From 6108cae1487e434c00c004aa314991ad7c5ffae3 Mon Sep 17 00:00:00 2001 From: Julius Peter Oketayot Date: Fri, 8 Dec 2023 19:41:22 +0300 Subject: [PATCH] Bug/FBR-488: Approve/Reject Loan Request Fixes --- .../loanAccount/EditLoanAccAppController.js | 20 +++++++++++++++++-- .../loanAccount/NewLoanAccAppController.js | 1 - app/views/loans/editloanaccount.html | 8 ++++---- app/views/loans/newloanaccount.html | 12 +++++------ 4 files changed, 28 insertions(+), 13 deletions(-) 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 @@ - - diff --git a/app/views/loans/newloanaccount.html b/app/views/loans/newloanaccount.html index 2028cafa3d..c36d503ccd 100755 --- a/app/views/loans/newloanaccount.html +++ b/app/views/loans/newloanaccount.html @@ -20,15 +20,15 @@
- -
+ - + @@ -42,7 +42,7 @@ @@ -216,7 +216,7 @@

{{ 'label.heading.cupolinkage' | translate}}

 {{loanaccountinfo.currency.displaySymbol}} + late-Validate ng-disabled="true"/> {{loanaccountinfo.currency.displaySymbol}}