Issue 27140: Backout previous fix to study its consequences
authorVíctor Martínez Romanos <victor.martinez@openbravo.com>
Mon, 04 Aug 2014 09:51:01 +0200
changeset 24154 7507a81f4e63
parent 24153 9ca3a8d726f5
child 24155 28068c12e140
Issue 27140: Backout previous fix to study its consequences
src-db/database/model/functions/C_ORDER_POST1.xml
--- a/src-db/database/model/functions/C_ORDER_POST1.xml	Mon Aug 04 12:16:50 2014 +0530
+++ b/src-db/database/model/functions/C_ORDER_POST1.xml	Mon Aug 04 09:51:01 2014 +0200
@@ -1358,8 +1358,8 @@
      */
       BEGIN
         v_ResultStr:='OrderCompleteCheck';
-        SELECT SUM(QtyOrdered) -SUM(QtyDelivered),
-            SUM(QtyOrdered) -SUM(QtyInvoiced)
+        SELECT SUM(QtyOrdered*hex_to_int(C_OrderLine_ID)) -SUM(QtyDelivered*hex_to_int(C_OrderLine_ID)),
+            SUM(QtyOrdered*hex_to_int(C_OrderLine_ID)) -SUM(QtyInvoiced*hex_to_int(C_OrderLine_ID))
           INTO ToDeliver,
             ToInvoice
         FROM C_ORDERLINE
@@ -1508,8 +1508,8 @@
      /**
       * Final Completeness check
       */
-      SELECT SUM(QtyOrdered) -SUM(QtyDelivered),
-          SUM(QtyOrdered) -SUM(QtyInvoiced)
+      SELECT SUM(QtyOrdered*hex_to_int(C_OrderLine_ID)) -SUM(QtyDelivered*hex_to_int(C_OrderLine_ID)),
+          SUM(QtyOrdered*hex_to_int(C_OrderLine_ID)) -SUM(QtyInvoiced*hex_to_int(C_OrderLine_ID))
         INTO ToDeliver,
           ToInvoice
       FROM C_ORDERLINE