Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0048737
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSmajorhave not tried2022-03-08 10:502022-06-14 17:47
ReporteraferrazView Statuspublic 
Assigned Toaferraz 
PrioritynormalResolutionfixedFixed in VersionRR22Q2
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0048737: Performance problem in Tax Engine having tax rules with many tax zones

DescriptionThe 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 ReproduceAdd a product to a ticket in POS and check tax engine performance.
Proposed SolutionFilter tax rules by country and region using taxZones property instead of creating a new rule for each tax zone.
TagsNo tags attached.
Attached Filesdiff file icon 20Q3.diff [^] (14,246 bytes) 2022-06-14 17:47 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0045303 closedaferraz Retail Modules Performance of the tax engine can be improved 
related to defect 0048762 closedgorka_gil Retail Modules Many unneded tax rules are loaded in WebPOS making tax engine very slow 
related to defect 0047419 closedigor_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 0051712pi newTriage Omni OMS Retail Modules Tax application error in POS 

-  Notes
(0135547)
hgbot (developer)
2022-03-08 11:37

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/739 [^]
(0135653)
hgbot (developer)
2022-03-11 11:04

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/739 [^]
(0135654)
hgbot (developer)
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
---
(0135655)
aferraz (manager)
2022-03-11 11:17

MR for TAP: https://gitlab.com/obcustomers/AGAP/org.openbravo.retail.posterminal/-/merge_requests/26 [^]

- 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


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker