@extends('global.app') @section('title', trans('policies.title.one')) @section('page_stylesheets') @endsection @section('extra_stylesheets') @endsection @section('profile_bar')
@if ($policy->client->profile_image_filename === 'default-profile.jpg')
{{ strtoupper($policy->client->first_name[0] . $policy->client->last_name[0]) }}
@else {{ $policy->client->first_name . ' ' . $policy->client->last_name }} @endif

{{ $policy->client->first_name . ' ' . $policy->client->last_name }}

@if ($policy->client->password === 'InsuraPasswordsAreLongButNeedToBeSetByInvitedUsersSuchAsThis') {{ trans('clients.status.inactive') }} @else {{ trans('clients.status.active') }} @endif @yield('client_action')
{{ trans('clients.label.email') }}

{{ $policy->client->email }}

{{ trans('clients.label.phone') }}

{{ $policy->client->phone }}

{{ trans('clients.label.birthday') }}

{{ is_null($policy->client->birthday) ? '---------- --, ----' : date('jS F Y', strtotime($policy->client->birthday)) }}

{{ trans('clients.label.address') }}

{{ $policy->client->address or '. . .' }}

@endsection @section('content') @parent
@include('global.status')

{{ trans('policies.label.details') }}

@yield('policy_actions')
{{ trans('policies.label.ref_no') }}

{{ $policy->ref_no }}

{{ trans('policies.label.product') }}

{{ $policy->product->name }}

{{ trans("policies.ribbon.type.{$policy->type}") }}
{{ trans('policies.label.renewal') }}

{{ date('F d, Y', strtotime($policy->renewal)) }}

{{ trans('policies.label.expiry') }}

{{ date('F d, Y', strtotime($policy->expiry)) }}

{{ trans('policies.label.payer') }}

{{ $policy->payer }}

{{ trans('policies.label.premium') }}

{{ $policy->currency_symbol }}{{ $policy->premium }}

@if ($policy->premium <= $policy->paid && $policy->paid > 0) {{ trans('policies.label.paid_in_full') }} @elseif ($policy->due > 0 && $policy->active) {{ trans('policies.label.due') }} - {{ $policy->currency_symbol }}{{ $policy->due }} @elseif ($policy->due > 0 && !$policy->active) {{ trans('policies.label.expired_and_due') }} - {{ $policy->currency_symbol }}{{ $policy->due }} @elseif ($policy->premium == $policy->paid && $policy->paid === 0) {{ trans('policies.label.free') }} @endif
{{ trans('policies.label.beneficiaries') }}

{{ $policy->beneficiaries }}

{{ trans('policies.label.special_remarks') }}

{!! $policy->special_remarks !!}

@foreach ($policy->customFields->all() as $custom_field)
{{ $custom_field->label }}

{{ is_object($custom_field->value) ? $custom_field->value->choice : $custom_field->value }}

@endforeach

{{ trans('policies.table.title.attachments') }}

@forelse($policy->attachments as $attachment) @empty @endforelse
{{ trans('policies.table.header.file') }} {{ trans('policies.table.header.date') }} {{ trans('policies.table.header.uploader') }} {{ trans('policies.table.header.actions') }}
{{ $attachment->name }} {{ date('F d, Y', strtotime($attachment->created_at)) }} {{ $attachment->uploader->first_name . ' ' . $attachment->uploader->last_name }} {{ trans('policies.table.data.action.view') }}
{{ csrf_field() }} {{ method_field('DELETE') }}
{{ trans('policies.table.message.empty.attachments', array( 'policy' => $policy->ref_no )) }}

{{ trans('policies.table.title.payments') }}

@if($policy->due > 0) @yield('payments_button') @endif
@forelse($policy->payments as $key => $payment) @empty @endforelse
{{ trans('policies.table.header.number') }} {{ trans('policies.table.header.amount') }} {{ trans('policies.table.header.date') }} {{ trans('policies.table.header.method') }}
{{ $key + 1 }} {{ $policy->client->currency_symbol }}{{ $payment->amount }} {{ date('F d, Y', strtotime($payment->date)) }} {{ array( 'card' => trans('clients.table.data.method.card'), 'cash' => trans('clients.table.data.method.cash'), 'paypal' => trans('clients.table.data.method.paypal') )[$payment->method] }}
{{ trans('policies.table.message.empty.payments', array( 'name' => $policy->client->first_name )) }}
@endsection @section('modals') @yield('policy_modals') @endsection @section('page_scripts') @endsection