Company Logo
@if(isset($is_solar) && $is_solar)

Green Starts with You

Solar Loan Account Statement

@else

Your Financial Partner

Loan Account Statement

@endif
Customer Name
@if(isset($customer_name)){{$customer_name}}@else - @endif
Agreement Number
@if(isset($agreement_no)){{$agreement_no}}@else - @endif
Product Name
@if(isset($product) && $product !== ""){{$product}}@else - @endif
Agreement Date
@if(isset($agreement_date)){{$agreement_date}}@else - @endif
Merchant Name
@if(isset($merchant_name)){{$merchant_name}}@else - @endif
Status
@if(isset($status)){{$status}}@else - @endif

Loan Details

@if(empty($secondary_status) || !in_array($secondary_status, ['settled', 'settlement-done', 'settlement-in-progress'])) @endif @if(empty($secondary_status) || !in_array($secondary_status, ['settled', 'settlement-done', 'settlement-in-progress'])) @endif
Loan Amount
@if(isset($amount_financed))₹{{str_replace('.00', '', money_format('%!i', $amount_financed))}}@else - @endif
Advance Amount
@if(isset($advance_amount))₹{{str_replace('.00', '', money_format('%!i', $advance_amount))}}@else - @endif
Amount Paid
@if(isset($amount_paid))₹{{str_replace('.00', '', money_format('%!i', $amount_paid))}}@else - @endif
Amount Pending
@if(isset($amount_pending))₹{{str_replace('.00', '', money_format('%!i', $amount_pending))}}@else - @endif
Interest Rate
@if(isset($interest)){{$interest}}%@else - @endif
Total EMI
@if(isset($total_emi)){{$total_emi}}@else - @endif
Advance EMI
@if(isset($advance_emi)){{$advance_emi}}@else - @endif
Paid EMI
@if(isset($emi_paid)){{$emi_paid}}@else - @endif
Pending EMI
@if(isset($remaining_emi)){{$remaining_emi}} Months @else - @endif
Frequency
@if(isset($frequency)){{$frequency}}@else - @endif

EMI Schedule

@php $schedulePages = []; $fullSchedule = $schedule ?? []; $rowsOnFirstPage = 20; // Fewer rows on the first schedule page to account for header/details if (count($fullSchedule) > 0) { // Get the first page's items $schedulePages[] = array_slice($fullSchedule, 0, $rowsOnFirstPage); // Get the remaining items $remainingSchedule = array_slice($fullSchedule, $rowsOnFirstPage); // If there are remaining items, chunk them into pages of 20 if ($remainingSchedule) { $subsequentPages = array_chunk($remainingSchedule, $rowsOnFirstPage); $schedulePages = array_merge($schedulePages, $subsequentPages); } } @endphp @foreach($schedulePages as $pageIndex => $schedulePage) @if($pageIndex > 0)
@endif
@if(isset($isMoratorium) && $isMoratorium == true) @endif @foreach($schedulePage as $payment) @if(!$isForeclosed || ($isForeclosed && $payment['payment_status'] != 'pending')) @if(isset($isMoratorium) && $isMoratorium == true) @endif @if(isset($payment['id']) && $payment['id'] != 'Pre-EMI') @endif @endif @endforeach
Installment No. Due Date Installment Amount Principal Interest Bounce PenalMoratorium AmountWaive-Off Total Due Amount Received Payment Date Principal Outstanding
@if(isset($payment['id']) && $payment['id'] == 'Pre-EMI'){{$payment['id']}} @elseif($payment['emi_type'] == 'prepartpayment') Pre Part Payment @else {!! $i_index !!} @endif @if(isset($payment['due_date']) && $payment['due_date'] != '01-Jan-1970'){{$payment['due_date']}}@else - @endif @if($loop->parent->first && $loop->first && isset($processing_fee_first_emi) && $processing_fee_first_emi && isset($processing_fee) && $processing_fee) ₹{{str_replace('.00', '', money_format('%!i', $payment['installment_amount'] + $processing_fee))}} @else @if(isset($payment['installment_amount']))₹{{str_replace('.00', '', money_format('%!i', $payment['installment_amount']))}}@else - @endif @endif @if(isset($payment['principal']))₹{{str_replace('.00', '', money_format('%!i', $payment['principal']))}}@else - @endif @if(isset($payment['interest'])){{$payment['interest']}} @else - @endif @if(isset($payment['bounce']))₹{{str_replace('.00', '', money_format('%!i', $payment['bounce']))}}@else - @endif @if(isset($payment['penal']))₹{{str_replace('.00', '', money_format('%!i', $payment['penal']))}}@else - @endif@if(isset($payment['moratorium_amount']))₹{{str_replace('.00', '', money_format('%!i', $payment['moratorium_amount']))}}@else - @endif@if(isset($payment['charges_waived']))₹{{str_replace('.00', '', money_format('%!i', $payment['charges_waived']))}}@else - @endif @if(isset($payment['total_due']))₹{{str_replace('.00', '', money_format('%!i', $payment['total_due']))}}@else - @endif @if(isset($payment['amount_received']))₹{{str_replace('.00', '', money_format('%!i', $payment['amount_received']))}}@else - @endif @if(isset($payment['last_payment_date']) && ($payment['last_payment_date']) !== "" && date('d-M-Y',strtotime($payment['last_payment_date'])) != '1970-01-01' && date('d-M-Y',strtotime($payment['last_payment_date'])) != '01-Jan-1970') {!! date('d-M-Y',$payment['last_payment_date']) !!} @elseif(isset($payment['payment_date']) && ($payment['payment_date']) !== "" && date('d-M-Y',strtotime($payment['payment_date'])) != '1970-01-01' && date('d-M-Y',strtotime($payment['payment_date'])) != '01-Jan-1970') {!! date('d-M-Y',strtotime($payment['payment_date'])) !!} @else - @endif @if(isset($payment['principal_outstanding']))₹{{str_replace('.00', '', money_format('%!i', $payment['principal_outstanding']))}}@else - @endif
@endforeach
@if(isset($isPrePartPayment) && $isPrePartPayment) {{--
Pre-Part Payment Details: ₹{{str_replace('.00', '', money_format('%!i', $prePartPaymentAmount))}} received via {{ $prePartPaymentMode or '' }} on {{ $prePartPaymentDate or '' }}.
--}} @endif @if($isForeclosed)
Foreclosure Details: ₹{{ $foreclosedAmount or '' }} received via {{ $foreclosedMode or '' }} on {{ $foreclosedDate or '' }}.
@endif @php $rowsOnLastPage = 0; if (!empty($schedulePages)) { $lastPage = end($schedulePages); $rowsOnLastPage = count($lastPage); } @endphp {{-- This condition now works correctly with the new pagination logic --}} @if ($rowsOnLastPage > 10 && count($schedulePages) > 1)
@endif @php $co2_emissions_saved = 0; $trees_planted = 0; // Check if amount_financed exists and is a number if (isset($amount_financed) && is_numeric($amount_financed)) { // Calculate CO2 emissions saved in tonnes $co2_emissions_saved = ($amount_financed * 120 * 0.85) / 50000000; // Calculate the equivalent number of trees planted $trees_planted = $co2_emissions_saved * 46; } @endphp @if(isset($is_solar) && $is_solar)

Your Green Impact Report

{{ number_format($co2_emissions_saved, 2) }} tonnes
CO₂ Emissions Saved
{{ round($trees_planted) }}
Equivalent Trees Planted
@endif