Package org.fenixedu.academic.domain.accounting.paymentCodes

Examples of org.fenixedu.academic.domain.accounting.paymentCodes.AccountingEventPaymentCode


    public boolean cancelCandidacy() {
        if (!isConcluded()) {
            new CancelledCandidacySituation(this, this.getPerson());

            for (PaymentCode paymentCode : getAvailablePaymentCodesSet()) {
                AccountingEventPaymentCode accountingEventPaymentCode = (AccountingEventPaymentCode) paymentCode;
                if (accountingEventPaymentCode.isNew() && accountingEventPaymentCode.getAccountingEvent() == null) {
                    accountingEventPaymentCode.cancel();
                }
            }

            return true;
        }
View Full Code Here


        // will be based on installments
        changeGratuityTotalPaymentCodeState(PaymentCodeState.CANCELLED);
    }

    private AccountingEventPaymentCode createAccountingEventPaymentCode(final EntryDTO entryDTO, final Student student) {
        AccountingEventPaymentCode accountingEventPaymentCode =
                findEquivalentPaymentCodeInStudentCandidacy(entryDTO, AccountingEventPaymentCode.class, student);

        if (accountingEventPaymentCode != null) {
            accountingEventPaymentCode.setAccountingEvent(this);
            return accountingEventPaymentCode;
        }

        return AccountingEventPaymentCode.create(PaymentCodeType.GRATUITY_FIRST_INSTALLMENT, new YearMonthDay(),
                calculateFullPaymentCodeEndDate(), this, entryDTO.getAmountToPay(), entryDTO.getAmountToPay(),
View Full Code Here

                calculateFullPaymentCodeEndDate(), this, entryDTO.getAmountToPay(), entryDTO.getAmountToPay(),
                student.getPerson());
    }

    private InstallmentPaymentCode createInstallmentPaymentCode(final EntryWithInstallmentDTO entry, final Student student) {
        AccountingEventPaymentCode accountingEventPaymentCode =
                findEquivalentPaymentCodeInStudentCandidacy(entry, InstallmentPaymentCode.class, student);

        if (accountingEventPaymentCode != null) {
            accountingEventPaymentCode.setAccountingEvent(this);
            return (InstallmentPaymentCode) accountingEventPaymentCode;
        }

        return InstallmentPaymentCode.create(PaymentCodeType.GRATUITY_FIRST_INSTALLMENT, new YearMonthDay(),
                calculateInstallmentPaymentCodeEndDate(entry.getInstallment()), this, entry.getInstallment(),
View Full Code Here

            if (!whatForClazz.equals(paymentCode.getClass())) {
                continue;
            }

            AccountingEventPaymentCode accountingEventPaymentCode = (AccountingEventPaymentCode) paymentCode;
            if (accountingEventPaymentCode.getAccountingEvent() != null) {
                continue;
            }

            if (!(accountingEventPaymentCode instanceof InstallmentPaymentCode)) {
                return accountingEventPaymentCode;
View Full Code Here

        return getAdministrativeOfficeFeeAndInsurancePR().getInsuranceAmount(getStartDate(), getEndDate());
    }

    @Override
    protected List<AccountingEventPaymentCode> createPaymentCodes() {
        AccountingEventPaymentCode paymentCode = findPaymentCodeInStudentCandidacy();

        if (paymentCode != null) {
            paymentCode.setAccountingEvent(this);
            return Collections.singletonList(paymentCode);

        }

        final Money totalAmount = calculateTotalAmount();
View Full Code Here

            if (!paymentCode.getClass().equals(AccountingEventPaymentCode.class)) {
                continue;
            }

            AccountingEventPaymentCode accountingEventPaymentCode = (AccountingEventPaymentCode) paymentCode;
            if (accountingEventPaymentCode.getAccountingEvent() != null) {
                continue;
            }

            if (!PaymentCodeType.ADMINISTRATIVE_OFFICE_FEE_AND_INSURANCE.equals(accountingEventPaymentCode.getType())) {
                continue;
            }

            if (!getExecutionYear().containsDate(accountingEventPaymentCode.getStartDate().toDateTimeAtMidnight())) {
                continue;
            }

            return accountingEventPaymentCode;
        }
View Full Code Here

    }

    @Override
    protected List<AccountingEventPaymentCode> updatePaymentCodes() {
        final Money totalAmount = calculateTotalAmount();
        final AccountingEventPaymentCode nonProcessedPaymentCode = getNonProcessedPaymentCode();

        if (nonProcessedPaymentCode != null) {
            nonProcessedPaymentCode.update(new YearMonthDay(), calculatePaymentCodeEndDate(), totalAmount, totalAmount);
        } else {
            final AccountingEventPaymentCode paymentCode = getCancelledPaymentCode();
            if (paymentCode != null) {
                paymentCode.update(new YearMonthDay(), calculatePaymentCodeEndDate(), totalAmount, totalAmount);
                paymentCode.setState(PaymentCodeState.NEW);
            }
        }

        return getNonProcessedPaymentCodes();
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.accounting.paymentCodes.AccountingEventPaymentCode

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.