Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forecast end date appears off by one #1633

Closed
simonmichael opened this issue Jul 31, 2021 · 3 comments
Closed

forecast end date appears off by one #1633

simonmichael opened this issue Jul 31, 2021 · 3 comments
Labels
A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. aregister balance docs Documentation-related. journal The journal file format, and its features. register

Comments

@simonmichael
Copy link
Owner

simonmichael commented Jul 31, 2021

As I think we mentioned somewhere recently, when generating forecast transactions, hledger treats the end date as inclusive, rather than exclusive. It means that forecast transactions can end a day earlier than you would expect, and it's not mentioned in docs. Today I found it confusing, and I think we should make it consistent. Examples:

2021-07-26
  (assets)  1000

~ daily
    (assets)                                       1

reg/areg forecast reports end 2 days before the -e ENDDATE (or --forecast=..ENDDATE),
(rather than the usual 1 day before), unless there are also real transactions up to that date:

$ hledger-1.22 areg -w80 assets -b 2021-07-31 -e 2021-08-05 --forecast
Transactions in assets and subaccounts:
2021-07-31                      assets                           1          1005
2021-08-01                      assets                           1          1006
2021-08-02                      assets                           1          1007
2021-08-03                      assets                           1          1008

bal -D goes to 1 day before (since 1.21), but forecasted transactions still end 2 days before:

$ hledger-1.22 bal --transpose -D assets -b 2021-07-31 -e 2021-08-05 --forecast
Balance changes in 2021-07-31..2021-08-04:

            || assets |   
============++========+===
 2021-07-31 ||      1 | 1 
 2021-08-01 ||      1 | 1 
 2021-08-02 ||      1 | 1 
 2021-08-03 ||      1 | 1 
 2021-08-04 ||      0 | 0 
@simonmichael simonmichael added A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. docs Documentation-related. journal The journal file format, and its features. aregister balance register labels Jul 31, 2021
@Xitian9
Copy link
Collaborator

Xitian9 commented Aug 2, 2021

Is the ideal behaviour to have it go to 1 day before or to the end date?

@simonmichael
Copy link
Owner Author

simonmichael commented Aug 2, 2021 via email

simonmichael pushed a commit that referenced this issue Aug 3, 2021
@simonmichael
Copy link
Owner Author

Fixed by #1637.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. aregister balance docs Documentation-related. journal The journal file format, and its features. register
Projects
None yet
Development

No branches or pull requests

2 participants