Package org.fenixedu.academic.domain.exceptions

Examples of org.fenixedu.academic.domain.exceptions.DomainExceptionWithLabelFormatter


                entryDTO.getAmountToPay(), transactionDetail));
    }

    private void checkIfCanAddAmount(final Money amountToPay, final Event event, final DateTime when) {
        if (amountToPay.compareTo(calculateTotalAmountToPay(event, when)) < 0) {
            throw new DomainExceptionWithLabelFormatter(
                    "error.DegreeTransferIndividualCandidacyPR.amount.being.payed.must.match.amount.to.pay",
                    event.getDescriptionForEntryType(getEntryType()));
        }
    }
View Full Code Here


                entryDTO.getAmountToPay(), transactionDetail));
    }

    private void checkIfCanAddAmount(final Money amountToPay, final Event event, final DateTime when) {
        if (amountToPay.compareTo(calculateTotalAmountToPay(event, when)) < 0) {
            throw new DomainExceptionWithLabelFormatter(
                    "error.DegreeChangeIndividualCandidacyPR.amount.being.payed.must.match.amount.to.pay",
                    event.getDescriptionForEntryType(getEntryType()));
        }
    }
View Full Code Here

    }

    private void checkParameters(final GratuityExemptionJustificationType justificationType, final String reason,
            final YearMonthDay dispatchDate) {
        if (dispatchDate == null || StringUtils.isEmpty(reason)) {
            throw new DomainExceptionWithLabelFormatter(
                    "error.accounting.events.GratuityExemptionJustificationByDispatch.dispatchDate.and.reason.are.required",
                    new LabelFormatter(justificationType.getQualifiedName(), LabelFormatter.ENUMERATION_RESOURCES));
        }

    }
View Full Code Here

            throw new DomainException(
                    "error.accounting.events.AdministrativeOfficeFeeAndInsuranceExemptionJustificationByDispatch.exemption.must.be.form.administrativeOfficeFee.exemption");
        }

        if (dispatchDate == null || StringUtils.isEmpty(reason)) {
            throw new DomainExceptionWithLabelFormatter(
                    "error.accounting.events.AdministrativeOfficeFeeAndInsuranceExemptionJustificationByDispatch.dispatchDate.and.reason.are.required",
                    new LabelFormatter(justificationType.getQualifiedName(), LabelFormatter.ENUMERATION_RESOURCES));
        }
    }
View Full Code Here

    }

    private void checkParameters(InsuranceExemptionJustificationType justificationType, String reason, YearMonthDay dispatchDate) {
        if (dispatchDate == null || StringUtils.isEmpty(reason)) {
            throw new DomainExceptionWithLabelFormatter(
                    "error.accounting.events.InsuranceExemptionJustificationByDispatch.dispatchDate.and.reason.are.required",
                    new LabelFormatter(justificationType.getQualifiedName(), LabelFormatter.ENUMERATION_RESOURCES));
        }
    }
View Full Code Here

    }

    private void checkParameters(final PenaltyExemptionJustificationType justificationType, final YearMonthDay dispatchDate,
            final String reason) {
        if (dispatchDate == null || StringUtils.isEmpty(reason)) {
            throw new DomainExceptionWithLabelFormatter(
                    "error.accounting.events.penaltyExemptionJustifications.PenaltyExemptionJustificationByDispatch.dispatchDate.and.reason.are.required",
                    new LabelFormatter(justificationType.getQualifiedName(), LabelFormatter.ENUMERATION_RESOURCES));
        }

    }
View Full Code Here

        if (checkRules && !canApplyReimbursement(amountToReimburse)) {
            throw new DomainException("error.accounting.AccountingTransaction.cannot.reimburse.events.that.may.open");
        }

        if (!getToAccountEntry().canApplyReimbursement(amountToReimburse)) {
            throw new DomainExceptionWithLabelFormatter(
                    "error.accounting.AccountingTransaction.amount.to.reimburse.exceeds.entry.amount", getToAccountEntry()
                            .getDescription());
        }

        final AccountingTransaction transaction =
View Full Code Here

            throw new DomainException("error.accounting.CreditNote.cannot.be.created.without.entries");
        }

        for (final CreditNoteEntryDTO entryDTO : entryDTOs) {
            if (!entryDTO.getEntry().canApplyReimbursement(entryDTO.getAmountToPay().negate())) {
                throw new DomainExceptionWithLabelFormatter(
                        "error.accounting.CreditNoteEntry.amount.to.reimburse.exceeds.entry.amount", entryDTO.getEntry()
                                .getDescription());
            }

            new CreditNoteEntry(creditNote, entryDTO.getEntry(), entryDTO.getAmountToPay());
View Full Code Here

    }

    private static void checkIfEmittedCreditNotesExceedEventsMaxReimbursableAmounts(Receipt receipt) {
        for (final Entry<Event, Money> each : calculateAmountsToReimburseByEvent(receipt).entrySet()) {
            if (!each.getKey().canApplyReimbursement(each.getValue())) {
                throw new DomainExceptionWithLabelFormatter(
                        "error.accounting.CreditNote.the.sum.credit.notes.in.emitted.state.exceeds.event.reimbursable.amount",
                        each.getKey().getDescription(), new LabelFormatter(each.getKey().getReimbursableAmount().toPlainString()));
            }
        }
View Full Code Here

        for (final Exam exam : bean.getExams()) {
            if (exam.isForSeason(Season.SPECIAL_SEASON_OBJ)
                    && !getEnrolmentFor(bean.getEnrolments(), exam).isSpecialSeasonEnroled(
                            bean.getExecutionPeriod().getExecutionYear())) {

                throw new DomainExceptionWithLabelFormatter(
                        "error.serviceRequests.documentRequests.ExamDateCertificateRequest.special.season.exam.requires.student.to.be.enroled",
                        exam.getSeason().getDescription());
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.exceptions.DomainExceptionWithLabelFormatter

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.