Add interactive customer selection to checkout modal
Replaced static customer display in the checkout/sale modal with the same interactive button functionality from the cart sidebar. Changes: - **HTML**: Replaced static div with interactive button + reset button in checkout modal - **JavaScript**: - Updated updateCustomerDisplay() to handle both locations (cart + checkout modal) - Added event listeners for checkout modal customer buttons - Both buttons now synchronized and use the same selection modal Benefits: ✅ Consistent UX across cart and checkout modal ✅ Full code reuse - same selection modal, search, and logic ✅ Both locations stay synchronized automatically ✅ Can search, select, and reset customer directly from checkout modal Implementation: - Cart sidebar button: customerSelectBtn, resetCustomerBtn - Checkout modal button: checkoutCustomerSelectBtn, checkoutResetCustomerBtn - Single updateCustomerDisplay() updates both locations - Single selectCustomer() used by all buttons 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -277,9 +277,18 @@
|
||||
<div class="col-md-7">
|
||||
<!-- Информация о клиенте -->
|
||||
<div class="mb-3">
|
||||
<strong>Клиент</strong>
|
||||
<div class="border rounded p-2 mt-2 bg-light">
|
||||
<div class="fw-bold" id="checkoutCustomerName">—</div>
|
||||
<label class="form-label fw-semibold">Клиент</label>
|
||||
<div class="d-flex gap-1 align-items-center">
|
||||
<button class="btn btn-outline-primary btn-sm d-flex align-items-center" id="checkoutCustomerSelectBtn">
|
||||
<i class="bi bi-person me-1"></i>
|
||||
<div class="d-flex flex-column align-items-start lh-1">
|
||||
<small class="text-muted" style="font-size: 0.65rem;">Клиент</small>
|
||||
<span id="checkoutCustomerSelectBtnText" class="fw-semibold">Выбрать</span>
|
||||
</div>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-outline-danger" id="checkoutResetCustomerBtn" title="Сброс на системного клиента" style="display: none;">
|
||||
<i class="bi bi-x-lg"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user