src-db/database/model/functions/M_RESERVATION_POST.xml
changeset 24270 e414f3f0e298
parent 24152 bae6b944d95a
child 24321 0bd1540f6c0d
equal deleted inserted replaced
24269:6f90c7d6a7d2 24270:e414f3f0e298
    45   v_org_id          VARCHAR2(32);
    45   v_org_id          VARCHAR2(32);
    46   v_count           NUMBER;
    46   v_count           NUMBER;
    47   v_quantity        NUMBER;
    47   v_quantity        NUMBER;
    48   v_reservedqty     NUMBER;
    48   v_reservedqty     NUMBER;
    49   v_productname     m_product.name%TYPE;
    49   v_productname     m_product.name%TYPE;
       
    50   v_countlines      NUMBER;
    50 
    51 
    51 TYPE RECORD IS REF CURSOR;
    52 TYPE RECORD IS REF CURSOR;
    52   Cur_Parameter RECORD;
    53   Cur_Parameter RECORD;
    53 
    54 
    54 BEGIN
    55 BEGIN
   275         WHERE c_order_id = v_sales_order_id;
   276         WHERE c_order_id = v_sales_order_id;
   276       END IF;
   277       END IF;
   277 
   278 
   278       v_newstatus := 'CO';
   279       v_newstatus := 'CO';
   279       v_newaction := 'HO';
   280       v_newaction := 'HO';
       
   281       /* Do not process reservation's with no lines
       
   282       */
       
   283       v_countlines:=0;
       
   284       SELECT COUNT(*) INTO v_countlines
       
   285         FROM m_reservation_stock
       
   286         WHERE m_reservation_id = v_reservation_id;
       
   287       IF(v_countlines = 0) THEN
       
   288 	v_newstatus:='DR';
       
   289 	v_newaction:='PR';
       
   290       END IF;
       
   291 
   280     END;
   292     END;
   281 
   293 
   282   ELSIF (v_resaction = 'HO') THEN
   294   ELSIF (v_resaction = 'HO') THEN
   283   /*
   295   /*
   284     Reservation Hold Process
   296     Reservation Hold Process