fixed error db migration and rd product edit error fixed
This commit is contained in:
+10525
-14674
File diff suppressed because one or more lines are too long
+4466
-1661
File diff suppressed because it is too large
Load Diff
+10
@@ -4,6 +4,11 @@
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">
|
||||
|
||||
<changeSet id="0278_add_is_mandatory_to_joint_holder" author="system">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<not>
|
||||
<columnExists tableName="m_current_account_joint_holder" columnName="is_mandatory"/>
|
||||
</not>
|
||||
</preConditions>
|
||||
<addColumn tableName="m_current_account_joint_holder">
|
||||
<column name="is_mandatory" type="boolean" defaultValueBoolean="false">
|
||||
<constraints nullable="false"/>
|
||||
@@ -12,6 +17,11 @@
|
||||
</changeSet>
|
||||
|
||||
<changeSet id="0278b_add_is_mandatory_to_savings_joint_holder" author="system">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<not>
|
||||
<columnExists tableName="m_savings_account_joint_holders" columnName="is_mandatory"/>
|
||||
</not>
|
||||
</preConditions>
|
||||
<addColumn tableName="m_savings_account_joint_holders">
|
||||
<column name="is_mandatory" type="boolean" defaultValueBoolean="false">
|
||||
<constraints nullable="false"/>
|
||||
|
||||
+24
@@ -46,6 +46,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
|
||||
@@ -265,6 +266,11 @@ public class InterestRateChart extends AbstractPersistableCustom<Long> {
|
||||
chartSlab.update(chartSlabsCommand, chartSlabsChanges, baseDataValidator, locale);
|
||||
}
|
||||
} else {
|
||||
final InterestRateChartSlab matchingChartSlab = this.findChartSlabByRanges(chartSlabsCommand, locale);
|
||||
if (matchingChartSlab != null) {
|
||||
matchingChartSlab.update(chartSlabsCommand, chartSlabsChanges, baseDataValidator, locale);
|
||||
continue;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: AA: Move this code to InterestRateChartSlabAssembler
|
||||
@@ -321,6 +327,24 @@ public class InterestRateChart extends AbstractPersistableCustom<Long> {
|
||||
return chartSlabs.remove(chartSlab);
|
||||
}
|
||||
|
||||
private InterestRateChartSlab findChartSlabByRanges(final JsonCommand chartSlabsCommand, final Locale locale) {
|
||||
final Integer fromPeriod = chartSlabsCommand.integerValueOfParameterNamed(fromPeriodParamName, locale);
|
||||
final Integer toPeriod = chartSlabsCommand.integerValueOfParameterNamed(toPeriodParamName, locale);
|
||||
final BigDecimal amountRangeFrom = chartSlabsCommand.bigDecimalValueOfParameterNamed(amountRangeFromParamName, locale);
|
||||
final BigDecimal amountRangeTo = chartSlabsCommand.bigDecimalValueOfParameterNamed(amountRangeToParamName, locale);
|
||||
|
||||
for (InterestRateChartSlab chartSlab : setOfChartSlabs()) {
|
||||
final InterestRateChartSlabFields slabFields = chartSlab.slabFields();
|
||||
if (Objects.equals(slabFields.fromPeriod(), fromPeriod) && Objects.equals(slabFields.toPeriod(), toPeriod)
|
||||
&& slabFields.isBigDecimalSame(slabFields.getAmountRangeFrom(), amountRangeFrom)
|
||||
&& slabFields.isBigDecimalSame(slabFields.getAmountRangeTo(), amountRangeTo)) {
|
||||
return chartSlab;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public LocalDate getFromDate() {
|
||||
return this.chartFields.getFromDate();
|
||||
}
|
||||
|
||||
+30
-4
@@ -19,6 +19,8 @@
|
||||
package org.apache.fineract.portfolio.savings.domain;
|
||||
|
||||
import static org.apache.fineract.portfolio.interestratechart.InterestRateChartApiConstants.deleteParamName;
|
||||
import static org.apache.fineract.portfolio.interestratechart.InterestRateChartApiConstants.endDateParamName;
|
||||
import static org.apache.fineract.portfolio.interestratechart.InterestRateChartApiConstants.fromDateParamName;
|
||||
import static org.apache.fineract.portfolio.interestratechart.InterestRateChartApiConstants.idParamName;
|
||||
import static org.apache.fineract.portfolio.savings.DepositsApiConstants.FIXED_DEPOSIT_PRODUCT_RESOURCE_NAME;
|
||||
import static org.apache.fineract.portfolio.savings.DepositsApiConstants.maxDepositTermParamName;
|
||||
@@ -45,6 +47,7 @@ import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import org.apache.fineract.accounting.common.AccountingRuleType;
|
||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||
@@ -215,10 +218,16 @@ public class FixedDepositProduct extends SavingsProduct {
|
||||
chart.update(chartCommand, chartsChanges, baseDataValidator, this.setOfCharts(), this.currency().getCode());
|
||||
}
|
||||
} else {
|
||||
// assemble chart
|
||||
final InterestRateChart newChart = this.chartAssembler.assembleFrom(chartElement, this.currency().getCode(),
|
||||
baseDataValidator);
|
||||
this.addChart(newChart);
|
||||
final InterestRateChart matchingChart = this.findChartByDates(chartCommand);
|
||||
if (matchingChart != null) {
|
||||
matchingChart.update(chartCommand, chartsChanges, baseDataValidator, this.setOfCharts(),
|
||||
this.currency().getCode());
|
||||
} else {
|
||||
// assemble chart
|
||||
final InterestRateChart newChart = this.chartAssembler.assembleFrom(chartElement, this.currency().getCode(),
|
||||
baseDataValidator);
|
||||
this.addChart(newChart);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -260,6 +269,23 @@ public class FixedDepositProduct extends SavingsProduct {
|
||||
return charts.remove(chart);
|
||||
}
|
||||
|
||||
private InterestRateChart findChartByDates(final JsonCommand chartCommand) {
|
||||
if (!chartCommand.parameterExists(fromDateParamName) || !chartCommand.parameterExists(endDateParamName)) {
|
||||
return this.charts != null && this.charts.size() == 1 ? this.charts.iterator().next() : null;
|
||||
}
|
||||
|
||||
final LocalDate fromDate = chartCommand.localDateValueOfParameterNamed(fromDateParamName);
|
||||
final LocalDate endDate = chartCommand.localDateValueOfParameterNamed(endDateParamName);
|
||||
|
||||
for (InterestRateChart chart : setOfCharts()) {
|
||||
if (Objects.equals(chart.getFromDate(), fromDate) && Objects.equals(chart.getEndDate(), endDate)) {
|
||||
return chart;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setHelpers(final InterestRateChartAssembler chartAssembler) {
|
||||
this.chartAssembler = chartAssembler;
|
||||
}
|
||||
|
||||
+26
@@ -71,6 +71,32 @@
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
|
||||
<changeSet author="fineract" id="2010b-add-nomination-facility-to-savings-account">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<not>
|
||||
<columnExists tableName="m_savings_account" columnName="nomination_facility"/>
|
||||
</not>
|
||||
</preConditions>
|
||||
<addColumn tableName="m_savings_account">
|
||||
<column name="nomination_facility" type="BOOLEAN" defaultValueBoolean="false">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
|
||||
<changeSet author="fineract" id="2010c-add-auto-debit-facility-to-savings-account">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<not>
|
||||
<columnExists tableName="m_savings_account" columnName="auto_debit_facility"/>
|
||||
</not>
|
||||
</preConditions>
|
||||
<addColumn tableName="m_savings_account">
|
||||
<column name="auto_debit_facility" type="BOOLEAN" defaultValueBoolean="false">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
|
||||
<!-- Facility config table for savings accounts -->
|
||||
<changeSet author="fineract" id="2010-create-savings-account-facility-config">
|
||||
<createTable tableName="m_savings_account_facility_config">
|
||||
|
||||
Reference in New Issue
Block a user