Comment 82 for bug 452854

Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi,

I finally spend half a day on this, and I give you what I got. The attached patch combine the last one of Anup and add a check/correction on debit and credit value according to the amount total of the invoice.

The point is the following (for me at least) :

- The Anup Patch seems to fix the sum debit != sum credit => Good !

- But the amount total of the invoice (in foreign currency) converted into company currency is still not = to credit or debit value on the receivable/payable account => Not good.

This issue let an invoice with an inconsistence when making the reconciliation.

My patch suggest the following:

- Once everything is ready to create the move line, it check that the condition is true (amount_total in company currency == credit or debit on the receivable/payable account).

- If there is a difference, then I add that difference on one credit and one debit line (the receivable and the biggest amount).

In another word, it correct the credit / debit total amount according to the rounding of the foreign currency. This avoid to have 0,01 cents to write-off when making the reconciliation.

For the future version 6.0, I'll strongly suggest to provide an account per currency / per company to deal with that, as it is in other software...

Please, review my patch cause we need something good for everyone.. I'm not that proud of my python coding on this one, advices welcome !

Regards,