[MERGE] account: partner ledger report with cumulitive balance

bzr revid: mra@mra-laptop-20101122071921-lgalzr3m05mxnk3b
This commit is contained in:
Mustufa Rangwala 2010-11-22 12:49:21 +05:30
commit c5c07843fa
1 changed files with 8 additions and 3 deletions

View File

@ -28,6 +28,7 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header):
def __init__(self, cr, uid, name, context=None):
super(third_party_ledger, self).__init__(cr, uid, name, context=context)
self.init_bal_sum = 0.0
self.localcontext.update({
'time': time,
'lines': self.lines,
@ -152,8 +153,10 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header):
(partner.id, tuple(self.account_ids), tuple(move_state)))
res = self.cr.dictfetchall()
sum = 0.0
if self.initial_balance:
sum = self.init_bal_sum
for r in res:
sum = r['debit'] - r['credit']
sum += r['debit'] - r['credit']
r['progress'] = sum
full_account.append(r)
return full_account
@ -178,7 +181,9 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header):
" " + RECONCILE_TAG + " "\
"AND " + self.init_query + " ",
(partner.id, tuple(move_state), tuple(self.account_ids)))
return self.cr.fetchall()
res = self.cr.fetchall()
self.init_bal_sum = res[0][2]
return res
def _sum_debit_partner(self, partner):
move_state = ['draft','posted']
@ -414,4 +419,4 @@ report_sxw.report_sxw('report.account.third_party_ledger_other', 'res.partner',
'addons/account/report/account_partner_ledger_other.rml',parser=third_party_ledger,
header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: