List<String> defaultCosts = ApplicationParamUtil
.getDefaultDeviationCosts();
CostType costType;
CostUnit costUnitInternal = costUnitManager.findByName("Intern");
OrderCost orderCost;
List<CostType> containsCostTypes = getCostTypes();
for (String costName : defaultCosts) {
costType = costTypeManager.findByName(costName);
if (costType == null) {
throw new ProTransException("Kan ikke finne kostnadstype "
+ costName);
}
if (!containsCostTypes.contains(costType)) {
orderCost = new OrderCost();
orderCost.setCostType(costType);
orderCost.setCostUnit(costUnitInternal);
orderCost.setOrder((Order) presentationModel
.getBufferedValue(ICostableModel.PROPERTY_ORDER));
orderCost.setDeviation((Deviation) presentationModel
.getBufferedValue(ICostableModel.PROPERTY_DEVIATION));
addCost(orderCost);
presentationModel.setBufferedValue(
ICostableModel.PROPERTY_COSTS, costsList);
}