@extends('layouts.app') @section('title', $deal->deal_no) @section('heading', 'Deal '.$deal->deal_no) @section('content') @php $st = $deal->status; $kes = fn ($v) => 'KSh '.number_format((float) $v, 2); $isFinance = $deal->payment_type === 'finance'; $balance = $deal->balance_due; $docs = $deal->documents->where('status', 'issued')->keyBy('type'); @endphp
{{ $st->label() }} {{ $isFinance ? 'Finance' : 'Cash' }} deal· {{ $deal->salesperson?->name }} · started {{ $deal->created_at->format('d M Y') }}
{{ $deal->vehicle->stock_id }} · {{ $deal->vehicle->vin }} @can('customers.view')· Customer profile@endcan @if ($deal->lead_id) · Lead@endif
The discount of {{ $policy['percent'] }}% needs {{ $policy['level'] }} approval ({{ $policy['below_minimum'] ? 'it takes the price below the vehicle\'s minimum' : 'over the '.$policy['manager_limit'].'% limit' }}{{ $policy['level'] === 'director' ? '; above '.$policy['director_limit'].'% or below cost needs a director' : '' }}). Add a reason, then submit.
@endif @if ($currentApproval){{ $currentApproval->discount_percent }}% off ({{ $kes($currentApproval->discount_amount) }}), requested by {{ $currentApproval->requester?->name }}. @if ($currentApproval->below_minimum) Below the vehicle's minimum price. @endif Reason: {{ $currentApproval->reason }}
Margin on the vehicle (price after discount less landed cost): {{ $kes(bcsub((string) $deal->net_price, (string) $deal->vehicle->landed_cost, 2)) }}
@endcan| # | Due | Instalment | Interest | Balance |
|---|---|---|---|---|
| {{ $row['n'] }} | {{ $row['due_date'] }} | {{ number_format((float) $row['installment'], 2) }} | {{ number_format((float) $row['interest'], 2) }} | {{ number_format((float) $row['closing'], 2) }} |
| Date | Method | Reference | Amount | Actions |
|---|---|---|---|---|
| {{ $p->received_on->format('d M Y') }} | {{ $p->method->name }}{{ $p->payer === 'financier' ? ' (lender)' : '' }} | {{ $p->reference }} | {{ number_format((float) $p->amount, 2) }} | @if ($p->receipt)Receipt@endif
@if ($p->status === 'confirmed' && $st !== \App\Enums\DealStatus::Completed) @can('payments.refund')
Reverse |
| Nothing received yet. | ||||