@extends('layouts.pos') @section('title', 'Kasir POS - MCU Klinik Mustika') @section('content') @if ($shift === null)
Buka Shift Kasir
@csrf
@if ($clinicDataConfigurationError !== null) @else

Profil Perusahaan digunakan otomatis. Catat saldo fisik awal sebelum melayani transaksi.

@if ($clinicData->logo_path) Logo {{ $clinicData->name }} @else @endif
{{ $clinicData->name }}
{{ $clinicData->address }}
{{ $clinicData->serviceTypeNames() }}
@csrf
@error ('opening_balance')
{{ $message }}
@enderror
@error ('company_profile')
{{ $message }}
@enderror
@endif
@else
Shift Kasir Aktif
@if ($isShiftCurrentDay) Terbuka @else Perlu Ditutup @endif
{{ $shift->location->name }} · Kasir {{ auth()->user()->name }} · Dibuka {{ \App\Helpers\DateHelper::formatShort($shift->opened_at) }} {{ $shift->opened_at->format('H:i') }}
@if ($isShiftCurrentDay) @endif
@include('pharmacy.pos.partials.item-list-modal') @include('pharmacy.pos.partials.held-sales-modal') @include('pharmacy.pos.partials.shift-transactions-modal') @include('pharmacy.pos.partials.close-shift-modal') @if (!$isShiftCurrentDay) @elseif (!$hasSellableItems) @else @php $selectedPrescriptionId = old('prescription_id', $activeHold?->prescription_id ?? request('prescription_id')); $selectedRegularCheckupId = old('regular_checkup_id', $activeHold?->regular_checkup_id); $selectedPatientId = old('patient_id', $activeHold?->patient_id ?? request('patient_id')); $selectedLabOrderId = old('lab_order_id'); $selectedLabOrder = $selectedLabOrderId ? $pendingLabOrders->firstWhere('id', (int) $selectedLabOrderId) : null; $labCartItems = $selectedLabOrder?->services->isNotEmpty() ? $selectedLabOrder->services ->map( fn($service) => [ 'item_type' => 'lab_test', 'lab_order_service_id' => $service->id, 'service_code' => $service->service_code, 'service_name' => $service->service_name, 'quantity' => 1, 'discount_percentage' => 0, 'discount_amount' => 0, 'price_type' => 'regular', 'snapshot_unit_price' => $service->unit_price, ], ) ->all() : $selectedLabOrder?->items ->map( fn($item) => [ 'item_type' => 'lab_test', 'lab_order_item_id' => $item->id, 'test_code' => $item->test_code, 'test_name' => $item->test_name, 'quantity' => 1, 'discount_percentage' => 0, 'discount_amount' => 0, 'price_type' => 'regular', 'snapshot_unit_price' => $item->unit_price, ], ) ->all(); $cartItems = old( 'items', $labCartItems ?? ($activeHold?->items ->map( fn($item) => [ 'item_type' => $item->item_type, 'drug_id' => $item->drug_id, 'pharmacy_service_id' => $item->pharmacy_service_id, 'drug_batch_id' => $item->drug_batch_id, 'lab_order_service_id' => $item->lab_order_service_id, 'selling_unit_id' => $item->selling_unit_id, 'quantity' => $item->selling_quantity, 'discount_percentage' => $item->discount_percentage, 'discount_amount' => $item->discount_amount, 'price_type' => $item->price_type, 'snapshot_unit_price' => $item->unit_price, 'notes' => $item->notes, ], ) ->all() ?? [['item_type' => 'drug', 'quantity' => 1]]), ); $payment = old('payments.0', ['payment_method' => 'cash', 'cash_received' => '']); $prescriptionPayload = $readyPrescriptions ->map( fn($prescription) => [ 'id' => (int) $prescription->id, 'patientId' => (int) $prescription->patient_id, 'items' => $prescription->items ->map(fn($item) => ['drugId' => (int) $item->drug_id, 'quantity' => (int) $item->quantity]) ->values(), ], ) ->values(); $batchPayload = $batches ->map( fn($batch) => [ 'id' => (int) $batch->id, 'drugId' => (int) $batch->drug_id, 'available' => (int) $batch->available_qty, ], ) ->values(); $legacyHoldDiscountAmount = $activeHold && (float) $activeHold->discount_amount > 0 && (float) $activeHold->items->sum('discount_amount') === 0 ? (float) $activeHold->discount_amount : 0; @endphp @if ($activeHold) @if ($activeHold->regularCheckup)
Sumber check-up reguler: {{ $activeHold->regularCheckup->checkup_number }} · {{ $activeHold->regularCheckup->patient->name }}. Pasien dan sumber transaksi dikunci mengikuti keranjang tahan.
@endif @elseif ($heldTransactions->isNotEmpty()) @endif
@csrf @if ($activeHold) @else @endif
Keranjang Belanja
Pilih pasien untuk memuat tagihan laboratorium dan resep yang siap. Harga lab memakai snapshot order dokter.
{{ count($cartItems) }} item
@error ('items')
{{ $message }}
@enderror
@foreach ($cartItems as $index => $item) @include('pharmacy.pos.partials.item-row', ['index' => $index, 'item' => $item]) @endforeach
No. Kode Barang Nama Barang Satuan Harga Jumlah Disc Disc RP Subtotal
Checkout
Total yang harus dibayar
Rp 0
Subtotal
Rp 0
Diskon
Rp 0
Total
Rp 0
Dialokasikan
Rp 0
Kembalian
Rp 0
@if (!$activeHold) @endif
@endif @endif @endsection @if ($shift !== null && $isShiftCurrentDay && $hasSellableItems) @push('scripts') @endpush @endif @if ($shift !== null) @push('scripts') @endpush @endif