diff --git a/app/scripts/controllers/loanAccount/EditLoanAccAppController.js b/app/scripts/controllers/loanAccount/EditLoanAccAppController.js index 9ab7759960..afe365811e 100755 --- a/app/scripts/controllers/loanAccount/EditLoanAccAppController.js +++ b/app/scripts/controllers/loanAccount/EditLoanAccAppController.js @@ -10,7 +10,6 @@ scope.restrictDate = new Date(); scope.date = {}; scope.rateFlag = false; - scope.isIndividualJlgLoanAccount = false; resourceFactory.loanResource.get({loanId: routeParams.id, template: true, associations: 'charges,collateral,meeting,multiDisburseDetails',staffInSelectedOfficeOnly:true}, function (data) { scope.loanaccountinfo = data; @@ -27,6 +26,24 @@ scope.clientId = data.clientId; scope.clientName = data.clientName; scope.formData.clientId = scope.clientId; + resourceFactory.clientResource.get({clientId: scope.clientId}, function (clientData) { + scope.clientData = clientData; + scope.prequalificationOptions = clientData.clientPrequalifications; + if(scope.loanaccountinfo.prequalificationData && scope.loanaccountinfo.prequalificationData.id){ + scope.formData.prequalificationId = scope.loanaccountinfo.prequalificationData.id; + var addExisting = false; + var matchingExists = false + for(var i = 0; i < scope.prequalificationOptions.length; i++){ + if(scope.prequalificationOptions[i].id == scope.formData.prequalificationId){ + matchingExists = true; + } + } + console.log(matchingExists); + if(!matchingExists){ + scope.prequalificationOptions.push(scope.loanaccountinfo.prequalificationData); + } + } + }); } if (data.group) { @@ -42,7 +59,6 @@ if (scope.clientId && scope.groupId) { scope.templateType = 'jlg'; - scope.isIndividualJlgLoanAccount = true; } else if (scope.groupId) { scope.templateType = 'group'; diff --git a/app/scripts/controllers/loanAccount/NewLoanAccAppController.js b/app/scripts/controllers/loanAccount/NewLoanAccAppController.js index e41ad419ad..69994decda 100755 --- a/app/scripts/controllers/loanAccount/NewLoanAccAppController.js +++ b/app/scripts/controllers/loanAccount/NewLoanAccAppController.js @@ -3,7 +3,6 @@ NewLoanAccAppController: function (scope, routeParams, resourceFactory, location,$uibModal, dateFilter, uiConfigService, WizardHandler, translate) { scope.previewRepayment = false; scope.clientId = routeParams.clientId; - scope.isIndividualJlgLoanAccount = location.search().isIndividualJlgLoanAccount; scope.groupId = routeParams.groupId; scope.restrictDate = new Date(); scope.formData = {}; diff --git a/app/views/loans/editloanaccount.html b/app/views/loans/editloanaccount.html index 6a3787c4e6..5c413e8683 100755 --- a/app/views/loans/editloanaccount.html +++ b/app/views/loans/editloanaccount.html @@ -16,10 +16,10 @@