-
Notifications
You must be signed in to change notification settings - Fork 816
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 797824 - Inconsistent behavior in Loan Review #2060
base: stable
Are you sure you want to change the base?
Conversation
fix the shift issue in loan review
I see. I think my fix has resolved the issue with the first incorrect payment. The missing payment in your previous figure is due to the start date configuration. The current mechanism calculates the end date based on the start date and the number of periods. In your earlier setting, the start date was set to the default, let’s assume it was 01/25/2025, with a 6-month duration. The end date would then be calculated as 06/25/2025. However, if we start the payment from 02/01/2025 and aim for 6 payments, the last payment would fall on 07/01/2025, which is after the calculated end date and it will be filtered during calculating the review. A propose solution is to calculate the payments review using the remain months. This also aligns with the final created schedules. |
Fair enough, but a partial payment on the first day of the loan is called a down payment and technically isn't part of the loan. For house mortgages the first payment is usually near the beginning of the following month; auto loans may defer payments for up to a year.
A 6-month loan beginning on 12/1 is due on 5/31. Strictly speaking if we start monthly payments on 2/1 then we would expect to have 5 payments of roughly $210 with the last one on 5/31. But we have a problem in the Months Remaining box: If we leave it to itself it changes the number to 4 and assumes that we've already made two payments; if we push it to 6 it decides that we have until 7/1 to pay. Fixing that's out of scope for the bug and is deeper in the logic of the assistant. I'm satisfied that your current change fixes the date issues sufficiently to satisfy the bug. I'll do a code review tomorrow (it's already past my bedtime), but assuming it all looks good I'm willing to merge this as-is and I'll leave it up to you whether to work on getting the interest calculations right on a separate PR. |
Yeah, I agree. The generation logic need more discussion. I will revert the repayments generation code that based on remain month.
The interest fix is also included in this pr. It depends on the remain month. Maybe you can help take a look. |
Notice that the formula (labeled Amount) is unaffected by the payments schedule. That explains a lot of the problem. I wondered if it had been noticed and found a lot of bugs documenting problems with it. |
fix the shift issue in loan review. More discussion is https://bugs.gnucash.org/show_bug.cgi?id=797824