details:   /erp/devel/pi/rev/dcb5c16ec13d
changeset: 12061:dcb5c16ec13d
user:      Ioritz Cia <ioritz.cia <at> openbravo.com>
date:      Thu May 05 17:40:59 2011 +0200
summary:   Fixes issue 16455: Payment report: Filters are not stored.

details:   /erp/devel/pi/rev/e317dcf60d8d
changeset: 12062:e317dcf60d8d
user:      Ioritz Cia <ioritz.cia <at> openbravo.com>
date:      Thu May 05 19:46:37 2011 +0200
summary:   New left joins in Payment Report for new hibernate behaviour.

details:   /erp/devel/pi/rev/305530340709
changeset: 12063:305530340709
user:      Ioritz Cia <ioritz.cia <at> openbravo.com>
date:      Thu May 05 20:29:37 2011 +0200
summary:   Fixes issue 15884: CurrentDSO and Overdue columns are being 
calculated wrong.

details:   /erp/devel/pi/rev/65e926b95433
changeset: 12064:65e926b95433
user:      Ioritz Cia <ioritz.cia <at> openbravo.com>
date:      Mon May 09 11:52:11 2011 +0200
summary:   Fixes issue 16455: Payment report: Filters are not stored: Status 
filter.

diffstat:

 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html
    |   82 +++++-
 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
    |   76 +++++-
 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.xml
     |   23 +-
 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
 |  118 +++++----
 4 files changed, 218 insertions(+), 81 deletions(-)

diffs (truncated from 518 to 300 lines):

diff -r 91b7608a44e8 -r 65e926b95433 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html
--- 
a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html
   Mon May 09 13:17:55 2011 +0200
+++ 
b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html
   Mon May 09 11:52:11 2011 +0200
@@ -121,7 +121,9 @@
         updateMenuIcon('buttonMenu');
 
         setWindowElementFocus('firstElement');
-        hideGroupedOrderingCriteria()
+        hideGroupedOrderingCriteria();
+        hideLeftRight();
+        selectedStatuses();
     }
     function onResizeDo(){
         resizeArea();
@@ -132,28 +134,81 @@
         var ord = document.frmMain.inpOrdCrit;
         var sho = document.frmMain.inpShown;
 
-        var last;
+        var lastOrd;
+        var lastSho;
+        var i;
 
         for (i = 0; i < ord.length; i++){
             if (gro.options[gro.selectedIndex].value == ord.options[i].value){
-                ord[i].style.display = 'none';
-                last = ord[i];
+                ord[i].style.visibility = "hidden";
+                lastOrd = ord[i];
             }
             else
-                ord[i].style.display = '';
+                ord[i].style.visibility = '';
         }
 
+        if (lastOrd != null){
+            ord.remove(lastOrd.index);
+            ord.add(lastOrd, null);
+        }
+
+        for (i = 0; i < sho.length ; i++){
+            if (gro.options[gro.selectedIndex].value == sho.options[i].value){
+                sho[i].style.visibility = "hidden";
+                lastSho = sho[i];
+            }
+            else
+                sho[i].style.visibility = '';
+        }
+        
+        if (lastSho != null){
+            sho.remove(lastSho.index);
+            sho.add(lastSho, null);
+        }
+    }
+    function hideLeftRight(){        
+        var ord = document.frmMain.inpOrdCrit;
+        var sho = document.frmMain.inpShown;
+
+        var last;
+        var i;
+        var j;
+        
+       for (i = 0; i < ord.length; i++){
+            for (j = 0; j < sho.length; j++){
+                if (ord.options[i].value == sho.options[j].value){
+                    ord[i].style.visibility = "hidden";
+                    last = ord[i];
+                }
+            }
+        }
+        
         if (last != null){
             ord.remove(last.index);
             ord.add(last, null);
         }
-
-        for (i = 0; i < sho.length ; i++){
-            if (gro.options[gro.selectedIndex].value == sho.options[i].value)
-                sho[i].style.display = 'none';
-            else
-                sho[i].style.display = '';
-        }
+    }
+    function selectedStatuses(){
+       var selStatus = document.frmMain.inpSelectedStatuses;
+       var strSelStatus;
+       var arrSelStatus;
+       var status = document.frmMain.paramfinPaymSt;
+       
+       var i;
+       var j;
+       
+       strSelStatus = selStatus.value.replace("('","");
+       strSelStatus = strSelStatus.replace("')","");
+       
+       arrSelStatus = strSelStatus.split("', '");
+       
+       for (i = 0; i < arrSelStatus.length; i++ ){
+               for (j = 0; j < status.options.length; j++){
+                       if (arrSelStatus[i] == status.options[j].value){
+                               status.options[j].selected = true;
+                       }
+               }
+       }
     }
     function openPaymentTab(isReceipt, recordId) {
        var myframe = getFrame('LayoutMDI') || top.opener;
@@ -189,6 +244,7 @@
   <input type="hidden" name="inpAdTableId"></input>
   <input type="hidden" name="inpIsReceipt"></input>
   <input type="hidden" name="inpRecordId"></input>
+  <input type="hidden" name="inpSelectedStatuses" id="inpSelectedStatuses" 
value=""></input>
   
   <table height="100%" border="0" cellpadding="0" cellspacing="0" id="main">
     <tr>
@@ -764,7 +820,7 @@
                     <span class="LabelText">Grouping Criteria</span>
                   </td>
                   <td class="Combo_ContentCell" colspan="2">
-                    <select  name="inpGroupCrit" id="paramGroupCrit" 
class="Combo Combo_TwoCells_width" onchange="hideGroupedOrderingCriteria();">
+                    <select  name="inpGroupCrit" id="paramGroupCrit" 
class="Combo Combo_TwoCells_width" 
onchange="hideGroupedOrderingCriteria();hideLeftRight();">
                       <option value=""> <div id="reportGroupCrit"></div> 
</option>
                     </select>
                   </td>
diff -r 91b7608a44e8 -r 65e926b95433 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
--- 
a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
   Mon May 09 13:17:55 2011 +0200
+++ 
b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
   Mon May 09 11:52:11 2011 +0200
@@ -36,6 +36,7 @@
 import org.openbravo.data.FieldProvider;
 import org.openbravo.data.Sqlc;
 import org.openbravo.erpCommon.businessUtility.WindowTabs;
+import org.openbravo.erpCommon.info.SelectorUtilityData;
 import org.openbravo.erpCommon.utility.ComboTableData;
 import org.openbravo.erpCommon.utility.LeftTabsBar;
 import org.openbravo.erpCommon.utility.NavigationBar;
@@ -60,8 +61,54 @@
       ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
 
-    if (vars.commandIn("FIND", "DEFAULT")) {
+    if (vars.commandIn("DEFAULT")) {
       String strOrg = vars.getGlobalVariable("inpOrg", 
"PaymentReport|Organization", "");
+      String strInclSubOrg = vars.getGlobalVariable("inpInclSubOrg",
+          "PaymentReport|IncludeSubOrganization", "");
+      String strDueDateFrom = vars.getGlobalVariable("inpDueDateFrom", 
"PaymentReport|DueDateFrom",
+          "");
+      String strDueDateTo = vars
+          .getRequestGlobalVariable("inpDueDateTo", "PaymentReport|DueDateTo");
+      String strAmountFrom = vars.getNumericGlobalVariable("inpAmountFrom",
+          "PaymentReport|AmountFrom", "");
+      String strAmountTo = vars.getNumericGlobalVariable("inpAmountTo", 
"PaymentReport|AmountTo",
+          "");
+      String strDocumentDateFrom = 
vars.getGlobalVariable("inpDocumentDateFrom",
+          "PaymentReport|DocumentDateFrom", "");
+      String strDocumentDateTo = vars.getGlobalVariable("inpDocumentDateTo",
+          "PaymentReport|DocumentDateTo", "");
+      String strcBPartnerIdIN = vars.getInGlobalVariable("inpcBPartnerId_IN",
+          "PaymentReport|BusinessPartner", "", IsIDFilter.instance);
+      String strcBPGroupIdIN = vars.getGlobalVariable("inpcBPGroupId_IN",
+          "PaymentReport|BusinessPartnerCategory", "");
+      String strcProjectIdIN = vars.getInGlobalVariable("inpcProjectId_IN",
+          "PaymentReport|Project", "", IsIDFilter.instance);
+      dao = new PaymentReportDao();
+      String strfinPaymSt = vars.getInGlobalVariable("inpfinPaymSt", "", "", 
new ValueListFilter(
+          dao.getReferenceListValues("FIN_Payment status", true)));
+      String strPaymentMethodId = vars.getGlobalVariable("inpPaymentMethodId",
+          "PaymentReport|PaymentMethodId", "", IsIDFilter.instance);
+      String strFinancialAccountId = 
vars.getGlobalVariable("inpFinancialAccountId",
+          "PaymentReport|FinancialAccountId", "", IsIDFilter.instance);
+      String strcCurrency = vars.getGlobalVariable("inpcCurrencyId", 
"PaymentReport|Currency", "",
+          IsIDFilter.instance);
+      String strConvertCurrency = 
vars.getGlobalVariable("inpConvertCurrencyId",
+          "PaymentReport|ConvertCurrency", "");
+      String strConversionDate = vars.getGlobalVariable("inpConversionDate",
+          "PaymentReport|ConversionDate", "");
+      String strPaymType = vars.getGlobalVariable("inpPaymType", 
"PaymentReport|PaymentType", "");
+      String strOverdue = vars.getGlobalVariable("inpOverdue", 
"PaymentReport|Overdue", "");
+      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", ""));
+      printPageDataSheet(response, vars, strOrg, strInclSubOrg, 
strDueDateFrom, strDueDateTo,
+          strAmountFrom, strAmountTo, strDocumentDateFrom, strDocumentDateTo, 
strcBPartnerIdIN,
+          strcBPGroupIdIN, strcProjectIdIN, strfinPaymSt, strPaymentMethodId,
+          strFinancialAccountId, strcCurrency, strConvertCurrency, 
strConversionDate, strPaymType,
+          strOverdue, strGroupCrit, strOrdCrit);
+    } else if (vars.commandIn("FIND")) {
+      String strOrg = vars.getRequestGlobalVariable("inpOrg", 
"PaymentReport|Organization");
       String strInclSubOrg = vars.getRequestGlobalVariable("inpInclSubOrg",
           "PaymentReport|IncludeSubOrganization");
       String strDueDateFrom = vars.getRequestGlobalVariable("inpDueDateFrom",
@@ -91,11 +138,12 @@
           "PaymentReport|FinancialAccountId", IsIDFilter.instance);
       String strcCurrency = vars.getRequestGlobalVariable("inpcCurrencyId",
           "PaymentReport|Currency", IsIDFilter.instance);
-      String strConvertCurrency = 
vars.getGlobalVariable("inpConvertCurrencyId",
-          "PaymentReport|ConvertCurrency", "");
-      String strConversionDate = vars.getGlobalVariable("inpConversionDate",
-          "PaymentReport|ConversionDate", "");
-      String strPaymType = vars.getGlobalVariable("inpPaymType", 
"PaymentReport|PaymentType", "");
+      String strConvertCurrency = 
vars.getRequestGlobalVariable("inpConvertCurrencyId",
+          "PaymentReport|ConvertCurrency", IsIDFilter.instance);
+      String strConversionDate = 
vars.getRequestGlobalVariable("inpConversionDate",
+          "PaymentReport|ConversionDate");
+      String strPaymType = vars
+          .getRequestGlobalVariable("inpPaymType", 
"PaymentReport|PaymentType");
       String strOverdue = vars.getRequestGlobalVariable("inpOverdue", 
"PaymentReport|Overdue");
       String strGroupCrit = vars
           .getRequestGlobalVariable("inpGroupCrit", "PaymentReport|GroupCrit");
@@ -264,7 +312,6 @@
           discardAL.add("sectionStatus");
           discardAL.add("sectionTotal");
         }
-        discardAL.add("ieldInvLinkNo");
         discard = new String[discardAL.size()];
 
         xmlDocument = xmlEngine.readXmlTemplate(
@@ -350,7 +397,11 @@
     xmlDocument.setParameter("documentDateTo", strDocumentDateTo);
     xmlDocument
         .setParameter("documentDateTodisplaySave", 
vars.getSessionValue("#AD_SqlDateFormat"));
-    xmlDocument.setParameter("cBPartnerId_IN", strcBPartnerIdIN);
+
+    xmlDocument.setData("paramcBPartnerId_IN", "liststructure", 
SelectorUtilityData.selectBpartner(
+        this, Utility.getContext(this, vars, "#AccessibleOrgTree", ""), 
Utility.getContext(this,
+            vars, "#User_Client", ""), strcBPartnerIdIN));
+
     xmlDocument.setParameter("cBPGroupId_IN", strcBPGroupIdIN);
     try {
       ComboTableData comboTableData = new ComboTableData(vars, this, 
"TABLEDIR", "C_BP_Group_ID",
@@ -362,8 +413,12 @@
     } catch (Exception ex) {
       throw new ServletException(ex);
     }
-    xmlDocument.setParameter("cProjectId_IN", strcProjectIdIN);
-    xmlDocument.setParameter("finPaymSt", strfinPaymSt);
+
+    xmlDocument.setData("paramcProjectId_IN", "liststructure", 
SelectorUtilityData.selectProject(
+        this, Utility.getContext(this, vars, "#AccessibleOrgTree", ""), 
Utility.getContext(this,
+            vars, "#User_Client", ""), strcProjectIdIN));
+
+    xmlDocument.setParameter("selectedStatuses", strfinPaymSt);
     try {
       ComboTableData comboTableData = new ComboTableData(vars, this, "LIST", 
"",
           "FIN_Payment status", "", Utility.getContext(this, vars, 
"#AccessibleOrgTree",
@@ -523,6 +578,7 @@
     vector.copyInto(objectListData);
 
     xmlDocument.setData("reportOrdCrit", "liststructure", objectListData);
+    xmlDocument.setData("reportShown", "liststructure", 
PaymentReportDao.getObjectList(strOrdCrit));
 
     response.setContentType("text/html; charset=UTF-8");
     PrintWriter out = response.getWriter();
diff -r 91b7608a44e8 -r 65e926b95433 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.xml
--- 
a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.xml
    Mon May 09 13:17:55 2011 +0200
+++ 
b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.xml
    Mon May 09 11:52:11 2011 +0200
@@ -50,16 +50,26 @@
   <PARAMETER id="paramDocumentDateTo" name="documentDateTo" attribute="value"/>
   <PARAMETER id="paramDocumentDateTo" name="documentDateTodisplaySave" 
attribute="displayformat" replace="xx"/>
   <PARAMETER id="paramDocumentDateTo" name="documentDateTodisplaySave" 
attribute="saveformat" replace="yy"/>
-  <PARAMETER id="paramcBPartnerId_IN" name="cBPartnerId_IN" attribute="value"/>
+  
+  <PARAMETER id="paramcBPartnerId_INselected" 
name="paramcBPartnerId_INselected" default=""/>
+  <SUBREPORT id="paramcBPartnerId_IN" name="paramcBPartnerId_IN" 
report="org/openbravo/erpCommon/reference/List">
+    <ARGUMENT name="parameterListSelected" 
withId="paramcBPartnerId_INselected"/>
+  </SUBREPORT>
+    
   <PARAMETER id="paramcBPGroupId_IN" name="cBPGroupId_IN" attribute="value"/>
   <SUBREPORT id="reportBPGroupId_IN" name="reportBPGroupId_IN" 
report="org/openbravo/erpCommon/reference/List">
     <ARGUMENT name="parameterListSelected" withId="paramcBPGroupId_IN"/>
   </SUBREPORT>
-  <PARAMETER id="paramcProjectId_IN" name="cProjectId_IN" attribute="value"/>
   
-  <PARAMETER id="paramfinPaymSt" name="finPaymSt" attribute="value"/>
+  <PARAMETER id="paramcProjectId_INselected" name="paramcProjectId_INselected" 
default=""/>
+  <SUBREPORT id="paramcProjectId_IN" name="paramcProjectId_IN" 
report="org/openbravo/erpCommon/reference/List">
+    <ARGUMENT name="parameterListSelected" 
withId="paramcProjectId_INselected"/>
+  </SUBREPORT>
+  
+  <PARAMETER id="inpSelectedStatuses" name="selectedStatuses" 
attribute="value"/>
+  <PARAMETER id="paramStatus" name="paramStatus" default=""/>
   <SUBREPORT id="paramfinPaymSt" name="reportStatus" 
report="org/openbravo/erpCommon/reference/List">
-    <ARGUMENT name="parameterListSelected" withId="paramfinPaymSt"/>
+    <ARGUMENT name="parameterListSelected" withId="paramStatus"/>
   </SUBREPORT>
   
   <PARAMETER id="paramPaymentMethodId" name="paymentMethodId" 
attribute="value"/> 
@@ -97,6 +107,11 @@
     <ARGUMENT name="parameterListSelected" withId="paramOrdCrit"/>
   </SUBREPORT>
   
+  <PARAMETER id="paramShown" name="inpShown" attribute="value"/>
+  <SUBREPORT id="reportShown" name="reportShown" 
report="org/openbravo/erpCommon/reference/List">
+    <ARGUMENT name="parameterListSelected" withId="paramShown"/>
+  </SUBREPORT>
+  
   
   <structure name="structure1">
     <FIELD id="fieldBPartner">BPARTNER</FIELD>
diff -r 91b7608a44e8 -r 65e926b95433 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to