More fields visible

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2025-04-08 16:17:57 +01:00
parent 548ae49c69
commit ea365e5645
2 changed files with 9 additions and 6 deletions

View file

@ -41,7 +41,7 @@ class TestLocationsFMCS extends Command
$this->newLine(); $this->newLine();
$this->info('Edit your locations to associate them with the correct company.'); $this->info('Edit your locations to associate them with the correct company.');
$header = ['Type', 'Name', 'ID', 'Item Company', 'Company ID', 'Item Location', 'Location Company ID']; $header = ['ID', 'Type', 'Name', 'Checkout Type', 'Company ID', 'Item Company','Item Location', 'Location Company', 'Location Company ID'];
sort($mismatched); sort($mismatched);
$this->table($header, $mismatched); $this->table($header, $mismatched);

View file

@ -1556,14 +1556,14 @@ class Helper
} }
foreach($locations as $location) { foreach($locations as $location) {
// in case of an update of a single location use the newly requested company_id // in case of an update of a single location, use the newly requested company_id
if ($new_company_id) { if ($new_company_id) {
$location_company = $new_company_id; $location_company = $new_company_id;
} else { } else {
$location_company = $location->company_id; $location_company = $location->company_id;
} }
// depending on the relationship, we must use different operations to retrieve the objects // Depending on the relationship, we must use different operations to retrieve the objects
$keywords_relation = [ $keywords_relation = [
'many' => [ 'many' => [
'accessories', 'accessories',
@ -1594,14 +1594,17 @@ class Helper
} }
foreach ($items as $item) { foreach ($items as $item) {
if ($item && $item->company_id != $location_company) { if ($item && $item->company_id != $location_company) {
$mismatched[] = [ $mismatched[] = [
class_basename(get_class($item)),
$item->name,
$item->id, $item->id,
$item->company->name ?? null, class_basename(get_class($item)),
$item->name ?? $item->asset_tag ?? $item->serial ?? $item->username,
str_replace('App\\Models\\', '', $item->assigned_type) ?? null,
$item->company_id ?? null, $item->company_id ?? null,
$item->company->name ?? null,
$item->location->name ?? null, $item->location->name ?? null,
$item->location->company->name ?? null,
$location_company ?? null, $location_company ?? null,
]; ];