Ligar entrada de mercancia-opdn y ubicacion-obin

buen Dia, hay forma de ligar las entradas de la mercancía (tabla OPDN) con su almacen de recepción y ubicación (tabla OBIN), actualmente tengo el siguiente código, pero no logro agregar la ubicación:

SELECT
T5.[DocEntry],
T0.[CardCode], 
T0.[CardName], 
T0.[DocNum], 
T0.[DocDate],
T1.[WhsCode], 
T1.[ItemCode], 
T1.[Dscription], 
T1.LineNum+1 AS Linea,
T1.[Quantity], 
T1.[Currency], 
T1.[PriceAfVAT], 
T1.[Quantity]*T1.[PriceAfVAT] as "Total"
FROM OPOR T0
INNER JOIN POR1 T1 ON T0.DOCENTRY = T1.DOCENTRY
LEFT OUTER JOIN PDN1 T4 ON T4.BASEENTRY = T1.DOCENTRY AND T4.BASETYPE = T1.OBJTYPE AND T4.BASELINE = T1.LINENUM
LEFT OUTER JOIN OPDN T5 ON T4.DOCENTRY = T5.DOCENTRY
WHERE T0.[CANCELED] ='N' AND T1.LineStatus = 'C' and T1.WhsCode='XXX'
ORDER BY T0.DOCNUM ASC

De antemano le agradezco sus cometarios y apoyo, Saludos.

Esta seria la relacion:

FROM
OBTN T0
inner join OBTQ T1 on T0.ItemCode = T1.ItemCode and T0.SysNumber = T1.SysNumber
inner join OITM T2 on T0.ItemCode = T2.ItemCode
inner join OBBQ T3 on T0.ItemCode = T3.ItemCode and T0.AbsEntry = T3.SnBMDAbs
inner join OBIN T4 on T3.BinAbs = T4.AbsEntry
inner join OWHS T6 on T6.WhsCode = t4.WhsCode
where
T1.Quantity > 0
AND T3.OnHandQty > 0
and T0.ItemCode = 'CodItem'
2 Me gusta