@extends('layouts.app') @php use App\Models\ShowroomInsurance; use App\Support\Format; use App\Support\ProcedureChecklist; $saved = $insurance->exists; $value = fn (string $field, $fallback = null) => old($field, $insurance->{$field} ?? $fallback); $dateValue = fn (string $field) => old($field, $insurance->{$field}?->format('Y-m-d')); $money = fn (string $field) => old( $field, $insurance->{$field} === null ? '' : Format::money($insurance->{$field}, 2, '') ); $moneyFields = [ 'stock_value', 'fitting_cost', 'sum_insured', 'sme_sum_insured', 'public_liability_sum_insured', 'invoice_amount', ]; @endphp @section('title', 'Showroom insurance — '.$proposal->outlet) @section('heading', 'New Retail Showroom Insurance Coverage (NRSIC)') @section('subheading', 'Clause 8.0 — for '.$proposal->outlet) @section('actions') @if ($saved) Print for signing PDF @endif Checklist Cancel @endsection @section('content') @if ($errors->any())
Please check the {{ $errors->count() }} highlighted {{ \Illuminate\Support\Str::plural('entry', $errors->count()) }} below.
@endif @unless ($saved)
Drafted from the accepted proposal — the showroom, the premises and the opening date taken from the term. The two figures are addressed to the people clause 8.1.1 names; fill them in as they come back.
@endunless @if ($saved && $insurance->outstandingFigures() !== [])
Still waiting on the {{ implode(' and the ', $insurance->outstandingFigures()) }} — the form cannot go to the PA to GMD for check until both are in (clause 8.3).
@endif
@csrf @method('PUT') {{-- ------------------------------------------------------------ --}} {{-- The showroom --}} {{-- ------------------------------------------------------------ --}}
The showroom
@error('reference')
{{ $message }}
@enderror
@error('showroom')
{{ $message }}
@enderror
@error('opening_date')
{{ $message }}
@enderror
@error('premises')
{{ $message }}
@enderror
{{-- ------------------------------------------------------------ --}} {{-- What is insured (clause 8.1.1) --}} {{-- ------------------------------------------------------------ --}}
What is insured clause 8.1.1
@foreach ([ ['stock_value', 'Stock value (RM)', ShowroomInsurance::STOCK_VALUE_SOURCE], ['fitting_cost', 'Furniture and fitting cost (RM)', ShowroomInsurance::FITTING_COST_SOURCE], ] as [$field, $label, $defaultSource])
@error($field)
{{ $message }}
@enderror
@error($field.'_source')
{{ $message }}
@enderror
@error($field.'_requested_on')
{{ $message }}
@enderror
@error($field.'_received_on')
{{ $message }}
@enderror
@endforeach
@error('sum_insured')
{{ $message }}
@enderror
Left blank it adds the two figures up. @if ($saved && $insurance->sumInsuredDiffers()) The parts now come to {{ Format::money($insurance->calculated_sum_insured) }}, so the cover is out by {{ Format::money(abs($insurance->calculated_sum_insured - (float) $insurance->sum_insured)) }}. @endif
{{-- ------------------------------------------------------------ --}} {{-- The cover (clause 8.5) --}} {{-- ------------------------------------------------------------ --}}
The cover clause 8.5
@error('insurer')
{{ $message }}
@enderror
@error('agent_name')
{{ $message }}
@enderror
@error('agent_contact')
{{ $message }}
@enderror
@error('period_from')
{{ $message }}
@enderror
@error('period_to')
{{ $message }}
@enderror
@error('sme_policy_no')
{{ $message }}
@enderror
@error('sme_sum_insured')
{{ $message }}
@enderror
@error('public_liability_policy_no')
{{ $message }}
@enderror
@error('public_liability_sum_insured')
{{ $message }}
@enderror
{{-- ------------------------------------------------------------ --}} {{-- The invoice (clauses 8.9 and 8.10) --}} {{-- ------------------------------------------------------------ --}}
The invoice clauses 8.9 and 8.10
@error('invoice_no')
{{ $message }}
@enderror
@error('invoice_date')
{{ $message }}
@enderror
@error('invoice_amount')
{{ $message }}
@enderror
{{-- ------------------------------------------------------------ --}} {{-- Remarks and sign-off --}} {{-- ------------------------------------------------------------ --}}
Remarks and sign-off
@error('remarks')
{{ $message }}
@enderror
@foreach ([ ['prepared', 'Prepared by', 'PTM — clause 8.1'], ['checked', 'Checked by', 'PA to GMD — clause 8.3'], ['approved', 'Approved by', 'GMD — clause 8.7'], ] as [$prefix, $label, $hint])
@error($prefix.'_by_name')
{{ $message }}
@enderror @error($prefix.'_on')
{{ $message }}
@enderror
@endforeach
Cancel
@endsection @push('scripts') @endpush