[IMP] Account: Partner Ledger Report-cummulative balance

bzr revid: mtr@mtr-20101118082759-3sztv3si7sc5kztj
This commit is contained in:
mtr 2010-11-18 13:57:59 +05:30
parent 57faed65d3
commit dd50d55b8d
2 changed files with 7 additions and 2 deletions

View File

@ -120,6 +120,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
self.cr.execute('SELECT l.id FROM account_move_line l, account_move am WHERE l.move_id=am.id AND am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' ORDER BY l.'+ self.sort_selection + '',(tuple(move_state), period_id, tuple(journal_id) ))
ids = map(lambda x: x[0], self.cr.fetchall())
print"--ids--",ids
return obj_mline.browse(self.cr, self.uid, ids)
def _set_get_account_currency_code(self, account_id):

View File

@ -152,8 +152,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 +180,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']