Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029891Openbravo ERP04. Warehouse managementpublic2015-04-07 13:552015-05-14 19:16
VictorVillar 
umartirena 
urgentmajoralways
closedfixed 
5
pi 
3.0PR15Q2.13.0PR15Q2.1 
aferraz
Core
No
0029891: Wrong Total Movement quantity in the costing tab with backdated transactions
Wrong Total Movement quantity in the costing tab with backdated transactions
AS group admin role,
   Go to product window,
     create a new product: name: test
    Price tab: Tarifa Bebidas Alegres
      Unit: 2
      List: 2

Go to Purchase order,
   create a new one for bebidas alegres
 Lines tab:
    Add test product
    qty: 200
Go to Goods Receipt window,
   movement date: two weeks ago
 select the order line cretated before.
Process it

Go to Purchase order,
   create a new one for bebidas alegres
 Lines tab:
    Add test product
    qty: 380
Go to Goods Receipt window,
   movement date: today
 select the order line cretated before.
Process it

Go to Purchase order,
   create a new one for bebidas alegres
 Lines tab:
    Add test product
    qty: 100
Go to Goods Receipt window,
   movement date: three weekes ago
 select the order line cretated before.
Process it

Go to Costing rule window.
   Process Fix Backdated Transactions: date: 1 month ago

Go to Process request :
   Launch the costing background process
Go to the Costing tab of the product: test
   order by ending date
    realise that the first line is: qty:100 and the total movement is: 300 which is wrong, should be 100
No tags attached.
related to defect 0036831 closed AtulOpenbravo Wrong average cost after negative stock correction: Total Stock Valuation of Costing tab is not updated 
blocks defect 0029513 closed umartirena Wrong Total Movement quantity in the costing tab with backdated transactions 
Issue History
2015-05-14 16:56aferrazTypedefect => backport
2015-05-14 16:56aferrazTarget Version => 3.0PR15Q2.1
2015-05-14 19:16hgbotCheckin
2015-05-14 19:16hgbotNote Added: 0077471
2015-05-14 19:16hgbotStatusscheduled => resolved
2015-05-14 19:16hgbotResolutionopen => fixed
2015-05-14 19:16hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/bf8ba2e9ab7a62595aae60ff4ed52fe62b25bc6d [^] => http://code.openbravo.com/erp/backports/3.0PR15Q2.1/rev/eb03fd0d3bd28e1d2cd1ddbe51dfdc0fe9eb2abc [^]
2015-05-14 19:16aferrazNote Added: 0077472
2015-05-14 19:16aferrazStatusresolved => closed
2015-05-14 19:16aferrazFixed in Version => 3.0PR15Q2.1
2017-09-12 14:50aferrazRelationship addedrelated to 0036831

Notes
(0077471)
hgbot   
2015-05-14 19:16   
Repository: erp/backports/3.0PR15Q2.1
Changeset: eb03fd0d3bd28e1d2cd1ddbe51dfdc0fe9eb2abc
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Thu May 14 17:11:31 2015 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR15Q2.1/rev/eb03fd0d3bd28e1d2cd1ddbe51dfdc0fe9eb2abc [^]

Fixes bug 29891: Total Movement qty fixed in costing tab with backdated trx

While working with cost adjustments, on certain cases the existing Costing records changes. This can happen because the cost has been recalculated due to backdated transactions, price adjustments, manual cost corrections, etc. In all this cases the 'Total Movement Quantity' field was not being correctly updated.
This field has to store the current stock of the product on that moment. So, each time the costing record is updated it is being checked if this value changes, and if it has changed the current stock is set.

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0077472)
aferraz   
2015-05-14 19:16   
Code review + Testing OK