on 09-23-2014 1:08 AM
Hola buen dia,
Necesito obtener todos los SN que tienen facturas de anticipos pendientes por arrastrar o aplicar a una factura.
No quiero hacerlo SN x SN uno a la vez,
Gracias.
Hola Jorge
Para facturas de anticipo de proveedores:
SELECT DISTINCT T0.[CardCode], T0.[CardName] FROM ODPO T0 WHERE T0.[DocStatus] = 'O'
Para facturas de anticipo de clientes:
SELECT DISTINCT T0.[CardCode], T0.[CardName] FROM ODPI T0 WHERE T0.[DocStatus] = 'O'
Estas consultas te mostrarán un listado de todos los clientes o proveedores, que tienen facturas de anticipo abiertas.
Un saludo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Buen día, creo que lo que se refiere Jorge, es un listado de Facturas de Anticipo que estan pendientes de ser aplicadas a una factura y el query arroja Facturas de Anticipo pendientes de Pago.
Para el listado de facturas de Anticipo pendientes de aplicar sería:
Ventas-Informes de ventas-Infomes de partidas abiertas: Anticipos de Cliente aun no aplicados.
Saludos
Alessandro.
Alesandro necesito tu ayuda para rteplicar erl informe de analisi de ventas para agregar campos pero:
TENGO EL SIGUIENTE QUERY PERO ME ARROJA DIFERENCIAS EN ALGUNOS ARTICULOS CUANDO ESTOS TIENEN DESCUENTOS, FACTURAS DE ANTICIPOS, O ESTAN ABIERTOS.
EN FIN CUADRA EN UN 80 %, NECESITO EL 100% ME PODRIAN AYUDAR POR FAVOR
SELECT ItemCode,
Sum(TotFac) - SUM(TotNC) as 'FacturadoNeto',
Sum(GBrutaFac)-SUM(GbrutaNC) as 'GBruta',
Round((Sum(GBrutaFac)-SUM(GbrutaNC))/case when (Sum(TotFac) - SUM(TotNC))= 0 then 1 else (Sum(TotFac) - SUM(TotNC)) end *100,2) as '% Margen'
FROM (
SELECT
ItemCode = T1.ItemCode,
Marca = (Select T2.FirmName from OMRC T2 JOIN OITM T3 on T2.FirmCode = T3.FirmCode where T3.ItemCode=T1.Itemcode),
TotFac = Sum(T1.Linetotal),
GBrutaFac = SUM(T1.GrssProfit),
TotNc= 0,
GbrutaNC = 0
FROM OINV T0 (NOLOCK) INNER JOIN INV1 T1 (NOLOCK) ON T0.DocEntry = T1.DocEntry
WHERE (T0.[DocDate] >='20140101' AND T0.[DocDate] <='20141231')
and T0.DocType = 'I' -- solo facturas por articulos
Group by T1.ItemCode
Union
SELECT
ItemCode = T1.ItemCode,
Marca = (Select T2.FirmName from OMRC T2 JOIN OITM T3 on T2.FirmCode = T3.FirmCode where T3.ItemCode=T1.Itemcode),
TotFac = 0,
GBrutaFac = 0,
TotNc= Sum(T1.LineTotal),
GbrutaNC = SUM(T1.GrssProfit)
FROM ORIN T0 (NOLOCK) INNER JOIN RIN1 T1 (NOLOCK) ON T0.DocEntry = T1.DocEntry
WHERE (T0.[DocDate] >='20140101' AND T0.[DocDate] <='20141231')
and T0.DocType = 'I' -- solo NC por articulos
Group by T1.ItemCode
Union
SELECT
ItemCode = T1.ItemCode,
Marca = (Select T2.FirmName from OMRC T2 JOIN OITM T3 on T2.FirmCode = T3.FirmCode where T3.ItemCode=T1.Itemcode),
TotFac = 0,
GBrutaFac = 0,
TotNc= Sum(T1.LineTotal),
GbrutaNC = SUM(T1.GrssProfit)
FROM ODPI T0 (NOLOCK) INNER JOIN DPI1 T1 (NOLOCK) ON T0.DocEntry = T1.DocEntry
WHERE (T0.[DocDate] >='20140101' AND T0.[DocDate] <='20141231')
and T0.DocType = 'I' -- solo Fact Anticipos por articulos
Group by T1.ItemCode
) T
Group by ItemCode, Marca
Alejandro como la califico?
Aprovecho para consultarte sobre otro tema.
Tengo a 1 usuario el encargado del almacen que en una sociedad al momento de realizar la entrega no le respeta la tarifa, me doy cuenta en el costo del producto el cual es considerable.
En donde configuro esta parte, para mi usuario y otros si lo respeta.
Gracias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Excelente a esto me referia!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
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.