Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041258Openbravo ERP09. Financial managementpublic2019-06-27 18:092019-07-16 16:42
shuehner 
Triage Finance 
normalmajorhave not tried
closedfixed 
5
 
3.0PR19Q33.0PR19Q3 
dmiguelez
Core
No
0041258: PaymentReportDao is not using bind-param
Several cases in that file are not using bind-param both for simple values i.e. here:
          hsqlScript.append(" and fpsd.");
          hsqlScript.append(FIN_PaymentScheduleDetail.PROPERTY_ORGANIZATION);
          hsqlScript.append(".id = '");
          hsqlScript.append(strOrg);
          hsqlScript.append("'");

as well as for list of values in in-clauses:
          hsqlScript.append(".id in ('");
          Set<String> orgChildTree = OBContext.getOBContext()
              .getOrganizationStructureProvider()
              .getChildTree(strOrg, true);
          Iterator<String> orgChildTreeIter = orgChildTree.iterator();
          while (orgChildTreeIter.hasNext()) {
            hsqlScript.append(orgChildTreeIter.next());
            orgChildTreeIter.remove();
            hsqlScript.append("'");
            if (orgChildTreeIter.hasNext()) {
              hsqlScript.append(", '");
            }
          }
          hsqlScript.append(")");
        }


Note: that setParameterList can be easily use to pass value lists directly see issue 40580 for an example
-
No tags attached.
blocks defect 00411993.0PR19Q4 closed collazoandy4 PaymentReportDao is not using bind-param 
Issue History
2019-07-03 17:00shuehnerTypedefect => backport
2019-07-03 17:00shuehnerTarget Version => 3.0PR19Q3
2019-07-16 16:42hgbotCheckin
2019-07-16 16:42hgbotNote Added: 0113435
2019-07-16 16:42hgbotStatusscheduled => resolved
2019-07-16 16:42hgbotResolutionopen => fixed
2019-07-16 16:42hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR19Q3/rev/8742d03be06390b88c775566cc00e5d5a1200985 [^]
2019-07-16 16:42dmiguelezReview Assigned To => dmiguelez
2019-07-16 16:42dmiguelezNote Added: 0113438
2019-07-16 16:42dmiguelezStatusresolved => closed
2019-07-16 16:42dmiguelezFixed in Version => 3.0PR19Q3

Notes
(0113435)
hgbot   
2019-07-16 16:42   
Repository: erp/backports/3.0PR19Q3
Changeset: 8742d03be06390b88c775566cc00e5d5a1200985
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Tue Jul 16 12:17:19 2019 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR19Q3/rev/8742d03be06390b88c775566cc00e5d5a1200985 [^]

Fixes issue 41258: PaymentReportDao is not using bind-param

Applied bind-params in getPaymentReport method

---
M modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
---
(0113438)
dmiguelez   
2019-07-16 16:42   
Code Review + Testing Ok