Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036831
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 04. Warehouse managementmajoralways2017-09-11 18:362017-09-21 16:50
ReporterngarciaView Statuspublic 
Assigned ToAtulOpenbravo 
PriorityurgentResolutionfixedFixed in Version3.0PR17Q4
StatusclosedFix in branchFixed in SCM revisionff6e0aa17abc
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toaferraz
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036831: Wrong average cost after negative stock correction: Total Stock Valuation of Costing tab is not updated

DescriptionWrong average cost after negative stock correction: Total Stock Valuation of Costing tab is not updated
Steps To ReproduceAs group admin role:

   Set the Enable Negative Stock Correction preference to Y
   Log out and log in

   Check the costing rule for F&B US, Inc. is validated without Warehouse Dimension
   Create a new stocked product in F&B US, Inc.
   Add a price of 6USD in Be Soft Dinker Price List
   Create a Goods Receipt for F&B US East Coast, add 2 units of it and complete it
   Create a Physical Inventory for F&B US West Coast, add 1 unit of it a cost of 12 and process it
   Create a Goods Shipment for F&B US East Coast, add 2 units of it and complete it
   Launch the Costing Background Process and check a current average cost of 8 is obtained
 
   Create a new Costing Rule for F&B US, Inc. with Warehouse Dimension
   Validate it

   Create a Goods Receipt for F&B US East Coast, add 1 unit of it and complete it
   Create another Goods Receipt for F&B US East Coast, add 1 unit of it and complete it

   Launch the Costing Background Process again and check although the first average cost for US East Coast is 6USD and a negative stock correction of 4USD has been made against the related transaction (I+) the Total Stock Valuation is 2 (-4 + 6). Thus, the current stock valuation is 8 and the current average cost is 4USD (it should be 6USD)
Proposed SolutionAttached a possible fix that should be properly reviewed and tested.
TagsNo tags attached.
Attached Filesdiff file icon 36831.diff [^] (2,731 bytes) 2017-09-12 17:47 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to design defect 0036642 newTriage Omni WMS [Costing Migration Process] Stock valuation should be updated to 0 when the stock of the product is 0 
related to defect 00339683.0PR17Q1 closeddmiguelez Wrong costs calculated with Backdated Transactions 
related to backport 00298913.0PR15Q2.1 closedumartirena Wrong Total Movement quantity in the costing tab with backdated transactions 

-  Notes
(0099117)
AtulOpenbravo (developer)
2017-09-18 14:38

Test Plan 36831
- Login with F&B International Group Admin role
- Set the Enable Negative Stock Correction preference to Y
- Log out and log in

- Check the costing rule for F&B US, Inc. is validated without Warehouse Dimension.
- Create a new stocked product in F&B US, Inc.
- Add a price of 6USD in Be Soft Drinker Price List.
- Create a Goods Receipt for F&B US East Coast, add 2 units of it and complete it.
- Create a Physical Inventory for F&B US West Coast, add 1 unit of it a cost of 12 and process it.
- Create a Goods Shipment for F&B US East Coast, add 2 units of it and complete it.
- Launch the Costing Background Process and check a current average cost of 8 is set for the product.
 
- Create a new Costing Rule for F&B US, Inc. with Warehouse Dimension
- Validate it.

- Create a Goods Receipt for F&B US East Coast, add 1 unit of it and complete it.
- Create another Goods Receipt for F&B US East Coast, add 1 unit of it and complete it.

- Realize that shipment from F&B US East Coast has total cost as 16 but the incoming cost was 12 so for the first receipt a adjustment of value -4 is done as Negative Stock Correction. Hence for costing line Total Movement Qty and Total Stock Valuation is set as empty and current average cost is 6. This is correct.

Same average cost 6 is also set for second receipt line.
(0099119)
AtulOpenbravo (developer)
2017-09-18 16:13

Test Plan 29891
- Login as F&B International Group Admin role
- Go to product window, create new record
  - Organization: F&B US Inc
  - Search Key: 29891
  - Name: test 29891
  - In Price Tab, add record for Be Soft Drinker price list
     Set Unit Price: 2, List Price: 2

- Go to Purchase order, create a new one for Be Soft Drinker
- In Lines tab, add test 29891 product, set Qty: 200, process order

- Go to Goods Receipt window, create record for Be Soft Drinker set movement date: two weeks ago
- select the order line created before and process it.

- Go to Purchase order, create a new one for Be Soft Drinker
- In Lines tab, add test 29891 product, set Qty: 380, process order

- Go to Goods Receipt window, create record for Be Soft Drinker, set movement date: today
- select the order line created before and process it

- Go to Purchase order, create a new one for Be Soft Drinker
- In Lines tab, add test 29891 product, set Qty: 100, process order

Go to Goods Receipt window, create record for Be Soft Drinker, set movement date: three weeks ago
- select the order line created before and process it

- Go to Costing rule window, for record with F&B US Inc Organization, Process Fix Backdated Transactions: date: 1 month ago

- Go to Process request and launch the costing background process
- Go to the Costing tab of the product: test 29891 product, sort records order by ending date
- Realise that the first line is: qty:100, second line qty:200, third line qty:380 and the total movement qty is empty for all three lines as there exists a adjustment entry of type backdated transaction.

- For costing line, check below tab Average Cost Transactions.
  - For three weeks ago goods receipt line Cumulative Qty = 100
  - For two weeks ago goods receipt line Cumulative Qty = 300
  - For three weeks ago goods receipt line Cumulative Qty = 680

- Add goods receipt for above product with Qty = 250 and process it.
- Launch costing background process.
- Check that costing line for fourth goods receipt has information as below

  Qty: 250
  Total Movement Qty: 930 (680 previous + 250 current)
  Total Stock Valuation: 1860

  This is correct.
(0099130)
hgbot (developer)
2017-09-18 18:20

Repository: erp/devel/pi
Changeset: ff6e0aa17abcc50e6c3389ac6eff9514a1055c62
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Mon Sep 18 20:43:17 2017 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/ff6e0aa17abcc50e6c3389ac6eff9514a1055c62 [^]

Fixes issue 36831: Wrong average cost after negative stock correction

Total stock valuation in Costing tab is not updated
after negative stock correction.

Check if total stock valuation has changed
same as we check if total movement quantity has changed.

When a cost adjustment is done, total stock valuation and
total movement quantity of affected cost will be set as zero,
in order to recalculate them properly next time a new cost is calculated.

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0099131)
aferraz (manager)
2017-09-18 18:56

Code review + Testing OK
(0099413)
hudsonbot (developer)
2017-09-21 16:50

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

- Issue History
Date Modified Username Field Change
2017-09-11 18:36 ngarcia New Issue
2017-09-11 18:36 ngarcia Assigned To => Triage Finance
2017-09-11 18:36 ngarcia Modules => Core
2017-09-11 18:36 ngarcia Resolution time => 1506895200
2017-09-11 18:36 ngarcia Triggers an Emergency Pack => No
2017-09-11 18:37 ngarcia Issue Monitored: networkb
2017-09-11 18:40 ngarcia Relationship added related to 0036642
2017-09-12 14:37 aferraz Assigned To Triage Finance => markmm82
2017-09-12 14:50 aferraz Relationship added related to 0033968
2017-09-12 14:50 aferraz Relationship added related to 0029891
2017-09-12 17:47 aferraz File Added: 36831.diff
2017-09-12 17:50 aferraz Proposed Solution updated
2017-09-15 13:28 aferraz Assigned To markmm82 => AtulOpenbravo
2017-09-18 14:35 AtulOpenbravo Status new => scheduled
2017-09-18 14:38 AtulOpenbravo Note Added: 0099117
2017-09-18 16:13 AtulOpenbravo Note Added: 0099119
2017-09-18 18:20 hgbot Checkin
2017-09-18 18:20 hgbot Note Added: 0099130
2017-09-18 18:20 hgbot Status scheduled => resolved
2017-09-18 18:20 hgbot Resolution open => fixed
2017-09-18 18:20 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ff6e0aa17abcc50e6c3389ac6eff9514a1055c62 [^]
2017-09-18 18:56 aferraz Review Assigned To => aferraz
2017-09-18 18:56 aferraz Note Added: 0099131
2017-09-18 18:56 aferraz Status resolved => closed
2017-09-18 18:56 aferraz Fixed in Version => 3.0PR17Q4
2017-09-21 16:50 hudsonbot Checkin
2017-09-21 16:50 hudsonbot Note Added: 0099413


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker