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