@if($invoice) Edit Invoice - {{ $invoice->invoiceno }} @else Add Invoice @endif

Insurance Company : {{ $assignment->insuranceCompany->company_name ?? '' }}
Adjuster : {{ $assignment->adjuster->name ?? '' }}
Claim Number : {{ $assignment->claim_number }}
Assignment Type : {{ $assignment->unitType->unit_type ?? '' }}
Type of Claim : {{ $assignment->claimType->claim_type ?? '' }}
Type of loss : {{ $assignment->lossType->loss_type ?? '' }}
Vehicle Location : {{ $assignment->vehicle_location }} ({{ $assignment->vehicle_street }}, {{ $assignment->vehicle_city }}, {{ $assignment->vehicleState->name ?? '' }}, {{ $assignment->vehicle_postcode }})
Type of vehicle : Year : {{ $assignment->vehicles[0]->vehicle_year ?? '' }}, Make : {{ $assignment->vehicles[0]->vehicle_make ?? '' }}, Model : {{ $assignment->vehicles[0]->vehicle_model ?? '' }}
Estimate Amount : {{ $assignment->appraisalReportData->appraisal_amount ?? '' }}
Total Loss : {{ $assignment->appraisalReportData->total_loss ?? '' }}
Appraiser Note : {!! $assignment->appraiser->appraiser_internal_note ?? '' !!}
Billing message : {!! $assignment->insuranceCompany->billing_page_insurance_notes ?? '' !!}

  {{ $invoice ? 'Invoice Items' : 'Add Items' }}

@if (session()->has('success')) @endif @if (session()->has('error')) @endif
Type Description Unit Insurance Amount Appraiser Amount Appraiser Only Insurance Only
@if(!empty($invoice_items))
Current Invoice Items:
@foreach($invoice_items as $index => $item) @endforeach
Type Description Unit Insurance Amount Subtotal Apply Insurance Amount Action
@if($editing_invoice_index === $index) @else {{ $item['type'] }} @endif @if($editing_invoice_index === $index) @else {{ $item['description'] }} @endif @if($editing_invoice_index === $index) @else {{ $item['unit'] }} @endif @if($editing_invoice_index === $index) @else ${{ number_format($item['insurance_amount'], 2) }} @endif ${{ number_format(($item['unit'] ?? 0) * ($item['insurance_amount'] ?? 0), 2) }} @if($editing_invoice_index === $index) @else {{ $item['apply_insurance_amount'] ? 'Yes' : 'No' }} @endif @if($editing_invoice_index === $index) @else @endif
Total: ${{ number_format( collect($invoice_items) ->map( fn($item) => (float) ($item['insurance_amount'] ?? 0) * (float) ($item['unit'] ?? 0) ) ->sum(), 2 ) }}
@endif @if(!empty($payroll_items))
Current Payroll Items:
@foreach($payroll_items as $pindex => $pitem) @endforeach @php $payrollTotal = collect($payroll_items ?? []) ->map(fn($it) => (float) ($it['appraiser_amount'] ?? 0) * (float) ($it['appraiser_unit'] ?? 0)) ->sum(); $grandTotal = $payrollTotal; @endphp
Appraiser Name Date Created Type Description Appraiser Unit Appraiser Amount Subtotal Manual Appraiser Fee Action
{{ $pitem['appraiser_name'] }} {{ $pitem['created_at']->format('m/d/Y') }} @if($editing_payroll_index === $pindex) @else {{ $pitem['type'] }} @endif @if($editing_payroll_index === $pindex) @else {{ $pitem['description'] }} @endif @if($editing_payroll_index === $pindex) @else {{ $pitem['appraiser_unit'] }} @endif @if($editing_payroll_index === $pindex) @else {{ $pitem['appraiser_amount'] ? '$' . number_format($pitem['appraiser_amount'], 2) : '-' }} @endif ${{ number_format(($pitem['appraiser_unit'] ?? 0) * ($pitem['appraiser_amount'] ?? 0), 2) }} @if($editing_payroll_index === $pindex) @else {{ $pitem['manual_appraiser_fee'] ? 'Yes' : 'No' }} @endif @if($editing_payroll_index === $pindex) @else @endif
Total: ${{ number_format($grandTotal, 2) }}
@endif
@if(!empty($invoice_items) || !empty($payroll_items)) @if($show_create_invoice_button || $invoice) @endif @if($invoice) @endif @endif
@push('scripts') @endpush
@if ($showChangeToInvoiceNeededModal) @endif