0001309: Insufficient Quantities "Red Marker" doesn't take into account dispatched...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 22 Jan 2012 22:23:51 +0000 (23:23 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 22 Jan 2012 22:23:51 +0000 (23:23 +0100)
sales/includes/ui/sales_order_ui.inc

index 841294de4ec3eb03b97c46405454cb844e59ace4..272429289287d13e1e5f3c07bbbb9d4ee2a80e4e 100644 (file)
@@ -167,7 +167,7 @@ function display_order_summary($title, &$order, $editable_items=false)
                        if (!$SysPrefs->allow_negative_stock() && is_inventory_item($stock_item->stock_id)) {
                                $qoh = get_qoh_on_date($stock_item->stock_id, 
                                        $_POST['Location'], $_POST['delivery_date']);
-                               if ($stock_item->qty_dispatched > $qoh) 
+                               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'");