---------------------------------------------
CREATE OR REPLACE TRIGGER ATUALIZA_DATA_NFRNF BEFORE UPDATE ON NOTAFISCAL
FOR EACH ROW
BEGIN
/*   IF (NVL(:OLD.IDSTATUS, 'P') = NVL(:NEW.IDSTATUS, 'P')) AND (:NEW.IDSTATUS = 'P') AND*/
   IF (:NEW.IDSTATUS = 'P') AND
      ((:NEW.IDJIMPRNF <> 'N' AND :NEW.DTEXPRNF <> :OLD.DTEXPRNF) OR
      (:NEW.DTEXPRNF = :OLD.DTEXPRNF AND :NEW.IDJIMPRNF = :OLD.IDJIMPRNF)) THEN
      :NEW.DTEXPRNF := NULL;
    END IF;
END;
/


-- VERSAO --
BEGIN ATUVEROBJ('ATUALIZA_DATA_NFRNF','4.09.034'); END;
/

