Safe Haskell | None |
---|
Penny - extensible double-entry accounting system
- data Defaults = Defaults {
- caseSensitive :: Bool
- matcher :: Matcher
- colorToFile :: Bool
- 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 TextSpecs = Labels (EvenAndOdd TextSpec)
- data Labels a = Labels {}
- data EvenAndOdd a = EvenAndOdd {}
- switchForeground :: Foreground8 -> Foreground256 -> TextSpec -> TextSpec
- switchBackground :: Background8 -> Background256 -> TextSpec -> TextSpec
- module Penny.Cabin.Chunk
- data SortField
- = Payee
- | Date
- | Flag
- | Number
- | Account
- | DrCr
- | Qty
- | Commodity
- | PostingMemo
- | TransactionMemo
- data SortOrder
- = Ascending
- | Descending
- 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
type TextSpecs = Labels (EvenAndOdd TextSpec)Source
switchForeground :: Foreground8 -> Foreground256 -> TextSpec -> TextSpecSource
Switch the foreground colors for new ones.
switchBackground :: Background8 -> Background256 -> TextSpec -> TextSpecSource
Switch the background colors for new ones.
module Penny.Cabin.Chunk
Sorting
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.
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.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.