on 05-16-2016 7:15 PM
Buen dia
Me pueden ayudar con un query que me permita obtener informe de ventas por el tipo de documento, es decir tengo dos distintos numeros de documentos (300xxx y 200xxx) cada cual pertenece a dos lugares de facturacion. y necesito separar el informe, me pueden ayudar a separarlo por el documento en 300xxx y 200xxx? Este es mi query pero me da el informe general.
SELECT T0.[DocNum], T0.[CardCode], T0.[CardName], T0.[DocDate],T0.[ShipToCode],T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[Price], T1.[LineTotal], T1.[StockPrice], (T1.[Quantity]* T1.[StockPrice]) as 'Costo total', -(T1.[Quantity]* T1.[StockPrice]) + T1.[LineTotal] as 'Utilidad Bruta'
FROM Oinv T0 INNER JOIN inv1 T1 ON T0.DocEntry = T1.DocEntry where t0.docstatus = 'o'
AND T0.[DOCDATE] BETWEEN [%0] AND [%1]
Hola, el campo es SERIES que almacena el numero del serial seleccionado para crear cada documento.
Saludos.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes. prueba lo siguiente.
SELECT T0.[DocNum], t0.series,t2.SeriesName,T0.[CardCode], T0.[CardName], T0.[DocDate],T0.[ShipToCode],T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[Price], T1.[LineTotal], T1.[StockPrice], (T1.[Quantity]* T1.[StockPrice]) as 'Costo total', -(T1.[Quantity]* T1.[StockPrice]) + T1.[LineTotal] as 'Utilidad Bruta'
FROM Oinv T0 INNER JOIN inv1 T1 ON T0.DocEntry = T1.DocEntry
inner join nnm1 t2 on t2.Series = t0.series and t2.ObjectCode = 13 and T2.Locked = 'N'
where t0.docstatus = 'o'
AND T0.[DOCDATE] BETWEEN [%0] AND [%1]
and T2.SeriesName = [%2]
Saludos+
Depende como quieras obtener la información:
1. Si quieres todo en el mismo resultado, identificando a que lugar de facturación corresponde, puedes agregar una columna que muestre eso basándote en el número de serie de doxumento (OINV.Series) o algún otro campo que te permita clasificarlos.
2. Si quieres información de un "tipo" de documento a la vez , según la que desee el usuario, entonces en el WHERE agrega ese campo que te sirvió como clasificador o simplemente apoyate en la numeración que comentas.
Saludos,
JC.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
104 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
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.