swissqr_report.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <data>
  4. <record id="l10n_ch_qr_report" model="ir.actions.report">
  5. <field name="name">QR-bill</field>
  6. <field name="model">account.move</field>
  7. <field name="report_type">qweb-pdf</field>
  8. <field name="report_name">l10n_ch.qr_report_main</field>
  9. <field name="report_file">l10n_ch.qr_report_main</field>
  10. <field name="print_report_name">'QR-bill-%s' % object.name</field>
  11. <field name="paperformat_id" ref="l10n_ch.paperformat_euro_no_margin"/>
  12. </record>
  13. <record id="l10n_ch_qr_header" model="ir.actions.report">
  14. <field name="name">QR-bill Header</field>
  15. <field name="model">account.move</field>
  16. <field name="report_type">qweb-pdf</field>
  17. <field name="report_name">l10n_ch.qr_report_header</field>
  18. <field name="report_file">l10n_ch.qr_report_header</field>
  19. </record>
  20. <template id="l10n_ch_header_template">
  21. <t t-call="web.external_layout">
  22. <!--The following elements are necessary for the header to be displayed correctly.-->
  23. <br/>
  24. <p>&amp;nbsp;</p>
  25. </t>
  26. </template>
  27. <template id="l10n_ch_swissqr_template">
  28. <div class="article" t-att-data-oe-model="o._name" t-att-data-oe-id="o.id">
  29. <t t-set="o" t-value="o.with_context(lang=lang)"/>
  30. <t t-set="company" t-value="o.company_id"/>
  31. <t t-set="formated_amount" t-value="'{:,.2f}'.format(o.amount_residual).replace(',','\xa0')"/>
  32. <t t-set="is_qrr" t-value="o.partner_bank_id.l10n_ch_qr_iban"/>
  33. <t t-set="is_scor" t-value="o.partner_bank_id._is_iso11649_reference(o.payment_reference)"/>
  34. <div class="swissqr_content_v2">
  35. <div class="swissqr_receipt">
  36. <img src="/l10n_ch/static/src/img/scissors_h.png" class="scissors horizontal_scissors"/>
  37. <div id="receipt_title_zone" class="swissqr_section_title">
  38. <span>Receipt</span>
  39. </div>
  40. <div id="receipt_indication_zone" class="receipt_indication_zone">
  41. <div class="swissqr_text title">
  42. <span>Account / Payable to</span>
  43. </div>
  44. <div class="swissqr_text content">
  45. <span t-field="o.partner_bank_id.acc_number" t-if="not o.partner_bank_id.l10n_ch_qr_iban"/>
  46. <span t-field="o.partner_bank_id.l10n_ch_qr_iban" t-if="o.partner_bank_id.l10n_ch_qr_iban"/>
  47. <br/>
  48. <span t-esc="o.partner_bank_id.acc_holder_name or o.company_id.name"/><br/>
  49. <span t-field="o.company_id.street"/><br/>
  50. <span t-field="o.company_id.country_id.code"/>
  51. <span t-field="o.company_id.zip"/>
  52. <span t-field="o.company_id.city"/><br/>
  53. <br/>
  54. </div>
  55. <t t-if="is_qrr or is_scor">
  56. <div class="swissqr_text title">
  57. <span>Reference</span>
  58. </div>
  59. </t>
  60. <t t-if="is_qrr">
  61. <div class="swissqr_text content">
  62. <span t-esc="o.space_qrr_reference(o.payment_reference)"/><br/>
  63. <br/>
  64. </div>
  65. </t>
  66. <t t-if="is_scor">
  67. <div class="swissqr_text content">
  68. <span t-esc="o.space_scor_reference(o.payment_reference)"/><br/>
  69. <br/>
  70. </div>
  71. </t>
  72. <div class="swissqr_text title">
  73. <span>Payable by</span>
  74. </div>
  75. <div class="swissqr_text content">
  76. <span t-field="o.partner_id.commercial_partner_id.name"/><br/>
  77. <span t-field="o.partner_id.street"/>
  78. <span t-field="o.partner_id.street2"/><br/>
  79. <span t-field="o.partner_id.country_id.code"/>
  80. <span t-field="o.partner_id.zip"/>
  81. <span t-field="o.partner_id.city"/>
  82. </div>
  83. </div>
  84. <div id="receipt_amount_zone" class="swissqr_column_left receipt_amount_zone">
  85. <div class="swissqr_text">
  86. <div class="column">
  87. <div class="title">
  88. <span>Currency</span>
  89. </div>
  90. <div class="content">
  91. <span t-field="o.currency_id.name"/>
  92. </div>
  93. </div>
  94. <div class="column">
  95. <div class="title">
  96. <span>Amount</span>
  97. </div>
  98. <div class="content">
  99. <span t-esc="formated_amount"/>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. <div id="receipt_acceptance_point_zone" class="receipt_acceptance_point_zone">
  105. <div class="swissqr_text content">
  106. <span class="title">Acceptance point</span>
  107. </div>
  108. </div>
  109. </div>
  110. <div class="swissqr_body">
  111. <img src="/l10n_ch/static/src/img/scissors_v.png" class="scissors vertical_scissors"/>
  112. <div class="swissqr_column_left">
  113. <div class="swissqr_section_title">
  114. <span>Payment part</span>
  115. </div>
  116. <img class="swissqr" t-att-src="qr_code_urls[o.id]"/>
  117. <div id="amount_zone" class="amount_zone">
  118. <div class="swissqr_text">
  119. <div class="column">
  120. <div class="title">
  121. <span>Currency</span>
  122. </div>
  123. <div class="content">
  124. <span t-field="o.currency_id.name"/>
  125. </div>
  126. </div>
  127. <div class="column">
  128. <div class="title">
  129. <span>Amount</span><br/>
  130. </div>
  131. <div class="content">
  132. <span t-esc="formated_amount"/>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <div id="indications_zone" class="swissqr_column_right">
  139. <div class="swissqr_text title">
  140. <span>Account / Payable to</span><br/>
  141. </div>
  142. <div class="swissqr_text content">
  143. <span t-field="o.partner_bank_id.acc_number" t-if="not o.partner_bank_id.l10n_ch_qr_iban"/>
  144. <span t-field="o.partner_bank_id.l10n_ch_qr_iban" t-if="o.partner_bank_id.l10n_ch_qr_iban"/>
  145. <br/>
  146. <span t-esc="o.partner_bank_id.acc_holder_name or o.company_id.name"/><br/>
  147. <span t-field="o.company_id.street"/><br/>
  148. <span t-field="o.company_id.country_id.code"/>
  149. <span t-field="o.company_id.zip"/>
  150. <span t-field="o.company_id.city"/><br/>
  151. <br/>
  152. </div>
  153. <t t-if="is_qrr or is_scor">
  154. <div class="swissqr_text title">
  155. <span class="title">Reference</span>
  156. </div>
  157. </t>
  158. <t t-if="is_qrr">
  159. <div class="swissqr_text content">
  160. <span t-esc="o.space_qrr_reference(o.payment_reference)"/><br/>
  161. <br/>
  162. </div>
  163. </t>
  164. <t t-if="is_scor">
  165. <div class="swissqr_text content">
  166. <span t-esc="o.space_scor_reference(o.payment_reference)"/><br/>
  167. <br/>
  168. </div>
  169. </t>
  170. <t t-set="additional_info" t-value="(o.ref or o.name if is_qrr or is_scor else o.payment_reference or o.ref or o.name)"/>
  171. <t t-if="additional_info">
  172. <div class="swissqr_text title">
  173. <span>Additional information</span>
  174. </div>
  175. <div class="swissqr_text content">
  176. <span t-esc="additional_info"/><br/>
  177. <br/>
  178. </div>
  179. </t>
  180. <div class="swissqr_text title">
  181. <span>Payable by</span>
  182. </div>
  183. <div class="swissqr_text content">
  184. <span t-field="o.partner_id.commercial_partner_id.name"/><br/>
  185. <span t-field="o.partner_id.street"> </span>
  186. <span t-field="o.partner_id.street2"/><br/>
  187. <span t-field="o.partner_id.country_id.code"/>
  188. <span t-field="o.partner_id.zip"/>
  189. <span t-field="o.partner_id.city"/><br/>
  190. <br/>
  191. </div>
  192. </div>
  193. </div>
  194. </div>
  195. </div>
  196. </template>
  197. <template id="l10n_ch.qr_report_main">
  198. <t t-call="web.html_container">
  199. <t t-foreach="docs" t-as="o">
  200. <t t-set="lang" t-value="o.partner_id.lang"/>
  201. <t t-call="l10n_ch.l10n_ch_swissqr_template" t-lang="lang"/>
  202. </t>
  203. </t>
  204. </template>
  205. <template id="l10n_ch.qr_report_header">
  206. <t t-call="web.html_container">
  207. <t t-foreach="docs" t-as="invoice">
  208. <t t-set="o" t-value="invoice"/>
  209. <t t-set="lang" t-value="o.partner_id.lang"/>
  210. <t t-call="l10n_ch.l10n_ch_header_template" t-lang="lang"/>
  211. </t>
  212. </t>
  213. </template>
  214. <template id="minimal_layout_with_report_attribute" inherit_id="web.minimal_layout">
  215. <body position="attributes">
  216. <attribute name="t-att-data-report-id">report_xml_id</attribute>
  217. </body>
  218. </template>
  219. </data>
  220. </odoo>