I've discovered the source of the defects -- The corresponding JSPs were
incorrectly bypassing the decimal display logic -- see details below.

Following developer guidelines, I'd like to create tests for this behavior,
but can't find any automated tests of display logic within mifos.
Mifos.org<http://mifos.org/>mentions use of WATIR, and plans to
migrate to Selenium. I intend to
practice with Selenium anyway and can proceed with this before submitting
the patch. Or, will manual verification suffice?

Please advise.

Keith Pierce

-----------------------------------
comment posted to the issue tracker:


This defect is caused by a JSP coding error, which causes the JSP to bypass
logic that formats the correct number of digits to the right of the decimal
point. Here are the details:
When instantiated with a monetary amount, a Money object
retrievesCurrency.defaultDigitsAfterDecimal (from the CURRENCY table
via Hibernate) and
uses it to set the scale of its amount attribute -- a BigDecimal value.
Normally, when a JSP wants to display a monetary amount, it invokes the "out"
custom tag with argument equal to the Money instance. This in turn
invokesMoney.toString(), which correctly formats the decimal display.

However, in 11 instances spread over 7 JSPs, the code first applies
amountDoubleValue to the Money.amount and then displays the double value. Java
applies its own internal rules for formatting double values, effectively
bypassing MifOS conventions described above.

The fix is simple -- just remove the "amountDoubleValue" and apply the "out" tag
to the Money object itself. I will make those changes and submit the patch.

The JSPs involved are:
* view_centerchargesdetail.jsp
* view_clientchargesdetail.jsp
* viewClientDetails.jsp
* view_groupchargesdetail.jsp
* viewgroupdetails.jsp
* closesavingsaccount.jsp
* reviewclosesavings.jsp
-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

Reply via email to