Openbravo Issue Tracking System - Retail Modules
View Issue Details
0032547Retail ModulesBest Deal Casepublic2016-03-29 13:122016-04-28 10:05
jorge-garcia 
jorge-garcia 
urgentmajorhave not tried
closedfixed 
5
 
RR16Q3 
marvintm
No
0032547: Best Deal Case is not getting the best case in some cases
Best Deal Case is not getting the best case in some cases
In backend define the following discounts and promotions on this window:
1- Create a new promotion and discount for Insect Repellent product and 10%
* Org: *
* Discount/Promotion type: Price adjustment
* Name: 10% Insect repellent
* Starting date: 1/03/2016
* Included product: Only those defined
* Discount %: 10
* Priority: 1
* Product tab: add the product Insect Repellent
Leave the other fields as they are by default
2. Create a new promotion and discount for Insect Repellent product and 20%
* Org: *
* Discount/Promotion type: Price adjustment
* Name: 20% Insect repellent
* Starting date: 1/03/2016
* Included product: Only those defined
* Discount %: 20
* Priority: 2
* Product tab: add the product Insect Repellent
Leave the other fields as they are by default

Go to the WebPOS and try these two cases
* Case 1:
 1) Add one products of Insect Repellent to the ticket
 2) Check the promotion of 10% is set to the line
 3) Add three units of bottle 1 L
 4) Check the promotion 3 x 2 - Bottles is added
 5) Click on pay button
 6) Check the discount of 20% for insect repellent product is not set
* Case 2:
 1) Add one product of Insect Repellent to the ticket
 2) Check the promotion of 10% is set to the line
 3) Click on pay button
 4) Check the discount of 20% for insect repellent product is set
 5) Delete the ticket.
 6) Add two products of Insect Repellent to the ticket
 7) Check the promotion of 10% is set to the line
 8) Click on pay button
 9) Check the discount of 20% for insect repellent product is not set
No tags attached.
related to defect 0032490 closed jorge-garcia [SERQA 800] A line in a receipt is deleted when working with best deal case and there are discounts for all lines in the receipt 
Issue History
2016-03-29 13:12jorge-garciaNew Issue
2016-03-29 13:12jorge-garciaAssigned To => jorge-garcia
2016-03-29 13:12jorge-garciaTriggers an Emergency Pack => No
2016-03-29 13:15jorge-garciaStatusnew => scheduled
2016-03-29 13:17jorge-garciaRelationship addedrelated to 0032490
2016-04-07 16:26hgbotCheckin
2016-04-07 16:26hgbotNote Added: 0085497
2016-04-07 16:26hgbotStatusscheduled => resolved
2016-04-07 16:26hgbotResolutionopen => fixed
2016-04-07 16:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bestdeal/rev/ec5fc187464cbc607fb17a82a6c51f85845d6bf0 [^]
2016-04-13 11:35hgbotCheckin
2016-04-13 11:35hgbotNote Added: 0085594
2016-04-13 11:35hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bestdeal/rev/ec5fc187464cbc607fb17a82a6c51f85845d6bf0 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bestdeal/rev/7596c6f76439ebb97e39d721b42a04ac0e6cf23a [^]
2016-04-13 12:59hgbotCheckin
2016-04-13 12:59hgbotNote Added: 0085605
2016-04-28 10:05marvintmReview Assigned To => marvintm
2016-04-28 10:05marvintmStatusresolved => closed
2016-04-28 10:05marvintmFixed in Version => RR16Q3

Notes
(0085497)
hgbot   
2016-04-07 16:26   
Repository: erp/pmods/org.openbravo.retail.discounts.bestdeal
Changeset: ec5fc187464cbc607fb17a82a6c51f85845d6bf0
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue Mar 29 16:56:20 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bestdeal/rev/ec5fc187464cbc607fb17a82a6c51f85845d6bf0 [^]

Fixed issue 32547: Best Deal Case is not getting the best case in some cases

Sometimes, the best deal case logic compares the new total discounted amount
with the original discounted amount (including those lines set in the
nonCandidatesLines).

The solution is to subtract the total amount discounted in the
nonCandidatesLines to the original discount amount.

---
M web/org.openbravo.retail.discounts.bestdeal/source/discounts-best-deal-case.js
---
(0085594)
hgbot   
2016-04-13 11:35   
Repository: erp/pmods/org.openbravo.retail.discounts.bestdeal
Changeset: 7596c6f76439ebb97e39d721b42a04ac0e6cf23a
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Mon Apr 11 10:27:08 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bestdeal/rev/7596c6f76439ebb97e39d721b42a04ac0e6cf23a [^]

Fixed issue 32547: Best Deal Case is not getting the best case in some cases

Sometimes, the best deal case logic compares the new total discounted amount
with the original discounted amount (including those lines set in the
nonCandidatesLines).

The solution is to subtract the total amount discounted in the
nonCandidatesLines to the original discount amount.

---
M web/org.openbravo.retail.discounts.bestdeal/source/discounts-best-deal-case.js
---
(0085605)
hgbot   
2016-04-13 12:59   
Repository: tools/automation/pi-mobile
Changeset: 2d0e3b42d8d0e3bde671432611d28733e0847423
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Wed Mar 30 13:04:44 2016 +0200
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/2d0e3b42d8d0e3bde671432611d28733e0847423 [^]

Verifies issue 32547: Best Deal Case is not getting the best case in some cases

Added tests:
* I32547_CalculateBestDealI
* I32547_CalculateBestDealII

---
A src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/discounts_bestdeal/I32547_CalculateBestDealI.java
A src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/discounts_bestdeal/I32547_CalculateBestDealII.java
---