@extends('layouts.staff') @section('title', 'Penalty History') @section('content')
{{-- HEADER --}}

Penalty History

{{ $customer->fullName }}

{{-- STATISTICS CARDS --}}

Total Penalties

{{ $totalPenalties }}

Unpaid Penalties

{{ $unpaidPenalties }}

Total Outstanding

RM {{ number_format($totalAmount, 2) }}

{{-- PENALTY LIST --}}

All Penalties

Complete history of penalties for this customer

@if($penalties->count() > 0)
@foreach($penalties as $penalty) {{-- DATE --}} {{-- TYPE --}} {{-- REASON --}} {{-- BOOKING --}} {{-- AMOUNT --}} {{-- RECEIPT COLUMN --}} {{-- STATUS --}} {{-- ACTION COLUMN (VERIFY BUTTON) --}} @endforeach
Date Type Reason Booking Amount Receipt Status Action

{{ \Carbon\Carbon::parse($penalty->date_imposed)->format('d M Y') }}

{{ \Carbon\Carbon::parse($penalty->date_imposed)->format('h:i A') }}

@if($penalty->bookingID) Booking @else Customer @endif

{{ $penalty->reason ?? 'N/A' }}

@if($penalty->bookingID && $penalty->booking) #{{ $penalty->bookingID }} @if($penalty->booking->vehicle)

{{ $penalty->booking->vehicle->vehicleModel ?? 'N/A' }}

@endif @else N/A @endif
@php $totalAmount = $penalty->amount ?? ($penalty->penaltyFees + $penalty->fuelSurcharge + $penalty->mileageSurcharge); @endphp

RM {{ number_format($totalAmount, 2) }}

@if($penalty->bookingID && ($penalty->fuelSurcharge > 0 || $penalty->mileageSurcharge > 0))

@if($penalty->penaltyFees > 0)Penalty: RM{{ number_format($penalty->penaltyFees, 2) }}@endif @if($penalty->fuelSurcharge > 0) | Fuel: RM{{ number_format($penalty->fuelSurcharge, 2) }}@endif @if($penalty->mileageSurcharge > 0) | Mileage: RM{{ number_format($penalty->mileageSurcharge, 2) }}@endif

@endif
@if($penalty->payment_proof) View @else No Upload @endif @if($penalty->penaltyStatus == 'Paid' || $penalty->status == 'Paid') Paid @elseif($penalty->penaltyStatus == 'Pending Verification') Verify @else Unpaid @endif @if($penalty->penaltyStatus == 'Pending Verification')
@csrf
@elseif($penalty->penaltyStatus == 'Paid' || $penalty->status == 'Paid')
Verified
@else - @endif
{{-- PAGINATION --}}
{{ $penalties->links() }}
@else

No Penalties Found

This customer has no penalty records.

@endif
@endsection