Produmex WMS
AnsweredI have the below query but I would like to add the QA reason and QA Reason Free text fields and the date the item was moved into a QUARANTINE status from the PMX_MVLI table my issue is that I can do a select where the srcreason and the deststatus are not equal but the reason codes and reason free text may have happened in another entry on the PMX_MVLI so the QA src reason and the dest qa status are the same is there a way to get round this to enable me to get the last entry of an item with a QA status of QUARANTINE?
SELECT
DISTINCT "PMX_INVT"."ItemCode" AS "ItemCode",
"OITM"."ItemName" AS "ItemName",
"PMX_ITRI"."BatchNumber" AS "BatchNumber1",
"PMX_OSEL"."Name" AS "StorLocName",
"PMX_INVT"."QualityStatusCode" AS "QualityStatus",
ROUND(("OBTN"."CostTotal"/"OBTN"."Quantity")*"PMX_INVT"."Quantity",2) AS "Cost",
--"PMX_REAS"."Name" AS "QA Reason",
--"PMX_REAS"."ReasonFreeText" AS "QA Reason Detail",
"PMX_INVT"."Quantity" AS "Quantity",
"OITM"."InvntryUom" AS "InvntryUom",
"OITB"."ItmsGrpNam" AS "Item Group"
FROM "PMX_INVT"
INNER JOIN "OITM" ON "PMX_INVT"."ItemCode" = "OITM"."ItemCode"
INNER JOIN "PMX_OSEL" ON "PMX_INVT"."StorLocCode" = "PMX_OSEL"."Code"
INNER JOIN "PMX_OSWH" ON "PMX_OSEL"."PmxWhsCode" = "PMX_OSWH"."Code"
LEFT JOIN "PMX_ITRI" ON "PMX_INVT"."ItemTransactionalInfoKey" = "PMX_ITRI"."InternalKey"
LEFT JOIN "PMX_LUID" AS "LUID" ON "PMX_INVT"."LogUnitIdentKey" = "LUID"."InternalKey"
LEFT JOIN ( SELECT
DISTINCT "PMX_LMLU"."MasterLUID",
"PMX_LMLU"."LUID"
FROM "PMX_LMLU" ) AS "PMX_LMLU" ON "PMX_INVT"."LogUnitIdentKey" = "PMX_LMLU"."LUID"
LEFT JOIN "PMX_LUID" AS "MasterLUID" ON "MasterLUID"."InternalKey" = "PMX_LMLU"."MasterLUID"
LEFT JOIN "OPDN" ON "OPDN"."DocEntry" = (SELECT
"Value"
FROM "PMX_HFI_LIVE"."TMP_IntInt"
WHERE "Key" = "PMX_INVT"."LogUnitIdentKey")
LEFT OUTER JOIN "OITB" ON "OITM"."ItmsGrpCod" = "OITB"."ItmsGrpCod"
--LEFT OUTER JOIN "PMX_REAS" ON "PMX_MVLI"."ReasonCode" = "PMX_REAS"."Code"
INNER JOIN "OBTN" ON "OITM"."ItemCode" = "OBTN"."ItemCode" AND "PMX_ITRI"."BatchNumber" = "OBTN"."DistNumber"
WHERE "PMX_INVT"."QualityStatusCode" = 'QUARANTI'
-
Official comment
Hello Chris,
For this specific topic, please contact your local Partner. If you are a Partner, please create a support ticket.
Please sign in to leave a comment.
Comments
1 comment