svn commit: r902719 [3/6] - in /ofbiz/trunk/applications/order: ./ data/ data/helpdata/ entitydef/ script/org/ofbiz/order/olap/ script/org/ofbiz/order/reports/ webapp/ordermgr/WEB-INF/ webapp/ordermgr/WEB-INF/actions/report/ webapp/ordermgr/WEB-INF/act...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r902719 [3/6] - in /ofbiz/trunk/applications/order: ./ data/ data/helpdata/ entitydef/ script/org/ofbiz/order/olap/ script/org/ofbiz/order/reports/ webapp/ordermgr/WEB-INF/ webapp/ordermgr/WEB-INF/actions/report/ webapp/ordermgr/WEB-INF/act...

hansbak-2
Modified: ofbiz/trunk/applications/order/data/helpdata/HELP_ORDER_Report.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/data/helpdata/HELP_ORDER_Report.xml?rev=902719&r1=902718&r2=902719&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/data/helpdata/HELP_ORDER_Report.xml (original)
+++ ofbiz/trunk/applications/order/data/helpdata/HELP_ORDER_Report.xml Mon Jan 25 07:23:57 2010
@@ -75,5 +75,25 @@
          This report lists promotions, total orders, percent of total orders, total orders amount, percent of total orders amount and shipping amounts.
      </para>
     </section>
+     <section>
+     <title>6. Sales Report</title>
+     <para>
+     This Sales report contains paid and unpaid sales orders.
+     </para>
+     </section>
+     <section>
+     <title>7. Net Before Overhead Report</title>
+     <para>
+     Net Before Overhead Report is the profit calculation of paid-shipped orders and all the occurred fee excluding the overhead cost.
+     They are grouped by Product Store Id.(Demo data for Net Before Overhead Report have in Product Store Id "B2CStore")
+     </para>
+     </section>
+     <section>
+     <title>8. Product Demand Report</title>
+     <para>
+     Product Demand Report is the report to show us which product sells good and which product doesn’t sell good or not selling at all in one account as well as for all accounts in last 4 weeks.
+     They are grouped by Product Store Id.(Demo data for Product Demand Report have in Product Store Id "B2CStore")
+     </para>
+     </section>
     </section>
 </section>

Modified: ofbiz/trunk/applications/order/entitydef/entitymodel_olap.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/entitydef/entitymodel_olap.xml?rev=902719&r1=902718&r2=902719&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/entitydef/entitymodel_olap.xml (original)
+++ ofbiz/trunk/applications/order/entitydef/entitymodel_olap.xml Mon Jan 25 07:23:57 2010
@@ -39,12 +39,14 @@
         <field name="origCurrencyDimId" type="id-ne"></field>
         <field name="billToCustomerDimId" type="id-ne"></field> <!-- TODO: implement the dimension -->
         
+        <field name="productStoreId" type="id-ne"></field>  
         <field name="salesChannelEnumId" type="id-ne"></field>
         <field name="saleChannel" type="description"></field>
         <field name="orderStatus" type="description"></field>
         <field name="visitId" type="id-ne"></field>
         <field name="initialReferrer" type="url"></field>
         <field name="productPromoCode" type="id"></field>
+        <field name="categoryName" type="id"></field>
         
         <field name="quantity" type="fixed-point">
             <description>Quantity order. From OrderItem.quantity</description>
@@ -94,6 +96,14 @@
         <field name="OtherFree" type="currency-precise">
             <description>Others: other fee which calculation is just a percentage of GrossSales.</description>
         </field>
+        
+        <field name="NBO" type="currency-precise">
+            <description>NBO: NBO which calculation is GrossProfit minus all the fees (eBay,RRC and Others).</description>
+        </field>
+        
+        <field name="CountDate" type="currency-precise">
+            <description>CountDate: Count of date.</description>
+        </field>
 <!--        <field name="AverageMerchandizeProfit" type="currency-precise">
             <description>Average Merchandize Profit</description>
         </field>
@@ -201,23 +211,28 @@
             <exclude field="productDimId"/>
             <exclude field="origCurrencyDimId"/>
             <exclude field="billToCustomerDimId"/>
+            <exclude field="productStoreId"/>
             <exclude field="salesChannelEnumId"/>
             <exclude field="saleChannel"/>
             <exclude field="orderStatus"/>
      <exclude field="visitId"/>
      <exclude field="initialReferrer"/>
             <exclude field="productPromoCode"/>
+            <exclude field="categoryName"/>
         </alias-all>
         <alias entity-alias="SOIF" name="orderId" group-by="true">
             <description>Order id</description>
         </alias>
+
         <alias entity-alias="SOIF" name="orderItemSeqId" group-by="true"/>
+        <alias entity-alias="SOIF" name="productStoreId" group-by="true"/>
         <alias entity-alias="SOIF" name="salesChannelEnumId" group-by="true"/>
         <alias entity-alias="SOIF" name="saleChannel" group-by="true"/>
         <alias entity-alias="SOIF" name="orderStatus" group-by="true"/>
         <alias entity-alias="SOIF" name="visitId" group-by="true"/>
         <alias entity-alias="SOIF" name="initialReferrer" group-by="true"/>
         <alias entity-alias="SOIF" name="productPromoCode" group-by="true"/>
+        <alias entity-alias="SOIF" name="categoryName" group-by="true"/>
 
         <view-link entity-alias="SOIF" rel-entity-alias="ODD">
             <key-map field-name="orderDateDimId" rel-field-name="dimensionId"/>

Modified: ofbiz/trunk/applications/order/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/ofbiz-component.xml?rev=902719&r1=902718&r2=902719&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/ofbiz-component.xml (original)
+++ ofbiz/trunk/applications/order/ofbiz-component.xml Mon Jan 25 07:23:57 2010
@@ -39,6 +39,7 @@
     <entity-resource type="data" reader-name="demo" loader="main" location="data/OrderDemoUser.xml"/>
     <entity-resource type="data" reader-name="demo" loader="main" location="data/OrderDemoData.xml"/>
     <entity-resource type="data" reader-name="demo" loader="main" location="data/SalesOrderDemoData.xml"/>
+
     <service-resource type="model" loader="main" location="servicedef/services.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_cart.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_shoppinglist.xml"/>

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/olap/FactServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/olap/FactServices.xml?rev=902719&r1=902718&r2=902719&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/olap/FactServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/olap/FactServices.xml Mon Jan 25 07:23:57 2010
@@ -121,6 +121,7 @@
                 </if-not-empty>
                 <!-- TODO -->
                 <set field="fact.billToCustomerDimId" value="_NA_"/>
+              
                 <create-value value-field="fact"/>
             </if-empty>
             <!-- =============== -->
@@ -234,6 +235,11 @@
                 </calcop>
             </calculate>
             
+            <!-- Product Store -->
+            <if-not-empty field="orderHeader.productStoreId">
+                <set field="fact.productStoreId" from-field="orderHeader.productStoreId"/>
+            </if-not-empty>
+            
             <!-- Sale Channel -->
             <if-not-empty field="orderHeader.salesChannelEnumId">
                 <entity-one entity-name="Enumeration" value-field="enumeration">
@@ -292,7 +298,7 @@
                     <calcop field="fact.extStorageCost" operator="get"/>
                     <calcop field="fact.extDistributionCost" operator="get"/>
                 </calcop>
-                </calculate>-->
+            </calculate>-->
             
             <!-- eBay -->
             <set field="fact.eBay" value="7"/>
@@ -302,6 +308,41 @@
             
             <!-- Others -->
             <set field="fact.OtherFree" value="5"/>
+            
+            <!-- Others -->
+            <calculate field="fees">
+                <calcop operator="add">
+                    <calcop operator="get" field="fact.eBay"/>
+                    <calcop operator="get" field="fact.RRC"/>
+                    <calcop operator="get" field="fact.OtherFree"/>
+                </calcop>
+            </calculate>
+            
+            <!-- NBO -->
+            <calculate field="NBO" type="BigDecimal">
+                <calcop operator="subtract">
+                    <calcop operator="get" field="fact.GrossProfit"></calcop>
+                    <calcop operator="get" field="fees"></calcop>
+                </calcop>
+            </calculate>
+            <set field="fact.NBO" from-field="NBO"/>
+            
+            <!-- CountDate -->
+            <set field="fact.CountDate" value="1"/>
+            
+            <!-- Category -->
+            <if-not-empty field="orderItem.productId">
+                <clear-field field="defaultTopCategoryId"/>
+                <entity-one entity-name="Product" value-field="product">
+                    <field-map field-name="productId" from-field="orderItem.productId"/>
+                </entity-one>
+                <set field="defaultTopCategoryId.topCategory" from-field="product.primaryProductCategoryId"/>
+                <call-service service-name="getAllCategories" in-map-name="defaultTopCategoryId">
+                    <result-to-field result-name="categories" field="categories"/>
+                </call-service>
+                <first-from-list entry="category" list="categories"/>
+                <set field="fact.categoryName" from-field="category.categoryName"/>
+            </if-not-empty>
 
             <store-value value-field="fact"/>
         </if-compare>

Added: ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/NetBeforeOverheadDateEvent.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/NetBeforeOverheadDateEvent.xml?rev=902719&view=auto
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/NetBeforeOverheadDateEvent.xml (added)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/NetBeforeOverheadDateEvent.xml Mon Jan 25 07:23:57 2010
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
+
+    <simple-method method-name="getOrder" short-description="Get Orders" login-required="false">
+        <set field="DateDay" value="2009-12-03"/>
+        <if-not-empty field="DateDay">
+            <entity-condition entity-name="SalesOrderItemStarSchema" list="Date_starschemas">
+                <condition-list combine="and">
+                    <condition-expr field-name="orderDateYearMonthDay" operator="equals" from-field="DateDay"/>
+                    <condition-expr field-name="productStoreId" operator="equals" from-field="productStoreId"/>
+                </condition-list>
+            </entity-condition>
+        </if-not-empty>
+    </simple-method>
+    
+</simple-methods>

Added: ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/NetBeforeOverheadEvent.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/NetBeforeOverheadEvent.xml?rev=902719&view=auto
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/NetBeforeOverheadEvent.xml (added)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/NetBeforeOverheadEvent.xml Mon Jan 25 07:23:57 2010
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
+
+    <simple-method method-name="getOrder" short-description="Get Orders" login-required="false">
+        <if-not-empty field="DateMonth">
+            <set field="DateYear" value="2009"/>
+            <set field="DateMonth" value="12"/>
+            <set field="mount1" from-field="DateMonth" type="Integer"/>
+            <calculate field="mount2" type="Integer">
+                <calcop field="mount1" operator="subtract">
+                    <number value="1"/>
+                </calcop>
+            </calculate>
+            <entity-condition entity-name="SalesOrderItemStarSchema" list="starschemas">
+                <condition-list combine="and">
+                    <condition-list combine="or">
+                        <condition-expr field-name="orderDateMonthOfYear" operator="equals" from-field="DateMonth"/>
+                        <condition-expr field-name="orderDateMonthOfYear" operator="equals" from-field="mount2"/>
+                    </condition-list>
+                    <condition-expr field-name="orderDateYearName" operator="equals" from-field="DateYear"/>
+                    <condition-expr field-name="productStoreId" operator="equals" from-field="productStoreId"/>
+                </condition-list>
+            </entity-condition>
+        </if-not-empty>
+    </simple-method>
+    
+</simple-methods>

Added: ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/NetBeforeOverheadMonthlyEvent.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/NetBeforeOverheadMonthlyEvent.xml?rev=902719&view=auto
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/NetBeforeOverheadMonthlyEvent.xml (added)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/NetBeforeOverheadMonthlyEvent.xml Mon Jan 25 07:23:57 2010
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
+
+    <simple-method method-name="getOrder" short-description="Get Orders" login-required="false">
+        <if-not-empty field="DateMonth">
+            <set field="DateYear" value="2009"/>
+            <set field="DateMonth" value="12"/>
+            <entity-condition entity-name="SalesOrderItemStarSchema" list="countdates" distinct="true">
+                <condition-list combine="and">  
+                    <condition-expr field-name="orderDateYearName" operator="equals" from-field="DateYear"/>
+                    <condition-expr field-name="orderDateMonthOfYear" operator="equals" from-field="DateMonth"/>
+                    <condition-expr field-name="productStoreId" operator="equals" from-field="productStoreId"/>
+                </condition-list>
+                <select-field field-name="orderDateYearMonthDay"/>
+                <select-field field-name="salesChannelEnumId"/>
+            </entity-condition>
+            <entity-condition entity-name="SalesOrderItemStarSchema" list="starschemas" distinct="true">
+                <condition-list combine="and">
+                    <condition-expr field-name="orderDateYearName" operator="equals" from-field="DateYear"/>
+                    <condition-expr field-name="orderDateMonthOfYear" operator="equals" from-field="DateMonth"/>
+                    <condition-expr field-name="productStoreId" operator="equals" from-field="productStoreId"/>
+                </condition-list>
+                <select-field field-name="orderDateMonthName"/>
+                <select-field field-name="salesChannelEnumId"/>
+                <select-field field-name="NBO"/>
+            </entity-condition>
+            <entity-condition entity-name="SalesOrderItemStarSchema" list="saleschannels" distinct="true">
+                <condition-list combine="and">  
+                    <condition-expr field-name="orderDateYearName" operator="equals" from-field="DateYear"/>
+                    <condition-expr field-name="orderDateMonthOfYear" operator="equals" from-field="DateMonth"/>
+                    <condition-expr field-name="productStoreId" operator="equals" from-field="productStoreId"/>
+                </condition-list>
+                <select-field field-name="salesChannelEnumId"/>
+            </entity-condition>
+        </if-not-empty>
+        
+        <set field="count1" value="-1"/>
+        <iterate entry="saleschannel" list="saleschannels">
+            <calculate field="count1">
+                <calcop field="count1" operator="add">
+                    <number value="1"/>
+                </calcop>
+            </calculate>
+            <set field="salesChannelId" from-field="saleschannel.salesChannelEnumId"/>
+            <set field="salesChannelMap.salesChannelList[]" from-field="salesChannelId"/>
+        </iterate>
+        
+        <set field="count2" value="0"/>
+        <iterate entry="countdate" list="countdates">
+            <set field="checksalesChannel1" from-field="salesChannelMap.salesChannelList[count2]"/>
+            <if-compare-field field="countdate.salesChannelEnumId" to-field="checksalesChannel1" operator="equals">
+                <calculate field="countdateMap.countsalesChannel[count2]">
+                    <calcop operator="add" field="countdateMap.countsalesChannel[count2]">
+                        <number value="1"/>
+                    </calcop>
+                </calculate>
+            </if-compare-field>
+            <if-compare-field field="countdate.salesChannelEnumId" to-field="checksalesChannel1" operator="not-equals">
+                <calculate field="count2">
+                    <calcop field="count2" operator="add">
+                        <number value="1"/>
+                    </calcop>
+                </calculate>
+                <calculate field="countdateMap.countsalesChannel[count2]">
+                    <calcop operator="add" field="countdateMap.countsalesChannel[count2]">
+                        <number value="1"/>
+                    </calcop>
+                </calculate>
+            </if-compare-field>
+        </iterate>
+
+        <set field="count3" value="-1"/>
+        <set field="count4" value="0"/>
+        <iterate entry="starschema" list="starschemas">
+            <calculate field="count3">
+                <calcop field="count3" operator="add">
+                    <number value="1"/>
+                </calcop>
+            </calculate>
+            <calculate field="count4">
+                <calcop field="count4" operator="add">
+                    <number value="1"/>
+                </calcop>
+            </calculate>
+            <set field="checksalesChannel2" from-field="salesChannelMap.salesChannelList[count3]"/>
+            <if-compare-field field="starschema.salesChannelEnumId" to-field="checksalesChannel2" operator="equals">
+                <set field="starschemacountdate" from-field="countdateMap.countsalesChannel[count4]"/>
+                <set field="starschema.CountDate" from-field="starschemacountdate"/>
+            </if-compare-field>
+        </iterate>
+    </simple-method>
+    
+</simple-methods>

Added: ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/ProductDemandReportEvent.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/ProductDemandReportEvent.xml?rev=902719&view=auto
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/ProductDemandReportEvent.xml (added)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/ProductDemandReportEvent.xml Mon Jan 25 07:23:57 2010
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
+
+    <simple-method method-name="getOrder" short-description="Get Orders" login-required="false">
+        <if-not-empty field="Week">
+            <!--<set field="year" from-field="Year" type="Integer"/>-->
+            <!--<set field="week1" from-field="Week" type="Integer"/>-->
+            <set field="year" value="2009" type="Integer"/>
+            <set field="week1" value="49" type="Integer"/>
+            <calculate field="week2" type="Integer">
+                <calcop field="week1" operator="subtract">
+                    <number value="1"/>
+                </calcop>
+            </calculate>
+            <calculate field="week3" type="Integer">
+                <calcop field="week1" operator="subtract">
+                    <number value="2"/>
+                </calcop>
+            </calculate>
+            <calculate field="week4" type="Integer">
+                <calcop field="week1" operator="subtract">
+                    <number value="3"/>
+                </calcop>
+            </calculate>
+            <if-not-empty field="productStoreId">
+                <entity-condition entity-name="SalesOrderItemStarSchema" list="starschemas">
+                    <condition-list combine="and">
+                        <condition-list combine="or">
+                            <condition-expr field-name="orderDateWeekOfYear" operator="equals" from-field="week1"/>
+                            <condition-expr field-name="orderDateWeekOfYear" operator="equals" from-field="week2"/>
+                            <condition-expr field-name="orderDateWeekOfYear" operator="equals" from-field="week3"/>
+                            <condition-expr field-name="orderDateWeekOfYear" operator="equals" from-field="week4"/>
+                        </condition-list>
+                        <condition-expr field-name="productStoreId" operator="equals" from-field="productStoreId"/>
+                        <condition-expr field-name="orderDateYearName" operator="equals" from-field="year"/>
+                    </condition-list>
+                </entity-condition>
+            </if-not-empty>
+            <if-empty field="productStoreId">
+                <entity-condition entity-name="SalesOrderItemStarSchema" list="starschemas">
+                    <condition-list combine="and">
+                        <condition-list combine="or">
+                            <condition-expr field-name="orderDateWeekOfYear" operator="equals" from-field="week1"/>
+                            <condition-expr field-name="orderDateWeekOfYear" operator="equals" from-field="week2"/>
+                            <condition-expr field-name="orderDateWeekOfYear" operator="equals" from-field="week3"/>
+                            <condition-expr field-name="orderDateWeekOfYear" operator="equals" from-field="week4"/>
+                        </condition-list>
+                        <condition-expr field-name="orderDateYearName" operator="equals" from-field="year"/>
+                    </condition-list>
+                </entity-condition>
+            </if-empty>
+        </if-not-empty>
+    </simple-method>
+</simple-methods>

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/SalesReportEvent.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/SalesReportEvent.xml?rev=902719&r1=902718&r2=902719&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/SalesReportEvent.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/SalesReportEvent.xml Mon Jan 25 07:23:57 2010
@@ -22,65 +22,25 @@
     xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
 
     <simple-method method-name="getOrder" short-description="Get Orders" login-required="false">
-        <log level="always" message="===================CheckfromDate : ${fromDate}"/>
-        <log level="always" message="===================CheckthruDate : ${thruDate}"/>
         <if-not-empty field="fromDate">
             <entity-condition entity-name="SalesOrderItemStarSchema" list="starschemas">
                 <condition-list combine="and">
                     <condition-expr field-name="orderDateYearMonthDay" operator="greater-equals" from-field="fromDate"/>
                     <condition-expr field-name="orderDateYearMonthDay" operator="less" from-field="thruDate"/>
                     <condition-list combine="or">
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_AU_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_CA_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_IE_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_SG_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_UK_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_US_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_DE_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_ES_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_FR_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_IT_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_AU_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_CA_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_IE_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_SG_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_UK_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_US_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_DE_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_ES_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_FR_SALES_CHANNEL"/>
-                        <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_IT_SALES_CHANNEL"/>
+                        <condition-expr field-name="productStoreId" operator="equals" value="B2CStore"/>
+                        <condition-expr field-name="productStoreId" operator="equals" value="B2BStore"/>
                     </condition-list>
                 </condition-list>
             </entity-condition>
-            <log level="always" message="===================starschemas : ${starschemas}"/>
         </if-not-empty>
         <if-empty field="fromDate">
             <entity-condition list="starschemas" entity-name="SalesOrderItemStarSchema">
                 <condition-list combine="or">
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_AU_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_CA_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_IE_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_SG_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_UK_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_US_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_DE_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_ES_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_FR_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="VV_IT_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_AU_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_CA_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_IE_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_SG_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_UK_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_US_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_DE_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_ES_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_FR_SALES_CHANNEL"/>
-                    <condition-expr field-name="salesChannelEnumId" operator="equals" value="B2B_IT_SALES_CHANNEL"/>
+                    <condition-expr field-name="productStoreId" operator="equals" value="B2CStore"/>
+                    <condition-expr field-name="productStoreId" operator="equals" value="B2BStore"/>
                 </condition-list>
             </entity-condition>
-            <log level="always" message="===================starschemas : ${starschemas}"/>
         </if-empty>
     </simple-method>
     

Added: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/NetBeforeOverheadReport.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/NetBeforeOverheadReport.groovy?rev=902719&view=auto
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/NetBeforeOverheadReport.groovy (added)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/NetBeforeOverheadReport.groovy Mon Jan 25 07:23:57 2010
@@ -0,0 +1,39 @@
+import org.ofbiz.base.util.*;
+import java.sql.*;
+import java.sql.Timestamp;
+import com.ibm.icu.util.Calendar;
+
+productStoreId = parameters.productStoreId;
+DateTime = UtilDateTime.nowTimestamp();
+String DateStr = DateTime;
+DateDay = DateStr.substring(0,10);
+DateMonth = DateStr.substring(5,7);
+DateYear = DateStr.substring(0,4);
+
+if (DateMonth == "01"||DateMonth == "03"||DateMonth == "05"||DateMonth == "07"||DateMonth == "08"||DateMonth == "10"||DateMonth == "12")
+{
+ NunberDate = 31;
+}
+else if (DateMonth == "02")
+{
+ NunberDate = 29;
+}
+else
+{
+ NunberDate = 30;
+}
+
+birtParameters = [:];
+try {
+ birtParameters.productStoreId = productStoreId;
+ birtParameters.DateDay = DateDay;
+ birtParameters.DateMonth = DateMonth;
+ birtParameters.DateYear = DateYear;
+ birtParameters.NunberDate = NunberDate;
+} catch (e) {
+ Debug.logError(e, "");
+}
+
+request.setAttribute("birtParameters", birtParameters);
+
+return "success";

Added: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/ProductDemandReport.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/ProductDemandReport.groovy?rev=902719&view=auto
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/ProductDemandReport.groovy (added)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/ProductDemandReport.groovy Mon Jan 25 07:23:57 2010
@@ -0,0 +1,22 @@
+import org.ofbiz.base.util.*;
+import java.sql.*;
+import com.ibm.icu.util.Calendar;
+
+productStoreId = parameters.productStoreId;
+Calendar cal = UtilDateTime.toCalendar(UtilDateTime.nowTimestamp());
+int Week = cal.get(Calendar.WEEK_OF_YEAR);
+int Year = cal.get(Calendar.YEAR);
+
+birtParameters = [:];
+try
+{
+ birtParameters.productStoreId = productStoreId;
+ birtParameters.Week = Week;
+ birtParameters.Year = Year;
+} catch (e) {
+ Debug.logError(e, "");
+}
+
+request.setAttribute("birtParameters", birtParameters);
+
+return "success";

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/SalesReport.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/SalesReport.groovy?rev=902719&r1=902718&r2=902719&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/SalesReport.groovy (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/SalesReport.groovy Mon Jan 25 07:23:57 2010
@@ -4,22 +4,14 @@
 fromDateStr = parameters.fromDate;
 thruDateStr = parameters.thruDate;
 
-Debug.logInfo("================ fromDateStr:" + fromDateStr, "");
-Debug.logInfo("================ thruDateStr:" + thruDateStr, "");
-
 birtParameters = [:];
 try {
  birtParameters.fromDate = Date.valueOf(fromDateStr);
  birtParameters.thruDate = Date.valueOf(thruDateStr);
- //birtParameters.fromDate = Timestamp.valueOf(fromDateStr);
- //birtParameters.thruDate = Timestamp.valueOf(thruDateStr);
 } catch (e) {
  Debug.logError(e, "");
 }
 
-Debug.logInfo("================ fromDate:" + birtParameters.fromDate, "");
-Debug.logInfo("================ thruDate:" + birtParameters.thruDate, "");
-
 request.setAttribute("birtParameters", birtParameters);
 
 return "success";

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=902719&r1=902718&r2=902719&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Mon Jan 25 07:23:57 2010
@@ -911,7 +911,7 @@
         <response name="error" type="view" value="billsetting"/>
     </request-map>
     <request-map uri="processorder">
-        <security https="true" auth="true"/>
+        <security https="false" auth="true"/>
         <event type="java" path="org.ofbiz.order.shoppingcart.CheckOutEvents" invoke="createOrder"/>
         <response name="sales_order" type="request" value="checkBlackList"/>
         <response name="work_order" type="request" value="checkBlackList"/>
@@ -1081,10 +1081,24 @@
     <request-map uri="PurchasesByOrganizationReport.pdf"><security https="true" auth="true"/>
         <response name="success" type="view" value="PurchasesByOrganizationReport"/>
     </request-map>
+    
     <request-map uri="SalesReport.pdf"><security https="true" auth="true"/>
         <event type="groovy" path="component://order/webapp/ordermgr/WEB-INF/actions/reports/" invoke="SalesReport.groovy"/>
         <response name="success" type="view" value="SalesOrderReport"/>
     </request-map>
+    <request-map uri="NetBeforeOverheadReport.pdf"><security https="true" auth="true"/>
+        <event type="groovy" path="component://order/webapp/ordermgr/WEB-INF/actions/reports/" invoke="NetBeforeOverheadReport.groovy"/>
+        <response name="success" type="view" value="NetBeforeOverheadOrderReport"/>
+    </request-map>
+    <request-map uri="ProductDemandReport.pdf"><security https="true" auth="true"/>
+        <event type="groovy" path="component://order/webapp/ordermgr/WEB-INF/actions/reports/" invoke="ProductDemandReport.groovy"/>
+        <response name="success" type="view" value="ProductDemandOrderReport"/>
+    </request-map>
+    <request-map uri="ProductContributionReport.pdf"><security https="true" auth="true"/>
+        <event type="groovy" path="component://order/webapp/ordermgr/WEB-INF/actions/reports/" invoke="ProductContributionReport.groovy"/>
+        <response name="success" type="view" value="ProductDemandOrderReport"/>
+    </request-map>
+
     <request-map uri="OrderByReferrer.pdf"><security https="true" auth="true"/>
         <response name="success" type="view" value="OrderByReferrerReport"/>
     </request-map>
@@ -1780,8 +1794,11 @@
     <view-map name="SalesByStoreReport" type="screenfop" page="component://order/widget/ordermgr/ReportScreens.xml#SalesByStoreReport" content-type="application/pdf" encoding="none"/>
     <view-map name="OpenOrderItemsReport" type="screen" page="component://order/widget/ordermgr/ReportScreens.xml#OpenOrderItemsReport"/>
     <view-map name="PurchasesByOrganizationReport" type="screenfop" page="component://order/widget/ordermgr/ReportScreens.xml#PurchasesByOrganizationReport" content-type="application/pdf" encoding="none"/>
- <view-map name="SalesOrderReport" type="birt" page="component://order/webapp/ordermgr/reports/SalesReport.rptdesign" content-type="application/pdf"/>
- <view-map name="OrderByReferrerReport" type="birt" page="component://order/webapp/ordermgr/reports/OrderByReferrer.rptdesign" content-type="application/pdf"/>
+
+    <view-map name="SalesOrderReport" type="birt" page="component://order/webapp/ordermgr/reports/SalesReport.rptdesign" content-type="application/pdf"/>
+    <view-map name="NetBeforeOverheadOrderReport" type="birt" page="component://order/webapp/ordermgr/reports/NetBeforeOverheadReport.rptdesign" content-type="application/pdf"/>
+    <view-map name="ProductDemandOrderReport" type="birt" page="component://order/webapp/ordermgr/reports/ProductDemandReport.rptdesign" content-type="application/pdf"/>
+    <view-map name="OrderByReferrerReport" type="birt" page="component://order/webapp/ordermgr/reports/OrderByReferrer.rptdesign" content-type="application/pdf"/>
     <view-map name="OrdersByChannelReport" type="birt" page="component://order/webapp/ordermgr/reports/OrdersByChannel.rptdesign" content-type="application/pdf"/>
     <view-map name="SaleOrderDiscountCodeReport" type="birt" page="component://order/webapp/ordermgr/reports/OrderDiscountCodeReport.rptdesign" content-type="application/pdf"/>
     <view-map name="Last3MonthsSalesReport" type="birt" page="component://order/webapp/ordermgr/reports/Last3MonthsSalesReport.rptdesign" content-type="application/pdf"/>