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.

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