[0005213] Additional cleanup.
[fa-stable.git] / inventory / includes / db / items_adjust_db.inc
index 605206cbd97bf9569617575f839f3b5132cd1deb..7dc541032cf69ad9e3890fd6d2307e326bdf19cd 100644 (file)
@@ -33,10 +33,12 @@ function add_stock_adjustment($items, $location, $date_, $reference, $memo_)
        foreach ($items as $line_item)
        {
 
-               if ($SysPrefs->loc_notification() == 1 && $line_item->qty < 0)
+               if ($SysPrefs->loc_notification() == 1 && $line_item->quantity < 0)
                {
-                       $chg = $line; $chg->qty = -$chg->qty;   // calculate_reorder_level expect positive qty
-                       $loc = calculate_reorder_level($location, $line_item, $st_ids, $st_names, $st_num, $st_reorder); 
+                       $tmp = $line_item->quantity;
+                       $line_item->quantity = -$line_item->quantity;   // calculate_reorder_level expect positive qty
+                       $loc = calculate_reorder_level($location, $line_item, $st_ids, $st_names, $st_num, $st_reorder);
+                       $line_item->quantity = $tmp;
                }
 
                add_stock_adjustment_item($adj_id, $line_item->stock_id, $location, $date_, $reference,