Fixes issue 35276: General Ledger filter changes with pagination in JE Report
authorArmaignac <collazoandy4@gmail.com>
Thu, 16 Feb 2017 11:42:21 -0500
changeset 31443 4c82e13385e5
parent 31442 4caee9fa9481
child 31444 d074c8f621ff
Fixes issue 35276: General Ledger filter changes with pagination in JE Report

Selected General Ledger filter value changes when pagination is executed in the
Journal Entries report

The General Ledger filter is not kept in the session to make use in the pagination.
For the solution, was saved the General Ledger Filter in the session every time
the search is executed (FIND action). By default, if there is any GL in the
session, the GL field will use the defaulted for the selected org. When paginating
always is used the account schema id stored in the session.
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java	Wed Feb 15 19:43:11 2017 -0500
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java	Thu Feb 16 11:42:21 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):  ______________________________________.
  ************************************************************************
@@ -92,7 +92,10 @@
     if (vars.commandIn("DEFAULT")) {
       String strOrg = vars.getGlobalVariable("inpOrg", "ReportGeneralLedgerJournal|Org",
           vars.getOrg());
-      String strcAcctSchemaId = OBLedgerUtils.getOrgLedger(strOrg);
+      String strcAcctSchemaId = vars.getSessionValue("ReportGeneralLedgerJournal|cAcctSchemaId");
+      if (StringUtils.equals(strcAcctSchemaId, "")) {
+        strcAcctSchemaId = OBLedgerUtils.getOrgLedger(strOrg);
+      }
       String strDateFrom = vars.getGlobalVariable("inpDateFrom",
           "ReportGeneralLedgerJournal|DateFrom", "");
       String strDateTo = vars.getGlobalVariable("inpDateTo", "ReportGeneralLedgerJournal|DateTo",
@@ -192,6 +195,7 @@
     } else if (vars.commandIn("FIND")) {
       String strcAcctSchemaId = vars.getRequestGlobalVariable("inpcAcctSchemaId",
           "ReportGeneralLedger|cAcctSchemaId");
+      vars.setSessionValue("ReportGeneralLedgerJournal|cAcctSchemaId", strcAcctSchemaId);
       String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom",
           "ReportGeneralLedgerJournal|DateFrom");
       String strDateTo = vars.getRequestGlobalVariable("inpDateTo",