2007-07-02 23:15:39 +04:00
|
|
|
module RawLedger
|
|
|
|
where
|
|
|
|
import qualified Data.Map as Map
|
|
|
|
|
|
|
|
import Utils
|
|
|
|
import Types
|
2007-07-03 03:41:07 +04:00
|
|
|
import AccountName
|
2007-07-02 23:15:39 +04:00
|
|
|
import Entry
|
|
|
|
import EntryTransaction
|
|
|
|
|
|
|
|
|
|
|
|
instance Show RawLedger where
|
|
|
|
show l = printf "RawLedger with %d entries"
|
|
|
|
((length $ entries l) +
|
|
|
|
(length $ modifier_entries l) +
|
|
|
|
(length $ periodic_entries l))
|
|
|
|
|
2007-07-02 23:39:34 +04:00
|
|
|
rawLedgerTransactions :: RawLedger -> [EntryTransaction]
|
|
|
|
rawLedgerTransactions l = entryTransactionsFrom $ entries l
|
|
|
|
|
|
|
|
rawLedgerAccountNamesUsed :: RawLedger -> [AccountName]
|
|
|
|
rawLedgerAccountNamesUsed l = accountNamesFromTransactions $ entryTransactionsFrom $ entries l
|
2007-07-02 23:15:39 +04:00
|
|
|
|
2007-07-02 23:39:34 +04:00
|
|
|
rawLedgerAccountNames :: RawLedger -> [AccountName]
|
|
|
|
rawLedgerAccountNames = sort . expandAccountNames . rawLedgerAccountNamesUsed
|
2007-07-02 23:15:39 +04:00
|
|
|
|
2007-07-02 23:39:34 +04:00
|
|
|
rawLedgerAccountNameTree :: RawLedger -> Tree AccountName
|
|
|
|
rawLedgerAccountNameTree l = accountNameTreeFrom $ rawLedgerAccountNames l
|
2007-07-02 23:15:39 +04:00
|
|
|
|
|
|
|
|
|
|
|
|