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

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Retail Modules] Discounts and Promotionsmajoralways2020-01-15 10:442020-02-17 12:51
Reportersanti_lozanoView Statuspublic 
Assigned Tomarkmm82 
PriorityhighResolutionfixedFixed in VersionRR19Q4.2
StatusclosedFix in branchFixed in SCM revision9edebd4b3dbf
ProjectionnoneETAnoneTarget VersionRR19Q4.2
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toguilleaer
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0042912: Promotions or discounts for a concrete characteristic are not being applied well

DescriptionAfter adding a discount for a concrete characteristic on back office, on web POS adding products to the ticket with that characteristic results in the discount only being applied when next product is added to the ticket (see images attached)
Steps To Reproduce* go to Openbravo livebuilds section Retail with module (pgsql link for back office, webpos for web POS)
* Go to back office, change role to The White Valley Group Admin
* create a new discount / promotion on window Discounts and Promotions. Organization = *, Discount/Promotion Type = Fixed Percentage Discount, Name = whatever test, Printed Name = whatever test, Starting Date = “today”, Priority = 10, Included Characteristics = Only those defined, Discount % = 10. On tab Characteristics create a new record: Active = Yes, Characteristic = Capacity, Characteristic Value = Under 2L.
* go to Web POS, search for products, select Capacity, on the popup select Under 2L, add the first one to the ticket
* the discount has not been applied
* add the second one to the ticket
* the discount is now applied to the product we added before only
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0042883 closedmarkmm82 Promotions or discounts for a concrete characteristic are not being applied well 

-  Notes
hgbot (developer)
2020-01-28 19:51

Repository: retail/backports/3.0RR19Q4.2/org.openbravo.retail.posterminal
Changeset: 9edebd4b3dbf309fdac90fad4a7a9049852469c2
Author: Mark Molina <mark.molina <at>>
Date: Tue Jan 28 10:41:46 2020 -0300
URL: [^]

Fixed issue 42912: Correctly applied promotions to product with characteristics

Promotions or discounts for a concrete characteristic was not being applied well
because the first time the product was added to the ticket, a new line was created
and finally as the last step, the product characteristics was updated to the line.
The discount engine was verifying if was possible to apply the discount for products
with characteristics defined in the rule, but it was happening before the product
characteristic list of the product was updated in model, so the rule was been marked
as not possible to apply to the new created line.

To fix this issue, was updated the product model to be added into the ticket, with
all it characteristics before adding the product to the line, and execute the discount
This fix updates the productCharacteristics attribute of the product model before
the line is created, instead of update the line itself after the line was created
and discounts validations fired.

As the product characteristics are updated previously to create the line (before
the OBPOS_PreAddProductToOrder hook is executed), it is not needed to do this when
the OBPOS_PostAddProductToOrder hook is executed, so the execution at this point of
the code was removed.

M web/org.openbravo.retail.posterminal/js/model/order.js

- Issue History
Date Modified Username Field Change
2020-01-16 15:36 marvintm Type defect => backport
2020-01-16 15:36 marvintm Target Version => RR19Q4.2
2020-01-28 19:51 hgbot Checkin
2020-01-28 19:51 hgbot Note Added: 0117307
2020-01-28 19:51 hgbot Status scheduled => resolved
2020-01-28 19:51 hgbot Resolution open => fixed
2020-01-28 19:51 hgbot Fixed in SCM revision => [^]
2020-02-17 12:51 guilleaer Review Assigned To => guilleaer
2020-02-17 12:51 guilleaer Status resolved => closed
2020-02-17 12:51 guilleaer Fixed in Version => RR19Q4.2

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker