hledger-lib
Safe HaskellNone
LanguageGHC2021

Hledger.Reports.PostingsReport

Description

Postings report, used by the register command.

Synopsis

Documentation

type PostingsReport = [PostingsReportItem] Source #

A postings report is a list of postings with a running total, and a little extra transaction info to help with rendering. This is used eg for the register command.

type PostingsReportItem = (Maybe Day, Maybe Period, Maybe Text, Posting, MixedAmount) Source #

postingsReport :: ReportSpec -> Journal -> PostingsReport Source #

Select postings from the journal and add running balance and other information to make a postings report. Used by eg hledger's register command.

postingsReportStartBalances :: ReportSpec -> Journal -> Map AccountName MixedAmount Source #

The account balances making up a postings report's starting balance: with --historical (and not --average), the sums of the matched postings before the report period, by account (depth-clipped as in the report). Otherwise, there is no starting balance, and this is empty. Useful for showing each account's historical running total, eg in charts.

mkpostingsReportItem :: Bool -> Bool -> WhichDate -> Maybe Period -> Posting -> MixedAmount -> PostingsReportItem Source #

Generate one postings report line item, containing the posting, the current running balance, and optionally the posting date and/or the transaction description.

registerRunningCalculationFn :: ReportOpts -> Int -> MixedAmount -> MixedAmount -> MixedAmount Source #

Based on the given report options, return a function that does the appropriate running calculation for the register report, ie a running average or running total. This function will take the item number, previous average/total, and new posting amount, and return the new average/total.

Tests

Orphan instances