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.

190 lines
10 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- Copyright 2018 Eficent Business and IT Consulting Services S.L.
  3. License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
  4. <odoo>
  5. <template id="report_assets_common" name="oca_statements report assets" inherit_id="web.report_assets_common">
  6. <xpath expr="." position="inside">
  7. <link href="/customer_outstanding_statement/static/src/less/layout_statement.less" rel="stylesheet"/>
  8. </xpath>
  9. </template>
  10. <template id="customer_outstanding_statement.statement_document">
  11. <t t-call="web.external_layout">
  12. <div class="page">
  13. <div class="row">
  14. <div name="statement_address" class="col-xs-5 col-xs-offset-7">
  15. <address t-esc="o"
  16. t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
  17. <div t-if="o.vat" class="mt16"><t t-esc="o.country_id.vat_label or 'TIN'"/>:
  18. <span t-field="o.vat"/>
  19. </div>
  20. </div>
  21. <h4 style="padding-left:15em;padding-top:2em">
  22. Outstanding Statement
  23. </h4>
  24. <p>
  25. Date: <span t-esc="Date[o.id]"/><br/><!--Today-->
  26. <t t-if="o.ref">Partner ref:<span t-field="o.ref"/></t>
  27. </p>
  28. <t t-if="Lines[o.id]">
  29. <br/>
  30. <t t-foreach="Lines[o.id]" t-as="currency">
  31. <br t-if="not currency_first"/>
  32. <p>
  33. <span t-esc="'Customer' if account_type == 'receivable' else 'Supplier'"/>
  34. Outstanding Statement at
  35. <span t-esc="Date_end[o.id]"/>
  36. in <span t-esc="Currencies[o.id][currency].name"/>:
  37. </p>
  38. <table class="table table-condensed table-statement">
  39. <thead>
  40. <tr>
  41. <th>Reference number</th>
  42. <th>Date</th>
  43. <th>Due Date</th>
  44. <th>Description</th>
  45. <th class="amount">Original Amount</th>
  46. <th class="amount">Open Amount</th>
  47. <th class="amount">Balance</th>
  48. </tr>
  49. </thead>
  50. <tr t-foreach="Lines[o.id][currency]" t-as="line"
  51. t-att-class="'statement-blocked' if line['blocked'] else ''">
  52. <td>
  53. <span t-esc="line['move_id']"/>
  54. </td>
  55. <td>
  56. <span t-esc="line['date']"/>
  57. </td>
  58. <td>
  59. <span t-esc="line['date_maturity']"/>
  60. </td>
  61. <td>
  62. <t t-if="line['name'] != '/'">
  63. <t t-if="not line['ref']">
  64. <span t-esc="line['name']"/>
  65. </t>
  66. <t t-if="line['ref'] and line['name']">
  67. <t t-if="line['name'] not in line['ref']">
  68. <span t-esc="line['name']"/>
  69. </t>
  70. <t t-if="line['ref'] not in line['name']">
  71. <span t-esc="line['ref']"/>
  72. </t>
  73. </t>
  74. </t>
  75. <t t-if="line['name'] == '/'">
  76. <span t-esc="line['ref']"/>
  77. </t>
  78. </td>
  79. <td class="amount">
  80. <span t-esc="line['amount']"
  81. t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  82. </td>
  83. <td class="amount">
  84. <span t-esc="line['open_amount']"
  85. t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  86. </td>
  87. <td class="amount">
  88. <span t-esc="line['balance']"
  89. t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  90. </td>
  91. </tr>
  92. <tr>
  93. <td/>
  94. <td>
  95. <span t-esc="Date_end[o.id]"/>
  96. </td>
  97. <td/>
  98. <td>
  99. Ending Balance
  100. </td>
  101. <td/>
  102. <td/>
  103. <td class="amount">
  104. <span t-esc="Amount_Due[o.id][currency]"
  105. t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  106. </td>
  107. </tr>
  108. </table>
  109. <p>
  110. Aging Report at <span t-esc="Date_end[o.id]"/> in <span t-esc="Currencies[o.id][currency].name"/>:
  111. </p>
  112. <table class="table table-condensed table-statement" t-if="Show_Buckets">
  113. <thead>
  114. <tr>
  115. <th class="amount">Current Due</th>
  116. <th class="amount">1-30 Days</th>
  117. <th class="amount">30-60 Days</th>
  118. <th class="amount">60-90 Days</th>
  119. <th class="amount">90-120 Days</th>
  120. <th class="amount">+120 Days</th>
  121. <th class="amount">Balance Due</th>
  122. </tr>
  123. </thead>
  124. <t t-set="buckets" t-value="Buckets[o.id].get(currency, {})"/>
  125. <tbody>
  126. <tr>
  127. <td class="amount">
  128. <span t-esc="buckets.get('current', 0.0)"
  129. t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  130. </td>
  131. <td class="amount">
  132. <span t-esc="buckets.get('b_1_30', 0.0)"
  133. t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  134. </td>
  135. <td class="amount">
  136. <span t-esc="buckets.get('b_30_60', 0.0)"
  137. t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  138. </td>
  139. <td class="amount">
  140. <span t-esc="buckets.get('b_60_90', 0.0)"
  141. t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  142. </td>
  143. <td class="amount">
  144. <span t-esc="buckets.get('b_90_120', 0.0)"
  145. t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  146. </td>
  147. <td class="amount">
  148. <span t-esc="buckets.get('b_over_120', 0.0)"
  149. t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  150. </td>
  151. <td class="amount">
  152. <span t-esc="buckets.get('balance', 0.0)"
  153. t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  154. </td>
  155. </tr>
  156. </tbody>
  157. </table>
  158. </t>
  159. </t>
  160. <p t-if="not Lines[o.id]">
  161. <strong>The partner doesn't have due entries.</strong>
  162. </p>
  163. </div>
  164. </div>
  165. </t>
  166. </template>
  167. <template id="statement">
  168. <t t-call="web.html_container">
  169. <t t-foreach="docs" t-as="o">
  170. <t t-if="not (Filter_non_due_partners and (not Lines[o.id]) and (len(doc_ids) > 1))">
  171. <t t-call="customer_outstanding_statement.statement_document" t-lang="o.lang"/>
  172. </t>
  173. </t>
  174. </t>
  175. </template>
  176. <report id="action_print_customer_outstanding_statement"
  177. model="res.partner"
  178. report_type="qweb-pdf"
  179. menu="False"
  180. string="Outstanding Statement"
  181. name="customer_outstanding_statement.statement"
  182. file="customer_outstanding_statement.statement"
  183. />
  184. </odoo>