mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-27 12:24:43 +03:00
Fix postingCleared for individually-cleared postings
The previous code simply looked directly to the parent transaction's status to determine whether the posting was cleared. This gave erroneous information for postings that were individually cleared even though the parent transaction was not cleared.
This commit is contained in:
parent
c14e533555
commit
4ec0cc474f
@ -74,8 +74,14 @@ sumPostings = sumMixedAmountsPreservingHighestPrecision . map pamount
|
|||||||
postingDate :: Posting -> Day
|
postingDate :: Posting -> Day
|
||||||
postingDate p = maybe nulldate tdate $ ptransaction p
|
postingDate p = maybe nulldate tdate $ ptransaction p
|
||||||
|
|
||||||
|
-- |Is this posting cleared? If this posting was individually marked
|
||||||
|
-- as cleared, returns True. Otherwise, return the parent
|
||||||
|
-- transaction's cleared status or, if there is no parent
|
||||||
|
-- transaction, return False.
|
||||||
postingCleared :: Posting -> Bool
|
postingCleared :: Posting -> Bool
|
||||||
postingCleared p = maybe False tstatus $ ptransaction p
|
postingCleared p = if pstatus p
|
||||||
|
then True
|
||||||
|
else maybe False tstatus $ ptransaction p
|
||||||
|
|
||||||
-- | Does this posting fall within the given date span ?
|
-- | Does this posting fall within the given date span ?
|
||||||
isPostingInDateSpan :: DateSpan -> Posting -> Bool
|
isPostingInDateSpan :: DateSpan -> Posting -> Bool
|
||||||
|
Loading…
Reference in New Issue
Block a user