hledger-lib-1.3: Core data types, parsers and functionality for the hledger accounting tools

Safe Haskell | None
Language | Haskell2010

Hledger.Reports.MultiBalanceReports

Description

Multi-column balance reports, used by the balance command.

Synopsis

- newtype MultiBalanceReport = MultiBalanceReport ([DateSpan], [MultiBalanceReportRow], MultiBalanceReportTotals)
- type MultiBalanceReportRow = (AccountName, AccountName, Int, [MixedAmount], MixedAmount, MixedAmount)
- multiBalanceReport :: ReportOpts -> Query -> Journal -> MultiBalanceReport
- multiBalanceReportValue :: Journal -> Day -> MultiBalanceReport -> MultiBalanceReport
- singleBalanceReport :: ReportOpts -> Query -> Journal -> BalanceReport

# Documentation

newtype MultiBalanceReport #

A multi balance report is a balance report with one or more columns. It has:

1. a list of each column's period (date span)
2. a list of row items, each containing:

- the full account name
- the leaf account name
- the account's depth
- the amounts to show in each column
- the total of the row's amounts
- the average of the row's amounts

1. the column totals and the overall total and average

The meaning of the amounts depends on the type of multi balance report, of which there are three: periodic, cumulative and historical (see `BalanceType` and Hledger.Cli.Balance).

Constructors

MultiBalanceReport ([DateSpan], [MultiBalanceReportRow], MultiBalanceReportTotals) |

Instances

Show MultiBalanceReport # |
Methods showsPrec :: Int -> MultiBalanceReport -> ShowS # show :: MultiBalanceReport -> String # showList :: [MultiBalanceReport] -> ShowS #

type MultiBalanceReportRow = (AccountName, AccountName, Int, [MixedAmount], MixedAmount, MixedAmount) #

multiBalanceReport :: ReportOpts -> Query -> Journal -> MultiBalanceReport #

Generate a multicolumn balance report for the matched accounts, showing the change of balance, accumulated balance, or historical balance in each of the specified periods.

multiBalanceReportValue :: Journal -> Day -> MultiBalanceReport -> MultiBalanceReport #

Convert all the amounts in a multi-column balance report to their value on the given date in their default valuation commodities (which are determined as of that date, not the report interval dates).

singleBalanceReport :: ReportOpts -> Query -> Journal -> BalanceReport #

Generates a single column BalanceReport like balanceReport, but uses multiBalanceReport, so supports --historical. TODO Does not support boring parent eliding or --flat yet.