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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0028301
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 04. Warehouse managementmajoralways2014-11-27 12:462014-12-30 23:26
ReporterpsanjuanView Statuspublic 
Assigned Toumartirena 
PriorityurgentResolutionfixedFixed in Version3.0PR15Q1
StatusclosedFix in branchFixed in SCM revisioncc0f6b428be8
ProjectionnoneETAnoneTarget Version
OSLinux 32 bitDatabaseOracleJava version1.6
OS VersionUbuntu 8.04.1Database version11.1.0.6.0Ant version1.7.0
Product VersionSCM revision 
Review Assigned ToSandrahuguet
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0028301: [Costing] Cost not properly calculated after booking two backdated transactions

Description[Costing] Cost not properly calculated after booking two backdated transactions
Steps To ReproduceIn QA testing client go to Product window.
Create a new product named KDK01 for Spain org. Navigate to price tab and select purchase price list. Enter a unit/list price of 10.00 €

Go to purchase order and create a new one dated on 19-11-2014. PO 1. Select Spain org and vendor A. Enter 200 units. Book the order.

Go to goods receipt window and create a new one dated on 19-11-2014 by selecting purchase order above. GR 01. Receipt 200 units. Enter an storage bin. Complete the receipt.

Go to process request window and run costing background process.

Go back to the goods receipt and get it posted. Realize that value posted is 2000 (200 units * 10 €/unit)

Go to purchase order window and create a new one for Spain org, KDK01 product, vendor A, dated on 20-11-2014. PO 2. Enter 300 units a 10.00 price. Book the order and leave it there.

Create a new purchase order for all the same dated on 26-11-2014. PO 3. Enter 400 units and change the price to 12. Book the order.

Go to goods receipt and create a new one dated on 26-11-2014. Use create lines from and select purchase order PO3 dated on 26-11-2014. Receipt 380 units. Complete.

Go to process request window and run costing background process.

Go back to goods receipt and get it posted. Realize that value posted is 4560.00 (380 units * 12 €/unit)

Navigate to product window, search product KDK01 and go to costing tab.
Realize that there are two cost related lines.
Line related to inventory trans dated on 19-11-2014 - cost 10 units 200
Line related to inventory trans dated on 26-11-2014 - cost 11.3103 units 580

Go to goods receipt window and create a new one dated on 17-11-2014. Use create lines from and select purchase order PO2 dated on 20-11-2014. Receipt 100 units.

Go to process request window and run costing background process.

Go back to goods receipt and get the one dated on 17-11-2014 posted. Realize that value posted is 1000 (100 units x 10 €/unit)

Go to product window, search by product KDK01 and navigate to costing tab. Realize that there are 3 lines.
Line related to inventory trans dated on 17-11-2014 - cost 10 units 680
Line related to inventory trans dated on 19-11-2014 - cost 10 units 200
Line related to inventory trans dated on 26-11-2014 - cost 11.3103 units 580

(A backdated transaction has been created in cost adjustment window dated on 17-11-2014 window which is correct, for an amount = 0.00)

Go to goods receipt window and create a new one dated on 02-11-2014, use create lines from and select PO 3 dated on 26-11-2014. Receipt 10 units. Complete.

Run costing background process.

Go back to goods receipt dated on 02-11-2014 and get it posted. Realize that value posted is 120 (10 units x 12 €/unit)

Go to product window and search KDK01 product, navigate to costing tab.
There are 5 lines there which is not correct.

See image KDK01_Cost_before Landed Cost

Line related to inventory trans 02-11-2014 - cost 12 - units 690 - correct
Line related to inventory trans 17-11-2014 - cost 10.1818 - units 680 - correct
Line related to inventory trans 19-11-2014 - cost 10.0645 - units 200 - correct
Line related to inventory trans 26-11-2014 - cost 11.1304 - units 580 - this one is not correct because the cost is not correct.

And a Line related to no inventory trans - cost 11.1304 - net unit price 11.13 - this is not correct. This line should not be there.

Enter now a landed cost dated on 26-11-2014. Navigate to Cost tab and select two landed cost :Fees for an amount of 200 € and Transportation Cost for an amount of 950€. Total 1150. Go to Receipt tab and select the receipt dated on 26-11-2014. Process. A cost adjustment is created for the product and for an amount of 1150.

Go to product window, search the product and navigate to costing tab. There are 6 lines there which is not correct.

See image KDK01_Cost_after Landed Cost

Line related to inventory trans 02-11-2014 - cost 12 - units 690 - correct
Line related to inventory trans 17-11-2014 - cost 10.1818 - units 680 - correct
Line related to inventory trans 19-11-2014 - cost 10.0645 - units 200 - correct
Line related to inventory trans 26-11-2014 - cost 12.7971 - net unit price 15.03 - units 580 - this one is not totally correct net unit price should be 12

Line related to no inventory trans - cost 11.1304 - net unit price 11.13 - this is not correct. This line should not be there.
Line related to no inventory trans - cost 12.7971 - net unit price 12.80 - this one is not correct. this line should not be there.
Proposed SolutionBooking order:
date//units//price//otal value
19-11//200//10 //2000
26-11 // 380 // 12 // 4560
17-11 // 100 // 10 // 1000
02-11 // 10 // 12 // 120

Correct costing calculation (before landed cost booking) should be:

Line related to inventory trans 02-11-2014 - cost 12 - net unit price 12 - units 690
Line related to inventory trans 17-11-2014 - cost 10.1818 - net unit price 10 - units 680
Line related to inventory trans 19-11-2014 - cost 10.0645 - net unit price 10 - units 200
Line related to inventory trans 26-11-2014 - cost 11.1304 - net unit price 12 - units 580

02/11/2014 = 12 €/ud => 10 uds x 12 €/ud
17/11/2014 = 10.1818 €/ud => (120 € + 1000 €)/110 units
19/11/2014 = 10.0645 => (110*10.1818) + 2000 / 310 units
26/11/2014 = 11.1304 => (310*10.0645) + 4560 / 690 units

Correct cost calculation after landed cost is:

Line related to inventory trans 02-11-2014 - cost 12 - net unit price 12 - units 690
Line related to inventory trans 17-11-2014 - cost 10.1818 - net unit price 10 - units 680
Line related to inventory trans 19-11-2014 - cost 10.0645 - net unit price 10 - units 200
Line related to inventory trans 26-11-2014 - cost 12.7971 - net unit price 12 - units 580

02/11/2014 = 12 €/ud => 10 uds x 12 €/ud
17/11/2014 = 10.1818 €/ud => (120 € + 1000 €)/110 units
19/11/2014 = 10.0645 => (110*10.1818) + 2000 / 310 units
26/11/2014 = 12.7971 => (310*10.0645) + 4560 + 1150 / 690 units
TagsNo tags attached.
Attached Filespng file icon KDD01_Cost_beforeLandedCost.png [^] (121,547 bytes) 2014-11-27 13:20


png file icon KDD01_cost_afterLandedCost.png [^] (92,851 bytes) 2014-11-27 13:20

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0028192 closedumartirena [Costing] Net Unit Price field in Costing tab is not properly calculated 

-  Notes
(0072274)
hgbot (developer)
2014-12-04 11:38

Repository: erp/devel/pi
Changeset: cc0f6b428be860e58b5708d67220832aef3ee83e
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Thu Dec 04 11:37:10 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/cc0f6b428be860e58b5708d67220832aef3ee83e [^]

Fixes Issue 28301: Cost is properly calculated after two backdated transactions.

The problem was in updateBDCostingTimeRange function. While updating the backdated average costing time, if a previous costing record was found, the future ending date was assigned to backdated costing record, not to the current costing, leaving as current costing the backdated costing record, and this is wrong.

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0072299)
hgbot (developer)
2014-12-05 08:35

Repository: erp/devel/pi
Changeset: 8c12e7511fd536e0baf208db846c027431365f7d
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Fri Dec 05 08:33:57 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/8c12e7511fd536e0baf208db846c027431365f7d [^]

Related to Issue 28301: Fix on updateBDCostingTimeRange function.

If the movement date of the inventory transaction related to current costing record is before the movement date of the inventory transaction related to backdated costing record, then the backdated costing record would be the current costing record. In other case the current costing record would remain as current costing record.

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0072307)
psanjuan (manager)
2014-12-05 11:26

Verified.
Just Code review missing. Once done this issue can be closed.
(0072725)
Sandrahuguet (developer)
2014-12-19 11:13

Code review done
(0073169)
hudsonbot (developer)
2014-12-30 23:26

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/6525fe229e06 [^]
Maturity status: Test
(0073180)
hudsonbot (developer)
2014-12-30 23:26

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

- Issue History
Date Modified Username Field Change
2014-11-27 12:46 psanjuan New Issue
2014-11-27 12:46 psanjuan Assigned To => dmiguelez
2014-11-27 12:46 psanjuan Modules => Core
2014-11-27 12:46 psanjuan Triggers an Emergency Pack => No
2014-11-27 12:49 psanjuan Steps to Reproduce Updated View Revisions
2014-11-27 12:55 psanjuan Steps to Reproduce Updated View Revisions
2014-11-27 12:55 psanjuan Proposed Solution updated
2014-11-27 13:09 psanjuan Steps to Reproduce Updated View Revisions
2014-11-27 13:09 psanjuan Proposed Solution updated
2014-11-27 13:13 psanjuan Steps to Reproduce Updated View Revisions
2014-11-27 13:13 psanjuan Proposed Solution updated
2014-11-27 13:19 psanjuan Steps to Reproduce Updated View Revisions
2014-11-27 13:19 psanjuan Proposed Solution updated
2014-11-27 13:19 psanjuan Relationship added related to 0028113
2014-11-27 13:19 psanjuan Assigned To dmiguelez => Sandrahuguet
2014-11-27 13:20 psanjuan File Added: KDD01_Cost_beforeLandedCost.png
2014-11-27 13:20 psanjuan File Added: KDD01_cost_afterLandedCost.png
2014-12-01 10:40 psanjuan Relationship deleted related to 0028113
2014-12-01 10:40 psanjuan Relationship added related to 0028192
2014-12-04 11:38 hgbot Checkin
2014-12-04 11:38 hgbot Note Added: 0072274
2014-12-04 11:38 hgbot Status new => resolved
2014-12-04 11:38 hgbot Resolution open => fixed
2014-12-04 11:38 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cc0f6b428be860e58b5708d67220832aef3ee83e [^]
2014-12-05 08:35 hgbot Checkin
2014-12-05 08:35 hgbot Note Added: 0072299
2014-12-05 11:06 psanjuan Proposed Solution updated
2014-12-05 11:12 psanjuan Proposed Solution updated
2014-12-05 11:14 psanjuan Proposed Solution updated
2014-12-05 11:17 psanjuan Proposed Solution updated
2014-12-05 11:19 psanjuan Proposed Solution updated
2014-12-05 11:25 psanjuan Proposed Solution updated
2014-12-05 11:25 psanjuan Proposed Solution updated
2014-12-05 11:26 psanjuan Note Added: 0072307
2014-12-11 16:45 Sandrahuguet Review Assigned To => Sandrahuguet
2014-12-11 16:45 Sandrahuguet Note Added: 0072432
2014-12-11 16:45 Sandrahuguet Status resolved => closed
2014-12-11 16:45 Sandrahuguet Fixed in Version => 3.0PR15Q1
2014-12-11 18:12 Sandrahuguet Note Deleted: 0072432
2014-12-11 18:13 Sandrahuguet Status closed => new
2014-12-11 18:13 Sandrahuguet Resolution fixed => open
2014-12-11 18:13 Sandrahuguet Fixed in Version 3.0PR15Q1 =>
2014-12-11 18:13 Sandrahuguet Status new => scheduled
2014-12-11 18:13 Sandrahuguet fix_in_branch => pi
2014-12-11 18:13 Sandrahuguet Assigned To Sandrahuguet => umartirena
2014-12-11 18:13 Sandrahuguet Status scheduled => resolved
2014-12-11 18:13 Sandrahuguet Resolution open => fixed
2014-12-11 18:15 Sandrahuguet Review Assigned To Sandrahuguet =>
2014-12-11 18:15 Sandrahuguet fix_in_branch pi =>
2014-12-12 12:35 Sandrahuguet Review Assigned To => gorkaion
2014-12-19 11:13 Sandrahuguet Review Assigned To gorkaion => Sandrahuguet
2014-12-19 11:13 Sandrahuguet Note Added: 0072725
2014-12-19 11:13 Sandrahuguet Status resolved => closed
2014-12-19 11:13 Sandrahuguet Fixed in Version => 3.0PR15Q1
2014-12-30 23:26 hudsonbot Checkin
2014-12-30 23:26 hudsonbot Note Added: 0073169
2014-12-30 23:26 hudsonbot Checkin
2014-12-30 23:26 hudsonbot Note Added: 0073180


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker