diff --git a/hledger-lib/Hledger/Read/Common.hs b/hledger-lib/Hledger/Read/Common.hs index c8a128ca6..4ad4d80bf 100644 --- a/hledger-lib/Hledger/Read/Common.hs +++ b/hledger-lib/Hledger/Read/Common.hs @@ -737,9 +737,11 @@ balanceassertionp = do char '=' exact <- optional $ try $ char '=' lift (skipMany spacenonewline) - a <- amountwithoutpricep "unpriced amount (for a balance assertion or assignment)" + -- allow this amount to have a price, for compatibility, but discard it + a <- amountp "amount (for a balance assertion or assignment)" + let a' = a{aprice=NoPrice} return BalanceAssertion - { baamount = a + { baamount = a' , baexact = isJust exact , baposition = sourcepos } diff --git a/hledger-lib/hledger_journal.m4.md b/hledger-lib/hledger_journal.m4.md index 42a59559f..33c234845 100644 --- a/hledger-lib/hledger_journal.m4.md +++ b/hledger-lib/hledger_journal.m4.md @@ -439,7 +439,9 @@ One workaround is to isolate each commodity into its own subaccount: ### Assertions and prices Balance assertion (or assignment) amounts should not have a [price](#transaction-prices), -as the meaning of that would be unclear. +as the meaning of that is unclear. +A price written there will be ignored. +(hledger's [close](/manual.html#close) command used to generate balance assertions with prices.) ### Assertions and subaccounts