Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033599Openbravo ERP04. Warehouse managementpublic2016-08-02 14:192016-08-23 14:26
ngarcia 
nonofrancisco 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q4 
aferraz
Core
No
0033599: Cannot validate a new Costing Rule after validating a costing rule with FIFO algorithm if there exists negative stock
Cannot validate a new Costing Rule after validating a costing rule with FIFO algorithm if there exists negative stock
As group admin role:
   Validate a Costing Rule with FIFO Costing Algorithm for F&B US, Inc.
   Create a product for F&B US, Inc.
   Set Allow Negative Stock at client level
   Create a Goods Receipt for F&B US - West Coast with 2 units of the product
   Create a Goods Shipment for F&B US - West Coast with 1 units of the product
   Create a Goods Shipment for F&B US - East Coast with 1 units of the product
   Check there exists negative stock for the product in East Coast warehouse
   Launch the Costing Background process and check it finishes successfully
   Validate a Costing Rule with Average Algorithm for F&B US, Inc. and check an empty error message is shown
   The log shows:
      
ERROR org.openbravo.costing.CostingRuleProcess -
java.lang.NullPointerException
    at org.openbravo.costing.CostingRuleProcess.updateInventoriesCostAndProcessInitInventories(CostingRuleProcess.java:583)
    at org.openbravo.costing.CostingRuleProcess.execute(CostingRuleProcess.java:132)
...
   
No tags attached.
related to defect 0033379 closed markmm82 Modules Cannot validate a new Costing Rule after validating a costing rule with FIFO algorithm 
related to defect 0034670 closed Triage Omni OMS Modules CostingServer should check if current algorithm supports adjustments, when trying to adjust remainder value in inventory closing 
Issue History
2016-08-02 14:19ngarciaNew Issue
2016-08-02 14:19ngarciaAssigned To => Triage Finance
2016-08-02 14:19ngarciaResolution time => 1470952800
2016-08-02 14:19ngarciaRelationship addedrelated to 0033379
2016-08-02 15:17aferrazAssigned ToTriage Finance => markmm82
2016-08-08 16:04markmm82Statusnew => scheduled
2016-08-12 15:29aferrazAssigned Tomarkmm82 => nonofrancisco
2016-08-22 13:15aferrazProjectModules => Openbravo ERP
2016-08-22 13:15aferrazModules => Core
2016-08-22 13:15aferrazTriggers an Emergency Pack => No
2016-08-22 13:15aferrazCategoryFIFO Costing Algorithm => 04. Warehouse management
2016-08-22 13:29hgbotCheckin
2016-08-22 13:29hgbotNote Added: 0089273
2016-08-22 13:29hgbotStatusscheduled => resolved
2016-08-22 13:29hgbotResolutionopen => fixed
2016-08-22 13:29hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/18744d5df2a4dd6bacc52994e6ffd259eaebc0bd [^]
2016-08-22 13:30aferrazReview Assigned To => aferraz
2016-08-22 13:30aferrazNote Added: 0089274
2016-08-22 13:30aferrazStatusresolved => closed
2016-08-22 13:30aferrazFixed in Version => 3.0PR16Q4
2016-08-22 13:37aferrazNote Added: 0089275
2016-08-22 14:34aferrazNote Added: 0089281
2016-08-22 14:35aferrazNote Edited: 0089281bug_revision_view_page.php?bugnote_id=0089281#r12882
2016-08-23 14:26hudsonbotCheckin
2016-08-23 14:26hudsonbotNote Added: 0089298
2016-12-02 11:45aferrazRelationship addedrelated to 0034670

Notes
(0089273)
hgbot   
2016-08-22 13:29   
Repository: erp/devel/pi
Changeset: 18744d5df2a4dd6bacc52994e6ffd259eaebc0bd
Author: Nono Carballo <nonofce <at> gmail.com>
Date: Thu Aug 18 12:08:06 2016 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/18744d5df2a4dd6bacc52994e6ffd259eaebc0bd [^]

Fixes issue 33599: Can't validate a costing rule after one with FIFO algorithm

Can not validate a new Costing Rule after validating onw with FIFO algorithm if there exists negative stock.
Problem is that FIFO Costing Algorithm is not able to calculate the cost of the closing inventory transaction with negative stock, because there will be more quantity in the Output Stack than the available in the Input Stack.
In that case, "NoCostCalculated" error message will be shown when validating the new Costing Rule until negative stock is regularized.

---
M src/org/openbravo/costing/CostingRuleProcess.java
---
(0089274)
aferraz   
2016-08-22 13:30   
Code review + Testing OK
(0089275)
aferraz   
2016-08-22 13:37   
Test plan:

As group admin role:
   Validate a Costing Rule with FIFO Costing Algorithm for F&B US, Inc.
   Create a product for F&B US, Inc.
   Set Allow Negative Stock at client level
   Create a Goods Receipt for F&B US - West Coast with 2 units of the product
   Create a Goods Shipment for F&B US - West Coast with 1 units of the product
   Create a Goods Shipment for F&B US - East Coast with 1 units of the product
   Check there exists negative stock for the product in East Coast warehouse
   Launch the Costing Background process and check it finishes successfully
   Validate a Costing Rule with Average Algorithm for F&B US, Inc. and check "NoCostCalculated" error message is shown as explained in the wiki
   Create a Physical Inventory for F&B US - East Coast. Click on Create Inventory Count List and select Inventory Quantity < 0. Edit line for created product and set Quantity count = 0 in order to remove negative stock of this product. Process it
   Launch the Costing Background process and check it finishes successfully
   Validate a Costing Rule with Average Algorithm for F&B US, Inc. and check it finishes successfully
(0089281)
aferraz   
2016-08-22 14:34   
(edited on: 2016-08-22 14:35)
Documentation updated (http://forge.openbravo.com/plugins/mwiki/index.php/FIFO [^]):

"Besides that, it will not be possible to validate a new costing rule until negative stock is regularized."

(0089298)
hudsonbot   
2016-08-23 14: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/49d28e45a11a [^]
Maturity status: Test