Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028441Openbravo ERP04. Warehouse managementpublic2014-12-17 18:172014-12-30 23:28
umartirena 
dmiguelez 
urgentmajoralways
closedfixed 
5
 
 
aferraz
Core
No
0028441: [Costing] Validate Costing Rule fails if there are no previous Costing Rules and exists transactions of a date before
[Costing] Validate Costing Rule process fails when is the first Costing Rule to be validated and there are transactions dated on a date before the starting date of the Costing Rule.

This is the error triggered by the process:
"Error:
ERROR: null value in column "dateacct" violates not-null constraint"
Create a new Organization (Legal Entity With Accounting).

Setup the vary basics such as fiscal calendar, open/close periods, BP group, Product group, Price Schema, Price list, a BP and a product. This setup should allow you to create and book a purchase order, a goods receipt of that order and the corresponding purchase invoice.

Go to Goods receipt and create a new one for the new org dated on 01/12/2014. Complete it.

Go to Costing rule and create a new one by entering below data:
* Starting Date: 15/12/2014.
Click on "Validate Costing Rule".

Realize that the error described above is displayed.
In CostingRuleProcess.java there are two places in where TransactionCost records are being created. The accounting date is mandatory for this table and is not being setted. Assign a value to that column.

The two places are:
* initializeOldTrx
* updateInventoriesCostAndProcessInitInventories

No tags attached.
Issue History
2014-12-17 18:17umartirenaNew Issue
2014-12-17 18:17umartirenaAssigned To => dmiguelez
2014-12-17 18:17umartirenaModules => Core
2014-12-17 18:17umartirenaTriggers an Emergency Pack => No
2014-12-17 18:35hgbotCheckin
2014-12-17 18:35hgbotNote Added: 0072669
2014-12-17 18:35hgbotStatusnew => resolved
2014-12-17 18:35hgbotResolutionopen => fixed
2014-12-17 18:35hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/17adffe3f2cda34ce68a0c45b8fb5a7fc959afe1 [^]
2014-12-17 18:56umartirenaNote Added: 0072671
2014-12-18 16:27psanjuanNote Added: 0072703
2014-12-18 17:05aferrazNote Added: 0072705
2014-12-18 17:06aferrazReview Assigned To => aferraz
2014-12-18 17:06aferrazStatusresolved => closed
2014-12-30 23:28hudsonbotCheckin
2014-12-30 23:28hudsonbotNote Added: 0073239

Notes
(0072669)
hgbot   
2014-12-17 18:35   
Repository: erp/devel/pi
Changeset: 17adffe3f2cda34ce68a0c45b8fb5a7fc959afe1
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Wed Dec 17 18:33:43 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/17adffe3f2cda34ce68a0c45b8fb5a7fc959afe1 [^]

Fixes Bug 28441:Validate Costing Rule doesn't fail if there prev transactions.

The process was failing while trying to create Transaction Cost records in initializeOldTrx and updateInventoriesCostAndProcessInitInventories processes. It was not setting any value to accounting date column, which is mandatory. This column has been populated in the following way: If the related transaction is a shipment the accounting date of the shipment is assigned, if not, the movement date of the transaction will be assigned.

---
M src/org/openbravo/costing/CostingRuleProcess.java
---
(0072671)
umartirena   
2014-12-17 18:56   
The column dateacct in m_transaction_cost was made mandatory in Cost Adjustment project.
(0072703)
psanjuan   
2014-12-18 16:27   
Verified.
(0072705)
aferraz   
2014-12-18 17:05   
Code review done.
(0073239)
hudsonbot   
2014-12-30 23:28   
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