@php
// each "Charge to" option has its own permission (walk-in = the customer / patient list)
$canChargeWalkin = auth()->user()->can('pharmacy-pos-charge-walkin');
$canChargeAppt = auth()->user()->can('pharmacy-pos-charge-appointment');
$canChargeRoom = auth()->user()->can('pharmacy-pos-charge-room');
$chargeOptions = array_keys(array_filter(['walkin' => $canChargeWalkin, 'appointment' => $canChargeAppt, 'admission' => $canChargeRoom]));
@endphp
@if (!$chargeOptions)
You can't save a sale: ask an admin for one of the POS "Charge to" permissions (walk-in, appointment or room).
@endif
@if ($chargeOptions)
{{-- Charge to: a walk-in, today's appointment, or a patient still admitted (room) --}}
@if ($canChargeAppt)
Today's appointment *
Select the appointment
@foreach ($charge_appointments as $a)
#{{ $a->appointment_no ?: $a->id }} · {{ $a->Patient?->patient_id }} - {{ $a->Patient?->name }} · Dr. {{ $a->dr?->name ?? '-' }}
@endforeach
@if ($charge_appointments->isEmpty())No appointments today. @endif
@endif
@if ($canChargeRoom)
Admitted patient (room) *
Select the admitted patient
@foreach ($charge_admissions as $a)
{{ $a->Patient?->patient_id }} - {{ $a->Patient?->name }} · {{ $a->Room?->name ?? 'Room' }}{{ $a->bed ? ' · bed ' . $a->bed : '' }}{{ $a->admission_no ? ' · #' . $a->admission_no : '' }}
@endforeach
@if ($charge_admissions->isEmpty())No patient is admitted now. @endif
@endif
@endif
Customers
Walk-in-customer
@foreach ($customers as $item)
{{ $item?->patient_id ." - ". $item?->name ." - ". $item?->phone }}
@endforeach
Currency *
{{-- Select --}}
@foreach ($currencies as $item)
default == "Yes" ? "selected" : "" }} > {{ $item?->name }}
@endforeach
Payment method *
Select
@foreach ($payment_methods as $item)
{{ $item?->name }}
@endforeach
Total amount
Discount
Paid amount
Balance amount
{{ $posCashier ? 'Debit' : 'Save sale (debit)' }}
@if ($posCashier)
Cash
@endif