@php // Fall back to the public/logo.png file if no logo has been uploaded via settings. $logoSetting = \App\Models\Setting::get('shop_logo', ''); $logo = $logoSetting ?: (file_exists(public_path('logo.png')) ? asset('logo.png') : ''); $qrCode = \App\Models\Setting::get('shop_qr_code', ''); $address = \App\Models\Setting::get('shop_address', ''); $gstin = \App\Models\Setting::get('shop_gstin', ''); $mobile = \App\Models\Setting::get('shop_mobile', ''); $shopName = \App\Models\Setting::get('shop_name', 'Mahendra Jewellers'); $totalWeight = $sale->items->sum(fn ($i) => (float) $i->weight); $hsnForProduct = function ($product) { $metal = strtolower((string) ($product->metal_type ?? '')); if (str_contains($metal, 'silver')) { return \App\Models\Setting::get('hsn_silver', '7106'); } if (str_contains($metal, 'gold')) { return \App\Models\Setting::get('hsn_gold', \App\Models\Setting::get('hsn_jewellery', '7113')); } return \App\Models\Setting::get('hsn_jewellery', '7113'); }; @endphp
{{-- ═══ HEADER ═══ --}}
@if($logo) {{ $shopName }} @else {{ strtoupper(substr($shopName, 0, 2)) }} @endif

{{ $shopName }}

Fine Gold · Silver · Diamond Jewellery

{{ $sale->sale_type === 'gst' ? 'Tax Invoice' : 'Approval Memo' }}
@if($address)Address: {{ $address }}@endif @if($gstin)GSTIN: {{ $gstin }}@endif @if($mobile)Mobile: {{ $mobile }}@endif
{{-- ═══ BILL + CUSTOMER INFO ═══ --}}

Bill Number

{{ $sale->bill_number }}

{{ $sale->sale_date->format('d M,Y') }}

Billed To

{{ $sale->customer->name }}

{{ $sale->customer->mobile }} @if($sale->customer_gst_number) · GSTIN: {{ $sale->customer_gst_number }} @endif

{{-- ═══ ITEMS ═══ --}}
Items & Ornaments
@foreach($sale->items as $i => $item) @endforeach
# Product Details Weight Purity Rate Amount
{{ $i + 1 }} {{ $item->product->product_code ?? '-' }}
{{ $item->product?->category?->name ?? 'Jewellery' }} · HSN: {{ $hsnForProduct($item->product) }}
@if($item->product?->description)
{{ $item->product->description }}
@endif
{{ \App\Support\IndianNumber::format($item->weight, 3) }} g {{ $item->purity }} {{ $item->rate ? '₹' . \App\Support\IndianNumber::format($item->rate, 2) : '-' }} ₹{{ \App\Support\IndianNumber::format($item->amount, 2) }}
{{-- ═══ TOTALS + PAYMENT ═══ --}}

Payment

Mode: {{ ucfirst($sale->payment_mode) }} · Type: {{ ucfirst($sale->payment_type) }}

@if($sale->payment_type === 'credit')

Paid: ₹{{ \App\Support\IndianNumber::format($sale->paid_amount, 2) }} · Balance: ₹{{ \App\Support\IndianNumber::format($sale->credit_amount, 2) }}

@endif

Summary

Items: {{ $sale->items->count() }} · Total Weight: {{ \App\Support\IndianNumber::format($totalWeight, 3) }} g

@if($qrCode)
Payment QR Scan to pay
via UPI
@endif
Taxable Value ₹{{ \App\Support\IndianNumber::format($sale->taxable_value, 2) }}
@if($sale->sale_type === 'gst')
CGST (1.5%) ₹{{ \App\Support\IndianNumber::format($sale->cgst, 2) }}
SGST (1.5%) ₹{{ \App\Support\IndianNumber::format($sale->sgst, 2) }}
@endif @if($sale->old_gold_amount)
Old Gold Deduction - ₹{{ \App\Support\IndianNumber::format($sale->old_gold_amount, 2) }}
@endif
Grand Total ₹{{ \App\Support\IndianNumber::format($sale->final_amount, 2) }}
{{-- ═══ FOOTER ═══ --}}