We must always test for stock availability by todays date.
authorJoe <unknown>
Fri, 19 Sep 2014 00:04:30 +0000 (02:04 +0200)
committerJoe <unknown>
Fri, 19 Sep 2014 00:04:30 +0000 (02:04 +0200)
sales/sales_order_entry.php

index f73a6d5fd8f5d5feb4ccee9db55fbd93a8b41ace..a147ea7f5925c71aa0625ebd06f13b9e39ef8ed4 100644 (file)
@@ -509,7 +509,7 @@ function check_item_data()
        elseif ($is_inventory_item && $_SESSION['Items']->trans_type!=ST_SALESORDER && $_SESSION['Items']->trans_type!=ST_SALESQUOTE 
                && !$SysPrefs->allow_negative_stock())
        {
-               $qoh = get_qoh_on_date($_POST['stock_id'], $_POST['Location'], $_POST['OrderDate']);
+               $qoh = get_qoh_on_date($_POST['stock_id'], $_POST['Location'], null); // Of course we must always test for stock availability by todays date.
                if (input_num('qty') > $qoh)
                {
                        $stock = get_item($_POST['stock_id']);