@extends('layouts.admin') @section('title', $purchase->reference) @section('content') @php $input = 'w-full h-11 px-3 rounded-xl border border-slate-300 dark:border-slate-700 bg-slate-50 dark:bg-slate-800 text-sm outline-none focus:ring-2 ring-brand-500 focus:bg-white dark:focus:bg-slate-900'; $label = 'block text-sm font-semibold mb-2'; $badge = [ 'paid' => 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400', 'partial' => 'bg-amber-500/10 text-amber-600 dark:text-amber-400', 'due' => 'bg-red-500/10 text-red-500', ]; $methods = ['cash' => 'Cash', 'card' => 'Card', 'bank' => 'Bank Transfer', 'cheque' => 'Cheque / PDC']; $pendingPdc = round((float) $purchase->payments->where('status', 'pending')->sum('amount'), 2); $available = round((float) $purchase->due_amount - $pendingPdc, 2); $stBadge = [ 'pending' => 'bg-amber-500/10 text-amber-600 dark:text-amber-400', 'cleared' => 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400', 'bounced' => 'bg-red-500/10 text-red-500', ]; $rate = rtrim(rtrim(number_format($purchase->vat_rate, 2), '0'), '.'); @endphp {{-- Breadcrumb --}}
@if (session('success'))| Product | Net Unit Cost | Qty | Unit | Discount | Tax | Subtotal | |
|---|---|---|---|---|---|---|---|
{{ $item->product_name }} {{ $item->product_code }} |
{{ number_format($item->unit_cost, 2) }} | {{ $item->quantity }} | {{ $item->unit ?: '—' }} | {{ $item->unit ?: '—' }} | {{ number_format($item->discount, 2) }} | {{ number_format($item->vat_amount, 2) }} | {{ number_format($item->line_total, 2) }} |
| Voucher | Date | Method | Cheque details | Status | Amount | Action |
|---|---|---|---|---|---|---|
| #{{ $pay->voucher_no }} | {{ $pay->date->format('d M Y') }} | {{ $methods[$pay->method] ?? $pay->method }} @if ($pay->is_pdc)PDC@endif |
@if ($pay->method === 'cheque')
No: {{ $pay->cheque_no }} · {{ $pay->bank_name }}
Cheque date: {{ $pay->cheque_date?->format('d M Y') }}
@else
{{ $pay->note ?: '—' }}
@endif
|
{{ $pay->status }} | {{ number_format($pay->amount, 2) }} | Voucher @if ($pay->status === 'pending') @endif |
| No payments have been made yet | ||||||