Author: doogie
Date: Thu Oct 1 19:30:41 2009
New Revision: 820761
URL:
http://svn.apache.org/viewvc?rev=820761&view=revLog:
Fix rounding error on order stats screen.
Modified:
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderStats.groovy
Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderStats.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderStats.groovy?rev=820761&r1=820760&r2=820761&view=diff==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderStats.groovy (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderStats.groovy Thu Oct 1 19:30:41 2009
@@ -17,6 +17,7 @@
* under the License.
*/
+import java.math.BigDecimal;
import java.util.*;
import java.sql.Timestamp;
import org.ofbiz.entity.*;
@@ -24,10 +25,10 @@
import org.ofbiz.entity.util.*;
import org.ofbiz.base.util.*;
-double calcItemTotal(List headers) {
- double total = 0.00;
+BigDecimal calcItemTotal(List headers) {
+ BigDecimal total = BigDecimal.ZERO;
headers.each { header ->
- total += header.grandTotal ?: 0.00;
+ total = total.plus(header.grandTotal ?: BigDecimal.ZERO);
}
return total;
}