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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0038157
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 04. Warehouse managementmajoralways2018-03-16 10:512018-03-23 21:22
ReportergorkaionView Statuspublic 
Assigned Tocollazoandy4 
PriorityimmediateResolutionfixedFixed in Version3.0PR18Q2
StatusclosedFix in branchFixed in SCM revision686b219d7c5e
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Todmiguelez
Web browser
ModulesCore
Regression levelPre packaging ( pi )
Regression date2018-01-15
Regression introduced in releasepi
Regression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/6fc5c9829dff02db5bb10f5f3b09c2cb137ef0d0 [^]
Triggers an Emergency PackNo
Summary

0038157: Receipts originally calculated with avg and adjusted by price difference correction are readjusted if avg cost changes

DescriptionHaving a Goods Receipt with no related Purchase Order but a related Purchase Invoice.

When the cost of the receipt is calculated the current average is used. Later the Price Difference correction process is launched and the cost is adjusted with the invoice price.

Now a previous transaction is adjusted so the average cost changes. The Goods Receipt is adjusted again with the new average cost not taking into account the Invoice Price. This last adjustment should not happen as the cost of the receipt is not based on the average cost anymore.

After fix of issue 0037279 when a incoming transaction is calculated using the
average cost. If the average cost used to calculate it is later changed by some cost adjustment the cost of this transaction is calculated again.

For example:
- Physical Inventories that increase stock and does not have a cost defined.
- Goods Receipts without a related Purchase Order.

Steps To ReproduceEnable preference to automatically execute Price Difference Correction (Property: "Enable automatic Price Difference Corrections").

On a product with an average cost.
* Create a Purchase Invoice for that product with qty 2000 and price 1.
* Create a Goods Receipt using the Create Lines From to select the created invoice and change the quantity to 1000.
* Repeat previous step to create a second Goods Receipt with the remaining 1000 qty.
* Execute Costing Background process and check in the Product -> Transactions tab that the receipts are calculated with Average Cost and adjusted with the invoice price.
* On the Transactions tab select the first Receipt and click on Manual Adjustment. Set amount=10000, incremental=Yes and Unit Cost = No.
* Check that the second receipt is adjusted again and the cost is based with the new Average Cost.
*
Proposed SolutionWhen checking if the transaction is based on the average cost take into account Goods Receipts that are already adjusted by the Price Difference Correction.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
caused by defect 0037279 closednonofrancisco Physical Inventory lines which increase stock and do not have a cost defined are not adjusted 

-  Notes
(0103380)
collazoandy4 (reporter)
2018-03-20 23:09

Test Plan
  Enable preference to automatically execute Price Difference Correction (Property: "Enable automatic Price Difference Corrections").
  Create a new product with purchase price list of 5.0, set an avg cost of 7
  Create and book a Purchase Invoice for the previous product with qty 2000 and price 1.0
  Create two Goods Receipts from the previous invoice with qty 1000
  Execute Costing Background process and check in the Product -> Transactions tab that the receipts are calculated with Average Cost and adjusted with the invoice price.
  On the Transactions tab select the first Receipt and click on Manual Adjustment. Set amount=10000, incremental=Yes and Unit Cost = No.
  Check that the second receipt is not adjusted
(0103459)
hgbot (developer)
2018-03-23 09:34

Repository: erp/devel/pi
Changeset: 686b219d7c5e5d5c118ec449fca312a0b58921f8
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Mon Mar 19 18:11:05 2018 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/686b219d7c5e5d5c118ec449fca312a0b58921f8 [^]

Fixes issue 38157: Receipts originally calculated with avg and adjusted by price
difference correction are readjusted if avg cost changes.

Having a Goods Receipt with no related Purchase Order but a related Purchase
Invoice, when the cost of the receipt is calculated the current average is used.
If the average cost used to calculate it is later changed by some cost adjustment
the cost of this transaction is calculated again even if the receipt was adjusted
by the Price Difference Correction process.

Now when checking if the transaction is based on the average cost take into account
if the receipts are already adjusted by the Price Difference Correction.

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0103460)
hgbot (developer)
2018-03-23 09:34

Repository: erp/devel/pi
Changeset: 5117700335fbce7a2d983b4007269eaace3d4205
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Tue Mar 20 18:01:55 2018 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/5117700335fbce7a2d983b4007269eaace3d4205 [^]

Related to issue 38157: Updated test 37279 with the new behavior

The JUnit test for issue 37279 was updated to take into account the new behavior
when the Goods Receipts have not Purchase Order related and the avg cost is updated

---
M src-test/src/org/openbravo/test/costing/TestIssue37279.java
M src-test/src/org/openbravo/test/costing/utils/TestCostingUtils.java
---
(0103462)
hgbot (developer)
2018-03-23 09:34

Repository: erp/devel/pi
Changeset: d3cd0c58c993b0eebae2fef4e09308dbb3112be3
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Fri Mar 23 09:34:17 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/d3cd0c58c993b0eebae2fef4e09308dbb3112be3 [^]

Related to Issue 38157. Code Review changes:

* Extracted String into constant
* In hql query, add explicit property instead of retrieving it from the object,
  it makes query easier to read

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0103464)
dmiguelez (developer)
2018-03-23 09:36

Code Review + Testing Ok
(0103478)
hudsonbot (developer)
2018-03-23 21:22

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/42e5233f5207 [^]
Maturity status: Test
(0103479)
hudsonbot (developer)
2018-03-23 21:22

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/42e5233f5207 [^]
Maturity status: Test
(0103481)
hudsonbot (developer)
2018-03-23 21:22

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

- Issue History
Date Modified Username Field Change
2018-03-16 10:51 gorkaion New Issue
2018-03-16 10:51 gorkaion Assigned To => Triage Finance
2018-03-16 10:51 gorkaion Modules => Core
2018-03-16 10:51 gorkaion Resolution time => 1522965600
2018-03-16 10:51 gorkaion Regression level => Pre packaging ( pi )
2018-03-16 10:51 gorkaion Regression date => 2018-01-15
2018-03-16 10:51 gorkaion Regression introduced in release => pi
2018-03-16 10:51 gorkaion Regression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/6fc5c9829dff02db5bb10f5f3b09c2cb137ef0d0 [^]
2018-03-16 10:51 gorkaion Triggers an Emergency Pack => No
2018-03-16 10:53 gorkaion Relationship added caused by 0037279
2018-03-16 10:56 aferraz Assigned To Triage Finance => collazoandy4
2018-03-16 16:06 collazoandy4 Status new => scheduled
2018-03-19 10:14 ngarcia Issue Monitored: ngarcia
2018-03-20 23:09 collazoandy4 Note Added: 0103380
2018-03-23 09:34 hgbot Checkin
2018-03-23 09:34 hgbot Note Added: 0103459
2018-03-23 09:34 hgbot Status scheduled => resolved
2018-03-23 09:34 hgbot Resolution open => fixed
2018-03-23 09:34 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/686b219d7c5e5d5c118ec449fca312a0b58921f8 [^]
2018-03-23 09:34 hgbot Checkin
2018-03-23 09:34 hgbot Note Added: 0103460
2018-03-23 09:34 hgbot Checkin
2018-03-23 09:34 hgbot Note Added: 0103462
2018-03-23 09:36 dmiguelez Review Assigned To => dmiguelez
2018-03-23 09:36 dmiguelez Note Added: 0103464
2018-03-23 09:36 dmiguelez Status resolved => closed
2018-03-23 09:36 dmiguelez Fixed in Version => 3.0PR18Q2
2018-03-23 21:22 hudsonbot Checkin
2018-03-23 21:22 hudsonbot Note Added: 0103478
2018-03-23 21:22 hudsonbot Checkin
2018-03-23 21:22 hudsonbot Note Added: 0103479
2018-03-23 21:22 hudsonbot Checkin
2018-03-23 21:22 hudsonbot Note Added: 0103481


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker