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

Safe HaskellNone
LanguageHaskell2010

Hledger.Reports.MultiBalanceReports

Description

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

Synopsis

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 period (date span)
  2. a list of rows, each containing:
  • the full account name
  • the leaf account name
  • the account's depth
  • a list of amounts, one for 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.Commands.Balance).

Constructors

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

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. Does not support tree-mode boring parent eliding. If the normalbalance_ option is set, it adjusts the sorting and sign of amounts (see ReportOpts and CompoundBalanceCommand).

balanceReportFromMultiBalanceReport :: ReportOpts -> Query -> Journal -> BalanceReport Source #

Generates a simple non-columnar BalanceReport, but using multiBalanceReport, in order to support --historical. Does not support tree-mode boring parent eliding. If the normalbalance_ option is set, it adjusts the sorting and sign of amounts (see ReportOpts and CompoundBalanceCommand).

mbrNegate :: MultiBalanceReport -> MultiBalanceReport Source #

Flip the sign of all amounts in a MultiBalanceReport.

mbrNormaliseSign :: NormalSign -> MultiBalanceReport -> MultiBalanceReport Source #

Given a MultiBalanceReport and its normal balance sign, if it is known to be normally negative, convert it to normally positive.

multiBalanceReportSpan :: MultiBalanceReport -> DateSpan Source #

Figure out the overall date span of a multicolumn balance report.