From 5cca04cdc9c5b4f871990f6fb6ef3023251c1608 Mon Sep 17 00:00:00 2001 From: Stephen Morgan Date: Wed, 4 Aug 2021 11:46:31 +1000 Subject: [PATCH] imp: areg: aregister no longer excludes future/forecast transactions by default. To get the previous behaviour, you can call with the additional query "not:date:tomorrow-". This is because we are preparing to move forecast_ to InputOpts, where it is not accessible to AccountTransactionsReport. --- .../Hledger/Reports/AccountTransactionsReport.hs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/hledger-lib/Hledger/Reports/AccountTransactionsReport.hs b/hledger-lib/Hledger/Reports/AccountTransactionsReport.hs index eb26c9be1..5f129e003 100644 --- a/hledger-lib/Hledger/Reports/AccountTransactionsReport.hs +++ b/hledger-lib/Hledger/Reports/AccountTransactionsReport.hs @@ -29,7 +29,7 @@ import Data.Maybe (catMaybes) import Data.Ord (Down(..), comparing) import Data.Text (Text) import qualified Data.Text as T -import Data.Time.Calendar (Day, addDays) +import Data.Time.Calendar (Day) import Hledger.Data import Hledger.Query @@ -97,16 +97,10 @@ accountTransactionsReport rspec@ReportSpec{_rsReportOpts=ropts} j thisacctq = it where -- A depth limit should not affect the account transactions report; it should show all transactions in/below this account. -- Queries on currency or amount are also ignored at this stage; they are handled earlier, before valuation. - reportq = simplifyQuery $ And [aregisterq, periodq, excludeforecastq (forecast_ ropts)] + reportq = simplifyQuery $ And [aregisterq, periodq] where aregisterq = filterQuery (not . queryIsCurOrAmt) . filterQuery (not . queryIsDepth) $ _rsQuery rspec periodq = Date . periodAsDateSpan $ period_ ropts - -- Except in forecast mode, exclude future/forecast transactions. - excludeforecastq (Just _) = Any - excludeforecastq Nothing = -- not:date:tomorrow- not:tag:generated-transaction - And [ Not . Date $ DateSpan (Just . addDays 1 $ _rsDay rspec) Nothing - , Not generatedTransactionTag - ] amtq = filterQuery queryIsCurOrAmt $ _rsQuery rspec queryIsCurOrAmt q = queryIsSym q || queryIsAmt q