hledger
Safe HaskellNone
LanguageGHC2021

Hledger.Cli.Commands.Print

Description

A ledger-compatible print command.

Synopsis

Documentation

print' :: CliOpts -> Journal -> IO () Source #

Print journal transactions in standard format.

journalApplyMatchOpt :: CliOpts -> Journal -> Journal Source #

With --match DESC, keep only the one recent transaction whose description is most similar to DESC, erroring if there is none. Otherwise, return the journal unchanged. XXX should match similarly to register --match

roundFromRawOpts :: RawOpts -> Maybe Rounding Source #

Get the --round option's value, if any. Can fail with a parse error.

amountStylesSetRoundingFromRawOpts :: RawOpts -> Map CommoditySymbol AmountStyle -> Map CommoditySymbol AmountStyle Source #

Set these amount styles' rounding strategy when they are being applied to amounts, according to the value of the --round option, if any.

layoutFlag :: Flag RawOpts Source #

The --layout flag for the print command, selecting how posting lines are aligned.

layoutFromRawOpts :: RawOpts -> PostingLayout Source #

Parse the --layout option. Defaults to defaultPostingLayout if absent. Errors with a clear message if the value is neither "hledger1" nor a positive integer.

transactionWithMostlyOriginalPostings :: Bool -> Transaction -> Transaction Source #

Replace this transaction's postings with the original postings if any, but keep the current possibly rewritten account names, and the inferred values of any auto postings. Drops postings tagged feesplitPostingTagName (synthetic fragments carved off other postings, eg by lot transfer auto-split), so the user sees their original entry. Postings tagged lotsplitPostingTagName (per-lot dispose/transfer split fragments) are retained, keeping their fragment pamount rather than reverting to poriginal — so 'print --lots' shows the per-lot detail, while journalCollapseLotDetail has already merged them down to one posting when --lots is off. With a true first argument, lot postings whose original amount had no cost basis annotation get the one inferred by lot processing (see withInferredBasis below). This is mainly for showing transactions with the amounts in their original journal format.