cli: multiBalanceReport: Remove redundant code branch.
This commit is contained in:
parent
5168d136ed
commit
7a5416928e
@ -314,7 +314,7 @@ balance opts@CliOpts{rawopts_=rawopts,reportopts_=ropts@ReportOpts{..}} j = do
|
|||||||
|
|
||||||
if budget then do -- single or multi period budget report
|
if budget then do -- single or multi period budget report
|
||||||
reportspan <- reportSpan j ropts
|
reportspan <- reportSpan j ropts
|
||||||
let budgetreport = dbg1 "budgetreport" $ budgetReport ropts assrt reportspan d j
|
let budgetreport = dbg4 "budgetreport" $ budgetReport ropts assrt reportspan d j
|
||||||
where
|
where
|
||||||
assrt = not $ ignore_assertions_ $ inputopts_ opts
|
assrt = not $ ignore_assertions_ $ inputopts_ opts
|
||||||
render = case fmt of
|
render = case fmt of
|
||||||
@ -335,13 +335,7 @@ balance opts@CliOpts{rawopts_=rawopts,reportopts_=ropts@ReportOpts{..}} j = do
|
|||||||
writeOutput opts $ render report
|
writeOutput opts $ render report
|
||||||
|
|
||||||
else do -- single period simple balance report
|
else do -- single period simple balance report
|
||||||
let report
|
let report = balanceReport ropts (queryFromOpts d ropts) j -- simple Ledger-style balance report
|
||||||
| balancetype_ `elem` [HistoricalBalance, CumulativeChange]
|
|
||||||
= let ropts' | flat_ ropts = ropts
|
|
||||||
| otherwise = ropts{accountlistmode_=ALTree}
|
|
||||||
in balanceReportFromMultiBalanceReport ropts' (queryFromOpts d ropts) j
|
|
||||||
-- for historical balances we must use balanceReportFromMultiBalanceReport (also forces --no-elide)
|
|
||||||
| otherwise = balanceReport ropts (queryFromOpts d ropts) j -- simple Ledger-style balance report
|
|
||||||
render = case fmt of
|
render = case fmt of
|
||||||
"txt" -> balanceReportAsText
|
"txt" -> balanceReportAsText
|
||||||
"csv" -> \ropts r -> (++ "\n") $ printCSV $ balanceReportAsCsv ropts r
|
"csv" -> \ropts r -> (++ "\n") $ printCSV $ balanceReportAsCsv ropts r
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user