 | hledger-lib-0.14: Reusable types and utilities for the hledger accounting tool and financial apps in general. | Source code | Contents | Index |
|
|
|
Description |
Most data types are defined here to avoid import cycles.
Here is an overview of the hledger data model:
Journal -- a journal is derived from one or more data files. It contains..
[Transaction] -- journal transactions, which have date, status, code, description and..
[Posting] -- multiple account postings (entries), which have account name and amount.
[HistoricalPrice] -- historical commodity prices
Ledger -- a ledger is derived from a journal, by applying a filter specification and doing some further processing. It contains..
Journal -- the filtered journal, containing only the transactions and postings we are interested in
Tree AccountName -- account names referenced in the journal's transactions, as a tree
Map AccountName Account -- per-account postings and balances from the journal's transactions, as a map from account name to account info
For more detailed documentation on each type, see the corresponding modules.
Evolution of transaction/entry/posting terminology:
- ledger 2: entries contain transactions
- hledger 0.4: Entrys contain RawTransactions (which are flattened to Transactions)
- ledger 3: transactions contain postings
- hledger 0.5: LedgerTransactions contain Postings (which are flattened to Transactions)
- hledger 0.8: Transactions contain Postings (referencing Transactions..)
|
|
Synopsis |
|
|
|
Documentation |
|
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | Commodity | | symbol :: String | the commodity's symbol
display preferences for amounts of this commodity
| side :: Side | should the symbol appear on the left or the right
| spaced :: Bool | should there be a space between symbol and quantity
| precision :: Int | number of decimal places to display
XXX these three might be better belonging to Journal
| decimalpoint :: Char | character to use as decimal point
| separator :: Char | character to use for separating digit groups (eg thousands)
| separatorpositions :: [Int] | positions of separators, counting leftward from decimal point
|
|
| Instances | |
|
|
|
An amount's price may be written as @ unit price or @@ total price.
Note although Price has a MixedAmount, it should hold only
single-commodity amounts, cf costOfAmount.
| Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | RegularPosting | | VirtualPosting | | BalancedVirtualPosting | |
| Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
data ModifierTransaction | Source |
|
Constructors | | Instances | |
|
|
data PeriodicTransaction | Source |
|
Constructors | | Instances | |
|
|
|
Constructors | SetBalance | | SetRequiredHours | | In | | Out | | FinalOut | |
| Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
|
|
A journal context is some data which can change in the course of
parsing a journal. An example is the default year, which changes when a
Y directive is encountered. At the end of parsing, the final context
is saved for later use by eg the add command.
| Constructors | Ctx | | ctxYear :: !(Maybe Year) | the default year most recently specified with Y
| ctxCommodity :: !(Maybe Commodity) | the default commodity most recently specified with D
| ctxAccount :: ![AccountName] | the current stack of parent accounts specified by !account
|
|
| Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
A JournalUpdate is some transformation of a Journal. It can do I/O or
raise an error.
|
|
|
A hledger journal reader is a triple of format name, format-detecting
predicate, and a parser to Journal.
| Constructors | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
A generic, pure specification of how to filter transactions and postings.
| Constructors | FilterSpec | | datespan :: DateSpan | only include if in this date span
| cleared :: Maybe Bool | only include if cleared/uncleared/don't care
| real :: Bool | only include if real/don't care
| empty :: Bool | include if empty (ie amount is zero)
| costbasis :: Bool | convert all amounts to cost basis
| acctpats :: [String] | only include if matching these account patterns
| descpats :: [String] | only include if matching these description patterns
| whichdate :: WhichDate | which dates to use (actual or effective)
| depth :: Maybe Int | |
|
| Instances | |
|
|
Produced by Haddock version 2.6.1 |