Fixed bug 31695: Return to vendor shipments can be selected in return to vendor
authorVíctor Martínez Romanos <victor.martinez@openbravo.com>
Tue, 15 Dec 2015 14:54:22 +0100
changeset 28147 653ed78431dc
parent 28146 ba5c3ba713b0
child 28148 447428f58b15
Fixed bug 31695: Return to vendor shipments can be selected in return to vendor

The HQL query in charge of getting the shipment lines was wrongly including all the shipment documents. Instead it should be taking only the lines belonging to a non-return shipment document.

This feature was lost during the refactor to a manual datasource P&E
src-db/database/sourcedata/AD_TABLE.xml
--- a/src-db/database/sourcedata/AD_TABLE.xml	Wed Dec 16 11:13:35 2015 +0100
+++ b/src-db/database/sourcedata/AD_TABLE.xml	Tue Dec 15 14:54:22 2015 +0100
@@ -11899,7 +11899,9 @@
 MAINFROM MaterialMgmtShipmentInOutLine as iol 
 left join  iol.attributeSetValue as attributeSetValue
 join iol.shipmentReceipt as io 
+join io.documentType as dt
 where io.businessPartner.id = :businessPartnerId 
+and dt.return = false
 and io.processed = true and io.documentStatus <> 'VO' 
 and io.salesTransaction = @isSalesTransaction@ 
 and (iol.movementQuantity+(@returnedOthersLeftClause@) <> 0)