/****** Object:  View [dbo].[V_EST_NF_NFE_PENDENTE_EMISSAO]    Script Date: 08/13/2013 09:44:51 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[V_EST_NF_NFE_PENDENTE_EMISSAO]'))
DROP VIEW [dbo].[V_EST_NF_NFE_PENDENTE_EMISSAO]
GO

/****** Object:  View [dbo].[V_EST_NF_NFE_PENDENTE_EMISSAO]    Script Date: 08/13/2013 09:44:54 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

--SELECT * FROM V_EST_NF_NFE_PENDENTE_EMISSAO WHERE PEND_SOLUC = 0
-- 0 - ENTRADA   
-- 1 - SAIDA   
CREATE VIEW [dbo].[V_EST_NF_NFE_PENDENTE_EMISSAO] AS   
-- 2 - CANCELAMENTO   
	SELECT
		P.CD_EMP
		, P.CD_FILIAL
		, P.CD_NF
	    , 0 AS CD_CTR_CARTA_CORRECAO
		, 0 AS CD_INU
		, P.PEND_SOLUC
		, 0 AS TIPO_NF
		, 'ENTRADA' AS DS_TIPO
	FROM
		EST_NF_ENT_NFE_PEND P
	LEFT OUTER JOIN EST_NF_ENT_NFE_CONTG CONTG ON
			P.CD_EMP = CONTG.CD_EMP
		AND	P.CD_FILIAL = CONTG.CD_FILIAL
		AND P.CD_NF = CONTG.CD_NF
	INNER JOIN PRC_FILIAL F ON
			P.CD_EMP = F.CD_EMP
		AND P.CD_FILIAL = F.CD_FILIAL
		AND F.FLAG_NFE_HABILITADA = 1
	WHERE
		CONTG.CD_NF IS NULL
	UNION ALL
	
	SELECT    
		P.CD_EMP
		, P.CD_FILIAL
		, P.CD_NF
		,0 AS CD_CTR_CARTA_CORRECAO
		, 0 AS CD_INU
		, P.PEND_SOLUC
		, 1 AS TIPO_NF
		, 'SAIDA' AS DS_TIPO
	FROM
		EST_NF_SAI_NFE_PEND P
	LEFT OUTER JOIN EST_NF_SAI_NFE_CONTG CONTG ON
			P.CD_EMP = CONTG.CD_EMP
		AND P.CD_FILIAL = CONTG.CD_FILIAL
		AND P.CD_NF = CONTG.CD_NF
	INNER JOIN PRC_FILIAL F ON
			P.CD_EMP = F.CD_EMP
		AND P.CD_FILIAL = F.CD_FILIAL
		AND F.FLAG_NFE_HABILITADA = 1
	WHERE
		CONTG.CD_NF IS NULL

	UNION ALL

	SELECT    
		P.CD_EMP
		, P.CD_FILIAL
		, P.CD_NF
		,0 AS CD_CTR_CARTA_CORRECAO
		, 0 AS CD_INU
		, P.PEND_SOLUC
		, 2 AS TIPO_NF
		, 'SAIDA CANCELAMENTO' AS DS_TIPO
	FROM
		EST_NF_SAI_NFE_CANCEL_PEND P 
	INNER JOIN PRC_FILIAL F ON
			P.CD_EMP = F.CD_EMP
		AND P.CD_FILIAL = F.CD_FILIAL
		AND F.FLAG_NFE_HABILITADA = 1

	UNION ALL   

	SELECT    
		P.CD_EMP
		, P.CD_FILIAL
		, P.CD_NF
		,0 AS CD_CTR_CARTA_CORRECAO
		, 0 AS CD_INU
		, P.PEND_SOLUC
		, 3 AS TIPO_NF
		, 'ENTRADA CANCELAMENTO' AS DS_TIPO
	FROM
		EST_NF_ENT_NFE_CANCEL_PEND P
	INNER JOIN PRC_FILIAL F ON
			P.CD_EMP = F.CD_EMP
		AND P.CD_FILIAL = F.CD_FILIAL
		AND F.FLAG_NFE_HABILITADA = 1

	UNION 

	SELECT    
		CC_SAI.CD_EMP
		, CC_SAI.CD_FILIAL
		, CC_SAI.CD_NF
		, CC.CD_CTR_CARTA_CORRECAO
		, 0 AS CD_INU
		, 0 AS PEND_SOLUC
		, 4 AS TIPO_NF
		, 'CARTA CORRECAO SAIDA' AS DS_TIPO
	FROM
		EST_NFE_CARTA_CORRECAO_PEND CC
	INNER JOIN EST_NFE_CARTA_CORRECAO_EST_NF_SAI CC_SAI ON 
		CC_SAI.CD_CTR_CARTA_CORRECAO = CC.CD_CTR_CARTA_CORRECAO
	INNER JOIN PRC_FILIAL F ON
			CC_SAI.CD_EMP = F.CD_EMP
		AND CC_SAI.CD_FILIAL = F.CD_FILIAL
		AND F.FLAG_NFE_HABILITADA = 1

	UNION 

	SELECT    
		CC_ENT.CD_EMP
		, CC_ENT.CD_FILIAL
		, CC_ENT.CD_NF
		,CC.CD_CTR_CARTA_CORRECAO
		, 0 AS CD_INU
		, 0 AS PEND_SOLUC
		, 5 AS TIPO_NF
		, 'CARTA CORRECAO ENTRADA' AS DS_TIPO
	FROM
		EST_NFE_CARTA_CORRECAO_PEND CC
	INNER JOIN EST_NFE_CARTA_CORRECAO_EST_NF_ENT CC_ENT ON 
		CC.CD_CTR_CARTA_CORRECAO = CC_ENT.CD_CTR_CARTA_CORRECAO     
	INNER JOIN PRC_FILIAL F ON
			CC_ENT.CD_EMP = F.CD_EMP
		AND CC_ENT.CD_FILIAL = F.CD_FILIAL
		AND F.FLAG_NFE_HABILITADA = 1
	UNION    

	SELECT    
		P.CD_EMP
		, P.CD_FILIAL
		, P.CD_NF
		,0 AS CD_CTR_CARTA_CORRECAO
		, 0 AS CD_INU
		, CASE WHEN P.GERAR_ARQUIVO = 1 THEN 0 ELSE 1 END AS PEND_SOLUC
		, 7 AS TIPO_NF
		, 'MANIFESTO DESTINATARIO' AS DS_TIPO
	FROM
		EST_NF_ENT_DANFE_PROVISORIO_EST_NF_ENT_MANIFESTO_PENDENTE P
	INNER JOIN PRC_FILIAL F ON
			P.CD_EMP = F.CD_EMP
		AND P.CD_FILIAL = F.CD_FILIAL
		AND F.FLAG_NFE_HABILITADA = 1

	UNION

	SELECT
		P.CD_EMP
		, P.CD_FILIAL
		, 0 AS CD_NF
		,0 AS CD_CTR_CARTA_CORRECAO
		, P.CD_INU
		, EST_NF_NFE_INU_PEND.PEND_SOLUC
		, 8 AS TIPO_NF
		, 'INUTILIZAÇÂO' AS DS_TIPO
	FROM
		EST_NF_NFE_INU P
	INNER JOIN EST_NF_NFE_INU_PEND ON
		P.CD_INU = EST_NF_NFE_INU_PEND.CD_INU
	INNER JOIN PRC_FILIAL F ON
			P.CD_EMP = F.CD_EMP
		AND P.CD_FILIAL = F.CD_FILIAL
		AND F.FLAG_NFE_HABILITADA = 1

	UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_INF_EFET_PGTO_INTEG
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 9 AS TIPO_NF
			, 'INFORMACAO DE EFETIVO PAGAMENTO INTEGRAL' AS DS_TIPO
		FROM
			EST_NFE_INF_EFET_PGTO_INTEG_PEND CC
		INNER JOIN EST_NFE_INF_EFET_PGTO_INTEG CC_ENT ON 
			CC.CD_CTR_INF_EFET_PGTO_INTEG = CC_ENT.CD_CTR_INF_EFET_PGTO_INTEG
		INNER JOIN EST_NFE_INF_EFET_PGTO_INTEG_EST_NF_ENT VINC ON VINC.CD_CTR_INF_EFET_PGTO_INTEG = CC_ENT.CD_CTR_INF_EFET_PGTO_INTEG
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
			
			
UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_IMP_ALC_ZFM_NAO_CONV 
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 10 AS TIPO_NF
			, 'IMPORTAÇÃO EM ALC/ZMF NÃO CONVERTIDA EM ISENÇÃO' AS DS_TIPO
		FROM
			EST_NFE_IMP_ALC_ZFM_NAO_CONV_PEND CC
		INNER JOIN EST_NFE_IMP_ALC_ZFM_NAO_CONV CC_ENT ON 
			CC.CD_CTR_IMP_ALC_ZFM_NAO_CONV   = CC_ENT.CD_CTR_IMP_ALC_ZFM_NAO_CONV  
		INNER JOIN EST_NFE_IMP_ALC_ZFM_NAO_CONV_EST_NF_ENT VINC ON VINC.CD_CTR_IMP_ALC_ZFM_NAO_CONV   = CC_ENT.CD_CTR_IMP_ALC_ZFM_NAO_CONV  
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1

	UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_PERDA_ROUBO_TRANSP_FORN 
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 11 AS TIPO_NF
			, 'PERECIMENTO, PERDA, ROUBO OU FURTO DURANTE O TRANSPORTE CONTRATADO PELO FORNECEDOR' AS DS_TIPO
		FROM
			EST_NFE_PEREC_PERDA_ROUBO_TRANSP_FORN_PEND CC
		INNER JOIN EST_NFE_PEREC_PERDA_ROUBO_TRANSP_FORN CC_ENT ON 
			CC.CD_CTR_PERDA_ROUBO_TRANSP_FORN  = CC_ENT.CD_CTR_PERDA_ROUBO_TRANSP_FORN 
		INNER JOIN EST_NFE_PEREC_PERDA_ROUBO_TRANSP_FORN_EST_NF_ENT VINC ON VINC.CD_CTR_PERDA_ROUBO_TRANSP_FORN  = CC_ENT.CD_CTR_PERDA_ROUBO_TRANSP_FORN 
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
			
UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_FORN_NAO_REALIZ_COM_PGTO_ANTECIP  
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 12 AS TIPO_NF
			, 'FORNECIMENTO NÃO REALIZADO COM PAGAMENTO ANTECIPADO' AS DS_TIPO
		FROM
			EST_NFE_FORN_NAO_REALIZ_COM_PGTO_ANTECIP_PEND CC
		INNER JOIN EST_NFE_FORN_NAO_REALIZ_COM_PGTO_ANTECIP CC_ENT ON 
			CC.CD_CTR_FORN_NAO_REALIZ_COM_PGTO_ANTECIP   =  CC_ENT.CD_CTR_FORN_NAO_REALIZ_COM_PGTO_ANTECIP 
		INNER JOIN EST_NFE_FORN_NAO_REALIZ_COM_PGTO_ANTECIP_EST_NF_ENT VINC ON VINC.CD_CTR_FORN_NAO_REALIZ_COM_PGTO_ANTECIP   = CC_ENT.CD_CTR_FORN_NAO_REALIZ_COM_PGTO_ANTECIP  
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
			
			
UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_ATUALIZA_DATA_PREVISAO_ENTREGA 
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 13 AS TIPO_NF
			, 'ATUALIZAÇÃO DA DATA DE PREVISÃO DE ENTREGA' AS DS_TIPO
		FROM
			EST_NFE_ATUALIZA_DATA_PREVISAO_ENTREGA_PEND CC
		INNER JOIN EST_NFE_ATUALIZA_DATA_PREVISAO_ENTREGA CC_ENT ON 
			CC.CD_CTR_ATUALIZA_DATA_PREVISAO_ENTREGA  = CC_ENT.CD_CTR_ATUALIZA_DATA_PREVISAO_ENTREGA 
		INNER JOIN EST_NFE_ATUALIZA_DATA_PREVISAO_ENTREGA_EST_NF_ENT VINC ON VINC.CD_CTR_ATUALIZA_DATA_PREVISAO_ENTREGA  = CC_ENT.CD_CTR_ATUALIZA_DATA_PREVISAO_ENTREGA 
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1

UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_SOLICIT_APROP_CRED_PRESUMIDO  
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 14 AS TIPO_NF
			, 'SOLICITAÇÃO DE APROPRIAÇÃO DE CRÉDITO PRESUMIDO' AS DS_TIPO
		FROM
			EST_NFE_SOLICIT_APROP_CRED_PRESUMIDO_PEND CC
		INNER JOIN EST_NFE_SOLICIT_APROP_CRED_PRESUMIDO CC_SAI ON 
			CC.CD_CTR_SOLICIT_APROP_CRED_PRESUMIDO  = CC_SAI.CD_CTR_SOLICIT_APROP_CRED_PRESUMIDO 
		INNER JOIN EST_NFE_SOLICIT_APROP_CRED_PRESUMIDO_EST_NF_SAI VINC ON VINC.CD_CTR_SOLICIT_APROP_CRED_PRESUMIDO  = CC_SAI.CD_CTR_SOLICIT_APROP_CRED_PRESUMIDO 
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1

UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_DEST_ITEM_CONS_PESSOAL  
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 15 AS TIPO_NF
			, 'DESTINAÇÃO DE ITEM PARA CONSUMO PESSOAL DE ENTRADA' AS DS_TIPO
		FROM
			EST_NFE_DEST_ITEM_CONS_PESSOAL_PEND CC
		INNER JOIN EST_NFE_DEST_ITEM_CONS_PESSOAL CC_ENT ON 
			CC.CD_CTR_DEST_ITEM_CONS_PESSOAL  = CC_ENT.CD_CTR_DEST_ITEM_CONS_PESSOAL 
		INNER JOIN EST_NFE_DEST_ITEM_CONS_PESSOAL_EST_NF_ENT VINC ON VINC.CD_CTR_DEST_ITEM_CONS_PESSOAL  = CC_ENT.CD_CTR_DEST_ITEM_CONS_PESSOAL 
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1

UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_DEST_ITEM_CONS_PESSOAL  
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 15 AS TIPO_NF
			, 'DESTINAÇÃO DE ITEM PARA CONSUMO PESSOAL DE SAÍDA' AS DS_TIPO
		FROM
			EST_NFE_DEST_ITEM_CONS_PESSOAL_PEND CC
		INNER JOIN EST_NFE_DEST_ITEM_CONS_PESSOAL CC_SAI ON 
			CC.CD_CTR_DEST_ITEM_CONS_PESSOAL  = CC_SAI.CD_CTR_DEST_ITEM_CONS_PESSOAL 
		INNER JOIN EST_NFE_DEST_ITEM_CONS_PESSOAL_EST_NF_SAI VINC ON VINC.CD_CTR_DEST_ITEM_CONS_PESSOAL  = CC_SAI.CD_CTR_DEST_ITEM_CONS_PESSOAL 
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1

UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_PERDA_ROUBO_TRANSP_DEST  
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 16 AS TIPO_NF
			, 'PERECIMENTO, PERDA, ROUBO OU FURTO DURANTE O TRANSPORTE CONTRATADO PELO ADQUIRENTE' AS DS_TIPO
		FROM
			EST_NFE_PEREC_PERDA_ROUBO_TRANSP_DEST_PEND CC
		INNER JOIN EST_NFE_PEREC_PERDA_ROUBO_TRANSP_DEST CC_SAI ON 
			CC.CD_CTR_PERDA_ROUBO_TRANSP_DEST   = CC_SAI.CD_CTR_PERDA_ROUBO_TRANSP_DEST  
		INNER JOIN EST_NFE_PEREC_PERDA_ROUBO_TRANSP_DEST_EST_NF_SAI VINC ON VINC.CD_CTR_PERDA_ROUBO_TRANSP_DEST   = CC_SAI.CD_CTR_PERDA_ROUBO_TRANSP_DEST  
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
			

UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_ACEITE_DEB_NOTA_CREDITO  
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 17 AS TIPO_NF
			, 'ACEITE DE DÉBITO NA APURAÇÃO POR EMISSÃO DE NOTA DE CRÉDITO' AS DS_TIPO
		FROM
			EST_NFE_ACEITE_DEB_NOTA_CREDITO_PEND CC
		INNER JOIN EST_NFE_ACEITE_DEB_NOTA_CREDITO CC_SAI ON 
			CC.CD_CTR_ACEITE_DEB_NOTA_CREDITO    = CC_SAI.CD_CTR_ACEITE_DEB_NOTA_CREDITO   
		INNER JOIN EST_NFE_EST_NFE_ACEITE_DEB_NOTA_CREDITO_EST_NF_SAI VINC ON VINC.CD_CTR_ACEITE_DEB_NOTA_CREDITO    = CC_SAI.CD_CTR_ACEITE_DEB_NOTA_CREDITO   
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
			
			
UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_IMOBILIZA_ITEM  
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 18 AS TIPO_NF
			, 'IMOBILIZAÇÃO DE ITEM' AS DS_TIPO
		FROM
			EST_NFE_IMOBILIZA_ITEM_PEND CC
		INNER JOIN EST_NFE_IMOBILIZA_ITEM CC_SAI ON 
			CC.CD_CTR_IMOBILIZA_ITEM    = CC_SAI.CD_CTR_IMOBILIZA_ITEM   
		INNER JOIN EST_NFE_IMOBILIZA_ITEM_EST_NF_SAI VINC ON VINC.CD_CTR_IMOBILIZA_ITEM    = CC_SAI.CD_CTR_IMOBILIZA_ITEM   
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
			
			
UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_SOLIC_APROP_CRED_COMB   
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 19 AS TIPO_NF
			, 'SOLICITAÇÃO DE APROPRIAÇÃO DE CRÉDITO DE COMBUSTÍVEL' AS DS_TIPO
		FROM
			EST_NFE_SOLIC_APROP_CRED_COMB_PEND CC
		INNER JOIN EST_NFE_SOLIC_APROP_CRED_COMB CC_SAI ON 
			CC.CD_CTR_SOLIC_APROP_CRED_COMB     = CC_SAI.CD_CTR_SOLIC_APROP_CRED_COMB    
		INNER JOIN EST_NFE_SOLIC_APROP_CRED_COMB_EST_NF_SAI VINC ON VINC.CD_CTR_SOLIC_APROP_CRED_COMB     = CC_SAI.CD_CTR_SOLIC_APROP_CRED_COMB    
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
			
			
UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_SOLIC_APROP_CRED_BENS_SERVS   
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 20 AS TIPO_NF
			, 'SOLICITAÇÃO DE APROPRIAÇÃO DE CRÉDITO PARA BENS E SERVIÇOS QUE DEPENDEM DO ADQUIRENTE' AS DS_TIPO
		FROM
			EST_NFE_SOLIC_APROP_CRED_BENS_SERVS_PEND CC
		INNER JOIN EST_NFE_SOLIC_APROP_CRED_BENS_SERVS CC_SAI ON 
			CC.CD_CTR_SOLIC_APROP_CRED_BENS_SERVS     = CC_SAI.CD_CTR_SOLIC_APROP_CRED_BENS_SERVS    
		INNER JOIN EST_NFE_SOLIC_APROP_CRED_BENS_SERVS_EST_NF_SAI VINC ON VINC.CD_CTR_SOLIC_APROP_CRED_BENS_SERVS     = CC_SAI.CD_CTR_SOLIC_APROP_CRED_BENS_SERVS    
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1

UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_MAN_PED_TRANSF_CRED_IBS   
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 21 AS TIPO_NF
			, 'MANIFESTAÇÃO SOBRE PEDIDO DE TRANSFERÊNCIA DE CRÉDITO DE IBS EM OPERAÇÕES DE SUCESSÃO ENTRADA' AS DS_TIPO
		FROM
			EST_NFE_MAN_PED_TRANSF_CRED_IBS_PEND CC
		INNER JOIN EST_NFE_MAN_PED_TRANSF_CRED_IBS CC_ENT ON 
			CC.CD_CTR_MAN_PED_TRANSF_CRED_IBS   = CC_ENT.CD_CTR_MAN_PED_TRANSF_CRED_IBS  
		INNER JOIN EST_NFE_MAN_PED_TRANSF_CRED_IBS_EST_NF_ENT VINC ON VINC.CD_CTR_MAN_PED_TRANSF_CRED_IBS   = CC_ENT.CD_CTR_MAN_PED_TRANSF_CRED_IBS  
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1

UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_MAN_PED_TRANSF_CRED_IBS   
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 21 AS TIPO_NF
			, 'MANIFESTAÇÃO SOBRE PEDIDO DE TRANSFERÊNCIA DE CRÉDITO DE IBS EM OPERAÇÕES DE SUCESSÃO SAÍDA' AS DS_TIPO
		FROM
			EST_NFE_MAN_PED_TRANSF_CRED_IBS_PEND CC
		INNER JOIN EST_NFE_MAN_PED_TRANSF_CRED_IBS CC_SAI ON 
			CC.CD_CTR_MAN_PED_TRANSF_CRED_IBS   = CC_SAI.CD_CTR_MAN_PED_TRANSF_CRED_IBS  
		INNER JOIN EST_NFE_MAN_PED_TRANSF_CRED_IBS_EST_NF_SAI VINC ON VINC.CD_CTR_MAN_PED_TRANSF_CRED_IBS   = CC_SAI.CD_CTR_MAN_PED_TRANSF_CRED_IBS  
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1


UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_MAN_PED_TRANSF_CRED_CBS   
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 22 AS TIPO_NF
			, 'MANIFESTAÇÃO SOBRE PEDIDO DE TRANSFERÊNCIA DE CRÉDITO DE CBS EM OPERAÇÕES DE SUCESSÃO ENTRADA' AS DS_TIPO
		FROM
			EST_NFE_MAN_PED_TRANSF_CRED_CBS_PEND CC
		INNER JOIN EST_NFE_MAN_PED_TRANSF_CRED_CBS CC_ENT ON 
			CC.CD_CTR_MAN_PED_TRANSF_CRED_CBS   = CC_ENT.CD_CTR_MAN_PED_TRANSF_CRED_CBS  
		INNER JOIN EST_NFE_MAN_PED_TRANSF_CRED_CBS_EST_NF_ENT VINC ON VINC.CD_CTR_MAN_PED_TRANSF_CRED_CBS   = CC_ENT.CD_CTR_MAN_PED_TRANSF_CRED_CBS  
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1

UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_MAN_PED_TRANSF_CRED_CBS   
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 22 AS TIPO_NF
			, 'MANIFESTAÇÃO SOBRE PEDIDO DE TRANSFERÊNCIA DE CRÉDITO DE CBS EM OPERAÇÕES DE SUCESSÃO SAÍDA' AS DS_TIPO
		FROM
			EST_NFE_MAN_PED_TRANSF_CRED_CBS_PEND CC
		INNER JOIN EST_NFE_MAN_PED_TRANSF_CRED_CBS CC_SAI ON 
			CC.CD_CTR_MAN_PED_TRANSF_CRED_CBS   = CC_SAI.CD_CTR_MAN_PED_TRANSF_CRED_CBS  
		INNER JOIN EST_NFE_MAN_PED_TRANSF_CRED_CBS_EST_NF_SAI VINC ON VINC.CD_CTR_MAN_PED_TRANSF_CRED_CBS   = CC_SAI.CD_CTR_MAN_PED_TRANSF_CRED_CBS  
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1


UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_VD
			,CC.CD_CTR_CONC_FINAN_ECONF    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 23 AS TIPO_NF
			, 'ECONF CONCILIAÇÃO FINANCEIRA NFCE 65' AS DS_TIPO
		FROM
			EST_NFE_CONC_FINAN_ECONF_PEND CC
		INNER JOIN EST_NFE_CONC_FINAN_ECONF CC_PDV ON 
			CC.CD_CTR_CONC_FINAN_ECONF    = CC_PDV.CD_CTR_CONC_FINAN_ECONF   
		INNER JOIN EST_NFE_CONC_FINAN_ECONF_PDV_VD VINC ON VINC.CD_CTR_CONC_FINAN_ECONF    = CC_PDV.CD_CTR_CONC_FINAN_ECONF   
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1

UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_CONC_FINAN_ECONF    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 23 AS TIPO_NF
			, 'ECONF CONCILIAÇÃO FINANCEIRA NFE 55' AS DS_TIPO
		FROM
			EST_NFE_CONC_FINAN_ECONF_PEND CC
		INNER JOIN EST_NFE_CONC_FINAN_ECONF CC_SAI ON 
			CC.CD_CTR_CONC_FINAN_ECONF    = CC_SAI.CD_CTR_CONC_FINAN_ECONF   
		INNER JOIN EST_NFE_CONC_FINAN_ECONF_EST_NF_SAI VINC ON VINC.CD_CTR_CONC_FINAN_ECONF    = CC_SAI.CD_CTR_CONC_FINAN_ECONF   
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1

UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_CANCEL_EVENTO    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 25 AS TIPO_NF
			, 'CANCELADOMENTO DE EVENTO INFORMACAO DE EFETIVO PAGAMENTO INTEGRAL' AS DS_TIPO
		FROM EST_NFE_CANCEL_EVENTO CC
		INNER JOIN EST_NFE_CANCEL_EVENTO_PEND CCP ON CC.CD_CTR_CANCEL_EVENTO   = CCP.CD_CTR_CANCEL_EVENTO
		INNER JOIN EST_NFE_INF_EFET_PGTO_INTEG_EST_NF_ENT VINC ON CC.CD_CTR_EVENTO  = VINC.CD_CTR_INF_EFET_PGTO_INTEG
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
		WHERE CC.TIPO_EVENTO = '112110'

UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_CANCEL_EVENTO    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 25 AS TIPO_NF
			, 'CANCELADOMENTO DE EVENTO IMPORTAÇÃO EM ALC/ZMF NÃO CONVERTIDA EM ISENÇÃO' AS DS_TIPO
		FROM EST_NFE_CANCEL_EVENTO CC
		INNER JOIN EST_NFE_CANCEL_EVENTO_PEND CCP ON CC.CD_CTR_CANCEL_EVENTO   = CCP.CD_CTR_CANCEL_EVENTO
		INNER JOIN EST_NFE_IMP_ALC_ZFM_NAO_CONV_EST_NF_ENT VINC ON CC.CD_CTR_EVENTO  = VINC.CD_CTR_IMP_ALC_ZFM_NAO_CONV 
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
		WHERE CC.TIPO_EVENTO = '112120'

UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_CANCEL_EVENTO    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 25 AS TIPO_NF
			, 'CANCELADOMENTO DE EVENTO PERECIMENTO, PERDA, ROUBO OU FURTO DURANTE O TRANSPORTE CONTRATADO PELO FORNECEDOR' AS DS_TIPO
		FROM EST_NFE_CANCEL_EVENTO CC
		INNER JOIN EST_NFE_CANCEL_EVENTO_PEND CCP ON CC.CD_CTR_CANCEL_EVENTO   = CCP.CD_CTR_CANCEL_EVENTO
		INNER JOIN EST_NFE_PEREC_PERDA_ROUBO_TRANSP_FORN_EST_NF_ENT VINC ON CC.CD_CTR_EVENTO  = VINC.CD_CTR_PERDA_ROUBO_TRANSP_FORN 
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
		WHERE CC.TIPO_EVENTO = '112130'

UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_CANCEL_EVENTO    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 25 AS TIPO_NF
			, 'CANCELADOMENTO DE EVENTO FORNECIMENTO NÃO REALIZADO COM PAGAMENTO ANTECIPADO' AS DS_TIPO
		FROM EST_NFE_CANCEL_EVENTO CC
		INNER JOIN EST_NFE_CANCEL_EVENTO_PEND CCP ON CC.CD_CTR_CANCEL_EVENTO   = CCP.CD_CTR_CANCEL_EVENTO
		INNER JOIN EST_NFE_FORN_NAO_REALIZ_COM_PGTO_ANTECIP_EST_NF_ENT VINC ON CC.CD_CTR_EVENTO  = VINC.CD_CTR_FORN_NAO_REALIZ_COM_PGTO_ANTECIP 
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
		WHERE CC.TIPO_EVENTO = '112140'
		


UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_CANCEL_EVENTO    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 25 AS TIPO_NF
			, 'CANCELADOMENTO DE EVENTO ATUALIZAÇÃO DA DATA DE PREVISÃO DE ENTREGA' AS DS_TIPO
		FROM EST_NFE_CANCEL_EVENTO CC
		INNER JOIN EST_NFE_CANCEL_EVENTO_PEND CCP ON CC.CD_CTR_CANCEL_EVENTO   = CCP.CD_CTR_CANCEL_EVENTO
		INNER JOIN EST_NFE_ATUALIZA_DATA_PREVISAO_ENTREGA_EST_NF_ENT VINC ON CC.CD_CTR_EVENTO  = VINC.CD_CTR_ATUALIZA_DATA_PREVISAO_ENTREGA  
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
		WHERE CC.TIPO_EVENTO = '112150'
		

UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_CANCEL_EVENTO    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 25 AS TIPO_NF
			, 'CANCELADOMENTO DE EVENTO SOLICITAÇÃO DE APROPRIAÇÃO DE CRÉDITO PRESUMIDO' AS DS_TIPO
		FROM EST_NFE_CANCEL_EVENTO CC
		INNER JOIN EST_NFE_CANCEL_EVENTO_PEND CCP ON CC.CD_CTR_CANCEL_EVENTO   = CCP.CD_CTR_CANCEL_EVENTO
		INNER JOIN EST_NFE_SOLICIT_APROP_CRED_PRESUMIDO_EST_NF_SAI VINC ON CC.CD_CTR_EVENTO  = VINC.CD_CTR_SOLICIT_APROP_CRED_PRESUMIDO   
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
		WHERE CC.TIPO_EVENTO = '211110'



UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_CANCEL_EVENTO    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 25 AS TIPO_NF
			, 'CANCELADOMENTO DE EVENTO DESTINAÇÃO DE ITEM PARA CONSUMO PESSOAL DE ENTRADA' AS DS_TIPO
		FROM EST_NFE_CANCEL_EVENTO CC
		INNER JOIN EST_NFE_CANCEL_EVENTO_PEND CCP ON CC.CD_CTR_CANCEL_EVENTO   = CCP.CD_CTR_CANCEL_EVENTO
		INNER JOIN EST_NFE_DEST_ITEM_CONS_PESSOAL_EST_NF_ENT VINC ON CC.CD_CTR_EVENTO  = VINC.CD_CTR_DEST_ITEM_CONS_PESSOAL    
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
		WHERE CC.TIPO_EVENTO = '211120'


UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_CANCEL_EVENTO    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 25 AS TIPO_NF
			, 'CANCELADOMENTO DE EVENTO DESTINAÇÃO DE ITEM PARA CONSUMO PESSOAL DE SAÍDA' AS DS_TIPO
		FROM EST_NFE_CANCEL_EVENTO CC
		INNER JOIN EST_NFE_CANCEL_EVENTO_PEND CCP ON CC.CD_CTR_CANCEL_EVENTO   = CCP.CD_CTR_CANCEL_EVENTO
		INNER JOIN EST_NFE_DEST_ITEM_CONS_PESSOAL_EST_NF_SAI VINC ON CC.CD_CTR_EVENTO  = VINC.CD_CTR_DEST_ITEM_CONS_PESSOAL    
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
		WHERE CC.TIPO_EVENTO = '211120'


UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_CANCEL_EVENTO    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 25 AS TIPO_NF
			, 'CANCELADOMENTO DE EVENTO PERECIMENTO, PERDA, ROUBO OU FURTO DURANTE O TRANSPORTE CONTRATADO PELO ADQUIRENTE' AS DS_TIPO
		FROM EST_NFE_CANCEL_EVENTO CC
		INNER JOIN EST_NFE_CANCEL_EVENTO_PEND CCP ON CC.CD_CTR_CANCEL_EVENTO   = CCP.CD_CTR_CANCEL_EVENTO
		INNER JOIN EST_NFE_PEREC_PERDA_ROUBO_TRANSP_DEST_EST_NF_SAI VINC ON CC.CD_CTR_EVENTO  = VINC.CD_CTR_PERDA_ROUBO_TRANSP_DEST     
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
		WHERE CC.TIPO_EVENTO = '211124'



UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_CANCEL_EVENTO    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 25 AS TIPO_NF
			, 'CANCELADOMENTO DE EVENTO ACEITE DE DÉBITO NA APURAÇÃO POR EMISSÃO DE NOTA DE CRÉDITO' AS DS_TIPO
		FROM EST_NFE_CANCEL_EVENTO CC
		INNER JOIN EST_NFE_CANCEL_EVENTO_PEND CCP ON CC.CD_CTR_CANCEL_EVENTO   = CCP.CD_CTR_CANCEL_EVENTO
		INNER JOIN EST_NFE_EST_NFE_ACEITE_DEB_NOTA_CREDITO_EST_NF_SAI VINC ON CC.CD_CTR_EVENTO  = VINC.CD_CTR_ACEITE_DEB_NOTA_CREDITO      
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
		WHERE CC.TIPO_EVENTO = '211128'



UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_CANCEL_EVENTO    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 25 AS TIPO_NF
			, 'CANCELADOMENTO DE EVENTO IMOBILIZAÇÃO DE ITEM' AS DS_TIPO
		FROM EST_NFE_CANCEL_EVENTO CC
		INNER JOIN EST_NFE_CANCEL_EVENTO_PEND CCP ON CC.CD_CTR_CANCEL_EVENTO   = CCP.CD_CTR_CANCEL_EVENTO
		INNER JOIN EST_NFE_IMOBILIZA_ITEM_EST_NF_SAI VINC ON CC.CD_CTR_EVENTO  = VINC.CD_CTR_IMOBILIZA_ITEM        
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
		WHERE CC.TIPO_EVENTO = '211130'




UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_CANCEL_EVENTO    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 25 AS TIPO_NF
			, 'CANCELADOMENTO DE EVENTO SOLICITAÇÃO DE APROPRIAÇÃO DE CRÉDITO DE COMBUSTÍVEL' AS DS_TIPO
		FROM EST_NFE_CANCEL_EVENTO CC
		INNER JOIN EST_NFE_CANCEL_EVENTO_PEND CCP ON CC.CD_CTR_CANCEL_EVENTO   = CCP.CD_CTR_CANCEL_EVENTO
		INNER JOIN EST_NFE_SOLIC_APROP_CRED_COMB_EST_NF_SAI VINC ON CC.CD_CTR_EVENTO  = VINC.CD_CTR_SOLIC_APROP_CRED_COMB        
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
		WHERE CC.TIPO_EVENTO = '211140'


UNION 

		SELECT    
			VINC.CD_EMP
			, VINC.CD_FILIAL
			, VINC.CD_NF
			,CC.CD_CTR_CANCEL_EVENTO    
			, 0 AS CD_INU
			, 0 AS PEND_SOLUC
			, 25 AS TIPO_NF
			, 'CANCELADOMENTO DE SOLICITAÇÃO DE APROPRIAÇÃO DE CRÉDITO PARA BENS E SERVIÇOS QUE DEPENDEM DO ADQUIRENTE' AS DS_TIPO
		FROM EST_NFE_CANCEL_EVENTO CC
		INNER JOIN EST_NFE_CANCEL_EVENTO_PEND CCP ON CC.CD_CTR_CANCEL_EVENTO   = CCP.CD_CTR_CANCEL_EVENTO
		INNER JOIN EST_NFE_SOLIC_APROP_CRED_BENS_SERVS_EST_NF_SAI VINC ON CC.CD_CTR_EVENTO  = VINC.CD_CTR_SOLIC_APROP_CRED_BENS_SERVS       
		INNER JOIN PRC_FILIAL F ON
				VINC.CD_EMP = F.CD_EMP
			AND VINC.CD_FILIAL = F.CD_FILIAL
			AND F.FLAG_NFE_HABILITADA = 1
		WHERE CC.TIPO_EVENTO = '211150'


