Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029430Openbravo ERP04. Warehouse managementpublic2015-03-26 12:262015-03-31 00:07
umartirena 
umartirena 
highmajoralways
closedfixed 
5
 
3.0PR15Q2 
aferraz
Core
No
0029430: [Cost Adjustment] Net Unit Price in Costing tab is not being properly calculated in certain cases
Net Unit Price in Costing tab is not being properly calculated in certain cases. There is a case in which this value is being set equals to cost, and this is wrong.
Run testCostingAAA() test.

As QA Testing Admin.
Go to Product window and select the product just created.
Go to Costing tab.
Realize that in the second Costing record the Net Unit Price is 68.00, when it should be 80.00 (150 * 70 + 1500) / 150.



Approved
depends on backport 00294323.0PR15Q1.2 closed umartirena [Cost Adjustment] Net Unit Price in Costing tab is not being properly calculated in certain cases 
Issue History
2015-03-26 12:26umartirenaNew Issue
2015-03-26 12:26umartirenaAssigned To => Sandrahuguet
2015-03-26 12:26umartirenaModules => Core
2015-03-26 12:26umartirenaTriggers an Emergency Pack => No
2015-03-26 12:27umartirenaStatusnew => scheduled
2015-03-26 12:27umartirenaAssigned ToSandrahuguet => umartirena
2015-03-26 13:33dmitry_mezentsevTag Attached: Approved
2015-03-27 14:42umartirenaTarget Version => 3.0PR15Q2
2015-03-30 11:31hgbotCheckin
2015-03-30 11:31hgbotNote Added: 0076125
2015-03-30 11:31hgbotStatusscheduled => resolved
2015-03-30 11:31hgbotResolutionopen => fixed
2015-03-30 11:31hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b87f60cb229d9c65589c755a6b44e98b34bb8a07 [^]
2015-03-30 11:31hgbotCheckin
2015-03-30 11:31hgbotNote Added: 0076126
2015-03-30 11:31aferrazReview Assigned To => aferraz
2015-03-30 11:31aferrazNote Added: 0076127
2015-03-30 11:31aferrazStatusresolved => closed
2015-03-31 00:07hudsonbotCheckin
2015-03-31 00:07hudsonbotNote Added: 0076163
2015-03-31 00:07hudsonbotCheckin
2015-03-31 00:07hudsonbotNote Added: 0076164

Notes
(0076125)
hgbot   
2015-03-30 11:31   
Repository: erp/devel/pi
Changeset: b87f60cb229d9c65589c755a6b44e98b34bb8a07
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Mon Mar 30 11:14:37 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b87f60cb229d9c65589c755a6b44e98b34bb8a07 [^]

Fixes bug 29430: Net Unit Price in Costing is properly calculated


Using Cost Adjustments the Net Unit Price of a product on a transaction could be affected with those. Starting from now the Net Unit Price assigned in Costing tab is going to take into account the Cost Adjustments of type Unit Cost.

So the calculation would be: ((originalPrice * qty) + adjustmentsAmount) / qty.

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0076126)
hgbot   
2015-03-30 11:31   
Repository: erp/devel/pi
Changeset: 8f36b14dbc05ea1a7972cb69b880d26612ac0e06
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Mon Mar 30 11:15:30 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/8f36b14dbc05ea1a7972cb69b880d26612ac0e06 [^]

Related to bug 29430: Adapt de test to the new behavior

---
M src-test/src/org/openbravo/test/costing/TestCosting.java
---
(0076127)
aferraz   
2015-03-30 11:31   
Code review + Testing OK
(0076163)
hudsonbot   
2015-03-31 00:07   
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/34da08f135b8 [^]
Maturity status: Test
(0076164)
hudsonbot   
2015-03-31 00:07   
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/34da08f135b8 [^]
Maturity status: Test