Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0042543 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
backport | [Retail Modules] Web POS | major | have not tried | 2019-12-12 19:18 | 2019-12-30 13:40 | |||
Reporter | marvintm | View Status | public | |||||
Assigned To | ranjith_qualiantech_com | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | RR19Q4.1 | |||
Status | closed | Fix in branch | Fixed in SCM revision | c3492346409c | ||||
Projection | none | ETA | none | Target Version | RR19Q4.1 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Merge Request Status | ||||||||
Review Assigned To | guilleaer | |||||||
OBNetwork customer | No | |||||||
Support ticket | ||||||||
Regression level | Production - Confirmed Stable | |||||||
Regression date | 2019-01-16 | |||||||
Regression introduced in release | RR19Q2 | |||||||
Regression introduced by commit | https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4cd21ae4e9d2 [^] | |||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0042543: Precision problem when calculating prices for services | |||||||
Description | There is currently a problem in the precision of calculation of the prices for services using Service Price Rules functionality. The calculation is not properly applying the currency precision, which leads to wrong calculation result. | |||||||
Steps To Reproduce | - Define the POS precision of currency EURO to 0. - In the back office, configure the service "Configuration" so that it implements a Service Price Rule of percentage 10 (and is marked as "Is Price Rule based"). - Define the price of GPS nano in the pricelist to 100, and the price of the Configuration service to 3.99. - In the WebPOS, add a GPS Nano product. - You will be shown the mandatory proposed services, and you will see that the "Configuration" service has price 4. This is wrong, it should have price 13.99 (3.99+10). | |||||||
Proposed Solution | The problem is the implementation of the following function: function calculatePercentageAmount( product, amount, percentage, partialPrice, callback ) { var newprice, oldprice = partialPrice ? 0 : product.get('listPrice'); newprice = OB.DEC.add( oldprice, OB.DEC.mul(amount, OB.DEC.div(percentage, 100)) ); callback(newprice); } The division of the percentage by 100 is rounded before the result is then multiplied by the amount. This is not correct, only the final result should be rounded. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
||||||||
|
![]() |
|
(0116346) hgbot (developer) 2019-12-16 14:03 |
Repository: retail/backports/3.0RR19Q4.1/org.openbravo.retail.posterminal Changeset: c3492346409c119658f339955863709fc8d79b1e Author: Ranjith S R <ranjith <at> qualiantech.com> Date: Mon Dec 16 18:32:29 2019 +0530 URL: http://code.openbravo.com/retail/backports/3.0RR19Q4.1/org.openbravo.retail.posterminal/rev/c3492346409c119658f339955863709fc8d79b1e [^] Fixed issue 42543 : BigDecimal should be used to calculate percentage instead of DEC function * If Precision is set as 0, DEC function will return invalid value for percentage calculation --- M web/org.openbravo.retail.posterminal/js/utils/ob-utilitiesuipos.js --- |
![]() |
|||
Date Modified | Username | Field | Change |
2019-12-12 19:21 | marvintm | Type | defect => backport |
2019-12-12 19:21 | marvintm | Target Version | => RR19Q4.1 |
2019-12-16 14:03 | hgbot | Checkin | |
2019-12-16 14:03 | hgbot | Note Added: 0116346 | |
2019-12-16 14:03 | hgbot | Status | scheduled => resolved |
2019-12-16 14:03 | hgbot | Resolution | open => fixed |
2019-12-16 14:03 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/retail/backports/3.0RR19Q4.1/org.openbravo.retail.posterminal/rev/c3492346409c119658f339955863709fc8d79b1e [^] |
2019-12-30 13:40 | guilleaer | Review Assigned To | => guilleaer |
2019-12-30 13:40 | guilleaer | Status | resolved => closed |
2019-12-30 13:40 | guilleaer | Fixed in Version | => RR19Q4.1 |
Copyright © 2000 - 2009 MantisBT Group |