~vauxoo/account-financial-report/7.0-afr-multicurrency-dev-1985-kty

« back to all changes in this revision

Viewing changes to account_financial_report/report/parser.py

  • Committer: Katherine Zaoral
  • Date: 2014-08-15 16:49:47 UTC
  • Revision ID: katherine.zaoral@vauxoo.com-20140815164947-yj8z8a3sramdi8q9
[ADD] now manage total, detail and full group by partner report.

Show diffs side-by-side

added added

removed removed

Lines of Context:
407
407
                    res.append(aux_res)
408
408
        elif ctx['group_by'] == 'partner':
409
409
            partner_data = self.get_group_by_partner(all_res)
410
 
            if detail_level == 'detail':
 
410
            if detail_level in ['detail', 'full']:
411
411
                for (key, value) in partner_data.iteritems():
412
412
                    aux_res = list()
413
413
                    aux_res.append(self.create_report_line(
418
418
                        aux_res.extend(value['xchange_total'])
419
419
                    aux_res.extend(value['real_total'])
420
420
                    res.append(aux_res)
 
421
            if detail_level == 'total':
 
422
                for (key, value) in partner_data.iteritems():
 
423
                    aux_res = list()
 
424
                    aux_res.append(self.create_report_line(
 
425
                        'Resume of partner {0}'.format(key), {'partner': key}))
 
426
                    aux_res.extend(value['init_balance'])
 
427
                    if value['xchange_total']:
 
428
                        aux_res.extend(value['xchange_total'])
 
429
                    aux_res.extend(value['real_total'])
 
430
                    res.append(aux_res)
421
431
        return res
422
432
 
423
433
    def get_group_by_partner(self, all_res):