From 663c68e8e2c248e7a3561003bccd7cef52c10800 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 17 Jul 2014 16:53:36 -0700 Subject: [PATCH] web: fix 0s with search by acct within a register --- hledger-lib/Hledger/Reports/TransactionsReports.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hledger-lib/Hledger/Reports/TransactionsReports.hs b/hledger-lib/Hledger/Reports/TransactionsReports.hs index 0da2d0ebf..9e3321d06 100644 --- a/hledger-lib/Hledger/Reports/TransactionsReports.hs +++ b/hledger-lib/Hledger/Reports/TransactionsReports.hs @@ -166,13 +166,13 @@ accountTransactionsReportItems query thisacctquery bal signfn (torig:ts) = case i of Just i' -> i':is Nothing -> is where + -- XXX I've lost my grip on this, let's just hope for the best + origps = tpostings torig tacct@Transaction{tpostings=queryps} = filterTransactionPostings query torig - (thisacctps, otheracctps) = -- partition (matchesPosting thisacctquery) queryps - case thisacctquery of None -> ([],queryps) - q -> partition (matchesPosting q) queryps + (thisacctps, otheracctps) = partition (matchesPosting thisacctquery) origps amt = negate $ sum $ map pamount thisacctps numotheraccts = length $ nub $ map paccount otheracctps - otheracctstr | thisacctquery == None = summarisePostingAccounts queryps + otheracctstr | thisacctquery == None = summarisePostingAccounts origps | numotheraccts == 0 = summarisePostingAccounts thisacctps | otherwise = summarisePostingAccounts otheracctps (i,bal') = case queryps of