Openbravo Issue Tracking System - Retail Modules
View Issue Details
0048069Retail ModulesDiscounts by Totalpublic2021-11-16 12:002021-12-23 08:10
Theo_Delobel 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
RR20Q3 
 
No
0048069: Discount/promotion type Free Product per Total
In the WebPos, when we try to use promotion type : Free Products per Total Amount
the amount of the free product is add to the total receipt
in the window : discount and promotion

set up a promotion as following :
discount/promotion type : Free Products per Total Amount
Included BP Categories: Only those defined
Included BP Set :All excluding defined
Included Business Partners :All excluding defined
Included Product Categories :All excluding defined
Included Products :Only those defined
Include Price Lists :All excluding defined
Included Organizations :All excluding defined
Included Characteristics :All excluding defined

Total receipt :12,000.00

In the tab : Business partner category : Reseller
in the tab product : one productA
In the tab free product : another productB


If you made a sales with productA for 13,000
the free productB is proposed but if you selected it, the amount of the productB is add to the total amount of the receipt.
it seems the issue come from getApplicableLines method.

It takes only the lines with the products found in the 'Only one defined' configuration.
No tags attached.
? Discount issue Free Product per Totla Amount-2021-11-15_18.07.15.mkv (2,833,745) 2021-11-16 12:00
https://issues.openbravo.com/file_download.php?file_id=16351&type=bug
Issue History
2021-11-16 12:00Theo_DelobelNew Issue
2021-11-16 12:00Theo_DelobelAssigned To => Retail
2021-11-16 12:00Theo_DelobelFile Added: Discount issue Free Product per Totla Amount-2021-11-15_18.07.15.mkv
2021-11-16 12:00Theo_DelobelTriggers an Emergency Pack => No
2021-11-17 15:18Theo_DelobelNote Added: 0133156
2021-11-23 08:55Theo_DelobelNote Added: 0133268
2021-11-24 07:26ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2021-11-24 07:43marvintmStatusnew => scheduled
2021-11-26 06:32hgbotNote Added: 0133383
2021-11-30 08:26hgbotResolutionopen => fixed
2021-11-30 08:26hgbotStatusscheduled => closed
2021-11-30 08:26hgbotNote Added: 0133408
2021-11-30 08:26hgbotNote Added: 0133409
2021-12-17 07:45ranjith_qualiantech_comNote Added: 0133789
2021-12-17 07:45ranjith_qualiantech_comStatusclosed => new
2021-12-17 07:45ranjith_qualiantech_comResolutionfixed => open
2021-12-17 07:45ranjith_qualiantech_comStatusnew => scheduled
2021-12-22 06:56hgbotNote Added: 0133891
2021-12-23 08:10hgbotResolutionopen => fixed
2021-12-23 08:10hgbotStatusscheduled => closed
2021-12-23 08:10hgbotNote Added: 0133920
2021-12-23 08:10hgbotNote Added: 0133921

Notes
(0133156)
Theo_Delobel   
2021-11-17 15:18   
I found that will i made some research :
it goes through the discount engine
which calls the method getApplicableLines
This method returns the lines on which you can apply a promotion,

Except that it returns the ticket without the line with the free object
Then it applies a filter on these lines to remove the price of the free item
(0133268)
Theo_Delobel   
2021-11-23 08:55   
Hello,

The customer ask me for the delay of resolution for this issue
Can you tell me when it can be solve ?
(0133383)
hgbot   
2021-11-26 06:32   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.bytotal/-/merge_requests/13 [^]
(0133408)
hgbot   
2021-11-30 08:26   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.bytotal [^]
Changeset: 1b2a12ddf97ee87db292b2a7709cfc75f478f28e
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2021-11-30T07:26:27+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.bytotal/-/commit/1b2a12ddf97ee87db292b2a7709cfc75f478f28e [^]

Fixed ISSUE-48069: FreeProducts should be applied even if discount product is not configured

---
M src-test/org/openbravo/discounts/bytotal/test/unittests/DiscountByTotalFreeItemsTest.java
M web/org.openbravo.retail.discounts.bytotal/app/model/business-logic/discounts-engine/engine/rules/by-total-free-item-discount.js
---
(0133409)
hgbot   
2021-11-30 08:26   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.bytotal/-/merge_requests/13 [^]
(0133789)
ranjith_qualiantech_com   
2021-12-17 07:45   
Free product discount should be applied for the following case
Type : Free Products per Total Amount
C1 : Minimum ticket amount : 150
C2 : Product Characteristic : Brand = Makita
Free product : Screwdriver set (price 50 €) (Brand : Bosch)

If 3 Screwdriver sets, my ticket is at 150 €, adding a new Screwdriver set will create the Free product discount. But it should not
(0133891)
hgbot   
2021-12-22 06:56   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.bytotal/-/merge_requests/16 [^]
(0133920)
hgbot   
2021-12-23 08:10   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.bytotal [^]
Changeset: 7ea42b16bc90ece920c34de974fcc102d9d91572
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 20-12-2021 13:18:37
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.bytotal/-/commit/7ea42b16bc90ece920c34de974fcc102d9d91572 [^]

Fixed ISSUE-48069: FreeProduct should not be included to reach Discount TotalAmount
* For FreeItem discount, FreeProduct should not be included to calculate
  the discount total amount

---
M src-test/org/openbravo/discounts/bytotal/test/unittests/DiscountByTotalFreeItemsTest.java
M web/org.openbravo.retail.discounts.bytotal/app/model/business-logic/discounts-engine/engine/rules/by-total-free-item-discount.js
---
(0133921)
hgbot   
2021-12-23 08:10   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.bytotal/-/merge_requests/16 [^]