Openbravo Issue Tracking System - Retail Modules
View Issue Details
0029707Retail ModulesDiscounts and Promotionspublic2015-04-27 16:022015-04-27 16:02
plujan 
Retail 
normalminoralways
newopen 
5
main 
 
No
0029707: [Coupons] Generating more codes than upper limit of code combinations blocks the system
Generation of codes has an upper limit considering the type (numeric, letters or mixed) and the number of digits/letters. However, I can request more coupons. This upper limit is not checked and the system does not finish processing because of this. See steps.
1. On a system having Coupons and Code Generator modules installed, login as White Valle admin.
2. Go to Discounts and Promotions window
3. Click on Generate Code button
4. On the pop up, select "Only numbers", code length 1, number of codes 11

Since there are only 10 possibilities for one digit code, the eleventh code is never found and the system does not detect that it is in an infinite loop.
One option is to verify the possibilities before trying to calculate them, throwing an error if there are less than the desired number of coupons.

However, already generated coupons should be also taken into accounts. Lets say I've generated 6 coupons using one digit code, if I execute the process again, 6 coupons seems fine, but since I've already created 6, it will not finish neither.

Also, if I create 30 letters&numbers some numbers will be used so the number of available numbers is unknown.
No tags attached.
Issue History
2015-04-27 16:02plujanNew Issue
2015-04-27 16:02plujanAssigned To => Retail
2015-04-27 16:02plujanTriggers an Emergency Pack => No

There are no notes attached to this issue.