src-db/database/model/functions/M_INOUT_POST.xml
changeset 19206 0ce3b01ec4eb
parent 19203 9011368fc0cf
child 19212 3c4319efc149
child 19387 2ea55d9cc882
--- a/src-db/database/model/functions/M_INOUT_POST.xml	Wed Jan 09 12:22:32 2013 +0100
+++ b/src-db/database/model/functions/M_INOUT_POST.xml	Wed Jan 09 12:41:13 2013 +0100
@@ -524,19 +524,13 @@
                   AND sl.M_Product_ID=ol.M_Product_ID  --    AND   sl.M_AttributeSetInstance_ID=ol.M_AttributeSetInstance_ID
                   AND sl.M_InOut_ID=Cur_InOut.M_InOut_ID
                 )
-              LOOP
-                
-                SELECT count(*) INTO v_count
-                FROM M_MATCHPO
-                WHERE C_ORDERLINE_ID = Cur_SLines.C_OrderLine_ID
-                      AND M_INOUTLINE_ID = Cur_SLines.M_InOutLine_ID;            
+              LOOP          
 
                 v_Qty:=Cur_SLines.MovementQty;
                 --IF (ABS(Cur_SLines.MovementQty) > ABS(Cur_SLines.QtyOrdered)) THEN
                 -- v_Qty := Cur_SLines.QtyOrdered;
                 --END IF;
 
-                IF (v_count = 0) THEN
                   Ad_Sequence_Next('M_MatchPO', Cur_SLines.AD_Org_ID, v_MatchPO_ID) ;
                   -- The min qty. Modified by Ismael Ciordia
                   v_ResultStr:='InsertMatchPO ' || v_MatchPO_ID;
@@ -556,18 +550,7 @@
                       v_Qty, 'N', 'Y', 'N'
                     )
                   ;
-                ELSE
-                  SELECT max(M_MATCHPO_ID)
-                  INTO v_MatchPO_ID
-                  FROM M_MATCHPO
-                  WHERE C_ORDERLINE_ID = Cur_SLines.C_OrderLine_ID
-                        AND M_INOUTLINE_ID = Cur_SLines.M_InOutLine_ID;
                   
-                  v_ResultStr:='UpdateMatchPO ' || v_MatchPO_ID;
-                  UPDATE M_MATCHPO
-                  SET DateTrx = now(), Qty =v_Qty, Processing = 'N', Processed = 'Y', Posted='N'
-                  WHERE M_MATCHPO_ID = v_MatchPO_ID;
-                END IF;
               END LOOP;
               v_ResultStr:='MatchInv';
               FOR Cur_ILines IN