lib: When performing a summary posting report without depth limiting,

report exclusive balances rather than inclusive balances (#1568).
This commit is contained in:
Stephen Morgan 2021-06-12 11:45:40 +10:00 committed by Simon Michael
parent b114571d26
commit 0df3a4714f
2 changed files with 4 additions and 2 deletions

View File

@ -212,7 +212,7 @@ summarisePostingsInDateSpan (DateSpan b e) wd mdepth showempty ps
balance a = maybe nullmixedamt bal $ lookupAccount a accts
where
bal = if isclipped a then aibalance else aebalance
isclipped a = maybe True (accountNameLevel a >=) mdepth
isclipped a = maybe False (accountNameLevel a >=) mdepth
negatePostingAmount :: Posting -> Posting
negatePostingAmount = postingTransformAmount negate

View File

@ -1,10 +1,12 @@
# 1. monthly reporting interval, no end dates, shows just the intervals with data:
<
2011/2/1
(a) 1
(a) 1
(a:b) 1
$ hledger -f- register --period 'monthly'
2011-02 a 1 1
a:b 1 2
# 2. or with a query pattern, just the intervals with matched data:
<