@extends('docs.master', [ 'title' => $title ?? ($data['title'] ?? 'Report Sale'), ]) @section('content')
{{--

Account Statement : {{$model->unit ? $model->unit->unitname : ''}}

--}}
{{--

{{$model->unitsale_contact ? ($model->unitsale_contact->client ? $model->unitsale_contact->client->person : '') : ''}}

--}}
{{-- --}}
{{--
 

{{$model->unitsale_contact ? ($model->unitsale_contact->client ? $model->unitsale_contact->client->person : '') : ''}}

--}}
@php $totalVat = $model['unitsale_details']->net_price * ($model['unitsale_details']->vat_percentage / 100); @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 : '') }}

Type

{{ $model['unitsale_details'] ? $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->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) @else

VAT

{{ number_format($totalVat ?? 0, 2) }}

@endif

Dues Summary As Of

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

       Down Payment /        Installment

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

Admin Charges / Unit registration

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

Late Payment Charges


SVG Image {{ number_format($model['dataSet']['penalty_balance'] ?? 0, 2) }}

    Total Payment Due


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


@if (isset($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) @php $rowStyle = ''; $latePaymentValue = 0; $receiptValue = 0; $descr = strtolower($item->descr ?? ''); // --- Regular installment due --- if ($item->due > 0) { $rowStyle = ''; $balance += $item->due; $totalDue += $item->due; } // --- Late Payment or Penalty --- elseif ($item->late_amount != 0) { $rowStyle = 'background-color:#f8f8e7'; $latePaymentValue = $item->late_amount; // WaiveOff -> make negative if (str_contains($descr, 'waive')) { $latePaymentValue = -abs($latePaymentValue); } $balance += $latePaymentValue; $totalLatePayment += $latePaymentValue; } // --- Receipt Rows --- elseif ($item->mount_received != 0) { $rowStyle = 'background-color:#e4e7eb'; // If description indicates penalty receipt → treat as late payment reduction if ( str_contains($descr, 'penalty') || str_contains($descr, 'late payment') || str_contains($descr, 'non-payment') ) { $latePaymentValue = -abs($item->mount_received); $totalLatePayment += $latePaymentValue; $balance += $latePaymentValue; } else { // Normal installment receipt $receiptValue = -abs($item->mount_received); $totalReceipts += $item->mount_received; $balance += $receiptValue; } } @endphp {{-- Amount Column --}} {{-- Receipt Column (only for non-penalty receipts) --}} {{-- Late Payment Column (penalties, waiveoffs, or penalty receipts) --}} {{-- Running Balance --}} @endforeach {{-- ✅ Totals --}}
SR# Description Date Amount Receipt Late Payment Balance
{{ $index + 1 }} @if ($item->mount_received > 0) @if (str_contains($descr, 'discount')) Additional Discount @else Receipt Against
{{ $item->descr }} @endif @else {!! $item->descr !!} @endif
{{ $item->due_date ? date('d-M-Y', strtotime($item->due_date)) : '-' }} {{ number_format($item->due ?? 0, 2) }} @if ($receiptValue != 0) {{ number_format($receiptValue, 2) }} @else {{ number_format(0, 2) }} @endif {{ number_format($latePaymentValue, 2) }} {{ number_format($balance, 2) }}
Total {{ number_format($totalDue, 2) }} {{ number_format($totalReceipts, 2) }} {{ number_format($totalLatePayment, 2) }} {{ number_format($balance, 2) }}


Unit Registration / Admin Charges


{{-- @dd($model); --}} @php $totaldld = 0; $totaldldrec = 0; $balancedld = 0; @endphp @foreach ($model['unitsale_details']->dld_admin_ledger as $index => $item) @php $totaldld += $item->charges; $totaldldrec += $item->amount_receipts; $balancedld += $item->charges - $item->amount_receipts; @endphp @endforeach
SR# Description Date Amount Receipt Balance
{{ $index + 1 }} {{ $item->is_additional_discount == 1 ? 'Additional Discount' : $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 ?? 0, 2) }}
Total {{ number_format($totaldld ?? 0, 2) }} {{ number_format($totaldldrec ?? 0, 2) }}

OTHER CHARGES


@if (isset($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; $totalExtReceipts += $item->amount_receipts; $balance += $item->charges - $item->amount_receipts; @endphp @endforeach @endif
SR# Description Date Amount Receipt Balance
{{ $index + 1 }} {{ $item->Details ? $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 ?? 0, 2) }}
Total {{ number_format($totalAmountExtra ?? 0, 2) }} {{ number_format($totalExtReceipts ?? 0, 2) }}

Summary


@if ($model['axtra_amount'][0]->amount > 0) @endif @if ($model['transfer_amount']) @endif @if ($model['unitsale_details']->additional_discount) @endif
SR# Description Amount
{{ 1 }} {{ 'Admin Fee with VAT' }} {{ number_format($model['unitsale_details']->admin_fee + $model['unitsale_details']->admin_fee * 0.05 ?? 0, 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 ?? 0, 2) }}
{{ 5 }} {{ 'Penalties' }} {{ number_format($model['dataSet']['penalty'] ?? 0, 2) }}
{{ 'Total' }} {{ number_format($model['unitsale_details']->dld_charges + $model['unitsale_details']->admin_fee + +($model['unitsale_details']->admin_fee * 0.05) + $totalAmountExtra + $model['unitsale_details']->net_price + $totalVat ?? 0, 2) }}
{{ 'Total Penalty Received' }} {{ number_format($model['dataSet']['penalty_received'] ?? 0, 2) }}
{{ 'Refunds if Any' }} {{ number_format($model['axtra_amount'][0]->amount ?? 0, 2) }}
{{ 'Amount Transferd' }} {{ number_format($model['transfer_amount'] ?? 0, 2) }}
{{ 'Discount' }} {{ number_format($model['unitsale_details']->additional_discount ?? 0, 2) }}
{{ 'Total Receipts' }} {{ number_format($totalReceipts + $totaldldrec + $totalExtReceipts ?? 0, 2) }}
{{ 'Net Balance' }} {{ number_format($model['unitsale_details']->dld_charges + $model['unitsale_details']->admin_fee + +($model['unitsale_details']->admin_fee * 0.05) + $totalAmountExtra + $model['unitsale_details']->net_price + $totalVat + $totalLatePayment + $model['axtra_amount'][0]->amount - ($totalReceipts + $totaldldrec + $totalExtReceipts - $model['transfer_amount']) ?? 0, 2) }}

COLLECTED POST DATED CHEQUES DETAIL


{{-- @dd($model['unitsale_details']); --}}
@if (isset($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; @endphp @endforeach @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 ?? 0, 2) }}

@if (count($model['unitsale_details']->bounce_receipts) > 0)

BOUNCED CHEQUES


{{-- @dd($model['unitsale_details']); --}}
@php $totalMount = 0; @endphp @foreach ($model['unitsale_details']->bounce_receipts as $index => $item) @php $totalMount += $item->amount_received; @endphp @endforeach
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 ?? 0, 2) }}
@endif

Note:

* Please note below Escrow Account Details for online transfers and deposits.
               Bank Name : {{ $model['unitsale_details']->building ? ($model['unitsale_details']->building->project ? $model['unitsale_details']->building->project->bank_name : '-') : '-' }}
               Account Name : {{ $model['unitsale_details']->building ? ($model['unitsale_details']->building->project ? $model['unitsale_details']->building->project->account_title : '-') : '-' }}
               Account No. {{ $model['unitsale_details']->building ? ($model['unitsale_details']->building->project ? $model['unitsale_details']->building->project->account_no : '-') : '-' }}
               IBAN No. {{ $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 discrepency 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}}

--}}
@endsection