fixed bug 22607 fixed bug 21684 Being able to export Shipments Dimensional Report to xls format.
authorNaiara Martinez <naiara.martinez@openbravo.com>
Mon, 17 Dec 2012 18:06:06 +0100
changeset 19064 9b74aa6eac00
parent 19062 55d6d93f9d91
child 19065 a9024a3c712c
fixed bug 22607 fixed bug 21684 Being able to export Shipments Dimensional Report to xls format.
In Payment report group by financial account and allow to order by it and due date.
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_TEXTINTERFACES.xml
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.xml
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportExcel.jrxml
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml
src-db/database/sourcedata/AD_MESSAGE.xml
src-db/database/sourcedata/AD_TEXTINTERFACES.xml
src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJR.java
src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJRFilter.html
--- a/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Mon Dec 17 18:34:33 2012 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Mon Dec 17 18:06:06 2012 +0100
@@ -462,6 +462,17 @@
 <!--7FFF499FA6DE45D8A60427A22D91165E-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
 <!--7FFF499FA6DE45D8A60427A22D91165E--></AD_TEXTINTERFACES>
 
+<!--81DD7CAF25BE4F17BF5F04B43BB076E0--><AD_TEXTINTERFACES>
+<!--81DD7CAF25BE4F17BF5F04B43BB076E0-->  <AD_TEXTINTERFACES_ID><![CDATA[81DD7CAF25BE4F17BF5F04B43BB076E0]]></AD_TEXTINTERFACES_ID>
+<!--81DD7CAF25BE4F17BF5F04B43BB076E0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--81DD7CAF25BE4F17BF5F04B43BB076E0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--81DD7CAF25BE4F17BF5F04B43BB076E0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--81DD7CAF25BE4F17BF5F04B43BB076E0-->  <TEXT><![CDATA[ACCS_ACCOUNT_ID_D]]></TEXT>
+<!--81DD7CAF25BE4F17BF5F04B43BB076E0-->  <FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml]]></FILENAME>
+<!--81DD7CAF25BE4F17BF5F04B43BB076E0-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--81DD7CAF25BE4F17BF5F04B43BB076E0-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
+<!--81DD7CAF25BE4F17BF5F04B43BB076E0--></AD_TEXTINTERFACES>
+
 <!--8747F91C31704FD0A9EC0C35237158BE--><AD_TEXTINTERFACES>
 <!--8747F91C31704FD0A9EC0C35237158BE-->  <AD_TEXTINTERFACES_ID><![CDATA[8747F91C31704FD0A9EC0C35237158BE]]></AD_TEXTINTERFACES_ID>
 <!--8747F91C31704FD0A9EC0C35237158BE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -748,6 +759,17 @@
 <!--B973837A2C334DC49973CEE4179F43B7-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
 <!--B973837A2C334DC49973CEE4179F43B7--></AD_TEXTINTERFACES>
 
+<!--B9CF74E3592E4EF684332D8BD3F34AE2--><AD_TEXTINTERFACES>
+<!--B9CF74E3592E4EF684332D8BD3F34AE2-->  <AD_TEXTINTERFACES_ID><![CDATA[B9CF74E3592E4EF684332D8BD3F34AE2]]></AD_TEXTINTERFACES_ID>
+<!--B9CF74E3592E4EF684332D8BD3F34AE2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B9CF74E3592E4EF684332D8BD3F34AE2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B9CF74E3592E4EF684332D8BD3F34AE2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B9CF74E3592E4EF684332D8BD3F34AE2-->  <TEXT><![CDATA[Financial Account]]></TEXT>
+<!--B9CF74E3592E4EF684332D8BD3F34AE2-->  <FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportExcel.jrxml]]></FILENAME>
+<!--B9CF74E3592E4EF684332D8BD3F34AE2-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--B9CF74E3592E4EF684332D8BD3F34AE2-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
+<!--B9CF74E3592E4EF684332D8BD3F34AE2--></AD_TEXTINTERFACES>
+
 <!--BA44533ED06A4B73BCE144691D928626--><AD_TEXTINTERFACES>
 <!--BA44533ED06A4B73BCE144691D928626-->  <AD_TEXTINTERFACES_ID><![CDATA[BA44533ED06A4B73BCE144691D928626]]></AD_TEXTINTERFACES_ID>
 <!--BA44533ED06A4B73BCE144691D928626-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html	Mon Dec 17 18:34:33 2012 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html	Mon Dec 17 18:06:06 2012 +0100
@@ -1127,7 +1127,7 @@
                       <table border="0" cellspacing="0" cellpadding="0" width="90%" class="DataGrid_Header_Table DataGrid_Body_Table" style="table-layout: auto;">
                         <div id="sectionStatus">
                           <tr class="DataGrid_Body_Row">
-                            <th colspan="15"  class="DataGrid_Header_Cell" style="text-align:left">Status<span>:&nbsp;</span>
+                            <th colspan="16"  class="DataGrid_Header_Cell" style="text-align:left">Status<span>:&nbsp;</span>
                             <span id="fieldStatus">xxStatusName</span></th>
                           </tr>
                     
@@ -1148,6 +1148,7 @@
                             <th width="10%" class="DataGrid_Header_Cell">Trans. Currency</th>
                             <th width="10%" class="DataGrid_Header_Cell">Base Amount</th>
                             <th width="10%" class="DataGrid_Header_Cell">Base Currency</th>
+                            <th width="10%" class="DataGrid_Header_Cell">Financial Account</th>
                           </tr>
                     
                           <div id="sectionDetail">
@@ -1177,6 +1178,7 @@
                               <td width="10%" id="fieldTransCurrency" class="DataGrid_Body_Cell">xx14500.34</td>
                               <td width="10%" id="fieldBaseAmount" class="DataGrid_Body_Cell_Amount">xx14500.34</td>
                               <td width="10%" id="fieldBaseCurrency" class="DataGrid_Body_Cell" style="text-align:center">xx14500.34</td>
+                              <td width="10%" id="fieldFinAccount" class="DataGrid_Body_Cell" style="text-align:center">xx14500.34</td>                       
                             </tr>
                           </div>
                           <tr class="DataGrid_Body_Row">
@@ -1184,9 +1186,10 @@
                             <th width="100%" class="DataGrid_Header_Cell_Amount" colspan="12"></th>
                             <th width="10%" class="DataGrid_Header_Cell_Amount" style="text-align:right"><span class="Bold" id="subtotalBaseAmount"></span></th>
                             <th width="10%" class="DataGrid_Header_Cell"><span class="Bold" id="fieldBaseCurrency"></span></th>
+                            <th width="100%" class="DataGrid_Header_Cell_Amount"></th>
                           </tr>
                           <tr>
-                            <th colspan="15" height="25px"/>
+                            <th colspan="16" height="25px"/>
                           </tr>
                         </div>
                       </table>
@@ -1195,7 +1198,7 @@
                       <table cellspacing="0" cellpadding="0" width="90%" class="DataGrid_Header_Table DataGrid_Body_Table" style="table-layout: auto;">
                           <div id="sectionGroupCrit">
                             <tr class="DataGrid_Body_Row">
-                              <th colspan="12" class="DataGrid_Header_Cell" style="text-align:left">Grouping Criteria<span>:&nbsp;</span>
+                              <th colspan="13" class="DataGrid_Header_Cell" style="text-align:left">Grouping Criteria<span>:&nbsp;</span>
                                 <span id="fieldGroupCritName">xxGroupCritName</span></th>
                              <!-- <th class="DataGrid_Header_Cell">Balance</th>
                               <th class="DataGrid_Header_Cell_Amount"><span id="sumBalanceAmount"></span></th>
@@ -1204,7 +1207,7 @@
                             </tr>
                             <div id="sectionStatus2">
                                 <tr class="DataGrid_Body_Row">
-                                  <th colspan="15" class="DataGrid_Header_Cell" style="text-align:left">Status<span>:&nbsp;</span>
+                                  <th colspan="16" class="DataGrid_Header_Cell" style="text-align:left">Status<span>:&nbsp;</span>
                                 <span id="fieldStatus2">xxStatusName</span></th>
                                 </tr>
                         
@@ -1224,6 +1227,7 @@
                                     <th width="10%" class="DataGrid_Header_Cell">Trans. Currency</th>
                                     <th width="10%" class="DataGrid_Header_Cell">Base Amount</th>
                                     <th width="10%" class="DataGrid_Header_Cell">Base Currency</th>
+                                    <th width="10%" class="DataGrid_Header_Cell">Financial Account</th>
                                 </tr>
                         
                                 <div id="sectionDetail2">
@@ -1252,6 +1256,7 @@
                                     <td width="10%" id="fieldTransCurrency2" class="DataGrid_Body_Cell">xx14500.34</td>
                                     <td width="10%" id="fieldBaseAmount2" class="DataGrid_Body_Cell_Amount">xx14500.34</td>
                                     <td width="10%" id="fieldBaseCurrency2" class="DataGrid_Body_Cell" style="text-align:center">xx14500.34</td>
+                                    <td width="10%" id="fieldFinAccount2" class="DataGrid_Body_Cell" style="text-align:center">xx14500.34</td>
                                   </tr>
                                 </div>
                                 <tr class="DataGrid_Body_Row">
@@ -1259,11 +1264,12 @@
                                   <th width="100%" class="DataGrid_Header_Cell_Amount" colspan="12"></th>
                                   <th width="10%" class="DataGrid_Header_Cell_Amount" style="text-align:right"><span class="Bold" id="subtotalBaseAmountStatus"></span></th>
                                   <th width="10%" class="DataGrid_Header_Cell"><span class="Bold" id="fieldBaseCurrency2"></span></th>
+                                  <th width="100%" class="DataGrid_Header_Cell_Amount"></th>
                                 </tr>
                               
                             </div>
                             <tr>
-                              <th colspan="15" style="height:25px"/>
+                              <th colspan="16" style="height:25px"/>
                             </tr>
                           </div>
                       </table>
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java	Mon Dec 17 18:34:33 2012 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java	Mon Dec 17 18:06:06 2012 +0100
@@ -123,7 +123,7 @@
       String strGroupCrit = vars.getGlobalVariable("inpGroupCrit", "PaymentReport|GroupCrit", "");
       String strOrdCrit = vars.getInGlobalVariable("inpShown", "PaymentReport|OrdCrit", "",
           new ValueListFilter("Date", "APRM_FATS_BPARTNER", "Project", "INS_CURRENCY",
-              "FINPR_BPartner_Category", ""));
+              "FINPR_BPartner_Category", "ACCS_ACCOUNT_ID_D", "DueDate", ""));
       final String strInclPaymentUsingCredit = vars.getGlobalVariable("inpInclPaymentUsingCredit",
           "PaymentReport|IncludePaymentUsingCredit", "Y");
       printPageDataSheet(response, vars, strOrg, strInclSubOrg, strDueDateFrom, strDueDateTo,
@@ -197,7 +197,7 @@
           .getRequestGlobalVariable("inpGroupCrit", "PaymentReport|GroupCrit");
       String strOrdCrit = vars.getRequestInGlobalVariable("inpShown", "PaymentReport|OrdCrit",
           new ValueListFilter("Date", "APRM_FATS_BPARTNER", "Project", "INS_CURRENCY",
-              "FINPR_BPartner_Category", ""));
+              "FINPR_BPartner_Category", "ACCS_ACCOUNT_ID_D", "DueDate", ""));
       final String strInclPaymentUsingCredit = vars.getStringParameter("inpInclPaymentUsingCredit",
           "N");
       vars.setSessionValue("PaymentReport|IncludePaymentUsingCredit", strInclPaymentUsingCredit);
@@ -255,7 +255,7 @@
           .getRequestGlobalVariable("inpGroupCrit", "PaymentReport|GroupCrit");
       String strOrdCrit = vars.getRequestInGlobalVariable("inpShown", "PaymentReport|OrdCrit",
           new ValueListFilter("Date", "APRM_FATS_BPARTNER", "Project", "INS_CURRENCY",
-              "FINPR_BPartner_Category", ""));
+              "FINPR_BPartner_Category", "ACCS_ACCOUNT_ID_D", "DueDate", ""));
       String strOutput = "html";
       final String strInclPaymentUsingCredit = vars.getStringParameter("inpInclPaymentUsingCredit",
           "N");
@@ -636,6 +636,11 @@
     sqlRO.setData("NAME", Utility.messageBD(this, "INS_CURRENCY", vars.getLanguage()));
     sqlRO.setData("DESCRIPTION", "");
     vector.addElement(sqlRO);
+    sqlRO = new SQLReturnObject();
+    sqlRO.setData("ID", "ACCS_ACCOUNT_ID_D");
+    sqlRO.setData("NAME", Utility.messageBD(this, "ACCS_ACCOUNT_ID_D", vars.getLanguage()));
+    sqlRO.setData("DESCRIPTION", "");
+    vector.addElement(sqlRO);
 
     objectListData = new FieldProvider[vector.size()];
     vector.copyInto(objectListData);
@@ -673,6 +678,18 @@
     sqlRO.setData("DESCRIPTION", "");
     vector.addElement(sqlRO);
 
+    sqlRO = new SQLReturnObject();
+    sqlRO.setData("ID", "ACCS_ACCOUNT_ID_D");
+    sqlRO.setData("NAME", Utility.messageBD(this, "ACCS_ACCOUNT_ID_D", vars.getLanguage()));
+    sqlRO.setData("DESCRIPTION", "");
+    vector.addElement(sqlRO);
+
+    sqlRO = new SQLReturnObject();
+    sqlRO.setData("ID", "DueDate");
+    sqlRO.setData("NAME", Utility.messageBD(this, "DueDate", vars.getLanguage()));
+    sqlRO.setData("DESCRIPTION", "");
+    vector.addElement(sqlRO);
+
     objectListData = new FieldProvider[vector.size()];
     vector.copyInto(objectListData);
 
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.xml	Mon Dec 17 18:34:33 2012 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.xml	Mon Dec 17 18:06:06 2012 +0100
@@ -154,6 +154,7 @@
     <FIELD id="fieldTransCurrency">TRANS_CURRENCY</FIELD>
     <FIELD id="fieldBaseAmount" format="euroInform">BASE_AMOUNT</FIELD>
     <FIELD id="fieldBaseCurrency">BASE_CURRENCY</FIELD>
+    <FIELD id="fieldFinAccount">FINANCIAL_ACCOUNT</FIELD>
 
 <!--     Accumulates Base Amount columns values -->
     <FUNCTION id="subtotalBaseAmount" name="SUM" format="euroInform">BASE_AMOUNT</FUNCTION>
@@ -192,6 +193,7 @@
     <FIELD id="fieldTransCurrency2">TRANS_CURRENCY</FIELD>
     <FIELD id="fieldBaseAmount2" format="euroInform">BASE_AMOUNT</FIELD>
     <FIELD id="fieldBaseCurrency2">BASE_CURRENCY</FIELD>
+    <FIELD id="fieldFinAccount2">FINANCIAL_ACCOUNT</FIELD>
     <FIELD id="fieldGroupCritName">GROUP_CRIT_ID</FIELD>
     <FIELD id="fieldGroupCrit">GROUP_CRIT_ID</FIELD>
 
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java	Mon Dec 17 18:34:33 2012 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java	Mon Dec 17 18:06:06 2012 +0100
@@ -476,6 +476,11 @@
         hsqlScript.append(", invcur.");
         hsqlScript.append(Currency.PROPERTY_ISOCODE);
         hsqlScript.append("), ");
+      } else if (strGroupCrit.equalsIgnoreCase("ACCS_ACCOUNT_ID_D")) { // REVISAR
+        hsqlScript.append(" coalesce(pay.");
+        hsqlScript.append(FIN_Payment.PROPERTY_ACCOUNT);
+        hsqlScript.append(", 'Awaiting Payment'");
+        hsqlScript.append("), ");
       }
 
       hsqlScript.append(" a, coalesce(pay.");
@@ -486,7 +491,7 @@
         String[] strOrdCritList = strOrdCrit.substring(2, strOrdCrit.length() - 2).split("', '");
 
         for (int i = 0; i < strOrdCritList.length; i++) {
-          if (strOrdCritList[i].contains("Date")) {
+          if (strOrdCritList[i].equalsIgnoreCase("Date")) {
             hsqlScript.append(", inv.");
             hsqlScript.append(Invoice.PROPERTY_INVOICEDATE);
           }
@@ -518,6 +523,14 @@
             hsqlScript.append(Currency.PROPERTY_ISOCODE);
             hsqlScript.append(")");
           }
+          if (strOrdCritList[i].equalsIgnoreCase("ACCS_ACCOUNT_ID_D")) {
+            hsqlScript.append(",  pay.");
+            hsqlScript.append(FIN_Payment.PROPERTY_ACCOUNT);
+          }
+          if (strOrdCritList[i].equalsIgnoreCase("DueDate")) {
+            hsqlScript.append(", invps.");
+            hsqlScript.append(FIN_PaymentSchedule.PROPERTY_DUEDATE);
+          }
         }
       }
 
@@ -525,9 +538,9 @@
       hsqlScript.append(FIN_PaymentScheduleDetail.PROPERTY_INVOICEPAYMENTSCHEDULE);
       hsqlScript.append(".");
       hsqlScript.append(FIN_PaymentSchedule.PROPERTY_ID);
-
       final Session session = OBDal.getInstance().getSession();
       final Query query = session.createQuery(hsqlScript.toString());
+
       int pos = 0;
       for (final Object param : parameters) {
         if (param instanceof BaseOBObject) {
@@ -969,6 +982,10 @@
           FieldProviderFactory.setField(previousRow, "GROUP_CRIT_ID",
               previousRow.getField("TRANS_CURRENCY"));
           FieldProviderFactory.setField(previousRow, "GROUP_CRIT", "Currency");
+        } else if (strGroupCrit.equalsIgnoreCase("ACCS_ACCOUNT_ID_D")) {
+          FieldProviderFactory.setField(previousRow, "GROUP_CRIT_ID",
+              previousRow.getField("FINANCIAL_ACCOUNT"));
+          FieldProviderFactory.setField(previousRow, "GROUP_CRIT", "Finnancial Account");
         } else {
           FieldProviderFactory.setField(previousRow, "GROUP_CRIT_ID", "");
         }
@@ -1246,6 +1263,10 @@
       FieldProviderFactory.setField(transactionData, "GROUP_CRIT_ID",
           transactionData.getField("TRANS_CURRENCY"));
       FieldProviderFactory.setField(transactionData, "GROUP_CRIT", "Currency");
+    } else if (strGroupCrit.equalsIgnoreCase("ACCS_ACCOUNT_ID_D")) {
+      FieldProviderFactory.setField(transactionData, "GROUP_CRIT_ID",
+          transactionData.getField("FINANCIAL_ACCOUNT"));
+      FieldProviderFactory.setField(transactionData, "GROUP_CRIT", "Finnancial Account");
     } else {
       FieldProviderFactory.setField(transactionData, "GROUP_CRIT_ID", "");
       FieldProviderFactory.setField(transactionData, "GROUP_CRIT", "");
@@ -1407,6 +1428,10 @@
             || (transaction.getCurrency().getISOCode().toString()
                 .compareTo(data.getField("TRANS_CURRENCY")) < 0);
       }
+      if (strOrdCritList[i].equalsIgnoreCase("DueDate")) {
+        Date dataDate = FIN_Utility.getDate(data.getField("DUE_DATE"));
+        isBefore = isBefore || (transaction.getDateAcct().compareTo(dataDate) < 0);
+      }
       return isBefore;
     } else {
       if (strOrdCritList[i].contains("Project")) {
@@ -1457,7 +1482,7 @@
           isBefore = isBeforeOrder(transaction, data, strOrdCritList, i + 1, BPName, BPCategory,
               strProject);
         }
-      } else if (strOrdCritList[i].contains("Date")) {
+      } else if (strOrdCritList[i].equalsIgnoreCase("Date")) {
         Date dataDate = FIN_Utility.getDate(data.getField("INVOICE_DATE"));
         if (dataDate != null) {
           isBefore = false;
@@ -1465,6 +1490,16 @@
           isBefore = isBeforeOrder(transaction, data, strOrdCritList, i + 1, BPName, BPCategory,
               strProject);
         }
+      } else if (strOrdCritList[i].equalsIgnoreCase("DueDate")) {
+        Date dataDate = FIN_Utility.getDate(data.getField("DUE_DATE"));
+        if (dataDate == null) {
+          isBefore = true;
+        } else if ((transaction.getDateAcct().compareTo(dataDate) < 0)) {
+          isBefore = true;
+        } else {
+          isBefore = isBeforeOrder(transaction, data, strOrdCritList, i + 1, BPName, BPCategory,
+              strProject);
+        }
       }
       return isBefore;
     }
@@ -1670,6 +1705,8 @@
         obCriteriaTrans.addOrder(Order.asc("bpc." + Category.PROPERTY_NAME));
       } else if (strGroupCrit.equalsIgnoreCase("INS_CURRENCY")) {
         obCriteriaTrans.addOrder(Order.asc("c." + Currency.PROPERTY_ISOCODE));
+      } else if (strGroupCrit.equalsIgnoreCase("ACCS_ACCOUNT_ID_D")) {
+        obCriteriaTrans.addOrder(Order.asc(FIN_FinaccTransaction.PROPERTY_ACCOUNT));
       }
 
       obCriteriaTrans.addOrder(Order.asc(FIN_FinaccTransaction.PROPERTY_STATUS));
@@ -1677,7 +1714,7 @@
       if (!strOrdCrit.isEmpty()) {
         String[] strOrdCritList = strOrdCrit.substring(2, strOrdCrit.length() - 2).split("', '");
         for (int i = 0; i < strOrdCritList.length; i++) {
-          if (strOrdCritList[i].contains("Date")) {
+          if (strOrdCritList[i].equalsIgnoreCase("Date")) {
             obCriteriaTrans.addOrder(Order.asc(FIN_FinaccTransaction.PROPERTY_DATEACCT));
           }
           if (strOrdCritList[i].contains("Project")) {
@@ -1692,6 +1729,12 @@
           if (strOrdCritList[i].contains("INS_CURRENCY")) {
             obCriteriaTrans.addOrder(Order.asc("c." + Currency.PROPERTY_ISOCODE));
           }
+          if (strOrdCritList[i].contains("ACCS_ACCOUNT_ID_D")) {
+            obCriteriaTrans.addOrder(Order.asc(FIN_FinaccTransaction.PROPERTY_ACCOUNT));
+          }
+          if (strOrdCritList[i].equalsIgnoreCase("DueDate")) {
+            obCriteriaTrans.addOrder(Order.asc(FIN_FinaccTransaction.PROPERTY_TRANSACTIONDATE));
+          }
         }
       }
       obCriteriaTrans.addOrderBy(FIN_FinaccTransaction.PROPERTY_ID, true);
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportExcel.jrxml	Mon Dec 17 18:34:33 2012 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportExcel.jrxml	Mon Dec 17 18:06:06 2012 +0100
@@ -3,7 +3,7 @@
 	<property name="ireport.scriptlethandling" value="0"/>
 	<property name="ireport.encoding" value="UTF-8"/>
 	<property name="ireport.zoom" value="1.0"/>
-	<property name="ireport.x" value="734"/>
+	<property name="ireport.x" value="1058"/>
 	<property name="ireport.y" value="0"/>
 	<import value="net.sf.jasperreports.engine.*"/>
 	<import value="java.util.*"/>
@@ -266,6 +266,14 @@
 				</textElement>
 				<text><![CDATA[Deposit/Withdraw Date]]></text>
 			</staticText>
+			<staticText>
+               <reportElement key="staticText-14" style="Detail_Header" x="1574" y="25" width="77" height="25"/>
+               <box leftPadding="2"/>
+               <textElement textAlignment="Center">
+                   <font size="8" isBold="false"/>
+               </textElement>
+               <text><![CDATA[Financial Account]]></text>
+           </staticText>
 		</band>
 	</pageHeader>
 	<columnHeader>
@@ -426,6 +434,13 @@
 				</textElement>
 				<textFieldExpression class="java.util.Date"><![CDATA[$F{DEPOSIT_WITHDRAW_DATE}]]></textFieldExpression>
 			</textField>
+			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
+               <reportElement key="textField-14" style="Report_Footer" x="1574" y="0" width="77" height="25"/>
+               <textElement textAlignment="Center">
+                   <font size="8"/>
+               </textElement>
+               <textFieldExpression class="java.lang.String"><![CDATA[$F{FINANCIAL_ACCOUNT}]]></textFieldExpression>
+           </textField>
 		</band>
 	</detail>
 	<columnFooter>
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml	Mon Dec 17 18:34:33 2012 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml	Mon Dec 17 18:06:06 2012 +0100
@@ -3,8 +3,8 @@
 	<property name="ireport.scriptlethandling" value="0"/>
 	<property name="ireport.encoding" value="UTF-8"/>
 	<property name="ireport.zoom" value="1.0"/>
-	<property name="ireport.x" value="0"/>
-	<property name="ireport.y" value="48"/>
+	<property name="ireport.x" value="25"/>
+	<property name="ireport.y" value="151"/>
 	<import value="net.sf.jasperreports.engine.*"/>
 	<import value="java.util.*"/>
 	<import value="net.sf.jasperreports.engine.data.*"/>
@@ -288,7 +288,9 @@
 		<groupExpression><![CDATA[($P{GROUP_CRIT}.equalsIgnoreCase("APRM_FATS_BPARTNER") ? $F{BPARTNER} :
   ($P{GROUP_CRIT}.equalsIgnoreCase("Project") ? $F{PROJECT} :
     ($P{GROUP_CRIT}.equalsIgnoreCase("FINPR_BPartner_Category") ? $F{BP_GROUP} :
-      ($P{GROUP_CRIT}.equalsIgnoreCase("INS_CURRENCY") ? $F{BASE_CURRENCY} : " "
+      ($P{GROUP_CRIT}.equalsIgnoreCase("INS_CURRENCY") ? $F{TRANS_CURRENCY} :
+        ($P{GROUP_CRIT}.equalsIgnoreCase("ACCS_ACCOUNT_ID_D") ? $F{FINANCIAL_ACCOUNT} :  " "
+        )
       )
     )
   )
@@ -304,7 +306,9 @@
 					<textFieldExpression class="java.lang.String"><![CDATA[($P{GROUP_CRIT}.equalsIgnoreCase("APRM_FATS_BPARTNER") ? $F{BPARTNER}.toString() :
   ($P{GROUP_CRIT}.equalsIgnoreCase("Project") ? $F{PROJECT}.toString() :
     ($P{GROUP_CRIT}.equalsIgnoreCase("FINPR_BPartner_Category") ? $F{BP_GROUP}.toString() :
-      ($P{GROUP_CRIT}.equalsIgnoreCase("INS_CURRENCY") ? $F{TRANS_CURRENCY}.toString() : "None"
+      ($P{GROUP_CRIT}.equalsIgnoreCase("INS_CURRENCY") ? $F{TRANS_CURRENCY}.toString() :
+        ($P{GROUP_CRIT}.equalsIgnoreCase("ACCS_ACCOUNT_ID_D") ? $F{FINANCIAL_ACCOUNT}.toString() :  "None"
+        )
       )
     )
   )
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Dec 17 18:34:33 2012 +0100
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Dec 17 18:06:06 2012 +0100
@@ -16533,6 +16533,17 @@
 <!--438DDB0A996D4ADF91F3C731DDC2146F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--438DDB0A996D4ADF91F3C731DDC2146F--></AD_MESSAGE>
 
+<!--43A084513DAE435A807E8C115961C4AC--><AD_MESSAGE>
+<!--43A084513DAE435A807E8C115961C4AC-->  <AD_MESSAGE_ID><![CDATA[43A084513DAE435A807E8C115961C4AC]]></AD_MESSAGE_ID>
+<!--43A084513DAE435A807E8C115961C4AC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--43A084513DAE435A807E8C115961C4AC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--43A084513DAE435A807E8C115961C4AC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--43A084513DAE435A807E8C115961C4AC-->  <VALUE><![CDATA[DueDate]]></VALUE>
+<!--43A084513DAE435A807E8C115961C4AC-->  <MSGTEXT><![CDATA[Due Date]]></MSGTEXT>
+<!--43A084513DAE435A807E8C115961C4AC-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--43A084513DAE435A807E8C115961C4AC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--43A084513DAE435A807E8C115961C4AC--></AD_MESSAGE>
+
 <!--43A909085DF1445AB36732B5B5BDA544--><AD_MESSAGE>
 <!--43A909085DF1445AB36732B5B5BDA544-->  <AD_MESSAGE_ID><![CDATA[43A909085DF1445AB36732B5B5BDA544]]></AD_MESSAGE_ID>
 <!--43A909085DF1445AB36732B5B5BDA544-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Mon Dec 17 18:34:33 2012 +0100
+++ b/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Mon Dec 17 18:06:06 2012 +0100
@@ -14143,6 +14143,17 @@
 <!--53275D35722A4AE28B74C04938BF33B7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--53275D35722A4AE28B74C04938BF33B7--></AD_TEXTINTERFACES>
 
+<!--5450D2BE7B8748A8811C4D0964DDE38A--><AD_TEXTINTERFACES>
+<!--5450D2BE7B8748A8811C4D0964DDE38A-->  <AD_TEXTINTERFACES_ID><![CDATA[5450D2BE7B8748A8811C4D0964DDE38A]]></AD_TEXTINTERFACES_ID>
+<!--5450D2BE7B8748A8811C4D0964DDE38A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--5450D2BE7B8748A8811C4D0964DDE38A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--5450D2BE7B8748A8811C4D0964DDE38A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--5450D2BE7B8748A8811C4D0964DDE38A-->  <TEXT><![CDATA[XLS Format]]></TEXT>
+<!--5450D2BE7B8748A8811C4D0964DDE38A-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJRFilter.html]]></FILENAME>
+<!--5450D2BE7B8748A8811C4D0964DDE38A-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--5450D2BE7B8748A8811C4D0964DDE38A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--5450D2BE7B8748A8811C4D0964DDE38A--></AD_TEXTINTERFACES>
+
 <!--54C1E7A930E347E7B3AD261B80B599C5--><AD_TEXTINTERFACES>
 <!--54C1E7A930E347E7B3AD261B80B599C5-->  <AD_TEXTINTERFACES_ID><![CDATA[54C1E7A930E347E7B3AD261B80B599C5]]></AD_TEXTINTERFACES_ID>
 <!--54C1E7A930E347E7B3AD261B80B599C5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -15738,6 +15749,17 @@
 <!--5F4C1DE27F6B495ABD4F549040FF5F5A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--5F4C1DE27F6B495ABD4F549040FF5F5A--></AD_TEXTINTERFACES>
 
+<!--5F62980B18264A78A6F5A43E86256DE5--><AD_TEXTINTERFACES>
+<!--5F62980B18264A78A6F5A43E86256DE5-->  <AD_TEXTINTERFACES_ID><![CDATA[5F62980B18264A78A6F5A43E86256DE5]]></AD_TEXTINTERFACES_ID>
+<!--5F62980B18264A78A6F5A43E86256DE5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--5F62980B18264A78A6F5A43E86256DE5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--5F62980B18264A78A6F5A43E86256DE5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--5F62980B18264A78A6F5A43E86256DE5-->  <TEXT><![CDATA[Export Results to XLS Format]]></TEXT>
+<!--5F62980B18264A78A6F5A43E86256DE5-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJRFilter.html]]></FILENAME>
+<!--5F62980B18264A78A6F5A43E86256DE5-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--5F62980B18264A78A6F5A43E86256DE5-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--5F62980B18264A78A6F5A43E86256DE5--></AD_TEXTINTERFACES>
+
 <!--60131D0676FF409BAD9EF1084CA6A6A3--><AD_TEXTINTERFACES>
 <!--60131D0676FF409BAD9EF1084CA6A6A3-->  <AD_TEXTINTERFACES_ID><![CDATA[60131D0676FF409BAD9EF1084CA6A6A3]]></AD_TEXTINTERFACES_ID>
 <!--60131D0676FF409BAD9EF1084CA6A6A3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJR.java	Mon Dec 17 18:34:33 2012 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJR.java	Mon Dec 17 18:06:06 2012 +0100
@@ -142,7 +142,8 @@
           strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strmWarehouseId,
           strNotShown, strShown, strDateFromRef, strDateToRef, strOrg, strsalesrepId, strOrder,
           strMayor, strMenor, strPartnerSalesrepId, strCurrencyId, "html");
-    } else if (vars.commandIn("EDIT_PDF", "EDIT_PDF_COMPARATIVE")) {
+    } else if (vars.commandIn("EDIT_PDF", "EDIT_PDF_COMPARATIVE", "EDIT_XLS",
+        "EDIT_XLS_COMPARATIVE")) {
       String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom",
           "ReportShipmentDimensionalAnalyzeJR|dateFrom");
       String strDateTo = vars.getRequestGlobalVariable("inpDateTo",
@@ -177,10 +178,17 @@
       String strComparative = vars.getStringParameter("inpComparative", "N");
       String strCurrencyId = vars.getGlobalVariable("inpCurrencyId",
           "ReportShipmentDimensionalAnalyzeJR|currency", strUserCurrencyId);
-      printPageHtml(request, response, vars, strComparative, strDateFrom, strDateTo,
-          strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strmWarehouseId,
-          strNotShown, strShown, strDateFromRef, strDateToRef, strOrg, strsalesrepId, strOrder,
-          strMayor, strMenor, strPartnerSalesrepId, strCurrencyId, "pdf");
+      if (vars.commandIn("EDIT_PDF", "EDIT_PDF_COMPARATIVE")) {
+        printPageHtml(request, response, vars, strComparative, strDateFrom, strDateTo,
+            strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strmWarehouseId,
+            strNotShown, strShown, strDateFromRef, strDateToRef, strOrg, strsalesrepId, strOrder,
+            strMayor, strMenor, strPartnerSalesrepId, strCurrencyId, "pdf");
+      } else {
+        printPageHtml(request, response, vars, strComparative, strDateFrom, strDateTo,
+            strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strmWarehouseId,
+            strNotShown, strShown, strDateFromRef, strDateToRef, strOrg, strsalesrepId, strOrder,
+            strMayor, strMenor, strPartnerSalesrepId, strCurrencyId, "xls");
+      }
     } else
       pageErrorPopUp(response);
   }
--- a/src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJRFilter.html	Mon Dec 17 18:34:33 2012 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJRFilter.html	Mon Dec 17 18:06:06 2012 +0100
@@ -814,6 +814,30 @@
                       <div>
                         <button type="button" 
                           class="ButtonLink" 
+                          onclick="openServletNewWindow('EDIT_XLS', true, 'ReportShipmentDimensionalAnalyzeJREdition.html', 'ReportShipmentDimensionalAnalyzeJREdition', null, false, '700', '1000', true);return false;" 
+                          onfocus="buttonEvent('onfocus', this); window.status='Export Results to XLS Format'; return true;" 
+                          onblur="buttonEvent('onblur', this);" 
+                          onkeyup="buttonEvent('onkeyup', this);" 
+                          onkeydown="buttonEvent('onkeydown', this);" 
+                          onkeypress="buttonEvent('onkeypress', this);" 
+                          onmouseup="buttonEvent('onmouseup', this);" 
+                          onmousedown="buttonEvent('onmousedown', this);" 
+                          onmouseover="buttonEvent('onmouseover', this); window.status='Export Results to XLS Format'; return true;" 
+                          onmouseout="buttonEvent('onmouseout', this);">
+                          <table class="Button">
+                            <tr>
+                              <td class="Button_left"><img class="Button_Icon Button_Icon_pdf" alt="Export Results to XLS Format" title="Export Results to XLS Format" src="../../../../../web/images/blank.gif" border="0" /></td>
+                              <td class="Button_text">XLS Format</td>
+                              <td class="Button_right"></td>
+                            </tr>
+                          </table>
+                        </button>
+                      </div>
+                    </td>
+                    <td class="Button_LeftAlign_ContentCell" colspan="0">
+                      <div>
+                        <button type="button" 
+                          class="ButtonLink" 
                           onclick="openServletNewWindow('EDIT_PDF', true, 'ReportShipmentDimensionalAnalyzeJREdition.html', 'ReportShipmentDimensionalAnalyzeJREdition', null, false, '700', '1000', true);return false;" 
                           onfocus="buttonEvent('onfocus', this); window.status='Export Results to PDF Format'; return true;" 
                           onblur="buttonEvent('onblur', this);"