@php $counter = 1; @endphp @foreach ($response['data'] as $key => $value) Reachassuree - Consolidated Renewal Report
Header Avatar

:: Consolidated Renewal Report (D/L) ::

@if($response['start_date'] != 'not selected') From Date :- {{ $response['start_date'] }} @endif @if($response['end_date'] != 'not selected') To Date :- {{ $response['end_date'] }} @endif

Selected Department : @php $lastDepartmentCount = count($response['department']) - 1; foreach ($response['department'] as $key2 => $value2) { if($lastDepartmentCount != 0){ echo $value2 . ", "; }else{ echo "General Insurance, Life Insurance, Investment, Documents"; } } @endphp

Page :- {{ $key + 1 }} > {{ $response['count'] }}
@php $dateTime = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $date = $dateTime->format("d/m/y h:i"); $displayedPolicyHolders = []; $familygroupName = []; $groupedData = []; foreach ($response['client_data'] as $client) { $groupedData[$client['group_name']][] = $client; } // Sort group names alphabetically (modify sorting logic if needed) ksort($groupedData); @endphp @foreach ($groupedData as $groupName => $clients) @php $totalClients = count($clients); $currentClient = 0; @endphp @foreach ($clients as $client) @php $currentClient++; $hasPolicies = false; foreach ($value as $value1) { foreach ($value1 as $policy) { if ($policy['policy_holder_name'] == $client['policy_holder_name']) { $hasPolicies = true; break 2; } } } @endphp @if ($hasPolicies) @foreach ($value as $value1) @foreach ($value1 as $policy) @if ($policy['policy_holder_name'] == $client['policy_holder_name']) @if($policy['remark'] != '') @else @endif @if($policy['remark'] != '') @endif @php $counter++; @endphp @endif @endforeach @endforeach @foreach ($response['total'] as $key2 => $value2) @foreach ($value2 as $key3 => $value3) @if($client['policy_holder_name'] == $key3 && $key3 != "group_total") @endif @endforeach @if($currentClient == $totalClients) @if($groupName == $key2 && $key3 == "group_total") @php // Add group to the array after displaying it $familygroupName[] = $groupName; @endphp @endif @endif @endforeach
Group Name: {{ $groupName }} Family Name: {{ $client['family_name'] }}
Policy Holder Name: {{ $client['policy_holder_name'] }} Mob No: {{ $client['mobile_number'] . ' / ' . $client['whatsapp_number'] }} Email: {{ $client['email'] }}
Sr. No. Division Ins. Co. Name Policy / Docs. No. Plan / Segment / Docs Detail Risk Start Sum Assured Risk End last Prem. Mode Due Type Renewal Date Payable Recievable
{{ $counter }}{{ $counter }}{{ $policy['division'] ?? '-' }} {{ $policy['ins_comp_name'] ?? '-' }} {{ $policy['policy_number'] ?? '-' }} {{ $policy['plan_segment_name'] ?? '-' }} {{ $policy['plan_segment_details'] ?? '-' }} {{ $policy['risk_start_date'] ?? '-' }} {{ $policy['sum_assured'] ?? '-' }} {{ $policy['risk_end_date'] ?? '-' }} {{ $policy['last_prem_date'] ?? '-' }} {{ $policy['mode'] ?? '-' }} {{ $policy['due_type'] ?? '-' }} {{ $policy['renewal_date'] ?? '-' }} {{ $policy['payble_amt'] ?? '-' }} -
Remarks {{ $policy['remark'] ?? '-' }}
Member Total {{ $value3['member_total'] ?? '-' }}
Group Total {{ $value3 ?? '-' }}
@endif @endforeach @endforeach
@endforeach