@if($settings->shop_logo) @else @endif

{{ $settings->shop_name ?? $settings->site_name }}

{{ $settings->shop_address ?? 'Address not set' }}
Tel: {{ $settings->shop_phone ?? 'N/A' }}
Invoice: {{ $sale->invoice_no }}
Date: {{ $sale->created_at->format('Y-m-d H:i') }}
Customer: {{ $sale->customer->name ?? 'Walk-in' }}
Cashier: {{ $sale->creator->name ?? 'System' }}
@foreach($sale->items as $item)
{{ $item->product->name }} @if($item->variation) ({{ $item->variation->variationType->name }}) @endif
{{ number_format($item->qty, 0) }} x Rs {{ number_format($item->net_unit_price, 2) }} @if($item->discount_amount > 0) (-Rs {{ number_format($item->discount_amount, 2) }}) @endif Rs {{ number_format($item->total, 2) }}
@endforeach
@php $total_item_discount = $sale->items->sum('discount_amount'); $order_discount_val = $sale->order_discount; if ($sale->order_discount_type == 'percent') { $order_discount_val = ($sale->sub_total * $sale->order_discount / 100); } $final_total_discount = $total_item_discount + $order_discount_val; $gross_total = $sale->items->sum('sub_total'); @endphp
Sub Total: Rs {{ number_format($sale->sub_total, 2) }}
@if($sale->order_discount > 0)
Discount: - {{ number_format($sale->order_discount, 2) }}{{ $sale->order_discount_type == 'percent' ? ' %' : 'Rs' }}
@endif
GRAND TOTAL: Rs {{ number_format($sale->grand_total, 2) }}
Cash Given: Rs {{ number_format($sale->cash_given, 2) }}
Paid Amount: Rs {{ number_format($sale->paid_amount - $sale->balance, 2) }}
@if($final_total_discount > 0)
Total Discount (Incl. Items): - Rs {{ number_format($final_total_discount, 2) }}
@endif
Balance: Rs {{ number_format($sale->balance, 2) }}
Payment Mode: {{ $sale->payment_type == 1 ? 'Cash' : ($sale->payment_type == 2 ? 'Card' : 'Credit') }}
@if ($sale->customer_id) @if ($settings->show_points_on_invoice && $settings->enable_loyalty_points)
@if($sale->earned_points > 0)
Points Earned: +{{ $sale->earned_points }}
@endif @if($sale->redeemed_points > 0)
Points Redeemed: -{{ $sale->redeemed_points }}
@endif @if($sale->wallet_amount_used > 0)
Wallet Paid: Rs {{ number_format($sale->wallet_amount_used, 2) }}
@endif @if($sale->wallet_amount_added > 0)
Added to Wallet: Rs {{ number_format($sale->wallet_amount_added, 2) }}
@endif @if($settings->enable_loyalty_points)
Total Loyalty Points: {{ $sale->customer->loyalty_points }}
@endif
@endif @if ($total_outstanding != 0)
{{ $total_outstanding > 0 ? 'NET OUTSTANDING:' : 'ACCOUNT CREDIT:' }} Rs {{ number_format(abs($total_outstanding), 2) }}
@endif @endif