@php $settings = \App\Models\AppSetting::all()->pluck('value', 'key'); $logoPath = \App\Models\AppSetting::get('company_logo'); $schedule = [ ['Deposit', 'deposit_pct', 'deposit_paid', $contract->depositAmount()], ['Check Measure','cm_pct', 'cm_paid', $contract->cmAmount()], ['Delivery', 'delivery_pct', 'delivery_paid', $contract->deliveryAmount()], ['Completion', 'completion_pct', 'completion_paid', $contract->completionAmount()], ]; $paymentFieldMap = [ 'deposit_paid' => 'Deposit', 'cm_paid' => 'Check Measure', 'delivery_paid' => 'Delivery', 'completion_paid' => 'Completion', ]; $currentLabel = $paymentFieldMap[$paymentType] ?? ''; @endphp
@if($logoPath && \Illuminate\Support\Facades\Storage::disk('public')->exists($logoPath)) Company Logo @else {{ \App\Models\AppSetting::get('company_name', 'Degabriele Kitchens') }} @endif
Contract
{{ $settings['company_name'] ?? '' }}
ABN {{ $settings['company_abn'] ?? '' }}
{{ $settings['company_address'] ?? '1/123 Business Park Drive, Sydney NSW 2000' }}
Phone {{ $settings['company_phone'] ?? '' }}  Email: {{ $settings['company_email'] ?? '' }}
Contract Number {{ $contract->contract_number }}
Date {{ now()->format('d F Y') }}

Invoice to
{{ $contract->contact?->first_name ?? '' }} {{ $contract->contact?->last_name ?? '' }}
{{ $contract->job?->lead?->site_address ?? '' }}
{{ $contract->job?->lead?->site_suburb ?? '' }}  {{ $contract->job?->lead?->site_postcode ?? '' }}
Deliver to
{{ $contract->contact?->first_name ?? '' }} {{ $contract->contact?->last_name ?? '' }}
{{ $contract->job?->site_address ?? '' }}
{{ $contract->job?->site_suburb ?? '' }}  {{ $contract->job?->site_postcode ?? '' }}
Customer Code
{{ $contract->job?->lead?->lead_number ?? '—' }}
Customer Contact No.
{{ $contract->contact?->phone ?? '—' }}

LOT DP NO
CERTIFICATE OF TITLE
STREET ADDRESS: {{ $contract->job?->site_address ?? '' }}
SUBURB {{ $contract->job?->site_suburb ?? '' }}  STATE {{ $contract->job?->site_state ?? '' }}  POSTCODE {{ $contract->job?->site_postcode ?? '' }}

@foreach($schedule as [$label, $pctField, $paidField, $amount]) @endforeach
Payment Stage Percentage Amount
{{ $label }} {{ $contract->$pctField ?? 0 }}% ${{ number_format($amount, 2) }}
Total Contract Price ${{ number_format($contract->contract_price, 2) }}
Sub-total (excl. GST)    ${{ number_format($contract->contract_price / 1.1, 2) }}
GST    ${{ number_format($contract->contract_price - ($contract->contract_price / 1.1), 2) }}
Total includes GST    ${{ number_format($contract->contract_price, 2) }}

Note:
• The deposit by law cannot exceed 10% of the contract price.
• The total amount must be the same as the contract price.
• Progress stages must be stated in clear and plain language.