+ } // Joe Hunt added 2008-09-22 -------------------------
+ elseif ($_SESSION['Items']->trans_type!=30 && !sys_prefs::allow_negative_stock() &&
+ is_inventory_item($_POST['stock_id']))
+ {
+ $qoh = get_qoh_on_date($_POST['stock_id'], $_POST['Location'], $_POST['OrderDate']);
+ if (input_num('qty') > $qoh)
+ {
+ $stock = get_item($_POST['stock_id']);
+ display_error(_("The delivery cannot be processed because there is an insufficient quantity for item:") .
+ " " . $stock['stock_id'] . " - " . $stock['description'] . " - " .
+ _("Quantity On Hand") . " = " . number_format2($qoh, get_qty_dec($_POST['stock_id'])));
+ return false;
+ }
+ return true;