Package org.fenixedu.academic.util

Examples of org.fenixedu.academic.util.InvocationResult


    @Atomic(mode = TxMode.WRITE)
    private void createAdministrativeOfficeFeeEvent(StudentCurricularPlan scp, ExecutionYear executionYear) {
        try {

            final AccountingEventsManager manager = new AccountingEventsManager();
            final InvocationResult result;
            if (scp.getAdministrativeOffice().isDegree()) {
                result = manager.createAdministrativeOfficeFeeAndInsuranceEvent(scp, executionYear);

            } else if (scp.getAdministrativeOffice().isMasterDegree()) {
                result = manager.createInsuranceEvent(scp, executionYear);

            } else {
                throw new RuntimeException();
            }

            if (result.isSuccess()) {
                AdministrativeOfficeFee_TOTAL_CREATED++;
            }
        } catch (Exception e) {
            taskLog("Exception on student curricular plan with oid : %s\n", scp.getExternalId());
            e.printStackTrace(getTaskLogWriter());
View Full Code Here


    @Atomic(mode = TxMode.WRITE)
    private void createInsuranceEvent(Person person, ExecutionYear executionYear) {
        try {
            final AccountingEventsManager manager = new AccountingEventsManager();
            final InvocationResult result = manager.createInsuranceEvent(person, executionYear);

            if (result.isSuccess()) {
                InsuranceEvent_TOTAL_CREATED++;
            }
        } catch (Exception e) {
            taskLog("Exception on person with oid : %s\n", person.getExternalId());
            e.printStackTrace(getTaskLogWriter());
View Full Code Here

    @Atomic(mode = TxMode.WRITE)
    private void generateGratuityEvent(StudentCurricularPlan studentCurricularPlan, ExecutionYear executionYear) {
        try {
            final AccountingEventsManager manager = new AccountingEventsManager();

            final InvocationResult result = manager.createGratuityEvent(studentCurricularPlan, executionYear);

            if (result.isSuccess()) {
                GratuityEvent_TOTAL_CREATED++;
            }
        } catch (Exception e) {
            taskLog("Exception on student curricular plan with oid : %s\n", studentCurricularPlan.getExternalId());
            e.printStackTrace(getTaskLogWriter());
View Full Code Here

                addActionMessage("error", request, "error.phd.accounting.events.insurance.invalid.execution.period", process
                        .getExecutionYear().getQualifiedName());
                return prepareCreateInsuranceEvent(mapping, actionForm, request, response);
            }

            final InvocationResult result =
                    new AccountingEventsManager().createInsuranceEvent(process.getPerson(), bean.getExecutionYear());

            if (result.isSuccess()) {
                addActionMessage("success", request, "message.phd.accounting.events.insurance.created.with.success");
                return prepare(mapping, actionForm, request, response);
            } else {
                addActionMessages("error", request, result.getMessages());
            }

        } catch (DomainExceptionWithInvocationResult e) {
            addActionMessages("error", request, e.getInvocationResult().getMessages());
        } catch (DomainException e) {
View Full Code Here

            return InvocationResult.createSuccess();

        }

        final InvocationResult result = InvocationResult.createInsuccess();
        result.addMessage(
                LabelFormatter.APPLICATION_RESOURCES,
                "error.accounting.events.AccountingEventsManager.registration.for.student.does.not.respect.requirements.to.create.standalone.gratuity.event");

        return result;
View Full Code Here

    }

    private InvocationResult createDfaGratuityEvent(StudentCurricularPlan studentCurricularPlan, ExecutionYear executionYear,
            boolean checkConditions) {

        final InvocationResult result =
                checkConditions ? verifyConditionsToCreateGratuityEvent(executionYear, studentCurricularPlan) : InvocationResult
                        .createSuccess();

        if (result.isSuccess()) {

            if (studentCurricularPlan.getRegistration().hasGratuityEvent(executionYear, DfaGratuityEvent.class)) {
                result.addMessage(LabelFormatter.APPLICATION_RESOURCES,
                        "error.accounting.events.AccountingEventsManager.student.already.has.gratuity.event.for.execution.year",
                        studentCurricularPlan.getRegistration().getStudent().getNumber().toString(), studentCurricularPlan
                                .getRegistration().getDegree().getPresentationName(), executionYear.getYear());

                result.setSuccess(false);

                return result;

            }
View Full Code Here

    }

    private InvocationResult createSpecializationDegreeGratuityEvent(StudentCurricularPlan studentCurricularPlan,
            ExecutionYear executionYear, boolean checkConditions) {

        final InvocationResult result =
                checkConditions ? verifyConditionsToCreateGratuityEvent(executionYear, studentCurricularPlan) : InvocationResult
                        .createSuccess();

        if (result.isSuccess()) {
            if (studentCurricularPlan.getRegistration().hasGratuityEvent(executionYear, SpecializationDegreeGratuityEvent.class)) {
                result.addMessage(LabelFormatter.APPLICATION_RESOURCES, studentCurricularPlan.getRegistration().getStudent()
                        .getNumber().toString(), studentCurricularPlan.getRegistration().getDegree().getPresentationName(),
                        executionYear.getYear());

                result.setSuccess(false);

                return result;
            }

            new SpecializationDegreeGratuityEvent(getAdministrativeOffice(studentCurricularPlan),
View Full Code Here

    }

    private InvocationResult createGratuityEventWithPaymentPlan(final StudentCurricularPlan studentCurricularPlan,
            final ExecutionYear executionYear, final boolean checkConditions) {

        final InvocationResult result =
                checkConditions ? verifyConditionsToCreateGratuityEvent(executionYear, studentCurricularPlan) : InvocationResult
                        .createSuccess();

        if (result.isSuccess()) {

            if (studentCurricularPlan.getRegistration().hasGratuityEvent(executionYear, GratuityEventWithPaymentPlan.class)) {
                result.addMessage(LabelFormatter.APPLICATION_RESOURCES,
                        "error.accounting.events.AccountingEventsManager.student.already.has.gratuity.event.for.execution.year",
                        studentCurricularPlan.getRegistration().getStudent().getNumber().toString(), studentCurricularPlan
                                .getRegistration().getDegree().getPresentationName(), executionYear.getYear());

                result.setSuccess(false);

                return result;

            }
View Full Code Here

    }

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

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

        if (verifyCommonConditionsToCreateGratuityAndAdministrativeOfficeEvents(executionYear, studentCurricularPlan,
                registration) && studentCurricularPlan.getDegree().canCreateGratuityEvent()) {

            if (!acceptedDegreeTypesForGratuityEvent.contains(studentCurricularPlan.getDegreeType())) {
                result.addMessage(LabelFormatter.APPLICATION_RESOURCES,
                        "error.accounting.events.AccountingEventsManager.cannot.create.gratuity.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.gratuity.event",
                    studentCurricularPlan.getRegistration().getStudent().getNumber().toString(), studentCurricularPlan
                            .getDegree().getPresentationName());
View Full Code Here

    }

    public InvocationResult createAdministrativeOfficeFeeAndInsuranceEvent(final StudentCurricularPlan studentCurricularPlan,
            final ExecutionYear executionYear, final boolean checkConditions) {

        final InvocationResult result =
                checkConditions ? verifyConditionsToCreateAdministrativeOfficeFeeAndInsuranceEvent(studentCurricularPlan,
                        executionYear) : InvocationResult.createSuccess();

        if (result.isSuccess()) {

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

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

                result.setSuccess(false);

                return 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.