bal: make --drop work with csv/html output
This commit is contained in:
parent
3849ba7a9d
commit
3663c46502
@ -363,7 +363,7 @@ budgetRollUp CliOpts{rawopts_=rawopts} budget j = j { jtxns = remapTxn <$> jtxns
|
|||||||
| otherwise =
|
| otherwise =
|
||||||
case parentAccountName acctName of
|
case parentAccountName acctName of
|
||||||
"" | boolopt "show-unbudgeted" rawopts -> origAcctName
|
"" | boolopt "show-unbudgeted" rawopts -> origAcctName
|
||||||
| otherwise -> T.append (T.pack "<unbudgeted>:") acctName
|
| otherwise -> T.append (T.pack "<unbudgeted>:") acctName -- TODO: --drop should not remove this
|
||||||
parent -> remapAccount' parent
|
parent -> remapAccount' parent
|
||||||
remapPosting p = p { paccount = remapAccount $ paccount p, porigin = Just . fromMaybe p $ porigin p }
|
remapPosting p = p { paccount = remapAccount $ paccount p, porigin = Just . fromMaybe p $ porigin p }
|
||||||
remapTxn = mapPostings (map remapPosting)
|
remapTxn = mapPostings (map remapPosting)
|
||||||
@ -397,7 +397,7 @@ budgetJournal opts j = journalBalanceTransactions' opts j { jtxns = budget }
|
|||||||
balanceReportAsCsv :: ReportOpts -> BalanceReport -> CSV
|
balanceReportAsCsv :: ReportOpts -> BalanceReport -> CSV
|
||||||
balanceReportAsCsv opts (items, total) =
|
balanceReportAsCsv opts (items, total) =
|
||||||
["account","balance"] :
|
["account","balance"] :
|
||||||
[[T.unpack a, showMixedAmountOneLineWithoutPrice b] | (a, _, _, b) <- items]
|
[[T.unpack (maybeAccountNameDrop opts a), showMixedAmountOneLineWithoutPrice b] | (a, _, _, b) <- items]
|
||||||
++
|
++
|
||||||
if no_total_ opts
|
if no_total_ opts
|
||||||
then []
|
then []
|
||||||
@ -524,7 +524,7 @@ multiBalanceReportAsCsv opts (MultiBalanceReport (colspans, items, (coltotals,to
|
|||||||
++ (if row_total_ opts then ["Total"] else [])
|
++ (if row_total_ opts then ["Total"] else [])
|
||||||
++ (if average_ opts then ["Average"] else [])
|
++ (if average_ opts then ["Average"] else [])
|
||||||
) :
|
) :
|
||||||
[T.unpack a :
|
[T.unpack (maybeAccountNameDrop opts a) :
|
||||||
map showMixedAmountOneLineWithoutPrice
|
map showMixedAmountOneLineWithoutPrice
|
||||||
(amts
|
(amts
|
||||||
++ (if row_total_ opts then [rowtot] else [])
|
++ (if row_total_ opts then [rowtot] else [])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user