Skip to content

Commit

Permalink
1.0.21 prepare (#280)
Browse files Browse the repository at this point in the history
* Fbr 536 redesign guaratee (#276)

* Feature/FBR-536: Redesign of payment guarantees by checks

* Feature/FBR-536: Redesign of payment guarantees by checks

* FBR-545 Add Range and day in center description

---------

Co-authored-by: Faheem Ahmad <[email protected]>
Co-authored-by: Faheem Ahmad <[email protected]>
  • Loading branch information
3 people authored Jan 19, 2024
1 parent 403eeb4 commit 670b3f2
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 10 deletions.
5 changes: 4 additions & 1 deletion app/global-translations/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4943,7 +4943,7 @@
"label.button.void": "Void",
"label.button.view.cheque": "View Cheque",
"label.button.void.cheque": "Void Cheque",
"label.button.disburse.and.print.cheque": "Disburse & Print",
"label.button.disburse.and.print.cheque": "Print",
"label.button.print.cheque": "Print Cheque",
"label.button.reassign.cheque": "Reassign Cheque",
"label.button.void.authorize.cheque": "Authorize Voidance",
Expand Down Expand Up @@ -5313,5 +5313,8 @@
"bank.cheque.status.pending.issuance": "Pending Issuance",
"bank.cheque.status.pending.authorization.by.accounting": "Pending Authorization by Accounting",
"bank.cheque.status.ready.to.be.printed": "Ready to be printed",
"error.msg.cheque.guarantee.savings.account.not.found": "Guarantee savings account not found",
"error.msg.cheque.guarantee.amount.greater.than.available.savings.account.balance": "Guarantee amount is greater than savings account available balance",
"label.heading.centerRange": "Range and Day",
"----End---": "--End of file--- "
}
6 changes: 4 additions & 2 deletions app/global-translations/locale-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -4653,7 +4653,7 @@
"error.msg.committee.user.already.assigned": "El usuario `{{params[0].value}}` ya está asignado a un comité",
"confirmation.message.first.part.one": "¿Está seguro de que desea ",
"confirmation.message.first.part.two": " esta precalificación?",
"label.button.disburse.and.print.cheque": "Desembolsar e imprimir",
"label.button.disburse.and.print.cheque": "Imprimir",
"label.button.validate.blacklist": "validar lista negra",
"label.input.blacklist.status": "Lista negra",
"label.validate.hard.policy": "Validar Política Dura",
Expand All @@ -4668,7 +4668,6 @@
"label.input.select.prequalification": "Seleccionar Precalificación",
"error.msg.prequalification.member.not.selected.exception": "Seleccione al menos una miembro para aprobar el préstamo",
"error.msg.prequalification.submitted.loan.not.found.exception": "No se encontró ningún préstamo en estado enviado y pendiente de aprobación",
"label.heading.additionals": "Adicionales",
"label.heading.additional.property.name": "Nombre del campo",
"label.heading.additional.property.value": "Valor de campo",
"label.description.additional.ciclosCancelados": "Ciclos cancelados",
Expand Down Expand Up @@ -4940,5 +4939,8 @@
"bank.cheque.status.pending.issuance": "Pendiente de emisión",
"bank.cheque.status.pending.authorization.by.accounting": "Pendiente de Autorización por Contabilidad",
"bank.cheque.status.ready.to.be.printed": "Listo para impresión",
"error.msg.cheque.guarantee.savings.account.not.found": "Cuenta de ahorro de garantía no encontrada",
"error.msg.cheque.guarantee.amount.greater.than.available.savings.account.balance": "El monto de la garantía es mayor que el saldo disponible de la cuenta de ahorros",
"label.heading.centerRange": "Rango y Dia",
"----End---": "---Fin del archivo---"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
scope.availableCheques= [];
scope.formData = {};
scope.uiValidationErrors = [];
scope.bankAccountOptions = [];

scope.searchByCaseId = function () {
var params = {
Expand All @@ -32,34 +33,77 @@
sortOrder: 'ASC',
agencyId: scope.formData.agencyId,
status: 1
}, function (data) {
}, data => {
scope.totalAvailableCheques = data.totalFilteredRecords;
scope.availableCheques = data.pageItems;
var bankAccMap = groupBy(scope.availableCheques, 'bankAccId');
for (var [key, value] of bankAccMap.entries()) {
var chequeData = value[0];
var accountName = chequeData.bankAccNo + ' (' + chequeData.bankName + ')' + ' - ' + chequeData.agencyName + ' (' + value.length + ' Cheques)';
scope.bankAccountOptions.push({bankAccId: chequeData.bankAccId, accountName: accountName });
}
});
}
const groupBy = (items, key) => {
const map = new Map();
items.forEach((item) => {
const keyValue = item[key];
const currArr = map.has(keyValue) ? map.get(keyValue) : [];
currArr.push(item);
map.set(keyValue, currArr);
});
return map;
};

scope.assignGuaranteeCheques = function () {
$uibModal.open({
templateUrl: 'assignGuaranteeCheques.html',
controller: AssignGuaranteeChequesController
});
};

scope.assignCheques = function(){
var AssignGuaranteeChequesController = function ($scope, $uibModalInstance) {
$scope.bankAccountOptions = scope.bankAccountOptions;
if (Array.isArray($scope.bankAccountOptions) && $scope.bankAccountOptions.length) {
$scope.bankAccId = $scope.bankAccountOptions[0].bankAccId;
}
$scope.assign = function () {
scope.assignChequesFromBankAccount( $scope.bankAccId);
$uibModalInstance.close('delete');
};
$scope.cancel = function () {
$uibModalInstance.close('cancel');
};
};

scope.assignChequesFromBankAccount = function(bankAccId){
var selectedGuaranteeDataList = [];
for(var i = 0; i < scope.guaranteeDataList.length; i++){
delete scope.guaranteeDataList[i].chequeData;
if(scope.guaranteeDataList[i].isSelected){
selectedGuaranteeDataList.push(scope.guaranteeDataList[i]);
}
}
var availableBankCheques = [];
for(var i = 0; i < scope.availableCheques.length; i++){
if(scope.availableCheques[i].bankAccId === bankAccId){
availableBankCheques.push(scope.availableCheques[i]);
}
}
scope.uiValidationErrors = [];
if(selectedGuaranteeDataList.length < 1){
scope.uiValidationErrors.push({
message: 'error.message.select.at.least.one.guarantee'
});
} else if (selectedGuaranteeDataList.length > this.availableCheques.length){
} else if (selectedGuaranteeDataList.length > availableBankCheques.length){
scope.uiValidationErrors.push({
message: 'error.message.insufficient.amount.of.cheques'
});
} else {
let mappedChequeIndex = 0;
for (var i = 0; i < scope.guaranteeDataList.length; i++ ){
if(scope.guaranteeDataList[i].isSelected){
scope.guaranteeDataList[i].chequeData = scope.availableCheques[mappedChequeIndex];
scope.guaranteeDataList[i].chequeData = availableBankCheques[mappedChequeIndex];
var chequeName = scope.guaranteeDataList[i].chequeData.chequeNo + ' |' + scope.guaranteeDataList[i].chequeData .batchNo + '| ' + scope.guaranteeDataList[i].chequeData .bankAccNo + '| ' + scope.guaranteeDataList[i].chequeData.bankName;
var accountName = scope.guaranteeDataList[i].chequeData.bankAccNo + ' - ' + scope.guaranteeDataList[i].chequeData.agencyName;
scope.guaranteeDataList[i].chequeData.chequeName = chequeName;
Expand Down Expand Up @@ -95,6 +139,7 @@
if(scope.guaranteeDataList[i].isSelected){
var selectedGuarantee = {
guaranteeId: scope.guaranteeDataList[i].id,
clientNo: scope.guaranteeDataList[i].clientNo,
caseId: scope.guaranteeDataList[i].caseId,
chequeId: scope.guaranteeDataList[i].chequeData.id,
guaranteeAmount: scope.guaranteeDataList[i].requestedAmount,
Expand Down
2 changes: 2 additions & 0 deletions app/views/banks/bankcheques/authorizechequesissuance.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ <h4 class="pull-left">{{'label.anchor.authorize.cheques.issuance' | translate}}<
<th>{{'label.heading.chequeNo' | translate}}</th>
<th>{{'label.heading.batchNo' | translate}}</th>
<th>{{'label.heading.bankAccNo' | translate}}</th>
<th>{{'label.input.type' | translate}}</th>
<th>{{'label.heading.chequeAmount' | translate}}</th>
<th>{{'label.heading.status' | translate}}</th>
<th>{{'label.heading.description' | translate}}</th>
Expand All @@ -151,6 +152,7 @@ <h4 class="pull-left">{{'label.anchor.authorize.cheques.issuance' | translate}}<
<td>{{cheque.chequeNo}}</td>
<td>{{cheque.batchNo}}</td>
<td>{{cheque.bankAccNo}}</td>
<td>{{cheque.loanAmount && cheque.loanAmount>0? 'label.heading.disbursement':'label.heading.guarantees'|translate }}</td>
<td>{{cheque.chequeAmount}}</td>
<td>{{cheque.status.code | translate}}</td>
<td>{{cheque.description}}</td>
Expand Down
28 changes: 25 additions & 3 deletions app/views/banks/bankcheques/payguaranteeswithcheques.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
<li><a href="#/organization">{{'label.anchor.organization' | translate}}</a></li>
<li class="active">{{'label.heading.pay.guarantees.by.cheques' | translate}}</li>
</ul>
<script type="text/ng-template" id="assignGuaranteeCheques.html">
<div class="modal-header silver">
<h3 class="bolder">{{'label.heading.assign.cheques.to.loans' | translate}}</h3>
</div>
<div class="modal-body ">
<api-validate></api-validate>
<br>
<div class="form-group">
<label for="bankAccId">{{'label.heading.select.bank.account' | translate}}</label>
<select id="bankAccId"
name="bankAccId"
ng-model="bankAccId"
class="form-control"
ng-options="bankAccountData.bankAccId as bankAccountData.accountName for bankAccountData in bankAccountOptions"
value="{{bankAccountData.bankAccId}}">
</select>
</div>
<br>
<button class="btn btn-warning" ng-click="cancel()">{{'label.button.cancel' | translate}}</button>
<button class="btn btn-primary" ng-click="assign()">{{'label.button.assign' | translate}}</button>
</div>
</script>
<api-validate></api-validate>
<div class="card">
<div class="content">
Expand Down Expand Up @@ -63,16 +85,16 @@ <h4 class="pull-left">{{'label.heading.pay.guarantees.by.cheques' | translate}}<
</thead>

<tbody>
<tr ng-repeat="guaranteeData in guaranteeDataList">
<tr ng-repeat="guaranteeData in guaranteeDataList track by $index">
<td>
<div class="checkbox form-group">
<label for="isSelected">
<input type="checkbox" id="isSelected" name="isSelected" ng-model="guaranteeData.isSelected">
</label>
</div>
</td>
<td>{{guaranteeData.clientNo}}</td>
<td>{{guaranteeData.id}}</td>
<td>{{guaranteeData.clientNo}}</td>
<td>{{guaranteeData.clientName}}</td>
<td>{{guaranteeData.withdrawalReason}}</td>
<td>{{guaranteeData.requestedAmount}}</td>
Expand All @@ -90,7 +112,7 @@ <h4 class="pull-left">{{'label.heading.pay.guarantees.by.cheques' | translate}}<
<br>
<div class="col-md-offset-2 paddedleft">
<a id="cancel" href="#/organization" class="btn btn-default">{{'label.button.cancel' | translate}}</a>
<a ng-disabled="isAssignBtnDisabled()" ng-click="assignCheques()" class="btn btn-primary" has-permission='PAYGUARANTEEBYCHEQUE_BANKCHEQUE'><i class="fa fa-tasks "></i>&nbsp;&nbsp;{{
<a ng-disabled="isAssignBtnDisabled()" ng-click="assignGuaranteeCheques()" class="btn btn-primary" has-permission='PAYGUARANTEEBYCHEQUE_BANKCHEQUE'><i class="fa fa-tasks "></i>&nbsp;&nbsp;{{
'label.button.assigncheques' | translate }}</a>
<button ng-disabled="!isChequeAssigned" id="save" type="submit" class="btn btn-primary" has-permission='PAYGUARANTEEBYCHEQUE_BANKCHEQUE'>{{'label.button.pay' | translate}}</button>
</div>
Expand Down
2 changes: 2 additions & 0 deletions app/views/banks/bankcheques/printcheques.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ <h4 class="pull-left">{{'label.anchor.print.cheques' | translate}}</h4>
<th>{{'label.heading.batchNo' | translate}}</th>
<th>{{'label.heading.bankAccNo' | translate}}</th>
<th>{{'label.heading.bank.name' | translate}}</th>
<th>{{'label.input.type' | translate}}</th>
<th>{{'label.heading.loanaccount' | translate}}</th>
<th>{{'label.heading.chequeAmount' | translate}}</th>
<th>{{'label.heading.clientno' | translate}}</th>
Expand All @@ -171,6 +172,7 @@ <h4 class="pull-left">{{'label.anchor.print.cheques' | translate}}</h4>
<td>{{cheque.batchNo}}</td>
<td>{{cheque.bankAccNo}}</td>
<td>{{cheque.bankName}}</td>
<td>{{cheque.loanAmount && cheque.loanAmount>0? 'label.heading.disbursement':'label.heading.guarantees'|translate }}</td>
<td>{{cheque.loanAccNo}}</td>
<td>{{cheque.chequeAmount}}</td>
<td>{{cheque.clientNo}}</td>
Expand Down
2 changes: 2 additions & 0 deletions app/views/organization/viewportfolio.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ <h3><strong>{{portfolio.name}}</strong></h3>
</span>
<tr class="graybg">
<th>{{'label.heading.centerName' | translate}}</th>
<th>{{'label.heading.centerRange' | translate}}</th>
<th>{{'label.heading.centereditegroups' | translate}}</th>
</tr>
</thead>
<tbody>
<tr class="pointer-main" ng-repeat="center in centers">
<td class="pointer" data-ng-click="editCenter(center.id)">{{center.name}}</td>
<td>{{center.rangeCode}} {{center.meetingDayName}}</td>
<td><button class="btn btn-default" data-ng-click="viewGroups(center.id)"><i class="fa fa-pencil"></i></button></td>
</tr>
</tbody>
Expand Down

0 comments on commit 670b3f2

Please sign in to comment.