gracias ya lo realice con un case anilado
SELECT T0.CardCode AS 'supplier code',
T0.CardName AS 'supplier Name',
CASE when T0.DocType = 'S' AND T0.DocCur = 'USD' AND T0.CardCode = T0.CardCode then SUM(T0.DocTotalFC) - SUM(T0.PaidSys) else
CASE When T0.DocType = 'S' AND T0.DocCur = 'MXN' AND T0.CardCode = T0.CardCode then SUM(T0.DocTotal) - SUM(T0.PaidSys) else 0 end end AS 'servicio',
CASE when T0.DocType = 'I' AND T0.DocCur = 'USD' AND T0.CardCode = T0.CardCode then SUM(T0.DocTotalFC) - SUM(T0.PaidSys) else
CASE When T0.DocType = 'I' AND T0.DocCur = 'MXN' AND T0.CardCode = T0.CardCode then SUM(T0.DocTotal) - SUM(T0.PaidSys) else 0 end end AS 'Articulos',
T0.DocCur
FROM OPCH T0
WHERE DATEDIFF (DD, T0.DocDueDate, GETDATE( )) BETWEEN -7 AND 365
AND T0.DocStatus = 'O' AND T0.SERIES = 10 AND T0.CANCELED = 'N'
GROUP BY T0.CardCode,T0.CardName,T0.DocType,T0.DocCur
ORDER BY T0.CardCode,T0.CardName,T0.DocType
FOR BROWSE