From 297cf30e604bc409587baa9305a961a63dc864fb Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 17 May 2025 02:05:37 -1000 Subject: [PATCH] ;dev: journalValueAndFilterPostingsWith notes [#2371], [#2385] --- hledger-lib/Hledger/Reports/ReportOptions.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hledger-lib/Hledger/Reports/ReportOptions.hs b/hledger-lib/Hledger/Reports/ReportOptions.hs index d59e869b3..be114072b 100644 --- a/hledger-lib/Hledger/Reports/ReportOptions.hs +++ b/hledger-lib/Hledger/Reports/ReportOptions.hs @@ -588,6 +588,14 @@ journalValueAndFilterPostings :: ReportSpec -> Journal -> Journal journalValueAndFilterPostings rspec j = journalValueAndFilterPostingsWith rspec j priceoracle where priceoracle = journalPriceOracle (infer_prices_ $ _rsReportOpts rspec) j +{- [Querying before valuation] +This helper is used by multiBalanceReport (all balance reports). +Previously, at least since #1625 (2021), it was filtering with the cur:/amt: parts +of the query before valuation, and with the other parts after valuation. +Now, since #2387 (2025), it does all filtering before valuation. +This avoids breaking boolean queries (#2371), avoids a strictness bug (#2385), +is simpler, and we think it's otherwise equivalent. +-} -- | Like 'journalValueAndFilterPostings', but takes a 'PriceOracle' as an argument. journalValueAndFilterPostingsWith :: ReportSpec -> Journal -> PriceOracle -> Journal journalValueAndFilterPostingsWith rspec@ReportSpec{_rsQuery=q, _rsReportOpts=ropts} =