Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035699Openbravo ERP07. Sales managementpublic2017-04-05 09:562017-05-29 17:43
ngarcia 
AtulOpenbravo 
immediatemajoralways
closedfixed 
5
 
3.0PR17Q3 
aferraz
Core
Production - Confirmed Stable
2015-07-16
3.0PR15Q4
https://code.openbravo.com/erp/devel/pi/rev/8860b648abb2 [^]
No
0035699: Wrong total gross amount when reactivating an order or a invoice which includes a basic discount of 100%
Wrong total gross amount when reactivating an order or a invoice which includes a basic discount of 100%
As group admin role:
   Create a Basic Discount of 100%
   Assign it to Hoteles Buenas Noches, S.A. business partner
   Create a sales invoice to it
   Check the discount is shown in the Basic Discounts tab
   Add a product to it with a tax rate different from 0 and check the Total Net Amount and Total Gross Amounts are correct (Total Gross Amount = Total Net Amount + Tax Amount
   Complete it and check both Total Gross Amount and Total Net Amount are 0 (discount is applied)
   Reactivate it and check the Total Gross Amount is wrong, it does not include the tax amount (Total Gross Amount = Total Net Amount)
   If you now remove the discount and complete the invoice again, the total gross amount will remain wrong
No tags attached.
related to defect 0035785 closed collazoandy4 Discounts line in processed invoices not rounded in database 
depends on backport 00357153.0PR17Q2 closed AtulOpenbravo Wrong total gross amount when reactivating an order or a invoice which includes a basic discount of 100% 
depends on backport 00357163.0PR17Q1.1 closed AtulOpenbravo Wrong total gross amount when reactivating an order or a invoice which includes a basic discount of 100% 
depends on backport 00357173.0PR16Q4.4 closed AtulOpenbravo Wrong total gross amount when reactivating an order or a invoice which includes a basic discount of 100% 
caused by feature request 0028366 closed adrianromero Add new functionality to calculate taxes per product BOM 
related to defect 0037890 scheduled collazoandy4 Wrong total gross amount when reactivating an order or a invoice which includes two basic discount of 100% 
Issue History
2017-04-05 09:56ngarciaNew Issue
2017-04-05 09:56ngarciaAssigned To => Triage Finance
2017-04-05 09:56ngarciaModules => Core
2017-04-05 09:56ngarciaResolution time => 1493157600
2017-04-05 09:56ngarciaTriggers an Emergency Pack => No
2017-04-05 09:57ngarciaIssue Monitored: networkb
2017-04-05 10:06heccamIssue Monitored: heccam
2017-04-05 10:18ngarciaPriorityurgent => immediate
2017-04-05 10:18ngarciaRelationship addedcaused by 0028366
2017-04-05 10:20ngarciaSummaryWrong total gross amount when reactivating a sales invoice which includes a basic discount of 100% => Wrong total gross amount when reactivating an order or a invoice which includes a basic discount of 100%
2017-04-05 10:20ngarciaDescription Updatedbug_revision_view_page.php?rev_id=14955#r14955
2017-04-05 13:46AtulOpenbravoStatusnew => scheduled
2017-04-06 08:38AtulOpenbravoNote Added: 0095857
2017-04-06 09:53aferrazStatusscheduled => feedback
2017-04-06 09:53aferrazStatusfeedback => new
2017-04-06 11:11aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=14967#r14967
2017-04-06 11:36aferrazAssigned ToTriage Finance => AtulOpenbravo
2017-04-06 16:59AtulOpenbravoStatusnew => scheduled
2017-04-06 17:02AtulOpenbravoRegression level => Production - Confirmed Stable
2017-04-06 17:02AtulOpenbravoRegression date => 2015-07-16
2017-04-06 17:02AtulOpenbravoRegression introduced in release => 3.0PR15Q4
2017-04-06 17:02AtulOpenbravoRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/8860b648abb2 [^]
2017-04-07 12:02AtulOpenbravoNote Added: 0095903
2017-04-10 21:04hgbotCheckin
2017-04-10 21:04hgbotNote Added: 0095954
2017-04-10 21:04hgbotStatusscheduled => resolved
2017-04-10 21:04hgbotResolutionopen => fixed
2017-04-10 21:04hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/024c93615355c3e0243d18e0d7a353ce8a6acb50 [^]
2017-04-11 10:09aferrazReview Assigned To => aferraz
2017-04-11 10:09aferrazNote Added: 0095964
2017-04-11 10:09aferrazStatusresolved => closed
2017-04-11 10:09aferrazFixed in Version => 3.0PR17Q3
2017-05-02 16:59aferrazRelationship addedrelated to 0035785
2017-05-04 09:32hgbotCheckin
2017-05-04 09:32hgbotNote Added: 0096368
2017-05-29 17:43hudsonbotCheckin
2017-05-29 17:43hudsonbotNote Added: 0096883
2017-05-29 17:43hudsonbotCheckin
2017-05-29 17:43hudsonbotNote Added: 0096933
2018-02-12 16:05ngarciaRelationship addedrelated to 0037890

Notes
(0095857)
AtulOpenbravo   
2017-04-06 08:38   
Test Plan:-
- Login as Group Admin role.
- Create a Basic Discount of 100%.
- Assign it to Hoteles Buenas Noches, S.A. business partner.
- Create a sales invoice for above business partner.
- Add the discount of 100% in the Basic Discounts tab.
- Add a product to it with a tax rate different from 0 and check the Total Net Amount and Total Gross Amounts are correct. (Total Gross Amount = Total Net Amount + Tax Amount.
- Complete it and check both Total Gross Amount and Total Net Amount are 0 (as discount is applied).
- Reactivate it and check the Total Gross Amount is wrong, it does not include the tax amount (Total Gross Amount = Total Net Amount).
- Remove the discount and complete the invoice again, check that total gross amount is set properly.

Test Plan:-
- Login as Group Admin role.
- Create a Basic Discount of 100%
- Assign it to Hoteles Buenas Noches, S.A. business partner.
- Create a sales order for above business partner.
- Check that the discount of 100% is added in the Basic Discounts tab
- Add a product to it with a tax rate different from 0 and check the Total Net Amount and Total Gross Amounts are correct. (Total Gross Amount = Total Net Amount + Tax Amount.
- Complete it and check both Total Gross Amount and Total Net Amount are 0 (as discount is applied).
- Reactivate it and check the Total Gross Amount is wrong, it does not include the tax amount (Total Gross Amount = Total Net Amount).
- Remove the discount and complete the order again, check that total gross amount is set properly.
(0095903)
AtulOpenbravo   
2017-04-07 12:02   
Test Plan

- Login as Group Admin role.
- Create a Basic Discount of 100%.
- Create a Purchase Price List with price includes tax flag = Yes.
- Create a version for Purchase Price List.
- Add Product Price for product "Vino Blanco 0,75L" and Unit Price = List Price = 10.
- Create a Purchase Order for business partner "Bebidas Alegres, S.L." with pricelist "Purchase Price List".
- Add product "Vino Blanco 0,75L", Ordered Qty = 1000.
- As Price List Includes Tax, Unit Price is set as 8.26.
- Add 100% Discount in Basic Discount Tab.
- Check Gross Amount = 10000, Total Net Amount = 8264.46.
- Complete the Order.
- Check Gross Amount = 0, Total Net Amount = 0.
- Reactivate the Order.
- Check Gross Amount = 10000, Total Net Amount = 8264.46.
- Delete the Basic Discount record.
- Complete the Order again.
- Check Gross Amount = 10000, Total Net Amount = 8264.46.

Repeat same test plan for Purchase Invoice.

Test Plan

- Login as Group Admin role.
- Create a Purchase Order for business partner "La Fruta es la Vida, S.L." with pricelist "Tarifa La Fruta es la Vida".
- Add product "Zumo de Pera 0,5L", Ordered Qty = 1000, Unit Price = 0.75
- Add product "Zumo de Pera 0,5L", Ordered Qty = 1000, Unit Price = 0.75
- Add 5% Discount in Basic Discount Tab.
- Check Gross Amount = 1815, Total Net Amount = 1500.
- Complete the Order.
- Check Gross Amount = 1724.25, Total Net Amount = 1425.
- Reactivate the Order.
- Check Gross Amount = 1815, Total Net Amount = 1500.
- Delete the Basic Discount record.
- Complete the Order again.
- Check Gross Amount = 1815, Total Net Amount = 1500.

Repeat same test plan for Purchase Invoice.
(0095954)
hgbot   
2017-04-10 21:04   
Repository: erp/devel/pi
Changeset: 024c93615355c3e0243d18e0d7a353ce8a6acb50
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Fri Apr 07 00:50:19 2017 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/024c93615355c3e0243d18e0d7a353ce8a6acb50 [^]

Fixes Issue 35699:Wrong total gross amount when reactivating an order or a
invoice which includes a basic discount of 100%

In PostgreSQL instance to achieve trigger execution in order to update
c_invoicetax, c_ordertax properly before deleting discount invoice and
order lines, c_invoicelinetax and c_orderlinetax lines are deleted.

---
M src-db/database/model/functions/C_INVOICE_POST.xml
M src-db/database/model/functions/C_ORDER_POST1.xml
---
(0095964)
aferraz   
2017-04-11 10:09   
Code review + Testing OK
(0096368)
hgbot   
2017-05-04 09:32   
Repository: erp/devel/pi
Changeset: c4b090768bd10ffe61da1b04c0065764f0d65a1d
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Sun Apr 16 23:23:43 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/c4b090768bd10ffe61da1b04c0065764f0d65a1d [^]

Related to issue 35699: Add some automated tests.

Incluided support for taxes test with discount lines
Two new products, and 10% and 100% discount was added to the dataset of QA Client
Code refactoring for test taxes with discount lines
Two taxes test group with 10% and 100% discount was added

---
M referencedata/sampledata/QA_Testing/C_DISCOUNT.xml
M referencedata/sampledata/QA_Testing/M_PRODUCT.xml
M referencedata/sampledata/QA_Testing/M_PRODUCT_ACCT.xml
M src-test/src/org/openbravo/test/taxes/TaxesTest.java
M src-test/src/org/openbravo/test/taxes/data/ProductDataConstants.java
A referencedata/sampledata/QA_Testing/C_INVOICE_DISCOUNT.xml
A referencedata/sampledata/QA_Testing/C_ORDER_DISCOUNT.xml
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData185.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData186.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData187.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData188.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData189.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData190.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData191.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData192.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData193.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData194.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData195.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData196.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData197.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData198.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData199.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData200.java
---
(0096883)
hudsonbot   
2017-05-29 17:43   
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/1ee70113bdc4 [^]
Maturity status: Test
(0096933)
hudsonbot   
2017-05-29 17:43   
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/1ee70113bdc4 [^]
Maturity status: Test