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

Retail Invoice

Step 1: Invoice Info • Step 2: Add Items • Step 3: Checkout
Back @isset($bill) Print @endisset
@include('general.valert') {{-- ========================= STEP 1: CREATE INVOICE ========================= --}} @if (!isset($bill))
Step 1: Create Invoice
@csrf
@if ($bdate == 1) @else @endif
@endif {{-- ========================= STEP 2: ADD ITEMS + CHECKOUT ========================= --}} @isset($bill)
{{-- LEFT: ADD ITEM --}}
Step 2: Add Items
{{-- Bill small info --}}
Invoice #: {{ $bill->invoice_number }} • Customer: {{ $bill->customer_name }} • Phone: {{ $bill->customer_phone }}
{{-- From Stock --}} @if ($bill->type_id == 1)
{{-- IMPORTANT: Controller expects these names --}} {{-- IMPORTANT: Controller expects "scat_id" --}}
{{-- Rename to scat_id to match controller --}}
@endif {{-- Without Stock --}} @if ($bill->type_id != 1)
@endif
{{-- RIGHT: ITEMS TABLE + CHECKOUT --}}
{{-- ITEMS LIST --}}
Items List
@if ($bill->type_id == 1) @foreach ($bill_items as $row) @endforeach @if($bill_items->count() == 0) @endif
# Cat Sub Weight Unit Qty Price Total Action
{{ $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 added yet.
@else @foreach ($bill_items as $row) @endforeach @if($bill_items->count() == 0) @endif
# Item Price Qty Total Action
{{ $loop->iteration }} {{ $row->name }} {{ number_format($row->price ?? 0, 2) }} {{ $row->qty }} {{ number_format($row->total ?? 0, 2) }}
No items added yet.
@endif
{{-- CHECKOUT --}} @php $sum_total = $bill_items->sum('total'); @endphp
Step 3: Checkout
{{-- Keep GET because your controller uses next_store without id --}}
@endisset
@endsection @section('pageCSS') @endsection @section('pageJs') {{-- keep your existing stock load scripts --}} @isset($bill) @if ($bill->type_id == 1) @if ($bsload == 1) @include('sale.retail_bills.script') @else @include('sale.retail_bills.stock_load2.script') @endif @else @include('sale.retail_bills.scriptrow') @endif @endisset @endsection