Openbravo Issue Tracking System - Retail Modules | |||||||||||||||||||
View Issue Details | |||||||||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||||||||
0042542 | Retail Modules | Web POS | public | 2019-12-12 19:18 | 2019-12-16 12:53 | ||||||||||||||
Reporter | marvintm | ||||||||||||||||||
Assigned To | ranjith_qualiantech_com | ||||||||||||||||||
Priority | normal | Severity | major | Reproducibility | have not tried | ||||||||||||||
Status | closed | Resolution | fixed | ||||||||||||||||
Platform | OS | 5 | OS Version | ||||||||||||||||
Product Version | |||||||||||||||||||
Target Version | Fixed in Version | RR20Q1 | |||||||||||||||||
Merge Request Status | |||||||||||||||||||
Review Assigned To | jorge-garcia | ||||||||||||||||||
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 | 0042542: 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 | - As system administrator, 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 14 (3.99+10, then rounded to 14). | ||||||||||||||||||
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, due to the usage of the OB.DEC API. This is not correct, only the final result should be rounded. | ||||||||||||||||||
Additional Information | |||||||||||||||||||
Tags | No tags attached. | ||||||||||||||||||
Relationships |
| ||||||||||||||||||
Attached Files | |||||||||||||||||||
Issue History | |||||||||||||||||||
Date Modified | Username | Field | Change | ||||||||||||||||
2019-12-12 19:18 | marvintm | New Issue | |||||||||||||||||
2019-12-12 19:18 | marvintm | Assigned To | => ranjith_qualiantech_com | ||||||||||||||||
2019-12-12 19:18 | marvintm | OBNetwork customer | => No | ||||||||||||||||
2019-12-12 19:18 | marvintm | Triggers an Emergency Pack | => No | ||||||||||||||||
2019-12-12 19:21 | marvintm | Regression level | => Production - Confirmed Stable | ||||||||||||||||
2019-12-12 19:21 | marvintm | Regression date | => 2019-01-16 | ||||||||||||||||
2019-12-12 19:21 | marvintm | Regression introduced in release | => RR19Q2 | ||||||||||||||||
2019-12-12 19:21 | marvintm | Regression introduced by commit | => https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4cd21ae4e9d2 [^] | ||||||||||||||||
2019-12-12 19:21 | marvintm | Status | new => scheduled | ||||||||||||||||
2019-12-12 19:26 | marvintm | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=19894#r19894 | ||||||||||||||||
2019-12-12 19:26 | marvintm | Proposed Solution updated | |||||||||||||||||
2019-12-16 07:41 | hgbot | Checkin | |||||||||||||||||
2019-12-16 07:41 | hgbot | Note Added: 0116322 | |||||||||||||||||
2019-12-16 07:41 | hgbot | Status | scheduled => resolved | ||||||||||||||||
2019-12-16 07:41 | hgbot | Resolution | open => fixed | ||||||||||||||||
2019-12-16 07:41 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/e61f23d9708ee8486290242e9c509a079ffe1456 [^] | ||||||||||||||||
2019-12-16 10:35 | jorge-garcia | Review Assigned To | => jorge-garcia | ||||||||||||||||
2019-12-16 10:46 | jorge-garcia | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=19906#r19906 | ||||||||||||||||
2019-12-16 12:53 | jorge-garcia | Note Added: 0116342 | |||||||||||||||||
2019-12-16 12:53 | jorge-garcia | Status | resolved => closed | ||||||||||||||||
2019-12-16 12:53 | jorge-garcia | Fixed in Version | => RR20Q1 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|