hledger-lib-1.16.2: Core data types, parsers and functionality for the hledger accounting tools

Safe HaskellNone
LanguageHaskell2010

Hledger.Data.Ledger

Contents

Description

A Ledger is derived from a Journal by applying a filter specification to select Transactions and Postings of interest. It contains the filtered journal and knows the resulting chart of accounts, account balances, and postings in each account.

Synopsis

Documentation

ledgerFromJournal :: Query -> Journal -> Ledger Source #

Filter a journal's transactions with the given query, then build a Ledger, containing the journal plus the tree of all its accounts with their subaccount-inclusive and subaccount-exclusive balances. If the query includes a depth limit, the ledger's journal will be depth limited, but the ledger's account tree will not.

ledgerAccountNames :: Ledger -> [AccountName] Source #

List a ledger's account names.

ledgerAccount :: Ledger -> AccountName -> Maybe Account Source #

Get the named account from a ledger.

ledgerRootAccount :: Ledger -> Account Source #

Get this ledger's root account, which is a dummy "root" account above all others. This should always be first in the account list, if somehow not this returns a null account.

ledgerTopAccounts :: Ledger -> [Account] Source #

List a ledger's top-level accounts (the ones below the root), in tree order.

ledgerLeafAccounts :: Ledger -> [Account] Source #

List a ledger's bottom-level (subaccount-less) accounts, in tree order.

ledgerAccountsMatching :: [String] -> Ledger -> [Account] Source #

Accounts in ledger whose name matches the pattern, in tree order.

ledgerPostings :: Ledger -> [Posting] Source #

List a ledger's postings, in the order parsed.

ledgerDateSpan :: Ledger -> DateSpan Source #

The (fully specified) date span containing all the ledger's (filtered) transactions, or DateSpan Nothing Nothing if there are none.

ledgerCommodities :: Ledger -> [CommoditySymbol] Source #

All commodities used in this ledger.

Orphan instances

Show Ledger Source # 
Instance details