@php $grand_payable_amount = 0; $grand_received_amount = 0; $grand_balance_amount = 0; $sub_payable = 0; $sub_received = 0; $sub_balance = 0; @endphp @foreach ($documentation_charges as $documentation_charge) @php $sell = $documentation_charge->sell; $payable_amount = $documentation_charge->payable_amount; // $received_amount = $documentation_charge->received_amount; $received_amount = $collections[$documentation_charge->id]; $balance_amount = $payable_amount - $received_amount; $sub_payable += $payable_amount; $sub_received += $received_amount; $sub_balance += $balance_amount; $grand_payable_amount += $payable_amount; $grand_received_amount += $received_amount; $grand_balance_amount += $balance_amount; $is_last_record = 0; $schedule_counter ++; $current_sell_id = $documentation_charge->sells_id; $next_sell_id = $documentation_charges[$loop->iteration]->sells_id ?? 0; if($current_sell_id != $next_sell_id){ $is_last_record = 1; } if( $documentation_charge->schedule_date < date('Y-m-d',strtotime(now())) && $documentation_charge->status !=='Settled' ){ $schdule_class ='badge-danger'; $documentation_charge->status ='Defaulter'; } else if($documentation_charge->status =='Settled'){ $schdule_class = 'badge-success'; } else if($documentation_charge->status =='Partially Settled'){ $schdule_class = 'badge-warning'; } else if($documentation_charge->status =='Pending'){ $schdule_class = 'badge-info'; } @endphp @if($schedule_counter ==1) @endif @if($is_last_record) @php $schedule_counter = 0; $sub_payable = 0; $sub_received = 0; $sub_balance = 0; $sub_last_paid_amount = 0; @endphp @endif @endforeach
{{ __('lang.sno') }} {{ __('lang.project') }} {{ __('lang.registration_no') }} {{ __('lang.property') }} {{ __('lang.customer') }} {{ __('lang.term') }} {{ __('lang.schedule_date') }} {{ __('lang.amount') }} {{ __('lang.received_amount') }} {{ __('lang.balance_amount') }} {{ __('lang.status') }}
{{ $sell->registration_no }} - {{ $sell->customer->name ?? '-' }} ({{ $sell->customer->nid ?? '-' }})
{{ $schedule_counter }} {{ $sell->branch->name ?? '-' }} {{ $sell->registration_no ?? '-' }} {{ $sell->product->product_unique_id ?? '-' }} {{ $sell->customer->name ?? '-' }} {{ $documentation_charge->term ?? '-' }} {{ Transaction::date_format($documentation_charge->schedule_date ) }} {{ Transaction::convert_money_format($payable_amount) }} {{ Transaction::convert_money_format($received_amount) }} {{ Transaction::convert_money_format($balance_amount) }} {{ $documentation_charge->status }}
Sub Total {{ $transaction->convert_money_format($sub_payable) }} {{ $transaction->convert_money_format($sub_received) }} {{ $transaction->convert_money_format($sub_balance) }}
Total {{ $transaction->convert_money_format($grand_payable_amount) }} {{ $transaction->convert_money_format($grand_received_amount) }} {{ $transaction->convert_money_format($grand_balance_amount) }}