From 93fbc0e9892d96d58333d70c3a483933168bb4fd Mon Sep 17 00:00:00 2001 From: Nicholas Niro Date: Tue, 11 Jul 2017 13:49:08 -0400 Subject: [PATCH] lib: Fix of a bug with the -H option. This patch fixes a bug that happened when using the -H option on a period without any transaction. Previously, the behavior was no output at all even though it should have shown the previous ending balances of past transactions. (This is similar to previously using -H with -E, but with the extra advantage of not showing empty accounts) --- hledger-lib/Hledger/Reports/MultiBalanceReports.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hledger-lib/Hledger/Reports/MultiBalanceReports.hs b/hledger-lib/Hledger/Reports/MultiBalanceReports.hs index 6203e64b7..bba296a06 100644 --- a/hledger-lib/Hledger/Reports/MultiBalanceReports.hs +++ b/hledger-lib/Hledger/Reports/MultiBalanceReports.hs @@ -156,7 +156,7 @@ multiBalanceReport opts q j = MultiBalanceReport (displayspans, items, totalsrow dbg1 "displayedAccts" $ (if tree_ opts then expandAccountNames else id) $ nub $ map (clipOrEllipsifyAccountName depth) $ - if empty_ opts then nub $ sort $ startAccts ++ postedAccts else postedAccts + if empty_ opts || (balancetype_ opts) == HistoricalBalance then nub $ sort $ startAccts ++ postedAccts else postedAccts acctBalChangesPerSpan :: [[(ClippedAccountName, MixedAmount)]] = dbg1 "acctBalChangesPerSpan"