summaryrefslogtreecommitdiff
path: root/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml
blob: 379b360d26dfbc0578d19312735ae05d70a86e80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">

    <t t-name="OrderReceipt" owl="1">
        <div class="pos-receipt">
            <t t-if="receipt.company.logo">
                <img class="pos-receipt-logo" t-att-src="receipt.company.logo" alt="Logo"/>
                <br/>
            </t>
            <t t-if="!receipt.company.logo">
                <h2 class="pos-receipt-center-align">
                    <t t-esc="receipt.company.name" />
                </h2>
                <br/>
            </t>
            <div class="pos-receipt-contact">
                <t t-if="receipt.company.contact_address">
                    <div><t t-esc="receipt.company.contact_address" /></div>
                </t>
                <t t-if="receipt.company.phone">
                    <div>Tel:<t t-esc="receipt.company.phone" /></div>
                </t>
                <t t-if="receipt.company.vat">
                    <div><t t-esc="receipt.company.vat_label"/>:<t t-esc="receipt.company.vat" /></div>
                </t>
                <t t-if="receipt.company.email">
                    <div><t t-esc="receipt.company.email" /></div>
                </t>
                <t t-if="receipt.company.website">
                    <div><t t-esc="receipt.company.website" /></div>
                </t>
                <t t-if="receipt.header_html">
                    <t t-raw="receipt.header_html" />
                </t>
                <t t-if="!receipt.header_html and receipt.header">
                    <div style="white-space:pre-line"><t t-esc="receipt.header" /></div>
                </t>
                <t t-if="receipt.cashier">
                    <div class="cashier">
                        <div>--------------------------------</div>
                        <div>Served by <t t-esc="receipt.cashier" /></div>
                    </div>
                </t>
            </div>
            <br /><br />

            <!-- Orderlines -->

            <div class="orderlines">
                <t t-foreach="receipt.orderlines" t-as="line" t-key="line.id">
                    <t t-if="isSimple(line)">
                        <div>
                            <t t-esc="line.product_name_wrapped[0]" />
                            <span t-esc="env.pos.format_currency_no_symbol(line.price_display)" class="price_display pos-receipt-right-align"/>
                        </div>
                        <WrappedProductNameLines line="line" />
                    </t>
                    <t t-else="">
                        <div t-esc="line.product_name_wrapped[0]" />
                        <WrappedProductNameLines line="line" />
                        <t t-if="line.display_discount_policy == 'without_discount' and line.price != line.price_lst">
                            <div class="pos-receipt-left-padding">
                                <t t-esc="env.pos.format_currency_no_symbol(line.price_lst)" />
                                ->
                                <t t-esc="env.pos.format_currency_no_symbol(line.price)" />
                            </div>
                        </t>
                        <t t-elif="line.discount !== 0">
                            <div class="pos-receipt-left-padding">
                                <t t-if="env.pos.config.iface_tax_included === 'total'">
                                    <t t-esc="env.pos.format_currency_no_symbol(line.price_with_tax_before_discount)"/>
                                </t>
                                <t t-else="">
                                    <t t-esc="env.pos.format_currency_no_symbol(line.price)"/>
                                </t>
                            </div>
                        </t>
                        <t t-if="line.discount !== 0">
                            <div class="pos-receipt-left-padding">
                                Discount: <t t-esc="line.discount" />%
                            </div>
                        </t>
                        <div class="pos-receipt-left-padding">
                            <t t-esc="Math.round(line.quantity * Math.pow(10, env.pos.dp['Product Unit of Measure'])) / Math.pow(10, env.pos.dp['Product Unit of Measure'])"/>
                            <t t-if="!line.is_in_unit" t-esc="line.unit_name" />
                            x
                            <t t-esc="env.pos.format_currency_no_symbol(line.price_display_one)" />
                            <span class="price_display pos-receipt-right-align">
                                <t t-esc="env.pos.format_currency_no_symbol(line.price_display)" />
                            </span>
                        </div>
                    </t>
                    <t t-if="line.pack_lot_lines">
                        <div class="pos-receipt-left-padding">
                            <ul>
                                <t t-foreach="line.pack_lot_lines" t-as="lot" t-key="lot.cid">
                                    <li>
                                        SN <t t-esc="lot.attributes['lot_name']"/>
                                    </li>
                                </t>
                            </ul>
                        </div>
                    </t>
                </t>
            </div>

            <!-- Subtotal -->

            <t t-if="!isTaxIncluded">
                <div class="pos-receipt-right-align">--------</div>
                <br/>
                <div>Subtotal<span t-esc="env.pos.format_currency(receipt.subtotal)" class="pos-receipt-right-align"/></div>
                <t t-foreach="receipt.tax_details" t-as="tax" t-key="tax.name">
                    <div>
                        <t t-esc="tax.name" />
                        <span t-esc='env.pos.format_currency_no_symbol(tax.amount)' class="pos-receipt-right-align"/>
                    </div>
                </t>
            </t>

            <!-- Total -->
            <div class="pos-receipt-right-align">--------</div>
            <br/>
            <div class="pos-receipt-amount">
                TOTAL
                <span t-esc="env.pos.format_currency(receipt.total_with_tax)" class="pos-receipt-right-align"/>
            </div>
            <t t-if="receipt.total_rounded != receipt.total_with_tax">
                <div class="pos-receipt-amount">
                  Rounding
                <span t-esc='env.pos.format_currency(receipt.rounding_applied)' class="pos-receipt-right-align"/>
                </div>
                <div class="pos-receipt-amount">
                  To Pay
                 <span t-esc='env.pos.format_currency(receipt.total_rounded)' class="pos-receipt-right-align"/>
              </div>
            </t>
            <br/><br/>

            <!-- Payment Lines -->

            <t t-foreach="receipt.paymentlines" t-as="line" t-key="line.cid">
                <div>
                    <t t-esc="line.name" />
                    <span t-esc="env.pos.format_currency_no_symbol(line.amount)" class="pos-receipt-right-align"/>
                </div>
            </t>
            <br/>

            <div class="pos-receipt-amount receipt-change">
                CHANGE
                <span t-esc="env.pos.format_currency(receipt.change)" class="pos-receipt-right-align"/>
            </div>
            <br/>

            <!-- Extra Payment Info -->

            <t t-if="receipt.total_discount">
                <div>
                    Discounts
                    <span t-esc="env.pos.format_currency(receipt.total_discount)" class="pos-receipt-right-align"/>
                </div>
            </t>
            <t t-if="isTaxIncluded">
                <t t-foreach="receipt.tax_details" t-as="tax" t-key="tax.name">
                    <div>
                        <t t-esc="tax.name" />
                        <span t-esc="env.pos.format_currency_no_symbol(tax.amount)" class="pos-receipt-right-align"/>
                    </div>
                </t>
                <div>
                    Total Taxes
                    <span t-esc="env.pos.format_currency(receipt.total_tax)" class="pos-receipt-right-align"/>
                </div>
            </t>

            <div class="before-footer" />

            <!-- Footer -->
            <div t-if="receipt.footer_html"  class="pos-receipt-center-align">
                <t t-raw="receipt.footer_html" />
            </div>

            <div t-if="!receipt.footer_html and receipt.footer"  class="pos-receipt-center-align" style="white-space:pre-line">
                <br/>
                <t t-esc="receipt.footer" />
                <br/>
                <br/>
            </div>

            <div class="after-footer">
                <t t-foreach="receipt.paymentlines" t-as="line">
                    <t t-if="line.ticket">
                        <br />
                        <div class="pos-payment-terminal-receipt">
                            <t t-raw="line.ticket" />
                        </div>
                    </t>
                </t>
            </div>

            <br/>
            <div class="pos-receipt-order-data">
                <div><t t-esc="receipt.name" /></div>
                <div><t t-esc="receipt.date.localestring" /></div>
            </div>

        </div>
    </t>

</templates>