A free open source IT asset/license management system
last rename
Godfrey Md217c2e2950e
diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.phpindex a51c957c5a..26301c1010 100644--- a/app/Helpers/Helper.php+++ b/app/Helpers/Helper.php@@ -1535,7 +1535,7 @@ class Helper{if (!$license->reassignable) {- $count = LicenseSeat::where('reassignable_seat', '=', true)+ $count = LicenseSeat::where('unreassignable_seat', '=', true)->where('license_id', '=', $license->id)->count();return $count;diff --git a/app/Http/Controllers/Api/LicenseSeatsController.php b/app/Http/Controllers/Api/LicenseSeatsController.phpindex 5115523c2e..38f8babf9d 100644--- a/app/Http/Controllers/Api/LicenseSeatsController.php+++ b/app/Http/Controllers/Api/LicenseSeatsController.php@@ -119,7 +119,7 @@ class LicenseSeatsController extends Controller// nothing to updatereturn response()->json(Helper::formatStandardApiResponse('success', $licenseSeat, trans('admin/licenses/message.update.success')));}- if( $touched && $licenseSeat->reassignable_seat) {+ if( $touched && $licenseSeat->unreassignable_seat) {return response()->json(Helper::formatStandardApiResponse('error', $licenseSeat, trans('admin/licenses/message.checkout.unavailable')));}// the logging functions expect only one "target". if both asset and user are present in the request,@@ -140,7 +140,7 @@ class LicenseSeatsController extends Controllerif ($is_checkin) {$licenseSeat->logCheckin($target, $request->input('note'));if(!$licenseSeat->license->reassignable){- $licenseSeat->reassignable_seat = true;+ $licenseSeat->unreassignable_seat = true;$licenseSeat->save();}diff --git a/app/Http/Controllers/Licenses/LicenseCheckinController.php b/app/Http/Controllers/Licenses/LicenseCheckinController.phpindex 6553b9ab12..8bd3e34f11 100644--- a/app/Http/Controllers/Licenses/LicenseCheckinController.php+++ b/app/Http/Controllers/Licenses/LicenseCheckinController.php@@ -96,7 +96,7 @@ class LicenseCheckinController extends Controller$licenseSeat->asset_id = null;$licenseSeat->notes = $request->input('notes');if (! $licenseSeat->license->reassignable) {- $licenseSeat->reassignable_seat = true;+ $licenseSeat->unreassignable_seat = true;$licenseSeat->notes .= "\n" . trans('admin/licenses/message.checkin.not_reassignable') . '.';}diff --git a/app/Http/Controllers/Licenses/LicensesController.php b/app/Http/Controllers/Licenses/LicensesController.phpindex 8ddac020b5..f963535375 100755--- a/app/Http/Controllers/Licenses/LicensesController.php+++ b/app/Http/Controllers/Licenses/LicensesController.php@@ -251,7 +251,7 @@ class LicensesController extends Controller$total_seats_count = (int) $license->totalSeatsByLicenseID();$available_seats_count = $license->availCount()->count();$unreassignable_seats_count = Helper::unReassignableCount($license);- if(!$license->reassignable){+ if(!$license->unreassignable_seat){$checkedout_seats_count = ($total_seats_count - $available_seats_count - $unreassignable_seats_count );}else {diff --git a/app/Http/Transformers/LicenseSeatsTransformer.php b/app/Http/Transformers/LicenseSeatsTransformer.phpindex ec74d74326..e882e74a88 100644--- a/app/Http/Transformers/LicenseSeatsTransformer.php+++ b/app/Http/Transformers/LicenseSeatsTransformer.php@@ -49,7 +49,7 @@ class LicenseSeatsTransformer'reassignable' => (bool) $seat->license->reassignable,'notes' => e($seat->notes),'user_can_checkout' => (($seat->assigned_to == '') && ($seat->asset_id == '')),- 'disabled' => $seat->reassignable_seat,+ 'disabled' => $seat->unreassignable_seat,];if ($seat_count != 0) {diff --git a/app/Models/License.php b/app/Models/License.phpindex b6fef33e1e..0b5eed097a 100755--- a/app/Models/License.php+++ b/app/Models/License.php@@ -653,7 +653,7 @@ class License extends Depreciable{return $this->licenseseats()->whereNull('deleted_at')- ->where('reassignable_seat', '=', false)+ ->where('unreassignable_seat', '=', false)->where(function ($query) {$query->whereNull('assigned_to')->whereNull('asset_id');diff --git a/database/factories/LicenseSeatFactory.php b/database/factories/LicenseSeatFactory.phpindex 09ea283d0c..ee516b6dac 100644--- a/database/factories/LicenseSeatFactory.php+++ b/database/factories/LicenseSeatFactory.php@@ -14,7 +14,7 @@ class LicenseSeatFactory extends Factory{return ['license_id' => License::factory(),- 'reassignable_seat' => false,+ 'unreassignable_seat' => false,];}diff --git a/database/migrations/2025_01_15_190348_adds_unavailable_to_license_seats_tables.php b/database/migrations/2025_01_15_190348_adds_unavailable_to_license_seats_tables.phpindex 334104d40e..9aec0343ac 100644--- a/database/migrations/2025_01_15_190348_adds_unavailable_to_license_seats_tables.php+++ b/database/migrations/2025_01_15_190348_adds_unavailable_to_license_seats_tables.php@@ -14,7 +14,7 @@ return new class extends Migrationpublic function up(): void{Schema::table('license_seats', function (Blueprint $table) {- $table->addColumn('boolean', 'reassignable_seat')->default(false)->after('assigned_to');+ $table->addColumn('boolean', 'unreassignable_seat')->default(false)->after('assigned_to');});}/**@@ -23,7 +23,7 @@ return new class extends Migrationpublic function down(): void{Schema::table('license_seats', function (Blueprint $table) {- $table->dropColumn('reassignable_seat');+ $table->dropColumn('unreassignable_seat');});}};diff --git a/tests/Feature/Checkins/Ui/LicenseCheckinTest.php b/tests/Feature/Checkins/Ui/LicenseCheckinTest.phpindex d43ccb593d..3c00d37071 100644--- a/tests/Feature/Checkins/Ui/LicenseCheckinTest.php+++ b/tests/Feature/Checkins/Ui/LicenseCheckinTest.php@@ -32,7 +32,7 @@ class LicenseCheckinTest extends TestCase$licenseSeat->refresh();- $this->assertEquals(1, $licenseSeat->reassignable_seat);+ $this->assertEquals(1, $licenseSeat->unreassignable_seat);}public function testCannotCheckinLicenseThatIsNotAssigned()