on 07-16-2015 4:49 PM
Buen día,
Quisiera me dieran una orientación para poder generar un Query que indique el numero de serie o lote de un articulo facturado ya que requiero incluirlo en un layout de impresión de dicho documento en Crystal Reports.
Actualmente utilizo SAP Business One 8.81
Agradezco de antemano sus aportes
Sino prueba con esta
SELECT DISTINCT
OSRN.DistNumber 'Serie',
OINV.DocNum 'Factura',
OWOR.Status 'Estado',
OWOR.Type,
OSRN.itemName,
OINV.CardCode,
INV1.ItemCode,
OWOR.PostDate,
OWOR.RjctQty,
OCRD.CardName,
OSLP.SlpName,
CASE
WHEN OSRI.Status = '1' THEN 'Facturado'
ELSE 'No Facturado'
END 'Estado',
OSRI.Status
FROM INV1 WITH (NOLOCK)
INNER JOIN OINV WITH (NOLOCK)
ON INV1.DocEntry = OINV.docentry
INNER JOIN OITL WITH (NOLOCK)
ON oinv.DocEntry = OITL.ApplyEntry
AND inv1.LineNum = OITL.ApplyLine
AND OITL.ApplyType = 13
INNER JOIN ITL1 WITH (NOLOCK)
ON OITL.LogEntry = ITL1.LogEntry
INNER JOIN OSRN WITH (NOLOCK)
ON ITL1.Itemcode = osrn.itemcode
AND ITL1.MdAbsEntry = OSRN.AbsEntry
LEFT JOIN OWOR WITH (NOLOCK)
ON OSRN.DistNumber = CONVERT(nvarchar, OWOR.DOCNUM)
LEFT JOIN OCRD WITH (NOLOCK)
ON OINV.CardCode = OCRD.CardCode
LEFT JOIN OSLP WITH (NOLOCK)
ON OCRD.SlpCode = OSLP.SlpCode
LEFT JOIN OSRI WITH (NOLOCK)
ON OSRN.DistNumber = OSRI.IntrSerial
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Buen dia Danilo,
Revisa si este query te sirve, lo he usado para layouts cuando quiero saber la serie o el lote., en este caso es para una entrega, pero funciona para cualquier documento de ventas que genere serie o lotes.
select DISTINCT B.ItemCode, A.CardCode,A.LicTradNum, A.DocDate, B.ItemCode, B.ItemName,
D.MnfSerial, D.DistNumber, D.InDate, D.GrntStart, D.GrntExp, A.Address, A.DocNum, G.SlpName,A.DocEntry --, F.Quantity--,F.WhsCode
from ODLN A
INNER JOIN OITL B ON (A.DocNum=B.DocNum AND B.DocType=15)
INNER JOIN ITL1 C ON (B.LogEntry=C.LogEntry AND B.DocType=15)
INNER JOIN OSRN D ON (C.SysNumber=D.SysNumber AND B.DocType=15 AND B.ItemCode=D.ItemCode)
INNER JOIN OITM E ON (B.ItemCode=E.ItemCode AND B.DocType=15)
INNER JOIN DLN1 F ON (A.DocEntry=F.DocEntry AND B.ItemCode=D.ItemCode )
INNER JOIN OSLP G ON (A.SlpCode=G.SlpCode AND B.DocType=15)
WHERE A.DocEntry={?DocKey@} AND E.ManSerNum='Y' AND B.DocType=15
Saludos,
Wuilmer Venegas
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 | |
5 | |
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.