@extends('master.app') @section('title', 'Retail Invoice') @section('pageCSS') @endsection @section('body')
{{-- ✅ HEADER HERO --}}

Retail Invoice

Invoice # {{ $bill->invoice_number }} • Date: {{ $bill->invoice_date }}
{{ $bill->customer_name }} {{ $bill->customer_phone }} Back {{-- A4 Print --}} {{-- Small 80mm Print --}}
{{-- ✅ SUMMARY + TOTALS --}} @php $cur = $bill->currency->title_en ?? ''; $itemsCount = ($bill->type_id == 1) ? $bill_items->sum('qty') : $bill_items->count(); $balance = $bill->balance ?? max(($bill->final_amount ?? 0) - ($bill->received ?? 0), 0); @endphp
Summary
{{ $bill->type_id == 1 ? 'From Stock' : 'Without Stock' }}
Customer
{{ $bill->customer_name }}
Phone
{{ $bill->customer_phone }}
Invoice No
{{ $bill->invoice_number }}
Date
{{ $bill->invoice_date }}
Received By
{{ $bill->received_by ?? '-' }}
Items
{{ $itemsCount }}
@if(!empty($bill->details))
{{ $bill->details }}
@endif
Financial Overview
International invoice style
Grand
{{ $cur }} {{ number_format($bill->grand_total ?? 0, 2) }}
Discount
{{ $cur }} {{ number_format($bill->discount ?? 0, 2) }}
Total
{{ $cur }} {{ number_format($bill->final_amount ?? 0, 2) }}
Received
{{ $cur }} {{ number_format($bill->received ?? 0, 2) }}
Balance
{{ $cur }} {{ number_format($balance, 2) }}
@if(($bill->currency_id ?? 1) != 1 && !empty($bill->ex_rate))
Exchange Rate: {{ $bill->ex_rate }}
@endif
{{-- ✅ ITEMS TABLE --}}
Items
Use print buttons for A4 or small thermal receipt.
@if($bill->type_id == 1) @forelse ($bill_items as $row) @empty @endforelse
# Category Sub Category Weight Unit Qty Price Total
{{ $loop->iteration }} {{ $row->category->title_en ?? '-' }} {{ $row->sub_category->title_en ?? '-' }} {{ $row->weight->title_en ?? '-' }} {{ $row->unit->title_en ?? '-' }} {{ $row->qty }} {{ number_format($row->sale_price ?? 0, 2) }} {{ number_format($row->total ?? 0, 2) }}
No items found
@else @forelse ($bill_items as $row) @empty @endforelse
# Item Price Qty Total
{{ $loop->iteration }} {{ $row->name }} {{ number_format($row->price ?? 0, 2) }} {{ $row->qty }} {{ number_format($row->total ?? 0, 2) }}
No items found
@endif
{{-- =========================== ✅ PRINT AREA: A4 INVOICE ============================ --}} {{-- =================================== ✅ PRINT AREA: SMALL THERMAL 80mm ==================================== --}}
@endsection @section('pageJs') @endsection