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.

212 lines
15 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="customer_activity_statement.statement_document">
  6. <t t-call="web.external_layout">
  7. <div class="page">
  8. <div class="row">
  9. <div class="col-xs-5 col-xs-offset-7">
  10. <span t-field="o.name"/><br/>
  11. <span t-raw="o.contact_address.replace('\n\n', '\n').replace('\n', '&lt;br&gt;')"/>
  12. <span t-field="o.vat"/>
  13. </div>
  14. <h4 style="padding-left:15em;padding-top:2em">
  15. Activity Statement
  16. </h4>
  17. <p>
  18. Date: <span t-esc="Date[o.id]" /><br/><!--Today-->
  19. <t t-if="o.ref">Partner ref: <span t-field="o.ref"/></t>
  20. </p>
  21. <t t-if="Lines[o.id]">
  22. <br/>
  23. <t t-foreach="Lines[o.id]" t-as="currency">
  24. <br t-if="not currency_first" />
  25. <p t-if="account_type == 'receivable'">
  26. Customer 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"/>:
  27. </p>
  28. <p t-if="account_type == 'payable'">
  29. 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"/>:
  30. </p>
  31. <table class="table table-condensed" style="border: 1px solid black; border-collapse: collapse;">
  32. <thead>
  33. <tr>
  34. <th style="border-right: 1px solid black;">Reference number</th>
  35. <th class="text-center" style="border-right: 1px solid black;">Date</th>
  36. <th style="border-right: 1px solid black;">Description</th>
  37. <th class="text-right" style="border-right: 1px solid black;">Amount</th>
  38. <th class="text-right" style="border-right: 1px solid black;">Balance</th>
  39. </tr>
  40. </thead>
  41. <tr>
  42. <td style="border-right: 1px solid black;"/>
  43. <td style="border-right: 1px solid black;">
  44. <span t-esc="Date_start[o.id]"/>
  45. </td>
  46. <td style="border-right: 1px solid black;">
  47. Balance Forward
  48. </td>
  49. <td style="border-right: 1px solid black;"/>
  50. <td class="text-right" t-if="currency in Balance_forward[o.id]" style="border-right: 1px solid black;">
  51. <span t-esc="Balance_forward[o.id][currency]" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  52. </td>
  53. <td class="text-right" t-if="currency not in Balance_forward[o.id]" style="border-right: 1px solid black;">
  54. <span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  55. </td>
  56. </tr>
  57. <tr t-foreach="Lines[o.id][currency]" t-as="line">
  58. <t t-if="not line['blocked']">
  59. <td style="border-right: 1px solid black;">
  60. <span t-esc="line['move_id']"/>
  61. </td>
  62. <td style="border-right: 1px solid black;">
  63. <span t-esc="line['date']"/>
  64. </td>
  65. <td style="border-right: 1px solid black;">
  66. <t t-if="line['name'] != '/'">
  67. <t t-if="not line['ref']"><span t-esc="line['name']"/></t>
  68. <t t-if="line['ref'] and line['name']">
  69. <t t-if="line['name'] not in line['ref']"><span t-esc="line['name']"/></t>
  70. <t t-if="line['ref'] not in line['name']"><span t-esc="line['ref']"/></t>
  71. </t>
  72. </t>
  73. <t t-if="line['name'] == '/'"><span t-esc="line['ref']"/></t>
  74. </td>
  75. <td class="text-right" style="border-right: 1px solid black;">
  76. <span t-esc="line['amount']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  77. </td>
  78. <td class="text-right" style="border-right: 1px solid black;">
  79. <span t-esc="line['balance']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  80. </td>
  81. </t>
  82. <t t-if="line['blocked']">
  83. <td style="border-right: 1px solid black; background-color: grey;">
  84. <span t-esc="line['move_id']"/>
  85. </td>
  86. <td style="border-right: 1px solid black; background-color: grey;">
  87. <span t-esc="line['date']"/>
  88. </td>
  89. <td style="border-right: 1px solid black; background-color: grey;">
  90. <t t-if="line['name'] != '/'">
  91. <t t-if="not line['ref']"><span t-esc="line['name']"/></t>
  92. <t t-if="line['ref'] and line['name']">
  93. <t t-if="line['name'] not in line['ref']"><span t-esc="line['name']"/></t>
  94. <t t-if="line['ref'] not in line['name']"><span t-esc="line['ref']"/></t>
  95. </t>
  96. </t>
  97. <t t-if="line['name'] == '/'"><span t-esc="line['ref']"/></t>
  98. </td>
  99. <td class="text-right" style="border-right: 1px solid black; background-color: grey;">
  100. <span t-esc="line['amount']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  101. </td>
  102. <td class="text-right" style="border-right: 1px solid black; background-color: grey;">
  103. <span t-esc="line['balance']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  104. </td>
  105. </t>
  106. </tr>
  107. <tr>
  108. <td style="border-right: 1px solid black;"/>
  109. <td style="border-right: 1px solid black;">
  110. <span t-esc="Date_end[o.id]"/>
  111. </td>
  112. <td style="border-right: 1px solid black;">
  113. Ending Balance
  114. </td>
  115. <td style="border-right: 1px solid black;"/>
  116. <td class="text-right" style="border-right: 1px solid black;">
  117. <span t-esc="Amount_Due[o.id][currency]" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  118. </td>
  119. </tr>
  120. </table>
  121. <p>
  122. Aging Report at <span t-esc="Date_end[o.id]" /> in <span t-esc="Currencies[o.id][currency].name"/>:
  123. </p>
  124. <table class="table table-condensed" t-if="Show_Buckets" style="border: 1px solid black; border-collapse: collapse;">
  125. <thead>
  126. <tr>
  127. <th class="text-center" style="border-right: 1px solid black;">Current Due</th>
  128. <th class="text-center" style="border-right: 1px solid black;">1-30 Days Due</th>
  129. <th class="text-center" style="border-right: 1px solid black;">30-60 Days Due</th>
  130. <th class="text-center" style="border-right: 1px solid black;">60-90 Days Due</th>
  131. <th class="text-center" style="border-right: 1px solid black;">90-120 Days Due</th>
  132. <th class="text-center" style="border-right: 1px solid black;">+120 Days Due</th>
  133. <th class="text-right" style="border-right: 1px solid black;">Balance Due</th>
  134. </tr>
  135. </thead>
  136. <tr t-if="currency in Buckets[o.id]">
  137. <td class="text-right" style="border-right: 1px solid black;">
  138. <span t-esc="Buckets[o.id][currency]['current']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  139. </td>
  140. <td class="text-right" style="border-right: 1px solid black;">
  141. <span t-esc="Buckets[o.id][currency]['b_1_30']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  142. </td>
  143. <td class="text-right" style="border-right: 1px solid black;">
  144. <span t-esc="Buckets[o.id][currency]['b_30_60']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  145. </td>
  146. <td class="text-right" style="border-right: 1px solid black;">
  147. <span t-esc="Buckets[o.id][currency]['b_60_90']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  148. </td>
  149. <td class="text-right" style="border-right: 1px solid black;">
  150. <span t-esc="Buckets[o.id][currency]['b_90_120']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  151. </td>
  152. <td class="text-right" style="border-right: 1px solid black;">
  153. <span t-esc="Buckets[o.id][currency]['b_over_120']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  154. </td>
  155. <td class="text-right" style="border-right: 1px solid black;">
  156. <span t-esc="Buckets[o.id][currency]['balance']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  157. </td>
  158. </tr>
  159. <tr t-if="currency not in Buckets[o.id]">
  160. <td class="text-right" style="border-right: 1px solid black;">
  161. <span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  162. </td>
  163. <td class="text-right" style="border-right: 1px solid black;">
  164. <span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  165. </td>
  166. <td class="text-right" style="border-right: 1px solid black;">
  167. <span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  168. </td>
  169. <td class="text-right" style="border-right: 1px solid black;">
  170. <span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  171. </td>
  172. <td class="text-right" style="border-right: 1px solid black;">
  173. <span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  174. </td>
  175. <td class="text-right" style="border-right: 1px solid black;">
  176. <span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  177. </td>
  178. <td class="text-right" style="border-right: 1px solid black;">
  179. <span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  180. </td>
  181. </tr>
  182. </table>
  183. </t>
  184. </t>
  185. <p t-if="not Lines[o.id]">
  186. <strong>The partner doesn't have due entries.</strong>
  187. </p>
  188. </div>
  189. </div>
  190. </t>
  191. </template>
  192. <template id="statement">
  193. <t t-call="web.html_container">
  194. <t t-foreach="docs" t-as="o">
  195. <t t-if="not (Filter_non_due_partners and (not Lines[o.id]) and (len(doc_ids) > 1))">
  196. <t t-call="customer_activity_statement.statement_document" t-lang="o.lang"/>
  197. </t>
  198. </t>
  199. </t>
  200. </template>
  201. <report id="action_print_customer_activity_statement"
  202. model="res.partner"
  203. report_type="qweb-pdf"
  204. menu="False"
  205. string="Statement Action to PDF"
  206. name="customer_activity_statement.statement"
  207. file="customer_activity_statement.statement"
  208. />
  209. </odoo>