@php $trackedExpenses = $application->expenses->where('status', '!=', 'rejected'); $approvedExpenses = $application->expenses->whereIn('status', ['approved', 'partially_paid', 'paid']); $expenseClassification = fn ($expense) => $expense->feeType?->classification ?? $expense->category; $governmentCost = (float) $approvedExpenses->filter(fn ($expense) => $expenseClassification($expense) === 'government_fee')->sum('subtotal'); $outsourcedCost = (float) $approvedExpenses->filter(fn ($expense) => $expenseClassification($expense) === 'outsourcing')->sum('subtotal'); $otherCost = (float) $approvedExpenses->filter(fn ($expense) => ! in_array($expenseClassification($expense), ['government_fee', 'outsourcing'], true))->sum('subtotal'); $serviceRevenue = (float) $application->typing_fee_total + (float) $application->service_charge_total; @endphp
@foreach([ ['Government paid', $governmentCost, 'text-amber-700'], ['Outsourced cost', $outsourcedCost, 'text-violet-700'], ['Other costs', $otherCost, 'text-rose-700'], ['Service margin', $serviceRevenue - $outsourcedCost - $otherCost, 'text-emerald-700'], ] as [$label, $amount, $color])

{{ $label }}

AED {{ number_format($amount, 2) }}

@endforeach
@if(auth()->user()->hasPermission('expense.create'))

Add Application Cost

Select a tenant fee type, then the supplier, authority, or outsourcing provider responsible for it.

+ Create a new fee type
@csrf
@csrf
@endif

Application Expense & Payment Register

Costs remain visible on this customer service and in the consolidated finance reports.

Application report →
@forelse($application->expenses as $expense) @if(in_array($expense->status, ['approved','partially_paid']) && (float)$expense->balance_due > 0 && auth()->user()->hasPermission('expense.approve')) @endif @empty @endforelse
CostSupplier / SourceTotalPaid / DueStatus / Action
{{ $expense->expense_number }} · {{ $expense->feeType?->name ?? str($expense->category)->replace('_',' ')->title() }}{{ str($expense->feeType?->classification ?? $expense->category)->replace('_',' ')->title() }} · {{ $expense->expense_date->format('d M Y') }} · {{ $expense->description }}{{ $expense->vendor?->name ?? 'Legacy direct payment' }}{{ $expense->payments->pluck('fundingAccount.name')->filter()->unique()->join(', ') ?: 'Not funded yet' }}@if($expense->vendor)Supplier ledger →@endifAED {{ number_format((float)$expense->total_amount,2) }}{{ $expense->expenseAccount?->account_code }} {{ $expense->expenseAccount?->account_name }}AED {{ number_format((float)$expense->paid_amount,2) }}Due AED {{ number_format((float)$expense->balance_due,2) }}{{ str($expense->status)->replace('_',' ')->title() }}
@php $action=['draft'=>'submit','submitted'=>'approve'][$expense->status]??null; @endphp @if($action && auth()->user()->hasPermission('expense.approve'))
@csrf
@endif
@csrf
AEDNo application costs yet

Add government or outsourced costs as they are incurred.