mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-09 21:22:26 +03:00
bs/cf/is: show one trailing blank line, not two
This commit is contained in:
parent
11202c897a
commit
9d4d6ebc4d
@ -480,8 +480,7 @@ multiBalanceReportAsCsv opts (MultiBalanceReport (colspans, items, (coltotals,to
|
||||
-- | Render a multi-column balance report as plain text suitable for console output.
|
||||
multiBalanceReportAsText :: ReportOpts -> MultiBalanceReport -> String
|
||||
multiBalanceReportAsText opts r =
|
||||
printf "%s in %s:" typeStr (showDateSpan $ multiBalanceReportSpan r)
|
||||
++ "\n"
|
||||
printf "%s in %s:\n\n" typeStr (showDateSpan $ multiBalanceReportSpan r)
|
||||
++ renderBalanceReportTable opts tabl
|
||||
where
|
||||
tabl = balanceReportAsTable opts r
|
||||
@ -495,11 +494,16 @@ multiBalanceReportAsText opts r =
|
||||
-- made using 'balanceReportAsTable'), render it in a format suitable for
|
||||
-- console output.
|
||||
renderBalanceReportTable :: ReportOpts -> Table String String MixedAmount -> String
|
||||
renderBalanceReportTable (ReportOpts { pretty_tables_ = pretty, color_=usecolor }) = unlines . trimborder . lines
|
||||
. render pretty id (" " ++) showamt
|
||||
. align
|
||||
renderBalanceReportTable (ReportOpts { pretty_tables_ = pretty, color_=usecolor }) =
|
||||
unlines
|
||||
. addtrailingblank
|
||||
. trimborder
|
||||
. lines
|
||||
. render pretty id (" " ++) showamt
|
||||
. align
|
||||
where
|
||||
trimborder = ("":) . (++[""]) . drop 1 . init . map (drop 1 . init)
|
||||
addtrailingblank = (++[""])
|
||||
trimborder = drop 1 . init . map (drop 1 . init)
|
||||
align (Table l t d) = Table l' t d
|
||||
where
|
||||
acctswidth = maximum' $ map strWidth (headerContents l)
|
||||
|
@ -155,8 +155,8 @@ compoundBalanceCommand CompoundBalanceCommandSpec{..} CliOpts{command_=cmd, repo
|
||||
++ (if average_ ropts' then [overallaverage] else [])
|
||||
where
|
||||
overallaverage = overalltotal `divideMixedAmount` fromIntegral (length overalltotals)
|
||||
putStrLn title
|
||||
putStrLn $ renderBalanceReportTable ropts' overalltable'
|
||||
putStrLn $ title ++ "\n"
|
||||
putStr $ renderBalanceReportTable ropts' overalltable'
|
||||
|
||||
-- Add the second table below the first, discarding its column headings.
|
||||
concatTables (Table hLeft hTop dat) (Table hLeft' _ dat') =
|
||||
|
@ -45,7 +45,6 @@ Balance Sheet
|
||||
======================++=================================================================================================================================================
|
||||
Total || $1 $1 $1 $1 $1 0 0 0 0 0 0 0
|
||||
|
||||
|
||||
>>>=0
|
||||
|
||||
# 3.
|
||||
@ -74,7 +73,6 @@ Balance Sheet
|
||||
==============++=================================================================================================================================================
|
||||
Total || $1 $1 $1 $1 $1 0 0 0 0 0 0 0
|
||||
|
||||
|
||||
>>>= 0
|
||||
|
||||
# 4.
|
||||
@ -100,7 +98,6 @@ Balance Sheet
|
||||
======================++==========================================================================================================================================================
|
||||
Total || $1 $1 $1 $1 $1 0 0 0 0 0 0 0 0
|
||||
|
||||
|
||||
>>>= 0
|
||||
|
||||
# 5.
|
||||
@ -124,7 +121,6 @@ Balance Sheet
|
||||
----------------------++----------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|| 0 0 0 0 0 0 0 0 0 0 0 $1 $1
|
||||
|
||||
|
||||
>>>= 0
|
||||
|
||||
# 6. Tree output still works, #565
|
||||
@ -197,7 +193,6 @@ Balance Sheet
|
||||
=============++===============================
|
||||
Total || $1 $1 $1
|
||||
|
||||
|
||||
>>>2
|
||||
>>>=0
|
||||
|
||||
@ -225,6 +220,5 @@ Balance Sheet
|
||||
═════════════╬═════════════
|
||||
Total ║ 1
|
||||
|
||||
|
||||
>>>2
|
||||
>>>= 0
|
||||
|
@ -161,7 +161,6 @@ Cashflow Statement
|
||||
----------------------++-------------------------------------------------------------------------------------------------------------
|
||||
|| $1 0 0 0 0 $-1 0 0 0 0 0 $-1
|
||||
|
||||
|
||||
>>>= 0
|
||||
|
||||
# 7. Multicolumn test (historical)
|
||||
@ -179,7 +178,6 @@ Cashflow Statement (Historical Ending Balances)
|
||||
----------------------++----------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|| $1 $1 $1 $1 $1 0 0 0 0 0 0 $-1 0
|
||||
|
||||
|
||||
>>>= 0
|
||||
|
||||
# 8. without -N/--no-total (single column)
|
||||
@ -224,7 +222,6 @@ Cashflow Statement
|
||||
--------------------++-------
|
||||
|| $-1
|
||||
|
||||
|
||||
>>>2
|
||||
>>>= 0
|
||||
|
||||
@ -240,6 +237,5 @@ Cashflow Statement
|
||||
assets:bank:saving || $1
|
||||
assets:cash || $-2
|
||||
|
||||
|
||||
>>>2
|
||||
>>>= 0
|
||||
|
@ -208,7 +208,6 @@ Income Statement
|
||||
===================++===============================================================================================================================
|
||||
Total || $-1 0 0 0 0 $1 0 0 0 0 0 0 0 0
|
||||
|
||||
|
||||
>>>= 0
|
||||
|
||||
# 6. Multicolumn test (historical)
|
||||
@ -234,5 +233,4 @@ Income Statement (Historical Ending Balances)
|
||||
===================++=================================================================================================================================================
|
||||
Total || $-1 $-1 $-1 $-1 $-1 0 0 0 0 0 0 0
|
||||
|
||||
|
||||
>>>= 0
|
||||
|
Loading…
Reference in New Issue
Block a user