web: fix 0s with search by acct within a register

This commit is contained in:
Simon Michael 2014-07-17 16:53:36 -07:00
parent 50577588d0
commit 663c68e8e2

View File

@ -166,13 +166,13 @@ accountTransactionsReportItems query thisacctquery bal signfn (torig:ts) =
case i of Just i' -> i':is case i of Just i' -> i':is
Nothing -> is Nothing -> is
where 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 tacct@Transaction{tpostings=queryps} = filterTransactionPostings query torig
(thisacctps, otheracctps) = -- partition (matchesPosting thisacctquery) queryps (thisacctps, otheracctps) = partition (matchesPosting thisacctquery) origps
case thisacctquery of None -> ([],queryps)
q -> partition (matchesPosting q) queryps
amt = negate $ sum $ map pamount thisacctps amt = negate $ sum $ map pamount thisacctps
numotheraccts = length $ nub $ map paccount otheracctps numotheraccts = length $ nub $ map paccount otheracctps
otheracctstr | thisacctquery == None = summarisePostingAccounts queryps otheracctstr | thisacctquery == None = summarisePostingAccounts origps
| numotheraccts == 0 = summarisePostingAccounts thisacctps | numotheraccts == 0 = summarisePostingAccounts thisacctps
| otherwise = summarisePostingAccounts otheracctps | otherwise = summarisePostingAccounts otheracctps
(i,bal') = case queryps of (i,bal') = case queryps of