src-db/database/model/functions/M_RESERVATION_POST.xml
changeset 21157 2e9ce78cf1e3
parent 20972 3f5e8c7117d6
child 24152 bae6b944d95a
equal deleted inserted replaced
21156:39c2826be99e 21157:2e9ce78cf1e3
   270                                  WHEN v_creservedcount + v_preservedcount > 0 THEN 'PR'
   270                                  WHEN v_creservedcount + v_preservedcount > 0 THEN 'PR'
   271                                  ELSE 'NR'
   271                                  ELSE 'NR'
   272                             END
   272                             END
   273         WHERE c_order_id = v_sales_order_id;
   273         WHERE c_order_id = v_sales_order_id;
   274       END IF;
   274       END IF;
   275       -- ADD RESERVED STOCK
       
   276       M_RESERVE_STOCK_AUTO(v_reservation_id, v_user_id, v_message);
       
   277 
   275 
   278       v_newstatus := 'CO';
   276       v_newstatus := 'CO';
   279       v_newaction := 'HO';
   277       v_newaction := 'HO';
   280     END;
   278     END;
   281 
   279 
   399       res_process = v_newaction,
   397       res_process = v_newaction,
   400       updated = now(),
   398       updated = now(),
   401       updatedby = v_user_id
   399       updatedby = v_user_id
   402   WHERE m_reservation_id = v_reservation_id;
   400   WHERE m_reservation_id = v_reservation_id;
   403 
   401 
       
   402   IF (v_resaction = 'PR') THEN
       
   403     -- ADD RESERVED STOCK
       
   404     M_RESERVE_STOCK_AUTO(v_reservation_id, v_user_id, v_message);
       
   405   END IF;
       
   406 
   404   IF (p_pinstance_id IS NOT NULL) THEN
   407   IF (p_pinstance_id IS NOT NULL) THEN
   405     DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ' || v_Message) ;
   408     DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ' || v_Message) ;
   406     AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'N', v_Result, v_Message) ;
   409     AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'N', v_Result, v_Message) ;
   407     DBMS_OUTPUT.PUT_LINE('--<<M_Reservation_Post finished>> ' || v_Message) ;
   410     DBMS_OUTPUT.PUT_LINE('--<<M_Reservation_Post finished>> ' || v_Message) ;
   408   END IF;
   411   END IF;