{{ config('settings.company_name') }}
{{ config('settings.address_1') }}
{{ $heading }}
@if ($search_by['from'] && $search_by['to']) From: {{ $transaction->date_format($search_by['from']) }} To: {{ $transaction->date_format($search_by['to']) }} @else {{ 'Upto ' . $transaction->date_format(now()) }} @endif
@php $is_official = $search_by['is_official']; $show_balance_schedule_wise = $search_by['show_balance_schedule_wise']; $footer_colspan = 5; if ($report_type == 'detailed'){ $footer_colspan = 7; } if($search_by['from'] == null && $search_by['to'] == null){ $column = "Upto ".date('d-F-Y', strtotime(date("Y-m-d"))); }elseif($search_by['from'] == null && $search_by['to'] != null){ $column = "Upto ".date('d-F-Y', strtotime($search_by['to'])); }else{ $column = date('d-M-Y', strtotime($search_by['from']))." - ".date('d-M-Y', strtotime($search_by['to'])); } @endphp @if ($report_type == 'detailed') @endif @foreach ($sells as $sell) @php $internal_dealers_names = $sell->sell_internal_dealer_rebate->implode('DealerName.name', ' ,
') ?? '-'; $external_dealers_names = $sell->sell_external_dealer_rebate->implode('DealerName.name', ' ,
') ?? '-'; $schedule_amount = $sell->official_schedule_amount + $sell->unofficial_schedule_amount; $received_amount = $sell->total_paid_official + $sell->total_paid_unofficial; $due_amount_before_this_period = $sell->due_amount_before_this_period_official + $sell->due_amount_before_this_period_unofficial; $received_amount_in_this_period = $sell->received_amount_in_this_period_official + $sell->received_amount_in_this_period_unofficial; $due_amount_in_this_period = $sell->due_amount_in_this_period_official + $sell->due_amount_in_this_period_unofficial; $payable_amount_in_this_period = $sell->payable_amount_in_this_period_official + $sell->payable_amount_in_this_period_unofficial; if($is_official == 'official'){ $schedule_amount = $sell->official_schedule_amount; $received_amount = $sell->total_paid_official; $due_amount_before_this_period = $sell->due_amount_before_this_period_official; $received_amount_in_this_period = $sell->received_amount_in_this_period_official; $due_amount_in_this_period = $sell->due_amount_in_this_period_official; $payable_amount_in_this_period = $sell->payable_amount_in_this_period_official; if(isUnofficialNewStructure($sell->branch_id)){ $schedule_amount = $sell->total_paid_official; $due_amount_before_this_period = 0; $due_amount_in_this_period = 0; $payable_amount_in_this_period = $received_amount_in_this_period_official; } } elseif($is_official == 'unofficial'){ $schedule_amount = $sell->unofficial_schedule_amount; $received_amount = $sell->total_paid_unofficial; $due_amount_before_this_period = $sell->due_amount_before_this_period_unofficial; $received_amount_in_this_period = $sell->received_amount_in_this_period_unofficial; $due_amount_in_this_period = $sell->due_amount_in_this_period_unofficial; $payable_amount_in_this_period = $sell->payable_amount_in_this_period_unofficial; if(isUnofficialNewStructure($sell->branch_id)){ $schedule_amount = $sell->official_schedule_amount - $sell->total_paid_official; $due_amount_before_this_period = $sell->due_amount_before_this_period_official - $sell->received_amount_befor_this_period_unofficial; $due_amount_in_this_period = $sell->due_amount_in_this_period_official - $sell->received_amount_in_this_period_unofficial; $payable_amount_in_this_period = $sell->payable_amount_in_this_period_official - $sell->received_amount_in_this_period_official; } } $due_amount = $due_amount_before_this_period + $due_amount_in_this_period; $due_amount_in_this_range = $due_amount_in_this_period; if(!$show_balance_schedule_wise){ $due_amount_in_this_range = $payable_amount_in_this_period - $received_amount_in_this_period; } $received_percentage = $schedule_amount ? round((($received_amount * 100) / $schedule_amount),2) : 0; //Total amounts calculations start $total_schedule_amount += $schedule_amount; $total_received_amount += $received_amount; $total_due_amount_before_this_period += $due_amount_before_this_period; $total_received_amount_in_this_period += $received_amount_in_this_period; $total_due_amount_in_this_period += $due_amount_in_this_range; $total_payable_amount_in_this_period += $payable_amount_in_this_period; $total_due_amount += $due_amount; //total amounts calculations end @endphp @if ($report_type == 'detailed') @endif @endforeach
{{__('lang.serial_no')}} {{__('lang.registration_number')}} {{__('lang.unit_number')}} {{__('lang.customer_name')}} {{__('lang.contact')}}{{__('lang.internal_dealer')}} {{__('lang.external_dealer')}}{{__('lang.total_sale_amount')}} {{__('lang.payable_amount')}}
({{$column}})
{{__('lang.total_received_amount')}} {{__('lang.received_percentage')}} {{__('lang.previous_balance')}} {{__('lang.received')}}
({{$column}})
{{__('lang.balance_in')}}
({{ $column }})
{{__('lang.total_due')}}
{{ $loop->iteration }} {{ $sell->registration_no }} {{ $sell->product->product_unique_id }} {{ $sell->customer->name }} {{ $sell->customer->phone }}
{{ $sell->customer->residential_phone }}
{{ $sell->customer->overseas_phone }}
{!! $internal_dealers_names !!} {!! $external_dealers_names !!} {{ $transaction->convert_money_format($schedule_amount) ?? 0 }} {{ $transaction->convert_money_format($payable_amount_in_this_period) ?? 0 }} {{ $transaction->convert_money_format($received_amount) ?? 0 }} {{ $received_percentage }} % {{ $transaction->convert_money_format($due_amount_before_this_period) ?? 0 }} {{ $transaction->convert_money_format($received_amount_in_this_period) ?? 0 }} {{ $transaction->convert_money_format($due_amount_in_this_range) ?? 0 }} {{ $transaction->convert_money_format($due_amount) ?? 0 }}
{{__('lang.total')}} {{ $transaction->convert_money_format($total_schedule_amount) ?? 0 }} {{ $transaction->convert_money_format($total_payable_amount_in_this_period) ?? 0 }} {{ $transaction->convert_money_format($total_received_amount) ?? 0 }} {{ $transaction->convert_money_format($total_due_amount_before_this_period) ?? 0 }} {{ $transaction->convert_money_format($total_received_amount_in_this_period) ?? 0 }} {{ $transaction->convert_money_format($total_due_amount_in_this_period) ?? 0 }} {{ $transaction->convert_money_format($total_due_amount) ?? 0 }}