Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0032038 | Openbravo ERP | 09. Financial management | public | 2016-01-28 12:17 | 2016-03-17 10:56 |
|
Reporter | maite | |
Assigned To | nonofrancisco | |
Priority | urgent | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | 3.0PR16Q2 | Fixed in Version | | |
Merge Request Status | |
Review Assigned To | vmromanos |
OBNetwork customer | OBPS |
Web browser | |
Modules | Core |
Support ticket | 40273 |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0032038: "Price Adjustment" promotion defined for the future is applied today |
Description | "Price Adjustment" promotion defined for the future is applied today |
Steps To Reproduce | 1. Define new "Price Adjustment" promotion type as:
* Date from: tomorrow
* Date to: tomorrow
* Included Product: only those defined --> add any product in Products tab
* Discount %: 5
2. Create new Purchase Order for today. Add line for defined product and realize that discount is applied |
Proposed Solution | Problem seems to be in src/org/openbravo/erpCommon/businessUtility/PriceAdjustment.java, which is not considering "Date From" but only "Date To" value |
Additional Information | |
Tags | No tags attached. |
Relationships | |
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2016-01-28 12:17 | maite | New Issue | |
2016-01-28 12:17 | maite | Assigned To | => Triage Finance |
2016-01-28 12:17 | maite | OBNetwork customer | => Yes |
2016-01-28 12:17 | maite | Modules | => Core |
2016-01-28 12:17 | maite | Support ticket | => 40273 |
2016-01-28 12:17 | maite | Resolution time | => 1456268400 |
2016-01-28 12:17 | maite | Triggers an Emergency Pack | => No |
2016-01-28 12:17 | maite | Issue Monitored: networkb | |
2016-02-01 17:22 | nonofrancisco | Assigned To | Triage Finance => nonofrancisco |
2016-02-01 17:23 | nonofrancisco | Status | new => scheduled |
2016-02-02 15:07 | nonofrancisco | Note Added: 0083853 | |
2016-02-10 17:16 | hgbot | Checkin | |
2016-02-10 17:16 | hgbot | Note Added: 0084086 | |
2016-02-10 17:16 | hgbot | Status | scheduled => resolved |
2016-02-10 17:16 | hgbot | Resolution | open => fixed |
2016-02-10 17:16 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/dbc7082479bb2a309cbeb054eef10768f95a8c9e [^] |
2016-02-10 17:16 | hgbot | Checkin | |
2016-02-10 17:16 | hgbot | Note Added: 0084087 | |
2016-02-10 17:17 | vmromanos | Review Assigned To | => vmromanos |
2016-02-10 17:17 | vmromanos | Note Added: 0084088 | |
2016-02-10 17:17 | vmromanos | Status | resolved => closed |
2016-03-17 10:56 | hudsonbot | Checkin | |
2016-03-17 10:56 | hudsonbot | Note Added: 0085125 | |
2016-03-17 10:56 | hudsonbot | Checkin | |
2016-03-17 10:56 | hudsonbot | Note Added: 0085126 | |
Notes |
|
|
Test Plan
As Openbravo / F&B International Group Admin
Create a new Discount and Promotion
Type: Price Adjustment
Discount %: 5
Date from: tomorrow
Date to: tomorrow
Included products: Only those defined
Save
In Product tab
Add Ale Beer
Save
Realize Ale Beer has a of 1.36 in Happy Drinks Price List.
Create a new Purchase Order
Business Partner: Happy Drinks, Inc.
Order date: today
Save
Create a new Line
Product: Ale Beer
Realize the net unit price is 1.36
Go to the Discount and Promotion window
Change the staring date of the promotion previously created to today date
Save
Go to Purchase Order window
In the line, select product Ale Beer again in product combo.
Realize the price is adjusted to 1.29 |
|
|
(0084086)
|
hgbot
|
2016-02-10 17:16
|
|
Repository: erp/devel/pi
Changeset: dbc7082479bb2a309cbeb054eef10768f95a8c9e
Author: Nono Carballo <f.carballo <at> nectus.com>
Date: Mon Feb 01 16:54:12 2016 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/dbc7082479bb2a309cbeb054eef10768f95a8c9e [^]
Fixes Issue 32038: "Price Adjustment" promotion type is applied to a line only
if the order/invoice date falls into the promotion period.
The HQL query was tuned to take into account the starting and ending date of the
promotion when selecting a product for a line in a purchase order/invoice.
The line only gets the promotion if the period encloses the order/invoice date,
start and end date included.
The line hql += "and (endingDate is null or endingDate>:date) "; was replaced with
hql += "and (endingDate is null or endingDate>=:date) ";
hql += "and (startingDate is null or startingDate<=:date) ";
---
M src/org/openbravo/erpCommon/businessUtility/PriceAdjustment.java
---
|
|
|
(0084087)
|
hgbot
|
2016-02-10 17:16
|
|
Repository: erp/devel/pi
Changeset: f8d4bab7045bfb0370cc14461f09ddcea330f47c
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Wed Feb 10 17:08:23 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/f8d4bab7045bfb0370cc14461f09ddcea330f47c [^]
Related to issue 32038: code review improvements
* startingDate is a mandatory column, so there is no need to validate whether it's null or not
* The promotion is applied for the period of time between the Starting and Ending Dates (both inclusive). For example, for a promotion available only in a concrete date, the starting and ending dates must be equal.
The date received as parameter to this query might have a time (hours/minutes/seconds). To control that situation the comparation is truncating the promotion starting and ending date (that should already be truncated because it's linked to a Date reference), it adds 1 day to the promotion ending date and removes the equal clause. Thus we can properly control the scenario of a one-day promotion with a datetime parameter.
---
M src/org/openbravo/erpCommon/businessUtility/PriceAdjustment.java
---
|
|
|
|
|
|
|
|
|
|
|