Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028177Openbravo ERP03. Procurement managementpublic2014-11-14 11:062014-12-30 23:27
maite 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
 
3.0PR15Q2 
pramakrishnan
Core
No
0028177: "Copy Lines" process is recalculating "lastpriceso" using "pricestd" instead of "lastpriceso"
"Copy Lines" process is recalculating "lastpriceso" using "pricestd" instead of "lastpriceso"
1. Define Price list as "tax included taxes" and set price=0 for an specific product
2. Register Purchase Order for any org and bp. Add line using previous product, edit price to set 200 and process order
3. Register new Purchase Order header for same org and bp
4. Run "Copy Lines" process and realize that "Last Price" is not showing 200 but 0.00, which is wrong
lastpriceso is being properly calculated to 200 in the query but is being later overwritten in following line of code using "pricestd" instead of previous "lastpriceso" (CopyFromOrder.java)

for (int i = 0; i < data.length; i++) {
      Product product = OBDal.getInstance().get(Product.class, data[i].mProductId);
      data[i].lastpriceso = (PriceAdjustment.calculatePriceActual(order, product, new BigDecimal(
          data[i].qty), new BigDecimal(data[i].pricestd))).toString();
    }

patch attached
No tags attached.
related to defect 00256713.0PR14Q2 closed AtulOpenbravo Wrong "Last Price" calculated when Discounts and Promotions found 
diff 28177.diff (870) 2014-11-14 11:19
https://issues.openbravo.com/file_download.php?file_id=7512&type=bug
Issue History
2014-11-14 11:06maiteNew Issue
2014-11-14 11:06maiteAssigned To => dmiguelez
2014-11-14 11:06maiteModules => Core
2014-11-14 11:06maiteTriggers an Emergency Pack => No
2014-11-14 11:07maiteRelationship addedrelated to 0025671
2014-11-14 11:07maiteAssigned Todmiguelez => AtulOpenbravo
2014-11-14 11:19maiteProposed Solution updated
2014-11-14 11:19maiteFile Added: 28177.diff
2014-11-17 14:06maiteResolution time => 1419030000
2014-12-01 13:42egoitzTarget Version3.0PR15Q1 => 3.0PR15Q2
2014-12-09 03:56AtulOpenbravoNote Added: 0072338
2014-12-09 03:56AtulOpenbravoStatusnew => scheduled
2014-12-09 03:56AtulOpenbravofix_in_branch => pi
2014-12-09 04:03AtulOpenbravoReview Assigned To => pramakrishnan
2014-12-09 04:03AtulOpenbravofix_in_branchpi =>
2014-12-09 04:05hgbotCheckin
2014-12-09 04:05hgbotNote Added: 0072339
2014-12-09 04:05hgbotStatusscheduled => resolved
2014-12-09 04:05hgbotResolutionopen => fixed
2014-12-09 04:05hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/78f50adbb376670cfb1fa98953c50d62b5706161 [^]
2014-12-15 09:41pramakrishnanNote Added: 0072489
2014-12-15 09:41pramakrishnanStatusresolved => closed
2014-12-30 23:27hudsonbotCheckin
2014-12-30 23:27hudsonbotNote Added: 0073184

Notes
(0072338)
AtulOpenbravo   
2014-12-09 03:56   
Test Plan
- Define Price list as "tax included taxes", Sales Price List=No and set Unit Price=0 for an specific product
- Register Purchase Order for any org and bp. Add line using previous product, edit price to set 200 and book order.
- Register new Purchase Order header for same org, Bp and Pricelist.
- Run "Copy Lines" process and realize that "Last Price" is showing 200.
(0072339)
hgbot   
2014-12-09 04:05   
Repository: erp/devel/pi
Changeset: 78f50adbb376670cfb1fa98953c50d62b5706161
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Tue Dec 09 08:32:55 2014 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/78f50adbb376670cfb1fa98953c50d62b5706161 [^]

Fixes Issue 28177:Copy Lines uses LastPriceSO instead of PriceStd

Incase of discount and promotion Copy Lines used PriceStd which now
uses lastpriceso to set value in grid data for LastPriceSO.

---
M src/org/openbravo/erpCommon/ad_actionButton/CopyFromOrder.java
---
(0072489)
pramakrishnan   
2014-12-15 09:41   
Code Review + Testing - OK.
(0073184)
hudsonbot   
2014-12-30 23:27   
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/6525fe229e06 [^]
Maturity status: Test