CREATE OR REPLACE TRIGGER ATUALIZA_VRDEVOLUCAOREC
AFTER DELETE
ON DEVOLUCAOREC FOR EACH ROW
BEGIN
   IF DELETING THEN
      UPDATE NOTAFISCAL
         SET VRDEVOLNFUTL = NVL(VRDEVOLNFUTL, 0) - :OLD.VRDEVOLUCAOREC
       WHERE CDFILIAL = :OLD.CDFILIAL
         AND NRLANCTONF = :OLD.NRLANCTONF;
   END IF;
END;
/

-- VERSAO --
BEGIN ATUVEROBJ('ATUALIZA_VRDEVOLUCAOREC','5.07.014'); END;
/
