From d1a0d37bd1319d9a2cf423c6d8fdc34b4f04245c Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 9 Dec 2021 12:58:22 -1000 Subject: [PATCH] fix: bal: --declared now respects not:ACCT (fix #1783) --- .../Hledger/Reports/MultiBalanceReport.hs | 2 +- hledger/test/balance/balance.test | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hledger-lib/Hledger/Reports/MultiBalanceReport.hs b/hledger-lib/Hledger/Reports/MultiBalanceReport.hs index 2945cad85..24f122365 100644 --- a/hledger-lib/Hledger/Reports/MultiBalanceReport.hs +++ b/hledger-lib/Hledger/Reports/MultiBalanceReport.hs @@ -285,7 +285,7 @@ acctChanges ReportSpec{_rsQuery=query,_rsReportOpts=ReportOpts{accountlistmode_, declaredacctps = [nullposting{paccount=n} | n <- journalLeafAccountNamesDeclared j , acctq `matchesAccount` n] - where acctq = dbg3 "acctq" $ filterQuery queryIsAcct query + where acctq = dbg3 "acctq" $ filterQueryOrNotQuery queryIsAcct query filterbydepth = case accountlistmode_ of ALTree -> filter ((depthq `matchesAccount`) . aname) -- a tree - just exclude deeper accounts diff --git a/hledger/test/balance/balance.test b/hledger/test/balance/balance.test index 52d0d83ca..f5481bc10 100644 --- a/hledger/test/balance/balance.test +++ b/hledger/test/balance/balance.test @@ -212,13 +212,13 @@ account b >>>= 0 # 12. not:ACCT queries work with declared accounts. -# hledger -f - balance -NE --declared not:a -# <<< -# account a -# account a:aa -# account a:ab -# account a:ac:aca -# account b -# >>> -# 0 b -# >>>= 0 +hledger -f - balance -NE --declared not:a +<<< +account a +account a:aa +account a:ab +account a:ac:aca +account b +>>> + 0 b +>>>= 0