hledger-lib-0.23: Core data types, parsers and utilities for the hledger accounting tool.

Safe HaskellNone

Hledger.Reports.ReportOptions

Description

Options common to most hledger reports.

Synopsis

Documentation

data ReportOpts Source

Standard options for customising report filtering and output, corresponding to hledger's command-line options and query language arguments. Used in hledger-lib and above.

data BalanceType Source

Which balance is being shown in a multi-column balance report.

Constructors

PeriodBalance

The change of balance in each period.

CumulativeBalance

The accumulated balance at each period's end, starting from zero at the report start date.

HistoricalBalance

The historical balance at each period's end, starting from the account balances at the report start date.

dateSpanFromOpts :: Day -> ReportOpts -> DateSpanSource

Figure out the date span we should report on, based on any beginendperiod options provided. A period option will cause begin and end options to be ignored.

intervalFromOpts :: ReportOpts -> IntervalSource

Figure out the reporting interval, if any, specified by the options. --period overrides --daily overrides --weekly overrides --monthly etc.

clearedValueFromOpts :: ReportOpts -> Maybe BoolSource

Get a maybe boolean representing the last cleared/uncleared option if any.

whichDateFromOpts :: ReportOpts -> WhichDateSource

Report which date we will report on based on --date2.

journalSelectingAmountFromOpts :: ReportOpts -> Journal -> JournalSource

Convert this journal's postings' amounts to the cost basis amounts if specified by options.

queryFromOpts :: Day -> ReportOpts -> QuerySource

Convert report options and arguments to a query.

queryFromOptsOnly :: Day -> ReportOpts -> QuerySource

Convert report options to a query, ignoring any non-flag command line arguments.

queryOptsFromOpts :: Day -> ReportOpts -> [QueryOpt]Source

Convert report options and arguments to query options.

transactionDateFn :: ReportOpts -> Transaction -> DaySource

Select the Transaction date accessor based on --date2.

postingDateFn :: ReportOpts -> Posting -> DaySource

Select the Posting date accessor based on --date2.