penny-0.32.0.4: Extensible double-entry accounting system

Safe HaskellNone

Penny.Cabin.Balance.Convert

Description

The Convert report. This report converts all account balances to a single commodity, which must be specified.

Synopsis

Documentation

data Opts Source

Options for the Convert report. These are the only options you need to use if you are supplying options programatically (as opposed to parsing them in from the command line.)

Constructors

Opts 

Fields

format :: Either (Amount Qty -> Text) RoundTo

If you want a convert report that shows a single commodity, pass a Left showing how to display each amount. If you want a convert report that shows percentages, pass a Right here with how many places to round to.

showZeroBalances :: ShowZeroBalances
 
sorter :: Sorter
 
target :: To
 
dateTime :: DateTime
 
textFormats :: Changers
 

type Sorter = (SubAccount, BottomLine) -> (SubAccount, BottomLine) -> OrderingSource

How to sort each line of the report. Each subaccount has only one BottomLine (unlike in the MultiCommodity report, where each subaccount may have more than one BottomLine, one for each commodity.)

report :: Opts -> [PricePoint] -> [(a, Posting)] -> Either Text [Chunk]Source

The function for the Convert report. Use this function if you are setting the options from a program (as opposed to parsing them in from the command line.) Will fail if the balance conversions fail.

cmdLineReport :: DefaultOpts -> ReportSource

Creates a report respecting the standard interface for reports whose options are parsed in from the command line.

getSorter :: SortOrder -> SortBy -> SorterSource

Returns a function usable to sort pairs of SubAccount and BottomLine depending on how you want them sorted.