details:   https://code.openbravo.com/erp/devel/pi/rev/da668ab518be
changeset: 33462:da668ab518be
user:      David Miguelez <david.miguelez <at> openbravo.com>
date:      Fri Feb 16 09:45:26 2018 +0100
summary:   Fixes Issue 37866. When completing an Order, if the Quantity ordered
is not the same as the Quantity delivered for any line, the flag
isDelivered is set as N.

diffstat:

 src-db/database/model/functions/C_ORDER_POST1.xml |  12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diffs (22 lines):

diff -r e823ba605b22 -r da668ab518be 
src-db/database/model/functions/C_ORDER_POST1.xml
--- a/src-db/database/model/functions/C_ORDER_POST1.xml Mon Feb 19 09:51:03 
2018 +0100
+++ b/src-db/database/model/functions/C_ORDER_POST1.xml Fri Feb 16 09:45:26 
2018 +0100
@@ -1637,6 +1637,18 @@
           UPDATE C_ORDER  SET DocStatus='VO'  WHERE C_Order_ID=v_Record_ID;
         END IF;
       END IF;
+      
+      -- If there is at least one line with different Quantity Ordered than 
Quantity Delivered, set the IsDelivered flag as N
+      -- By default this flag is already N for new Orders, this can happen 
when the Order has been cloned from another one
+      -- that has been already delivered, and then the lines information has 
changed
+      IF (ToDeliver <> 0) THEN
+        UPDATE C_ORDER
+        SET IsDelivered='N',
+            Updated=now(),
+            UpdatedBy=v_User
+        WHERE C_Order_ID=v_Record_ID;
+      END IF;
+
       -- We are done with standard sales orders
       IF (v_DocSubTypeSO = 'RM' OR v_isreturndoctype = 'Y') THEN
 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to