You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2009/12/15 16:34:30 UTC

svn commit: r890830 [3/7] - in /ofbiz/trunk: applications/accounting/webapp/accounting/WEB-INF/ applications/accounting/webapp/accounting/WEB-INF/actions/payment/ applications/accounting/webapp/accounting/payment/report/ applications/accounting/widget/...

Propchange: ofbiz/trunk/applications/order/data/SalesOrderDemoData.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/order/data/SalesOrderDemoData.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/order/data/SalesOrderDemoData.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/applications/order/entitydef/entitymodel_olap.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/entitydef/entitymodel_olap.xml?rev=890830&r1=890829&r2=890830&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/entitydef/entitymodel_olap.xml (original)
+++ ofbiz/trunk/applications/order/entitydef/entitymodel_olap.xml Tue Dec 15 15:34:29 2009
@@ -38,14 +38,24 @@
         <field name="productDimId" type="id-ne"></field>
         <field name="origCurrencyDimId" type="id-ne"></field>
         <field name="billToCustomerDimId" type="id-ne"></field> <!-- TODO: implement the dimension -->
-
+        
+        <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="quantity" type="fixed-point">
             <description>Quantity order. From OrderItem.quantity</description>
         </field>
-        
+
         <field name="extGrossAmount" type="currency-precise">
             <description>Extended gross amount: quantity item multiplied by the unit price.</description>
         </field>
+        <field name="extGrossCost" type="currency-precise">
+            <description>Extended gross cost: quantity item multiplied by the last price.</description>
+        </field>
         <field name="extDiscountAmount" type="currency-precise">
             <description>Extended discount amount.</description>
         </field>
@@ -60,26 +70,36 @@
         </field>
         
         <field name="GrossSales" type="currency-precise">
-            <description>Gross Sales</description>
+            <description>Gross Sales: extGrossAmount less extShippingAmount.</description>
         </field>
         <field name="GrossMerchandizeSales" type="currency-precise">
-            <description>Gross Merchandize Sales</description>
+            <description>Gross Merchandize Sales: extGrossAmount.</description>
         </field>
         <field name="GrossMerchandizeProfit" type="currency-precise">
-            <description>Gross Merchandize Profit</description>
+            <description>Gross Merchandize Profit: GrossMerchandizeSales less default price.</description>
         </field>
         <field name="GrossShippingProfit" type="currency-precise">
             <description>Gross Shipping Profit</description>
         </field>
         <field name="GrossProfit" type="currency-precise">
-            <description>Gross Profit</description>
+            <description>Gross Profit: GrossMerchandizeProfit less GrossShippingProfit.</description>
+        </field>
+        
+        <field name="eBay" type="currency-precise">
+            <description>eBay Fee: current ebay fee is captured manually by employee and updated into sharepoint list.</description>
+        </field>
+        <field name="RRC" type="currency-precise">
+            <description>RRC: the total amount of our RRC (refund, replace and cancellation).</description>
         </field>
-        <field name="AverageMerchandizeProfit" type="currency-precise">
+        <field name="OtherFree" type="currency-precise">
+            <description>Others: other fee which calculation is just a percentage of GrossSales.</description>
+        </field>
+<!--        <field name="AverageMerchandizeProfit" type="currency-precise">
             <description>Average Merchandize Profit</description>
         </field>
         <field name="AverageGrossProfit" type="currency-precise">
             <description>Average Gross Profit</description>
-        </field>
+        </field>-->
 
         <!--<field name="extGrossAmount" type="currency-precise">
             <description>Extended gross amount: quantity invoiced multiplied by the list unit price.</description>
@@ -142,7 +162,7 @@
         <prim-key field="orderId"/>
         <prim-key field="orderItemSeqId"/>
 
-        <relation type="one" fk-name="SOIF_INVDATE" rel-entity-name="DateDimension">
+        <relation type="one" fk-name="SOIF_ORDERDATE" rel-entity-name="DateDimension">
             <key-map field-name="orderDateDimId" rel-field-name="dimensionId"/>
         </relation>
         <relation type="one" fk-name="SOIF_CURRENCY" rel-entity-name="CurrencyDimension">
@@ -160,12 +180,12 @@
     <view-entity entity-name="SalesOrderItemStarSchema" package-name="org.ofbiz.bi.starschema.order" title="Sales Order Item Star Schema">
         <description>Order Item star schema (Profit and Loss Statement).</description>
 
-        <member-entity entity-alias="SIIF" entity-name="SalesOrderItemFact"/>
-        <member-entity entity-alias="IDD" entity-name="DateDimension"/>
+        <member-entity entity-alias="SOIF" entity-name="SalesOrderItemFact"/>
+        <member-entity entity-alias="ODD" entity-name="DateDimension"/>
         <member-entity entity-alias="PD" entity-name="ProductDimension"/>
         <member-entity entity-alias="CD" entity-name="CurrencyDimension"/>
 
-        <alias-all entity-alias="IDD" prefix="orderDate" group-by="true">
+        <alias-all entity-alias="ODD" prefix="orderDate" group-by="true">
             <exclude field="dimensionId"/>
         </alias-all>
         <alias-all entity-alias="PD" prefix="product" group-by="true">
@@ -174,27 +194,38 @@
         <alias-all entity-alias="CD" prefix="currency" group-by="true">
             <exclude field="dimensionId"/>
         </alias-all>
-        <alias-all entity-alias="SIIF" function="sum">
+        <alias-all entity-alias="SOIF" function="sum">
+            <exclude field="orderId"/>
             <exclude field="orderItemSeqId"/>
             <exclude field="orderDateDimId"/>
             <exclude field="productDimId"/>
-            <exclude field="billToCustomerDimId"/>
             <exclude field="origCurrencyDimId"/>
-            <exclude field="orderId"/>
-            <exclude field="orderItemSeqId"/>
+            <exclude field="billToCustomerDimId"/>
+            <exclude field="salesChannelEnumId"/>
+            <exclude field="saleChannel"/>
+            <exclude field="orderStatus"/>
+	    	<exclude field="visitId"/>
+	    	<exclude field="initialReferrer"/>
+            <exclude field="productPromoCode"/>
         </alias-all>
-        <alias entity-alias="SIIF" name="orderId" group-by="true">
+        <alias entity-alias="SOIF" name="orderId" group-by="true">
             <description>Order id</description>
         </alias>
-        <alias entity-alias="SIIF" name="orderItemSeqId" group-by="true"/>
+        <alias entity-alias="SOIF" name="orderItemSeqId" 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"/>
 
-        <view-link entity-alias="SIIF" rel-entity-alias="IDD">
+        <view-link entity-alias="SOIF" rel-entity-alias="ODD">
             <key-map field-name="orderDateDimId" rel-field-name="dimensionId"/>
         </view-link>
-        <view-link entity-alias="SIIF" rel-entity-alias="PD">
+        <view-link entity-alias="SOIF" rel-entity-alias="PD">
             <key-map field-name="productDimId" rel-field-name="dimensionId"/>
         </view-link>
-        <view-link entity-alias="SIIF" rel-entity-alias="CD">
+        <view-link entity-alias="SOIF" rel-entity-alias="CD">
             <key-map field-name="origCurrencyDimId" rel-field-name="dimensionId"/>
         </view-link>
 

Modified: ofbiz/trunk/applications/order/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/ofbiz-component.xml?rev=890830&r1=890829&r2=890830&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/ofbiz-component.xml (original)
+++ ofbiz/trunk/applications/order/ofbiz-component.xml Tue Dec 15 15:34:29 2009
@@ -37,6 +37,7 @@
     <entity-resource type="data" reader-name="seed" loader="main" location="data/OrderSecurityData.xml"/>
     <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=890830&r1=890829&r2=890830&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 Tue Dec 15 15:34:29 2009
@@ -52,7 +52,7 @@
         </if-empty>
         <if-empty field="orderAdjustment">
             <entity-and entity-name="OrderAdjustment" list="orderAdjustments">
-                <field-map field-name="orderId" from-field="orderHeader.orderId"/>
+                <field-map field-name="orderId" from-field="orderItem.orderId"/>
             </entity-and>
         </if-empty>
         <if-empty field="orderHeader">
@@ -73,6 +73,7 @@
                 <make-value entity-name="SalesOrderItemFact" value-field="fact"/>
                 <set field="fact.orderId" from-field="orderHeader.orderId"/>
                 <set field="fact.orderItemSeqId" from-field="orderItem.orderItemSeqId"/>
+                <set field="fact.salesChannelEnumId" from-field="orderHeader.salesChannelEnumId"/>
                 <!-- conversion of the order date -->
                 <if-not-empty field="orderHeader.orderDate">
                     <clear-field field="inMap"/>
@@ -137,16 +138,30 @@
             <set field="fact.GrossMerchandizeProfit" value="0.0" type="BigDecimal"/>
             <set field="fact.GrossShippingProfit" value="0.0" type="BigDecimal"/>
             <set field="fact.GrossProfit" value="0.0" type="BigDecimal"/>
-            <set field="fact.AverageMerchandizeProfit" value="0.0" type="BigDecimal"/>
-            <set field="fact.AverageGrossProfit" value="0.0" type="BigDecimal"/>
+<!--            <set field="fact.AverageMerchandizeProfit" value="0.0" type="BigDecimal"/>
+            <set field="fact.AverageGrossProfit" value="0.0" type="BigDecimal"/>-->
             
-            <!-- gross -->
+            <!-- amount -->
             <calculate field="fact.extGrossAmount">
                 <calcop field="fact.quantity" operator="multiply">
                     <calcop field="orderItem.unitPrice" operator="get"/>
                 </calcop>
             </calculate>
             
+            <!-- cost -->
+            <entity-and entity-name="SupplierProduct" list="costs">
+                <field-map field-name="productId" from-field="orderItem.productId"/>
+            </entity-and>
+            <iterate list="costs" entry="cost">
+                <if-compare field="cost.minimumOrderQuantity" operator="equals" value="0">
+                    <calculate field="fact.extGrossCost">
+                        <calcop field="fact.quantity" operator="multiply">
+                            <calcop field="cost.lastPrice" operator="get"/>
+                        </calcop>
+                    </calculate>
+                </if-compare>
+            </iterate>
+            
             <!-- shipping -->
             <iterate list="orderAdjustments" entry="shipping">
                 <if-compare field="shipping.orderAdjustmentTypeId" operator="equals" value="SHIPPING_CHARGES">
@@ -174,9 +189,20 @@
                 <if-compare field="discount.orderAdjustmentTypeId" operator="equals" value="PROMOTION_ADJUSTMENT">
                     <calculate field="fact.extDiscountAmount">
                         <calcop field="fact.extDiscountAmount" operator="add">
-                            <calcop field="discount.amount" operator="negative"/>
+                            <calcop field="discount.amount" operator="get"/>
                         </calcop>
                     </calculate>
+                    <!-- product promo code -->
+                    <entity-and entity-name="ProductPromoCode" list="productPromo">
+                        <field-map field-name="productPromoId" from-field="discount.productPromoId"/>
+                    </entity-and>
+                    <first-from-list entry="productPromoCode" list="productPromo"/>
+                    <if-not-empty field="productPromoCode">
+                        <set field="fact.productPromoCode" from-field="productPromoCode.productPromoCodeId"/>
+                        <else>
+                            <set field="fact.productPromoCode" value="Not require code"/>
+                        </else>
+                    </if-not-empty>
                 </if-compare>
             </iterate>
 
@@ -202,23 +228,51 @@
             </calculate>
             
             <!-- Gross Merchandize Profit -->
-            <entity-and entity-name="ProductPrice" list="costs">
-                <field-map field-name="productId" from-field="orderItem.productId"/>
-            </entity-and>
-            <iterate list="costs" entry="cost">
-                <if-compare field="cost.productPriceTypeId" operator="equals" value="DEFAULT_PRICE">
-                    <log level="always" message="===================price : ${cost.price}"/>
-                    <calculate field="fact.GrossMerchandizeProfit">
-                        <calcop field="fact.GrossMerchandizeSales" operator="subtract">
-                            <calcop field="cost.price" operator="get"/>
-                        </calcop>
-                    </calculate>
-                </if-compare>
-            </iterate>
+            <calculate field="fact.GrossMerchandizeProfit">
+                <calcop field="fact.GrossMerchandizeSales" operator="subtract">
+                    <calcop field="fact.extGrossCost" operator="get"/>
+                </calcop>
+            </calculate>
+            
+            <!-- Sale Channel -->
+            <if-not-empty field="orderHeader.salesChannelEnumId">
+                <entity-one entity-name="Enumeration" value-field="enumeration">
+                    <field-map field-name="enumId" from-field="orderHeader.salesChannelEnumId"/>
+                </entity-one>
+                <if-not-empty field="enumeration">
+                    <set field="fact.saleChannel" from-field="enumeration.description"/>
+                </if-not-empty>
+            </if-not-empty>
+
+            <!-- Order status -->
+            <if-not-empty field="orderHeader.statusId">
+                <entity-one entity-name="StatusItem" value-field="statusItem">
+                <field-map field-name="statusId" from-field="orderHeader.statusId"/>
+                </entity-one>
+                <if-not-empty field="statusItem">
+                <set field="fact.orderStatus" from-field="statusItem.description"/>
+                </if-not-empty>
+            </if-not-empty>
+            
+            <!-- Order visit and referrer -->
+            <if-not-empty field="orderHeader.visitId">
+                <entity-one entity-name="Visit" value-field="visit">
+                <field-map field-name="visitId" from-field="orderHeader.visitId"/>
+                </entity-one>
+                <if-not-empty field="visit">
+                	<set field="fact.visitId" from-field="visit.visitId"/>
+                	<set field="fact.initialReferrer" from-field="visit.initialReferrer"/>
+                </if-not-empty>
+            </if-not-empty>
             
             <!-- Gross Shipping Profit -->
             
             <!-- Gross Profit -->
+            <calculate field="fact.GrossProfit">
+                <calcop field="fact.GrossMerchandizeProfit" operator="subtract">
+                    <calcop field="fact.GrossShippingProfit" operator="get"/>
+                </calcop>
+            </calculate>
             
             <!-- Average Merchandize Profit -->
             
@@ -238,9 +292,19 @@
                     <calcop field="fact.extStorageCost" operator="get"/>
                     <calcop field="fact.extDistributionCost" operator="get"/>
                 </calcop>
-            </calculate>-->
+                </calculate>-->
+            
+            <!-- eBay -->
+            <set field="fact.eBay" value="7"/>
+                
+            <!-- RRC -->
+            <set field="fact.RRC" value="2"/>
+            
+            <!-- Others -->
+            <set field="fact.OtherFree" value="5"/>
 
             <store-value value-field="fact"/>
         </if-compare>
     </simple-method>
+   
 </simple-methods>

Added: 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=890830&view=auto
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/SalesReportEvent.xml (added)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/SalesReportEvent.xml Tue Dec 15 15:34:29 2009
@@ -0,0 +1,87 @@
+<?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">
+        <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-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-list>
+            </entity-condition>
+            <log level="always" message="===================starschemas : ${starschemas}"/>
+        </if-empty>
+    </simple-method>
+    
+</simple-methods>

Propchange: ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/SalesReportEvent.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/SalesReportEvent.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/order/script/org/ofbiz/order/reports/SalesReportEvent.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?rev=890830&r1=890829&r2=890830&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services.xml Tue Dec 15 15:34:29 2009
@@ -1063,4 +1063,4 @@
         <attribute name="orderItem" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
         <attribute name="orderAdjustment " type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
     </service>
-</services>
\ No newline at end of file
+</services>

Modified: ofbiz/trunk/applications/order/servicedef/services_olap.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_olap.xml?rev=890830&r1=890829&r2=890830&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services_olap.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services_olap.xml Tue Dec 15 15:34:29 2009
@@ -39,4 +39,5 @@
         <description>Calls the loadSalesOrderItemFact service for all the order items.</description>
         <attribute name="orderId" type="String" mode="IN" optional="false"/>
     </service>
+    
 </services>

Added: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OrderByChannel.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OrderByChannel.groovy?rev=890830&view=auto
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OrderByChannel.groovy (added)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OrderByChannel.groovy Tue Dec 15 15:34:29 2009
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+import org.ofbiz.base.util.*;
+
+birtParameters = [:];
+if(request.getParameter("saleChannel")){
+	birtParameters.saleChannel = request.getParameter("saleChannel");
+}else{
+	birtParameters.saleChannel = "null";
+}
+
+request.setAttribute("birtParameters", birtParameters);
+
+return "success";
\ No newline at end of file

Propchange: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OrderByChannel.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OrderByChannel.groovy
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OrderByChannel.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=890830&view=auto
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/SalesReport.groovy (added)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/SalesReport.groovy Tue Dec 15 15:34:29 2009
@@ -0,0 +1,25 @@
+import org.ofbiz.base.util.*;
+import java.sql.*;
+
+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";

Propchange: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/SalesReport.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/SalesReport.groovy
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/SalesReport.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=890830&r1=890829&r2=890830&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Tue Dec 15 15:34:29 2009
@@ -1084,9 +1084,23 @@
         <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/report/" invoke="SalesReport.groovy"/>
+        <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="OrderByReferrer.pdf"><security https="true" auth="true"/>
+        <response name="success" type="view" value="OrderByReferrerReport"/>
+    </request-map>
+    <request-map uri="OrdersByChannel.pdf"><security https="true" auth="true"/>
+    	<event type="groovy" path="component://order/webapp/ordermgr/WEB-INF/actions/reports/" invoke="OrderByChannel.groovy"/>
+        <response name="success" type="view" value="OrdersByChannelReport"/>
+    </request-map>
+    <request-map uri="OrderDiscountCode.pdf">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="SaleOrderDiscountCodeReport"/>
+    </request-map>
+    <request-map uri="Last3MonthsSalesReport.pdf"><security https="true" auth="true"/>
+        <response name="success" type="view" value="Last3MonthsSalesReport"/>
+    </request-map>    
 
      <!-- Requirement request mappings -->
     <request-map uri="FindRequirements">
@@ -1765,7 +1779,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://birt/webapp/birt/report/SalesReport.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="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"/>    
 
     <view-map name="FindRequirements" type="screen" page="component://order/widget/ordermgr/RequirementScreens.xml#FindRequirements"/>
     <view-map name="EditRequirement" type="screen" page="component://order/widget/ordermgr/RequirementScreens.xml#EditRequirement"/>

Added: ofbiz/trunk/applications/order/webapp/ordermgr/reports/Last3MonthsSalesReport.rptdesign
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/reports/Last3MonthsSalesReport.rptdesign?rev=890830&view=auto
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/reports/Last3MonthsSalesReport.rptdesign (added)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/reports/Last3MonthsSalesReport.rptdesign Tue Dec 15 15:34:29 2009
@@ -0,0 +1,816 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.20" id="1">
+    <property name="createdBy">Eclipse BIRT Designer Version 2.5.1.v20090903 Build &lt;2.5.1.v20090917-1447></property>
+    <property name="units">in</property>
+    <method name="initialize"><![CDATA[importPackage(Packages.org.ofbiz.base.util)
+importPackage(Packages.javolution.util)
+importPackage(Packages.org.ofbiz.entity.util)
+importPackage(Packages.java.util)
+importPackage(Packages.java.lang)
+importPackage(Packages.org.ofbiz.entity.condition)
+module = "Last3MonthsSalesReport.rptdesign";]]></method>
+    <property name="iconFile">/templates/blank_report.gif</property>
+    <property name="bidiLayoutOrientation">ltr</property>
+    <data-sources>
+        <script-data-source name="OFBIZ" id="7"/>
+    </data-sources>
+    <data-sets>
+        <script-data-set name="SalesOrderItemStarSchema" id="8">
+            <list-property name="resultSetHints">
+                <structure>
+                    <property name="position">1</property>
+                    <property name="name">orderId</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">2</property>
+                    <property name="name">orderItemSeqId</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">3</property>
+                    <property name="name">orderStatus</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">4</property>
+                    <property name="name">saleChannel</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">5</property>
+                    <property name="name">quantity</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">6</property>
+                    <property name="name">extGrossAmount</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">7</property>
+                    <property name="name">orderDateDayOfMonth</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">8</property>
+                    <property name="name">orderDateMonthOfYear</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">9</property>
+                    <property name="name">orderDateYearName</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">10</property>
+                    <property name="name">price</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">11</property>
+                    <property name="name">stock</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">12</property>
+                    <property name="name">productId</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">13</property>
+                    <property name="name">internalName</property>
+                    <property name="dataType">string</property>
+                </structure>
+            </list-property>
+            <list-property name="columnHints">
+                <structure>
+                    <property name="columnName">orderId</property>
+                </structure>
+                <structure>
+                    <property name="columnName">orderItemSeqId</property>
+                </structure>
+                <structure>
+                    <property name="columnName">orderStatus</property>
+                </structure>
+                <structure>
+                    <property name="columnName">saleChannel</property>
+                </structure>
+                <structure>
+                    <property name="columnName">quantity</property>
+                </structure>
+                <structure>
+                    <property name="columnName">extGrossAmount</property>
+                </structure>
+                <structure>
+                    <property name="columnName">orderDateDayOfMonth</property>
+                </structure>
+                <structure>
+                    <property name="columnName">orderDateMonthOfYear</property>
+                </structure>
+                <structure>
+                    <property name="columnName">orderDateYearName</property>
+                </structure>
+                <structure>
+                    <property name="columnName">price</property>
+                </structure>
+                <structure>
+                    <property name="columnName">stock</property>
+                </structure>
+                <structure>
+                    <property name="columnName">productId</property>
+                </structure>
+                <structure>
+                    <property name="columnName">internalName</property>
+                </structure>
+            </list-property>
+            <structure name="cachedMetaData">
+                <list-property name="resultSet">
+                    <structure>
+                        <property name="position">1</property>
+                        <property name="name">orderId</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">2</property>
+                        <property name="name">orderItemSeqId</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">3</property>
+                        <property name="name">orderStatus</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">4</property>
+                        <property name="name">saleChannel</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">5</property>
+                        <property name="name">quantity</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">6</property>
+                        <property name="name">extGrossAmount</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">7</property>
+                        <property name="name">orderDateDayOfMonth</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">8</property>
+                        <property name="name">orderDateMonthOfYear</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">9</property>
+                        <property name="name">orderDateYearName</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">10</property>
+                        <property name="name">price</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">11</property>
+                        <property name="name">stock</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">12</property>
+                        <property name="name">productId</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">13</property>
+                        <property name="name">internalName</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                </list-property>
+            </structure>
+            <property name="dataSource">OFBIZ</property>
+            <method name="open"><![CDATA[salesOrderItemStarSchemas = null;
+userLogin = null;
+try {
+    userLogin = delegator.findByPrimaryKey("UserLogin",UtilMisc.toMap("userLoginId","admin"));
+    months = FastList.newInstance();
+    thisMonth = 0;
+    thisMonth = UtilDateTime.getMonth(UtilDateTime.nowTimestamp(), TimeZone.getDefault(), Locale.getDefault())+1;
+    thisYear = UtilDateTime.getYear(UtilDateTime.nowTimestamp(), TimeZone.getDefault(), Locale.getDefault())
+    i = 0;
+    month = thisMonth;
+    while(i<3){
+    i = i + 1;
+	switch(month)
+	{
+	case 1:
+	  months.add(1);
+	  break;
+	case 2:
+	  months.add(2);
+	  break;
+	case 3:
+	  months.add(3);
+	  break;
+	case 4:
+	  months.add(4);
+	  break;
+	case 5:
+	  months.add(5);
+	  break;
+	case 6:
+	  months.add(6);
+	  break;
+	case 7:
+	  months.add(7);
+	  break;
+	case 8:
+	  months.add(8);
+	  break;
+	case 9:
+	  months.add(9);
+	  break;
+	case 10:
+	  months.add(10);
+	  break;
+	case 11:
+	  months.add(11);
+	  break;
+	case 12:
+	  months.add(12);
+	  break;
+	}
+	month = month - 1
+	}
+	Debug.log("================  Last 3 Months Sale Order Report====="+months);
+	cond = FastList.newInstance();
+	cond.add(EntityCondition.makeCondition("orderDateMonthOfYear", EntityOperator.IN, months));
+	cond.add(EntityCondition.makeCondition("orderDateYearName", EntityOperator.EQUALS, thisYear));
+    salesOrderItemStarSchemas  = delegator.findList("SalesOrderItemStarSchema", EntityCondition.makeCondition(cond, EntityOperator.AND), null, null, null, false);
+} catch(e) {
+        Debug.logError(e,"");
+}
+totalRow = 0;
+countOfRow = 0;
+if (salesOrderItemStarSchemas) {
+    totalRow = salesOrderItemStarSchemas.size();
+}
+]]></method>
+            <method name="fetch"><![CDATA[if (countOfRow == totalRow - 1) return false;
+salesOrderItemStarSchema = salesOrderItemStarSchemas.get(countOfRow);
+input =  FastMap.newInstance();
+input.put("productId", salesOrderItemStarSchema.getString("productProductId"));
+input.put("userLogin", userLogin);
+QOH = 0;
+
+try {
+    result = dispatcher.runSync("getInventoryValuationList", input);
+    inventorys = result.get("inventoryValuationList");
+    QOH = inventorys.get(0).get("totalQuantityOnHand");
+} catch (e) {
+    Debug.logError(e, module);
+}
+
+price = 0;
+internalName = "None";
+input =  FastMap.newInstance();
+try {
+	product = delegator.findByPrimaryKey("Product",UtilMisc.toMap("productId", salesOrderItemStarSchema.getString("productProductId")));
+	input.put("product", product);
+	input.put("userLogin", userLogin);
+    result = dispatcher.runSync("calculateProductPrice", input);
+    price = result.get("price");
+    if(product.get("internalName")){
+    	internalName = product.get("internalName");
+    }
+} catch (e) {
+    Debug.logError(e, module);
+}
+
+row["orderId"] = salesOrderItemStarSchema.getString("orderId");
+row["orderItemSeqId"] = salesOrderItemStarSchema.getString("orderItemSeqId");
+row["orderStatus"] = salesOrderItemStarSchema.getString("orderStatus");
+row["saleChannel"] = salesOrderItemStarSchema.getString("saleChannel");
+row["quantity"] = salesOrderItemStarSchema.getString("quantity");
+row["extGrossAmount"] = salesOrderItemStarSchema.getString("extGrossAmount");
+row["orderDateDayOfMonth"] = salesOrderItemStarSchema.getString("orderDateDayOfMonth");
+row["orderDateMonthOfYear"] = salesOrderItemStarSchema.getString("orderDateMonthOfYear");
+row["orderDateYearName"] = salesOrderItemStarSchema.getString("orderDateYearName");
+row["price"] = price;
+row["stock"] = QOH;
+row["productId"]= salesOrderItemStarSchema.getString("productProductId");
+row["internalName"] = internalName;
+countOfRow ++;
+return true;]]></method>
+        </script-data-set>
+    </data-sets>
+    <cubes>
+        <tabular-cube name="DataCube" id="9">
+            <property name="dimensions">
+                <tabular-dimension name="Group" id="86">
+                    <property name="defaultHierarchy">NewTabularHierarchy</property>
+                    <property name="hierarchies">
+                        <tabular-hierarchy name="NewTabularHierarchy" id="87">
+                            <property name="levels">
+                                <tabular-level name="productId" id="88">
+                                    <property name="dataType">string</property>
+                                    <property name="columnName">productId</property>
+                                </tabular-level>
+                                <tabular-level name="internalName" id="281">
+                                    <property name="dataType">string</property>
+                                    <property name="columnName">internalName</property>
+                                </tabular-level>
+                                <tabular-level name="price" id="223">
+                                    <property name="dataType">string</property>
+                                    <property name="columnName">price</property>
+                                </tabular-level>
+                                <tabular-level name="stock" id="224">
+                                    <property name="dataType">string</property>
+                                    <property name="columnName">stock</property>
+                                </tabular-level>
+                                <tabular-level name="orderDateMonthOfYear" id="222">
+                                    <property name="dataType">string</property>
+                                    <property name="columnName">orderDateMonthOfYear</property>
+                                </tabular-level>
+                            </property>
+                        </tabular-hierarchy>
+                    </property>
+                </tabular-dimension>
+            </property>
+            <property name="measureGroups">
+                <tabular-measure-group name="Summary Field" id="89">
+                    <property name="measures">
+                        <tabular-measure name="orderItemSeqId" id="90">
+                            <property name="function">count</property>
+                            <expression name="measureExpression">dataSetRow["orderItemSeqId"]</expression>
+                            <property name="dataType">integer</property>
+                        </tabular-measure>
+                        <tabular-measure name="quantity" id="91">
+                            <property name="function">sum</property>
+                            <expression name="measureExpression" type="javascript">dataSetRow["quantity"]</expression>
+                            <property name="dataType">float</property>
+                        </tabular-measure>
+                        <tabular-measure name="extGrossAmount" id="92">
+                            <property name="function">sum</property>
+                            <expression name="measureExpression" type="javascript">dataSetRow["extGrossAmount"]</expression>
+                            <property name="dataType">float</property>
+                        </tabular-measure>
+                    </property>
+                </tabular-measure-group>
+            </property>
+            <property name="dataSet">SalesOrderItemStarSchema</property>
+        </tabular-cube>
+    </cubes>
+    <styles>
+        <style name="report" id="4">
+            <property name="fontFamily">sans-serif</property>
+            <property name="fontSize">10pt</property>
+        </style>
+        <style name="crosstab-cell" id="5">
+            <property name="borderBottomColor">#CCCCCC</property>
+            <property name="borderBottomStyle">solid</property>
+            <property name="borderBottomWidth">1pt</property>
+            <property name="borderLeftColor">#CCCCCC</property>
+            <property name="borderLeftStyle">solid</property>
+            <property name="borderLeftWidth">1pt</property>
+            <property name="borderRightColor">#CCCCCC</property>
+            <property name="borderRightStyle">solid</property>
+            <property name="borderRightWidth">1pt</property>
+            <property name="borderTopColor">#CCCCCC</property>
+            <property name="borderTopStyle">solid</property>
+            <property name="borderTopWidth">1pt</property>
+        </style>
+        <style name="crosstab" id="6">
+            <property name="borderBottomColor">#CCCCCC</property>
+            <property name="borderBottomStyle">solid</property>
+            <property name="borderBottomWidth">1pt</property>
+            <property name="borderLeftColor">#CCCCCC</property>
+            <property name="borderLeftStyle">solid</property>
+            <property name="borderLeftWidth">1pt</property>
+            <property name="borderRightColor">#CCCCCC</property>
+            <property name="borderRightStyle">solid</property>
+            <property name="borderRightWidth">1pt</property>
+            <property name="borderTopColor">#CCCCCC</property>
+            <property name="borderTopStyle">solid</property>
+            <property name="borderTopWidth">1pt</property>
+        </style>
+    </styles>
+    <page-setup>
+        <simple-master-page name="Simple MasterPage" id="2">
+            <page-footer>
+                <text id="3">
+                    <property name="contentType">html</property>
+                    <text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
+                </text>
+            </page-footer>
+        </simple-master-page>
+    </page-setup>
+    <body>
+        <text id="366">
+            <property name="fontSize">larger</property>
+            <property name="fontWeight">bold</property>
+            <property name="textAlign">center</property>
+            <property name="contentType">auto</property>
+            <text-property name="content"><![CDATA[Last 3 Months Sales Report]]></text-property>
+        </text>
+        <text id="367"/>
+        <extended-item extensionName="Crosstab" extensionVersion="2.5.0" id="282">
+            <property name="measures">
+                <extended-item extensionName="MeasureView" id="301">
+                    <property name="measure">orderItemSeqId</property>
+                    <property name="detail">
+                        <extended-item extensionName="AggregationCell" id="302">
+                            <property name="aggregationOnRow">Group/orderDateMonthOfYear</property>
+                            <property name="content">
+                                <data id="303">
+                                    <property name="resultSetColumn">orderItemSeqId_Group/orderDateMonthOfYear</property>
+                                </data>
+                            </property>
+                            <property name="width">0.9888888888888889in</property>
+                        </extended-item>
+                    </property>
+                    <property name="aggregations">
+                        <extended-item extensionName="AggregationCell" id="317">
+                            <property name="aggregationOnRow">Group/productId</property>
+                            <property name="content">
+                                <data id="318">
+                                    <property name="resultSetColumn">orderItemSeqId_Group/productId</property>
+                                </data>
+                            </property>
+                        </extended-item>
+                        <extended-item extensionName="AggregationCell" id="325">
+                            <property name="content">
+                                <data id="326">
+                                    <property name="resultSetColumn">orderItemSeqId</property>
+                                </data>
+                            </property>
+                        </extended-item>
+                    </property>
+                    <property name="header">
+                        <extended-item extensionName="CrosstabCell" id="304">
+                            <property name="content">
+                                <label id="305">
+                                    <property name="fontWeight">bold</property>
+                                    <text-property name="text">Items</text-property>
+                                </label>
+                            </property>
+                            <property name="height">0.32222222222222224in</property>
+                        </extended-item>
+                    </property>
+                </extended-item>
+                <extended-item extensionName="MeasureView" id="306">
+                    <property name="measure">quantity</property>
+                    <property name="detail">
+                        <extended-item extensionName="AggregationCell" id="307">
+                            <property name="aggregationOnRow">Group/orderDateMonthOfYear</property>
+                            <property name="content">
+                                <data id="308">
+                                    <property name="resultSetColumn">quantity_Group/orderDateMonthOfYear</property>
+                                </data>
+                            </property>
+                            <property name="width">0.9888888888888889in</property>
+                        </extended-item>
+                    </property>
+                    <property name="aggregations">
+                        <extended-item extensionName="AggregationCell" id="319">
+                            <property name="aggregationOnRow">Group/productId</property>
+                            <property name="content">
+                                <data id="320">
+                                    <property name="resultSetColumn">quantity_Group/productId</property>
+                                </data>
+                            </property>
+                        </extended-item>
+                        <extended-item extensionName="AggregationCell" id="327">
+                            <property name="content">
+                                <data id="328">
+                                    <property name="resultSetColumn">quantity</property>
+                                </data>
+                            </property>
+                        </extended-item>
+                    </property>
+                    <property name="header">
+                        <extended-item extensionName="CrosstabCell" id="309">
+                            <property name="content">
+                                <label id="310">
+                                    <property name="fontWeight">bold</property>
+                                    <text-property name="text">QTY</text-property>
+                                </label>
+                            </property>
+                        </extended-item>
+                    </property>
+                </extended-item>
+                <extended-item extensionName="MeasureView" id="311">
+                    <property name="measure">extGrossAmount</property>
+                    <property name="detail">
+                        <extended-item extensionName="AggregationCell" id="312">
+                            <property name="aggregationOnRow">Group/orderDateMonthOfYear</property>
+                            <property name="content">
+                                <data id="313">
+                                    <property name="resultSetColumn">extGrossAmount_Group/orderDateMonthOfYear</property>
+                                </data>
+                            </property>
+                            <property name="width">0.9888888888888889in</property>
+                        </extended-item>
+                    </property>
+                    <property name="aggregations">
+                        <extended-item extensionName="AggregationCell" id="321">
+                            <property name="aggregationOnRow">Group/productId</property>
+                            <property name="content">
+                                <data id="322">
+                                    <property name="resultSetColumn">extGrossAmount_Group/productId</property>
+                                </data>
+                            </property>
+                        </extended-item>
+                        <extended-item extensionName="AggregationCell" id="329">
+                            <property name="content">
+                                <data id="330">
+                                    <property name="resultSetColumn">extGrossAmount</property>
+                                </data>
+                            </property>
+                        </extended-item>
+                    </property>
+                    <property name="header">
+                        <extended-item extensionName="CrosstabCell" id="314">
+                            <property name="content">
+                                <label id="315">
+                                    <property name="fontWeight">bold</property>
+                                    <text-property name="text">ToTal</text-property>
+                                </label>
+                            </property>
+                        </extended-item>
+                    </property>
+                </extended-item>
+            </property>
+            <property name="rows">
+                <extended-item extensionName="CrosstabView" id="284">
+                    <property name="grandTotal">
+                        <extended-item extensionName="CrosstabCell" id="324">
+                            <property name="content">
+                                <label id="331">
+                                    <property name="fontWeight">bold</property>
+                                    <property name="textAlign">right</property>
+                                    <text-property name="text">Grand Total</text-property>
+                                </label>
+                            </property>
+                        </extended-item>
+                    </property>
+                    <property name="views">
+                        <extended-item extensionName="DimensionView" id="285">
+                            <property name="dimension">Group</property>
+                            <property name="levels">
+                                <extended-item extensionName="LevelView" name="NewLevel View" id="286">
+                                    <property name="level">Group/productId</property>
+                                    <property name="member">
+                                        <extended-item extensionName="CrosstabCell" id="287">
+                                            <property name="content">
+                                                <data name="productId" id="288">
+                                                    <property name="resultSetColumn">productId</property>
+                                                </data>
+                                            </property>
+                                            <property name="width">0.8777777777777778in</property>
+                                        </extended-item>
+                                    </property>
+                                    <property name="aggregationHeader">
+                                        <extended-item extensionName="CrosstabCell" id="316">
+                                            <property name="content">
+                                                <data name="productId_TOTAL" id="323">
+                                                    <property name="fontWeight">bold</property>
+                                                    <property name="textAlign">right</property>
+                                                    <property name="resultSetColumn">productId_TOTAL</property>
+                                                </data>
+                                            </property>
+                                        </extended-item>
+                                    </property>
+                                </extended-item>
+                                <extended-item extensionName="LevelView" name="NewLevel View1" id="289">
+                                    <property name="level">Group/internalName</property>
+                                    <property name="member">
+                                        <extended-item extensionName="CrosstabCell" id="290">
+                                            <property name="content">
+                                                <data name="internalName" id="291">
+                                                    <property name="resultSetColumn">internalName</property>
+                                                </data>
+                                            </property>
+                                            <property name="width">2.3222222222222224in</property>
+                                        </extended-item>
+                                    </property>
+                                </extended-item>
+                                <extended-item extensionName="LevelView" name="NewLevel View2" id="292">
+                                    <property name="level">Group/price</property>
+                                    <property name="member">
+                                        <extended-item extensionName="CrosstabCell" id="293">
+                                            <property name="content">
+                                                <data name="price" id="294">
+                                                    <property name="resultSetColumn">price</property>
+                                                </data>
+                                            </property>
+                                            <property name="width">0.5666666666666667in</property>
+                                        </extended-item>
+                                    </property>
+                                </extended-item>
+                                <extended-item extensionName="LevelView" name="NewLevel View3" id="295">
+                                    <property name="level">Group/stock</property>
+                                    <property name="member">
+                                        <extended-item extensionName="CrosstabCell" id="296">
+                                            <property name="content">
+                                                <data name="stock" id="297">
+                                                    <property name="resultSetColumn">stock</property>
+                                                </data>
+                                            </property>
+                                            <property name="width">0.6in</property>
+                                        </extended-item>
+                                    </property>
+                                </extended-item>
+                                <extended-item extensionName="LevelView" name="NewLevel View4" id="298">
+                                    <property name="level">Group/orderDateMonthOfYear</property>
+                                    <property name="member">
+                                        <extended-item extensionName="CrosstabCell" id="299">
+                                            <property name="content">
+                                                <data name="orderDateMonthOfYear" id="300">
+                                                    <property name="resultSetColumn">orderDateMonthOfYear</property>
+                                                </data>
+                                            </property>
+                                            <property name="width">0.5666666666666667in</property>
+                                        </extended-item>
+                                    </property>
+                                </extended-item>
+                            </property>
+                        </extended-item>
+                    </property>
+                    <property name="grandTotalLocation">after</property>
+                </extended-item>
+            </property>
+            <property name="header">
+                <extended-item extensionName="CrosstabCell" id="283">
+                    <property name="content">
+                        <grid id="345">
+                            <property name="width">4.844444444444444in</property>
+                            <column id="346">
+                                <property name="width">0.8333333333333334in</property>
+                            </column>
+                            <column id="347">
+                                <property name="width">2.2888888888888888in</property>
+                            </column>
+                            <column id="348">
+                                <property name="width">0.6in</property>
+                            </column>
+                            <column id="349">
+                                <property name="width">0.5888888888888889in</property>
+                            </column>
+                            <column id="350">
+                                <property name="width">0.5444444444444444in</property>
+                            </column>
+                            <row id="351">
+                                <cell id="352">
+                                    <text id="357">
+                                        <property name="fontWeight">bold</property>
+                                        <property name="contentType">auto</property>
+                                        <text-property name="content"><![CDATA[ProductID]]></text-property>
+                                    </text>
+                                </cell>
+                                <cell id="353">
+                                    <text id="358">
+                                        <property name="fontWeight">bold</property>
+                                        <property name="contentType">auto</property>
+                                        <text-property name="content"><![CDATA[Product Name]]></text-property>
+                                    </text>
+                                </cell>
+                                <cell id="354">
+                                    <text id="363">
+                                        <property name="fontWeight">bold</property>
+                                        <property name="contentType">auto</property>
+                                        <text-property name="content"><![CDATA[Price]]></text-property>
+                                    </text>
+                                </cell>
+                                <cell id="355">
+                                    <text id="364">
+                                        <property name="fontWeight">bold</property>
+                                        <property name="contentType">auto</property>
+                                        <text-property name="content"><![CDATA[Stock]]></text-property>
+                                    </text>
+                                </cell>
+                                <cell id="356">
+                                    <text id="365">
+                                        <property name="fontWeight">bold</property>
+                                        <property name="contentType">auto</property>
+                                        <text-property name="content"><![CDATA[Month]]></text-property>
+                                    </text>
+                                </cell>
+                            </row>
+                        </grid>
+                    </property>
+                </extended-item>
+            </property>
+            <property name="cube">DataCube</property>
+            <list-property name="boundDataColumns">
+                <structure>
+                    <property name="name">productId</property>
+                    <expression name="expression">dimension["Group"]["productId"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">internalName</property>
+                    <expression name="expression">dimension["Group"]["internalName"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">price</property>
+                    <expression name="expression">dimension["Group"]["price"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">stock</property>
+                    <expression name="expression">dimension["Group"]["stock"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">orderDateMonthOfYear</property>
+                    <expression name="expression">dimension["Group"]["orderDateMonthOfYear"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">orderItemSeqId_Group/orderDateMonthOfYear</property>
+                    <expression name="expression">measure["orderItemSeqId"]</expression>
+                    <property name="dataType">integer</property>
+                    <simple-property-list name="aggregateOn">
+                        <value>Group/orderDateMonthOfYear</value>
+                    </simple-property-list>
+                    <property name="aggregateFunction">SUM</property>
+                </structure>
+                <structure>
+                    <property name="name">quantity_Group/orderDateMonthOfYear</property>
+                    <expression name="expression">measure["quantity"]</expression>
+                    <property name="dataType">float</property>
+                    <simple-property-list name="aggregateOn">
+                        <value>Group/orderDateMonthOfYear</value>
+                    </simple-property-list>
+                    <property name="aggregateFunction">SUM</property>
+                </structure>
+                <structure>
+                    <property name="name">extGrossAmount_Group/orderDateMonthOfYear</property>
+                    <expression name="expression">measure["extGrossAmount"]</expression>
+                    <property name="dataType">float</property>
+                    <simple-property-list name="aggregateOn">
+                        <value>Group/orderDateMonthOfYear</value>
+                    </simple-property-list>
+                    <property name="aggregateFunction">SUM</property>
+                </structure>
+                <structure>
+                    <property name="name">orderItemSeqId_Group/productId</property>
+                    <expression name="expression">measure["orderItemSeqId"]</expression>
+                    <property name="dataType">integer</property>
+                    <simple-property-list name="aggregateOn">
+                        <value>Group/productId</value>
+                    </simple-property-list>
+                    <property name="aggregateFunction">SUM</property>
+                </structure>
+                <structure>
+                    <property name="name">quantity_Group/productId</property>
+                    <expression name="expression">measure["quantity"]</expression>
+                    <property name="dataType">float</property>
+                    <simple-property-list name="aggregateOn">
+                        <value>Group/productId</value>
+                    </simple-property-list>
+                    <property name="aggregateFunction">SUM</property>
+                </structure>
+                <structure>
+                    <property name="name">extGrossAmount_Group/productId</property>
+                    <expression name="expression">measure["extGrossAmount"]</expression>
+                    <property name="dataType">float</property>
+                    <simple-property-list name="aggregateOn">
+                        <value>Group/productId</value>
+                    </simple-property-list>
+                    <property name="aggregateFunction">SUM</property>
+                </structure>
+                <structure>
+                    <property name="name">productId_TOTAL</property>
+                    <expression name="expression">dimension["Group"]["productId"]+" TOTAL"</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">orderItemSeqId</property>
+                    <expression name="expression">measure["orderItemSeqId"]</expression>
+                    <property name="dataType">integer</property>
+                    <property name="aggregateFunction">SUM</property>
+                </structure>
+                <structure>
+                    <property name="name">quantity</property>
+                    <expression name="expression">measure["quantity"]</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateFunction">SUM</property>
+                </structure>
+                <structure>
+                    <property name="name">extGrossAmount</property>
+                    <expression name="expression">measure["extGrossAmount"]</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateFunction">SUM</property>
+                </structure>
+            </list-property>
+        </extended-item>
+    </body>
+</report>