;doc: Assertions and ordering: rewrite; update Ledger info

This commit is contained in:
Simon Michael 2024-04-11 17:28:07 -10:00
parent 28abe5e9ff
commit 96e9bdb2e2

View File

@ -1405,18 +1405,12 @@ troubleshooting or for reading Ledger files.
### Assertions and ordering ### Assertions and ordering
hledger sorts an account's postings and assertions first by date and hledger calculates and checks an account's balance assertions in date order
then (for postings on the same day) by parse order. Note this is (and when there are multiple assertions on the same day, in parse order).
different from Ledger, which sorts assertions only by parse Note this is different from Ledger, which checks assertions always in parse order, ignoring dates.
order. (Also, Ledger assertions do not see the accumulated effect of
repeated postings to the same account within a transaction.)
So, hledger balance assertions keep working if you reorder This means in hledger you can freely reorder transactions, postings, or files, and balance assertions will usually keep working.
differently-dated transactions within the journal. But if you reorder The exception is when you reorder multiple postings on the same day, to the same account, which have balance assertions; those will likely need updating.
same-dated transactions or postings, assertions might break and require
updating. This order dependence does bring an advantage: precise
control over the order of postings and assertions within a day, so you
can assert intra-day balances.
### Assertions and multiple included files ### Assertions and multiple included files