From e9d300bef31802c709db06a838ed20aefbf1ad7b Mon Sep 17 00:00:00 2001 From: Dmitry Astapov Date: Wed, 11 Sep 2019 23:11:23 +0100 Subject: [PATCH] lib: dont raise when there is neither budget nor transactions in the report period --- hledger-lib/Hledger/Reports/BudgetReport.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hledger-lib/Hledger/Reports/BudgetReport.hs b/hledger-lib/Hledger/Reports/BudgetReport.hs index 58386ec57..ecb0ee7ad 100644 --- a/hledger-lib/Hledger/Reports/BudgetReport.hs +++ b/hledger-lib/Hledger/Reports/BudgetReport.hs @@ -286,11 +286,11 @@ budgetReportAsText ropts@ReportOpts{..} budgetr@(PeriodicReport ( _, rows, _)) = Just (AtDate d _mc) -> ", valued at "++showDate d Nothing -> "") actualwidth = - maximum [ maybe 0 (length . showMixedAmountOneLineWithoutPrice) amt + maximum' [ maybe 0 (length . showMixedAmountOneLineWithoutPrice) amt | (_, _, _, amtandgoals, _, _) <- rows , (amt, _) <- amtandgoals ] budgetwidth = - maximum [ maybe 0 (length . showMixedAmountOneLineWithoutPrice) goal + maximum' [ maybe 0 (length . showMixedAmountOneLineWithoutPrice) goal | (_, _, _, amtandgoals, _, _) <- rows , (_, goal) <- amtandgoals ] -- XXX lay out actual, percentage and/or goal in the single table cell for now, should probably use separate cells