@extends('layouts.app') @section('title', 'Salary Advance') @section('page', 'payroll') @section('payrollNav', 'advances') @php $statusVariant = fn ($s) => $s === 'Active' ? 'success' : 'danger'; @endphp @section('content') @include('partials.account-payroll-nav') @if (session('success')) {{ session('success') }} @endif @if ($errors->any()) {{ $errors->first() }} @endif @if ($canManage ?? false) @endif

Total Advances

{{ money($totalAdvances) }}

Active records

@forelse ($advances as $row) {{ $row->advance_date?->format('Y-m-d') ?? '—' }} {{ $row->staff?->name ?? '—' }} {{ money((float) $row->amount) }} @if ($row->pay_from === 'cash_book') {{ $row->cashBook?->name ?? 'Cash' }} @else {{ $row->bankAccount?->name ?? 'Bank' }} @endif {{ $row->notes ?: '—' }} {{ $row->status }} @if ($canManage ?? false)
@endif @empty No salary advances yet. @endforelse
@if ($canManage ?? false) @endif @endsection @push('styles') @endpush @push('scripts') @endpush