Safe Haskell | None |
---|---|
Language | Haskell2010 |
Here are several variants of a transactions report. Transactions reports are like a postings report, but more transaction-oriented, and (in the account-centric variant) relative to a some base account. They are used by hledger-web.
- type TransactionsReport = (String, [TransactionsReportItem])
- type TransactionsReportItem = (Transaction, Transaction, Bool, String, MixedAmount, MixedAmount)
- triOrigTransaction :: (t, t1, t2, t3, t4, t5) -> t
- triDate :: (t, Transaction, t1, t2, t3, t4) -> Day
- triAmount :: (t, t1, t2, t3, t4, t5) -> t4
- triBalance :: (t, t1, t2, t3, t4, t5) -> t5
- triCommodityAmount :: Commodity -> (t, t1, t2, t3, MixedAmount, t4) -> MixedAmount
- triCommodityBalance :: Commodity -> (t, t1, t2, t3, t4, MixedAmount) -> MixedAmount
- journalTransactionsReport :: ReportOpts -> Journal -> Query -> TransactionsReport
- accountTransactionsReport :: ReportOpts -> Journal -> Query -> Query -> AccountTransactionsReport
- transactionsReportByCommodity :: TransactionsReport -> [(Commodity, TransactionsReport)]
Documentation
type TransactionsReport = (String, [TransactionsReportItem]) Source
A transactions report includes a list of transactions (posting-filtered and unfiltered variants), a running balance, and some other information helpful for rendering a register view (a flag indicating multiple other accounts and a display string describing them) with or without a notion of current account(s). Two kinds of report use this data structure, see journalTransactionsReport and accountTransactionsReport below for detais.
type TransactionsReportItem = (Transaction, Transaction, Bool, String, MixedAmount, MixedAmount) Source
triOrigTransaction :: (t, t1, t2, t3, t4, t5) -> t Source
triDate :: (t, Transaction, t1, t2, t3, t4) -> Day Source
triBalance :: (t, t1, t2, t3, t4, t5) -> t5 Source
triCommodityAmount :: Commodity -> (t, t1, t2, t3, MixedAmount, t4) -> MixedAmount Source
triCommodityBalance :: Commodity -> (t, t1, t2, t3, t4, MixedAmount) -> MixedAmount Source
journalTransactionsReport :: ReportOpts -> Journal -> Query -> TransactionsReport Source
Select transactions from the whole journal. This is similar to a "postingsReport" except with transaction-based report items which are ordered most recent first. XXX Or an EntriesReport - use that instead ? This is used by hledger-web's journal view.
accountTransactionsReport :: ReportOpts -> Journal -> Query -> Query -> AccountTransactionsReport Source
transactionsReportByCommodity :: TransactionsReport -> [(Commodity, TransactionsReport)] Source
Split a transactions report whose items may involve several commodities, into one or more single-commodity transactions reports.