From b137a346c0e7a1cee694ce9598c70d42f8461c9a Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 13 Jun 2011 21:39:00 +0000 Subject: [PATCH] web: make a filtered account register's Total column positive, like a journal register --- hledger/Hledger/Cli/Register.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hledger/Hledger/Cli/Register.hs b/hledger/Hledger/Cli/Register.hs index c12ec145b..4729516fa 100644 --- a/hledger/Hledger/Cli/Register.hs +++ b/hledger/Hledger/Cli/Register.hs @@ -114,7 +114,7 @@ registerReport opts fspec j = (totallabel,postingsToRegisterReportItems ps nullp -- Does not handle reporting intervals. -- accountRegisterReport :: [Opt] -> Journal -> Matcher -> AccountName -> RegisterReport -accountRegisterReport opts j m a = (label, postingsToRegisterReportItems displayps nullposting startbal (-)) +accountRegisterReport opts j m a = (label, postingsToRegisterReportItems displayps nullposting startbal sumfn) where -- displayps' | interval == NoInterval = displayps -- | otherwise = summarisePostingsByInterval interval depth empty filterspan displayps @@ -129,9 +129,9 @@ accountRegisterReport opts j m a = (label, postingsToRegisterReportItems display -- starting balance: if we are filtering by a start date and nothing else -- else, the sum of postings to this account before it; otherwise zero. - (startbal,label) | matcherIsNull m = (nullmixedamt,balancelabel) - | matcherIsStartDateOnly effective m = (sumPostings priorps,balancelabel) - | otherwise = (nullmixedamt,totallabel) + (startbal,label, sumfn) | matcherIsNull m = (nullmixedamt,balancelabel,(-)) + | matcherIsStartDateOnly effective m = (sumPostings priorps,balancelabel,(-)) + | otherwise = (nullmixedamt,totallabel,(+)) where priorps = -- ltrace "priorps" $ filter (matchesPosting