Fixed issue 34839: Not possible to select a GS in RFC not created from an order
authorRafael Queralta Pozo <rqueralta@nauta.cu>
Wed, 04 Jan 2017 14:29:14 -0500
changeset 31066 20d4ef128855
parent 31065 f1b037bcb10e
child 31067 8b10f7e4693e
Fixed issue 34839: 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	Thu Jan 05 08:28:23 2017 -0500
+++ b/src/org/openbravo/common/datasource/ReturnFromCustomerHQLInserter.java	Wed Jan 04 14:29:14 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;
     }