PhdGratuityPR postingRule =
new PhdGratuityPR(bean.getStartDate(), bean.getEndDate(), phdProgram.getServiceAgreementTemplate(), new Money(
bean.getGratuity()), bean.getFineRate());
for (CreateGratuityPhdPRPeriodBean periodBean : bean.getPeriods()) {
PhdGratuityPaymentPeriod period =
new PhdGratuityPaymentPeriod(periodBean.getPeriodStartDate(), periodBean.getPeriodEndDate(),
periodBean.getLimitePaymentDay());
postingRule.addPhdGratuityPaymentPeriods(period);
period.setRootDomainObject(Bennu.getInstance());
}
for (CreateGratuityPhdPRQuickBean quirkBean : bean.getExceptions()) {
PhdGratuityPriceQuirk quirk = new PhdGratuityPriceQuirk(quirkBean.getYear(), new Money(quirkBean.getGratuity()));
postingRule.addPhdGratuityPriceQuirks(quirk);