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.

171 lines
9.5 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  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_activity_statement/static/src/less/layout_statement.less" rel="stylesheet"/>
  8. </xpath>
  9. </template>
  10. <template id="customer_activity_statement.statement_document">
  11. <t t-call="web.external_layout">
  12. <div class="page">
  13. <div class="row">
  14. <div class="col-xs-5 col-xs-offset-7">
  15. <span t-field="o.name"/><br/>
  16. <span t-raw="o.contact_address.replace('\n\n', '\n').replace('\n', '&lt;br&gt;')"/>
  17. <span t-field="o.vat"/>
  18. </div>
  19. <h4 style="padding-left:15em;padding-top:2em">
  20. Activity 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'"/> Activity Statement between <span t-esc="Date_start[o.id]" /> and <span t-esc="Date_end[o.id]" /> in <span t-esc="Currencies[o.id][currency].name"/>:
  32. </p>
  33. <table class="table table-condensed table-statement" >
  34. <thead>
  35. <tr>
  36. <th >Reference number</th>
  37. <th >Date</th>
  38. <th >Description</th>
  39. <th class="amount" >Amount</th>
  40. <th class="amount" >Balance</th>
  41. </tr>
  42. </thead>
  43. <tbody>
  44. <tr>
  45. <td />
  46. <td >
  47. <span t-esc="Date_start[o.id]"/>
  48. </td>
  49. <td >
  50. Balance Forward
  51. </td>
  52. <td />
  53. <td class="amount" >
  54. <span t-esc="Balance_forward[o.id].get(currency, 0.0)" t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  55. </td>
  56. </tr>
  57. <tr t-foreach="Lines[o.id][currency]" t-as="line" t-att-class="'statement-blocked' if line['blocked'] else ''">
  58. <td >
  59. <span t-esc="line['move_id']"/>
  60. </td>
  61. <td >
  62. <span t-esc="line['date']"/>
  63. </td>
  64. <td >
  65. <t t-if="line['name'] != '/'">
  66. <t t-if="not line['ref']"><span t-esc="line['name']"/></t>
  67. <t t-if="line['ref'] and line['name']">
  68. <t t-if="line['name'] not in line['ref']"><span t-esc="line['name']"/></t>
  69. <t t-if="line['ref'] not in line['name']"><span t-esc="line['ref']"/></t>
  70. </t>
  71. </t>
  72. <t t-if="line['name'] == '/'"><span t-esc="line['ref']"/></t>
  73. </td>
  74. <td class="amount" >
  75. <span t-esc="line['amount']" t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  76. </td>
  77. <td class="amount" >
  78. <span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  79. </td>
  80. </tr>
  81. <tr>
  82. <td />
  83. <td >
  84. <span t-esc="Date_end[o.id]"/>
  85. </td>
  86. <td >
  87. Ending Balance
  88. </td>
  89. <td />
  90. <td class="amount" >
  91. <span t-esc="Amount_Due[o.id][currency]" t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  92. </td>
  93. </tr>
  94. </tbody>
  95. </table>
  96. <p>
  97. Aging Report at <span t-esc="Date_end[o.id]" /> in <span t-esc="Currencies[o.id][currency].name"/>:
  98. </p>
  99. <table class="table table-condensed table-statement" t-if="Show_Buckets" >
  100. <thead>
  101. <tr>
  102. <th class="amount" >Current Due</th>
  103. <th class="amount" >1-30 Days Due</th>
  104. <th class="amount" >30-60 Days Due</th>
  105. <th class="amount" >60-90 Days Due</th>
  106. <th class="amount" >90-120 Days Due</th>
  107. <th class="amount" >+120 Days Due</th>
  108. <th class="amount" >Balance Due</th>
  109. </tr>
  110. </thead>
  111. <t t-set="buckets" t-value="Buckets[o.id].get(currency, {})" />
  112. <tbody >
  113. <tr >
  114. <td class="amount" >
  115. <span t-esc="buckets.get('current', 0.0)" t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  116. </td>
  117. <td class="amount" >
  118. <span t-esc="buckets.get('b_1_30', 0.0)" t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  119. </td>
  120. <td class="amount" >
  121. <span t-esc="buckets.get('b_30_60', 0.0)" t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  122. </td>
  123. <td class="amount" >
  124. <span t-esc="buckets.get('b_60_90', 0.0)" t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  125. </td>
  126. <td class="amount" >
  127. <span t-esc="buckets.get('b_90_120', 0.0)" t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  128. </td>
  129. <td class="amount" >
  130. <span t-esc="buckets.get('b_over_120', 0.0)" t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  131. </td>
  132. <td class="amount" >
  133. <span t-esc="buckets.get('balance', 0.0)" t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  134. </td>
  135. </tr>
  136. </tbody>
  137. </table>
  138. </t>
  139. </t>
  140. <p t-if="not Lines[o.id]">
  141. <strong>The partner doesn't have due entries.</strong>
  142. </p>
  143. </div>
  144. </div>
  145. </t>
  146. </template>
  147. <template id="statement">
  148. <t t-call="web.html_container">
  149. <t t-foreach="docs" t-as="o">
  150. <t t-if="not (Filter_non_due_partners and (not Lines[o.id]) and (len(doc_ids) > 1))">
  151. <t t-call="customer_activity_statement.statement_document" t-lang="o.lang"/>
  152. </t>
  153. </t>
  154. </t>
  155. </template>
  156. <report id="action_print_customer_activity_statement"
  157. model="res.partner"
  158. report_type="qweb-pdf"
  159. menu="False"
  160. string="Activity Statement"
  161. name="customer_activity_statement.statement"
  162. file="customer_activity_statement.statement"
  163. />
  164. </odoo>