@use('App\Enums\PermissionName') @use('App\Enums\RoleName') @use('App\Models\Payment') @php $currency = $user->currency(); @endphp

{{ __('User details') }}

{{ __('Back to users') }}
@if ($account) {{ __('All payments') }} @endif @can(PermissionName::CreatePayments->value) {{ __('Record payment') }} @endcan @if ($canUpdate) {{ __('Edit') }} @endif
{{ $user->name }}
{{ $user->designation() }}
{{ $user->employee_id ?? '—' }}
@foreach ($user->roles as $role) {{ RoleName::labelFor($role->name) }} @endforeach
{{ __('Email') }}
{{ $user->email }}
{{ __('Phone') }}
{{ $user->phone ?? '—' }}
{{ __('Location') }}
{{ $user->location?->name ?? __('No location') }} {{ $user->location ? $user->location->place().' · ' : '' }}{{ __('Paid in :currency', ['currency' => $currency->value]) }}
{{ __('Date of birth') }}
{{ $user->date_of_birth?->format('d F Y') ?? '—' }}
{{ __('Address') }}
{{ collect([$user->address, $user->city, $user->country])->filter()->implode(', ') ?: '—' }}
{{ __('Emergency contact') }}
{{ $user->emergency_contact_name ?? '—' }} @if ($user->emergency_contact_phone) {{ $user->emergency_contact_phone }} @endif
{{ __('Added') }}
{{ $user->created_at->format('d M Y') }} {{ __('Last updated :date', ['date' => $user->updated_at->format('d M Y')]) }}
@if ($account)
@include('payments.partials.ledger', ['employee' => $user, 'ledger' => $account['ledger'], 'thisMonth' => $account['thisMonth']])

{{ __('Paid by type') }}

{{ __('Everything paid so far, all time.') }}

@if ($account['by_type']->isEmpty())

{{ __('Nothing paid yet.') }}

@else
@foreach (\App\Enums\PaymentType::cases() as $type) @if ($account['by_type']->has($type->value))
{{ $type->label() }}
{{ $account['by_type'][$type->value] }}
@endif @endforeach
{{ __('Total') }}
{{ $account['paid_total'] }}
@endif
@include('payments.partials.salary-history', ['employee' => $user, 'editUrl' => $canUpdate ? route('users.edit', $user).'#salary' : null])

{{ __('Latest payments') }}

{{ __('The most recent ones. The full list, with filters, is under All payments.') }}

{{ __('All payments') }}
@if ($account['recent']->isEmpty())

{{ __('No payments recorded yet.') }}

@else
@foreach ($account['recent'] as $payment) @endforeach
{{ __('Type') }} {{ __('Amount') }} {{ __('Paid via') }} {{ __('Date') }} {{ __('Status') }} {{ __('Actions') }}
{{ $payment->type->label() }} @include('payments.partials.table-amount') @include('payments.partials.table-method') @include('payments.partials.table-date') {{ $payment->status->label() }} {{ __('View') }}
@endif
@endif