Bug 335277

Summary: 0% interest rate loan is miscalculed
Product: [Applications] kmymoney Reporter: lephilousophe
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal CC: onet.cristian
Priority: NOR    
Version: 4.6.6   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Patch that fixes the bug

Description lephilousophe 2014-05-24 13:00:27 UTC
When you create a loan with 0% interest rate, the scheduled transaction is OK but the forecast in the Loan register is wrong with a huge negative number (autoCalc). As a side effect the planned operation in the check account register is in red.

Reproducible: Always

Steps to Reproduce:
1. Create a 0% interest loan
2. Go to loan register and see the planned operation

Actual Results:  
Operation has a huge negative number

Expected Results:  
Operation should be the amortization value which is equal to the payment value in this case (no interests)

I attach a patch that fixes the bug
Comment 1 lephilousophe 2014-05-24 13:01:42 UTC
Created attachment 86797 [details]
Patch that fixes the bug
Comment 2 Cristian Oneț 2014-07-31 14:36:24 UTC
The patch looks good, I'll take care of it.
Comment 3 Cristian Oneț 2014-09-23 06:03:46 UTC
Git commit ed3ef1673cc960e48949fb310881b74a29ce657a by Cristian Oneț.
Committed on 23/09/2014 at 06:00.
Pushed by conet into branch 'master'.

Fix the forecast of a '0%' interest rate loan payment.

Take the interest split into account only when it's valid. Thanks
to 'lephilousophe@users.sourceforge.net' for the patch.

M  +8    -4    kmymoney/mymoney/mymoneyforecast.cpp

http://commits.kde.org/kmymoney/ed3ef1673cc960e48949fb310881b74a29ce657a