Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029702Openbravo ERP04. Warehouse managementpublic2015-04-27 12:472015-08-20 23:16
psanjuan 
aferraz 
urgentmajoralways
closedfixed 
20Ubuntu 8.04.1
 
 
vmromanos
Core
No
0029702: Java.lang.NullPointerException after launching the Costing Background process in a product under "Standard" algorithm
Java.lang.NullPointerException after launching the Costing Background process in a product under "Standard" algorithm, once stock is negative
Create a Costing Rule with below set up for a Legal entity:
Costing Algorithm: Standard Algorithm
Warehouse Dimension= No
Backdated Transactions Fixed = Yes

Create a product named "Product Negative 1 Positivo Standard" with below setup:
Purchase Price List 100.00 in "Price" tab.
Navigate to "Costing" tab and enter below data:
Cost Type = Standard
Cost = 100
Starting Date =01-01-2015
Ending Date = 31-12-9999
Manual = Yes
Warehouse = empty

Create a purchase order and a goods receipt for 100 units of this product.
Book the order, and complete and post Goods Receipt.

Create a goods shipment for 100 units of this product.
Complete and post Goods Shipment.

Navigate to Product window, transaction tab and realize that Goods Receipt and Goods Shipment are both cost calculated.

Once more create a goods shipment for 5 units of this product, therefore product stock turns into negative.

Complete goods shipment and post it.

Navigate to Product window, transaction tab and realize that last Goods shipment transaction is also cost calculated.

Navigate to Goods Receipt window and create a new one for 10 units of the product, therefore stock turns into a positive value.

Complete Goods Receipt and try to post it.
An error is shown saying that no there is no cost calculated for the product.

Navigate to Process Request window and realize that Process Request has been executed but there is no message whether it was success or not.

java lang null pointer exception is thrown. See image below:
Costing Background process fails because calculateNegativeStockCorrectionAdjustmentAmount method for Standard Costing Algorithm does not calculate the adjustment amount (it does nothing), and this field keeps as null.

Costing Background process should be change to avoid creating cost adjustments when working with Standard Costing Algorithm in case of PDC, NSC, BDT and MCC
No tags attached.
depends on defect 0029729 closed aferraz Differences between actual cost and standard cost (variances) should not trigger Cost Adjustments. 
png issue_29702.png (238,849) 2015-04-27 12:48
https://issues.openbravo.com/file_download.php?file_id=8024&type=bug
png
Issue History
2015-04-27 12:47psanjuanNew Issue
2015-04-27 12:47psanjuanAssigned To => Triage Finance
2015-04-27 12:47psanjuanModules => Core
2015-04-27 12:47psanjuanTriggers an Emergency Pack => No
2015-04-27 12:48psanjuanFile Added: issue_29702.png
2015-04-27 12:53psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8352#r8352
2015-04-27 13:07psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8353#r8353
2015-04-27 13:12psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8354#r8354
2015-04-30 09:45aferrazAssigned ToTriage Finance => aferraz
2015-04-30 13:34aferrazProposed Solution updated
2015-04-30 13:57psanjuanRelationship addedcaused by 0029729
2015-04-30 13:58psanjuanRelationship deletedcaused by 0029729
2015-04-30 13:58psanjuanRelationship addeddepends on 0029729
2015-06-11 12:51aferrazStatusnew => scheduled
2015-06-11 17:36aferrazStatusscheduled => acknowledged
2015-06-11 17:36aferrazStatusacknowledged => scheduled
2015-06-11 17:37aferrazStatusscheduled => feedback
2015-06-11 17:37aferrazStatusfeedback => new
2015-06-30 14:46psanjuanNote Added: 0078595
2015-07-06 15:46vmromanosStatusnew => scheduled
2015-07-06 15:56hgbotCheckin
2015-07-06 15:56hgbotNote Added: 0078679
2015-07-06 15:56hgbotStatusscheduled => resolved
2015-07-06 15:56hgbotResolutionopen => fixed
2015-07-06 15:56hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b45cf0559789653c61099068e3954a76a3bec0b5 [^]
2015-07-06 15:58vmromanosReview Assigned To => vmromanos
2015-07-06 15:58vmromanosStatusresolved => closed
2015-08-20 23:16hudsonbotCheckin
2015-08-20 23:16hudsonbotNote Added: 0079475

Notes
(0078595)
psanjuan   
2015-06-30 14:46   
Verified.
No JavaLang Null pointer exception is now shown and product transactions are created and valued properly at given standard cost. No cost adjustment is created which is correct.
(0078679)
hgbot   
2015-07-06 15:56   
Repository: erp/devel/pi
Changeset: b45cf0559789653c61099068e3954a76a3bec0b5
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Jul 02 15:12:55 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b45cf0559789653c61099068e3954a76a3bec0b5 [^]

Fixes issue 29729 & Fixes issue 29702 & Fixes issue 29728

Cost Adjustments will not be created in transactions calculated with Standard Algorithm.

---
M src/org/openbravo/costing/CostingServer.java
M src/org/openbravo/costing/PriceDifferenceProcess.java
---
(0079475)
hudsonbot   
2015-08-20 23:16   
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/8c91718397a5 [^]
Maturity status: Test