Openbravo Issue Tracking System - Retail Modules
View Issue Details
0047365Retail ModulesCoupons OTFpublic2021-07-08 14:342021-07-09 15:06
migueldejuana 
migueldejuana 
normalmajoralways
closedfixed 
5
 
 
No
0047365: Coupons with higher discount than line amount, generate negative lines
Applying a Coupon, if the coupon have a higher value than the total gross of the line, we get a negative line.
In that case, we should apply the maximum amount and the line will have a 100% of discount.
- Create or modify a coupon and set the value to 500€ for example.
- Go to web POS, add the coupon to the ticket (the lines must be less than 500€)
- We will have a discount higher that the line amount and we get a negative line
- ERROR! We cannot have negative lines due to a discount applied
NOR
related to defect 0045405 closed ranjith_qualiantech_com Error applying coupon. The last line is negative. 
related to defect 0047265 closed migueldejuana Combos with higher discount than line amount, generate negative lines 
Issue History
2021-07-08 14:34migueldejuanaNew Issue
2021-07-08 14:34migueldejuanaAssigned To => migueldejuana
2021-07-08 14:34migueldejuanaTriggers an Emergency Pack => No
2021-07-08 14:34migueldejuanaRelationship addedrelated to 0045405
2021-07-08 14:35migueldejuanaRelationship addedrelated to 0047265
2021-07-09 10:15hgbotNote Added: 0130344
2021-07-09 10:36hgbotResolutionopen => fixed
2021-07-09 10:36hgbotStatusnew => closed
2021-07-09 10:36hgbotNote Added: 0130346
2021-07-09 10:36hgbotNote Added: 0130347
2021-07-09 15:06rafarodaTag Attached: NOR

Notes
(0130344)
hgbot   
2021-07-09 10:15   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf/-/merge_requests/14 [^]
(0130346)
hgbot   
2021-07-09 10:36   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf [^]
Changeset: 857f16d5ddc6747dd382a1b63c305ffa83c93351
Author: Miguel de Juana <miguel.dejuana@openbravo.com>
Date: 2021-07-08T14:41:05+02:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf/-/commit/857f16d5ddc6747dd382a1b63c305ffa83c93351 [^]

Fixed ISSUE-0047365: Coupons with higher discount than line amount, generate negative lines

- Set discount amount to line amount when discount amount is higher

---
M web/org.openbravo.retail.discounts.coupons.otf/app/model/business-logic/discounts-engine/engine/rules/variable-amount-coupons-discount.js
---
(0130347)
hgbot   
2021-07-09 10:36   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf/-/merge_requests/14 [^]