---
---Datos de un pedido
---
select a.strNumDoc, a.strCodLin, e.strCodigoBarra, a.strUbcA, a.lngCanAsg, f.strDescripcion
from
tbl_peddet a join tbl_pedcab b on a.strTipDoc = b.strTipDoc and a.strNumDoc = b.strNumDoc
join tblterceros c on b.strCodTer = c.strCodigo
join tblzonas d on c.strCodigoZona = d.strCodigo
join tblsku e on a.strCodLin = e.strCodLin
join tblproductos f on e.strReferencia = f.strReferencia
where
b.strTipDoc = 'pd' and b.strCamGen = '201908'
and b.logFacturado = 0
and d.STRMAILGROUP = 'c'
and a.strCodLin <> '00412'
and a.lngCanAsg > 0
order by a.strNumDoc