X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Ftransfers.php;h=b04c7d87cd0db347d7f189407a957a23beb2908b;hb=ec51d9a922df61d39de8444cd0a3aaf51ebcbf2b;hp=4ad32ea2451e739b29cfb856f0853a098923cb59;hpb=96ad9190fa3637a41b3161f5b99fc044cbe01867;p=fa-stable.git diff --git a/inventory/transfers.php b/inventory/transfers.php index 4ad32ea2..b04c7d87 100644 --- a/inventory/transfers.php +++ b/inventory/transfers.php @@ -115,17 +115,14 @@ if (isset($_POST['Process'])) display_error(_("The locations to transfer from and to must be different.")); set_focus('FromStockLocation'); $input_error = 1; - } - else + } + elseif (!$SysPrefs->allow_negative_stock()) { - $failed_item = $tr->check_qoh($_POST['FromStockLocation'], $_POST['AdjDate'], true); - if ($failed_item >= 0) + $low_stock = $tr->check_qoh($_POST['FromStockLocation'], $_POST['AdjDate'], true); + + if ($low_stock) { - $line = $tr->line_items[$failed_item]; - display_error(_("The quantity entered is greater than the available quantity for this item at the source location :") . - " " . $line->stock_id . " - " . $line->item_description); - echo "
"; - $_POST['Edit'.$failed_item] = 1; // enter edit mode + display_error(_("The transfer cannot be processed because it would cause negative inventory balance in source location for marked items as of document date or later.")); $input_error = 1; } }