question: public MCostDetail createVarianceCostDetail ( MPPCostCollector costCollector , BigDecimal amount , BigDecimal quantity , MCostDetail costDetail , MProduct product , MAcctSchema accountSchema , MCostType costType , MCostElement costElement ) { final MCostDetail costDetailVariance = new MCostDetail ( costCollector . getCtx ( ) , 0 , costCollector . get_TrxName ( ) ) ; if ( costDetail != null ) { MCostDetail . copyValues ( costDetail , costDetailVariance ) ; costDetailVariance . setProcessed ( false ) ; } if ( product != null ) { costDetailVariance . setM_Product_ID ( product . getM_Product_ID ( ) ) ; costDetailVariance . setM_AttributeSetInstance_ID ( costCollector . getM_AttributeSetInstance_ID ( ) ) ; } if ( accountSchema != null ) { costDetailVariance . setC_AcctSchema_ID ( accountSchema . getC_AcctSchema_ID ( ) ) ; } if ( costElement != null ) { costDetailVariance . setM_CostElement_ID ( costElement . getM_CostElement_ID ( ) ) ; } costDetailVariance . setPP_Cost_Collector_ID ( costCollector . getPP_Cost_Collector_ID ( ) ) ; costDetailVariance . setM_CostType_ID ( costType . getM_CostType_ID ( ) ) ; costDetailVariance . setM_CostElement_ID ( costElement . getM_CostElement_ID ( ) ) ; costDetailVariance . setAmt ( amount ) ; costDetailVariance . setAmtLL ( BigDecimal . ZERO ) ; costDetailVariance . setQty ( quantity ) ; costDetailVariance . setDateAcct ( costCollector . getDateAcct ( ) ) ; costDetailVariance . saveEx ( ) ; processCostDetail ( costDetailVariance ) ; return costDetailVariance ; }
target:  Create Cost detail from cost collector