@extends('docs.master', ['title' => 'Receipt List']) @section('content') @php // Define $totalVat at the top to ensure it's available $totalVat = isset($model['unitsale_details']->net_price) && isset($model['unitsale_details']->vat_percentage) ? $model['unitsale_details']->net_price * ($model['unitsale_details']->vat_percentage / 100) : 0; @endphp

Customer Details:

@foreach ($model['unitsale_contact_joint']->clients ?? [] as $index => $item) {{ $item->client ? $item->client->id + 1000000 : '-' }} @if ($index < count($model['unitsale_contact_joint']->clients ?? []) - 1) , @endif @endforeach

@foreach ($model['unitsale_contact_joint']->clients ?? [] as $index => $item) {{ $item->client ? $item->client->person : '-' }} @if ($index < count($model['unitsale_contact_joint']->clients ?? []) - 1) , @endif @endforeach

Purchase Date

{{ $model['unitsale_details'] ? date('d-M-Y', strtotime($model['unitsale_details']->booking_date ?? '')) : '-' }}

Unit No

{{ $model['unitsale_details'] && $model['unitsale_details']->unit ? $model['unitsale_details']->unit->unitname : '-' }}

Address

{{ $model['unitsale_contact'] && $model['unitsale_contact']->client && $model['unitsale_contact']->client->billing_address ? $model['unitsale_contact']->client->billing_address : '-' }}

Purchase Price

{{ number_format($model['unitsale_details'] ? $model['unitsale_details']->net_price : 0, 2) }}

Type

{{ $model['unitsale_details'] && $model['unitsale_details']->unittype ? $model['unitsale_details']->unittype['unittype'] : '-' }}

Mobile:

{{ $model['unitsale_contact'] && $model['unitsale_contact']->client ? $model['unitsale_contact']->client->mobile_number : '-' }}

Paid Up

{{ number_format($model['total_receipts'] ?? 0, 2) }}

Project

{{ $model['unitsale_details'] && $model['unitsale_details']->building && $model['unitsale_details']->building->project ? $model['unitsale_details']->building->project['projectname'] : '-' }}

Email:

{{ $model['unitsale_contact'] && $model['unitsale_contact']->client ? $model['unitsale_contact']->client->email : '-' }}

PDC's In Hand

{{ number_format($model['total_pdcs'] ?? 0, 2) }}

@if ($totalVat > 0)

VAT

{{ number_format($totalVat, 2) }}

@endif

Dues Summary As Of

{{ date('d-M-Y') }}

Installment

{{ number_format(($model['total_installment'] ?? 0) - ($model['installment_receipts'] ?? 0) + ($model['axtra_amount'][0]->amount ?? 0), 2) }}

Admin Charges / Unit Registration

{{ number_format(($model['unitsale_details']->dld_charges ?? 0) + ($model['unitsale_details']->admin_fee ?? 0) + (($model['unitsale_details']->admin_fee ?? 0) * 0.05) - ($model['total_dld_admin_receipts'] ?? 0), 2) }}

Late Payment Charges

{{ number_format($model['total_late_payment'] ?? 0, 2) }}

Total Payment Due

{{ number_format(($model['total_dues'] ?? 0) + ($model['unitsale_details']->dld_charges ?? 0) + ($model['unitsale_details']->admin_fee ?? 0) + (($model['unitsale_details']->admin_fee ?? 0) * 0.05) - ($model['total_dld_admin_receipts'] ?? 0) + ($model['axtra_amount'][0]->amount ?? 0), 2) }}


@if (isset($model['unitsale_details']['sale_terms']) && !empty($model['unitsale_details']['sale_terms']))

PAYMENT TERMS


@foreach ($model['unitsale_details']['sale_terms'] as $index => $item) * {{ $item->percentage }}% {{ $item->paymenttype->paymenttypedetail ?? '-' }}    @endforeach

@endif

SCHEDULE


@php $balance = 0; $totalDue = 0; $totalReceipts = 0; $totalLatePayment = 0; @endphp @foreach ($model['model'] ?? [] as $index => $item) late_amount != 0) style="background-color: #f8f8e7" @elseif ($item->mount_received) style="background-color: #e4e7eb" @endif> @php if ($item->due > 0) { $balance += $item->due; $totalDue += $item->due; } elseif ($item->late_amount != 0) { $balance += $item->late_amount; $totalLatePayment += $item->late_amount; } elseif ($item->mount_received) { $balance -= $item->mount_received; $totalReceipts += $item->mount_received; } @endphp @endforeach
SR# Description Date Amount Receipt Late Payment Balance
{{ $index + 1 }} {{ $item->mount_received > 0 ? (str_contains(strtolower($item->descr ?? ''), 'discount') ? 'Additional Discount' : 'Receipt') : ($item->descr ?? '-') }} {{ $item->due_date ? date('d-M-Y', strtotime($item->due_date ?? '')) : '-' }} {{ number_format($item->due ?? 0, 2) }} {{ number_format($item->mount_received ?? 0, 2) }} {{ number_format($item->late_amount ?? 0, 2) }} {{ number_format($balance, 2) }}
Total {{ number_format($totalDue, 2) }} {{ number_format($totalReceipts, 2) }} {{ number_format($totalLatePayment, 2) }}


Unit Registration / Admin Charges


@php $totaldld = 0; $totaldldrec = 0; $balancedld = 0; @endphp @foreach ($model['unitsale_details']->dld_admin_ledger ?? [] as $index => $item) @php $totaldld += $item->charges ?? 0; $totaldldrec += $item->amount_receipts ?? 0; $balancedld += ($item->charges ?? 0) - ($item->amount_receipts ?? 0); @endphp @endforeach
SR# Description Date Amount Receipt Balance
{{ $index + 1 }} {{ $item->charge_type ?? '-' }} {{ $item->transaction_date ? date('d-M-Y', strtotime($item->transaction_date ?? '')) : '-' }} {{ number_format($item->charges ?? 0, 2) }} {{ number_format($item->amount_receipts ?? 0, 2) }} {{ number_format($balancedld, 2) }}
Total {{ number_format($totaldld, 2) }} {{ number_format($totaldldrec, 2) }}

Other Charges


@if (isset($model['unitsale_details']->extra_charges_ledger) && !empty($model['unitsale_details']->extra_charges_ledger)) @php $totalAmountExtra = 0; $totalExtReceipts = 0; $balance = 0; @endphp @foreach ($model['unitsale_details']->extra_charges_ledger as $index => $item) @php $totalAmountExtra += $item->charges ?? 0; $totalExtReceipts += $item->amount_receipts ?? 0; $balance += ($item->charges ?? 0) - ($item->amount_receipts ?? 0); @endphp @endforeach @else @endif
SR# Description Date Amount Receipt Balance
{{ $index + 1 }} {{ $item->Details ?? '-' }} {{ $item->transaction_date ? date('d-M-Y', strtotime($item->transaction_date ?? '')) : '-' }} {{ number_format($item->charges ?? 0, 2) }} {{ number_format($item->amount_receipts ?? 0, 2) }} {{ number_format($balance, 2) }}
Total {{ number_format($totalAmountExtra, 2) }} {{ number_format($totalExtReceipts, 2) }}
No extra charges available

Summary


SR# Description Amount
1 Admin Fee with VAT {{ number_format(($model['unitsale_details']->admin_fee ?? 0) + (($model['unitsale_details']->admin_fee ?? 0) * 0.05), 2) }}
2 DLD Charges {{ number_format($model['unitsale_details']->dld_charges ?? 0, 2) }}
3 Purchase Price {{ number_format($model['unitsale_details']->net_price ?? 0, 2) }}
4 Other Charges {{ number_format($totalAmountExtra ?? 0, 2) }}
5 VAT {{ number_format($totalVat, 2) }}
Total {{ number_format(($model['unitsale_details']->dld_charges ?? 0) + ($model['unitsale_details']->admin_fee ?? 0) + (($model['unitsale_details']->admin_fee ?? 0) * 0.05) + ($totalAmountExtra ?? 0) + ($model['unitsale_details']->net_price ?? 0) + $totalVat, 2) }}
Total Penalties {{ number_format($totalLatePayment ?? 0, 2) }}
Total Receipts {{ number_format(($totalReceipts ?? 0) + ($totaldldrec ?? 0) + ($totalExtReceipts ?? 0), 2) }}
Net Balance {{ number_format(($model['unitsale_details']->dld_charges ?? 0) + ($model['unitsale_details']->admin_fee ?? 0) + (($model['unitsale_details']->admin_fee ?? 0) * 0.05) + ($totalAmountExtra ?? 0) + ($model['unitsale_details']->net_price ?? 0) + $totalVat + ($totalLatePayment ?? 0) + ($model['axtra_amount'][0]->amount ?? 0) - (($totalReceipts ?? 0) + ($totaldldrec ?? 0) + ($totalExtReceipts ?? 0) - ($model['transfer_amount'] ?? 0)), 2) }}

COLLECTED POST DATED CHEQUES DETAIL


@if (isset($model['unitsale_details']->pdc_installment_ledger) && !empty($model['unitsale_details']->pdc_installment_ledger)) @php $totalMount = 0; @endphp @foreach ($model['unitsale_details']->pdc_installment_ledger as $index => $item) @php $totalMount += $item->amount_received ?? 0; @endphp @endforeach @else @endif
SR# Chq Date Chq No Amount
{{ $index + 1 }} {{ $item->payment_date ? date('d-M-Y', strtotime($item->payment_date ?? '')) : '-' }} {{ $item->chq_no ?? '-' }} {{ number_format($item->amount_received ?? 0, 2) }}
Total {{ number_format($totalMount, 2) }}
No post-dated cheques available

Note:

* PLEASE NOTE BELOW ESCROW ACCOUNT DETAILS FOR ONLINE TRANSFERS AND DEPOSITS.
Bank Name: {{ $model['unitsale_details'] && $model['unitsale_details']->building && $model['unitsale_details']->building->project ? $model['unitsale_details']->building->project->bank_name : '-' }}
Account Name: {{ $model['unitsale_details'] && $model['unitsale_details']->building && $model['unitsale_details']->building->project ? $model['unitsale_details']->building->project->account_title : '-' }}
Account No: {{ $model['unitsale_details'] && $model['unitsale_details']->building && $model['unitsale_details']->building->project ? $model['unitsale_details']->building->project->account_no : '-' }}
IBAN No: {{ $model['unitsale_details'] && $model['unitsale_details']->building && $model['unitsale_details']->building->project ? $model['unitsale_details']->building->project->iban_no : '-' }}

* YOU ARE REQUESTED TO PLEASE SEND PAYMENT DETAIL OR PROOF OF PAYMENT TO Accounts@empiredevelopment.ae

* PLEASE EMAIL US ON Accounts@empiredevelopment.ae WITHIN 15 DAYS FROM STATEMENT OF ACCOUNT DATE IN CASE OF ANY DISCREPANCY OTHERWISE THIS STATEMENT OF ACCOUNT WILL BE CONSIDERED AS ACCEPTED AND CONFIRMED BY THE CLIENT.

* THE ABOVE POST DATED CHEQUES AMOUNTS ARE NOT GOING TO REFLECT IN YOUR STATEMENT UNTIL REALISATION OF CHEQUES FROM YOUR BANK.

PRINTED ON: {{ date('d-m-Y h:i:s A') }} BY {{ Auth::User()->name ?? 'Unknown' }}

@endsection