on 11-09-2015 7:09 PM
Alguien sabe como hacer que aparezca la serie del articulo de la tabla osrn en el layout de la factura
Chequea este query que es para todas las transacciones.
SELECT DISTINCT
T0.ItemCode AS Cod_Item,
T0.ItemName AS Nombre_Item,
T0.IntrSerial AS Serie,
T0.WhsCode AS Almacen,
CASE T0.Status
WHEN 0 THEN 'Disponible'
WHEN 1 THEN 'No disponible'
WHEN 2 THEN 'Imputado'
END AS Estado,
T2.Quantity AS Cantidad,
CASE T3.BaseType
WHEN 13 THEN 'Factura Clientes'
WHEN 14 THEN 'NC Clientes'
WHEN 15 THEN 'Entrega'
WHEN 16 THEN 'Devolucion'
WHEN 18 THEN 'Factura Proveedor'
WHEN 19 THEN 'NC Proveedores'
WHEN 20 THEN 'Entrada mercaderia OP'
WHEN 21 THEN 'Devolucion mercaderias'
WHEN 59 THEN 'Entrada mercaderias'
WHEN 60 THEN 'Salida de mercaderias'
WHEN 67 THEN 'Traslado stock'
ELSE CONVERT(NVARCHAR(5),T3.BaseType)
END AS Documento,
T3.BaseNum AS NroDocto,
T4.TransId AS Asiento,
T3.BaseLinNum AS Linea,
T3.DocDate AS Fecha,
T3.WhsCode AS Alm_Docto,
T3.CardName AS IC,
CASE T3.Direction
WHEN 1 THEN 'Salida'
ELSE 'Entrada'
END AS Sentido
FROM OSRI T0
INNER JOIN OSRN T1 ON T1.ItemCode=T0.ItemCode AND T1.DistNumber=T0.IntrSerial
INNER JOIN OSRQ T2 ON T2.ItemCode=T1.ItemCode AND T2.SysNumber=T1.SysNumber
LEFT JOIN SRI1 T3 ON T3.ItemCode=T0.ItemCode AND T3.SysSerial=T1.SysNumber
LEFT JOIN JDT1 T4 ON T4.TransType=T3.BaseType AND T4.BaseRef=T3.BaseNum AND T4.CreatedBy=T3.BaseEntry
Saludos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
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.