8727743a2ad980bb4662a95bf37db013b149a8d8
[odoo/odoo.git] / addons / pos_restaurant / static / src / xml / printbill.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <templates id="template" xml:space="preserve">
3
4     <t t-name="PrintBillButton">
5         <span class="control-button order-printbill">
6             <i class="fa fa-print"></i>
7             Bill
8         </span>
9     </t>
10
11     <t t-name="BillReceipt">
12         <receipt align='center' width='40' value-thousands-separator='' >
13             <t t-if='receipt.company.logo'>
14                 <img t-att-src='receipt.company.logo' />
15                 <br/>
16             </t>
17             <t t-if='!receipt.company.logo'>
18                 <h1><t t-esc='receipt.company.name' /></h1>
19                 <br/>
20             </t>
21             <div font='b'>
22                 <t t-if='receipt.shop.name'>
23                     <div><t t-esc='receipt.shop.name' /></div>
24                 </t>
25                 <t t-if='receipt.company.contact_address'>
26                     <div><t t-esc='receipt.company.contact_address' /></div>
27                 </t>
28                 <t t-if='receipt.company.phone'>
29                     <div>Tel:<t t-esc='receipt.company.phone' /></div>
30                 </t>
31                 <t t-if='receipt.company.vat'>
32                     <div>VAT:<t t-esc='receipt.company.vat' /></div>
33                 </t>
34                 <t t-if='receipt.company.email'>
35                     <div><t t-esc='receipt.company.email' /></div>
36                 </t>
37                 <t t-if='receipt.company.website'>
38                     <div><t t-esc='receipt.company.website' /></div>
39                 </t>
40                 <t t-if='receipt.header'>
41                     <div><t t-esc='receipt.header' /></div>
42                 </t>
43                 <t t-if='receipt.cashier'>
44                     <div>--------------------------------</div>
45                     <div>Served by <t t-esc='receipt.cashier' /></div>
46                 </t>
47             </div>
48             <br /><br />
49
50             <!-- Orderlines -->
51
52             <div line-ratio='0.6'>
53                 <t t-foreach='receipt.orderlines' t-as='line'>
54                     <t t-set='simple' t-value='line.discount === 0 and line.unit_name === "Unit(s)" and line.quantity === 1' />
55                     <t t-if='simple'>
56                         <line>
57                             <left><t t-esc='line.product_name' /></left>
58                             <right><value><t t-esc='line.price_display' /></value></right>
59                         </line>
60                     </t>
61                     <t t-if='!simple'>
62                         <line><left><t t-esc='line.product_name' /></left></line>
63                         <t t-if='line.discount !== 0'>
64                             <line indent='1'><left>Discount: <t t-esc='line.discount' />%</left></line>
65                         </t>
66                         <line indent='1'>
67                             <left>
68                                 <value value-decimals='3' value-autoint='on'>
69                                     <t t-esc='line.quantity' />
70                                 </value>
71                                 <t t-if='line.unit_name !== "Unit(s)"'>
72                                     <t t-esc='line.unit_name' /> 
73                                 </t>
74                                 x 
75                                 <value value-decimals='2'>
76                                     <t t-esc='line.price' />
77                                 </value>
78                             </left>
79                             <right>
80                                 <value><t t-esc='line.price_display' /></value>
81                             </right>
82                         </line>
83                     </t>
84                 </t>
85             </div>
86
87             <!-- Subtotal -->
88             <t t-set='taxincluded' t-value='Math.abs(receipt.subtotal - receipt.total_with_tax) &lt;= 0.000001' />
89             <t t-if='!taxincluded'>
90                 <line><right>--------</right></line>
91                 <line><left>Subtotal</left><right> <value><t t-esc="receipt.subtotal" /></value></right></line>
92                 <t t-foreach='receipt.tax_details' t-as='tax'>
93                     <line>
94                         <left><t t-esc='tax.name' /></left>
95                         <right><value><t t-esc='tax.amount' /></value></right>
96                     </line>
97                 </t>
98             </t>
99
100             <!-- Total -->
101
102             <line><right>--------</right></line>
103             <line size='double-height'>
104                 <left><pre>        TOTAL</pre></left>
105                 <right><value><t t-esc='receipt.total_with_tax' /></value></right>
106             </line>
107             <br/><br/>
108
109             <!-- Extra Payment Info -->
110
111             <t t-if='receipt.total_discount'>
112                 <line>
113                     <left>Discounts</left>
114                     <right><value><t t-esc='receipt.total_discount'/></value></right>
115                 </line>
116             </t>
117             <t t-if='taxincluded'>
118                 <t t-foreach='receipt.tax_details' t-as='tax'>
119                     <line>
120                         <left><t t-esc='tax.name' /></left>
121                         <right><value><t t-esc='tax.amount' /></value></right>
122                     </line>
123                 </t>
124             </t>
125
126             <!-- Footer -->
127             <t t-if='receipt.footer'>
128                 <br/>
129                 <pre><t t-esc='receipt.footer' /></pre>
130                 <br/>
131                 <br/>
132             </t>
133
134             <br/>
135             <div font='b'>
136                 <div><t t-esc='receipt.name' /></div>
137                 <div><t t-esc='receipt.date.localestring' /></div>
138             </div>
139
140         </receipt>
141     </t>
142
143 </templates>