Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0025436Openbravo ERP07. Sales managementpublic2014-01-07 21:192017-12-11 10:15
pjuvara 
AtulOpenbravo 
normalmajoralways
scheduledopen 
5
3.0MP29.1 
3.0PR14Q2 
Google Chrome
Core
No
0025436: Buy X and get Y as a gift promotion results in negative invoice if order quantity is less than Y
Consider a case where if customers buy 10 units of product A they are entitled to up to 10 units of product B for free. This is supported with the "Buy X and get Y as a gift" promotion type delivered in the Discounts and Promotions for Retail module.

If you create an invoice with one line for 10 units of A and a line with 15 units of B, the unit price of B is correctly adjusted down to reflect that only 5 units have a non zero price.

However if you create an invoice with one line for 10 units of A and a line with 5 units of B, you get a negative price for B.

The expectation is that the price for the lines for B is 0.
See attached screenshots that reproduce:
A) the promotion
B) an invoice with the right discount applied
C) an invoice with the incorrect discount applied
No tags attached.
png A-Promotion.png (97,901) 2014-01-07 21:20
https://issues.openbravo.com/file_download.php?file_id=6606&type=bug
png

png B-CorrectInvoice.png (119,498) 2014-01-07 21:24
https://issues.openbravo.com/file_download.php?file_id=6607&type=bug
png

png C-IncorrectInvoice.png (119,760) 2014-01-07 21:26
https://issues.openbravo.com/file_download.php?file_id=6608&type=bug
png
Issue History
2014-01-07 21:19pjuvaraNew Issue
2014-01-07 21:19pjuvaraAssigned To => dmiguelez
2014-01-07 21:19pjuvaraWeb browser => Google Chrome
2014-01-07 21:19pjuvaraModules => Core
2014-01-07 21:19pjuvaraTriggers an Emergency Pack => No
2014-01-07 21:20pjuvaraFile Added: A-Promotion.png
2014-01-07 21:24pjuvaraFile Added: B-CorrectInvoice.png
2014-01-07 21:26pjuvaraFile Added: C-IncorrectInvoice.png
2014-01-07 21:28pjuvaraNote Added: 0063263
2014-01-07 21:37pjuvaraNote Added: 0063265
2014-01-23 16:06mtaalWeb browserGoogle Chrome => Google Chrome
2014-01-23 16:06mtaalAssigned Todmiguelez => mtaal
2014-01-23 16:06mtaalTarget Version => 3.0MP32
2016-10-21 10:58mtaalStatusnew => closed
2016-10-21 10:58mtaalResolutionopen => out of date
2016-10-21 13:17mtaalTag Attached: MT_closed_out_of_date
2016-10-21 13:21mtaalTag Detached: MT_closed_out_of_date
2016-10-21 13:21mtaalAssigned Tomtaal => Triage Finance
2016-10-21 13:21mtaalNote Added: 0090767
2016-10-21 13:21mtaalStatusclosed => new
2016-10-21 13:21mtaalResolutionout of date => open
2017-11-10 10:00dmiguelezAssigned ToTriage Finance => AtulOpenbravo
2017-11-10 10:00dmiguelezStatusnew => scheduled
2017-12-11 10:15AtulOpenbravoNote Added: 0100956
2017-12-11 10:17AtulOpenbravoNote Edited: 0100956bug_revision_view_page.php?bugnote_id=0100956#r16423

Notes
(0063263)
pjuvara   
2014-01-07 21:28   
This defect was reported using the Discount and Promotion Rules for Retail module version 1.3.1010
(0063265)
pjuvara   
2014-01-07 21:37   
Please also see related issue 25437.
(0090767)
mtaal   
2016-10-21 13:21   
re-open to be validated by functional team
(0100956)
AtulOpenbravo   
2017-12-11 10:15   
(edited on: 2017-12-11 10:17)
- Login as F&B International Group Admin
- Define product A and product B
- Add sales price to them. product A = 10, product B = 15
- Define a Discount and Promotion of type Buy X and get Y as a gift
- In Products Tab add Product A, quantity 10 and Product B as gift product, gift quantity as 10.
- Create an invoice with one line for 10 units of product A and a line with 15 units of product B, the unit price of B is set as 5, correctly adjusted down to reflect that only 5 units have a non zero price.
  i.e 15 qty X 5 price = 75 ~ 5 units total amount (5 qty X 15 Price = 75)
- Create an invoice with one line for 10 units of A and a line with 5 units of B and process the invoice.
- Realize that the price for the line of product B is set as 0.