removing warnings
This commit is contained in:
+2
-2
@@ -112,8 +112,8 @@ public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements Acco
|
||||
// get the GL Accounts or tags to Debit and Credit
|
||||
final String[] debitTags = command.arrayValueOfParameterNamed(AccountingRuleJsonInputParams.DEBIT_ACCOUNT_TAGS.getValue());
|
||||
final String[] creditTags = command.arrayValueOfParameterNamed(AccountingRuleJsonInputParams.CREDIT_ACCOUNT_TAGS.getValue());
|
||||
final Set<String> incomingDebitTags = debitTags == null ? new HashSet<String>() : new HashSet<>(Arrays.asList(debitTags));
|
||||
final Set<String> incomingCreditTags = creditTags == null ? new HashSet<String>() : new HashSet<>(Arrays.asList(creditTags));
|
||||
final Set<String> incomingDebitTags = debitTags == null ? new HashSet<>() : new HashSet<>(Arrays.asList(debitTags));
|
||||
final Set<String> incomingCreditTags = creditTags == null ? new HashSet<>() : new HashSet<>(Arrays.asList(creditTags));
|
||||
final Long accountToDebitId = command.longValueOfParameterNamed(AccountingRuleJsonInputParams.ACCOUNT_TO_DEBIT.getValue());
|
||||
final Long accountToCreditId = command.longValueOfParameterNamed(AccountingRuleJsonInputParams.ACCOUNT_TO_CREDIT.getValue());
|
||||
|
||||
|
||||
-1
@@ -7,7 +7,6 @@ package org.mifosplatform.portfolio.client.handler;
|
||||
|
||||
import org.mifosplatform.commands.annotation.CommandType;
|
||||
import org.mifosplatform.commands.handler.NewCommandSourceHandler;
|
||||
import org.mifosplatform.commands.provider.CommandHandlerProvider;
|
||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.mifosplatform.portfolio.client.service.ClientWritePlatformService;
|
||||
|
||||
-1
@@ -35,7 +35,6 @@ import org.springframework.data.jpa.domain.AbstractPersistable;
|
||||
@Table(name = "m_loan_recalculation_details")
|
||||
public class LoanInterestRecalculationDetails extends AbstractPersistable<Long> {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@OneToOne
|
||||
@JoinColumn(name = "loan_id", nullable = false)
|
||||
private Loan loan;
|
||||
|
||||
+2
-3
@@ -9,9 +9,8 @@ import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRul
|
||||
|
||||
public class LoanMultiDisbursementException extends AbstractPlatformDomainRuleException {
|
||||
|
||||
public LoanMultiDisbursementException(final String entity, final String defaultUserMessage,
|
||||
final Object... defaultUserMessageArgs) {
|
||||
super("error.msg." + defaultUserMessage,defaultUserMessage);
|
||||
public LoanMultiDisbursementException(final String defaultUserMessage, final Object... defaultUserMessageArgs) {
|
||||
super("error.msg." + defaultUserMessage, defaultUserMessage, defaultUserMessageArgs);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-1
@@ -460,7 +460,6 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche
|
||||
boolean isHolidayEnabled = false;
|
||||
WorkingDays workingDays = null;
|
||||
LocalDate recalculateFrom = null;
|
||||
LocalDate lastTransactionDate = null;
|
||||
Long overdurPenaltyWaitPeriod = null;
|
||||
if (loan.repaymentScheduleDetail().isInterestRecalculationEnabled()) {
|
||||
restCalendarInstance = calendarInstanceRepository.findCalendarInstaneByEntityId(
|
||||
|
||||
+14
-14
@@ -2607,21 +2607,21 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
|
||||
}
|
||||
|
||||
private void validateForAddAndDeleteTranche(final Loan loan){
|
||||
|
||||
private void validateForAddAndDeleteTranche(final Loan loan) {
|
||||
|
||||
BigDecimal totalDisbursedAmount = BigDecimal.ZERO;
|
||||
Collection<LoanDisbursementDetails> loanDisburseDetails = loan.getDisbursementDetails();
|
||||
for (LoanDisbursementDetails disbursementDetails : loanDisburseDetails) {
|
||||
if(disbursementDetails.actualDisbursementDate() != null){
|
||||
if (disbursementDetails.actualDisbursementDate() != null) {
|
||||
totalDisbursedAmount = totalDisbursedAmount.add(disbursementDetails.principal());
|
||||
}
|
||||
}
|
||||
if(totalDisbursedAmount.compareTo(loan.getApprovedPrincipal()) == 0){
|
||||
if (totalDisbursedAmount.compareTo(loan.getApprovedPrincipal()) == 0) {
|
||||
final String errorMessage = "loan.disbursement.cannot.be.a.edited";
|
||||
throw new LoanMultiDisbursementException(LoanApiConstants.disbursementDataParameterName, errorMessage);
|
||||
}
|
||||
throw new LoanMultiDisbursementException(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public CommandProcessingResult addAndDeleteLoanDisburseDetails(Long loanId, JsonCommand command) {
|
||||
@@ -2630,17 +2630,17 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
checkClientOrGroupActive(loan);
|
||||
final Map<String, Object> actualChanges = new LinkedHashMap<>();
|
||||
LocalDate expectedDisbursementDate = loan.getExpectedDisbursedOnLocalDate();
|
||||
if(!loan.loanProduct().isMultiDisburseLoan()){
|
||||
if (!loan.loanProduct().isMultiDisburseLoan()) {
|
||||
final String errorMessage = "loan.product.does.not.support.multiple.disbursals";
|
||||
throw new LoanMultiDisbursementException(LoanApiConstants.disbursementDataParameterName, errorMessage);
|
||||
throw new LoanMultiDisbursementException(errorMessage);
|
||||
}
|
||||
if(loan.isSubmittedAndPendingApproval() || loan.isClosed() || loan.isClosedWrittenOff() || loan.status().isClosedObligationsMet() ||
|
||||
loan.status().isOverpaid()){
|
||||
if (loan.isSubmittedAndPendingApproval() || loan.isClosed() || loan.isClosedWrittenOff() || loan.status().isClosedObligationsMet()
|
||||
|| loan.status().isOverpaid()) {
|
||||
final String errorMessage = "cannot.modify.tranches.if.loan.is.pendingapproval.closed.overpaid.writtenoff";
|
||||
throw new LoanMultiDisbursementException(LoanApiConstants.disbursementDataParameterName, errorMessage);
|
||||
throw new LoanMultiDisbursementException(errorMessage);
|
||||
}
|
||||
validateMultiDisbursementData(command, expectedDisbursementDate);
|
||||
|
||||
|
||||
this.validateForAddAndDeleteTranche(loan);
|
||||
|
||||
loan.updateDisbursementDetails(command, actualChanges);
|
||||
@@ -2704,7 +2704,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
Collection<LoanDisbursementDetails> loanDisburseDetails = loan.getDisbursementDetails();
|
||||
BigDecimal setAmount = BigDecimal.ZERO;
|
||||
for (LoanDisbursementDetails details : loanDisburseDetails) {
|
||||
if(details.actualDisbursementDate() != null){
|
||||
if (details.actualDisbursementDate() != null) {
|
||||
setAmount = setAmount.add(details.principal());
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -31,7 +31,6 @@ import org.springframework.data.jpa.domain.AbstractPersistable;
|
||||
@Table(name = "m_product_loan_recalculation_details")
|
||||
public class LoanProductInterestRecalculationDetails extends AbstractPersistable<Long> {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@OneToOne
|
||||
@JoinColumn(name = "product_id", nullable = false)
|
||||
private LoanProduct loanProduct;
|
||||
|
||||
-3
@@ -5,10 +5,7 @@
|
||||
*/
|
||||
package org.mifosplatform.portfolio.paymenttype.api;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.DELETE;
|
||||
|
||||
+1
-1
@@ -272,7 +272,7 @@ public class DepositAccountData {
|
||||
}
|
||||
|
||||
public Collection<SavingsAccountChargeData> charges() {
|
||||
return (this.charges == null) ? new HashSet<SavingsAccountChargeData>() : this.charges;
|
||||
return (this.charges == null) ? new HashSet<>() : this.charges;
|
||||
}
|
||||
|
||||
public EnumOptionData depositType() {
|
||||
|
||||
+1
-1
@@ -469,6 +469,6 @@ public class SavingsAccountData {
|
||||
}
|
||||
|
||||
public Collection<SavingsAccountChargeData> charges() {
|
||||
return (this.charges == null) ? new HashSet<SavingsAccountChargeData>() : this.charges;
|
||||
return (this.charges == null) ? new HashSet<>() : this.charges;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2309,7 +2309,7 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
||||
}
|
||||
|
||||
public Set<SavingsAccountCharge> charges() {
|
||||
return (this.charges == null) ? new HashSet<SavingsAccountCharge>() : this.charges;
|
||||
return (this.charges == null) ? new HashSet<>() : this.charges;
|
||||
}
|
||||
|
||||
public void validateAccountValuesWithProduct() {
|
||||
|
||||
Reference in New Issue
Block a user