Package org.fenixedu.academic.util

Examples of org.fenixedu.academic.util.Money


        throw new DomainException("error.accounting.postingRules.EquivalencePlanRequestPR.maximumAmount.cannot.be.modified");
    }

    @Override
    public List<EntryDTO> calculateEntries(Event event, DateTime when) {
        final Money calculateAmountToPay = event.calculateAmountToPay(when);
        return Collections.singletonList(new EntryDTO(getEntryType(), event, calculateTotalAmountToPay(event, when), event
                .getPayedAmount(), calculateAmountToPay, event.getDescriptionForEntryType(getEntryType()), calculateAmountToPay));
    }
View Full Code Here


    @Override
    protected Money doCalculationForAmountToPay(final Event event, final DateTime when, boolean applyDiscount) {
        final EquivalencePlanRequestEvent planRequest = (EquivalencePlanRequestEvent) event;

        Money amountToPay = getAmountPerUnit();

        if (planRequest.getNumberOfEquivalences() != null && planRequest.getNumberOfEquivalences().intValue() != 0) {
            amountToPay = amountToPay.multiply(planRequest.getNumberOfEquivalences().intValue());
        }

        if (getMaximumAmount().greaterThan(Money.ZERO)) {
            if (amountToPay.greaterThan(getMaximumAmount())) {
                amountToPay = getMaximumAmount();
            }
        }

        return amountToPay;
View Full Code Here

        return Collections.singleton(makeAccountingTransaction(user, event, fromAccount, toAccount, getEntryType(), entryDTOs
                .iterator().next().getAmountToPay(), transactionDetail));
    }

    private void checkIfCanAddAmount(final Money amountToPay, final Event event, final DateTime whenRegistered) {
        final Money totalFinalAmount = event.getPayedAmount().add(amountToPay);

        if (totalFinalAmount.lessThan(calculateTotalAmountToPay(event, whenRegistered))) {
            throw new DomainExceptionWithLabelFormatter(
                    "error.accounting.postingRules.gratuity.EquivalencePlanRequestPR.amount.being.payed.must.be.equal.to.amount.in.debt",
                    event.getDescriptionForEntryType(getEntryType()));
        }
    }
View Full Code Here

    public Money getAmountForUnits(Integer numberOfUnits) {
        if (numberOfUnits <= 1) {
            return Money.ZERO;
        }

        Money totalAmountOfUnits = getAmountPerUnit().multiply(new BigDecimal(numberOfUnits - 1));

        if (this.getMaximumAmount().greaterThan(Money.ZERO)) {
            if (totalAmountOfUnits.greaterThan(this.getMaximumAmount())) {
                totalAmountOfUnits = this.getMaximumAmount();
            }
        }

        return totalAmountOfUnits;
View Full Code Here

    public Money getAmountForUnits(Integer numberOfUnits) {
        if (numberOfUnits <= 1) {
            return Money.ZERO;
        }

        Money totalAmountOfUnits = getAmountPerUnit().multiply(new BigDecimal(numberOfUnits - 1));

        if (this.getMaximumAmount().greaterThan(Money.ZERO)) {
            if (totalAmountOfUnits.greaterThan(this.getMaximumAmount())) {
                totalAmountOfUnits = this.getMaximumAmount();
            }
        }

        return totalAmountOfUnits;
View Full Code Here

    }

    @Override
    protected Money doCalculationForAmountToPay(Event event, DateTime when, boolean applyDiscount) {
        final CertificateRequestEvent requestEvent = (CertificateRequestEvent) event;
        Money totalAmountToPay =
                calculateAmountToPayWithUnits(requestEvent, true).add(calculateAmountToPayForPages(requestEvent));

        return totalAmountToPay;
    }
View Full Code Here

        return totalAmountToPay;
    }

    private Money calculateAmountToPayWithUnits(final CertificateRequestEvent requestEvent, final boolean checkUrgency) {
        Money total = checkUrgency && isUrgent(requestEvent) ? getBaseAmount().multiply(2) : getBaseAmount();

        final EnrolmentCertificateRequest request = (EnrolmentCertificateRequest) requestEvent.getAcademicServiceRequest();
        if (request.getDetailed() != null && request.getDetailed().booleanValue()) {
            total = total.add(getAmountForUnits(requestEvent));
        }
        return total;
    }
View Full Code Here

        throw new DomainException("error.DegreeTransferIndividualCandidacyPR.cannot.modify.amountForExternalStudent");
    }

    @Override
    public List<EntryDTO> calculateEntries(Event event, DateTime when) {
        final Money amountToPay = calculateTotalAmountToPay(event, when);
        return Collections.singletonList(new EntryDTO(getEntryType(), event, amountToPay, Money.ZERO, amountToPay, event
                .getDescriptionForEntryType(getEntryType()), amountToPay));
    }
View Full Code Here

                penaltyAmount);
    }

    @Override
    protected Money doCalculationForAmountToPay(Event event, DateTime when, boolean applyDiscount) {
        Money total =
                super.doCalculationForAmountToPay(event, when, applyDiscount).add(
                        hasPenalty(event, when) ? getFixedAmountPenalty() : Money.ZERO);

        return total;
    }
View Full Code Here

    protected boolean has(final EventType eventType) {
        return getEventType().equals(eventType);
    }

    public final Money calculateTotalAmountToPay(Event event, DateTime when, boolean applyDiscount) {
        Money amountToPay = doCalculationForAmountToPay(event, when, applyDiscount);

        if (!event.isExemptionAppliable()) {
            return amountToPay;
        }
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.