Openbravo Issue Tracking System - Openbravo Localizations
View Issue Details
0047862Openbravo LocalizationsLocalization Portugalpublic2021-10-15 13:532021-10-27 09:41
joniturralde93 
aferraz 
urgentmajoralways
closedfixed 
5
 
 
0047862: SAF-T: Cross store return with different taxes
When a cross store return is tried and the two stores have different taxes, now, the original tax is imported. However, the SAF-T code implies that any tax will be in local database, which is not the case this time, and this leads to javascript errors.
To configure:
- New tax category
- Two new tax rates for this tax category with different rates (select for Spain and the configuration needed so it's loaded in the Web POS)
- Set that tax category in a product (for example 'Ceiling Lamp')
- Go to Organization Vall Blanca store and select cross store as 'White Valley Spain S.A'
- Do the same for Category Tree Store (and activate it if necessary)
- Add the modified product to both the price lists and assortments

- Log into Web POS (VBS-1) and buy the product (make sure the applied rate is correct)
- Log into CTST1 and go to Verified returns and search the completed order
- Return the line

- When trying to pay (click total), there is a SAFT error in this part (function addInformationToTaxRates):


 OB.Dal.queryUsingCache(OB.Model.TaxRate, criteria, [taxId], function(records) {
                    var regionId = records.at(0).get('region');



As the searched tax is from another store and is not in the local database.

This is reproducible in a customer's environment if needed.
Support cross store operations with different taxes
No tags attached.
depends on defect 0047538 closed prakashmurugesan88 Retail Modules Returning a line in another terminal with different taxes makes the return tax inconsistent 
depends on feature request 0041646RR19Q4 closed aferraz Retail Modules Add new hook to PaidReceipts.java 
diff 41646_19Q3.diff (2,478) 2021-10-19 09:41
https://issues.openbravo.com/file_download.php?file_id=16275&type=bug
Issue History
2021-10-15 13:53joniturralde93New Issue
2021-10-15 13:53joniturralde93Assigned To => Triage Finance
2021-10-15 13:53joniturralde93Modules => Core
2021-10-15 13:53joniturralde93Triggers an Emergency Pack => No
2021-10-18 17:22aferrazRelationship addedrelated to 0047538
2021-10-19 09:15aferrazAssigned ToTriage Finance => aferraz
2021-10-19 09:40aferrazRelationship addeddepends on 0041646
2021-10-19 09:41aferrazFile Added: 41646_19Q3.diff
2021-10-19 12:54aferrazRelationship replaceddepends on 0047538
2021-10-19 13:23hgbotNote Added: 0132447
2021-10-19 13:27hgbotNote Added: 0132448
2021-10-19 13:28hgbotNote Added: 0132449
2021-10-20 19:03aferrazStatusnew => scheduled
2021-10-20 19:04aferrazProjectOpenbravo ERP => Modules
2021-10-20 19:04aferrazProjectModules => Openbravo Localizations
2021-10-20 19:04aferrazCategory02. Master data management => Localization Portugal
2021-10-27 09:38hgbotNote Added: 0132662
2021-10-27 09:38hgbotResolutionopen => fixed
2021-10-27 09:38hgbotStatusscheduled => closed
2021-10-27 09:38hgbotNote Added: 0132663
2021-10-27 09:38hgbotNote Added: 0132664
2021-10-27 09:40hgbotNote Added: 0132665
2021-10-27 09:40hgbotNote Added: 0132666
2021-10-27 09:40hgbotNote Added: 0132667
2021-10-27 09:41hgbotNote Added: 0132668
2021-10-27 09:41hgbotNote Added: 0132669

Notes
(0132447)
hgbot   
2021-10-19 13:23   
Merge Request created: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail/-/merge_requests/26 [^]
(0132448)
hgbot   
2021-10-19 13:27   
Merge Request created: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail/-/merge_requests/27 [^]
(0132449)
hgbot   
2021-10-19 13:28   
Merge Request created: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail/-/merge_requests/28 [^]
(0132662)
hgbot   
2021-10-27 09:38   
Repository: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail [^]
Changeset: ab1b18eee277cb4a1c50cf5872d89ef389b5d129
Author: Álvaro Ferraz <alvaro.ferraz@openbravo.com>
Date: 2021-10-27T09:37:39+02:00
URL: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail/-/commit/ab1b18eee277cb4a1c50cf5872d89ef389b5d129 [^]

Related to ISSUE-47862: Modify ticketTaxes inside manageTaxRates function

In 20Q3 upgrade, manageTaxRates function was broken.
This function is intended to add region, taxCode and taxExemption to the already calculated ticket taxes.
Instead of this, it was adding the information to the taxRate queried from the database. Then, ticket taxes remain without this information.

---
M web/com.practicsbs.saftpt.retail/js/utils.js
---
(0132663)
hgbot   
2021-10-27 09:38   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail [^]
Changeset: c5d1a90a4063386bb64c91f288617fca06eedd48
Author: Álvaro Ferraz <alvaro.ferraz@openbravo.com>
Date: 2021-10-27T09:37:39+02:00
URL: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail/-/commit/c5d1a90a4063386bb64c91f288617fca06eedd48 [^]

Fixes ISSUE-47862: Allow cross store return with different tax

When doing a return in store B of a sale done in store A, we need to load the taxes of the sale in A into the return in B (0047538).
Thus, we avoid problems if both stores manage different taxes and A taxes are not present in a B terminal. Also, we make sure to have the same taxes in the return than in the original sale.
As saft module needs extra tax information, we also need to add it to the original sale to be taken just in case it is not present in local database.

---
A src/com/practicsbs/saftpt/retail/hook/SaftrPaidReceiptsHook.java
M web/com.practicsbs.saftpt.retail/js/utils.js
---
(0132664)
hgbot   
2021-10-27 09:38   
Merge request merged: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail/-/merge_requests/26 [^]
(0132665)
hgbot   
2021-10-27 09:40   
Repository: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail [^]
Changeset: c8c87958dc1e039b358f194d75e33fedadd39503
Author: Álvaro Ferraz <alvaro.ferraz@openbravo.com>
Date: 2021-10-27T09:39:38+02:00
URL: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail/-/commit/c8c87958dc1e039b358f194d75e33fedadd39503 [^]

Related to ISSUE-47862: Modify ticketTaxes inside manageTaxRates function

In 20Q3 upgrade, manageTaxRates function was broken.
This function is intended to add region, taxCode and taxExemption to the already calculated ticket taxes.
Instead of this, it was adding the information to the taxRate queried from the database. Then, ticket taxes remain without this information.

---
M web/com.practicsbs.saftpt.retail/js/utils.js
---
(0132666)
hgbot   
2021-10-27 09:40   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail [^]
Changeset: 043eb349161ee170954c818f15f436281b8c0971
Author: Álvaro Ferraz <alvaro.ferraz@openbravo.com>
Date: 2021-10-27T09:39:38+02:00
URL: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail/-/commit/043eb349161ee170954c818f15f436281b8c0971 [^]

Fixes ISSUE-47862: Allow cross store return with different tax

When doing a return in store B of a sale done in store A, we need to load the taxes of the sale in A into the return in B (0047538).
Thus, we avoid problems if both stores manage different taxes and A taxes are not present in a B terminal. Also, we make sure to have the same taxes in the return than in the original sale.
As saft module needs extra tax information, we also need to add it to the original sale to be taken just in case it is not present in local database.

---
A src/com/practicsbs/saftpt/retail/hook/SaftrPaidReceiptsHook.java
M web/com.practicsbs.saftpt.retail/js/utils.js
---
(0132667)
hgbot   
2021-10-27 09:40   
Merge request merged: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail/-/merge_requests/27 [^]
(0132668)
hgbot   
2021-10-27 09:41   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail [^]
Changeset: 92e7af7730b4718721094b828fbd1295e0d15117
Author: Álvaro Ferraz <alvaro.ferraz@openbravo.com>
Date: 2021-10-27T09:40:51+02:00
URL: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail/-/commit/92e7af7730b4718721094b828fbd1295e0d15117 [^]

Fixes ISSUE-47862: Allow cross store return with different tax

When doing a return in store B of a sale done in store A, we need to load the taxes of the sale in A into the return in B (0047538).
Thus, we avoid problems if both stores manage different taxes and A taxes are not present in a B terminal. Also, we make sure to have the same taxes in the return than in the original sale.
As saft module needs extra tax information, we also need to add it to the original sale to be taken just in case it is not present in local database.

---
A src/com/practicsbs/saftpt/retail/hook/SaftrPaidReceiptsHook.java
M web/com.practicsbs.saftpt.retail/js/utils.js
---
(0132669)
hgbot   
2021-10-27 09:41   
Merge request merged: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail/-/merge_requests/28 [^]