fix: bal: --declared now respects not:ACCT (fix #1783)

This commit is contained in:
Simon Michael 2021-12-09 12:58:22 -10:00
parent 25598a231f
commit d1a0d37bd1
2 changed files with 11 additions and 11 deletions

View File

@ -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

View File

@ -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