Related to ISSUE-43320. Use id's to compare inside hql queries.
authorDavid Miguelez <david.miguelez@openbravo.com>
Mon, 02 Mar 2020 17:58:58 +0100
changeset 37131 b82dcc5d2455
parent 37130 5074d9bfb8e7
child 37132 6a1a38fa540d
Related to ISSUE 43320. Use id's to compare inside hql queries.
src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java	Tue Feb 25 16:17:19 2020 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java	Mon Mar 02 17:58:58 2020 +0100
@@ -113,8 +113,8 @@
       final VariablesSecureApp vars) throws ServletException, IOException {
     final String strDateFrom = vars.getGlobalVariable("inpDateFrom",
         "GeneralAccountingReports|dateFrom", "");
-    final String strDateTo = vars.getGlobalVariable("inpDateTo",
-        "GeneralAccountingReports|dateTo", "");
+    final String strDateTo = vars.getGlobalVariable("inpDateTo", "GeneralAccountingReports|dateTo",
+        "");
     final String strDateFromRef = vars.getGlobalVariable("inpDateFromRef",
         "GeneralAccountingReports|dateFromRef", "");
     final String strDateToRef = vars.getGlobalVariable("inpDateToRef",
@@ -123,8 +123,8 @@
         "GeneralAccountingReports|asDateTo", "");
     final String strAsDateToRef = vars.getGlobalVariable("inpAsDateToRef",
         "GeneralAccountingReports|asDateToRef", "");
-    final String strPageNo = vars.getGlobalVariable("inpPageNo",
-        "GeneralAccountingReports|PageNo", "1");
+    final String strPageNo = vars.getGlobalVariable("inpPageNo", "GeneralAccountingReports|PageNo",
+        "1");
     final String strElementValue = vars.getGlobalVariable("inpcElementvalueId",
         "GeneralAccountingReports|C_ElementValue_ID", "");
     final String strConImporte = vars.getGlobalVariable("inpConImporte",
@@ -549,7 +549,7 @@
                   "select y" +
                   "  from FinancialMgmtYear y" +
                   "    , FinancialMgmtPeriod as p" +
-                  " where p.year = y" +
+                  " where p.year.id = y.id" +
                   "   and p.endingDate < :date " +
                   "   and y.calendar.id = :calendarId" +
                   " order by p.startingDate";