align loan product data with field names used for create. return enumerations with extra information that describe it better.
This commit is contained in:
@@ -2,21 +2,20 @@ package org.mifosng.data;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
|
||||||
|
|
||||||
@XmlRootElement(name = "option")
|
|
||||||
public class EnumOptionData implements Serializable {
|
public class EnumOptionData implements Serializable {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
private String code;
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
public EnumOptionData() {
|
protected EnumOptionData() {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
public EnumOptionData(final String value, final Long id) {
|
public EnumOptionData(final Long id, final String code, final String value) {
|
||||||
this.value = value;
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
this.code = code;
|
||||||
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
@@ -34,4 +33,12 @@ public class EnumOptionData implements Serializable {
|
|||||||
public void setValue(final String value) {
|
public void setValue(final String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
package org.mifosng.data;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
|
||||||
|
|
||||||
@XmlRootElement
|
|
||||||
public class EnumOptionList {
|
|
||||||
|
|
||||||
private Collection<EnumOptionData> options = new ArrayList<EnumOptionData>();
|
|
||||||
|
|
||||||
protected EnumOptionList() {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnumOptionList(final List<EnumOptionData> options) {
|
|
||||||
this.options = options;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Collection<EnumOptionData> getOptions() {
|
|
||||||
return this.options;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOptions(final Collection<EnumOptionData> options) {
|
|
||||||
this.options = options;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,259 +0,0 @@
|
|||||||
package org.mifosng.data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.codehaus.jackson.map.annotate.JsonFilter;
|
|
||||||
import org.joda.time.DateTime;
|
|
||||||
|
|
||||||
@JsonFilter("myFilter")
|
|
||||||
public class LoanProductData implements Serializable {
|
|
||||||
|
|
||||||
private Long id;
|
|
||||||
private String name;
|
|
||||||
private String description;
|
|
||||||
private MoneyData principalMoney;
|
|
||||||
private BigDecimal interestRatePerPeriod = BigDecimal.ZERO;
|
|
||||||
private int interestRatePeriod;
|
|
||||||
private BigDecimal annualInterestRate = BigDecimal.ZERO;
|
|
||||||
private int interestMethod;
|
|
||||||
private int interestRateCalculatedInPeriod;
|
|
||||||
|
|
||||||
private Integer numberOfInterestFreePeriods = Integer.valueOf(0);
|
|
||||||
private Integer repaidEvery;
|
|
||||||
private int repaymentPeriodFrequency;
|
|
||||||
private Integer numberOfRepayments;
|
|
||||||
private int amortizationMethod;
|
|
||||||
private MoneyData inArrearsTolerance;
|
|
||||||
private DateTime createdOn;
|
|
||||||
private DateTime lastModifedOn;
|
|
||||||
|
|
||||||
private List<CurrencyData> possibleCurrencies = new ArrayList<CurrencyData>();
|
|
||||||
private List<EnumOptionData> possibleAmortizationOptions = new ArrayList<EnumOptionData>();
|
|
||||||
private List<EnumOptionData> possibleInterestOptions = new ArrayList<EnumOptionData>();
|
|
||||||
private List<EnumOptionData> possibleInterestRateCalculatedInPeriodOptions = new ArrayList<EnumOptionData>();
|
|
||||||
private List<EnumOptionData> repaymentFrequencyOptions = new ArrayList<EnumOptionData>();
|
|
||||||
private List<EnumOptionData> interestFrequencyOptions = new ArrayList<EnumOptionData>();
|
|
||||||
|
|
||||||
public LoanProductData() {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public LoanProductData(final Long id, final String name,
|
|
||||||
String description,
|
|
||||||
final MoneyData principalMoney,
|
|
||||||
final BigDecimal interestRatePerPeriod,
|
|
||||||
final int interestRatePeriod, final BigDecimal annualInterestRate,
|
|
||||||
final int interestMethod, final int interestCalculationInPeriodMethod,
|
|
||||||
final Integer repaidEvery,
|
|
||||||
final int repaymentPeriodFrequency, final Integer numberOfRepayments,
|
|
||||||
final int amortizationMethod, MoneyData inArrearsTolerance, DateTime createdOn, DateTime lastModifedOn) {
|
|
||||||
this.id = id;
|
|
||||||
this.name = name;
|
|
||||||
this.description = description;
|
|
||||||
this.principalMoney = principalMoney;
|
|
||||||
this.interestRatePerPeriod = interestRatePerPeriod;
|
|
||||||
this.interestRatePeriod = interestRatePeriod;
|
|
||||||
this.annualInterestRate = annualInterestRate;
|
|
||||||
this.interestMethod = interestMethod;
|
|
||||||
this.interestRateCalculatedInPeriod = interestCalculationInPeriodMethod;
|
|
||||||
this.numberOfRepayments = numberOfRepayments;
|
|
||||||
this.repaidEvery = repaidEvery;
|
|
||||||
this.repaymentPeriodFrequency = repaymentPeriodFrequency;
|
|
||||||
this.amortizationMethod = amortizationMethod;
|
|
||||||
this.inArrearsTolerance = inArrearsTolerance;
|
|
||||||
this.createdOn = createdOn;
|
|
||||||
this.lastModifedOn = lastModifedOn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MoneyData getPrincipalMoney() {
|
|
||||||
return principalMoney;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrincipalMoney(MoneyData principalMoney) {
|
|
||||||
this.principalMoney = principalMoney;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getInterestRatePerPeriod() {
|
|
||||||
return interestRatePerPeriod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInterestRatePerPeriod(BigDecimal interestRatePerPeriod) {
|
|
||||||
this.interestRatePerPeriod = interestRatePerPeriod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getInterestRatePeriod() {
|
|
||||||
return interestRatePeriod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInterestRatePeriod(int interestRatePeriod) {
|
|
||||||
this.interestRatePeriod = interestRatePeriod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getAnnualInterestRate() {
|
|
||||||
return annualInterestRate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAnnualInterestRate(BigDecimal annualInterestRate) {
|
|
||||||
this.annualInterestRate = annualInterestRate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getInterestMethod() {
|
|
||||||
return interestMethod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInterestMethod(int interestMethod) {
|
|
||||||
this.interestMethod = interestMethod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getRepaidEvery() {
|
|
||||||
return repaidEvery;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRepaidEvery(Integer repaidEvery) {
|
|
||||||
this.repaidEvery = repaidEvery;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRepaymentPeriodFrequency() {
|
|
||||||
return repaymentPeriodFrequency;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRepaymentPeriodFrequency(int repaymentPeriodFrequency) {
|
|
||||||
this.repaymentPeriodFrequency = repaymentPeriodFrequency;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getNumberOfRepayments() {
|
|
||||||
return numberOfRepayments;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNumberOfRepayments(Integer numberOfRepayments) {
|
|
||||||
this.numberOfRepayments = numberOfRepayments;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getAmortizationMethod() {
|
|
||||||
return amortizationMethod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAmortizationMethod(int amortizationMethod) {
|
|
||||||
this.amortizationMethod = amortizationMethod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MoneyData getInArrearsTolerance() {
|
|
||||||
return inArrearsTolerance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInArrearsTolerance(MoneyData inArrearsTolerance) {
|
|
||||||
this.inArrearsTolerance = inArrearsTolerance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DateTime getCreatedOn() {
|
|
||||||
return createdOn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreatedOn(DateTime createdOn) {
|
|
||||||
this.createdOn = createdOn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DateTime getLastModifedOn() {
|
|
||||||
return lastModifedOn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLastModifedOn(DateTime lastModifedOn) {
|
|
||||||
this.lastModifedOn = lastModifedOn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CurrencyData> getPossibleCurrencies() {
|
|
||||||
return possibleCurrencies;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPossibleCurrencies(List<CurrencyData> possibleCurrencies) {
|
|
||||||
this.possibleCurrencies = possibleCurrencies;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<EnumOptionData> getPossibleAmortizationOptions() {
|
|
||||||
return possibleAmortizationOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPossibleAmortizationOptions(
|
|
||||||
List<EnumOptionData> possibleAmortizationOptions) {
|
|
||||||
this.possibleAmortizationOptions = possibleAmortizationOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<EnumOptionData> getPossibleInterestOptions() {
|
|
||||||
return possibleInterestOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPossibleInterestOptions(
|
|
||||||
List<EnumOptionData> possibleInterestOptions) {
|
|
||||||
this.possibleInterestOptions = possibleInterestOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<EnumOptionData> getRepaymentFrequencyOptions() {
|
|
||||||
return repaymentFrequencyOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRepaymentFrequencyOptions(
|
|
||||||
List<EnumOptionData> repaymentFrequencyOptions) {
|
|
||||||
this.repaymentFrequencyOptions = repaymentFrequencyOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<EnumOptionData> getInterestFrequencyOptions() {
|
|
||||||
return interestFrequencyOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInterestFrequencyOptions(
|
|
||||||
List<EnumOptionData> interestFrequencyOptions) {
|
|
||||||
this.interestFrequencyOptions = interestFrequencyOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getNumberOfInterestFreePeriods() {
|
|
||||||
return numberOfInterestFreePeriods;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNumberOfInterestFreePeriods(Integer numberOfInterestFreePeriods) {
|
|
||||||
this.numberOfInterestFreePeriods = numberOfInterestFreePeriods;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getInterestRateCalculatedInPeriod() {
|
|
||||||
return interestRateCalculatedInPeriod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInterestRateCalculatedInPeriod(int interestRateCalculatedInPeriod) {
|
|
||||||
this.interestRateCalculatedInPeriod = interestRateCalculatedInPeriod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<EnumOptionData> getPossibleInterestRateCalculatedInPeriodOptions() {
|
|
||||||
return possibleInterestRateCalculatedInPeriodOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPossibleInterestRateCalculatedInPeriodOptions(
|
|
||||||
List<EnumOptionData> possibleInterestRateCalculatedInPeriodOptions) {
|
|
||||||
this.possibleInterestRateCalculatedInPeriodOptions = possibleInterestRateCalculatedInPeriodOptions;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -29,7 +29,7 @@ public class LoanRepaymentPeriodData {
|
|||||||
private static CurrencyData currencyData(MoneyData moneyData) {
|
private static CurrencyData currencyData(MoneyData moneyData) {
|
||||||
String code = moneyData.getCurrencyCode();
|
String code = moneyData.getCurrencyCode();
|
||||||
String name = moneyData.getDefaultName();
|
String name = moneyData.getDefaultName();
|
||||||
int decimalPlaces = moneyData.getCurrencyDigitsAfterDecimal();
|
int decimalPlaces = moneyData.getDigitsAfterDecimal();
|
||||||
String displaySymbol = moneyData.getDisplaySymbol();
|
String displaySymbol = moneyData.getDisplaySymbol();
|
||||||
String nameCode = moneyData.getNameCode();
|
String nameCode = moneyData.getNameCode();
|
||||||
return new CurrencyData(code, name, decimalPlaces, displaySymbol, nameCode);
|
return new CurrencyData(code, name, decimalPlaces, displaySymbol, nameCode);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public class LoanSchedule implements Serializable {
|
|||||||
private static CurrencyData currencyData(MoneyData moneyData) {
|
private static CurrencyData currencyData(MoneyData moneyData) {
|
||||||
String code = moneyData.getCurrencyCode();
|
String code = moneyData.getCurrencyCode();
|
||||||
String name = moneyData.getDefaultName();
|
String name = moneyData.getDefaultName();
|
||||||
int decimalPlaces = moneyData.getCurrencyDigitsAfterDecimal();
|
int decimalPlaces = moneyData.getDigitsAfterDecimal();
|
||||||
String displaySymbol = moneyData.getDisplaySymbol();
|
String displaySymbol = moneyData.getDisplaySymbol();
|
||||||
String nameCode = moneyData.getNameCode();
|
String nameCode = moneyData.getNameCode();
|
||||||
return new CurrencyData(code, name, decimalPlaces, displaySymbol, nameCode);
|
return new CurrencyData(code, name, decimalPlaces, displaySymbol, nameCode);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||||||
public class MoneyData implements Serializable, Comparable<MoneyData> {
|
public class MoneyData implements Serializable, Comparable<MoneyData> {
|
||||||
|
|
||||||
private String currencyCode;
|
private String currencyCode;
|
||||||
private Integer currencyDigitsAfterDecimal;
|
private Integer digitsAfterDecimal;
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
private String defaultName;
|
private String defaultName;
|
||||||
private String nameCode;
|
private String nameCode;
|
||||||
@@ -33,12 +33,12 @@ public class MoneyData implements Serializable, Comparable<MoneyData> {
|
|||||||
String defaultName, String nameCode, String displaySymbol,
|
String defaultName, String nameCode, String displaySymbol,
|
||||||
final BigDecimal amount) {
|
final BigDecimal amount) {
|
||||||
this.currencyCode = currencyCode;
|
this.currencyCode = currencyCode;
|
||||||
this.currencyDigitsAfterDecimal = currencyDigitsAfterDecimal;
|
this.digitsAfterDecimal = currencyDigitsAfterDecimal;
|
||||||
this.defaultName = defaultName;
|
this.defaultName = defaultName;
|
||||||
this.nameCode = nameCode;
|
this.nameCode = nameCode;
|
||||||
this.displaySymbol = displaySymbol;
|
this.displaySymbol = displaySymbol;
|
||||||
BigDecimal amountStripped = amount.stripTrailingZeros();
|
BigDecimal amountStripped = amount.stripTrailingZeros();
|
||||||
this.amount = amountStripped.setScale(this.currencyDigitsAfterDecimal,
|
this.amount = amountStripped.setScale(this.digitsAfterDecimal,
|
||||||
RoundingMode.HALF_EVEN);
|
RoundingMode.HALF_EVEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ public class MoneyData implements Serializable, Comparable<MoneyData> {
|
|||||||
private static CurrencyData currencyData(MoneyData moneyData) {
|
private static CurrencyData currencyData(MoneyData moneyData) {
|
||||||
String code = moneyData.getCurrencyCode();
|
String code = moneyData.getCurrencyCode();
|
||||||
String name = moneyData.getDefaultName();
|
String name = moneyData.getDefaultName();
|
||||||
int decimalPlaces = moneyData.getCurrencyDigitsAfterDecimal();
|
int decimalPlaces = moneyData.getDigitsAfterDecimal();
|
||||||
String displaySymbol = moneyData.getDisplaySymbol();
|
String displaySymbol = moneyData.getDisplaySymbol();
|
||||||
String nameCode = moneyData.getNameCode();
|
String nameCode = moneyData.getNameCode();
|
||||||
return new CurrencyData(code, name, decimalPlaces, displaySymbol, nameCode);
|
return new CurrencyData(code, name, decimalPlaces, displaySymbol, nameCode);
|
||||||
@@ -96,10 +96,6 @@ public class MoneyData implements Serializable, Comparable<MoneyData> {
|
|||||||
return this.currencyCode;
|
return this.currencyCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getCurrencyDigitsAfterDecimal() {
|
|
||||||
return this.currencyDigitsAfterDecimal;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getAmount() {
|
public BigDecimal getAmount() {
|
||||||
return this.amount;
|
return this.amount;
|
||||||
}
|
}
|
||||||
@@ -108,10 +104,6 @@ public class MoneyData implements Serializable, Comparable<MoneyData> {
|
|||||||
this.currencyCode = currencyCode;
|
this.currencyCode = currencyCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCurrencyDigitsAfterDecimal(final Integer currencyDigitsAfterDecimal) {
|
|
||||||
this.currencyDigitsAfterDecimal = currencyDigitsAfterDecimal;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAmount(final BigDecimal amount) {
|
public void setAmount(final BigDecimal amount) {
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
}
|
}
|
||||||
@@ -185,4 +177,12 @@ public class MoneyData implements Serializable, Comparable<MoneyData> {
|
|||||||
public String getDisplaySymbolValue() {
|
public String getDisplaySymbolValue() {
|
||||||
return new StringBuilder().append(this.amount.toPlainString()).append(' ').append(this.displaySymbol).toString().trim();
|
return new StringBuilder().append(this.amount.toPlainString()).append(' ').append(this.displaySymbol).toString().trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getDigitsAfterDecimal() {
|
||||||
|
return digitsAfterDecimal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDigitsAfterDecimal(Integer digitsAfterDecimal) {
|
||||||
|
this.digitsAfterDecimal = digitsAfterDecimal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
package org.mifosng.data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
|
||||||
|
|
||||||
import org.joda.time.LocalDate;
|
|
||||||
|
|
||||||
@XmlRootElement(name = "organisation")
|
|
||||||
public class OrganisationReadModel implements Serializable {
|
|
||||||
|
|
||||||
private Long id;
|
|
||||||
private String name;
|
|
||||||
private String contactName;
|
|
||||||
private LocalDate openingDate;
|
|
||||||
|
|
||||||
public OrganisationReadModel() {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrganisationReadModel(final Long id, final String name,
|
|
||||||
final String contactName, final LocalDate openingDate) {
|
|
||||||
this.id = id;
|
|
||||||
this.name = name;
|
|
||||||
this.contactName = contactName;
|
|
||||||
this.openingDate = openingDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getContactName() {
|
|
||||||
return this.contactName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getOpeningDate() {
|
|
||||||
return this.openingDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(final Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(final String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setContactName(final String contactName) {
|
|
||||||
this.contactName = contactName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOpeningDate(final LocalDate openingDate) {
|
|
||||||
this.openingDate = openingDate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -63,7 +63,7 @@ public class ScheduledLoanInstallment implements Serializable {
|
|||||||
private CurrencyData currencyData(MoneyData moneyData) {
|
private CurrencyData currencyData(MoneyData moneyData) {
|
||||||
String code = moneyData.getCurrencyCode();
|
String code = moneyData.getCurrencyCode();
|
||||||
String name = moneyData.getDefaultName();
|
String name = moneyData.getDefaultName();
|
||||||
int decimalPlaces = moneyData.getCurrencyDigitsAfterDecimal();
|
int decimalPlaces = moneyData.getDigitsAfterDecimal();
|
||||||
String displaySymbol = moneyData.getDisplaySymbol();
|
String displaySymbol = moneyData.getDisplaySymbol();
|
||||||
String nameCode = moneyData.getNameCode();
|
String nameCode = moneyData.getNameCode();
|
||||||
return new CurrencyData(code, name, decimalPlaces, displaySymbol, nameCode);
|
return new CurrencyData(code, name, decimalPlaces, displaySymbol, nameCode);
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
package org.mifosng.data.command;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
|
||||||
|
|
||||||
@XmlRootElement
|
|
||||||
public class KeyValueInformation {
|
|
||||||
|
|
||||||
private String key;
|
|
||||||
private String value;
|
|
||||||
|
|
||||||
protected KeyValueInformation() {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public KeyValueInformation(String key, String value) {
|
|
||||||
this.key = key;
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getKey() {
|
|
||||||
return key;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setKey(String key) {
|
|
||||||
this.key = key;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-40
@@ -1,40 +0,0 @@
|
|||||||
package org.mifosng.data.command;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
|
||||||
|
|
||||||
import org.mifosng.data.EntityIdentifier;
|
|
||||||
|
|
||||||
@XmlRootElement
|
|
||||||
public class UpdateClientInformationCommand {
|
|
||||||
|
|
||||||
private EntityIdentifier id;
|
|
||||||
private List<KeyValueInformation> fields = new ArrayList<KeyValueInformation>();
|
|
||||||
|
|
||||||
protected UpdateClientInformationCommand() {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public UpdateClientInformationCommand(EntityIdentifier id, List<KeyValueInformation> fields) {
|
|
||||||
this.id = id;
|
|
||||||
this.fields = fields;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<KeyValueInformation> getFields() {
|
|
||||||
return fields;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFields(List<KeyValueInformation> fields) {
|
|
||||||
this.fields = fields;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityIdentifier getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(EntityIdentifier id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+2
-2
@@ -32,14 +32,14 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
||||||
|
|
||||||
var digits = monetaryObj.currencyDigitsAfterDecimal.toFixed(0);
|
var digits = monetaryObj.digitsAfterDecimal.toFixed(0);
|
||||||
return Globalize.format(monetaryObj.amount, "n" + digits);
|
return Globalize.format(monetaryObj.amount, "n" + digits);
|
||||||
},
|
},
|
||||||
moneyWithCurrency: function(monetaryObj) {
|
moneyWithCurrency: function(monetaryObj) {
|
||||||
|
|
||||||
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
||||||
|
|
||||||
var digits = monetaryObj.currencyDigitsAfterDecimal.toFixed(0);
|
var digits = monetaryObj.digitsAfterDecimal.toFixed(0);
|
||||||
return Globalize.format(monetaryObj.amount, "c" + digits);
|
return Globalize.format(monetaryObj.amount, "c" + digits);
|
||||||
},
|
},
|
||||||
decimal: function(number, digits) {
|
decimal: function(number, digits) {
|
||||||
|
|||||||
@@ -26,14 +26,14 @@
|
|||||||
|
|
||||||
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
||||||
|
|
||||||
var digits = monetaryObj.currencyDigitsAfterDecimal.toFixed(0);
|
var digits = monetaryObj.digitsAfterDecimal.toFixed(0);
|
||||||
return Globalize.format(monetaryObj.amount, "n" + digits);
|
return Globalize.format(monetaryObj.amount, "n" + digits);
|
||||||
},
|
},
|
||||||
moneyWithCurrency: function(monetaryObj) {
|
moneyWithCurrency: function(monetaryObj) {
|
||||||
|
|
||||||
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
||||||
|
|
||||||
var digits = monetaryObj.currencyDigitsAfterDecimal.toFixed(0);
|
var digits = monetaryObj.digitsAfterDecimal.toFixed(0);
|
||||||
return Globalize.format(monetaryObj.amount, "c" + digits);
|
return Globalize.format(monetaryObj.amount, "c" + digits);
|
||||||
},
|
},
|
||||||
decimal: function(number, digits) {
|
decimal: function(number, digits) {
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
||||||
|
|
||||||
var digits = monetaryObj.currencyDigitsAfterDecimal.toFixed(0);
|
var digits = monetaryObj.digitsAfterDecimal.toFixed(0);
|
||||||
return Globalize.format(monetaryObj.amount, "n" + digits);
|
return Globalize.format(monetaryObj.amount, "n" + digits);
|
||||||
},
|
},
|
||||||
moneyWithCurrency: function(monetaryObj) {
|
moneyWithCurrency: function(monetaryObj) {
|
||||||
|
|
||||||
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
||||||
|
|
||||||
var digits = monetaryObj.currencyDigitsAfterDecimal.toFixed(0);
|
var digits = monetaryObj.digitsAfterDecimal.toFixed(0);
|
||||||
return Globalize.format(monetaryObj.amount, "c" + digits);
|
return Globalize.format(monetaryObj.amount, "c" + digits);
|
||||||
},
|
},
|
||||||
decimal: function(number, digits) {
|
decimal: function(number, digits) {
|
||||||
|
|||||||
+15
-15
@@ -37,8 +37,8 @@
|
|||||||
<legend><spring:message code="form.legend.loan.product.currency"/></legend>
|
<legend><spring:message code="form.legend.loan.product.currency"/></legend>
|
||||||
<label for="currencyCode"><spring:message code="form.label.loan.product.currency"/></label>
|
<label for="currencyCode"><spring:message code="form.label.loan.product.currency"/></label>
|
||||||
<select id="currencyCode" name="currencyCode" title="" style="width: 300px;">
|
<select id="currencyCode" name="currencyCode" title="" style="width: 300px;">
|
||||||
{{#each possibleCurrencies}}
|
{{#each currencyOptions}}
|
||||||
{{#if $parent.parent.data.principalMoney.currencyCode===code}}
|
{{#if $parent.parent.data.principal.currencyCode===code}}
|
||||||
<option value="{{=code}}" selected="selected">{{=name}}</option>
|
<option value="{{=code}}" selected="selected">{{=name}}</option>
|
||||||
{{#else}}
|
{{#else}}
|
||||||
<option value="{{=code}}">{{=name}}</option>
|
<option value="{{=code}}">{{=name}}</option>
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
{{/each}}
|
{{/each}}
|
||||||
</select>
|
</select>
|
||||||
<label for="digitsAfterDecimal"><spring:message code="form.label.loan.product.decimalplaces"/></label>
|
<label for="digitsAfterDecimal"><spring:message code="form.label.loan.product.decimalplaces"/></label>
|
||||||
<input id="digitsAfterDecimal" name="digitsAfterDecimal" title="" style="width: 300px;" value="{{=$ctx.number(principalMoney.currencyDigitsAfterDecimal)}}" />
|
<input id="digitsAfterDecimal" name="digitsAfterDecimal" title="" style="width: 300px;" value="{{=$ctx.number(principal.digitsAfterDecimal)}}" />
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><spring:message code="form.legend.loan.product.loan.terms"/></legend>
|
<legend><spring:message code="form.legend.loan.product.loan.terms"/></legend>
|
||||||
@@ -58,17 +58,17 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><spring:message code="form.label.loan.product.loan.amount"/></td>
|
<td><spring:message code="form.label.loan.product.loan.amount"/></td>
|
||||||
<td>
|
<td>
|
||||||
<input id="principal" name="principal" title="" style="width: 125px;" value="{{=$ctx.money(principalMoney)}}" />
|
<input id="principal" name="principal" title="" style="width: 125px;" value="{{=$ctx.money(principal)}}" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><spring:message code="form.label.loan.product.repaidevery"/></td>
|
<td><spring:message code="form.label.loan.product.repaidevery"/></td>
|
||||||
<td>
|
<td>
|
||||||
<input id="repaymentEvery" name="repaymentEvery" title="" style="width: 50px;" value="{{=$ctx.number(repaidEvery)}}"/>
|
<input id="repaymentEvery" name="repaymentEvery" title="" style="width: 50px;" value="{{=$ctx.number(repaymentEvery)}}"/>
|
||||||
|
|
||||||
<select id="repaymentFrequencyType" name="repaymentFrequencyType" title="" style="width: 121px;">
|
<select id="repaymentFrequencyType" name="repaymentFrequencyType" title="" style="width: 121px;">
|
||||||
{{#each repaymentFrequencyOptions}}
|
{{#each repaymentFrequencyTypeOptions}}
|
||||||
{{#if $ctx.number($parent.parent.data.repaymentPeriodFrequency)===$ctx.number(id)}}
|
{{#if $ctx.number($parent.parent.data.repaymentFrequencyType.id)===$ctx.number(id)}}
|
||||||
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
||||||
{{#else}}
|
{{#else}}
|
||||||
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
||||||
@@ -93,8 +93,8 @@
|
|||||||
<input id="interestRatePerPeriod" name="interestRatePerPeriod" title="" style="width: 70px;" value="{{=$ctx.decimal(interestRatePerPeriod, 4)}}" />
|
<input id="interestRatePerPeriod" name="interestRatePerPeriod" title="" style="width: 70px;" value="{{=$ctx.decimal(interestRatePerPeriod, 4)}}" />
|
||||||
|
|
||||||
<select id="interestRateFrequencyType" name="interestRateFrequencyType" title="" style="width: 139px;">
|
<select id="interestRateFrequencyType" name="interestRateFrequencyType" title="" style="width: 139px;">
|
||||||
{{#each interestFrequencyOptions}}
|
{{#each interestRateFrequencyTypeOptions}}
|
||||||
{{#if $ctx.number($parent.parent.data.interestRatePeriod)===$ctx.number(id)}}
|
{{#if $ctx.number($parent.parent.data.interestRateFrequencyType.id)===$ctx.number(id)}}
|
||||||
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
||||||
{{#else}}
|
{{#else}}
|
||||||
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
||||||
@@ -107,8 +107,8 @@
|
|||||||
<td><spring:message code="form.label.loan.product.amortization"/></td>
|
<td><spring:message code="form.label.loan.product.amortization"/></td>
|
||||||
<td>
|
<td>
|
||||||
<select id="amortizationType" name="amortizationType" title="" style="width: 220px;">
|
<select id="amortizationType" name="amortizationType" title="" style="width: 220px;">
|
||||||
{{#each possibleAmortizationOptions}}
|
{{#each amortizationTypeOptions}}
|
||||||
{{#if $ctx.number($parent.parent.data.amortizationMethod)===$ctx.number(id)}}
|
{{#if $ctx.number($parent.parent.data.amortizationType.id)===$ctx.number(id)}}
|
||||||
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
||||||
{{#else}}
|
{{#else}}
|
||||||
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
||||||
@@ -121,8 +121,8 @@
|
|||||||
<td><spring:message code="form.label.loan.product.interest.method"/></td>
|
<td><spring:message code="form.label.loan.product.interest.method"/></td>
|
||||||
<td>
|
<td>
|
||||||
<select id="interestType" name="interestType" title="" style="width: 220px;">
|
<select id="interestType" name="interestType" title="" style="width: 220px;">
|
||||||
{{#each possibleInterestOptions}}
|
{{#each interestTypeOptions}}
|
||||||
{{#if $ctx.number($parent.parent.data.interestMethod)===$ctx.number(id)}}
|
{{#if $ctx.number($parent.parent.data.interestType.id)===$ctx.number(id)}}
|
||||||
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
||||||
{{#else}}
|
{{#else}}
|
||||||
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
||||||
@@ -135,8 +135,8 @@
|
|||||||
<td><spring:message code="form.label.loan.product.interest.rate.calcutated.in.period"/></td>
|
<td><spring:message code="form.label.loan.product.interest.rate.calcutated.in.period"/></td>
|
||||||
<td>
|
<td>
|
||||||
<select id="interestCalculationPeriodType" name="interestCalculationPeriodType" title="" style="width: 220px;">
|
<select id="interestCalculationPeriodType" name="interestCalculationPeriodType" title="" style="width: 220px;">
|
||||||
{{#each possibleInterestRateCalculatedInPeriodOptions}}
|
{{#each interestCalculationPeriodTypeOptions}}
|
||||||
{{#if $ctx.number($parent.parent.data.interestRateCalculatedInPeriod)===$ctx.number(id)}}
|
{{#if $ctx.number($parent.parent.data.interestCalculationPeriodType.id)===$ctx.number(id)}}
|
||||||
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
||||||
{{#else}}
|
{{#else}}
|
||||||
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
||||||
|
|||||||
+2
-2
@@ -32,14 +32,14 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
||||||
|
|
||||||
var digits = monetaryObj.currencyDigitsAfterDecimal.toFixed(0);
|
var digits = monetaryObj.digitsAfterDecimal.toFixed(0);
|
||||||
return Globalize.format(monetaryObj.amount, "n" + digits);
|
return Globalize.format(monetaryObj.amount, "n" + digits);
|
||||||
},
|
},
|
||||||
moneyWithCurrency: function(monetaryObj) {
|
moneyWithCurrency: function(monetaryObj) {
|
||||||
|
|
||||||
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
||||||
|
|
||||||
var digits = monetaryObj.currencyDigitsAfterDecimal.toFixed(0);
|
var digits = monetaryObj.digitsAfterDecimal.toFixed(0);
|
||||||
return Globalize.format(monetaryObj.amount, "c" + digits);
|
return Globalize.format(monetaryObj.amount, "c" + digits);
|
||||||
},
|
},
|
||||||
decimal: function(number, digits) {
|
decimal: function(number, digits) {
|
||||||
|
|||||||
@@ -24,14 +24,14 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
||||||
|
|
||||||
var digits = monetaryObj.currencyDigitsAfterDecimal.toFixed(0);
|
var digits = monetaryObj.digitsAfterDecimal.toFixed(0);
|
||||||
return Globalize.format(monetaryObj.amount, "n" + digits);
|
return Globalize.format(monetaryObj.amount, "n" + digits);
|
||||||
},
|
},
|
||||||
moneyWithCurrency: function(monetaryObj) {
|
moneyWithCurrency: function(monetaryObj) {
|
||||||
|
|
||||||
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
||||||
|
|
||||||
var digits = monetaryObj.currencyDigitsAfterDecimal.toFixed(0);
|
var digits = monetaryObj.digitsAfterDecimal.toFixed(0);
|
||||||
return Globalize.format(monetaryObj.amount, "c" + digits);
|
return Globalize.format(monetaryObj.amount, "c" + digits);
|
||||||
},
|
},
|
||||||
decimal: function(number, digits) {
|
decimal: function(number, digits) {
|
||||||
|
|||||||
@@ -23,14 +23,14 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
||||||
|
|
||||||
var digits = monetaryObj.currencyDigitsAfterDecimal.toFixed(0);
|
var digits = monetaryObj.digitsAfterDecimal.toFixed(0);
|
||||||
return Globalize.format(monetaryObj.amount, "n" + digits);
|
return Globalize.format(monetaryObj.amount, "n" + digits);
|
||||||
},
|
},
|
||||||
moneyWithCurrency: function(monetaryObj) {
|
moneyWithCurrency: function(monetaryObj) {
|
||||||
|
|
||||||
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
Globalize.culture().numberFormat.currency.symbol = monetaryObj.displaySymbol;
|
||||||
|
|
||||||
var digits = monetaryObj.currencyDigitsAfterDecimal.toFixed(0);
|
var digits = monetaryObj.digitsAfterDecimal.toFixed(0);
|
||||||
return Globalize.format(monetaryObj.amount, "c" + digits);
|
return Globalize.format(monetaryObj.amount, "c" + digits);
|
||||||
},
|
},
|
||||||
decimal: function(number, digits) {
|
decimal: function(number, digits) {
|
||||||
|
|||||||
@@ -55,8 +55,8 @@
|
|||||||
<div id="formerrors"></div>
|
<div id="formerrors"></div>
|
||||||
|
|
||||||
<input type="hidden" id="clientId" name="clientId" value="{{=clientId}}" />
|
<input type="hidden" id="clientId" name="clientId" value="{{=clientId}}" />
|
||||||
<input type="hidden" id="currencyCode" name="currencyCode" value="{{=selectedProduct.principalMoney.currencyCode}}" />
|
<input type="hidden" id="currencyCode" name="currencyCode" value="{{=selectedProduct.principal.currencyCode}}" />
|
||||||
<input type="hidden" id="digitsAfterDecimal" name="digitsAfterDecimal" value="{{=$ctx.number(selectedProduct.principalMoney.currencyDigitsAfterDecimal)}}" />
|
<input type="hidden" id="digitsAfterDecimal" name="digitsAfterDecimal" value="{{=$ctx.number(selectedProduct.principal.digitsAfterDecimal)}}" />
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><spring:message code="form.legend.loan.information"/></legend>
|
<legend><spring:message code="form.legend.loan.information"/></legend>
|
||||||
@@ -103,18 +103,18 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><spring:message code="form.label.loan.product.loan.amount"/></td>
|
<td><spring:message code="form.label.loan.product.loan.amount"/></td>
|
||||||
<td>
|
<td>
|
||||||
<input id="principal" name="principal" title="" type="text" value="{{=$ctx.money(selectedProduct.principalMoney)}}" style="width: 125px;" />
|
<input id="principal" name="principal" title="" type="text" value="{{=$ctx.money(selectedProduct.principal)}}" style="width: 125px;" />
|
||||||
<input id="principalCurrencyCode" name="principalCurrencyCode" title="" type="text" value="{{=selectedProduct.principalMoney.displaySymbol}}" style="width: 40px;" disabled="disabled" />
|
<input id="principalCurrencyCode" name="principalCurrencyCode" title="" type="text" value="{{=selectedProduct.principal.displaySymbol}}" style="width: 40px;" disabled="disabled" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><spring:message code="form.label.loan.product.repaidevery"/></td>
|
<td><spring:message code="form.label.loan.product.repaidevery"/></td>
|
||||||
<td>
|
<td>
|
||||||
<input id="repaymentEvery" name="repaymentEvery" title="" type="text" value="{{=$ctx.number(selectedProduct.repaidEvery)}}" style="width: 50px;" />
|
<input id="repaymentEvery" name="repaymentEvery" title="" type="text" value="{{=$ctx.number(selectedProduct.repaymentEvery)}}" style="width: 50px;" />
|
||||||
|
|
||||||
<select name="repaymentFrequencyType" id="repaymentFrequencyType" title="" style="width: 121px;">
|
<select name="repaymentFrequencyType" id="repaymentFrequencyType" title="" style="width: 121px;">
|
||||||
{{#each selectedProduct.repaymentFrequencyOptions}}
|
{{#each selectedProduct.repaymentFrequencyTypeOptions}}
|
||||||
{{#if $ctx.number($parent.parent.data.selectedProduct.repaymentPeriodFrequency)===$ctx.number(id)}}
|
{{#if $ctx.number($parent.parent.data.selectedProduct.repaymentFrequencyType.id)===$ctx.number(id)}}
|
||||||
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
||||||
{{#else}}
|
{{#else}}
|
||||||
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
||||||
@@ -152,8 +152,8 @@
|
|||||||
<input id="interestRatePerPeriod" name="interestRatePerPeriod" title="" type="text" value="{{=$ctx.decimal(selectedProduct.interestRatePerPeriod, 4)}}" style="width: 60px;" />
|
<input id="interestRatePerPeriod" name="interestRatePerPeriod" title="" type="text" value="{{=$ctx.decimal(selectedProduct.interestRatePerPeriod, 4)}}" style="width: 60px;" />
|
||||||
|
|
||||||
<select name="interestRateFrequencyType" id="interestRateFrequencyType" title="" style="width: 115px;">
|
<select name="interestRateFrequencyType" id="interestRateFrequencyType" title="" style="width: 115px;">
|
||||||
{{#each selectedProduct.interestFrequencyOptions}}
|
{{#each selectedProduct.interestRateFrequencyTypeOptions}}
|
||||||
{{#if $ctx.number($parent.parent.data.selectedProduct.interestRatePeriod)===$ctx.number(id)}}
|
{{#if $ctx.number($parent.parent.data.selectedProduct.interestRateFrequencyType.id)===$ctx.number(id)}}
|
||||||
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
||||||
{{#else}}
|
{{#else}}
|
||||||
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
||||||
@@ -172,8 +172,8 @@
|
|||||||
<td><spring:message code="form.label.loan.product.amortization"/></td>
|
<td><spring:message code="form.label.loan.product.amortization"/></td>
|
||||||
<td>
|
<td>
|
||||||
<select name="amortizationType" id="amortizationType" title="" style="width: 178px;">
|
<select name="amortizationType" id="amortizationType" title="" style="width: 178px;">
|
||||||
{{#each selectedProduct.possibleAmortizationOptions}}
|
{{#each selectedProduct.amortizationTypeOptions}}
|
||||||
{{#if $ctx.number($parent.parent.data.selectedProduct.amortizationMethod)===$ctx.number(id)}}
|
{{#if $ctx.number($parent.parent.data.selectedProduct.amortizationType.id)===$ctx.number(id)}}
|
||||||
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
||||||
{{#else}}
|
{{#else}}
|
||||||
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
||||||
@@ -186,8 +186,8 @@
|
|||||||
<td><spring:message code="form.label.loan.product.interest.method"/></td>
|
<td><spring:message code="form.label.loan.product.interest.method"/></td>
|
||||||
<td>
|
<td>
|
||||||
<select name="interestType" id="interestType" title="" style="width: 180px;">
|
<select name="interestType" id="interestType" title="" style="width: 180px;">
|
||||||
{{#each selectedProduct.possibleInterestOptions}}
|
{{#each selectedProduct.interestTypeOptions}}
|
||||||
{{#if $ctx.number($parent.parent.data.selectedProduct.interestMethod)===$ctx.number(id)}}
|
{{#if $ctx.number($parent.parent.data.selectedProduct.interestType.id)===$ctx.number(id)}}
|
||||||
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
||||||
{{#else}}
|
{{#else}}
|
||||||
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
||||||
@@ -200,8 +200,8 @@
|
|||||||
<td><spring:message code="form.label.loan.product.interest.rate.calcutated.in.period"/></td>
|
<td><spring:message code="form.label.loan.product.interest.rate.calcutated.in.period"/></td>
|
||||||
<td>
|
<td>
|
||||||
<select id="interestCalculationPeriodType" name="interestCalculationPeriodType" title="" style="width: 220px;">
|
<select id="interestCalculationPeriodType" name="interestCalculationPeriodType" title="" style="width: 220px;">
|
||||||
{{#each selectedProduct.possibleInterestRateCalculatedInPeriodOptions}}
|
{{#each selectedProduct.interestCalculationPeriodTypeOptions}}
|
||||||
{{#if $ctx.number($parent.parent.data.selectedProduct.interestRateCalculatedInPeriod)===$ctx.number(id)}}
|
{{#if $ctx.number($parent.parent.data.selectedProduct.interestCalculationPeriodType.id)===$ctx.number(id)}}
|
||||||
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
|
||||||
{{#else}}
|
{{#else}}
|
||||||
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
|
||||||
|
|||||||
@@ -17,13 +17,13 @@ import javax.ws.rs.core.Response;
|
|||||||
import javax.ws.rs.core.UriInfo;
|
import javax.ws.rs.core.UriInfo;
|
||||||
|
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import org.mifosng.data.ClientData;
|
|
||||||
import org.mifosng.data.ClientLoanAccountSummaryCollectionData;
|
import org.mifosng.data.ClientLoanAccountSummaryCollectionData;
|
||||||
import org.mifosng.data.EntityIdentifier;
|
import org.mifosng.data.EntityIdentifier;
|
||||||
import org.mifosng.data.NoteData;
|
import org.mifosng.data.NoteData;
|
||||||
import org.mifosng.data.OfficeLookup;
|
|
||||||
import org.mifosng.platform.api.commands.ClientCommand;
|
import org.mifosng.platform.api.commands.ClientCommand;
|
||||||
import org.mifosng.platform.api.commands.NoteCommand;
|
import org.mifosng.platform.api.commands.NoteCommand;
|
||||||
|
import org.mifosng.platform.api.data.ClientData;
|
||||||
|
import org.mifosng.platform.api.data.OfficeLookup;
|
||||||
import org.mifosng.platform.api.infrastructure.ApiDataConversionService;
|
import org.mifosng.platform.api.infrastructure.ApiDataConversionService;
|
||||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||||
import org.mifosng.platform.client.service.ClientReadPlatformService;
|
import org.mifosng.platform.client.service.ClientReadPlatformService;
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ import javax.ws.rs.core.Response;
|
|||||||
import javax.ws.rs.core.UriInfo;
|
import javax.ws.rs.core.UriInfo;
|
||||||
|
|
||||||
import org.mifosng.data.EntityIdentifier;
|
import org.mifosng.data.EntityIdentifier;
|
||||||
import org.mifosng.data.LoanProductData;
|
|
||||||
import org.mifosng.platform.api.commands.LoanProductCommand;
|
import org.mifosng.platform.api.commands.LoanProductCommand;
|
||||||
|
import org.mifosng.platform.api.data.LoanProductData;
|
||||||
import org.mifosng.platform.api.infrastructure.ApiDataConversionService;
|
import org.mifosng.platform.api.infrastructure.ApiDataConversionService;
|
||||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||||
import org.mifosng.platform.loanproduct.service.LoanProductReadPlatformService;
|
import org.mifosng.platform.loanproduct.service.LoanProductReadPlatformService;
|
||||||
@@ -32,8 +32,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
public class LoanProductApiResource {
|
public class LoanProductApiResource {
|
||||||
|
|
||||||
private String defaultFieldList = "principalMoney,inArrearsTolerance,amortizationMethod,interestMethod,repaymentPeriodFrequency,interestRatePeriod,interestRateCalculatedInPeriod,repaidEvery,numberOfRepayments,interestRatePerPeriod,annualInterestRate,numberOfInterestFreePeriods,flexible,interestRebateAllowed";
|
private String defaultFieldList = "principal,inArrearsTolerance,numberOfRepayments,repaymentEvery,interestRatePerPeriod,annualInterestRate,repaymentFrequencyType,interestRateFrequencyType,amortizationType,interestType,interestCalculationPeriodType";
|
||||||
private String allowedFieldList = "possibleCurrencies,possibleAmortizationOptions,possibleInterestOptions,possibleInterestRateCalculatedInPeriodOptions,repaymentFrequencyOptions,interestFrequencyOptions";
|
private String allowedFieldList = "currencyOptions,amortizationTypeOptions,interestTypeOptions,interestCalculationPeriodTypeOptions,repaymentFrequencyTypeOptions,interestRateFrequencyTypeOptions";
|
||||||
private String filterName = "myFilter";
|
private String filterName = "myFilter";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -22,13 +22,13 @@ import org.mifosng.data.EntityIdentifier;
|
|||||||
import org.mifosng.data.LoanAccountData;
|
import org.mifosng.data.LoanAccountData;
|
||||||
import org.mifosng.data.LoanRepaymentData;
|
import org.mifosng.data.LoanRepaymentData;
|
||||||
import org.mifosng.data.LoanSchedule;
|
import org.mifosng.data.LoanSchedule;
|
||||||
import org.mifosng.data.NewLoanWorkflowStepOneData;
|
|
||||||
import org.mifosng.platform.api.commands.AdjustLoanTransactionCommand;
|
import org.mifosng.platform.api.commands.AdjustLoanTransactionCommand;
|
||||||
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
|
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
|
||||||
import org.mifosng.platform.api.commands.LoanStateTransitionCommand;
|
import org.mifosng.platform.api.commands.LoanStateTransitionCommand;
|
||||||
import org.mifosng.platform.api.commands.LoanTransactionCommand;
|
import org.mifosng.platform.api.commands.LoanTransactionCommand;
|
||||||
import org.mifosng.platform.api.commands.SubmitLoanApplicationCommand;
|
import org.mifosng.platform.api.commands.SubmitLoanApplicationCommand;
|
||||||
import org.mifosng.platform.api.commands.UndoStateTransitionCommand;
|
import org.mifosng.platform.api.commands.UndoStateTransitionCommand;
|
||||||
|
import org.mifosng.platform.api.data.NewLoanWorkflowStepOneData;
|
||||||
import org.mifosng.platform.api.infrastructure.ApiDataConversionService;
|
import org.mifosng.platform.api.infrastructure.ApiDataConversionService;
|
||||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||||
import org.mifosng.platform.exceptions.UnrecognizedQueryParamException;
|
import org.mifosng.platform.exceptions.UnrecognizedQueryParamException;
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ import javax.ws.rs.core.UriInfo;
|
|||||||
|
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import org.mifosng.data.EntityIdentifier;
|
import org.mifosng.data.EntityIdentifier;
|
||||||
import org.mifosng.data.OfficeData;
|
|
||||||
import org.mifosng.platform.api.commands.OfficeCommand;
|
import org.mifosng.platform.api.commands.OfficeCommand;
|
||||||
|
import org.mifosng.platform.api.data.OfficeData;
|
||||||
import org.mifosng.platform.api.infrastructure.ApiDataConversionService;
|
import org.mifosng.platform.api.infrastructure.ApiDataConversionService;
|
||||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||||
import org.mifosng.platform.organisation.service.OfficeReadPlatformService;
|
import org.mifosng.platform.organisation.service.OfficeReadPlatformService;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import javax.ws.rs.core.Context;
|
|||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.UriInfo;
|
import javax.ws.rs.core.UriInfo;
|
||||||
|
|
||||||
import org.mifosng.data.PermissionData;
|
import org.mifosng.platform.api.data.PermissionData;
|
||||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||||
import org.mifosng.platform.user.service.PermissionReadPlatformService;
|
import org.mifosng.platform.user.service.PermissionReadPlatformService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ import javax.ws.rs.core.Response;
|
|||||||
import javax.ws.rs.core.UriInfo;
|
import javax.ws.rs.core.UriInfo;
|
||||||
|
|
||||||
import org.mifosng.data.EntityIdentifier;
|
import org.mifosng.data.EntityIdentifier;
|
||||||
import org.mifosng.data.PermissionData;
|
|
||||||
import org.mifosng.data.RoleData;
|
|
||||||
import org.mifosng.platform.api.commands.RoleCommand;
|
import org.mifosng.platform.api.commands.RoleCommand;
|
||||||
|
import org.mifosng.platform.api.data.PermissionData;
|
||||||
|
import org.mifosng.platform.api.data.RoleData;
|
||||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||||
import org.mifosng.platform.user.service.PermissionReadPlatformService;
|
import org.mifosng.platform.user.service.PermissionReadPlatformService;
|
||||||
import org.mifosng.platform.user.service.RoleReadPlatformService;
|
import org.mifosng.platform.user.service.RoleReadPlatformService;
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ import javax.ws.rs.core.MediaType;
|
|||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.UriInfo;
|
import javax.ws.rs.core.UriInfo;
|
||||||
|
|
||||||
import org.mifosng.data.AppUserData;
|
|
||||||
import org.mifosng.data.EntityIdentifier;
|
import org.mifosng.data.EntityIdentifier;
|
||||||
import org.mifosng.platform.api.commands.UserCommand;
|
import org.mifosng.platform.api.commands.UserCommand;
|
||||||
|
import org.mifosng.platform.api.data.AppUserData;
|
||||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||||
import org.mifosng.platform.user.service.AppUserReadPlatformService;
|
import org.mifosng.platform.user.service.AppUserReadPlatformService;
|
||||||
import org.mifosng.platform.user.service.AppUserWritePlatformService;
|
import org.mifosng.platform.user.service.AppUserWritePlatformService;
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.mifosng.data;
|
package org.mifosng.platform.api.data;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.mifosng.data;
|
package org.mifosng.platform.api.data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -0,0 +1,258 @@
|
|||||||
|
package org.mifosng.platform.api.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.codehaus.jackson.map.annotate.JsonFilter;
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
import org.mifosng.data.CurrencyData;
|
||||||
|
import org.mifosng.data.EnumOptionData;
|
||||||
|
import org.mifosng.data.MoneyData;
|
||||||
|
|
||||||
|
@JsonFilter("myFilter")
|
||||||
|
public class LoanProductData implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private MoneyData principal;
|
||||||
|
private MoneyData inArrearsTolerance;
|
||||||
|
|
||||||
|
private Integer numberOfRepayments;
|
||||||
|
private Integer repaymentEvery;
|
||||||
|
private BigDecimal interestRatePerPeriod = BigDecimal.ZERO;
|
||||||
|
private BigDecimal annualInterestRate = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
private EnumOptionData repaymentFrequencyType;
|
||||||
|
private EnumOptionData interestRateFrequencyType;
|
||||||
|
private EnumOptionData amortizationType;
|
||||||
|
private EnumOptionData interestType;
|
||||||
|
private EnumOptionData interestCalculationPeriodType;
|
||||||
|
|
||||||
|
private DateTime createdOn;
|
||||||
|
private DateTime lastModifedOn;
|
||||||
|
|
||||||
|
private List<CurrencyData> currencyOptions = new ArrayList<CurrencyData>();
|
||||||
|
private List<EnumOptionData> amortizationTypeOptions = new ArrayList<EnumOptionData>();
|
||||||
|
private List<EnumOptionData> interestTypeOptions = new ArrayList<EnumOptionData>();
|
||||||
|
private List<EnumOptionData> interestCalculationPeriodTypeOptions = new ArrayList<EnumOptionData>();
|
||||||
|
private List<EnumOptionData> repaymentFrequencyTypeOptions = new ArrayList<EnumOptionData>();
|
||||||
|
private List<EnumOptionData> interestRateFrequencyTypeOptions = new ArrayList<EnumOptionData>();
|
||||||
|
|
||||||
|
public LoanProductData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanProductData(DateTime createdOn, DateTime lastModifedOn, Long id,
|
||||||
|
String name, String description, MoneyData principal,
|
||||||
|
MoneyData tolerance, Integer numberOfRepayments,
|
||||||
|
Integer repaymentEvery, BigDecimal interestRatePerPeriod,
|
||||||
|
BigDecimal annualInterestRate,
|
||||||
|
EnumOptionData repaymentFrequencyType,
|
||||||
|
EnumOptionData interestRateFrequencyType,
|
||||||
|
EnumOptionData amortizationType,
|
||||||
|
EnumOptionData interestType,
|
||||||
|
EnumOptionData interestCalculationPeriodType) {
|
||||||
|
this.createdOn = createdOn;
|
||||||
|
this.lastModifedOn = lastModifedOn;
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
this.principal = principal;
|
||||||
|
this.inArrearsTolerance = tolerance;
|
||||||
|
this.numberOfRepayments = numberOfRepayments;
|
||||||
|
this.repaymentEvery = repaymentEvery;
|
||||||
|
this.interestRatePerPeriod = interestRatePerPeriod;
|
||||||
|
this.annualInterestRate = annualInterestRate;
|
||||||
|
this.repaymentFrequencyType = repaymentFrequencyType;
|
||||||
|
this.interestRateFrequencyType = interestRateFrequencyType;
|
||||||
|
this.amortizationType = amortizationType;
|
||||||
|
this.interestType = interestType;
|
||||||
|
this.interestCalculationPeriodType = interestCalculationPeriodType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getPrincipal() {
|
||||||
|
return principal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipal(MoneyData principal) {
|
||||||
|
this.principal = principal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getInArrearsTolerance() {
|
||||||
|
return inArrearsTolerance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInArrearsTolerance(MoneyData inArrearsTolerance) {
|
||||||
|
this.inArrearsTolerance = inArrearsTolerance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumberOfRepayments() {
|
||||||
|
return numberOfRepayments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfRepayments(Integer numberOfRepayments) {
|
||||||
|
this.numberOfRepayments = numberOfRepayments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRepaymentEvery() {
|
||||||
|
return repaymentEvery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentEvery(Integer repaymentEvery) {
|
||||||
|
this.repaymentEvery = repaymentEvery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getInterestRatePerPeriod() {
|
||||||
|
return interestRatePerPeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRatePerPeriod(BigDecimal interestRatePerPeriod) {
|
||||||
|
this.interestRatePerPeriod = interestRatePerPeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getAnnualInterestRate() {
|
||||||
|
return annualInterestRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnnualInterestRate(BigDecimal annualInterestRate) {
|
||||||
|
this.annualInterestRate = annualInterestRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DateTime getCreatedOn() {
|
||||||
|
return createdOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedOn(DateTime createdOn) {
|
||||||
|
this.createdOn = createdOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DateTime getLastModifedOn() {
|
||||||
|
return lastModifedOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastModifedOn(DateTime lastModifedOn) {
|
||||||
|
this.lastModifedOn = lastModifedOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumOptionData getRepaymentFrequencyType() {
|
||||||
|
return repaymentFrequencyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentFrequencyType(EnumOptionData repaymentFrequencyType) {
|
||||||
|
this.repaymentFrequencyType = repaymentFrequencyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumOptionData getInterestRateFrequencyType() {
|
||||||
|
return interestRateFrequencyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRateFrequencyType(
|
||||||
|
EnumOptionData interestRateFrequencyType) {
|
||||||
|
this.interestRateFrequencyType = interestRateFrequencyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumOptionData getAmortizationType() {
|
||||||
|
return amortizationType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmortizationType(EnumOptionData amortizationType) {
|
||||||
|
this.amortizationType = amortizationType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumOptionData getInterestType() {
|
||||||
|
return interestType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestType(EnumOptionData interestType) {
|
||||||
|
this.interestType = interestType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumOptionData getInterestCalculationPeriodType() {
|
||||||
|
return interestCalculationPeriodType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestCalculationPeriodType(
|
||||||
|
EnumOptionData interestCalculationPeriodType) {
|
||||||
|
this.interestCalculationPeriodType = interestCalculationPeriodType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<EnumOptionData> getRepaymentFrequencyTypeOptions() {
|
||||||
|
return repaymentFrequencyTypeOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentFrequencyTypeOptions(
|
||||||
|
List<EnumOptionData> repaymentFrequencyTypeOptions) {
|
||||||
|
this.repaymentFrequencyTypeOptions = repaymentFrequencyTypeOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<EnumOptionData> getInterestRateFrequencyTypeOptions() {
|
||||||
|
return interestRateFrequencyTypeOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRateFrequencyTypeOptions(
|
||||||
|
List<EnumOptionData> interestRateFrequencyTypeOptions) {
|
||||||
|
this.interestRateFrequencyTypeOptions = interestRateFrequencyTypeOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CurrencyData> getCurrencyOptions() {
|
||||||
|
return currencyOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrencyOptions(List<CurrencyData> currencyOptions) {
|
||||||
|
this.currencyOptions = currencyOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<EnumOptionData> getAmortizationTypeOptions() {
|
||||||
|
return amortizationTypeOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmortizationTypeOptions(
|
||||||
|
List<EnumOptionData> amortizationTypeOptions) {
|
||||||
|
this.amortizationTypeOptions = amortizationTypeOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<EnumOptionData> getInterestTypeOptions() {
|
||||||
|
return interestTypeOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestTypeOptions(List<EnumOptionData> interestTypeOptions) {
|
||||||
|
this.interestTypeOptions = interestTypeOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<EnumOptionData> getInterestCalculationPeriodTypeOptions() {
|
||||||
|
return interestCalculationPeriodTypeOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestCalculationPeriodTypeOptions(
|
||||||
|
List<EnumOptionData> interestCalculationPeriodTypeOptions) {
|
||||||
|
this.interestCalculationPeriodTypeOptions = interestCalculationPeriodTypeOptions;
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.mifosng.data;
|
package org.mifosng.platform.api.data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -9,6 +9,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||||||
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||||
import org.codehaus.jackson.map.annotate.JsonFilter;
|
import org.codehaus.jackson.map.annotate.JsonFilter;
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
|
import org.mifosng.data.LoanSchedule;
|
||||||
|
|
||||||
@XmlRootElement(name = "newloanworkflow")
|
@XmlRootElement(name = "newloanworkflow")
|
||||||
@JsonIgnoreProperties({ "organisationId", "organisationName" })
|
@JsonIgnoreProperties({ "organisationId", "organisationName" })
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.mifosng.data;
|
package org.mifosng.platform.api.data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.mifosng.data;
|
package org.mifosng.platform.api.data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.mifosng.data;
|
package org.mifosng.platform.api.data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.mifosng.data;
|
package org.mifosng.platform.api.data;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
+1
-1
@@ -2,9 +2,9 @@ package org.mifosng.platform.client.service;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.mifosng.data.ClientData;
|
|
||||||
import org.mifosng.data.ClientLoanAccountSummaryCollectionData;
|
import org.mifosng.data.ClientLoanAccountSummaryCollectionData;
|
||||||
import org.mifosng.data.NoteData;
|
import org.mifosng.data.NoteData;
|
||||||
|
import org.mifosng.platform.api.data.ClientData;
|
||||||
|
|
||||||
public interface ClientReadPlatformService {
|
public interface ClientReadPlatformService {
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -11,13 +11,13 @@ import javax.sql.DataSource;
|
|||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import org.mifosng.data.AppUserData;
|
|
||||||
import org.mifosng.data.ClientData;
|
|
||||||
import org.mifosng.data.ClientLoanAccountSummaryCollectionData;
|
import org.mifosng.data.ClientLoanAccountSummaryCollectionData;
|
||||||
import org.mifosng.data.ClientLoanAccountSummaryData;
|
import org.mifosng.data.ClientLoanAccountSummaryData;
|
||||||
import org.mifosng.data.NoteData;
|
import org.mifosng.data.NoteData;
|
||||||
import org.mifosng.data.OfficeData;
|
import org.mifosng.platform.api.data.AppUserData;
|
||||||
import org.mifosng.data.OfficeLookup;
|
import org.mifosng.platform.api.data.ClientData;
|
||||||
|
import org.mifosng.platform.api.data.OfficeData;
|
||||||
|
import org.mifosng.platform.api.data.OfficeLookup;
|
||||||
import org.mifosng.platform.exceptions.ClientNotFoundException;
|
import org.mifosng.platform.exceptions.ClientNotFoundException;
|
||||||
import org.mifosng.platform.exceptions.NoteNotFoundException;
|
import org.mifosng.platform.exceptions.NoteNotFoundException;
|
||||||
import org.mifosng.platform.infrastructure.JdbcSupport;
|
import org.mifosng.platform.infrastructure.JdbcSupport;
|
||||||
|
|||||||
+9
-3
@@ -1,19 +1,25 @@
|
|||||||
package org.mifosng.platform.loan.domain;
|
package org.mifosng.platform.loan.domain;
|
||||||
|
|
||||||
public enum AmortizationMethod {
|
public enum AmortizationMethod {
|
||||||
EQUAL_PRINCIPAL(0), EQUAL_INSTALLMENTS(1), INVALID(2);
|
EQUAL_PRINCIPAL(0, "amortizationType.equal.principal"), EQUAL_INSTALLMENTS(1, "amortizationType.equal.installments"), INVALID(2, "amortizationType.invalid");
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
|
private final String code;
|
||||||
|
|
||||||
private AmortizationMethod(final Integer value) {
|
private AmortizationMethod(final Integer value, final String code) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
public static AmortizationMethod fromInt(final Integer selectedMethod) {
|
public static AmortizationMethod fromInt(final Integer selectedMethod) {
|
||||||
|
|
||||||
if (selectedMethod == null) {
|
if (selectedMethod == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
+1
-1
@@ -483,7 +483,7 @@ public class DerivedLoanDataProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Money moneyFrom(MoneyData money) {
|
private Money moneyFrom(MoneyData money) {
|
||||||
MonetaryCurrency monetaryCurrency = new MonetaryCurrency(money.getCurrencyCode(), money.getCurrencyDigitsAfterDecimal());
|
MonetaryCurrency monetaryCurrency = new MonetaryCurrency(money.getCurrencyCode(), money.getDigitsAfterDecimal());
|
||||||
return Money.of(monetaryCurrency, money.getAmount());
|
return Money.of(monetaryCurrency, money.getAmount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+9
-3
@@ -1,19 +1,25 @@
|
|||||||
package org.mifosng.platform.loan.domain;
|
package org.mifosng.platform.loan.domain;
|
||||||
|
|
||||||
public enum InterestCalculationPeriodMethod {
|
public enum InterestCalculationPeriodMethod {
|
||||||
DAILY(0), SAME_AS_REPAYMENT_PERIOD(1), INVALID(2);
|
DAILY(0, "interestCalculationPeriodType.daily"), SAME_AS_REPAYMENT_PERIOD(1, "interestCalculationPeriodType.same.as.repayment.period"), INVALID(2, "interestCalculationPeriodType.invalid");
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
|
private final String code;
|
||||||
|
|
||||||
private InterestCalculationPeriodMethod(final Integer value) {
|
private InterestCalculationPeriodMethod(final Integer value, final String code) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
public static InterestCalculationPeriodMethod fromInt(final Integer selectedMethod) {
|
public static InterestCalculationPeriodMethod fromInt(final Integer selectedMethod) {
|
||||||
|
|
||||||
InterestCalculationPeriodMethod repaymentMethod = null;
|
InterestCalculationPeriodMethod repaymentMethod = null;
|
||||||
switch (selectedMethod) {
|
switch (selectedMethod) {
|
||||||
|
|||||||
@@ -1,19 +1,25 @@
|
|||||||
package org.mifosng.platform.loan.domain;
|
package org.mifosng.platform.loan.domain;
|
||||||
|
|
||||||
public enum InterestMethod {
|
public enum InterestMethod {
|
||||||
DECLINING_BALANCE(0), FLAT(1), INVALID(2);
|
DECLINING_BALANCE(0, "interestType.declining.balance"), FLAT(1, "interestType.flat"), INVALID(2, "interestType.invalid");
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
|
private final String code;
|
||||||
|
|
||||||
private InterestMethod(final Integer value) {
|
private InterestMethod(final Integer value, final String code) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
public static InterestMethod fromInt(final Integer selectedMethod) {
|
public static InterestMethod fromInt(final Integer selectedMethod) {
|
||||||
|
|
||||||
InterestMethod repaymentMethod = null;
|
InterestMethod repaymentMethod = null;
|
||||||
switch (selectedMethod) {
|
switch (selectedMethod) {
|
||||||
|
|||||||
+8
-2
@@ -1,17 +1,23 @@
|
|||||||
package org.mifosng.platform.loan.domain;
|
package org.mifosng.platform.loan.domain;
|
||||||
|
|
||||||
public enum PeriodFrequencyType {
|
public enum PeriodFrequencyType {
|
||||||
DAYS(0), WEEKS(1), MONTHS(2), YEARS(3), INVALID(4);
|
DAYS(0, "periodFrequencyType.days"), WEEKS(1, "periodFrequencyType.weeks"), MONTHS(2, "periodFrequencyType.months"), YEARS(3, "periodFrequencyType.years"), INVALID(4, "periodFrequencyType.invalid");
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
|
private final String code;
|
||||||
|
|
||||||
private PeriodFrequencyType(final Integer value) {
|
private PeriodFrequencyType(final Integer value, final String code) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
public static PeriodFrequencyType fromInt(final Integer frequency) {
|
public static PeriodFrequencyType fromInt(final Integer frequency) {
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ package org.mifosng.platform.loan.service;
|
|||||||
|
|
||||||
import org.mifosng.data.LoanAccountData;
|
import org.mifosng.data.LoanAccountData;
|
||||||
import org.mifosng.data.LoanRepaymentData;
|
import org.mifosng.data.LoanRepaymentData;
|
||||||
import org.mifosng.data.NewLoanWorkflowStepOneData;
|
import org.mifosng.platform.api.data.NewLoanWorkflowStepOneData;
|
||||||
|
|
||||||
public interface LoanReadPlatformService {
|
public interface LoanReadPlatformService {
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -7,14 +7,14 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import org.mifosng.data.ClientData;
|
|
||||||
import org.mifosng.data.CurrencyData;
|
import org.mifosng.data.CurrencyData;
|
||||||
import org.mifosng.data.DerivedLoanData;
|
import org.mifosng.data.DerivedLoanData;
|
||||||
import org.mifosng.data.LoanAccountData;
|
import org.mifosng.data.LoanAccountData;
|
||||||
import org.mifosng.data.LoanProductData;
|
|
||||||
import org.mifosng.data.LoanRepaymentData;
|
import org.mifosng.data.LoanRepaymentData;
|
||||||
import org.mifosng.data.MoneyData;
|
import org.mifosng.data.MoneyData;
|
||||||
import org.mifosng.data.NewLoanWorkflowStepOneData;
|
import org.mifosng.platform.api.data.ClientData;
|
||||||
|
import org.mifosng.platform.api.data.LoanProductData;
|
||||||
|
import org.mifosng.platform.api.data.NewLoanWorkflowStepOneData;
|
||||||
import org.mifosng.platform.client.service.ClientReadPlatformService;
|
import org.mifosng.platform.client.service.ClientReadPlatformService;
|
||||||
import org.mifosng.platform.currency.domain.ApplicationCurrency;
|
import org.mifosng.platform.currency.domain.ApplicationCurrency;
|
||||||
import org.mifosng.platform.currency.domain.ApplicationCurrencyRepository;
|
import org.mifosng.platform.currency.domain.ApplicationCurrencyRepository;
|
||||||
|
|||||||
+1
-1
@@ -297,7 +297,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
|
|
||||||
final MonetaryCurrency monetaryCurrency = new MonetaryCurrency(
|
final MonetaryCurrency monetaryCurrency = new MonetaryCurrency(
|
||||||
scheduledLoanInstallment.getPrincipalDue().getCurrencyCode(),
|
scheduledLoanInstallment.getPrincipalDue().getCurrencyCode(),
|
||||||
scheduledLoanInstallment.getPrincipalDue().getCurrencyDigitsAfterDecimal());
|
scheduledLoanInstallment.getPrincipalDue().getDigitsAfterDecimal());
|
||||||
|
|
||||||
Money principal = Money.of(monetaryCurrency,
|
Money principal = Money.of(monetaryCurrency,
|
||||||
scheduledLoanInstallment.getPrincipalDue().getAmount());
|
scheduledLoanInstallment.getPrincipalDue().getAmount());
|
||||||
|
|||||||
+4
-4
@@ -6,13 +6,13 @@ import org.mifosng.data.EnumOptionData;
|
|||||||
|
|
||||||
public interface LoanDropdownReadPlatformService {
|
public interface LoanDropdownReadPlatformService {
|
||||||
|
|
||||||
List<EnumOptionData> retrieveLoanAmortizationMethodOptions();
|
List<EnumOptionData> retrieveLoanAmortizationTypeOptions();
|
||||||
|
|
||||||
List<EnumOptionData> retrieveLoanInterestMethodOptions();
|
List<EnumOptionData> retrieveLoanInterestTypeOptions();
|
||||||
|
|
||||||
List<EnumOptionData> retrieveLoanInterestRateCalculatedInPeriodOptions();
|
List<EnumOptionData> retrieveLoanInterestRateCalculatedInPeriodOptions();
|
||||||
|
|
||||||
List<EnumOptionData> retrieveRepaymentFrequencyOptions();
|
List<EnumOptionData> retrieveRepaymentFrequencyTypeOptions();
|
||||||
|
|
||||||
List<EnumOptionData> retrieveInterestFrequencyOptions();
|
List<EnumOptionData> retrieveInterestRateFrequencyTypeOptions();
|
||||||
}
|
}
|
||||||
+29
-58
@@ -1,59 +1,40 @@
|
|||||||
package org.mifosng.platform.loanproduct.service;
|
package org.mifosng.platform.loanproduct.service;
|
||||||
|
|
||||||
|
import static org.mifosng.platform.loanproduct.service.LoanEnumerations.amortizationType;
|
||||||
|
import static org.mifosng.platform.loanproduct.service.LoanEnumerations.interestCalculationPeriodType;
|
||||||
|
import static org.mifosng.platform.loanproduct.service.LoanEnumerations.interestRateFrequencyType;
|
||||||
|
import static org.mifosng.platform.loanproduct.service.LoanEnumerations.interestType;
|
||||||
|
import static org.mifosng.platform.loanproduct.service.LoanEnumerations.repaymentFrequencyType;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
|
||||||
|
|
||||||
import org.mifosng.data.EnumOptionData;
|
import org.mifosng.data.EnumOptionData;
|
||||||
import org.mifosng.platform.loan.domain.AmortizationMethod;
|
import org.mifosng.platform.loan.domain.AmortizationMethod;
|
||||||
|
import org.mifosng.platform.loan.domain.InterestCalculationPeriodMethod;
|
||||||
|
import org.mifosng.platform.loan.domain.InterestMethod;
|
||||||
import org.mifosng.platform.loan.domain.PeriodFrequencyType;
|
import org.mifosng.platform.loan.domain.PeriodFrequencyType;
|
||||||
import org.mifosng.platform.security.PlatformSecurityContext;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/*
|
|
||||||
* FIXME - remove hardcoded return of loan dropdown options
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
@Service
|
@Service
|
||||||
public class LoanDropdownReadPlatformServiceImpl implements LoanDropdownReadPlatformService {
|
public class LoanDropdownReadPlatformServiceImpl implements
|
||||||
|
LoanDropdownReadPlatformService {
|
||||||
private final PlatformSecurityContext context;
|
|
||||||
private final SimpleJdbcTemplate jdbcTemplate;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public LoanDropdownReadPlatformServiceImpl(final PlatformSecurityContext context, final DataSource dataSource) {
|
|
||||||
this.context = context;
|
|
||||||
this.jdbcTemplate = new SimpleJdbcTemplate(dataSource);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<EnumOptionData> retrieveLoanAmortizationMethodOptions() {
|
public List<EnumOptionData> retrieveLoanAmortizationTypeOptions() {
|
||||||
EnumOptionData equalInstallments = new EnumOptionData(
|
|
||||||
"Equal installments", AmortizationMethod.EQUAL_INSTALLMENTS
|
|
||||||
.getValue().longValue());
|
|
||||||
EnumOptionData equalPrinciplePayments = new EnumOptionData(
|
|
||||||
"Equal principle payments", AmortizationMethod.EQUAL_PRINCIPAL
|
|
||||||
.getValue().longValue());
|
|
||||||
|
|
||||||
List<EnumOptionData> allowedAmortizationMethods = Arrays.asList(
|
List<EnumOptionData> allowedAmortizationMethods = Arrays.asList(
|
||||||
equalInstallments, equalPrinciplePayments);
|
amortizationType(AmortizationMethod.EQUAL_INSTALLMENTS),
|
||||||
|
amortizationType(AmortizationMethod.EQUAL_PRINCIPAL));
|
||||||
|
|
||||||
return allowedAmortizationMethods;
|
return allowedAmortizationMethods;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<EnumOptionData> retrieveLoanInterestMethodOptions() {
|
public List<EnumOptionData> retrieveLoanInterestTypeOptions() {
|
||||||
EnumOptionData interestRateCalculationMethod2 = new EnumOptionData(
|
|
||||||
"Declining Balance", Long.valueOf(0));
|
|
||||||
EnumOptionData interestRateCalculationMethod1 = new EnumOptionData(
|
|
||||||
"Flat", Long.valueOf(1));
|
|
||||||
|
|
||||||
List<EnumOptionData> allowedRepaymentScheduleCalculationMethods = Arrays
|
List<EnumOptionData> allowedRepaymentScheduleCalculationMethods = Arrays
|
||||||
.asList(interestRateCalculationMethod2,
|
.asList(interestType(InterestMethod.FLAT),
|
||||||
interestRateCalculationMethod1);
|
interestType(InterestMethod.DECLINING_BALANCE));
|
||||||
|
|
||||||
return allowedRepaymentScheduleCalculationMethods;
|
return allowedRepaymentScheduleCalculationMethods;
|
||||||
}
|
}
|
||||||
@@ -61,39 +42,29 @@ public class LoanDropdownReadPlatformServiceImpl implements LoanDropdownReadPlat
|
|||||||
@Override
|
@Override
|
||||||
public List<EnumOptionData> retrieveLoanInterestRateCalculatedInPeriodOptions() {
|
public List<EnumOptionData> retrieveLoanInterestRateCalculatedInPeriodOptions() {
|
||||||
|
|
||||||
EnumOptionData option1 = new EnumOptionData("Daily",
|
List<EnumOptionData> allowedOptions = Arrays
|
||||||
Long.valueOf(0));
|
.asList(interestCalculationPeriodType(InterestCalculationPeriodMethod.DAILY),
|
||||||
EnumOptionData option2 = new EnumOptionData(
|
interestCalculationPeriodType(InterestCalculationPeriodMethod.SAME_AS_REPAYMENT_PERIOD));
|
||||||
"Same as repayment period", Long.valueOf(1));
|
|
||||||
|
|
||||||
List<EnumOptionData> allowedOptions = Arrays.asList(option1,
|
|
||||||
option2);
|
|
||||||
|
|
||||||
return allowedOptions;
|
return allowedOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<EnumOptionData> retrieveRepaymentFrequencyOptions() {
|
public List<EnumOptionData> retrieveRepaymentFrequencyTypeOptions() {
|
||||||
EnumOptionData frequency1 = new EnumOptionData("Days",
|
|
||||||
Long.valueOf(0));
|
|
||||||
EnumOptionData frequency2 = new EnumOptionData("Weeks",
|
|
||||||
Long.valueOf(1));
|
|
||||||
EnumOptionData frequency3 = new EnumOptionData("Months",
|
|
||||||
Long.valueOf(2));
|
|
||||||
List<EnumOptionData> repaymentFrequencyOptions = Arrays.asList(
|
List<EnumOptionData> repaymentFrequencyOptions = Arrays.asList(
|
||||||
frequency1, frequency2, frequency3);
|
repaymentFrequencyType(PeriodFrequencyType.DAYS),
|
||||||
|
repaymentFrequencyType(PeriodFrequencyType.WEEKS),
|
||||||
|
repaymentFrequencyType(PeriodFrequencyType.MONTHS));
|
||||||
return repaymentFrequencyOptions;
|
return repaymentFrequencyOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<EnumOptionData> retrieveInterestFrequencyOptions() {
|
public List<EnumOptionData> retrieveInterestRateFrequencyTypeOptions() {
|
||||||
// support for monthly and annual percentage rate (MPR) and (APR)
|
// support for monthly and annual percentage rate (MPR) and (APR)
|
||||||
EnumOptionData perMonth = new EnumOptionData("Per month",
|
List<EnumOptionData> interestRateFrequencyTypeOptions = Arrays.asList(
|
||||||
PeriodFrequencyType.MONTHS.getValue().longValue());
|
interestRateFrequencyType(PeriodFrequencyType.MONTHS),
|
||||||
EnumOptionData perYear = new EnumOptionData("Per year",
|
interestRateFrequencyType(PeriodFrequencyType.YEARS));
|
||||||
PeriodFrequencyType.YEARS.getValue().longValue());
|
return interestRateFrequencyTypeOptions;
|
||||||
List<EnumOptionData> repaymentFrequencyOptions = Arrays.asList(
|
|
||||||
perMonth, perYear);
|
|
||||||
return repaymentFrequencyOptions;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+115
@@ -0,0 +1,115 @@
|
|||||||
|
package org.mifosng.platform.loanproduct.service;
|
||||||
|
|
||||||
|
import org.mifosng.data.EnumOptionData;
|
||||||
|
import org.mifosng.platform.loan.domain.AmortizationMethod;
|
||||||
|
import org.mifosng.platform.loan.domain.InterestCalculationPeriodMethod;
|
||||||
|
import org.mifosng.platform.loan.domain.InterestMethod;
|
||||||
|
import org.mifosng.platform.loan.domain.PeriodFrequencyType;
|
||||||
|
|
||||||
|
public class LoanEnumerations {
|
||||||
|
|
||||||
|
public static EnumOptionData repaymentFrequencyType(final int id) {
|
||||||
|
return repaymentFrequencyType(PeriodFrequencyType.fromInt(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumOptionData repaymentFrequencyType(final PeriodFrequencyType type) {
|
||||||
|
final String codePrefix = "repaymentFrequency.";
|
||||||
|
EnumOptionData optionData = null;
|
||||||
|
switch (type) {
|
||||||
|
case DAYS:
|
||||||
|
optionData = new EnumOptionData(PeriodFrequencyType.DAYS.getValue().longValue(), codePrefix + PeriodFrequencyType.DAYS.getCode(), "Days");
|
||||||
|
break;
|
||||||
|
case WEEKS:
|
||||||
|
optionData = new EnumOptionData(PeriodFrequencyType.WEEKS.getValue().longValue(), codePrefix + PeriodFrequencyType.WEEKS.getCode(), "Weeks");
|
||||||
|
break;
|
||||||
|
case MONTHS:
|
||||||
|
optionData = new EnumOptionData(PeriodFrequencyType.MONTHS.getValue().longValue(), codePrefix + PeriodFrequencyType.MONTHS.getCode(), "Months");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
optionData = new EnumOptionData(PeriodFrequencyType.INVALID.getValue().longValue(), PeriodFrequencyType.INVALID.getCode(), "Invalid");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return optionData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumOptionData interestRateFrequencyType(final int id) {
|
||||||
|
return interestRateFrequencyType(PeriodFrequencyType.fromInt(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumOptionData interestRateFrequencyType(final PeriodFrequencyType type) {
|
||||||
|
final String codePrefix = "interestRateFrequency.";
|
||||||
|
EnumOptionData optionData = null;
|
||||||
|
switch (type) {
|
||||||
|
case MONTHS:
|
||||||
|
optionData = new EnumOptionData(PeriodFrequencyType.MONTHS.getValue().longValue(), codePrefix + PeriodFrequencyType.MONTHS.getCode(), "Per month");
|
||||||
|
break;
|
||||||
|
case YEARS:
|
||||||
|
optionData = new EnumOptionData(PeriodFrequencyType.YEARS.getValue().longValue(), codePrefix + PeriodFrequencyType.YEARS.getCode(), "Per year");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
optionData = new EnumOptionData(PeriodFrequencyType.INVALID.getValue().longValue(), PeriodFrequencyType.INVALID.getCode(), "Invalid");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return optionData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumOptionData amortizationType(Integer id) {
|
||||||
|
return amortizationType(AmortizationMethod.fromInt(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumOptionData amortizationType(AmortizationMethod amortizationMethod) {
|
||||||
|
EnumOptionData optionData = null;
|
||||||
|
switch (amortizationMethod) {
|
||||||
|
case EQUAL_INSTALLMENTS:
|
||||||
|
optionData = new EnumOptionData(AmortizationMethod.EQUAL_INSTALLMENTS.getValue().longValue(), AmortizationMethod.EQUAL_INSTALLMENTS.getCode(), "Equal installments");
|
||||||
|
break;
|
||||||
|
case EQUAL_PRINCIPAL:
|
||||||
|
optionData = new EnumOptionData(AmortizationMethod.EQUAL_PRINCIPAL.getValue().longValue(), AmortizationMethod.EQUAL_PRINCIPAL.getCode(), "Equal principle payments");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
optionData = new EnumOptionData(AmortizationMethod.INVALID.getValue().longValue(), AmortizationMethod.INVALID.getCode(), "Invalid");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return optionData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumOptionData interestType(Integer id) {
|
||||||
|
return interestType(InterestMethod.fromInt(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumOptionData interestType(InterestMethod type) {
|
||||||
|
EnumOptionData optionData = null;
|
||||||
|
switch (type) {
|
||||||
|
case FLAT:
|
||||||
|
optionData = new EnumOptionData(InterestMethod.FLAT.getValue().longValue(), InterestMethod.FLAT.getCode(), "Flat");
|
||||||
|
break;
|
||||||
|
case DECLINING_BALANCE:
|
||||||
|
optionData = new EnumOptionData(InterestMethod.DECLINING_BALANCE.getValue().longValue(), InterestMethod.DECLINING_BALANCE.getCode(), "Declining Balance");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
optionData = new EnumOptionData(AmortizationMethod.INVALID.getValue().longValue(), AmortizationMethod.INVALID.getCode(), "Invalid");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return optionData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumOptionData interestCalculationPeriodType(Integer id) {
|
||||||
|
return interestCalculationPeriodType(InterestCalculationPeriodMethod.fromInt(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumOptionData interestCalculationPeriodType(InterestCalculationPeriodMethod type) {
|
||||||
|
EnumOptionData optionData = null;
|
||||||
|
switch (type) {
|
||||||
|
case DAILY:
|
||||||
|
optionData= new EnumOptionData(InterestCalculationPeriodMethod.DAILY.getValue().longValue(), InterestCalculationPeriodMethod.DAILY.getCode(), "Daily");
|
||||||
|
break;
|
||||||
|
case SAME_AS_REPAYMENT_PERIOD:
|
||||||
|
optionData = new EnumOptionData(InterestCalculationPeriodMethod.SAME_AS_REPAYMENT_PERIOD.getValue().longValue(), InterestCalculationPeriodMethod.SAME_AS_REPAYMENT_PERIOD.getCode(), "Same as repayment period");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
optionData = new EnumOptionData(AmortizationMethod.INVALID.getValue().longValue(), AmortizationMethod.INVALID.getCode(), "Invalid");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return optionData;
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -2,7 +2,7 @@ package org.mifosng.platform.loanproduct.service;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.mifosng.data.LoanProductData;
|
import org.mifosng.platform.api.data.LoanProductData;
|
||||||
|
|
||||||
public interface LoanProductReadPlatformService {
|
public interface LoanProductReadPlatformService {
|
||||||
|
|
||||||
|
|||||||
+49
-42
@@ -11,11 +11,15 @@ import javax.sql.DataSource;
|
|||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.mifosng.data.CurrencyData;
|
import org.mifosng.data.CurrencyData;
|
||||||
import org.mifosng.data.EnumOptionData;
|
import org.mifosng.data.EnumOptionData;
|
||||||
import org.mifosng.data.LoanProductData;
|
|
||||||
import org.mifosng.data.MoneyData;
|
import org.mifosng.data.MoneyData;
|
||||||
|
import org.mifosng.platform.api.data.LoanProductData;
|
||||||
import org.mifosng.platform.currency.service.CurrencyReadPlatformService;
|
import org.mifosng.platform.currency.service.CurrencyReadPlatformService;
|
||||||
import org.mifosng.platform.exceptions.LoanProductNotFoundException;
|
import org.mifosng.platform.exceptions.LoanProductNotFoundException;
|
||||||
import org.mifosng.platform.infrastructure.JdbcSupport;
|
import org.mifosng.platform.infrastructure.JdbcSupport;
|
||||||
|
import org.mifosng.platform.loan.domain.AmortizationMethod;
|
||||||
|
import org.mifosng.platform.loan.domain.InterestCalculationPeriodMethod;
|
||||||
|
import org.mifosng.platform.loan.domain.InterestMethod;
|
||||||
|
import org.mifosng.platform.loan.domain.PeriodFrequencyType;
|
||||||
import org.mifosng.platform.security.PlatformSecurityContext;
|
import org.mifosng.platform.security.PlatformSecurityContext;
|
||||||
import org.mifosng.platform.user.domain.AppUser;
|
import org.mifosng.platform.user.domain.AppUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -80,24 +84,21 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
|
|||||||
|
|
||||||
LoanProductData productData = new LoanProductData();
|
LoanProductData productData = new LoanProductData();
|
||||||
|
|
||||||
|
productData.setAmortizationType(LoanEnumerations.amortizationType(AmortizationMethod.EQUAL_INSTALLMENTS));
|
||||||
|
productData.setInterestType(LoanEnumerations.interestType(InterestMethod.DECLINING_BALANCE));
|
||||||
|
productData.setRepaymentFrequencyType(LoanEnumerations.repaymentFrequencyType(PeriodFrequencyType.MONTHS));
|
||||||
|
productData.setInterestRateFrequencyType(LoanEnumerations.interestRateFrequencyType(PeriodFrequencyType.MONTHS));
|
||||||
|
productData.setInterestCalculationPeriodType(LoanEnumerations.interestCalculationPeriodType(InterestCalculationPeriodMethod.SAME_AS_REPAYMENT_PERIOD));
|
||||||
|
|
||||||
populateProductDataWithDropdownOptions(productData);
|
populateProductDataWithDropdownOptions(productData);
|
||||||
|
|
||||||
if (productData.getPossibleCurrencies().size() >= 1) {
|
if (productData.getCurrencyOptions().size() >= 1) {
|
||||||
CurrencyData currency = productData.getPossibleCurrencies().get(0);
|
CurrencyData currency = productData.getCurrencyOptions().get(0);
|
||||||
MoneyData zero = MoneyData.zero(currency);
|
MoneyData zero = MoneyData.zero(currency);
|
||||||
productData.setPrincipalMoney(zero);
|
productData.setPrincipal(zero);
|
||||||
productData.setInArrearsTolerance(zero);
|
productData.setInArrearsTolerance(zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
productData.setAmortizationMethod(Integer.valueOf(1));
|
|
||||||
productData.setInterestMethod(Integer.valueOf(0));
|
|
||||||
productData.setRepaymentPeriodFrequency(2);
|
|
||||||
productData.setInterestRatePeriod(2);
|
|
||||||
productData.setInterestRateCalculatedInPeriod(1);
|
|
||||||
|
|
||||||
productData.setRepaidEvery(1);
|
|
||||||
productData.setNumberOfRepayments(0);
|
|
||||||
|
|
||||||
return productData;
|
return productData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,26 +143,32 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
|
|||||||
MoneyData principalMoney = MoneyData.of(currencyData, principal);
|
MoneyData principalMoney = MoneyData.of(currencyData, principal);
|
||||||
MoneyData toleranceMoney = MoneyData.of(currencyData, tolerance);
|
MoneyData toleranceMoney = MoneyData.of(currencyData, tolerance);
|
||||||
|
|
||||||
BigDecimal interestRatePerPeriod = rs.getBigDecimal("interestRatePerPeriod");
|
|
||||||
int interestRatePeriod = JdbcSupport.getInteger(rs, "interestRatePerPeriodFreq");
|
|
||||||
BigDecimal annualInterestRate = rs.getBigDecimal("annualInterestRate");
|
|
||||||
int interestMethod = JdbcSupport.getInteger(rs, "interestMethod");
|
|
||||||
int interestCalculationInPeriodMethod = JdbcSupport.getInteger(rs, "interestCalculationInPeriodMethod");
|
|
||||||
|
|
||||||
Integer repaidEvery = JdbcSupport.getInteger(rs, "repaidEvery");
|
|
||||||
int repaymentFrequency = JdbcSupport.getInteger(rs, "repaymentPeriodFrequency");
|
|
||||||
Integer numberOfRepayments = JdbcSupport.getInteger(rs, "numberOfRepayments");
|
Integer numberOfRepayments = JdbcSupport.getInteger(rs, "numberOfRepayments");
|
||||||
int amortizationMethod = JdbcSupport.getInteger(rs, "amortizationMethod");
|
Integer repaymentEvery = JdbcSupport.getInteger(rs, "repaidEvery");
|
||||||
|
BigDecimal interestRatePerPeriod = rs.getBigDecimal("interestRatePerPeriod");
|
||||||
|
BigDecimal annualInterestRate = rs.getBigDecimal("annualInterestRate");
|
||||||
|
|
||||||
|
int repaymentFrequencyTypeId = JdbcSupport.getInteger(rs, "repaymentPeriodFrequency");
|
||||||
|
EnumOptionData repaymentFrequencyType = LoanEnumerations.repaymentFrequencyType(repaymentFrequencyTypeId);
|
||||||
|
|
||||||
|
int amortizationTypeId = JdbcSupport.getInteger(rs, "amortizationMethod");
|
||||||
|
EnumOptionData amortizationType = LoanEnumerations.amortizationType(amortizationTypeId);
|
||||||
|
|
||||||
|
int interestRateFrequencyTypeId = JdbcSupport.getInteger(rs, "interestRatePerPeriodFreq");
|
||||||
|
EnumOptionData interestRateFrequencyType = LoanEnumerations.interestRateFrequencyType(interestRateFrequencyTypeId);
|
||||||
|
|
||||||
|
int interestTypeId = JdbcSupport.getInteger(rs, "interestMethod");
|
||||||
|
EnumOptionData interestType = LoanEnumerations.interestType(interestTypeId);
|
||||||
|
|
||||||
|
int interestCalculationPeriodTypeId = JdbcSupport.getInteger(rs, "interestCalculationInPeriodMethod");
|
||||||
|
EnumOptionData interestCalculationPeriodType = LoanEnumerations.interestCalculationPeriodType(interestCalculationPeriodTypeId);
|
||||||
|
|
||||||
DateTime createdOn = JdbcSupport.getDateTime(rs, "createdon");
|
DateTime createdOn = JdbcSupport.getDateTime(rs, "createdon");
|
||||||
DateTime lastModifedOn = JdbcSupport.getDateTime(rs, "modifiedon");
|
DateTime lastModifedOn = JdbcSupport.getDateTime(rs, "modifiedon");
|
||||||
|
|
||||||
return new LoanProductData(id, name, description, principalMoney,
|
return new LoanProductData(createdOn, lastModifedOn, id, name, description, principalMoney, toleranceMoney,
|
||||||
interestRatePerPeriod, interestRatePeriod,
|
numberOfRepayments, repaymentEvery, interestRatePerPeriod, annualInterestRate,
|
||||||
annualInterestRate, interestMethod, interestCalculationInPeriodMethod,
|
repaymentFrequencyType, interestRateFrequencyType, amortizationType, interestType, interestCalculationPeriodType);
|
||||||
repaidEvery,
|
|
||||||
repaymentFrequency, numberOfRepayments, amortizationMethod,
|
|
||||||
toleranceMoney, createdOn, lastModifedOn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private CurrencyData findCurrencyByCode(String currencyCode, List<CurrencyData> allowedCurrencies) {
|
private CurrencyData findCurrencyByCode(String currencyCode, List<CurrencyData> allowedCurrencies) {
|
||||||
@@ -178,19 +185,19 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
|
|||||||
|
|
||||||
private void populateProductDataWithDropdownOptions(LoanProductData productData) {
|
private void populateProductDataWithDropdownOptions(LoanProductData productData) {
|
||||||
|
|
||||||
List<CurrencyData> possibleCurrencies = currencyReadPlatformService.retrieveAllowedCurrencies();
|
List<CurrencyData> currencyOptions = currencyReadPlatformService.retrieveAllowedCurrencies();
|
||||||
|
List<EnumOptionData> amortizationTypeOptions = dropdownReadPlatformService.retrieveLoanAmortizationTypeOptions();
|
||||||
|
List<EnumOptionData> interestTypeOptions = dropdownReadPlatformService.retrieveLoanInterestTypeOptions();
|
||||||
|
List<EnumOptionData> interestCalculationPeriodTypeOptions = dropdownReadPlatformService.retrieveLoanInterestRateCalculatedInPeriodOptions();
|
||||||
|
List<EnumOptionData> repaymentFrequencyTypeOptions = dropdownReadPlatformService.retrieveRepaymentFrequencyTypeOptions();
|
||||||
|
List<EnumOptionData> interestRateFrequencyTypeOptions = dropdownReadPlatformService.retrieveInterestRateFrequencyTypeOptions();
|
||||||
|
|
||||||
List<EnumOptionData> possibleAmortizationOptions = dropdownReadPlatformService.retrieveLoanAmortizationMethodOptions();
|
productData.setCurrencyOptions(currencyOptions);
|
||||||
List<EnumOptionData> possibleInterestOptions = dropdownReadPlatformService.retrieveLoanInterestMethodOptions();
|
productData.setAmortizationTypeOptions(amortizationTypeOptions);
|
||||||
List<EnumOptionData> possibleInterestRateCalculatedInPeriodOptions = dropdownReadPlatformService.retrieveLoanInterestRateCalculatedInPeriodOptions();
|
productData.setInterestTypeOptions(interestTypeOptions);
|
||||||
List<EnumOptionData> repaymentFrequencyOptions = dropdownReadPlatformService.retrieveRepaymentFrequencyOptions();
|
productData.setInterestCalculationPeriodTypeOptions(interestCalculationPeriodTypeOptions);
|
||||||
List<EnumOptionData> interestFrequencyOptions = dropdownReadPlatformService.retrieveInterestFrequencyOptions();
|
productData.setRepaymentFrequencyTypeOptions(repaymentFrequencyTypeOptions);
|
||||||
|
productData.setInterestRateFrequencyTypeOptions(interestRateFrequencyTypeOptions);
|
||||||
productData.setPossibleCurrencies(possibleCurrencies);
|
|
||||||
productData.setPossibleAmortizationOptions(possibleAmortizationOptions);
|
|
||||||
productData.setPossibleInterestOptions(possibleInterestOptions);
|
|
||||||
productData.setPossibleInterestRateCalculatedInPeriodOptions(possibleInterestRateCalculatedInPeriodOptions);
|
|
||||||
productData.setRepaymentFrequencyOptions(repaymentFrequencyOptions);
|
|
||||||
productData.setInterestFrequencyOptions(interestFrequencyOptions);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+2
-2
@@ -3,8 +3,8 @@ package org.mifosng.platform.organisation.service;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.mifosng.data.OfficeData;
|
import org.mifosng.platform.api.data.OfficeData;
|
||||||
import org.mifosng.data.OfficeLookup;
|
import org.mifosng.platform.api.data.OfficeLookup;
|
||||||
|
|
||||||
public interface OfficeReadPlatformService {
|
public interface OfficeReadPlatformService {
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -9,8 +9,8 @@ import java.util.List;
|
|||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import org.mifosng.data.OfficeData;
|
import org.mifosng.platform.api.data.OfficeData;
|
||||||
import org.mifosng.data.OfficeLookup;
|
import org.mifosng.platform.api.data.OfficeLookup;
|
||||||
import org.mifosng.platform.exceptions.OfficeNotFoundException;
|
import org.mifosng.platform.exceptions.OfficeNotFoundException;
|
||||||
import org.mifosng.platform.infrastructure.JdbcSupport;
|
import org.mifosng.platform.infrastructure.JdbcSupport;
|
||||||
import org.mifosng.platform.security.PlatformSecurityContext;
|
import org.mifosng.platform.security.PlatformSecurityContext;
|
||||||
|
|||||||
@@ -102,8 +102,7 @@ public class LoanOpenResource {
|
|||||||
JSONObject object = new JSONObject();
|
JSONObject object = new JSONObject();
|
||||||
object.put("amount", money.getAmount());
|
object.put("amount", money.getAmount());
|
||||||
object.put("currencyCode", money.getCurrencyCode());
|
object.put("currencyCode", money.getCurrencyCode());
|
||||||
object.put("currencyDigitsAfterDecimal",
|
object.put("currencyDigitsAfterDecimal", money.getDigitsAfterDecimal());
|
||||||
money.getCurrencyDigitsAfterDecimal());
|
|
||||||
|
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import javax.persistence.JoinColumn;
|
|||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
import org.mifosng.data.PermissionData;
|
import org.mifosng.platform.api.data.PermissionData;
|
||||||
import org.mifosng.platform.organisation.domain.Organisation;
|
import org.mifosng.platform.organisation.domain.Organisation;
|
||||||
import org.springframework.data.jpa.domain.AbstractPersistable;
|
import org.springframework.data.jpa.domain.AbstractPersistable;
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ import javax.persistence.ManyToMany;
|
|||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
import org.mifosng.data.PermissionData;
|
import org.mifosng.platform.api.data.PermissionData;
|
||||||
import org.mifosng.data.RoleData;
|
import org.mifosng.platform.api.data.RoleData;
|
||||||
import org.mifosng.platform.infrastructure.AbstractAuditableCustom;
|
import org.mifosng.platform.infrastructure.AbstractAuditableCustom;
|
||||||
import org.mifosng.platform.organisation.domain.Organisation;
|
import org.mifosng.platform.organisation.domain.Organisation;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ package org.mifosng.platform.user.service;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.mifosng.data.AppUserData;
|
import org.mifosng.platform.api.data.AppUserData;
|
||||||
|
|
||||||
public interface AppUserReadPlatformService {
|
public interface AppUserReadPlatformService {
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -11,10 +11,10 @@ import java.util.Set;
|
|||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import org.mifosng.data.AppUserData;
|
import org.mifosng.platform.api.data.AppUserData;
|
||||||
import org.mifosng.data.OfficeData;
|
import org.mifosng.platform.api.data.OfficeData;
|
||||||
import org.mifosng.data.OfficeLookup;
|
import org.mifosng.platform.api.data.OfficeLookup;
|
||||||
import org.mifosng.data.RoleData;
|
import org.mifosng.platform.api.data.RoleData;
|
||||||
import org.mifosng.platform.exceptions.UserNotFoundException;
|
import org.mifosng.platform.exceptions.UserNotFoundException;
|
||||||
import org.mifosng.platform.infrastructure.JdbcSupport;
|
import org.mifosng.platform.infrastructure.JdbcSupport;
|
||||||
import org.mifosng.platform.organisation.service.OfficeReadPlatformService;
|
import org.mifosng.platform.organisation.service.OfficeReadPlatformService;
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ package org.mifosng.platform.user.service;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.mifosng.data.PermissionData;
|
import org.mifosng.platform.api.data.PermissionData;
|
||||||
|
|
||||||
public interface PermissionReadPlatformService {
|
public interface PermissionReadPlatformService {
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import java.util.Collection;
|
|||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import org.mifosng.data.PermissionData;
|
import org.mifosng.platform.api.data.PermissionData;
|
||||||
import org.mifosng.platform.infrastructure.JdbcSupport;
|
import org.mifosng.platform.infrastructure.JdbcSupport;
|
||||||
import org.mifosng.platform.security.PlatformSecurityContext;
|
import org.mifosng.platform.security.PlatformSecurityContext;
|
||||||
import org.mifosng.platform.user.domain.AppUser;
|
import org.mifosng.platform.user.domain.AppUser;
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ package org.mifosng.platform.user.service;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.mifosng.data.RoleData;
|
import org.mifosng.platform.api.data.RoleData;
|
||||||
|
|
||||||
public interface RoleReadPlatformService {
|
public interface RoleReadPlatformService {
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ import java.util.Collection;
|
|||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import org.mifosng.data.RoleData;
|
import org.mifosng.platform.api.data.RoleData;
|
||||||
import org.mifosng.platform.exceptions.RoleNotFoundException;
|
import org.mifosng.platform.exceptions.RoleNotFoundException;
|
||||||
import org.mifosng.platform.infrastructure.JdbcSupport;
|
import org.mifosng.platform.infrastructure.JdbcSupport;
|
||||||
import org.mifosng.platform.security.PlatformSecurityContext;
|
import org.mifosng.platform.security.PlatformSecurityContext;
|
||||||
|
|||||||
Reference in New Issue
Block a user