diff --git a/app/Console/Commands/TestLocationsFMCS.php b/app/Console/Commands/TestLocationsFMCS.php index 488cca011..d71c41f96 100644 --- a/app/Console/Commands/TestLocationsFMCS.php +++ b/app/Console/Commands/TestLocationsFMCS.php @@ -38,8 +38,10 @@ class TestLocationsFMCS extends Command $mismatched = Helper::test_locations_fmcs(true, $location_id); $this->warn(trans_choice('admin/settings/message.location_scoping.mismatch', count($mismatched))); + $this->newLine(); + $this->info('Edit your locations to associate them with the correct company.'); - $header = ['Item Type', 'Item ID', 'Item Company ID', 'Location Company ID']; + $header = ['Type', 'Name', 'ID', 'Item Company', 'Company ID', 'Item Location', 'Location Company ID']; sort($mismatched); $this->table($header, $mismatched); diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php index 546d72735..e5857fe4a 100644 --- a/app/Helpers/Helper.php +++ b/app/Helpers/Helper.php @@ -1597,9 +1597,12 @@ class Helper if ($item && $item->company_id != $location_company) { $mismatched[] = [ class_basename(get_class($item)), + $item->name, $item->id, - $item->company_id, - $location_company ?? 'null', + $item->company->name ?? null, + $item->company_id ?? null, + $item->location->name ?? null, + $location_company ?? null, ]; } diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index feca50ddd..a6de4466d 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -327,7 +327,7 @@ class SettingsController extends Controller if ($old_locations_fmcs == '0' && $setting->scope_locations_fmcs == '1') { $mismatched = Helper::test_locations_fmcs(false); if (count($mismatched) != 0) { - return redirect()->back()->withInput()->with('error', trans_choice('admin/settings/message.location_scoping.mismatch', count($mismatched))); + return redirect()->back()->withInput()->with('error', trans_choice('admin/settings/message.location_scoping.mismatch', count($mismatched)).' '.trans('admin/settings/message.location_scoping.not_saved')); } } diff --git a/resources/lang/en-US/admin/settings/message.php b/resources/lang/en-US/admin/settings/message.php index 9a0313f29..8d9b40e95 100644 --- a/resources/lang/en-US/admin/settings/message.php +++ b/resources/lang/en-US/admin/settings/message.php @@ -53,7 +53,8 @@ return [ ], 'location_scoping' => [ - 'mismatch' => 'There is 1 item in the database that need your attention before you can enable location scoping. Your settings were not saved.| There are :count items in the database that need your attention before you can enable location scoping. Your settings were not saved.', + 'not_saved' => 'Your settings were not saved.', + 'mismatch' => 'There is 1 item in the database that need your attention before you can enable location scoping.|There are :count items in the database that need your attention before you can enable location scoping.', ], ];