Staff Payment History

@if ($paidLeaveDays > 0)

Paid Leave Applied: {{ $paidLeaveDays }} day(s) — ₹ {{ number_format($paidLeaveAmount, 2) }} added to salary

@endif @foreach($rows as $i => $row) @php $advances = \App\Models\AdvanceSalary::where('staff_id', $row->staff_id) ->whereDate('date', $row->attendance_date) ->pluck('amount'); @endphp @endforeach @if ($paidLeaveDays > 0) @endif
# Date Attendance Calculated Salary Advance Received
{{ $i + 1 }} {{ \Carbon\Carbon::parse($row->attendance_date)->format('d-m-Y') }} {{ ucfirst($row->attendance_type) }} {{ number_format($row->display_salary, 2) }} {{ $advances->isEmpty() ? '-' : $advances->implode(' + ') }}
Total {{ number_format($rows->sum('display_salary'), 2) }} {{ number_format($rows->sum('advance_received'), 2) }}
+ Paid Leave ({{ $paidLeaveDays }} day(s)): ₹ {{ number_format($paidLeaveAmount, 2) }}
Grand Total (Salary + Paid Leave − Advance) ₹ {{ number_format($rows->sum('display_salary') + $paidLeaveAmount - $rows->sum('advance_received'), 2) }}