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.

290 lines
16 KiB

  1. ## -*- coding: utf-8 -*-
  2. <!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <style type="text/css">
  6. .overflow_ellipsis {
  7. text-overflow: ellipsis;
  8. overflow: hidden;
  9. white-space: nowrap;
  10. }
  11. ${css}
  12. </style>
  13. </head>
  14. <body>
  15. <%!
  16. def amount(text):
  17. return text.replace('-', '&#8209;') # replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers)
  18. %>
  19. <%setLang(user.lang)%>
  20. <%
  21. initial_balance_text = {'initial_balance': _('Computed'), 'opening_balance': _('Opening Entries'), False: _('No')}
  22. %>
  23. <div class="act_as_table data_table">
  24. <div class="act_as_row labels">
  25. <div class="act_as_cell">${_('Chart of Account')}</div>
  26. <div class="act_as_cell">${_('Fiscal Year')}</div>
  27. <div class="act_as_cell">
  28. %if filter_form(data) == 'filter_date':
  29. ${_('Dates Filter')}
  30. %else:
  31. ${_('Periods Filter')}
  32. %endif
  33. </div>
  34. <div class="act_as_cell">${_('Accounts Filter')}</div>
  35. <div class="act_as_cell">${_('Target Moves')}</div>
  36. <div class="act_as_cell">${_('Initial Balance')}</div>
  37. </div>
  38. <div class="act_as_row">
  39. <div class="act_as_cell">${ chart_account.name }</div>
  40. <div class="act_as_cell">${ fiscalyear.name if fiscalyear else '-' }</div>
  41. <div class="act_as_cell">
  42. ${_('From:')}
  43. %if filter_form(data) == 'filter_date':
  44. ${formatLang(start_date, date=True) if start_date else u'' }
  45. %else:
  46. ${start_period.name if start_period else u''}
  47. %endif
  48. ${_('To:')}
  49. %if filter_form(data) == 'filter_date':
  50. ${ formatLang(stop_date, date=True) if stop_date else u'' }
  51. %else:
  52. ${stop_period.name if stop_period else u'' }
  53. %endif
  54. </div>
  55. <div class="act_as_cell">
  56. %if partner_ids:
  57. ${_('Custom Filter')}
  58. %else:
  59. ${ display_partner_account(data) }
  60. %endif
  61. </div>
  62. <div class="act_as_cell">${ display_target_move(data) }</div>
  63. <div class="act_as_cell">${ initial_balance_text[initial_balance_mode] }</div>
  64. </div>
  65. </div>
  66. %for account in objects:
  67. %if ledger_lines[account.id] or init_balance[account.id]:
  68. <%
  69. if not partners_order[account.id]:
  70. continue
  71. account_total_debit = 0.0
  72. account_total_credit = 0.0
  73. account_balance_cumul = 0.0
  74. account_balance_cumul_curr = 0.0
  75. %>
  76. <div class="account_title bg" style="width: 1080px; margin-top: 20px; font-size: 12px;">${account.code} - ${account.name}</div>
  77. %for partner_name, p_id, p_ref, p_name in partners_order[account.id]:
  78. <%
  79. total_debit = 0.0
  80. total_credit = 0.0
  81. cumul_balance = 0.0
  82. cumul_balance_curr = 0.0
  83. part_cumul_balance = 0.0
  84. part_cumul_balance_curr = 0.0
  85. %>
  86. <div class="act_as_table list_table" style="margin-top: 5px;">
  87. <div class="act_as_caption account_title">
  88. ${partner_name or _('No Partner')}
  89. </div>
  90. <div class="act_as_thead">
  91. <div class="act_as_row labels">
  92. ## date
  93. <div class="act_as_cell first_column" style="width: 50px;">${_('Date')}</div>
  94. ## period
  95. <div class="act_as_cell" style="width: 70px;">${_('Period')}</div>
  96. ## move
  97. <div class="act_as_cell" style="width: 100px;">${_('Entry')}</div>
  98. ## journal
  99. <div class="act_as_cell" style="width: 70px;">${_('Journal')}</div>
  100. ## partner
  101. <div class="act_as_cell" style="width: 100px;">${_('Partner')}</div>
  102. ## move reference
  103. <div class="act_as_cell" style="width: 60px;">${_('Reference')}</div>
  104. ## label
  105. <div class="act_as_cell" style="width: 280px;">${_('Label')}</div>
  106. ## reconcile
  107. <div class="act_as_cell" style="width: 80px;">${_('Rec.')}</div>
  108. ## debit
  109. <div class="act_as_cell amount" style="width: 80px;">${_('Debit')}</div>
  110. ## credit
  111. <div class="act_as_cell amount" style="width: 80px;">${_('Credit')}</div>
  112. ## balance cumulated
  113. <div class="act_as_cell amount" style="width: 80px;">${_('Cumul. Bal.')}</div>
  114. %if amount_currency(data):
  115. ## currency balance
  116. <div class="act_as_cell amount sep_left" style="width: 80px;">${_('Curr. Balance')}</div>
  117. ## curency code
  118. <div class="act_as_cell amount" style="width: 30px; text-align: right;">${_('Curr.')}</div>
  119. %endif
  120. </div>
  121. </div>
  122. <div class="act_as_tbody">
  123. <%
  124. total_debit = init_balance[account.id].get(p_id, {}).get('debit') or 0.0
  125. total_credit =init_balance[account.id].get(p_id, {}).get('credit') or 0.0
  126. %>
  127. %if initial_balance_mode and (total_debit or total_credit):
  128. <%
  129. part_cumul_balance = init_balance[account.id].get(p_id, {}).get('init_balance') or 0.0
  130. part_cumul_balance_curr = init_balance[account.id].get(p_id, {}).get('init_balance_currency') or 0.0
  131. balance_forward_currency = init_balance[account.id].get(p_id, {}).get('currency_name') or ''
  132. cumul_balance += part_cumul_balance
  133. cumul_balance_curr += part_cumul_balance_curr
  134. %>
  135. <div class="act_as_row initial_balance">
  136. ## date
  137. <div class="act_as_cell first_column"></div>
  138. ## period
  139. <div class="act_as_cell"></div>
  140. ## move
  141. <div class="act_as_cell"></div>
  142. ## journal
  143. <div class="act_as_cell"></div>
  144. ## partner
  145. <div class="act_as_cell"></div>
  146. ## move reference
  147. <div class="act_as_cell"></div>
  148. ## label
  149. <div class="act_as_cell" >${_('Initial Balance')}</div>
  150. ## reconcile
  151. <div class="act_as_cell"></div>
  152. ## debit
  153. <div class="act_as_cell amount">${formatLang(total_debit) | amount }</div>
  154. ## credit
  155. <div class="act_as_cell amount">${formatLang(total_credit) | amount }</div>
  156. ## balance cumulated
  157. <div class="act_as_cell amount" style="padding-right: 1px;">${formatLang(part_cumul_balance) | amount }</div>
  158. %if amount_currency(data):
  159. ## currency balance
  160. <div class="act_as_cell sep_left amount">${formatLang(part_cumul_balance_curr) | amount }</div>
  161. ## curency code
  162. <div class="act_as_cell">${balance_forward_currency}</div>
  163. %endif
  164. </div>
  165. %endif
  166. %for line in ledger_lines[account.id].get(p_id, []):
  167. <%
  168. total_debit += line.get('debit') or 0.0
  169. total_credit += line.get('credit') or 0.0
  170. label_elements = [line.get('lname') or '']
  171. if line.get('invoice_number'):
  172. label_elements.append("(%s)" % (line['invoice_number'],))
  173. label = ' '.join(label_elements)
  174. %>
  175. <div class="act_as_row lines">
  176. ## date
  177. <div class="act_as_cell first_column">${formatLang(line.get('ldate') or '', date=True)}</div>
  178. ## period
  179. <div class="act_as_cell">${line.get('period_code') or ''}</div>
  180. ## move
  181. <div class="act_as_cell">${line.get('move_name') or ''}</div>
  182. ## journal
  183. <div class="act_as_cell">${line.get('jcode') or ''}</div>
  184. ## partner
  185. <div class="act_as_cell overflow_ellipsis">${line.get('partner_name') or ''}</div>
  186. ## move reference
  187. <div class="act_as_cell">${line.get('lref') or ''}</div>
  188. ## label
  189. <div class="act_as_cell">${label}</div>
  190. ## reconcile
  191. <div class="act_as_cell">${line.get('rec_name') or ''}</div>
  192. ## debit
  193. <div class="act_as_cell amount">${formatLang(line.get('debit') or 0.0) | amount }</div>
  194. ## credit
  195. <div class="act_as_cell amount">${formatLang(line.get('credit') or 0.0) | amount }</div>
  196. ## balance cumulated
  197. <% cumul_balance += line.get('balance') or 0.0 %>
  198. <div class="act_as_cell amount" style="padding-right: 1px;">${formatLang(cumul_balance) | amount }</div>
  199. %if amount_currency(data):
  200. ## currency balance
  201. <div class="act_as_cell sep_left amount">${formatLang(line.get('amount_currency') or 0.0) | amount }</div>
  202. ## curency code
  203. <div class="act_as_cell" style="text-align: right; ">${line.get('currency_code') or ''}</div>
  204. %endif
  205. </div>
  206. %endfor
  207. <div class="act_as_row lines labels">
  208. ## date
  209. <div class="act_as_cell first_column"></div>
  210. ## period
  211. <div class="act_as_cell"></div>
  212. ## move
  213. <div class="act_as_cell"></div>
  214. ## journal
  215. <div class="act_as_cell"></div>
  216. ## partner
  217. <div class="act_as_cell"></div>
  218. ## move reference
  219. <div class="act_as_cell"></div>
  220. ## label
  221. <div class="act_as_cell">${_('Cumulated Balance on Partner')}</div>
  222. ## reconcile
  223. <div class="act_as_cell"></div>
  224. ## debit
  225. <div class="act_as_cell amount">${formatLang(total_debit) | amount }</div>
  226. ## credit
  227. <div class="act_as_cell amount">${formatLang(total_credit) | amount }</div>
  228. ## balance cumulated
  229. <div class="act_as_cell amount" style="padding-right: 1px;">${formatLang(cumul_balance) | amount }</div>
  230. %if amount_currency(data):
  231. ## currency balance
  232. %if account.currency_id:
  233. <div class="act_as_cell amount sep_left">${formatLang(cumul_balance_curr) | amount }</div>
  234. %else:
  235. <div class="act_as_cell sep_left amount">${ u'-' }</div>
  236. %endif
  237. ## currency code
  238. <div class="act_as_cell" style="text-align: right; padding-right: 1px;">${ account.currency_id.name if account.currency_id else u'' }</div>
  239. %endif
  240. </div>
  241. </div>
  242. </div>
  243. <%
  244. account_total_debit += total_debit
  245. account_total_credit += total_credit
  246. account_balance_cumul += cumul_balance
  247. account_balance_cumul_curr += cumul_balance_curr
  248. %>
  249. %endfor
  250. <div class="act_as_table list_table" style="margin-top:5px;">
  251. <div class="act_as_row labels" style="font-weight: bold; font-size: 12px;">
  252. <div class="act_as_cell first_column" style="width: 450px;">${account.code} - ${account.name}</div>
  253. ## label
  254. <div class="act_as_cell" style="width: 360px;">${_("Cumulated Balance on Account")}</div>
  255. ## debit
  256. <div class="act_as_cell amount" style="width: 80px;">${ formatLang(account_total_debit) | amount }</div>
  257. ## credit
  258. <div class="act_as_cell amount" style="width: 80px;">${ formatLang(account_total_credit) | amount }</div>
  259. ## balance cumulated
  260. <div class="act_as_cell amount" style="width: 80px; padding-right: 1px;">${ formatLang(account_balance_cumul) | amount }</div>
  261. %if amount_currency(data):
  262. ## currency balance
  263. %if account.currency_id:
  264. <div class="act_as_cell amount sep_left" style="width: 80px;">${ formatLang(account_balance_cumul_curr) | amount }</div>
  265. %else:
  266. <div class="act_as_cell amount sep_left" style="width: 80px;">${ u'-' }</div>
  267. %endif
  268. ## curency code
  269. <div class="act_as_cell amount" style="width: 30px; text-align: right; padding-right: 1px;">${ account.currency_id.name if account.currency_id else u'' }</div>
  270. %endif
  271. </div>
  272. </div>
  273. </div>
  274. %endif
  275. %endfor
  276. </body>
  277. </html>