printbill.xml 5.5 KB

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