Openbravo Issue Tracking System - Retail Modules |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0048737 | Retail Modules | Web POS | public | 2022-03-08 10:50 | 2022-06-14 17:47 |
|
Reporter | aferraz | |
Assigned To | aferraz | |
Priority | normal | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | RR22Q2 | |
Merge Request Status | |
Review Assigned To | |
OBNetwork customer | |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0048737: Performance problem in Tax Engine having tax rules with many tax zones |
Description | The map of joinRuleAndZone function in OB.Taxes.filterRulesByTicket (tax-engine.js) consumes a lot of memory when having tax rules with many tax zones. |
Steps To Reproduce | Add a product to a ticket in POS and check tax engine performance. |
Proposed Solution | Filter tax rules by country and region using taxZones property instead of creating a new rule for each tax zone. |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | defect | 0045303 | | closed | aferraz | Retail Modules | Performance of the tax engine can be improved | related to | defect | 0048762 | | closed | gorka_gil | Retail Modules | Many unneded tax rules are loaded in WebPOS making tax engine very slow | related to | defect | 0047419 | | closed | igor_trebol | Openbravo Localizations | Wrong tax calculation for sales to not exempt customers from a Store located in Guadeloupe to a customer located in Guadeloupe | related to | defect | 0051712 | pi | new | Triage Omni OMS | Retail Modules | Tax application error in POS |
|
Attached Files | 20Q3.diff (14,246) 2022-06-14 17:47 https://issues.openbravo.com/file_download.php?file_id=17162&type=bug |
|
Issue History |
Date Modified | Username | Field | Change |
2022-03-08 10:50 | aferraz | New Issue | |
2022-03-08 10:50 | aferraz | Assigned To | => aferraz |
2022-03-08 10:50 | aferraz | Triggers an Emergency Pack | => No |
2022-03-08 11:37 | hgbot | Note Added: 0135547 | |
2022-03-08 13:25 | aferraz | Relationship added | related to 0045303 |
2022-03-10 13:37 | aferraz | Relationship added | related to 0048762 |
2022-03-11 11:04 | hgbot | Resolution | open => fixed |
2022-03-11 11:04 | hgbot | Status | new => closed |
2022-03-11 11:04 | hgbot | Note Added: 0135653 | |
2022-03-11 11:04 | hgbot | Fixed in Version | => RR22Q2 |
2022-03-11 11:04 | hgbot | Note Added: 0135654 | |
2022-03-11 11:17 | aferraz | Note Added: 0135655 | |
2022-05-19 15:30 | aferraz | Relationship added | related to 0047419 |
2022-06-14 17:47 | aferraz | File Added: 20Q3.diff | |
2023-02-28 13:31 | aferraz | Relationship added | related to 0051712 |
Notes |
|
(0135547)
|
hgbot
|
2022-03-08 11:37
|
|
|
|
(0135653)
|
hgbot
|
2022-03-11 11:04
|
|
|
|
(0135654)
|
hgbot
|
2022-03-11 11:04
|
|
Directly closing issue as related merge request is already approved.
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: c54d8b29e49b4042369858f5a51245e1f2c05e84
Author: Álvaro Ferraz <alvaro.ferraz@openbravo.com>
Date: 11-03-2022 10:04:54
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/c54d8b29e49b4042369858f5a51245e1f2c05e84 [^]
Fixes ISSUE-48737: Remove joinRuleAndZone and groupRuleAndZone functions from tax engine
Tax definition in OB allows to define different tax zones for each tax rate. Tax zones work as tax rate extension. That means the rule should apply if it matches the country/region defined in the tax rate (header) or in any tax zone (subtab).
In order to compute tax zones, joinRuleAndZone function was doing a map to retrieve each tax zone as a new rule, including the information from the tax rate but overriding the country/region properties. After this map, rules were filtered by country/region properties and groupRuleAndZone grouped rules by tax rate again.
The map function was consuming a lot of memory when many tax rates and tax zones were defined making tax engine very slow. This map has been replaced by two flatMaps named checkandUpdateLocation. Both functions copy the rules after filtering by country/region instead of before as it was doing joinRuleAndZone, creating a copy only for the tax rates and tax zones that match lines country/region, which reduces the memory needed.
---
M web/org.openbravo.retail.posterminal/app/model/business-logic/taxes-engine/engine/tax-engine.js
---
|
|
|
|
|