Skip to Content
0
Jul 20, 2020 at 12:43 AM

Inventory Report (OINM duplicate return)

96 Views Last edit Jul 20, 2020 at 11:08 AM 2 rev

Hi,

guys, i have a problem when doing an inventory report.
The query brings the information, but there are many duplicate lines.
I tried to limit in the OINM by the field "TransType (" 59, 20), but even so there are several duplicate lines and with that making it difficult to extract the information.
I ask the specialists for help.

T2."TransType",T2."DocDate", T2."InQty", T2."OutQty", T4."WhsCode", T3."WhsName" AS "Nome do depósito", T1."ItemCode", T1."ItemName", T0."ItmsGrpNam", T1."InvntryUom", T1."U_RSD_PesoBruto", T1."U_RSD_UN_Conversao", T4."AvgPrice" 

FROM  OITB T0  
INNER  JOIN OITM T1  ON  T1."ItmsGrpCod" = T0."ItmsGrpCod"   
INNER  JOIN OINM T2  ON  T2."ItemCode" = T1."ItemCode"   
INNER  JOIN OWHS T3  ON  T3."WhsCode" = T2."Warehouse"   
INNER  JOIN OITW T4  ON  T4."WhsCode" = T3."WhsCode"   
INNER  JOIN OITM T5  ON  T5."ItemCode" = T4."ItemCode"   

WHERE 
T2."TransType" in (59,20) AND
T1."ItemCode" = [%0]

Thankful!

Regards

Junior