Openbravo Issue Tracking System - Retail Modules
View Issue Details
0041340Retail ModulesReturn Receiptpublic2019-07-12 09:302019-08-01 08:15
asiermartirena 
ranjith_qualiantech_com 
urgentmajoralways
closedfixed 
5
 
RR19Q4 
marvintm
No
0041340: Multiple joins when loading a verified return
The query that is loading the lines to return is doing more joins than needed. This is the current code in PaidReceipts.java:

select
  ordLine.goodsShipmentLine.salesOrderLine.salesOrder.documentNo,
  ordLine.goodsShipmentLine.salesOrderLine.id
from OrderLine as ordLine
where ordLine.id = :lineId

The joins to the goodsShipmentLine and salesOrderLine is duplicated. The query should be the following one:

select
  retOrdLine.salesOrder.documentNo,
  retOrdLine.id
from OrderLine as ordLine
  join ordLine.goodsShipmentLine.salesOrderLine as retOrdLine
where ordLine.id = :lineId
Check the query in the PaidReceipts.java class.
Performance
patch 41340.patch (1,360) 2019-07-22 05:13
https://issues.openbravo.com/file_download.php?file_id=13159&type=bug
Issue History
2019-07-12 09:30asiermartirenaNew Issue
2019-07-12 09:30asiermartirenaAssigned To => Retail
2019-07-12 09:30asiermartirenaTriggers an Emergency Pack => No
2019-07-12 09:31asiermartirenaTag Attached: Performance
2019-07-15 07:10guillermogilResolution time => 1563573600
2019-07-18 04:53rqueraltaAssigned ToRetail => rqueralta
2019-07-18 04:53rqueraltaStatusnew => scheduled
2019-07-22 05:13rqueraltaFile Added: 41340.patch
2019-07-23 13:56ranjith_qualiantech_comAssigned Torqueralta => ranjith_qualiantech_com
2019-07-30 14:15hgbotCheckin
2019-07-30 14:15hgbotNote Added: 0113710
2019-07-30 14:15hgbotStatusscheduled => resolved
2019-07-30 14:15hgbotResolutionopen => fixed
2019-07-30 14:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/d390dd10f10709bde591ce980878f2dbb5579df0 [^]
2019-08-01 08:15marvintmReview Assigned To => marvintm
2019-08-01 08:15marvintmStatusresolved => closed
2019-08-01 08:15marvintmFixed in Version => RR19Q4

Notes
(0113710)
hgbot   
2019-07-30 14:15   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: d390dd10f10709bde591ce980878f2dbb5579df0
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Tue Jul 30 17:44:55 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/d390dd10f10709bde591ce980878f2dbb5579df0 [^]

Fixed issue 41340 : Paid Receipt Return Order lines query updated by removing unnecessary joins

---
M src/org/openbravo/retail/posterminal/PaidReceipts.java
---