Skip to content

Commit

Permalink
Merge pull request #3723 from ColoredCow/master
Browse files Browse the repository at this point in the history
Release 2 Oct
  • Loading branch information
GauravGusain98 authored Oct 2, 2024
2 parents 1cdb70e + d650548 commit f9c12fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Services/EmployeeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public function index($filters = [])
$employees = Employee::applyFilters($filters)
->leftJoin('project_team_members', 'employees.user_id', '=', 'project_team_members.team_member_id')
->leftJoin('projects', 'project_team_members.project_id', '=', 'projects.id')
->selectRaw('employees.*, team_member_id, count(case when projects.status = "active" and project_team_members.ended_on is null then 1 else null end) as active_project_count')
->leftJoin('clients', 'projects.client_id', '=', 'clients.id')
->selectRaw('employees.*, team_member_id, count(case when projects.status = "active" and project_team_members.ended_on is null then 1 else null end) as active_project_count, count(distinct case when clients.status = "active" and project_team_members.ended_on is null then clients.id else null end) as active_clients_count')
->groupBy('employees.user_id')
->orderby('active_project_count', 'desc')
->get();
Expand Down
8 changes: 8 additions & 0 deletions resources/views/hr/employees/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<th>Name</th>
@if($routeName === "employees")
<th>Active Projects Count</th>
<th>Active Clients Count</th>
<th>
Overall FTE
<span class="tooltip-wrapper" data-html="true" data-toggle="tooltip" title="Total FTE for the current month">
Expand Down Expand Up @@ -88,6 +89,13 @@ class="{{ config('constants.review-tags.completed.class') }} badge-pill mr-1 mb-
{{ $employee->active_project_count }}
@endif
</td>
<td>
@if ($employee->user == null)
0
@else
{{ $employee->active_clients_count }}
@endif
</td>
@if(today()==today()->startOfMonth())
<td>{{ 0 }}</td>
@else
Expand Down

0 comments on commit f9c12fe

Please sign in to comment.