@if($status != 'need_action')

{{ __('Advances') }}

@can('advances create') @endcan
@endif {{-- Filters --}}
{{ __('All') }}
{{-- Table --}}
@php $cols = [ ['key'=>'id', 'label'=>'#'], ['key'=>'employee', 'label'=>__('Employee')], ['key'=>'label', 'label'=>__('Label')], ['key'=>'start_date', 'label'=>__('Start Date')], ['key'=>'months', 'label'=>__('Months')], ['key'=>'amount', 'label'=>__('Amount')], ['key'=>'monthly_amount','label'=>__('Monthly installments')], ['key'=>'status', 'label'=>__('Status')], ['key'=>null, 'label'=>__('File')], ['key'=>null, 'label'=>__('Actions')], ]; @endphp @foreach($cols as $c) @endforeach @forelse($advances as $a) @empty @endforelse
{{-- @if($c['key'])--}} {{-- --}} {{-- @else--}} {{-- {{ $c['label'] }}--}} {{-- @endif--}} {{ $c['label'] }}
{{ $loop->iteration + ($advances->currentPage() - 1) * $advances->perPage() }} {{ $a->employee->name ?? '—' }} {{ $a->label }} {{ $a->start_date?->format('Y-m-d') }} {{ $a->months }} {{ number_format($a->amount,2) }} {{ number_format($a->monthly_amount ?? ($a->amount / max(1,$a->months)),2) }} {{ __(ucfirst($a->status)) }} @if($a->file_url) {{ __('View') }} @else @endif
@can('advances edit') @endcan @can('advances delete') @endcan @can('advances approve') @if($a->status === 'pending') @endif @endcan @can('advances disburse') @if(in_array($a->status, ['approved','disbursed'])) @endif @endcan {{__("View")}}
{{ __('No records found.') }}
{{ $advances->links() }}
{{-- Modal --}}

{{ $isEditMode ? __('Edit Advance') : __('Add Advance') }}

@if ($errors->any())
    @foreach ($errors->all() as $e)
  • {{ $e }}
  • @endforeach
@endif
{{ __('Choose employee') }}
{{--
--}} {{-- --}} {{-- --}} {{--
--}}
@if($existingFile) {{ __('View Existing File') }} @endif