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.

202 lines
15 KiB

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