Openbravo Issue Tracking System - Retail Modules
View Issue Details
0045203Retail ModulesLoyalty Programs for Web POSpublic2020-10-07 12:142020-10-15 16:35
aaroncalero 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
 
RR21Q1 
marvintm
Production - Confirmed Stable
2019-05-03
https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.loyalty.programs/-/commit/c29a675e002392b0253c7cb3ea24410a95dd0cf2 [^]
No
0045203: Inconsistent memberId between subscriptions created in WebPOS and Backoffice
When a subscription is created, it's member ID is defined automatically based on a sequence linked to the Loyalty Program.

When the subscription is created from backoffice, by default the member ID is shown as tentative (between angle brackets) and is finally confirmed when saving the record. Regardless of the length of the number given by the sequence, this number is padded to 10 characters adding zeros to the left (this is done by an event handler monitoring the Save event of subscriptions.

Prior to 19q3 this worked also when creating subscriptions from WebPOS; the member ID was left blank, and then the event handler would take care of retrieving the number from the sequence and padding it accordingly.

In 19q3 the subscription saving process was refactored and some code was added to set the member ID before saving the subscription.
This code is missing the padding adjustment, so subscriptions created from WebPOS are missing the leading zeros.
In an environment with Loyalty Programs for WebPOS installed and configured:
Log in backend, go to the Subscriptions window and create a new record.
Assing a program, category, status and Business partner and verify that the member ID is shown as e.g. <0000000002>.
Save the record and verify that the member ID is confirmed as 0000000002.

Log in WebPOS
Search for a customer without loyalty subscriptions.
Open the Customer Details window for that customer.
Click on the + button on the Loyalty Program section. The Loyalty Program selector will be shown.
Select the program and click on OK. In the New Loyalty popup fill any mandatory field (by default nothing should be required) and click on Save.
Verify that the Subscription Details popup is opened and the member ID is shown as 3, without the zero-padding.
The SaveSubscriptionManager.java file should add the padding to the member ID when it is assigned, here[1]
A left padding example can be seen in the base org.openbravo.loyalty.programs module, in the SubscriptionEventHandler.java.

[1] https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.loyalty.programs/-/blob/master/src/org/openbravo/retail/loyalty/programs/process/SaveSubscriptionManager.java#L123 [^]
No tags attached.
Issue History
2020-10-07 12:14aaroncaleroNew Issue
2020-10-07 12:14aaroncaleroAssigned To => Retail
2020-10-07 12:14aaroncaleroResolution time => 1603839600
2020-10-07 12:14aaroncaleroRegression level => Production - Confirmed Stable
2020-10-07 12:14aaroncaleroRegression date => 2019-05-03
2020-10-07 12:14aaroncaleroRegression introduced by commit => https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.loyalty.programs/-/commit/c29a675e002392b0253c7cb3ea24410a95dd0cf2 [^]
2020-10-07 12:14aaroncaleroTriggers an Emergency Pack => No
2020-10-14 08:27ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2020-10-14 13:14ranjith_qualiantech_comStatusnew => scheduled
2020-10-15 05:23hgbotNote Added: 0123688
2020-10-15 16:33hgbotNote Added: 0123717
2020-10-15 16:34marvintmStatusscheduled => resolved
2020-10-15 16:34marvintmFixed in Version => RR21Q1
2020-10-15 16:34marvintmResolutionopen => fixed
2020-10-15 16:35marvintmReview Assigned To => marvintm
2020-10-15 16:35marvintmStatusresolved => closed

Notes
(0123688)
hgbot   
2020-10-15 05:23   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.loyalty.programs/-/merge_requests/9 [^]
(0123717)
hgbot   
2020-10-15 16:33   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.loyalty.programs/-/merge_requests/9 [^]