Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0032038
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 09. Financial managementmajoralways2016-01-28 12:172016-03-17 10:56
ReportermaiteView Statuspublic 
Assigned Tononofrancisco 
PriorityurgentResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisiondbc7082479bb
ProjectionnoneETAnoneTarget Version3.0PR16Q2
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tovmromanos
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
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 Reproduce1. 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 SolutionProblem seems to be in src/org/openbravo/erpCommon/businessUtility/PriceAdjustment.java, which is not considering "Date From" but only "Date To" value
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0083853)
nonofrancisco (developer)
2016-02-02 15:07

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 (developer)
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 (developer)
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
---
(0084088)
vmromanos (manager)
2016-02-10 17:17

Code review + testing OK
(0085125)
hudsonbot (developer)
2016-03-17 10:56

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/b22fb0500156 [^]
Maturity status: Test
(0085126)
hudsonbot (developer)
2016-03-17 10:56

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/b22fb0500156 [^]
Maturity status: Test

- 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 Modules => Core
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


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker