parsing: order postings first by date, then by parse order when checking balance assertions

This commit is contained in:
Simon Michael 2013-05-30 15:16:54 -07:00
parent 5685b3dc9c
commit 6073b56b9e

View File

@ -377,7 +377,10 @@ checkBalanceAssertionsForAccount ps
| null errs = Right ()
| otherwise = Left $ head errs
where
errs = fst $ foldl' checkBalanceAssertion ([],nullmixedamt) $ splitAssertions ps
errs = fst $
foldl' checkBalanceAssertion ([],nullmixedamt) $
splitAssertions $
sortBy (comparing postingDate) ps
-- Given a starting balance, accumulated errors, and a non-null sequence of
-- postings to a single account with a balance assertion in the last: