@extends('layouts.authenticated') @section('title', 'POS Kasir') @section('page-title', 'POS Kasir') @section('page-content')

📷 Arahkan barcode produk ke kamera

@foreach($categories as $category) @endforeach
@include('pos.partials.product-list', ['products' => $products])

Keranjang

Keranjang kosong

Subtotal Rp
Total Rp
@php $user = auth()->user(); $branchId = $user->branch_id; $barcodeProducts = \App\Models\Product::where('is_active', true) ->whereNotNull('barcode') ->where('barcode', '!=', '') ->whereHas('branchStock', function ($q) use ($branchId) { $q->where('branch_id', $branchId); }) ->with(['branchStock' => function ($q) use ($branchId) { $q->where('branch_id', $branchId); }]) ->get(); $initialBarcodeProductIndex = []; foreach ($barcodeProducts as $product) { $barcode = trim((string) $product->barcode); $branchStock = $product->branchStock->first(); $initialBarcodeProductIndex[$barcode] = [ 'id' => $product->id, 'name' => $product->name, 'price' => (float) ($product->price ?? 0), 'stock' => (int) ($branchStock ? $branchStock->stock : 0), 'track_stock' => (bool) ($branchStock ? $branchStock->track_stock : true), ]; } @endphp @push('styles') @endpush @endsection