hledger-1.19.1: Command-line interface for the hledger accounting system

Safe Haskell | None
Language | Haskell2010

Hledger.Cli.CompoundBalanceCommand

Description

Common helpers for making multi-section balance report commands like balancesheet, cashflow, and incomestatement.

Synopsis

- data CompoundBalanceCommandSpec = CompoundBalanceCommandSpec {
  - cbcdoc :: CommandDoc
  - cbctitle :: String
  - cbcqueries :: [CBCSubreportSpec]
  - cbctype :: BalanceType
  }
- compoundBalanceCommandMode :: CompoundBalanceCommandSpec -> Mode RawOpts
- compoundBalanceCommand :: CompoundBalanceCommandSpec -> CliOpts -> Journal -> IO ()

# Documentation

data CompoundBalanceCommandSpec Source #

Description of a compound balance report command, from which we generate the command's cmdargs mode and IO action. A compound balance report command shows one or more sections/subreports, each with its own title and subtotals row, in a certain order, plus a grand totals row if there's more than one section. Examples are the balancesheet, cashflow and incomestatement commands.

Compound balance reports do sign normalisation: they show all account balances as normally positive, unlike the ordinary BalanceReport and most hledger commands which show incomeliabilityequity balances as normally negative. Each subreport specifies the normal sign of its amounts, and whether it should be added to or subtracted from the grand total.

Constructors

CompoundBalanceCommandSpec |

Fields

- cbcdoc :: CommandDoc

  the command's name(s) and documentation

- cbctitle :: String

  overall report title

- cbcqueries :: [CBCSubreportSpec]

  subreport details

- cbctype :: BalanceType

  the "balance" type (change, cumulative, historical) this report shows (overrides command line flags)

compoundBalanceCommandMode :: CompoundBalanceCommandSpec -> Mode RawOpts Source #

Generate a cmdargs option-parsing mode from a compound balance command specification.

compoundBalanceCommand :: CompoundBalanceCommandSpec -> CliOpts -> Journal -> IO () Source #

Generate a runnable command from a compound balance command specification.