Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0043376Openbravo ERPA. Platformpublic2020-02-28 13:252020-03-06 13:17
inigo_lerga 
inigo_lerga 
normalminorhave not tried
closedfixed 
5
 
3.0PR20Q2 
dmiguelez
Core
No
0043376: Apply new HQL Style in CashVATUtil.java
CashVATUtil.java has three HQL queries with:
- the HQL is hard to read because of formatting
- and it is mixing txt and i.e PROPERTY_ID constant which is not recommended by default
-
Follow new format as in http://wiki.openbravo.com/wiki/HQL_Coding_Conventions [^]
No tags attached.
related to design defect 0041287 acknowledged Triage Platform Base Tracking issue: Convert HQL to apply new style 
Issue History
2020-02-28 13:25inigo_lergaNew Issue
2020-02-28 13:25inigo_lergaAssigned To => inigo_lerga
2020-02-28 13:25inigo_lergaModules => Core
2020-02-28 13:25inigo_lergaTriggers an Emergency Pack => No
2020-02-28 13:25inigo_lergaStatusnew => scheduled
2020-03-02 10:28inigo_lergaNote Added: 0118230
2020-03-02 12:07inigo_lergaNote Edited: 0118230bug_revision_view_page.php?bugnote_id=0118230#r20486
2020-03-02 12:13inigo_lergaRelationship addedrelated to 0041287
2020-03-06 13:16hgbotCheckin
2020-03-06 13:16hgbotNote Added: 0118372
2020-03-06 13:16hgbotStatusscheduled => resolved
2020-03-06 13:16hgbotResolutionopen => fixed
2020-03-06 13:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cb0899b44c4dc4bf61b305086eaa2e816cddb16b [^]
2020-03-06 13:16hgbotCheckin
2020-03-06 13:16hgbotNote Added: 0118373
2020-03-06 13:16hgbotCheckin
2020-03-06 13:16hgbotNote Added: 0118374
2020-03-06 13:17dmiguelezReview Assigned To => dmiguelez
2020-03-06 13:17dmiguelezNote Added: 0118375
2020-03-06 13:17dmiguelezStatusresolved => closed
2020-03-06 13:17dmiguelezFixed in Version => 3.0PR20Q2

Notes
(0118230)
inigo_lerga   
2020-03-02 10:28   
(edited on: 2020-03-02 12:07)
--Test Plan Mantis HQL queries--
First of all, to execute this query it is needed to
have installed the Cash VAT Management module.

As the F&B International Group Admin role:
  - Go to the Organization window and enter the
    "F&B US, Inc." record. Open its Information Tab
    line and check the Cash VAT checkbox.
  - Go to the Tax Rate window and create a new record
    with "F&B US, Inc." as Business Partner, any name
    and rate desired. Put any previous day before today as
    the Valid From Date field.
    Check the Cash VAT checkbox and save the record.
  - Go now to the Sales Invoice window and create a
    new record with "F&B US, Inc." as Organization and
    "Healthy Food Supermarkets, Co." as Business Partner.
    Go to the Lines Tab and create a new one with
    "Cola" as Product and 10 units in Invoiced Quantity.
    Select the previosly created Tax Rate in the Tax field.
  - Go back to the Sales Invoice Header and press the Complete
    button and OK button in the popup window.
    Press the Add Payment button and Done button in the popup
    window.
  
  #In this moment two of the modified HQLs are executed#

  - Press the Post button and OK button in the popup window.

  #In this moment the last modified HQL is executed#

(0118372)
hgbot   
2020-03-06 13:16   
Repository: erp/devel/pi
Changeset: cb0899b44c4dc4bf61b305086eaa2e816cddb16b
Author: Iñigo Lerga <inigo.lerga <at> openbravo.com>
Date: Mon Mar 02 10:46:16 2020 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/cb0899b44c4dc4bf61b305086eaa2e816cddb16b [^]

fixes BUG-43376:Applied new HQL Style

---
M src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
(0118373)
hgbot   
2020-03-06 13:16   
Repository: erp/devel/pi
Changeset: bbf99091e921244a3333e13ae53fe1b1c6879125
Author: Iñigo Lerga <inigo.lerga <at> openbravo.com>
Date: Mon Mar 02 12:09:24 2020 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/bbf99091e921244a3333e13ae53fe1b1c6879125 [^]

related to ISSUE-43376: Applied Sonarlint suggestions and more

-Finals added
-Sonarlint suggestions applied

---
M src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
(0118374)
hgbot   
2020-03-06 13:16   
Repository: erp/devel/pi
Changeset: 298670191d095316dd461841de5562bc33b0d29f
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Fri Mar 06 12:50:32 2020 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/298670191d095316dd461841de5562bc33b0d29f [^]

Related to ISSUE-43376. Code Review changes:
Retrieve first the query into an object and then do the !list.isEmpty() comparison.
The reason for this change is to make more obvius the list empty comparison
while reading the code.

---
M src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
(0118375)
dmiguelez   
2020-03-06 13:17   
Code Review + Testing Ok