@extends('layouts.pdf') @section('title') {{ $extra['module_name'] }} @endsection @section('content') @php $is_official = $search_by['is_official']; $total_payable_amount = 0; $total_balance = 0; $total_paid = 0; $schedule_counter = 0; if($summary_check == 0){ $colspan = 0; }else{ $colspan = 4; } @endphp
@include('admin.partials.header', ['extra' => $extra]) @if($summary_check == 0) @endif @if($show_last_payment) @endif @foreach ($schedules as $schedule ) @php $sell = $schedule->sell; $customer = $sell->customer; $product = $sell->product; $is_last_record = 0; $schedule_counter ++; if( !( isset($schedules[$loop->iteration]) && $schedule->sells_id == $schedules[$loop->iteration]->sells_id) ){ $is_last_record = 1; } $payable = $schedule->payable_amount + $schedule->unofficial_payable_amount; $received = $schedule->payment_received_amount + $schedule->unofficial_payment_received_amount; if($show_last_payment){ $last_paid_amount = $schedule->actualReceivedItems->last()->received_amount; } if(!userAllowedUnofficial($sell->branch_id)){ $payable = $schedule->payable_amount ; $received = $schedule->payment_received_amount ; } elseif($is_official == 'official'){ $payable = $schedule->payable_amount; $received = $schedule->payment_received_amount; $last_paid_amount = $schedule->actualReceivedItemsOfficial->last()->received_amount; if(isUnofficialNewStructure($sell->branch_id)){ $payable = $schedule->payment_received_amount; } } elseif($is_official == 'unofficial'){ $payable = $schedule->unofficial_payable_amount; $received = $schedule->unofficial_payment_received_amount; $last_paid_amount = $schedule->actualReceivedItemsUnofficial->last()->received_amount; if(isUnofficialNewStructure($sell->branch_id)){ $payable = $schedule->payable_amount - $schedule->payment_received_amount; } } $balance = $payable - $received; $sub_payable += $payable; $sub_received += $received; $sub_balance += $balance; $sub_last_paid_amount += $last_paid_amount; $total_payable += $payable; $total_received += $received; $total_balance += $balance; $total_last_paid_amount += $last_paid_amount; $sell_status = $sell->status; // BADGES START if($sell_status == 'ACTIVE'){ $sale_class = 'badge-success'; } else if($sell_status == 'CANCELLED' || $sell_status == 'CANCELLATION' ){ $sale_class = 'badge-danger'; } if( $schedule->schedule_date < date('Y-m-d',strtotime(now())) && $schedule->payment_status !=='Settled' ){ $schdule_class ='badge-danger'; $schedule->payment_status ='Defaulter'; } else if($schedule->payment_status =='Settled'){ $schdule_class = 'badge-success'; } else if($schedule->payment_status =='Partially Settled'){ $schdule_class = 'badge-warning'; } else if($schedule->payment_status =='Pending'){ $schdule_class = 'badge-info'; } // BADGES END @endphp @if($schedule_counter ==1) @endif @if($summary_check == 0) @endif @if($show_last_payment) @endif @if($is_last_record) @if($show_last_payment) @endif @php $schedule_counter = 0; $sub_payable = 0; $sub_received = 0; $sub_balance = 0; $sub_last_paid_amount = 0; @endphp @endif @endforeach @if($show_last_payment) @endif
{{__('lang.serial_no')}} {{__('lang.registration_no')}} {{__('lang.sale_date')}} {{__('lang.customer')}} {{__('lang.name')}} {{__('lang.customer')}} {{__('lang.phone')}}{{__('lang.customer')}} {{__('lang.address')}} {{__('lang.internal_employee')}} {{__('lang.external_employee')}} {{__('lang.block')}}{{__('lang.product')}} {{__('lang.size')}} {{__('lang.term')}} {{__('lang.actual_amount')}} {{$transaction->systemSettingCurrency()}} {{__('lang.paid_amount')}} {{$transaction->systemSettingCurrency()}}{{__('lang.last_paid_amount')}} {{$transaction->systemSettingCurrency()}}{{__('lang.paid_date')}} {{__('lang.balance_amount')}} {{$transaction->systemSettingCurrency()}} {{__('lang.schedule_date')}} {{__('lang.sale_status')}} {{__('lang.status')}}
{{ $sell->registration_no }}
{{ $schedule_counter }} {{ $sell->registration_no}} {{ $transaction->date_format($sell->sale_date_v2) }} {{ $customer->name }} {{ $customer->phone }}{{ $customer->mailing_address }} {{ $product->block->name ?? '-' }}{{ $product->product_unique_id }} {{ $product->flat_size }} {{ $schedule->term }} {{Transaction::convert_money_format($payable) }} {{ Transaction::convert_money_format($received) }}{{ Transaction::convert_money_format($last_paid_amount) }} {{ $schedule->payment_last_date ? date(config('settings.date_format'), strtotime($schedule->payment_last_date)) : '-' }} {{ Transaction::convert_money_format($balance) }} {{ !empty($schedule->schedule_date) ? date(config('settings.date_format'), strtotime($schedule->schedule_date)) : ' - ' }} {{ $sell->status }} {{ $schedule->payment_status }}
{{__('lang.sub_total')}} {{ Transaction::convert_money_format($sub_payable) }} {{ Transaction::convert_money_format($sub_received) }}{{ Transaction::convert_money_format($sub_last_paid_amount) }} {{ Transaction::convert_money_format($sub_balance) }}
{{__('lang.grand_total')}} {{ Transaction::convert_money_format($total_payable) }} {{ Transaction::convert_money_format($total_received) }}{{ Transaction::convert_money_format($total_last_paid_amount) }} {{ Transaction::convert_money_format($total_balance) }}
@stop