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.

188 lines
10 KiB

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