@php $customer = $deliveryChallan->customer; $docOpts = $docSettings['options'] ?? []; $docLbl = $docSettings['labels'] ?? []; $statusKey = $deliveryChallan->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) $deliveryChallan->grand_total; $challanTitle = $challanTitle ?? $challanTitle ?? \App\Helpers\DeliveryChallanDocumentSettings::title($company->id ?? null); $documentCopyLabel = $documentCopyLabel ?? ($documentCopies['original'] ?? 'Original Copy'); $docId = $docId ?? 'delivery-challan-doc'; $hasDiscountCol = $deliveryChallan->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($logoImage)
{{ $company->name ?? 'Company' }}@php $companyLines = $company->fullAddressLines(); @endphp @if(! empty($companyLines)) @foreach($companyLines as $line) @endforeach @elseif($company->address ?? $company->city) @endif @if($company->phone)@endif @if($company->email)@endif @if($company->gstin ?? null)@endif |
{{ $challanTitle }}#{{ $deliveryChallan->challan_number }} {{ $documentCopyLabel }} @if($docOpts['show_amount_due'] ?? true)
Total: ₹ {{ number_format($totalAmount, 2) }}
@endif
|
{{ $docLbl['bill_to'] ?? 'Bill To' }}{{ $customer->name }} @if(($docOpts['show_contact_person'] ?? true) && $customer->contact_person) @endif @foreach($billLines as $line) @endforeach @if($customer->gstin) @endif |
@if($docOpts['show_shipping_address'] ?? true)
{{ $docLbl['ship_to'] ?? 'Ship To' }}@foreach($shipLines as $line) @endforeach @if(empty(array_filter($shipLines))) @endif |
@endif
| # | {{ $docLbl['col_item'] ?? 'Item' }} & {{ $docLbl['col_description'] ?? 'Description' }} | Qty / UoM | Price (₹) | @if($hasDiscountCol){{ $docLbl['col_discount'] ?? 'Discount' }} | @endif{{ $docLbl['col_tax'] ?? 'Tax' }} | {{ $docLbl['col_total'] ?? 'Amount' }} |
|---|---|---|---|---|---|---|
| {{ $i + 1 }} | {{ $line->item_name }} @if($line->description) {{ $line->description }} @endif | @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{{ $qtyUom ?: '—' }} | {{ number_format($line->rate, 2) }} | @if($hasDiscountCol)@if((float) $line->discount_percent > 0) {{ rtrim(rtrim(number_format($line->discount_percent, 2), '0'), '.') }}% @else — @endif | @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) }} |
@include('partials.admin.document-bank-details', [
'company' => $company,
'settings' => $settings,
'showBank' => false,
])
@if(($docOpts['show_transport_block'] ?? true) && $deliveryChallan->has_transport_eway && $deliveryChallan->transport_eway)
Transport / E-Way{{ $deliveryChallan->transport_eway }} {{ $docLbl['terms'] ?? 'Terms & Conditions' }}{{ $deliveryChallan->terms }} |
@include('partials.admin.document-totals', [
'document' => $deliveryChallan,
'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
|