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.

217 lines
10 KiB

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