@Willy_Caldero Gracias Ingeniero siempre usted con su amabilidad para explicar las pregunta. Asi como me comenta lo haré Saludos
Gracias
@Willy_Caldero Este fue el la consulta que realice pero solo me esta funcionando para una sola porpiedad
SELECT T1.[ItemCode] , T1.[Dscription] AS DESCRIPCIÓN,T2.[CardCode],
T0.[CardCode] ,T0.[CardName] AS CLIENTE,T0.[DocEntry],T0.[DocDate],
SUM(T1.[Quantity]*T2.[SalPackUn]) AS CANTIDAD,
/*T2.[SalUnitMsr]*/ /*T2.[InvntryUom]*/ T1.[unitMsr] AS 'UNIDAD DE VENTAS',
T1.[PriceBefDi] AS 'PRECIO UNITARIO',
SUM(T1.[LineTotal]-(T1.[LineTotal]*T0.[DiscPrcnt]/100)) AS VENTAS,
SUM(T1.[GrssProfit]) As Utilidad,T3.[ItmsGrpNam] as 'GRUPO DE ARTICULOS',
'Propiedad' = case when t2.qrygroup27='Y' then (select itmsgrpnam from OITG
where ItmsTypCod =27) end
FROM OINV T0 INNER JOIN INV1 T1 ON T0.[DocEntry]=T1.[DocEntry]
INNER JOIN OITM T2 ON T1.[ItemCode]=T2.[ItemCode]
INNER JOIN OITB T3 ON T2.[ItmsGrpCod]=T3.[ItmsGrpCod]
WHERE T0.[DocDate]>=[%3] AND T0.[DocDate]<=[%4] AND T2.[CardCode]=[%0] AND
T3.[ItmsGrpNam]=[%1] and t2.qrygroup27 = 'Y'
GROUP BY T3.[ItmsGrpNam],T2.[CardCode],T0.[CardCode],T0.[CardName],
T0.[DocEntry],T0.[DocDate],T1.[ItemCode],T1.[Dscription],T2.[NumInBuy],
T1.[unitMsr] ,T1.[PriceBefDi],t2.qrygroup27
UNION ALL
SELECT T1.[ItemCode] AS 'N° CATALOGO' , T1.[Dscription] AS DESCRIPCION,
T2.[CardCode] , T0.[CardCode], T0.[CardName] AS CLIENTE,T0.[DocEntry],
T0.[DocDate] ,-SUM(T1.[Quantity]*T2.[SalPackUn]) AS CANTIDAD,
/*T2.[SalUnitMsr]*/
/*T2.[InvntryUom]*/ T1.[unitMsr] AS 'UNIDAD DE VENTAS',
T1.[PriceBefDi] AS 'PRECIO UNITARIO',
-SUM(T1.[LineTotal]-(T1.[LineTotal]*T0.[DiscPrcnt]/100)) AS VENTAS,
-SUM(T1.[GrssProfit]),T3.[ItmsGrpNam]as 'GRUPO DE ARTICULOS',
'Propiedad' = case when t2.qrygroup27='Y' then (select itmsgrpnam
from OITG where ItmsTypCod =27) end
FROM ORIN T0
INNER JOIN RIN1 T1 ON T0.[DocEntry]=T1.[DocEntry]
INNER JOIN OITM T2 ON T1.[ItemCode]=T2.[ItemCode]
INNER JOIN OITB T3 ON T2.[ItmsGrpCod]=T3.[ItmsGrpCod]
WHERE T0.[DocDate]>=[%3] AND T0.[DocDate]<=[%4] AND T2.[CardCode]=[%0] AND
T3.[ItmsGrpNam]=[%1] AND t2.qrygroup27 = 'Y'
GROUP BY T3.[ItmsGrpNam],T2.[CardCode],T0.[CardCode], T0.[CardName],
T0.[DocEntry],T0.[DocDate],T1.[ItemCode],
T1.[Dscription], /*T2.[InvntryUom]*//*T2.[SalUnitMsr]*/
T1.[unitMsr],T1.[PriceBefDi],t2.qrygroup27 ORDER BY 6 DESC