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.

218 lines
10 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. .account_level_1 {
  7. text-transform: uppercase;
  8. font-size: 15px;
  9. background-color:#F0F0F0;
  10. }
  11. .account_level_2 {
  12. font-size: 12px;
  13. background-color:#F0F0F0;
  14. }
  15. .regular_account_type {
  16. font-weight: normal;
  17. }
  18. .view_account_type {
  19. font-weight: bold;
  20. }
  21. .account_level_consol {
  22. font-weight: normal;
  23. font-style: italic;
  24. }
  25. ${css}
  26. .list_table .act_as_row {
  27. margin-top: 10px;
  28. margin-bottom: 10px;
  29. font-size:10px;
  30. }
  31. </style>
  32. </head>
  33. <body>
  34. <%!
  35. def amount(text):
  36. return text.replace('-', '&#8209;') # replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers)
  37. %>
  38. <%setLang(user.lang)%>
  39. <%
  40. initial_balance_text = {'initial_balance': _('Computed'), 'opening_balance': _('Opening Entries'), False: _('No')}
  41. %>
  42. <div class="act_as_table data_table">
  43. <div class="act_as_row labels" style="page-break-inside: avoid">
  44. <div class="act_as_cell">${_('Chart of Account')}</div>
  45. <div class="act_as_cell">${_('Fiscal Year')}</div>
  46. <div class="act_as_cell">
  47. %if filter_form(data) == 'filter_date':
  48. ${_('Dates Filter')}
  49. %else:
  50. ${_('Periods Filter')}
  51. %endif
  52. </div>
  53. <div class="act_as_cell">${_('Accounts Filter')}</div>
  54. <div class="act_as_cell">${_('Target Moves')}</div>
  55. <div class="act_as_cell">${_('Initial Balance')}</div>
  56. </div>
  57. <div class="act_as_row" style="page-break-inside: avoid">
  58. <div class="act_as_cell">${ chart_account.name }</div>
  59. <div class="act_as_cell">${ fiscalyear.name if fiscalyear else '-' }</div>
  60. <div class="act_as_cell">
  61. ${_('From:')}
  62. %if filter_form(data) == 'filter_date':
  63. ${formatLang(start_date, date=True) if start_date else u'' }
  64. %else:
  65. ${start_period.name if start_period else u''}
  66. %endif
  67. ${_('To:')}
  68. %if filter_form(data) == 'filter_date':
  69. ${ formatLang(stop_date, date=True) if stop_date else u'' }
  70. %else:
  71. ${stop_period.name if stop_period else u'' }
  72. %endif
  73. </div>
  74. <div class="act_as_cell">
  75. %if accounts(data):
  76. ${', '.join([account.code for account in accounts(data)])}
  77. %else:
  78. ${_('All')}
  79. %endif
  80. </div>
  81. <div class="act_as_cell">${ display_target_move(data) }</div>
  82. <div class="act_as_cell">${ initial_balance_text[initial_balance_mode] }</div>
  83. </div>
  84. </div>
  85. %for index, params in enumerate(comp_params):
  86. <div class="act_as_table data_table">
  87. <div class="act_as_row" style="page-break-inside: avoid">
  88. <div class="act_as_cell">${_('Comparison %s') % (index + 1,)} (${"C%s" % (index + 1,)})</div>
  89. <div class="act_as_cell">
  90. %if params['comparison_filter'] == 'filter_date':
  91. ${_('Dates Filter:')}&nbsp;${formatLang(params['start'], date=True) }&nbsp;-&nbsp;${formatLang(params['stop'], date=True) }
  92. %elif params['comparison_filter'] == 'filter_period':
  93. ${_('Periods Filter:')}&nbsp;${params['start'].name}&nbsp;-&nbsp;${params['stop'].name}
  94. %else:
  95. ${_('Fiscal Year :')}&nbsp;${params['fiscalyear'].name}
  96. %endif
  97. </div>
  98. <div class="act_as_cell">${_('Initial Balance:')} ${ initial_balance_text[params['initial_balance_mode']] }</div>
  99. </div>
  100. </div>
  101. %endfor
  102. <div class="act_as_table list_table" style="margin-top: 20px;">
  103. <div class="act_as_thead">
  104. <div class="act_as_row labels" style="page-break-inside: avoid">
  105. ## code
  106. <div class="act_as_cell first_column" style="width: 20px;">${_('Code')}</div>
  107. ## account name
  108. <div class="act_as_cell" style="width: 80px;">${_('Account')}</div>
  109. %if comparison_mode == 'no_comparison':
  110. %if initial_balance_mode:
  111. ## initial balance
  112. <div class="act_as_cell amount" style="width: 30px;">${_('Initial Balance')}</div>
  113. %endif
  114. ## debit
  115. <div class="act_as_cell amount" style="width: 30px;">${_('Debit')}</div>
  116. ## credit
  117. <div class="act_as_cell amount" style="width: 30px;">${_('Credit')}</div>
  118. %endif
  119. ## balance
  120. <div class="act_as_cell amount" style="width: 30px;">
  121. %if comparison_mode == 'no_comparison' or not fiscalyear:
  122. ${_('Balance')}
  123. %else:
  124. ${_('Balance %s') % (fiscalyear.name,)}
  125. %endif
  126. </div>
  127. %if comparison_mode in ('single', 'multiple'):
  128. %for index in range(nb_comparison):
  129. <div class="act_as_cell amount" style="width: 30px;">
  130. %if comp_params[index]['comparison_filter'] == 'filter_year' and comp_params[index].get('fiscalyear', False):
  131. ${_('Balance %s') % (comp_params[index]['fiscalyear'].name,)}
  132. %else:
  133. ${_('Balance C%s') % (index + 1,)}
  134. %endif
  135. </div>
  136. %if comparison_mode == 'single': ## no diff in multiple comparisons because it shows too data
  137. <div class="act_as_cell amount" style="width: 30px;">${_('Difference')}</div>
  138. <div class="act_as_cell amount" style="width: 30px;">${_('% Difference')}</div>
  139. %endif
  140. %endfor
  141. %endif
  142. </div>
  143. </div>
  144. <div class="act_as_tbody">
  145. <%
  146. last_child_consol_ids = []
  147. last_level = False
  148. %>
  149. %for current_account in objects:
  150. <%
  151. if not current_account.to_display:
  152. continue
  153. comparisons = current_account.comparisons
  154. if current_account.id in last_child_consol_ids:
  155. # current account is a consolidation child of the last account: use the level of last account
  156. level = last_level
  157. level_class = "account_level_consol"
  158. else:
  159. # current account is a not a consolidation child: use its own level
  160. level = current_account.level or 0
  161. level_class = "account_level_%s" % (level,)
  162. last_child_consol_ids = [child_consol_id.id for child_consol_id in current_account.child_consol_ids]
  163. last_level = current_account.level
  164. %>
  165. <div class="act_as_row lines ${level_class} ${"%s_account_type" % (current_account.type,)}" style="page-break-inside: avoid">
  166. ## code
  167. <div class="act_as_cell first_column">${current_account.code}</div>
  168. ## account name
  169. <div class="act_as_cell" style="padding-left: ${level * 5}px;">${current_account.name}</div>
  170. %if comparison_mode == 'no_comparison':
  171. %if initial_balance_mode:
  172. ## opening balance
  173. <div class="act_as_cell amount">${formatLang(current_account.init_balance) | amount}</div>
  174. %endif
  175. ## debit
  176. <div class="act_as_cell amount">${formatLang(current_account.debit) | amount}</div>
  177. ## credit
  178. <div class="act_as_cell amount">${formatLang(current_account.credit) | amount}</div>
  179. %endif
  180. ## balance
  181. <div class="act_as_cell amount">${formatLang(current_account.balance) | amount}</div>
  182. %if comparison_mode in ('single', 'multiple'):
  183. %for comp_account in comparisons:
  184. <div class="act_as_cell amount">${formatLang(comp_account['balance']) | amount}</div>
  185. %if comparison_mode == 'single': ## no diff in multiple comparisons because it shows too data
  186. <div class="act_as_cell amount">${formatLang(comp_account['diff']) | amount}</div>
  187. <div class="act_as_cell amount">
  188. %if comp_account['percent_diff'] is False:
  189. ${ '-' }
  190. %else:
  191. ${int(round(comp_account['percent_diff'])) | amount} &#37;
  192. %endif
  193. </div>
  194. %endif
  195. %endfor
  196. %endif
  197. </div>
  198. %endfor
  199. </div>
  200. </div>
  201. </body>
  202. </html>