+
+ ## account name
+
${_('Account / Partner Name')}
+ ## code
+
${_('Code / Ref')}
+ %if comparison_mode == 'no_comparison':
+ %if initial_balance_mode:
+ ## initial balance
+
${_('Initial Balance')}
+ %endif
+ ## debit
+
${_('Debit')}
+ ## credit
+
${_('Credit')}
+ %endif
+ ## balance
+
+ %if comparison_mode == 'no_comparison' or not fiscalyear:
+ ${_('Balance')}
+ %else:
+ ${_('Balance %s') % (fiscalyear.name,)}
+ %endif
+
+ %if comparison_mode in ('single', 'multiple'):
+ %for index in range(nb_comparison):
+
+ %if comp_params[index]['comparison_filter'] == 'filter_year' and comp_params[index].get('fiscalyear', False):
+ ${_('Balance %s') % (comp_params[index]['fiscalyear'].name,)}
+ %else:
+ ${_('Balance C%s') % (index + 1,)}
+ %endif
+
+ %if comparison_mode == 'single': ## no diff in multiple comparisons because it shows too data
+
${_('Difference')}
+
${_('% Difference')}
+ %endif
+ %endfor
+ %endif
+
+
+
+ %for (partner_code_name, partner_id, partner_ref, partner_name) in partners_order:
+ <%
+ partner = current_partner_amounts.get(partner_id, {})
+
+ # in single mode, we have to display all the partners
+ # even if their balance is 0.0 because the initial balance
+ # should match with the previous year closings
+
+ # in multiple columns mode, we do not want to print partners
+ # which have a balance at 0.0 in each comparison column
+ if comparison_mode in ('single', 'multiple'):
+ all_comparison_lines = [comp['partners_amounts'][partner_id]
+ for comp in comparisons
+ if comp['partners_amounts'].get(partner_id)]
+ if not display_line(all_comparison_lines):
+ continue
+
+ total_initial_balance += partner.get('init_balance', 0.0)
+ total_debit += partner.get('debit', 0.0)
+ total_credit += partner.get('credit', 0.0)
+ total_balance += partner.get('balance', 0.0)
+ %>
+
+
${partner_name if partner_name else _('Unallocated') }
+
${partner_ref if partner_ref else ''}
+ %if comparison_mode == 'no_comparison':
+ %if initial_balance_mode:
+
${formatLang(partner.get('init_balance', 0.0)) | amount}
+ %endif
+
${formatLang(partner.get('debit', 0.0)) | amount}
+
${formatLang(partner.get('credit', 0.0)) | amount}
+ %endif
+
${formatLang(partner['balance'] if partner else 0.0) | amount}
+
+ %if comparison_mode in ('single', 'multiple'):
+ %for i, comp in enumerate(comparisons):
+ <%
+ comp_partners = comp['partners_amounts']
+ balance = diff = percent_diff = 0
+ if comp_partners.get(partner_id):
+ balance = comp_partners[partner_id]['balance']
+ diff = comp_partners[partner_id]['diff']
+ percent_diff = comp_partners[partner_id]['percent_diff']
+ comparison_total[i]['balance'] += balance
+ %>
+
${formatLang(balance) | amount}
+ %if comparison_mode == 'single': ## no diff in multiple comparisons because it shows too data
+
${formatLang(diff) | amount}
+
+ %if percent_diff is False:
+ ${ '-' }
+ %else:
+ ${int(round(percent_diff)) | amount} %
+ %endif
+
+ %endif
+ %endfor
+ %endif
+
+ %endfor
+
+