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.

169 lines
8.3 KiB

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!-- Copyright 2018 ForgeFlow, S.L. (https://www.forgeflow.com)
  3. License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
  4. <odoo>
  5. <template id="partner_statement.outstanding_statement_document">
  6. <t t-call="web.external_layout">
  7. <t t-set="o" t-value="o.with_context({'lang': lang})" />
  8. <t t-set="address">
  9. <address
  10. t-esc="get_inv_addr(o)"
  11. t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'
  12. />
  13. <div t-if="o.vat" class="mt16"><t
  14. t-esc="company.country_id.vat_label or 'Tax ID'"
  15. />: <span t-field="o.vat" /></div>
  16. </t>
  17. <div class="page">
  18. <div class="oe_structure" />
  19. <h2>Statement of Account</h2>
  20. <div id="informations" class="row mt32 mb32">
  21. <div class="col-3 bm-2">
  22. <strong>Date:</strong>
  23. <p t-esc="d['today']" class="m-0" />
  24. </div>
  25. <div class="col-3 bm-2">
  26. <strong>Partner Name:</strong>
  27. <p t-field="o.name" class="m-0" />
  28. </div>
  29. <div t-if="o.ref" class="col-3 bm-2">
  30. <strong>Partner Code:</strong>
  31. <p t-field="o.ref" class="m-0" />
  32. </div>
  33. </div>
  34. <t t-if="d['currencies']">
  35. <br />
  36. <t t-foreach="d['currencies'].items()" t-as="currency">
  37. <t t-set="display_currency" t-value="Currencies[currency[0]]" />
  38. <t t-set="currency" t-value="currency[1]" />
  39. <p>
  40. <span
  41. t-esc="'' if account_type == 'receivable' else 'Supplier '"
  42. />Statement up to <span t-esc="d['end']" /> in <span
  43. t-esc="display_currency.name"
  44. />
  45. </p>
  46. <table class="table table-sm table-statement">
  47. <thead>
  48. <tr>
  49. <th>Reference number</th>
  50. <th>Date</th>
  51. <th>Due Date</th>
  52. <th>Description</th>
  53. <th class="amount">Original</th>
  54. <th class="amount">Open Amount</th>
  55. <th class="amount">Balance</th>
  56. </tr>
  57. </thead>
  58. <tbody>
  59. <tr
  60. t-foreach="currency['lines']"
  61. t-as="line"
  62. t-att-class="'statement-blocked' if line['blocked'] else ''"
  63. >
  64. <td>
  65. <span t-esc="line['move_id']" />
  66. </td>
  67. <td>
  68. <span t-esc="line['date']" />
  69. </td>
  70. <td>
  71. <span t-esc="line['date_maturity']" />
  72. </td>
  73. <td>
  74. <t t-if="line['name'] != '/'">
  75. <t t-if="not line['ref']">
  76. <span t-esc="line['name']" />
  77. </t>
  78. <t t-if="line['ref'] and not line['name']">
  79. <span t-esc="line['ref']" />
  80. </t>
  81. <t t-if="line['ref'] and line['name']">
  82. <t
  83. t-if="line['name'] not in line['ref'] or line['name'] == line['ref']"
  84. >
  85. <span t-esc="line['name']" />
  86. </t>
  87. <t
  88. t-if="line['ref'] not in line['name']"
  89. >
  90. <span t-esc="line['ref']" />
  91. </t>
  92. </t>
  93. </t>
  94. <t t-if="line['name'] == '/'">
  95. <span t-esc="line['ref']" />
  96. </t>
  97. </td>
  98. <td class="amount">
  99. <span
  100. t-esc="line['amount']"
  101. t-options="{'widget': 'monetary', 'display_currency': display_currency}"
  102. />
  103. </td>
  104. <td class="amount">
  105. <span
  106. t-esc="line['open_amount']"
  107. t-options="{'widget': 'monetary', 'display_currency': display_currency}"
  108. />
  109. </td>
  110. <td class="amount">
  111. <span
  112. t-esc="line['balance']"
  113. t-options="{'widget': 'monetary', 'display_currency': display_currency}"
  114. />
  115. </td>
  116. </tr>
  117. <tr>
  118. <td />
  119. <td>
  120. <span t-esc="d['end']" />
  121. </td>
  122. <td>
  123. Ending Balance
  124. </td>
  125. <td />
  126. <td />
  127. <td />
  128. <td class="amount">
  129. <span
  130. t-esc="currency['amount_due']"
  131. t-options="{'widget': 'monetary', 'display_currency': display_currency}"
  132. />
  133. </td>
  134. </tr>
  135. </tbody>
  136. </table>
  137. <t
  138. t-call="partner_statement.aging_buckets"
  139. t-if="currency['buckets']"
  140. />
  141. </t>
  142. </t>
  143. <p t-if="d.get('no_entries')">
  144. <strong>The partner doesn't have due entries.</strong>
  145. </p>
  146. </div>
  147. </t>
  148. </template>
  149. <template id="outstanding_statement">
  150. <t t-call="web.html_container">
  151. <t t-foreach="docs" t-as="o">
  152. <t t-set="d" t-value="data.get(o.id)" />
  153. <t
  154. t-call="partner_statement.outstanding_statement_document"
  155. t-lang="o.lang"
  156. />
  157. </t>
  158. </t>
  159. </template>
  160. <report
  161. id="action_print_outstanding_statement"
  162. model="res.partner"
  163. report_type="qweb-pdf"
  164. menu="False"
  165. string="Outstanding Statement"
  166. name="partner_statement.outstanding_statement"
  167. file="partner_statement.outstanding_statement"
  168. />
  169. </odoo>