[FIX] Account: account and account_financial_report - wrong selection condition on balance report
lp bug: https://launchpad.net/bugs/582243 fixed bzr revid: mra@mra-laptop-20101209120918-zssimdszxldnx0v4
This commit is contained in:
@@ -84,11 +84,12 @@ class account_balance(report_sxw.rml_parse, common_report_header):
|
||||
}
|
||||
self.sum_debit += account_rec['debit']
|
||||
self.sum_credit += account_rec['credit']
|
||||
acc_digit = self.pool.get('decimal.precision').precision_get(self.cr, 1, 'Account')
|
||||
if disp_acc == 'bal_movement':
|
||||
if res['credit'] > 0 or res['debit'] > 0 or res['balance'] > 0:
|
||||
if round(res['credit'], acc_digit) > 0 or round(res['debit'], acc_digit) > 0 or round(res['balance'], acc_digit) != 0:
|
||||
self.result_acc.append(res)
|
||||
elif disp_acc == 'bal_solde':
|
||||
if res['balance'] != 0:
|
||||
if round(res['balance'], acc_digit) != 0:
|
||||
self.result_acc.append(res)
|
||||
else:
|
||||
self.result_acc.append(res)
|
||||
|
||||
@@ -129,15 +129,16 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header)
|
||||
'level': account.level,
|
||||
'balance':account.balance,
|
||||
}
|
||||
acc_digit = self.pool.get('decimal.precision').precision_get(self.cr, 1, 'Account')
|
||||
if typ == 'liability' and account.type <> 'view' and (account.debit <> account.credit):
|
||||
self.result_sum_dr += account.balance
|
||||
if typ == 'asset' and account.type <> 'view' and (account.debit <> account.credit):
|
||||
self.result_sum_cr += account.balance
|
||||
if data['form']['display_account'] == 'bal_movement':
|
||||
if account.credit > 0 or account.debit > 0 or account.balance > 0:
|
||||
if round(account.credit, acc_digit) > 0 or round(account.debit, acc_digit) > 0 or round(account.balance, acc_digit) != 0:
|
||||
accounts_temp.append(account_dict)
|
||||
elif data['form']['display_account'] == 'bal_solde':
|
||||
if account.balance != 0:
|
||||
if round(account.balance, acc_digit) != 0:
|
||||
accounts_temp.append(account_dict)
|
||||
else:
|
||||
accounts_temp.append(account_dict)
|
||||
|
||||
@@ -99,15 +99,16 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header):
|
||||
accounts_temp = []
|
||||
for account in accounts:
|
||||
if (account.user_type.report_type) and (account.user_type.report_type == typ):
|
||||
acc_digit = self.pool.get('decimal.precision').precision_get(self.cr, 1, 'Account')
|
||||
if typ == 'expense' and account.type <> 'view' and (account.debit <> account.credit):
|
||||
self.result_sum_dr += abs(account.debit - account.credit)
|
||||
if typ == 'income' and account.type <> 'view' and (account.debit <> account.credit):
|
||||
self.result_sum_cr += abs(account.debit - account.credit)
|
||||
if data['form']['display_account'] == 'bal_movement':
|
||||
if account.credit > 0 or account.debit > 0 or account.balance > 0:
|
||||
if round(account.credit, acc_digit) > 0 or round(account.debit, acc_digit) > 0 or round(account.balance, acc_digit) != 0:
|
||||
accounts_temp.append(account)
|
||||
elif data['form']['display_account'] == 'bal_solde':
|
||||
if account.balance != 0:
|
||||
if round(account.balance, acc_digit) != 0:
|
||||
accounts_temp.append(account)
|
||||
else:
|
||||
accounts_temp.append(account)
|
||||
|
||||
Reference in New Issue
Block a user