@extends('garage.layouts.app') @section('title', 'Claim '.$claim->claim_no) @push('styles') @include('garage.claims.partials.show-page-styles') @endpush @section('content') @php $canApprove = !in_array($claim->status, ['approved','rejected','closed','replacement_issued'], true) && $claim->resolution_type !== 'rejected'; $canMarkReceived = $claim->status === 'pending'; $canReject = !in_array($claim->status, ['rejected','closed'], true); $showWorkflow = $canApprove || $canMarkReceived || $canReject; @endphp
{{-- Header --}}
Claims

{{ $claim->claim_no }}

{{ $claim->claim_date }} · {{ $claim->customer_name }} @if($claim->sale_number) · {{ $claim->sale_number }} @endif
@include('garage.claims.partials.status-badge', ['status' => $claim->status]) @include('garage.claims.partials.resolution-badge', ['resolution' => $claim->resolution_type])
@if($canEdit || $canDelete)
@include('garage.claims.partials.actions-dropdown', [ 'variant' => 'header', 'claimId' => $claim->id, 'claimNo' => $claim->claim_no, 'canEdit' => $canEdit, 'canDelete' => $canDelete, 'showOpen' => false, ])
@endif
@if(session('error'))
{{ session('error') }}
@endif
{{-- Main column --}}
Claim information
Customer
{{ $claim->customer_name ?? '—' }}
Linked sale
{{ $claim->sale_number ?? '—' }}
Warranty vendor
@if($claim->vendor_name) {{ $claim->vendor_name }} @else Not set @if($canEdit) Edit claim to add @endif @endif
Resolution
@include('garage.claims.partials.resolution-badge', ['resolution' => $claim->resolution_type])
@if($hasMovements || $claim->remarks)
@if($hasMovements) Stock movements — header-only edits @endif @if($claim->remarks) Remarks: {{ $claim->remarks }} @endif
@endif
@if($vouchers->isNotEmpty())
Accounting vouchers
@foreach($vouchers as $v)
{{ $v->reference_no ?? 'Voucher #'.$v->id }} {{ $v->voucher_date }} · {{ $v->status }} Discount settlement
@endforeach
@endif
Claim lines
@foreach($items as $it) @endforeach
Part Qty Serial Status Movements Action
{{ $it->part_name }}
@if($it->claim_reason)
{{ $it->claim_reason }}
@endif
{{ number_format((float)$it->qty, 2) }} {{ $it->serial_no ?? '—' }} @include('garage.claims.partials.status-badge', ['status' => $it->status]) @if($it->replacement_purchase_invoice_id)
↗ {{ $it->replacement_bill_number ?? '#'.$it->replacement_purchase_invoice_id }}
@endif @if($it->replacement_sale_id)
↘ {{ $it->replacement_sale_number ?? '#'.$it->replacement_sale_id }}
@endif @if($it->settlement_sale_id)
Sale {{ $it->settlement_sale_number ?? '#'.$it->settlement_sale_id }}
@endif @if($it->settlement_voucher_id) @endif @if(!$it->replacement_purchase_invoice_id && !$it->replacement_sale_id && !$it->settlement_sale_id && !$it->settlement_voucher_id) — @endif
@include('garage.claims.partials.line-actions-dropdown', ['claim' => $claim, 'item' => $it])
{{-- Sidebar --}}
@if($showWorkflow)
Workflow
@if($canApprove || $canMarkReceived)
@if($canApprove)
@csrf
@endif @if($canMarkReceived)
@csrf
@endif
@endif @if($canReject)
@csrf
@endif
@endif @include('garage.claims.partials.flow-guide')
@endsection