Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036659Openbravo ERP04. Warehouse managementpublic2017-08-17 13:172017-09-21 16:49
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q4 
aferraz
Core
No
0036659: [Costing Migration Process]: Closing inventories are not leaving stock valuation to 0
[Costing Migration Process]: Closing inventories are not leaving stock valuation to 0

In calculateCosts function of CostingMigrationProcess class, in order to adjust the cost of the last transaction, the movementqty is wrongly compared with the stock (movementqty will be negative when stock is positive):

        if (trx.getMovementQuantity().compareTo(totalStock) == 0) {
          // Last transaction adjusts remaining cost amount.
          trxCost = totalCost;
        }
*
Change in CostingMigrationProcess.java:

if (trx.getMovementQuantity().compareTo(totalStock) == 0) {
  // Last transaction adjusts remaining cost amount.
  trxCost = totalCost;
}

with:

if (trx.getMovementQuantity().negate().compareTo(totalStock) == 0) {
  // Last transaction adjusts remaining cost amount.
  trxCost = totalCost;
}
No tags attached.
related to design defect 0036642 new Triage Omni WMS [Costing Migration Process] Stock valuation should be updated to 0 when the stock of the product is 0 
related to defect 0036675 closed markmm82 [Costing Migration Process]: Transactions related with closing inventory lines do not have an entry in Transaction Cost tab 
Issue History
2017-08-17 13:17ngarciaNew Issue
2017-08-17 13:17ngarciaAssigned To => Triage Finance
2017-08-17 13:17ngarciaModules => Core
2017-08-17 13:17ngarciaResolution time => 1504735200
2017-08-17 13:17ngarciaTriggers an Emergency Pack => No
2017-08-17 13:17ngarciaIssue Monitored: networkb
2017-08-17 13:20ngarciaRelationship addedrelated to 0036642
2017-08-17 13:27aferrazAssigned ToTriage Finance => markmm82
2017-08-17 13:28aferrazProposed Solution updated
2017-08-17 13:34aferrazProposed Solution updated
2017-08-17 16:10markmm82Statusnew => scheduled
2017-08-18 08:37hgbotCheckin
2017-08-18 08:37hgbotNote Added: 0098535
2017-08-18 08:37hgbotStatusscheduled => resolved
2017-08-18 08:37hgbotResolutionopen => fixed
2017-08-18 08:37hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/eedde20727c8bf0ef1c4228dfc7fc29a1bbd89b3 [^]
2017-08-18 08:48aferrazReview Assigned To => aferraz
2017-08-18 08:48aferrazNote Added: 0098536
2017-08-18 08:48aferrazStatusresolved => closed
2017-08-18 08:48aferrazFixed in Version => 3.0PR17Q4
2017-08-21 11:40ngarciaRelationship addedrelated to 0036675
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099312

Notes
(0098535)
hgbot   
2017-08-18 08:37   
Repository: erp/devel/pi
Changeset: eedde20727c8bf0ef1c4228dfc7fc29a1bbd89b3
Author: Mark <markmm82 <at> gmail.com>
Date: Thu Aug 17 10:35:39 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/eedde20727c8bf0ef1c4228dfc7fc29a1bbd89b3 [^]

Fixes issue 36659: Closing inventories are not leaving stock valuation to 0

When Costing Migration Process is executed closing inventories are not leaving
stock valuation to 0. In calculateCosts function of CostingMigrationProcess class,
in order to adjust the cost of the last transaction, the movementqty was wrongly
compared with the stock because it doesn't take into account that movementqty will
be negative (as it belongs to closing inventory transactions) when stock is positive.

To fix it, the movement quantity is negated when comparing with stock.

---
M src/org/openbravo/costing/CostingMigrationProcess.java
---
(0098536)
aferraz   
2017-08-18 08:48   
Code review OK
(0099312)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test