Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032428Openbravo ERP07. Sales managementpublic2016-03-07 16:562018-02-22 17:22
ngarcia 
markmm82 
immediatemajoralways
closedfixed 
5
 
3.0PR16Q2 
aferraz
Core
Production - Confirmed Stable
2015-07-16
3.0PR15Q4
https://code.openbravo.com/erp/devel/pi/rev/8860b648abb2 [^]
No
0032428: Wrong Tax Amount and Total Gross Amount in orders created by the Copy Record process if price list includes taxes
Wrong Tax Amount and Total Gross Amount in orders created by the Copy Record process if price list includes taxes
As group admin role:
   Create a Sales Price List
   Set it as Price Includes Tax
   Add a version and a product to it
   Create a Sales Order with that price list and product and book it
   Click on the Copy record button of the toolbar and check the Total Gross Amount field of the status bar is wrong
   The tax amount of the tax tab is also wrong
   Book it and check the values do not change
   Repeat the process in the purchase flow and check the problem is also reproducible
No tags attached.
depends on backport 00324373.0PR16Q1 closed markmm82 Openbravo ERP Wrong Tax Amount and Total Gross Amount in orders created by the Copy Record process if price list includes taxes 
depends on backport 00324383.0PR15Q4.5 closed markmm82 Openbravo ERP Wrong Tax Amount and Total Gross Amount in orders created by the Copy Record process if price list includes taxes 
caused by feature request 0028366 closed adrianromero Openbravo ERP Add new functionality to calculate taxes per product BOM 
related to defect 0032472 closed markmm82 Modules Purchase Invoices with Total Gross Amount of 0 created from Procurement Contract Billing Process 
related to defect 0032844 closed markmm82 Modules Wrong total net and gross amounts when generating an invoice with the Mass Invoicing process 
Issue History
2016-03-07 16:56ngarciaNew Issue
2016-03-07 16:56ngarciaAssigned To => Triage Finance
2016-03-07 16:56ngarciaModules => Core
2016-03-07 16:56ngarciaResolution time => 1460325600
2016-03-07 16:56ngarciaTriggers an Emergency Pack => No
2016-03-07 16:56ngarciaIssue Monitored: networkb
2016-03-07 16:59ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=11383#r11383
2016-03-07 17:41eugeniIssue Monitored: eugeni
2016-03-08 17:49markmm82Statusnew => scheduled
2016-03-08 17:49markmm82Assigned ToTriage Finance => markmm82
2016-03-08 17:55aferrazStatusscheduled => feedback
2016-03-08 17:55aferrazStatusfeedback => new
2016-03-08 18:14aferrazRegression level => Production - Confirmed Stable
2016-03-08 18:14aferrazRegression date => 2015-07-16
2016-03-08 18:14aferrazRegression introduced in release => 3.0PR15Q4
2016-03-08 18:14aferrazRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/8860b648abb2 [^]
2016-03-08 18:17aferrazStatusnew => scheduled
2016-03-08 18:19aferrazRelationship addedcaused by 0028366
2016-03-09 17:24markmm82Note Added: 0084850
2016-03-09 17:27markmm82Note Edited: 0084850bug_revision_view_page.php?bugnote_id=0084850#r11397
2016-03-10 10:52psanjuanNote Added: 0084863
2016-03-10 10:53psanjuanNote Added: 0084864
2016-03-10 11:16psanjuanNote Edited: 0084864bug_revision_view_page.php?bugnote_id=0084864#r11401
2016-03-10 11:17psanjuanNote Edited: 0084864bug_revision_view_page.php?bugnote_id=0084864#r11402
2016-03-10 11:26psanjuanNote Edited: 0084864bug_revision_view_page.php?bugnote_id=0084864#r11403
2016-03-10 13:54psanjuanNote Edited: 0084864bug_revision_view_page.php?bugnote_id=0084864#r11404
2016-03-10 14:01psanjuanNote Edited: 0084864bug_revision_view_page.php?bugnote_id=0084864#r11405
2016-03-10 14:10psanjuanNote Edited: 0084864bug_revision_view_page.php?bugnote_id=0084864#r11406
2016-03-10 14:11psanjuanNote Edited: 0084864bug_revision_view_page.php?bugnote_id=0084864#r11407
2016-03-10 14:14psanjuanNote Edited: 0084864bug_revision_view_page.php?bugnote_id=0084864#r11408
2016-03-10 18:17hgbotCheckin
2016-03-10 18:17hgbotNote Added: 0084878
2016-03-10 18:17hgbotStatusscheduled => resolved
2016-03-10 18:17hgbotResolutionopen => fixed
2016-03-10 18:17hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b5115ab17d95d8abfb51fad53c18cff1ed1da6da [^]
2016-03-10 18:17hgbotCheckin
2016-03-10 18:17hgbotNote Added: 0084879
2016-03-10 18:19aferrazReview Assigned To => aferraz
2016-03-10 18:19aferrazNote Added: 0084880
2016-03-10 18:19aferrazStatusresolved => closed
2016-03-10 18:19aferrazFixed in Version => 3.0PR16Q2
2016-03-11 12:51psanjuanNote Edited: 0084864bug_revision_view_page.php?bugnote_id=0084864#r11414
2016-03-14 19:03eduardo_ArgalNote Added: 0084967
2016-03-15 17:27aferrazRelationship addedrelated to 0032472
2016-03-16 13:27psanjuanNote Added: 0085007
2016-03-16 13:29psanjuanNote Edited: 0085007bug_revision_view_page.php?bugnote_id=0085007#r11463
2016-03-17 10:56hudsonbotCheckin
2016-03-17 10:56hudsonbotNote Added: 0085193
2016-03-17 10:56hudsonbotCheckin
2016-03-17 10:56hudsonbotNote Added: 0085194
2016-05-04 10:04aferrazRelationship addedrelated to 0032844
2016-09-28 17:55nonofranciscoNote Added: 0090354
2018-02-22 17:22hgbotCheckin
2018-02-22 17:22hgbotNote Added: 0102613
2018-02-22 17:22hgbotCheckin
2018-02-22 17:22hgbotNote Added: 0102614

Notes
(0084850)
markmm82   
2016-03-09 17:24   
(edited on: 2016-03-09 17:27)
Test plan:
As group admin role:
   Create a Sales Price List
   Set it as Price Includes Tax
   Add a version and a product to it
   Create a Sales Order with that price list and product and book it
   Click on the Copy record button of the toolbar and check the Total Gross Amount field of the status bar are the same like the original.
   The tax amount of the tax tab is also right
   Book it and check the values do not change (everything was calculated where cloning, including taxes)
   Repeat the process in the purchase flow and check the problem is also corrected.

(0084863)
psanjuan   
2016-03-10 10:52   
Issue verified.
(0084864)
psanjuan   
2016-03-10 10:53   
(edited on: 2016-03-11 12:51)
Test Plan

Test case 1 - sales price list including taxes, without basic discounts.

Create a Sales Price List for F&B España
Set it as Price Includes Tax
Add a version and a product to it, for instance "Agua sin Gas 1L" Unit/List Price = 100.00€
Create a Sales Order for F&B España, BP= Alimentos y Supermercados. Select Sales Price list including taxes.

Go to Lines and select the product, add 1 unit. Save it.
Go to Basic Discounts and remove it.
Check that Total Gross Amount = 100, Total Net Amount = 82.64 (100/1.21). This is correct.

Go to Tax tab and check below values:
Taxable Amount = 82.64
Tax Amount = 17.36
This is correct.
Book the order. (ie. order 1000237)

Go back to the header and click on the Copy record button of the toolbar.
Check that the order has been cloned into a new one (ie. order 1000238).
Remove the discount if any.
In the new order check below data is shown:

Total Gross Amount = 100.00
Total Net Amount = 82.64
Taxable Amount = 82.64
Tax Amount = 17.36

Book the order and check that all values above remains which is correct.


Test case 2 - sales price list including taxes, with basic discounts.

Create a Sales Price List for F&B España
Set it as Price Includes Tax
Add a version and a product to it, for instance "Agua sin Gas 1L" Unit/List Price = 100.00€
Create a Sales Order for F&B España, BP= Alimentos y Supermercados. Select Sales Price list including taxes.

Go to Lines and select the product, add 1 unit. Save it.

Check that Total Gross Amount = 100, Total Net Amount = 82.64 (100/1.21). This is correct.

Go to Tax tab and check below values:
Taxable Amount = 82.64
Tax Amount = 17.36
This is correct.
Book the order. (ie. order 1000239)

Check now that the values have changed due to basic discount of 10%.

Total Gross Amount = 90.00 (100.00-10%s100.00)
Total Net Amount = 74.38 (90/1.21)
Tax Amount = 74.38
Taxable Amount = 15.62

Go back to the header and click on the Copy record button of the toolbar.
Check that the order has been cloned into a new one (ie. order 1000240).
In the new order check below data is shown:

Total Gross Amount = 90.00
Total Net Amount = 74.38
Taxable Amount = 74.38
Tax Amount = 15.62

Book the order and check that all values above remains which is correct.


Test case 3 - sales price list do not including taxes, without discount.

Create a Sales Price List for F&B España
Do not set it as Price Includes Tax
Add a version and a product to it, for instance "Agua sin Gas 1L" Unit/List Price = 100.00€
Create a Sales Order for F&B España, BP= Alimentos y Supermercados. Select Sales Price just created.

Go to Lines and select the product, add 1 unit. Save it.
Go to Basic Discounts and remove it.
Check that Total Gross Amount = 121, Total Net Amount = 100 . This is correct.

Go to Tax tab and check below values:
Taxable Amount = 100.00
Tax Amount = 21.00
This is correct.
Book the order. (ie. order 1000237)

Go back to the header and click on the Copy record button of the toolbar.
Check that the order has been cloned into a new one (ie. order 1000238).
Remove the discount if any.
In the new order check below data is shown:

Total Gross Amount = 121.00
Total Net Amount = 100.00
Taxable Amount = 100.00
Tax Amount = 21.00

Book the order and check that all values above remains which is correct.


Test case 4 - sales price list do not including taxes, with discounts.

Create a Sales Price List for F&B España
Do not set it as Price Includes Tax
Add a version and a product to it, for instance "Agua sin Gas 1L" Unit/List Price = 100.00€
Create a Sales Order for F&B España, BP= Alimentos y Supermercados. Select Sales Price list just created.

Go to Lines and select the product, add 1 unit. Save it.
Check that Total Gross Amount = 121, Total Net Amount = 100. This is correct.

Go to Tax tab and check below values:
Taxable Amount = 100.00
Tax Amount = 21.00
This is correct.
Book the order. (ie. order 1000237)

Check that the values have been updated, due to the discount 10%:
Total Gross Amount = 108.90
Total Net Amount = 90.00
Taxable Amount = 90.00
Tax Amount = 18.90

Go back to the header and click on the Copy record button of the toolbar.
Check that the order has been cloned into a new one (ie. order 1000238).
In the new order check below data is shown:

Total Gross Amount = 108.90
Total Net Amount = 90.00
Taxable Amount = 90.00
Tax Amount =18.90

Book the order and check that all values above remains which is correct.


(repeat all test cases above for purchase orders, in the case of purchase orders with discount, after copy the order we need to make sure that the discount is selected in the tab "Basic Discounts", because that info is not copied by default. see issue: 32462)

(0084878)
hgbot   
2016-03-10 18:17   
Repository: erp/devel/pi
Changeset: b5115ab17d95d8abfb51fad53c18cff1ed1da6da
Author: Mark <m.molina <at> nectus.com>
Date: Wed Mar 09 18:53:24 2016 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/b5115ab17d95d8abfb51fad53c18cff1ed1da6da [^]

Fixes issue 32428: Wrong orders created by the Copy Record process

Fixed the wrong Tax Amount and Total Gross Amount calculation in orders created by the Copy Record process
if price list includes taxes. These amounts are calculated when related triggers are fired, due that when
the order is cloned from the original order was necessary to reset calculated amounts and then triggers updates
them again when lines are added to the cloned order.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/businesslogic/CloneOrderActionHandler.java
---
(0084879)
hgbot   
2016-03-10 18:17   
Repository: erp/devel/pi
Changeset: 201577aba6ba46850f4e4d3a2eff9f6a5fa9e78e
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Mar 10 17:56:11 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/201577aba6ba46850f4e4d3a2eff9f6a5fa9e78e [^]

Related to issue 32428: Code review improvements

Use BigDecimal.ZERO instead of new BigDecimal(0).

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/businesslogic/CloneOrderActionHandler.java
---
(0084880)
aferraz   
2016-03-10 18:19   
Code review + Testing OK
(0084967)
eduardo_Argal   
2016-03-14 19:03   
Review ConvertQuotationIntoOrder and OrderGroupingProcess. This problem may be present there.
Please test to ensure this is not happening.
(0085007)
psanjuan   
2016-03-16 13:27   
(edited on: 2016-03-16 13:29)
Review of ConvertQuotatonIntoOder process

Scenario 1

Go to Sales Quotation window.
Create a new one for Alimentos y Supermercados.
Select the previously created Sales price list including taxes.
Go to lines and select "Agua sin Gas 1L".
Check that unit price changes from 100 to 82.64 as it does include a 21% VAT.
(100/1.21) = 82.64

Save it.

Check total gross Amount = 100.00
Total Net amount = 82.64
Taxable Amount = 82.64
Tax Amount = 17.36

All of that is correct.

Go to basic discount tab and remove the discount shown there, if any.
Book it.

Click on "Create Order" process button. Select Firm Quote. Press OK.

Go to the sales order just created and verify it does shown same amounts/figures as above.

Scenario 2

Go to Sales Quotation window.
Create a new one for Alimentos y Supermercados.
Select the previously created Sales price list including taxes.
Go to lines and select "Agua sin Gas 1L".
Check that unit price changes from 100 to 82.64 as it does include a 21% VAT.
(100/1.21) = 82.64

Save it.

Check total gross Amount = 100.00
Total Net amount = 82.64
Taxable Amount = 82.64
Tax Amount = 17.36

All of that is correct.

Make sure that a basic discount of 10% for instance is set in the basic discount tab.

Book it.

Check that figures above have changed as shown below:

Check total gross Amount = 90.00
Total Net amount = 74.38
Taxable Amount = 74.38
Tax Amount = 15.62

Click on "Create Order" process button. Select Firm Quote. Press OK.

Go to the sales order just created and verify it does shown same amounts/figures as above.

(0085193)
hudsonbot   
2016-03-17 10:56   
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/b22fb0500156 [^]
Maturity status: Test
(0085194)
hudsonbot   
2016-03-17 10:56   
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/b22fb0500156 [^]
Maturity status: Test
(0090354)
nonofrancisco   
2016-09-28 17:55   
Test Cases in TestLink

URL:https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-10200 [^]
URL:https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-10201 [^]
(0102613)
hgbot   
2018-02-22 17:22   
Repository: tools/automation/int
Changeset: 4f3a78e849c3344985638d23f058b56e46965936
Author: Nono Carballo <nonofce <at> gmail.com>
Date: Tue Sep 27 15:38:44 2016 -0400
URL: http://code.openbravo.com/tools/automation/int/rev/4f3a78e849c3344985638d23f058b56e46965936 [^]

Related to issue 32428: Added some automated tests

---
M src-test/com/openbravo/test/integration/erp/data/masterdata/pricing/pricelist/PriceListData.java
M src-test/com/openbravo/test/integration/erp/data/masterdata/pricing/pricelist/ProductPriceData.java
M src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/ProductPriceTab.java
M src-test/com/openbravo/test/integration/erp/gui/procurement/transactions/purchaseorder/PurchaseOrderHeaderTab.java
M src-test/com/openbravo/test/integration/erp/gui/sales/transactions/salesorder/HeaderTab.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/masterdata/pricing/pricelist/PriceList.java
M src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/ProductPriceScript.java
M src-test/com/openbravo/test/integration/erp/testscripts/procurement/transactions/PurchaseOrder.java
M src-test/com/openbravo/test/integration/erp/testscripts/sales/transactions/SalesOrder.java
A src-test/com/openbravo/test/integration/erp/gui/procurement/transactions/purchaseorder/TaxTab.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/procurement/testsuites/PRO_Regressions/PRORegression32428.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/sales/testsuites/SAL_Regressions/SALRegression32428.java
---
(0102614)
hgbot   
2018-02-22 17:22   
Repository: tools/automation/int
Changeset: 5271449cfd2bc776eb9b44858904be1f1afcbbf4
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Mon Aug 07 14:16:45 2017 -0400
URL: http://code.openbravo.com/tools/automation/int/rev/5271449cfd2bc776eb9b44858904be1f1afcbbf4 [^]

Related to issue 32428:Fix tax amount and price list name in sales flow

---
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/procurement/testsuites/PRO_Regressions/PRORegression32428.java
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/sales/testsuites/SAL_Regressions/SALRegression32428.java
---