You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

237 lines
12 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <template id="theme_invoice_G002_document">
  4. <t t-call="web.external_layout">
  5. <t t-set="address">
  6. <address t-field="o.partner_id"
  7. t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
  8. <div t-if="o.partner_id.vat" class="mt16"><t
  9. t-esc="o.company_id.country_id.vat_label or 'Tax ID'"/>:
  10. <span t-field="o.partner_id.vat"/>
  11. </div>
  12. </t>
  13. <div class="page mt32">
  14. <h2>
  15. <span t-if="o.release_capital_request">Request to Release
  16. Capital
  17. </span>
  18. <span t-else="">
  19. <span t-if="o.type == 'out_invoice' and o.state in ('open', 'in_payment', 'paid')">
  20. Invoice
  21. </span>
  22. <span t-if="o.type == 'out_invoice' and o.state == 'draft'">
  23. Draft Invoice
  24. </span>
  25. <span t-if="o.type == 'out_invoice' and o.state == 'cancel'">
  26. Cancelled Invoice
  27. </span>
  28. <span t-if="o.type == 'out_refund'">Credit Note</span>
  29. <span t-if="o.type == 'in_refund'">Vendor Credit Note
  30. </span>
  31. <span t-if="o.type == 'in_invoice'">Vendor Bill</span>
  32. </span>
  33. <span t-field="o.number"/>
  34. </h2>
  35. <div id="informations" class="row mt32 mb32">
  36. <div class="col-auto mw-100 mb-2" t-if="o.name"
  37. name="description">
  38. <strong>Description:</strong>
  39. <p class="m-0" t-field="o.name"/>
  40. </div>
  41. <div class="col-auto mw-100 mb-2" t-if="o.date_invoice"
  42. name="invoice_date">
  43. <strong>Request Date:</strong>
  44. <p class="m-0" t-field="o.date_invoice"/>
  45. </div>
  46. <div name="reference" class="col-auto mw-100 mb-2"
  47. t-if="o.reference">
  48. <strong>Structured Communication:</strong>
  49. <p class="m-0" t-field="o.reference"/>
  50. </div>
  51. <div name="account_number" class="col-auto mw-100 mb-2">
  52. <strong>Account Number:</strong>
  53. <t t-foreach="o.company_id.bank_journal_ids"
  54. t-as="journal">
  55. <t t-set="b" t-value="journal.bank_account_id"/>
  56. <t t-if="o.release_capital_request and journal.get_cooperator_payment">
  57. <p class="m-0" t-field="b.acc_number"/>
  58. </t>
  59. <t t-if="not o.release_capital_request and journal.get_general_payment">
  60. <p t-field="b.acc_number"/>
  61. </t>
  62. </t>
  63. </div>
  64. <div name="contact" class="col-auto mw-100 mb-2">
  65. <strong>Your Contact:</strong>
  66. <p t-field="o.user_id"/>
  67. </div>
  68. </div>
  69. <t t-set="display_discount"
  70. t-value="any([l.discount for l in o.invoice_line_ids])"/>
  71. <table class="table table-sm o_main_table"
  72. name="invoice_line_table">
  73. <thead>
  74. <tr>
  75. <t t-set="colspan" t-value="5"/>
  76. <th class="text-left">
  77. <span>Description</span>
  78. </th>
  79. <th class="d-none text-left">
  80. <span>Source Document</span>
  81. </th>
  82. <th class="text-right">
  83. <span>Part Type</span>
  84. </th>
  85. <th class="text-right">
  86. <span>Quantity</span>
  87. </th>
  88. <th t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
  89. <span>Unit Price</span>
  90. </th>
  91. <th class="text-right">
  92. <span groups="account.group_show_line_subtotals_tax_excluded">
  93. Amount
  94. </span>
  95. <span groups="account.group_show_line_subtotals_tax_included">
  96. Total Price
  97. </span>
  98. </th>
  99. </tr>
  100. </thead>
  101. <tbody class="invoice_tbody">
  102. <t t-set="current_subtotal" t-value="0"/>
  103. <t t-foreach="o.invoice_line_ids" t-as="line">
  104. <t t-set="current_subtotal"
  105. t-value="current_subtotal + line.price_subtotal"
  106. groups="account.group_show_line_subtotals_tax_excluded"/>
  107. <t t-set="current_subtotal"
  108. t-value="current_subtotal + line.price_total"
  109. groups="account.group_show_line_subtotals_tax_included"/>
  110. <tr t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''">
  111. <t t-if="not line.display_type"
  112. name="account_invoice_line_accountable">
  113. <td name="account_invoice_line_name">
  114. <span t-field="line.name"/>
  115. </td>
  116. <td class="d-none">
  117. <span t-field="line.origin"/>
  118. </td>
  119. <td class="text-right">
  120. <span t-field="line.product_id.short_name"/>
  121. </td>
  122. <td class="text-right">
  123. <span t-field="line.quantity"/>
  124. <span t-field="line.uom_id"
  125. groups="uom.group_uom"/>
  126. </td>
  127. <td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
  128. <span t-field="line.price_unit"/>
  129. </td>
  130. <td class="text-right o_price_total">
  131. <span t-field="line.price_subtotal"
  132. groups="account.group_show_line_subtotals_tax_excluded"/>
  133. <span t-field="line.price_total"
  134. groups="account.group_show_line_subtotals_tax_included"/>
  135. </td>
  136. </t>
  137. <t t-if="line.display_type == 'line_section'">
  138. <td colspan="99">
  139. <span t-field="line.name"/>
  140. </td>
  141. <t t-set="current_section" t-value="line"/>
  142. <t t-set="current_subtotal" t-value="0"/>
  143. </t>
  144. <t t-if="line.display_type == 'line_note'">
  145. <td colspan="99">
  146. <span t-field="line.name"/>
  147. </td>
  148. </t>
  149. </tr>
  150. <t t-if="current_section and (line_last or o.invoice_line_ids[line_index+1].display_type == 'line_section')">
  151. <tr class="is-subtotal text-right">
  152. <td colspan="99">
  153. <strong class="mr16">Subtotal</strong>
  154. <span
  155. t-esc="current_subtotal"
  156. t-options='{"widget": "monetary", "display_currency": o.currency_id}'
  157. />
  158. </td>
  159. </tr>
  160. </t>
  161. </t>
  162. </tbody>
  163. </table>
  164. <div class="clearfix">
  165. <div id="total" class="row">
  166. <div t-attf-class="#{'col-4' if report_type != 'html' else 'col-sm-7 col-md-5'} ml-auto">
  167. <table class="table table-sm">
  168. <tr class="border-black o_total">
  169. <td>
  170. <strong>Total</strong>
  171. </td>
  172. <td class="text-right">
  173. <span t-field="o.amount_total"/>
  174. </td>
  175. </tr>
  176. </table>
  177. </div>
  178. </div>
  179. </div>
  180. <p t-if="o.reference">
  181. Please use the following communication for your payment :
  182. <b>
  183. <span t-field="o.reference"/>
  184. </b>
  185. </p>
  186. <p t-if="o.comment" name="comment">
  187. <span t-field="o.comment"/>
  188. </p>
  189. <p t-if="o.payment_term_id" name="payment_term">
  190. <span t-field="o.payment_term_id.note"/>
  191. </p>
  192. <p t-if="o.fiscal_position_id.note" name="note">
  193. <span t-field="o.fiscal_position_id.note"/>
  194. </p>
  195. <div id="qrcode"
  196. t-if="(o.partner_id.country_id.code in ['BE', 'AT', 'DE', 'FI', 'NL']) and (o.company_id.qr_code) and (o.currency_id.name == 'EUR') and (o.partner_bank_id.acc_number != False)">
  197. <p t-if="(o.partner_bank_id.qr_code_valid)">
  198. <strong class="text-center">Scan me with your banking
  199. app.
  200. </strong>
  201. <br/>
  202. <br/>
  203. <img class="border border-dark rounded"
  204. t-att-src="o.partner_bank_id.build_qr_code_url(o.residual,(o.reference) if (o.reference) else o.number)"/>
  205. </p>
  206. <p t-if="(o.partner_bank_id.qr_code_valid == False)">
  207. <strong class="text-center">The SEPA QR Code
  208. informations are not set correctly.
  209. </strong>
  210. <br/>
  211. </p>
  212. </div>
  213. </div>
  214. </t>
  215. </template>
  216. <template id="theme_invoice_G002">
  217. <t t-call="web.html_container">
  218. <t t-foreach="docs" t-as="o">
  219. <t t-call="easy_my_coop.theme_invoice_G002_document"
  220. t-lang="o.partner_id.lang"/>
  221. </t>
  222. </t>
  223. </template>
  224. </odoo>