Package org.fenixedu.academic.util

Examples of org.fenixedu.academic.util.InvocationResult


    }

    private InvocationResult verifyConditionsToCreateAdministrativeOfficeFeeAndInsuranceEvent(
            final StudentCurricularPlan studentCurricularPlan, final ExecutionYear executionYear) {

        final InvocationResult result = new InvocationResult().setSuccess(false);

        final Registration registration = studentCurricularPlan.getRegistration();

        if (verifyCommonConditionsToCreateGratuityAndAdministrativeOfficeEvents(executionYear, studentCurricularPlan,
                registration)) {
            if (!acceptedDegreeTypesForAdministrativeOfficeFeeAndInsuranceEvent.contains(studentCurricularPlan.getDegreeType())) {
                result.addMessage(
                        LabelFormatter.APPLICATION_RESOURCES,
                        "error.accounting.events.AccountingEventsManager.cannot.create.administrativeoffice.fee.and.insurance.event.for.degree.type",
                        studentCurricularPlan.getDegree().getPresentationName());

                return result;
            }

            result.setSuccess(true);

        } else {
            result.addMessage(
                    LabelFormatter.APPLICATION_RESOURCES,
                    "error.accounting.events.AccountingEventsManager.registration.for.student.does.not.respect.requirements.to.create.administrativeoffice.fee.and.insurance.event",
                    studentCurricularPlan.getRegistration().getStudent().getNumber().toString(), studentCurricularPlan
                            .getDegree().getPresentationName());
        }
View Full Code Here


        return createInsuranceEvent(studentCurricularPlan, executionYear, true);
    }

    public InvocationResult createInsuranceEvent(final StudentCurricularPlan studentCurricularPlan,
            final ExecutionYear executionYear, final boolean checkConditions) {
        final InvocationResult result =
                checkConditions ? verifyConditionsToCreateInsuranceEvent(studentCurricularPlan, executionYear) : InvocationResult
                        .createSuccess();

        if (result.isSuccess()) {

            final Student student = studentCurricularPlan.getRegistration().getStudent();

            if (student.getPerson().hasInsuranceEventOrAdministrativeOfficeFeeInsuranceEventFor(executionYear)) {
                result.addMessage(LabelFormatter.APPLICATION_RESOURCES,
                        "error.accounting.events.AccountingEventsManager.student.already.has.insurance.event.for.year", student
                                .getNumber().toString(), executionYear.getYear());

                result.setSuccess(false);

                return result;

            }
View Full Code Here

    }

    private InvocationResult verifyConditionsToCreateInsuranceEvent(final StudentCurricularPlan studentCurricularPlan,
            final ExecutionYear executionYear) {

        final InvocationResult result = new InvocationResult().setSuccess(false);
        final Registration registration = studentCurricularPlan.getRegistration();

        if (verifyCommonConditionsToCreateGratuityAndAdministrativeOfficeEvents(executionYear, studentCurricularPlan,
                registration)) {
            if (!acceptedDegreeTypesForInsuranceEvent.contains(studentCurricularPlan.getDegreeType())) {
                result.addMessage(LabelFormatter.APPLICATION_RESOURCES,
                        "error.accounting.events.AccountingEventsManager.cannot.create.insurance.event.for.degree.type",
                        studentCurricularPlan.getDegree().getPresentationName());

                return result;
            }

            result.setSuccess(true);

        } else {
            result.addMessage(
                    LabelFormatter.APPLICATION_RESOURCES,
                    "error.accounting.events.AccountingEventsManager.registration.for.student.does.not.respect.requirements.to.create.insurance.event",
                    studentCurricularPlan.getRegistration().getStudent().getNumber().toString(), studentCurricularPlan
                            .getDegree().getPresentationName());
        }
View Full Code Here

    }

    @Atomic
    public InvocationResult createInsuranceEvent(final Person person, final ExecutionYear executionYear) {

        final InvocationResult result = InvocationResult.createSuccess();

        if (result.isSuccess()) {

            if (person.hasInsuranceEventOrAdministrativeOfficeFeeInsuranceEventFor(executionYear)) {
                result.addMessage(LabelFormatter.APPLICATION_RESOURCES,
                        "error.accounting.events.AccountingEventsManager.student.already.has.insurance.event.for.year", person
                                .getStudent().getNumber().toString(), executionYear.getYear());

                result.setSuccess(false);

                return result;

            }
View Full Code Here

        movePayments((GratuityEventWithPaymentPlan) firstEvent, (GratuityEventWithPaymentPlan) secondEvent);
    }

    private void createGratuityEvent(final StudentCurricularPlan newStudentCurricularPlan) {
        final InvocationResult result =
                new AccountingEventsManager().createGratuityEvent(newStudentCurricularPlan, getExecutionYear(), false);
        if (!result.isSuccess()) {
            throw new DomainExceptionWithInvocationResult(result);
        }
    }
View Full Code Here

        return res;
    }

    public void createGratuityEvent(final StudentCurricularPlan studentCurricularPlan, final ExecutionYear executionYear) {
        final AccountingEventsManager manager = new AccountingEventsManager();
        final InvocationResult result = manager.createGratuityEvent(studentCurricularPlan, executionYear);

        if (!result.isSuccess()) {
            throw new DomainExceptionWithInvocationResult(result);
        }
    }
View Full Code Here

    }

    public void createAdministrativeOfficeFeeEvent(final StudentCurricularPlan studentCurricularPlan,
            final ExecutionYear executionYear) {
        final AccountingEventsManager manager = new AccountingEventsManager();
        final InvocationResult result =
                manager.createAdministrativeOfficeFeeAndInsuranceEvent(studentCurricularPlan, executionYear);

        if (!result.isSuccess()) {
            throw new DomainExceptionWithInvocationResult(result);
        }

    }
View Full Code Here

                .createEnrolmentOutOfPeriodEvent(studentCurricularPlan, executionSemester, numberOfDelayDays);
    }

    public void createInsuranceEvent(final StudentCurricularPlan studentCurricularPlan, final ExecutionYear executionYear) {
        final AccountingEventsManager manager = new AccountingEventsManager();
        final InvocationResult result = manager.createInsuranceEvent(studentCurricularPlan, executionYear);

        if (!result.isSuccess()) {
            throw new DomainExceptionWithInvocationResult(result);
        }
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.util.InvocationResult

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.