{{ 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
@if($is_summary == 0) @endif @if ($show_branch && $is_summary == 0) @endif @if($is_summary == 1 && $consolidated_summary) @endif @if($is_summary == 0) @endif @if($with_rps == 1) @endif @if($with_rps == 0) @endif @if($is_summary == 0) @endif @if($show_buyback_date == 1) @endif @if($is_summary == 0 || ($is_summary == 1 && $consolidated_summary)) @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @endif @if($is_summary == 0) @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @if ($show_internal_dealer) @endif @if ($show_external_dealer) @endif @if($is_summary == 0) @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @if($is_summary == 0) @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif {{-- @if($is_summary == 1) --}} {{-- @endif --}} @if($is_summary == 0) @endif @foreach ($sells as $sell) @php $last_receipt = $sell->lastActualReceivedByDate(); $last_payment_date = $last_receipt->date_of_collection_new; $last_payment_amount = $last_receipt ? $last_receipt->actualReceivedItem->sum('received_amount') : 0; $product_value_official = $sell->product->rate_per_size * $sell->product->flat_size; $product_value_unofficial = $sell->product->fixed_amount_unofficial; $product_value_combine = $sell->product->fixed_amount; if($sell->status != 'ACTIVE'){ $product_value_combine = $sell->cost_amount; } $schedule_official = $sell->official_schedule_amount; $schedule_unofficial = $sell->unofficial_schedule_amount; $schedule_combine = $sell->total_schedule_amount; $collected_amount_official = $sell->total_paid_official; $collected_amount_unofficial = $sell->total_paid_un_official; $collected_amount_combine = $sell->total_paid; $till_month_due_amount_official = $sell->total_till_month_due_official; $till_month_due_amount_unofficial = $sell->total_till_month_due_unofficial; $till_month_due_amount_combine = $sell->total_till_month_due; $discount_official = $sell->discount_amount; $discount_unofficial = $sell->discount_amount_un_official; if(isUnofficialNewStructure($sell->branch_id)){ $schedule_official = $collected_amount_official; $schedule_unofficial = $sell->official_schedule_amount - $collected_amount_official; $till_month_due_amount_official = 0; $till_month_due_amount_unofficial = $sell->total_till_month_due_official - $sell->total_till_month_received_unofficial; $discount_official = 0; $discount_unofficial = $sell->discount_amount; } $collection_percentage_official = $schedule_official ? ($collected_amount_official / $schedule_official) * 100 : 0; $collection_percentage_unofficial = $schedule_unofficial ? ($collected_amount_unofficial / $schedule_unofficial) * 100 : 0; $collection_percentage_combine = $schedule_combine ? ($collected_amount_combine / $schedule_combine) * 100 : 0; $due_amount_official = $schedule_official - $collected_amount_official; $due_amount_unofficial = $schedule_unofficial - $collected_amount_unofficial; $due_amount_combine = $schedule_combine - $collected_amount_combine; $discount_combine = $discount_official + $discount_unofficial; $sale_amount_official = $schedule_official + $discount_official; $sale_amount_unofficial = $schedule_unofficial + $discount_unofficial; $sale_amount_combine = $schedule_combine + $discount_combine; $rate_per_size_official = $sell->product->rate_per_size; $rate_per_size_unofficial = $sell->product->rate_per_size_unofficial; if ($fix_no_rate && $sell->product->flat_size && !$rate_per_size_official) { $rate_per_size_official = $sell->product->flat_size ? $sell->total_schedule_amount / $sell->product->flat_size : 0; } $rate_per_size_combine = $rate_per_size_official + $rate_per_size_unofficial; // RATE FIX END //total amounts $total_product_value_official += $product_value_official; $total_product_value_unofficial += $product_value_unofficial; $total_product_value_combine += $product_value_combine; $total_discount_official += $discount_official; $total_discount_unofficial += $discount_unofficial; $total_discount_combine += $discount_combine; $total_sale_amount_official += $sale_amount_official; $total_sale_amount_unofficial += $sale_amount_unofficial; $total_sale_amount_combine += $sale_amount_combine; $total_schedule_official += $schedule_official; $total_schedule_unofficial += $schedule_unofficial; $total_schedule_combine += $schedule_combine; $total_collected_amount_official += $collected_amount_official; $total_collected_amount_unofficial += $collected_amount_unofficial; $total_collected_amount_combine += $collected_amount_combine; $total_due_amount_official += $due_amount_official; $total_due_amount_unofficial += $due_amount_unofficial; $total_due_amount_combine += $due_amount_combine; $total_till_month_due_amount_official += $till_month_due_amount_official; $total_till_month_due_amount_unofficial += $till_month_due_amount_unofficial; $total_till_month_due_amount_combine += $till_month_due_amount_combine; $total_collection_percentage_official = $total_schedule_official ? ($total_collected_amount_official / $total_schedule_official) * 100 : 0; $total_collection_percentage_unofficial = $total_schedule_unofficial ? ($total_collected_amount_unofficial / $total_schedule_unofficial) * 100 : 0; $total_collection_percentage_combine = $total_schedule_combine ? ($total_collected_amount_combine / $total_schedule_combine) * 100 : 0; $is_last_record = 0; $sells_counter ++; if( !( isset($sells[$loop->iteration]) && $sell->customer_id == $sells[$loop->iteration]->customer_id) ){ $is_last_record = 1; } $product_net_sale = $sale_amount_combine - ($sell->dealers->sum('rebate_amount') + $sell->discount_amount); $net_rate_per_size = $sell->product->flat_size ? $product_net_sale / $sell->product->flat_size : 0; // Grand Total Start $g_total_additional += $sell->additional_charges; $g_total_product_net_sale += $product_net_sale; $g_total_paid_exceed += $sell->total_paid_exceed; $g_total_product_sp1 += $product_value_combine; $g_total_additional1 += $sell->additional_charges; $g_total_sale_amount1 += $sale_amount_combine; $g_total_discount1 += $sell->discount_amount; $g_total_product_net_sale1 += $product_net_sale; $g_total_schedule_amount1 += $sell->total_schedule_amount; $g_total_paid1 += $total_paid_combine; $g_total_due1 += $due_amount_combine; $g_total_till_month_due1 += $sell->total_till_month_due; $g_total_paid_exceed1 += $sell->total_paid_exceed; $grand_percent1 = $g_total_schedule_amount1 ? ($g_total_paid1 / $g_total_schedule_amount1) * 100 : 0; // Grand Total End foreach($sell->dealers as $key=> $dealer_rebate) { //Grand total of Rebate Start if($dealer_rebate->dealer_type == 'Internal') { $g_total_internal_rebate += $dealer_rebate->rebate_amount; $g_total_internal_rebate1 += $dealer_rebate->rebate_amount; } if($dealer_rebate->dealer_type == 'External') { $g_total_external_rebate += $dealer_rebate->rebate_amount; $g_total_external_rebate1 += $dealer_rebate->rebate_amount; } //Grand total of Rebate End } // Badge Start $badge_class = ''; if ($sell->is_transfered) { $badge_class = 'badge-danger'; } else{ if ($sell->status == 'ACTIVE') { $badge_class = 'badge-success'; } elseif ($sell->status == 'CANCELLED') { $badge_class = 'badge-danger'; } elseif ($sell->status == 'BUY BACK') { $badge_class = 'badge-info'; }elseif ($sell->status == 'FULL PAID') { $badge_class = 'badge-success'; } else { $badge_class = 'badge-warning'; } } $internal_dealer_name = $sell->sell_internal_dealer_rebate->implode('DealerName.name', ' ,
') ; $external_dealer_name = $sell->sell_external_dealer_rebate->implode('DealerName.name', ' ,
'); $internal_dealer_rebate = $sell->sell_internal_dealer_rebate->implode('rebate_amount', ' ,') ?? 0; $external_dealer_rebate = $sell->sell_external_dealer_rebate->implode('rebate_amount', ' ,') ?? 0; $internal_dealer_name = str_replace('&', 'and', $internal_dealer_name); $external_dealer_name = str_replace('&', 'and', $external_dealer_name); @endphp @if($customer_group_by == 1 && $sells_counter == 1) @endif @if ($show_branch && $is_summary == 0) @endif @if($is_summary == 1 && $consolidated_summary) @endif @if($is_summary == 0) @endif @if($with_rps == 0) @endif @if($with_rps == 1) @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @endif @if($is_summary == 0) @endif @if($show_buyback_date == 1) @endif @if($is_summary == 0 || ($is_summary == 1 && $consolidated_summary)) @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @endif @if($is_summary == 0) @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @if ($show_internal_dealer) @endif @if ($show_external_dealer) @endif @if($is_summary == 0) @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @if($is_summary == 0) @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif {{-- @if($is_summary == 1) --}} {{-- @endif --}} @if($is_summary == 0) @endif {{-- Footer --}} @if($customer_group_by == 1 && $is_last_record) @if ($show_internal_dealer) @endif @if ($show_external_dealer) @endif @if ($show_official) @endif @if($customer_group_by == 1 && $sells_counter == 1) @php $g_total_product_sp1 = 0; $g_total_additional1 = 0; $g_total_sale_amount1= 0; $g_total_discount1 = 0; $g_total_employee_rebate1 = 0; $g_total_ext_employee_rebate1 =0; $g_total_product_net_sale1 = 0; $g_total_schedule_amount1 = 0; $g_total_paid_official1 =0; $g_total_paid_un_official1 = 0; $g_total_paid1 = 0; $g_total_due1 = 0; $g_total_till_month_due1 = 0; $g_total_paid_exceed1 = 0; $grand_percent1 =0; @endphp @endif @php $sells_counter = 0; @endphp @endif @endforeach @if($is_summary == 0) @else @endif @if($is_summary == 0 || ($is_summary == 1 && $consolidated_summary)) @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @endif @if($is_summary == 0) @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @if ($show_internal_dealer) @endif @if ($show_external_dealer) @endif @if($is_summary == 0) @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @if($is_summary == 0) @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @if($is_summary == 0) @endif
{{__('lang.product')}} {{__('lang.customer')}} {{__('lang.sale')}} {{__('lang.schedule')}}
{{__('lang.serial_no')}} {{__('lang.registration_no')}}{{__('lang.project_name')}}{{__('lang.product_type')}}{{__('lang.unit_no')}}{{__('lang.block')}} {{__('lang.floor')}} {{__('lang.category')}} {{__('lang.layout')}}{{__('lang.size')}}{{__('lang.rps')}}{{__('lang.nrps')}}{{__('lang.customer')}}{{__('lang.phone')}} {{__('lang.nic')}} {{__('lang.address')}}{{__('lang.sale_date')}}{{__('lang.buyback_date')}}{{__('lang.property_value')}} @if($show_official_label) {{__('lang.official')}} @endif {{__('lang.property_value')}} @if($show_official_label) {{__('lang.unofficial')}} @endif {{__('lang.property_value')}}{{__('lang.a_charges')}}{{__('lang.official')}} @if($show_official_label) {{__('lang.official')}} @endif {{$transaction->systemSettingCurrency()}}{{__('lang.sale')}} @if($show_official_label) {{__('lang.unofficial')}} @endif {{$transaction->systemSettingCurrency()}}{{__('lang.sale')}} {{$transaction->systemSettingCurrency()}}{{__('lang.discount')}} @if($show_official_label) {{__('lang.official')}} @endif {{__('lang.discount')}} @if($show_official_label) {{__('lang.unofficial')}} @endif {{__('lang.discount')}}{{__('lang.i_dealer')}} {{__('lang.i_rebate')}} {{__('lang.e_dealer')}} {{__('lang.e_rebate')}} {{__('lang.net_sale')}}{{__('lang.schedule')}} @if($show_official_label) {{__('lang.official')}} @endif {{$transaction->systemSettingCurrency()}}{{__('lang.schedule')}} @if($show_official_label) {{__('lang.unofficial')}} @endif {{$transaction->systemSettingCurrency()}}{{__('lang.schedule')}} {{$transaction->systemSettingCurrency()}}{{__('lang.total_collection')}} @if($show_official_label) {{__('lang.official')}} @endif{{__('lang.total_collection')}} @if($show_official_label) {{__('lang.unofficial')}} @endif{{__('lang.total_collection')}}{{__('lang.total_collection_percentage')}} @if($show_official_label) {{__('lang.official')}} @endif{{__('lang.total_collection_percentage')}} @if($show_official_label) {{__('lang.unofficial')}} @endif{{__('lang.total_collection_percentage')}}{{__('lang.total_due')}} @if($show_official_label) {{__('lang.official')}} @endif{{__('lang.total_due')}} @if($show_official_label) {{__('lang.unofficial')}} @endif{{__('lang.total_due')}}{{__('lang.total_due_till_month')}} @if($show_official_label) {{__('lang.official')}} @endif{{__('lang.total_due_till_month')}} @if($show_official_label) {{__('lang.unofficial')}} @endif{{__('lang.total_due_till_month')}}{{__('lang.last_payment_date')}} {{__('lang.last_paid_amount')}}{{__('lang.received_exceeded')}} {{$transaction->systemSettingCurrency()}} {{__('lang.sale_status')}}
{{$sell->customer->name}}
{{ $customer_group_by == 1 ? $sells_counter : $loop->iteration }} {{ $sell->registration_no }} {{ $sell->branch->name }}{{ $sell->product->type->name }}{{ $sell->product->product_unique_id }}{{ $sell->product->block->name ?? '-' }} {{ $sell->product->floor->name ?? '-' }} {{ $sell->product->category->name ?? '-' }} {{ $sell->product->type->name ?? '-' }}{{ $sell->product->flat_size }} {{ $sell->product->size_in }}{{ $transaction->convert_money_format($net_rate_per_size) }} {{ $transaction->convert_money_format($rate_per_size_official) }} {{ $transaction->convert_money_format($rate_per_size_unofficial) }} {{ $transaction->convert_money_format($rate_per_size_combine) }} {{ $sell->customer->name }}{{ $sell->customer->phone }} {{ $sell->customer->nid }} {{ $sell->customer->mailing_address }}{{ $transaction->date_format($sell->sale_date_v2) }}{{ $transaction->date_format($sell->sell_buy_back->buyback_date ?? '') }}{{ $transaction->convert_money_format($product_value_official) }} {{ $transaction->convert_money_format($product_value_unofficial) }} {{ $transaction->convert_money_format($product_value_combine) }} {{ number_format($sell->additional_charges, 2) }} {{ $transaction->convert_money_format($sale_amount_official) }} {{ $transaction->convert_money_format($sale_amount_unofficial) }} {{ $transaction->convert_money_format($sale_amount_combine) }} {{ $transaction->convert_money_format($discount_official) }} {{ $transaction->convert_money_format($discount_unofficial) }} {{ $transaction->convert_money_format($discount_combine) }} {!! $internal_dealer_name !!} {!! $transaction->convert_multiline_money_format($internal_dealer_rebate) ?? '-' !!}{!! $external_dealer_name !!} {!! $transaction->convert_multiline_money_format($external_dealer_rebate) ?? '-' !!}{{ number_format($product_net_sale, 2) }}{{ $transaction->convert_money_format($schedule_official) }} {{ $transaction->convert_money_format($schedule_unofficial) }} {{ $transaction->convert_money_format($schedule_combine) }} {{ $transaction->convert_money_format($collected_amount_official) }} {{ $transaction->convert_money_format($collected_amount_unofficial) }}{{ $transaction->convert_money_format($collected_amount_combine) }}{{ $transaction->convert_money_format($collection_percentage_official) }} %{{ $transaction->convert_money_format($collection_percentage_unofficial) }} %{{ $transaction->convert_money_format($collection_percentage_combine) }} %{{ $transaction->convert_money_format($due_amount_official) }} {{ $transaction->convert_money_format($due_amount_unofficial) }}{{ $transaction->convert_money_format($due_amount_combine) }}{{ $transaction->convert_money_format($till_month_due_amount_official) }} {{ $transaction->convert_money_format($till_month_due_amount_unofficial) }}{{ $transaction->convert_money_format($till_month_due_amount_combine) }}{{ $transaction->date_format($last_payment_date) ?? '-' }} {{ $transaction->convert_money_format($last_payment_amount) ?? '-' }}{{ number_format($sell->total_paid_exceed, 2) }} @if ($sell->is_transfered) {{__('lang.transfer')}} @else {{ $sell->status }} @endif
TOTAL {{ number_format($g_total_product_sp1, 2) }} {{ number_format($g_total_additional1, 2) }} {{ number_format($g_total_sale_amount1, 2) }} {{ number_format($g_total_discount1, 2) }} {{ number_format($g_total_internal_rebate1, 2) }} {{ number_format($g_total_external_rebate1, 2) }}{{ number_format($g_total_product_net_sale1, 2) }} {{ number_format($g_total_schedule_amount1, 2) }}{{ number_format($g_total_paid_official1, 2) }} {{ number_format($g_total_paid_un_official1, 2) }}{{ number_format($g_total_paid1, 2) }} {{ number_format($grand_percent1, 2) }}% {{ number_format($g_total_due1, 2) }} {{ number_format($g_total_till_month_due1, 2) }} {{ number_format($g_total_paid_exceed1, 2) }}
TOTALTOTAL{{ $transaction->convert_money_format($total_product_value_official) }}{{ $transaction->convert_money_format($total_product_value_unofficial) }}{{ $transaction->convert_money_format($total_product_value_combine) }}{{ number_format($g_total_additional, 2) }}{{ $transaction->convert_money_format($total_sale_amount_official) }}{{ $transaction->convert_money_format($total_sale_amount_unofficial) }}{{ $transaction->convert_money_format($total_sale_amount_combine) }}{{ $transaction->convert_money_format($total_discount_official) }}{{ $transaction->convert_money_format($total_discount_unofficial) }}{{ $transaction->convert_money_format($total_discount_combine) }} {{ number_format($g_total_internal_rebate1, 2) }} {{ number_format($g_total_external_rebate1, 2) }}{{ number_format($g_total_product_net_sale, 2) }}{{ $transaction->convert_money_format($total_schedule_official) }}{{ $transaction->convert_money_format($total_schedule_unofficial) }}{{ $transaction->convert_money_format($total_schedule_combine) }}{{ $transaction->convert_money_format($total_collected_amount_official) }}{{ $transaction->convert_money_format($total_collected_amount_unofficial) }}{{ $transaction->convert_money_format($total_collected_amount_combine) }}{{ $transaction->convert_money_format($total_collection_percentage_official) }} %{{ $transaction->convert_money_format($total_collection_percentage_unofficial) }} %{{ $transaction->convert_money_format($total_collection_percentage_combine) }} %{{ $transaction->convert_money_format($total_due_amount_official) }}{{ $transaction->convert_money_format($total_due_amount_unofficial) }}{{ $transaction->convert_money_format($total_due_amount_combine) }}{{ $transaction->convert_money_format($total_till_month_due_amount_official) }}{{ $transaction->convert_money_format($total_till_month_due_amount_unofficial) }}{{ $transaction->convert_money_format($total_till_month_due_amount_combine) }} {{ number_format($g_total_paid_exceed, 2) }}
{{-- Footer --}} {{-- @if($customer_group_by == 0) --}} @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif @if($show_official) @endif @if($show_unofficial) @endif @if($show_combined) @endif
{{__('lang.total_schedule_amount')}} @if($show_official_label) {{__('lang.official_ucase')}} @endif | {{ $transaction->convert_money_format($total_schedule_official) }}
{{__('lang.total_schedule_amount')}} @if($show_official_label) {{__('lang.unofficial_ucase')}} @endif | {{ $transaction->convert_money_format($total_schedule_unofficial) }}
{{__('lang.total_schedule_amount')}} | {{ $transaction->convert_money_format($total_schedule_combine) }}
{{__('lang.total_collected')}} @if($show_official_label) {{__('lang.official_ucase')}} @endif | {{ $transaction->convert_money_format($total_collected_amount_official) }}
{{__('lang.total_collected')}} @if($show_official_label) {{__('lang.unofficial_ucase')}} @endif | {{ $transaction->convert_money_format($total_collected_amount_unofficial) }}
{{__('lang.total_collected')}} | {{ $transaction->convert_money_format($total_collected_amount_combine) }}
{{__('lang.total_balance')}} @if($show_official_label) {{__('lang.official_ucase')}} @endif | {{ $transaction->convert_money_format($total_due_amount_official) }}
{{__('lang.total_balance')}} @if($show_official_label) {{__('lang.unofficial_ucase')}} @endif | {{ $transaction->convert_money_format($total_due_amount_unofficial) }}
{{__('lang.total_balance')}} | {{ $transaction->convert_money_format($total_due_amount_combine) }}
{{__('lang.total_due_till_month')}} @if($show_official_label) {{__('lang.official_ucase')}} @endif | {{ $transaction->convert_money_format($total_till_month_due_amount_official) }}
{{__('lang.total_due_till_month')}} @if($show_official_label) {{__('lang.unofficial_ucase')}} @endif | {{ $transaction->convert_money_format($total_till_month_due_amount_unofficial) }}
{{__('lang.total_due_till_month')}} | {{ $transaction->convert_money_format($total_till_month_due_amount_combine) }}