X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fdb%2Fmanufacturing_db.inc;h=6473ba4bcf0f335e067402879389325cc222e6c8;hb=7e8df3a179c05c51085349e139aac9ce88b9378d;hp=ddb93c58fd2cf33041a99497eef5fbf894ad6b2a;hpb=f8ad8280fa3d47484bafbf753c6e048a729d3ad6;p=fa-stable.git diff --git a/includes/db/manufacturing_db.inc b/includes/db/manufacturing_db.inc index ddb93c58..6473ba4b 100644 --- a/includes/db/manufacturing_db.inc +++ b/includes/db/manufacturing_db.inc @@ -41,7 +41,7 @@ function load_stock_levels($location) $sql = "SELECT stock_id, SUM(qty) FROM ".TB_PREF."stock_moves WHERE tran_date <= '$date'"; if ($location != '') $sql .= " AND loc_code = ".db_escape($location); $sql .= " GROUP BY stock_id"; - $result = db_query($sql, "QOH calulcation failed"); + $result = db_query($sql, "QOH calculation failed"); while ($row = db_fetch($result)) { $qoh_stock[$row[0]] = $row[1]; } @@ -179,19 +179,6 @@ function get_on_worder_qty($stock_id, $location) return $qoo; } -function get_mb_flag($stock_id) -{ - $sql = "SELECT mb_flag FROM ".TB_PREF."stock_master WHERE stock_id = " - .db_escape($stock_id); - $result = db_query($sql, "retreive mb_flag from item"); - - if (db_num_rows($result) == 0) - return -1; - - $myrow = db_fetch_row($result); - return $myrow[0]; -} - //-------------------------------------------------------------------------------------- function add_bom($selected_parent, $component, $workcentre_added, $loc_code, $quantity) @@ -283,7 +270,7 @@ function check_for_recursive_bom($ultimate_parent, $component_to_check) $sql = "SELECT component FROM ".TB_PREF."bom WHERE parent=".db_escape($component_to_check); $result = db_query($sql,"could not check recursive bom"); - if ($result != 0) + if ($result) { while ($myrow = db_fetch_row($result)) { @@ -296,10 +283,9 @@ function check_for_recursive_bom($ultimate_parent, $component_to_check) { return 1; } - } //(while loop) - } //end if $result is true + } + } return 0; -} //end of function check_for_recursive_bom +} -?>