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

GO
CREATE VIEW [dbo].[V_PDV_MENU_FISCAL_MOVIMENTO_ECF_DADOS_REDUCAOZ]    
AS

   SELECT MP.CD_EMP,
   MP.CD_FILIAL,
   MP.CD_CX,
   MP.DT_ECF,
   MP.CONT_RED_Z,
   ISNULL(MP.COO_REDUCAO_Z,0) AS COO_REDUCAO_Z,
   MP.CONT_REINICIO AS CONT_REINICIO_OP,
   MP.DT_CAD,
   MP.VLR_VEND_BRUTA,
   MP.VLR_BASE_ICMS_SUBS,
   MP.VLR_ISENTAS,
   MP.VLR_N_TRIB,
   MP.VLR_DESC,
   MP.VLR_CANC,
   MP.DT_USUARIO_ECF,
   MP.DT_USUARIO_SOFTWARE_BASICO,
   MP.LETRA_MF_ADICIONAL,
   CX.NR_SERIE_IMP,
   CX.MODELO_ECF
       
	FROM PDV_MAPA_RESUMO MP  INNER JOIN PDV_CX CX ON
	MP.CD_EMP = CX.CD_EMP 
	AND MP.CD_FILIAL = CX.CD_FILIAL
	AND MP.CD_CX  = CX.CD_CX
    

