Package org.fenixedu.academic.domain.accounting.paymentPlans

Examples of org.fenixedu.academic.domain.accounting.paymentPlans.GratuityPaymentPlan


                "error.accounting.agreement.serviceAgreementTemplates.DegreeCurricularPlanServiceAgreementTemplate.cannot.modify.degreeCurricularPlan");
    }

    public GratuityPaymentPlan getGratuityPaymentPlanFor(final StudentCurricularPlan studentCurricularPlan,
            final ExecutionYear executionYear) {
        GratuityPaymentPlan result = null;
        for (final PaymentPlan paymentPlan : getPaymentPlansSet()) {
            if (paymentPlan instanceof GratuityPaymentPlan
                    && ((GratuityPaymentPlan) paymentPlan).isAppliableFor(studentCurricularPlan, executionYear)) {
                GratuityPaymentPlan gratuityPaymentPlan = (GratuityPaymentPlan) paymentPlan;

                if (result == null) {
                    result = (GratuityPaymentPlan) paymentPlan;
                } else {
                    if (gratuityPaymentPlan.hasPrecedenceOver(result.getClass())) {
                        result = gratuityPaymentPlan;
                    } else if (!result.hasPrecedenceOver(gratuityPaymentPlan.getClass())) {
                        // Incompatible payment plans
                        throw new DomainException(
                                "error.net.sourceforge.fenixedu.domain.accounting.serviceAgreementTemplates.DegreeCurricularPlanServiceAgreementTemplate.more.than.one.gratuity.payment.plan.is.appliable");
                    }
                }
View Full Code Here


    }

    public void configurateDefaultPaymentPlan() {
        if (!hasDefaultGratuityPaymentPlan()) {
            ensureServiceAgreement();
            final GratuityPaymentPlan paymentPlan =
                    getDegreeCurricularPlanServiceAgreement().getDefaultGratuityPaymentPlan(getExecutionYear());
            if (paymentPlan == null) {
                throw new DomainException("error.GratuityEventWithPaymentPlan.cannot.set.null.payment.plan");
            }
            super.setGratuityPaymentPlan(paymentPlan);
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.accounting.paymentPlans.GratuityPaymentPlan

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.