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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0035861
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Retail Modules] Web POSmajoralways2017-04-27 13:262017-06-21 18:35
ReporterjorgewederagoView Statuspublic 
Assigned Tojorge-garcia 
PriorityurgentResolutionfixedFixed in VersionRR17Q2.1
StatusclosedFix in branchFixed in SCM revisionaeab86c8343c
ProjectionnoneETAnoneTarget VersionRR17Q2.1
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned Tomarvintm
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0035861: When applying more than 2 discounts to the same line the information about them is generated wrongly.

DescriptionIf you apply more than 2 discounts to the same line and finish the transaction, if you go to the ERP and check the information related to them you will see that the values are not correctly generated so the information stored in the database is not correct.
Steps To Reproduce1.- In the ERP go to discounts and promotions and generate (for eg) 4 Discretionary Fixed Amount discounts.
2.- In WebPOS buy something and apply all the discounts to it.
3.- Finish the transaction
4.- Go to the ERP to the Sales order window, select the order and line and check the values in Base Gross Unit Price displayed in discounts and promotions.
Proposed SolutionThe following code seems wrong since it applies twice the discounts due accumulators.

base = line.get('price');
        _.forEach(line.get('promotions') || [], function (discount) {
          var discountAmt = discount.actualAmt || discount.amt || 0;
          discount.basePrice = base;
          discount.unitDiscount = OB.DEC.div(discountAmt, line.get('qtyToApplyDisc') || line.get('qty'));
          totalDiscount = OB.DEC.add(totalDiscount, discountAmt);
          base = OB.DEC.sub(base, totalDiscount);
        }, this);
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0035858pi closedjorge-garcia When applying more than 2 discounts to the same line the information about them is generated wrongly. 

-  Notes
(0097445)
hgbot (developer)
2017-06-16 14:22

Repository: retail/backports/3.0RR17Q2.1/org.openbravo.retail.posterminal
Changeset: aeab86c8343c74d9ad8be9d16bd542f4729479d2
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Fri Jun 16 14:03:14 2017 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR17Q2.1/org.openbravo.retail.posterminal/rev/aeab86c8343c74d9ad8be9d16bd542f4729479d2 [^]

Fixed issue 35861: When applying more than 2 discounts to the same line the
information about them is generated wrongly.

The solution is to used the discounted amount per product instead of the
discount accumulated to calculate the base price in each promotion.

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---

- Issue History
Date Modified Username Field Change
2017-04-27 13:45 marvintm Type defect => backport
2017-04-27 13:45 marvintm Target Version pi => RR17Q2.1
2017-06-16 09:33 jorge-garcia Assigned To Retail => jorge-garcia
2017-06-16 14:22 hgbot Checkin
2017-06-16 14:22 hgbot Note Added: 0097445
2017-06-16 14:22 hgbot Status scheduled => resolved
2017-06-16 14:22 hgbot Resolution open => fixed
2017-06-16 14:22 hgbot Fixed in SCM revision => http://code.openbravo.com/retail/backports/3.0RR17Q2.1/org.openbravo.retail.posterminal/rev/aeab86c8343c74d9ad8be9d16bd542f4729479d2 [^]
2017-06-21 18:35 marvintm Review Assigned To => marvintm
2017-06-21 18:35 marvintm Status resolved => closed
2017-06-21 18:35 marvintm Fixed in Version => RR17Q2.1


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker