Openbravo Issue Tracking System - Retail Modules
View Issue Details
0046878Retail ModulesDiscounts and Promotionspublic2021-05-28 08:122021-06-10 09:45
guillermogil 
rqueralta 
highmajoralways
closedfixed 
5
 
RR21Q3 
No
0046878: Undo Button does not do anything while undoing a discount that allows multiple instances
Undo Button does not do anything while undoing a discount that allows multiple instances.

The logic to find the discount is wrong as it tries to find a discount instance that does not exist
Create a User Defined Amount discount with allows multiple instances
Login on POS
Add a product
Add the following created discount
Click undo

Discount does not get deleted but undo label dissapears
Review the following logic:
                undo: function() {
                    let manualPromotions = receipt.get('discountsFromUser').manualPromotions;
                    let promotionToDelete = manualPromotions.find(manualPromotion=>{
                        return (manualPromotion.id === promotionRule.id && manualPromotion.discountinstance === promotionRule.discountinstance);
                    }
                    );
                    if (promotionToDelete) {
                        manualPromotions.splice(manualPromotions.indexOf(promotionToDelete), 1);
                    }
                    receipt.calculateReceipt();
                    receipt.set('undo', null);
                    receipt.set('multipleUndo', null);
                }
No tags attached.
Issue History
2021-05-28 08:12guillermogilNew Issue
2021-05-28 08:12guillermogilAssigned To => Retail
2021-05-28 08:12guillermogilResolution time => 1623708000
2021-05-28 08:12guillermogilTriggers an Emergency Pack => No
2021-05-28 08:19guillermogilSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=22624#r22624
2021-05-28 08:19guillermogilProposed Solution updated
2021-06-06 23:13rqueraltaAssigned ToRetail => rqueralta
2021-06-06 23:13rqueraltaStatusnew => scheduled
2021-06-09 20:23hgbotNote Added: 0129288
2021-06-10 09:45hgbotResolutionopen => fixed
2021-06-10 09:45hgbotStatusscheduled => closed
2021-06-10 09:45hgbotFixed in Version => RR21Q3
2021-06-10 09:45hgbotNote Added: 0129309
2021-06-10 09:45hgbotNote Added: 0129310

Notes
(0129288)
hgbot   
2021-06-09 20:23   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/473 [^]
(0129309)
hgbot   
2021-06-10 09:45   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 2021a5e993a75a8d6855c2a0b967dbaea7a10c0e
Author: Rafael Queralta <rafaelcuba81@gmail.com>
Date: 2021-06-10T07:45:10+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/2021a5e993a75a8d6855c2a0b967dbaea7a10c0e [^]

Fixed BUG-46878: Check if promotionrule allow multiple instances

---
M web/org.openbravo.retail.posterminal/js/model/discounts.js
---
(0129310)
hgbot   
2021-06-10 09:45   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/473 [^]