fix: prices: Do not include zero amounts when calculating amounts for balance assignments. (#1736)
This is not usually a problem, but can get in the way of auto-inferring prices.
This commit is contained in:
parent
e35d0b7865
commit
1c90c7f97a
@ -508,7 +508,7 @@ addOrAssignAmountAndCheckAssertionB p@Posting{paccount=acc, pamount=amt, pbalanc
|
||||
oldbalothercommodities <- filterMixedAmount ((acommodity baamount /=) . acommodity) <$> getRunningBalanceB acc
|
||||
return $ maAddAmount oldbalothercommodities baamount
|
||||
diff <- (if bainclusive then setInclusiveRunningBalanceB else setRunningBalanceB) acc newbal
|
||||
let p' = p{pamount=diff, poriginal=Just $ originalPosting p}
|
||||
let p' = p{pamount=filterMixedAmount (not . amountIsZero) diff, poriginal=Just $ originalPosting p}
|
||||
whenM (R.reader bsAssrt) $ checkBalanceAssertionB p' newbal
|
||||
return p'
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user