Openbravo Issue Tracking System - Openbravo ERP
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0036757||Openbravo ERP||04. Warehouse management||public||2017-08-31 12:17||2017-09-21 16:49|
|Assigned To||AtulOpenbravo|| |
|Product Version|| |
|Target Version||Fixed in Version||3.0PR17Q4|| |
|Merge Request Status|
|Review Assigned To||aferraz|
|Regression introduced in release|
|Regression introduced by commit|
|Triggers an Emergency Pack||No|
|Summary||0036757: Negative Stock Correction for remaining stock valuation not done in closing inventory lines (when validating a costing rule)|
|Description||Negative Stock Correction for remaining stock valuation not done in closing inventory lines (when validating a costing rule)|
The problem is that in CostingRuleProcess.updateInventoriesCostAndProcessInitInventories function the transactions related to inventory closing lines are not ordered (getInventoryLineTransactions). Then, when checking the current stock in CostingServer.checkCostAdjustments function by CostAdjustmentUtils.getStockOnTransactionDate function, only the transactions with higher movementqty are taken into account and the currentstock could never be 0
|Steps To Reproduce||As group admin role:|
Having a product with stock in different warehouses and a current average cost different from the current cost of costing tab (in order to have a remaining value after closing inventories)
Having a costing rule already validated with Warehouse Dimension = 'N'
Go to Costing Rule window and validate a new rule for the same organization but with Warehouse Dimension = 'Y'
Check no Negative Stock Correction is done for that product (it is not required to have the preference to enable it)
|Proposed Solution||Add following order by to CostingRuleProcess.getInventoryLineTransactions():|
where.append(" order by trx." + MaterialTransaction.PROPERTY_MOVEMENTQUANTITY + " desc");
where.append(" , trx." + MaterialTransaction.PROPERTY_ID);
|Tags||No tags attached.|
|blocks ||design defect ||0036758|| ||new ||Triage Omni WMS ||After validating a costing rule with warehouse dimension, remaining stock valuation could exist on each warehouse but not global |
|2017-08-31 12:17||ngarcia||New Issue|
|2017-08-31 12:17||ngarcia||Assigned To|| => Triage Finance|
|2017-08-31 12:17||ngarcia||Modules|| => Core|
|2017-08-31 12:17||ngarcia||Triggers an Emergency Pack|| => No|
|2017-08-31 12:17||ngarcia||Issue Monitored: networkb|
|2017-08-31 12:18||ngarcia||Resolution time|| => 1505944800|
|2017-08-31 12:30||ngarcia||Relationship added||blocks 0036642|
|2017-08-31 12:31||ngarcia||Relationship deleted||blocks 0036642|
|2017-08-31 12:31||ngarcia||Relationship added||blocks 0036758|
|2017-08-31 13:26||ngarcia||Steps to Reproduce Updated||bug_revision_view_page.php?rev_id=15773#r15773|
|2017-08-31 13:55||aferraz||Proposed Solution updated|
|2017-08-31 13:56||aferraz||Assigned To||Triage Finance => AtulOpenbravo|
|2017-09-04 08:21||AtulOpenbravo||Note Added: 0098784|
|2017-09-04 14:21||hgbot||Note Added: 0098809|
|2017-09-04 14:21||hgbot||Status||new => resolved|
|2017-09-04 14:21||hgbot||Resolution||open => fixed|
|2017-09-04 14:21||hgbot||Fixed in SCM revision|| => http://code.openbravo.com/erp/devel/pi/rev/2873be0d1b66505d00e85de1ec705aa2500a7874 [^]|
|2017-09-04 14:21||aferraz||Review Assigned To|| => aferraz|
|2017-09-04 14:21||aferraz||Note Added: 0098810|
|2017-09-04 14:21||aferraz||Status||resolved => closed|
|2017-09-04 14:21||aferraz||Fixed in Version|| => 3.0PR17Q4|
|2017-09-21 16:49||hudsonbot||Note Added: 0099356|
- Login as F&B International Group Admin
- Navigate to Product window, add product
Search Key: test costing 36757
Name: test costing 36757
Product Category: Others
- Add Prices information.
1. Price List Version: Tarifa Bebidas Alegres, Unit Price:8.00, List Price:8.00
2. Price List Version: Tarifa de ventas, Unit Price:10.00, List Price:10.00
- Navigate to Purchase Order, create a record for "Bebidas Alegres, S.L." in F&B Espana organization.
- Add line for product "test costing 36757", quantity 100, complete it.
- Create goods receipt for above order in F&B Espana Organization.
- Add two lines for purchase order line for product "test costing 36757" using Create Lines From process as
1. Quantity = 50, Storage Bin = Rn-0-0-0
2. Quantity = 50, Storage Bin = Rs-0-0-0
- Complete goods receipt.
- Generate invoice from receipt and Navigate to Purchase Invoice selecting the invoice previously created.
- Update the Invoice Line unit price to 9.00
- Complete the invoice.
- Make sure that costing background process is executed.
- In Process request, schedule Price Correction Background process with timing Run Immediately.
- Navigate to Costing Rules add record,
Costing Algorithm: Average
Starting Date: Today's Date
Warehouse Dimension = Yes
- Validate costing rule and Navigate to Cost Adjustment window
- Realize that several records with Negative Stock Correction as Source process appears and there exists a record for product "test costing 36757".
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Mon Sep 04 14:03:39 2017 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/2873be0d1b66505d00e85de1ec705aa2500a7874 [^]
Fixes issue 36757: Negative Stock Correction for remaining stock valuation
not done in closing inventory lines (when validating a costing rule)
Add order by clause to sort movement qty desc, material transaction id