Files
ladill-pos/resources/views/pos/partials/customer-picker.blade.php
T
isaaccladandCursor e5d2b84388
Deploy Ladill Mini / deploy (push) Successful in 23s
Add Ladill POS v1 — register, Pay checkout, and commerce links.
Staff-facing counter register at pos.ladill.com with catalog cart, cash and
MoMo/card checkout via Ladill Pay, CRM timeline/import, invoice prefill, and
Merchant catalog import.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 22:52:24 +00:00

29 lines
1.4 KiB
PHP

@props(['customers' => []])
@if (!empty($customers))
<div class="rounded-xl bg-indigo-50/60 p-3"
x-data="{
cid: '',
customers: @js(array_values($customers)),
fill() {
const c = this.customers.find((x) => String(x.id) === String(this.cid));
if (!c) return;
const set = (id, v) => { const el = document.getElementById(id); if (el) el.value = v || ''; };
set('customer_name', c.name);
set('customer_email', c.email || '');
set('customer_phone', c.phone || '');
const hidden = document.getElementById('crm_customer_id');
if (hidden) hidden.value = c.id;
}
}">
<label class="text-xs font-medium text-slate-600">CRM customer (optional)</label>
<select x-model="cid" @change="fill()"
class="mt-1 block w-full rounded-lg border-slate-200 text-sm focus:border-indigo-500 focus:ring-indigo-500">
<option value="">Walk-in customer</option>
@foreach (array_values($customers) as $c)
<option value="{{ $c['id'] }}">{{ $c['name'] }}@if (!empty($c['email'])) ({{ $c['email'] }})@endif</option>
@endforeach
</select>
<input type="hidden" name="crm_customer_id" id="crm_customer_id" value="">
</div>
@endif