hledger-0.8: A command-line (or curses or web-based) double-entry accounting tool.Source codeContentsIndex
Ledger.Transaction
Description
A Transaction represents a single balanced entry in the ledger file. It normally contains two or more balanced Postings.
Synopsis
nulltransaction :: Transaction
showTransaction :: Transaction -> String
showTransactionUnelided :: Transaction -> String
showTransactionForPrint :: Bool -> Transaction -> String
showTransaction' :: Bool -> Bool -> Transaction -> String
showAccountName :: Maybe Int -> PostingType -> AccountName -> String
isTransactionBalanced :: Transaction -> Bool
balanceTransaction :: Transaction -> Either String Transaction
ledgerTransactionWithDate :: WhichDate -> Transaction -> Transaction
txnTieKnot :: Transaction -> Transaction
settxn :: Transaction -> Posting -> Posting
Documentation
nulltransaction :: TransactionSource
showTransaction :: Transaction -> StringSource

Show a ledger entry, formatted for the print command. ledger 2.x's standard format looks like this:

yyyymmdd[ *][ CODE] description.........          [  ; comment...............]
    account name 1.....................  ...$amount1[  ; comment...............]
    account name 2.....................  ..$-amount1[  ; comment...............]

pcodewidth    = no limit -- 10          -- mimicking ledger layout.
pdescwidth    = no limit -- 20          -- I don't remember what these mean,
pacctwidth    = 35 minimum, no maximum  -- they were important at the time.
pamtwidth     = 11
pcommentwidth = no limit -- 22
showTransactionUnelided :: Transaction -> StringSource
showTransactionForPrint :: Bool -> Transaction -> StringSource
showTransaction' :: Bool -> Bool -> Transaction -> StringSource
showAccountName :: Maybe Int -> PostingType -> AccountName -> StringSource
Show an account name, clipped to the given width if any, and appropriately bracketed/parenthesised for the given posting type.
isTransactionBalanced :: Transaction -> BoolSource
balanceTransaction :: Transaction -> Either String TransactionSource
Ensure that this entry is balanced, possibly auto-filling a missing amount first. We can auto-fill if there is just one non-virtual transaction without an amount. The auto-filled balance will be converted to cost basis if possible. If the entry can not be balanced, return an error message instead.
ledgerTransactionWithDate :: WhichDate -> Transaction -> TransactionSource
Convert the primary date to either the actual or effective date.
txnTieKnot :: Transaction -> TransactionSource
Ensure a transaction's postings refer back to it.
settxn :: Transaction -> Posting -> PostingSource
Set a posting's parent transaction.
Produced by Haddock version 2.6.0