---
---Datos del pedido BD / LE
---
select a.*, b.*, c.strCodigoBarra from
(
select
a.strNumDoc, b.strCodLin
from tbl_pedcab a, tbl_peddet b
where
a.strTipDoc = b.strTipDoc and a.strNumDoc = b.strNumDoc and a.strTipDoc = 'pd'
group by a.strNumDoc, b.strCodLin
) a left join
(
Select
a.numeropedido, b.sku, c.skupickeado
from
[192.168.10.14].[MP_StockSupply].Picking.PedidosEncabezados a,
[192.168.10.14].[MP_StockSupply].Picking.PedidosCuerpos b,
[192.168.10.14].[MP_StockSupply].picking.PedidosSkuPickeados c
where
b.PedidoEncabezadoId = a.PedidoEncabezadoId and c.PedidoCuerpoId = b.PedidoCuerpoId
) b on a.strnumdoc = b.numeropedido and a.strcodlin = b.sku
inner join tblsku c on a.strCodLin = c.strCodLin
where
strNumDoc = '0019480872'
--and strCodigoBarra = '7707216592390'