- } // Joe Hunt added 2008-09-22 -------------------------
- elseif ($is_inventory_item && $_SESSION['Items']->trans_type!=ST_SALESORDER && $_SESSION['Items']->trans_type!=ST_SALESQUOTE
- && !$SysPrefs->allow_negative_stock())
- {
- $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;