".TB_PREF."stock_master.description, ".TB_PREF."stock_master.mb_flag AS ResourceType,
".TB_PREF."stock_master.material_cost+ ".TB_PREF."stock_master.labour_cost+".TB_PREF."stock_master.overhead_cost AS standard_cost, units,
".TB_PREF."bom.quantity * (".TB_PREF."stock_master.material_cost+ ".TB_PREF."stock_master.labour_cost+ ".TB_PREF."stock_master.overhead_cost) AS ComponentCost
- FROM ".TB_PREF."workcentres, ".TB_PREF."locations, ".TB_PREF."bom INNER JOIN ".TB_PREF."stock_master ON ".TB_PREF."bom.component = ".TB_PREF."stock_master.stock_id
+ FROM (".TB_PREF."workcentres, ".TB_PREF."locations, ".TB_PREF."bom) INNER JOIN ".TB_PREF."stock_master ON ".TB_PREF."bom.component = ".TB_PREF."stock_master.stock_id
WHERE ".TB_PREF."bom.parent = '" . $item . "'
AND ".TB_PREF."workcentres.id=CAST(".TB_PREF."bom.workcentre_added AS UNSIGNED)
AND ".TB_PREF."bom.loc_code = ".TB_PREF."locations.loc_code ORDER BY ".TB_PREF."bom.id";
".TB_PREF."stock_master.mb_flag,
".TB_PREF."locations.location_name,
".TB_PREF."workcentres.name AS WorkCentreDescription FROM
- ".TB_PREF."wo_requirements, ".TB_PREF."locations, ".TB_PREF."workcentres INNER JOIN ".TB_PREF."stock_master ON
+ (".TB_PREF."wo_requirements, ".TB_PREF."locations, ".TB_PREF."workcentres) INNER JOIN ".TB_PREF."stock_master ON
".TB_PREF."wo_requirements.stock_id = ".TB_PREF."stock_master.stock_id
WHERE workorder_id=$woid
AND ".TB_PREF."locations.loc_code = ".TB_PREF."wo_requirements.loc_code
INSERT INTO `0_stock_master` VALUES ('103', 1, 1, '32MB VGA Card', '', 'each', 'B', '3000', '4010', '1420', '4210', '0', NULL, NULL, 0, 0, 0, 0, 0);
INSERT INTO `0_stock_master` VALUES ('104', 1, 1, '52x CD Drive', '', 'each', 'B', '3000', '4010', '1420', '4210', '0', NULL, NULL, 0, 0, 0, 0, 0);
INSERT INTO `0_stock_master` VALUES ('201', 2, 1, 'Assembly Labour', '', 'each', 'D', '3000', '4010', '1420', '4210', '0', NULL, NULL, 0, 0, 0, 0, 0);
-INSERT INTO `0_stock_master` VALUES ('3400', 3, 1, 'P4 Business System', '', 'each', 'M', '3000', '4010', '1420', '4210', '0', NULL, NULL, 0, 0, 0, 0, 0);
+INSERT INTO `0_stock_master` VALUES ('3400', 3, 1, 'P4 Business System', '', 'each', 'M', '3000', '4010', '1420', '4210', '1400', NULL, NULL, 0, 0, 0, 0, 0);
--
-- Data in table `stock_moves`