Does anyone have a query to get the BOM for lot nu...
# suiteql
j
Does anyone have a query to get the BOM for lot number assemblies?
l
try
Copy code
SELECT
  a.item AS assembly_id,
  a.itemname AS assembly_name,
  b.item AS component_id,
  b.itemname AS component_name,
  c.quantity
FROM
  item AS a
JOIN
  bomrevision AS br ON a.id = br.assembly
JOIN
  bomrevisionmember AS c ON br.id = c.bomrevision
JOIN
  item AS b ON c.component = b.id
WHERE
  a.type = 'Assembly'
  AND a.islotitem = 'T'
  AND br.isinactive = 'F'
  AND c.isinactive = 'F'
  AND b.isinactive = 'F'
ORDER BY
  a.itemname, b.itemname;
Copy code
SELECT
  a.id AS assembly_id,
  a.itemid AS assembly_name,
  b.id AS component_id,
  b.itemid AS component_name,
  c.quantity
FROM
  assemblyitem AS a
JOIN
  assemblyitembillofmaterials AS abm ON a.id = abm.assembly
JOIN
  bomrevisionmember AS c ON abm.billofmaterials = c.billofmaterials
JOIN
  item AS b ON c.member = b.id
WHERE
  a.islotitem = 'T'
  AND abm.isinactive = 'F'
  AND c.isinactive = 'F'
  AND b.isinactive = 'F'
ORDER BY
  a.itemid, b.itemid;