From 9315d56408e41c31bd3098b00e8a69dcc342e44a Mon Sep 17 00:00:00 2001 From: Doug Hutcheson Date: Sun, 14 Jan 2024 07:07:37 +0800 Subject: [PATCH] ci4-bugfix to stock locations and item csv import Stock locations are now being handled correctly in the Configuration stock page, due to a fix to Models/Stock_locations.php and imports to stock locations from csv are now working due to a correction to Controllers/Items.php --- app/Controllers/Items.php | 4 ++-- app/Models/Stock_location.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Controllers/Items.php b/app/Controllers/Items.php index 43d03d1d9..bdbf8f551 100644 --- a/app/Controllers/Items.php +++ b/app/Controllers/Items.php @@ -1216,11 +1216,11 @@ class Items extends Secure_Controller 'Tax 2 Percent' => $row['Tax 2 Percent'] ]; -/* foreach($allowed_locations as $location_name) + foreach($allowed_locations as $location_name) { $check_for_numeric_values[] = $row["location_$location_name"]; } - */ + //Check for non-numeric values which require numeric foreach($check_for_numeric_values as $key => $value) { diff --git a/app/Models/Stock_location.php b/app/Models/Stock_location.php index f627b6e0f..dff255032 100644 --- a/app/Models/Stock_location.php +++ b/app/Models/Stock_location.php @@ -255,7 +255,7 @@ class Stock_location extends Model $this->employee = model('Employee'); // Retrieve the menu_group assigned to the grant for the module and use that for the new stock locations - $menu_group = $employee->get_menu_group($module, $employee['person_id']); + $menu_group = $this->employee->get_menu_group($module, $employee['person_id']); $grants_data = ['permission_id' => $permission_id, 'person_id' => $employee['person_id'], 'menu_group' => $menu_group];