-
-
Notifications
You must be signed in to change notification settings - Fork 842
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
[Bug]: Loan interest paid at end of quarter is accounted in next quarter's expenses #10917
Labels
Comments
I wanna work on this issue, can anyone help me, where I can get the code and how can I solve this. If you help me, this is going to be my first contribution in open-source. |
fwillard
added a commit
to fwillard/OpenTTD
that referenced
this issue
Jun 18, 2023
glx22
pushed a commit
that referenced
this issue
Jun 20, 2023
LordAro
pushed a commit
to LordAro/OpenTTD
that referenced
this issue
Jun 28, 2023
LordAro
pushed a commit
that referenced
this issue
Jun 28, 2023
mrmbernardi
pushed a commit
to mrmbernardi/OpenTTD
that referenced
this issue
Jul 2, 2023
shoter
pushed a commit
to shoter/OpenTTD
that referenced
this issue
Jul 16, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version of OpenTTD
Since before svn r1 (via git blame)
Expected result
Loan interest paid at the end of a quarter should be accounted for in the quarterly operating expenses for that quarter.
For example, loan interest paid for March 2022 should be accounted for in the quarterly operating expenses for Q1 2022.
Actual result
Loan interest paid at the end of a quarter is accounted for in the quarterly operating expenses for next quarter.
For example, loan interest paid for March 2022 is accounted for in the quarterly operating expenses for Q2 2022.
Furthermore, if loan interest is paid for December of a given year, that interest gets accounted for in the yearly totals for that year but the quarterly expenses for next year, causing a discrepancy between the annual totals and the quarterly totals (the sum of the quarterlies don't add up to the annual).
Steps to reproduce
This is best reproduced in a scenario where you otherwise would not need a loan (such as in an established company or in a new game with the money cheat).
See JGRennison/OpenTTD-patches#524 for more detailed reproduction steps and a screenshot of the erroneous accounting. One fix, as implemented in JGRPP by @JGRennison, is simply to move
CompaniesPayInterest()
such that it occurs beforeCompaniesGenStatistics()
.The alternative fix would be to somehow make the loan interest paid for December of a given year to be posted in the annual totals for next year. That would also solve the discrepancy, but in the other direction (loan interest payments for a given month are reported at the beginning of the month after).
The text was updated successfully, but these errors were encountered: