Skip to content

Commit

Permalink
Merge branch 'fiter/fb/qa' into prod/release/v1.0.0
Browse files Browse the repository at this point in the history
* fiter/fb/qa: (138 commits)
  Latest bug fixes
  Release/1.0.33 prepare (#359)
  Release/1.0.32 prepare (#357)
  Release/1.0.31 prepare (#355)
  Release v1.0.30 (#353)
  Release v1.0.29 (#346)
  QA - Release/1.0.28 prepare (#344)
  fix fbr 612
  fix fbr 542
  Release guarantee extra fields
  Enhancement/FBR-593: Traducir valores y etiquetas en solicitud de préstamo (#332)
  fix fbr 536
  QA - Release/1.0.27 prepare (#330)
  Fix FBR-609 (#329)
  Feature/FBR-588: Personalizar asientos contables (#328)
  fix fbr 606
  fix fbr 606
  fix FBR 599
  Bug/FBR-592: Fix java.io.IOException: Broken pipe v3 (#324)
  QA Release 1.0.26 prepare (#323)
  ...
  • Loading branch information
leonardohildt committed May 1, 2024
2 parents 10e29a6 + abeb8b3 commit 36939b6
Show file tree
Hide file tree
Showing 87 changed files with 2,451 additions and 11,127 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ app/custom_files
Gruntfile-custom.js
.sass-cache
gems.locked
package-lock.json
.grunt/
bin/
*.cache
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN npm install -g bower
RUN npm install -g grunt-cli
COPY . /usr/src/app
RUN bower --allow-root install
RUN npm install
RUN npm install --force
RUN bundle install
#RUN grunt test --code-coverage --force
RUN grunt prod
Expand Down
4 changes: 2 additions & 2 deletions app/angular/i18n/angular-locale_es.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ $provide.value("$locale", {
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
Expand Down
219 changes: 184 additions & 35 deletions app/global-translations/locale-en.json

Large diffs are not rendered by default.

312 changes: 250 additions & 62 deletions app/global-translations/locale-es.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,44 @@
mifosX.controllers = _.extend(module, {
ApproveChequesIssuanceController: function (scope, routeParams, route, location, resourceFactory, http, $uibModal, API_VERSION, $timeout, $rootScope, Upload) {

resourceFactory.chequeBatchTemplateResource.get({}, function (data) {
scope.statusOptions = data.statusOptions;
scope.agencyOptions = data.agencyOptions;
});
scope.bankAccountOptions = [];
resourceFactory.chequeBatchTemplateResource.get({}, function (data) {
scope.statusOptions = data.statusOptions;
scope.agencyOptions = data.agencyOptions;
scope.facilitatorOptions = data.facilitatorOptions;
scope.centerOptions = data.centerOptions;
scope.allGroupOptions = data.groupOptions;
scope.groupOptions = data.groupOptions;
scope.allCenterGroupOptions = data.groupOptions;
});

scope.routeTo = function (chequeId, batchId){
location.path('/viewdetails/' + chequeId + '/cheque/' + batchId);
scope.filterGroups = function () {
if (this.formData.centerId){
scope.groupOptions = [];
for (var i in scope.allGroupOptions) {
if (scope.allGroupOptions[i].centerId == scope.formData.centerId) {
scope.groupOptions.push(scope.allGroupOptions[i]);
}
}
}else {
scope.groupOptions = scope.allGroupOptions;
}

}

resourceFactory.bankAccountResource.getAllBankAccounts({}, function (data) {
scope.totalBankAccounts = data.totalFilteredRecords;
scope.bankAccountOptions = data.pageItems;
for (var i = 0; i < scope.bankAccountOptions.length; i++) {
var accountName = scope.bankAccountOptions[i].accountNumber + ' - ' + scope.bankAccountOptions[i].agency.name;
scope.bankAccountOptions[i].accountName = accountName;
}

});


scope.routeTo = function (chequeId, batchId) {
location.path('/viewdetails/' + chequeId + '/cheque/' + batchId);
};

scope.cheques = [];
Expand All @@ -18,56 +49,86 @@
scope.isAllChequesSelected = false;
scope.disableApproveButton = true;
scope.getResultsPage = function (pageNumber) {
resourceFactory.searchChequeResource.get({
resourceFactory.searchChequeResource.get({
offset: ((pageNumber - 1) * scope.chequesPerPage),
limit: scope.chequesPerPage,
orderBy: 'chequeNo',
sortOrder: 'ASC',
to: scope.formData.to,
from: scope.formData.from,
centerId: scope.formData.centerId,
groupId: scope.formData.groupId,
facilitatorId: scope.formData.facilitatorId,
bankAccNo: scope.formData.bankAccNo,
bankAccId: scope.formData.bankAccId,
chequeNo: scope.formData.chequeNo,
agencyId: scope.formData.agencyId,
status: scope.formData.status
}, function (data) {
scope.totalCheques = data.totalFilteredRecords;
scope.cheques = data.pageItems;
scope.isAllChequesSelected = false;
});
});
}

scope.$watch('formData.bankAccId',function(){
delete scope.formData.agencyName;
delete scope.formData.bankName;
for (var i = 0; i < scope.bankAccountOptions.length; i++ ){
if(scope.bankAccountOptions[i].id === scope.formData.bankAccId){
scope.formData.agencyName = scope.bankAccountOptions[i].agency.name;
scope.formData.bankName = scope.bankAccountOptions[i].bank.name;
}
}
});

scope.$watch('formData.centerId',function(){
var selectedCenterGroupOptions = [];
if(scope.formData.centerId){
var centerGroupOptions = [];
for (var i = 0; i < scope.groupOptions.length; i++ ){
selectedCenterGroupOptions.push(scope.groupOptions[i]);
}
scope.groupOptions = selectedCenterGroupOptions;
} else {
scope.groupOptions = scope.allCenterGroupOptions;
}
});

scope.search = function () {
scope.getResultsPage(1);
scope.getResultsPage(1);
}

scope.selectAllCheques = function(){
for (var i = 0; i < scope.cheques.length; i++ ){
scope.cheques[i].isSelected = scope.isAllChequesSelected;
scope.selectAllCheques = function () {
for (var i = 0; i < scope.cheques.length; i++) {
scope.cheques[i].isSelected = scope.isAllChequesSelected;
}
}

scope.isApproveBtnDisabled = function(){
var ret = true;
for (var i = 0; i < scope.cheques.length; i++ ){
if(scope.cheques[i].isSelected){
ret = false;
break;
}
}
return ret;
scope.isApproveBtnDisabled = function () {
var ret = true;
for (var i = 0; i < scope.cheques.length; i++) {
if (scope.cheques[i].isSelected) {
ret = false;
break;
}
}
return ret;
}

scope.submit = function (){
var selectedCheques = [];
for(var i = 0; i < scope.cheques.length; i++){
if(scope.cheques[i].isSelected){
var selectedCheque = {
chequeId: scope.cheques[i].id
}
selectedCheques.push(selectedCheque);
scope.submit = function () {
var selectedCheques = [];
for (var i = 0; i < scope.cheques.length; i++) {
if (scope.cheques[i].isSelected) {
var selectedCheque = {
chequeId: scope.cheques[i].id
}
}
resourceFactory.chequeBatchResource.approveIssuance({ commandParam: 'approveissuance'}, selectedCheques, function (data) {
route.reload();
});
selectedCheques.push(selectedCheque);
}
}
resourceFactory.chequeBatchResource.approveIssuance({commandParam: 'approveissuance'}, selectedCheques, function (data) {
route.reload();
});
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
scope.agencyOptions = data.agencyOptions;
scope.facilitatorOptions = data.facilitatorOptions;
scope.centerOptions = data.centerOptions;
scope.allGroupOptions = data.groupOptions;
scope.groupOptions = data.groupOptions;
scope.allCenterGroupOptions = data.groupOptions;
});
Expand All @@ -22,6 +23,19 @@

});

scope.filterGroups = function () {
if (this.formData.centerId){
scope.groupOptions = [];
for (var i in scope.allGroupOptions) {
if (scope.allGroupOptions[i].centerId == scope.formData.centerId) {
scope.groupOptions.push(scope.allGroupOptions[i]);
}
}
}else {
scope.groupOptions = scope.allGroupOptions;
}

}
scope.cheques = [];
scope.formData = {};
scope.chequesPerPage = 100;
Expand Down
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,37 +33,82 @@
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[i];
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;
scope.guaranteeDataList[i].chequeData.accountName = accountName;
mappedChequeIndex++;
}
}
scope.uiValidationErrors = [];
Expand Down Expand Up @@ -93,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
Loading

0 comments on commit 36939b6

Please sign in to comment.