Hi all,
In current hledger, a balance assertion like some:account $1 = $4 asserts that after the $1 posting, some:account's balance is $4. I learned from [1]https://github.com/simonmichael/hledger/issues/195 that in Ledger, it means that some:account's *dollar* balance is $4, and says nothing about any other commodities in the account. This should be clarified at [2]http://ledger-cli.org/3.0/doc/ledger3.html#Balance-assertions. I find this a little harder to understand and explain, and unsatisfying that a balance assertion doesn't definitively nail down (programmatically and visually) what's in an account. You can add more postings, with 0 amount if necessary, to assert the balance of each individual commodity: some:account $1 = $4 some:account 0 = EUR 10 some:account 0 = FRF 15 but you're still not absolutely sure of the account's balance - new commodities can show up there and the assertions won't notice. Also, what does it mean to assert a commodity-less zero balance ? Ledger accepts all the assertions below, which seems wrong: 1/1 a 1 = 1 a $1 = $1 a $-1 = 0 a 1 = 0 a 1 = 0 b The advantage of Ledger's current way is that you can make at least some assertions about a multi-commodity account. In current hledger this is explicitly not supported, so if you really needed to assert a multi-commodity balance you'd have to separate the commodities into subaccounts. Compatible balance assertions are important for interoperability between ledger-likes, so I'm wondering how to harmonise this. I can make hledger's assertions work like current Ledger, or we could agree to target a new design. Eg I propose we add a one-line syntax for multi-commodity amounts, such as: some:account $1 = $4, EUR 10, FRF15 ; comma followed by a space separates amounts and agree that assertions disallow commodities not explicitly mentioned. What do you think ? There's at least one other incompatibility between Ledger and hledger balance assertions: 1/1 a 1 = 1 a 1 = 1 ; Ledger expects a to be 1 again, ignoring the previous posting; hledger expects 2 b Can I persuade you that hledger's interpretation is better here ? Either way, I'd also like to have --no-balance-assertions or similar widely supported, so that you can at least ignore them temporarily while running another ledger-like on your data. Thoughts ? References 1. https://github.com/simonmichael/hledger/issues/195 2. http://ledger-cli.org/3.0/doc/ledger3.html#Balance-assertions -- --- You received this message because you are subscribed to the Google Groups "Ledger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
