@extends('admin.layouts.app') @section('page-title', 'Payment Details') @section('page-description', 'Complete transaction information') @section('content') @php $loan = $payment->loan; $installment = $payment->installment; $status = strtolower((string)($payment->status ?? 'unknown')); $statusClass = in_array($status,['paid'],true) ? 'paid' : (in_array($status,['pending','created'],true) ? 'pending' : (in_array($status,['failed','cancelled','cancelled_by_user'],true) ? 'failed' : 'neutral')); @endphp
← Back to Payments
Payment Amount
₹{{ number_format((float)($payment->amount ?? 0),2) }}
{{ $payment->paid_at?->format('d M Y, h:i A') ?? $payment->created_at?->format('d M Y, h:i A') ?? '—' }}

Transaction Details

{{ ucfirst(str_replace('_',' ',$payment->status ?? 'Unknown')) }}
Payment ID
{{ $payment->payment_id ?? '—' }}
Order ID
{{ $payment->order_id ?? '—' }}
Amount
₹{{ number_format((float)($payment->amount ?? 0),2) }}
Currency
{{ $payment->currency ?? 'INR' }}
Payment Method
{{ $payment->payment_method ? ucfirst(str_replace('_',' ',$payment->payment_method)) : ($payment->is_manual ? 'Manual' : 'Online') }}
Reference Number
{{ $payment->reference_number ?? '—' }}
Paid At
{{ $payment->paid_at?->format('d M Y, h:i A') ?? '—' }}
Recorded Type
{{ $payment->is_manual ? 'Admin Manual' : 'Online Gateway' }}

Loan / EMI Information

@if($loan)
Loan Number{{ $loan->loan_number ?? 'Loan #'.$loan->id }}
Loan Amount₹{{ number_format((float)$loan->loan_amount,2) }}
Total Payable₹{{ number_format((float)$loan->total_payable,2) }}
Current Outstanding₹{{ number_format((float)$loan->outstanding_amount,2) }}
Loan Status{{ ucfirst(str_replace('_',' ',$loan->status ?? '—')) }}
@if($installment)
EMI Number#{{ $installment->installment_number }}
EMI Amount₹{{ number_format((float)$installment->emi_amount,2) }}
EMI Paid₹{{ number_format((float)$installment->paid_amount,2) }}
EMI Outstanding₹{{ number_format((float)$installment->outstanding_amount,2) }}
Due Date{{ $installment->due_date?->format('d M Y') ?? '—' }}
EMI Status{{ ucfirst($installment->status ?? '—') }}
@else
This payment is linked to the loan balance, not to one specific EMI installment.
@endif @else
This payment is not linked to a loan.
@endif
@if($payment->remarks)

Remarks

{{ $payment->remarks }}
@endif

Client

@if($payment->user)
{{ strtoupper(substr($payment->user->name,0,1)) }}
{{ $payment->user->name }}
{{ $payment->user->email ?? '—' }}
{{ $payment->user->mobile ?? 'Mobile not available' }}
@else
Client information not available.
@endif

Payment Summary

Amount₹{{ number_format((float)($payment->amount ?? 0),2) }}
Method{{ $payment->payment_method ? ucfirst(str_replace('_',' ',$payment->payment_method)) : ($payment->is_manual ? 'Manual' : 'Online') }}
Status{{ ucfirst(str_replace('_',' ',$payment->status ?? 'Unknown')) }}
Created{{ $payment->created_at?->format('d M Y, h:i A') ?? '—' }}
Updated{{ $payment->updated_at?->format('d M Y, h:i A') ?? '—' }}

Recorded By

@if($payment->recorder)
{{ $payment->recorder->name }}
Administrator
@elseif($payment->is_manual)
Admin information not available.
@else
Online payment — no admin recorder.
@endif
@endsection