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

Record and manage client payments

@if(session('success')) @endif @if($errors->any()) @endif @if(!$isSuperAdmin)
Today's Collections
{{ $company->currency_code }} {{ number_format($totalToday, 2) }}
@else
Today's Collections (All)
₱ {{ number_format($totalToday, 2) }}
@endif
Payment Records
Record New Payment
@if($payments->count() > 0)
@if($isSuperAdmin) @endif @foreach($payments as $payment) @if($isSuperAdmin) @if($payment->billing) @else @endif @endif @endforeach
CompanyClient Amount Type Method Reference Date Status Actions
{{ $payment->billing->client->company->name ?? 'N/A' }}{{ $payment->client->company->name ?? 'N/A' }}{{ $payment->client->name ?? 'N/A' }} {{ $isSuperAdmin ? '₱' : $company->currency_code }} {{ number_format($payment->amount, 2) }} @php $typeColors = [ 'billing' => 'primary', 'installation' => 'success', 'reconnection' => 'warning', 'late_fee' => 'danger', 'deposit' => 'info', 'other' => 'secondary' ]; $typeLabels = [ 'billing' => 'Billing', 'installation' => 'Installation', 'reconnection' => 'Reconnection', 'late_fee' => 'Late Fee', 'deposit' => 'Deposit', 'other' => 'Other' ]; $paymentType = $payment->payment_type ?? 'billing'; $color = $typeColors[$paymentType] ?? 'secondary'; $label = $typeLabels[$paymentType] ?? ucfirst($paymentType); @endphp {{ $label }} {{ ucfirst($payment->payment_method) }} {{ $payment->reference_number ?? 'N/A' }} {{ $payment->payment_date->format('M d, Y') }} {{ ucfirst($payment->status) }} @if($payment->status !== 'voided') @endif {{-- Void acts on the whole billing behind this payment, so it reverses every payment collected against that bill. --}} @if($payment->billing && $payment->billing->isVoidable()) @can('void', $payment->billing) @endcan @endif
@csrf @method('DELETE')
@else
No payments recorded yet. Record your first payment
@endif
@can('void-billings') @include('components.void-billing-modal', ['hasVoidAuthorizer' => $hasVoidAuthorizer]) @endcan @endsection