{{-- resources/views/quotes/quote_layout.blade.php --}} @php use Modules\Item\Models\Service; $bankAccount = $quote->franchise->province->bankAccount; $business = $quote->business; $user = $quote->user; $client = $business->primaryClient; $address = $business->primaryAddress; $province = $quote->franchise->province; $currency = config('globalSettings.currency.ZAR'); //dd($user->contact->contactMethods, $client->contact->contactMethods); // Excel-derived greens $green1 = '#297983'; $green2 = '#298C9C'; $green3 = '#4AC4D6'; $stampColour = $quote->status->getColor(); $quoteItems = $quote->quoteItems; $quoteServiceQty = []; //loop through each service and increment the quantity foreach ($quoteItems as $item) { $serviceId = $item->item->service_id; if (isset($quoteServiceQty[$serviceId])) { $quoteServiceQty[$serviceId] = [ 'service_id' => $quoteServiceQty[$serviceId]['service_id'], 'quantity' => $quoteServiceQty[$serviceId]['quantity'] + 1, 'subtotal' => $quoteServiceQty[$serviceId]['subtotal'] + $item->item_subtotal, 'vat' => $quoteServiceQty[$serviceId]['vat'] + $item->item_tax_total, 'total' => $quoteServiceQty[$serviceId]['total'] + $item->item_total ]; } else { $quoteServiceQty[$serviceId] = [ 'service_id' => $serviceId, 'quantity' => 1, 'subtotal' => $item->item_subtotal, 'vat' => $item->item_tax_total, 'total' => $item->item_total ]; } } $services = Service::where(Service::PROVINCE_ID, $province->province_id) ->orWhere(Service::PROVINCE_ID, null) ->orderBy(Service::ORDER) ->get(); $serviceItems = []; //Build the services based on the services used inside the quote->items foreach ($services as $service) { $quantity = $quoteServiceQty[$service->service_id]['quantity'] ?? 0; $serviceItems[] = [ 'name' => $service->service_name, 'quantity' => $quantity, 'subtotal' => $quantity ? $quoteServiceQty[$service->service_id]['subtotal'] : 0, 'vat' => $quantity ? $quoteServiceQty[$service->service_id]['vat'] : 0, 'total' => $quantity ? $quoteServiceQty[$service->service_id]['total'] : 0, ]; } //dd($serviceItems); @endphp quote {{ $inv['number'] ?? '' }} {{-- optionally inline built CSS if you want Tailwind styles --}} @if(!empty($inlineCss ?? '')) @endif {{-- ========================= SCREEN VIEW (single page) ========================= --}}
{{-- Decorative GREEN SHARDS background --}}
{{-- BIG CENTER STAMP (screen) --}} @if($stampColour)
{{ $quote->status }}
@endif {{-- Header --}}
Company Logo
Licentia {{ $province->province_name }}
Licensing & Compliance Services
Cell
{{ $user->contact->primaryCell }}
Email
{{ $user->contact->primaryEmail }}

Quote

{{ $quote->status }}
Quote No
{{ $quote->quote_number }}
Date
{{ $quote?->date_expires ?? 'To Be Set' }}
{{-- Bill To / Business --}}

Bill To

Client
{{ $business->business_reg_name ?? $business->business_trading_name }}
Reg No
{{ $business?->business_reg_number ?? '-' }}
Trading As
{{ $business->business_trading_name }}
VAT No
{{ $business?->business_VAT_number ?? 'To Be Advised' }}
Street
{{ $address->street_address }}
Town/City
{{ $address->town->town_name }}
Code
{{ $address->postal_code }}

Contact

Executive
{{ $client->contact->full_name }}
Cell
{{ $client->contact->primary_cell }}
Email
{{ $client->contact->primary_email }}
{{-- Services--}}
{{-- Description (flex) --}} {{-- Quantity --}} {{-- Sub --}} {{-- VAT 15% --}} {{-- Total --}} @forelse($serviceItems as $line) @php $qty = (float) ($line['quantity'] ?? 1); $sub = $line['subtotal']; $vat = $line['vat']; $total = $line['total']; @endphp @empty @endforelse
Description Quantity Sub VAT {{ config('globalSettings.tax_rate') }}% Total
{{ $line['name'] ?? '' }}
@if(!empty($line['note']))
{{ $line['note'] }}
@endif
{{ number_format($qty, 2) }} {{ $currency . number_format($sub, 2, '.', ' ') }} {{ $currency . number_format($vat, 2, '.', ' ') }} {{ $currency . number_format($total, 2, '.', ' ') }}
No items added.
{{-- Banking + Totals (SCREEN) --}} @php $discount = $quote->discount_total; @endphp
{{-- Banking --}}

Banking & Payment Information

Account Name
{{ $bankAccount->account_holder}}
Bank
{{ $bankAccount->bank->bank_name }}
Account No
{{ $bankAccount->account_number ?? '' }}
Branch Code
{{ $bankAccount->branch_code }}
Type
{{ $bankAccount->account_type }}
Terms
{{ $bank['terms'] ?? 'Net 7 — Payment within 7 days of quote' }}
@if(!empty($inv['payment_note']))
Payment
{{ $inv['payment_note'] }}
@endif
@if(!empty($inv['notes']))

Notes

{{ $inv['notes'] }}
@endif
{{-- Totals --}}
Sub-Total{{ $currency . number_format($quote->subtotal, 2, '.', ' ') }}
@if($discount !== 0.0)
Discount{{ $currency . number_format($quote->discount_total, 2, '.', ' ') }}
@endif
VAT {{ config('globalSettings.tax_rate') * 100 }} %{{ $currency . number_format($quote->tax_total, 2, '.', ' ') }}
Total Due {{ $currency . number_format($quote->total, 2, '.', ' ') }}
@if(!empty($quote->date_expires))
Due on {{ $quote->date_expires }}
@endif
{{-- Screen footer / print button --}}
© {{ date('Y') }} Licentia {{ $province->province_name }} — All rights reserved.
• REG: 2025/003396/07 • VAT: 4040273023
{{-- ========================= PRINT VIEW (multi-page) ========================= --}}