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_outstanding_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. Outstanding 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. Outstanding Statement at <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 class="text-center" style="border-right: 1px solid black;">Due Date</th>
  34. <th style="border-right: 1px solid black;">Description</th>
  35. <th class="text-right" style="border-right: 1px solid black;">Original Amount</th>
  36. <th class="text-right" style="border-right: 1px solid black;">Open Amount</th>
  37. <th class="text-right" style="border-right: 1px solid black;">Balance</th>
  38. </tr>
  39. </thead>
  40. <tr t-foreach="Lines[o.id][currency]" t-as="line">
  41. <t t-if="not line['blocked']">
  42. <td style="border-right: 1px solid black;">
  43. <span t-esc="line['move_id']"/>
  44. </td>
  45. <td style="border-right: 1px solid black;">
  46. <span t-esc="line['date']"/>
  47. </td>
  48. <td style="border-right: 1px solid black;">
  49. <span t-esc="line['date_maturity']"/>
  50. </td>
  51. <td style="border-right: 1px solid black;">
  52. <t t-if="line['name'] != '/'">
  53. <t t-if="not line['ref']"><span t-esc="line['name']"/></t>
  54. <t t-if="line['ref'] and line['name']">
  55. <t t-if="line['name'] not in line['ref']"><span t-esc="line['name']"/></t>
  56. <t t-if="line['ref'] not in line['name']"><span t-esc="line['ref']"/></t>
  57. </t>
  58. </t>
  59. <t t-if="line['name'] == '/'"><span t-esc="line['ref']"/></t>
  60. </td>
  61. <td class="text-right" style="border-right: 1px solid black;">
  62. <span t-esc="line['amount']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  63. </td>
  64. <td class="text-right" style="border-right: 1px solid black;">
  65. <span t-esc="line['open_amount']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  66. </td>
  67. <td class="text-right" style="border-right: 1px solid black;">
  68. <span t-esc="line['balance']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  69. </td>
  70. </t>
  71. <t t-if="line['blocked']">
  72. <td style="border-right: 1px solid black; background-color: grey;">
  73. <span t-esc="line['move_id']"/>
  74. </td>
  75. <td style="border-right: 1px solid black; background-color: grey;">
  76. <span t-esc="line['date']"/>
  77. </td>
  78. <td style="border-right: 1px solid black; background-color: grey;">
  79. <span t-esc="line['date_maturity']"/>
  80. </td>
  81. <td style="border-right: 1px solid black; background-color: grey;">
  82. <t t-if="line['name'] != '/'">
  83. <t t-if="not line['ref']"><span t-esc="line['name']"/></t>
  84. <t t-if="line['ref'] and line['name']">
  85. <t t-if="line['name'] not in line['ref']"><span t-esc="line['name']"/></t>
  86. <t t-if="line['ref'] not in line['name']"><span t-esc="line['ref']"/></t>
  87. </t>
  88. </t>
  89. <t t-if="line['name'] == '/'"><span t-esc="line['ref']"/></t>
  90. </td>
  91. <td class="text-right" style="border-right: 1px solid black; background-color: grey;">
  92. <span t-esc="line['amount']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  93. </td>
  94. <td class="text-right" style="border-right: 1px solid black; background-color: grey;">
  95. <span t-esc="line['open_amount']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  96. </td>
  97. <td class="text-right" style="border-right: 1px solid black; background-color: grey;">
  98. <span t-esc="line['balance']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
  99. </td>
  100. </t>
  101. </tr>
  102. <tr>
  103. <td style="border-right: 1px solid black;"/>
  104. <td style="border-right: 1px solid black;">
  105. <span t-esc="Date_end[o.id]"/>
  106. </td>
  107. <td style="border-right: 1px solid black;"/>
  108. <td style="border-right: 1px solid black;">
  109. Ending Balance
  110. </td>
  111. <td style="border-right: 1px solid black;"/>
  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_outstanding_statement.statement_document" t-lang="o.lang"/>
  194. </t>
  195. </t>
  196. </t>
  197. </template>
  198. <report id="action_print_customer_outstanding_statement"
  199. model="res.partner"
  200. report_type="qweb-pdf"
  201. menu="False"
  202. string="Statement Action to PDF"
  203. name="customer_outstanding_statement.statement"
  204. file="customer_outstanding_statement.statement"
  205. />
  206. </odoo>