Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0051646Openbravo ERP07. Sales managementpublic2023-02-20 12:262023-02-20 14:42
andre_montenegro 
Triage Omni OMS 
normalminoralways
closedno change required 
5
 
 
jorge-garcia
Google Chrome
Core
No
0051646: Buy X and get Y as a gift promotion results duplicated if applied to different products
If applied a discount "Buy X and get Y as a gift promotion" twice for 2 different products when "Apply to lowest Price" is checked, discounts and promotions applied to the lines is NOK in ERP.

Example:

Exists a 3x2 discount applied to Prod A and Prod B
If paid an order with 2 Prod A and 4 Prod B, discount is applied twice to the lower price (let's assume it's Prod B).
For Prod B, ERP displays 2 promotions "3x2 discount" applied, but one of them applies 0.00 discount and the other one applies the full discount.
ERP:
1. Login in the backend as Openbravo
2. Go to Discounts & Promotions window
3. Verify that promotion '3 x 2 Bottles' exists
4. If not create it:
   * Discount/Promotion Type: Buy X pay Y of different product
   * Starting Date: 01/01/2023
   * Included Products: Only those defined
   * Definition:
     - X Units: 3
     - Y Units: 2
     - Application Rule: Apply to lowest Price

  * Product Tab:
    - Create new records: Bottle 1L , Camel bak 3L

POS:
    
1. Login in POS as Vallblanca user
2. Add two products of Camel Bak 3 L
3. Add four products of Bottle 1L
4. Verify that 3x2 Bottle discount is applied to Bottle 1L.
5. Pay order with Cash or Card.

Verify ERP:
1. Go to Sales Order & select last paid order.
2. Verify Discounts and Promotions for each Line

Line 10 (Camel back 3 L)has a discount "3x2 Bottles" with 0.00 Discount per unit - OK
Line 20 (Bottle 1 L) has 2 discounts "3x2 Bottles", "Discounts and Promotions" tab:
  - Line 10 with discount 0.00 - NOK
  - Line 20 with discount per Unit 9.50 / Total Amount 19.00 - NOK
Discounts and Promotions tab for Line 20 (Bottle 1 L) should contain 2 discounts "3x2 Bottles", each one with a value of 9.50 pero Unit and Total amount.
No tags attached.
png ERP_Prod_1.png (129,495) 2023-02-20 12:26
https://issues.openbravo.com/file_download.php?file_id=18145&type=bug
png

png ERP_Prod_2.png (133,840) 2023-02-20 12:27
https://issues.openbravo.com/file_download.php?file_id=18146&type=bug
png

png POS_Ticekt.png (57,352) 2023-02-20 12:27
https://issues.openbravo.com/file_download.php?file_id=18147&type=bug
png
Issue History
2023-02-20 12:26andre_montenegroNew Issue
2023-02-20 12:26andre_montenegroAssigned To => Triage Omni OMS
2023-02-20 12:26andre_montenegroFile Added: ERP_Prod_1.png
2023-02-20 12:26andre_montenegroWeb browser => Google Chrome
2023-02-20 12:26andre_montenegroModules => Core
2023-02-20 12:26andre_montenegroTriggers an Emergency Pack => No
2023-02-20 12:27andre_montenegroFile Added: ERP_Prod_2.png
2023-02-20 12:27andre_montenegroFile Added: POS_Ticekt.png
2023-02-20 14:41jorge-garciaNote Added: 0146785
2023-02-20 14:42jorge-garciaReview Assigned To => jorge-garcia
2023-02-20 14:42jorge-garciaStatusnew => closed
2023-02-20 14:42jorge-garciaResolutionopen => no change required

Notes
(0146785)
jorge-garcia   
2023-02-20 14:41   
The problem reported is not an issue as it works as expected.

Here is the explanation:

In the case reported, the promotion "3 x 2 Bottles" could be applied twice to the ticket as all six units of the ticket participate in the promotion calculation.

"Buy X Get Y from different products" discount type consumes units from the lines for two reasons:
  * To calculate how many times the promotion is applied (in this case two times).
  * To block those units and avoid other promotions to consume them (in this case, it will block the six units from ticket lines)

The result seen in the ERP is the following:
  * From Camel Back, two units has been consumed by the promotion with 0€ amount discounted (as these two units should be paid by the customer)
  * From Bottle 1L, two units has been consumed by the promotion with 0€ amount discounted (as with these two additional units, we have four units that the customer should pay) and two other units consumed by the same promotion with 19€ amount discounted (as these two units will be free for the customer)

At the end, the user gets six units: four bottles to be paid and two bottles for free.