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

Safe Haskell | Safe-Inferred
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 Source #

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

Print a (posting) register report.

postingsReportAsText :: CliOpts -> PostingsReport -> Text Source #

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

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

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 Source #