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

Safe Haskell | None
Language | Haskell2010

Hledger.Cli.Commands.Register

Description

A ledger-compatible `register` command.

Synopsis

- registermode :: Mode RawOpts
- register :: CliOpts -> Journal -> IO ()
- postingsReportAsText :: CliOpts -> PostingsReport -> Text
- postingsReportItemAsText :: CliOpts -> Int -> Int -> (PostingsReportItem, [WideBuilder], [WideBuilder]) -> Builder
- tests_Register :: TestTree

# Documentation

registermode :: Mode RawOpts #

register :: CliOpts -> Journal -> IO () #

Print a (posting) register report.

postingsReportAsText :: CliOpts -> PostingsReport -> Text #

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

postingsReportItemAsText :: CliOpts -> Int -> Int -> (PostingsReportItem, [WideBuilder], [WideBuilder]) -> Builder #

Render one register report line item as plain text. Layout is like so: `width (specified, terminal width, or 80) -------------------- date (10) description account amount (12) balance (12) DDDDDDDDDD dddddddddddddddddddd aaaaaaaaaaaaaaaaaaa AAAAAAAAAAAA AAAAAAAAAAAA` If description's width is specified, account will use the remaining space. Otherwise, description and account divide up the space equally.

With a report interval, the layout is like so: `width (specified, terminal width, or 80) -------------------- date (21) account amount (12) balance (12) DDDDDDDDDDDDDDDDDDDDD aaaaaaaaaaaaaaaaaaaaaaaaaaaaa AAAAAAAAAAAA AAAAAAAAAAAA`

date and description are shown for the first posting of a transaction only.

Returns a string which can be multi-line, eg if the running balance has multiple commodities. Does not yet support formatting control like balance reports.

Also returns the natural width (without padding) of the amount and balance fields.

tests_Register :: TestTree #