diff --git a/applications/order/entitydef/entitymodel_olap.xml b/applications/order/entitydef/entitymodel_olap.xml
index 953bd1fe9a..97346b9e98 100644
--- a/applications/order/entitydef/entitymodel_olap.xml
+++ b/applications/order/entitydef/entitymodel_olap.xml
@@ -91,6 +91,10 @@ under the License.
Gross Profit: Gross Merchandize Profit less Gross Shipping Profit.
+
+
+ Count of order.
+
diff --git a/applications/order/script/org/ofbiz/order/olap/FactServices.xml b/applications/order/script/org/ofbiz/order/olap/FactServices.xml
index fe8ef2827b..c7f0fcff8b 100644
--- a/applications/order/script/org/ofbiz/order/olap/FactServices.xml
+++ b/applications/order/script/org/ofbiz/order/olap/FactServices.xml
@@ -120,11 +120,13 @@ under the License.
-
-
-
-
-
+
+
+
+
+
+
+
@@ -193,6 +195,7 @@ under the License.
+
@@ -206,19 +209,20 @@ under the License.
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
@@ -230,34 +234,36 @@ under the License.
-
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
@@ -324,18 +330,17 @@ under the License.
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
@@ -372,45 +377,39 @@ under the License.
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
@@ -420,11 +419,27 @@ under the License.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
+
+
+
+
-
-
+
+
-
-
+
+
@@ -461,4 +480,33 @@ under the License.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/applications/order/script/org/ofbiz/order/reports/SalesReportEvent.xml b/applications/order/script/org/ofbiz/order/reports/SalesReportEvent.xml
index e9e0d3cae1..d7fd18ec95 100644
--- a/applications/order/script/org/ofbiz/order/reports/SalesReportEvent.xml
+++ b/applications/order/script/org/ofbiz/order/reports/SalesReportEvent.xml
@@ -25,47 +25,258 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/applications/order/servicedef/services_olap.xml b/applications/order/servicedef/services_olap.xml
index 347e6ef528..0adfd0f0d9 100644
--- a/applications/order/servicedef/services_olap.xml
+++ b/applications/order/servicedef/services_olap.xml
@@ -40,9 +40,25 @@ under the License.
-
- Import Sales Order Data.
+
+ Load Sales Order Data Daily.
-
+
+ Import Sales Order Data.
+
+
+
+
+
+ Import Sales Order Data.
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/applications/order/webapp/ordermgr/WEB-INF/actions/reports/CheckReportBy.groovy b/applications/order/webapp/ordermgr/WEB-INF/actions/reports/CheckReportBy.groovy
index 34ba9c7391..8c56cc782d 100644
--- a/applications/order/webapp/ordermgr/WEB-INF/actions/reports/CheckReportBy.groovy
+++ b/applications/order/webapp/ordermgr/WEB-INF/actions/reports/CheckReportBy.groovy
@@ -21,19 +21,48 @@ import javax.servlet.http.HttpServletRequest;
import org.ofbiz.base.util.UtilValidate;
reportBy = parameters.reportBy;
+exportType = parameters.exportType;
if (UtilValidate.isEmpty(parameters.fromDate)) {
request.setAttribute("_ERROR_MESSAGE_", "Please select From Date.");
return "error";
}
-if (reportBy == "day") {
- return "day";
-} else if (reportBy == "week") {
- return "week";
-} else if (reportBy == "month") {
- return "month";
-} else {
- request.setAttribute("_ERROR_MESSAGE_", "Please select Report By.");
- return "error";
+if (exportType == "pdf") {
+ if (reportBy == "day") {
+ return "dayPDF";
+ } else if (reportBy == "week") {
+ return "weekPDF";
+ } else if (reportBy == "month") {
+ return "monthPDF";
+ } else {
+ request.setAttribute("_ERROR_MESSAGE_", "Please select Report By.");
+ return "error";
+ }
+}
+
+if (exportType == "excel") {
+ if (reportBy == "day") {
+ return "dayExcel";
+ } else if (reportBy == "week") {
+ return "weekExcel";
+ } else if (reportBy == "month") {
+ return "monthExcel";
+ } else {
+ request.setAttribute("_ERROR_MESSAGE_", "Please select Report By.");
+ return "error";
+ }
+}
+
+if (exportType == "html") {
+ if (reportBy == "day") {
+ return "dayHTML";
+ } else if (reportBy == "week") {
+ return "weekHTML";
+ } else if (reportBy == "month") {
+ return "monthHTML";
+ } else {
+ request.setAttribute("_ERROR_MESSAGE_", "Please select Report By.");
+ return "error";
+ }
}
diff --git a/applications/order/webapp/ordermgr/WEB-INF/actions/reports/SalesReport.groovy b/applications/order/webapp/ordermgr/WEB-INF/actions/reports/SalesReport.groovy
index 2b2469ab72..8534510ccd 100644
--- a/applications/order/webapp/ordermgr/WEB-INF/actions/reports/SalesReport.groovy
+++ b/applications/order/webapp/ordermgr/WEB-INF/actions/reports/SalesReport.groovy
@@ -30,8 +30,9 @@ int year = cal.get(Calendar.YEAR);
birtParameters = [:];
try {
birtParameters.reportBy = parameters.reportBy;
- birtParameters.fromDate = (Date.valueOf(fromDateStr))-3;
+ birtParameters.fromDate = (Date.valueOf(fromDateStr))-2;
birtParameters.thruDate = Date.valueOf(fromDateStr);
+ birtParameters.lastDate = (Date.valueOf(fromDateStr))-7;
birtParameters.thruWeek = week;
birtParameters.thruMonth = month;
birtParameters.thisYear = year;
diff --git a/applications/order/webapp/ordermgr/WEB-INF/controller.xml b/applications/order/webapp/ordermgr/WEB-INF/controller.xml
index 54f7e7dcd0..44c821976c 100644
--- a/applications/order/webapp/ordermgr/WEB-INF/controller.xml
+++ b/applications/order/webapp/ordermgr/WEB-INF/controller.xml
@@ -1160,9 +1160,15 @@ under the License.
-
-
-
+
+
+
+
+
+
+
+
+
@@ -1170,15 +1176,39 @@ under the License.
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1935,9 +1965,15 @@ under the License.
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/applications/order/webapp/ordermgr/reports/SalesReport.rptdesign b/applications/order/webapp/ordermgr/reports/SalesReport.rptdesign
index 0f65d6e981..1c07814d00 100644
--- a/applications/order/webapp/ordermgr/reports/SalesReport.rptdesign
+++ b/applications/order/webapp/ordermgr/reports/SalesReport.rptdesign
@@ -124,6 +124,16 @@ under the License.
/templates/blank_report.gif
auto layout
+
+ static
+ string
+ true
+ simple
+ text-box
+
+ Unformatted
+
+
static
false
@@ -146,9 +156,10 @@ under the License.
Unformatted
-
+
static
- string
+ false
+ date
true
simple
text-box
@@ -243,31 +254,36 @@ under the License.
10
- quantity
+ countOrder
integer
11
- GS
+ quantity
integer
12
- GMS
+ GS
integer
13
- GMP
+ GMS
integer
14
- GSP
+ GMP
integer
15
+ GSP
+ integer
+
+
+ 16
GP
integer
@@ -309,6 +325,10 @@ under the License.
orderDateDescription
orderDateDescription
+
+ countOrder
+ countOrder
+
quantity
quantity
@@ -383,31 +403,36 @@ under the License.
10
- quantity
+ countOrder
integer
11
- GS
+ quantity
integer
12
- GMS
+ GS
integer
13
- GMP
+ GMS
integer
14
- GSP
+ GMP
integer
15
+ GSP
+ integer
+
+
+ 16
GP
integer
@@ -427,6 +452,7 @@ try
reportBy = params["reportBy"].value;
fromDate = params["fromDate"].value;
thruDate = params["thruDate"].value;
+ lastDate = params["lastDate"].value;
thruWeek = params["thruWeek"].value;
thruMonth = params["thruMonth"].value;
thisYear = params["thisYear"].value;
@@ -434,6 +460,7 @@ try
methodContext.putEnv("reportBy", reportBy);
methodContext.putEnv("fromDate", fromDate);
methodContext.putEnv("thruDate", thruDate);
+ methodContext.putEnv("lastDate", lastDate);
methodContext.putEnv("thruWeek", thruWeek);
methodContext.putEnv("thruMonth", thruMonth);
methodContext.putEnv("thisYear", thisYear);
@@ -468,6 +495,7 @@ if (starschemas)
pod = starschema.getString("pod");
account = starschema.getString("account");
+ countOrder = starschema.getString("countOrder");
quantity = starschema.getString("quantity");
GS = starschema.getString("GS");
GMS = starschema.getString("GMS");
@@ -484,6 +512,7 @@ if (starschemas)
row["orderDateWeekOfYear"] = orderDateWeekOfYear;
row["orderDateDayName"] = orderDateDayName;
row["orderDateDescription"] = orderDateDescription;
+ row["countOrder"] = countOrder;
row["quantity"] = quantity;
row["GS"] = GS;
row["GMS"] = GMS;
@@ -558,6 +587,10 @@ return true;]]>
+
+ dataSetRow["countOrder"]
+ integer
+
dataSetRow["quantity"]
integer
@@ -643,12 +676,14 @@ return true;]]>
- us-legal
+ custom
+ 10in
+ 20in
landscape
- 0.25in
- 0.25in
- 0.25in
- 0.25in
+ 0.5in
+ 0.5in
+ 0.5in
+ 0.5in
sans-serif
@@ -670,6 +705,91 @@ return true;]]>
+
+ countOrder
+
+
+ Account/Account
+ Date/orderDateDescription
+ sans-serif
+ #FFEBCD
+ center
+
+
+
+ Fixed
+ #,##0
+
+ countOrder_Account/Account_Date/orderDateDescription
+
+
+
+
+
+
+ Account/Brand
+ Date/orderDateDescription
+ sans-serif
+ #87CEFA
+ center
+
+
+
+ Fixed
+ #,##0
+
+ countOrder_Account/Brand_Date/orderDateDescription
+
+
+
+
+ Account/Pod
+ Date/orderDateDescription
+ sans-serif
+ #B0C4DE
+ center
+
+
+
+ Fixed
+ #,##0
+
+ countOrder_Account/Pod_Date/orderDateDescription
+
+
+
+
+ Date/orderDateDescription
+ sans-serif
+ #6495ED
+ center
+
+
+
+ Fixed
+ #,##0
+
+ countOrder_Date/orderDateDescription
+
+
+
+
+
+
+
+
+
+ sans-serif
+ small
+ bold
+ #ECE9D8
+ center
+
+
+
quantity
@@ -935,7 +1055,7 @@ return true;]]>
#FFEBCD
center
-
+
Fixed
#,##0
@@ -954,12 +1074,12 @@ return true;]]>
#87CEFA
center
-
+
Fixed
#,##0
- GP_Account/Brand_Date/orderDateDescription
+ Brand_GP
@@ -970,12 +1090,12 @@ return true;]]>
#B0C4DE
center
-
+
Fixed
#,##0
- GP_Account/Pod_Date/orderDateDescription
+ Pod_GP
@@ -985,12 +1105,12 @@ return true;]]>
#6495ED
center
-
+
Fixed
#,##0
- GP_Date/orderDateDescription
+ Grand_GP
@@ -1461,6 +1581,20 @@ return true;]]>
+
+ Date/orderDateMonthOfYear
+
+
+
+
+ orderDateMonthOfYear
+
+
+ #FFEBCD
+ center
+
+
+
Date/orderDateMonthName
@@ -1515,6 +1649,7 @@ return true;]]>
+ sans-serif
#FFFFFF
BIC_DataCube
@@ -2123,6 +2258,70 @@ return true;]]>
}
float
+
+ Account_GP
+ data["GMP_Account/Account_Date/orderDateDescription"]+data["GSP_Account/Account_Date/orderDateDescription"]
+ integer
+
+
+ Pod_GP
+ data["GMP_Account/Pod_Date/orderDateDescription"]+data["GSP_Account/Pod_Date/orderDateDescription"]
+ integer
+
+
+ Brand_GP
+ data["GMP_Account/Brand_Date/orderDateDescription"]+data["GSP_Account/Brand_Date/orderDateDescription"]
+ integer
+
+
+ Grand_GP
+ data["GMP_Date/orderDateDescription"]+data["GSP_Date/orderDateDescription"]
+ integer
+
+
+ countOrder_Account/Brand_Date/orderDateDescription
+ measure["countOrder"]
+ integer
+
+ Account/Brand
+ Date/orderDateDescription
+
+ SUM
+
+
+ countOrder_Account/Pod_Date/orderDateDescription
+ measure["countOrder"]
+ integer
+
+ Account/Pod
+ Date/orderDateDescription
+
+ SUM
+
+
+ countOrder_Date/orderDateDescription
+ measure["countOrder"]
+ integer
+
+ Date/orderDateDescription
+
+ SUM
+
+
+ countOrder_Account/Account_Date/orderDateDescription
+ measure["countOrder"]
+ integer
+
+ Account/Account
+ Date/orderDateDescription
+
+ SUM
+
+
+ orderDateMonthOfYear
+ dimension["Date"]["orderDateMonthOfYear"]
+ string
+