mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-20 10:47:29 +03:00
fix: forecast: Make sure forecast transactions are generated up to the day before the provided query end date. (#1633)
This commit is contained in:
parent
3dbd441210
commit
1d278993bc
@ -143,7 +143,7 @@ journalAddForecast CliOpts{inputopts_=iopts, reportspec_=rspec} j =
|
||||
forecastbeginDefault = dbg2 "forecastbeginDefault" $ fromMaybe today mjournalend
|
||||
|
||||
-- "They end on or before the specified report end date, or 180 days from today if unspecified."
|
||||
mspecifiedend = dbg2 "specifieddates" $ reportPeriodLastDay rspec
|
||||
mspecifiedend = dbg2 "specifieddates" $ addDays 1 <$> reportPeriodLastDay rspec
|
||||
forecastendDefault = dbg2 "forecastendDefault" $ fromMaybe (addDays 180 today) mspecifiedend
|
||||
|
||||
forecastspan = dbg2 "forecastspan" $
|
||||
|
@ -218,3 +218,20 @@ commodity 1,000.00 USD
|
||||
2020-01-28 (a) 1,000.00 USD 2,000.00 USD
|
||||
>>>2
|
||||
>>>=0
|
||||
|
||||
# 11. Forecast transactions are generated up to the day before the requested end date
|
||||
hledger -f - reg -b 2021-01-01 -e 2021-01-05 --forecast
|
||||
<<<
|
||||
2021-01-01
|
||||
(a) 1000
|
||||
|
||||
~ daily
|
||||
(a) 1
|
||||
|
||||
>>>
|
||||
2021-01-01 (a) 1000 1000
|
||||
2021-01-02 (a) 1 1001
|
||||
2021-01-03 (a) 1 1002
|
||||
2021-01-04 (a) 1 1003
|
||||
>>>2
|
||||
>>>=0
|
||||
|
Loading…
Reference in New Issue
Block a user