select 	
		Codigo, 
		grprod,
		Descricao, 
		Fabricante, 
		Tipo, 
        Flag_ImprClassif1,
		Cod_Estado,
		Qtd_Fisico, 
		Qtd_Solicitado, 
		Qtd_Quarentena, 
		Qtd_Disponivel,
        Prc_Venda, 
        Prc_CusMedPra, 
        Prc_CustoMedio, 
        Prc_UltEnt,
        ifnull((select sum(Qtd_UnidVenda)
			from view_itensvendapordata
			where
			Codigo = produ.Codigo
			and dataCompleta >= '2018-01-01'
			and dataCompleta <= '2018-12-31'),0) as Qtd_UnidVenda,
		ifnull((select sum(TotalVlr_CusIte_NF)
			from view_itensvendapordata
			where
			Codigo = produ.Codigo
			and dataCompleta >= '2018-01-01'
			and dataCompleta <= '2018-12-31'),0) as TotalVlr_CusIte_NF,
		ifnull((select sum(vlrTotalVenda)
			from view_itensvendapordata
			where
			Codigo = produ.Codigo
			and dataCompleta >= '2018-01-01'
			and dataCompleta <= '2018-12-31'),0) as vlrTotalVenda
        
from produ
-- where Flag_ImprClassif1 <> 'N'

order by Descricao;

