Merge pull request #1268 from bharathc27/test1
guaranterdomainserviceissue
This commit is contained in:
+13
-11
@@ -378,21 +378,23 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService {
|
|||||||
BigDecimal amountForRelease = loanTransaction.getPrincipalPortion();
|
BigDecimal amountForRelease = loanTransaction.getPrincipalPortion();
|
||||||
BigDecimal totalGuaranteeAmount = loan.getGuaranteeAmount();
|
BigDecimal totalGuaranteeAmount = loan.getGuaranteeAmount();
|
||||||
BigDecimal principal = loan.getPrincpal().getAmount();
|
BigDecimal principal = loan.getPrincpal().getAmount();
|
||||||
|
if((amountForRelease!=null)&&(totalGuaranteeAmount!=null))
|
||||||
|
{
|
||||||
|
amountForRelease = amountForRelease.multiply(totalGuaranteeAmount).divide(principal,this.roundingMode);
|
||||||
|
List<DepositAccountOnHoldTransaction> accountOnHoldTransactions = new ArrayList<>();
|
||||||
|
|
||||||
amountForRelease = amountForRelease.multiply(totalGuaranteeAmount).divide(principal);
|
BigDecimal amountLeft = calculateAndRelaseGuarantorFunds(externalGuarantorList, guarantorGuarantee, amountForRelease,
|
||||||
List<DepositAccountOnHoldTransaction> accountOnHoldTransactions = new ArrayList<>();
|
|
||||||
|
|
||||||
BigDecimal amountLeft = calculateAndRelaseGuarantorFunds(externalGuarantorList, guarantorGuarantee, amountForRelease,
|
|
||||||
loanTransaction, accountOnHoldTransactions);
|
loanTransaction, accountOnHoldTransactions);
|
||||||
|
|
||||||
if (amountLeft.compareTo(BigDecimal.ZERO) == 1) {
|
if (amountLeft.compareTo(BigDecimal.ZERO) == 1) {
|
||||||
calculateAndRelaseGuarantorFunds(selfGuarantorList, selfGuarantee, amountLeft, loanTransaction, accountOnHoldTransactions);
|
calculateAndRelaseGuarantorFunds(selfGuarantorList, selfGuarantee, amountLeft, loanTransaction, accountOnHoldTransactions);
|
||||||
externalGuarantorList.addAll(selfGuarantorList);
|
externalGuarantorList.addAll(selfGuarantorList);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!externalGuarantorList.isEmpty()) {
|
if (!externalGuarantorList.isEmpty()) {
|
||||||
this.depositAccountOnHoldTransactionRepository.save(accountOnHoldTransactions);
|
this.depositAccountOnHoldTransactionRepository.save(accountOnHoldTransactions);
|
||||||
this.guarantorFundingRepository.save(externalGuarantorList);
|
this.guarantorFundingRepository.save(externalGuarantorList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user