@vite('resources/css/app.css')

Invoice

@if($invoice->payment_status === 'paid')
Paid
@endif
Invoice #{{ $invoice->workorder->workorder_number }}

To
{{ $invoice->customer->name }} {{ $invoice->customer->last_name }}
{{ $invoice->customer->address }}
{{ $invoice->customer->city }}, {{ $invoice->customer->province }}
{{ $invoice->customer->phone_number }}
Date: {{ $invoice->invoice_date }}

Labor

@php $laborNumber = 0; $laborTotal = 0; $pricePerHour = $invoice->workorder->price_per_hour ?? 0; @endphp @foreach($invoice->workorder->WorkorderItems as $item) @php $laborNumber++; $hours = $item->hrs ?? 0; $itemTotal = $hours * $pricePerHour; $laborTotal += $itemTotal; @endphp @if(!empty($item->complaint_cause_correction['complaint']) || !empty($item->complaint_cause_correction['cause']) || !empty($item->complaint_cause_correction['correction'])) @endif @endforeach @if($laborNumber > 0) @endif
# Service Hours Rate Total
{{ $laborNumber }}. {{ $item->service->service ?? 'Service' }} {{ $hours }} ${{ number_format($pricePerHour, 2) }}/hr ${{ number_format($itemTotal, 2) }}
@if(!empty($item->complaint_cause_correction['complaint'])) Complaint: {{ $item->complaint_cause_correction['complaint'] }}
@endif @if(!empty($item->complaint_cause_correction['cause'])) Cause: {{ $item->complaint_cause_correction['cause'] }}
@endif @if(!empty($item->complaint_cause_correction['correction'])) Correction: {{ $item->complaint_cause_correction['correction'] }} @endif
Labor Subtotal: ${{ number_format($laborTotal, 2) }}

Parts

@php $partNumber = 0; $partsTotal = 0; @endphp @foreach($invoice->workorder->WorkorderItems as $item) @php $hasParts = ($item->parts->count() > 0) || ($item->inventoryParts->count() > 0); @endphp {{-- Workorder Item Header (only if it has parts) --}} @if($hasParts) @endif {{-- PartsTech Parts --}} @foreach($item->parts as $part) @php $partNumber++; $unitPrice = $part->price['sale'] ?? $part->price['list'] ?? $part->price['cost'] ?? 0; $lineTotal = $unitPrice * $part->quantity; $partsTotal += $lineTotal; @endphp @endforeach {{-- Inventory Parts --}} @foreach($item->inventoryParts as $invPart) @php $partNumber++; $unitPrice = $invPart->price ?? 0; $lineTotal = $unitPrice * $invPart->quantity; $partsTotal += $lineTotal; @endphp @endforeach @endforeach @if($partNumber === 0) @else @endif
# Part Name Qty Unit Price Total
{{ $item->service->service ?? $item->label ?? 'Service' }}
{{ $partNumber }}. {{ $part->part_name }} {{ $part->quantity }} ${{ number_format($unitPrice, 2) }} ${{ number_format($lineTotal, 2) }}
{{ $partNumber }}. {{ $invPart->part->part_name ?? 'Unknown Part' }} {{ $invPart->quantity }} ${{ number_format($unitPrice, 2) }} ${{ number_format($lineTotal, 2) }}
No parts
Parts Subtotal: ${{ number_format($partsTotal, 2) }}

Amount Due {{ $invoice->invoice_date }}

Labor Subtotal: ${{ number_format($laborTotal, 2) }}
Parts Subtotal: ${{ number_format($partsTotal, 2) }}
Total: ${{ number_format($invoice->total_cost, 2) }}
@if($invoice->payment_status === 'unpaid')
@endif
@vite('resources/js/app.js')