@extends('layouts.admin') @section('title', 'Preview Quotation') @section('page-title', 'Design & Finalize Quotation') @section('content')

Design & Finalize Quotation

Quotation #{{ $data['quotation_number'] ?? 'QUO-2024-001' }} • Draft

check_circle Details Design & Share
@if(isset($templateView) && view()->exists($templateView)) @php try { // Render the template $templateContent = view($templateView, ['quotation' => $quotation ?? null])->render(); // Extract styles from head - get all style tags $styles = ''; preg_match_all('/]*>(.*?)<\/style>/is', $templateContent, $styleMatches); if (!empty($styleMatches[1])) { $styles = ''; } // Extract body content - get everything inside body tag $bodyContent = $templateContent; if (preg_match('/]*>(.*?)<\/body>/is', $templateContent, $bodyMatches)) { $bodyContent = $bodyMatches[1]; } elseif (preg_match('/]*class=["\']quotation-container["\'][^>]*>(.*?)<\/div>\s*<\/body>/is', $templateContent, $containerMatches)) { // If no body tag, try to get quotation-container div $bodyContent = $containerMatches[1]; } elseif (preg_match('/]*class=["\']quotation-container["\'][^>]*>(.*)/is', $templateContent, $containerMatches)) { // Fallback: get quotation-container content $bodyContent = $containerMatches[1]; } } catch (\Exception $e) { $bodyContent = '
Error loading template: ' . htmlspecialchars($e->getMessage()) . '
Template: ' . htmlspecialchars($templateView ?? 'N/A') . '
'; $styles = ''; } @endphp {!! $styles !!}
{!! $bodyContent !!}
@else
@if($companySettings->company_logo && \Illuminate\Support\Facades\Storage::disk('public')->exists($companySettings->company_logo)) Company Logo @else
{{ strtoupper(substr($companySettings->company_name ?? 'FA', 0, 2)) }}
@endif

{{ $companySettings->company_name ?? config('app.name', 'ProInvoice') }}

@if($companySettings->company_address)

{{ $companySettings->company_address }}

@endif

QUOTATION

#{{ $data['quotation_number'] ?? 'QUO-2024-001' }}

Issue Date: {{ \Carbon\Carbon::parse($data['issue_date'] ?? now())->format('M d, Y') }}
@if(!empty($data['expiry_date']))
Valid Until: {{ \Carbon\Carbon::parse($data['expiry_date'])->format('M d, Y') }}
@endif
@if($customer)

Bill To

{{ $customer->name }}

@if($customer->email)

{{ $customer->email }}

@endif @if($customer->phone)

{{ $customer->phone }}

@endif @if($customer->address)

{{ $customer->address }}

@endif
@endif
@forelse($items as $item) @empty @endforelse
Description Qty Price Total

{{ $item['description'] }}

@if(!empty($item['notes']))

{{ $item['notes'] }}

@endif
{{ number_format($item['quantity'], 2) }} {{ $selectedCurrency->symbol ?? '$' }}{{ number_format($item['unit_price'], 2) }} {{ $selectedCurrency->symbol ?? '$' }}{{ number_format($item['total'], 2) }}
No items added
Subtotal {{ $selectedCurrency->symbol ?? '$' }}{{ number_format($subtotal, 2) }}
@if($taxAmount > 0)
Tax {{ $selectedCurrency->symbol ?? '$' }}{{ number_format($taxAmount, 2) }}
@endif @if($discount > 0)
Discount -{{ $selectedCurrency->symbol ?? '$' }}{{ number_format($discount, 2) }}
@endif
Total {{ $selectedCurrency->symbol ?? '$' }}{{ number_format($total, 2) }}
@if(!empty($data['notes']) || !empty($data['terms']))
@if(!empty($data['notes']))

Notes

{{ $data['notes'] }}

@endif @if(!empty($data['terms']))

Terms & Conditions

{{ $data['terms'] }}

@endif
@endif

Powered by {{ config('app.name', 'ProInvoice') }}

@endif

share Share Quotation

arrow_back Back to Details
@csrf @foreach($data as $key => $value) @if(is_array($value)) @foreach($value as $subKey => $subValue) @if(is_array($subValue)) @foreach($subValue as $itemKey => $itemValue) @endforeach @else @endif @endforeach @else @endif @endforeach
@csrf @foreach($data as $key => $value) @if(is_array($value)) @foreach($value as $subKey => $subValue) @if(is_array($subValue)) @foreach($subValue as $itemKey => $itemValue) @endforeach @else @endif @endforeach @else @endif @endforeach
@endsection