Skip to content
djp edited this page Feb 22, 2012 · 20 revisions

I'm experimenting with something like this personally, it works, but it's an imperfect solution to a poorly-defined problem

; Chart of Accounts file, to be !included.
; this is intended to represent a full CofA, to populate hledger-web-add drop-downs 
; and tab-completions, and as a sane place for accounts metadata and starting balances.
; It is also hoped that a function will be developed to constrain data entry to these accounts. 
; balances must be non-zero, in order to be seen by hledger-web (and?)
 
2011/01/01 Chart of Accounts  ; including notes and starting balances
    assets                        1
    assets:cash                   17.00
    assets:PCF:chequing           28000
    assets:RBC:chequing           1 ; account closed ?
    expenses:insurance:home       100 ;StateFarm
    expenses:telcom:Bell          700 ;416-123-4567
    expenses:telcom:ISP           1
    expenses:telcom:djp-wind      1; cel phone
    expenses:utils:hydro          1
    income:djp:dp_services        -1
    income:lena:lc_pay            -100
    liabilities:SecureCap         -40000
    liabilities:Mortgage         -160000 ; Imaginary Mortgage Group inc.
    liabilities:CIBC:DP_line      -12000
    liabilities:CapOne:MC         -100
    liabilities:parking tickets   -320
    liabilities:personal:betzy    -1200
    assets:home:resale_value      360000 ; estimate
    equity:starting_bal
; this is not a complete CofA

Currently, I use (something like) this as an !include d file, and I was almost surprised that is (mostly) works as intended. It is imperfect in that it is treated as a regular transaction, and is by definition related to every other transaction, so is seen in most listings, where it ought to be un-seen, most of the time. That it's entries must be non-zero is annoying, and that is is balancing with the equity account probably has implications I only dimly understand, but makes sense for many starting-balances. I intend to fully flesh out my version to include all the metada I might ever want about each account, including real-world co-ordinates, like contact information, account details, filesystem uri, associated information files, account threshholds, associated interest-rates.. the works, consolidated in a text-file where I keep my accounting data, how convenient! Down the road all of this metada may be made available to any other report-types, where more detail about the actual account is wanted. If this sort of thing were adopted for main-stream use, I could see it being applied to other data.ledger files with an !accounts (instead of !include) or in-line under a block-designator like ~accounts this:that this:the:other ~end an it would be good to be able to attach a CofA.ledger file from the command-line, or as an environment-variable.