Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041253Openbravo ERP08. Project and service managementpublic2019-07-03 16:522019-08-22 14:44
shuehner 
AtulOpenbravo 
normalmajorhave not tried
closedfixed 
5
 
3.0PR19Q43.0PR19Q4 
dmiguelez
Core
No
0041253: ReportProjectProfitabilityJR.noConversionToHours is not using bind-params
This code is not using bind-params:

    if (StringUtils.isNotEmpty(strOrg)) {
      hsqlScript.append(" and p." + Project.PROPERTY_ORGANIZATION + ".id in (" + strOrg + ")");
    }

When fixing please apply new HQL-style to every HQL in this file.
-
No tags attached.
depends on backport 00412543.0PR19Q3 closed Triage Omni OMS ReportProjectProfitabilityJR.noConversionToHours is not using bind-params 
depends on backport 00412553.0PR19Q2.1 closed AtulOpenbravo ReportProjectProfitabilityJR.noConversionToHours is not using bind-params 
depends on backport 00412563.0PR19Q1.3 closed Triage Omni OMS ReportProjectProfitabilityJR.noConversionToHours is not using bind-params 
related to defect 0041342 closed Triage Omni OMS Apply new HQL Style to HQL in ReportProjectProfitabilityJR 
related to defect 0041343 new Triage Omni OMS Remove selectOrg & treeOrg methods used in ReportProjectProfitabilityJR 
blocks design defect 0038136 acknowledged Triage Platform Base Tracking issue: Find & Fix queries not using bind-params but embedding values into query string 
Issue History
2019-07-03 16:52shuehnerNew Issue
2019-07-03 16:52shuehnerAssigned To => Triage Finance
2019-07-03 16:52shuehnerModules => Core
2019-07-03 16:52shuehnerTriggers an Emergency Pack => No
2019-07-03 16:52shuehnerRelationship addedblocks 0038136
2019-07-03 16:53shuehnerStatusnew => scheduled
2019-07-04 12:02shuehnerTarget Version => 3.0PR19Q4
2019-07-04 17:48SandrahuguetAssigned ToTriage Finance => collazoandy4
2019-07-09 17:14SandrahuguetAssigned Tocollazoandy4 => AtulOpenbravo
2019-07-09 17:47SandrahuguetAssigned ToAtulOpenbravo => collazoandy4
2019-07-11 08:28SandrahuguetAssigned Tocollazoandy4 => AtulOpenbravo
2019-07-12 11:18AtulOpenbravoRelationship addedrelated to 0041342
2019-07-12 11:19AtulOpenbravoRelationship addedrelated to 0041343
2019-07-15 14:41AtulOpenbravoNote Added: 0113375
2019-07-15 14:43AtulOpenbravoNote Added: 0113376
2019-07-17 11:26hgbotCheckin
2019-07-17 11:26hgbotNote Added: 0113468
2019-07-17 11:26hgbotStatusscheduled => resolved
2019-07-17 11:26hgbotResolutionopen => fixed
2019-07-17 11:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/5179ba16ea150015f93c7e02572937d44e197725 [^]
2019-07-17 11:28dmiguelezReview Assigned To => dmiguelez
2019-07-17 11:28dmiguelezNote Added: 0113477
2019-07-17 11:28dmiguelezStatusresolved => closed
2019-07-17 11:28dmiguelezFixed in Version => 3.0PR19Q4
2019-08-22 14:44hudsonbotCheckin
2019-08-22 14:44hudsonbotNote Added: 0114154

Notes
(0113375)
AtulOpenbravo   
2019-07-15 14:41   
Verified the bind-params values for organization by configuring the log4j2-web.xml as

<Loggers>
 <Root level="info">
 <AppenderRef ref="Console"/>
 </Root>
 <Logger name="reloadXml" level="error"/>
 <Logger name="org.hibernate.SQL" level="debug"/>
 <Logger name="org.hibernate.type.descriptor.sql" level="trace"/>
</Loggers>


Log:

[http-bio-8180-exec-3] DEBUG org.hibernate.SQL - select uom0_.C_UOM_ID as C_UOM_ID1_294_, uom0_.AD_Client_ID as AD_Clien2_294_, uom0_.AD_Org_ID as AD_Org_I3_294_, uom0_.IsActive as IsActive4_294_, uom0_.Created as Created5_294_, uom0_.Updated as Updated6_294_, uom0_.CreatedBy as CreatedB7_294_, uom0_.UpdatedBy as UpdatedB8_294_, uom0_.X12DE355 as X9_294_, uom0_.UOMSymbol as UOMSymb10_294_, uom0_.Name as Name11_294_, uom0_.Description as Descrip12_294_, uom0_.StdPrecision as StdPrec13_294_, uom0_.CostingPrecision as Costing14_294_, uom0_.IsDefault as IsDefau15_294_, uom0_.Breakdown as Breakdo16_294_, uom0_.UOM_Type as UOM_Typ17_294_, uom0_.Useinproduction as Useinpr18_294_ from C_UOM uom0_ where (exists (select 1 from S_TimeExpenseLine timeandexp1_ inner join S_TimeExpense timeandexp2_ on timeandexp1_.S_TimeExpense_ID=timeandexp2_.S_TimeExpense_ID left outer join C_Project project3_ on timeandexp1_.C_Project_ID=project3_.C_Project_ID where timeandexp1_.IsTimeReport='Y' and timeandexp1_.C_UOM_ID=uom0_.C_UOM_ID and timeandexp1_.C_UOM_ID<>'101' and timeandexp2_.Processed='Y' and (project3_.AD_Org_ID in (? , ? , ?)))) and not (exists (select 1 from C_UOM_Conversion uomconvers4_ where uomconvers4_.C_UOM_ID=uom0_.C_UOM_ID and uomconvers4_.C_UOM_To_ID='101')) and (uom0_.AD_Org_ID in (? , ? , ? , ? , ? , ? , ? , ?)) and (uom0_.AD_Client_ID in (? , ?)) and uom0_.IsActive='Y'

[http-bio-8180-exec-3] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [1] as [VARCHAR] - [E443A31992CB4635AFCAEABE7183CE85]
[http-bio-8180-exec-3] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [2] as [VARCHAR] - [B843C30461EA4501935CB1D125C9C25A]
[http-bio-8180-exec-3] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [3] as [VARCHAR] - [DC206C91AA6A4897B44DA897936E0EC3]
[http-bio-8180-exec-3] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [4] as [VARCHAR] - [0]
[http-bio-8180-exec-3] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [5] as [VARCHAR] - [E443A31992CB4635AFCAEABE7183CE85]
[http-bio-8180-exec-3] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [6] as [VARCHAR] - [B843C30461EA4501935CB1D125C9C25A]
[http-bio-8180-exec-3] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [7] as [VARCHAR] - [BAE22373FEBE4CCCA24517E23F0C8A48]
[http-bio-8180-exec-3] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [8] as [VARCHAR] - [DC206C91AA6A4897B44DA897936E0EC3]
[http-bio-8180-exec-3] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [9] as [VARCHAR] - [2E60544D37534C0B89E765FE29BC0B43]
[http-bio-8180-exec-3] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [10] as [VARCHAR] - [19404EAD144C49A0AF37D54377CF452D]
[http-bio-8180-exec-3] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [11] as [VARCHAR] - [7BABA5FF80494CAFA54DEBD22EC46F01]
[http-bio-8180-exec-3] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [12] as [VARCHAR] - [23C59575B9CF467C9620760EB255B389]
[http-bio-8180-exec-3] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [13] as [VARCHAR] - [0]
(0113376)
AtulOpenbravo   
2019-07-15 14:43   
Verifed using postgresql logs by configuring postgresql.conf with below parameters as:

log_statement = 'all'
log_directory = 'pg_log'
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
logging_collector = on
log_min_error_statement = error


logs:

execute <unnamed>/C_10:

select uom0_.C_UOM_ID as C_UOM_ID1_294_, uom0_.AD_Client_ID as AD_Clien2_294_, uom0_.AD_Org_ID as AD_Org_I3_294_, uom0_.IsActive as IsActive4_294_, uom0_.Created as Created5_294_, uom0_.Updated as Updated6_294_, uom0_.CreatedBy as CreatedB7_294_, uom0_.UpdatedBy as UpdatedB8_294_, uom0_.X12DE355 as X9_294_, uom0_.UOMSymbol as UOMSymb10_294_, uom0_.Name as Name11_294_, uom0_.Description as Descrip12_294_, uom0_.StdPrecision as StdPrec13_294_, uom0_.CostingPrecision as Costing14_294_, uom0_.IsDefault as IsDefau15_294_, uom0_.Breakdown as Breakdo16_294_, uom0_.UOM_Type as UOM_Typ17_294_, uom0_.Useinproduction as Useinpr18_294_ from C_UOM uom0_ where (exists (select 1 from S_TimeExpenseLine timeandexp1_ inner join S_TimeExpense timeandexp2_ on timeandexp1_.S_TimeExpense_ID=timeandexp2_.S_TimeExpense_ID left outer join C_Project project3_ on timeandexp1_.C_Project_ID=project3_.C_Project_ID where timeandexp1_.IsTimeReport='Y' and timeandexp1_.C_UOM_ID=uom0_.C_UOM_ID and timeandexp1_.C_UOM_ID<>'101' and timeandexp2_.Processed='Y' and (project3_.AD_Org_ID in ($1 , $2 , $3)))) and not (exists (select 1 from C_UOM_Conversion uomconvers4_ where uomconvers4_.C_UOM_ID=uom0_.C_UOM_ID and uomconvers4_.C_UOM_To_ID='101')) and (uom0_.AD_Org_ID in ($4 , $5 , $6 , $7 , $8 , $9 , $10 , $11)) and (uom0_.AD_Client_ID in ($12 , $13)) and uom0_.IsActive='Y'

DETAIL:
parameters:
$1 = 'E443A31992CB4635AFCAEABE7183CE85',
$2 = 'B843C30461EA4501935CB1D125C9C25A',
$3 = 'DC206C91AA6A4897B44DA897936E0EC3',
$4 = '0',
$5 = 'E443A31992CB4635AFCAEABE7183CE85',
$6 = 'B843C30461EA4501935CB1D125C9C25A',
$7 = 'BAE22373FEBE4CCCA24517E23F0C8A48',
$8 = 'DC206C91AA6A4897B44DA897936E0EC3',
$9 = '2E60544D37534C0B89E765FE29BC0B43',
$10 = '19404EAD144C49A0AF37D54377CF452D',
$11 = '7BABA5FF80494CAFA54DEBD22EC46F01',
$12 = '23C59575B9CF467C9620760EB255B389',
$13 = '0'
(0113468)
hgbot   
2019-07-17 11:26   
Repository: erp/devel/pi
Changeset: 5179ba16ea150015f93c7e02572937d44e197725
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Sun Jul 14 23:33:32 2019 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/5179ba16ea150015f93c7e02572937d44e197725 [^]

Fixes Issue 41253: ReportProjectProfitabilityJR.noConversionToHours
is not using bind-params

Applied bind-params to organization ids in noConversionToHours
method. Organization ids are obtained from OrganizationStructureProvider

---
M src/org/openbravo/erpCommon/ad_reports/ReportProjectProfitabilityJR.java
---
(0113477)
dmiguelez   
2019-07-17 11:28   
Code Review + Testing Ok
(0114154)
hudsonbot   
2019-08-22 14:44   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/ad3efd3bd07c [^]
Maturity status: Test