Openbravo Issue Tracking System - POS2
View Issue Details
0057525POS2POSpublic2024-12-20 17:132025-01-22 13:01
Daria_Sh 
ranjith_qualiantech_com 
normalmajoralways
closedfixed 
5
 
25Q2 
No
0057525: OTF Coupon can be created and applied with a negative or zero 'Number of Uses Limit' value
When a zero or negative value is entered as the 'Number of Uses Limit' in the OTF Rule in the Backoffice, the rule is saved, and the OTF Coupon can still be generated and applied in the POS.

Pre - configurations:
1. Go to 'Discounts and Promotions' window
2. Open 'Test Coupon' discount
3. Tick 'Uses coupon codes' and 'Is OTF Coupon' flags
4. Ensure discount is active
5. Go to 'OTF Coupons Generation Rules' window
6. Create new Rule → Fulfill the following fields:
- Applicant, Search Key, Description and Starting Date
- Active: ✔
- Issuance Time: At Paid Time
- Promotion/Discount: Test Coupon
- Number of Uses: N Uses
- Number of Uses Limit: 0|-1
7. Proceed to 'Print' tab → Fulfill the required fields
8. Launch the HW manager
1. Login to POS (livebuilds:vallblanca/openbravo)
2. Add product to the Order
3. Complete the Order (Click 'Pay', select 'Cash' and click 'Done')
4. Select 'Print' delivery option
5. Verify the printed Coupon in the HW manager
Actual Result: The Coupon is printed and saved in the BO (Discount Coupon window) with 'Number of Uses Limit' equal to 0 or -1

6. Add product to the Order
7. Scan or redeem Coupon Code
Actual Result: The coupon is applied
The validation should be set for this field preventing to save OTF rule with zero or negative value in 'Number of Uses Limit' field
No tags attached.
depends on backport 005772125Q1 closed ranjith_qualiantech_com OTF Coupon can be created and applied with a negative or zero 'Number of Uses Limit' value 
depends on backport 005772224Q4.2 closed ranjith_qualiantech_com OTF Coupon can be created and applied with a negative or zero 'Number of Uses Limit' value 
related to defect 0057526 closed ranjith_qualiantech_com Variable OTF Coupon can be created and applied with zero/negative/greater than 100% Discount value 
png Screenshot_68.png (128,014) 2024-12-20 17:13
https://issues.openbravo.com/file_download.php?file_id=20668&type=bug
png

png Screenshot_67.png (126,008) 2024-12-20 17:14
https://issues.openbravo.com/file_download.php?file_id=20669&type=bug
png
Issue History
2024-12-20 17:13Daria_ShNew Issue
2024-12-20 17:13Daria_ShAssigned To => Retail
2024-12-20 17:13Daria_ShFile Added: Screenshot_68.png
2024-12-20 17:13Daria_ShTriggers an Emergency Pack => No
2024-12-20 17:14Daria_ShFile Added: Screenshot_67.png
2024-12-20 18:00Daria_ShDescription Updatedbug_revision_view_page.php?rev_id=28953#r28953
2024-12-20 18:00Daria_ShProposed Solution updated
2024-12-20 18:00Daria_ShProposed Solution updated
2025-01-17 12:27ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2025-01-18 07:11ranjith_qualiantech_comStatusnew => scheduled
2025-01-19 23:50hgbotNote Added: 0174338
2025-01-21 13:11hgbotResolutionopen => fixed
2025-01-21 13:11hgbotStatusscheduled => closed
2025-01-21 13:11hgbotNote Added: 0174468
2025-01-21 13:11hgbotNote Added: 0174469
2025-01-22 12:54ranjith_qualiantech_comRelationship addedrelated to 0057526
2025-01-22 13:01javierRodriguezStatusclosed => new
2025-01-22 13:01javierRodriguezResolutionfixed => open
2025-01-22 13:01javierRodriguezStatusnew => scheduled
2025-01-22 13:01javierRodriguezStatusscheduled => resolved
2025-01-22 13:01javierRodriguezFixed in Version => 25Q2
2025-01-22 13:01javierRodriguezResolutionopen => fixed
2025-01-22 13:01javierRodriguezStatusresolved => closed

Notes
(0174338)
hgbot   
2025-01-19 23:50   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf/-/merge_requests/67 [^]
(0174468)
hgbot   
2025-01-21 13:11   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf [^]
Changeset: f5bed501087bf5cfc8faa4e884ab0e6cde796a08
Author: Ranjith S R <r.rangaraju@external.orisha.com>
Date: 21-01-2025 12:11:45
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf/-/commit/f5bed501087bf5cfc8faa4e884ab0e6cde796a08 [^]

Fixed ISSUE-57525: Added Event Handler to validate min value of UsesLimit and Discount

---
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/retail/discounts/coupons/otf/event/CouponrulesEventHandler.java
---
(0174469)
hgbot   
2025-01-21 13:11   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf/-/merge_requests/67 [^]