[ 
http://mifosforge.jira.com/browse/MIFOS-4701?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jakub Sławiński resolved MIFOS-4701.
------------------------------------

      Resolution: Fixed
    Story Points: 0.5


This invalid behavior was caused by two bugs:

1. getTotalRepaymentDue() method used a lot of arithmetic operations on Doubles 
to calculate total repayment due amount. In this particular case you had the 
following situation:

principal: 9999.9999
interest: 1243.7299
total repayment due: 11243.729800000001

I fixed this by using BigDecimals instead of Doubles, so now we have the 
correct sum: 11243.7298

2. getLoanPaymentType() method used equals method to check if the payment is a 
full repayment. In this particular case you were comparing two amounts:
11243.729800000001 and 11243.7298
which were different. Moreover, the first value wasn't smaller or equal to 
total repayable amount, so this payment couldn't be treated as a future 
payment. This ended in returning null in this method.

I fixed this by extending the first check, i.e. amounts are the same when are 
different by amount smaller than tiny value (this is the same solution as in 
paymentAmountIsValid() method - this is why paymentAmountIsValid() method 
didn't throw exception here).

Moreover, I have extended one of the integration tests to check this particular 
scenario (i.e. principal: 9999.9999, interest: 1243.7299 and total repayment 
due: 11243.7298).

> CSE stack trace - in updateLoanStatus
> -------------------------------------
>
>                 Key: MIFOS-4701
>                 URL: http://mifosforge.jira.com/browse/MIFOS-4701
>             Project: mifos
>          Issue Type: Bug
>          Components: Collection Sheet Entry
>    Affects Versions: Elsie F
>            Reporter: jbrewster
>            Assignee: Jakub Sławiński
>            Priority: Major
>             Fix For: Elsie F, Elsie F - Iteration 11
>
>         Attachments: screenshot-1.jpg, screenshot-2.jpg
>
>
> Collection Sheet entry hits a stack trace when submitting collection sheet 
> for following parameters on test server http://ci.mifos.org:8120/mifos
> Center : Kay's Branch
> Date of transaction: 04/02/2011 
> Branch Office: Branch-1 
> Loan officer: Loan Officer1   
> Mode of payment: PayPal 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues

Reply via email to