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

-- VERSAO --
BEGIN ATUVEROBJ('ATUALIZA_VRDEVOLUCAO','5.07.015'); END;
/
