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

Safe HaskellNone
LanguageHaskell2010

Hledger.Reports.TransactionsReports

Description

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.

Synopsis

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 AccountTransactionsReport = (String, [AccountTransactionsReportItem]) Source

An account transactions report represents transactions affecting a particular account (or possibly several accounts, but we don't use that). It is used by hledger-web's (and hledger-ui's) account register view, where we want to show one row per journal transaction, with:

  • the total increase/decrease to the current account
  • the names of the other account(s) posted to/from
  • transaction dates, adjusted to the date of the earliest posting to the current account if those postings have their own dates

Currently, reporting intervals are not supported, and report items are most recent first.

triOrigTransaction :: (t, t1, t2, t3, t4, t5) -> t Source

triDate :: (t, Transaction, t1, t2, t3, t4) -> Day Source

triAmount :: (t, t1, t2, t3, t4, t5) -> t4 Source

triBalance :: (t, t1, t2, t3, t4, t5) -> t5 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.

transactionsReportByCommodity :: TransactionsReport -> [(Commodity, TransactionsReport)] Source

Split a transactions report whose items may involve several commodities, into one or more single-commodity transactions reports.