hledger/RawLedger.hs

32 lines
885 B
Haskell
Raw Normal View History

module RawLedger
where
import qualified Data.Map as Map
import Utils
import Types
2007-07-03 03:41:07 +04:00
import AccountName
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:39:34 +04:00
rawLedgerAccountNames :: RawLedger -> [AccountName]
rawLedgerAccountNames = sort . expandAccountNames . rawLedgerAccountNamesUsed
2007-07-02 23:39:34 +04:00
rawLedgerAccountNameTree :: RawLedger -> Tree AccountName
rawLedgerAccountNameTree l = accountNameTreeFrom $ rawLedgerAccountNames l