cleaning up MIFOSX-1897
This commit is contained in:
@@ -31824,6 +31824,18 @@ No Request Body:
|
||||
</dd>
|
||||
<dd>Flag determines whether running balances
|
||||
to be returned
|
||||
</dd>
|
||||
<dt>loanId</dt>
|
||||
<dd>
|
||||
Integer <span>optional</span>
|
||||
</dd>
|
||||
<dd>Provides ability to restrict journal entries based on the loan they are associated with
|
||||
</dd>
|
||||
<dt>savingsId</dt>
|
||||
<dd>
|
||||
Integer <span>optional</span>
|
||||
</dd>
|
||||
<dd>Provides ability to restrict journal entries based on the savings account they are associated with
|
||||
</dd>
|
||||
</dl>
|
||||
<p>Example Requests:</p>
|
||||
@@ -31842,6 +31854,10 @@ No Request Body:
|
||||
<div class=apiClick>journalentries?runningBalance=true</div>
|
||||
<br>
|
||||
<div class=apiClick>journalentries?transactionDetails=true</div>
|
||||
<br>
|
||||
<div class=apiClick>journalentries?loanId=12</div>
|
||||
<br>
|
||||
<div class=apiClick>journalentries?savingsId=24</div>
|
||||
</div>
|
||||
<div class="method-example">
|
||||
<code class="method-declaration">
|
||||
|
||||
+15
-16
@@ -35,8 +35,8 @@ import org.mifosplatform.infrastructure.core.exception.UnrecognizedQueryParamExc
|
||||
import org.mifosplatform.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.mifosplatform.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
import org.mifosplatform.infrastructure.core.service.Page;
|
||||
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
||||
import org.mifosplatform.infrastructure.core.service.SearchParameters;
|
||||
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -62,8 +62,7 @@ public class JournalEntriesApiResource {
|
||||
@Autowired
|
||||
public JournalEntriesApiResource(final PlatformSecurityContext context,
|
||||
final JournalEntryReadPlatformService journalEntryReadPlatformService,
|
||||
final DefaultToApiJsonSerializer<Object> toApiJsonSerializer,
|
||||
final ApiRequestParameterHelper apiRequestParameterHelper,
|
||||
final DefaultToApiJsonSerializer<Object> toApiJsonSerializer, final ApiRequestParameterHelper apiRequestParameterHelper,
|
||||
final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService) {
|
||||
this.context = context;
|
||||
this.apiRequestParameterHelper = apiRequestParameterHelper;
|
||||
@@ -82,7 +81,7 @@ public class JournalEntriesApiResource {
|
||||
@QueryParam("offset") final Integer offset, @QueryParam("limit") final Integer limit,
|
||||
@QueryParam("orderBy") final String orderBy, @QueryParam("sortOrder") final String sortOrder,
|
||||
@QueryParam("locale") final String locale, @QueryParam("dateFormat") final String dateFormat,
|
||||
@QueryParam("loanId") final Long loanId,@QueryParam("savingsId") final Long savingsId,
|
||||
@QueryParam("loanId") final Long loanId, @QueryParam("savingsId") final Long savingsId,
|
||||
@QueryParam("runningBalance") final boolean runningBalance, @QueryParam("transactionDetails") final boolean transactionDetails) {
|
||||
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||
@@ -96,7 +95,8 @@ public class JournalEntriesApiResource {
|
||||
toDate = toDateParam.getDate("toDate", dateFormat, locale);
|
||||
}
|
||||
|
||||
final SearchParameters searchParameters = SearchParameters.forJournalEntries(officeId, offset, limit, orderBy, sortOrder,loanId,savingsId);
|
||||
final SearchParameters searchParameters = SearchParameters.forJournalEntries(officeId, offset, limit, orderBy, sortOrder, loanId,
|
||||
savingsId);
|
||||
JournalEntryAssociationParametersData associationParametersData = new JournalEntryAssociationParametersData(transactionDetails,
|
||||
runningBalance);
|
||||
|
||||
@@ -107,11 +107,11 @@ public class JournalEntriesApiResource {
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("{journalEntryId}")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
public String retreiveJournalEntryById(@PathParam("journalEntryId") final Long journalEntryId, @Context final UriInfo uriInfo,
|
||||
@QueryParam("runningBalance") final boolean runningBalance, @QueryParam("transactionDetails") final boolean transactionDetails) {
|
||||
@Path("{journalEntryId}")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
public String retreiveJournalEntryById(@PathParam("journalEntryId") final Long journalEntryId, @Context final UriInfo uriInfo,
|
||||
@QueryParam("runningBalance") final boolean runningBalance, @QueryParam("transactionDetails") final boolean transactionDetails) {
|
||||
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||
JournalEntryAssociationParametersData associationParametersData = new JournalEntryAssociationParametersData(transactionDetails,
|
||||
@@ -123,8 +123,6 @@ public class JournalEntriesApiResource {
|
||||
return this.apiJsonSerializerService.serialize(settings, glJournalEntryData, RESPONSE_DATA_PARAMETERS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@POST
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@@ -150,12 +148,12 @@ public class JournalEntriesApiResource {
|
||||
@Path("{transactionId}")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
public String createReversalJournalEntry(final String jsonRequestBody,
|
||||
@PathParam("transactionId") final String transactionId,
|
||||
public String createReversalJournalEntry(final String jsonRequestBody, @PathParam("transactionId") final String transactionId,
|
||||
@QueryParam("command") final String commandParam) {
|
||||
CommandProcessingResult result = null;
|
||||
if (is(commandParam, "reverse")) {
|
||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().reverseJournalEntry(transactionId).withJson(jsonRequestBody).build();
|
||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().reverseJournalEntry(transactionId).withJson(jsonRequestBody)
|
||||
.build();
|
||||
result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||
} else {
|
||||
throw new UnrecognizedQueryParamException("command", commandParam);
|
||||
@@ -171,7 +169,8 @@ public class JournalEntriesApiResource {
|
||||
public String retrieveOpeningBalance(@Context final UriInfo uriInfo, @QueryParam("officeId") final Long officeId) {
|
||||
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||
final OfficeOpeningBalancesData officeOpeningBalancesData = this.journalEntryReadPlatformService.retrieveOfficeOpeningBalances(officeId);
|
||||
final OfficeOpeningBalancesData officeOpeningBalancesData = this.journalEntryReadPlatformService
|
||||
.retrieveOfficeOpeningBalances(officeId);
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.apiJsonSerializerService.serialize(settings, officeOpeningBalancesData);
|
||||
}
|
||||
|
||||
+38
-24
@@ -5,6 +5,16 @@
|
||||
*/
|
||||
package org.mifosplatform.accounting.journalentry.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.mifosplatform.accounting.common.AccountingEnumerations;
|
||||
@@ -13,13 +23,21 @@ import org.mifosplatform.accounting.financialactivityaccount.domain.FinancialAct
|
||||
import org.mifosplatform.accounting.glaccount.data.GLAccountData;
|
||||
import org.mifosplatform.accounting.glaccount.domain.GLAccountType;
|
||||
import org.mifosplatform.accounting.glaccount.service.GLAccountReadPlatformService;
|
||||
import org.mifosplatform.accounting.journalentry.data.*;
|
||||
import org.mifosplatform.accounting.journalentry.data.JournalEntryAssociationParametersData;
|
||||
import org.mifosplatform.accounting.journalentry.data.JournalEntryData;
|
||||
import org.mifosplatform.accounting.journalentry.data.OfficeOpeningBalancesData;
|
||||
import org.mifosplatform.accounting.journalentry.data.TransactionDetailData;
|
||||
import org.mifosplatform.accounting.journalentry.data.TransactionTypeEnumData;
|
||||
import org.mifosplatform.accounting.journalentry.exception.JournalEntriesNotFoundException;
|
||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
||||
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||
import org.mifosplatform.infrastructure.core.domain.JdbcSupport;
|
||||
import org.mifosplatform.infrastructure.core.exception.GeneralPlatformDomainRuleException;
|
||||
import org.mifosplatform.infrastructure.core.service.*;
|
||||
import org.mifosplatform.infrastructure.core.service.DateUtils;
|
||||
import org.mifosplatform.infrastructure.core.service.Page;
|
||||
import org.mifosplatform.infrastructure.core.service.PaginationHelper;
|
||||
import org.mifosplatform.infrastructure.core.service.RoutingDataSource;
|
||||
import org.mifosplatform.infrastructure.core.service.SearchParameters;
|
||||
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||
import org.mifosplatform.organisation.office.data.OfficeData;
|
||||
import org.mifosplatform.organisation.office.service.OfficeReadPlatformService;
|
||||
@@ -37,16 +55,6 @@ import org.springframework.jdbc.core.RowMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlatformService {
|
||||
|
||||
@@ -58,8 +66,9 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
||||
private final PaginationHelper<JournalEntryData> paginationHelper = new PaginationHelper<>();
|
||||
|
||||
@Autowired
|
||||
public JournalEntryReadPlatformServiceImpl(final RoutingDataSource dataSource, final GLAccountReadPlatformService glAccountReadPlatformService,
|
||||
final OfficeReadPlatformService officeReadPlatformService, final FinancialActivityAccountRepositoryWrapper financialActivityAccountRepositoryWrapper) {
|
||||
public JournalEntryReadPlatformServiceImpl(final RoutingDataSource dataSource,
|
||||
final GLAccountReadPlatformService glAccountReadPlatformService, final OfficeReadPlatformService officeReadPlatformService,
|
||||
final FinancialActivityAccountRepositoryWrapper financialActivityAccountRepositoryWrapper) {
|
||||
this.jdbcTemplate = new JdbcTemplate(dataSource);
|
||||
this.glAccountReadPlatformService = glAccountReadPlatformService;
|
||||
this.officeReadPlatformService = officeReadPlatformService;
|
||||
@@ -229,7 +238,7 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
||||
sqlBuilder.append("select SQL_CALC_FOUND_ROWS ");
|
||||
sqlBuilder.append(rm.schema());
|
||||
|
||||
final Object[] objectArray = new Object[5];
|
||||
final Object[] objectArray = new Object[15];
|
||||
int arrayPos = 0;
|
||||
String whereClose = " where ";
|
||||
|
||||
@@ -315,14 +324,15 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
||||
whereClose = " and ";
|
||||
}
|
||||
if (searchParameters.isSavingsIdPassed()) {
|
||||
sqlBuilder.append(whereClose + " journalEntry.savings_transaction_id in (select id from m_savings_account_transaction where savings_account_id = ?)");
|
||||
sqlBuilder
|
||||
.append(whereClose
|
||||
+ " journalEntry.savings_transaction_id in (select id from m_savings_account_transaction where savings_account_id = ?)");
|
||||
objectArray[arrayPos] = searchParameters.getSavingsId();
|
||||
arrayPos = arrayPos + 1;
|
||||
|
||||
whereClose = " and ";
|
||||
}
|
||||
|
||||
|
||||
if (searchParameters.isOrderByRequested()) {
|
||||
sqlBuilder.append(" order by ").append(searchParameters.getOrderBy());
|
||||
|
||||
@@ -364,12 +374,12 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
||||
@Override
|
||||
public OfficeOpeningBalancesData retrieveOfficeOpeningBalances(final Long officeId) {
|
||||
|
||||
final FinancialActivityAccount financialActivityAccountId = this.financialActivityAccountRepositoryWrapper.findByFinancialActivityTypeWithNotFoundDetection(300);
|
||||
final Long contraId = financialActivityAccountId.getGlAccount().getId();
|
||||
if (contraId == null) { throw new GeneralPlatformDomainRuleException(
|
||||
final FinancialActivityAccount financialActivityAccountId = this.financialActivityAccountRepositoryWrapper
|
||||
.findByFinancialActivityTypeWithNotFoundDetection(300);
|
||||
final Long contraId = financialActivityAccountId.getGlAccount().getId();
|
||||
if (contraId == null) { throw new GeneralPlatformDomainRuleException(
|
||||
"error.msg.financial.activity.mapping.opening.balance.contra.account.cannot.be.null",
|
||||
"office-opening-balances-contra-account value can not be null",
|
||||
"office-opening-balances-contra-account");}
|
||||
"office-opening-balances-contra-account value can not be null", "office-opening-balances-contra-account"); }
|
||||
|
||||
final JournalEntryAssociationParametersData associationParametersData = new JournalEntryAssociationParametersData();
|
||||
final GLAccountData contraAccount = this.glAccountReadPlatformService.retrieveGLAccountById(contraId, associationParametersData);
|
||||
@@ -456,7 +466,8 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
||||
final String transactionId = "";
|
||||
final Page<JournalEntryData> contraJournalEntries = retrieveContraTransactions(officeId, contraId, transactionId);
|
||||
if (!CollectionUtils.isEmpty(contraJournalEntries.getPageItems())) {
|
||||
final JournalEntryData contraTransaction = contraJournalEntries.getPageItems().get(contraJournalEntries.getPageItems().size()-1);
|
||||
final JournalEntryData contraTransaction = contraJournalEntries.getPageItems().get(
|
||||
contraJournalEntries.getPageItems().size() - 1);
|
||||
return contraTransaction.getTransactionId();
|
||||
}
|
||||
return transactionId;
|
||||
@@ -472,8 +483,11 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
||||
final Date fromDate = null;
|
||||
final Date toDate = null;
|
||||
final JournalEntryAssociationParametersData associationParametersData = null;
|
||||
final Long loanId = null;
|
||||
final Long savingsId = null;
|
||||
|
||||
final SearchParameters searchParameters = SearchParameters.forJournalEntries(officeId, offset, limit, orderBy, sortOrder,null,null);
|
||||
final SearchParameters searchParameters = SearchParameters.forJournalEntries(officeId, offset, limit, orderBy, sortOrder, loanId,
|
||||
savingsId);
|
||||
return retrieveAll(searchParameters, contraId, onlyManualEntries, fromDate, toDate, transactionId, entityType,
|
||||
associationParametersData);
|
||||
|
||||
|
||||
+7
-7
@@ -39,7 +39,6 @@ import org.mifosplatform.accounting.journalentry.serialization.JournalEntryComma
|
||||
import org.mifosplatform.accounting.rule.domain.AccountingRule;
|
||||
import org.mifosplatform.accounting.rule.domain.AccountingRuleRepository;
|
||||
import org.mifosplatform.accounting.rule.exception.AccountingRuleNotFoundException;
|
||||
import org.mifosplatform.infrastructure.configuration.domain.ConfigurationDomainService;
|
||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||
import org.mifosplatform.infrastructure.core.data.ApiParameterError;
|
||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||
@@ -93,7 +92,8 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
|
||||
final AccountingProcessorForSavingsFactory accountingProcessorForSavingsFactory,
|
||||
final GLAccountReadPlatformService glAccountReadPlatformService,
|
||||
final OrganisationCurrencyRepositoryWrapper organisationCurrencyRepository, final PlatformSecurityContext context,
|
||||
final PaymentDetailWritePlatformService paymentDetailWritePlatformService,final FinancialActivityAccountRepositoryWrapper financialActivityAccountRepositoryWrapper) {
|
||||
final PaymentDetailWritePlatformService paymentDetailWritePlatformService,
|
||||
final FinancialActivityAccountRepositoryWrapper financialActivityAccountRepositoryWrapper) {
|
||||
this.glClosureRepository = glClosureRepository;
|
||||
this.officeRepository = officeRepository;
|
||||
this.glJournalEntryRepository = glJournalEntryRepository;
|
||||
@@ -451,12 +451,12 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
|
||||
final JournalEntryCommand journalEntryCommand = this.fromApiJsonDeserializer.commandFromApiJson(command.json());
|
||||
journalEntryCommand.validateForCreate();
|
||||
|
||||
final FinancialActivityAccount financialActivityAccountId = this.financialActivityAccountRepositoryWrapper.findByFinancialActivityTypeWithNotFoundDetection(300);
|
||||
final Long contraId = financialActivityAccountId.getGlAccount().getId();
|
||||
if (contraId == null) { throw new GeneralPlatformDomainRuleException(
|
||||
final FinancialActivityAccount financialActivityAccountId = this.financialActivityAccountRepositoryWrapper
|
||||
.findByFinancialActivityTypeWithNotFoundDetection(300);
|
||||
final Long contraId = financialActivityAccountId.getGlAccount().getId();
|
||||
if (contraId == null) { throw new GeneralPlatformDomainRuleException(
|
||||
"error.msg.financial.activity.mapping.opening.balance.contra.account.cannot.be.null",
|
||||
"office-opening-balances-contra-account value can not be null",
|
||||
"office-opening-balances-contra-account");}
|
||||
"office-opening-balances-contra-account value can not be null", "office-opening-balances-contra-account"); }
|
||||
|
||||
validateJournalEntriesArePostedBefore(contraId);
|
||||
|
||||
|
||||
+34
-14
@@ -32,8 +32,10 @@ public final class SearchParameters {
|
||||
final String hierarchy) {
|
||||
final Long staffId = null;
|
||||
final String accountNo = null;
|
||||
final Long loanId = null;
|
||||
final Long savingsId = null;
|
||||
return new SearchParameters(sqlSearch, officeId, externalId, name, hierarchy, null, null, null, null, null, null, staffId,
|
||||
accountNo,null,null);
|
||||
accountNo, loanId, savingsId);
|
||||
}
|
||||
|
||||
public static SearchParameters forClients(final String sqlSearch, final Long officeId, final String externalId,
|
||||
@@ -43,9 +45,11 @@ public final class SearchParameters {
|
||||
final Integer maxLimitAllowed = getCheckedLimit(limit);
|
||||
final Long staffId = null;
|
||||
final String accountNo = null;
|
||||
final Long loanId = null;
|
||||
final Long savingsId = null;
|
||||
|
||||
return new SearchParameters(sqlSearch, officeId, externalId, displayName, hierarchy, firstname, lastname, offset, maxLimitAllowed,
|
||||
orderBy, sortOrder, staffId, accountNo,null,null);
|
||||
orderBy, sortOrder, staffId, accountNo, loanId, savingsId);
|
||||
}
|
||||
|
||||
public static SearchParameters forGroups(final String sqlSearch, final Long officeId, final Long staffId, final String externalId,
|
||||
@@ -54,14 +58,15 @@ public final class SearchParameters {
|
||||
|
||||
final Integer maxLimitAllowed = getCheckedLimit(limit);
|
||||
final String accountNo = null;
|
||||
final Long loanId = null;
|
||||
final Long savingsId = null;
|
||||
|
||||
return new SearchParameters(sqlSearch, officeId, externalId, name, hierarchy, null, null, offset, maxLimitAllowed, orderBy,
|
||||
sortOrder, staffId, accountNo,null,null);
|
||||
sortOrder, staffId, accountNo, loanId, savingsId);
|
||||
}
|
||||
|
||||
public static SearchParameters forOffices(final String orderBy, final String sortOrder) {
|
||||
return new SearchParameters(null, null, null, null, null, null, null, null, null, orderBy, sortOrder,
|
||||
null, null,null,null);
|
||||
return new SearchParameters(null, null, null, null, null, null, null, null, null, orderBy, sortOrder, null, null, null, null);
|
||||
}
|
||||
|
||||
public static SearchParameters forLoans(final String sqlSearch, final String externalId, final Integer offset, final Integer limit,
|
||||
@@ -69,27 +74,32 @@ public final class SearchParameters {
|
||||
|
||||
final Integer maxLimitAllowed = getCheckedLimit(limit);
|
||||
final Long staffId = null;
|
||||
final Long loanId = null;
|
||||
final Long savingsId = null;
|
||||
|
||||
return new SearchParameters(sqlSearch, null, externalId, null, null, null, null, offset, maxLimitAllowed, orderBy, sortOrder,
|
||||
staffId, accountNo,null,null);
|
||||
staffId, accountNo, loanId, savingsId);
|
||||
}
|
||||
|
||||
public static SearchParameters forJournalEntries(final Long officeId, final Integer offset, final Integer limit, final String orderBy,
|
||||
final String sortOrder,final Long loanId,final Long savingsId) {
|
||||
final String sortOrder, final Long loanId, final Long savingsId) {
|
||||
|
||||
final Integer maxLimitAllowed = getCheckedLimit(limit);
|
||||
final Long staffId = null;
|
||||
|
||||
return new SearchParameters(null, officeId, null, null, null, null, null, offset, maxLimitAllowed, orderBy, sortOrder, staffId,
|
||||
null,loanId,savingsId);
|
||||
null, loanId, savingsId);
|
||||
}
|
||||
|
||||
public static SearchParameters forPagination(final Integer offset, final Integer limit, final String orderBy, final String sortOrder) {
|
||||
|
||||
final Integer maxLimitAllowed = getCheckedLimit(limit);
|
||||
final Long staffId = null;
|
||||
final Long loanId = null;
|
||||
final Long savingsId = null;
|
||||
|
||||
return new SearchParameters(null, null, null, null, null, null, null, offset, maxLimitAllowed, orderBy, sortOrder, staffId, null,null,null);
|
||||
return new SearchParameters(null, null, null, null, null, null, null, offset, maxLimitAllowed, orderBy, sortOrder, staffId, null,
|
||||
loanId, savingsId);
|
||||
}
|
||||
|
||||
public static SearchParameters forSavings(final String sqlSearch, final String externalId, final Integer offset, final Integer limit,
|
||||
@@ -98,9 +108,11 @@ public final class SearchParameters {
|
||||
final Integer maxLimitAllowed = getCheckedLimit(limit);
|
||||
final Long staffId = null;
|
||||
final String accountNo = null;
|
||||
final Long loanId = null;
|
||||
final Long savingsId = null;
|
||||
|
||||
return new SearchParameters(sqlSearch, null, externalId, null, null, null, null, offset, maxLimitAllowed, orderBy, sortOrder,
|
||||
staffId, accountNo,null,null);
|
||||
staffId, accountNo, loanId, savingsId);
|
||||
}
|
||||
|
||||
public static SearchParameters forAccountTransfer(final String sqlSearch, final String externalId, final Integer offset,
|
||||
@@ -109,14 +121,17 @@ public final class SearchParameters {
|
||||
final Integer maxLimitAllowed = getCheckedLimit(limit);
|
||||
final Long staffId = null;
|
||||
final String accountNo = null;
|
||||
final Long loanId = null;
|
||||
final Long savingsId = null;
|
||||
|
||||
return new SearchParameters(sqlSearch, null, externalId, null, null, null, null, offset, maxLimitAllowed, orderBy, sortOrder,
|
||||
staffId, accountNo,null,null);
|
||||
staffId, accountNo, loanId, savingsId);
|
||||
}
|
||||
|
||||
private SearchParameters(final String sqlSearch, final Long officeId, final String externalId, final String name,
|
||||
final String hierarchy, final String firstname, final String lastname, final Integer offset, final Integer limit,
|
||||
final String orderBy, final String sortOrder, final Long staffId, final String accountNo,final Long loanId,final Long savingsId) {
|
||||
final String orderBy, final String sortOrder, final Long staffId, final String accountNo, final Long loanId,
|
||||
final Long savingsId) {
|
||||
this.sqlSearch = sqlSearch;
|
||||
this.officeId = officeId;
|
||||
this.externalId = externalId;
|
||||
@@ -233,11 +248,16 @@ public final class SearchParameters {
|
||||
public boolean isLoanIdPassed() {
|
||||
return this.loanId != null && this.loanId != 0;
|
||||
}
|
||||
|
||||
public boolean isSavingsIdPassed() {
|
||||
return this.savingsId != null && this.savingsId != 0;
|
||||
}
|
||||
|
||||
public Long getLoanId() {return this.loanId;}
|
||||
public Long getLoanId() {
|
||||
return this.loanId;
|
||||
}
|
||||
|
||||
public Long getSavingsId() {return this.savingsId;}
|
||||
public Long getSavingsId() {
|
||||
return this.savingsId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user