@extends('layouts.app') @section('title', 'Contracts') @section('breadcrumb')Contracts@endsection @section('content')
@foreach([['All', 'all'], ['Draft', 'draft'], ['Signed', 'signed'], ['In Progress', 'in_progress'], ['Completed', 'completed']] as [$label, $key])
{{ $stats[$key] }}
{{ $label }}
@endforeach
@forelse($contracts as $contract) @empty @endforelse
Contract # Client Job Status Payments Value Signed
{{ $contract->contract_number }}
{{ $contract->contact?->initials ?? '??' }}
{{ $contract->contact?->full_name ?? '—' }}
{{ $contract->job?->job_number ?? '—' }} @php $sc = match($contract->status) { 'draft' => 'gray', 'sent' => 'blue', 'signed' => 'green', 'deposit_paid' => 'teal', 'in_progress' => 'purple', 'completed' => 'emerald', default => 'gray' }; @endphp {{ $contract->statusLabel() }}
@foreach(['deposit_paid', 'cm_paid', 'delivery_paid', 'completion_paid'] as $f)
@endforeach
{{ collect(['deposit_paid', 'cm_paid', 'delivery_paid', 'completion_paid'])->filter(fn($f) => $contract->$f)->count() }}/4 paid
${{ number_format($contract->contract_price ?? 0) }}
{{ $contract->signed_date?->format('d M Y') ?? '—' }}
No contracts found.
@if($contracts->hasPages())
{{ $contracts->links() }}
@endif
@endsection