Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0014047Openbravo ERP03. Procurement managementpublic2010-07-26 16:042010-10-19 19:16
psarobe 
dalsasua 
immediatemajoralways
closedfixed 
5
2.50MP20 
2.50MP22 
Core
No
0014047: Taxes in procurement invoice not properly calculate under some circunstances
Taxes in procurement invoice are not properly calculate under the QA testing scenario.
That scenario has this org tree structure:
(*)
 |---Main
       |--- Spain
       |--- USA
Every organization has its own warehouse: Warehouse Spain and USA
In procurement invoice does not exist the warehouse so to calculate the destiny address what the application does is to take the warehouse from the session.
So if for any reason in the session the value is Warehouse USA (therefore the country address is USA) and you are creating the purchase invoice for the Org Spain and the country vendor is Spain instead of selecting the tax VAT 10%, is selecting the Exempt 10%
1. Login as QAAdmin/QAAdmin
2. Ensure that the warehouse is Warehouse USA in the user info
3. Go to procurement management->Transactions->Purchase invoice
3. Click new and select bpartner Vendor A. Ensure the organization is Spain.Save
4. Move to lines and select product Raw materials A
5. Notice that the tax is Exempt 10% when it has to be VAT 10%
1. It's ok that it takes the warehouse from the session but it has to validate that that warehouse belongs to the org tree branch of the invoice header.
2. If not then we should take a warehouse that belongs to it
No tags attached.
related to defect 00149232.50MP23 closed dalsasua If there is not warehouse defined, taxes are not properly calculated 
Issue History
2010-07-26 16:04psarobeNew Issue
2010-07-26 16:04psarobeAssigned To => dalsasua
2010-07-26 16:05psarobeStatusnew => scheduled
2010-07-26 16:05psarobefix_in_branch => pi
2010-07-26 16:07psarobefix_in_branchpi =>
2010-07-26 16:07psarobeProposed Solution updated
2010-07-26 19:41hgbotCheckin
2010-07-26 19:41hgbotNote Added: 0029569
2010-07-26 19:41hgbotStatusscheduled => resolved
2010-07-26 19:41hgbotResolutionopen => fixed
2010-07-26 19:41hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f1b53dfc9e0db9355313ca0fd3faa4f69b81bbb8 [^]
2010-07-27 15:41hudsonbotCheckin
2010-07-27 15:41hudsonbotNote Added: 0029610
2010-08-17 14:18hgbotCheckin
2010-08-17 14:18hgbotNote Added: 0030072
2010-08-17 14:18hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/f1b53dfc9e0db9355313ca0fd3faa4f69b81bbb8 [^] => http://code.openbravo.com/erp/devel/pi/rev/64da2ed5a594ee8b9671d76bf01775fe5d98c636 [^]
2010-08-18 00:39hudsonbotCheckin
2010-08-18 00:39hudsonbotNote Added: 0030089
2010-08-20 13:11psarobeSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=701#r701
2010-08-20 13:14psarobeNote Added: 0030185
2010-08-20 13:14psarobeStatusresolved => new
2010-08-20 13:14psarobeResolutionfixed => open
2010-08-20 13:15psarobeStatusnew => scheduled
2010-08-20 13:15psarobefix_in_branch => pi
2010-08-20 14:06hgbotCheckin
2010-08-20 14:06hgbotNote Added: 0030189
2010-08-20 14:06hgbotStatusscheduled => resolved
2010-08-20 14:06hgbotResolutionopen => fixed
2010-08-20 14:06hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/64da2ed5a594ee8b9671d76bf01775fe5d98c636 [^] => http://code.openbravo.com/erp/devel/pi/rev/3af16d254adc81a08637c8a1c2b77fa4015bea8e [^]
2010-08-21 00:06hudsonbotCheckin
2010-08-21 00:06hudsonbotNote Added: 0030206
2010-09-16 13:44psarobeNote Added: 0031158
2010-09-16 13:44psarobeStatusresolved => closed
2010-09-16 13:44psarobeFixed in Version => 2.50MP22
2010-09-17 00:00anonymoussf_bug_id0 => 3068045
2010-10-19 13:42dalsasuaNote Added: 0031972
2010-10-19 13:42dalsasuaStatusclosed => new
2010-10-19 13:42dalsasuaResolutionfixed => open
2010-10-19 13:42dalsasuaFixed in Version2.50MP22 =>
2010-10-19 19:15psarobeStatusnew => scheduled
2010-10-19 19:15psarobeStatusscheduled => resolved
2010-10-19 19:15psarobeResolutionopen => fixed
2010-10-19 19:15psarobeStatusresolved => closed
2010-10-19 19:16psarobeFixed in Version => 2.50MP22
2010-10-19 19:16psarobefix_in_branchpi =>
2010-10-19 19:22psarobeRelationship addedrelated to 0014923

Notes
(0029569)
hgbot   
2010-07-26 19:41   
Repository: erp/devel/pi
Changeset: f1b53dfc9e0db9355313ca0fd3faa4f69b81bbb8
Author: David Alsasua <david.alsasua <at> openbravo.com>
Date: Mon Jul 26 19:27:40 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f1b53dfc9e0db9355313ca0fd3faa4f69b81bbb8 [^]

Fixes issue 14047.
Currently, callout in invoice line uses client warehouse set in context to retrieve client location, and uses it to select the appropriate tax rate.
Now, once the warehouse is retrieved, it is checked if the organization for which this warehouse is set, is in the same branch of the organizational tree. If not, chooses another warehouse: once set for an organization in the same branch of the tree of organizations.

---
M src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Product.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Product_data.xsql
A src/org/openbravo/erpCommon/businessUtility/Organization_data.xsql
---
(0029610)
hudsonbot   
2010-07-27 15:41   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/f1b53dfc9e0d [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/634cc0909ed2 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17922.obx [^]
(0030072)
hgbot   
2010-08-17 14:18   
Repository: erp/devel/pi
Changeset: 64da2ed5a594ee8b9671d76bf01775fe5d98c636
Author: David Alsasua <david.alsasua <at> openbravo.com>
Date: Tue Aug 17 14:17:29 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/64da2ed5a594ee8b9671d76bf01775fe5d98c636 [^]

Fixes issue 14047

---
M src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Product.java
R src/org/openbravo/erpCommon/businessUtility/Organization_data.xsql
---
(0030089)
hudsonbot   
2010-08-18 00:39   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/64da2ed5a594 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/2cad794ceb55 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18177.obx [^]
(0030185)
psarobe   
2010-08-20 13:14   
Still i can reproduce. I have updated the steps a little bit so it's easier to verify whether is properly fix or not
(0030189)
hgbot   
2010-08-20 14:06   
Repository: erp/devel/pi
Changeset: 3af16d254adc81a08637c8a1c2b77fa4015bea8e
Author: David Alsasua <david.alsasua <at> openbravo.com>
Date: Fri Aug 20 14:06:10 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3af16d254adc81a08637c8a1c2b77fa4015bea8e [^]

Fixes issue 14047
Wrong logic applied with OrganizationStructureProvider usage. Now works as expected

---
M src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Product.java
---
(0030206)
hudsonbot   
2010-08-21 00:06   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/3af16d254adc [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/eedf97667060 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18194.obx [^]
(0031158)
psarobe   
2010-09-16 13:44   
Tested working fine
(0031972)
dalsasua   
2010-10-19 13:42   
It seems that, if no warehouse is defined for the client, the callout fails. Let's test it also with no warehouse defined in the client.