@php $customer = $quotation->customer; $docOpts = $docSettings['options'] ?? []; $docLbl = $docSettings['labels'] ?? []; $statusKey = $quotation->status; $primarySig = $settings['primary_signature_label'] ?? 'Provider Signature'; $secondarySig = $settings['secondary_signature_label'] ?? 'Receiver Signature'; $showTaxable = $settings['show_total_taxable_value'] ?? true; $roundOff = $settings['round_off_amount'] ?? false; $fmtTotal = function ($n) use ($roundOff) { return $roundOff ? number_format(round($n), 0) : number_format($n, 2); }; $billLines = $customer->billingAddressLines(); $shipLines = $customer->has_shipping_address ? $customer->shippingAddressLines() : $billLines; $totalAmount = (float) $quotation->grand_total; $quotationTitle = $quotationTitle ?? \App\Helpers\QuotationDocumentSettings::titleForType($quotation->type, $company->id ?? null); $documentCopyLabel = $documentCopyLabel ?? ($documentCopies['original'] ?? 'Original Copy'); $docId = $docId ?? 'quotation-doc'; $hasDiscountCol = $quotation->items->contains(fn ($li) => (float) $li->discount_percent > 0); $forPdf = $forPdf ?? false; if ($forPdf) { $logoImage = $logoPath ?? \App\Helpers\CompanyMedia::pdfImagePath($company->logo_path ?? null); $signatureImage = $signaturePath ?? \App\Helpers\CompanyMedia::pdfImagePath($company->signature_image_path ?? null); } else { $logoImage = $logoPath ?? $logoSrc ?? \App\Helpers\CompanyMedia::imageSource($company->logo_path ?? null); $signatureImage = $signaturePath ?? $signatureSrc ?? \App\Helpers\CompanyMedia::imageSource($company->signature_image_path ?? null); } @endphp
@if(! $forPdf && ! ($forPublic ?? false)) @if($statusKey === 'accepted')
Accepted
@elseif($statusKey === 'rejected')
Rejected
@elseif($statusKey === 'converted')
Converted
@elseif($statusKey === 'sent')
Sent
@endif @endif
@if($logoImage) @endif

{{ $company->name ?? 'Company' }}

@php $companyLines = $company->fullAddressLines(); @endphp @if(! empty($companyLines)) @foreach($companyLines as $line)

{{ $line }}

@endforeach @elseif($company->address ?? $company->city)

{{ collect([$company->address, $company->city, $company->state, $company->pincode, $company->country])->filter()->implode(', ') }}

@endif @if($company->phone)

Phone: {{ $company->phone }}

@endif @if($company->email)

Email: {{ $company->email }}

@endif @if($company->gstin ?? null)

GSTIN: {{ $company->gstin }}

@endif

{{ $quotationTitle }}

#{{ $quotation->quote_number }}

{{ $documentCopyLabel }}

@if($docOpts['show_amount_due'] ?? true)
Total: ₹ {{ number_format($totalAmount, 2) }}
@endif @if($quotation->po_no) @endif @if($quotation->po_date) @endif @if(($gstMode ?? false) && ($placeOfSupplyLabel ?? null)) @endif
Quote Date {{ $quotation->quote_date->format('d - M - Y') }}
Valid Until {{ $quotation->valid_until?->format('d - M - Y') ?? '—' }}
{{ $docLbl['po_number'] ?? ($quotation->po_label ?? 'PO Number') }} {{ $quotation->po_no }}
PO Date {{ $quotation->po_date->format('d - M - Y') }}
Place of Supply {{ $placeOfSupplyLabel }}
@if($docOpts['show_shipping_address'] ?? true) @endif

{{ $customer->name }}

@if(($docOpts['show_contact_person_quote_to'] ?? true) && $customer->contact_person)

{{ $customer->contact_person }}

@endif @foreach($billLines as $line)

{{ $line }}

@endforeach @if($customer->gstin)

GSTIN: {{ $customer->gstin }}

@endif
@foreach($shipLines as $line)

{{ $line }}

@endforeach @if(empty(array_filter($shipLines)))

Same as billing address

@endif
@if($gstMode ?? false) @include('partials.admin.document-gst-items', [ 'documentItems' => $quotation->items, 'gstIsIgst' => $gstIsIgst ?? false, 'docLbl' => $docLbl, ]) @else @if($hasDiscountCol) @endif @foreach($quotation->items as $i => $line) @php $qtyDisplay = number_format($line->quantity, 0) == $line->quantity ? (string) (int) $line->quantity : number_format($line->quantity, 3); $qtyUom = trim($qtyDisplay . ($line->unit ? ' ' . $line->unit : '')); @endphp @if($hasDiscountCol) @endif @endforeach
# {{ $docLbl['col_item'] ?? 'Item' }} & {{ $docLbl['col_description'] ?? 'Description' }} Qty / UoM Price (₹){{ $docLbl['col_discount'] ?? 'Discount' }}{{ $docLbl['col_tax'] ?? 'Tax' }} {{ $docLbl['col_total'] ?? 'Amount' }}
{{ $i + 1 }} {{ $line->item_name }} @if($line->description) {{ $line->description }} @endif {{ $qtyUom ?: '—' }} {{ number_format($line->rate, 2) }} @if((float) $line->discount_percent > 0) {{ rtrim(rtrim(number_format($line->discount_percent, 2), '0'), '.') }}% @else — @endif @if($line->tax_amount > 0) ₹ {{ number_format($line->tax_amount, 2) }} @if($line->tax_rate > 0) {{ rtrim(rtrim(number_format($line->tax_rate, 2), '0'), '.') }}% @endif @else — @endif ₹ {{ number_format($line->amount, 2) }}
@endif
@include('partials.admin.document-bank-details', [ 'company' => $company, 'settings' => $settings, 'showBank' => (bool) ($settings['show_bank_details_quotation'] ?? true), ]) @if($quotation->terms)

{{ $docLbl['terms'] ?? 'Terms & Conditions' }}

{{ $quotation->terms }}

@endif
@include('partials.admin.document-totals', [ 'document' => $quotation, 'gstMode' => $gstMode ?? false, 'gstSummaryRows' => $gstSummaryRows ?? [], 'taxBreakdown' => $taxBreakdown ?? [], 'showTaxable' => $showTaxable, 'fmtTotal' => $fmtTotal, 'docOpts' => $docOpts, 'docLbl' => $docLbl, ]) @if($docOpts['show_total_in_words'] ?? true)

Amount in Words: {{ $amountInWords }}

@endif @if($docOpts['show_primary_signature'] ?? true) @endif @if($docOpts['show_secondary_signature'] ?? false) @endif
@if($signatureImage) @else
@endif

{{ $primarySig }}

{{ $secondarySig }}