bal: keep csv column and row labels consistently lower case

It was reported on #hledger that bal -O csv capitalises "account"
differently for single and multi-period reports. All lower case seems
to be the most common, so I have dropped the capitalisation. Also
the trailing colon from --transpose's "total:".
This commit is contained in:
Simon Michael 2021-03-27 10:54:52 -07:00
parent 03f06128dc
commit 5db75c39df
2 changed files with 6 additions and 6 deletions

View File

@ -477,9 +477,9 @@ multiBalanceReportAsCsv :: ReportOpts -> MultiBalanceReport -> CSV
multiBalanceReportAsCsv opts@ReportOpts{average_, row_total_} multiBalanceReportAsCsv opts@ReportOpts{average_, row_total_}
(PeriodicReport colspans items (PeriodicReportRow _ coltotals tot avg)) = (PeriodicReport colspans items (PeriodicReportRow _ coltotals tot avg)) =
maybetranspose $ maybetranspose $
("Account" : map showDateSpan colspans ("account" : map showDateSpan colspans
++ ["Total" | row_total_] ++ ["total" | row_total_]
++ ["Average" | average_] ++ ["average" | average_]
) : ) :
[displayName a : [displayName a :
map (wbToText . showMixedAmountB oneLine) map (wbToText . showMixedAmountB oneLine)
@ -490,7 +490,7 @@ multiBalanceReportAsCsv opts@ReportOpts{average_, row_total_}
++ ++
if no_total_ opts if no_total_ opts
then [] then []
else ["Total:" : else ["total" :
map (wbToText . showMixedAmountB oneLine) ( map (wbToText . showMixedAmountB oneLine) (
coltotals coltotals
++ [tot | row_total_] ++ [tot | row_total_]

View File

@ -13,12 +13,12 @@ Balance changes in 2012-12-01..2013-03-31:
hledger -f balance-multicol.journal balance -M -A -O csv --transpose hledger -f balance-multicol.journal balance -M -A -O csv --transpose
>>> >>>
"Account","assets","assets:cash","assets:checking","Total:" "account","assets","assets:cash","assets:checking","total"
"2012-12","0","0","10","10" "2012-12","0","0","10","10"
"2013-01","0","0","0","0" "2013-01","0","0","0","0"
"2013-02","1","1","0","2" "2013-02","1","1","0","2"
"2013-03","0","0","1","1" "2013-03","0","0","1","1"
"Average","0","0","3","3" "average","0","0","3","3"
>>>=0 >>>=0