Take refunds into account

This commit is contained in:
Alexis de Lattre
2015-03-07 00:01:27 +01:00
parent 9e6c8b28ba
commit 215e5a7b90

View File

@@ -38,5 +38,8 @@ class AccountVoucher(models.Model):
total_open_bal = 0.0 total_open_bal = 0.0
for line in res['value']['line_cr_ids']: for line in res['value']['line_cr_ids']:
total_open_bal += line['amount_unreconciled'] total_open_bal += line['amount_unreconciled']
if res['value'].get('line_dr_ids'):
for line in res['value']['line_dr_ids']:
total_open_bal -= line['amount_unreconciled']
res['value']['amount'] = total_open_bal res['value']['amount'] = total_open_bal
return res return res