Sales quotation and Sales order should not require sufficient stock.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 9 Nov 2012 08:58:55 +0000 (09:58 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 9 Nov 2012 08:58:55 +0000 (09:58 +0100)
sales/includes/ui/sales_order_ui.inc

index 9cb6c363e0a9ffd2c6ffd0432c942f8efb14d002..0ace8627c9e1706db58ab691fbc2a03af5eb8fc2 100644 (file)
@@ -168,7 +168,8 @@ function display_order_summary($title, &$order, $editable_items=false)
                $qoh_msg = '';
                if (!$editable_items || $id != $line_no)
                {
-                       if (!$SysPrefs->allow_negative_stock() && is_inventory_item($stock_item->stock_id)) {
+                       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)