{{ config('settings.company_name')}}
{{ config('settings.address_1')}}, {{ config('settings.address_2')}}, {{ config('settings.city')}}
{{$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 ($extra['branch_status'] == false) @endif @if($extra['summary'] == '1') @endif @if($extra['summary'] == '0') @endif @if($extra['summary'] == '0') @endif @if ($extra['dealer'] == '1') @endif @if ($extra['dealer'] == '1') @endif @if ($infos['items'][0]->file_merge) @endif {{-- --}} {{-- --}} @php $sl = 1; // $total_net_sells_price = 0; $total_collection = 0; $gtotal_collection = 0; $total_due = 0; $total_sale_amount = 0; $total_last_payment = 0; $total_file_amount = 0; $total_internal_rebate = 0; $total_external_rebate = 0; $total_net_sale_amount = 0; $total_discount = 0; $total_net_sale = 0; $total_schedule_amount = 0; $sale_amount = 0; $total_exceeded_amount = 0; $total_additional_charges = 0; @endphp @foreach ($infos['items'] as $key=>$item ) @if ($item->is_transfered == false) @php $due_amount = 0; $last_payment_data = App\Models\ActualReceived::where('sells_id',$item->sells_id)->orderby('created_at','desc')->first(); // $net_sell_price= $item->net_sells_price; $total_collection= $infos['total_collection'][$key]; // $cost_amount = ( !empty($item->revise_rate) ? $item->revise_rate : $item->cost_amount ); $sale_amount = !empty($item->total_amount) ? ($item->cost_amount) : $item->net_amount; if($total_collection==0 || (!empty($item->net_amount) ? $item->net_amount : $item->total_amount) == 0){ $collection_percentage =0; }else{ $collection_percentage = ($total_collection/(!empty($item->net_amount) ? $item->net_amount : $item->total_amount) ) * 100; } // $total_net_sells_price += $item->net_sells_price; $total_sale_amount += $sale_amount ; $total_discount += $item->discount; $total_additional_charges += $item->additional_charges; $total_internal_rebate +=$item->internal_rebate; $total_external_rebate +=$item->external_rebate; $total_schedule_amount += $item->total_amount; $gtotal_collection += $infos['total_collection'][$key]; $total_last_payment +=$last_payment_data->actual_amount; $due_amount = $item->total_amount - $infos['total_collection'][$key]; $total_file_amount += $item->file_sale_amount; $total_profit_loss_amount += $item->loss_or_profit || $item->file_sale_amount > 0 ? $item->loss_amount : $item->profit_amount; @endphp @if ($extra['branch_status'] == false) @endif @php $string = $item->phone; $parts = explode("/", $string); $phone = implode(' / ', $parts); @endphp @if($extra['summary'] == '1') @endif @if($extra['summary'] == '0') @endif {{-- {{dd($item)}} --}} @if($extra['summary'] == '0') @endif @if ($extra['dealer'] == '1') @endif @if ($extra['dealer'] == '1') @endif @if ($infos['items'][0]->file_merge) @if ($item->loss_amount > 0 || $item->profit_amount > 0) @php if(!empty($item->file_sale_amount)) { $file_merge_amount = $item->loss_amount > 0 ? $item->loss_amount : $item->profit_amount; } else { $file_merge_amount = 0; } @endphp @else @endif @endif @php $net_sale = ($sale_amount - $item->discount - $item->external_rebate - $item->internal_rebate + $item->additional_charges); $total_net_sale += $net_sale; @endphp @php if(!empty($infos['total_collection'][$key]) || $infos['total_collection'][$key] > 0) { $percentageTotal = round(($infos['total_collection'][$key] / ($item->total_amount) * 100)) . ' %'; } else { $percentageTotal = 0; } @endphp {{-- --}} {{-- --}} @php $due_amount_till_month = 0; foreach(App\Models\ScheduleReceivable::where('sells_id', $item->sells_id)->where('term', '!=', 'DISCOUNT')->get() as $schedule) { if(trim($schedule['schedule_date']) <= Carbon\Carbon::now()->endOfMonth()->format('Y-m-d')) { $due_amount_till_month += $schedule['payable_amount']; } } $total_due_month = abs(!empty($due_amount_till_month) ? ($due_amount_till_month - App\Models\ActualReceived::where('sells_id', $item->sells_id)->sum('actual_amount')) : 0); @endphp {{-- --}} @php $loss_amount = $item->loss_amount > 0 ? $item->loss_amount : $item->profit_amount; @endphp @php /* $net_sale_amount = ((!empty($item->net_amount) ? $item->net_amount : $item->total_amount) - $item->internal_rebate - $item->external_rebate - $loss_amount - $item->discount); $total_net_sale_amount += $net_sale_amount; */ $total_due += $due_amount; $total_due_till_month += $total_due_month; $total_exceeded_amount += abs($total_due_month <= 0 ? $total_due_month : 0); $sl++; @endphp @endif @endforeach @if ($extra['branch_status'] == false) @endif @php if($extra['summary'] == '1'){ $colspan = '5'; } else{ $colspan = '6'; } @endphp @if($extra['summary'] == '0') @endif @if ($extra['dealer'] == '1') @endif @if ($extra['dealer'] == '1') @endif @if ($infos['items'][0]->file_merge) @endif {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}}
S. No. Registration NoProject NameUnit No CustomerSize Rate Per Size{{__('lang.phone')}}Sale Date Collection DateTotal Sale Additional Charges DiscountInternal DealerInternal Rebate External DealerExternal Rebate File Merge Amount {{$transaction->systemSettingCurrency()}} File Loss/Profit Amount {{$transaction->systemSettingCurrency()}}Net Sale Schedule {{$transaction->systemSettingCurrency()}} Total CollectionTotal Collection In Percentage Total DueTotal Due Till Month
{{ $sl }} {{ $item->registration_no }} {{ $item->branch_name }} {{ $item->product_id }} {{ $item->customer_name }} {{ ($item->size ?? '-').' '.($item->size_in ?? '-') }} {{ $item->rate_per_size ?? '-' }} {{ $phone ?? '-' }} {{ $transaction->date_format($item->sale_date_v2) }} {{ $transaction->date_format($infos['date_of_collection'][$key]) ?$transaction->date_format($infos['date_of_collection'][$key]) : '-' }} {{ $transaction->convert_money_format($sale_amount) }} {{ $transaction->convert_money_format($item->additional_charges) }} {{ $transaction->convert_money_format($item->discount) }}{{ $item->internal_employee_name }}{{ $transaction->convert_money_format($item->internal_rebate) ?? '0'}}{{ $item->external_employee_name }}{{ $transaction->convert_money_format($item->external_rebate) ?? '0'}}{{ $transaction->convert_money_format($item->file_sale_amount) ?? '0' }} {{ $transaction->convert_money_format($file_merge_amount) }}0 {{ $transaction->convert_money_format($net_sale) }} {{ $transaction->convert_money_format($item->total_amount) }} {{ $transaction->convert_money_format( $infos['total_collection'][$key] )}} {{ ($percentageTotal) }} {{ $transaction->convert_money_format( $due_amount) }} {{ $transaction->convert_money_format($total_due_month) }} {{ $transaction->convert_money_format(abs($total_due_month <= 0 ? $total_due_month : 0)) }}
Total {{ $transaction->convert_money_format($total_sale_amount) }} {{ $transaction->convert_money_format($total_additional_charges) }} {{ $transaction->convert_money_format($total_discount) }} {{ $transaction->convert_money_format($total_internal_rebate) }}{{ $transaction->convert_money_format($total_external_rebate) }}{{ $transaction->convert_money_format($total_file_amount) }} {{ $transaction->convert_money_format($total_profit_loss_amount) }}{{ $transaction->convert_money_format( $total_net_sale ) }} {{ $transaction->convert_money_format( $total_schedule_amount ) }} {{ $transaction->convert_money_format( $gtotal_collection ) }} {{ $transaction->convert_money_format( $total_due ) }} {{ $transaction->convert_money_format( $total_due_till_month ) }} {{ $transaction->convert_money_format($total_exceeded_amount) }}
TOTAL COLLECTION | {{ $transaction->convert_money_format($total_schedule_amount) }} {{ $transaction->convert_money_format($total_net_sale) }}
TOTAL COLLECTED | {{ $transaction->convert_money_format($gtotal_collection ) }}{{ $transaction->convert_money_format($infos['sum_total_collection'] ) }}
TOTAL BALANCE | {{ $transaction->convert_money_format( $total_due ) }} {{ $transaction->convert_money_format( $total_due ) }}