final LoanSummaryData summary = null;
final BigDecimal feeChargesDueAtDisbursementCharged = null;
final ChargeData chargeTemplate = null;
final Boolean syncDisbursementWithMeeting = null;
final LoanScheduleData repaymentSchedule = null;
final Collection<LoanTransactionData> transactions = null;
final Collection<CollateralData> collateral = null;
final Collection<GuarantorData> guarantors = null;
final Collection<NoteData> notes = null;
final CalendarData calendarData = null;
final Collection<LoanProductData> productOptions = null;
final Collection<CalendarData> calendarOptions = null;
final Collection<StaffData> loanOfficerOptions = null;
final EnumOptionData termPeriodFrequencyType = product.getRepaymentFrequencyType();
final Collection<LoanChargeData> charges = new ArrayList<LoanChargeData>();
for (final ChargeData charge : product.charges()) {
if (!charge.isOverdueInstallmentCharge()) {
charges.add(charge.toLoanChargeData());
}
}
final Integer loancounter = null;
final Integer loanProductCounter = null;
final PortfolioAccountData linkedAccount = null;
final Collection<PortfolioAccountData> accountLinkingOptions = null;
final Collection<DisbursementData> disbursementData = null;
final Collection<LoanTermVariationsData> emiAmountVariations = null;
BigDecimal principal = null;
BigDecimal interestRatePerPeriod = null;
Integer numberOfRepayments = null;
if (product.useBorrowerCycle() && loanCycleNumber > 0) {
Collection<LoanProductBorrowerCycleVariationData> principalVariationsForBorrowerCycle = product
.getPrincipalVariationsForBorrowerCycle();
Collection<LoanProductBorrowerCycleVariationData> interestForVariationsForBorrowerCycle = product
.getInterestRateVariationsForBorrowerCycle();
Collection<LoanProductBorrowerCycleVariationData> repaymentVariationsForBorrowerCycle = product
.getNumberOfRepaymentVariationsForBorrowerCycle();
principal = fetchLoanCycleDefaultValue(principalVariationsForBorrowerCycle, loanCycleNumber);
interestRatePerPeriod = fetchLoanCycleDefaultValue(interestForVariationsForBorrowerCycle, loanCycleNumber);
BigDecimal numberofRepaymentval = fetchLoanCycleDefaultValue(repaymentVariationsForBorrowerCycle, loanCycleNumber);
if (numberofRepaymentval != null) {
numberOfRepayments = numberofRepaymentval.intValue();
}
}
if (principal == null) {
principal = product.getPrincipal();
}
if (interestRatePerPeriod == null) {
interestRatePerPeriod = product.getInterestRatePerPeriod();
}
if (numberOfRepayments == null) {
numberOfRepayments = product.getNumberOfRepayments();
}
final Integer termFrequency = numberOfRepayments * product.getRepaymentEvery();
final BigDecimal fixedEmi = null;
Map<Long, LoanBorrowerCycleData> memberVariations = null;
final Boolean inArrears = null;
final Boolean isNPA = null;
final LoanScheduleData originalSchedule = null;
return new LoanAccountData(id, accountNo, status, externalId, clientId, clientName, clientOfficeId, group, loanType,
product.getId(), product.getName(), product.getDescription(), product.getFundId(), product.getFundName(), loanPurposeId,
loanPurposeName, loanOfficerId, loanOfficerName, product.getCurrency(), principal, principal, totalOverpaid,
product.getInArrearsTolerance(), termFrequency, termPeriodFrequencyType, numberOfRepayments, product.getRepaymentEvery(),