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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034055
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 04. Warehouse managementmajoralways2016-09-22 13:062016-12-16 18:37
ReporterngarciaView Statuspublic 
Assigned Tomarkmm82 
PriorityurgentResolutionfixedFixed in Version3.0PR17Q1
StatusclosedFix in branchFixed in SCM revision9a17396e89b4
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

0034055: Wrong cost adjustment is made when stock reaches 0 but stock valuation is not 0 due to rounding issues

DescriptionWrong cost adjustment is made when stock reaches 0 but stock valuation is not 0 due to rounding issues.

Should the stock valuation be 0 once the stock is 0 although there is not any new entry in the warehouse?
Steps To ReproduceAs system admin role:
   Set Cost Precision of the currency to 6
As group admin role:
   Set the following two preferences as Y:
      Allow to persist Unit Cost
      Enable Negative Stock Corrections
   Create a new product
   Create a physical inventory and add the previously created product:
      Quantity count: 19
      Cost: 26.24069
   Create two Goods Shipments: one of 10 units and one of 9 units
   Launch the Costing Background Process
   Check the Stock is 0.00 and Stock Valuation is 0.00 in Product - Unit Cost tab
   Launch the Reset Unit Cost process and check Stock Valuation is updated to -0.01, which is wrong.
   Create a new physical inventory:
      Quantity count: 19
      Cost: null
   Launch the Costing Background Process
   Check the Stock is 19 and the Stock Valuation is 498.55378
   Launch the Reset Unit Cost process and check the Stock is updated to 38, which is wrong.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0034099 scheduledAtulOpenbravo Different precision in database than in UI for Unit Cost field of Product - Unit Cost tab 
depends on defect 0034068 closedmarkmm82 Stock valuation is updated to 0 when the stock if 0 by the Reset Unit Cost process but not by Costing Background Process 
has duplicate defect 0034056 closedmarkmm82 Wrong stock in Unit Cost tab of Product window 

-  Notes
(0090166)
ngarcia (developer)
2016-09-22 13:12

During the analysis of this issue, it should be checked if an adjustment should be done in the moment the stock reaches 0 in order the valuation to become 0 too
(0090538)
markmm82 (developer)
2016-10-11 18:21
edited on: 2016-10-17 18:22

Test Plan
As system admin role:
   Set Cost Precision of the currency to 6
As group admin role:
   1. Set the following two preferences as Y:
      Allow to persist Unit Cost
      Enable Negative Stock Corrections
   2. Create a new product
   3. Create a physical inventory and add the previously created product:
      Quantity count: 19
      Cost: 26.24069
   4. Launch the Costing Background Process
      Check the Stock is 19 and Stock Valuation is 498.57311 in Product - Unit Cost tab
   5. Launch the Reset Unit Cost process and check values remain the same
   6. Create two Goods Shipments: one of 10 units and one of 9 units
   7. Launch the Costing Background Process
   8. Check the Stock is 0.00 and Stock Valuation is 0.00 in Product - Unit Cost tab
   9. Launch the Reset Unit Cost process and check values remain the same
   10. Create a new physical inventory:
      Quantity count: 19
      Cost: null
   11.Launch the Costing Background Process
      Check the Stock is 19 and Stock Valuation is 498.56378.
   12. Launch the Reset Unit Cost process and check the Stock is 19 and Stock Valuation is 498.55378.

(0090643)
hgbot (developer)
2016-10-17 17:03

Repository: erp/devel/pi
Changeset: 9a17396e89b4a64f565bb9822a8e9bdd88384255
Author: Mark <markmm82 <at> gmail.com>
Date: Tue Oct 11 15:10:05 2016 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/9a17396e89b4a64f565bb9822a8e9bdd88384255 [^]

Fixes issue 34055: Fixed errors in Costing Background due to rounding issues.

When cost adjustments are created, they should not be taken into account when Stock Valuation is initialized because it duplicates the stock amount (caused by natural union between tables) inside M_INITIALIZE_STOCK_VALUATION function.

---
M src-db/database/model/functions/M_INITIALIZE_STOCK_VALUATION.xml
---
(0090644)
hgbot (developer)
2016-10-17 17:03

Repository: erp/devel/pi
Changeset: 839a52f407fcb6188b0eb4e45456c50a55d2ddaa
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Oct 17 17:00:58 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/839a52f407fcb6188b0eb4e45456c50a55d2ddaa [^]

Related to issue 34055: Code review improvements

Set zero valuation in case stock is zero and it does not exist any record in m_stock_valuation.
Do not sum transaction movementqty, to avoid duplicate stock in case we have more than one m_transaction_cost record related to the same transaction.

---
M src-db/database/model/functions/M_INITIALIZE_STOCK_VALUATION.xml
M src-db/database/model/functions/M_UPDATE_STOCK_VALUATION.xml
---
(0090646)
hgbot (developer)
2016-10-17 18:09

Repository: erp/devel/pi
Changeset: d52eb3542b99b40a33d79e7634a777cd5ae6635c
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Oct 17 18:08:57 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d52eb3542b99b40a33d79e7634a777cd5ae6635c [^]

Related to issue 34055: Remove isunitcost condition

Remove isunitcost condition in M_INITIALIZE_STOCK_VALUATION query.

---
M src-db/database/model/functions/M_INITIALIZE_STOCK_VALUATION.xml
---
(0090648)
aferraz (manager)
2016-10-17 18:24

Code review + Testing OK
(0092525)
hudsonbot (developer)
2016-12-16 18:37

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/dc8bf00badd0 [^]
Maturity status: Test
(0092526)
hudsonbot (developer)
2016-12-16 18:37

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/dc8bf00badd0 [^]
Maturity status: Test
(0092527)
hudsonbot (developer)
2016-12-16 18:37

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/dc8bf00badd0 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2016-09-22 13:06 ngarcia New Issue
2016-09-22 13:06 ngarcia Assigned To => Triage Finance
2016-09-22 13:06 ngarcia Modules => Core
2016-09-22 13:06 ngarcia Resolution time => 1476309600
2016-09-22 13:06 ngarcia Triggers an Emergency Pack => No
2016-09-22 13:06 ngarcia Issue Monitored: networkb
2016-09-22 13:11 ngarcia Relationship added related to 0034056
2016-09-22 13:11 ngarcia Steps to Reproduce Updated View Revisions
2016-09-22 13:12 ngarcia Note Added: 0090166
2016-09-22 13:20 ngarcia Steps to Reproduce Updated View Revisions
2016-09-23 10:32 ngarcia Steps to Reproduce Updated View Revisions
2016-09-28 12:38 aferraz Assigned To Triage Finance => markmm82
2016-09-29 17:20 markmm82 Status new => scheduled
2016-10-10 18:41 aferraz Steps to Reproduce Updated View Revisions
2016-10-10 18:49 aferraz Steps to Reproduce Updated View Revisions
2016-10-10 18:53 aferraz Relationship replaced has duplicate 0034056
2016-10-10 18:54 aferraz Relationship added depends on 0034068
2016-10-10 18:55 aferraz Relationship added related to 0034099
2016-10-11 15:02 aferraz Steps to Reproduce Updated View Revisions
2016-10-11 15:12 aferraz Steps to Reproduce Updated View Revisions
2016-10-11 18:21 markmm82 Note Added: 0090538
2016-10-17 16:56 aferraz Note Edited: 0090538 View Revisions
2016-10-17 17:03 hgbot Checkin
2016-10-17 17:03 hgbot Note Added: 0090643
2016-10-17 17:03 hgbot Status scheduled => resolved
2016-10-17 17:03 hgbot Resolution open => fixed
2016-10-17 17:03 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9a17396e89b4a64f565bb9822a8e9bdd88384255 [^]
2016-10-17 17:03 hgbot Checkin
2016-10-17 17:03 hgbot Note Added: 0090644
2016-10-17 18:09 hgbot Checkin
2016-10-17 18:09 hgbot Note Added: 0090646
2016-10-17 18:22 aferraz Note Edited: 0090538 View Revisions
2016-10-17 18:24 aferraz Review Assigned To => aferraz
2016-10-17 18:24 aferraz Note Added: 0090648
2016-10-17 18:24 aferraz Status resolved => closed
2016-10-17 18:24 aferraz Fixed in Version => 3.0PR17Q1
2016-12-16 18:37 hudsonbot Checkin
2016-12-16 18:37 hudsonbot Note Added: 0092525
2016-12-16 18:37 hudsonbot Checkin
2016-12-16 18:37 hudsonbot Note Added: 0092526
2016-12-16 18:37 hudsonbot Checkin
2016-12-16 18:37 hudsonbot Note Added: 0092527


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker