public LoanRepaymentScheduleInstallment fetchRepaymentInstallment(final Money trasferedAmount) { for (final LoanInstallmentCharge loanChargePerInstallment : this.loanInstallmentCharge) { if (loanChargePerInstallment.isPending() && trasferedAmount .getAmount() .equals( loanChargePerInstallment .getAmountThroughChargePayment(trasferedAmount.getCurrency()) .getAmount())) { return loanChargePerInstallment.getRepaymentInstallment(); } } return null; }
public LoanInstallmentCharge getUnpaidInstallmentLoanCharge() { LoanInstallmentCharge unpaidChargePerInstallment = null; for (final LoanInstallmentCharge loanChargePerInstallment : this.loanInstallmentCharge) { if (loanChargePerInstallment.isPending() && (unpaidChargePerInstallment == null || unpaidChargePerInstallment .getRepaymentInstallment() .getDueDate() .isAfter(loanChargePerInstallment.getRepaymentInstallment().getDueDate()))) { unpaidChargePerInstallment = loanChargePerInstallment; } } return unpaidChargePerInstallment; }