@php
$totaldue = 0;
$totalreceived = 0;
$future_installments = [];
$future_dates = [];
$installment_date;
$installments = $model->installments;
$installmentCount = count($installments);
$continueEveryMonthDisplayed = false;
@endphp
@foreach($model->installments as $index=> $item)
@php
$installment_date = strtotime($item->date1);
$current_date = strtotime(date('d-M-Y'));
@endphp
@if($item->IsInstallment )
@if(strtotime($item->date1) <= strtotime(date('d-M-Y')))
{{ date('d-M-y', strtotime($item->date1)) }} |
{{$item->paymenttypedetail}} |
PKR {{number_format($item->due,2)}} |
PKR
@php ($totalreceived += $item->mount_received)
{{number_format($item->mount_received,2)}} |
- |
@php ($totaldue += $item->due)
{{number_format($item->due,2)}}
|
{{ date('d-M-y', strtotime($item->date1)) }}
|
@endif
@if(strtotime($item->date1) > strtotime(date('d-M-Y')) && $index <= ($installmentCount - 9) )
{{ date('d-M-y', strtotime($item->date1)) }} |
{{$item->paymenttypedetail}} |
PKR {{number_format($item->due,2)}} |
PKR
@php ($totalreceived += $item->mount_received)
{{number_format($item->mount_received,2)}} |
- |
@php ($totaldue += $item->due)
{{number_format($item->due,2)}}
|
{{ date('d-M-y', strtotime($item->date1)) }}
|
@endif
{{-- @php(dd($model['future_installment'][0]['date'])) --}}
@if( strtotime($item->date1) > $current_date)
@if($index >= ($installmentCount - 2))
@if (!$continueEveryMonthDisplayed)
| Continue Every Month |
|
|
|
|
@php ($continueEveryMonthDisplayed = true)
@endif
{{ date('d-M-y', strtotime($item->date1)) }} |
{{$item->paymenttypedetail}} |
PKR {{number_format($item->due,2)}} |
PKR
@php ($totalreceived += $item->mount_received)
{{number_format($item->mount_received,2)}} |
- |
@php ($totaldue += $item->due)
{{number_format($item->due,2)}}
|
{{ date('d-M-y', strtotime($item->date1)) }}
|
@endif
@endif
@else
{{ date('d-M-y', strtotime($item->date1)) }} |
{{$item->paymenttypedetail}} |
PKR {{number_format($item->due,2)}} |
PKR
@php ($totaldue += $item->due)
@php ($totalreceived += $item->mount_received)
{{number_format($item->mount_received)}} |
- |
@php ($totaldue += $item->due)
{{number_format($item->due)}} |
{{ date('d-M-y', strtotime($item->date1)) }}
|
@endif
@endforeach