Skip to content

A free open source IT asset/license management system

removes empty seats when sorting by department

Godfrey M249ff868e5e0
diff --git a/app/Models/LicenseSeat.php b/app/Models/LicenseSeat.php
index 8a51c0c9cf..397a141468 100755
--- a/app/Models/LicenseSeat.php
+++ b/app/Models/LicenseSeat.php
@@ -126,6 +126,7 @@ class LicenseSeat extends SnipeModel implements ICompanyableChild
{
return $query->leftJoin('users as license_seat_users', 'license_seats.assigned_to', '=', 'license_seat_users.id')
->leftJoin('departments as license_user_dept', 'license_user_dept.id', '=', 'license_seat_users.department_id')
+ ->whereNotNull('license_seats.assigned_to')
->orderBy('license_user_dept.name', $order);
}
}