X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fdb%2Fmanufacturing_db.inc;h=637ef4b9e25a558b80bca1fa4f4000e15613013a;hb=1571869d54be48452fdbe08f25130972ff0a7b5a;hp=1e8af932385ed5b12f861f2e32a032f4f9ff30fa;hpb=5f06887dedd4d14701864fb72994d7e20352086d;p=fa-stable.git diff --git a/includes/db/manufacturing_db.inc b/includes/db/manufacturing_db.inc index 1e8af932..637ef4b9 100644 --- a/includes/db/manufacturing_db.inc +++ b/includes/db/manufacturing_db.inc @@ -61,10 +61,10 @@ function stock_demand_manufacture($stock_id, $qty, $demand_id, $location, $level $qoh_stock = array(); load_stock_levels($location); } - $stock_qty = $qoh_stock[$stock_id]; - if ($stock_qty == NULL) $stock_qty = 0; + if (empty($qoh_stock[$stock_id])) $stock_qty = 0; + else $stock_qty = $qoh_stock[$stock_id]; if ($qty <= $stock_qty) return $demand; - $bom = $bom_list[$stock_id]; + $bom = @$bom_list[$stock_id]; if ($bom == NULL) { $sql = "SELECT parent, component, quantity FROM " .TB_PREF."bom WHERE parent = ".db_escape($stock_id); @@ -205,7 +205,7 @@ function add_bom($selected_parent, $component, $workcentre_added, $loc_code, $qu } //-------------------------------------------------------------------------------------- -function update_bom($selected_parent, $selected_component, $work_centre_added, $loc_code, $quantity) +function update_bom($selected_parent, $selected_component, $workcentre_added, $loc_code, $quantity) { $sql = "UPDATE ".TB_PREF."bom SET workcentre_added=".db_escape($workcentre_added) . ",loc_code=".db_escape($loc_code) . ",