penny-lib-0.2.0.0: Extensible double-entry accounting system - library

Safe HaskellSafe-Infered

Penny.Cabin.Posts

Contents

Description

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).

Synopsis

Defaults

defaultPostsReport :: DefaultTimeZone -> RadGroup -> ReportSource

When applied to a DefaultTimeZone and a RadGroup, returns a report with the default options.

Custom report

customPostsReportSource

Arguments

:: (Runtime -> T)

Function that, when applied to a Runtime, returns the default options for the posts report. The options will be overridden by any options on the command line.

-> Report 

Generate a custom Posts report.

Options

data T Source

Constructors

T 

Fields

drCrColors :: DrCrColors

Colors to use when displaying debits, credits, and when displaying balance totals

baseColors :: BaseColors

Colors to use when displaying everything else

dateFormat :: Box -> Text

How to display dates. This function is applied to the a PostingInfo so it has lots of information, but it should return a date for use in the Date field.

qtyFormat :: Box -> Text

How to display the quantity of the posting. This function is applied to a PostingInfo so it has lots of information, but it should return a formatted string of the quantity. Allows you to format digit grouping, radix points, perform rounding, etc.

balanceFormat :: Commodity -> BottomLine -> Text

How to display balance totals. Similar to balanceFormat.

payeeAllocation :: Allocation

This and accountAllocation determine how much space payees and accounts receive. They divide up the remaining space after everything else is displayed. For instance if payeeAllocation is 60 and accountAllocation is 40, the payee takes about 60 percent of the remaining space and the account takes about 40 percent.

accountAllocation :: Allocation

See payeeAllocation above

width :: ReportWidth

Gives the default report width. This can be overridden on the command line. You can use the information from the Runtime to make this as wide as the as the current terminal.

subAccountLength :: Int

When shortening the names of sub accounts to make them fit, they will be this long.

colorPref :: Colors

How many colors you want to see, or do it automatically.

timeZone :: DefaultTimeZone

When dates and times are given on the command line and they have no time zone, they are assumed to be in this time zone. This has no bearing on how dates are formatted in the output; for that, see dateFormat above.

radGroup :: RadGroup

The characters used for the radix point for numbers given on the command line (e.g. a full stop, or a comma) and for the digit group separator for numbers parsed from the command line (e.g. a full stop, or a comma). Affects how inputs are parsed. Has no bearing on how output is formatted; for that, see qtyFormat and balanceFormat above.

sensitive :: CaseSensitive

Whether pattern matches are case sensitive by default.

factory :: CaseSensitive -> Text -> Exceptional Text (Text -> Bool)

Default factory for pattern matching

tokens :: [Token (Box LibertyMeta -> Bool)]

Default list of tokens used to filter postings.

postFilter :: [PostFilterFn]

The entire posting list is transformed by this function after it is filtered according to the tokens.

fields :: T Bool

Default fields to show in the report.

spacers :: T Int

Default width for spacer fields. If any of these Ints are less than or equal to zero, there will be no spacer. There is never a spacer for fields that do not appear in the report.

showZeroBalances :: ShowZeroBalances