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.

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