hledger-1.3: Command-line interface for the hledger accounting tool

Safe Haskell | None
Language | Haskell2010

Hledger.Cli.Register

Description

A ledger-compatible `register` command.

Synopsis

- registermode :: Mode RawOpts
- register :: CliOpts -> Journal -> IO ()
- postingsReportAsText :: CliOpts -> PostingsReport -> String
- postingsReportItemAsText :: CliOpts -> Int -> Int -> PostingsReportItem -> String
- tests_Hledger_Cli_Register :: Test

# Documentation

registermode :: Mode RawOpts #

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

Print a (posting) register report.

postingsReportAsText :: CliOpts -> PostingsReport -> String #

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

postingsReportItemAsText :: CliOpts -> Int -> Int -> PostingsReportItem -> String #

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.

tests_Hledger_Cli_Register :: Test #