hledger-lib-0.26: Core data types, parsers and utilities for the hledger accounting tool.

Safe Haskell | None
Language | Haskell2010

Hledger.Reports.MultiBalanceReports

Description

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

Synopsis

- newtype MultiBalanceReport = MultiBalanceReport ([DateSpan], [MultiBalanceReportRow], MultiBalanceTotalsRow)
- type MultiBalanceReportRow = (RenderableAccountName, [MixedAmount], MixedAmount, MixedAmount)
- multiBalanceReport :: ReportOpts -> Query -> Journal -> MultiBalanceReport

# Documentation

newtype MultiBalanceReport Source

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

1. a list of each column's date span
2. a list of rows, each containing a renderable account name and the amounts to show in each column
3. a list of each column's final total

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], MultiBalanceTotalsRow) |

Instances

Show MultiBalanceReport Source |

type MultiBalanceReportRow = (RenderableAccountName, [MixedAmount], MixedAmount, MixedAmount) Source

A row in a multi balance report has

- An account name, with rendering hints
- A list of amounts to be shown in each of the report's columns.
- The total of the row amounts.
- The average of the row amounts.

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

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.