Add dual-screen customer display for the register.
Deploy Ladill POS / deploy (push) Successful in 56s

Token-gated full-screen customer view shows order, payment QR, tips,
signature, receipt, and promo phases while the till keeps operator UI.
This commit is contained in:
isaacclad
2026-07-15 15:35:44 +00:00
parent 5e31bdf629
commit 38b7f96714
10 changed files with 1426 additions and 4 deletions
@@ -7,6 +7,7 @@ use App\Http\Controllers\Pos\Concerns\ScopesToAccount;
use App\Models\PosLocation;
use App\Models\PosProduct;
use App\Models\PosSale;
use App\Services\Pos\CustomerDisplayService;
use App\Services\Pos\PosBarcodeLookupService;
use App\Services\Pos\PosLocationService;
use App\Services\Pos\PosSaleService;
@@ -25,18 +26,24 @@ class RegisterController extends Controller
private PosSaleService $sales,
private PosLocationService $locations,
private PosBarcodeLookupService $barcodes,
private CustomerDisplayService $customerDisplays,
) {}
public function index(Request $request): View
{
$owner = $this->ownerRef($request);
$location = $this->location($request);
$display = $this->customerDisplays->ensureForLocation($location);
return view('pos.register', [
'products' => $this->registerProducts($owner, $location),
'location' => $location,
'crmCustomers' => $this->crmCustomers($owner),
'barcodeLookupUrl' => route('pos.register.lookup'),
'customerDisplayUrl' => $this->customerDisplays->displayUrl($display),
'customerDisplayPushUrl' => route('pos.customer-display.push'),
'customerDisplayActionsUrl' => route('pos.customer-display.actions'),
'isRestaurant' => $location->isRestaurant(),
]);
}
@@ -163,6 +170,7 @@ class RegisterController extends Controller
if ($data['payment_method'] === 'cash') {
$this->sales->recordCashPayment($sale);
$this->customerDisplays->pushReceipt($location, $sale->fresh(['lines']));
if ($location->printer_auto_print) {
return redirect()
@@ -176,18 +184,26 @@ class RegisterController extends Controller
}
$result = $this->sales->initiatePayCheckout($sale, $merchant);
$checkoutUrl = $result['checkout_url'] ?? null;
$this->customerDisplays->pushPayment($location, $sale->fresh(['lines']), [
'checkout_url' => $checkoutUrl,
'qr_url' => $checkoutUrl,
'message' => 'Complete payment with card or MoMo',
'options' => ['Card / MoMo'],
]);
if ($request->expectsJson() || $request->ajax()) {
return response()->json([
'checkout_url' => $result['checkout_url'],
'checkout_url' => $checkoutUrl,
'sale_id' => $sale->id,
]);
}
return redirect()
->route('pos.sales.show', $sale)
->with('checkout_url', $result['checkout_url'])
->with('success', 'Payment sheet ready — hand the device to the customer for card or MoMo.');
->with('checkout_url', $checkoutUrl)
->with('success', 'Payment sheet ready — customer screen shows the QR; till sheet is for the operator.');
} catch (RuntimeException $e) {
return back()->withInput()->with('error', $e->getMessage());
}