Fixed issue 34851: Not possible to select a GS in RFC not created from an order
authorRafael Queralta Pozo <rqueralta@nauta.cu>
Thu, 05 Jan 2017 09:21:26 -0500
changeset 31652 db942c7919d3
parent 31056 7f58c9165bf6
child 31653 f52faf69b245
Fixed issue 34851: Not possible to select a GS in RFC not created from an order

Restructured HQL inserter query for discount to select a GS in RFC has not been
created from an order
src/org/openbravo/common/datasource/ReturnFromCustomerHQLInserter.java
--- a/src/org/openbravo/common/datasource/ReturnFromCustomerHQLInserter.java	Fri Dec 30 15:26:21 2016 +0000
+++ b/src/org/openbravo/common/datasource/ReturnFromCustomerHQLInserter.java	Thu Jan 05 09:21:26 2017 -0500
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014-2016 Openbravo SLU
+ * All portions are Copyright (C) 2014-2017 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -41,7 +41,7 @@
     // discounts
     String buttonOwnerViewTabId = requestParameters.get("buttonOwnerViewTabId");
     if (RETURN_FROM_CUSTOMER_TAB_ID.equals(buttonOwnerViewTabId)) {
-      return " exists (select 1 from OrderLine e where e.id = iol.salesOrderLine.id and e.orderDiscount is null) ";
+      return " (select e.orderDiscount from OrderLine e where e.id = iol.salesOrderLine.id) is null ";
     } else {
       return null;
     }