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

Ledger.RawLedger

Description

A RawLedger is a parsed ledger file. We call it raw to distinguish from the cached Ledger.

Synopsis

Documentation

filterRawLedger :: DateSpan -> [String] -> Bool -> Bool -> RawLedger -> RawLedgerSource

Remove ledger entries we are not interested in. Keep only those which fall between the begin and end dates, and match the description pattern, and are cleared or real if those options are active.

filterRawLedgerEntriesByDescription :: [String] -> RawLedger -> RawLedgerSource

Keep only entries whose description matches the description patterns.

filterRawLedgerEntriesByDate :: DateSpan -> RawLedger -> RawLedgerSource

Keep only entries which fall between begin and end dates. We include entries on the begin date and exclude entries on the end date, like ledger. An empty date string means no restriction.

filterRawLedgerEntriesByClearedStatus :: Bool -> RawLedger -> RawLedgerSource

Keep only entries with cleared status, if the flag is true, otherwise do no filtering.

filterRawLedgerTransactionsByRealness :: Bool -> RawLedger -> RawLedgerSource

Strip out any virtual transactions, if the flag is true, otherwise do no filtering.

filterRawLedgerEntriesByAccount :: [String] -> RawLedger -> RawLedgerSource

Keep only entries which affect accounts matched by the account patterns.

canonicaliseAmounts :: Bool -> RawLedger -> RawLedgerSource

Give all a ledger's amounts their canonical display settings. That is, in each commodity, amounts will use the display settings of the first amount detected, and the greatest precision of the amounts detected. Also, amounts are converted to cost basis if that flag is active.

rawLedgerAmounts :: RawLedger -> [MixedAmount]Source

Get just the amounts from a ledger, in the order parsed.

rawLedgerCommodities :: RawLedger -> [Commodity]Source

Get just the ammount commodities from a ledger, in the order parsed.

rawLedgerPrecisions :: RawLedger -> [Int]Source

Get just the amount precisions from a ledger, in the order parsed.