From b82e800ae6dc3439748243b31764c9efa007a79c Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 30 Mar 2017 17:18:30 -0700 Subject: [PATCH] bs/cf/is: fix subtitle appearing above total (and put on one line) (#527) --- hledger/Hledger/Cli/BalanceView.hs | 7 +++---- tests/cashflow/cashflow.test | 3 +-- tests/incomestatement/incomestatement.test | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/hledger/Hledger/Cli/BalanceView.hs b/hledger/Hledger/Cli/BalanceView.hs index 5db8129ed..941386665 100644 --- a/hledger/Hledger/Cli/BalanceView.hs +++ b/hledger/Hledger/Cli/BalanceView.hs @@ -117,13 +117,13 @@ balanceviewReport :: BalanceView -> CliOpts -> Journal -> IO () balanceviewReport BalanceView{..} CliOpts{reportopts_=ropts, rawopts_=raw} j = do currDay <- getCurrentDay let q0 = queryFromOpts currDay ropts' + let title = bvtitle ++ maybe "" (' ':) balanceclarification case interval_ ropts' of NoInterval -> do let (views, amt) = foldMap (uncurry (balanceviewQueryReport ropts' q0 j)) bvqueries - mapM_ putStrLn (bvtitle : "" : views) - mapM_ putStrLn balanceclarification + mapM_ putStrLn (title : "" : views) unless (no_total_ ropts') . mapM_ putStrLn $ [ "Total:" @@ -151,8 +151,7 @@ balanceviewReport BalanceView{..} CliOpts{reportopts_=ropts, rawopts_=raw} j = d (sumAmts ++ (if row_total_ ropts' then [totsum] else []) ++ (if average_ ropts' then [totavg] else []) ) - putStrLn bvtitle - mapM_ putStrLn balanceclarification + putStrLn title putStrLn $ renderBalanceReportTable ropts totTabl where overwriteBalanceType = diff --git a/tests/cashflow/cashflow.test b/tests/cashflow/cashflow.test index 14859225e..b2fac9320 100644 --- a/tests/cashflow/cashflow.test +++ b/tests/cashflow/cashflow.test @@ -182,8 +182,7 @@ Cashflow Statement # 6. Multicolumn test (historical) hledger -f sample.journal cashflow -p 'monthly in 2008' -A --historical >>> -Cashflow Statement -(Historical Ending Balances) +Cashflow Statement (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 ======================++========================================================================================================================================================== diff --git a/tests/incomestatement/incomestatement.test b/tests/incomestatement/incomestatement.test index 0b4aad058..c99ce0c20 100644 --- a/tests/incomestatement/incomestatement.test +++ b/tests/incomestatement/incomestatement.test @@ -214,8 +214,7 @@ Income Statement # 6. Multicolumn test (historical) hledger -f sample.journal incomestatement -p 'monthly in 2008' --historical >>> -Income Statement -(Historical Ending Balances) +Income Statement (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 ===================++=================================================================================================================================================