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

Safe HaskellNone





type BudgetCell = (Maybe Change, Maybe BudgetGoal) Source #

A budget report tracks expected and actual changes per account and subperiod.

budgetReport :: ReportOpts -> Bool -> DateSpan -> Day -> Journal -> BudgetReport Source #

Calculate budget goals from all periodic transactions, actual balance changes from the regular transactions, and compare these to get a BudgetReport. Unbudgeted accounts may be hidden or renamed (see budgetRollup).

sortBudgetReport :: ReportOpts -> Journal -> BudgetReport -> BudgetReport Source #

Sort a budget report's rows according to options.

budgetJournal :: Bool -> ReportOpts -> DateSpan -> Journal -> Journal Source #

Use all periodic transactions in the journal to generate budget transactions in the specified report period. Budget transactions are similar to forecast transactions except their purpose is to set goal amounts (of change) per account and period.

budgetRollUp :: [AccountName] -> Bool -> Journal -> Journal Source #

Adjust a journal's account names for budget reporting, in two ways:

  1. accounts with no budget goal anywhere in their ancestry are moved under the "unbudgeted" top level account.
  2. subaccounts with no budget goal are merged with their closest parent account with a budget goal, so that only budgeted accounts are shown. This can be disabled by --empty.

combineBudgetAndActual :: MultiBalanceReport -> MultiBalanceReport -> BudgetReport Source #

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.

budgetReportSpan :: BudgetReport -> DateSpan Source #

Figure out the overall period of a BudgetReport.

budgetReportAsText :: ReportOpts -> BudgetReport -> String Source #

Render a budget report as plain text suitable for console output.

maybeAccountNameDrop :: ReportOpts -> AccountName -> AccountName Source #

Drop leading components of accounts names as specified by --drop, but only in --flat mode.