Package org.fenixedu.academic.util

Examples of org.fenixedu.academic.util.Money


        return result;
    }

    public Money calculateOtherPartiesPayedAmount() {
        Money result = Money.ZERO;
        for (final AccountingTransaction accountingTransaction : getNonAdjustingTransactions()) {
            if (!accountingTransaction.isSourceAccountFromParty(getParty())) {
                result = result.add(accountingTransaction.getToAccountEntry().getAmountWithAdjustment());
            }
        }

        return result;
    }
View Full Code Here


    public void addDiscount(final Person responsible, final Money amount) {
        addDiscounts(new Discount(responsible, amount));
    }

    public Money getTotalDiscount() {
        Money result = Money.ZERO;
        for (final Discount discount : getDiscountsSet()) {
            result = result.add(discount.getAmount());
        }
        return result;
    }
View Full Code Here

        super.setType(paymentCodeType);
        super.setStartDate(startDate);
        super.setEndDate(endDate);
        super.setMinAmount(minAmount);
        super.setMaxAmount(maxAmount != null ? maxAmount : new Money(SIBS_IGNORE_MAX_AMOUNT));
        super.setPerson(person);
    }
View Full Code Here

    public void update(final YearMonthDay startDate, final YearMonthDay endDate, final Money minAmount, final Money maxAmount) {
        checkParameters(startDate, endDate, maxAmount, maxAmount);
        super.setStartDate(startDate);
        super.setEndDate(endDate);
        super.setMinAmount(minAmount);
        super.setMaxAmount(maxAmount != null ? maxAmount : new Money(SIBS_IGNORE_MAX_AMOUNT));
        super.setWhenUpdated(new DateTime());
    }
View Full Code Here

    public Money getAmountWithAdjustment() {
        return hasBeenAdjusted() ? getOriginalAmount().add(getTotalAdjustedAmount()) : getOriginalAmount();
    }

    private Money getTotalAdjustedAmount() {
        Money result = Money.ZERO;
        for (final AccountingTransaction transaction : getAccountingTransaction().getAdjustmentTransactionsSet()) {
            result = result.add(transaction.getEntryFor(getAccount()).getOriginalAmount());
        }

        return result;
    }
View Full Code Here

    }

    @Override
    protected Money doCalculationForAmountToPay(Event event, DateTime when, boolean applyDiscount) {
        final CertificateRequestEvent certificateRequestEvent = (CertificateRequestEvent) event;
        final Money amountForUnits = getAmountForUnits(event);
        return isUrgent(certificateRequestEvent) ? amountForUnits.multiply(2) : amountForUnits;
    }
View Full Code Here

        return isUrgent(certificateRequestEvent) ? amountForUnits.multiply(2) : amountForUnits;
    }

    @Override
    public Money getAmountForUnits(Event event) {
        final Money money = super.getAmountForUnits(event);
        final Money maximumAmount = getMaximumAmount();
        return maximumAmount == null || maximumAmount.isZero() || money.lessThan(maximumAmount) ? money : maximumAmount;
    }
View Full Code Here

    }

    @Override
    protected Money calculatePenaltyAmount(final Event event, final DateTime when, final BigDecimal discountPercentage) {
        if (when.toDateMidnight().compareTo(getWhenStartToApplyPenalty(event, when)) >= 0) {
            return new Money(calculateMonthPenalty(event, discountPercentage).multiply(
                    new BigDecimal(getNumberOfMonthsToChargePenalty(event, when))));
        } else {
            return Money.ZERO;
        }
    }
View Full Code Here

        final BigDecimal proporcionToPay = enroledEcts.divide(getEctsForAmount());
        // TODO: Fix Money limitation of scale = 2 to prevent this type of
        // coding
        final BigDecimal amount = getAmount().getAmount().setScale(10);

        return new Money(amount.multiply(new BigDecimal("0.5")).multiply(BigDecimal.ONE.add(proporcionToPay)));

    }
View Full Code Here

    }

    @Override
    protected Money doCalculationForAmountToPay(Event event, DateTime when, boolean applyDiscount) {
        final CertificateRequestEvent certificateRequestEvent = (CertificateRequestEvent) event;
        Money totalAmountToPay =
                isUrgent(certificateRequestEvent) ? getBaseAmount().multiply(BigDecimal.valueOf(2)).add(getAmountForUnits(event)) : super
                        .doCalculationForAmountToPay(event, when, applyDiscount);
        totalAmountToPay = totalAmountToPay.add(calculateAmountToPayForPages(certificateRequestEvent));

        return totalAmountToPay;
    }
View Full Code Here

TOP

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

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.