Fixes issue 19858: The "Goods Shipment" selector it doesn't work properly.
authorJavier Etxarri <javier.echarri@openbravo.com>
Fri, 24 Feb 2012 08:49:44 +0100
changeset 15683 a77ef04bc81c
parent 15682 b4ce2c15d515
child 15684 482fdc3919a1
Fixes issue 19858: The "Goods Shipment" selector it doesn't work properly.
Now only dissapears the shipments where the related order has invoice term 'After Order Delivered' and is not completely delivered
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql	Tue Feb 28 16:04:56 2012 +0000
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql	Fri Feb 24 08:49:44 2012 +0100
@@ -363,12 +363,12 @@
         WHERE o.C_ORDER_ID = s.C_ORDER_ID
         AND o.C_ORDER_ID = ic.C_ORDER_ID
         AND ic.term = 'N')
-        AND EXISTS (SELECT 1
+        AND NOT EXISTS (SELECT 1
         FROM C_ORDER o , C_ORDERLINE ol
         WHERE o.C_ORDER_ID = s.C_ORDER_ID
         AND o.C_ORDER_ID = ol.C_ORDER_ID
         GROUP BY o.INVOICERULE
-        HAVING o.INVOICERULE <> 'O' OR (SUM(ol.qtyordered) = SUM(ol.qtydelivered)))
+        HAVING (o.INVOICERULE = 'O' AND SUM(ol.qtyordered) <> SUM(ol.qtydelivered)))
         ORDER BY NAME
       ]]>
     </Sql>