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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0057671
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[POS2] POSmajoralways2025-01-17 06:332025-02-06 14:44
ReporteraxelmercadoView Statuspublic 
Assigned Toprakashmurugesan88 
PriorityhighResolutionfixedFixed in Version25Q2
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Merge Request Status
Review Assigned To
OBNetwork customerOBPS
Support ticket110411
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0057671: Problem with “Maximum discount per role” functionality, does not work correctly.

DescriptionWe apply the changes but there is an error in the way decimals and rounding are handled, resulting in inconsistencies when validating the maximum discounts allowed. This allows the system to accept final prices that are below the calculated limits for both the Unit Price and the List Price.
Steps To ReproduceNavigate to role and configure the detailed actions and the maximum discount as below.
In the terminal, add a product and to the line, add a manual discount as below.
You can notice following Rounding issue.


Initial Context:

Product with List Price: 5.90€.
Product with Unit Price (price already reduced): 4.90€.
Observed Behavior:

The system warns that the maximum discount allowed is 16%, based on the Unit Price.

Calculated discount: 4.90€ × 0.16 = 0.784€ ≈ 0.78€ (rounding).
Expected minimum allowed price: €4.90 - €0.78 = €4.12.
However, the POS allows to apply a price of €4.11, which is below the expected limit of €4.12.

Extended Case:

If the original List Price of €5.90 is considered, a maximum discount of 30% would imply:

Minimum price allowed: €5.90 × 0.70 = €4.13.
But the system allows applying a discount that results in a final price of 4.11€, equivalent to a discount of 30.33%, exceeding the established limit.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0056718 closedprakashmurugesan88 Problem with “Maximum discount per role” functionality, does not work correctly. 
depends on backport 005767225Q1 closedprakashmurugesan88 Problem with “Maximum discount per role” functionality, does not work correctly. 

-  Notes
(0174253)
prakashmurugesan88 (viewer)
2025-01-17 06:58
edited on: 2025-01-17 07:55

Created following Merge Request
https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/3359 [^]

(0175225)
hgbot (developer)
2025-02-06 14:44

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 2adcef8831a65f041ff5410e057731a55ce181cd
Author: Prakash Murugesan <p.murugesan@external.orisha.com>
Date: 06-02-2025 13:44:07
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.pos2/-/commit/2adcef8831a65f041ff5410e057731a55ce181cd [^]

Fixes ISSUE-57671: Fixed percentage calculation rounding issue

---
M web-jspack/org.openbravo.pos2/src/model/ticket/user-actions/discounts/ApplyHigherDiscountThanAllowedForRole.js
---
(0175226)
hgbot (developer)
2025-02-06 14:44

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 3c08f173766d6c7ed8cd15d450db318affb39fb0
Author: Prakash Murugesan <p.murugesan@external.orisha.com>
Date: 06-02-2025 13:44:07
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.pos2/-/commit/3c08f173766d6c7ed8cd15d450db318affb39fb0 [^]

Related to ISSUE-57671: Fixed error message

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M web-jspack/org.openbravo.pos2/src/model/ticket/user-actions/discounts/ApplyHigherDiscountThanAllowedForRole.js
---
(0175227)
hgbot (developer)
2025-02-06 14:44

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: debf15301b82acccfdfed6ede6535b859a7419bc
Author: Prakash Murugesan <p.murugesan@external.orisha.com>
Date: 06-02-2025 13:44:07
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.pos2/-/commit/debf15301b82acccfdfed6ede6535b859a7419bc [^]

Related to ISSUE-57671: Fixed copy right

---
M web-jspack/org.openbravo.pos2/src/model/ticket/user-actions/discounts/ApplyHigherDiscountThanAllowedForRole.js
---
(0175228)
hgbot (developer)
2025-02-06 14:44

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: bbda20a8a103727e95c2f73b47b611a2d8f10a96
Author: Prakash Murugesan <p.murugesan@external.orisha.com>
Date: 06-02-2025 13:44:07
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.pos2/-/commit/bbda20a8a103727e95c2f73b47b611a2d8f10a96 [^]

Related to ISSUE-57671: Fixed jest test

---
M web-jspack/org.openbravo.pos2/src/model/ticket/user-actions/discounts/__test__/areDiscountsExceedingMaximumAllowedByRole.test.js
---

- Issue History
Date Modified Username Field Change
2025-01-17 06:33 prakashmurugesan88 New Issue
2025-01-17 06:33 prakashmurugesan88 Assigned To => prakashmurugesan88
2025-01-17 06:33 prakashmurugesan88 OBNetwork customer => No
2025-01-17 06:33 prakashmurugesan88 Triggers an Emergency Pack => No
2025-01-17 06:34 prakashmurugesan88 Relationship added related to 0056718
2025-01-17 06:36 prakashmurugesan88 Issue cloned 0057672
2025-01-17 06:40 prakashmurugesan88 Relationship added depends on 0057672
2025-01-17 06:40 prakashmurugesan88 Status new => scheduled
2025-01-17 06:58 prakashmurugesan88 Note Added: 0174253
2025-01-17 07:55 prakashmurugesan88 Note Edited: 0174253 View Revisions
2025-01-17 21:52 axelmercado OBNetwork customer No => OBPS
2025-01-17 21:52 axelmercado Support ticket => 110411
2025-01-17 21:52 axelmercado Reporter prakashmurugesan88 => axelmercado
2025-02-06 14:44 hgbot Resolution open => fixed
2025-02-06 14:44 hgbot Status scheduled => resolved
2025-02-06 14:44 hgbot Fixed in Version => 25Q2
2025-02-06 14:44 hgbot Note Added: 0175225
2025-02-06 14:44 hgbot Note Added: 0175226
2025-02-06 14:44 hgbot Note Added: 0175227
2025-02-06 14:44 hgbot Note Added: 0175228
2025-02-06 14:44 marvintm Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker