From a681e5329d35666ce3e607426af9ef6739449c2b Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sun, 11 Jul 2021 11:01:01 -1000 Subject: [PATCH] fix: ui: transaction: possibly off-by-one valuation date I'm not sure if it arose in practice, but: ensure TransactionScreen in V mode would correctly use the journal's last day as valuation date, not the day after that. --- hledger-lib/Hledger/Reports/ReportOptions.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hledger-lib/Hledger/Reports/ReportOptions.hs b/hledger-lib/Hledger/Reports/ReportOptions.hs index c8e854806..852ee282f 100644 --- a/hledger-lib/Hledger/Reports/ReportOptions.hs +++ b/hledger-lib/Hledger/Reports/ReportOptions.hs @@ -636,8 +636,8 @@ reportPeriodOrJournalLastDay :: ReportSpec -> Journal -> Maybe Day reportPeriodOrJournalLastDay rspec j = reportPeriodLastDay rspec <|> journalOrPriceEnd where journalOrPriceEnd = case value_ $ rsOpts rspec of - Just (AtEnd _) -> max (journalEndDate False j) lastPriceDirective - _ -> journalEndDate False j + Just (AtEnd _) -> max (journalLastDay False j) lastPriceDirective + _ -> journalLastDay False j lastPriceDirective = fmap (addDays 1) . maximumMay . map pddate $ jpricedirectives j -- | Make a name for the given period in a multiperiod report, given