dev: refactor

This commit is contained in:
Simon Michael 2024-10-08 22:29:02 -10:00
parent 6ce5e85e99
commit 05fd8e1d69

View File

@ -927,12 +927,12 @@ multiBalanceReportAsTable opts@ReportOpts{summary_only_, average_, row_total_, b
++ (if not summary_only_ then map (reportPeriodName balanceaccum_ spans) spans else []) ++ (if not summary_only_ then map (reportPeriodName balanceaccum_ spans) spans else [])
++ [" Total" | totalscolumn] ++ [" Total" | totalscolumn]
++ ["Average" | average_] ++ ["Average" | average_]
fullRowAsTexts row =
let rs = multiBalanceRowAsText opts row
in (replicate (length rs) (renderacct row), rs)
(accts, rows) = unzip $ fmap fullRowAsTexts items (accts, rows) = unzip $ fmap fullRowAsTexts items
renderacct row = where
T.replicate ((prrIndent row - 1) * 2) " " <> prrDisplayName row fullRowAsTexts row = (replicate (length rs) (renderacct row), rs)
where
rs = multiBalanceRowAsText opts row
renderacct row' = T.replicate ((prrIndent row' - 1) * 2) " " <> prrDisplayName row'
addtotalrow addtotalrow
| no_total_ opts = id | no_total_ opts = id
| otherwise = | otherwise =