resolving compilation issue and bumping up sql patch number
This commit is contained in:
+24
-22
@@ -42,7 +42,6 @@ import org.mifosplatform.portfolio.calendar.domain.CalendarInstanceRepository;
|
||||
import org.mifosplatform.portfolio.loanaccount.data.HolidayDetailDTO;
|
||||
import org.mifosplatform.portfolio.loanaccount.data.LoanChargePaidByData;
|
||||
import org.mifosplatform.portfolio.loanaccount.data.ScheduleGeneratorDTO;
|
||||
import org.mifosplatform.portfolio.loanaccount.domain.ChangedTransactionDetail;
|
||||
import org.mifosplatform.portfolio.loanaccount.domain.DefaultLoanLifecycleStateMachine;
|
||||
import org.mifosplatform.portfolio.loanaccount.domain.Loan;
|
||||
import org.mifosplatform.portfolio.loanaccount.domain.LoanAccountDomainService;
|
||||
@@ -121,13 +120,10 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche
|
||||
HolidayRepositoryWrapper holidayRepository, WorkingDaysRepositoryWrapper workingDaysRepository,
|
||||
LoanRepaymentScheduleHistoryRepository loanRepaymentScheduleHistoryRepository,
|
||||
final LoanScheduleHistoryWritePlatformService loanScheduleHistoryWritePlatformService,
|
||||
final CalendarInstanceRepository calendarInstanceRepository,
|
||||
final LoanAccountDomainService loanAccountDomainService,
|
||||
final LoanChargeReadPlatformService loanChargeReadPlatformService,
|
||||
final LoanScheduleGeneratorFactory loanScheduleFactory,
|
||||
final CalendarInstanceRepository calendarInstanceRepository, final LoanAccountDomainService loanAccountDomainService,
|
||||
final LoanChargeReadPlatformService loanChargeReadPlatformService, final LoanScheduleGeneratorFactory loanScheduleFactory,
|
||||
final LoanTransactionRepository loanTransactionRepository,
|
||||
final JournalEntryWritePlatformService journalEntryWritePlatformService,
|
||||
final LoanRepository loanRepository,
|
||||
final JournalEntryWritePlatformService journalEntryWritePlatformService, final LoanRepository loanRepository,
|
||||
final LoanAssembler loanAssembler) {
|
||||
this.loanRepositoryWrapper = loanRepositoryWrapper;
|
||||
this.codeValueRepositoryWrapper = codeValueRepositoryWrapper;
|
||||
@@ -271,7 +267,7 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche
|
||||
|
||||
catch (final DataIntegrityViolationException dve) {
|
||||
// handle the data integrity violation
|
||||
handleDataIntegrityViolation(jsonCommand, dve);
|
||||
handleDataIntegrityViolation(dve);
|
||||
|
||||
// return an empty command processing result object
|
||||
return CommandProcessingResult.empty();
|
||||
@@ -359,8 +355,8 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche
|
||||
if (Money.of(currency, period.principalDue()).isZero() && Money.of(currency, period.interestDue()).isZero()
|
||||
&& repaymentScheduleInstallment.isNotFullyPaidOff()) {
|
||||
|
||||
if(repaymentScheduleInstallment.getPenaltyChargesOutstanding(currency).isGreaterThan(zeroAmount) ||
|
||||
repaymentScheduleInstallment.getFeeChargesOutstanding(currency).isGreaterThan(zeroAmount)) {
|
||||
if (repaymentScheduleInstallment.getPenaltyChargesOutstanding(currency).isGreaterThan(zeroAmount)
|
||||
|| repaymentScheduleInstallment.getFeeChargesOutstanding(currency).isGreaterThan(zeroAmount)) {
|
||||
|
||||
waiveLoanCharges.addAll(loan.getLoanCharges(periodDueDate));
|
||||
}
|
||||
@@ -395,7 +391,8 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche
|
||||
// update the status of the request
|
||||
loanRescheduleRequest.approve(appUser, approvedOnDate);
|
||||
|
||||
// update the derived fields of each loan repayments schedule instalments
|
||||
// update the derived fields of each loan repayments schedule
|
||||
// instalments
|
||||
for (final LoanRepaymentScheduleInstallment repaymentScheduleInstallment : repaymentScheduleInstallments) {
|
||||
repaymentScheduleInstallment.updateDerivedFields(currency, new LocalDate());
|
||||
}
|
||||
@@ -410,7 +407,7 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche
|
||||
|
||||
catch (final DataIntegrityViolationException dve) {
|
||||
// handle the data integrity violation
|
||||
handleDataIntegrityViolation(jsonCommand, dve);
|
||||
handleDataIntegrityViolation(dve);
|
||||
|
||||
// return an empty command processing result object
|
||||
return CommandProcessingResult.empty();
|
||||
@@ -420,11 +417,14 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche
|
||||
/**
|
||||
* waive all charges in the collection
|
||||
*
|
||||
* @param loan Loan object
|
||||
* @param loanCharges collection of LoanCharge objects
|
||||
* @param loan
|
||||
* Loan object
|
||||
* @param loanCharges
|
||||
* collection of LoanCharge objects
|
||||
* @return void
|
||||
**/
|
||||
private void waiveLoanCharges(Loan loan, Collection<LoanCharge> loanCharges) {
|
||||
AppUser currentUser = this.platformSecurityContext.authenticatedUser();
|
||||
this.loanAssembler.setHelpers(loan);
|
||||
|
||||
for (LoanCharge loanCharge : loanCharges) {
|
||||
@@ -454,8 +454,8 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche
|
||||
LocalDate lastTransactionDate = null;
|
||||
Long overdurPenaltyWaitPeriod = null;
|
||||
if (loan.repaymentScheduleDetail().isInterestRecalculationEnabled()) {
|
||||
restCalendarInstance = calendarInstanceRepository.findCalendarInstaneByEntityId(loan.loanInterestRecalculationDetailId(),
|
||||
CalendarEntityType.LOAN_RECALCULATION_DETAIL.getValue());
|
||||
restCalendarInstance = calendarInstanceRepository.findCalendarInstaneByEntityId(
|
||||
loan.loanInterestRecalculationDetailId(), CalendarEntityType.LOAN_RECALCULATION_DETAIL.getValue());
|
||||
|
||||
final MonetaryCurrency currency = loan.getCurrency();
|
||||
applicationCurrency = this.applicationCurrencyRepository.findOneWithNotFoundDetection(currency);
|
||||
@@ -465,15 +465,16 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche
|
||||
loan.getDisbursementDate(), loan, calendarInstance);
|
||||
|
||||
isHolidayEnabled = this.configurationDomainService.isRescheduleRepaymentsOnHolidaysEnabled();
|
||||
holidays = this.holidayRepository.findByOfficeIdAndGreaterThanDate(loan.getOfficeId(), loan.getDisbursementDate().toDate());
|
||||
holidays = this.holidayRepository.findByOfficeIdAndGreaterThanDate(loan.getOfficeId(), loan.getDisbursementDate()
|
||||
.toDate());
|
||||
workingDays = this.workingDaysRepository.findOne();
|
||||
overdurPenaltyWaitPeriod = this.configurationDomainService.retrievePenaltyWaitPeriod();
|
||||
}
|
||||
|
||||
HolidayDetailDTO holidayDetailDTO = new HolidayDetailDTO(isHolidayEnabled, holidays, workingDays);
|
||||
ScheduleGeneratorDTO scheduleGeneratorDTO = new ScheduleGeneratorDTO(loanScheduleFactory, applicationCurrency,
|
||||
calculatedRepaymentsStartingFromDate, holidayDetailDTO, restCalendarInstance, recalculateFrom, overdurPenaltyWaitPeriod,
|
||||
lastTransactionDate);
|
||||
calculatedRepaymentsStartingFromDate, holidayDetailDTO, restCalendarInstance, recalculateFrom,
|
||||
overdurPenaltyWaitPeriod, lastTransactionDate);
|
||||
|
||||
Money accruedCharge = Money.zero(loan.getCurrency());
|
||||
if (loan.isPeriodicAccrualAccountingEnabledOnLoanProduct()) {
|
||||
@@ -485,7 +486,8 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche
|
||||
}
|
||||
|
||||
final LoanTransaction loanTransaction = loan.waiveLoanCharge(loanCharge, defaultLoanLifecycleStateMachine(), changes,
|
||||
existingTransactionIds, existingReversedTransactionIds, loanInstallmentNumber, scheduleGeneratorDTO, accruedCharge);
|
||||
existingTransactionIds, existingReversedTransactionIds, loanInstallmentNumber, scheduleGeneratorDTO, accruedCharge,
|
||||
currentUser);
|
||||
|
||||
this.loanTransactionRepository.save(loanTransaction);
|
||||
|
||||
@@ -545,7 +547,7 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche
|
||||
|
||||
catch (final DataIntegrityViolationException dve) {
|
||||
// handle the data integrity violation
|
||||
handleDataIntegrityViolation(jsonCommand, dve);
|
||||
handleDataIntegrityViolation(dve);
|
||||
|
||||
// return an empty command processing result object
|
||||
return CommandProcessingResult.empty();
|
||||
@@ -562,7 +564,7 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche
|
||||
* data integrity violation exception
|
||||
* @return void
|
||||
**/
|
||||
private void handleDataIntegrityViolation(final JsonCommand jsonCommand, final DataIntegrityViolationException dve) {
|
||||
private void handleDataIntegrityViolation(final DataIntegrityViolationException dve) {
|
||||
|
||||
logger.error(dve.getMessage(), dve);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user