Openbravo Issue Tracking System - POS2
View Issue Details
0052105POS2POSpublic2023-04-12 11:242023-08-14 08:13
jorgewederago 
jorgewederago 
highmajoralways
scheduledopen 
5
 
 
No
0052105: When customizing a discount name, the name is not retrieved properly when loading form the backend
If there is a flow that is capable of changing the name of a discount defined in OB backoffice. Whenever that ticket is loaded, the name of the base discount is loaded instead of the customized one.
1.- Open POS2
2.- Add a line and add a line discount. Eg:disc_fixed_5_euro
3.- Open developer tools and write the following line to alter the name of the discount
OB.App.State.getState().Ticket.discountsFromUser.manualPromotions[0].name= 'test_discount'
4.- Open line discounts again add another discount and press apply
5.- Open line discounts and remove the just added discount
6.- The current ticket should only have the name-edited discount (the previous steps were needed to update all the discount info)
7.- Finish the ticket
8.- Load the ticket from the backend
9.- See that the name is the one of the base discount
In older versions there was a column called EM_Obdisc_Identifier where the customized name was saved and then recovered whenever was needed.

The way to fill that in older versions was to do something similar to this:
  OB.Model.Discounts.discountRules[
    '7B49D8CC4E084A75B7CB4D85A6A3A578'
  ].getIdentifier = function(rule) {
    return rule.get('name');
  };

However, in newer versions this is no longer possible. Some of them have the method implemented by default but not all them causing this malfunctions.
No tags attached.
? Reassignment-Note (160) 2023-07-04 14:58
https://issues.openbravo.com/file_download.php?file_id=18722&type=bug
Issue History
2023-04-12 11:24jorgewederagoNew Issue
2023-04-12 11:24jorgewederagoAssigned To => Retail
2023-04-12 11:24jorgewederagoTriggers an Emergency Pack => No
2023-07-01 11:00sreehariAssigned ToRetail => sreehari
2023-07-03 07:12sreehariStatusnew => scheduled
2023-07-04 14:58sreehariFile Added: Reassignment-Note
2023-07-04 14:58sreehariAssigned Tosreehari => jorgewederago

There are no notes attached to this issue.