src-db/database/model/triggers/MA_WRPHASE_TRG.xml
changeset 14983 fcf3ccf492f3
parent 14979 da3863fa640f
child 25175 9e11efa4229f
equal deleted inserted replaced
14982:0efd2107a1a5 14983:fcf3ccf492f3
    25     IF AD_isTriggerEnabled()='N' THEN RETURN;
    25     IF AD_isTriggerEnabled()='N' THEN RETURN;
    26     END IF;
    26     END IF;
    27 
    27 
    28 IF (INSERTING) THEN
    28 IF (INSERTING) THEN
    29 	UPDATE MA_WORKREQUIREMENT 
    29 	UPDATE MA_WORKREQUIREMENT 
    30 	SET ESTIMATEDTIME = ESTIMATEDTIME + :NEW.ESTIMATEDTIME
    30 	SET ESTIMATEDTIME = ESTIMATEDTIME + :NEW.ESTIMATEDTIME, RUNTIME = RUNTIME + :NEW.RUNTIME
    31 	WHERE MA_WORKREQUIREMENT_ID = :NEW.MA_WORKREQUIREMENT_ID;
    31 	WHERE MA_WORKREQUIREMENT_ID = :NEW.MA_WORKREQUIREMENT_ID;
    32 END IF;
    32 END IF;
    33 
    33 
    34 IF (UPDATING) THEN
    34 IF (UPDATING) THEN
    35 	UPDATE MA_WORKREQUIREMENT 
    35 	UPDATE MA_WORKREQUIREMENT 
    36 	SET ESTIMATEDTIME = ESTIMATEDTIME + :NEW.ESTIMATEDTIME - :OLD.ESTIMATEDTIME
    36 	SET ESTIMATEDTIME = ESTIMATEDTIME + :NEW.ESTIMATEDTIME - :OLD.ESTIMATEDTIME, RUNTIME = RUNTIME + :NEW.RUNTIME - :OLD.RUNTIME
    37 	WHERE MA_WORKREQUIREMENT_ID = :NEW.MA_WORKREQUIREMENT_ID;
    37 	WHERE MA_WORKREQUIREMENT_ID = :NEW.MA_WORKREQUIREMENT_ID;
    38 END IF;
    38 END IF;
    39 
    39 
    40 IF (DELETING) THEN
    40 IF (DELETING) THEN
    41 	UPDATE MA_WORKREQUIREMENT 
    41 	UPDATE MA_WORKREQUIREMENT 
    42 	SET ESTIMATEDTIME = ESTIMATEDTIME - :OLD.ESTIMATEDTIME
    42 	SET ESTIMATEDTIME = ESTIMATEDTIME - :OLD.ESTIMATEDTIME, RUNTIME = RUNTIME - :OLD.RUNTIME
    43 	WHERE MA_WORKREQUIREMENT_ID = :OLD.MA_WORKREQUIREMENT_ID;
    43 	WHERE MA_WORKREQUIREMENT_ID = :OLD.MA_WORKREQUIREMENT_ID;
    44 END IF;
    44 END IF;
    45 
    45 
    46 END MA_WRPHASE_TRG
    46 END MA_WRPHASE_TRG
    47 ]]></body>
    47 ]]></body>