IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[V_RC_CLI_CONV]'))
DROP VIEW [dbo].V_RC_CLI_CONV
go

CREATE VIEW [dbo].[V_RC_CLI_CONV] AS
SELECT  rc_cli_conv.cd_conv, 
		rc_cli_conv.cd_emp, 
		rc_cli_conv.cd_filial, 
		rc_cli_conv.ds_conv, 
		rc_cli_conv.perc_desc, 
		rc_cli_conv.cd_cli, 
		rc_cli_conv.dia_fat, 
		rc_cli_conv.lim_cre, 
		rc_cli_conv.cd_conv_id, 
		ISNULL(DBO.rc_cli_conv.tp_conv, 0) AS tp_conv,
		ISNULL(DBO.rc_cli_conv.sts_cred, 0) AS sts_cred,
		rc_cli_conv.instrucoes,
		rc_cli_conv.instrucoes_format, 
		rc_cli_conv.flag_imp_prod, 
		rc_cli_conv.flag_requer_senha, 
		rc_cli_conv.flag_imp_compr, 
		rc_cli_conv.perc_rec_min_conv, 
		ISNULL(DBO.rc_cli_conv.conv_habilitado, 0) AS conv_habilitado, 
		rc_cli_conv.flag_blq_desc_vlr, 
		rc_cli_conv.perc_rec_max_conv, 
		rc_cli_conv.qt_max_parc,
		rc_cli_conv.vlr_min_parc,
		rc_cli_conv.flag_recbto_vlr_subsidio,
		rc_cli_conv.qtd_dias_prorrog,
		ISNULL(DBO.rc_cli_conv.cd_mdl_vd, 0) AS cd_mdl_vd,
		ISNULL(DBO.rc_cli_conv.flag_somente_item_conv, 0) AS flag_somente_item_conv, 
		rc_cli_conv.procedure_desconto,
		ISNULL(DBO.rc_cli_conv.flag_somente_desc_contrato, 0) AS flag_somente_desc_contrato,
		rc_cli_conv.flag_imp_compr_tds_parc ,
		ISNULL(DBO.rc_cli_conv.flag_preco_livre, 0) AS flag_preco_livre,
		ISNULL(DBO.rc_cli_conv.tp_fechamento, 0) AS tp_fechamento,
		ISNULL(DBO.rc_cli_conv.flag_dif_vd_tit_dependente, 0) AS flag_dif_vd_tit_dependente
   FROM rc_cli_conv;