pos_customer_orders/static/src/xml/partner_editor.xml

61 lines
3.6 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="pos_customer_orders.PartnerDetailsEdit" t-inherit="point_of_sale.PartnerDetailsEdit" t-inherit-mode="extension">
<xpath expr="//section" position="after">
<section class="partner-details-orders d-flex flex-column m-3">
<div class="container">
<h3 class="mb-3">Top 3 Products</h3>
<t t-if="state.topProducts and state.topProducts.length > 0">
<div class="list-group mb-4">
<t t-foreach="state.topProducts" t-as="product" t-key="product.product_name">
<div class="list-group-item d-flex justify-content-between align-items-center">
<span class="fw-bold" t-esc="product.product_name"/>
<span class="text-muted">
<i class="fa fa-shopping-cart me-1"/>
<strong class="text-dark" style="font-size: 1.1em;"><t t-esc="product.total_qty"/></strong> Units
</span>
</div>
</t>
</div>
</t>
<t t-else="">
<div class="alert alert-info mb-4">No top products found.</div>
</t>
<h3 class="mb-3">Last Orders</h3>
<t t-if="state.lastOrders and state.lastOrders.length > 0">
<div class="list-group">
<t t-foreach="state.lastOrders" t-as="order" t-key="order.id">
<div class="list-group-item list-group-item-action flex-column align-items-start">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1"><t t-esc="order.pos_reference || order.name"/></h5>
<small class="text-muted"><t t-esc="order.date_order"/></small>
</div>
<p class="mb-1">Total: <t t-esc="env.utils.formatCurrency(order.amount_total)"/></p>
<small class="text-muted" t-if="order.note">Note: <t t-esc="order.note"/></small>
<div class="mt-2" t-if="order.lines and order.lines.length > 0">
<small class="fw-bold">Products:</small>
<ul class="list-unstyled small ps-2">
<t t-foreach="order.lines" t-as="line" t-key="line.id">
<li>
<t t-esc="line.qty"/> x <t t-esc="line.product_name"/>
(<t t-esc="env.utils.formatCurrency(line.price_subtotal_incl)"/>)
</li>
</t>
</ul>
</div>
</div>
</t>
</div>
</t>
<t t-else="">
<div class="alert alert-info">No orders found for this customer.</div>
</t>
</div>
</section>
</xpath>
</t>
</templates>