@php
/* Controller can pass $patients and $products. The fallbacks keep this Blade usable immediately. */
$billingPatients = ($patients ?? \App\Models\Patient::query()
->select('id', 'sheet_no', 'patient_name', 'first_name', 'middle_name', 'last_name', 'phone', 'age', 'gender', 'place')
->latest('id')->get())
->map(function ($patient) {
$fullName = trim(collect([$patient->first_name, $patient->middle_name, $patient->last_name])->filter()->implode(' '));
return [
'id' => (string) $patient->id,
'sheet_no' => (string) ($patient->sheet_no ?? ''),
'name' => (string) ($patient->patient_name ?: $fullName ?: 'Unnamed Patient'),
'phone' => (string) ($patient->phone ?? ''),
'age' => (string) ($patient->age ?? ''),
'gender' => (string) ($patient->gender ?? ''),
'place' => (string) ($patient->place ?? ''),
];
})->values();
$billingProducts = ($products ?? \App\Models\Product::query()
->with('categoryDetail')
->orderBy('product_name')->get())
->map(function ($product) {
return [
'id' => (string) $product->id,
'name' => (string) $product->product_name,
'code' => (string) ($product->hsn_code ?: $product->id),
'category' => (string) (optional($product->categoryDetail)->category_name ?? optional($product->categoryDetail)->name ?? ''),
'brand' => (string) ($product->brand ?? ''),
'sp' => (float) ($product->selling_price ?? 0),
'gst' => (float) ($product->tax ?? 0),
'stock' => (float) ($product->current_stock ?? 0),
'unit' => trim((string) ($product->st_val ?? '') . ' ' . (string) ($product->st_unit ?? '')),
'status' => (string) ($product->status ?? 'active'),
];
})->values();
@endphp
{{-- Today Bills --}}
Today Bills
{{-- Held Bills --}}
{{-- Settings --}}
| # |
Item |
Code |
Unit |
SP (₹) |
QTY |
GST |
Amount (₹) |
Remark |
Action |
Bill Details
Sub Total₹ 0.00
GST₹ 0.00
Discount- ₹ 0.00
Charges+ ₹ 0.00
Total₹ 0.00
Select Payment Mode
F1 Search
F2 Discount
F3 Charge
F6 Save & Print
F7 Hold Bill
F8 Held Bills
CTRL+B New Bill
CTRL+P Change Price
CTRL+Q Change QTY
DEL Delete Item
ESC Exit