@extends('layouts.app') @section('title', 'Payment') @section('content')

Payment Management

Manage customer payments and outstanding balances.

{{-- Success Message --}} @if(session('success'))
{{ session('success') }}
@endif {{-- Error Message --}} @if(session('error'))
{{ session('error') }}
@endif {{-- Summary Cards --}}
{{-- Total Payments --}}

Total Payments

{{ $totalPayments }}

{{-- Paid Payments --}}

Paid Payments

{{ $paidInvoices }}

@php $paidPercentage = $totalPayments > 0 ? round(($paidInvoices / $totalPayments) * 100) : 0; @endphp
{{-- Pending Payments --}}

Pending Payments

{{ $pendingInvoices }}

@php $pendingPercentage = $totalPayments > 0 ? round(($pendingInvoices / $totalPayments) * 100) : 0; @endphp
{{-- Total Amount --}}

Total Amount Received

Rs. {{ number_format($totalPayment, 2) }}

{{-- Search & Filter --}}

Search & Filter

{{-- Search --}}
{{-- Status --}}
{{-- Payment Method --}}
{{-- Date --}}
{{-- Buttons --}}
Reset
{{-- Payment List --}}

Payment List

@forelse($payments as $payment) {{-- Payment ID --}} {{-- Invoice --}} {{-- Customer --}} {{-- Payment Date --}} {{-- Payment Method --}} {{-- Amount --}} {{-- Remaining --}} {{-- Status --}} {{-- Received By --}} {{-- Actions --}} @empty @endforelse
# Invoice No. Customer Name Payment Date Payment Method Amount Paid Remaining Balance Payment Status Received By Actions
{{ $payment->payment_id }} @if($payment->order) {{ $payment->order->serial_number ?? 'N/A' }} @else N/A @endif {{ $payment->customer->customer_name ?? 'N/A' }} {{ $payment->payment_date ? $payment->payment_date->format('d-M-Y h:i A') : 'N/A' }} {{ $payment->method->method_type ?? 'N/A' }} Rs. {{ number_format((float)$payment->amount_paid, 2) }} Rs. {{ number_format((float)$payment->remaining_amount, 2) }} @php $status = strtolower( $payment->status->status_name ?? '' ); @endphp @if($status === 'paid')
Paid
@elseif($status === 'partial')
Partial
@elseif($status === 'pending')
Pending
@else
{{ $payment->status->status_name ?? 'Unknown' }}
@endif
{{ $payment->receiver->user_name ?? 'N/A' }}
@csrf @method('DELETE')
No payments found

No payment records match your search.

Add First Payment
{{-- Pagination --}} @if($payments->hasPages())
{{ $payments->links() }}
@endif
@endsection