Openbravo Issue Tracking System - Retail Modules
View Issue Details
0045649Retail ModulesDiscounts and Promotionspublic2020-12-24 11:492020-12-31 13:36
nicola_uva 
ranjith_qualiantech_com 
normalminoralways
closedfixed 
5
 
piRR21Q1 
No
0045649: Promotions are removed from paid ticket when a custom action is register on Ticket model
Promotions are removed from paid ticket when a custom action is register on Ticket model.
Below the code to register an action

(function OBRCTDTicketDematModelDefinition() {
  OB.App.StateAPI.Ticket.registerAction(
    'showTicketDematPopup',
    (ticket, payload) => {
      const newTicket = { ...ticket };
      return newTicket;
    }
  );
})();

OB.App.StateAPI.Ticket.showTicketDematPopup.addPreHook(
  (globalState, payload) => {
   let newGlobalState = { ...globalState },
   return newGlobalState;
  }
);
1)In the ERP configure a promotion with discount type "Variable Discount per Total Amount"
2) Register the action as explained in the description field
2) Login in the WEBPOS
3) Add a line to the receipt and apply to the promotions in (1)
4) Pay the ticket
5) Open the ticket paid
6) Invoke the action in the console of the browser using this code
 OB.App.State.Ticket.showTicketDematPopup()
7) the promotions is removed from the ticket
No tags attached.
Issue History
2020-12-24 11:49nicola_uvaNew Issue
2020-12-24 11:49nicola_uvaAssigned To => Retail
2020-12-24 11:49nicola_uvaResolution time => 1609801200
2020-12-24 11:49nicola_uvaTriggers an Emergency Pack => No
2020-12-24 13:06nicola_uvaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=21971#r21971
2020-12-28 06:20ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2020-12-29 06:24ranjith_qualiantech_comStatusnew => scheduled
2020-12-30 07:22hgbotNote Added: 0125155
2020-12-30 07:22hgbotNote Added: 0125156
2020-12-31 13:36hgbotResolutionopen => fixed
2020-12-31 13:36hgbotStatusscheduled => closed
2020-12-31 13:36hgbotFixed in Version => RR21Q1
2020-12-31 13:36hgbotNote Added: 0125229
2020-12-31 13:36hgbotNote Added: 0125230
2020-12-31 13:36hgbotNote Added: 0125231
2020-12-31 13:36hgbotNote Added: 0125232

Notes
(0125155)
hgbot   
2020-12-30 07:22   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/236 [^]
(0125156)
hgbot   
2020-12-30 07:22   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.bytotal/-/merge_requests/5 [^]
(0125229)
hgbot   
2020-12-31 13:36   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 4c958258d9fc043b80f1aab377be5754a2520ac8
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2020-12-31T12:36:35+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/4c958258d9fc043b80f1aab377be5754a2520ac8 [^]

Fixed ISSUE-45649: Manual promotions should be generated when opening paid receipt

---
M web/org.openbravo.retail.posterminal/js/model/order.js
M web/org.openbravo.retail.posterminal/js/utils/ticketListUtils.js
---
(0125230)
hgbot   
2020-12-31 13:36   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/236 [^]
(0125231)
hgbot   
2020-12-31 13:36   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.bytotal [^]
Changeset: b620e43dc1f74953043a13d5c3237cf886b13ba8
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2020-12-28T14:29:35+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.bytotal/-/commit/b620e43dc1f74953043a13d5c3237cf886b13ba8 [^]

Related to ISSUE-45649: Added identifier for By Total Promotions

---
M web/org.openbravo.retail.discounts.bytotal/app/model/business-logic/discounts-engine/engine/rules/manual-by-total-amount-discount.js
M web/org.openbravo.retail.discounts.bytotal/app/model/business-logic/discounts-engine/engine/rules/manual-by-total-percentage-discount.js
---
(0125232)
hgbot   
2020-12-31 13:36   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.bytotal/-/merge_requests/5 [^]