Safe Haskell | None |
---|
Penny - extensible double-entry accounting system
- data Defaults = Defaults {
- caseSensitive :: Bool
- matcher :: Matcher
- colorToFile :: Bool
- expressionType :: ExprDesc
- defaultScheme :: Maybe Scheme
- additionalSchemes :: [Scheme]
- sorter :: [(SortField, SortOrder)]
- balanceFormat :: Commodity -> Qty -> Text
- balanceShowZeroBalances :: Bool
- balanceOrder :: SortOrder
- convertShowZeroBalances :: Bool
- convertTarget :: Target
- convertOrder :: SortOrder
- convertSortBy :: SortBy
- convertFormat :: Commodity -> Qty -> Text
- postingsFields :: Fields Bool
- postingsWidth :: Int
- postingsShowZeroBalances :: Bool
- postingsDateFormat :: Box -> Text
- postingsQtyFormat :: Box -> Text
- postingsBalanceFormat :: Commodity -> Qty -> Text
- postingsSubAccountLength :: Int
- postingsPayeeAllocation :: Int
- postingsAccountAllocation :: Int
- postingsSpacers :: Spacers Int
- data Matcher
- data Scheme = Scheme {}
- type Changers = Labels (EvenAndOdd (Chunk -> Chunk))
- data Labels a = Labels {}
- data EvenAndOdd a = EvenAndOdd {}
- module System.Console.Rainbow
- data SortField
- = Payee
- | Date
- | Flag
- | Number
- | Account
- | DrCr
- | Qty
- | Commodity
- | PostingMemo
- | TransactionMemo
- data SortOrder
- = Ascending
- | Descending
- data ExprDesc
- defaultQtyFormat :: Qty -> Text
- data Target
- data SortBy
- = SortByQty
- | SortByName
- type Box = Box PostMeta
- data Fields a = Fields {
- fGlobalTransaction :: a
- fRevGlobalTransaction :: a
- fGlobalPosting :: a
- fRevGlobalPosting :: a
- fFileTransaction :: a
- fRevFileTransaction :: a
- fFilePosting :: a
- fRevFilePosting :: a
- fFiltered :: a
- fRevFiltered :: a
- fSorted :: a
- fRevSorted :: a
- fVisible :: a
- fRevVisible :: a
- fLineNum :: a
- fDate :: a
- fFlag :: a
- fNumber :: a
- fPayee :: a
- fAccount :: a
- fPostingDrCr :: a
- fPostingCmdty :: a
- fPostingQty :: a
- fTotalDrCr :: a
- fTotalCmdty :: a
- fTotalQty :: a
- fTags :: a
- fMemo :: a
- fFilename :: a
- data Spacers a = Spacers {
- sGlobalTransaction :: a
- sRevGlobalTransaction :: a
- sGlobalPosting :: a
- sRevGlobalPosting :: a
- sFileTransaction :: a
- sRevFileTransaction :: a
- sFilePosting :: a
- sRevFilePosting :: a
- sFiltered :: a
- sRevFiltered :: a
- sSorted :: a
- sRevSorted :: a
- sVisible :: a
- sRevVisible :: a
- sLineNum :: a
- sDate :: a
- sFlag :: a
- sNumber :: a
- sPayee :: a
- sAccount :: a
- sPostingDrCr :: a
- sPostingCmdty :: a
- sPostingQty :: a
- sTotalDrCr :: a
- sTotalCmdty :: a
- widthFromRuntime :: Runtime -> Int
- yearMonthDay :: Box -> Text
- qtyAsIs :: Box -> Text
- balanceAsIs :: a -> Qty -> Text
- data Runtime
- environment :: Runtime -> [(String, String)]
- data Text
- pack :: String -> Text
- runPenny :: (Runtime -> Defaults) -> IO ()
Building a custom Penny binary
Everything you need to create a custom Penny program is available by importing only this module.
This type contains settings for all the reports, as well as default settings for the global options. Some of these can be overridden on the command line.
Defaults | |
|
Color schemes
module System.Console.Rainbow
Sorting
Expression type
Formatting quantities
defaultQtyFormat :: Qty -> TextSource
Convert report options
The commodity to which to convert the commodities in the convert report.
AutoTarget | Selects a target commodity automatically, based on which commodity is the most common target commodity in the prices in your ledger files. If there is a tie for most common target commodity, the target that appears later in your ledger files is used. |
ManualTarget String | Always uses the commodity named by the string given. |
Postings report options
Fields | |
|
Spacers | |
|
widthFromRuntime :: Runtime -> IntSource
Gets the current screen width from the runtime. If the COLUMNS environment variable is not set, uses 80.
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.
Runtime
environment :: Runtime -> [(String, String)]Source
Text
data Text
A space efficient, packed, unboxed Unicode text type.
Eq Text | |
Data Text | |
Ord Text | |
Read Text | |
Show Text | |
Typeable Text | |
IsString Text | |
Monoid Text | |
NFData Text | |
Mod Text | When used as a modifier, a Text will replace the text within a Chunk with new text. {-# LANGUAGE OverloadedStrings #-} goodbyeWorld :: Chunk goodbyeWorld = plain "Hello world!" +.+ "Goodbye world!" |
HasText Text | |
Monad m => Stream Text m Char |
Main function
:: (Runtime -> Defaults) | runPenny will apply this function to the Runtime. This way the defaults you use can vary depending on environment variables, the terminal type, the date, etc. |
-> IO () |
Creates an IO action that you can use for the main function.
Developer overview
Penny is organized into a tree of modules, each with a name. Check out the links for details on each component of Penny.
Penny.Brenner - Penny financial institution transaction handling. Depends on Lincoln and Copper.
Penny.Cabin - Penny reports. Depends on Lincoln and Liberty.
Penny.Copper - the Penny parser. Depends on Lincoln.
Penny.Liberty - Penny command line parser helpers. Depends on Lincoln and Copper.
Penny.Lincoln - the Penny core. Depends on no other Penny components.
Penny.Shield - the Penny runtime environment. Depends on Lincoln.
Penny.Steel - independent utilities. Depends on no other Penny components.
Penny.Wheat - tools to use with Penny.Steel.Prednote. Depends on Steel, Lincoln, and Copper.
Penny.Zinc - the Penny command-line interface. Depends on Cabin, Copper, Liberty, and Lincoln.
The dependencies are represented as a dot file in bindocdependencies.dot in the Penny git repository.