Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039676Openbravo ERP07. Sales managementpublic2018-11-22 12:332018-12-13 00:22
Leyre 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR19Q1 
Sandrahuguet
Core
No
0039676: Error when calculating the taxes in the "Copy from Orders" process
Error when calculating the taxes in the "Copy from Orders" process
1. Create a sales order from Backend:
 1.1 Role International Group Admin - F&B International Group
 1.2 Business Partner = Restaurantes Luna Llena
 1.3 Lines -> Agua sin Gas.

2. Check that the assigned Tax = "entregas IVA 21%".

3. In the Business Partner Window -> Location/Address tab -> add a line, for example, Venezuela Location.

4. Create the header of a new Sales Order with this Business Partner.
 4.1 Make sure that "Partner Address" is the old one from Spain.

5. Copy from Orders.

* Verify that the line is created with Tax = "Exportaciones (%N=>0%)"
CORRECT:
In the case that you add the line "manually",first the tax is calculated without product.
Then, when a product is added, the line is updated and the tax is calculated again.

The parameter "bill Partner location" is calculated in SL_Order_Product.java class:

StringUtils.isEmpty(data[0].billtoId) ? strCBPartnerLocationID:data[0].billtoId

Then the SQL is executed by returning a correct value.

WRONG:
In the case that you execute the "Copy from Order" process, the bill partner location is calculated in the getMaxBusinessPartnerLocationId method, in UpdateTax.java class.

It takes the maximum value of the bussiness PartnerÅ› locations.

No tags attached.
Issue History
2018-11-22 12:33LeyreNew Issue
2018-11-22 12:33LeyreAssigned To => Triage Finance
2018-11-22 12:33LeyreModules => Core
2018-11-22 12:33LeyreResolution time => 1544655600
2018-11-22 12:33LeyreTriggers an Emergency Pack => No
2018-11-22 12:36PracticsIssue Monitored: Practics
2018-11-22 13:33SandrahuguetAssigned ToTriage Finance => AtulOpenbravo
2018-12-04 09:34SandrahuguetAssigned ToAtulOpenbravo => markmm82
2018-12-04 09:34SandrahuguetStatusnew => scheduled
2018-12-04 21:32markmm82Note Added: 0108259
2018-12-12 10:20hgbotCheckin
2018-12-12 10:20hgbotNote Added: 0108540
2018-12-12 10:20hgbotStatusscheduled => resolved
2018-12-12 10:20hgbotResolutionopen => fixed
2018-12-12 10:20hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/7f011c2b82dfaa613265c4c040c1e578236f0276 [^]
2018-12-12 10:21SandrahuguetReview Assigned To => Sandrahuguet
2018-12-12 10:21SandrahuguetNote Added: 0108541
2018-12-12 10:21SandrahuguetStatusresolved => closed
2018-12-12 10:21SandrahuguetFixed in Version => 3.0PR19Q1
2018-12-13 00:22hudsonbotCheckin
2018-12-13 00:22hudsonbotNote Added: 0108559

Notes
(0108259)
markmm82   
2018-12-04 21:32   
Test Plan:
1. Create a sales order from Backend:
 1.1 Role International Group Admin - F&B International Group
 1.2 Business Partner = Restaurantes Luna Llena
 1.3 Lines -> Agua sin Gas.

2. Check that the assigned Tax = "Entregas IVA 21%".

3. In the Business Partner Window -> Location/Address tab -> add a line, for example, Venezuela Location.

4. Create the header of a new Sales Order with this Business Partner.
 4.1 Make sure that "Partner Address" is the old one from Spain.

5. Copy from Orders selecting the line of the first created order.
 Verify that the line is created with Tax = "Entregas IVA 21%", it is right.
(0108540)
hgbot   
2018-12-12 10:20   
Repository: erp/devel/pi
Changeset: 7f011c2b82dfaa613265c4c040c1e578236f0276
Author: Mark <markmm82 <at> gmail.com>
Date: Tue Dec 04 15:24:47 2018 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/7f011c2b82dfaa613265c4c040c1e578236f0276 [^]

Fixed issue 39676: Error when calculating the taxes in the "Copy from Orders"
process.

Executing the "Copy from Order" process, the bill partner location was calculated
in the UpdateTax.getMaxBusinessPartnerLocationId() method, taking the maximum value
of the bussiness Partner? locations.

Now it will use the Bill Location of the order if defined or the last partner address
in other case, similar to the flow when the line is created manually and the SL_Order_Product
callout is called.

---
M src/org/openbravo/common/actionhandler/copyfromorderprocess/UpdateTax.java
---
(0108541)
Sandrahuguet   
2018-12-12 10:21   
Code review + testing OK
(0108559)
hudsonbot   
2018-12-13 00:22   
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/a40cfd3585b5 [^]
Maturity status: Test