Safe Haskell | None |
---|
The Penny Postings report
The Postings report displays postings in a tabular format designed to be read by humans. Some terminology used in the Postings report:
row
- The smallest unit that spans from left to right. A row, however, might consist of more than one screen line. For example, the running balance is shown on the far right side of the Postings report. The running balance might consist of more than one commodity. Each commodity is displayed on its own screen line. However, all these lines put together are displayed in a single row.
column
- The smallest unit that spans from top to bottom.
tranche
- Each posting is displayed in several rows. The group of rows that is displayed for a single posting is called a tranche.
tranche row
- Each tranche has a particular number of rows (currently four); each of these rows is known as a tranche row.
field
- Corresponds to a particular element of the posting, such as whether it is a debit or credit or its payee. The user can select which fields to see.
allocation
- The width of the Payee and Account fields is variable. Generally their width will adjust to fill the entire width of the screen. The allocations of the Payee and Account fields determine how much of the remaining space each field will receive.
The Postings report is easily customized from the command line to show various fields. However, the order of the fields is not configurable without editing the source code (sorry).
- postsReport :: ShowZeroBalances -> Pdct (Box LibertyMeta) -> [PostFilterFn] -> ChunkOpts -> [Box LibertyMeta] -> [PreChunk]
- zincReport :: ZincOpts -> Report
- defaultOptions :: Runtime -> ZincOpts
- data ZincOpts = ZincOpts {
- fields :: Fields Bool
- width :: ReportWidth
- showZeroBalances :: ShowZeroBalances
- dateFormat :: Box -> Text
- qtyFormat :: Box -> Text
- balanceFormat :: Commodity -> Qty -> Text
- subAccountLength :: SubAccountLength
- payeeAllocation :: Alloc
- accountAllocation :: Alloc
- spacers :: Spacers Int
- data Alloc
- newtype SubAccountLength = SubAccountLength {}
- alloc :: Int -> Alloc
- yearMonthDay :: Box -> Text
- qtyAsIs :: Box -> Text
- balanceAsIs :: a -> Qty -> Text
- defaultWidth :: ReportWidth
- columnsVarToWidth :: Maybe String -> ReportWidth
- widthFromRuntime :: Runtime -> ReportWidth
- defaultFields :: Fields Bool
- defaultSpacerWidth :: Spacers Int
- newtype ReportWidth = ReportWidth {
- unReportWidth :: Int
Documentation
:: ShowZeroBalances | |
-> Pdct (Box LibertyMeta) | Removes posts from the report if applying this function to the post returns False. Posts removed still affect the running balance. |
-> [PostFilterFn] | Applies these post-filters to the list of posts that results from applying the predicate above. Might remove more postings. Postings removed still affect the running balance. |
-> ChunkOpts | |
-> [Box LibertyMeta] | |
-> [PreChunk] |
All information needed to make a Posts report. This function never fails.
zincReport :: ZincOpts -> ReportSource
All the information to configure the postings report if the options will be parsed in from the command line.
ZincOpts | |
|
yearMonthDay :: Box -> TextSource
Shows the date of a posting in YYYY-MM-DD format.
Shows the quantity of a posting. Does no rounding or prettification; simply uses show on the underlying Decimal.
balanceAsIs :: a -> Qty -> TextSource
Shows the quantity of a balance. If there is no quantity, shows two dashes.
defaultWidth :: ReportWidthSource
The default width for the report.
columnsVarToWidth :: Maybe String -> ReportWidthSource
Applied to the value of the COLUMNS environment variable, returns an appropriate ReportWidth.
widthFromRuntime :: Runtime -> ReportWidthSource
Given the Runtime, use the defaultWidth given above to calculate the report's width if COLUMNS does not yield a value. Otherwise, use what is in COLUMNS.
defaultFields :: Fields BoolSource
Default fields to show in the Postings report.
defaultSpacerWidth :: Spacers IntSource
Default width of spacers; most are one character wide, but the spacer after payee is 4 characters wide.