After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 684670 - Interest amount calculation is wrong in Sqllite3 format
Interest amount calculation is wrong in Sqllite3 format
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Backend - SQL
2.4.x
Other Windows
: Normal normal
: ---
Assigned To: John Ralls
gnucash-core-maint
Depends on:
Blocks:
 
 
Reported: 2012-09-23 17:33 UTC by ar.eric
Modified: 2018-06-29 23:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description ar.eric 2012-09-23 17:33:39 UTC
Actions → Scheduled Transactions → Mortgage and Loan Repayment....

Loan Amount: 23000

Interest Rate: 3.168%

Type: Fixe rate


Start Date: 2009/06/22

Length: 84

Months Remaining: 47

With Xml => Interest 35.62 (right)
With Sqllite3 => Interest 61.36  (wrong)
Comment 1 ar.eric 2012-09-23 17:39:57 UTC
Repayment Frequency on the last screen: 
- Frequency: monthly 
- Start date for loan repayments: 2012/09/22
Comment 2 Frank H. Ellenberger 2012-09-23 22:17:55 UTC
If the result with the xml backend is right, we have a problem with the SQL backend.
Comment 3 John Ralls 2012-09-24 00:19:23 UTC
We have lots of problems with the SQL backend.

So with my trusty HP12C, I see that the first month's interest on 23000 is 60.72 and that after paying for 37 months it's 35.62. 61.36 is what the interest would be if the loan had had no payments for 48 months.

It would seem that the SQL backend isn't storing something, or is perhaps storing something incorrectly.
Comment 4 John Ralls 2013-09-10 23:06:16 UTC
After a bit of testing, a clarification and update:
Clarification: ignore the summary of payments in the last screen of the mortgage wizard. It's wrong, and it fortunately doesn't reflect what's actually created by the SX engine.

The procedure to follow is to run the wizard with the parameters above, click "Apply" at the end, then save (XML only) and quit or switch to a different file, then switch back, accepting the "since last run" box.
Update: For 10Sep2013, with that date as the first payment:
              Total    Principal   Interest
XML           $305.65   280.18      25.47
SQL           $305.65   244.29      61.36

If with SQL you select Actions>Scheduled Transactions>Since Last Run without quitting, the results are the same as for XML; this suggests that there's something that isn't saved correctly in the SX. Doing a "save as" to SQL with the pending SX *also* produces the same answer as XML, meaning that the problem is with a missing "mark dirty" to make the automated save rather than a failure of the SQL backend to completely save when its given the opportunity.
Comment 5 John Ralls 2013-09-12 23:32:31 UTC
OK, found and fixed it, r23164/5.
Comment 6 John Ralls 2017-09-24 22:43:55 UTC
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
Comment 7 John Ralls 2018-06-29 23:10:48 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=684670. Please update any external references or bookmarks.