{{-- Excel table title format start --}}
{{ config('settings.company_name') }}
{{ config('settings.address_1') }}
{{ $extra['branch'] ? $extra['branch']->name : 'All Projects' }} {{ $heading }} @if ($search_by['from'] && $search_by['to']) {{__('lang.from')}}: {{ $transaction->date_format($search_by['from']) }} {{__('lang.to')}}: {{ $transaction->date_format($search_by['to']) }} @else {{ 'Upto ' . $transaction->date_format(now()) }} @endif
{{-- Excel title format end --}} @php $total_sell_amount = 0; $total_till_month_payable_amount = 0; $total_till_month_balance_amount = 0; $total_collection_official = 0; $total_collection_unofficial = 0; $total_collection = 0; $total_balance = 0; @endphp @foreach ($sells as $sell ) @php $customer = $sell->customer; $product = $sell->product; $rate = $product->rate_per_size + $product->rate_per_size_unofficial; $sell_schedules = $sell->ScheduleReceivableWithoutDiscount; $till_month_due_schedules = $sell->all_till_month_due; $till_month_payable_amount = $till_month_due_schedules->sum('payable_amount') + $till_month_due_schedules->sum('unofficial_payable_amount') ; $till_month_received_amount = $till_month_due_schedules->sum('payment_received_amount') + $till_month_due_schedules->sum('unofficial_payment_received_amount') ; $till_month_balance_amount = $till_month_payable_amount - $till_month_received_amount; $due_terms_count = $sell->till_month_due->count(); $dealer_name = $sell->dealers->implode('DealerName.name', ' , ') ?? '-'; $sell_amount = $sell_schedules->sum('payable_amount'); $collection_amount_official = $received_amounts[$sell->id]['official'] ?? 0; $collection_amount_unofficial = $received_amounts[$sell->id]['unofficial'] ?? 0; $collection_amount = $collection_amount_official + $collection_amount_unofficial; $balance_amount = $sell_amount - $collection_amount; $status = $sell->status; $defaulter_status = ''; $last_payment_data = $sell->all_last_payment_data; $last_received_amount = $last_payment_data->last_received_amount ?? 0; $last_received_date = $last_payment_data->last_date_of_collection ?? null; $collection_percent = 0; if($sell_amount){ $collection_percent = $transaction->convert_money_format(($collection_amount/$sell_amount) * 100); } if($due_terms_count >= 3){ $defaulter_status = __('lang.defaulter_caps'); } $total_sell_amount += $sell_amount; $total_till_month_payable_amount += $till_month_payable_amount; $total_till_month_balance_amount += $till_month_balance_amount; $total_collection_official += $collection_amount_official; $total_collection_unofficial += $collection_amount_unofficial; $total_collection_amount += $collection_amount; $total_balance_amount += $balance_amount; // Badges_start $badge = 'badge badge-success'; if ($sell->is_transfered || $status == 'BLOCKED') { $badge = 'badge badge-danger'; } elseif ($status == 'REACTIVATE'|| $status == 'CANCELLATION' || $status == 'CANCELLED') { $badge = 'badge badge-warning'; } elseif ($status == 'BUY BACK') { $badge = 'badge badge-primary'; } elseif ($status == 'REFUNDED') { $badge = 'badge badge-secondary'; } // Badges_end @endphp @endforeach
{{__('lang.sno')}} {{__('lang.project')}} {{__('lang.registration_no')}} {{__('lang.sale_date')}} {{__('lang.customer_name')}} {{__('lang.customer_contact')}} {{__('lang.dealer_name')}} {{__('lang.area')}} {{__('lang.rate')}} {{__('lang.sale_amount')}} {{__('lang.last_received_date')}} {{__('lang.last_received_amount')}} {{__('lang.demand')}} {{__('lang.received_amount_official')}} {{__('lang.received_amount_unofficial')}} {{__('lang.total_collection')}} {{__('lang.total_collection_percentage')}} {{__('lang.demand_balance')}} {{__('lang.total_balance_lowercase')}} {{__('lang.due_terms')}} {{__('lang.status')}}
{{$loop->iteration}} {{$sell->branch->name}} {{ $sell->registration_no }} {{ $transaction->date_format($sell->sale_date_v2) ?? '-'}} {{ $customer->name}} {{ $customer->phone ?? '-'}} {{ $dealer_name }} {{ $product->flat_size }} {{$product->size_in}} {{ $rate }} {{ $transaction->convert_money_format($sell_amount) }} {{ $transaction->date_format($last_received_date) ?? '-' }} {{ $transaction->convert_money_format($last_received_amount) }} {{ $transaction->convert_money_format($till_month_payable_amount ) }} {{ $transaction->convert_money_format($collection_amount_official) }} {{ $transaction->convert_money_format($collection_amount_unofficial) }} {{ $transaction->convert_money_format($collection_amount) }} {{ $collection_percent }} % {{ $transaction->convert_money_format($till_month_balance_amount) }} {{ $transaction->convert_money_format($balance_amount) }} {{ $due_terms_count }} {{$status}} @if($defaulter_status == 'DEFAULTER')

{{ $defaulter_status }} @endif
{{__('lang.total')}} {{ $transaction->convert_money_format($total_sell_amount) }} {{ $transaction->convert_money_format($total_till_month_payable_amount) }} {{ $transaction->convert_money_format($total_collection_official) }} {{ $transaction->convert_money_format($total_collection_unofficial) }} {{ $transaction->convert_money_format($total_collection) }} {{ $transaction->convert_money_format($total_till_month_balance_amount) }} {{ $transaction->convert_money_format($total_balance) }}