Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028509Openbravo ERP04. Warehouse managementpublic2014-12-31 13:452015-02-04 20:33
umartirena 
umartirena 
urgentmajoralways
closedfixed 
5
 
3.0PR15Q2 
Sandrahuguet
Core
No
0028509: [Costing] Inventory Amount Update fails when the stock is negative
Inventory Amount Update fails when the total amount of the transactions that is going to change the cost, is negative. The problem is that is trying to create a Physical Inventory with a Qty Count negative, and this is not allowed, so the process fails
As QA Testing Admin:
 * Create a new Product for Spain org and add a Costing record with cost 10.
 * Create a Shipment for that product of qty 10. Complete it.
 * Run Costing Background Process.
 * Create an Inventory Amount update.
 * Create a Line and put as Unit Cost 15. Process the Inventory Amount Update.
 * Realize that an error is displayed.
In this case revert the Qty Count and Qty Book in the Physical Inventory Lines and negate them to make them positive, maintaining the difference between them to create the same transaction quantity.
No tags attached.
Issue History
2014-12-31 13:45umartirenaNew Issue
2014-12-31 13:45umartirenaAssigned To => dmiguelez
2014-12-31 13:45umartirenaModules => Core
2014-12-31 13:45umartirenaTriggers an Emergency Pack => No
2014-12-31 13:53umartirenaAssigned Todmiguelez => umartirena
2015-01-02 15:46hgbotCheckin
2015-01-02 15:46hgbotNote Added: 0073296
2015-01-02 15:46hgbotStatusnew => resolved
2015-01-02 15:46hgbotResolutionopen => fixed
2015-01-02 15:46hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/5d9b7b1516694312013db585f8b8bc86e7bd1e7c [^]
2015-01-08 12:30psanjuanNote Added: 0073359
2015-01-08 13:33SandrahuguetReview Assigned To => Sandrahuguet
2015-01-08 13:33SandrahuguetNote Added: 0073364
2015-01-08 13:33SandrahuguetStatusresolved => closed
2015-01-08 13:33SandrahuguetFixed in Version => 3.0PR15Q2
2015-02-04 20:33hudsonbotCheckin
2015-02-04 20:33hudsonbotNote Added: 0074098

Notes
(0073296)
hgbot   
2015-01-02 15:46   
Repository: erp/devel/pi
Changeset: 5d9b7b1516694312013db585f8b8bc86e7bd1e7c
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Wed Dec 31 13:50:58 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/5d9b7b1516694312013db585f8b8bc86e7bd1e7c [^]

Fixes bug 28509: Inventory Amt Update now works with negative stock.

In this case the Qty Count and Qty Book have been reverted in the Physical Inventory Lines and negate them to make them positive, maintaining the difference between them to create the same transaction quantity.

Also getInventoryClosingCost function in AverageAlgorithm has been changed to negate the cost obtained from an inventory closing when the movement qty is positive (closing from negative to 0), because the cost obtained was negative, and this is wrong.

---
M src/org/openbravo/costing/AverageAlgorithm.java
M src/org/openbravo/costing/InventoryAmountUpdateProcess.java
---
(0073359)
psanjuan   
2015-01-08 12:30   
Verified it is now possible to create a negative inventory amount update that properly manages opening/closing inventories.
(0073364)
Sandrahuguet   
2015-01-08 13:33   
Code review done
(0074098)
hudsonbot   
2015-02-04 20:33   
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/f36c91d0ad63 [^]
Maturity status: Test