Comment 35 for bug 452854

Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote : Re: Cannon validate foreign currency invoices

Hi everyone,

I post the result f the expert team accouting here:

If I agree with most aspect of what you spoke about (the way to properly handle it, OFBiz specs, and so ...),
this is only possible on the next coming version 5.2. I already write a blueprint to centralize every one's ideas here :

https://blueprints.launchpad.net/openobject-addons/+spec/generic-accuracy-improvement

So please, post your advice and though here, so will try to find a "community" solution for that !

But for now, we still have a big trouble : Depending on currency exchange rate, we still can't confirm some invoices !!!!

I'll suggest to handle it the following:

When the balance isn't respected on the invoice confirmation (raising an error), OpenERP automatically add the difference
on the line with the greatest amount. That means, in my example, OpenERP will add 0,01 CHF.- on the 1144.0.- Line.

Doing that will avoid the error, and allow the user to confirm the invoice. I know this is not perfect, but as we saw, I
can't suggest a better solution, or my merge proposal will be refuse... Saying it's too much for a stable version... And the
worst is that I'll agree on that.

Implementing a good write-off system per currency AND implementing Decimal should be the good one in my own opinion...

So know the decision is : adding the difference to the biggest line. Just pay attention for incoming invoices we just have to make sure that the total VAT calculated by OpenERP corresponds to Total VAT on the invoice, this avoids discussion with fiscal authorities.

@forstera : The only way I know before this fix is to change the currency rate... Then pass a write-off for it !

Regards,

Joël

P.S. As a proof/reminder, I put my Scenario test case to let you reproduce and understand things:

  Background:
      Given I am loged as admin user with password admin used
      And the company currency is set to EUR
      And the following currency rate settings are:
      |code|rate|name|
      |EUR|1.000|01-01-2009|
      |CHF|1.644|01-01-2009|
      |CHF|1.500|09-09-2009|
      |CHF|0.6547|10-10-2009|
      |USD|1.3785|01-01-2009|
      And a cash journal in USD exists
      And a cash journal in CHF exists
      And a cash journal in EUR exists

  Scenario: check_rounding_diff_multi_line_inv
    Given I have recorded on the 11 oct 2009 a supplier invoice (in_invoice) of 1144.0 CHF without tax called MySupplierInvoiceRounding
    And I add a line on the last created invoice of 91.73
    And I add a line on the last created invoice of 63.00
    And correct the total amount of the invoice according to changes
    When I press the validate button
    Then I should see the invoice MySupplierInvoiceRounding open
    And the total credit amount must be equal to the total debit amount
 # Here we check the rounding to see if sum(rounded lines) == total invoice amount * current currency rate
    And the total amount convert into company currency must be same amount than the credit line on the payable/receivable account