Hola Marco, supongo que este código te puede servir, lo hice un poco de afán pero creo que la lógica es correcta para que la pruebes en el Query manager:
/* Select From [DBO].[OINV] T0 */
Declare @FechaIni as DateTime
Declare @FechaFin as DateTime
/* Where */
Set Dateformat DMY
Set @FechaIni = /* T0.DocDate */ '[%0]'
Set @FechaFin = /* T0.DocDate */ '[%1]'
Select T0.ItmsGrpNam,
Sum(T1.LineTotal) 'Factura',
Sum(T2.LineTotal) 'Nota_Credito',
Sum(T1.LineTotal) - Sum(T2.LineTotal) 'Total'
From OITB T0
Inner Join
(
Select T3.ItmsGrpNam, T1.LineTotal
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 Between @FechaIni And @FechaFin
)T1 On T0.ItmsGrpNam = T1.ItmsGrpNam
Inner Join
(
Select T3.ItmsGrpNam, T1.LineTotal
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 Between @FechaIni And @FechaFin
)T2 On T0.ItmsGrpNam = T2.ItmsGrpNam
Group By T0.ItmsGrpNam
Order By T0.ItmsGrpNam
Saludos,
Andrés