@extends('layouts.master') @push('css') @endpush @section('content')

Employee Advances (ملازمین ایڈوانسز)

ملازمین کے ایڈوانس کھاتوں اور بقایا جات کا خلاصہ
@if(session('success')) @endif @if(isset($errors) && $errors->any()) @endif {{-- Overall Summary KPIs --}}
کل ملازمین
{{ number_format($overall['total_employees']) }}
ایکٹیو ایڈوانسز
{{ number_format($overall['active_advances']) }}
کل ایڈوانس رقم
Rs. {{ number_format($overall['total_amount'], 0) }}
کل وصولی
Rs. {{ number_format($overall['total_recovered'], 0) }}
کل بقایا رقم (Net Balance)
Rs. {{ number_format($overall['total_balance'], 0) }}
{{-- Search Bar --}}
@if(request('search')) ریسٹ @endif
{{-- Main Employees Summary Table (1 Entry per Employee) --}}
@forelse($employeesWithAdvances as $emp) @php $totalAmt = (float) $emp->advances->sum('amount'); $totalRec = (float) $emp->advances->sum('recovered'); $balance = $totalAmt - $totalRec; $monthlyDed = (float) $emp->advances->where('status', 'active')->sum('monthly_deduction'); $activeCount = $emp->advances->where('status', 'active')->count(); $totalCount = $emp->advances->count(); $initials = strtoupper(substr($emp->first_name, 0, 1) . substr($emp->last_name ?? '', 0, 1)); @endphp @empty @endforelse
# Employee (ملازم) Advances Count Total Advance Recovered Remaining Balance Monthly Deduction Status Actions
{{ $loop->iteration + ($employeesWithAdvances->currentPage() - 1) * $employeesWithAdvances->perPage() }}
{{ $initials }}
{{ $emp->first_name }} {{ $emp->last_name }}
{{ $emp->employee_no ?? ('EMP-' . $emp->id) }} @if($emp->department) {{ $emp->department->department_name ?? ($emp->department->name ?? '') }} @endif @if($emp->designation) • {{ $emp->designation->designation_name ?? ($emp->designation->title ?? ($emp->designation->name ?? '')) }} @endif
{{ $totalCount }} Total @if($activeCount > 0) {{ $activeCount }} Active @else All Clear @endif {{ number_format($totalAmt, 0) }} {{ number_format($totalRec, 0) }} {{ number_format($balance, 0) }} {{ number_format($monthlyDed, 0) }} @if($balance > 0) Active (جاری) @else Cleared (مکمل) @endif
کوئی ایڈوانس ریکارڈ نہیں ملا۔ نیا ایڈوانس شامل کرنے کے لیے اوپر دیے گئے بٹن پر کلک کریں۔
Showing {{ $employeesWithAdvances->firstItem() ?? 0 }} to {{ $employeesWithAdvances->lastItem() ?? 0 }} of {{ $employeesWithAdvances->total() }} employees
{{ $employeesWithAdvances->links() }}
{{-- ══════════════════════════════════════════════════════════════════════════ --}} {{-- EMPLOYEE ADVANCES VIEW MODALS (One Modal per Employee) --}} {{-- ══════════════════════════════════════════════════════════════════════════ --}} @foreach($employeesWithAdvances as $emp) @php $empTotalAmt = (float) $emp->advances->sum('amount'); $empTotalRec = (float) $emp->advances->sum('recovered'); $empBalance = $empTotalAmt - $empTotalRec; $empMonthlyDed = (float) $emp->advances->where('status', 'active')->sum('monthly_deduction'); @endphp @endforeach {{-- ══════════════════════════════════════════════════════════════════════════ --}} {{-- EDIT ADVANCE MODALS (One Modal per Individual Advance) --}} {{-- ══════════════════════════════════════════════════════════════════════════ --}} @foreach($employeesWithAdvances as $emp) @foreach($emp->advances as $adv) @endforeach @endforeach {{-- ══════════════════════════════════════════════════════════════════════════ --}} {{-- ADD NEW ADVANCE MODAL --}} {{-- ══════════════════════════════════════════════════════════════════════════ --}} @endsection @push('scripts') @endpush