details:   https://code.openbravo.com/erp/devel/pi/rev/5e154eda86d9
changeset: 29434:5e154eda86d9
user:      Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
date:      Thu May 05 11:45:33 2016 +0200
summary:   Fixes issue 32871: Update Quantity process deletes lines with no 
stock

M_Inventory_ListUpdate process will update QtyBook and QuantityOrderBook to 
zero instead of delete inventory line in case it does not exist stock.

diffstat:

 src-db/database/model/functions/M_INVENTORY_LISTUPDATE.xml |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (33 lines):

diff -r 33497f786cd5 -r 5e154eda86d9 
src-db/database/model/functions/M_INVENTORY_LISTUPDATE.xml
--- a/src-db/database/model/functions/M_INVENTORY_LISTUPDATE.xml        Thu May 
05 10:54:05 2016 +0200
+++ b/src-db/database/model/functions/M_INVENTORY_LISTUPDATE.xml        Thu May 
05 11:45:33 2016 +0200
@@ -19,7 +19,7 @@
   * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
   * All Rights Reserved.
   * Contributor(s): Openbravo SLU
-  * Contributions are Copyright (C) 2001-2015 Openbravo, S.L.U.
+  * Contributions are Copyright (C) 2001-2016 Openbravo, S.L.U.
   *
   * Specifically, this derivative work is based upon the following Compiere
   * file and version.
@@ -100,7 +100,8 @@
   */
   IF(NOT END_PROCESS) THEN
     v_ResultStr:='UpdatingLine';
-    DELETE FROM M_InventoryLine
+    UPDATE M_InventoryLine
+    SET QtyBook = 0, QuantityOrderBook = 0
       WHERE M_Inventory_ID=v_Record_ID
         AND (NOT EXISTS
         (SELECT *
@@ -122,10 +123,6 @@
           AND (s.QTYORDERONHAND = 0 OR s.QTYORDERONHAND IS NULL)
         ))
     ;
-    rowcount:=SQL%ROWCOUNT;
-    IF(rowcount<>0) THEN
-      v_Message:='@Deleted@=' || rowcount || ', ';  
-    END IF;
     UPDATE M_InventoryLine
       SET QtyBook=
       (SELECT QtyOnHand

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to