- if (!$SysPrefs->allow_negative_stock() && is_inventory_item($stock_item->stock_id) &&
- $order->trans_type != ST_SALESORDER && $order->trans_type!=ST_SALESQUOTE) {
- $qoh = get_qoh_on_date($stock_item->stock_id,
- $_POST['Location'], $_POST['delivery_date']);
- if (($stock_item->qty_dispatched -$stock_item->qty_done) > $qoh)
- {
- // oops, we don't have enough of one of the component items
- start_row("class='stockmankobg'");
- $qoh_msg .= $stock_item->stock_id . " - " . $stock_item->item_description . ": " .
- _("Quantity On Hand") . " = "
- . number_format2($qoh, get_qty_dec($stock_item->stock_id)) . '<br>';
- $has_marked = true;
- } else
- alt_table_row_color($k);
- } else {
+ if (in_array($stock_item->stock_id, $low_stock))
+ start_row("class='stockmankobg'"); // notice low stock status
+ else