X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=manufacturing%2Fwork_order_entry.php;h=049ab914527e0609b0de9e24ad6e0f3276dfc09e;hb=2b6719b3bfbbb17196ec03480d4d11c5be6bbab9;hp=f5e90d10c55ed299bd5920610911a3912880b072;hpb=40da959b32eb27fcb0422207a284eed13cc27d7e;p=fa-stable.git diff --git a/manufacturing/work_order_entry.php b/manufacturing/work_order_entry.php index f5e90d10..049ab914 100644 --- a/manufacturing/work_order_entry.php +++ b/manufacturing/work_order_entry.php @@ -203,8 +203,7 @@ function can_process() $quantity = $bom_item["quantity"] * input_num('quantity'); - $qoh = get_qoh_on_date($bom_item["component"], $bom_item["loc_code"], $_POST['date_']); - if (-$quantity + $qoh < 0) + if (check_negative_stock($bom_item["component"], -$quantity, $bom_item["loc_code"], $_POST['date_'])) { display_error(_("The work order cannot be processed because there is an insufficient quantity for component:") . " " . $bom_item["component"] . " - " . $bom_item["description"] . ". " . _("Location:") . " " . $bom_item["location_name"]); @@ -217,8 +216,7 @@ function can_process() elseif ($_POST['type'] == WO_UNASSEMBLY) { // if unassembling, check item to unassemble - $qoh = get_qoh_on_date($_POST['stock_id'], $_POST['StockLocation'], $_POST['date_']); - if (-input_num('quantity') + $qoh < 0) + if (check_negative_stock($_POST['stock_id'], -input_num('quantity'), $_POST['StockLocation'], $_POST['date_'])) { display_error(_("The selected item cannot be unassembled because there is insufficient stock.")); return false;