@extends('layouts.app') @section('title', 'Warranty') @section('breadcrumb') @endsection @section('content')
{{ $activeCount }}
Active Warranties
{{ $expiringSoon }}
Expiring in 30 Days
{{ $claimedCount }}
Claims
{{ $expiredCount }}
Expired
Warranties ({{ $warranties->total() }})
@forelse($warranties as $warranty) @php $daysLeft = $warranty->days_remaining; $isActive = $warranty->is_active; @endphp @empty @endforelse
Customer Product Serial No. Sale Invoice Start Date End Date Days Left Status Actions
@if($warranty->customer) {{ $warranty->customer->name }}
{{ $warranty->customer->phone }}
@else @endif
{{ $warranty->saleItem?->productVariant?->product?->name ?? '—' }}
{{ $warranty->saleItem?->productVariant?->variant_name ?? '' }}
@if($warranty->serialNumber) {{ $warranty->serialNumber->serial_no }} @else Non-serial @endif @if($warranty->saleItem?->sale) {{ $warranty->saleItem->sale->invoice_no }} @else — @endif {{ $warranty->start_date->format('d M Y') }} {{ $warranty->end_date->format('d M Y') }} @if($warranty->status === 'active') @if($daysLeft <= 0) Expired @elseif($daysLeft <= 7) {{ $daysLeft }}d @elseif($daysLeft <= 30) {{ $daysLeft }}d @else {{ $daysLeft }}d @endif @else @endif @php $wc = ['active'=>'success','expired'=>'danger','claimed'=>'warning','void'=>'secondary']; @endphp {{ ucfirst($warranty->status) }}
No warranty records found.
@if($warranties->hasPages())@endif
@endsection