Package org.fenixedu.academic.domain.accounting.events

Examples of org.fenixedu.academic.domain.accounting.events.AnnualEvent


    public Set<AnnualEvent> getAnnualEventsFor(final ExecutionYear executionYear) {
        final Set<AnnualEvent> result = new HashSet<AnnualEvent>();
        for (final Event event : getEventsSet()) {
            if (event instanceof AnnualEvent) {
                final AnnualEvent annualEvent = (AnnualEvent) event;
                if (annualEvent.isFor(executionYear) && !annualEvent.isCancelled()) {
                    result.add(annualEvent);
                }
            }
        }
View Full Code Here


    public Set<AnnualEvent> getOpenAnnualEventsFor(final ExecutionYear executionYear) {
        final Set<AnnualEvent> result = new HashSet<AnnualEvent>();
        for (final Event event : getEventsSet()) {
            if (event instanceof AnnualEvent) {
                final AnnualEvent annualEvent = (AnnualEvent) event;
                if (annualEvent.isFor(executionYear) && annualEvent.isOpen()) {
                    result.add(annualEvent);
                }
            }
        }
View Full Code Here

    protected boolean hasAnyAdministrativeOfficeFeeAndInsuranceInDebt(final Student student, final ExecutionYear executionYear) {
        for (final Event event : student.getPerson().getEventsSet()) {

            if (event instanceof AnnualEvent) {
                final AnnualEvent annualEvent = (AnnualEvent) event;
                if (annualEvent.getExecutionYear().isAfter(executionYear)) {
                    continue;
                }
            }

            if ((event instanceof AdministrativeOfficeFeeAndInsuranceEvent || event instanceof InsuranceEvent) && event.isOpen()) {
View Full Code Here

        super.init(EventType.ADMINISTRATIVE_OFFICE_FEE_INSURANCE, startDate, endDate, serviceAgreementTemplate);
    }

    @Override
    protected Money doCalculationForAmountToPay(Event event, DateTime when, boolean applyDiscount) {
        final AnnualEvent annualEvent = (AnnualEvent) event;
        return getPostingRuleForAdministrativeOfficeFee(annualEvent.getStartDate(), annualEvent.getEndDate())
                .calculateTotalAmountToPay(event, when, applyDiscount).add(
                        getPostingRuleForInsurance(annualEvent.getStartDate(), annualEvent.getEndDate())
                                .calculateTotalAmountToPay(event, when, applyDiscount));
    }
View Full Code Here

    public List<EntryDTO> calculateEntries(Event event, DateTime when) {

        final List<EntryDTO> result = new ArrayList<EntryDTO>();
        final AdministrativeOfficeFeeAndInsuranceEvent administrativeOfficeFeeAndInsuranceEvent =
                (AdministrativeOfficeFeeAndInsuranceEvent) event;
        final AnnualEvent annualEvent = (AnnualEvent) event;
        if (administrativeOfficeFeeAndInsuranceEvent.hasToPayAdministrativeOfficeFee()) {
            result.addAll(getPostingRuleForAdministrativeOfficeFee(annualEvent.getStartDate(), annualEvent.getEndDate())
                    .calculateEntries(event, when));
        }
        if (administrativeOfficeFeeAndInsuranceEvent.hasToPayInsurance()) {
            result.addAll(getPostingRuleForInsurance(annualEvent.getStartDate(), annualEvent.getEndDate()).calculateEntries(
                    event, when));
        }

        return result;
    }
View Full Code Here

    protected Set<AccountingTransaction> internalProcess(User user, Collection<EntryDTO> entryDTOs, Event event,
            Account fromAccount, Account toAccount, AccountingTransactionDetailDTO transactionDetail) {

        final Set<AccountingTransaction> result = new HashSet<AccountingTransaction>();
        final Set<Entry> createdEntries = new HashSet<Entry>();
        final AnnualEvent annualEvent = (AnnualEvent) event;
        for (final EntryDTO entryDTO : entryDTOs) {

            if (entryDTO.getEntryType() == EntryType.INSURANCE_FEE) {

                createdEntries.addAll(getPostingRuleForInsurance(annualEvent.getStartDate(), annualEvent.getEndDate()).process(
                        user, Collections.singletonList(entryDTO), event, fromAccount, toAccount, transactionDetail));

            } else if (entryDTO.getEntryType() == EntryType.ADMINISTRATIVE_OFFICE_FEE) {
                createdEntries.addAll(getPostingRuleForAdministrativeOfficeFee(annualEvent.getStartDate(),
                        annualEvent.getEndDate()).process(user, Collections.singletonList(entryDTO), event, fromAccount,
                        toAccount, transactionDetail));
            } else {
                throw new DomainException(
                        "error.accounting.postingRules.AdministrativeOfficeFeeAndInsurancePR.invalid.entry.type");
            }
View Full Code Here

    @Override
    public AccountingTransaction depositAmount(User responsibleUser, Event event, Account fromAcount, Account toAccount,
            Money amount, EntryType entryType, AccountingTransactionDetailDTO transactionDetailDTO) {

        final AnnualEvent annualEvent = (AnnualEvent) event;

        if (entryType == EntryType.INSURANCE_FEE) {
            return getPostingRuleForInsurance(annualEvent.getStartDate(), annualEvent.getEndDate()).depositAmount(
                    responsibleUser, event, fromAcount, toAccount, amount, transactionDetailDTO);

        } else if (entryType == EntryType.ADMINISTRATIVE_OFFICE_FEE) {
            return getPostingRuleForAdministrativeOfficeFee(annualEvent.getStartDate(), annualEvent.getEndDate()).depositAmount(
                    responsibleUser, event, fromAcount, toAccount, amount, transactionDetailDTO);

        } else {
            throw new DomainException("error.AdministrativeOfficeFeeAndInsurancePR.unsupported.entry.type");
        }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.accounting.events.AnnualEvent

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.