hledger-lib-1.41: A library providing the core functionality of hledger

Safe Haskell | None
Language | Haskell2010

Hledger.Reports.BudgetReport

Contents

- Helpers
- Tests

Synopsis

- type BudgetGoal = Change
- type BudgetTotal = Total
- type BudgetAverage = Average
- type BudgetCell = (Maybe Change, Maybe BudgetGoal)
- type BudgetReportRow = PeriodicReportRow DisplayName BudgetCell
- type BudgetReport = PeriodicReport DisplayName BudgetCell
- budgetReport :: ReportSpec -> BalancingOpts -> DateSpan -> Journal -> BudgetReport
- combineBudgetAndActual :: ReportOpts -> Journal -> MultiBalanceReport -> MultiBalanceReport -> BudgetReport
- tests_BudgetReport :: TestTree

# Documentation

type BudgetGoal = Change #

type BudgetTotal = Total #

type BudgetAverage = Average #

type BudgetCell = (Maybe Change, Maybe BudgetGoal) #

A budget report tracks expected and actual changes per account and subperiod. Each table cell has an actual change amount and/or a budget goal amount.

type BudgetReportRow = PeriodicReportRow DisplayName BudgetCell #

A row in a budget report table - account name and data cells.

type BudgetReport = PeriodicReport DisplayName BudgetCell #

A full budget report table.

budgetReport :: ReportSpec -> BalancingOpts -> DateSpan -> Journal -> BudgetReport #

Calculate per-account, per-period budget (balance change) goals from all periodic transactions, calculate actual balance changes from the regular transactions, and compare these to get a `BudgetReport`. Unbudgeted accounts may be hidden or renamed (see journalWithBudgetAccountNames).

# Helpers

combineBudgetAndActual :: ReportOpts -> Journal -> MultiBalanceReport -> MultiBalanceReport -> BudgetReport #

Combine a per-account-and-subperiod report of budget goals, and one of actual change amounts, into a budget performance report. The two reports should have the same report interval, but need not have exactly the same account rows or date columns. (Cells in the combined budget report can be missing a budget goal, an actual amount, or both.) The combined report will include:

- consecutive subperiods at the same interval as the two reports, spanning the period of both reports
- all accounts mentioned in either report, sorted by account code or account name or amount as appropriate.

# Tests

tests_BudgetReport :: TestTree #