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());
}
}
Aggregations