Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031202Openbravo ERP04. Warehouse managementpublic2015-10-21 13:192015-11-23 21:17
psanjuan 
aferraz 
urgentmajorhave not tried
closedfixed 
20Ubuntu 8.04.1
 
 
dmiguelez
Core
No
0031202: Wrong cost calculation while stocks gets into 0 due to remaining valuation
Wrong cost calculation while stocks gets into 0 due to remaining valuation
Make sure you have enabled the preference: Enable Negative Stock Corrections for F&B España.

Rest of steps are executed on F&B España, costing rule "Average", Warehouse dimension = NO.

Go to product window and create a new product named "Product Rounding 31202" for instance. Go to price tab and select "Tarifa Bebidas Alegres", enter a unit/list price = 4
Create a purchase order for that product, org F&B España, of 1 unit. Book the order
Create another purchase order for that product, org F&B España, 1 unit. This time change the price to 3.00. Book the order.
Create a third purchase order for that product, org F&B España, 1 unit. This time change the price to 3.00. Book the order.

Go to Goods Receipt window and create 3 different receipts, one for each order. Select the same warehouse in all the 3 for instance Warehouse = España Norte, but a different storage bin each. Complete the 3 receipts and run costing background process.

Go to product window and check that the cost of this product is 3.3333.

Create a shipment of the 3 units so you get into 0 stock. Complete the shipment and run costing background process.

Check also that each shipment transaction, in the transaction tab, has been valued at a cost of 3.33

Create a new purchase order of 1 unit of the product, this time change the price to 7.00
Receipt that unit in España Norte WH in a storage bin. Complete the receipt and run costing background process.

Go to product window and check that the new average cost for the product is 7.01 while it should have been 7.00

A negative stock correction cost adjustment needs to be created when the stock gets 0, therefore a 0 stock means 0 value so the remaining cost is removed
No tags attached.
related to defect 00310693.0PR16Q1 closed aferraz Wrong cost calculation using inventory amount update caused by remaining valuation 
Issue History
2015-10-21 13:19psanjuanNew Issue
2015-10-21 13:19psanjuanAssigned To => Triage Finance
2015-10-21 13:19psanjuanModules => Core
2015-10-21 13:19psanjuanTriggers an Emergency Pack => No
2015-10-21 13:19psanjuanRelationship addedrelated to 0031069
2015-10-21 13:28psanjuanNote Added: 0081173
2015-10-21 13:29psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9776#r9776
2015-10-21 13:29psanjuanProposed Solution updated
2015-10-21 13:29psanjuanNote Edited: 0081173bug_revision_view_page.php?bugnote_id=0081173#r9778
2015-10-21 13:41psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9779#r9779
2015-10-21 13:45psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9780#r9780
2015-10-21 15:02psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9781#r9781
2015-10-21 15:03psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9782#r9782
2015-10-21 15:10psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9783#r9783
2015-10-21 15:13psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9784#r9784
2015-10-21 15:15psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9785#r9785
2015-10-21 15:29psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9786#r9786
2015-10-21 15:45psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9787#r9787
2015-10-21 15:46psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9788#r9788
2015-10-21 15:48psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9789#r9789
2015-10-21 15:49psanjuanNote Added: 0081177
2015-10-21 15:49psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9790#r9790
2015-10-21 15:53psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9791#r9791
2015-10-21 15:53psanjuanNote Deleted: 0081173
2015-10-22 10:36psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9805#r9805
2015-10-22 10:37psanjuanNote Deleted: 0081177
2015-10-22 10:38psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9806#r9806
2015-10-22 10:39aferrazAssigned ToTriage Finance => aferraz
2015-10-22 10:39aferrazStatusnew => scheduled
2015-10-22 10:45psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9807#r9807
2015-10-22 10:49aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9808#r9808
2015-10-22 13:07aferrazNote Added: 0081207
2015-10-23 09:24psanjuanNote Edited: 0081207bug_revision_view_page.php?bugnote_id=0081207#r9839
2015-10-23 09:37psanjuanNote Edited: 0081207bug_revision_view_page.php?bugnote_id=0081207#r9840
2015-10-23 09:58psanjuanNote Edited: 0081207bug_revision_view_page.php?bugnote_id=0081207#r9841
2015-10-23 09:59psanjuanNote Added: 0081250
2015-11-12 11:49hgbotCheckin
2015-11-12 11:49hgbotNote Added: 0081744
2015-11-12 11:49hgbotStatusscheduled => resolved
2015-11-12 11:49hgbotResolutionopen => fixed
2015-11-12 11:49hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9c12064c0d44f487f2df11a897a30bb7c344b8c9 [^]
2015-11-12 11:49hgbotCheckin
2015-11-12 11:49hgbotNote Added: 0081745
2015-11-12 11:49hgbotCheckin
2015-11-12 11:49hgbotNote Added: 0081746
2015-11-12 11:49hgbotCheckin
2015-11-12 11:49hgbotNote Added: 0081747
2015-11-12 11:49dmiguelezReview Assigned To => dmiguelez
2015-11-12 11:49dmiguelezNote Added: 0081748
2015-11-12 11:49dmiguelezStatusresolved => closed
2015-11-12 13:12hgbotCheckin
2015-11-12 13:12hgbotNote Added: 0081752
2015-11-16 14:38hgbotCheckin
2015-11-16 14:38hgbotNote Added: 0081886
2015-11-23 21:17hudsonbotCheckin
2015-11-23 21:17hudsonbotNote Added: 0082205
2015-11-23 21:17hudsonbotCheckin
2015-11-23 21:17hudsonbotNote Added: 0082206
2015-11-23 21:17hudsonbotCheckin
2015-11-23 21:17hudsonbotNote Added: 0082207
2015-11-23 21:17hudsonbotCheckin
2015-11-23 21:17hudsonbotNote Added: 0082208
2015-11-23 21:17hudsonbotCheckin
2015-11-23 21:17hudsonbotNote Added: 0082209
2015-11-23 21:17hudsonbotCheckin
2015-11-23 21:17hudsonbotNote Added: 0082238

Notes
(0081207)
aferraz   
2015-10-22 13:07   
(edited on: 2015-10-23 09:58)
Test plan:

Make sure you have enabled the preference: Enable Negative Stock Corrections for F&B España.

Rest of steps are executed on F&B España, costing rule "Average", Warehouse dimension = NO.

1. Go to product window and create a new product named "Product Rounding 31202" for instance. Go to price tab and select "Tarifa Bebidas Alegres", enter a unit/list price = 4

2. Create a purchase order for that product, org F&B España, of 1 unit. Book the order
Create another purchase order for that product, org F&B España, 1 unit. This time change the price to 3.00. Book the order.
Create a third purchase order for that product, org F&B España, 1 unit. This time change the price to 3.00. Book the order.

3. Go to Goods Receipt window and create 3 different receipts, one for each order. Select the same warehouse in all the 3 for instance Warehouse = España Norte, but a different storage bin each. Complete the 3 receipts and run costing background process.

Go to product window and check that the cost of this product is 3.3333.

4. Create a shipment of the 3 units so you get into 0 stock. Complete the shipment and run costing background process.

Check also that each shipment transaction, in the transaction tab, has been valued at a cost of 3.33

5. Create a new purchase order of 1 unit of the product, this time change the price to 7.00
Receipt that unit in España Norte WH in a storage bin. Complete the receipt and run costing background process.

Go to product window and check that the new average cost for the product is 7.00.

A negative cost adjustment of -0.01 has been created related to this last receipt, therefore Trx Original Cost = 7.00; Total Cost = 6.99 and Unit Cost = 7.00

Create another purchase order of the product for 1 unit at a price = 5.00
Receipt the order and run the costing background process.

New average cost calculated is = 6.00 (7+5)/2 units.

Create a shipment of 3 units, therefore you get into negative stock of -1. Check that Allow negative Stock is allowed at Client level.

Create another purchase order of 3 units at a price of 4.00. Receipt the order and run costing background process.

Check that a new negative stock correction has been created for this last receipt of 2.00
Check that new average cost is 4.00
Negative adjustment amount = [(-1+6.00)+(3*4.00)+X]/2 units = 4.00 (new average cost).

(0081250)
psanjuan   
2015-10-23 09:59   
Test Plan above verified.
(0081744)
hgbot   
2015-11-12 11:49   
Repository: erp/devel/pi
Changeset: 9c12064c0d44f487f2df11a897a30bb7c344b8c9
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Oct 26 17:00:37 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/9c12064c0d44f487f2df11a897a30bb7c344b8c9 [^]

Fixes issue 31202: NSC when you get into 0 stock

Negative Stock Correction adjustment should be created when you get into zero stock (only in case you do not get into zero stock by a Closing Inventory), as it is created when you get into negative stock.

---
M src/org/openbravo/costing/CostingServer.java
M src/org/openbravo/costing/CostingUtils.java
---
(0081745)
hgbot   
2015-11-12 11:49   
Repository: erp/devel/pi
Changeset: 6b0630da41f100f3cb6964f23df7696c96496397
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Oct 26 15:07:34 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/6b0630da41f100f3cb6964f23df7696c96496397 [^]

Related to issue 31202: Update inventory types created by Costing Rule process

---
M referencedata/sampledata/F_B_International_Group/M_INVENTORY.xml
M referencedata/sampledata/QA_Testing/M_INVENTORY.xml
---
(0081746)
hgbot   
2015-11-12 11:49   
Repository: erp/devel/pi
Changeset: 64e4f46536b75e92c85e4bfabc5207151df93650
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Oct 26 16:40:52 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/64e4f46536b75e92c85e4bfabc5207151df93650 [^]

Related to issue 31202: Run Costing Background process for QA Testing client

---
M referencedata/sampledata/QA_Testing/M_COSTING.xml
M referencedata/sampledata/QA_Testing/M_TRANSACTION.xml
M referencedata/sampledata/QA_Testing/M_TRANSACTION_COST.xml
---
(0081747)
hgbot   
2015-11-12 11:49   
Repository: erp/devel/pi
Changeset: c7ee4c9a5a1e90b203726bb97a6209a7afa1f0be
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Thu Nov 12 11:48:27 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/c7ee4c9a5a1e90b203726bb97a6209a7afa1f0be [^]

Related to Issue 31202. Code Review changes.

While looking for existing Processed Transactions for a Product
it now takes into account costing dimensions, such as Warehouse.

---
M src/org/openbravo/costing/CostingServer.java
M src/org/openbravo/costing/CostingUtils.java
---
(0081748)
dmiguelez   
2015-11-12 11:49   
Code Review + Testing Ok
(0081752)
hgbot   
2015-11-12 13:12   
Repository: erp/devel/pi
Changeset: 31b64687c6c0522c003c3df3d45723e2b106abe0
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Oct 30 00:43:32 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/31b64687c6c0522c003c3df3d45723e2b106abe0 [^]

Related to issue 31202: Added an automated test in TestCosting

---
M src-test/src/org/openbravo/test/costing/TestCosting.java
---
(0081886)
hgbot   
2015-11-16 14:38   
Repository: erp/devel/pi
Changeset: 7971376bb0ad13b930a6a33edc5714151c251664
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Nov 16 11:16:11 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/7971376bb0ad13b930a6a33edc5714151c251664 [^]

Related to issue 31202: Fix testCostingE2 test in TestCosting

---
M src-test/src/org/openbravo/test/costing/TestCosting.java
---
(0082205)
hudsonbot   
2015-11-23 21:17   
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/7b56bebaaa88 [^]
Maturity status: Test
(0082206)
hudsonbot   
2015-11-23 21:17   
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/7b56bebaaa88 [^]
Maturity status: Test
(0082207)
hudsonbot   
2015-11-23 21:17   
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/7b56bebaaa88 [^]
Maturity status: Test
(0082208)
hudsonbot   
2015-11-23 21:17   
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/7b56bebaaa88 [^]
Maturity status: Test
(0082209)
hudsonbot   
2015-11-23 21:17   
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/7b56bebaaa88 [^]
Maturity status: Test
(0082238)
hudsonbot   
2015-11-23 21:17   
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/7b56bebaaa88 [^]
Maturity status: Test