Invoice tax : Onchanges on tax amount and base should consider the tax-code and base-code signs respectively

Bug #524278 reported by Nicolas Bessi - Camptocamp
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Status tracked in Trunk
5.0
In Progress
Low
JMA(Open ERP)
Trunk
Fix Released
High
Jay Vora (Serpent Consulting Services)

Bug Description

When you manually edit the amount of an invoice tax line on an purchase invoice (it will probably do the same on customer), the tax amount is recomputed, the amount is right but the sign is wrong if the tax sign is negative. It appears that the tax code sign in ignored.

That error report itself in the accounting line and spoiled the Vat report.

Maybe we should use a rule based on debit or credit and account type instead of having a tax code sign in order to avoid this kind of problems.

Regards

Nicolas

Tags: maintenance
Changed in account-banking:
status: New → Confirmed
affects: account-banking → openobject-addons
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi,

This bug is still present in the current 5.0.7 version !

This is important, as the VAT declaration is erroneous without a fix or a manual intervention on the base code amount.

OERPScenario can now detect this bug with --tag=@bug524278.

Here is the complete test case :

 Given I have recorded on the 10 sept 2009 a supplier invoice (in_invoice) of 1000.0 CHF without tax called MySupplierInvoiceTax
    And I add a line with tax called MyTaxLine on the last created invoice of 12156.0 with the tax called 'Buy 19.6%'
 When I compute the taxes on invoice
 Then I should have a invoice tax line with a base amount of 12156.0
 And a tax amount of 2382.58

 When I modify the tax amount to 2382.55
 Then I should have a invoice tax line with a base amount of 12156.0
 And a tax amount of 2382.55
 And a tax code amount of -1588.37

!!! Fails here => get 1588.37 instead of -1588.37

 And a tax base amount of -8104.0

 Given I correct the total amount of the invoice according to changes
 When I press the validate button
 Then I should see the invoice MySupplierInvoiceTax open
 And I should have a linked account move with 4 lines and a posted status

Changed in openobject-addons:
importance: Undecided → High
milestone: none → 5.0.8
Changed in openobject-addons:
assignee: nobody → Jay (Open ERP) (jvo-openerp)
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

The root of the problem is, the account_invoice_tax object has no relation with account.tax.

Should we be adding a field for that?

Let us know.
Thanks.

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

This is again an issue which needs a guidance from our Accounting experts.

Thanks.

Revision history for this message
Ferdinand (office-chricar) wrote :

we have a "weak" relation via tax_code_id

IMHO yes we should (only) have ONE account_invoice_tax line per tax_id (which is the same as in account_invoice_line_tax)

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

Hello Joël and Nicolas,

The 'Taxes' one2many is only an overview of the total taxes applied on different invoice lines.
Altering them explicitly would be not countable.

As of now, we do not have any relation to account.tax and so onchange can't be applied on it.
So, I pass this bug to be fixed on trunk.
Let us know your views please.

Thanks.

Revision history for this message
Nathan (nathan-bowden-kiwi) wrote :

i pointmatch with ferdinand.
i work for account,i know its importent.

Revision history for this message
Nathan (nathan-bowden-kiwi) wrote : Re: On change on invoice taxes ignore tax code sign

up.

Revision history for this message
pap(openerp) (pap-openerp) wrote :

Hello,
It is fixed in trunk-addons.

Thank you.

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

It has been fixed by revision 4901 <email address hidden>.
Thanks.

summary: - On change on invoice taxes ignore tax code sign
+ Invoice tax : Onchanges on tax amount and base should consider the tax-
+ code and base-code signs respectively
tags: added: maintenance
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Vincent/Frederic,

Can you please try with this patch?

Thanks.

Revision history for this message
Nathan (nathan-bowden-kiwi) wrote :

works ok for me.

Revision history for this message
Nathan (nathan-bowden-kiwi) wrote :

can someone see it if Jay(Openerp) is dead(not replying or cannot see anymore)?

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

Nathan,

Thanks for coming back on this.

We are actually waiting for a response from C2C as this is a maintenance case(tag has been added).

Thanks.

P.s.: I am very much alive (due to all your blessings).

Revision history for this message
Nathan (nathan-bowden-kiwi) wrote :

Sorry Jay(openerp), I didnot mean it.
btw,thanks for fix.

Revision history for this message
Nathan (nathan-bowden-kiwi) wrote :

up.

Revision history for this message
Nathan (nathan-bowden-kiwi) wrote :

JMA(OpenERP), thank you for efforts and patch, we are now using version 6.
you can shut this bug down.

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.