hledger-0.2: A ledger-compatible text-based accounting tool.

Ledger.Ledger

Description

A Ledger stores, for efficiency, a RawLedger plus its tree of account names, and a map from account names to Accounts. It may also have had uninteresting Entrys and Transactions filtered out.

Synopsis

Documentation

cacheLedger :: [String] -> RawLedger -> LedgerSource

Convert a raw ledger to a more efficient cached type, described above.

accountnames :: Ledger -> [AccountName]Source

List a ledger's account names.

ledgerAccount :: Ledger -> AccountName -> AccountSource

Get the named account from a ledger.

accounts :: Ledger -> [Account]Source

List a ledger's accounts, in tree order

topAccounts :: Ledger -> [Account]Source

List a ledger's top-level accounts, in tree order

accountsMatching :: [String] -> Ledger -> [Account]Source

Accounts in ledger whose name matches the pattern, in tree order.

subAccounts :: Ledger -> Account -> [Account]Source

List a ledger account's immediate subaccounts

ledgerTransactions :: Ledger -> [Transaction]Source

List a ledger's transactions.

ledgerAccountTree :: Int -> Ledger -> Tree AccountSource

Get a ledger's tree of accounts to the specified depth.

ledgerAccountTreeAt :: Ledger -> Account -> Maybe (Tree Account)Source

Get a ledger's tree of accounts rooted at the specified account.