Package org.mifosplatform.organisation.monetary.domain

Examples of org.mifosplatform.organisation.monetary.domain.Money.minus()


        for (LoanTransaction loanTransaction : loanTransactions) {
            if (loanTransaction.isDisbursement()) {
                outstanding = outstanding.plus(loanTransaction.getAmount(getCurrency()));
                loanTransaction.updateOutstandingLoanBalance(outstanding.getAmount());
            } else {
                outstanding = outstanding.minus(loanTransaction.getPrincipalPortion(getCurrency()));
                loanTransaction.updateOutstandingLoanBalance(outstanding.getAmount());
            }
        }
    }
View Full Code Here


                    if (installment.getFeeChargesCharged(getCurrency()).isLessThan(fee)
                            || installment.getInterestCharged(getCurrency()).isLessThan(interest)
                            || installment.getPenaltyChargesCharged(getCurrency()).isLessThan(penality)) {
                        interest = interest.minus(loanTransaction.getInterestPortion(getCurrency()));
                        fee = fee.minus(loanTransaction.getFeeChargesPortion(getCurrency()));
                        penality = penality.minus(loanTransaction.getPenaltyChargesPortion(getCurrency()));
                        loanTransaction.reverse();
                    }
                }
            }
            installment.updateAccrualPortion(interest, fee, penality);
View Full Code Here

                        if (!loanApplicationTerms.isMultiDisburseLoan()) {
                            loanApplicationTerms.setFixedEmiAmount(null);
                        }
                        fixedEmiAmount = fixedEmiAmount.zero();
                        outstandingBalance = outstandingBalance.minus(reducePrincipal);
                        balanceForcalculation = balanceForcalculation.minus(reducePrincipal);
                        totalCumulativePrincipal = totalCumulativePrincipal.plus(reducePrincipal);
                        reducePrincipal = reducePrincipal.zero();
                    break;
                    case REDUCE_NUMBER_OF_INSTALLMENTS:
                        if (fixedEmiAmount.isGreaterThanZero()) {
View Full Code Here

                    case REDUCE_NUMBER_OF_INSTALLMENTS:
                        if (fixedEmiAmount.isGreaterThanZero()) {
                            loanApplicationTerms.setFixedEmiAmount(fixedEmiAmount.getAmount());
                        }
                        outstandingBalance = outstandingBalance.minus(reducePrincipal);
                        balanceForcalculation = balanceForcalculation.minus(reducePrincipal);
                        totalCumulativePrincipal = totalCumulativePrincipal.plus(reducePrincipal);
                        reducePrincipal = reducePrincipal.zero();
                    break;
                    case RESCHEDULE_NEXT_REPAYMENTS:
                        balanceForcalculation = balanceForcalculation.minus(reducePrincipal);
View Full Code Here

                        balanceForcalculation = balanceForcalculation.minus(reducePrincipal);
                        totalCumulativePrincipal = totalCumulativePrincipal.plus(reducePrincipal);
                        reducePrincipal = reducePrincipal.zero();
                    break;
                    case RESCHEDULE_NEXT_REPAYMENTS:
                        balanceForcalculation = balanceForcalculation.minus(reducePrincipal);
                    break;
                    default:
                    break;
                }
            }
View Full Code Here

            Money totalInterestChargedForFullLoanTerm = loanApplicationTerms.calculateTotalInterestCharged(
                    this.paymentPeriodsInOneYearCalculator, mathContext);

            if (!recalculateInterest && newInterestRate == null) {
                totalInterestChargedForFullLoanTerm = Money.of(currency, loanSummary.getTotalInterestCharged());
                totalInterestChargedForFullLoanTerm = totalInterestChargedForFullLoanTerm.minus(actualTotalCumulativeInterest);

                loanApplicationTerms.updateTotalInterestDue(totalInterestChargedForFullLoanTerm);
            }

            for (LoanRescheduleModelRepaymentPeriod period : periods) {
View Full Code Here

            installment.resetDerivedComponents();
            installment.updateDerivedFields(currency, loanApplicationTerms.getExpectedDisbursementDate());
        }
        for (LoanRepaymentScheduleInstallment installment : installments) {
            processinstallmets.add(installment);
            unpaidPricipal = unpaidPricipal.minus(installment.getPrincipal(currency));
            if (installment.getInstallmentNumber() <= installmentNumber) {
                continue;
            }
            processedInstallmentNumber = installment.getInstallmentNumber();
            if (installment.getInstallmentNumber() == installments.size()) {
View Full Code Here

                    BigDecimal reducePrincipal = disbursementAfterPeriod(loanApplicationTerms, repaymentDueDate, lastDueDate);
                    principalOutstanding = principalOutstanding.minus(reducePrincipal);
                    calculateInterestOnPrincipal = principalOutstanding;
                    BigDecimal currentPeriodDisbursal = disbursementForPeriod(loanApplicationTerms, periodStartDate, repaymentDueDate,
                            disbursementDatas, true);
                    calculateInterestOnPrincipal = calculateInterestOnPrincipal.minus(currentPeriodDisbursal);
                }

                PrincipalInterest principalInterest = loanApplicationTerms.calculateTotalInterestForPeriod(
                        this.paymentPeriodsInOneYearCalculator, interestCalculationGraceOnRepaymentPeriodFraction, periodNumber, mc,
                        totalOutstandingInterestPaymentDueToGrace.zero(), daysInPeriodApplicableForInterest, calculateInterestOnPrincipal);
View Full Code Here

        this.totalInterestRepaid = summaryWrapper.calculateTotalInterestRepaid(repaymentScheduleInstallments, currency).getAmount();
        this.totalInterestWaived = summaryWrapper.calculateTotalInterestWaived(repaymentScheduleInstallments, currency).getAmount();
        this.totalInterestWrittenOff = summaryWrapper.calculateTotalInterestWrittenOff(repaymentScheduleInstallments, currency).getAmount();

        if (totalInterestCharged.isGreaterThanZero()) {
            this.totalInterestOutstanding = totalInterestCharged.minus(this.totalInterestRepaid).minus(this.totalInterestWaived)
                    .minus(this.totalInterestWrittenOff).getAmount();
        }

        final Money totalFeeChargesCharged = summaryWrapper.calculateTotalFeeChargesCharged(repaymentScheduleInstallments, currency).plus(
                this.totalFeeChargesDueAtDisbursement);
View Full Code Here

                .getAmount();
        this.totalPenaltyChargesWrittenOff = summaryWrapper.calculateTotalPenaltyChargesWrittenOff(repaymentScheduleInstallments, currency)
                .getAmount();

        if (totalPenaltyChargesCharged.isGreaterThanZero()) {
            this.totalPenaltyChargesOutstanding = totalPenaltyChargesCharged.minus(this.totalPenaltyChargesRepaid)
                    .minus(this.totalPenaltyChargesWaived).minus(this.totalPenaltyChargesWrittenOff).getAmount();
        }

        final Money totalExpectedRepayment = Money.of(currency, this.totalPrincipalDisbursed).plus(this.totalInterestCharged)
                .plus(this.totalFeeChargesCharged).plus(this.totalPenaltyChargesCharged);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.