Package org.fenixedu.academic.domain.phd.debts

Examples of org.fenixedu.academic.domain.phd.debts.PhdGratuityPR


    @Atomic
    private void makeGratuityPostingRule(CreateGratuityPhdBean bean, PhdProgram phdProgram) {
        if (bean.getPeriods().size() == 0) {
            throw new RuntimeException("error.empty.periods");
        }
        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);
            quirk.setRootDomainObject(Bennu.getInstance());
        }
        postingRule.setRootDomainObject(Bennu.getInstance());

    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.phd.debts.PhdGratuityPR

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.