Author: ashish
Date: Thu Mar 10 13:35:23 2011
New Revision: 1080218
URL:
http://svn.apache.org/viewvc?rev=1080218&view=revLog:
Bug fix. Orderstats
https://localhost:8443/ordermgr/control/orderstats was not resetting the amounts, we have observed this issue when we ran this report on March 01 and March 2. There were calculation issue with february month.
Thanks Amit for the contribution.
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=1080218&r1=1080217&r2=1080218&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 Mar 10 13:35:23 2011
@@ -41,22 +41,10 @@ double calcItemCount(List items) {
return count;
}
-cal = Calendar.getInstance();
-cal.set(Calendar.AM_PM, Calendar.AM);
-cal.set(Calendar.HOUR, 0);
-cal.set(Calendar.MINUTE, 0);
-cal.set(Calendar.SECOND, 0);
-cal.set(Calendar.MILLISECOND, 0);
-dayBegin = new Timestamp(cal.getTime().getTime());
-
-cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
-weekBegin = new Timestamp(cal.getTime().getTime());
-
-cal.set(Calendar.DAY_OF_MONTH, 1);
-monthBegin = new Timestamp(cal.getTime().getTime());
-
-cal.set(Calendar.MONTH, 0);
-yearBegin = new Timestamp(cal.getTime().getTime());
+dayBegin = UtilDateTime.getDayStart(nowTimestamp, timeZone, locale);
+weekBegin = UtilDateTime.getWeekStart(nowTimestamp, timeZone, locale);
+monthBegin = UtilDateTime.getMonthStart(nowTimestamp, timeZone, locale);
+yearBegin = UtilDateTime.getYearStart(nowTimestamp, timeZone, locale);
// order status report
ecl = EntityCondition.makeCondition([