From beeed4c10c3bb9b6d91a6176a0773a516abdcb6c Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 6 May 2014 21:36:04 -0700 Subject: [PATCH] aregister: fix date filtering with disordered txns (fixes #184) Fix a refactoring-related regression that the tests missed: if transactions were not ordered by date in the journal, register could include postings before the report start date in the output. --- hledger-lib/Hledger/Reports/PostingsReport.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hledger-lib/Hledger/Reports/PostingsReport.hs b/hledger-lib/Hledger/Reports/PostingsReport.hs index 00f4a093a..f44e81d75 100644 --- a/hledger-lib/Hledger/Reports/PostingsReport.hs +++ b/hledger-lib/Hledger/Reports/PostingsReport.hs @@ -66,7 +66,7 @@ postingsReport opts q j = (totallabel, items) dbg "ps3" $ (if related_ opts then concatMap relatedPostings else id) $ -- with -r, replace each with its sibling postings dbg "ps2" $ filter (reportq `matchesPosting`) $ -- filter postings by the query, including before the report start date, ignoring depth dbg "ps1" $ journalPostings $ journalSelectingAmountFromOpts opts j - (precedingps, reportps) = dbg "precedingps, reportps" $ span (beforestartq `matchesPosting`) pstoend + (precedingps, reportps) = dbg "precedingps, reportps" $ partition (beforestartq `matchesPosting`) pstoend empty = queryEmpty q -- displayexpr = display_ opts -- XXX