Skip to Content
avatar image
Former Member

Reporte de ventas anexado litros facturados

Buenos días estimados Srs.

Tengo la siguiente consulta; requerimos de un informe de ventas en donde se nos muestre las ventas por vendedor así como lo litros que haya acumulado ya sea semanal o mensual. he intentado pero no me sale la consulta ya que no soy muy bueno en la cuestión de lo reportes, tengo como obtener los litros

SELECT T1.[SlpName], sum(T0.[Volume])*1000 FROM OINV T0 INNER JOIN OSLP T1 ON T0.[SlpCode] = T1.[SlpCode] GROUP BY T1.[SlpName]

y quisiera agregarlo a esta otra parte pero no me queda

SELECT T1.SlpName AS 'Personal de ventas ', --T0.SlpCode AS 'SP Code', COUNT(T0.DocNum) AS 'Numero de documentos', 'Nota de Crédito' AS 'Tipo documento', SUM ((T0.DocTotal) * -1) AS 'Total de los documentos', SUM (((T0.DocTotal - T0.VatSum) - T0.TotalExpns) * -1) AS 'Total en productos', SUM ((T0.GrosProfit) * -1) AS 'Ganancia bruta', CASE WHEN (SUM (((T0.DocTotal - T0.VatSum) - T0.TotalExpns) * -1)) = 0.00 THEN 0.00 ELSE (SUM ((T0.GrosProfit) * -1)/SUM (((T0.DocTotal - T0.VatSum) - T0.TotalExpns) * -1)) * 100 END AS 'Ganancia bruta %', SUM ((T0.PaidToDate) * -1) AS 'Pagado a la fecha', SUM ((T0.DocTotal - T0.PaidToDate) *-1) AS 'Documentos abiertos' FROM ORIN T0 INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode WHERE (T1.SlpName LIKE '%%%%' OR '%' = ' ') AND T0.TaxDate >= [%0] AND T0.TaxDate <= [%1] GROUP BY T0.SlpCode, T1.SlpName UNION SELECT T1.SlpName AS 'Personal de ventas ', --T0.SlpCode AS 'SP Code', COUNT(T0.DocNum) AS 'Numero de documentos', 'Factura' AS 'Tipo documento', SUM (T0.DocTotal) AS 'Total de los documentos', SUM ((T0.DocTotal - T0.VatSum) - T0.TotalExpns) AS 'Total en productos', SUM (T0.GrosProfit) AS 'Ganancia bruta', CASE WHEN (SUM ((T0.DocTotal - T0.VatSum) - T0.TotalExpns)) = 0.00 THEN 0.00 ELSE (SUM (T0.GrosProfit)/SUM ((T0.DocTotal - T0.VatSum) - T0.TotalExpns)) * 100 END AS 'Ganancia bruta %', SUM (T0.PaidToDate) AS 'Pagado a la fecha', SUM (T0.DocTotal - T0.PaidToDate) AS 'Documentos abiertos' FROM OINV T0 INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode WHERE (T1.SlpName LIKE '%%%%' OR '%' = ' ') AND T0.TaxDate >= [%0] AND T0.TaxDate <= [%1] GROUP BY T0.SlpCode, T1.SlpName

espero me puedan ayudar

Saludos

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers