[ 
http://mifosforge.jira.com/browse/MIFOS-2754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56959#action_56959
 ] 

Sam Birney commented on MIFOS-2754:
-----------------------------------


I think I see the problem.  This jsp page:

./application/src/main/webapp/pages/application/loan/jsp/glimLoanForm.jsp 

Is calling CalculateTotalLoanAmount which is defined in these two files:

./application/src/main/webapp/pages/application/loan/js/CreateLoanAccount.js    
                                      
./application/src/main/webapp/pages/application/loan/js/EditLoanAccount.js  

you can see that it is calling parseInt, assuming the loan amounts are integers 
rather than real numbers:

function CalculateTotalLoanAmount(length)
{
        
document.forms["loanAccountActionForm"].elements["loanAmount"].value="0.0";     
        for(var i=0,l=length; i<l; i++)
        {               
                var curAmountValue = 
parseInt(document.forms["loanAccountActionForm"].elements["clientDetails["+i+"].loanAmount"].value);
                if 
((document.forms["loanAccountActionForm"].elements["clients["+i+"]"].checked==true)
 && (!isNaN(curAmountValue)))
                {
                        
document.forms["loanAccountActionForm"].elements["loanAmount"].value=curAmountValue+parseInt(document.forms["loanAccountActionForm"].elements["loanAmount"].value);
                }
        }
}

HTH



> GLIM -- incorrect rounding off of loan amounts
> ----------------------------------------------
>
>                 Key: MIFOS-2754
>                 URL: http://mifosforge.jira.com/browse/MIFOS-2754
>             Project: mifos
>          Issue Type: Bug
>          Components: GLIM
>    Affects Versions: Release 1.4
>            Reporter: Sam Birney
>            Assignee: mifostriage
>            Priority: Critical
>
> decimal amounts are being dropped in GLIM loan calculations.
> REPRO:
> 1. make sure GLIM is enabled
> 2. find a group, for example with 3 clients
> 3. click to open a new loan account
> 4. enter amounts of 100.5 for each client's individual amount
> EXPECTED BEHAVIOR:
> 1. total loan amount = 301.5
> ACTUAL BEHAVIOR:
> 1. total loan amount = 300
> Yikes!  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://mifosforge.jira.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues

Reply via email to