@Atomic
static public void createDFAGratuityPostingRule(final CreateDFAGratuityPostingRuleBean bean) {
check(AcademicPredicates.MANAGE_PAYMENTS);
if (bean.getRule() == DFAGratuityByAmountPerEctsPR.class) {
new DFAGratuityByAmountPerEctsPR(bean.getStartDate(), null, bean.getServiceAgreementTemplate(),
bean.getTotalAmount(), bean.getPartialAcceptedPercentage(), bean.getAmountPerEctsCredit());
} else if (bean.getRule() == DFAGratuityByNumberOfEnrolmentsPR.class) {
new DFAGratuityByNumberOfEnrolmentsPR(bean.getStartDate(), null, bean.getServiceAgreementTemplate(),
bean.getTotalAmount(), bean.getPartialAcceptedPercentage());
} else {