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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0023999
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 04. Warehouse managementmajoralways2013-06-05 16:422013-08-01 17:51
ReporterVictorVillarView Statuspublic 
Assigned Topramakrishnan 
PriorityurgentResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisione7559d190d29
ProjectionnoneETAnoneTarget Version3.0MP26
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned ToVictorVillar
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0023999: Wrong cost calculation for production products under some circunstancies

DescriptionWrong cost calculation for production products under some circunstancies, regarding the new costing engine.

Production 1:Movement date: 22 April, Transaction process date: today
 - product A (P+).
 - product B (p-)

Production 2: Movement date: 22 April, Transaction process date: today
 - product B (P+)
 - product C (P-)

Cost calculation of Production 2 is OK, so the transaction cost for product B is OK.
The Starting date of costing record generated for the product B, is 'TODAY', so when the ma_production_cost function, tries to calculate the cost for the transaction of the product A, will search a register in the m_costing table for product B valid from the 22th of April (the movement date) instead the transaction process date.
Steps To ReproduceProduction 1:Movement date: 22 April, Transaction process date: today
 - product A (P+).
 - product B (p-)

Production 2: Movement date: 22 April, Transaction process date: today
 - product B (P+)
 - product C (P-)

Cost calculation of Production 2 is OK, so the transaction cost for product B is OK.
The Starting date of costing record generated for the product B, is 'TODAY', so when the ma_production_cost function, tries to calculate the cost for the transaction of the product A, will search a register in the m_costing table for product B valid from the 22th of April (the movement date) instead the transaction process date.
Proposed SolutionThere are two options to solve this issue:

The PL should be split in two parts, the first one for the instances already migrated and the second one for the instances that use the old costing engine.

* Part 1: Instances already migrated
1.- if the v_ProductionDate = MAX(movementdate) variable is only used for costing purposes, 'costing queries'. The solution should be v_ProductionDate = MAX(trxprocessdate), doing a join with the m_transaction table.

2.- if the v_ProductionDate = MAX(movementdate) variable is not used only in 'costing queries', the solution should be add a new variable = MAX(trxprocessdate), doing a join with the m_transaction table in the same query where you define the v_ProductionDate and add the new variable only in the 'costing queries'

*Part2: Instances is not migrated:

Should contain the same function as now.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0059678)
ioritzCia (developer)
2013-06-26 12:57

Testing plan:

- You need three production products. If you have them right, if not:
  - Create three new products.
  - Mark production = 'Y'
  - Imagine A, B and C products.
  - Having the two productions B is going to be P+ and C is going to be P- of the first one. A is going to be P+ and B is going to be P- of the second one. So, we need to initialize the costs of C. We can do this with a Physical Inventory, a Goods Receipt or manually.
- Create a Physical Inventory for C and in the lines initialize it's cost.
- Go to Process Plan window and create one for B and C and another one for A and B as said before.
- Go to Work Requirement window.
  - Create two Work Requirement one for each Process Plan.
  - Process the Work Requirements and create the Work Efforts.
- Go to Production Run window.
  - There are already two created corresponding to the previous Work Requirements.
  - Set for each one the completed quantity.
  - Set for each one the cost center version. (The cost center for this case does not need anything special just create it and name it)
  - Set the movement date previous to the transaction date, so that the cost in of the product B is different for the movement date in comparison to the one for the transaction date.
  - Create the standards.
  - Process the Production Run the production run for product B must be processed before the one for product A.
- Check the Costing tab for products A and B.
  - The last row generated for product A must have in the Net Unit Price column, the same amount of the Cost column for the product B for the row in product B that matches the Transaction Date and not the Movement Date.
(0059679)
hgbot (developer)
2013-06-26 12:58

Repository: erp/devel/pi
Changeset: 167acdfcb2b04b23b0409279645ebd6f13691952
Author: Ioritz Cia <ioritz.cia <at> openbravo.com>
Date: Tue Jun 25 16:34:37 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/167acdfcb2b04b23b0409279645ebd6f13691952 [^]

Fixes issue 23999: Wrong production cost calculation.

---
M src-db/database/model/functions/MA_PRODUCTION_COST.xml
---
(0059703)
hudsonbot (developer)
2013-06-27 12:56

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/badcced5427d [^]

Maturity status: Test
(0059795)
hgbot (developer)
2013-07-01 17:59

Repository: erp/devel/pi
Changeset: c0b047987095c3b7cea09de4e667c44a5a24fec9
Author: Ioritz Cia <ioritz.cia <at> openbravo.com>
Date: Mon Jul 01 17:59:17 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/c0b047987095c3b7cea09de4e667c44a5a24fec9 [^]

Related to issue 23999: Backout of changeset 167acdfcb2b0.

---
M src-db/database/model/functions/MA_PRODUCTION_COST.xml
---
(0059803)
hudsonbot (developer)
2013-07-02 10:31

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/62f36c5324f7 [^]

Maturity status: Test
(0060414)
hgbot (developer)
2013-07-31 13:28

Repository: erp/devel/pi
Changeset: e7559d190d29acfb5d151b1947dfae8f07a4169d
Author: Ioritz Cia <ioritz.cia <at> openbravo.com>
Date: Wed Jul 31 13:27:18 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e7559d190d29acfb5d151b1947dfae8f07a4169d [^]

Fixes issue 23999: Backout of changeset c0b047987095.
The issue is fixed again.

---
M src-db/database/model/functions/MA_PRODUCTION_COST.xml
---
(0060416)
VictorVillar (developer)
2013-07-31 13:29

verified
(0060460)
hudsonbot (developer)
2013-08-01 17:51

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/37aeae33b0c0 [^]

Maturity status: Test

- Issue History
Date Modified Username Field Change
2013-06-05 16:42 VictorVillar New Issue
2013-06-05 16:42 VictorVillar Assigned To => dmiguelez
2013-06-05 16:42 VictorVillar Modules => Core
2013-06-05 16:42 VictorVillar Resolution time => 1372629600
2013-06-05 16:42 VictorVillar Triggers an Emergency Pack => No
2013-06-05 16:42 VictorVillar Issue Monitored: networkb
2013-06-06 16:45 dmiguelez Assigned To dmiguelez => jonalegriaesarte
2013-06-24 09:29 jonalegriaesarte Assigned To jonalegriaesarte => ioritzCia
2013-06-25 16:37 ioritzCia Status new => scheduled
2013-06-25 16:37 ioritzCia fix_in_branch => pi
2013-06-26 12:57 ioritzCia Note Added: 0059678
2013-06-26 12:58 hgbot Checkin
2013-06-26 12:58 hgbot Note Added: 0059679
2013-06-26 12:58 hgbot Status scheduled => resolved
2013-06-26 12:58 hgbot Resolution open => fixed
2013-06-26 12:58 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/167acdfcb2b04b23b0409279645ebd6f13691952 [^]
2013-06-27 12:56 hudsonbot Checkin
2013-06-27 12:56 hudsonbot Note Added: 0059703
2013-07-01 17:59 hgbot Checkin
2013-07-01 17:59 hgbot Note Added: 0059795
2013-07-01 18:05 ioritzCia Status resolved => new
2013-07-01 18:05 ioritzCia Resolution fixed => open
2013-07-01 18:05 ioritzCia Target Version 3.0MP25 => 3.0MP26
2013-07-01 18:05 ioritzCia fix_in_branch pi =>
2013-07-01 18:05 ioritzCia Steps to Reproduce Updated View Revisions
2013-07-02 10:31 hudsonbot Checkin
2013-07-02 10:31 hudsonbot Note Added: 0059803
2013-07-29 12:04 jonalegriaesarte Assigned To ioritzCia => pramakrishnan
2013-07-31 13:28 hgbot Checkin
2013-07-31 13:28 hgbot Note Added: 0060414
2013-07-31 13:28 hgbot Status new => resolved
2013-07-31 13:28 hgbot Resolution open => fixed
2013-07-31 13:28 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/167acdfcb2b04b23b0409279645ebd6f13691952 [^] => http://code.openbravo.com/erp/devel/pi/rev/e7559d190d29acfb5d151b1947dfae8f07a4169d [^]
2013-07-31 13:29 VictorVillar Review Assigned To => VictorVillar
2013-07-31 13:29 VictorVillar Note Added: 0060416
2013-07-31 13:29 VictorVillar Status resolved => closed
2013-08-01 17:51 hudsonbot Checkin
2013-08-01 17:51 hudsonbot Note Added: 0060460


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker