bs/is: fix "Ratio has zero denominator" error (take 2) (#535)

This commit is contained in:
Simon Michael 2017-05-04 10:21:47 -07:00
parent c8e4bc0098
commit 118bc85726
2 changed files with 4 additions and 4 deletions

View File

@ -531,8 +531,8 @@ balanceReportAsTable opts (MultiBalanceReport (colspans, items, (coltotals,tot,a
addtotalrow | no_total_ opts = id
| otherwise = (+----+ (row "" $
coltotals
++ (if row_total_ opts then [tot] else [])
++ (if average_ opts then [avg] else [])
++ (if row_total_ opts && not (null coltotals) then [tot] else [])
++ (if average_ opts && not (null coltotals) then [avg] else [])
))
-- | Figure out the overall date span of a multicolumn balance report.

View File

@ -148,8 +148,8 @@ balanceviewReport BalanceView{..} CliOpts{command_=cmd, reportopts_=ropts, rawop
mergedTabl
+====+
row "Total"
(sumAmts ++ (if row_total_ ropts' then [totsum] else [])
++ (if average_ ropts' then [totavg] else [])
(sumAmts ++ (if row_total_ ropts' && not (null sumAmts) then [totsum] else [])
++ (if average_ ropts' && not (null sumAmts) then [totavg] else [])
)
putStrLn title
putStrLn $ renderBalanceReportTable ropts totTabl