on 02-20-2011 11:00 PM
Hola,
Necesito sacar un informe con las ventas similar a la información del análisis volumen de negocio pero que además incluya los importes de las facturas con el impuesto, es decir, que me de cada factura con el importe base, el impporte de impuesto y el importe total. A alguien se le ocurre cómo?
Gracias y un saludo,
Tere
Hola Teresa
Prueba la siguiente Query
SELECT T0.CardCode, T0.CardName, Count(T0.DocNum)'NºDoctos', SUM(T0.DocTotal)'Total Facturas', SUM(T0.VatSum)'Total Impuesto', SUM(T0.DocTotal-T0.VatSum)'Total Base o neto', SUM(T0.GrosProfit)'Ganancia', SUM(T0.DocTotal-T0.PaidToDate)'Pendiente'
FROM OINV T0
WHERE T0.DocDate BETWEEN '[%0]' AND '[%1]'
GROUP BY T0.CardCode, T0.CardName
UNION
SELECT T0.CardCode, T0.CardName, Count(T0.DocNum)'NºDoctos', -SUM(T0.DocTotal)'Total Facturas', -SUM(T0.VatSum)'Total Impuesto', -SUM(T0.DocTotal-T0.VatSum)'Total Base o neto', -SUM(T0.GrosProfit)'Ganancia', -SUM(T0.DocTotal-T0.PaidToDate)'Pendiente'
FROM ORIN T0
WHERE T0.DocDate BETWEEN '[%0]' AND '[%1]'
GROUP BY T0.CardCode, T0.CardName
Saludos
FLR
Edited by: Floyola on Feb 21, 2011 11:00 AM
Edited by: Floyola on Feb 21, 2011 11:01 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.