@php $unit = 0; foreach ($invoice->items as $item) { $unit += $item->booking->unit ?? 0; } $totalHours = floor($unit); $totalMinutes = round(($unit - floor($unit)) * 60); if ($totalMinutes >= 60) { $totalHours += 1; $totalMinutes = 0; } $hoursDisplay = $totalMinutes > 0 ? $totalHours . 'h ' . $totalMinutes . 'm' : (string) $totalHours; @endphp
{{-- HEADER --}}
First Ride Driving School
www.firstride.com.au
INVOICE
DATE: {{ \Carbon\Carbon::parse($invoice->invoice_date)->format('F j, Y') }}
INVOICE NUMBER: {{ $invoice->invoice_number }}
{{-- CUSTOMER + PAYMENT --}}
{{ $invoice->student->user->name ?? '-' }}
Mobile: {{ $invoice->student->user->phone ?? '-' }}
Email: {{ $invoice->student->user->email ?? '-' }}
Address: {{ $invoice->student->user->address->full_address ?? '-' }}
Payment Method

First Ride Pty Ltd

BSB: 062-692

Account No: 4311 3669

PayID: 6 4687 7536 (ACN no)

{{-- LINE ITEMS --}} @foreach ($invoice->items as $index => $item) @php $description = $item->description ?? ''; $descLower = strtolower($description); $isHighlight = str_contains($descLower, 'prior test') || str_contains($descLower, 'car hire') || str_contains($descLower, 'test lesson'); $lessonDateRaw = $item->booking->lesson_date ?? null; $lessonDate = 'N/A'; if ($lessonDateRaw) { try { $lessonDate = \Carbon\Carbon::parse($lessonDateRaw)->format('D d M, Y'); } catch (\Exception $e) { $lessonDate = $lessonDateRaw; } } $teacherName = trim( ($item->booking->instructor->user->name ?? '') . ' ' . ($item->booking->instructor->user->last_name ?? '') ); @endphp @endforeach
Lesson Date Description Teacher Units Unit Price Amount
{{ $lessonDate }} {{ $description ?: 'N/A' }} {{ $teacherName ?: '-' }} {{ $item->booking->unit ?? 'N/A' }} ${{ number_format($item->booking->lessonType->unit_price ?? 0, 2) }} ${{ number_format($item->booking->price ?? 0, 2) }}
{{-- TOTALS + FOOTER CONTENT --}}
Total Lessons: {{ number_format(count($invoice->items)) }}
Total Hours: {{ $hoursDisplay }}
Questions:
Email us at
Or call us at 0421 954 160
SubTotal ${{ number_format($invoice->subtotal, 2) }}
{{ $invoice->discount_reason ?? 'Discount' }} -${{ number_format($invoice->discount, 2) }}
Received ${{ number_format($amountReceived ?? 0, 2) }}
Invoice Total
(GST Included)
${{ number_format($invoice->total - ($amountReceived ?? 0), 2) }}
Thank You!
{{-- FOOTER --}}