details:   https://code.openbravo.com/erp/devel/pi/rev/0bd1540f6c0d
changeset: 24321:0bd1540f6c0d
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Mon Aug 25 14:49:59 2014 +0530
summary:   Fixes Issue 27457:Stock Reservations are not processed when 
generating a WPL

diffstat:

 src-db/database/model/functions/M_RESERVATION_POST.xml |  27 +++++++++++------
 1 files changed, 17 insertions(+), 10 deletions(-)

diffs (44 lines):

diff -r dfd3357a0a14 -r 0bd1540f6c0d 
src-db/database/model/functions/M_RESERVATION_POST.xml
--- a/src-db/database/model/functions/M_RESERVATION_POST.xml    Mon Aug 25 
09:49:03 2014 +0200
+++ b/src-db/database/model/functions/M_RESERVATION_POST.xml    Mon Aug 25 
14:49:59 2014 +0530
@@ -278,16 +278,6 @@
 
       v_newstatus := 'CO';
       v_newaction := 'HO';
-      /* Do not process reservation's with no lines
-      */
-      v_countlines:=0;
-      SELECT COUNT(*) INTO v_countlines
-        FROM m_reservation_stock
-        WHERE m_reservation_id = v_reservation_id;
-      IF(v_countlines = 0) THEN
-       v_newstatus:='DR';
-       v_newaction:='PR';
-      END IF;
 
     END;
 
@@ -418,6 +408,23 @@
     M_RESERVE_STOCK_AUTO(v_reservation_id, v_user_id, v_message);
   END IF;
 
+  /* Do not process reservation's with no lines
+      */
+      v_countlines:=0;
+      SELECT COUNT(*) INTO v_countlines
+        FROM m_reservation_stock
+        WHERE m_reservation_id = v_reservation_id;
+      IF(v_countlines = 0) THEN
+        v_newstatus:='DR';
+        v_newaction:='PR';
+       UPDATE m_reservation
+          SET res_status = v_newstatus,
+              res_process = v_newaction,
+              updated = now(),
+              updatedby = v_user_id
+        WHERE m_reservation_id = v_reservation_id;
+      END IF;
+
   IF (p_pinstance_id IS NOT NULL) THEN
     DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ' || v_Message) ;
     AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'N', v_Result, v_Message) ;

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to