105 lines
5.8 KiB
XML
105 lines
5.8 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<templates id="template" xml:space="preserve">
|
|
|
|
<t t-name="pos_face_recognition.FaceRecognitionButton" owl="1">
|
|
<div class="control-button" t-on-click="onClick">
|
|
<i class="fa fa-camera" role="img" aria-label="Face Recognition" title="Face Recognition"/>
|
|
<span>Face Rec.</span>
|
|
</div>
|
|
</t>
|
|
|
|
<t t-name="pos_face_recognition.FaceRecognitionSidebar" owl="1">
|
|
<div class="face-recognition-sidebar">
|
|
<div class="sidebar-header">
|
|
<h3>Face Recognition</h3>
|
|
</div>
|
|
<div class="sidebar-content">
|
|
<div class="camera-container">
|
|
<video id="face-rec-video" autoplay="true" playsinline="true" width="100%"></video>
|
|
</div>
|
|
|
|
<div class="results-container" t-if="state.matches.length > 0">
|
|
<h4>Matches:</h4>
|
|
<ul class="match-list">
|
|
<t t-foreach="state.matches" t-as="match" t-key="match.id">
|
|
<li t-on-click="() => this.selectCustomer(match)" class="match-item">
|
|
<div class="match-info">
|
|
<div>
|
|
<span class="match-name"><t t-esc="match.name"/></span>
|
|
<span class="match-phone" t-if="match.phone"><br/><t t-esc="match.phone"/></span>
|
|
</div>
|
|
<span class="match-prob"><t t-esc="(match.probability * 100).toFixed(1)"/>%</span>
|
|
</div>
|
|
</li>
|
|
</t>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="customer-details" t-if="state.selectedCustomer">
|
|
<h4>Selected: <t t-esc="state.selectedCustomer.name"/></h4>
|
|
|
|
<div class="last-orders">
|
|
<h5>Last 2 Orders:</h5>
|
|
<div t-if="state.lastOrders and state.lastOrders.length > 0" class="orders-list">
|
|
<t t-foreach="state.lastOrders" t-as="order" t-key="order.id">
|
|
<div class="order-card">
|
|
<div class="order-header">
|
|
<span class="order-number">Order #<t t-esc="order.name || order.id"/></span>
|
|
<span class="order-date"><t t-esc="order.date_order"/></span>
|
|
</div>
|
|
<div class="order-details">
|
|
<div class="order-row">
|
|
<span class="label">Total:</span>
|
|
<span class="value"><t t-esc="env.utils.formatCurrency(order.amount_total)"/></span>
|
|
</div>
|
|
<div class="order-row" t-if="order.lines and order.lines.length > 0">
|
|
<span class="label">Items:</span>
|
|
<span class="value"><t t-esc="order.lines.length"/> product(s)</span>
|
|
</div>
|
|
<div class="order-row" t-if="order.state">
|
|
<span class="label">Status:</span>
|
|
<span class="value status" t-att-class="order.state"><t t-esc="order.state"/></span>
|
|
</div>
|
|
</div>
|
|
<div class="order-products" t-if="order.lines and order.lines.length > 0">
|
|
<div class="products-label">Products:</div>
|
|
<ul class="product-list">
|
|
<t t-foreach="order.lines" t-as="line" t-key="line.id">
|
|
<li class="product-item">
|
|
<span class="product-qty"><t t-esc="line.qty"/>x</span>
|
|
<span class="product-name"><t t-esc="line.product_name"/></span>
|
|
<span class="product-price"><t t-esc="env.utils.formatCurrency(line.price_subtotal_incl)"/></span>
|
|
</li>
|
|
</t>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</div>
|
|
<p t-else="" class="no-orders">No previous orders found</p>
|
|
</div>
|
|
<br/>
|
|
<div class="top-products">
|
|
<h5>Top 3 Products:</h5>
|
|
<ul t-if="state.topProducts and state.topProducts.length > 0">
|
|
<t t-foreach="state.topProducts" t-as="prod" t-key="prod_index">
|
|
<li>
|
|
<t t-out="prod['name']['en_US']"/> (Qty: <t t-out="Math.round(prod['qty'])"/>)
|
|
</li>
|
|
</t>
|
|
</ul>
|
|
<p t-else="">No previous orders found</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
|
|
<t t-name="pos_face_recognition.ProductScreen" t-inherit="point_of_sale.ProductScreen" t-inherit-mode="extension">
|
|
<xpath expr="//div[hasclass('product-screen')]" position="inside">
|
|
<FaceRecognitionSidebar />
|
|
</xpath>
|
|
</t>
|
|
|
|
</templates>
|