Merge branch 'PR106' into develop
This commit is contained in:
+5
-1
@@ -225,7 +225,11 @@ public class SavingsAccountCharge extends AbstractPersistable<Long> {
|
|||||||
|
|
||||||
populateDerivedFields(transactionAmount, chargeAmount);
|
populateDerivedFields(transactionAmount, chargeAmount);
|
||||||
|
|
||||||
if (this.isWithdrawalFee()) {
|
if (this.isWithdrawalFee()
|
||||||
|
|| this.isOverdraftFee()
|
||||||
|
|| this.isSavingsActivation()
|
||||||
|
|| this.isSavingsClosure()
|
||||||
|
|| this.isSavingsNoActivity()) {
|
||||||
this.amountOutstanding = BigDecimal.ZERO;
|
this.amountOutstanding = BigDecimal.ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-2
@@ -45,6 +45,7 @@ import org.apache.fineract.portfolio.account.service.AccountAssociationsReadPlat
|
|||||||
import org.apache.fineract.portfolio.account.service.AccountTransfersReadPlatformService;
|
import org.apache.fineract.portfolio.account.service.AccountTransfersReadPlatformService;
|
||||||
import org.apache.fineract.portfolio.charge.domain.Charge;
|
import org.apache.fineract.portfolio.charge.domain.Charge;
|
||||||
import org.apache.fineract.portfolio.charge.domain.ChargeRepositoryWrapper;
|
import org.apache.fineract.portfolio.charge.domain.ChargeRepositoryWrapper;
|
||||||
|
import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
|
||||||
import org.apache.fineract.portfolio.client.domain.Client;
|
import org.apache.fineract.portfolio.client.domain.Client;
|
||||||
import org.apache.fineract.portfolio.client.exception.ClientNotActiveException;
|
import org.apache.fineract.portfolio.client.exception.ClientNotActiveException;
|
||||||
import org.apache.fineract.portfolio.group.domain.Group;
|
import org.apache.fineract.portfolio.group.domain.Group;
|
||||||
@@ -785,6 +786,17 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
final Long chargeDefinitionId = command.longValueOfParameterNamed(chargeIdParamName);
|
final Long chargeDefinitionId = command.longValueOfParameterNamed(chargeIdParamName);
|
||||||
final Charge chargeDefinition = this.chargeRepository.findOneWithNotFoundDetection(chargeDefinitionId);
|
final Charge chargeDefinition = this.chargeRepository.findOneWithNotFoundDetection(chargeDefinitionId);
|
||||||
|
|
||||||
|
Integer chargeTimeType = chargeDefinition.getChargeTimeType();
|
||||||
|
LocalDate dueAsOfDateParam = command.localDateValueOfParameterNamed(dueAsOfDateParamName);
|
||||||
|
if((chargeTimeType.equals(ChargeTimeType.WITHDRAWAL_FEE.getValue())
|
||||||
|
|| chargeTimeType.equals(ChargeTimeType.OVERDRAFT_FEE.getValue())
|
||||||
|
|| chargeTimeType.equals(ChargeTimeType.SAVINGS_ACTIVATION.getValue())
|
||||||
|
|| chargeTimeType.equals(ChargeTimeType.SAVINGS_NOACTIVITY_FEE.getValue())
|
||||||
|
|| chargeTimeType.equals(ChargeTimeType.SAVINGS_CLOSURE.getValue()))
|
||||||
|
&& dueAsOfDateParam != null){
|
||||||
|
baseDataValidator.reset().parameter(dueAsOfDateParamName).value(dueAsOfDateParam.toString(fmt))
|
||||||
|
.failWithCodeNoParameterAddedToErrorCode("charge.due.date.is.invalid.for." + ChargeTimeType.fromInt(chargeTimeType).getCode());
|
||||||
|
}
|
||||||
final SavingsAccountCharge savingsAccountCharge = SavingsAccountCharge.createNewFromJson(savingsAccount, chargeDefinition, command);
|
final SavingsAccountCharge savingsAccountCharge = SavingsAccountCharge.createNewFromJson(savingsAccount, chargeDefinition, command);
|
||||||
|
|
||||||
if (savingsAccountCharge.getDueLocalDate() != null) {
|
if (savingsAccountCharge.getDueLocalDate() != null) {
|
||||||
@@ -793,16 +805,15 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
&& this.holidayRepository.isHoliday(savingsAccount.officeId(), savingsAccountCharge.getDueLocalDate())) {
|
&& this.holidayRepository.isHoliday(savingsAccount.officeId(), savingsAccountCharge.getDueLocalDate())) {
|
||||||
baseDataValidator.reset().parameter(dueAsOfDateParamName).value(savingsAccountCharge.getDueLocalDate().toString(fmt))
|
baseDataValidator.reset().parameter(dueAsOfDateParamName).value(savingsAccountCharge.getDueLocalDate().toString(fmt))
|
||||||
.failWithCodeNoParameterAddedToErrorCode("charge.due.date.is.on.holiday");
|
.failWithCodeNoParameterAddedToErrorCode("charge.due.date.is.on.holiday");
|
||||||
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.configurationDomainService.allowTransactionsOnNonWorkingDayEnabled()
|
if (!this.configurationDomainService.allowTransactionsOnNonWorkingDayEnabled()
|
||||||
&& !this.workingDaysRepository.isWorkingDay(savingsAccountCharge.getDueLocalDate())) {
|
&& !this.workingDaysRepository.isWorkingDay(savingsAccountCharge.getDueLocalDate())) {
|
||||||
baseDataValidator.reset().parameter(dueAsOfDateParamName).value(savingsAccountCharge.getDueLocalDate().toString(fmt))
|
baseDataValidator.reset().parameter(dueAsOfDateParamName).value(savingsAccountCharge.getDueLocalDate().toString(fmt))
|
||||||
.failWithCodeNoParameterAddedToErrorCode("charge.due.date.is.a.nonworking.day");
|
.failWithCodeNoParameterAddedToErrorCode("charge.due.date.is.a.nonworking.day");
|
||||||
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
|
||||||
|
|
||||||
savingsAccount.addCharge(fmt, savingsAccountCharge, chargeDefinition);
|
savingsAccount.addCharge(fmt, savingsAccountCharge, chargeDefinition);
|
||||||
|
|
||||||
|
|||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
UPDATE `job`
|
||||||
|
SET `task_priority`=3, `scheduler_group`=1
|
||||||
|
WHERE `name`='Update Savings Dormant Accounts';
|
||||||
Reference in New Issue
Block a user