@extends('layouts.app') @section('content')

Payment Details

#{{ $payment->payment_number }}
Payment Information
Payment Number
{{ $payment->payment_number }}
Customer
{{ $payment->customer->CustomerName }} @if($payment->customer->TenantName && $payment->customer->TenantName !== $payment->customer->CustomerName) {{ $payment->customer->TenantName }} @endif @if($payment->customer->Phone1 || $payment->customer->Phone2)
{{ $payment->customer->Phone1 }} @if($payment->customer->Phone2 && $payment->customer->Phone2 !== $payment->customer->Phone1) / {{ $payment->customer->Phone2 }} @endif
@endif
@if($payment->invoice_id)
Applied to Invoice
@if($payment->invoice_type === 'rent') Rent Invoice #{{ $payment->invoice_id }} @else KPLC Invoice #{{ $payment->invoice_id }} @endif
@endif
Payment Amount

KES {{ number_format($payment->TotalPayment, 2) }}

Payment Date
{{ \Carbon\Carbon::parse($payment->PayementDate)->format('F j, Y') }} ({{ \Carbon\Carbon::parse($payment->PayementDate)->diffForHumans() }})
Payment Method
@php $methodClasses = [ 'mpesa' => ['bg-success bg-opacity-10 text-success', 'fa-mobile-alt'], 'bank_transfer' => ['bg-primary bg-opacity-10 text-primary', 'fa-university'], 'cash' => ['bg-warning bg-opacity-10 text-warning', 'fa-money-bill-wave'], 'cheque' => ['bg-info bg-opacity-10 text-info', 'fa-file-invoice-dollar'], 'other' => ['bg-secondary bg-opacity-10 text-secondary', 'fa-ellipsis-h'] ]; $method = strtolower($payment->PaymentMode); $methodClass = $methodClasses[$method] ?? $methodClasses['other']; @endphp {{ ucfirst(str_replace('_', ' ', $method)) }}
@if($payment->ReceiptNo)
Reference Number
{{ $payment->ReceiptNo }}
@endif
Status
@php $status = $payment->Processed ? 'completed' : 'pending'; $statusClasses = [ 'completed' => ['bg-success bg-opacity-10 text-success', 'fa-check-circle', 'Processed'], 'pending' => ['bg-warning bg-opacity-10 text-warning', 'fa-clock', 'Pending'], 'failed' => ['bg-danger bg-opacity-10 text-danger', 'fa-times-circle', 'Failed'], 'refunded' => ['bg-info bg-opacity-10 text-info', 'fa-undo-alt', 'Refunded'] ]; $statusClass = $statusClasses[$status] ?? $statusClasses['pending']; @endphp {{ $statusClass[2] }} @if($payment->Processed && $payment->LastUpdatedate)
Processed on {{ \Carbon\Carbon::parse($payment->LastUpdatedate)->format('M j, Y \a\t g:i A') }} @if($payment->receivedBy) by {{ $payment->receivedBy->name }} @endif
@endif
@if($payment->notes)
Notes
{{ $payment->notes }}
@endif
@if(in_array($payment->status, ['completed', 'pending']))
Payment Actions
@if($payment->status === 'completed') @endif @if($payment->status === 'pending') @endif
@endif
@push('scripts') @endpush @endsection