@extends('layouts.pdf') @section('title') {{ $extra['module_name'] }} @endsection @section('content') {{--

Printing Date & Time: {{ $extra['current_date_time'] }}

--}}
@include('admin.partials.header', ['extra' => $extra]) @php $dues_total= $total_cost = $total_received = $total_dues_bf_this = $total_dues_till_month = $total_dues = 0; @endphp @if(isset($show_status)) @endif @php $total_property_amount = $total_rebate_ext = $total_rebate_int = $total_sale_amount = $total_difference = 0; @endphp @foreach ($sells as $key => $sell) @php $cost_rate = $sell->product->cost_per_size; $property_size = $sell->product->flat_size; $cost_amount = $sell->product->cost_fixed_amount ?? $cost_rate * $property_size; $badge_class = ''; 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'; } @endphp @php $ext_name = ""; if(!empty($sell->sell_external_dealer_rebate)){ foreach($sell->sell_external_dealer_rebate as $key_I => $ext_emp){ $ext_name .= $ext_emp->DealerName->name . ',' . "\r\n"; } }else{ $ext_name = "-"; } @endphp @php $int_name = ""; if(!empty($sell->sell_internal_dealer_rebate)){ foreach($sell->sell_internal_dealer_rebate as $key_I => $int_emp){ $int_name .= $int_emp->DealerName->name . ',' . "\r\n"; } }else{ $int_name = "-"; } @endphp @php $total = $sell->total_schedule_amount - ($sell->dealers->sum('rebate_amount') +$sell->product->cost_fixed_amount+$sell->total_additional); @endphp @if(isset($show_status)) @php if($total > 0){ $status = "badge badge-success"; }else{ $status = "badge badge-danger"; } @endphp @endif @php $total_property_amount += ($sell->product->fixed_amount+$sell->total_additional); $total_rebate_ext += $sell->sell_external_dealer_rebate->sum('rebate_amount'); $total_rebate_int += $sell->sell_internal_dealer_rebate->sum('rebate_amount'); $total_sale_amount += $sell->total_schedule_amount; $total_difference += $total; @endphp @endforeach @if(isset($show_status)) @endif
{{__('lang.serial_no')}} {{__('lang.customer_name')}} {{__('lang.unit_number')}} {{__('lang.registration_number')}} {{__('lang.external_dealer_name')}} {{__('lang.internal_dealer_name')}} {{__('lang.property')}} {{$transaction->systemSettingCurrency()}} {{__('lang.rebate_amount')}}({{__('lang.external')}}) {{__('lang.rebate_amount')}}({{__('lang.internal')}}) {{__('lang.sale')}} {{$transaction->systemSettingCurrency()}}{{__('lang.variance')}} {{$transaction->systemSettingCurrency()}} {{__('lang.status')}}{{__('lang.sales_status')}}
{{ ++$key }} {{ $sell->customer->name }} {{ $sell->product->product_unique_id }} {{ $sell->registration_no }} {{ number_format($cost_amount + $sell->total_additional,2) }} {{ number_format($sell->sell_external_dealer_rebate->sum('rebate_amount'),2) }} {{ number_format($sell->sell_internal_dealer_rebate->sum('rebate_amount'),2) }} {{ number_format($sell->total_schedule_amount,2) }}{{ ($total < 0) ? "(".number_format($total*(-1),2).")" : number_format($total,2) }} {{ ($total > 0) ? "Profit" : "Loss"}} {{ $sell->status }}
{{__('lang.total')}} {{ number_format($total_property_amount,2) }} {{ number_format($total_rebate_ext,2) }} {{ number_format(($total_rebate_int),2) }} {{ number_format(($total_sale_amount),2) }}{{ number_format($total_difference,2) }}
@stop