Layout bug in sales_order_view. Column Comments renamed to Cust Order Ref
[fa-stable.git] / sales / includes / ui / sales_order_ui.inc
index 8006018a92c78120deb5f73108ca0aef42c0017f..2508c11b5429067896ffdeddaa50f2874e05cf11 100644 (file)
@@ -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)) . '<br>';
-                               $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)) . '<br>';
+                                       $has_marked = true;
+                                } else 
+                                       alt_table_row_color($k);
                        } else {
                                alt_table_row_color($k);
                        }
@@ -246,7 +246,8 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group
        if (isset($order) && !$editable)
        {
                // can't change the customer/branch if items already received on this order
-               echo $order->customer_name . " - " . $order->deliver_to;
+               //echo $order->customer_name . " - " . $order->deliver_to;
+               label_row(null, $order->customer_name . " - " . $order->deliver_to);
                hidden('customer_id', $order->customer_id);
                hidden('branch_id', $order->Branch);
                hidden('sales_type', $order->sales_type);