-- CRIAR AS COLUNAS PARA A TABELA PDV_VD_IT - CONFORME SOLICITADO NO CHAMADO FARMAGOI-3133
if not exists( select * from INFORMATION_SCHEMA.COLUMNS
				WHERE TABLE_NAME= 'PDV_VD_IT' AND COLUMN_NAME='vlr_fecop')
ALTER TABLE PDV_VD_IT ADD vlr_fecop money; 

if not exists( select * from INFORMATION_SCHEMA.COLUMNS
				WHERE TABLE_NAME= 'PDV_VD_IT' AND COLUMN_NAME='vlr_fecop_st')
ALTER TABLE PDV_VD_IT ADD vlr_fecop_st  money;

if not exists( select * from INFORMATION_SCHEMA.COLUMNS
				WHERE TABLE_NAME= 'PDV_VD_IT' AND COLUMN_NAME='vlr_fecop_ret')
ALTER TABLE PDV_VD_IT ADD vlr_fecop_ret   money;

if not exists( select * from INFORMATION_SCHEMA.COLUMNS
				WHERE TABLE_NAME= 'PDV_VD_IT' AND COLUMN_NAME='perc_fecop_st')
ALTER TABLE PDV_VD_IT ADD perc_fecop_st   money;

if not exists( select * from INFORMATION_SCHEMA.COLUMNS
				WHERE TABLE_NAME= 'PDV_VD_IT' AND COLUMN_NAME='perc_fecop_ret')
ALTER TABLE PDV_VD_IT ADD perc_fecop_ret   money;

if not exists( select * from INFORMATION_SCHEMA.COLUMNS
				WHERE TABLE_NAME= 'PDV_VD_IT' AND COLUMN_NAME='vlr_base_calc')
ALTER TABLE PDV_VD_IT ADD vlr_base_calc  money;

if not exists( select * from INFORMATION_SCHEMA.COLUMNS
				WHERE TABLE_NAME= 'PDV_VD_IT' AND COLUMN_NAME='vlr_icms')
ALTER TABLE PDV_VD_IT ADD vlr_icms   money;

if not exists( select * from INFORMATION_SCHEMA.COLUMNS
				WHERE TABLE_NAME= 'PDV_VD_IT' AND COLUMN_NAME='vlr_base_subst')
ALTER TABLE PDV_VD_IT ADD vlr_base_subst  money;

if not exists( select * from INFORMATION_SCHEMA.COLUMNS
				WHERE TABLE_NAME= 'PDV_VD_IT' AND COLUMN_NAME='vlr_isento')
ALTER TABLE PDV_VD_IT ADD vlr_isento  money;

if not exists( select * from INFORMATION_SCHEMA.COLUMNS
				WHERE TABLE_NAME= 'PDV_VD_IT' AND COLUMN_NAME='vlr_outras')
ALTER TABLE PDV_VD_IT ADD vlr_outras  money;

if not exists( select * from INFORMATION_SCHEMA.COLUMNS
				WHERE TABLE_NAME= 'PDV_VD_IT' AND COLUMN_NAME='vlr_icms_subst')
ALTER TABLE PDV_VD_IT ADD vlr_icms_subst   money;

if not exists( select * from INFORMATION_SCHEMA.COLUMNS
				WHERE TABLE_NAME= 'PDV_VD_IT' AND COLUMN_NAME='perc_icms')
ALTER TABLE PDV_VD_IT ADD perc_icms  money;

if not exists( select * from INFORMATION_SCHEMA.COLUMNS
				WHERE TABLE_NAME= 'PDV_VD_IT' AND COLUMN_NAME='perc_icms_subst')
ALTER TABLE PDV_VD_IT ADD perc_icms_subst   money;

if not exists( select * from INFORMATION_SCHEMA.COLUMNS
				WHERE TABLE_NAME= 'PDV_VD_IT' AND COLUMN_NAME='perc_red_base_calc')
ALTER TABLE PDV_VD_IT ADD perc_red_base_calc  money;






