From cda62d9a59e7a20d68e6909358f27b40c0bad1d6 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 12 Jun 2025 09:30:46 -1000 Subject: [PATCH] ;dev: change "1.44" to "1.50" in docs and error messages --- hledger-lib/Hledger/Data/Balancing.hs | 4 ++-- hledger-lib/Hledger/Data/Transaction.hs | 2 +- hledger/hledger.m4.md | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hledger-lib/Hledger/Data/Balancing.hs b/hledger-lib/Hledger/Data/Balancing.hs index b48013b28..2cd016539 100644 --- a/hledger-lib/Hledger/Data/Balancing.hs +++ b/hledger-lib/Hledger/Data/Balancing.hs @@ -152,8 +152,8 @@ transactionCheckBalanced BalancingOpts{commodity_styles_=_mglobalstyles, txn_bal ++ if bvsumokold then "" else oldbalancingmsg oldbalancingmsg = unlines [ -- ------------------------------------------------------------------------------- - "\nNote, hledger <1.44 accepted this entry because of the global display precision," - ,"but hledger 1.44+ checks more strictly, using the entry's local precision." + "\nNote, hledger <1.50 accepted this entry because of the global display precision," + ,"but hledger 1.50+ checks more strictly, using the entry's local precision." ,"You can use --txn-balancing=old to keep it working, or fix it (recommended);" ,"see 'Transaction balancing' in the hledger manual." ] diff --git a/hledger-lib/Hledger/Data/Transaction.hs b/hledger-lib/Hledger/Data/Transaction.hs index b34f5f670..fad101830 100644 --- a/hledger-lib/Hledger/Data/Transaction.hs +++ b/hledger-lib/Hledger/Data/Transaction.hs @@ -89,7 +89,7 @@ import Data.List (union) -- | How to determine the precision used for checking that transactions are balanced. See #2402. data TransactionBalancingPrecision = TBPOld - -- ^ Legacy behaviour, as in hledger <1.44, included to ease upgrades. + -- ^ Legacy behaviour, as in hledger <1.50, included to ease upgrades. -- use precision inferred from the whole journal, overridable by commodity directive or -c. -- Display precision is also transaction balancing precision; increasing it can break journal reading. -- Some valid journals are rejected until commodity directives are added. diff --git a/hledger/hledger.m4.md b/hledger/hledger.m4.md index ceef4dc5e..580f19168 100644 --- a/hledger/hledger.m4.md +++ b/hledger/hledger.m4.md @@ -1836,14 +1836,14 @@ Especially when it involves costs, which often are not exact, because of repeati In each commodity, hledger sums the transaction's posting amounts, after converting any with costs; then it checks if that sum is zero, when rounded to a suitable number of decimal digits - which we call the *balancing precision*. -Since version 1.44, hledger infers balancing precision in each transaction from the amounts in that transaction's journal entry (like Ledger). +Since version 1.50, hledger infers balancing precision in each transaction from the amounts in that transaction's journal entry (like Ledger). Ie, when checking the balance of commodity A, it uses the highest decimal precision seen for A in the journal entry (excluding cost amounts). This makes transaction balancing robust; any imbalances must be visibly accounted for in the journal entry, display precision can be freely increased with `-c`, and compatibility with Ledger and Beancount journals is good. -Note that hledger versions before 1.44 worked differently: they allowed display precision to override the balancing precision. +Note that hledger versions before 1.50 worked differently: they allowed display precision to override the balancing precision. This masked small imbalances and caused fragility (see issue #2402). -As a result, some journal entries (or CSV rules) that worked with hledger <1.44, are now rejected with an "unbalanced transaction" error. +As a result, some journal entries (or CSV rules) that worked with hledger <1.50, are now rejected with an "unbalanced transaction" error. If you hit this problem, it's easy to fix: - You can restore the old behaviour, by adding `--txn-balancing=old` to the command or to your `~/.hledger.conf` file.