@foreach ($response['data'] as $key => $value) Reachassuree - Life Invoice
Header Avatar

:: Life Insurance Renewal Policy Report (D/L) ::

@php if($response['policy_status'] == '-1'){ $date_type = "All"; }else if($response['policy_status'] == '0'){ $date_type = "Renewal"; }else if($response['policy_status'] == '1'){ $date_type = "Renewed"; }else if($response['policy_status'] == '2'){ $date_type = "Can Not Renew"; } @endphp

@if($response['start_date'] != 'not selected') Due Form Date :- {{ $response['start_date'] }} @endif @if($response['end_date'] != 'not selected') | Due End Date :- {{ $response['end_date'] }} @endif

Page :- {{ $key + 1 }} > {{ $response['count'] }}
@php $dateTime = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $date = $dateTime->format("d/m/y H:i"); $sumAssuredTotal = 0; $accidentRiskTotal = 0; $duePremiumTotal = 0; $groupName = []; $groupSumAssuredTotal = 0; $groupTotalPremiumTotal = 0; $carriedOverGroupTotals = $response['ongoingGroupTotals']; @endphp @foreach ($value as $key1 => $value1) @php $sumAssuredTotal = $sumAssuredTotal + $value1['sum_assured']; $accidentRiskTotal = $accidentRiskTotal + $value1['accident_risk_amount']; $toalOfDue = $value1['tax_amount'] + $value1['total_amount']; $duePremiumTotal = $duePremiumTotal + $toalOfDue; $groupSumAssuredTotal += $value1['sum_assured']; $groupTotalPremiumTotal += $value1['total_amount']; $group = $value1['group']; $isLastInGroup = false; if (isset($response['ongoingGroupTotals'][$group]['last_record']) && $response['ongoingGroupTotals'][$group]['last_record'] === $value1) { $isLastInGroup = true; } @endphp @if($response['type'] == "group-wise" && !in_array($value1['group'],$groupName)) @php // Add group to the array after displaying it $groupName[] = $value1['group']; @endphp @endif @if ($key1 % 2 == 0) @else @endif @if ($value1['risk_to_date']) @else @endif @if ($value1['renewal_status'] != 1) @if ($riskDate <= $prevDate) @if($value1['status'] == 0) @else @endif @else @endif @else @endif
Group {{$value1['group']}}
Sr.No. Premium Due Date Agency Policy Holder Name Insurance Company Plan Name Risk Start Date Maturity Date Remarks
{{ $key1 + 1 }}{{ $key1 + 1 }}{{ dateDMYFormat($value1['risk_to_date']) }}-{{ $value1['agency'] }} {{ $value1['policy_holder_name'] }} {{ $value1['insurance_company'] }} {{ $value1['insurance_plan'] }} {{ $value1['risk_from_date'] ? dateDMYFormat($value1['risk_from_date']) : '' }} {{ $value1['maturity_date'] ? dateDMYFormat($value1['maturity_date']) : '' }} {{ substr($value1['remark'], 0, 150) }}
Policy Number Broker Group Name Branch Plan Detail Last Prem.Date Next SB Due
{{ $value1['policy_number'] }} {{ $value1['broker'] }} {{ $value1['group'] }} {{ $value1['branch'] }} {{ $value1['risk_term'] }}-{{ $value1['premium_paying_term'] }} {{ $value1['last_payment_date'] ? dateDMYFormat($value1['last_payment_date']) : ''}} {{ $value1['risk_to_date'] ? dateDMYFormat($value1['risk_to_date']) : '-' }}
Renewal status Mode Sub Agent Mob No. / W App No. Policy Status Sum Assured Accident Risk Total Amount
Not RenewRenewRenewRenewed{{ $value1['mode'] }} {{ $value1['sub_agent'] }} {{ $value1['mobile_number'] }} / {{ $value1['whatsapp_number']}} {{ $value1['life_policy_status'] }} {{ $value1['sum_assured'] }} {{ $value1['accident_risk_amount'] }} {{ $value1['tax_amount'] + $value1['total_amount'] }}
@if ($response['type'] == "group-wise" && $isLastInGroup)
Group Total Sum Assured Total Amount
{{ number_format($carriedOverGroupTotals[$group]['sum_assured'], 2) }} {{ number_format($carriedOverGroupTotals[$group]['total_amount'], 2) }}
@php // Mark as rendered to avoid duplication unset($response['ongoingGroupTotals'][$group]['last_record']); @endphp @endif @endforeach @if ($response['type'] != "group-wise") {{-- --}} {{-- --}}
Page total Sum AssuredAccident RiskTotal Amount
{{ number_format($sumAssuredTotal, 2) }}{{ number_format($accidentRiskTotal, 2) }}{{ number_format($duePremiumTotal, 2) }}
@endif @if ($key + 1 == $response['count']) {{-- --}} {{-- --}}
REPORT TOTAL Sum AssuredAccident RiskDue Premium
{{ number_format($response['sumAssuredTotal'] , 2) }}{{ number_format($response['accidentRiskTotal'], 2) }}{{ number_format($response['duePremiumTotal'], 2) }}
@endif
@endforeach