svn commit: r886743 [1/4] - in /ofbiz/branches/addbirt: applications/accounting/webapp/accounting/WEB-INF/ applications/accounting/webapp/accounting/WEB-INF/actions/payment/ applications/accounting/webapp/accounting/payment/report/ applications/account...

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

svn commit: r886743 [1/4] - in /ofbiz/branches/addbirt: applications/accounting/webapp/accounting/WEB-INF/ applications/accounting/webapp/accounting/WEB-INF/actions/payment/ applications/accounting/webapp/accounting/payment/report/ applications/account...

hansbak-2
Author: hansbak
Date: Thu Dec  3 11:12:50 2009
New Revision: 886743

URL: http://svn.apache.org/viewvc?rev=886743&view=rev
Log:
some example Birt reports with selection forms in accounting -> payment and order -> reports

Added:
    ofbiz/branches/addbirt/applications/accounting/webapp/accounting/WEB-INF/actions/payment/PaymentReport.groovy   (with props)
    ofbiz/branches/addbirt/applications/accounting/webapp/accounting/payment/report/
    ofbiz/branches/addbirt/applications/accounting/webapp/accounting/payment/report/PaymentReport.rptdesign
    ofbiz/branches/addbirt/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OrderByChannel.groovy   (with props)
    ofbiz/branches/addbirt/applications/order/webapp/ordermgr/reports/OrderByReferrer.rptdesign
    ofbiz/branches/addbirt/applications/order/webapp/ordermgr/reports/OrderDiscountCodeReport.rptdesign
    ofbiz/branches/addbirt/applications/order/webapp/ordermgr/reports/OrdersByChannel.rptdesign
    ofbiz/branches/addbirt/applications/product/script/org/ofbiz/product/olap/FactServices.xml   (with props)
    ofbiz/branches/addbirt/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryItemReport.groovy   (with props)
    ofbiz/branches/addbirt/applications/product/webapp/facility/inventory/report/
    ofbiz/branches/addbirt/applications/product/webapp/facility/inventory/report/InventoryReport.rptdesign
Modified:
    ofbiz/branches/addbirt/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/branches/addbirt/applications/accounting/widget/AccountingMenus.xml
    ofbiz/branches/addbirt/applications/accounting/widget/CommonScreens.xml
    ofbiz/branches/addbirt/applications/accounting/widget/PaymentForms.xml
    ofbiz/branches/addbirt/applications/accounting/widget/PaymentScreens.xml
    ofbiz/branches/addbirt/applications/order/data/OrderPortletData.xml
    ofbiz/branches/addbirt/applications/order/entitydef/entitygroup_olap.xml
    ofbiz/branches/addbirt/applications/order/entitydef/entitymodel_olap.xml
    ofbiz/branches/addbirt/applications/order/script/org/ofbiz/order/olap/FactServices.xml
    ofbiz/branches/addbirt/applications/order/webapp/ordermgr/WEB-INF/controller.xml
    ofbiz/branches/addbirt/applications/order/widget/ordermgr/ReportForms.xml
    ofbiz/branches/addbirt/applications/order/widget/ordermgr/ReportScreens.xml
    ofbiz/branches/addbirt/applications/product/entitydef/entitygroup_olap.xml
    ofbiz/branches/addbirt/applications/product/entitydef/entitymodel_olap.xml
    ofbiz/branches/addbirt/applications/product/servicedef/services_olap.xml
    ofbiz/branches/addbirt/applications/product/webapp/facility/WEB-INF/controller.xml
    ofbiz/branches/addbirt/applications/product/widget/facility/FacilityForms.xml
    ofbiz/branches/addbirt/applications/product/widget/facility/FacilityScreens.xml
    ofbiz/branches/addbirt/applications/product/widget/facility/ReportScreens.xml
    ofbiz/branches/addbirt/framework/bi/script/org/ofbiz/bi/DimensionServices.xml

Added: ofbiz/branches/addbirt/applications/accounting/webapp/accounting/WEB-INF/actions/payment/PaymentReport.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/addbirt/applications/accounting/webapp/accounting/WEB-INF/actions/payment/PaymentReport.groovy?rev=886743&view=auto
==============================================================================
--- ofbiz/branches/addbirt/applications/accounting/webapp/accounting/WEB-INF/actions/payment/PaymentReport.groovy (added)
+++ ofbiz/branches/addbirt/applications/accounting/webapp/accounting/WEB-INF/actions/payment/PaymentReport.groovy Thu Dec  3 11:12:50 2009
@@ -0,0 +1,44 @@
+/*
+ * 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.accounting.util.UtilAccounting
+import org.ofbiz.base.util.*;
+import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.entity.condition.EntityCondition;
+import org.ofbiz.entity.condition.EntityOperator;
+birtParameters = [:];
+birtParameters.partyIdTo = request.getParameter("partyIdTo");
+birtParameters.paymentId = request.getParameter("paymentId");
+birtParameters.paymentTypeId = request.getParameter("paymentTypeId");
+birtParameters.paymentId_op = request.getParameter("paymentId_op");
+birtParameters.paymentRefNum_ic = request.getParameter("paymentRefNum_ic");
+birtParameters.noConditionFind = request.getParameter("noConditionFind");
+birtParameters.contentType = request.getParameter("contentType");
+birtParameters.partyIdFrom = request.getParameter("partyIdFrom");
+birtParameters.paymentRefNum_op = request.getParameter("paymentRefNum_op");
+birtParameters.amount = request.getParameter("amount");
+birtParameters.statusId = request.getParameter("statusId");
+birtParameters.paymentGatewayResponseId = request.getParameter("paymentGatewayResponseId");
+birtParameters.paymentId_ic = request.getParameter("paymentId_ic");
+birtParameters.paymentRefNum = request.getParameter("paymentRefNum");
+birtParameters.comments_ic = request.getParameter("comments_ic");
+birtParameters.comments_op = request.getParameter("comments_op");
+birtParameters.comments = request.getParameter("comments");
+request.setAttribute("birtParameters", birtParameters);
+return "success";
\ No newline at end of file

Propchange: ofbiz/branches/addbirt/applications/accounting/webapp/accounting/WEB-INF/actions/payment/PaymentReport.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/branches/addbirt/applications/accounting/webapp/accounting/WEB-INF/actions/payment/PaymentReport.groovy
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/branches/addbirt/applications/accounting/webapp/accounting/WEB-INF/actions/payment/PaymentReport.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/branches/addbirt/applications/accounting/webapp/accounting/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/addbirt/applications/accounting/webapp/accounting/WEB-INF/controller.xml?rev=886743&r1=886742&r2=886743&view=diff
==============================================================================
--- ofbiz/branches/addbirt/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/branches/addbirt/applications/accounting/webapp/accounting/WEB-INF/controller.xml Thu Dec  3 11:12:50 2009
@@ -24,7 +24,7 @@
     <include location="component://commonext/webapp/WEB-INF/controller.xml"/>
     <description>Accounting Manager Module Site Configuration File</description>
     <owner>Copyright 2001-2009 The Apache Software Foundation</owner>
-
+ <handler name="birt" type="view" class="org.ofbiz.webapp.view.BirtViewHandler"/>
     <!-- Events to run on every request before security (chains exempt) -->
     <!--
     <preprocessor>
@@ -2485,6 +2485,21 @@
         <response name="success" type="none"/>
         <response name="error" type="none"/>
     </request-map>
+    <!-- Reports -->
+    <request-map uri="paymentReport">
+     <security https="true" auth="true"/>
+        <response name="success" type="view" value="paymentReport"/>
+    </request-map>
+    <request-map uri="paymentReportHtml">
+        <security https="true" auth="true"/>
+        <event type="groovy" path="component://accounting/webapp/accounting/WEB-INF/actions/payment/" invoke="PaymentReport.groovy"/>
+        <response name="success" type="view" value="ViewPaymentReportHtml"/>
+    </request-map>
+    <request-map uri="paymentReportPdf">
+        <security https="true" auth="true"/>
+        <event type="groovy" path="component://accounting/webapp/accounting/WEB-INF/actions/payment/" invoke="PaymentReport.groovy"/>
+        <response name="success" type="view" value="ViewPaymentReportPdf"/>
+    </request-map>
     <!-- end of request mappings -->
 
     <!-- View Mappings -->
@@ -2522,6 +2537,8 @@
     <view-map name="PrintChecks" type="screenfop" page="component://accounting/widget/PaymentScreens.xml#PrintChecks" content-type="application/pdf" encoding="none"/>
     <view-map name="FindSalesInvoicesByDueDate" type="screen" page="component://accounting/widget/PaymentScreens.xml#FindSalesInvoicesByDueDate"/>
     <view-map name="FindPurchaseInvoicesByDueDate" type="screen" page="component://accounting/widget/PaymentScreens.xml#FindPurchaseInvoicesByDueDate"/>
+    <view-map name="paymentReport" type="screen" page="component://accounting/widget/PaymentScreens.xml#PaymentReport"/>
+    
 
     <!-- Payment Group -->
     <view-map name="FindPaymentGroup" type="screen" page="component://accounting/widget/PaymentGroupScreens.xml#FindPaymentGroup"/>
@@ -2785,5 +2802,7 @@
     <view-map name="CostCentersReportPdf" type="screenfop" page="component://accounting/widget/ReportFinancialSummaryScreens.xml#CostCentersReportPdf" content-type="application/pdf" encoding="none"/>
     <view-map name="ComparativeIncomeStatementsPdf" type="screenfop" page="component://accounting/widget/ReportFinancialSummaryScreens.xml#ComparativeIncomeStatementsPdf" content-type="application/pdf" encoding="none"/>
     <view-map name="ComparativeIncomeStatementsCsv" type="screencsv" page="component://accounting/widget/ReportFinancialSummaryScreens.xml#ComparativeIncomeStatementsCsv" content-type="text/csv" encoding="none"/>
+    <view-map name="ViewPaymentReportHtml" type="birt" page="component://accounting/webapp/accounting/payment/report/PaymentReport.rptdesign" content-type="text/html"/>
+    <view-map name="ViewPaymentReportPdf" type="birt" page="component://accounting/webapp/accounting/payment/report/PaymentReport.rptdesign" content-type="application/pdf"/>
     <!-- end of view mappings -->
 </site-conf>

Added: ofbiz/branches/addbirt/applications/accounting/webapp/accounting/payment/report/PaymentReport.rptdesign
URL: http://svn.apache.org/viewvc/ofbiz/branches/addbirt/applications/accounting/webapp/accounting/payment/report/PaymentReport.rptdesign?rev=886743&view=auto
==============================================================================
--- ofbiz/branches/addbirt/applications/accounting/webapp/accounting/payment/report/PaymentReport.rptdesign (added)
+++ ofbiz/branches/addbirt/applications/accounting/webapp/accounting/payment/report/PaymentReport.rptdesign Thu Dec  3 11:12:50 2009
@@ -0,0 +1,740 @@
+<?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>
+    <list-property name="userProperties">
+        <structure>
+            <property name="name">Payment.Payments.x</property>
+            <property name="type">integer</property>
+            <property name="isVisible">false</property>
+        </structure>
+        <structure>
+            <property name="name">Payment.Payments.y</property>
+            <property name="type">integer</property>
+            <property name="isVisible">false</property>
+        </structure>
+    </list-property>
+    <property name="Payment.Payments.x">135</property>
+    <property name="Payment.Payments.y">80</property>
+    <method name="initialize"><![CDATA[importPackage(Packages.org.ofbiz.base.util)
+importPackage(Packages.javolution.util)
+importPackage(Packages.org.ofbiz.entity.util)
+module = "PaymentReport.rptdesign";]]></method>
+    <property name="iconFile">/templates/blank_report.gif</property>
+    <property name="bidiLayoutOrientation">ltr</property>
+    <parameters>
+        <scalar-parameter name="paymentId" id="77">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+        <scalar-parameter name="partyIdTo" id="78">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+        <scalar-parameter name="partyIdFrom" id="79">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+        <scalar-parameter name="noConditionFind" id="80">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+        <scalar-parameter name="paymentTypeId" id="82">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+        <scalar-parameter name="paymentTypeId_op" id="83">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+        <scalar-parameter name="paymentRefNum_ic" id="84">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+        <scalar-parameter name="paymentRefNum_op" id="85">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+        <scalar-parameter name="amount" id="86">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+        <scalar-parameter name="statusId" id="87">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+        <scalar-parameter name="paymentId_ic" id="88">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+        <scalar-parameter name="paymentRefNum" id="89">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+        <scalar-parameter name="comments_ic" id="90">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+        <scalar-parameter name="comments_op" id="91">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+        <scalar-parameter name="comments" id="92">
+            <property name="valueType">static</property>
+            <property name="isRequired">false</property>
+            <property name="dataType">string</property>
+            <property name="distinct">true</property>
+            <property name="paramType">simple</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+    </parameters>
+    <data-sources>
+        <script-data-source name="OFBIZ" id="61"/>
+    </data-sources>
+    <data-sets>
+        <script-data-set name="Payments" id="62">
+            <list-property name="resultSetHints">
+                <structure>
+                    <property name="position">1</property>
+                    <property name="name">paymentId</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">2</property>
+                    <property name="name">paymentType</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">3</property>
+                    <property name="name">status</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">4</property>
+                    <property name="name">from</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">5</property>
+                    <property name="name">to</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">6</property>
+                    <property name="name">date</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">7</property>
+                    <property name="name">amount</property>
+                    <property name="dataType">float</property>
+                </structure>
+            </list-property>
+            <list-property name="columnHints">
+                <structure>
+                    <property name="columnName">paymentId</property>
+                </structure>
+                <structure>
+                    <property name="columnName">paymentType</property>
+                </structure>
+                <structure>
+                    <property name="columnName">status</property>
+                </structure>
+                <structure>
+                    <property name="columnName">from</property>
+                </structure>
+                <structure>
+                    <property name="columnName">to</property>
+                </structure>
+                <structure>
+                    <property name="columnName">date</property>
+                </structure>
+                <structure>
+                    <property name="columnName">amount</property>
+                </structure>
+            </list-property>
+            <list-property name="parameters">
+                <structure>
+                    <property name="name">parameters</property>
+                    <property name="dataType">javaObject</property>
+                    <property name="position">1</property>
+                    <expression name="defaultValue" type="javascript">null</expression>
+                    <property name="isInput">true</property>
+                    <property name="isOutput">false</property>
+                </structure>
+            </list-property>
+            <structure name="cachedMetaData">
+                <list-property name="resultSet">
+                    <structure>
+                        <property name="position">1</property>
+                        <property name="name">paymentId</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">2</property>
+                        <property name="name">paymentType</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">3</property>
+                        <property name="name">status</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">4</property>
+                        <property name="name">from</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">5</property>
+                        <property name="name">to</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">6</property>
+                        <property name="name">date</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">7</property>
+                        <property name="name">amount</property>
+                        <property name="dataType">float</property>
+                    </structure>
+                </list-property>
+            </structure>
+            <property name="dataSource">OFBIZ</property>
+            <method name="open"><![CDATA[payments = null;
+userLogin = null;
+parameters = null;
+try {
+    userLogin = delegator.findByPrimaryKey("UserLogin",UtilMisc.toMap("userLoginId","admin"));
+} catch(e) {
+        Debug.logError(e,"");
+}
+input =  FastMap.newInstance();
+inputFields =  FastMap.newInstance();
+if(params!=null){
+ inputFields.put("partyIdTo", params["partyIdTo"]);
+ inputFields.put("paymentId", params["paymentId"]);
+ inputFields.put("paymentTypeId", params["paymentTypeId"]);
+ inputFields.put("paymentId_op", params["paymentId_op"]);
+ inputFields.put("paymentRefNum_ic", params["paymentRefNum_ic"]);
+ inputFields.put("noConditionFind", params["noConditionFind"]);
+ inputFields.put("partyIdFrom", params["partyIdFrom"]);
+ inputFields.put("paymentRefNum_op", params["paymentRefNum_op"]);
+ inputFields.put("amount", params["amount"]);
+ inputFields.put("statusId", params["statusId"]);
+ inputFields.put("paymentGatewayResponseId", params["paymentGatewayResponseId"]);
+ inputFields.put("paymentId_ic", params["paymentId_ic"]);
+ inputFields.put("paymentRefNum", params["paymentRefNum"]);
+ inputFields.put("comments_ic", params["comments_ic"]);
+ inputFields.put("comments_op", params["comments_op"]);
+ inputFields.put("comments", params["comments"]);
+}
+input.put("userLogin",userLogin);
+input.put("inputFields",inputFields);
+input.put("entityName","PaymentAndType");
+input.put("orderBy","effectiveDate DESC");
+//input.put("viewIndex", 0);
+//input.put("viewSize", 20);
+try {
+    result = dispatcher.runSync("performFind", input);
+    payments = result.get("listIt");
+} catch (e) {
+    Debug.logError(e, module);
+}]]></method>
+            <method name="fetch"><![CDATA[if(payments==null)return false;
+if(payment=payments.next()){
+ row["paymentId"] = payment.getString("paymentId");
+ row["paymentType"] = payment.getString("paymentTypeId");
+ row["status"] = payment.getString("statusId");
+ row["from"] = payment.getString("partyIdFrom");
+ row["to"] = payment.getString("partyIdTo");
+ row["date"] = payment.getString("effectiveDate");
+ row["amount"] = payment.getString("amount");
+}else{
+ payments.close();
+ return false;
+}
+return true;]]></method>
+        </script-data-set>
+    </data-sets>
+    <cubes>
+        <tabular-cube name="Payment" id="93">
+            <property name="dimensions">
+                <tabular-dimension name="Group" id="94">
+                    <property name="defaultHierarchy">NewTabularHierarchy</property>
+                    <property name="hierarchies">
+                        <tabular-hierarchy name="NewTabularHierarchy" id="95">
+                            <property name="levels">
+                                <tabular-level name="paymentId" id="96">
+                                    <property name="dataType">string</property>
+                                    <property name="columnName">paymentId</property>
+                                </tabular-level>
+                                <tabular-level name="paymentType" id="111">
+                                    <property name="dataType">string</property>
+                                    <property name="columnName">paymentType</property>
+                                </tabular-level>
+                                <tabular-level name="status" id="112">
+                                    <property name="dataType">string</property>
+                                    <property name="columnName">status</property>
+                                </tabular-level>
+                                <tabular-level name="from" id="113">
+                                    <property name="dataType">string</property>
+                                    <property name="columnName">from</property>
+                                </tabular-level>
+                                <tabular-level name="to" id="114">
+                                    <property name="dataType">string</property>
+                                    <property name="columnName">to</property>
+                                </tabular-level>
+                                <tabular-level name="date" id="115">
+                                    <property name="dataType">string</property>
+                                    <property name="columnName">date</property>
+                                </tabular-level>
+                            </property>
+                        </tabular-hierarchy>
+                    </property>
+                </tabular-dimension>
+            </property>
+            <property name="measureGroups">
+                <tabular-measure-group name="Summary Field" id="219">
+                    <property name="measures">
+                        <tabular-measure name="amount" id="220">
+                            <property name="function">sum</property>
+                            <expression name="measureExpression" type="javascript">dataSetRow["amount"]</expression>
+                            <property name="dataType">float</property>
+                        </tabular-measure>
+                    </property>
+                </tabular-measure-group>
+            </property>
+            <property name="dataSet">Payments</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="71">
+            <property name="backgroundColor">silver</property>
+            <property name="fontSize">larger</property>
+            <property name="fontWeight">bolder</property>
+            <property name="textAlign">center</property>
+            <property name="textTransform">none</property>
+            <property name="contentType">auto</property>
+            <text-property name="content"><![CDATA[Payments Report
+]]></text-property>
+        </text>
+        <extended-item extensionName="Crosstab" extensionVersion="2.5.0" id="255">
+            <property name="measures">
+                <extended-item extensionName="MeasureView" id="277">
+                    <property name="measure">amount</property>
+                    <property name="detail">
+                        <extended-item extensionName="AggregationCell" id="278">
+                            <property name="aggregationOnRow">Group/date</property>
+                            <property name="content">
+                                <data id="279">
+                                    <property name="textAlign">center</property>
+                                    <property name="resultSetColumn">amount_Group/date</property>
+                                </data>
+                            </property>
+                        </extended-item>
+                    </property>
+                    <property name="aggregations">
+                        <extended-item extensionName="AggregationCell" id="283">
+                            <property name="content">
+                                <data id="284">
+                                    <property name="resultSetColumn">amount</property>
+                                </data>
+                            </property>
+                        </extended-item>
+                    </property>
+                    <property name="header">
+                        <extended-item extensionName="CrosstabCell" id="280">
+                            <property name="content">
+                                <label id="309">
+                                    <property name="backgroundColor">gray</property>
+                                    <property name="fontWeight">bold</property>
+                                    <property name="textOverline">none</property>
+                                    <property name="textAlign">center</property>
+                                    <text-property name="text">Date</text-property>
+                                </label>
+                            </property>
+                            <property name="height">0.3333333333333333in</property>
+                        </extended-item>
+                    </property>
+                </extended-item>
+            </property>
+            <property name="rows">
+                <extended-item extensionName="CrosstabView" id="257">
+                    <property name="grandTotal">
+                        <extended-item extensionName="CrosstabCell" id="282">
+                            <property name="content">
+                                <label id="285">
+                                    <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="258">
+                            <property name="dimension">Group</property>
+                            <property name="levels">
+                                <extended-item extensionName="LevelView" name="NewLevel View" id="259">
+                                    <property name="level">Group/paymentId</property>
+                                    <property name="member">
+                                        <extended-item extensionName="CrosstabCell" id="260">
+                                            <property name="content">
+                                                <data name="paymentId" id="261">
+                                                    <property name="textAlign">center</property>
+                                                    <property name="resultSetColumn">paymentId</property>
+                                                </data>
+                                            </property>
+                                        </extended-item>
+                                    </property>
+                                </extended-item>
+                                <extended-item extensionName="LevelView" name="NewLevel View1" id="262">
+                                    <property name="level">Group/paymentType</property>
+                                    <property name="member">
+                                        <extended-item extensionName="CrosstabCell" id="263">
+                                            <property name="content">
+                                                <data name="paymentType" id="264">
+                                                    <property name="textAlign">center</property>
+                                                    <property name="resultSetColumn">paymentType</property>
+                                                </data>
+                                            </property>
+                                        </extended-item>
+                                    </property>
+                                </extended-item>
+                                <extended-item extensionName="LevelView" name="NewLevel View2" id="265">
+                                    <property name="level">Group/status</property>
+                                    <property name="member">
+                                        <extended-item extensionName="CrosstabCell" id="266">
+                                            <property name="content">
+                                                <data name="status" id="267">
+                                                    <property name="textAlign">center</property>
+                                                    <property name="resultSetColumn">status</property>
+                                                </data>
+                                            </property>
+                                        </extended-item>
+                                    </property>
+                                </extended-item>
+                                <extended-item extensionName="LevelView" name="NewLevel View3" id="268">
+                                    <property name="level">Group/from</property>
+                                    <property name="member">
+                                        <extended-item extensionName="CrosstabCell" id="269">
+                                            <property name="content">
+                                                <data name="from" id="270">
+                                                    <property name="textAlign">center</property>
+                                                    <property name="resultSetColumn">from</property>
+                                                </data>
+                                            </property>
+                                        </extended-item>
+                                    </property>
+                                </extended-item>
+                                <extended-item extensionName="LevelView" name="NewLevel View4" id="271">
+                                    <property name="level">Group/to</property>
+                                    <property name="member">
+                                        <extended-item extensionName="CrosstabCell" id="272">
+                                            <property name="content">
+                                                <data name="to" id="273">
+                                                    <property name="textAlign">center</property>
+                                                    <property name="resultSetColumn">to</property>
+                                                </data>
+                                            </property>
+                                        </extended-item>
+                                    </property>
+                                </extended-item>
+                                <extended-item extensionName="LevelView" name="NewLevel View5" id="274">
+                                    <property name="level">Group/date</property>
+                                    <property name="member">
+                                        <extended-item extensionName="CrosstabCell" id="275">
+                                            <property name="content">
+                                                <data name="date" id="276">
+                                                    <property name="textAlign">center</property>
+                                                    <property name="resultSetColumn">date</property>
+                                                </data>
+                                            </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="256">
+                    <property name="content">
+                        <grid id="286">
+                            <column id="287"/>
+                            <column id="288"/>
+                            <column id="289"/>
+                            <column id="290"/>
+                            <column id="291"/>
+                            <column id="292"/>
+                            <row id="293">
+                                <cell id="294">
+                                    <label id="301">
+                                        <property name="backgroundColor">gray</property>
+                                        <property name="fontWeight">bold</property>
+                                        <property name="textOverline">none</property>
+                                        <property name="textAlign">center</property>
+                                        <text-property name="text">PaymentId</text-property>
+                                    </label>
+                                </cell>
+                                <cell id="295">
+                                    <label id="308">
+                                        <property name="backgroundColor">gray</property>
+                                        <property name="fontWeight">bold</property>
+                                        <property name="textOverline">none</property>
+                                        <property name="textAlign">center</property>
+                                        <text-property name="text">PaymentType</text-property>
+                                    </label>
+                                </cell>
+                                <cell id="296">
+                                    <label id="302">
+                                        <property name="backgroundColor">gray</property>
+                                        <property name="fontWeight">bold</property>
+                                        <property name="textOverline">none</property>
+                                        <property name="textAlign">center</property>
+                                        <text-property name="text">Status</text-property>
+                                    </label>
+                                </cell>
+                                <cell id="297">
+                                    <label id="307">
+                                        <property name="backgroundColor">gray</property>
+                                        <property name="fontWeight">bold</property>
+                                        <property name="textOverline">none</property>
+                                        <property name="textAlign">center</property>
+                                        <text-property name="text">From</text-property>
+                                    </label>
+                                </cell>
+                                <cell id="298">
+                                    <label id="305">
+                                        <property name="backgroundColor">gray</property>
+                                        <property name="fontWeight">bold</property>
+                                        <property name="textOverline">none</property>
+                                        <property name="textAlign">center</property>
+                                        <text-property name="text">To</text-property>
+                                    </label>
+                                </cell>
+                                <cell id="299">
+                                    <label id="306">
+                                        <property name="backgroundColor">gray</property>
+                                        <property name="fontWeight">bold</property>
+                                        <property name="textOverline">none</property>
+                                        <property name="textAlign">center</property>
+                                        <text-property name="text">Date</text-property>
+                                    </label>
+                                </cell>
+                            </row>
+                        </grid>
+                    </property>
+                </extended-item>
+            </property>
+            <property name="cube">Payment</property>
+            <list-property name="boundDataColumns">
+                <structure>
+                    <property name="name">paymentId</property>
+                    <expression name="expression">dimension["Group"]["paymentId"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">paymentType</property>
+                    <expression name="expression">dimension["Group"]["paymentType"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">status</property>
+                    <expression name="expression">dimension["Group"]["status"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">from</property>
+                    <expression name="expression">dimension["Group"]["from"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">to</property>
+                    <expression name="expression">dimension["Group"]["to"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">date</property>
+                    <expression name="expression">dimension["Group"]["date"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">amount_Group/date</property>
+                    <property name="dataType">float</property>
+                    <simple-property-list name="aggregateOn">
+                        <value>Group/date</value>
+                    </simple-property-list>
+                    <property name="aggregateFunction">SUM</property>
+                    <list-property name="arguments">
+                        <structure>
+                            <property name="name">Expression</property>
+                            <expression name="value" type="javascript">measure["amount"]</expression>
+                        </structure>
+                    </list-property>
+                </structure>
+                <structure>
+                    <property name="name">amount</property>
+                    <property name="dataType">float</property>
+                    <property name="aggregateFunction">SUM</property>
+                    <list-property name="arguments">
+                        <structure>
+                            <property name="name">Expression</property>
+                            <expression name="value" type="javascript">measure["amount"]</expression>
+                        </structure>
+                    </list-property>
+                </structure>
+            </list-property>
+        </extended-item>
+    </body>
+</report>

Modified: ofbiz/branches/addbirt/applications/accounting/widget/AccountingMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/addbirt/applications/accounting/widget/AccountingMenus.xml?rev=886743&r1=886742&r2=886743&view=diff
==============================================================================
--- ofbiz/branches/addbirt/applications/accounting/widget/AccountingMenus.xml (original)
+++ ofbiz/branches/addbirt/applications/accounting/widget/AccountingMenus.xml Thu Dec  3 11:12:50 2009
@@ -336,10 +336,7 @@
     </menu>
 
     <menu name="PaymentTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
-        <menu-item name="find" title="${uiLabelMap.CommonFind}" >
-            <condition>
-                <if-compare field="tabButtonItem" operator="not-equals" value="find"/>
-            </condition>
+        <menu-item name="findPayment" title="${uiLabelMap.CommonFind}" >
             <link target="findPayments"/>
         </menu-item>
         <menu-item name="paymentOverview" title="${uiLabelMap.AccountingPaymentTabOverview}">
@@ -361,6 +358,9 @@
                 <parameter param-name="paymentId" from-field="payment.paymentId"/>
             </link>
         </menu-item>
+       <menu-item name="paymentReport" title="Payment Report">
+            <link target="paymentReport"/>
+        </menu-item>
         <menu-item name="editPaymentApplications" title="${uiLabelMap.AccountingPaymentTabApplications}">
             <condition>
                 <and>

Modified: ofbiz/branches/addbirt/applications/accounting/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/addbirt/applications/accounting/widget/CommonScreens.xml?rev=886743&r1=886742&r2=886743&view=diff
==============================================================================
--- ofbiz/branches/addbirt/applications/accounting/widget/CommonScreens.xml (original)
+++ ofbiz/branches/addbirt/applications/accounting/widget/CommonScreens.xml Thu Dec  3 11:12:50 2009
@@ -48,6 +48,44 @@
             </widgets>
         </section>
     </screen>
+    
+    <screen name="CommonPaymentDecorator">
+        <section>
+            <actions>
+                <set field="headerItem" value="payments"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <section>
+                            <!-- do check for ACCOUNTING, _VIEW permission -->
+                            <condition>
+                                <if-has-permission permission="ACCOUNTING" action="_VIEW"/>
+                            </condition>
+                            <widgets>
+                                <include-menu name="PaymentTabBar" location="component://accounting/widget/AccountingMenus.xml"/>
+                                <include-menu name="PaymentSubTabBar" location="component://accounting/widget/AccountingMenus.xml"/>
+                                <container style="leftclear">
+                                 <section>
+                                 <condition>
+                                 <not><if-empty field="paymentId"/></not>
+                                 </condition>
+                                 <widgets>
+                                 <label style="h1" text="${uiLabelMap[labelTitleProperty]} ${uiLabelMap.CommonId}:[${paymentId}]  ${${extraFunctionName}}"/>
+                                 </widgets>
+                                    </section>
+                                </container>
+                                <decorator-section-include name="body"/>
+                            </widgets>
+                            <fail-widgets>
+                                <label style="h3" text="${uiLabelMap.AccountingViewPermissionError}"/>
+                            </fail-widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 
     <screen name="CommonPaymentGroupDecorator">
         <section>

Modified: ofbiz/branches/addbirt/applications/accounting/widget/PaymentForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/addbirt/applications/accounting/widget/PaymentForms.xml?rev=886743&r1=886742&r2=886743&view=diff
==============================================================================
--- ofbiz/branches/addbirt/applications/accounting/widget/PaymentForms.xml (original)
+++ ofbiz/branches/addbirt/applications/accounting/widget/PaymentForms.xml Thu Dec  3 11:12:50 2009
@@ -587,4 +587,17 @@
         <field name="transactionDate" position="1"><display/></field>
         <field name="statusId"  position="2" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem" description="${description}" key-field-name="statusId"/></field>
     </form>
+ <form name="PaymentReport" type="single"  target="paymentReportHtml" extends="FindPayments" extends-resource="component://accounting/widget/PaymentForms.xml" target-window="_BLANK">
+     <field name="contentType" action="document.PaymentReport.action=this.value" event="onchange">
+     <drop-down>
+     <option key="paymentReportHtml" description="text/html"></option>
+ <option key="paymentReportPdf" description="application/pdf"></option>
+ <!--option key="application/vnd.ms-excel">application/vnd.ms-excel</option>
+ <option key="application/vnd.ms-word">application/vnd.ms-word</option>
+ <option key="application/vnd.ms-powerpoint">application/vnd.ms-powerpoint</option-->
+     </drop-down>
+     </field>
+     <field name="searchButton"><hidden/></field>
+     <field name="report" title="Report" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
 </forms>

Modified: ofbiz/branches/addbirt/applications/accounting/widget/PaymentScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/addbirt/applications/accounting/widget/PaymentScreens.xml?rev=886743&r1=886742&r2=886743&view=diff
==============================================================================
--- ofbiz/branches/addbirt/applications/accounting/widget/PaymentScreens.xml (original)
+++ ofbiz/branches/addbirt/applications/accounting/widget/PaymentScreens.xml Thu Dec  3 11:12:50 2009
@@ -65,9 +65,10 @@
             <actions>
                 <set field="titleProperty" value="PageTitleFindPayment"/>
                 <set field="headerItem" value="payments"/>
+                <set field="tabButtonItem" value="findPayment"/>
             </actions>
             <widgets>
-                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+               <decorator-screen name="CommonPaymentDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <section>
                             <widgets>
@@ -538,4 +539,25 @@
             </widgets>
         </section>
     </screen>
+    <screen name="PaymentReport">
+        <section>
+            <actions>
+             <set field="headerItem" value="payments"/>
+                <set field="tabButtonItem" value="paymentReport"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonPaymentDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>
+                            <screenlet title="Payment Report">
+                             <include-form name="PaymentReport" location="component://accounting/widget/PaymentForms.xml"/>
+                            </screenlet>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>

Modified: ofbiz/branches/addbirt/applications/order/data/OrderPortletData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/addbirt/applications/order/data/OrderPortletData.xml?rev=886743&r1=886742&r2=886743&view=diff
==============================================================================
--- ofbiz/branches/addbirt/applications/order/data/OrderPortletData.xml (original)
+++ ofbiz/branches/addbirt/applications/order/data/OrderPortletData.xml Thu Dec  3 11:12:50 2009
@@ -130,4 +130,29 @@
         description=""/>
     <PortletPortletCategory portalPortletId="SalesReport" portletCategoryId="REPORT"/>
     <PortalPagePortlet portalPageId="OrderReportPage" portalPortletId="SalesReport" portletSeqId="00001" columnSeqId="00002" sequenceNum="5"/>
+    
+    <PortalPortlet portalPortletId="OrderByReferrer"
+        portletName="Sale Orders By Referrer Report"
+        screenName="SaleOrdersByReferrerReport"
+        screenLocation="component://order/widget/ordermgr/ReportScreens.xml"
+        description=""/>
+    <PortletPortletCategory portalPortletId="OrderByReferrer" portletCategoryId="REPORT"/>
+    <PortalPagePortlet portalPageId="OrderReportPage" portalPortletId="OrderByReferrer" portletSeqId="00001" columnSeqId="00001" sequenceNum="6"/>
+    
+ <PortalPortlet portalPortletId="OrderByChannel"
+        portletName="Sale Orders by Channel"
+        screenName="SaleOrdersByChannelReport"
+        screenLocation="component://order/widget/ordermgr/ReportScreens.xml"
+        description=""/>
+    <PortletPortletCategory portalPortletId="OrderByChannel" portletCategoryId="REPORT"/>
+    <PortalPagePortlet portalPageId="OrderReportPage" portalPortletId="OrderByChannel" portletSeqId="00001" columnSeqId="00001" sequenceNum="7"/>
+
+    <PortalPortlet portalPortletId="OrderDiscountCode"
+        portletName="Orders with discount code"
+        screenName="SaleOrderDiscountCodeReport"
+        screenLocation="component://order/widget/ordermgr/ReportScreens.xml"
+        description=""/>
+    <PortletPortletCategory portalPortletId="OrderDiscountCode" portletCategoryId="REPORT"/>
+    <PortalPagePortlet portalPageId="OrderReportPage" portalPortletId="OrderDiscountCode" portletSeqId="00001" columnSeqId="00001" sequenceNum="5"/>
+
 </entity-engine-xml>

Modified: ofbiz/branches/addbirt/applications/order/entitydef/entitygroup_olap.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/addbirt/applications/order/entitydef/entitygroup_olap.xml?rev=886743&r1=886742&r2=886743&view=diff
==============================================================================
--- ofbiz/branches/addbirt/applications/order/entitydef/entitygroup_olap.xml (original)
+++ ofbiz/branches/addbirt/applications/order/entitydef/entitygroup_olap.xml Thu Dec  3 11:12:50 2009
@@ -30,6 +30,7 @@
     <!-- Star Schemas                                              -->
     <!-- ========================================================= -->
     <entity-group group="org.ofbiz.olap" entity="SalesOrderItemStarSchema"/>
+    
 
 </entitygroup>
 

Modified: ofbiz/branches/addbirt/applications/order/entitydef/entitymodel_olap.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/addbirt/applications/order/entitydef/entitymodel_olap.xml?rev=886743&r1=886742&r2=886743&view=diff
==============================================================================
--- ofbiz/branches/addbirt/applications/order/entitydef/entitymodel_olap.xml (original)
+++ ofbiz/branches/addbirt/applications/order/entitydef/entitymodel_olap.xml Thu Dec  3 11:12:50 2009
@@ -38,11 +38,15 @@
         <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="quantity" type="fixed-point">
             <description>Quantity order. From OrderItem.quantity</description>
         </field>
-        
+        <field name="orderStatus" type="description"></field>
+ <field name="saleChannel" type="description"></field>
+ <field name="visitId" type="id-ne"></field>
+ <field name="initialReferrer" type="url"></field>
+        <field name="productPromoCode" type="id"></field>
         <field name="extGrossAmount" type="currency-precise">
             <description>Extended gross amount: quantity item multiplied by the unit price.</description>
         </field>
@@ -182,11 +186,21 @@
             <exclude field="origCurrencyDimId"/>
             <exclude field="orderId"/>
             <exclude field="orderItemSeqId"/>
+            <exclude field="orderStatus"/>
+     <exclude field="saleChannel"/>
+     <exclude field="visitId"/>
+     <exclude field="initialReferrer"/>
+            <exclude field="productPromoCode"/>
         </alias-all>
         <alias entity-alias="SIIF" name="orderId" group-by="true">
             <description>Order id</description>
         </alias>
         <alias entity-alias="SIIF" name="orderItemSeqId" group-by="true"/>
+        <alias entity-alias="SIIF" name="orderStatus" group-by="true"/>
+        <alias entity-alias="SIIF" name="saleChannel" group-by="true"/>
+        <alias entity-alias="SIIF" name="visitId" group-by="true"/>
+        <alias entity-alias="SIIF" name="initialReferrer" group-by="true"/>
+        <alias entity-alias="SIIF" name="productPromoCode" group-by="true"/>
 
         <view-link entity-alias="SIIF" rel-entity-alias="IDD">
             <key-map field-name="orderDateDimId" rel-field-name="dimensionId"/>

Modified: ofbiz/branches/addbirt/applications/order/script/org/ofbiz/order/olap/FactServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/addbirt/applications/order/script/org/ofbiz/order/olap/FactServices.xml?rev=886743&r1=886742&r2=886743&view=diff
==============================================================================
--- ofbiz/branches/addbirt/applications/order/script/org/ofbiz/order/olap/FactServices.xml (original)
+++ ofbiz/branches/addbirt/applications/order/script/org/ofbiz/order/olap/FactServices.xml Thu Dec  3 11:12:50 2009
@@ -177,6 +177,17 @@
                             <calcop field="discount.amount" operator="negative"/>
                         </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>
 
@@ -216,6 +227,37 @@
                 </if-compare>
             </iterate>
             
+            <!-- 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 -->
@@ -243,4 +285,5 @@
             <store-value value-field="fact"/>
         </if-compare>
     </simple-method>
+  
 </simple-methods>

Added: ofbiz/branches/addbirt/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OrderByChannel.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/addbirt/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OrderByChannel.groovy?rev=886743&view=auto
==============================================================================
--- ofbiz/branches/addbirt/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OrderByChannel.groovy (added)
+++ ofbiz/branches/addbirt/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OrderByChannel.groovy Thu Dec  3 11:12:50 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/branches/addbirt/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OrderByChannel.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Modified: ofbiz/branches/addbirt/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/addbirt/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=886743&r1=886742&r2=886743&view=diff
==============================================================================
--- ofbiz/branches/addbirt/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ ofbiz/branches/addbirt/applications/order/webapp/ordermgr/WEB-INF/controller.xml Thu Dec  3 11:12:50 2009
@@ -1654,6 +1654,17 @@
         <response name="success" type="view" value="OrderPickSheetPDF"/>
         <response name="error" type="view" value="orderview"/>
     </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="LookupProductCategory">
         <security auth="true" https="true"/>
@@ -1766,6 +1777,9 @@
     <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="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="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"/>