From b262be78380fef23840f188fbdadb31cbd62226b Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 5 Sep 2016 14:44:16 -0700 Subject: [PATCH] ui: fix wrong register start balance in historical mode 90c0d40 a few weeks ago miscalculated the starting balance in accountTransactionsReport. Possibly also affects -web and -api. --- hledger-lib/Hledger/Reports/TransactionsReports.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hledger-lib/Hledger/Reports/TransactionsReports.hs b/hledger-lib/Hledger/Reports/TransactionsReports.hs index 7d94da32a..cde7fae1d 100644 --- a/hledger-lib/Hledger/Reports/TransactionsReports.hs +++ b/hledger-lib/Hledger/Reports/TransactionsReports.hs @@ -161,8 +161,11 @@ accountTransactionsReport opts j reportq thisacctq = (label, items) (-- ltrace "priormatcher" $ And [thisacctq, realq, statusq, tostartdatequery])) $ transactionsPostings ts - tostartdatequery = Date (DateSpan Nothing startdate) - startdate = queryStartDate (date2_ opts) q + tostartdatequery = + case mstartdate of + Just _ -> Date (DateSpan Nothing mstartdate) + Nothing -> None -- no start date specified, don't add up any prior postings + mstartdate = queryStartDate (date2_ opts) q items = reverse $ -- see also registerChartHtml accountTransactionsReportItems q thisacctq startbal negate ts