CREATE trigger ttbpdv_cfe_a01d for tbpdv_cfe
active after delete position 1
AS
BEGIN
    DELETE FROM TBPDV_CFE_ITEM T WHERE T.PDV_CFE_ID = OLD.ID;
    DELETE FROM TBPDV_CFE_ITEM_SALDO T WHERE T.PDV_CFE_ID = OLD.ID;
    DELETE FROM TBPDV_CFE_FORMA_PAGAMENTO T WHERE T.PDV_CFE_ID = OLD.ID;
END;

COMMENT ON TRIGGER TTBPDV_CFE_A01D IS 'EXCLUSAO DE ITENS, SALDO DOS ITENS E FORMAS DE PAGAMENTO DO CUPOM';

