--no-total hides balance report's final total

This commit is contained in:
Simon Michael 2009-04-02 07:22:54 +00:00
parent 83b0ebf832
commit 80a0653b3e
2 changed files with 4 additions and 1 deletions

View File

@ -129,7 +129,8 @@ showBalanceReport opts args l = acctsstr ++ totalstr
interestingaccts = filter (isInteresting opts l) acctnames
acctnames = sort $ tail $ flatten $ treemap aname accttree
accttree = ledgerAccountTree (depthFromOpts opts) l
totalstr | not (Empty `elem` opts) && isZeroMixedAmount total = ""
totalstr | NoTotal `elem` opts = ""
| not (Empty `elem` opts) && isZeroMixedAmount total = ""
| otherwise = printf "--------------------\n%s\n" $ padleft 20 $ showMixedAmount total
where
total = sum $ map abalance $ topAccounts l

View File

@ -70,6 +70,7 @@ options = [
"(where EXPR is 'dOP[DATE]', OP is <, <=, =, >=, >)")
,Option ['E'] ["empty"] (NoArg Empty) "show empty/zero things which are normally elided"
,Option ['R'] ["real"] (NoArg Real) "report only on real (non-virtual) transactions"
,Option [] ["no-total"] (NoArg NoTotal) "balance report: hide the final total"
-- ,Option ['s'] ["subtotal"] (NoArg SubTotal) "balance report: show subaccounts"
,Option ['W'] ["weekly"] (NoArg WeeklyOpt) "register report: show weekly summary"
,Option ['M'] ["monthly"] (NoArg MonthlyOpt) "register report: show monthly summary"
@ -98,6 +99,7 @@ data Opt =
Display {value::String} |
Empty |
Real |
NoTotal |
SubTotal |
WeeklyOpt |
MonthlyOpt |