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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0014419
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 03. Procurement managementmajoralways2010-09-03 11:252011-09-16 18:48
Reporterneil_smithView Statuspublic 
Assigned Tojonalegriaesarte 
PriorityhighResolutionno change requiredFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionmainSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0014419: Price problem when 'Copy from order' from purchase (or sale) order (Copy from Order process).

DescriptionWhile copying from a sales order to a purchase order, from the purchase order header, it is not the most actual price that is selected.
In the CopyFromPOOrder_data.xsql file, the selectPriceForProduct method does an order by pv.ValidFrom DESC, and in the CopyFromPOOrder.java file, it loops on the records returned by the selectPriceForProduct method and memorizes the price for each validfrom that null or empty ("") or validfrom that is before today.
If we have several pricelist versions with different validfrom dates for the same pricelist, it will find the first price (the most actual one because of the 'DESC' order by), memorizes it, does other calculations (precision, ...), then finds the second price (with a smaller validfrom date, that means that is older), memorizes it, etc...
This means that the oldest valid price is memorized and not the newest.
Steps To Reproduce1. Create a product
2. Add 2 purchase prices to the product (in the price list assigned to the vendor of the product). One valid from 2010.01.01 with the price 100, and a second one, valid from 2010.06.01 with the price 999.
3. Add 1 sale price (in the pricelist of the customer that will by the product), 150.
4. Create a sales order for that product (-> price 150)
5. Create a purchase order for the vendor of the product.
6. Copy the lines from the sale order by using the 'Copy from Order' button.

-> The price on the purchase order is 999 and not 100.
Proposed SolutionSimply change the ORDER BY clause of the selectPriceForProduct method from DESC to ASC.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0041037)
psarobe (manager)
2011-09-16 18:48

This is how it should work. If you are in the 3th of September then it takes the 999 since this is the one valid starting from the 1st of June

- Issue History
Date Modified Username Field Change
2010-09-03 11:25 neil_smith New Issue
2010-09-03 11:25 neil_smith Assigned To => adrianromero
2011-06-03 10:59 dalsasua Assigned To adrianromero => dalsasua
2011-07-20 18:12 dalsasua Assigned To dalsasua => jonalegriaesarte
2011-09-16 18:48 psarobe Note Added: 0041037
2011-09-16 18:48 psarobe Status new => closed
2011-09-16 18:48 psarobe Resolution open => no change required


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker