{{ __('app.hr.advance.title') }}

{{ __('app.hr.advance.desc') }}

@can('staff_advances.create') {{ __('app.hr.advance.request') }} @endcan
@if ($notice) {{ $notice }} @endif @if ($errors->any())
    @foreach ($errors->all() as $message)
  • {{ $message }}
  • @endforeach
@endif @if ($showForm)
@foreach ($staff as $profile) @endforeach
{{ __('app.actions.cancel') }} {{ __('app.hr.advance.request') }}
@endif @if ($disbursing)
@if ($destination === 'cash') @foreach ($cashAccounts as $account) @endforeach @else @foreach ($bankAccounts as $account) @endforeach @endif
{{ __('app.actions.cancel') }} {{ __('app.hr.advance.disburse') }}
@endif @if ($cancelling)
{{ __('app.actions.cancel') }} {{ __('app.hr.advance.cancel') }}
@endif
@foreach ($statuses as $status) @endforeach
@forelse ($advances as $advance) @empty @endforelse
{{ __('app.hr.fields.employee') }} {{ __('app.hr.fields.amount') }} {{ __('app.hr.fields.monthly_installment') }} {{ __('app.hr.advance.outstanding') }} {{ __('app.hr.fields.status') }} {{ __('app.hr.advance.requested_on') }} {{ __('app.hr.advance.disbursed_on') }} {{ __('app.hr.payroll.voucher') }} {{ __('app.actions.view') }}
{{ $advance->staffProfile?->user?->name ?? '—' }} {{ $advance->staffProfile?->employee_no }} · {{ $advance->reason }} {{ number_format((float) $advance->amount, 2) }} {{ number_format((float) $advance->monthly_installment, 2) }} {{ number_format($advance->outstanding(), 2) }} {{ __('app.hr.advance.recovered') }}: {{ number_format((float) $advance->recovered_amount, 2) }} @php($advanceColor = match ($advance->status) { \App\Enums\AdvanceStatus::Pending => 'gold', \App\Enums\AdvanceStatus::Approved => 'maroon', \App\Enums\AdvanceStatus::Disbursed => 'green', \App\Enums\AdvanceStatus::Recovered => 'green', \App\Enums\AdvanceStatus::Cancelled => 'slate', }) {{ $advance->status->label() }} {{ $advance->created_at?->translatedFormat('d M Y') }} {{ $advance->disbursed_on?->translatedFormat('d M Y') ?? '—' }} {{ $advance->voucher?->voucher_no ?? '—' }}
@if ($advance->isPending() && $advance->staffProfile?->user_id !== auth()->id()) @can('staff_advances.approve') {{ __('app.hr.advance.approve') }} @endcan @endif @if ($advance->isApproved()) @can('staff_advances.disburse') {{ __('app.hr.advance.disburse') }} @endcan @endif @if (in_array($advance->status, [\App\Enums\AdvanceStatus::Pending, \App\Enums\AdvanceStatus::Approved], true)) @can('staff_advances.cancel') {{ __('app.hr.advance.cancel') }} @endcan @endif
@if ($advances->hasPages())
{{ $advances->links() }}
@endif