Debian Codegraph @

addons/point_of_sale/static/src/app/screens/payment_screen/payment_screen.xml

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <templates id="template" xml:space="preserve">
3
4 <t t-name="point_of_sale.PaymentScreen">
5 <t t-if="ui.isSmall">
6 <div class="payment-screen screen d-flex flex-column h-100 p-2 overflow-hidden gap-2">
7 <t t-call="point_of_sale.PaymentScreenDue" />
8 <div class="d-flex flex-grow-1 flex-column overflow-y-auto gap-1">
9 <t t-call="point_of_sale.PaymentScreenMethods" />
10 </div>
11 <PaymentScreenPaymentLines
12 paymentLines="paymentLines"
13 deleteLine.bind="deletePaymentLine"
14 sendForceDone.bind="sendForceDone"
15 sendPaymentReverse.bind="sendPaymentReverse"
16 sendPaymentCancel.bind="sendPaymentCancel"
17 sendPaymentRequest.bind="sendPaymentRequest"
18 selectLine.bind="selectPaymentLine"
19 updateSelectedPaymentline.bind="updateSelectedPaymentline"
20 isRefundOrder="isRefundOrder" />
21 <PaymentScreenStatus order="currentOrder" />
22 <t t-call="point_of_sale.PaymentScreenButtons" />
23 <div t-attf-class="d-flex switchpane gap-2 mt-2">
24 <t t-call="point_of_sale.PaymentScreenBack" />
25 <t t-call="point_of_sale.PaymentScreenValidate" />
26 </div>
27 </div>
28 </t>
29 <t t-else="">
30 <div class="payment-screen screen d-flex flex-column h-100 ">
31 <div class="main-content d-flex gap-2 h-100 bg-100 overflow-auto">
32 <div class="left-content d-flex flex-column col-md-4 p-1 h-100 overflow-hidden gap-1">
33 <div class="flex-grow-1 overflow-auto">
34 <t t-call="point_of_sale.PaymentScreenMethods" />
35 </div>
36 <div class="w-100 flex-shrink-0">
37 <t t-call="point_of_sale.PaymentScreenButtons" />
38 <Numpad class="'mt-2'" buttons="getNumpadButtons()"/>
39 </div>
40 <div t-attf-class="d-flex flex-row gap-1">
41 <t t-call="point_of_sale.PaymentScreenBack" />
42 <t t-call="point_of_sale.PaymentScreenValidate" />
43 </div>
44 </div>
45 <div class="center-content d-flex flex-column flex-grow-1 gap-2 py-2 pe-2"
46 t-attf-class="{{ !paymentLines.length ? 'justify-content-center align-items-center' : '' }}">
47 <t t-call="point_of_sale.PaymentScreenDue" />
48 <div t-if="paymentLines.length" class="payment-summary d-flex flex-grow-1 flex-column gap-1 overflow-y-auto py-3">
49 <PaymentScreenPaymentLines
50 paymentLines="paymentLines"
51 deleteLine.bind="deletePaymentLine"
52 sendForceDone.bind="sendForceDone"
53 sendPaymentReverse.bind="sendPaymentReverse"
54 sendPaymentCancel.bind="sendPaymentCancel"
55 sendPaymentRequest.bind="sendPaymentRequest"
56 selectLine.bind="selectPaymentLine"
57 updateSelectedPaymentline.bind="updateSelectedPaymentline"
58 isRefundOrder="isRefundOrder" />
59 <PaymentScreenStatus order="currentOrder" />
60 </div>
61 </div>
62 </div>
63 </div>
64 </t>
65 </t>
66
67 <t t-name="point_of_sale.PaymentScreenDue">
68 <section class="paymentlines-container fw-bold"
69 t-att-class="{
70 'paymentlines-empty': paymentLines.length === 0,
71 'fade-effect': this.pos.addAnimation and !ui.isSmall,
72 }">
73 <div class="total text-center text-dark"
74 t-att-style="!ui.isSmall? 'font-size: 125px;' : ''" >
75 <PriceFormatter price="this.env.utils.formatCurrency(currentOrder.totalDue)" />
76 </div>
77 </section>
78 </t>
79
80 <t t-name="point_of_sale.PaymentScreenValidate">
81 <button class="validation-button next btn btn-primary btn-lg py-3 lh-lg"
82 t-on-click="() => this.validateOrder()"
83 t-attf-class="
84 {{ ui.isSmall ? 'btn-switchpane flex-fill' : 'button next w-50' }}
85 {{ currentOrder.canBeValidated() and !currentOrder.isRefundInProcess() ? 'highlight' : 'disabled' }}
86 "
87 >
88 <span>Validate</span>
89 </button>
90 </t>
91
92 <t t-name="point_of_sale.PaymentScreenBack">
93 <t t-if="ui.isSmall">
94 <button class="btn-switchpane back-button validation-button btn btn-secondary btn-lg lh-lg "
95 t-on-click="() => pos.onClickBackButton()">
96 <i class="oi oi-chevron-left fa-fw" role="img" aria-label="Go Back" title="Go Back" />
97 </button>
98 </t>
99 <t t-else="">
100 <button class="button back back-button validation btn btn-secondary btn-lg w-50 py-3 lh-lg "
101 t-on-click="() => pos.onClickBackButton()">
102 <span class="back_text">Back</span>
103 </button>
104 </t>
105 </t>
106
107 <t t-name="point_of_sale.PaymentScreenButtons">
108 <div class="payment-buttons d-flex flex-column gap-1">
109 <div class="d-flex flex-column flex-sm-row gap-1 w-100">
110 <t t-set="hasOptionalButtons" t-value="pos.config.iface_tipproduct and pos.config.tip_product_id or pos.config.iface_cashdrawer or pos.config.ship_later" />
111 <button class="button partner-button btn btn-lg w-100 w-md-50 lh-lg text-truncate"
112 t-att-class="{ 'highlight text-action': currentOrder.getPartner() }"
113 t-attf-class="{{ currentOrder.isCustomerRequired ? 'btn-primary' : 'btn-secondary' }}"
114 t-on-click="() => this.pos.selectPartner()">
115 <i class="fa fa-user me-2" role="img" title="Customer" />
116 <span class="partner-name">
117 <t t-if="currentOrder.getPartner()" t-esc="currentOrder.getPartner().name"/>
118 <t t-else="">Customer</t>
119 </span>
120 </button>
121 <button class="button js_invoice btn btn-secondary btn-lg d-flex justify-content-between align-items-baseline w-100 w-md-50 lh-lg"
122 t-att-class="{ 'highlight active': currentOrder.isToInvoice(), 'opacity-50': !pos.config.canInvoice }"
123 t-on-click="toggleIsToInvoice" t-att-disabled="currentOrder.lines[0]?.refunded_orderline_id?.order_id?.isToInvoice()">
124 <span>
125 <i class="fa fa-file-text-o me-2" />
126 <t t-if="pos.config.canInvoice">Invoice</t>
127 <t t-else="">Not available</t>
128 </span>
129 <i class="fa me-2" t-attf-class="{{ currentOrder.isToInvoice() ? 'fa-check-square text-action' : 'fa-square-o' }}" />
130 </button>
131 </div>
132 <div t-if="(pos.config.iface_tipproduct and pos.config.tip_product_id) or pos.config.iface_cashdrawer or pos.config.ship_later" class="d-flex flex-column gap-1 w-100">
133 <button t-if="pos.config.iface_tipproduct and pos.config.tip_product_id" class="button btn btn-secondary btn-lg d-flex justify-content-between align-items-baseline w-100 lh-lg" t-att-class="{ 'highlight active text-action': currentOrder.getTip() }"
134 t-on-click="addTip">
135 <span t-attf-class="{{currentOrder.getTip() ? 'me-auto' : 'mx-auto' }}"><i class="fa fa-heart me-2" />Tip</span>
136 <t t-if="currentOrder.getTip() != 0">
137 <t t-esc="env.utils.formatCurrency(currentOrder.getTip())" />
138 </t>
139 </button>
140 <button t-if="pos.config.iface_cashdrawer" class="button js_cashdrawer btn btn-secondary btn-lg py-3 rounded"
141 t-on-click="openCashbox">
142 <i class="fa fa-archive me-2" />Open Cashbox
143 </button>
144 <button t-if="pos.config.ship_later" class="button btn btn-secondary btn-lg d-flex justify-content-between align-items-baseline w-100 lh-lg" t-att-class="{ 'highlight active text-action': currentOrder.getShippingDate() }"
145 t-on-click="toggleShippingDatePicker">
146 <span t-attf-class="{{currentOrder.getShippingDate() ? 'me-auto' : 'mx-auto' }}"><i class="fa fa-clock-o me-2" />Ship Later</span>
147 <span t-if="currentOrder.getShippingDate()">
148 <t t-esc="currentOrder.getShippingDate()" />
149 </span>
150 </button>
151 </div>
152 </div>
153 </t>
154
155 <t t-name="point_of_sale.PaymentScreenMethods">
156 <div class="paymentmethods-container mb-3" t-att-class="ui.isSmall ? 'my-2 rounded-3' : 'flex-grow-1'">
157 <div class="paymentmethods gap-1 gap-lg-2" t-att-class="{ 'd-grid p-1 gap-1 overflow-y-auto rounded-3 bg-200': ui.isSmall, 'd-flex flex-column gap-lg-2': !ui.isSmall }">
158 <t t-foreach="payment_methods_from_config" t-as="paymentMethod" t-key="paymentMethod.id">
159 <div t-if="!(this.pos.cashier._role === 'minimal' and paymentMethod.type === 'pay_later')" class="button paymentmethod btn btn-secondary btn-lg lh-lg flex-fill"
160 t-att-class="{'opacity-50': this.pos.paymentTerminalInProgress and paymentMethod.use_payment_terminal, 'd-flex justify-content-between align-items-center': true}"
161 t-on-click="() => this.addNewPaymentLine(paymentMethod)">
162 <div class="payment-method-display d-flex align-items-center gap-2 text-wrap text-start lh-sm">
163 <img class="payment-method-icon" t-att-src="paymentMethodImage(paymentMethod.id)" />
164 <span class="payment-name" t-esc="paymentMethod.name" />
165 </div>
166 <span class="text-muted" t-esc="pos.getPaymentMethodFmtAmount(paymentMethod, currentOrder)"/>
167 </div>
168 </t>
169 </div>
170 </div>
171 </t>
172
173 </templates>