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.

209 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>
  26. 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. <table class="table table-condensed" style="border: 1px solid black; border-collapse: collapse;">
  29. <thead>
  30. <tr>
  31. <th style="border-right: 1px solid black;">Reference number</th>
  32. <th class="text-center" style="border-right: 1px solid black;">Date</th>
  33. <th style="border-right: 1px solid black;">Description</th>
  34. <th class="text-right" style="border-right: 1px solid black;">Amount</th>
  35. <th class="text-right" style="border-right: 1px solid black;">Balance</th>
  36. </tr>
  37. </thead>
  38. <tr>
  39. <td style="border-right: 1px solid black;"/>
  40. <td style="border-right: 1px solid black;">
  41. <span t-esc="Date_start[o.id]"/>
  42. </td>
  43. <td style="border-right: 1px solid black;">
  44. Balance Forward
  45. </td>
  46. <td style="border-right: 1px solid black;"/>
  47. <td class="text-right" t-if="currency in Balance_forward[o.id]" style="border-right: 1px solid black;">
  48. <span t-esc="Balance_forward[o.id][currency]" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  49. </td>
  50. <td class="text-right" t-if="currency not in Balance_forward[o.id]" style="border-right: 1px solid black;">
  51. <span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  52. </td>
  53. </tr>
  54. <tr t-foreach="Lines[o.id][currency]" t-as="line">
  55. <t t-if="not line['blocked']">
  56. <td style="border-right: 1px solid black;">
  57. <span t-esc="line['move_id']"/>
  58. </td>
  59. <td style="border-right: 1px solid black;">
  60. <span t-esc="line['date']"/>
  61. </td>
  62. <td style="border-right: 1px solid black;">
  63. <t t-if="line['name'] != '/'">
  64. <t t-if="not line['ref']"><span t-esc="line['name']"/></t>
  65. <t t-if="line['ref'] and line['name']">
  66. <t t-if="line['name'] not in line['ref']"><span t-esc="line['name']"/></t>
  67. <t t-if="line['ref'] not in line['name']"><span t-esc="line['ref']"/></t>
  68. </t>
  69. </t>
  70. <t t-if="line['name'] == '/'"><span t-esc="line['ref']"/></t>
  71. </td>
  72. <td class="text-right" style="border-right: 1px solid black;">
  73. <span t-esc="line['amount']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  74. </td>
  75. <td class="text-right" style="border-right: 1px solid black;">
  76. <span t-esc="line['balance']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  77. </td>
  78. </t>
  79. <t t-if="line['blocked']">
  80. <td style="border-right: 1px solid black; background-color: grey;">
  81. <span t-esc="line['move_id']"/>
  82. </td>
  83. <td style="border-right: 1px solid black; background-color: grey;">
  84. <span t-esc="line['date']"/>
  85. </td>
  86. <td style="border-right: 1px solid black; background-color: grey;">
  87. <t t-if="line['name'] != '/'">
  88. <t t-if="not line['ref']"><span t-esc="line['name']"/></t>
  89. <t t-if="line['ref'] and line['name']">
  90. <t t-if="line['name'] not in line['ref']"><span t-esc="line['name']"/></t>
  91. <t t-if="line['ref'] not in line['name']"><span t-esc="line['ref']"/></t>
  92. </t>
  93. </t>
  94. <t t-if="line['name'] == '/'"><span t-esc="line['ref']"/></t>
  95. </td>
  96. <td class="text-right" style="border-right: 1px solid black; background-color: grey;">
  97. <span t-esc="line['amount']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  98. </td>
  99. <td class="text-right" style="border-right: 1px solid black; background-color: grey;">
  100. <span t-esc="line['balance']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  101. </td>
  102. </t>
  103. </tr>
  104. <tr>
  105. <td style="border-right: 1px solid black;"/>
  106. <td style="border-right: 1px solid black;">
  107. <span t-esc="Date_end[o.id]"/>
  108. </td>
  109. <td style="border-right: 1px solid black;">
  110. Ending Balance
  111. </td>
  112. <td style="border-right: 1px solid black;"/>
  113. <td class="text-right" style="border-right: 1px solid black;">
  114. <span t-esc="Amount_Due[o.id][currency]" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  115. </td>
  116. </tr>
  117. </table>
  118. <p>
  119. Aging Report at <span t-esc="Date_end[o.id]" /> in <span t-esc="Currencies[o.id][currency].name"/>:
  120. </p>
  121. <table class="table table-condensed" t-if="Show_Buckets" style="border: 1px solid black; border-collapse: collapse;">
  122. <thead>
  123. <tr>
  124. <th class="text-center" style="border-right: 1px solid black;">Current Due</th>
  125. <th class="text-center" style="border-right: 1px solid black;">1-30 Days Due</th>
  126. <th class="text-center" style="border-right: 1px solid black;">30-60 Days Due</th>
  127. <th class="text-center" style="border-right: 1px solid black;">60-90 Days Due</th>
  128. <th class="text-center" style="border-right: 1px solid black;">90-120 Days Due</th>
  129. <th class="text-center" style="border-right: 1px solid black;">+120 Days Due</th>
  130. <th class="text-right" style="border-right: 1px solid black;">Balance Due</th>
  131. </tr>
  132. </thead>
  133. <tr t-if="currency in Buckets[o.id]">
  134. <td class="text-right" style="border-right: 1px solid black;">
  135. <span t-esc="Buckets[o.id][currency]['current']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  136. </td>
  137. <td class="text-right" style="border-right: 1px solid black;">
  138. <span t-esc="Buckets[o.id][currency]['b_1_30']" 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_30_60']" 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_60_90']" 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_90_120']" 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_over_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]['balance']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  154. </td>
  155. </tr>
  156. <tr t-if="currency not in Buckets[o.id]">
  157. <td class="text-right" style="border-right: 1px solid black;">
  158. <span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  159. </td>
  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. </tr>
  179. </table>
  180. </t>
  181. </t>
  182. <p t-if="not Lines[o.id]">
  183. <strong>The partner doesn't have due entries.</strong>
  184. </p>
  185. </div>
  186. </div>
  187. </t>
  188. </template>
  189. <template id="statement">
  190. <t t-call="web.html_container">
  191. <t t-foreach="docs" t-as="o">
  192. <t t-if="not (Filter_non_due_partners and (not Lines[o.id]) and (len(doc_ids) > 1))">
  193. <t t-call="customer_activity_statement.statement_document" t-lang="o.lang"/>
  194. </t>
  195. </t>
  196. </t>
  197. </template>
  198. <report id="action_print_customer_activity_statement"
  199. model="res.partner"
  200. report_type="qweb-pdf"
  201. menu="False"
  202. string="Statement Action to PDF"
  203. name="customer_activity_statement.statement"
  204. file="customer_activity_statement.statement"
  205. />
  206. </odoo>