The balance of the bank statement with foreign currencies is wrong

Bug #588604 reported by Wyden Silvan (brain-tec)
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Undecided
Vinay Rana (OpenERP)

Bug Description

In the file account_bank_statement.py the function "_end_balance" is wrong. When you have entries in foreign currencies it doesn't take the date from the move line. So after the confirmation of the bank statement, the end balance change and the real balance and the calculated balance doesnt much any more.

I have found a solution that seems to work. I submit the date of the move line and round the amount:

Line 30:
from tools import config

Line 66:
res[statement.id] += round(res_currency_obj.compute(cursor,
                                user, company_currency_id, currency_id,
                                line.debit, context={'date': line.date}),int(config['price_accuracy']))
Line 75:
 res[statement.id] -= round(res_currency_obj.compute(cursor,
                                user, company_currency_id, currency_id,
                                line.credit, context={'date': line.date}),int(config['price_accuracy']))

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

Hello Wyden,

I have gone through the above scenario.
Everything seems to be fine for us.

*There is actually no need for the round() function suggested above as the value which comes from the compute() method of 'res.currency' object is already rounded, so it is unnecessary to apply the round() function again.

**Other aspect the 'currency rate' is already coming from the 'line date' so there seems to be no need to update the context by passing the 'line.date'.

I hope this helps.

However, you can provide me with an example or screen-shot about the problem you facing on your side.

Thanks.

Changed in openobject-addons:
assignee: nobody → vra (openerp) (vra-openerp)
Revision history for this message
Wyden Silvan (brain-tec) (brain-tec) wrote :

Hi

I have you attached a screenshot in Germant. How you can see, the calculated total at the bottom isn't the same as the total of the bank statement. As long as you don't confirm the bank statement the two totals are equal. But as soon as you click on "confirm" the calculated total changes to another value which is a problem of currencies. The problems appears only when the date of the bank statement lines isn't the date of today. If you put in the statement lines the date from today, then there are now problems and the two total are equal!

The currency of the company is CHF and the currency of the bank statement is EUR.

Thanks.

Changed in openobject-addons:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.