Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037640Openbravo ERP02. Master data managementpublic2018-01-15 17:282018-02-22 18:18
samuel_nicuesa 
AtulOpenbravo 
highmajoralways
closedfixed 
5
pi 
3.0PR18Q2 
dmiguelez
Core
No
0037640: Trying to separate discounts using different organizations that are not in the same branch DOES NOT separate these discounts
Trying to separate discounts using different organizations that are not in the same branch DOES NOT separate these discounts. (Using "Discounts and Promotions" window).
All these discounts appear for all the users when they should be separated.
Log in into ERP as Openbravo/openbravo
Using the The White Valley Group Admin Role go to "Discounts and Promotions" window.

Create a new record and set the following data:
Organization: Vall Blanca Store
Discount/Promotion Type *: Fixed Percentage Discount
Name: Test 50%
Printed Name: Test 50%
Starting date: 01-01-2018
Included Products: Only those defined
Discount: 50.
Save.

Go to Products tab.
Create a new record.
Product: Alpine poles
Active: Enabled.
Save.
---
Then go to Sales Order window and create one record :
Organization: Central Mountains Store.
Business Partner: Arturo Montoro.
Save.

Go to lines tab.
Create a new record.
Product: Alpine Poles.
Save.
---
Choose the sales order created and press Book button.
Go back to the lines tab and you will see that the discount created using Vall Blanca Store has been applied.

This should not happens because central mountain's organization is "Central Mountains Store" and "Vall Blanca Store" is in other branch.
No tags attached.
depends on defect 0027862 closed dmiguelez Trying to separate discounts using different organizations that are not in the same branch DOES NOT separate these discounts. RR 
patch patch27862.patch (767) 2018-01-15 17:28
https://issues.openbravo.com/file_download.php?file_id=11460&type=bug
Issue History
2018-01-15 17:28samuel_nicuesaNew Issue
2018-01-15 17:28samuel_nicuesaAssigned To => Triage Finance
2018-01-15 17:28samuel_nicuesaFile Added: patch27862.patch
2018-01-15 17:28samuel_nicuesaModules => Core
2018-01-15 17:28samuel_nicuesaResolution time => 1517785200
2018-01-15 17:28samuel_nicuesaTriggers an Emergency Pack => No
2018-01-15 17:29samuel_nicuesaRelationship addeddepends on 0027862
2018-01-15 17:35samuel_nicuesaNote Added: 0101707
2018-01-15 17:53dmiguelezAssigned ToTriage Finance => AtulOpenbravo
2018-01-16 06:38AtulOpenbravoStatusnew => scheduled
2018-01-17 03:48AtulOpenbravoNote Added: 0101736
2018-01-18 11:36hgbotCheckin
2018-01-18 11:36hgbotNote Added: 0101767
2018-01-18 11:36hgbotStatusscheduled => resolved
2018-01-18 11:36hgbotResolutionopen => fixed
2018-01-18 11:36hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/7f73f128fec8ab03189bcdda3d1392c0ee152370 [^]
2018-01-18 11:48hgbotCheckin
2018-01-18 11:48hgbotNote Added: 0101768
2018-01-18 11:49dmiguelezReview Assigned To => dmiguelez
2018-01-18 11:49dmiguelezNote Added: 0101769
2018-01-18 11:49dmiguelezStatusresolved => closed
2018-01-18 11:49dmiguelezFixed in Version => 3.0PR18Q2
2018-02-22 18:18hudsonbotCheckin
2018-02-22 18:18hudsonbotNote Added: 0102664
2018-02-22 18:18hudsonbotCheckin
2018-02-22 18:18hudsonbotNote Added: 0102665

Notes
(0101707)
samuel_nicuesa   
2018-01-15 17:35   
We have seen that in WEB POS the discounts are being applied properly.
In the ERP the Discount lookup is not taking into account the organization tree. A proposed solution was attached (patch27862).
(0101736)
AtulOpenbravo   
2018-01-17 03:48   
- Login as F&B International Group Admin
- Navigate to Discount and Promotion window
- Create a new record
  - Organization: F&B España - Región Norte
  - Discount/Promotion Type: Price Adjustment
  - Name: Discount 50%
  - Starting Date: 01-01-2018
  - Included Products: Only those defined
  - Discount %: 50
  - Rest all the fields default value
  - Save record.
- Navigate to Product Tab
  - Add record for product Vino Blanco 0,75L
- Create a new record in Discount and Promotion
  - Organization: F&B España, S.A
  - Discount/Promotion Type: Price Adjustment
  - Name: Discount 20%
  - Starting Date: 01-01-2018
  - Included Products: Only those defined
  - Discount %: 20
  - Rest all the fields default value
  - Save record.
- Navigate to Product Tab
  - Add record for product Vino Rosado 0,75L
- Navigate to Sales Order window.
- Create a new record for any business partner in organization "F&B España - Región Sur"
- Add line for product Vino Blanco 0,75L Quantity = 1000
- Realize that Net Unit Price = Net List Price = 5.33 (No discount and promotion is applied)
- Add another line for product Vino Rosado 0,75L, Quantity = 1000
- Realize that Net Unit Price = 4.50, Net List Price = 5.63 (20% discount and promotion is applied)
- Book the order and realize that price set in both steps remains same and are correct.
- Repeat same steps to create Sales Invoice.

- Create a new record for any business partner in organization "F&B España - Región Norte"
- Add line for product Vino Blanco 0,75L Quantity = 1000
- Realize that Net Unit Price =2.67, Net List Price = 5.33 (50% discount and promotion is applied)
- Add another line for product Vino Rosado 0,75L, Quantity = 1000
- Realize that Net Unit Price = 4.50, Net List Price = 5.63 (20% discount and promotion is applied)
- Book the order and realize that price set in both steps remains same and are correct.
- Repeat same steps to create Sales Invoice.

- Create a new record for any business partner in organization "F&B España, S.A"
- Add line for product Vino Blanco 0,75L Quantity = 1000
- Realize that Net Unit Price =5.33, Net List Price = 5.33 (No discount and promotion is applied)
- Add another line for product Vino Rosado 0,75L, Quantity = 1000
- Realize that Net Unit Price = 4.50, Net List Price = 5.63 (20% discount and promotion is applied)
- Book the order and realize that price set in both steps remains same and are correct.
- Repeat same steps to create Sales Invoice.
(0101767)
hgbot   
2018-01-18 11:36   
Repository: erp/devel/pi
Changeset: 7f73f128fec8ab03189bcdda3d1392c0ee152370
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Tue Jan 16 12:50:55 2018 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/7f73f128fec8ab03189bcdda3d1392c0ee152370 [^]

Fixes Issue 37640: Trying to separate discounts using different
organizations that are not in the same branch DOES NOT separate
these discounts

** Apply offers (discount and promotion) to the lines whose order
organization is in organization tree of the offer organization.

---
M src-db/database/model/functions/M_PROMOTION_CALCULATE.xml
M src/org/openbravo/erpCommon/businessUtility/PriceAdjustment.java
---
(0101768)
hgbot   
2018-01-18 11:48   
Repository: erp/devel/pi
Changeset: d73c3858c8e4699e575a691ac7d0aa4cb31103a8
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Thu Jan 18 11:48:38 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/d73c3858c8e4699e575a691ac7d0aa4cb31103a8 [^]

Related to Issue 37640. Updated license year

---
M src-db/database/model/functions/M_PROMOTION_CALCULATE.xml
---
(0101769)
dmiguelez   
2018-01-18 11:49   
Code Review + Testing Ok
(0102664)
hudsonbot   
2018-02-22 18:18   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/980a6ad5bbf5 [^]
Maturity status: Test
(0102665)
hudsonbot   
2018-02-22 18:18   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/980a6ad5bbf5 [^]
Maturity status: Test