March Docs

LedgerJournal

Functions

fnaccountsaccounts(l : Ledger) : List(LedgerAccount.Account)#
fnbalancebalance(l : Ledger, id : String) : Result(FinanceAmount.Quantity, LedgerError.Error)#
fncountcount(l : Ledger) : {Int | _ >= 0}#
fndraftdraft(p : PostedEntry) : LedgerEntry.Draft#
fnentriesentries(l : Ledger) : List(PostedEntry)#
fnentry_identry_id(p : PostedEntry) : String#
fnnewnew(accounts : List(LedgerAccount.Account)) : Result(Ledger, LedgerError.Error)#
fnpostpost(l : Ledger, d : LedgerEntry.Draft) : Result((Ledger, PostedEntry), LedgerError.Error) do append(l, d, None) end#
fnpost_validatedpost_validated(l : Ledger, v : LedgerValidation.Validated) : Result((Ledger, PostedEntry), LedgerError.Error)#

Post a validated draft, rechecking destination accounts and current replay keys.

fnreversal_ofreversal_of(p : PostedEntry) : Option(String)#
fnreversereverse(l : Ledger, original : PostedEntry, id : String, metadata : FinanceMetadata.Metadata) : Result((Ledger, PostedEntry), LedgerError.Error)#
fnvalidatevalidate(l : Ledger, d : LedgerEntry.Draft) : Result(LedgerValidation.Validated, LedgerError.Error)#

Check accounting invariants without posting or reserving replay keys.