metatroncubeswdev c29a74a41b new fix updated
2026-06-12 20:04:35 -04:00

86 lines
3.7 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<!-- Standalone Equal Split screen — no SplitBillScreen import needed -->
<t t-name="dine360_restaurant.EqualSplitScreen" owl="1">
<div class="equal-split-screen screen d-flex flex-column h-100">
<!-- Header -->
<div class="d-flex align-items-center px-3 py-3 border-bottom bg-light">
<button class="btn btn-secondary me-3" t-on-click="back">
<i class="fa fa-arrow-left me-1"/>Back to Split
</button>
<h4 class="mb-0 fw-bold">
<i class="fa fa-users me-2"/>Equal Split
</h4>
</div>
<!-- Body -->
<div class="d-flex flex-column align-items-center justify-content-center flex-grow-1 gap-4 p-4">
<!-- Order total reference -->
<div class="text-muted fs-6">
Order Total: <strong t-esc="formattedTotal"/>
</div>
<!-- People counter -->
<div class="d-flex align-items-center gap-4">
<button class="btn btn-outline-secondary equal-split-counter-btn"
t-on-click="decreasePeople"
t-att-disabled="state.numPeople &lt;= 2">
<i class="fa fa-minus"/>
</button>
<div class="text-center">
<div class="equal-split-count-number fw-bold" t-esc="state.numPeople"/>
<div class="text-muted small">people</div>
</div>
<button class="btn btn-outline-secondary equal-split-counter-btn"
t-on-click="increasePeople"
t-att-disabled="state.numPeople >= 20">
<i class="fa fa-plus"/>
</button>
</div>
<!-- Per-person amount -->
<div class="equal-split-amount-box text-center p-4 rounded">
<div class="text-muted mb-1 small">Each person pays</div>
<div class="equal-split-amount fw-bold" t-esc="formattedEqualAmount"/>
</div>
<!-- Charge button -->
<button class="btn btn-primary btn-lg px-5" t-on-click="chargeCurrentPerson">
<i class="fa fa-credit-card me-2"/>Charge This Person
</button>
<div class="text-muted small text-center" style="max-width: 320px;">
<i class="fa fa-info-circle me-1"/>
After payment, return to the table and press Split again.
Decrease the count by 1 each time.
</div>
</div>
</div>
</t>
<!-- Inject "Equal Split" button at the top of the standard SplitBillScreen -->
<t t-name="dine360_restaurant.EqualSplitButton"
t-inherit="pos_restaurant.SplitBillScreen"
t-inherit-mode="extension"
owl="1">
<xpath expr="//div[hasclass('split-bill-screen')]" position="prepend">
<div class="equal-split-toggle-bar d-flex align-items-center justify-content-between px-3 py-2 border-bottom">
<span class="fw-semibold text-muted small">
<i class="fa fa-cut me-1"/>Split By Item
</span>
<button class="btn btn-sm btn-primary"
t-on-click="() => pos.showScreen('EqualSplitScreen')">
<i class="fa fa-users me-1"/>Equal Split
</button>
</div>
</xpath>
</t>
</templates>