cli: Cli.Commands.Balance.multiBalanceReportAsSpreadsheetHelper -> multiBalanceReportAsSpreadsheetParts
This commit is contained in:
parent
bb5e64c75f
commit
afc320f1ba
@ -774,16 +774,16 @@ multiBalanceReportAsCsv opts@ReportOpts{..} report = maybeTranspose allRows
|
|||||||
_ -> rows ++ totals
|
_ -> rows ++ totals
|
||||||
rows = header:body
|
rows = header:body
|
||||||
(header, body, totals) =
|
(header, body, totals) =
|
||||||
multiBalanceReportAsSpreadsheetHelper False opts report
|
multiBalanceReportAsSpreadsheetParts False opts report
|
||||||
maybeTranspose = if transpose_ then transpose else id
|
maybeTranspose = if transpose_ then transpose else id
|
||||||
|
|
||||||
-- Helper for CSV and ODS and HTML rendering.
|
-- Helper for CSV and ODS and HTML rendering.
|
||||||
multiBalanceReportAsSpreadsheetHelper ::
|
multiBalanceReportAsSpreadsheetParts ::
|
||||||
Bool -> ReportOpts -> MultiBalanceReport ->
|
Bool -> ReportOpts -> MultiBalanceReport ->
|
||||||
([Ods.Cell Ods.NumLines Text],
|
([Ods.Cell Ods.NumLines Text],
|
||||||
[[Ods.Cell Ods.NumLines Text]],
|
[[Ods.Cell Ods.NumLines Text]],
|
||||||
[[Ods.Cell Ods.NumLines Text]])
|
[[Ods.Cell Ods.NumLines Text]])
|
||||||
multiBalanceReportAsSpreadsheetHelper ishtml opts@ReportOpts{..} (PeriodicReport colspans items tr) =
|
multiBalanceReportAsSpreadsheetParts ishtml opts@ReportOpts{..} (PeriodicReport colspans items tr) =
|
||||||
(headers, concatMap fullRowAsTexts items, addTotalBorders totalrows)
|
(headers, concatMap fullRowAsTexts items, addTotalBorders totalrows)
|
||||||
where
|
where
|
||||||
accountCell label =
|
accountCell label =
|
||||||
@ -840,7 +840,7 @@ multiBalanceReportHtmlRows ropts mbr =
|
|||||||
-- TODO: should the commodity_column be displayed as a subaccount in this case as well?
|
-- TODO: should the commodity_column be displayed as a subaccount in this case as well?
|
||||||
(headingsrow, bodyrows, mtotalsrows)
|
(headingsrow, bodyrows, mtotalsrows)
|
||||||
| transpose_ ropts = error' "Sorry, --transpose with HTML output is not yet supported" -- PARTIAL:
|
| transpose_ ropts = error' "Sorry, --transpose with HTML output is not yet supported" -- PARTIAL:
|
||||||
| otherwise = multiBalanceReportAsSpreadsheetHelper True ropts mbr
|
| otherwise = multiBalanceReportAsSpreadsheetParts True ropts mbr
|
||||||
formatRow = Html.formatRow . map (fmap L.toHtml)
|
formatRow = Html.formatRow . map (fmap L.toHtml)
|
||||||
in
|
in
|
||||||
(formatRow headingsrow
|
(formatRow headingsrow
|
||||||
@ -854,7 +854,7 @@ multiBalanceReportAsSpreadsheet ::
|
|||||||
ReportOpts -> MultiBalanceReport ->
|
ReportOpts -> MultiBalanceReport ->
|
||||||
((Maybe Int, Maybe Int), [[Ods.Cell Ods.NumLines Text]])
|
((Maybe Int, Maybe Int), [[Ods.Cell Ods.NumLines Text]])
|
||||||
multiBalanceReportAsSpreadsheet ropts mbr =
|
multiBalanceReportAsSpreadsheet ropts mbr =
|
||||||
let (header,body,total) = multiBalanceReportAsSpreadsheetHelper True ropts mbr
|
let (header,body,total) = multiBalanceReportAsSpreadsheetParts True ropts mbr
|
||||||
in (if transpose_ ropts then swap *** Ods.transpose else id) $
|
in (if transpose_ ropts then swap *** Ods.transpose else id) $
|
||||||
((Just 1, case layout_ ropts of LayoutWide _ -> Just 1; _ -> Nothing),
|
((Just 1, case layout_ ropts of LayoutWide _ -> Just 1; _ -> Nothing),
|
||||||
header : body ++ total)
|
header : body ++ total)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user