Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Sub GetApplicantPayoffAmount(ByVal lb As LendingDto.Applications.Liability)
- Dim tr As New Framework.Common.Tracer(String.Format("GetApplicantPayoffAmount-{0}", lb.AccountNumber))
- 'create service reference vars and set credentials
- Dim MonetaryEngine As New Monetary()
- With MonetaryEngine.Service.ClientCredentials.UserName
- .UserName = _HostUserName
- .Password = _HostPassword
- End With
- Dim SavingAccountEngine As New SavingAccount()
- With SavingAccountEngine.Service.ClientCredentials.UserName
- .UserName = _HostUserName
- .Password = _HostPassword
- End With
- Dim TransactionInfo As New MonetaryEngine.wsTransactionInfo
- Dim TransactionItemInfo As New MonetaryEngine.wsTransactionItemInfo
- Try
- 'get account id for refi to be paid off
- Dim PortSuffix() As String = lb.AccountNumber.Split("-")
- Dim AccountInfo As New SavingAccountEngine.wsAccountInfo
- AccountInfo = SavingAccountEngine.Service.findAccountByAccountPortSuffix(SavingAccountEngine.getWebContext, Integer.Parse(PortSuffix(0)), Integer.Parse(PortSuffix(1)))
- 'payoff refi
- tr.StopStartTask(String.Format("GetApplicantPayoffAmount-Call-getLoanPaymentDetails - {0}", AccountInfo.accountId))
- TransactionInfo = MonetaryEngine.Service.getLoanPaymentDetails(MonetaryEngine.getWebContext, AccountInfo.accountId, 0, BusinessDate)
- TransactionInfo.transactionItemInfos(0).loanPaymentComponent.paymentType = "PAYOFF"
- tr.StopStartTask(String.Format("GetApplicantPayoffAmount-Call-processLoanPayments - {0}", AccountInfo.accountId))
- TransactionItemInfo = MonetaryEngine.Service.processLoanPayments(MonetaryEngine.getWebContext, TransactionInfo.transactionItemInfos(0), BusinessDate, False)
- 'set payoff amount
- lb.PayoffAmount = TransactionItemInfo.loanPaymentComponent.paymentTypeAmount / 100
- tr.StopStartTask(String.Format("GetApplicantPayoffAmount-GotPayOff-{0}", AccountInfo.accountId))
- Common.SerializeObjectToFile(lb, "GetApplicantPayoffAmount-GotPayOff-" + lb.AccountNumber.ToString + "-" + lb.PayoffAmount.ToString)
- 'add the liability back
- _ApplicantLiabilities.Add(lb)
- Catch ex As Exception
- If Not ex.Message = "MONT0030" Then 'Acumen Specific Error - Loan Account not in Disbursed state for transaction
- Akcelerant.Core.Utility.LogError(ex)
- End If
- Finally
- 'Decrement the variable as the thread is complete
- If Interlocked.Decrement(_NumberOfThreadsNotYetCompleted) = 0 Then
- _ThreadDoneEvent.Set()
- End If
- tr.Dispose()
- End Try
- End Sub
Add Comment
Please, Sign In to add comment