public static void generateSchedule(LoanAccount loanAccount)
			throws Exception {
		if (loanAccount.getPlafond().compareTo(BigDecimal.ZERO) != 1) {
			throw new Exception("Plafond harus lebih besar dari 0.");
		}

		if (loanAccount.getTenure() <= 0) {
			throw new Exception("Tenure <= 0. Seharusnya > 0.");
		}

		if (loanAccount.getInterestRate().compareTo(BigDecimal.ZERO) == -1) {
			throw new Exception("Interest rate tidak boleh kurang dari 0.");
		}

		if (loanAccount.getStartDate() == null) {
			throw new Exception("Start date tidak boleh null.");
		}

		if (loanAccount.getInterestType() == 'F') {
			LoanAccountScheduleService
					.generateScheduleWithFlatRate(loanAccount);
		} else if (loanAccount.getInterestType() == 'E') {
			LoanAccountScheduleService
					.generateScheduleWithEffectiveRate(loanAccount);
		} else if (loanAccount.getInterestType() == 'A') {
			LoanAccountScheduleService
					.generateScheduleWithAnnuityRate(loanAccount);
		} else {
			throw new Exception(
					"Jenis bunga tidak diketahui. Jenis bunga: 'F'/'E'/'A'");
		}
	}