Inventory Adjustment: fixed error in adjustment entry when inventory notifications...
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 27 Jun 2019 12:29:13 +0000 (14:29 +0200)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 27 Jun 2019 12:29:13 +0000 (14:29 +0200)
inventory/includes/db/items_adjust_db.inc

index 605206cbd97bf9569617575f839f3b5132cd1deb..9a45e0f7d02c077a10157a07d1e0a8ca7c02b33f 100644 (file)
@@ -33,10 +33,10 @@ 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); 
+                       $chg = $line_item; $chg->quantity= -$chg->quantity;     // calculate_reorder_level expect positive qty
+                       $loc = calculate_reorder_level($location, $chg, $st_ids, $st_names, $st_num, $st_reorder); 
                }
 
                add_stock_adjustment_item($adj_id, $line_item->stock_id, $location, $date_, $reference,