Search in sources :

Example 1 with StandardCostingMethod

use of org.adempiere.engine.StandardCostingMethod in project adempiere by adempiere.

the class GenerateCostDetail method generateCostCollectorNotTransaction.

private void generateCostCollectorNotTransaction(MAcctSchema accountSchema, MCostType costType, int productId, String trxName) throws SQLException {
    List<MPPCostCollector> costCollectors = MPPCostCollector.getCostCollectorNotTransaction(getCtx(), productId, getAccountDate(), getAccountDateTo(), trxName);
    // Process Collector Cost Manufacturing
    for (MPPCostCollector costCollector : costCollectors) {
        for (MCostDetail costDetail : MCostDetail.getByCollectorCost(costCollector)) {
            costDetail.deleteEx(true);
        }
        CostEngineFactory.getCostEngine(getAD_Client_ID()).clearAccounting(accountSchema, costType, costCollector, productId, costCollector.getDateAcct());
        final StandardCostingMethod standardCostingMethod = (StandardCostingMethod) CostingMethodFactory.get().getCostingMethod(X_M_CostType.COSTINGMETHOD_StandardCosting);
        if (MPPCostCollector.COSTCOLLECTORTYPE_UsegeVariance.equals(costCollector.getCostCollectorType()))
            standardCostingMethod.createUsageVariances(costCollector);
        else if (MPPCostCollector.COSTCOLLECTORTYPE_MethodChangeVariance.equals(costCollector.getCostCollectorType()))
            standardCostingMethod.createMethodVariances(costCollector);
        else if (MPPCostCollector.COSTCOLLECTORTYPE_RateVariance.equals(costCollector.getCostCollectorType()))
            standardCostingMethod.createRateVariances(costCollector);
        else if (MPPCostCollector.COSTCOLLECTORTYPE_ActivityControl.equals(costCollector.getCostCollectorType()))
            standardCostingMethod.createActivityControl(costCollector);
    //else
    //System.out.println("Cost Collector Type: " + costCollector.getCostCollectorType());
    }
}
Also used : MPPCostCollector(org.eevolution.model.MPPCostCollector) MCostDetail(org.compiere.model.MCostDetail) StandardCostingMethod(org.adempiere.engine.StandardCostingMethod)

Aggregations

StandardCostingMethod (org.adempiere.engine.StandardCostingMethod)1 MCostDetail (org.compiere.model.MCostDetail)1 MPPCostCollector (org.eevolution.model.MPPCostCollector)1