bs/is: fix "Ratio has zero denominator" error with no matched accounts (#518)

This commit is contained in:
Simon Michael 2017-05-04 10:24:00 -07:00
parent 2de0109953
commit c8e4bc0098
2 changed files with 2 additions and 3 deletions

View File

@ -532,7 +532,7 @@ balanceReportAsTable opts (MultiBalanceReport (colspans, items, (coltotals,tot,a
| otherwise = (+----+ (row "" $
coltotals
++ (if row_total_ opts then [tot] else [])
++ (if average_ opts then [avg] else [])
++ (if average_ opts then [avg] else [])
))
-- | Figure out the overall date span of a multicolumn balance report.

View File

@ -137,8 +137,7 @@ balanceviewReport BalanceView{..} CliOpts{command_=cmd, reportopts_=ropts, rawop
sumAmts = case amts of
a1:as -> foldl' (zipWith (+)) a1 as
[] -> []
totavg = totsum `divideMixedAmount`
fromIntegral (length sumAmts)
totavg = totsum `divideMixedAmount` fromIntegral (length sumAmts)
mergedTabl = case tabls of
t1:ts -> foldl' merging t1 ts
[] -> T.empty