bs/cf/is: fix subtitle appearing above total (and put on one line) (#527)

This commit is contained in:
Simon Michael 2017-03-30 17:18:30 -07:00
parent afd58b8451
commit b82e800ae6
3 changed files with 5 additions and 8 deletions

View File

@ -117,13 +117,13 @@ balanceviewReport :: BalanceView -> CliOpts -> Journal -> IO ()
balanceviewReport BalanceView{..} CliOpts{reportopts_=ropts, rawopts_=raw} j = do balanceviewReport BalanceView{..} CliOpts{reportopts_=ropts, rawopts_=raw} j = do
currDay <- getCurrentDay currDay <- getCurrentDay
let q0 = queryFromOpts currDay ropts' let q0 = queryFromOpts currDay ropts'
let title = bvtitle ++ maybe "" (' ':) balanceclarification
case interval_ ropts' of case interval_ ropts' of
NoInterval -> do NoInterval -> do
let (views, amt) = let (views, amt) =
foldMap (uncurry (balanceviewQueryReport ropts' q0 j)) foldMap (uncurry (balanceviewQueryReport ropts' q0 j))
bvqueries bvqueries
mapM_ putStrLn (bvtitle : "" : views) mapM_ putStrLn (title : "" : views)
mapM_ putStrLn balanceclarification
unless (no_total_ ropts') . mapM_ putStrLn $ unless (no_total_ ropts') . mapM_ putStrLn $
[ "Total:" [ "Total:"
@ -151,8 +151,7 @@ balanceviewReport BalanceView{..} CliOpts{reportopts_=ropts, rawopts_=raw} j = d
(sumAmts ++ (if row_total_ ropts' then [totsum] else []) (sumAmts ++ (if row_total_ ropts' then [totsum] else [])
++ (if average_ ropts' then [totavg] else []) ++ (if average_ ropts' then [totavg] else [])
) )
putStrLn bvtitle putStrLn title
mapM_ putStrLn balanceclarification
putStrLn $ renderBalanceReportTable ropts totTabl putStrLn $ renderBalanceReportTable ropts totTabl
where where
overwriteBalanceType = overwriteBalanceType =

View File

@ -182,8 +182,7 @@ Cashflow Statement
# 6. Multicolumn test (historical) # 6. Multicolumn test (historical)
hledger -f sample.journal cashflow -p 'monthly in 2008' -A --historical hledger -f sample.journal cashflow -p 'monthly in 2008' -A --historical
>>> >>>
Cashflow Statement Cashflow Statement (Historical Ending Balances)
(Historical Ending Balances)
|| 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31 Average || 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31 Average
======================++========================================================================================================================================================== ======================++==========================================================================================================================================================

View File

@ -214,8 +214,7 @@ Income Statement
# 6. Multicolumn test (historical) # 6. Multicolumn test (historical)
hledger -f sample.journal incomestatement -p 'monthly in 2008' --historical hledger -f sample.journal incomestatement -p 'monthly in 2008' --historical
>>> >>>
Income Statement Income Statement (Historical Ending Balances)
(Historical Ending Balances)
|| 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31 || 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31
===================++================================================================================================================================================= ===================++=================================================================================================================================================