Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0025105Openbravo ERP05. Production managementpublic2013-11-07 17:272017-02-15 09:47
VictorVillar 
Triage Omni OMS 
immediatemajoralways
newopen 
5
pi 
 
Core
No
0025105: The Production cost should be calculated independently if the Cost center is defined in the Production Run
The Production cost should be calculated independently if the Cost center is defined in the Production Run
The Production cost should be calculated independently if the Cost center is defined in the Production Run
There is a restriction at the beginning of ma_production_cost function when creates the Cur_ProductionPlan cursor --> "AND pp.MA_COSTCENTER_VERSION_ID IS NOT NULL":


SELECT pp.M_ProductionPlan_ID, pp.ma_costcenter_version_id,
SUM(CASE pl.productiontype WHEN '+' THEN (mp.weight * pl.movementqty)
ELSE 0 END) AS ProducedKG,
SUM(CASE pl.productiontype WHEN '+' THEN (pl.movementqty)
ELSE 0 END) AS ProducedUd,
SUM(CASE pl.productiontype WHEN '+' THEN COALESCE(wrpp.ComponentCost,1) ELSE 0 END) AS CompCostSum,
                                         ccv.costuom, ccv.COST, pp.MA_CostCenterUse, pp.MA_WRPHASE_ID, pp.LINE
                                  FROM M_PRODUCTIONPLAN pp INNER JOIN M_PRODUCTIONLINE pl ON pp.m_productionplan_id = pl.m_productionplan_id
                                                                                         AND pp.m_production_id = p_Production_ID
                                                           INNER JOIN M_PRODUCT mp ON pl.m_product_id = mp.m_product_id
                                                           LEFT JOIN MA_COSTCENTER_VERSION ccv ON ccv.MA_COSTCENTER_VERSION_ID = pp.ma_costcenter_version_id
                                                           LEFT JOIN MA_WRPHASE wrp ON wrp.ma_wrphase_id = pp.ma_wrphase_id
                                                           LEFT JOIN MA_WRPHASEPRODUCT wrpp ON wrp.ma_wrphase_id = wrpp.ma_wrphase_id
                                   AND wrpp.m_product_id = pl.m_product_id
                                  WHERE NOT EXISTS (SELECT 1
                                                   FROM M_PRODUCTIONLINE pl1, M_PRODUCTIONPLAN pp2, M_PRODUCTIONLINE pl2
                                                   WHERE pl1.m_productionplan_id = pp2.m_productionplan_id
                                                     AND pl1.m_product_id = pl2.m_product_id
                                                     AND pl2.productiontype='-'
                                                     AND pl1.productiontype='+'
                                                     AND pp2.m_production_id = p_Production_ID
                                                     AND pl2.M_productionplan_ID = pp.M_ProductionPlan_ID
                                                     AND pl1.calculated = 'N')
   AND pp.MA_COSTCENTER_VERSION_ID IS NOT NULL
                                 GROUP BY pp.M_ProductionPlan_ID, pp.ma_costcenter_version_id, ccv.costuom,
                                           ccv.COST, pp.MA_CostCenterUse, pp.MA_WRPHASE_ID, pp.LINE


Also the lines should NOT be calculated = Y when there is not defined the cost center version:

    UPDATE M_PRODUCTIONLINE
    SET CALCULATED='Y'
    WHERE M_PRODUCTIONPLAN_ID IN (SELECT M_PRODUCTIONPLAN_ID
                                  FROM M_PRODUCTIONPLAN
                                  WHERE M_PRODUCTION_ID = p_Production_ID
                                    AND MA_COSTCENTER_VERSION_ID IS NULL);
No tags attached.
related to design defect 0023505 new Triage Omni WMS The Cost Center Version should not be necessary to calculate the cost of manufacturing products 
related to defect 0035300 closed mcobas Empty error message when applying a cost adjustment to a transaction associated to a work effort line 
Issue History
2013-11-07 17:27VictorVillarNew Issue
2013-11-07 17:27VictorVillarAssigned To => dmiguelez
2013-11-07 17:27VictorVillarModules => Core
2013-11-07 17:27VictorVillarTriggers an Emergency Pack => No
2013-11-07 17:29VictorVillarProposed Solution updated
2013-12-16 09:35VictorVillarIssue Monitored: networkb
2013-12-16 09:35VictorVillarAssigned Todmiguelez => jonalegriaesarte
2014-03-31 22:43ngarciaRelationship addedrelated to 0023505
2017-02-15 09:47ngarciaAssigned Tojonalegriaesarte => Triage Finance
2017-02-17 13:46ngarciaRelationship addedrelated to 0035300

There are no notes attached to this issue.