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.
This commit is contained in:
Simon Michael 2021-07-11 11:01:01 -10:00
parent 5d2caf3c7f
commit a681e5329d

View File

@ -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