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.

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