diff --git a/app/Services/HR/LeaveService.php b/app/Services/HR/LeaveService.php index f20e0563..ab4f1181 100644 --- a/app/Services/HR/LeaveService.php +++ b/app/Services/HR/LeaveService.php @@ -500,6 +500,15 @@ public function getBalanceSummary(?int $year = null, ?string $sort = null, ?stri ->with(['user:id,name', 'department:id,name']) ->forTenant($tenantId) ->whereIn('employee_status', $statusFilter) + ->where(function ($q) { + $q->whereDoesntHave('department', function ($dq) { + $dq->where('name', 'like', '%영업팀%'); + })->orWhereNull('department_id'); + }) + ->where(function ($q) { + $q->whereNull('json_extra->is_excluded') + ->orWhere('json_extra->is_excluded', false); + }) ->get(); // (3) 기존 balance 일괄 조회