Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028113Openbravo ERP04. Warehouse managementpublic2014-11-06 18:052014-12-30 23:26
psanjuan 
umartirena 
urgentmajoralways
closedfixed 
20Ubuntu 8.04.1
 
3.0PR15Q1 
Sandrahuguet
Core
No
0028113: [Costing] wrong negative stock correction adjustment
[Costing] wrong negative stock correction adjustment
In QA Testing Client create a new product named Costing V221.
Select a purchase price list and enter a unit/list price of 15.00

Go to purchase order and create a new one dated on 17/10/2014. Select the product and enter 500 units. Book the order.

Go to purchase order and create a new one dated on 18/10/2014. Select the product and enter 700 units. Change the price to 12.00. Book the order.

Go to goods receipt window and create a new one dated on 19/10/2014. Select the first purchase order and receipt 150 units. Complete the receipt.

Go to process request window and launch costing background process.

Go to the goods receipt and post it. Realize that the value post is 2250 (150 units * 15.00)

Go to goods shipment window and create a new one dated on 20/10/2014. Enter 600 units.

Go to process request window and launch costing background process.

Go to the goods shipment and post it. Realize that the value post is 9000 (600 units * 15.00)

Go to goods receipt window and create a new one dated on 22/10/2014. Select the second purchase order and receipt 500 units.

Go to process request window and launch costing background process.

Go to the goods receipt and post it. Realize that the value post is 6000 (500 units * 12.00)

Go to Cost adjustment window and realize that negative stock correction one has been created for an adjustment amount of X= 1350 (2250-9000+6000+X)/50 = 12

Go to Product window, search the product and navigate to Costing tab. Realize that cost shown is 12, Total mov quty = 50

Go to purchase invoice window and create a new one dated on 30/10/2014. Create purchase lines by using "Create Lines From" button, selecting both purchase order.

Change 150 units line price from 15.00 to 20.00
Change 500 units line price from 12.00 to 18.00

Complete and post the invoice.

Go to process request window and launch price correction background process.

Go to Cost adjustment window and realize that a price difference correction has been created including below adjustments:

1.- Vendor receipt dated on 19/10/2014 - Adj Amount 750.00 (150 units * 20.00 - 150 units * 15.00)
2.- Vendor receipt dated on 22/10/2014 - Adj Amount 3000.00 (500 units * 18.00 - 500 units * 12.00)
3.- Customer Shipment dated on 20/10/2014 - Adj Amount 3000.00 (600 units * 20.00 - 600 units * 15.00)
4 - Vendor receipt dated on 22/10/2014 - Set as Negative Stock Correction- Adj Amount -315 - this last adjustment is not correct.

Correct negative stock correction adjustment should be: -450 = (2250+750-9000-3000+6000+1350+3000+X)/50 = 18

Go to the product window, search the product and navigate to costing tab. Realize that there are two lines.

Line 1 related to Vendor receipt 19/10/2014 inventory transaction - Cost 20 - total mov quantity - 150 - this is correct

Line 2 related to Vendor receipt 22/10/2014 inventory transaction - Cost 20.7 - total mov quanity - 50 - this is NOT correct as it should have a cost of 18.00




Correct negative stock correction adjustment should be: -450 = (2250+750-9000-3000+6000+1350+3000+X)/50 = 18

Go to the product window, search the product and navigate to costing tab.
There should be below two lines.

Line 1 related to Vendor receipt 19/10/2014 inventory transaction - Cost 20 - total mov quantity - 150

Line 2 related to Vendor receipt 22/10/2014 inventory transaction - Cost 18.00 - total mov quanity - 50
No tags attached.
related to defect 0028029 closed umartirena [Costing] Negative Stock Correction adjustments should NOT be marked as "Unit Cost". 
Issue History
2014-11-06 18:05psanjuanNew Issue
2014-11-06 18:05psanjuanAssigned To => dmiguelez
2014-11-06 18:05psanjuanModules => Core
2014-11-06 18:05psanjuanTriggers an Emergency Pack => No
2014-11-06 18:06psanjuanRelationship addedrelated to 0028029
2014-11-07 09:20psanjuanAssigned Todmiguelez => umartirena
2014-11-07 11:32psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6985#r6985
2014-11-07 11:38psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6986#r6986
2014-11-07 11:46psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6987#r6987
2014-11-07 11:46psanjuanProposed Solution updated
2014-11-07 11:49psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6988#r6988
2014-11-07 11:51psanjuanProposed Solution updated
2014-11-11 17:21hgbotCheckin
2014-11-11 17:21hgbotNote Added: 0071562
2014-11-11 17:21hgbotStatusnew => resolved
2014-11-11 17:21hgbotResolutionopen => fixed
2014-11-11 17:21hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c05011cca9f937e4969fe2577ffcb9b122817835 [^]
2014-11-12 09:35psanjuanNote Added: 0071581
2014-11-12 09:35psanjuanStatusresolved => closed
2014-11-12 12:21umartirenaNote Added: 0071600
2014-11-12 12:21umartirenaStatusclosed => new
2014-11-12 12:21umartirenaResolutionfixed => open
2014-11-12 12:22hgbotCheckin
2014-11-12 12:22hgbotNote Added: 0071601
2014-11-12 12:29umartirenaStatusnew => scheduled
2014-11-12 12:29umartirenafix_in_branch => pi
2014-11-12 12:30umartirenaStatusscheduled => resolved
2014-11-12 12:30umartirenaFixed in Version => pi
2014-11-12 12:30umartirenaFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/c05011cca9f937e4969fe2577ffcb9b122817835 [^] => https://code.openbravo.com/erp/devel/pi/rev/b852c03d58e7 [^]
2014-11-12 12:30umartirenaResolutionopen => fixed
2014-11-12 13:45psanjuanStatusresolved => closed
2014-11-12 13:45psanjuanfix_in_branchpi =>
2014-11-12 19:31aferrazStatusclosed => new
2014-11-12 19:31aferrazResolutionfixed => open
2014-11-12 19:31aferrazFixed in Versionpi =>
2014-11-12 19:33aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7046#r7046
2014-11-12 19:33aferrazProposed Solution updated
2014-11-12 19:33aferrazStatusnew => scheduled
2014-11-12 19:33aferrazfix_in_branch => pi
2014-11-12 19:34aferrazStatusscheduled => resolved
2014-11-12 19:34aferrazResolutionopen => fixed
2014-11-12 19:34aferrazReview Assigned To => aferraz
2014-11-12 19:34aferrazNote Added: 0071614
2014-11-12 19:34aferrazStatusresolved => closed
2014-11-17 10:42aferrazStatusclosed => new
2014-11-17 10:42aferrazResolutionfixed => open
2014-11-27 13:19psanjuanRelationship addedrelated to 0028301
2014-12-01 10:40psanjuanRelationship deletedrelated to 0028301
2014-12-02 13:30umartirenafix_in_branchpi =>
2014-12-02 13:30umartirenaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7202#r7202
2014-12-04 12:21hgbotCheckin
2014-12-04 12:21hgbotNote Added: 0072278
2014-12-04 12:24umartirenaStatusnew => scheduled
2014-12-04 12:24umartirenafix_in_branch => pi
2014-12-04 12:24umartirenaStatusscheduled => resolved
2014-12-04 12:24umartirenaFixed in Version => pi
2014-12-04 12:24umartirenaFixed in SCM revisionhttps://code.openbravo.com/erp/devel/pi/rev/b852c03d58e7 [^] => https://code.openbravo.com/erp/devel/pi/rev/7084255c151e [^]
2014-12-04 12:24umartirenaResolutionopen => fixed
2014-12-04 14:49psanjuanStatusresolved => closed
2014-12-04 14:49psanjuanfix_in_branchpi =>
2014-12-04 14:49psanjuanNote Added: 0072284
2014-12-05 10:49psanjuanNote Added: 0072305
2014-12-05 10:49psanjuanStatusclosed => new
2014-12-05 10:50psanjuanStatusnew => scheduled
2014-12-05 10:55umartirenaStatusscheduled => resolved
2014-12-11 18:21SandrahuguetReview Assigned Toaferraz => Sandrahuguet
2014-12-12 14:33SandrahuguetNote Added: 0072452
2014-12-12 14:33SandrahuguetStatusresolved => closed
2014-12-12 14:33SandrahuguetFixed in Versionpi => 3.0PR15Q1
2014-12-30 23:24hudsonbotCheckin
2014-12-30 23:24hudsonbotNote Added: 0073042
2014-12-30 23:24hudsonbotCheckin
2014-12-30 23:24hudsonbotNote Added: 0073049
2014-12-30 23:26hudsonbotCheckin
2014-12-30 23:26hudsonbotNote Added: 0073170

Notes
(0071562)
hgbot   
2014-11-11 17:21   
Repository: erp/devel/pi
Changeset: c05011cca9f937e4969fe2577ffcb9b122817835
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Tue Nov 11 17:20:36 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/c05011cca9f937e4969fe2577ffcb9b122817835 [^]

Fixes bug 28113: Use costing Price to calculate Adjustment Amount

In some cases the transaction price it was not being properly calculated in order to calculate the negative stock correction amounts. Starting from now the Net Unit Price field of Costing tab will be used in Cost Adjustments. To get the transaction price this Net Unit Price will be used.

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0071581)
psanjuan   
2014-11-12 09:35   
Verified.
See product: Costing V221 test in the excel sheet below:
https://docs.google.com/a/openbravo.com/spreadsheets/d/1Ilm1oct0vH4iKFlI1I0VbmYM-r8fdo1moK02jd2Zigg/edit#gid=1025660841 [^]
(0071600)
umartirena   
2014-11-12 12:21   
Reopened due to rounding amount issues.
(0071601)
hgbot   
2014-11-12 12:22   
Repository: erp/devel/pi
Changeset: b852c03d58e701020cdbbd66d3875331c77f7ca0
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Wed Nov 12 11:56:25 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b852c03d58e701020cdbbd66d3875331c77f7ca0 [^]

Related to Issue 28113: Add some missing currency roundings

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0071614)
aferraz   
2014-11-12 19:34   
Verified.
(0072278)
hgbot   
2014-12-04 12:21   
Repository: erp/devel/pi
Changeset: 7084255c151e87dba55b4f7a7c475b4db9f277a0
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Thu Dec 04 12:12:34 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/7084255c151e87dba55b4f7a7c475b4db9f277a0 [^]

Related to Issue 28113: Revert a change on issue 28115.

In this cases the net unit price is the cost of the transaction

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0072284)
psanjuan   
2014-12-04 14:49   
Verified.
(0072305)
psanjuan   
2014-12-05 10:49   
Issue resolved that was closed by mistake.
Code review required to close the issue.
(0072452)
Sandrahuguet   
2014-12-12 14:33   
Code review done
(0073042)
hudsonbot   
2014-12-30 23:24   
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
(0073049)
hudsonbot   
2014-12-30 23:24   
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
(0073170)
hudsonbot   
2014-12-30 23:26   
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