From 7a1b93d8d75faa011f16337cdf1b270c8d3d21bc Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Mon, 30 Mar 2009 10:22:58 +0000 Subject: [PATCH] qoh checks only with allow_negative_stock off --- sales/includes/ui/sales_order_ui.inc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sales/includes/ui/sales_order_ui.inc b/sales/includes/ui/sales_order_ui.inc index 8006018a..af71bed1 100644 --- a/sales/includes/ui/sales_order_ui.inc +++ b/sales/includes/ui/sales_order_ui.inc @@ -164,19 +164,19 @@ function display_order_summary($title, &$order, $editable_items=false) $qoh_msg = ''; if (!$editable_items || $id != $line_no) { - if (is_inventory_item($stock_item->stock_id)) { + if (!sys_prefs::allow_negative_stock() && is_inventory_item($stock_item->stock_id)) { $qoh = get_qoh_on_date($stock_item->stock_id, $_POST['Location'], $_POST['OrderDate']); - if ($stock_item->qty_dispatched > $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)) . '
'; - $has_marked = true; - } else - alt_table_row_color($k); + if ($stock_item->qty_dispatched > $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)) . '
'; + $has_marked = true; + } else + alt_table_row_color($k); } else { alt_table_row_color($k); } -- 2.30.2