From f5b7842870b13bc956b7b9613aa4f937407fc0b1 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Thu, 27 Jun 2019 14:29:13 +0200 Subject: [PATCH] Inventory Adjustment: fixed error in adjustment entry when inventory notifications are switched on. --- inventory/includes/db/items_adjust_db.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inventory/includes/db/items_adjust_db.inc b/inventory/includes/db/items_adjust_db.inc index 605206cb..9a45e0f7 100644 --- a/inventory/includes/db/items_adjust_db.inc +++ b/inventory/includes/db/items_adjust_db.inc @@ -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, -- 2.30.2