Skip to content

Commit

Permalink
Bug/FBR-488: Approve/Reject Loan Request Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Julius Peter Oketayot committed Dec 8, 2023
1 parent 479dbf0 commit 4595180
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
19 changes: 17 additions & 2 deletions app/scripts/controllers/loanAccount/EditLoanAccAppController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -27,6 +26,23 @@
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;
}
}
if(!matchingExists){
scope.prequalificationOptions.push(scope.loanaccountinfo.prequalificationData);
}
}
});
}

if (data.group) {
Expand All @@ -42,7 +58,6 @@

if (scope.clientId && scope.groupId) {
scope.templateType = 'jlg';
scope.isIndividualJlgLoanAccount = true;
}
else if (scope.groupId) {
scope.templateType = 'group';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
10 changes: 5 additions & 5 deletions app/views/loans/editloanaccount.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<td class="width14" ng-hide="isIndividualJlgLoanAccount">
<label>{{ 'label.anchor.prequalifications' | translate }}<span class="required">*</span>:&nbsp;</label>
</td>
<td class="width36 paddedbottom10" ng-hide="isIndividualJlgLoanAccount">
<select id="prequailificationId" ng-model="prequailificationId" class="form-control width170px"
ng-options="prequalification.id as prequalification.groupName for prequalification in prequalificationOptions"
value="{{prequalification.id}}" ng-change="prequalificationChange(prequailificationId)">
<td class="width36 paddedbottom10">
<select id="prequalificationId" ng-model="formData.prequalificationId" class="form-control width170px"
ng-options="prequalification.id as prequalification.prequalificationNumber + ' (' + prequalification.productName + ')' for prequalification in prequalificationOptions"
value="{{prequalification.id}}" ng-change="prequalificationChange(formData.prequalificationId)">
<option style="display:none" value="">{{'label.input.select.prequalification' | translate}}</option>
</select>
</td>
Expand Down Expand Up @@ -166,7 +166,7 @@ <h3>{{ 'label.heading.cupolinkage' | translate}}</h3>
class="required">*</span>:</label></td>
<td class="width31 paddedbottom10">
<input type="text" class="form-control" id="principal" name="principal" ng-model="formData.principal"
number-format required late-Validate/>&nbsp;{{loanaccountinfo.currency.displaySymbol}}
number-format required ng-disabled="true" late-Validate/>&nbsp;{{loanaccountinfo.currency.displaySymbol}}
<form-validate valattributeform="editloanaccountform" valattribute="principal"/>
</td>
<td class="width14"><label>{{ 'label.input.loanterm' | translate }}&nbsp;<span class="required">*</span>:</label>
Expand Down
12 changes: 6 additions & 6 deletions app/views/loans/newloanaccount.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
<hr>
<table class="" style="border-spacing: 10px; border-collapse: separate">
<tr>
<td class="width14" ng-hide="isIndividualJlgLoanAccount">
<td class="width14">
<label>{{'label.anchor.prequalifications' | translate }}
<span class="required">*</span>:&nbsp;
</label>
<i class="fa fa-question-circle" uib-tooltip="{{'label.tooltip.prequalification' | translate}}"></i>
</td>
<td class="width36 paddedbottom20" ng-hide="isIndividualJlgLoanAccount">
<select id="prequalificationId" ng-model="prequalificationId" ng-options="prequalification.id as prequalification.prequalificationNumber for prequalification in prequalificationOptions"
value="{{prequalification.id}}" ng-change="prequalificationChange(prequalificationId)" class="form-control width170px">
<td class="width36 paddedbottom20">
<select id="prequalificationId" ng-model="formData.prequalificationId" ng-options="prequalification.id as prequalification.prequalificationNumber + ' (' + prequalification.productName + ')' for prequalification in prequalificationOptions"
value="{{prequalification.id}}" ng-change="prequalificationChange(formData.prequalificationId)" class="form-control width170px">
<option style="display:none" value="">{{'label.input.select.prequalification' | translate}}
</option>
</select>
Expand All @@ -42,7 +42,7 @@
<td class="width36 paddedbottom20">
<select id="productId" ng-model="formData.productId" class="form-control width170px" ng-options="product.id as product.name for product in products"
value="{{product.id}}" ng-change="loanProductChange(formData.productId)" class="form-control width170px"
required="required" ng-disabled="!isIndividualJlgLoanAccount">
required="required" ng-disabled="true">
<option style="display:none" value="">{{'label.selectloanproduct' | translate}}
</option>
</select>
Expand Down Expand Up @@ -216,7 +216,7 @@ <h3>{{ 'label.heading.cupolinkage' | translate}}</h3>
</td>
<td class="width31 paddedbottom20">
<input type="text" class="form-control" id="principal" name="principal" ng-model="formData.principal" number-format required
late-Validate ng-disabled="!isIndividualJlgLoanAccount"/>&nbsp;{{loanaccountinfo.currency.displaySymbol}}
late-Validate ng-disabled="true"/>&nbsp;{{loanaccountinfo.currency.displaySymbol}}
<form-validate valattributeform="Terms" valattribute="principal" />
</td>
<td class="width14">
Expand Down

0 comments on commit 4595180

Please sign in to comment.