Source codeContentsIndex
Hledger.Cli.Commands.Register
Description
A ledger-compatible register command.
Synopsis
type RegisterReport = [RegisterReportItem]
type RegisterReportItem = (Maybe (Day, String), Posting, MixedAmount)
register :: [Opt] -> [String] -> Journal -> IO ()
registerReportAsText :: [Opt] -> RegisterReport -> String
registerReportItemAsText :: [Opt] -> RegisterReportItem -> String
registerReport :: [Opt] -> FilterSpec -> Journal -> RegisterReport
getitems :: [Posting] -> Posting -> MixedAmount -> [RegisterReportItem]
mkitem :: Bool -> Posting -> MixedAmount -> RegisterReportItem
postingsMatchingDisplayExpr :: Maybe String -> [Posting] -> ([Posting], [Posting], [Posting])
displayExprMatches :: Maybe String -> Posting -> Bool
datedisplayexpr :: GenParser Char st (Posting -> Bool)
summarisePostingsByInterval :: Interval -> Maybe Int -> Bool -> DateSpan -> [Posting] -> [Posting]
summarisePostingsInDateSpan :: DateSpan -> Maybe Int -> Bool -> [Posting] -> [Posting]
depthClipPostings :: Maybe Int -> [Posting] -> [Posting]
depthClipPosting :: Maybe Int -> Posting -> Posting
tests_Register :: Test
Documentation
type RegisterReport = [RegisterReportItem]Source
A register report is a list of postings to an account or set of accounts, with a running total. Postings may be actual postings, or virtual postings aggregated over a reporting interval.
type RegisterReportItem = (Maybe (Day, String), Posting, MixedAmount)Source
The data for a single register report line item, representing one posting.
register :: [Opt] -> [String] -> Journal -> IO ()Source
Print a register report.
registerReportAsText :: [Opt] -> RegisterReport -> StringSource
Render a register report as plain text suitable for console output.
registerReportItemAsText :: [Opt] -> RegisterReportItem -> StringSource
Render one register report line item as plain text. Eg: date (10) description (20) account (22) amount (11) balance (12) DDDDDDDDDD dddddddddddddddddddd aaaaaaaaaaaaaaaaaaaaaa AAAAAAAAAAA AAAAAAAAAAAA ^ displayed for first postings^ only, otherwise blank
registerReport :: [Opt] -> FilterSpec -> Journal -> RegisterReportSource
Get a register report with the specified options for this journal.
getitems :: [Posting] -> Posting -> MixedAmount -> [RegisterReportItem]Source
Generate register report line items.
mkitem :: Bool -> Posting -> MixedAmount -> RegisterReportItemSource
Generate one register report line item, from a flag indicating whether to include transaction info, a posting, and the current running balance.
postingsMatchingDisplayExpr :: Maybe String -> [Posting] -> ([Posting], [Posting], [Posting])Source
Date-sort and split a list of postings into three spans - postings matched by the given display expression, and the preceding and following postings.
displayExprMatches :: Maybe String -> Posting -> BoolSource
Does this display expression allow this posting to be displayed ? Raises an error if the display expression can't be parsed.
datedisplayexpr :: GenParser Char st (Posting -> Bool)Source
Parse a hledger display expression, which is a simple date test like d>[DATE] or d<=[DATE], and return a Posting-matching predicate.
summarisePostingsByInterval :: Interval -> Maybe Int -> Bool -> DateSpan -> [Posting] -> [Posting]Source
Convert a list of postings into summary postings. Summary postings are one per account per interval and aggregated to the specified depth if any.
summarisePostingsInDateSpan :: DateSpan -> Maybe Int -> Bool -> [Posting] -> [Posting]Source

Given a date span (representing a reporting interval) and a list of postings within it: aggregate the postings so there is only one per account, and adjust their date/description so that they will render as a summary for this interval.

As usual with date spans the end date is exclusive, but for display purposes we show the previous day as end date, like ledger.

When a depth argument is present, postings to accounts of greater depth are aggregated where possible.

The showempty flag includes spans with no postings and also postings with 0 amount.

depthClipPostings :: Maybe Int -> [Posting] -> [Posting]Source
Clip the account names to the specified depth in a list of postings.
depthClipPosting :: Maybe Int -> Posting -> PostingSource
Clip a posting's account name to the specified depth.
tests_Register :: TestSource
Produced by Haddock version 2.6.1