Revert "FINERACT-1410 :Allow Payment types to map to all types of Ledgers (#1894)"
This reverts commit 32fae2b127.
This commit is contained in:
+2
-6
@@ -362,7 +362,8 @@ public class ProductToGLAccountMappingHelper {
|
||||
private void savePaymentChannelToFundSourceMapping(final Long productId, final Long paymentTypeId,
|
||||
final Long paymentTypeSpecificFundAccountId, final PortfolioProductType portfolioProductType) {
|
||||
final PaymentType paymentType = this.paymentTypeRepositoryWrapper.findOneWithNotFoundDetection(paymentTypeId);
|
||||
final GLAccount glAccount = getAccountById(LoanProductAccountingParams.FUND_SOURCE.getValue(), paymentTypeSpecificFundAccountId);
|
||||
final GLAccount glAccount = getAccountByIdAndType(LoanProductAccountingParams.FUND_SOURCE.getValue(), GLAccountType.ASSET,
|
||||
paymentTypeSpecificFundAccountId);
|
||||
final ProductToGLAccountMapping accountMapping = new ProductToGLAccountMapping(glAccount, productId,
|
||||
portfolioProductType.getValue(), CashAccountsForLoan.FUND_SOURCE.getValue(), paymentType);
|
||||
this.accountMappingRepository.save(accountMapping);
|
||||
@@ -426,11 +427,6 @@ public class ProductToGLAccountMappingHelper {
|
||||
return glAccount;
|
||||
}
|
||||
|
||||
public GLAccount getAccountById(final String paramName, final Long accountId) {
|
||||
final GLAccount glAccount = this.accountRepositoryWrapper.findOneWithNotFoundDetection(accountId);
|
||||
return glAccount;
|
||||
}
|
||||
|
||||
public GLAccount getAccountByIdAndType(final String paramName, final List<GLAccountType> expectedAccountTypes, final Long accountId) {
|
||||
final GLAccount glAccount = this.accountRepositoryWrapper.findOneWithNotFoundDetection(accountId);
|
||||
// validate account is of the expected Type
|
||||
|
||||
-1
@@ -31,6 +31,5 @@ public final class GlobalConfigurationApiConstant {
|
||||
public static final String CONFIGURATION_RESOURCE_NAME = "globalConfiguration";
|
||||
public static final String localeParamName = "locale";
|
||||
public static final String dateFormatParamName = "dateFormat";
|
||||
public static final String STRING_VALUE = "stringValue";
|
||||
|
||||
}
|
||||
|
||||
+3
-9
@@ -43,10 +43,9 @@ import org.springframework.stereotype.Component;
|
||||
public class GlobalConfigurationDataValidator {
|
||||
|
||||
private final FromJsonHelper fromApiJsonHelper;
|
||||
private static final Set<String> UPDATE_CONFIGURATION_DATA_PARAMETERS = new HashSet<>(
|
||||
Arrays.asList(GlobalConfigurationApiConstant.localeParamName, GlobalConfigurationApiConstant.dateFormatParamName,
|
||||
GlobalConfigurationApiConstant.ENABLED, GlobalConfigurationApiConstant.VALUE, GlobalConfigurationApiConstant.DATE_VALUE,
|
||||
GlobalConfigurationApiConstant.STRING_VALUE));
|
||||
private static final Set<String> UPDATE_CONFIGURATION_DATA_PARAMETERS = new HashSet<>(Arrays.asList(
|
||||
GlobalConfigurationApiConstant.localeParamName, GlobalConfigurationApiConstant.dateFormatParamName,
|
||||
GlobalConfigurationApiConstant.ENABLED, GlobalConfigurationApiConstant.VALUE, GlobalConfigurationApiConstant.DATE_VALUE));
|
||||
|
||||
@Autowired
|
||||
public GlobalConfigurationDataValidator(final FromJsonHelper fromApiJsonHelper) {
|
||||
@@ -82,11 +81,6 @@ public class GlobalConfigurationDataValidator {
|
||||
baseDataValidator.reset().parameter(GlobalConfigurationApiConstant.DATE_VALUE).value(dateValue).notNull();
|
||||
}
|
||||
|
||||
if (this.fromApiJsonHelper.parameterExists(GlobalConfigurationApiConstant.STRING_VALUE, element)) {
|
||||
final String stringValue = this.fromApiJsonHelper.extractStringNamed(GlobalConfigurationApiConstant.STRING_VALUE, element);
|
||||
baseDataValidator.reset().parameter(GlobalConfigurationApiConstant.STRING_VALUE).value(stringValue).notNull();
|
||||
}
|
||||
|
||||
if (!dataValidationErrors.isEmpty()) {
|
||||
throw new PlatformApiDataValidationException(dataValidationErrors);
|
||||
}
|
||||
|
||||
+3
-10
@@ -33,7 +33,6 @@ public class GlobalConfigurationPropertyData {
|
||||
private final Long value;
|
||||
@SuppressWarnings("unused")
|
||||
private final Date dateValue;
|
||||
private String stringValue;
|
||||
@SuppressWarnings("unused")
|
||||
private final Long id;
|
||||
@SuppressWarnings("unused")
|
||||
@@ -42,24 +41,22 @@ public class GlobalConfigurationPropertyData {
|
||||
private final boolean trapDoor;
|
||||
|
||||
public GlobalConfigurationPropertyData(final String name, final boolean enabled, final Long value, final Date dateValue,
|
||||
final String stringValue, final String description, final boolean trapDoor) {
|
||||
final String description, final boolean trapDoor) {
|
||||
this.name = name;
|
||||
this.enabled = enabled;
|
||||
this.value = value;
|
||||
this.dateValue = dateValue;
|
||||
this.stringValue = stringValue;
|
||||
this.id = null;
|
||||
this.description = description;
|
||||
this.trapDoor = trapDoor;
|
||||
}
|
||||
|
||||
public GlobalConfigurationPropertyData(final String name, final boolean enabled, final Long value, Date dateValue,
|
||||
final String stringValue, final Long id, final String description, final boolean isTrapDoor) {
|
||||
public GlobalConfigurationPropertyData(final String name, final boolean enabled, final Long value, Date dateValue, final Long id,
|
||||
final String description, final boolean isTrapDoor) {
|
||||
this.name = name;
|
||||
this.enabled = enabled;
|
||||
this.value = value;
|
||||
this.dateValue = dateValue;
|
||||
this.stringValue = stringValue;
|
||||
this.id = id;
|
||||
this.description = description;
|
||||
this.trapDoor = isTrapDoor;
|
||||
@@ -77,10 +74,6 @@ public class GlobalConfigurationPropertyData {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public String getStringValue() {
|
||||
return this.stringValue;
|
||||
}
|
||||
|
||||
public Date getDateValue() {
|
||||
return this.dateValue;
|
||||
}
|
||||
|
||||
-4
@@ -98,8 +98,4 @@ public interface ConfigurationDomainService {
|
||||
boolean isFirstRepaymentDateAfterRescheduleAllowedOnHoliday();
|
||||
|
||||
boolean isInterestToBeAppropriatedEquallyWhenGreaterThanEMI();
|
||||
|
||||
String getAccountMappingForPaymentType();
|
||||
|
||||
String getAccountMappingForCharge();
|
||||
}
|
||||
|
||||
-30
@@ -363,34 +363,4 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAccountMappingForPaymentType() {
|
||||
final String propertyName = "account-mapping-for-payment-type";
|
||||
String defaultValue = "Asset"; // 1 Stands for Account mapped from asset only
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
if (property.isEnabled()) {
|
||||
String value = property.getStringValue();
|
||||
if (value == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAccountMappingForCharge() {
|
||||
final String propertyName = "account-mapping-for-charge";
|
||||
String defaultValue = "Income"; // 1 Stands for Account mapped from income only
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
if (property.isEnabled()) {
|
||||
String value = property.getValue().toString();
|
||||
if (value == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-20
@@ -46,9 +46,6 @@ public class GlobalConfigurationProperty extends AbstractPersistableCustom {
|
||||
@Column(name = "date_value", nullable = true)
|
||||
private Date dateValue;
|
||||
|
||||
@Column(name = "string_value", nullable = true)
|
||||
private String stringValue;
|
||||
|
||||
@Column(name = "description", nullable = true)
|
||||
private String description;
|
||||
|
||||
@@ -60,18 +57,16 @@ public class GlobalConfigurationProperty extends AbstractPersistableCustom {
|
||||
this.enabled = false;
|
||||
this.value = null;
|
||||
this.dateValue = null;
|
||||
this.stringValue = null;
|
||||
this.description = null;
|
||||
this.isTrapDoor = false;
|
||||
}
|
||||
|
||||
public GlobalConfigurationProperty(final String name, final boolean enabled, final Long value, final Date dateValue,
|
||||
final String stringValue, final String description, final boolean isTrapDoor) {
|
||||
final String description, final boolean isTrapDoor) {
|
||||
this.name = name;
|
||||
this.enabled = enabled;
|
||||
this.value = value;
|
||||
this.dateValue = dateValue;
|
||||
this.stringValue = stringValue;
|
||||
this.description = description;
|
||||
this.isTrapDoor = isTrapDoor;
|
||||
}
|
||||
@@ -88,10 +83,6 @@ public class GlobalConfigurationProperty extends AbstractPersistableCustom {
|
||||
return this.dateValue;
|
||||
}
|
||||
|
||||
public String getStringValue() {
|
||||
return this.stringValue;
|
||||
}
|
||||
|
||||
public Map<String, Object> update(final JsonCommand command) {
|
||||
|
||||
final Map<String, Object> actualChanges = new LinkedHashMap<>(7);
|
||||
@@ -122,13 +113,6 @@ public class GlobalConfigurationProperty extends AbstractPersistableCustom {
|
||||
this.dateValue = newDateValue;
|
||||
}
|
||||
|
||||
final String stringValueParamName = "stringValue";
|
||||
if (command.isChangeInStringParameterNamed(stringValueParamName, this.stringValue)) {
|
||||
final String newStringValue = command.stringValueOfParameterNamed(stringValueParamName);
|
||||
actualChanges.put(stringValueParamName, newStringValue);
|
||||
this.stringValue = newStringValue;
|
||||
}
|
||||
|
||||
final String passwordPropertyName = "force-password-reset-days";
|
||||
if (this.name.equalsIgnoreCase(passwordPropertyName)) {
|
||||
if ((this.enabled == true && command.hasParameter(valueParamName) && (this.value == 0))
|
||||
@@ -142,12 +126,12 @@ public class GlobalConfigurationProperty extends AbstractPersistableCustom {
|
||||
}
|
||||
|
||||
public static GlobalConfigurationProperty newSurveyConfiguration(final String name) {
|
||||
return new GlobalConfigurationProperty(name, false, null, null, null, null, false);
|
||||
return new GlobalConfigurationProperty(name, false, null, null, null, false);
|
||||
}
|
||||
|
||||
public GlobalConfigurationPropertyData toData() {
|
||||
return new GlobalConfigurationPropertyData(getName(), isEnabled(), getValue(), getDateValue(), getStringValue(), this.getId(),
|
||||
this.description, this.isTrapDoor);
|
||||
return new GlobalConfigurationPropertyData(getName(), isEnabled(), getValue(), getDateValue(), this.getId(), this.description,
|
||||
this.isTrapDoor);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
||||
+5
-6
@@ -52,7 +52,7 @@ public class ConfigurationReadPlatformServiceImpl implements ConfigurationReadPl
|
||||
|
||||
this.context.authenticatedUser();
|
||||
|
||||
String sql = "SELECT c.id, c.name, c.enabled, c.value, c.date_value, c.description,c.string_value, c.is_trap_door FROM c_configuration c ";
|
||||
String sql = "SELECT c.id, c.name, c.enabled, c.value, c.date_value, c.description, c.is_trap_door FROM c_configuration c ";
|
||||
|
||||
if (survey) {
|
||||
sql += " JOIN x_registered_table on x_registered_table.registered_table_name = c.name ";
|
||||
@@ -68,11 +68,11 @@ public class ConfigurationReadPlatformServiceImpl implements ConfigurationReadPl
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlobalConfigurationPropertyData retrieveGlobalConfiguration(final String name) {
|
||||
public GlobalConfigurationPropertyData retrieveGlobalConfiguration(String name) {
|
||||
|
||||
this.context.authenticatedUser();
|
||||
|
||||
final String sql = "SELECT c.id, c.name, c.enabled, c.value, c.date_value, c.string_value, c.description, c.is_trap_door FROM "
|
||||
final String sql = "SELECT c.id, c.name, c.enabled, c.value, c.date_value, c.description, c.is_trap_door FROM "
|
||||
+ "c_configuration c where c.name=? order by c.id";
|
||||
final GlobalConfigurationPropertyData globalConfiguration = this.jdbcTemplate.queryForObject(sql, this.rm, new Object[] { name });
|
||||
|
||||
@@ -84,7 +84,7 @@ public class ConfigurationReadPlatformServiceImpl implements ConfigurationReadPl
|
||||
|
||||
this.context.authenticatedUser();
|
||||
|
||||
final String sql = "SELECT c.id, c.name, c.enabled, c.value, c.date_value, c.string_value ,c.description, c.is_trap_door FROM "
|
||||
final String sql = "SELECT c.id, c.name, c.enabled, c.value, c.date_value, c.description, c.is_trap_door FROM "
|
||||
+ "c_configuration c where c.id=? order by c.id";
|
||||
final GlobalConfigurationPropertyData globalConfiguration = this.jdbcTemplate.queryForObject(sql, this.rm,
|
||||
new Object[] { configId });
|
||||
@@ -102,11 +102,10 @@ public class ConfigurationReadPlatformServiceImpl implements ConfigurationReadPl
|
||||
final boolean enabled = rs.getBoolean("enabled");
|
||||
final Long value = rs.getLong("value");
|
||||
final Date dateValue = rs.getDate("date_value");
|
||||
final String stringValue = rs.getString("string_value");
|
||||
final String description = rs.getString("description");
|
||||
final Long id = rs.getLong("id");
|
||||
final boolean isTrapDoor = rs.getBoolean("is_trap_door");
|
||||
return new GlobalConfigurationPropertyData(name, enabled, value, dateValue, stringValue, id, description, isTrapDoor);
|
||||
return new GlobalConfigurationPropertyData(name, enabled, value, dateValue, id, description, isTrapDoor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-2
@@ -191,6 +191,4 @@ public class SavingsApiConstants {
|
||||
public static final String gsimApplicationId = "applicationId";
|
||||
public static final String gsimLastApplication = "lastApplication";
|
||||
public static final String ERROR_MSG_SAVINGS_ACCOUNT_NOT_ACTIVE = "not.in.active.state";
|
||||
|
||||
public static final String accountMappingForPaymentParamName = "accountMappingForPayment";
|
||||
}
|
||||
|
||||
+3
-2
@@ -41,12 +41,13 @@ public class SavingsApiSetConstants extends SavingsApiConstants {
|
||||
"interestCalculationTypeOptions", "interestCalculationDaysInYearTypeOptions", "lockinPeriodFrequencyTypeOptions",
|
||||
"withdrawalFeeTypeOptions", nominalAnnualInterestRateOverdraftParamName, minOverdraftForInterestCalculationParamName,
|
||||
withHoldTaxParamName, taxGroupIdParamName, isDormancyTrackingActiveParamName, daysToInactiveParamName,
|
||||
daysToDormancyParamName, daysToInactiveParamName, accountMappingForPaymentParamName));
|
||||
daysToDormancyParamName, daysToInactiveParamName));
|
||||
|
||||
/**
|
||||
* These parameters will match the class level parameters of {@link SavingsAccountData}. Where possible, we try to
|
||||
* get response parameters to match those of request parameters.
|
||||
*/
|
||||
|
||||
protected static final Set<String> SAVINGS_ACCOUNT_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(idParamName,
|
||||
accountNoParamName, externalIdParamName, statusParamName, activatedOnDateParamName, staffIdParamName, clientIdParamName,
|
||||
"clientName", groupIdParamName, "groupName", "savingsProductId", "savingsProductName", "currency",
|
||||
@@ -57,7 +58,7 @@ public class SavingsApiSetConstants extends SavingsApiConstants {
|
||||
"interestCompoundingPeriodTypeOptions", "interestPostingPeriodTypeOptions", "interestCalculationTypeOptions",
|
||||
"interestCalculationDaysInYearTypeOptions", "lockinPeriodFrequencyTypeOptions", "withdrawalFeeTypeOptions", "withdrawalFee",
|
||||
"annualFee", onHoldFundsParamName, nominalAnnualInterestRateOverdraftParamName, minOverdraftForInterestCalculationParamName,
|
||||
datatables, savingsAmountOnHold, accountMappingForPaymentParamName));
|
||||
datatables, savingsAmountOnHold));
|
||||
|
||||
protected static final Set<String> SAVINGS_TRANSACTION_RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||
Arrays.asList(idParamName, "accountId", accountNoParamName, "currency", "amount", dateParamName, paymentDetailDataParamName,
|
||||
|
||||
+5
-12
@@ -52,7 +52,6 @@ import org.apache.fineract.accounting.producttoaccountmapping.service.ProductToG
|
||||
import org.apache.fineract.commands.domain.CommandWrapper;
|
||||
import org.apache.fineract.commands.service.CommandWrapperBuilder;
|
||||
import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService;
|
||||
import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
|
||||
import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
@@ -101,7 +100,6 @@ public class SavingsProductsApiResource {
|
||||
private final ChargeReadPlatformService chargeReadPlatformService;
|
||||
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||
private final TaxReadPlatformService taxReadPlatformService;
|
||||
private final ConfigurationDomainService configurationDomainService;
|
||||
|
||||
@Autowired
|
||||
public SavingsProductsApiResource(final SavingsProductReadPlatformService savingProductReadPlatformService,
|
||||
@@ -113,7 +111,7 @@ public class SavingsProductsApiResource {
|
||||
final AccountingDropdownReadPlatformService accountingDropdownReadPlatformService,
|
||||
final ProductToGLAccountMappingReadPlatformService accountMappingReadPlatformService,
|
||||
final ChargeReadPlatformService chargeReadPlatformService, PaymentTypeReadPlatformService paymentTypeReadPlatformService,
|
||||
final TaxReadPlatformService taxReadPlatformService, final ConfigurationDomainService configurationDomainService) {
|
||||
final TaxReadPlatformService taxReadPlatformService) {
|
||||
this.savingProductReadPlatformService = savingProductReadPlatformService;
|
||||
this.dropdownReadPlatformService = dropdownReadPlatformService;
|
||||
this.currencyReadPlatformService = currencyReadPlatformService;
|
||||
@@ -126,7 +124,6 @@ public class SavingsProductsApiResource {
|
||||
this.chargeReadPlatformService = chargeReadPlatformService;
|
||||
this.paymentTypeReadPlatformService = paymentTypeReadPlatformService;
|
||||
this.taxReadPlatformService = taxReadPlatformService;
|
||||
this.configurationDomainService = configurationDomainService;
|
||||
}
|
||||
|
||||
@POST
|
||||
@@ -135,7 +132,7 @@ public class SavingsProductsApiResource {
|
||||
@Operation(summary = "Create a Savings Product", description = "Creates a Savings Product\n\n"
|
||||
+ "Mandatory Fields: name, shortName, description, currencyCode, digitsAfterDecimal,inMultiplesOf, nominalAnnualInterestRate, interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType,accountingRule\n\n"
|
||||
+ "Mandatory Fields for Cash based accounting (accountingRule = 2): savingsReferenceAccountId, savingsControlAccountId, interestOnSavingsAccountId, incomeFromFeeAccountId, transfersInSuspenseAccountId, incomeFromPenaltyAccountId\n\n"
|
||||
+ "Optional Fields: minRequiredOpeningBalance, lockinPeriodFrequency, lockinPeriodFrequencyType, withdrawalFeeForTransfers, paymentChannelToFundSourceMappings, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, charges, allowOverdraft, overdraftLimit, minBalanceForInterestCalculation,withHoldTax,taxGroupId,accountMapping")
|
||||
+ "Optional Fields: minRequiredOpeningBalance, lockinPeriodFrequency, lockinPeriodFrequencyType, withdrawalFeeForTransfers, paymentChannelToFundSourceMappings, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, charges, allowOverdraft, overdraftLimit, minBalanceForInterestCalculation,withHoldTax,taxGroupId")
|
||||
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.PostSavingsProductsRequest.class)))
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.PostSavingsProductsResponse.class))) })
|
||||
@@ -232,8 +229,7 @@ public class SavingsProductsApiResource {
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Retrieve Savings Product Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
|
||||
+ "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "Account Mapping:\n" + "\n"
|
||||
+ "savingsproducts/template")
|
||||
+ "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "savingsproducts/template")
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.GetSavingsProductsTemplateResponse.class))) })
|
||||
public String retrieveTemplate(@Context final UriInfo uriInfo) {
|
||||
@@ -292,8 +288,6 @@ public class SavingsProductsApiResource {
|
||||
final Map<String, List<GLAccountData>> accountingMappingOptions = this.accountingDropdownReadPlatformService
|
||||
.retrieveAccountMappingOptionsForSavingsProducts();
|
||||
|
||||
final String accountMappingForPayment = configurationDomainService.getAccountMappingForPaymentType();
|
||||
|
||||
// charges
|
||||
final boolean feeChargesOnly = false;
|
||||
Collection<ChargeData> chargeOptions = this.chargeReadPlatformService.retrieveSavingsProductApplicableCharges(feeChargesOnly);
|
||||
@@ -307,14 +301,13 @@ public class SavingsProductsApiResource {
|
||||
savingsProductToReturn = SavingsProductData.withTemplate(savingsProduct, currencyOptions, interestCompoundingPeriodTypeOptions,
|
||||
interestPostingPeriodTypeOptions, interestCalculationTypeOptions, interestCalculationDaysInYearTypeOptions,
|
||||
lockinPeriodFrequencyTypeOptions, withdrawalFeeTypeOptions, paymentTypeOptions, accountingRuleOptions,
|
||||
accountingMappingOptions, chargeOptions, penaltyOptions, taxGroupOptions, accountMappingForPayment);
|
||||
accountingMappingOptions, chargeOptions, penaltyOptions, taxGroupOptions);
|
||||
} else {
|
||||
savingsProductToReturn = SavingsProductData.template(currency, interestCompoundingPeriodType, interestPostingPeriodType,
|
||||
interestCalculationType, interestCalculationDaysInYearType, accountingRule, currencyOptions,
|
||||
interestCompoundingPeriodTypeOptions, interestPostingPeriodTypeOptions, interestCalculationTypeOptions,
|
||||
interestCalculationDaysInYearTypeOptions, lockinPeriodFrequencyTypeOptions, withdrawalFeeTypeOptions,
|
||||
paymentTypeOptions, accountingRuleOptions, accountingMappingOptions, chargeOptions, penaltyOptions, taxGroupOptions,
|
||||
accountMappingForPayment);
|
||||
paymentTypeOptions, accountingRuleOptions, accountingMappingOptions, chargeOptions, penaltyOptions, taxGroupOptions);
|
||||
}
|
||||
|
||||
return savingsProductToReturn;
|
||||
|
||||
-4
@@ -70,8 +70,6 @@ final class SavingsProductsApiResourceSwagger {
|
||||
@Schema(example = "1")
|
||||
public Integer accountingRule;
|
||||
public Set<PostSavingsCharges> charges;
|
||||
@Schema(example = "accountMappingForPayment")
|
||||
public String accountMappingForPayment;
|
||||
}
|
||||
|
||||
@Schema(description = "PostSavingsProductsResponse")
|
||||
@@ -727,8 +725,6 @@ final class SavingsProductsApiResourceSwagger {
|
||||
public Set<GetSavingsProductsTemplateAccountingRule> accountingRuleOptions;
|
||||
public GetSavingsProductsAccountingMappingOptions accountingMappingOptions;
|
||||
public Set<GetSavingsProductsChargeOptions> chargeOptions;
|
||||
public GetSavingsProductsResponse.GetSavingsCurrency accountMapping;
|
||||
|
||||
}
|
||||
|
||||
@Schema(description = "DeleteSavingsProductsProductIdResponse")
|
||||
|
||||
+9
-16
@@ -62,7 +62,6 @@ public final class SavingsProductData implements Serializable {
|
||||
private final boolean withHoldTax;
|
||||
private final TaxGroupData taxGroup;
|
||||
private String depositAccountType = null;
|
||||
private final String accountMappingForPayment;
|
||||
|
||||
// accounting
|
||||
private final EnumOptionData accountingRule;
|
||||
@@ -103,8 +102,7 @@ public final class SavingsProductData implements Serializable {
|
||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
||||
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
||||
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
||||
final Collection<ChargeData> penaltyOptions, final Collection<TaxGroupData> taxGroupOptions,
|
||||
final String accountMappingForPayment) {
|
||||
final Collection<ChargeData> penaltyOptions, final Collection<TaxGroupData> taxGroupOptions) {
|
||||
|
||||
final Long id = null;
|
||||
final String name = null;
|
||||
@@ -143,7 +141,7 @@ public final class SavingsProductData implements Serializable {
|
||||
penaltyOptions, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, allowOverdraft, overdraftLimit,
|
||||
minRequiredBalance, enforceMinRequiredBalance, minBalanceForInterestCalculation, nominalAnnualInterestRateOverdraft,
|
||||
minOverdraftForInterestCalculation, withHoldTax, taxGroup, taxGroupOptions, isDormancyTrackingActive, daysToInactive,
|
||||
daysToDormancy, daysToEscheat, accountMappingForPayment);
|
||||
daysToDormancy, daysToEscheat);
|
||||
}
|
||||
|
||||
public static SavingsProductData withCharges(final SavingsProductData product, final Collection<ChargeData> charges) {
|
||||
@@ -160,7 +158,7 @@ public final class SavingsProductData implements Serializable {
|
||||
product.minRequiredBalance, product.enforceMinRequiredBalance, product.minBalanceForInterestCalculation,
|
||||
product.nominalAnnualInterestRateOverdraft, product.minOverdraftForInterestCalculation, product.withHoldTax,
|
||||
product.taxGroup, product.taxGroupOptions, product.isDormancyTrackingActive, product.daysToInactive, product.daysToDormancy,
|
||||
product.daysToEscheat, product.accountMappingForPayment);
|
||||
product.daysToEscheat);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -169,7 +167,6 @@ public final class SavingsProductData implements Serializable {
|
||||
*
|
||||
* @param taxGroupOptions
|
||||
* TODO
|
||||
* @param accountMapping
|
||||
*/
|
||||
public static SavingsProductData withTemplate(final SavingsProductData existingProduct, final Collection<CurrencyData> currencyOptions,
|
||||
final Collection<EnumOptionData> interestCompoundingPeriodTypeOptions,
|
||||
@@ -179,7 +176,7 @@ public final class SavingsProductData implements Serializable {
|
||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
||||
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
||||
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
||||
final Collection<ChargeData> penaltyOptions, Collection<TaxGroupData> taxGroupOptions, final String accountMappingForPayment) {
|
||||
final Collection<ChargeData> penaltyOptions, Collection<TaxGroupData> taxGroupOptions) {
|
||||
|
||||
return new SavingsProductData(existingProduct.id, existingProduct.name, existingProduct.shortName, existingProduct.description,
|
||||
existingProduct.currency, existingProduct.nominalAnnualInterestRate, existingProduct.interestCompoundingPeriodType,
|
||||
@@ -195,7 +192,7 @@ public final class SavingsProductData implements Serializable {
|
||||
existingProduct.minBalanceForInterestCalculation, existingProduct.nominalAnnualInterestRateOverdraft,
|
||||
existingProduct.minOverdraftForInterestCalculation, existingProduct.withHoldTax, existingProduct.taxGroup, taxGroupOptions,
|
||||
existingProduct.isDormancyTrackingActive, existingProduct.daysToInactive, existingProduct.daysToDormancy,
|
||||
existingProduct.daysToEscheat, existingProduct.accountMappingForPayment);
|
||||
existingProduct.daysToEscheat);
|
||||
}
|
||||
|
||||
public static SavingsProductData withAccountingDetails(final SavingsProductData existingProduct,
|
||||
@@ -215,7 +212,6 @@ public final class SavingsProductData implements Serializable {
|
||||
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
||||
final Collection<ChargeData> chargeOptions = null;
|
||||
final Collection<ChargeData> penaltyOptions = null;
|
||||
final String accountMappingForPayment = null;
|
||||
|
||||
return new SavingsProductData(existingProduct.id, existingProduct.name, existingProduct.shortName, existingProduct.description,
|
||||
existingProduct.currency, existingProduct.nominalAnnualInterestRate, existingProduct.interestCompoundingPeriodType,
|
||||
@@ -231,7 +227,7 @@ public final class SavingsProductData implements Serializable {
|
||||
existingProduct.minBalanceForInterestCalculation, existingProduct.nominalAnnualInterestRateOverdraft,
|
||||
existingProduct.minOverdraftForInterestCalculation, existingProduct.withHoldTax, existingProduct.taxGroup,
|
||||
existingProduct.taxGroupOptions, existingProduct.isDormancyTrackingActive, existingProduct.daysToInactive,
|
||||
existingProduct.daysToDormancy, existingProduct.daysToEscheat, existingProduct.accountMappingForPayment);
|
||||
existingProduct.daysToDormancy, existingProduct.daysToEscheat);
|
||||
}
|
||||
|
||||
public static SavingsProductData instance(final Long id, final String name, final String shortName, final String description,
|
||||
@@ -264,7 +260,6 @@ public final class SavingsProductData implements Serializable {
|
||||
final Collection<ChargeToGLAccountMapper> feeToIncomeAccountMappings = null;
|
||||
final Collection<ChargeToGLAccountMapper> penaltyToIncomeAccountMappings = null;
|
||||
final Collection<TaxGroupData> taxGroupOptions = null;
|
||||
final String accountMappingForPayment = null;
|
||||
|
||||
return new SavingsProductData(id, name, shortName, description, currency, nominalAnnualInterestRate, interestCompoundingPeriodType,
|
||||
interestPostingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minRequiredOpeningBalance,
|
||||
@@ -275,7 +270,7 @@ public final class SavingsProductData implements Serializable {
|
||||
penaltyOptions, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, allowOverdraft, overdraftLimit,
|
||||
minRequiredBalance, enforceMinRequiredBalance, minBalanceForInterestCalculation, nominalAnnualInterestRateOverdraft,
|
||||
minOverdraftForInterestCalculation, withHoldTax, taxGroup, taxGroupOptions, isDormancyTrackingActive, daysToInactive,
|
||||
daysToDormancy, daysToEscheat, accountMappingForPayment);
|
||||
daysToDormancy, daysToEscheat);
|
||||
}
|
||||
|
||||
public static SavingsProductData lookup(final Long id, final String name) {
|
||||
@@ -325,7 +320,6 @@ public final class SavingsProductData implements Serializable {
|
||||
final Long daysToInactive = null;
|
||||
final Long daysToDormancy = null;
|
||||
final Long daysToEscheat = null;
|
||||
final String accountMappingForPayment = null;
|
||||
|
||||
return new SavingsProductData(id, name, shortName, description, currency, nominalAnnualInterestRate, interestCompoundingPeriodType,
|
||||
interestPostingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minRequiredOpeningBalance,
|
||||
@@ -336,7 +330,7 @@ public final class SavingsProductData implements Serializable {
|
||||
penaltyOptions, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, allowOverdraft, overdraftLimit,
|
||||
minRequiredBalance, enforceMinRequiredBalance, minBalanceForInterestCalculation, nominalAnnualInterestRateOverdraft,
|
||||
minOverdraftForInterestCalculation, withHoldTax, taxGroup, taxGroupOptions, isDormancyTrackingActive, daysToInactive,
|
||||
daysToDormancy, daysToEscheat, accountMappingForPayment);
|
||||
daysToDormancy, daysToEscheat);
|
||||
}
|
||||
|
||||
private SavingsProductData(final Long id, final String name, final String shortName, final String description,
|
||||
@@ -360,7 +354,7 @@ public final class SavingsProductData implements Serializable {
|
||||
final BigDecimal minBalanceForInterestCalculation, final BigDecimal nominalAnnualInterestRateOverdraft,
|
||||
final BigDecimal minOverdraftForInterestCalculation, final boolean withHoldTax, final TaxGroupData taxGroup,
|
||||
final Collection<TaxGroupData> taxGroupOptions, final Boolean isDormancyTrackingActive, final Long daysToInactive,
|
||||
final Long daysToDormancy, final Long daysToEscheat, final String accountMappingForPayment) {
|
||||
final Long daysToDormancy, final Long daysToEscheat) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.shortName = shortName;
|
||||
@@ -417,7 +411,6 @@ public final class SavingsProductData implements Serializable {
|
||||
this.daysToInactive = daysToInactive;
|
||||
this.daysToDormancy = daysToDormancy;
|
||||
this.daysToEscheat = daysToEscheat;
|
||||
this.accountMappingForPayment = accountMappingForPayment;
|
||||
}
|
||||
|
||||
public boolean hasAccountingEnabled() {
|
||||
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.'=.
|
||||
--
|
||||
|
||||
ALTER TABLE `c_configuration`
|
||||
ADD COLUMN `string_value` VARCHAR(100) NULL DEFAULT NULL AFTER `date_value`;
|
||||
|
||||
insert into c_configuration(name, string_value, enabled, description) values('account-mapping-for-payment-type', 'Asset', '1', 'Asset: default for asset, Use comma seperated values for Liability, Asset and Expense accounts');
|
||||
|
||||
insert into c_configuration(name, string_value, enabled, description) values('account-mapping-for-charge', 'Income', '1', 'Income: default for Income, Use comma seperated values for Income, Liability and Expense accounts');
|
||||
Reference in New Issue
Block a user