From 80a0653b3e391168f14771a23eea3acd40a170b1 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 2 Apr 2009 07:22:54 +0000 Subject: [PATCH] --no-total hides balance report's final total --- BalanceCommand.hs | 3 ++- Options.hs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/BalanceCommand.hs b/BalanceCommand.hs index 85a085839..f2dadbf4a 100644 --- a/BalanceCommand.hs +++ b/BalanceCommand.hs @@ -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 diff --git a/Options.hs b/Options.hs index e33bb793d..c023750f5 100644 --- a/Options.hs +++ b/Options.hs @@ -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 |