From 628c4241f359a8b5ea67a9342960a60eb7170f15 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 16 Oct 2008 06:53:08 +0000 Subject: [PATCH] omit transactions with zero amount from register report --- RegisterCommand.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RegisterCommand.hs b/RegisterCommand.hs index 9fa0d1af4..4bd35a04b 100644 --- a/RegisterCommand.hs +++ b/RegisterCommand.hs @@ -24,7 +24,8 @@ showTransactionsWithBalances opts args l = startingbalance = nullamt showTransactionsWithBalances' :: [Transaction] -> Transaction -> Amount -> [String] showTransactionsWithBalances' [] _ _ = [] - showTransactionsWithBalances' (t:ts) tprev b = this ++ rest + showTransactionsWithBalances' (t@Transaction{amount=a}:ts) tprev b = + (if isZeroAmount a then [] else this) ++ rest where b' = b + (amount t) sameentry (Transaction {entryno=e1}) (Transaction {entryno=e2}) = e1 == e2