// only fetch the installment if the number is greater than 0
if (previousInstallmentNo > 0) {
previousInstallment = loan.fetchRepaymentScheduleInstallment(previousInstallmentNo);
}
LoanRepaymentScheduleInstallment firstInstallment = loan.fetchRepaymentScheduleInstallment(1);
// the "installment from date" is equal to the due date of the
// previous installment, if it exists
if (previousInstallment != null) {
installmentFromDate = previousInstallment.getDueDate();