Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0034392Openbravo ERP07. Sales managementpublic2016-11-04 10:482018-02-22 17:22
ngarcia 
markmm82 
immediatemajoralways
closedfixed 
5
 
3.0PR17Q1 
aferraz
Core
Production - Confirmed Stable
2015-07-16
3.0PR15Q4
https://code.openbravo.com/erp/devel/pi/rev/8860b648abb2 [^]
No
0034392: Tax are duplicated in voided Sales Invoices if the original include a basic discount. Total Gross Amount does not match
Tax are duplicated in voided Sales Invoices if the original include a basic discount. Total Gross Amount does not match
As group admin role:
   Create a Sales Invoice, add a line and 'Descuento 10%' basic discount to it and complete it
   Void it
   Check two records are created in the tax tab of the automatically created invoice and that the total gross amount does not match the original total gross amount
No tags attached.
depends on backport 00344343.0PR16Q4 closed markmm82 Tax are duplicated in voided Sales Invoices if the original include a basic discount. Total Gross Amount does not match 
depends on backport 00344353.0PR16Q3.3 closed markmm82 Tax are duplicated in voided Sales Invoices if the original include a basic discount. Total Gross Amount does not match 
depends on backport 00344363.0PR16Q2.4 closed markmm82 Tax are duplicated in voided Sales Invoices if the original include a basic discount. Total Gross Amount does not match 
caused by feature request 0028366 closed adrianromero Add new functionality to calculate taxes per product BOM 
Issue History
2016-11-04 10:48ngarciaNew Issue
2016-11-04 10:48ngarciaAssigned To => Triage Finance
2016-11-04 10:48ngarciaModules => Core
2016-11-04 10:48ngarciaResolution time => 1480028400
2016-11-04 10:48ngarciaTriggers an Emergency Pack => No
2016-11-04 10:49ngarciaNote Added: 0091166
2016-11-04 10:49ngarciaIssue Monitored: networkb
2016-11-04 12:06aferrazAssigned ToTriage Finance => markmm82
2016-11-07 17:50markmm82Statusnew => acknowledged
2016-11-08 17:09markmm82Regression level => Production - Confirmed Stable
2016-11-08 17:09markmm82Regression date => 2015-07-16
2016-11-08 17:09markmm82Regression introduced in release => 3.0PR15Q4
2016-11-08 17:09markmm82Regression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/8860b648abb2 [^]
2016-11-08 17:22markmm82Statusacknowledged => scheduled
2016-11-08 17:22markmm82Relationship addedcaused by 0028366
2016-11-08 17:24markmm82Note Added: 0091251
2016-11-09 14:38psanjuanNote Added: 0091285
2016-11-09 14:53psanjuanNote Added: 0091286
2016-11-09 14:58psanjuanNote Edited: 0091251bug_revision_view_page.php?bugnote_id=0091251#r13612
2016-11-09 15:10psanjuanNote Added: 0091287
2016-11-09 15:12psanjuanNote Edited: 0091287bug_revision_view_page.php?bugnote_id=0091287#r13614
2016-11-09 15:16psanjuanNote Edited: 0091287bug_revision_view_page.php?bugnote_id=0091287#r13615
2016-11-09 15:26psanjuanNote Added: 0091288
2016-11-09 15:26psanjuanNote Edited: 0091288bug_revision_view_page.php?bugnote_id=0091288#r13618
2016-11-09 15:29psanjuanNote Edited: 0091287bug_revision_view_page.php?bugnote_id=0091287#r13619
2016-11-09 15:34psanjuanNote Edited: 0091288bug_revision_view_page.php?bugnote_id=0091288#r13620
2016-11-09 15:43psanjuanNote Edited: 0091287bug_revision_view_page.php?bugnote_id=0091287#r13621
2016-11-09 15:45psanjuanNote Edited: 0091288bug_revision_view_page.php?bugnote_id=0091288#r13622
2016-11-11 12:54hgbotCheckin
2016-11-11 12:54hgbotNote Added: 0091391
2016-11-11 12:54hgbotStatusscheduled => resolved
2016-11-11 12:54hgbotResolutionopen => fixed
2016-11-11 12:54hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d991f91e1a2fbb16b949d63d358d8282be388f5c [^]
2016-11-11 12:55aferrazReview Assigned To => aferraz
2016-11-11 12:55aferrazNote Added: 0091393
2016-11-11 12:55aferrazStatusresolved => closed
2016-11-11 12:55aferrazFixed in Version => 3.0PR17Q1
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092610
2018-02-22 17:22hgbotCheckin
2018-02-22 17:22hgbotNote Added: 0102625

Notes
(0091166)
ngarcia   
2016-11-04 10:49   
Wrongly created data should be corrected as voided invoices cannot be reactivated
(0091251)
markmm82   
2016-11-08 17:24   
(edited on: 2016-11-09 14:58)
Test Plan 1
As group admin role:
   Create a Sales Invoice header for Alimentos y Supermercados BP.
   Add a line:
     Product: Cerveza Ale 0,5 L
     Qty: 100
     Tax: Entregas IVA 21%
     Net Unit Price: 2.04
     Line Net Amount: 204.00
   Save and go to the Tax tab, notice a new tax is created:
     Taxable Amount: 204.00
     Tax Amount: 42.84
   Go to Basic Discounts and add a 'Descuento 10%' to it
   Complete the invoice.
   Notice after complete the sales invoice header shows:
     Total Gross Amount: 226.16
     Total Net Amount: 183.60
   Void it
   Go to the generated reversed Sales invoice and notice the information in header and tabs does match the original one, including total gross amount, lines, discounts and taxes.

Test Plan 2
As group admin role:
   Create a Sales Invoice header for Alimentos y Supermercados BP.
   Add a line:
     Product: Cerveza Ale 0,5 L
     Qty: 100
     Tax: Entregas IVA 21%
     Net Unit Price: 2.04
     Line Net Amount: 204.00
   Save and go to the Tax tab, notice a new tax is created:
     Taxable Amount: 204.00
     Tax Amount: 42.84
   Add a new tax to the invoice:
     Tax: Adquisiciones IVA 8% - IVA Reducido
     Taxable Amount: 204.00
     Tax Amount: 16.32
   Go to Basic Discounts and add a 'Descuento 10%' to it
   Complete the invoice.
   Notice after complete the sales invoice header shows:
     Total Gross Amount: 238.48
     Total Net Amount: 183.60
   Void it
   Go to the generated reversed Sales invoice and notice the information in header and tabs does match the original one, including total gross amount, lines, discounts and taxes.

(0091285)
psanjuan   
2016-11-09 14:38   
Issue verified.
(0091286)
psanjuan   
2016-11-09 14:53   
Test Plan

Test Case 1

Check that original sales and purchase invoice without including any discount product but two or more product at the same tax rate or different one, once voided, voided ones are equal to the original ones.
(0091287)
psanjuan   
2016-11-09 15:10   
(edited on: 2016-11-09 15:43)
Test Case 2 - one tax rate

As group admin role:
   Create a Sales Invoice header for Alimentos y Supermercados BP.
   Add a line:
     Product: Cerveza Ale 0,5 L
     Qty: 100
     Tax: Entregas IVA 21%
     Net Unit Price: 2.04
     Line Net Amount: 204.00
   Save and go to the Tax tab, notice a new tax is created:
     Taxable Amount: 204.00
     Tax Amount: 42.84
   Go to Basic Discounts and add a 'Descuento 10%' to it
   Complete the invoice.
   Notice after complete the sales invoice header shows:
     Total Gross Amount: 226.16
     Total Net Amount: 183.60
   Void it
   Go to the generated reversed Sales invoice and notice the information in header and tabs does match the original one, including total gross amount, lines, discounts and taxes.

Repeat same test for Purchase Invoice.

Repeat same test as above including more than 1 discount.

Repeat same test as above for a AR Credit Memo

Test Case 3 - more than one tax rate.


As group admin role:
   Create a Sales Invoice header for Alimentos y Supermercados BP.
   Add a line:
     Product: Cerveza Ale 0,5 L
     Qty: 100
     Tax: Entregas IVA 21%
     Net Unit Price: 2.04
     Line Net Amount: 204.00
   Save and go to the Tax tab, notice a new tax is created:
     Taxable Amount: 204.00
     Tax Amount: 42.84

     Add a new line:
     Product: Cerveza Ale 0,5 L
     Qty: 200
     Tax: Entregas IVA 21%
     Net Unit Price: 2.04
     Line Net Amount: 408.00
Save and go to the Tax tab, notice that tax amoutn has changed to:
     Taxable Amount: 612.00
     Tax Amount: 128.52

Add a new line:
   Product: Cerveza Ale 0,5 L
     Qty: 150
     Change tax to : Entregas IVA 10%
     Net Unit Price: 2.04
     Line Net Amount: 306.00
Save and go to the Tax tab, notice that there is a new tax line:
     Taxable Amount: 306.00
     Tax Amount: 30.60

   
   Go to Basic Discounts and add a 'Descuento 10%' to it
   Complete the invoice.

   Notice after complete the sales invoice header shows:
     Total Gross Amount: 969.41
     Total Net Amount: 826.20

   Check that two discount lines have been created with below info:
     Line related to tax "Entregas IVA 21% Line Net Amount = -61.20 (10% of 612.00)
     Line related to tax "Entregas IVA 10" Line Net Amount = -30.60 (10% of 306.00)

   Void it

   Go to voided sales invoice and check below data:

    Total Gross Amount = -969.41
    Total Net Amount = -826.20
    In tax tab there are only two records

Check that two discount lines have been created with below info:
     Line related to tax "Entregas IVA 21% Line Net Amount = 61.20 (10% of 612.00)
     Line related to tax "Entregas IVA 10" Line Net Amount = 30.60 (10% of 306.00)

Repeat same test as above including more than 1 discount.

Repeat same test as above for a AR Credit Memo

Repeat same test for Purchase Invoice.

Repeat same test for Purchase Invoice including Intracommunity tax rates (summary tax rate including two children tax rates).

(0091288)
psanjuan   
2016-11-09 15:26   
(edited on: 2016-11-09 15:45)
Test Case 4 - new tax line added.

As group admin role:
   Create a Sales Invoice header for Alimentos y Supermercados BP.
   Add a line:
     Product: Cerveza Ale 0,5 L
     Qty: 100
     Tax: Entregas IVA 21%
     Net Unit Price: 2.04
     Line Net Amount: 204.00
   Save and go to the Tax tab, notice a new tax is created:
     Taxable Amount: 204.00
     Tax Amount: 42.84
   
   Add another line:
     Product: Cerveza Ale 0.5L
     Qty = 150
     Tax = Entregas IVA 10%
     Net Unit Price = 2.04
     Line Net Amount = 306.00

   Go to tax tab and check there are two lines in there, one for each tax rate.
     Create a new tax line in Tax tab. Enter below information:

     Tax = Entregas IVA 21%
     Tax Amount = 0.01
     Taxable Amount = 0.05

   Save and check Total Gross Amount = 583.45 and Total Net Amount = 510.00
   
   Go to Basic Discounts and add a 'Descuento 10%' to it
   
   Complete the invoice.

   Notice after complete the sales invoice header shows:
   Total Gross Amount = 459.00+66.11= 525.11
   Total Net Amoun = 510.00 - 20.40-30.60 = 459.00

   Void the invoice. Check below info is shown for voided invoice.
   Total Gross Amount = -525.11
   Total Net Amount = -459.00

Repeat same test including more than one discount.

Repeat same test as above for a AR Credit Memo

Repeat same test for Purchase Invoice.

(0091391)
hgbot   
2016-11-11 12:54   
Repository: erp/devel/pi
Changeset: d991f91e1a2fbb16b949d63d358d8282be388f5c
Author: Mark <markmm82 <at> gmail.com>
Date: Mon Nov 07 16:43:46 2016 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/d991f91e1a2fbb16b949d63d358d8282be388f5c [^]

Fixes issue 34392: Avoid duplicated taxes in voided Sales Invoices if discounts

When taxes of the reversed invoice are created only manual taxes are taken into
account (reacalculate flag set as Y).

---
M src-db/database/model/functions/C_INVOICE_POST.xml
---
(0091393)
aferraz   
2016-11-11 12:55   
Code review + Testing OK
(0092610)
hudsonbot   
2016-12-16 18:38   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/dc8bf00badd0 [^]
Maturity status: Test
(0102625)
hgbot   
2018-02-22 17:22   
Repository: tools/automation/int
Changeset: bab0f433ea5fa802ee7c0a296486c7f7c445932f
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Tue Sep 05 16:48:59 2017 -0400
URL: http://code.openbravo.com/tools/automation/int/rev/bab0f433ea5fa802ee7c0a296486c7f7c445932f [^]

Related to issue 34392: Added some automated test

---
M src-test/com/openbravo/test/integration/erp/gui/procurement/transactions/purchaseinvoice/PurchaseInvoiceHeaderTab.java
M src-test/com/openbravo/test/integration/erp/gui/sales/transactions/salesinvoice/SalesInvoiceHeaderTab.java
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/procurement/testsuites/PRO_Regressions/PRO_RegressionSuite.java
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/procurement/testsuites/PRO_Regressions/build.xml
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/sales/testsuites/SAL_Regressions/SAL_RegressionSuite.java
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/sales/testsuites/SAL_Regressions/build.xml
M src-test/com/openbravo/test/integration/erp/testscripts/procurement/transactions/PurchaseInvoice.java
M src-test/com/openbravo/test/integration/erp/testscripts/sales/transactions/SalesInvoice.java
A src-test/com/openbravo/test/integration/erp/gui/procurement/transactions/purchaseinvoice/BasicDiscountsTab.java
A src-test/com/openbravo/test/integration/erp/gui/procurement/transactions/purchaseinvoice/TaxTab.java
A src-test/com/openbravo/test/integration/erp/gui/sales/transactions/salesinvoice/BasicDiscountsTab.java
A src-test/com/openbravo/test/integration/erp/gui/sales/transactions/salesinvoice/TaxTab.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/procurement/testsuites/PRO_Regressions/PRORegression34392Out.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/sales/testsuites/SAL_Regressions/SALRegression34392In.java
---