{{-- Shared faithful port of the quotation-document body used by TWO legacy emails: - MailHandler::sendEmailQuotationToHeadDivision (L566-772) → QuotationToHeadDivisionMail - MailHandler::sendEmailQuotationToUser (L773-971) → QuotationApprovedMail Both render the SAME structure (plain title + "Header" sub-banner, then Header → Details → Notes and Conditions → History Quotation). They diverge on three points, passed in as flags so ONE template stays byte-faithful to each: $showIsOrder — head-division shows an "Is Order : Yes/No" header row (L659); ToUser does not $formatUsdRate— head-division number_format's USD Rate (L657); ToUser renders it raw (L857) $decSep/$thouSep — head-division uses US '.'/',' (L657,700-702); ToUser uses Indonesian ','/'.' (L899-901) All {{ }} auto-escape (safer than legacy's raw concatenation). Null-safe (?->) navigation mirrors legacy's LEFT JOINs (missing lookups → empty cells). NOTE: this is a DISTINCT structure from mail/quotation-revised.blade.php, whose own legacy (sendEmailQuoToUserRevise) uses a combined title banner and renders History BEFORE Notes — do not conflate the two. --}} @php $showIsOrder = $showIsOrder ?? false; $formatUsdRate = $formatUsdRate ?? false; $decSep = $decSep ?? ','; $thouSep = $thouSep ?? '.'; $num = fn ($v) => number_format((float) $v, 2, $decSep, $thouSep); @endphp Quotation - Colorindo Chemtra {{-- Header --}}

Header

@if ($showIsOrder) @endif
Quotation No.   : {{ str_pad((string) $quotation->ID, 6, '0', STR_PAD_LEFT) }}
Request Date   : {{ $quotation->Tanggal }}
Quotation Date   : {{ $quotation->QuotationDate }}
Division   : {{ $quotation->division?->DivisionName }}
Sales   : {{ $quotation->userIDSales?->Nama }}
Company Name   : {{ $quotation->company?->CompanyName }}
Company CP Name   : {{ $quotation->companyCP?->CompanyCPSalutation }} {{ $quotation->companyCP?->CompanyCPName }}
Company CP Address   : {{ $quotation->companyCP?->CompanyCPAddress }}
Company CP Telephone   : {{ $quotation->companyCP?->CompanyCPTelephone }}
CC   : {{ $quotation->CC }}
USD Rate   : {{ $formatUsdRate ? $num($quotation->USDRate) : $quotation->USDRate }}
Comment   : {{ $quotation->Comment }}
Is Order   : {{ $quotation->IsOrder ? 'Yes' : 'No' }}
{{-- Details --}}

Details

@foreach ($quotation->details as $i => $d) @endforeach
PrincipalName PrincipalPrintName Original Product Name Product Name Packing UnitPriceUSD UnitPriceIDR RemarksQuotation Project/RemarkInternal History
{{ $d->barang?->principal?->PrincipalName }} {{ $d->PrincipalPrintName }} {{ $d->barang?->NamaBarang }} {{ $d->ProductName }} {{ $num($d->QuantityPacking) }} {{ $d->packing?->PackingName }} {{ $num($d->UnitPriceUSD) }} {{ $num($d->UnitPriceIDR) }} {{ $d->Remarks }} {{ $d->RemarkInternal }} @foreach ($d->assignments as $a) {{ $a->Tanggal }} | {{ $a->quotationDetailStatus?->StatusDetailName }} | {{ $a->user?->Nama }}
@endforeach
{{-- Notes and Conditions (legacy renders this BEFORE History) --}}

Notes and Conditions

Price   : {{ $quotation->quotationPriceDesc?->QuotationUnitPriceDescName }}
Sales Terms   : {{ $quotation->quotationSalesTerm?->QuotationSalesTermName }}
Payment Terms   : {{ $quotation->quotationPaymentTerm?->QuotationPaymentTermName }}
Delivery / Lead Time   : {{ $quotation->quotationDeliveryTime?->QuotationDeliveryTimeName }}
Validity   : {{ $quotation->quotationValidity?->QuotationValidityName }}
Stock Availibility   : {{ $quotation->quotationStockAvailibility?->QuotationStockAvailabilityName }}
{{-- History Quotation --}}

History Quotation

@foreach ($quotation->assignments as $a) @endforeach
ID Status Tanggal User Comment
{{ $a->ID }} {{ $a->quotationStatus?->StatusName }} {{ $a->Tanggal }} {{ $a->user?->Nama }} {{ $a->Comment }}