Principal Amount {{number_format($loan->amount,2)}} Released Date {{$loan->created_at}}
EMI {{$loan->repaymentPlans->first()->is_new ? number_format($loan->emi,2) : number_format($loan->repaymentPlans->first()->emi + $loan->repaymentPlans->first()->management_fee,2)}} Payment Closed {{$loan->closedPayments()->count()}}
Loan Tenor {{$loan->duration}} Penalty @php($cur_month = $loan->created_at->diffInMonths(now())) @if($cur_month <= 3) {{10}}% @elseif($cur_month <=6) {{7.5}}% @elseif($cur_month <=9) {{5}}% @else {{0}}% @endif

Loan Fulfilment
@php($loan_wallet = $loan->user->loan_wallet) @if($loan_wallet > 0) @endif @if($loan_wallet < 0 && abs($loan_wallet) > 100 && !$loan->is_penalized) @endif
Released Amount {{number_format($loan->amount,2)}}
Interest and Fees to Date {{number_format($loan->accrued_amount,2)}}
Late Repayment Charges {{number_format($loan_wallet,2)}}
Current Value of Loan {{number_format($loan->current_value,2)}}
Less: Repayments {{number_format($loan->deductions,2)}}
Repayment Wallet Balance {{number_format($loan->repayment_wallet,2)}}
Value on Closure {{number_format($loan->closing_value)}}
Add: {{$loan->is_penalized ? 'Penal Charge' : 'Preliquidation Charge'}} {{number_format($loan->penal_charge,2)}}
Late Repayment Charges {{number_format(abs($loan->user->loan_wallet),2)}}
Total Due @ {{now()}} {{ number_format($loan->closing_value + $loan->penal_charge, 2) }}