Fix for issue 35273: General Ledger filter removed when paginating in GL Report
authorArmaignac <collazoandy4@gmail.com>
Wed, 15 Feb 2017 19:43:11 -0500
changeset 31442 4caee9fa9481
parent 31433 10effee8d6e4
child 31443 4c82e13385e5
Fix for issue 35273: General Ledger filter removed when paginating in GL Report

The General Ledger filter was removed when paginating in General Ledger Report
in HTML view

Now the General Ledger filter it's save in the session by the FIND action and get in the DEFAULT action
for showing in the report page
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java	Wed Feb 08 14:07:20 2017 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java	Wed Feb 15 19:43:11 2017 -0500
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2001-2016 Openbravo SLU
+ * All portions are Copyright (C) 2001-2017 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -28,6 +28,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.lang.StringUtils;
 import org.openbravo.base.filter.IsIDFilter;
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 import org.openbravo.base.secureApp.VariablesSecureApp;
@@ -61,7 +62,10 @@
 
     if (vars.commandIn("DEFAULT")) {
       String strOrg = vars.getGlobalVariable("inpOrg", "ReportGeneralLedger|Org", vars.getOrg());
-      String strcAcctSchemaId = OBLedgerUtils.getOrgLedger(strOrg);
+      String strcAcctSchemaId = vars.getSessionValue("ReportGeneralLedger|cAcctSchemaId");
+      if (StringUtils.equals(strcAcctSchemaId, "")) {
+        strcAcctSchemaId = OBLedgerUtils.getOrgLedger(strOrg);
+      }
       String strDateFrom = vars
           .getGlobalVariable("inpDateFrom", "ReportGeneralLedger|DateFrom", "");
       String strDateTo = vars.getGlobalVariable("inpDateTo", "ReportGeneralLedger|DateTo", "");
@@ -103,6 +107,7 @@
           "ReportGeneralLedger|cAcctSchemaId");
       String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom",
           "ReportGeneralLedger|DateFrom");
+      vars.setSessionValue("ReportGeneralLedger|cAcctSchemaId", strcAcctSchemaId);
       String strDateTo = vars.getRequestGlobalVariable("inpDateTo", "ReportGeneralLedger|DateTo");
       String strPageNo = vars.getRequestGlobalVariable("inpPageNo", "ReportGeneralLedger|PageNo");
       String strAmtFrom = vars.getNumericParameter("inpAmtFrom");