Residual amount : Regression with bank statement

Bug #666154 reported by Vincent Renaville@camptocamp
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
High
JMA(Open ERP)

Bug Description

Hello,

We have a problem with Residual amount on invoice on latest stable version, you can reproduce it using this use case:
###Configuration
- Create a new database.
- Use the service company profile
- Use the EUr as company currency
- Install Suisse - plan comptable Sterchi as account chart
- Do not install extra-module
###Invoice creation
- Create a new customer invoice
- Create one invoice line linked with it
- Set the state to open using "Create" button
###Reconciliation
- Create a new bank statement
- Select a bank journal
- Import the previous created invoice through "Import invoice" button
- confirm the bank statement
###Result
- Return to the invoice
- the status of the invoice is paid but the residual is equal to invoice amount

the residual must be equal to 0.

Kind regards,

Vincent Renaville

Related branches

Changed in openobject-addons:
assignee: nobody → JMA(Open ERP) (jma-openerp)
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Vincent,

Can you check with this patch?

We have checked the complex case bug 511104 too.

Thanks.

Changed in openobject-addons:
importance: Undecided → High
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thanks for the feedback.
It has been fixed by revision 2877 <email address hidden>.

Changed in openobject-addons:
status: In Progress → Fix Released
milestone: none → 5.0.15
Revision history for this message
Frederic Clementi - Camptocamp (frederic-clementi) wrote :

Hi Jay,

I have just done this test with your patch but if you create an invoice in foreign currency at rate A and pay in full it with the draft statement at rate B and you post a write off (for the curr. rate difference) than status become "paid" but residual amount is not zero (= exchange rate diff)

Good luck

Frederic

Changed in openobject-addons:
status: Fix Released → Confirmed
Revision history for this message
forstera (arnaud-forster-deactivatedaccount) wrote :

hello all,

I pass the patch but it will be test saturday by the accounting. Is it working or not (there are 2 differente answers here ) ?

Thanks

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello,

The currency difference was the original culprit and here is the patch.

Behavior chosen:
1. If the currency of payment and invoice is different : Consider the latest rate.
2. If the currency of payment and company is different : Consider the rate when invoice was made.

Queries/Feedbacks invited.
Thanks.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Arnaud,

You will need to update the code first and use this patch.
This patch of comment #5 has been made from the committed revision.

Thanks.

Revision history for this message
forstera (arnaud-forster-deactivatedaccount) wrote :

ok, thanks. I'm proceeding. Tests will be done saturday morning...

Revision history for this message
forstera (arnaud-forster-deactivatedaccount) wrote :

Ooops, soory.

If i Understand well, first I install revision 2877 and then I install your patch. Is it that ?

Thanks

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Yes, you are right.
Let me know if you need more convenient patch without updating the revision 2877.
Thanks.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Hello all, I think there might be a confusion with the patches here.

The patch posted in comment #1 is not correct and is not the patch that was applied in revision 2877!
If you have tested by applying this patch instead of updating to the latest stable, this will typically lead to the sort of behavior Frederic is describing in comment #3. (Jay, perhaps you should delete that initial patch?)

Raphael, since you re-opened the bug, how did you reproduce it?

I have juste tried again the 2 cases after a simple update to the latest stable rev. 2877 (no manual patch applied) and the original scenario seems to work fine, and the scenario of different rates from comment #3 too!

Could you all simply retry your tests with revision 2877, and no other patch?

Thanks!

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote : Re: [Bug 666154] Re: Residual amount : Regression with bank statement

Hello Olivier,

I personaly just used my admin bug management rights to flag the bug as
confirmed again (so OpenERP SA + community can detect it) after Frederic
Clementi from CampToCamp said it was still present. I didn't try to
reproduce the issue myself (but tend to trust CampToCamp guys when it's
about spotting accounting issues). As it been fixed after Frederic reported
the failure or was that report invalid?

Sounds good anyway if you can't reproduce it.

Raphaël Valyi

On Thu, Oct 28, 2010 at 8:03 PM, Olivier Dony (OpenERP) <
<email address hidden>> wrote:

> Hello all, I think there might be a confusion with the patches here.
>
> The patch posted in comment #1 is not correct and is not the patch that was
> applied in revision 2877!
> If you have tested by applying this patch instead of updating to the latest
> stable, this will typically lead to the sort of behavior Frederic is
> describing in comment #3. (Jay, perhaps you should delete that initial
> patch?)
>
> Raphael, since you re-opened the bug, how did you reproduce it?
>
> I have juste tried again the 2 cases after a simple update to the latest
> stable rev. 2877 (no manual patch applied) and the original scenario
> seems to work fine, and the scenario of different rates from comment #3
> too!
>
> Could you all simply retry your tests with revision 2877, and no other
> patch?
>
> Thanks!
>
> --
> Residual amount : Regression with bank statement
> https://bugs.launchpad.net/bugs/666154
> You received this bug notification because you are subscribed to
> OpenObject Addons.
>
> Status in OpenObject Addons Modules: Confirmed
>
> Bug description:
> Hello,
>
> We have a problem with Residual amount on invoice on latest stable version,
> you can reproduce it using this use case:
> ###Configuration
> - Create a new database.
> - Use the service company profile
> - Use the EUr as company currency
> - Install Suisse - plan comptable Sterchi as account chart
> - Do not install extra-module
> ###Invoice creation
> - Create a new customer invoice
> - Create one invoice line linked with it
> - Set the state to open using "Create" button
> ###Reconciliation
> - Create a new bank statement
> - Select a bank journal
> - Import the previous created invoice through "Import invoice" button
> - confirm the bank statement
> ###Result
> - Return to the invoice
> - the status of the invoice is paid but the residual is equal to invoice
> amount
>
> the residual must be equal to 0.
>
>
> Kind regards,
>
>
> Vincent Renaville
>
>
>

Revision history for this message
forstera (arnaud-forster-deactivatedaccount) wrote :

Hello all,

So I applied revision 2877 without any othe patch. the Accounting are going to test that saturday morning; I'll post the results as soon as they'll transmitt them to me...

Revision history for this message
Frederic Clementi - Camptocamp (frederic-clementi) wrote :

Hi guys,

Unfortunately, I do not agree with the way the bug has been fixed. It is really a tough one.
- 1st - If you create an invoice in currency and you have different payments the residual amount is wrong.
- 2nd - we should not have any amount in currency on the write entry otherwise the partner ledger report we are testing at the same time for version 6 will includes funny amount in currency(= all exchange rate diff.)

Fixing this bug is crucial for us,

Thanks

Frederic

Revision history for this message
Frederic Clementi - Camptocamp (frederic-clementi) wrote :

In this attached file I tried to explain what I mean when I say the calculation is wrong.
I think we need to change a bit the way it has been coded.

I propose to separate the residual amount calculation when final payment has not been made and the final residual amount (which is zero in most of the cases)

Also, on the potential write off entry, it is important not to leave the "amount in currency" column empty, otherwise we will create problems with partner reports later.

But please read this and do not hesitate to tell me if you do not think if is correct.

Hoping this will help.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Frederic,

I completely agree with you that amount_currency should not be empty(But only when amount is paid in currency other than company currency...Correct me here if I conflicted).

Thanks a lot for the document you attached.I have gone though it and conclude that residual amount is always zero now. Which means the current bug is solved. Tell me if you don't agree,otherwise we should close the bug.

Moreover, in your case of multiple currency payment where 1st payment of 200 USD makes residual 277.69, seems accurate and correct to me.

Let me justify :
One must pay 326.44 EUR anyhow to company.
You pay 200 USD at the rate of 1.6 USD = 1 EUR ---> Leads to the payment of 125.00 EUR.
Residual is the amount which is yet to be paid to company, so company currency plays its role here which takes to 326.44-125.00 = 201.44 EUR yet to be paid.
201.44 EUR = 277.60 USD at the rate of 1.3785. (the rate at which invoice was validated).

I think, this scenario is very much acceptable and works as expected.

Now, as you already mentioned about the effect of write-off and currency difference on Reports, I am keen to see this and correct them if really it hurts the accountants. Can you please elaborate more about this?

Thanks for all your interest.

Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Frederic Clementi - Camptocamp (frederic-clementi) wrote :

Hi Jay,

I do not agree when you say the residual amount should be 277.60 USD (using the invoicing rate).
Invoice was 450 $, 1st payment is 200 $ so residual has to be 250$ (no matter exchange rate).

regards

Frederic

Revision history for this message
Vincent Renaville@camptocamp (vrenaville-c2c) wrote :

Hello,

Do you have any news about this problem ?
It's really difficult for our customers to made invoice control.

Thanks for your help,

Vincent

Revision history for this message
Frederic Clementi - Camptocamp (frederic-clementi) wrote :

Residual amount does not work on 5.0.15.

When you pay in full an invoice in CHF with the pay invoice wizard whereas your company currency is EUR and that you have 2 different rate for invoice and payment then you have a write off... residual amount is not zero.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hi Frederic,

Can you tell me how you operated the bank statement details?
I tried the same way, but only the payment screen was different and was ok.

Thanks.

Changed in openobject-addons:
milestone: 5.0.15 → none
Revision history for this message
Vincent Renaville@camptocamp (vrenaville-c2c) wrote :

Hello,

I think we have a misunderstanding.
Frédéric report a problem about residual when user use the "Pay invoice" wizard in the invoice.

I have made the test with bank statement and it works now with the last stable version.

thanks for your help,

Vincent

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thank you for precious feedback Vincent.
I would like to close the bug as soon as I get confirmation from you guys.
Thanks for being with us.

Revision history for this message
Frederic Clementi - Camptocamp (frederic-clementi) wrote :

Sorry Jay, I mixed up the 2 bug reports residual amount pay via pay invoice wizard and the one via bank statement.
Please don't blacklist me ;)

Apologies,

Frederic

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thanks for your comment Frederic, I won't blacklist you now :).

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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