fix eclipse warnings around unused imports and fields in Data objects.
This commit is contained in:
+2
@@ -2,7 +2,9 @@ package org.mifosplatform.portfolio.account.data;
|
|||||||
|
|
||||||
public class AccountAssociationsData {
|
public class AccountAssociationsData {
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private final Long id;
|
private final Long id;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private final PortfolioAccountData account;
|
private final PortfolioAccountData account;
|
||||||
private final PortfolioAccountData linkedAccount;
|
private final PortfolioAccountData linkedAccount;
|
||||||
|
|
||||||
|
|||||||
+12
-13
@@ -31,14 +31,14 @@ public class AccountAssociationsReadPlatformServiceImpl implements AccountAssoci
|
|||||||
@Override
|
@Override
|
||||||
public PortfolioAccountData retriveLoanAssociation(final Long loanId) {
|
public PortfolioAccountData retriveLoanAssociation(final Long loanId) {
|
||||||
PortfolioAccountData linkedAccount = null;
|
PortfolioAccountData linkedAccount = null;
|
||||||
AccountAssociationsMapper mapper = new AccountAssociationsMapper();
|
final AccountAssociationsMapper mapper = new AccountAssociationsMapper();
|
||||||
String sql = "select " + mapper.schema() + " where aa.loan_account_id = ? ";
|
final String sql = "select " + mapper.schema() + " where aa.loan_account_id = ? ";
|
||||||
try {
|
try {
|
||||||
AccountAssociationsData accountAssociationsData = jdbcTemplate.queryForObject(sql, mapper, loanId);
|
final AccountAssociationsData accountAssociationsData = this.jdbcTemplate.queryForObject(sql, mapper, loanId);
|
||||||
if (accountAssociationsData != null) {
|
if (accountAssociationsData != null) {
|
||||||
linkedAccount = accountAssociationsData.linkedAccount();
|
linkedAccount = accountAssociationsData.linkedAccount();
|
||||||
}
|
}
|
||||||
} catch (EmptyResultDataAccessException e) {
|
} catch (final EmptyResultDataAccessException e) {
|
||||||
logger.debug("Linking account is not configured");
|
logger.debug("Linking account is not configured");
|
||||||
}
|
}
|
||||||
return linkedAccount;
|
return linkedAccount;
|
||||||
@@ -47,13 +47,13 @@ public class AccountAssociationsReadPlatformServiceImpl implements AccountAssoci
|
|||||||
@Override
|
@Override
|
||||||
public boolean isLinkedWithAnyActiveLoan(final Long savingsId) {
|
public boolean isLinkedWithAnyActiveLoan(final Long savingsId) {
|
||||||
boolean hasActiveLoan = false;
|
boolean hasActiveLoan = false;
|
||||||
String sql = "select loanAccount.loan_status_id as status from m_portfolio_account_associations aa " +
|
final String sql = "select loanAccount.loan_status_id as status from m_portfolio_account_associations aa " +
|
||||||
"left join m_loan loanAccount on loanAccount.id = aa.loan_account_id " +
|
"left join m_loan loanAccount on loanAccount.id = aa.loan_account_id " +
|
||||||
"where aa.linked_savings_account_id = ?";
|
"where aa.linked_savings_account_id = ?";
|
||||||
|
|
||||||
List<Integer> statusList= this.jdbcTemplate.queryForList(sql,Integer.class, savingsId);
|
final List<Integer> statusList= this.jdbcTemplate.queryForList(sql,Integer.class, savingsId);
|
||||||
for(Integer status:statusList){
|
for(final Integer status:statusList){
|
||||||
LoanStatus loanStatus= LoanStatus.fromInt(status);
|
final LoanStatus loanStatus= LoanStatus.fromInt(status);
|
||||||
if(loanStatus.isActiveOrAwaitingApprovalOrDisbursal() || loanStatus.isUnderTransfer()){
|
if(loanStatus.isActiveOrAwaitingApprovalOrDisbursal() || loanStatus.isUnderTransfer()){
|
||||||
hasActiveLoan = true;
|
hasActiveLoan = true;
|
||||||
break;
|
break;
|
||||||
@@ -67,7 +67,7 @@ public class AccountAssociationsReadPlatformServiceImpl implements AccountAssoci
|
|||||||
private final String schemaSql;
|
private final String schemaSql;
|
||||||
|
|
||||||
public AccountAssociationsMapper() {
|
public AccountAssociationsMapper() {
|
||||||
StringBuilder sqlBuilder = new StringBuilder();
|
final StringBuilder sqlBuilder = new StringBuilder();
|
||||||
sqlBuilder.append("aa.id as id,");
|
sqlBuilder.append("aa.id as id,");
|
||||||
// sqlBuilder.append("savingsAccount.id as savingsAccountId, savingsAccount.account_no as savingsAccountNo,");
|
// sqlBuilder.append("savingsAccount.id as savingsAccountId, savingsAccount.account_no as savingsAccountNo,");
|
||||||
sqlBuilder.append("loanAccount.id as loanAccountId, loanAccount.account_no as loanAccountNo,");
|
sqlBuilder.append("loanAccount.id as loanAccountId, loanAccount.account_no as loanAccountNo,");
|
||||||
@@ -86,7 +86,7 @@ public class AccountAssociationsReadPlatformServiceImpl implements AccountAssoci
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AccountAssociationsData mapRow(ResultSet rs, @SuppressWarnings("unused") int rowNum) throws SQLException {
|
public AccountAssociationsData mapRow(final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException {
|
||||||
|
|
||||||
final Long id = rs.getLong("id");
|
final Long id = rs.getLong("id");
|
||||||
// final Long savingsAccountId = JdbcSupport.getLong(rs,
|
// final Long savingsAccountId = JdbcSupport.getLong(rs,
|
||||||
@@ -94,8 +94,7 @@ public class AccountAssociationsReadPlatformServiceImpl implements AccountAssoci
|
|||||||
// final String savingsAccountNo = rs.getString("savingsAccountNo");
|
// final String savingsAccountNo = rs.getString("savingsAccountNo");
|
||||||
final Long loanAccountId = JdbcSupport.getLong(rs, "loanAccountId");
|
final Long loanAccountId = JdbcSupport.getLong(rs, "loanAccountId");
|
||||||
final String loanAccountNo = rs.getString("loanAccountNo");
|
final String loanAccountNo = rs.getString("loanAccountNo");
|
||||||
PortfolioAccountData account = PortfolioAccountData.lookup(loanAccountId, loanAccountNo);
|
final PortfolioAccountData account = PortfolioAccountData.lookup(loanAccountId, loanAccountNo);
|
||||||
;
|
|
||||||
/*
|
/*
|
||||||
* if (savingsAccountId != null) { account =
|
* if (savingsAccountId != null) { account =
|
||||||
* PortfolioAccountData.lookup(savingsAccountId, savingsAccountNo);
|
* PortfolioAccountData.lookup(savingsAccountId, savingsAccountNo);
|
||||||
@@ -108,7 +107,7 @@ public class AccountAssociationsReadPlatformServiceImpl implements AccountAssoci
|
|||||||
// "linkLoanAccountId");
|
// "linkLoanAccountId");
|
||||||
// final String linkLoanAccountNo =
|
// final String linkLoanAccountNo =
|
||||||
// rs.getString("linkLoanAccountNo");
|
// rs.getString("linkLoanAccountNo");
|
||||||
PortfolioAccountData linkedAccount = PortfolioAccountData.lookup(linkSavingsAccountId, linkSavingsAccountNo);
|
final PortfolioAccountData linkedAccount = PortfolioAccountData.lookup(linkSavingsAccountId, linkSavingsAccountNo);
|
||||||
/*
|
/*
|
||||||
* if (linkSavingsAccountId != null) { linkedAccount =
|
* if (linkSavingsAccountId != null) { linkedAccount =
|
||||||
* PortfolioAccountData.lookup(linkSavingsAccountId,
|
* PortfolioAccountData.lookup(linkSavingsAccountId,
|
||||||
|
|||||||
+4
-9
@@ -19,19 +19,14 @@ import org.mifosplatform.portfolio.charge.domain.ChargePaymentMode;
|
|||||||
*/
|
*/
|
||||||
public class LoanChargeData {
|
public class LoanChargeData {
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private final Long id;
|
private final Long id;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final Long chargeId;
|
private final Long chargeId;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final EnumOptionData chargeTimeType;
|
private final EnumOptionData chargeTimeType;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private final LocalDate dueDate;
|
private final LocalDate dueDate;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
@@ -55,7 +50,6 @@ public class LoanChargeData {
|
|||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final BigDecimal amountWrittenOff;
|
private final BigDecimal amountWrittenOff;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private final BigDecimal amountOutstanding;
|
private final BigDecimal amountOutstanding;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
@@ -73,6 +67,7 @@ public class LoanChargeData {
|
|||||||
|
|
||||||
private final boolean waived;
|
private final boolean waived;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private final boolean chargePayable;
|
private final boolean chargePayable;
|
||||||
|
|
||||||
private final Long loanId;
|
private final Long loanId;
|
||||||
@@ -96,7 +91,7 @@ public class LoanChargeData {
|
|||||||
final BigDecimal amountPaid, final BigDecimal amountWaived, final BigDecimal amountWrittenOff,
|
final BigDecimal amountPaid, final BigDecimal amountWaived, final BigDecimal amountWrittenOff,
|
||||||
final BigDecimal amountOutstanding, final EnumOptionData chargeTimeType, final LocalDate dueDate,
|
final BigDecimal amountOutstanding, final EnumOptionData chargeTimeType, final LocalDate dueDate,
|
||||||
final EnumOptionData chargeCalculationType, final BigDecimal percentage, final BigDecimal amountPercentageAppliedTo,
|
final EnumOptionData chargeCalculationType, final BigDecimal percentage, final BigDecimal amountPercentageAppliedTo,
|
||||||
final boolean penalty, EnumOptionData chargePaymentMode, boolean paid, boolean waived, Long loanId) {
|
final boolean penalty, final EnumOptionData chargePaymentMode, final boolean paid, final boolean waived, final Long loanId) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.chargeId = chargeId;
|
this.chargeId = chargeId;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@@ -129,8 +124,8 @@ public class LoanChargeData {
|
|||||||
|
|
||||||
private LoanChargeData(final Long id, final Long chargeId, final String name, final CurrencyData currency, final BigDecimal amount,
|
private LoanChargeData(final Long id, final Long chargeId, final String name, final CurrencyData currency, final BigDecimal amount,
|
||||||
final BigDecimal pecentage, final EnumOptionData chargeTimeType, final EnumOptionData chargeCalculationType,
|
final BigDecimal pecentage, final EnumOptionData chargeTimeType, final EnumOptionData chargeCalculationType,
|
||||||
final Collection<ChargeData> chargeOptions, final boolean penalty, EnumOptionData chargePaymentMode, boolean paid,
|
final Collection<ChargeData> chargeOptions, final boolean penalty, final EnumOptionData chargePaymentMode, final boolean paid,
|
||||||
boolean waived, Long loanId) {
|
final boolean waived, final Long loanId) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.chargeId = chargeId;
|
this.chargeId = chargeId;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|||||||
+33
-34
@@ -33,7 +33,6 @@ import org.mifosplatform.portfolio.calendar.domain.CalendarInstance;
|
|||||||
import org.mifosplatform.portfolio.calendar.domain.CalendarInstanceRepository;
|
import org.mifosplatform.portfolio.calendar.domain.CalendarInstanceRepository;
|
||||||
import org.mifosplatform.portfolio.calendar.domain.CalendarRepository;
|
import org.mifosplatform.portfolio.calendar.domain.CalendarRepository;
|
||||||
import org.mifosplatform.portfolio.calendar.exception.CalendarNotFoundException;
|
import org.mifosplatform.portfolio.calendar.exception.CalendarNotFoundException;
|
||||||
import org.mifosplatform.portfolio.charge.domain.ChargePaymentMode;
|
|
||||||
import org.mifosplatform.portfolio.client.domain.AccountNumberGenerator;
|
import org.mifosplatform.portfolio.client.domain.AccountNumberGenerator;
|
||||||
import org.mifosplatform.portfolio.client.domain.AccountNumberGeneratorFactory;
|
import org.mifosplatform.portfolio.client.domain.AccountNumberGeneratorFactory;
|
||||||
import org.mifosplatform.portfolio.client.domain.Client;
|
import org.mifosplatform.portfolio.client.domain.Client;
|
||||||
@@ -149,7 +148,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
}
|
}
|
||||||
|
|
||||||
private LoanLifecycleStateMachine defaultLoanLifecycleStateMachine() {
|
private LoanLifecycleStateMachine defaultLoanLifecycleStateMachine() {
|
||||||
List<LoanStatus> allowedLoanStatuses = Arrays.asList(LoanStatus.values());
|
final List<LoanStatus> allowedLoanStatuses = Arrays.asList(LoanStatus.values());
|
||||||
return new DefaultLoanLifecycleStateMachine(allowedLoanStatuses);
|
return new DefaultLoanLifecycleStateMachine(allowedLoanStatuses);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,14 +157,14 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
public CommandProcessingResult submitApplication(final JsonCommand command) {
|
public CommandProcessingResult submitApplication(final JsonCommand command) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final AppUser currentUser = context.authenticatedUser();
|
final AppUser currentUser = this.context.authenticatedUser();
|
||||||
|
|
||||||
this.fromApiJsonDeserializer.validateForCreate(command.json());
|
this.fromApiJsonDeserializer.validateForCreate(command.json());
|
||||||
|
|
||||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
||||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("loan");
|
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("loan");
|
||||||
|
|
||||||
final Long productId = fromJsonHelper.extractLongNamed("productId", command.parsedJson());
|
final Long productId = this.fromJsonHelper.extractLongNamed("productId", command.parsedJson());
|
||||||
final LoanProduct loanProduct = this.loanProductRepository.findOne(productId);
|
final LoanProduct loanProduct = this.loanProductRepository.findOne(productId);
|
||||||
if (loanProduct == null) { throw new LoanProductNotFoundException(productId); }
|
if (loanProduct == null) { throw new LoanProductNotFoundException(productId); }
|
||||||
|
|
||||||
@@ -173,7 +172,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
|
|
||||||
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
|
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
|
||||||
|
|
||||||
final Loan newLoanApplication = loanAssembler.assembleFrom(command, currentUser);
|
final Loan newLoanApplication = this.loanAssembler.assembleFrom(command, currentUser);
|
||||||
|
|
||||||
validateSubmittedOnDate(newLoanApplication);
|
validateSubmittedOnDate(newLoanApplication);
|
||||||
|
|
||||||
@@ -193,7 +192,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
|
|
||||||
final String submittedOnNote = command.stringValueOfParameterNamed("submittedOnNote");
|
final String submittedOnNote = command.stringValueOfParameterNamed("submittedOnNote");
|
||||||
if (StringUtils.isNotBlank(submittedOnNote)) {
|
if (StringUtils.isNotBlank(submittedOnNote)) {
|
||||||
Note note = Note.loanNote(newLoanApplication, submittedOnNote);
|
final Note note = Note.loanNote(newLoanApplication, submittedOnNote);
|
||||||
this.noteRepository.save(note);
|
this.noteRepository.save(note);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,7 +204,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
calendar = this.calendarRepository.findOne(calendarId);
|
calendar = this.calendarRepository.findOne(calendarId);
|
||||||
if (calendar == null) { throw new CalendarNotFoundException(calendarId); }
|
if (calendar == null) { throw new CalendarNotFoundException(calendarId); }
|
||||||
|
|
||||||
CalendarInstance calendarInstance = new CalendarInstance(calendar, newLoanApplication.getId(),
|
final CalendarInstance calendarInstance = new CalendarInstance(calendar, newLoanApplication.getId(),
|
||||||
CalendarEntityType.LOANS.getValue());
|
CalendarEntityType.LOANS.getValue());
|
||||||
this.calendarInstanceRepository.save(calendarInstance);
|
this.calendarInstanceRepository.save(calendarInstance);
|
||||||
}
|
}
|
||||||
@@ -213,9 +212,9 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
// Save linked account information
|
// Save linked account information
|
||||||
final Long savingsAccountId = command.longValueOfParameterNamed("linkAccountId");
|
final Long savingsAccountId = command.longValueOfParameterNamed("linkAccountId");
|
||||||
if (savingsAccountId != null) {
|
if (savingsAccountId != null) {
|
||||||
SavingsAccount savingsAccount = this.savingsAccountAssembler.assembleFrom(savingsAccountId);
|
final SavingsAccount savingsAccount = this.savingsAccountAssembler.assembleFrom(savingsAccountId);
|
||||||
this.fromApiJsonDeserializer.validatelinkedSavingsAccount(savingsAccount, newLoanApplication);
|
this.fromApiJsonDeserializer.validatelinkedSavingsAccount(savingsAccount, newLoanApplication);
|
||||||
AccountAssociations accountAssociations = AccountAssociations.associateSavingsAccount(newLoanApplication, savingsAccount);
|
final AccountAssociations accountAssociations = AccountAssociations.associateSavingsAccount(newLoanApplication, savingsAccount);
|
||||||
this.accountAssociationsRepository.save(accountAssociations);
|
this.accountAssociationsRepository.save(accountAssociations);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,7 +226,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
.withGroupId(newLoanApplication.getGroupId()) //
|
.withGroupId(newLoanApplication.getGroupId()) //
|
||||||
.withLoanId(newLoanApplication.getId()) //
|
.withLoanId(newLoanApplication.getId()) //
|
||||||
.build();
|
.build();
|
||||||
} catch (DataIntegrityViolationException dve) {
|
} catch (final DataIntegrityViolationException dve) {
|
||||||
handleDataIntegrityIssues(command, dve);
|
handleDataIntegrityIssues(command, dve);
|
||||||
return CommandProcessingResult.empty();
|
return CommandProcessingResult.empty();
|
||||||
}
|
}
|
||||||
@@ -238,7 +237,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
public CommandProcessingResult modifyApplication(final Long loanId, final JsonCommand command) {
|
public CommandProcessingResult modifyApplication(final Long loanId, final JsonCommand command) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
|
|
||||||
this.fromApiJsonDeserializer.validateForModify(command.json());
|
this.fromApiJsonDeserializer.validateForModify(command.json());
|
||||||
|
|
||||||
@@ -351,7 +350,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
|
|
||||||
final String submittedOnNote = command.stringValueOfParameterNamed("submittedOnNote");
|
final String submittedOnNote = command.stringValueOfParameterNamed("submittedOnNote");
|
||||||
if (StringUtils.isNotBlank(submittedOnNote)) {
|
if (StringUtils.isNotBlank(submittedOnNote)) {
|
||||||
Note note = Note.loanNote(existingLoanApplication, submittedOnNote);
|
final Note note = Note.loanNote(existingLoanApplication, submittedOnNote);
|
||||||
this.noteRepository.save(note);
|
this.noteRepository.save(note);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -362,27 +361,27 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
if (calendar == null) { throw new CalendarNotFoundException(calendarId); }
|
if (calendar == null) { throw new CalendarNotFoundException(calendarId); }
|
||||||
}
|
}
|
||||||
|
|
||||||
List<CalendarInstance> ciList = (List<CalendarInstance>) this.calendarInstanceRepository.findByEntityIdAndEntityTypeId(loanId,
|
final List<CalendarInstance> ciList = (List<CalendarInstance>) this.calendarInstanceRepository.findByEntityIdAndEntityTypeId(loanId,
|
||||||
CalendarEntityType.LOANS.getValue());
|
CalendarEntityType.LOANS.getValue());
|
||||||
if (calendar != null) {
|
if (calendar != null) {
|
||||||
|
|
||||||
// For loans, allow to attach only one calendar instance per
|
// For loans, allow to attach only one calendar instance per
|
||||||
// loan
|
// loan
|
||||||
if (ciList != null && !ciList.isEmpty()) {
|
if (ciList != null && !ciList.isEmpty()) {
|
||||||
CalendarInstance calendarInstance = ciList.get(0);
|
final CalendarInstance calendarInstance = ciList.get(0);
|
||||||
if (calendarInstance.getCalendar().getId() != calendar.getId()) {
|
if (calendarInstance.getCalendar().getId() != calendar.getId()) {
|
||||||
calendarInstance.updateCalendar(calendar);
|
calendarInstance.updateCalendar(calendar);
|
||||||
this.calendarInstanceRepository.saveAndFlush(calendarInstance);
|
this.calendarInstanceRepository.saveAndFlush(calendarInstance);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// attaching new calendar
|
// attaching new calendar
|
||||||
CalendarInstance calendarInstance = new CalendarInstance(calendar, existingLoanApplication.getId(),
|
final CalendarInstance calendarInstance = new CalendarInstance(calendar, existingLoanApplication.getId(),
|
||||||
CalendarEntityType.LOANS.getValue());
|
CalendarEntityType.LOANS.getValue());
|
||||||
this.calendarInstanceRepository.save(calendarInstance);
|
this.calendarInstanceRepository.save(calendarInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (ciList != null && !ciList.isEmpty()) {
|
} else if (ciList != null && !ciList.isEmpty()) {
|
||||||
CalendarInstance calendarInstance = ciList.get(0);
|
final CalendarInstance calendarInstance = ciList.get(0);
|
||||||
this.calendarInstanceRepository.delete(calendarInstance);
|
this.calendarInstanceRepository.delete(calendarInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -406,13 +405,13 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
if (accountAssociations == null) {
|
if (accountAssociations == null) {
|
||||||
isModified = true;
|
isModified = true;
|
||||||
} else {
|
} else {
|
||||||
SavingsAccount savingsAccount = accountAssociations.linkedSavingsAccount();
|
final SavingsAccount savingsAccount = accountAssociations.linkedSavingsAccount();
|
||||||
if (savingsAccount == null || savingsAccount.getId() != savingsAccountId) {
|
if (savingsAccount == null || savingsAccount.getId() != savingsAccountId) {
|
||||||
isModified = true;
|
isModified = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isModified) {
|
if (isModified) {
|
||||||
SavingsAccount savingsAccount = this.savingsAccountAssembler.assembleFrom(savingsAccountId);
|
final SavingsAccount savingsAccount = this.savingsAccountAssembler.assembleFrom(savingsAccountId);
|
||||||
this.fromApiJsonDeserializer.validatelinkedSavingsAccount(savingsAccount, existingLoanApplication);
|
this.fromApiJsonDeserializer.validatelinkedSavingsAccount(savingsAccount, existingLoanApplication);
|
||||||
if (accountAssociations == null) {
|
if (accountAssociations == null) {
|
||||||
accountAssociations = AccountAssociations.associateSavingsAccount(existingLoanApplication, savingsAccount);
|
accountAssociations = AccountAssociations.associateSavingsAccount(existingLoanApplication, savingsAccount);
|
||||||
@@ -426,7 +425,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
|
|
||||||
if (!isLinkedAccPresent) {
|
if (!isLinkedAccPresent) {
|
||||||
final Set<LoanCharge> charges = existingLoanApplication.charges();
|
final Set<LoanCharge> charges = existingLoanApplication.charges();
|
||||||
for (LoanCharge loanCharge : charges) {
|
for (final LoanCharge loanCharge : charges) {
|
||||||
if (loanCharge.getChargePaymentMode().isPaymentModeAccountTransfer()) {
|
if (loanCharge.getChargePaymentMode().isPaymentModeAccountTransfer()) {
|
||||||
final String errorMessage = "one of the charges requires linked savings account for payment";
|
final String errorMessage = "one of the charges requires linked savings account for payment";
|
||||||
throw new LinkedAccountRequiredException("loanCharge", errorMessage);
|
throw new LinkedAccountRequiredException("loanCharge", errorMessage);
|
||||||
@@ -441,7 +440,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
.withGroupId(existingLoanApplication.getGroupId()) //
|
.withGroupId(existingLoanApplication.getGroupId()) //
|
||||||
.withLoanId(existingLoanApplication.getId()) //
|
.withLoanId(existingLoanApplication.getId()) //
|
||||||
.with(changes).build();
|
.with(changes).build();
|
||||||
} catch (DataIntegrityViolationException dve) {
|
} catch (final DataIntegrityViolationException dve) {
|
||||||
handleDataIntegrityIssues(command, dve);
|
handleDataIntegrityIssues(command, dve);
|
||||||
return CommandProcessingResult.empty();
|
return CommandProcessingResult.empty();
|
||||||
}
|
}
|
||||||
@@ -453,7 +452,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
*/
|
*/
|
||||||
private void handleDataIntegrityIssues(final JsonCommand command, final DataIntegrityViolationException dve) {
|
private void handleDataIntegrityIssues(final JsonCommand command, final DataIntegrityViolationException dve) {
|
||||||
|
|
||||||
Throwable realCause = dve.getMostSpecificCause();
|
final Throwable realCause = dve.getMostSpecificCause();
|
||||||
if (realCause.getMessage().contains("loan_account_no_UNIQUE")) {
|
if (realCause.getMessage().contains("loan_account_no_UNIQUE")) {
|
||||||
|
|
||||||
final String accountNo = command.stringValueOfParameterNamed("accountNo");
|
final String accountNo = command.stringValueOfParameterNamed("accountNo");
|
||||||
@@ -478,14 +477,14 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult deleteApplication(final Long loanId) {
|
public CommandProcessingResult deleteApplication(final Long loanId) {
|
||||||
|
|
||||||
context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
|
|
||||||
final Loan loan = retrieveLoanBy(loanId);
|
final Loan loan = retrieveLoanBy(loanId);
|
||||||
checkClientOrGroupActive(loan);
|
checkClientOrGroupActive(loan);
|
||||||
|
|
||||||
if (loan.isNotSubmittedAndPendingApproval()) { throw new LoanApplicationNotInSubmittedAndPendingApprovalStateCannotBeDeleted(loanId); }
|
if (loan.isNotSubmittedAndPendingApproval()) { throw new LoanApplicationNotInSubmittedAndPendingApprovalStateCannotBeDeleted(loanId); }
|
||||||
|
|
||||||
List<Note> relatedNotes = this.noteRepository.findByLoanId(loan.getId());
|
final List<Note> relatedNotes = this.noteRepository.findByLoanId(loan.getId());
|
||||||
this.noteRepository.deleteInBatch(relatedNotes);
|
this.noteRepository.deleteInBatch(relatedNotes);
|
||||||
|
|
||||||
this.loanRepository.delete(loanId);
|
this.loanRepository.delete(loanId);
|
||||||
@@ -503,7 +502,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult approveApplication(final Long loanId, final JsonCommand command) {
|
public CommandProcessingResult approveApplication(final Long loanId, final JsonCommand command) {
|
||||||
|
|
||||||
final AppUser currentUser = context.authenticatedUser();
|
final AppUser currentUser = this.context.authenticatedUser();
|
||||||
|
|
||||||
this.loanApplicationTransitionApiJsonValidator.validateApproval(command.json());
|
this.loanApplicationTransitionApiJsonValidator.validateApproval(command.json());
|
||||||
|
|
||||||
@@ -516,7 +515,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
|
|
||||||
final String noteText = command.stringValueOfParameterNamed("note");
|
final String noteText = command.stringValueOfParameterNamed("note");
|
||||||
if (StringUtils.isNotBlank(noteText)) {
|
if (StringUtils.isNotBlank(noteText)) {
|
||||||
Note note = Note.loanNote(loan, noteText);
|
final Note note = Note.loanNote(loan, noteText);
|
||||||
changes.put("note", noteText);
|
changes.put("note", noteText);
|
||||||
this.noteRepository.save(note);
|
this.noteRepository.save(note);
|
||||||
}
|
}
|
||||||
@@ -537,7 +536,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult undoApplicationApproval(final Long loanId, final JsonCommand command) {
|
public CommandProcessingResult undoApplicationApproval(final Long loanId, final JsonCommand command) {
|
||||||
|
|
||||||
context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
|
|
||||||
this.fromApiJsonDeserializer.validateForUndo(command.json());
|
this.fromApiJsonDeserializer.validateForUndo(command.json());
|
||||||
|
|
||||||
@@ -548,9 +547,9 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
if (!changes.isEmpty()) {
|
if (!changes.isEmpty()) {
|
||||||
this.loanRepository.save(loan);
|
this.loanRepository.save(loan);
|
||||||
|
|
||||||
String noteText = command.stringValueOfParameterNamed("note");
|
final String noteText = command.stringValueOfParameterNamed("note");
|
||||||
if (StringUtils.isNotBlank(noteText)) {
|
if (StringUtils.isNotBlank(noteText)) {
|
||||||
Note note = Note.loanNote(loan, noteText);
|
final Note note = Note.loanNote(loan, noteText);
|
||||||
this.noteRepository.save(note);
|
this.noteRepository.save(note);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -570,7 +569,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult rejectApplication(final Long loanId, final JsonCommand command) {
|
public CommandProcessingResult rejectApplication(final Long loanId, final JsonCommand command) {
|
||||||
|
|
||||||
final AppUser currentUser = context.authenticatedUser();
|
final AppUser currentUser = this.context.authenticatedUser();
|
||||||
|
|
||||||
this.loanApplicationTransitionApiJsonValidator.validateRejection(command.json());
|
this.loanApplicationTransitionApiJsonValidator.validateRejection(command.json());
|
||||||
|
|
||||||
@@ -581,9 +580,9 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
if (!changes.isEmpty()) {
|
if (!changes.isEmpty()) {
|
||||||
this.loanRepository.save(loan);
|
this.loanRepository.save(loan);
|
||||||
|
|
||||||
String noteText = command.stringValueOfParameterNamed("note");
|
final String noteText = command.stringValueOfParameterNamed("note");
|
||||||
if (StringUtils.isNotBlank(noteText)) {
|
if (StringUtils.isNotBlank(noteText)) {
|
||||||
Note note = Note.loanNote(loan, noteText);
|
final Note note = Note.loanNote(loan, noteText);
|
||||||
this.noteRepository.save(note);
|
this.noteRepository.save(note);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -603,7 +602,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult applicantWithdrawsFromApplication(final Long loanId, final JsonCommand command) {
|
public CommandProcessingResult applicantWithdrawsFromApplication(final Long loanId, final JsonCommand command) {
|
||||||
|
|
||||||
final AppUser currentUser = context.authenticatedUser();
|
final AppUser currentUser = this.context.authenticatedUser();
|
||||||
|
|
||||||
this.loanApplicationTransitionApiJsonValidator.validateApplicantWithdrawal(command.json());
|
this.loanApplicationTransitionApiJsonValidator.validateApplicantWithdrawal(command.json());
|
||||||
|
|
||||||
@@ -615,9 +614,9 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
if (!changes.isEmpty()) {
|
if (!changes.isEmpty()) {
|
||||||
this.loanRepository.save(loan);
|
this.loanRepository.save(loan);
|
||||||
|
|
||||||
String noteText = command.stringValueOfParameterNamed("note");
|
final String noteText = command.stringValueOfParameterNamed("note");
|
||||||
if (StringUtils.isNotBlank(noteText)) {
|
if (StringUtils.isNotBlank(noteText)) {
|
||||||
Note note = Note.loanNote(loan, noteText);
|
final Note note = Note.loanNote(loan, noteText);
|
||||||
this.noteRepository.save(note);
|
this.noteRepository.save(note);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-4
@@ -25,7 +25,6 @@ import org.mifosplatform.organisation.staff.exception.StaffRoleException;
|
|||||||
import org.mifosplatform.organisation.workingdays.domain.WorkingDays;
|
import org.mifosplatform.organisation.workingdays.domain.WorkingDays;
|
||||||
import org.mifosplatform.organisation.workingdays.domain.WorkingDaysRepositoryWrapper;
|
import org.mifosplatform.organisation.workingdays.domain.WorkingDaysRepositoryWrapper;
|
||||||
import org.mifosplatform.portfolio.accountdetails.service.AccountEnumerations;
|
import org.mifosplatform.portfolio.accountdetails.service.AccountEnumerations;
|
||||||
import org.mifosplatform.portfolio.charge.domain.ChargePaymentMode;
|
|
||||||
import org.mifosplatform.portfolio.client.domain.Client;
|
import org.mifosplatform.portfolio.client.domain.Client;
|
||||||
import org.mifosplatform.portfolio.client.domain.ClientRepositoryWrapper;
|
import org.mifosplatform.portfolio.client.domain.ClientRepositoryWrapper;
|
||||||
import org.mifosplatform.portfolio.client.exception.ClientNotActiveException;
|
import org.mifosplatform.portfolio.client.exception.ClientNotActiveException;
|
||||||
@@ -56,8 +55,8 @@ import org.mifosplatform.portfolio.loanproduct.domain.LoanProduct;
|
|||||||
import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail;
|
import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail;
|
||||||
import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRepository;
|
import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRepository;
|
||||||
import org.mifosplatform.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy;
|
import org.mifosplatform.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy;
|
||||||
import org.mifosplatform.portfolio.loanproduct.exception.LinkedAccountRequiredException;
|
|
||||||
import org.mifosplatform.portfolio.loanproduct.exception.InvalidCurrencyException;
|
import org.mifosplatform.portfolio.loanproduct.exception.InvalidCurrencyException;
|
||||||
|
import org.mifosplatform.portfolio.loanproduct.exception.LinkedAccountRequiredException;
|
||||||
import org.mifosplatform.portfolio.loanproduct.exception.LoanProductNotFoundException;
|
import org.mifosplatform.portfolio.loanproduct.exception.LoanProductNotFoundException;
|
||||||
import org.mifosplatform.useradministration.domain.AppUser;
|
import org.mifosplatform.useradministration.domain.AppUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -160,9 +159,9 @@ public class LoanAssembler {
|
|||||||
final String errorMessage = "Charge and Loan must have the same currency.";
|
final String errorMessage = "Charge and Loan must have the same currency.";
|
||||||
throw new InvalidCurrencyException("loanCharge", "attach.to.loan", errorMessage);
|
throw new InvalidCurrencyException("loanCharge", "attach.to.loan", errorMessage);
|
||||||
}
|
}
|
||||||
if(loanCharge.getChargePaymentMode().isPaymentModeAccountTransfer()){
|
if (loanCharge.getChargePaymentMode().isPaymentModeAccountTransfer()) {
|
||||||
final Long savingsAccountId = this.fromApiJsonHelper.extractLongNamed("linkAccountId", element);
|
final Long savingsAccountId = this.fromApiJsonHelper.extractLongNamed("linkAccountId", element);
|
||||||
if(savingsAccountId == null){
|
if (savingsAccountId == null) {
|
||||||
final String errorMessage = "one of the charges requires linked savings account for payment";
|
final String errorMessage = "one of the charges requires linked savings account for payment";
|
||||||
throw new LinkedAccountRequiredException("loanCharge", errorMessage);
|
throw new LinkedAccountRequiredException("loanCharge", errorMessage);
|
||||||
}
|
}
|
||||||
|
|||||||
+34
-36
@@ -10,7 +10,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
@@ -246,22 +245,21 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
|
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<LoanCharge> loanCharges = loan.charges();
|
final Set<LoanCharge> loanCharges = loan.charges();
|
||||||
Map<Long,BigDecimal> disBuLoanCharges = new HashMap<Long,BigDecimal>();
|
final Map<Long, BigDecimal> disBuLoanCharges = new HashMap<Long, BigDecimal>();
|
||||||
for (LoanCharge loanCharge : loanCharges) {
|
for (final LoanCharge loanCharge : loanCharges) {
|
||||||
if (loanCharge.isDueAtDisbursement() && loanCharge.getChargePaymentMode().isPaymentModeAccountTransfer()) {
|
if (loanCharge.isDueAtDisbursement() && loanCharge.getChargePaymentMode().isPaymentModeAccountTransfer()) {
|
||||||
disBuLoanCharges.put(loanCharge.getId(), loanCharge.amount());
|
disBuLoanCharges.put(loanCharge.getId(), loanCharge.amount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final Locale locale = command.extractLocale();
|
final Locale locale = command.extractLocale();
|
||||||
final DateTimeFormatter fmt = DateTimeFormat.forPattern(command.dateFormat()).withLocale(locale);
|
final DateTimeFormatter fmt = DateTimeFormat.forPattern(command.dateFormat()).withLocale(locale);
|
||||||
for (Map.Entry<Long, BigDecimal> entrySet: disBuLoanCharges.entrySet()) {
|
for (final Map.Entry<Long, BigDecimal> entrySet : disBuLoanCharges.entrySet()) {
|
||||||
PortfolioAccountData savingAccountData = this.accountAssociationsReadPlatformService.retriveLoanAssociation(loanId);
|
final PortfolioAccountData savingAccountData = this.accountAssociationsReadPlatformService.retriveLoanAssociation(loanId);
|
||||||
AccountTransferDTO accountTransferDTO = new AccountTransferDTO(actualDisbursementDate, entrySet.getValue(),
|
final AccountTransferDTO accountTransferDTO = new AccountTransferDTO(actualDisbursementDate, entrySet.getValue(),
|
||||||
PortfolioAccountType.SAVINGS, PortfolioAccountType.LOAN, savingAccountData.accountId(), loanId,
|
PortfolioAccountType.SAVINGS, PortfolioAccountType.LOAN, savingAccountData.accountId(), loanId, "Loan Charge Payment",
|
||||||
"Loan Charge Payment", locale, fmt, null, null, LoanTransactionType.REPAYMENT_AT_DISBURSEMENT.getValue(),
|
locale, fmt, null, null, LoanTransactionType.REPAYMENT_AT_DISBURSEMENT.getValue(), entrySet.getKey());
|
||||||
entrySet.getKey());
|
this.accountTransfersWritePlatformService.transferFunds(accountTransferDTO);
|
||||||
accountTransfersWritePlatformService.transferFunds(accountTransferDTO);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new CommandProcessingResultBuilder() //
|
return new CommandProcessingResultBuilder() //
|
||||||
@@ -475,7 +473,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
final LoanTransaction transactionToAdjust = this.loanTransactionRepository.findOne(transactionId);
|
final LoanTransaction transactionToAdjust = this.loanTransactionRepository.findOne(transactionId);
|
||||||
if (transactionToAdjust == null) { throw new LoanTransactionNotFoundException(transactionId); }
|
if (transactionToAdjust == null) { throw new LoanTransactionNotFoundException(transactionId); }
|
||||||
|
|
||||||
if (accountTransfersReadPlatformService.isAccountTransfer(transactionId, PortfolioAccountType.LOAN)) { throw new PlatformServiceUnavailableException(
|
if (this.accountTransfersReadPlatformService.isAccountTransfer(transactionId, PortfolioAccountType.LOAN)) { throw new PlatformServiceUnavailableException(
|
||||||
"error.msg.loan.transfer.transaction.update.not.allowed", "Loan transaction:" + transactionId
|
"error.msg.loan.transfer.transaction.update.not.allowed", "Loan transaction:" + transactionId
|
||||||
+ " update not allowed as it involves in account transfer", transactionId); }
|
+ " update not allowed as it involves in account transfer", transactionId); }
|
||||||
|
|
||||||
@@ -793,12 +791,12 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
final String errorMessage = "Charge and Loan must have the same currency.";
|
final String errorMessage = "Charge and Loan must have the same currency.";
|
||||||
throw new InvalidCurrencyException("loanCharge", "attach.to.loan", errorMessage);
|
throw new InvalidCurrencyException("loanCharge", "attach.to.loan", errorMessage);
|
||||||
}
|
}
|
||||||
if(loanCharge.getChargePaymentMode().isPaymentModeAccountTransfer()){
|
if (loanCharge.getChargePaymentMode().isPaymentModeAccountTransfer()) {
|
||||||
PortfolioAccountData portfolioAccountData = this.accountAssociationsReadPlatformService.retriveLoanAssociation(loanId);
|
final PortfolioAccountData portfolioAccountData = this.accountAssociationsReadPlatformService.retriveLoanAssociation(loanId);
|
||||||
if(portfolioAccountData == null){
|
if (portfolioAccountData == null) {
|
||||||
final String errorMessage = loanCharge.name()+"Charge requires linked savings account for payment";
|
final String errorMessage = loanCharge.name() + "Charge requires linked savings account for payment";
|
||||||
throw new LinkedAccountRequiredException("loanCharge.add", errorMessage,loanCharge.name());
|
throw new LinkedAccountRequiredException("loanCharge.add", errorMessage, loanCharge.name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<Long> existingTransactionIds = new ArrayList<Long>();
|
final List<Long> existingTransactionIds = new ArrayList<Long>();
|
||||||
@@ -949,7 +947,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public CommandProcessingResult payLoanCharge(final Long loanId, Long loanChargeId, final JsonCommand command,
|
public CommandProcessingResult payLoanCharge(final Long loanId, Long loanChargeId, final JsonCommand command,
|
||||||
boolean isChargeIdIncludedInJson) {
|
final boolean isChargeIdIncludedInJson) {
|
||||||
|
|
||||||
this.loanEventApiJsonValidator.validateChargePaymentTransaction(command.json(), isChargeIdIncludedInJson);
|
this.loanEventApiJsonValidator.validateChargePaymentTransaction(command.json(), isChargeIdIncludedInJson);
|
||||||
if (isChargeIdIncludedInJson) {
|
if (isChargeIdIncludedInJson) {
|
||||||
@@ -978,15 +976,15 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
final Locale locale = command.extractLocale();
|
final Locale locale = command.extractLocale();
|
||||||
final DateTimeFormatter fmt = DateTimeFormat.forPattern(command.dateFormat()).withLocale(locale);
|
final DateTimeFormatter fmt = DateTimeFormat.forPattern(command.dateFormat()).withLocale(locale);
|
||||||
|
|
||||||
PortfolioAccountData portfolioAccountData = this.accountAssociationsReadPlatformService.retriveLoanAssociation(loanId);
|
final PortfolioAccountData portfolioAccountData = this.accountAssociationsReadPlatformService.retriveLoanAssociation(loanId);
|
||||||
if(portfolioAccountData == null){
|
if (portfolioAccountData == null) {
|
||||||
final String errorMessage = "Charge with id:"+loanChargeId+" requires linked savings account for payment";
|
final String errorMessage = "Charge with id:" + loanChargeId + " requires linked savings account for payment";
|
||||||
throw new LinkedAccountRequiredException("loanCharge.pay", errorMessage,loanChargeId);
|
throw new LinkedAccountRequiredException("loanCharge.pay", errorMessage, loanChargeId);
|
||||||
}
|
}
|
||||||
AccountTransferDTO accountTransferDTO = new AccountTransferDTO(transactionDate, loanCharge.amountOutstanding(),
|
final AccountTransferDTO accountTransferDTO = new AccountTransferDTO(transactionDate, loanCharge.amountOutstanding(),
|
||||||
PortfolioAccountType.SAVINGS, PortfolioAccountType.LOAN, portfolioAccountData.accountId(), loanId, "Loan Charge Payment",
|
PortfolioAccountType.SAVINGS, PortfolioAccountType.LOAN, portfolioAccountData.accountId(), loanId, "Loan Charge Payment",
|
||||||
locale, fmt, null, null, LoanTransactionType.CHARGE_PAYMENT.getValue(), loanChargeId);
|
locale, fmt, null, null, LoanTransactionType.CHARGE_PAYMENT.getValue(), loanChargeId);
|
||||||
accountTransfersWritePlatformService.transferFunds(accountTransferDTO);
|
this.accountTransfersWritePlatformService.transferFunds(accountTransferDTO);
|
||||||
|
|
||||||
return new CommandProcessingResultBuilder() //
|
return new CommandProcessingResultBuilder() //
|
||||||
.withCommandId(command.commandId()) //
|
.withCommandId(command.commandId()) //
|
||||||
@@ -1001,24 +999,24 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
@CronTarget(jobName = JobName.TRANSFER_FEE_CHARGE_FOR_LOANS)
|
@CronTarget(jobName = JobName.TRANSFER_FEE_CHARGE_FOR_LOANS)
|
||||||
public void transferFeeCharges() throws JobExecutionException {
|
public void transferFeeCharges() throws JobExecutionException {
|
||||||
Collection<LoanChargeData> chargeDatas = this.LoanChargeReadPlatformService.retrieveLoanChargesForFeePayment(
|
final Collection<LoanChargeData> chargeDatas = this.LoanChargeReadPlatformService.retrieveLoanChargesForFeePayment(
|
||||||
ChargePaymentMode.ACCOUNT_TRANSFER.getValue(), LoanStatus.ACTIVE.getValue());
|
ChargePaymentMode.ACCOUNT_TRANSFER.getValue(), LoanStatus.ACTIVE.getValue());
|
||||||
StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
if (chargeDatas != null) {
|
if (chargeDatas != null) {
|
||||||
for (LoanChargeData chargeData : chargeDatas) {
|
for (final LoanChargeData chargeData : chargeDatas) {
|
||||||
if (chargeData.getDueDate()!=null && !chargeData.getDueDate().isAfter(new LocalDate())) {
|
if (chargeData.getDueDate() != null && !chargeData.getDueDate().isAfter(new LocalDate())) {
|
||||||
PortfolioAccountData portfolioAccountData = this.accountAssociationsReadPlatformService
|
final PortfolioAccountData portfolioAccountData = this.accountAssociationsReadPlatformService
|
||||||
.retriveLoanAssociation(chargeData.getLoanId());
|
.retriveLoanAssociation(chargeData.getLoanId());
|
||||||
AccountTransferDTO accountTransferDTO = new AccountTransferDTO(new LocalDate(), chargeData.getAmountOutstanding(),
|
final AccountTransferDTO accountTransferDTO = new AccountTransferDTO(new LocalDate(), chargeData.getAmountOutstanding(),
|
||||||
PortfolioAccountType.SAVINGS, PortfolioAccountType.LOAN, portfolioAccountData.accountId(),
|
PortfolioAccountType.SAVINGS, PortfolioAccountType.LOAN, portfolioAccountData.accountId(),
|
||||||
chargeData.getLoanId(), "Loan Charge Payment", null, null, null, null,
|
chargeData.getLoanId(), "Loan Charge Payment", null, null, null, null,
|
||||||
LoanTransactionType.CHARGE_PAYMENT.getValue(), chargeData.getId());
|
LoanTransactionType.CHARGE_PAYMENT.getValue(), chargeData.getId());
|
||||||
try {
|
try {
|
||||||
accountTransfersWritePlatformService.transferFunds(accountTransferDTO);
|
this.accountTransfersWritePlatformService.transferFunds(accountTransferDTO);
|
||||||
} catch (PlatformApiDataValidationException e) {
|
} catch (final PlatformApiDataValidationException e) {
|
||||||
sb.append("Validation exception while paying charge ").append(chargeData.getId()).append(" for loan id:")
|
sb.append("Validation exception while paying charge ").append(chargeData.getId()).append(" for loan id:")
|
||||||
.append(chargeData.getLoanId()).append("--------");
|
.append(chargeData.getLoanId()).append("--------");
|
||||||
} catch (InsufficientAccountBalanceException e) {
|
} catch (final InsufficientAccountBalanceException e) {
|
||||||
sb.append("InsufficientAccountBalance Exception while paying charge ").append(chargeData.getId())
|
sb.append("InsufficientAccountBalance Exception while paying charge ").append(chargeData.getId())
|
||||||
.append("for loan id:").append(chargeData.getLoanId()).append("--------");
|
.append("for loan id:").append(chargeData.getLoanId()).append("--------");
|
||||||
|
|
||||||
@@ -1086,7 +1084,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public LoanTransaction withdrawLoanTransfer(Long accountId, LocalDate transferDate) {
|
public LoanTransaction withdrawLoanTransfer(final Long accountId, final LocalDate transferDate) {
|
||||||
final Loan loan = this.loanAssembler.assembleFrom(accountId);
|
final Loan loan = this.loanAssembler.assembleFrom(accountId);
|
||||||
|
|
||||||
final List<Long> existingTransactionIds = new ArrayList<Long>(loan.findExistingTransactionIds());
|
final List<Long> existingTransactionIds = new ArrayList<Long>(loan.findExistingTransactionIds());
|
||||||
@@ -1106,7 +1104,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public void rejectLoanTransfer(Long accountId) {
|
public void rejectLoanTransfer(final Long accountId) {
|
||||||
final Loan loan = this.loanAssembler.assembleFrom(accountId);
|
final Loan loan = this.loanAssembler.assembleFrom(accountId);
|
||||||
loan.setLoanStatus(LoanStatus.TRANSFER_ON_HOLD.getValue());
|
loan.setLoanStatus(LoanStatus.TRANSFER_ON_HOLD.getValue());
|
||||||
this.loanRepository.save(loan);
|
this.loanRepository.save(loan);
|
||||||
|
|||||||
+3
-2
@@ -55,6 +55,7 @@ public class SavingsAccountData {
|
|||||||
private final SavingsAccountSummaryData summary;
|
private final SavingsAccountSummaryData summary;
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final Collection<SavingsAccountTransactionData> transactions;
|
private final Collection<SavingsAccountTransactionData> transactions;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private final Collection<SavingsAccountChargeData> charges;
|
private final Collection<SavingsAccountChargeData> charges;
|
||||||
|
|
||||||
// template
|
// template
|
||||||
@@ -76,7 +77,7 @@ public class SavingsAccountData {
|
|||||||
final EnumOptionData interestCalculationType, final EnumOptionData interestCalculationDaysInYearType,
|
final EnumOptionData interestCalculationType, final EnumOptionData interestCalculationDaysInYearType,
|
||||||
final BigDecimal minRequiredOpeningBalance, final Integer lockinPeriodFrequency,
|
final BigDecimal minRequiredOpeningBalance, final Integer lockinPeriodFrequency,
|
||||||
final EnumOptionData lockinPeriodFrequencyType, final BigDecimal withdrawalFeeAmount, final EnumOptionData withdrawalFeeType,
|
final EnumOptionData lockinPeriodFrequencyType, final BigDecimal withdrawalFeeAmount, final EnumOptionData withdrawalFeeType,
|
||||||
boolean withdrawalFeeForTransfers, final BigDecimal annualFeeAmount, final MonthDay annualFeeOnMonthDay,
|
final boolean withdrawalFeeForTransfers, final BigDecimal annualFeeAmount, final MonthDay annualFeeOnMonthDay,
|
||||||
final LocalDate annualFeeNextDueDate, final SavingsAccountSummaryData summary) {
|
final LocalDate annualFeeNextDueDate, final SavingsAccountSummaryData summary) {
|
||||||
|
|
||||||
final Collection<SavingsProductData> productOptions = null;
|
final Collection<SavingsProductData> productOptions = null;
|
||||||
@@ -313,7 +314,7 @@ public class SavingsAccountData {
|
|||||||
if (obj == null) { return false; }
|
if (obj == null) { return false; }
|
||||||
if (obj == this) { return true; }
|
if (obj == this) { return true; }
|
||||||
if (obj.getClass() != getClass()) { return false; }
|
if (obj.getClass() != getClass()) { return false; }
|
||||||
SavingsAccountData rhs = (SavingsAccountData) obj;
|
final SavingsAccountData rhs = (SavingsAccountData) obj;
|
||||||
return new EqualsBuilder().append(this.id, rhs.id).append(this.accountNo, rhs.accountNo).isEquals();
|
return new EqualsBuilder().append(this.id, rhs.id).append(this.accountNo, rhs.accountNo).isEquals();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-7
@@ -7,12 +7,11 @@ package org.mifosplatform.portfolio.savings.domain;
|
|||||||
|
|
||||||
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.annualFeeAmountParamName;
|
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.annualFeeAmountParamName;
|
||||||
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.annualFeeOnMonthDayParamName;
|
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.annualFeeOnMonthDayParamName;
|
||||||
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.idParamName;
|
|
||||||
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.chargeIdParamName;
|
|
||||||
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.chargesParamName;
|
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.chargesParamName;
|
||||||
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.currencyCodeParamName;
|
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.currencyCodeParamName;
|
||||||
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.descriptionParamName;
|
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.descriptionParamName;
|
||||||
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.digitsAfterDecimalParamName;
|
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.digitsAfterDecimalParamName;
|
||||||
|
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.idParamName;
|
||||||
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.inMultiplesOfParamName;
|
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.inMultiplesOfParamName;
|
||||||
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.interestCalculationDaysInYearTypeParamName;
|
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.interestCalculationDaysInYearTypeParamName;
|
||||||
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.interestCalculationTypeParamName;
|
import static org.mifosplatform.portfolio.savings.SavingsApiConstants.interestCalculationTypeParamName;
|
||||||
@@ -69,7 +68,7 @@ public class SavingsProductAssembler {
|
|||||||
final String currencyCode = command.stringValueOfParameterNamed(currencyCodeParamName);
|
final String currencyCode = command.stringValueOfParameterNamed(currencyCodeParamName);
|
||||||
final Integer digitsAfterDecimal = command.integerValueOfParameterNamed(digitsAfterDecimalParamName);
|
final Integer digitsAfterDecimal = command.integerValueOfParameterNamed(digitsAfterDecimalParamName);
|
||||||
final Integer inMultiplesOf = command.integerValueOfParameterNamed(inMultiplesOfParamName);
|
final Integer inMultiplesOf = command.integerValueOfParameterNamed(inMultiplesOfParamName);
|
||||||
MonetaryCurrency currency = new MonetaryCurrency(currencyCode, digitsAfterDecimal,inMultiplesOf);
|
final MonetaryCurrency currency = new MonetaryCurrency(currencyCode, digitsAfterDecimal,inMultiplesOf);
|
||||||
|
|
||||||
final BigDecimal interestRate = command.bigDecimalValueOfParameterNamed(nominalAnnualInterestRateParamName);
|
final BigDecimal interestRate = command.bigDecimalValueOfParameterNamed(nominalAnnualInterestRateParamName);
|
||||||
|
|
||||||
@@ -125,7 +124,7 @@ public class SavingsProductAssembler {
|
|||||||
final AccountingRuleType accountingRuleType = AccountingRuleType.fromInt(command.integerValueOfParameterNamed("accountingRule"));
|
final AccountingRuleType accountingRuleType = AccountingRuleType.fromInt(command.integerValueOfParameterNamed("accountingRule"));
|
||||||
|
|
||||||
//Savings product charges
|
//Savings product charges
|
||||||
final Set<Charge> charges = this.assembleListOfSavingsProductCharges(command, currencyCode);
|
final Set<Charge> charges = assembleListOfSavingsProductCharges(command, currencyCode);
|
||||||
|
|
||||||
return SavingsProduct.createNew(name, description, currency, interestRate, interestCompoundingPeriodType,
|
return SavingsProduct.createNew(name, description, currency, interestRate, interestCompoundingPeriodType,
|
||||||
interestPostingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minRequiredOpeningBalance,
|
interestPostingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minRequiredOpeningBalance,
|
||||||
@@ -138,7 +137,7 @@ public class SavingsProductAssembler {
|
|||||||
final Set<Charge> charges = new HashSet<Charge>();
|
final Set<Charge> charges = new HashSet<Charge>();
|
||||||
|
|
||||||
if (command.parameterExists(chargesParamName)) {
|
if (command.parameterExists(chargesParamName)) {
|
||||||
JsonArray chargesArray = command.arrayOfParameterNamed(chargesParamName);
|
final JsonArray chargesArray = command.arrayOfParameterNamed(chargesParamName);
|
||||||
if (chargesArray != null) {
|
if (chargesArray != null) {
|
||||||
for (int i = 0; i < chargesArray.size(); i++) {
|
for (int i = 0; i < chargesArray.size(); i++) {
|
||||||
|
|
||||||
@@ -149,12 +148,12 @@ public class SavingsProductAssembler {
|
|||||||
final Charge charge = this.chargeRepository.findOneWithNotFoundDetection(id);
|
final Charge charge = this.chargeRepository.findOneWithNotFoundDetection(id);
|
||||||
|
|
||||||
if(!charge.isSavingsCharge()){
|
if(!charge.isSavingsCharge()){
|
||||||
String errorMessage = "Charge with identifier " + charge.getId() + " cannot be applied to Savings product.";
|
final String errorMessage = "Charge with identifier " + charge.getId() + " cannot be applied to Savings product.";
|
||||||
throw new ChargeCannotBeAppliedToException("savings.product", errorMessage, charge.getId());
|
throw new ChargeCannotBeAppliedToException("savings.product", errorMessage, charge.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!savingsProductCurrencyCode.equals(charge.getCurrencyCode())) {
|
if (!savingsProductCurrencyCode.equals(charge.getCurrencyCode())) {
|
||||||
String errorMessage = "Charge and Savings Product must have the same currency.";
|
final String errorMessage = "Charge and Savings Product must have the same currency.";
|
||||||
throw new InvalidCurrencyException("charge", "attach.to.savings.product", errorMessage);
|
throw new InvalidCurrencyException("charge", "attach.to.savings.product", errorMessage);
|
||||||
}
|
}
|
||||||
charges.add(charge);
|
charges.add(charge);
|
||||||
|
|||||||
+26
-26
@@ -173,7 +173,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
final BigDecimal transactionAmount = command.bigDecimalValueOfParameterNamed("transactionAmount");
|
final BigDecimal transactionAmount = command.bigDecimalValueOfParameterNamed("transactionAmount");
|
||||||
|
|
||||||
final Map<String, Object> changes = new LinkedHashMap<String, Object>();
|
final Map<String, Object> changes = new LinkedHashMap<String, Object>();
|
||||||
PaymentDetail paymentDetail = paymentDetailWritePlatformService.createAndPersistPaymentDetail(command, changes);
|
final PaymentDetail paymentDetail = this.paymentDetailWritePlatformService.createAndPersistPaymentDetail(command, changes);
|
||||||
|
|
||||||
final SavingsAccountTransaction deposit = this.savingsAccountDomainService.handleDeposit(account, fmt, transactionDate,
|
final SavingsAccountTransaction deposit = this.savingsAccountDomainService.handleDeposit(account, fmt, transactionDate,
|
||||||
transactionAmount, paymentDetail);
|
transactionAmount, paymentDetail);
|
||||||
@@ -206,12 +206,12 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
final DateTimeFormatter fmt = DateTimeFormat.forPattern(command.dateFormat()).withLocale(locale);
|
final DateTimeFormatter fmt = DateTimeFormat.forPattern(command.dateFormat()).withLocale(locale);
|
||||||
|
|
||||||
final Map<String, Object> changes = new LinkedHashMap<String, Object>();
|
final Map<String, Object> changes = new LinkedHashMap<String, Object>();
|
||||||
PaymentDetail paymentDetail = paymentDetailWritePlatformService.createAndPersistPaymentDetail(command, changes);
|
final PaymentDetail paymentDetail = this.paymentDetailWritePlatformService.createAndPersistPaymentDetail(command, changes);
|
||||||
|
|
||||||
final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId);
|
final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId);
|
||||||
checkClientOrGroupActive(account);
|
checkClientOrGroupActive(account);
|
||||||
|
|
||||||
SavingsAccountTransaction withdrawal = this.savingsAccountDomainService.handleWithdrawal(account, fmt, transactionDate,
|
final SavingsAccountTransaction withdrawal = this.savingsAccountDomainService.handleWithdrawal(account, fmt, transactionDate,
|
||||||
transactionAmount, paymentDetail, true);
|
transactionAmount, paymentDetail, true);
|
||||||
|
|
||||||
return new CommandProcessingResultBuilder() //
|
return new CommandProcessingResultBuilder() //
|
||||||
@@ -319,16 +319,16 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult undoTransaction(final Long savingsId, final Long transactionId, boolean allowAccountTransferModification) {
|
public CommandProcessingResult undoTransaction(final Long savingsId, final Long transactionId, final boolean allowAccountTransferModification) {
|
||||||
|
|
||||||
final List<Long> newTransactionIds = new ArrayList<Long>();
|
final List<Long> newTransactionIds = new ArrayList<Long>();
|
||||||
final List<Long> reversedTransactionIds = new ArrayList<Long>();
|
final List<Long> reversedTransactionIds = new ArrayList<Long>();
|
||||||
|
|
||||||
SavingsAccountTransaction savingsAccountTransaction = this.savingsAccountTransactionRepository.findOneByIdAndSavingsAccountId(
|
final SavingsAccountTransaction savingsAccountTransaction = this.savingsAccountTransactionRepository.findOneByIdAndSavingsAccountId(
|
||||||
transactionId, savingsId);
|
transactionId, savingsId);
|
||||||
if (savingsAccountTransaction == null) { throw new SavingsAccountTransactionNotFoundException(savingsId, transactionId); }
|
if (savingsAccountTransaction == null) { throw new SavingsAccountTransactionNotFoundException(savingsId, transactionId); }
|
||||||
|
|
||||||
if(!allowAccountTransferModification && accountTransfersReadPlatformService.isAccountTransfer(transactionId, PortfolioAccountType.SAVINGS)){
|
if(!allowAccountTransferModification && this.accountTransfersReadPlatformService.isAccountTransfer(transactionId, PortfolioAccountType.SAVINGS)){
|
||||||
throw new PlatformServiceUnavailableException("error.msg.saving.account.transfer.transaction.update.not.allowed","Savings account transaction:"+transactionId+" update not allowed as it involves in account transfer",transactionId);
|
throw new PlatformServiceUnavailableException("error.msg.saving.account.transfer.transaction.update.not.allowed","Savings account transaction:"+transactionId+" update not allowed as it involves in account transfer",transactionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -363,14 +363,14 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult adjustSavingsTransaction(final Long savingsId, final Long transactionId, final JsonCommand command) {
|
public CommandProcessingResult adjustSavingsTransaction(final Long savingsId, final Long transactionId, final JsonCommand command) {
|
||||||
|
|
||||||
SavingsAccountTransaction savingsAccountTransaction = this.savingsAccountTransactionRepository.findOneByIdAndSavingsAccountId(
|
final SavingsAccountTransaction savingsAccountTransaction = this.savingsAccountTransactionRepository.findOneByIdAndSavingsAccountId(
|
||||||
transactionId, savingsId);
|
transactionId, savingsId);
|
||||||
if (savingsAccountTransaction == null) { throw new SavingsAccountTransactionNotFoundException(savingsId, transactionId); }
|
if (savingsAccountTransaction == null) { throw new SavingsAccountTransactionNotFoundException(savingsId, transactionId); }
|
||||||
|
|
||||||
if (!(savingsAccountTransaction.isDeposit() || savingsAccountTransaction.isWithdrawal()) || savingsAccountTransaction.isReversed()) { throw new TransactionUpdateNotAllowedException(
|
if (!(savingsAccountTransaction.isDeposit() || savingsAccountTransaction.isWithdrawal()) || savingsAccountTransaction.isReversed()) { throw new TransactionUpdateNotAllowedException(
|
||||||
savingsId, transactionId); }
|
savingsId, transactionId); }
|
||||||
|
|
||||||
if(accountTransfersReadPlatformService.isAccountTransfer(transactionId, PortfolioAccountType.SAVINGS)){
|
if(this.accountTransfersReadPlatformService.isAccountTransfer(transactionId, PortfolioAccountType.SAVINGS)){
|
||||||
throw new PlatformServiceUnavailableException("error.msg.saving.account.transfer.transaction.update.not.allowed","Savings account transaction:"+transactionId+" update not allowed as it involves in account transfer",transactionId);
|
throw new PlatformServiceUnavailableException("error.msg.saving.account.transfer.transaction.update.not.allowed","Savings account transaction:"+transactionId+" update not allowed as it involves in account transfer",transactionId);
|
||||||
}
|
}
|
||||||
this.savingsAccountTransactionDataValidator.validate(command);
|
this.savingsAccountTransactionDataValidator.validate(command);
|
||||||
@@ -389,13 +389,13 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
final List<Long> existingTransactionIds = new ArrayList<Long>();
|
final List<Long> existingTransactionIds = new ArrayList<Long>();
|
||||||
final List<Long> existingReversedTransactionIds = new ArrayList<Long>();
|
final List<Long> existingReversedTransactionIds = new ArrayList<Long>();
|
||||||
final Map<String, Object> changes = new LinkedHashMap<String, Object>();
|
final Map<String, Object> changes = new LinkedHashMap<String, Object>();
|
||||||
PaymentDetail paymentDetail = paymentDetailWritePlatformService.createAndPersistPaymentDetail(command, changes);
|
final PaymentDetail paymentDetail = this.paymentDetailWritePlatformService.createAndPersistPaymentDetail(command, changes);
|
||||||
|
|
||||||
final MathContext mc = new MathContext(10, RoundingMode.HALF_EVEN);
|
final MathContext mc = new MathContext(10, RoundingMode.HALF_EVEN);
|
||||||
account.undoTransaction(transactionId, existingReversedTransactionIds);
|
account.undoTransaction(transactionId, existingReversedTransactionIds);
|
||||||
|
|
||||||
// for undo withdrawal fee
|
// for undo withdrawal fee
|
||||||
SavingsAccountTransaction nextSavingsAccountTransaction = this.savingsAccountTransactionRepository.findOneByIdAndSavingsAccountId(
|
final SavingsAccountTransaction nextSavingsAccountTransaction = this.savingsAccountTransactionRepository.findOneByIdAndSavingsAccountId(
|
||||||
transactionId+1, savingsId);
|
transactionId+1, savingsId);
|
||||||
if(nextSavingsAccountTransaction!=null && nextSavingsAccountTransaction.isWithdrawalFeeAndNotReversed()){
|
if(nextSavingsAccountTransaction!=null && nextSavingsAccountTransaction.isWithdrawalFeeAndNotReversed()){
|
||||||
account.undoTransaction(transactionId+1, existingReversedTransactionIds);
|
account.undoTransaction(transactionId+1, existingReversedTransactionIds);
|
||||||
@@ -403,11 +403,11 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
|
|
||||||
SavingsAccountTransaction transaction = null;
|
SavingsAccountTransaction transaction = null;
|
||||||
if (savingsAccountTransaction.isDeposit()) {
|
if (savingsAccountTransaction.isDeposit()) {
|
||||||
SavingsAccountTransactionDTO transactionDTO = new SavingsAccountTransactionDTO(fmt, transactionDate, transactionAmount,
|
final SavingsAccountTransactionDTO transactionDTO = new SavingsAccountTransactionDTO(fmt, transactionDate, transactionAmount,
|
||||||
existingTransactionIds, existingReversedTransactionIds, paymentDetail);
|
existingTransactionIds, existingReversedTransactionIds, paymentDetail);
|
||||||
transaction = account.deposit(transactionDTO);
|
transaction = account.deposit(transactionDTO);
|
||||||
} else {
|
} else {
|
||||||
SavingsAccountTransactionDTO transactionDTO = new SavingsAccountTransactionDTO(fmt, transactionDate, transactionAmount,
|
final SavingsAccountTransactionDTO transactionDTO = new SavingsAccountTransactionDTO(fmt, transactionDate, transactionAmount,
|
||||||
existingTransactionIds, existingReversedTransactionIds, paymentDetail);
|
existingTransactionIds, existingReversedTransactionIds, paymentDetail);
|
||||||
transaction = account.withdraw(transactionDTO, true);
|
transaction = account.withdraw(transactionDTO, true);
|
||||||
}
|
}
|
||||||
@@ -435,7 +435,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private void throwValidationForActiveStatus(String actionName) {
|
private void throwValidationForActiveStatus(final String actionName) {
|
||||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
||||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
|
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
|
||||||
.resource(SAVINGS_ACCOUNT_RESOURCE_NAME + actionName);
|
.resource(SAVINGS_ACCOUNT_RESOURCE_NAME + actionName);
|
||||||
@@ -451,7 +451,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
|
|
||||||
final Map<String, Object> accountingBridgeData = savingsAccount.deriveAccountingBridgeData(applicationCurrency.toData(),
|
final Map<String, Object> accountingBridgeData = savingsAccount.deriveAccountingBridgeData(applicationCurrency.toData(),
|
||||||
existingTransactionIds, existingReversedTransactionIds);
|
existingTransactionIds, existingReversedTransactionIds);
|
||||||
journalEntryWritePlatformService.createJournalEntriesForSavings(accountingBridgeData);
|
this.journalEntryWritePlatformService.createJournalEntriesForSavings(accountingBridgeData);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkClientOrGroupActive(final SavingsAccount account) {
|
private void checkClientOrGroupActive(final SavingsAccount account) {
|
||||||
@@ -466,14 +466,14 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult close(Long savingsId, JsonCommand command) {
|
public CommandProcessingResult close(final Long savingsId, final JsonCommand command) {
|
||||||
final AppUser user = this.context.authenticatedUser();
|
final AppUser user = this.context.authenticatedUser();
|
||||||
|
|
||||||
this.savingsAccountTransactionDataValidator.validateClosing(command);
|
this.savingsAccountTransactionDataValidator.validateClosing(command);
|
||||||
final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId);
|
final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId);
|
||||||
final boolean isLinkedWithAnyActiveLoan = accountAssociationsReadPlatformService.isLinkedWithAnyActiveLoan(savingsId);
|
final boolean isLinkedWithAnyActiveLoan = this.accountAssociationsReadPlatformService.isLinkedWithAnyActiveLoan(savingsId);
|
||||||
if(isLinkedWithAnyActiveLoan){
|
if(isLinkedWithAnyActiveLoan){
|
||||||
String defaultUserMessage = "Closing savings account with id:"+savingsId+" is not allowed, since it is linked with one of the active loans";
|
final String defaultUserMessage = "Closing savings account with id:"+savingsId+" is not allowed, since it is linked with one of the active loans";
|
||||||
throw new SavingsAccountClosingNotAllowedException("linked", defaultUserMessage, savingsId);
|
throw new SavingsAccountClosingNotAllowedException("linked", defaultUserMessage, savingsId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -499,7 +499,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SavingsAccountTransaction initiateSavingsTransfer(Long accountId, LocalDate transferDate) {
|
public SavingsAccountTransaction initiateSavingsTransfer(final Long accountId, final LocalDate transferDate) {
|
||||||
final SavingsAccount savingsAccount = this.savingAccountAssembler.assembleFrom(accountId);
|
final SavingsAccount savingsAccount = this.savingAccountAssembler.assembleFrom(accountId);
|
||||||
|
|
||||||
final List<Long> existingTransactionIds = new ArrayList<Long>(savingsAccount.findExistingTransactionIds());
|
final List<Long> existingTransactionIds = new ArrayList<Long>(savingsAccount.findExistingTransactionIds());
|
||||||
@@ -519,7 +519,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SavingsAccountTransaction withdrawSavingsTransfer(Long accountId, LocalDate transferDate) {
|
public SavingsAccountTransaction withdrawSavingsTransfer(final Long accountId, final LocalDate transferDate) {
|
||||||
final SavingsAccount savingsAccount = this.savingAccountAssembler.assembleFrom(accountId);
|
final SavingsAccount savingsAccount = this.savingAccountAssembler.assembleFrom(accountId);
|
||||||
|
|
||||||
final List<Long> existingTransactionIds = new ArrayList<Long>(savingsAccount.findExistingTransactionIds());
|
final List<Long> existingTransactionIds = new ArrayList<Long>(savingsAccount.findExistingTransactionIds());
|
||||||
@@ -539,15 +539,15 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void rejectSavingsTransfer(Long accountId) {
|
public void rejectSavingsTransfer(final Long accountId) {
|
||||||
final SavingsAccount savingsAccount = this.savingAccountAssembler.assembleFrom(accountId);
|
final SavingsAccount savingsAccount = this.savingAccountAssembler.assembleFrom(accountId);
|
||||||
savingsAccount.setStatus(SavingsAccountStatusType.TRANSFER_ON_HOLD.getValue());
|
savingsAccount.setStatus(SavingsAccountStatusType.TRANSFER_ON_HOLD.getValue());
|
||||||
this.savingAccountRepository.save(savingsAccount);
|
this.savingAccountRepository.save(savingsAccount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SavingsAccountTransaction acceptSavingsTransfer(Long accountId, LocalDate transferDate, Office acceptedInOffice,
|
public SavingsAccountTransaction acceptSavingsTransfer(final Long accountId, final LocalDate transferDate, final Office acceptedInOffice,
|
||||||
Staff fieldOfficer) {
|
final Staff fieldOfficer) {
|
||||||
final SavingsAccount savingsAccount = this.savingAccountAssembler.assembleFrom(accountId);
|
final SavingsAccount savingsAccount = this.savingAccountAssembler.assembleFrom(accountId);
|
||||||
|
|
||||||
final List<Long> existingTransactionIds = new ArrayList<Long>(savingsAccount.findExistingTransactionIds());
|
final List<Long> existingTransactionIds = new ArrayList<Long>(savingsAccount.findExistingTransactionIds());
|
||||||
@@ -603,7 +603,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult updateSavingsAccountCharge(JsonCommand command) {
|
public CommandProcessingResult updateSavingsAccountCharge(final JsonCommand command) {
|
||||||
this.context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
|
|
||||||
this.savingsAccountChargeDataValidator.validateUpdate(command.json());
|
this.savingsAccountChargeDataValidator.validateUpdate(command.json());
|
||||||
@@ -638,7 +638,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult waiveCharge(Long savingsAccountId, Long savingsAccountChargeId, JsonCommand command) {
|
public CommandProcessingResult waiveCharge(final Long savingsAccountId, final Long savingsAccountChargeId, final JsonCommand command) {
|
||||||
|
|
||||||
this.context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
|
|
||||||
@@ -664,7 +664,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult deleteSavingsAccountCharge(Long savingsAccountId, Long savingsAccountChargeId, JsonCommand command) {
|
public CommandProcessingResult deleteSavingsAccountCharge(final Long savingsAccountId, final Long savingsAccountChargeId, @SuppressWarnings("unused") final JsonCommand command) {
|
||||||
this.context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
|
|
||||||
final SavingsAccount savingsAccount = this.savingAccountAssembler.assembleFrom(savingsAccountId);
|
final SavingsAccount savingsAccount = this.savingAccountAssembler.assembleFrom(savingsAccountId);
|
||||||
@@ -687,7 +687,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult payCharge(Long savingsAccountId, Long savingsAccountChargeId, JsonCommand command) {
|
public CommandProcessingResult payCharge(final Long savingsAccountId, final Long savingsAccountChargeId, final JsonCommand command) {
|
||||||
this.context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
|
|
||||||
final List<Long> existingTransactionIds = new ArrayList<Long>();
|
final List<Long> existingTransactionIds = new ArrayList<Long>();
|
||||||
|
|||||||
+1
-2
@@ -29,7 +29,6 @@ import org.mifosplatform.organisation.monetary.domain.ApplicationCurrencyReposit
|
|||||||
import org.mifosplatform.organisation.monetary.domain.MonetaryCurrency;
|
import org.mifosplatform.organisation.monetary.domain.MonetaryCurrency;
|
||||||
import org.mifosplatform.organisation.staff.domain.Staff;
|
import org.mifosplatform.organisation.staff.domain.Staff;
|
||||||
import org.mifosplatform.organisation.staff.domain.StaffRepositoryWrapper;
|
import org.mifosplatform.organisation.staff.domain.StaffRepositoryWrapper;
|
||||||
import org.mifosplatform.portfolio.charge.domain.Charge;
|
|
||||||
import org.mifosplatform.portfolio.client.domain.AccountNumberGenerator;
|
import org.mifosplatform.portfolio.client.domain.AccountNumberGenerator;
|
||||||
import org.mifosplatform.portfolio.client.domain.AccountNumberGeneratorFactory;
|
import org.mifosplatform.portfolio.client.domain.AccountNumberGeneratorFactory;
|
||||||
import org.mifosplatform.portfolio.client.domain.Client;
|
import org.mifosplatform.portfolio.client.domain.Client;
|
||||||
@@ -236,7 +235,7 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
|||||||
if (changes.containsKey("charges")) {
|
if (changes.containsKey("charges")) {
|
||||||
//final Set<Charge> savingsProductCharges = this.savi.assembleListOfSavingsProductCharges(command, product.currency().getCode());
|
//final Set<Charge> savingsProductCharges = this.savi.assembleListOfSavingsProductCharges(command, product.currency().getCode());
|
||||||
final Set<SavingsAccountCharge> charges = this.savingsAccountChargeAssembler.fromParsedJson(command.parsedJson());
|
final Set<SavingsAccountCharge> charges = this.savingsAccountChargeAssembler.fromParsedJson(command.parsedJson());
|
||||||
boolean updated = account.update(charges);
|
final boolean updated = account.update(charges);
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
changes.remove("charges");
|
changes.remove("charges");
|
||||||
}
|
}
|
||||||
|
|||||||
+20
-21
@@ -17,7 +17,6 @@ import org.mifosplatform.infrastructure.core.domain.JdbcSupport;
|
|||||||
import org.mifosplatform.infrastructure.core.service.RoutingDataSource;
|
import org.mifosplatform.infrastructure.core.service.RoutingDataSource;
|
||||||
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
||||||
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||||
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
|
||||||
import org.mifosplatform.portfolio.savings.data.SavingsProductData;
|
import org.mifosplatform.portfolio.savings.data.SavingsProductData;
|
||||||
import org.mifosplatform.portfolio.savings.exception.SavingsProductNotFoundException;
|
import org.mifosplatform.portfolio.savings.exception.SavingsProductNotFoundException;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -37,7 +36,7 @@ public class SavingsProductReadPlatformServiceImpl implements SavingsProductRead
|
|||||||
@Autowired
|
@Autowired
|
||||||
public SavingsProductReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
|
public SavingsProductReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
jdbcTemplate = new JdbcTemplate(dataSource);
|
this.jdbcTemplate = new JdbcTemplate(dataSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -45,26 +44,26 @@ public class SavingsProductReadPlatformServiceImpl implements SavingsProductRead
|
|||||||
|
|
||||||
this.context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
|
|
||||||
final String sql = "select " + savingsProductRowMapper.schema();
|
final String sql = "select " + this.savingsProductRowMapper.schema();
|
||||||
|
|
||||||
return this.jdbcTemplate.query(sql, savingsProductRowMapper);
|
return this.jdbcTemplate.query(sql, this.savingsProductRowMapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<SavingsProductData> retrieveAllForLookup() {
|
public Collection<SavingsProductData> retrieveAllForLookup() {
|
||||||
|
|
||||||
final String sql = "select " + savingsProductLookupsRowMapper.schema();
|
final String sql = "select " + this.savingsProductLookupsRowMapper.schema();
|
||||||
|
|
||||||
return this.jdbcTemplate.query(sql, savingsProductLookupsRowMapper);
|
return this.jdbcTemplate.query(sql, this.savingsProductLookupsRowMapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SavingsProductData retrieveOne(final Long savingProductId) {
|
public SavingsProductData retrieveOne(final Long savingProductId) {
|
||||||
try {
|
try {
|
||||||
this.context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
final String sql = "select " + savingsProductRowMapper.schema() + " where sp.id = ?";
|
final String sql = "select " + this.savingsProductRowMapper.schema() + " where sp.id = ?";
|
||||||
return this.jdbcTemplate.queryForObject(sql, savingsProductRowMapper, new Object[] { savingProductId });
|
return this.jdbcTemplate.queryForObject(sql, this.savingsProductRowMapper, new Object[] { savingProductId });
|
||||||
} catch (EmptyResultDataAccessException e) {
|
} catch (final EmptyResultDataAccessException e) {
|
||||||
throw new SavingsProductNotFoundException(savingProductId);
|
throw new SavingsProductNotFoundException(savingProductId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,29 +107,29 @@ public class SavingsProductReadPlatformServiceImpl implements SavingsProductRead
|
|||||||
@Override
|
@Override
|
||||||
public SavingsProductData mapRow(final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException {
|
public SavingsProductData mapRow(final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException {
|
||||||
|
|
||||||
Long id = rs.getLong("id");
|
final Long id = rs.getLong("id");
|
||||||
String name = rs.getString("name");
|
final String name = rs.getString("name");
|
||||||
String description = rs.getString("description");
|
final String description = rs.getString("description");
|
||||||
|
|
||||||
String currencyCode = rs.getString("currencyCode");
|
final String currencyCode = rs.getString("currencyCode");
|
||||||
String currencyName = rs.getString("currencyName");
|
final String currencyName = rs.getString("currencyName");
|
||||||
String currencyNameCode = rs.getString("currencyNameCode");
|
final String currencyNameCode = rs.getString("currencyNameCode");
|
||||||
String currencyDisplaySymbol = rs.getString("currencyDisplaySymbol");
|
final String currencyDisplaySymbol = rs.getString("currencyDisplaySymbol");
|
||||||
Integer currencyDigits = JdbcSupport.getInteger(rs, "currencyDigits");
|
final Integer currencyDigits = JdbcSupport.getInteger(rs, "currencyDigits");
|
||||||
final Integer inMultiplesOf = JdbcSupport.getInteger(rs, "inMultiplesOf");
|
final Integer inMultiplesOf = JdbcSupport.getInteger(rs, "inMultiplesOf");
|
||||||
final CurrencyData currency = new CurrencyData(currencyCode, currencyName, currencyDigits, inMultiplesOf,
|
final CurrencyData currency = new CurrencyData(currencyCode, currencyName, currencyDigits, inMultiplesOf,
|
||||||
currencyDisplaySymbol, currencyNameCode);
|
currencyDisplaySymbol, currencyNameCode);
|
||||||
final BigDecimal nominalAnnualInterestRate = rs.getBigDecimal("nominalAnnualInterestRate");
|
final BigDecimal nominalAnnualInterestRate = rs.getBigDecimal("nominalAnnualInterestRate");
|
||||||
|
|
||||||
final Integer compoundingInterestPeriodTypeValue = JdbcSupport.getInteger(rs, "compoundingInterestPeriodType");
|
final Integer compoundingInterestPeriodTypeValue = JdbcSupport.getInteger(rs, "compoundingInterestPeriodType");
|
||||||
EnumOptionData compoundingInterestPeriodType = SavingsEnumerations
|
final EnumOptionData compoundingInterestPeriodType = SavingsEnumerations
|
||||||
.compoundingInterestPeriodType(compoundingInterestPeriodTypeValue);
|
.compoundingInterestPeriodType(compoundingInterestPeriodTypeValue);
|
||||||
|
|
||||||
final Integer interestPostingPeriodTypeValue = JdbcSupport.getInteger(rs, "interestPostingPeriodType");
|
final Integer interestPostingPeriodTypeValue = JdbcSupport.getInteger(rs, "interestPostingPeriodType");
|
||||||
EnumOptionData interestPostingPeriodType = SavingsEnumerations.interestPostingPeriodType(interestPostingPeriodTypeValue);
|
final EnumOptionData interestPostingPeriodType = SavingsEnumerations.interestPostingPeriodType(interestPostingPeriodTypeValue);
|
||||||
|
|
||||||
final Integer interestCalculationTypeValue = JdbcSupport.getInteger(rs, "interestCalculationType");
|
final Integer interestCalculationTypeValue = JdbcSupport.getInteger(rs, "interestCalculationType");
|
||||||
EnumOptionData interestCalculationType = SavingsEnumerations.interestCalculationType(interestCalculationTypeValue);
|
final EnumOptionData interestCalculationType = SavingsEnumerations.interestCalculationType(interestCalculationTypeValue);
|
||||||
|
|
||||||
EnumOptionData interestCalculationDaysInYearType = null;
|
EnumOptionData interestCalculationDaysInYearType = null;
|
||||||
final Integer interestCalculationDaysInYearTypeValue = JdbcSupport.getInteger(rs, "interestCalculationDaysInYearType");
|
final Integer interestCalculationDaysInYearTypeValue = JdbcSupport.getInteger(rs, "interestCalculationDaysInYearType");
|
||||||
@@ -144,7 +143,7 @@ public class SavingsProductReadPlatformServiceImpl implements SavingsProductRead
|
|||||||
|
|
||||||
final BigDecimal minRequiredOpeningBalance = rs.getBigDecimal("minRequiredOpeningBalance");
|
final BigDecimal minRequiredOpeningBalance = rs.getBigDecimal("minRequiredOpeningBalance");
|
||||||
|
|
||||||
Integer lockinPeriodFrequency = JdbcSupport.getInteger(rs, "lockinPeriodFrequency");
|
final Integer lockinPeriodFrequency = JdbcSupport.getInteger(rs, "lockinPeriodFrequency");
|
||||||
EnumOptionData lockinPeriodFrequencyType = null;
|
EnumOptionData lockinPeriodFrequencyType = null;
|
||||||
final Integer lockinPeriodFrequencyTypeValue = JdbcSupport.getInteger(rs, "lockinPeriodFrequencyType");
|
final Integer lockinPeriodFrequencyTypeValue = JdbcSupport.getInteger(rs, "lockinPeriodFrequencyType");
|
||||||
if (lockinPeriodFrequencyTypeValue != null) {
|
if (lockinPeriodFrequencyTypeValue != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user