Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Discounts and Promotionsmajoralways2020-11-10 14:332020-11-25 07:52
ReportergsuarezView Statuspublic 
Assigned Toranjith_qualiantech_com 
PriorityhighResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSLinux 64 bitDatabasePostgreSQLJava version
OS VersionDatabase versionAnt version
Product VersionRR19Q1SCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0045405: Error applying coupon. The last line is negative.

DescriptionWhen applying a coupon for 71.49, the last line is negative.
This coupon was generated by OTF. The rule is 50% off the next purchase, that is, a sale was made for 142.98.
I attach a ZIP with two images, one of POS and the other of the backoffice.
Steps To Reproduce1. Generate a new Variable Amount Coupons promotion. Check Is OTF Coupon and Uses coupon codes. In the field Included Product Categories, select the option "Only those defined". Add Lighting & Electronics product category in Product Category tab.
2. Generate a new OTF rule with 50% of discount and associate the discount created in step 1. I used OTF_10_PER rule, but I change 10% to 50%.
3. Generate a sales for 142.98 for products that being to Ski category.
4. Check that a coupon is generated in the promotion created in step 1. The amount of the coupon will be 71.49.
5. Change the price of 8 products to:
   a) WVG/L0001 to 19.99.
   b) WVG/L0002 to 10.
   c) WVG/L0003 to 18.99.
   d) WVG/L0004 to 12.50.
   e) WVG/L0005 to 2.99.
   f) WVG/L0006 to 2.99.
   g) WVG/L0007 to 1.
   h) WVG/L0008 to 0.10.
The list price will be The White Valley Group Purchase Price List Version.
6. Refresh POS and check that the prices has been changed.
7. In the new ticket, add the products in order. First WVG/L0001, second WVG/L0002 and so.
8. For the product WVG/L0006 check that quantity are 2.
9. Apply the coupon.
10. Check that the line with price 0.10 has a discount of 0.11.
TagsNo tags attached.
Attached Fileszip file icon [^] (300,904 bytes) 2020-11-10 14:33

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
hgbot (developer)
2020-11-24 10:51

Merge Request created: [^]
hgbot (developer)
2020-11-25 07:52

Directly closing issue as related merge request is already approved.

Repository: [^]
Changeset: e47123efa5527b3208acd00e8210ba193f857533
Author: Ranjith S R <>
Date: 2020-11-24T15:15:20+05:30
URL: [^]

Fixed ISSUE-45405: Updated discount calculation by sorting lines
To avoid decimal problem, difference of accumulated discount and total discount will be applied for last line.
Sometimes discount amount will be higher than last line price which leads to negative line. To avoid this, Line should be sorted ascending by price, so last line will have higher amount, discount will be applied withput any problem

M web/
hgbot (developer)
2020-11-25 07:52

Merge request merged: [^]

- Issue History
Date Modified Username Field Change
2020-11-10 14:33 gsuarez New Issue
2020-11-10 14:33 gsuarez Assigned To => Retail
2020-11-10 14:33 gsuarez File Added:
2020-11-10 14:33 gsuarez Triggers an Emergency Pack => No
2020-11-24 03:26 ranjith_qualiantech_com Assigned To Retail => ranjith_qualiantech_com
2020-11-24 03:26 ranjith_qualiantech_com Status new => scheduled
2020-11-24 10:51 hgbot Note Added: 0124580
2020-11-25 07:52 hgbot Resolution open => fixed
2020-11-25 07:52 hgbot Status scheduled => closed
2020-11-25 07:52 hgbot Note Added: 0124606
2020-11-25 07:52 hgbot Note Added: 0124607

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker