@extends('layouts.pdf') @section('title') {{ $extra['module_name'] }} @endsection @section('content')
{{ 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
@php $total_payable_amount= 0; $total_received_amount = 0; $total_balance_amount= 0; @endphp @if( !empty($infos) ) @foreach($infos as $item ) @php $total_payable_amount+=$item->payable_amount; $total_received_amount+=$item->total_received; $total_balance_amount+=$item->balance; $internal+=$item->internal_rebate; $external+=$item->external_rebate; $net_sale_amount = ($total_payable_amount - $total_internal_rebate - $total_external_rebate); @endphp @endforeach @endif
Total Receivable Customer: {{$transaction->convert_money_format($total_payable_amount)}}
Total Paid Amount:
Total Receivable: {{$transaction->convert_money_format($total_balance_amount)}}
Total Internal Rebate: {{$transaction->convert_money_format($internal)}}
Total External Rebate: {{$transaction->convert_money_format($external)}}
Net Sale Amount: {{$transaction->convert_money_format($net_sale_amount)}}
@if ($params['block'] != '0' ) @endif @if ($params['floor_number'] != '0' ) @endif @if ($params['product_type'] != '0' ) @endif
Block : {{ $params['block'] }}
Floor : {{ $params['floor_number'] }}
{{__('lang.type')}} : {{App\Models\ProductType::find($params['product_type'])->name}}

@php $counter = 1; $total_payable_amount= 0; $total_received_amount = 0; $total_balance_amount= 0; @endphp @if( !empty($infos) ) @foreach( $infos as $item ) @php $query = App\Models\ScheduleReceivable::WHERE('sells_id',$item->sells_id)->where('already_received',true)->orderBy('id', 'asc')->first(); $checkActualReceived = App\Models\ActualReceived::where('sells_id',$item->sells_id)->orderBy('created_at', 'desc')->first(); if($checkActualReceived) { $upcoming_id = App\Models\ActualReceivedItem::where('sells_id',$item->sells_id)->orderBy('created_at', 'desc')->first()->schedule_receivable_id; $last_payment = $checkActualReceived->actual_amount; $last_payment_date = $checkActualReceived->date_of_collection; $last_payment_date = $last_payment_date ? date(Config('settings.date_format'),strtotime(trim(str_replace('/', '-', $last_payment_date)))) : '-'; } else { $upcoming_id = $query->id; $last_payment = $query->already_received_amount; $last_payment_date = $query->already_received_date; $last_payment_date = $last_payment_date ? date(Config('settings.date_format'),strtotime(trim(str_replace('/', '-', $last_payment_date)))) : '-'; } $upcomingQuery = App\Models\ScheduleReceivable::leftJOIN('actual_received_items as ari','ari.schedule_receivable_id','=','schedule_receivables.id') ->WHERE('schedule_receivables.id',$upcoming_id+7)->first(); // if(empty($upcomingQuery)) // { // $upcomingQuery = App\Models\ScheduleReceivable::leftJOIN('actual_received_items as ari','ari.schedule_receivable_id','=','schedule_receivables.id') // ->WHERE('schedule_receivables.id',$upcoming_id+7)->first(); // } $upcoming_payment = $upcomingQuery->payable_amount - ($upcomingQuery->already_received_amount + $upcomingQuery->received_amount); if($upcoming_payment == 0){ $upcomingQuery = App\Models\ScheduleReceivable::leftJOIN('actual_received_items as ari','ari.schedule_receivable_id','=','schedule_receivables.id') ->WHERE('schedule_receivables.id',$upcoming_id+2)->first(); } if(!$upcomingQuery){ $upcomingQuery = App\Models\ScheduleReceivable::WHERE('sells_id',$item->sells_id)->first(); } $upcoming_payment = $upcomingQuery->payable_amount - ($upcomingQuery->already_received_amount + $upcomingQuery->received_amount); $upcoming_payment_date = date(Config('settings.date_format'),strtotime(trim(str_replace('/', '-', $upcomingQuery->schedule_date)))); @endphp @php $total_payable_amount+=$item->payable_amount; $total_received_amount+=$item->total_received; $total_balance_amount+=$item->balance; @endphp @endforeach @endif
{{ $search_by['branch'] == 0 ? 'ALL PROJECT' : App\Models\Branch::where('id', $search_by['branch'] )->first()->name }}
S. No. Registration No Unit No Customer {{__('lang.phone')}} Last Paid Amount {{$transaction->systemSettingCurrency()}} Last Paid Date Total Sell {{$transaction->systemSettingCurrency()}} Total Paid Amount {{$transaction->systemSettingCurrency()}} Total Balance Amount {{$transaction->systemSettingCurrency()}} Upcoming Payment Upcoming Payment Date
{{$loop->iteration}} {{$item->registration_no}} {{$item->product_id}} {{$item->customer_name}} {{$item->customer_phone}} {{ $transaction->convert_money_format( $last_payment ) }} {{ App\Models\Common::checkInvalidDate($last_payment_date) }} {{ $transaction->convert_money_format( $item->payable_amount ) }} {{$transaction->convert_money_format($item->total_received)}} {{$transaction->convert_money_format($item->balance)}} {{$item->payable_amount == $item->total_received ? "0.00" : $transaction->convert_money_format($upcoming_payment)}} {{ $item->payable_amount == $item->total_received ? "-" : App\Models\Common::checkInvalidDate($upcoming_payment_date)}}
Total {{$transaction->convert_money_format($total_payable_amount)}} {{$transaction->convert_money_format($total_received_amount)}} {{$transaction->convert_money_format($total_balance_amount)}}

@stop