Openbravo Issue Tracking System - Openbravo ERP | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0046770 | Openbravo ERP | 03. Procurement management | public | 2021-05-21 04:12 | 2021-06-15 11:41 |
Reporter | lbressan | ||||
Assigned To | markmm82 | ||||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | 5 | OS Version | ||
Product Version | |||||
Target Version | Fixed in Version | PR21Q3 | |||
Merge Request Status | approved | ||||
Review Assigned To | |||||
OBNetwork customer | Gold | ||||
Web browser | |||||
Modules | Core | ||||
Support ticket | |||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0046770: Bad tax calculated in Purchase Order lines with multi-country business partner | ||||
Description | When using a multi-country Business Partner in a purchase order, the taxes of the lines are not selected correctly, regardless of the Tax Location. The problem is caused by the BillTo_ID field, which is not visible in the purchase order, but which takes the value of the first of the addresses. org.openbravo.erpCommon.ad_callouts.SE_Order_BPartner ... // Bill to if (strLocation != null && !strLocation.isEmpty()) { info.addResult("inpbilltoId", strLocation); } ... This field is not present in the purchase order, so it cannot be changed even if the Partner Address field is changed to another country. This field is then used for the calculation in the C_GetTax Database function. org.openbravo.erpCommon.ad_callouts.SL_Order_Product ... try { String strCTaxID = Tax.get(this, strMProductID, data[0].dateordered, strADOrgID, strMWarehouseID, (StringUtils.isEmpty(data[0].billtoId) ? strCBPartnerLocationID : data[0].billtoId), strCBPartnerLocationID, data[0].cProjectId, StringUtils.equals(strIsSOTrx, "Y"), StringUtils.equals(data[0].iscashvat, "Y")); info.addResult("inpcTaxId", strCTaxID); } ... org.openbravo.erpCommon.ad_callouts SL_Order_Tax_data.xsql ... <SqlMethod name="select" type="preparedStatement" return="multiple"> <SqlMethodComment></SqlMethodComment> <Sql> <![CDATA[ SELECT C_Order.BillTo_ID, C_Order.DateOrdered, C_Order.C_Project_ID, C_Order.IsCashVat FROM C_Order WHERE C_Order_ID = ? ]]> </Sql> ... org.openbravo.erpCommon.businessUtility Tax_data.xsql ... <SqlMethod name="taxGet" type="preparedStatement" return="String" default=""> <SqlMethodComment></SqlMethodComment> <Sql><![CDATA[ SELECT C_GetTax(?, TO_DATE(?), ?, ?, ?, ?, ?, ?, ?, ?) AS TAX FROM DUAL ]]></Sql> ... | ||||
Steps To Reproduce | 1. Enter the Back Office to any Client-Organization (Example: The White Valley Group-Category Tree Store) 2. Choose a Business Partner and add an address from a country different from the other countries of the other Locations that it has. (Example: Mountains & Snow S.L has addresses from Spain, add an address from France, with all empty fields except the country) 3. Create a new Tax Category. 4. Create new Tax Rates for this Tax Category between the country of all the Business Partner Locations and the country of the Organization (In this example: Category Tree Store is from Spain, add Tax Rates Spain-Spain, Spain -France and France-Spain). 5. Assign that Tax Category to a Product (Example: Alpine ski boot). 6. Create a Purchase Order with the chosen Organization. 7. Add the chosen Business Partner. (It should load by default the new Location created) 8. Change Partner Location. 9. Add a line. 10. Select the chosen product. 11. Check which Tax is charged on the line. 12. Delete the line. 13. Change Partner Location. 14. Repeat the test on the line. | ||||
Proposed Solution | 1. Use org.openbravo.erpCommon.ad_callouts.SE_Order_BPartnerLocation to update BillTo_ID to the appropriate value. 2. Correct the callout to select the correct address from the C_Order for the Purchase Orders. | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2021-05-21 04:12 | lbressan | New Issue | |||
2021-05-21 04:12 | lbressan | Assigned To | => Triage Finance | ||
2021-05-21 04:12 | lbressan | OBNetwork customer | => OBPS | ||
2021-05-21 04:12 | lbressan | Modules | => Core | ||
2021-05-21 04:12 | lbressan | Resolution time | => 1623276000 | ||
2021-05-21 04:12 | lbressan | Triggers an Emergency Pack | => No | ||
2021-05-21 11:30 | vmromanos | Assigned To | Triage Finance => markmm82 | ||
2021-05-21 21:05 | lbressan | Description Updated | bug_revision_view_page.php?rev_id=22578#r22578 | ||
2021-06-01 00:45 | lbressan | OBNetwork customer | OBPS => Gold | ||
2021-06-09 18:13 | markmm82 | Status | new => scheduled | ||
2021-06-09 22:30 | markmm82 | Note Added: 0129289 | |||
2021-06-10 01:15 | hgbot | Merge Request Status | => open | ||
2021-06-10 01:15 | hgbot | Note Added: 0129293 | |||
2021-06-10 14:32 | hgbot | Note Added: 0129349 | |||
2021-06-10 15:43 | markmm82 | Note Edited: 0129289 | bug_revision_view_page.php?bugnote_id=0129289#r22710 | ||
2021-06-10 18:02 | hgbot | Note Added: 0129364 | |||
2021-06-11 00:04 | hgbot | Note Added: 0129371 | |||
2021-06-11 00:14 | hgbot | Note Added: 0129372 | |||
2021-06-11 14:25 | hgbot | Note Added: 0129413 | |||
2021-06-11 23:01 | hgbot | Note Added: 0129422 | |||
2021-06-15 09:43 | hgbot | Merge Request Status | open => approved | ||
2021-06-15 11:41 | hgbot | Resolution | open => fixed | ||
2021-06-15 11:41 | hgbot | Status | scheduled => closed | ||
2021-06-15 11:41 | hgbot | Fixed in Version | => PR21Q3 | ||
2021-06-15 11:41 | hgbot | Note Added: 0129510 | |||
2021-06-15 11:41 | hgbot | Note Added: 0129511 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|