@php use App\Models\AppSetting; use Illuminate\Support\Facades\Storage; $companyName = AppSetting::get('company_name', 'Degabriele Kitchens'); $companyAddress = AppSetting::get('company_address', '123 Showroom Drive, Melbourne VIC 3000'); $companyPhone = AppSetting::get('company_phone', '(03) 9999 1234'); $companyEmail = AppSetting::get('company_email', 'quotes@degabrielekitchens.com.au'); $companyAbn = AppSetting::get('company_abn', '12 345 678 901'); $logoPath = AppSetting::get('company_logo'); $gstRate = 0.10; // Group items by section, then by material type within each section $sections = $quote->sections ?? collect(); // Compute totals using retail prices (client-facing PDF) $subtotalRetail = 0; foreach ($sections as $section) { foreach ($section->items as $item) { $retail = $item->total_retail ?? ($item->retail_price ? $item->retail_price * $item->quantity : $item->total ?? 0); $subtotalRetail += (float)$retail; } } $discountAmt = (float)($quote->discount_amount ?? 0); $afterDiscount = $subtotalRetail - $discountAmt; $gst = $afterDiscount * $gstRate; $grandTotal = $afterDiscount + $gst; $depositPct = (float)($quote->deposit_pct ?? 30); $depositAmt = $grandTotal * ($depositPct / 100); @endphp
@if($logoPath && Storage::disk('public')->exists($logoPath)) {{ $companyName }} @else
{{ explode(' ', $companyName)[0] ?? 'Degabriele' }} {{ implode(' ', array_slice(explode(' ', $companyName), 1)) ?: 'Kitchens' }}
@endif
{{ $companyAddress }}
{{ $companyPhone }}  |  {{ $companyEmail }}
QUOTE
{{ $quote->quote_number }}
{{ $quote->statusLabel() }}
Quote To
{{ $quote->contact?->full_name ?? '—' }}
@if($quote->contact?->company){{ $quote->contact->company }}
@endif @if($quote->contact?->email){{ $quote->contact->email }}
@endif @if($quote->contact?->phone){{ $quote->contact->phone }}@endif
Quote Date
{{ $quote->created_at->format('d M Y') }}
Valid Until
{{ $quote->valid_until?->format('d M Y') ?? '—' }}
@if($quote->job)
Job Reference
{{ $quote->job->job_number }}
@endif
Grand Total (inc. GST)
${{ number_format($grandTotal, 2) }}
Deposit ({{ number_format($depositPct, 0) }}%): ${{ number_format($depositAmt, 2) }}
@if($quote->description)

{{ $quote->description }}

@endif @foreach($sections as $section) @php $sectionRetail = 0; foreach ($section->items as $item) { $sectionRetail += (float)($item->total_retail ?? ($item->retail_price ? $item->retail_price * $item->quantity : $item->total ?? 0)); } @endphp
{{ $section->name }}
@foreach($section->items as $item) @php $unitPrice = $item->retail_price ?? $item->unit_price ?? 0; $lineTotal = $item->total_retail ?? ($item->retail_price ? $item->retail_price * $item->quantity : $item->total ?? 0); @endphp @endforeach
Description Item Code Unit Qty Unit Price Total
{{ $item->description }}
@if($item->notes)
{{ $item->notes }}
@endif
@if($item->item_code){{ $item->item_code }}@else@endif {{ $item->unit ?? '—' }} {{ $item->quantity }} ${{ number_format($unitPrice, 2) }} ${{ number_format($lineTotal, 2) }}
{{ $section->name }} Subtotal ${{ number_format($sectionRetail, 2) }}
@endforeach
@if($discountAmt > 0) @endif
Subtotal (ex. GST) ${{ number_format($subtotalRetail, 2) }}
Discount -${{ number_format($discountAmt, 2) }}
GST (10%) ${{ number_format($gst, 2) }}

Total (inc. GST) ${{ number_format($grandTotal, 2) }}
Deposit Required ({{ number_format($depositPct, 0) }}%) ${{ number_format($depositAmt, 2) }}
Terms & Conditions

{{ $quote->terms ?? 'Payment terms: Deposit due on acceptance. Balance due 14 days prior to installation. Prices are inclusive of GST. This quote is valid for 30 days from the date of issue. Degabriele Kitchens reserves the right to vary pricing if materials costs change significantly. All cabinetry and bench-tops are custom manufactured to order and are non-refundable once production has commenced.' }}

Client Acceptance
Signature & Date
Authorised By — {{ $companyName }}
Signature & Date