CREATE TRIGGER TTBNFS_FORMA_PAGAMENTO_A01D FOR TBNFS_FORMA_PAGAMENTO
ACTIVE AFTER DELETE POSITION 0
AS
BEGIN
    IF(CHAR_LENGTH(TRIM(OLD.CODIGO_AUTORIZACAO)) > 0)THEN
    BEGIN
       DELETE FROM TBCONCILIACAO_CARTAO_DET
         WHERE DOCUMENTO_CONTROLE = OLD.DOCUMENTO_ID
           AND TIPO               = OLD.DOCUMENTO_TIPO;
    END
END;