
/*------ ATD 438178 ------*/
-- Adicionando coluna AdRemICMS na tabela COMPLEMENTOPRODUTO
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'AdRemICMS' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='COMPLEMENTOPRODUTO')) 
ALTER TABLE COMPLEMENTOPRODUTO ADD AdRemICMS NUMERIC(7,4)
go

-- Adicionando coluna qBCMonoRet na tabela DADOSITEMNFE
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'qBCMonoRet' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='DADOSITEMNFE')) 
ALTER TABLE DADOSITEMNFE ADD qBCMonoRet NUMERIC(15,4)
go

-- Adicionando coluna adRemICMSRet na tabela DADOSITEMNFE
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'adRemICMSRet' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='DADOSITEMNFE')) 
ALTER TABLE DADOSITEMNFE ADD adRemICMSRet NUMERIC(7,4)
go

-- Adicionando coluna vICMSMonoRet na tabela DADOSITEMNFE
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'vICMSMonoRet' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='DADOSITEMNFE')) 
ALTER TABLE DADOSITEMNFE ADD vICMSMonoRet NUMERIC(15,2)
go

-- Adicionando coluna qBCMonoRet na tabela DADOSNOTANFE
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'qBCMonoRet' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='DADOSNOTANFE')) 
ALTER TABLE DADOSNOTANFE ADD qBCMonoRet NUMERIC(15,4)
go

-- Adicionando coluna vICMSMonoRet na tabela DADOSNOTANFE
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'vICMSMonoRet' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='DADOSNOTANFE')) 
ALTER TABLE DADOSNOTANFE ADD vICMSMonoRet NUMERIC(15,2)
go