}
}
//Update the assessment
if(allowReputationUpdate) {
BusinessQuality assessment = new BusinessQuality();
assessment.setAssessDate(date.getTime());
assessment.setCommentary(businessQualityComment);
assessment.setEvaluable(supplier);
assessment.setValuer(evaluator);
BigDecimal partnersDealsNumber = BigDecimal.valueOf(bqDAO.getPartnersDealsNumber(
supplier.getId(), evaluator.getId()) + 1);
BigDecimal prevQuality = bqDAO.getAvarageAssessment(supplier.getId());
BigDecimal effectiveBusinessQuality =
businessQuality.divide(partnersDealsNumber, RoundingMode.HALF_UP).add(
prevQuality.multiply(BigDecimal.ONE.subtract(BigDecimal.ONE.divide(partnersDealsNumber, RoundingMode.HALF_UP))));
assessment.setValue(effectiveBusinessQuality);
assessment.setInitialValue(businessQuality);
bqDAO.save(assessment);
}