Fix in Loan Product edition (#1905)

Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
José Alberto Hernández
2023-11-21 10:35:15 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent f6edab0dd5
commit df8c90d9e6
6 changed files with 74 additions and 52 deletions
+13
View File
@@ -41,6 +41,7 @@
"moment": "^2.29.4", "moment": "^2.29.4",
"rxjs": "6.6.2", "rxjs": "6.6.2",
"tslib": "^2.0.0", "tslib": "^2.0.0",
"vkbeautify": "^0.99.2",
"zone.js": "0.11.6" "zone.js": "0.11.6"
}, },
"devDependencies": { "devDependencies": {
@@ -59,6 +60,7 @@
"@types/jasminewd2": "2.0.6", "@types/jasminewd2": "2.0.6",
"@types/lodash": "4.14.132", "@types/lodash": "4.14.132",
"@types/node": "12.11.1", "@types/node": "12.11.1",
"@types/vkbeautify": "^0.99.2",
"codelyzer": "6.0.0", "codelyzer": "6.0.0",
"cypress": "^10.7.0", "cypress": "^10.7.0",
"git-describe": "^4.1.1", "git-describe": "^4.1.1",
@@ -4198,6 +4200,12 @@
"vfile-message": "*" "vfile-message": "*"
} }
}, },
"node_modules/@types/vkbeautify": {
"version": "0.99.4",
"resolved": "https://registry.npmjs.org/@types/vkbeautify/-/vkbeautify-0.99.4.tgz",
"integrity": "sha512-IB/vC9R2BPQJDbKaBwG6B8nnBKeu/RMYKVgVBoSiMjj3CmePsRqHaFNLiYov7sBn+CiGe6eqY9UslPv+TEyjvA==",
"dev": true
},
"node_modules/@types/ws": { "node_modules/@types/ws": {
"version": "8.5.8", "version": "8.5.8",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.8.tgz", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.8.tgz",
@@ -21791,6 +21799,11 @@
"unist-util-stringify-position": "^1.1.1" "unist-util-stringify-position": "^1.1.1"
} }
}, },
"node_modules/vkbeautify": {
"version": "0.99.3",
"resolved": "https://registry.npmjs.org/vkbeautify/-/vkbeautify-0.99.3.tgz",
"integrity": "sha512-2ozZEFfmVvQcHWoHLNuiKlUfDKlhh4KGsy54U0UrlLMR1SO+XKAIDqBxtBwHgNrekurlJwE8A9K6L49T78ZQ9Q=="
},
"node_modules/void-elements": { "node_modules/void-elements": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz",
+1 -1
View File
@@ -161,7 +161,7 @@ export class Datatables {
public isValidUrl(urlString: string): boolean { public isValidUrl(urlString: string): boolean {
try { try {
const url = new URL(urlString); const url = new URL(urlString);
return url.protocol.startsWith("http") || url.protocol.startsWith("https"); return url.protocol.startsWith('http') || url.protocol.startsWith('https');
} catch (e) { } catch (e) {
return false; return false;
} }
@@ -50,6 +50,8 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges {
this.penaltyToIncomeAccountMappings = this.loanProduct.penaltyToIncomeAccountMappings || []; this.penaltyToIncomeAccountMappings = this.loanProduct.penaltyToIncomeAccountMappings || [];
} else { } else {
this.accountingMappings = {};
if ((this.loanProduct.accountingRule && this.loanProduct.accountingRule > 1) || this.loanProductsTemplate.accountingRule.value !== 'NONE') {
const assetAccountData = this.loanProductsTemplate.accountingMappingOptions.assetAccountOptions || []; const assetAccountData = this.loanProductsTemplate.accountingMappingOptions.assetAccountOptions || [];
const incomeAccountData = this.loanProductsTemplate.accountingMappingOptions.incomeAccountOptions || []; const incomeAccountData = this.loanProductsTemplate.accountingMappingOptions.incomeAccountOptions || [];
const expenseAccountData = this.loanProductsTemplate.accountingMappingOptions.expenseAccountOptions || []; const expenseAccountData = this.loanProductsTemplate.accountingMappingOptions.expenseAccountOptions || [];
@@ -79,30 +81,37 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges {
'overpaymentLiabilityAccount': this.glAccountLookUp(this.loanProduct.overpaymentLiabilityAccountId, liabilityAccountData), 'overpaymentLiabilityAccount': this.glAccountLookUp(this.loanProduct.overpaymentLiabilityAccountId, liabilityAccountData),
}; };
const paymentTypesData = this.loanProductsTemplate.paymentTypeOptions || [];
if (this.loanProduct.paymentChannelToFundSourceMappings?.length > 0) {
const paymentTypesData = this.loanProductsTemplate.paymentTypeOptions || [];
this.loanProduct.paymentChannelToFundSourceMappings.forEach((m: any) => { this.loanProduct.paymentChannelToFundSourceMappings.forEach((m: any) => {
this.paymentChannelToFundSourceMappings.push({ this.paymentChannelToFundSourceMappings.push({
fundSourceAccount: this.glAccountLookUp(m.fundSourceAccountId, assetAndLiabilityAccountData), fundSourceAccount: this.glAccountLookUp(m.fundSourceAccountId, assetAndLiabilityAccountData),
paymentType: this.paymentTypeLookUp(m.paymentTypeId, paymentTypesData) paymentType: this.paymentTypeLookUp(m.paymentTypeId, paymentTypesData)
}); });
}); });
}
this.feeToIncomeAccountMappings = []; this.feeToIncomeAccountMappings = [];
if (this.loanProduct.feeToIncomeAccountMappings?.length > 0) {
this.loanProduct.feeToIncomeAccountMappings.forEach((m: any) => { this.loanProduct.feeToIncomeAccountMappings.forEach((m: any) => {
this.feeToIncomeAccountMappings.push({ this.feeToIncomeAccountMappings.push({
incomeAccount: this.glAccountLookUp(m.incomeAccountId, incomeAccountData), incomeAccount: this.glAccountLookUp(m.incomeAccountId, incomeAccountData),
charge: this.chargeLookUp(m.chargeId, this.loanProductsTemplate.chargeOptions) charge: this.chargeLookUp(m.chargeId, this.loanProductsTemplate.chargeOptions)
}); });
}); });
}
this.penaltyToIncomeAccountMappings = []; this.penaltyToIncomeAccountMappings = [];
if (this.loanProduct.penaltyToIncomeAccountMappings?.length > 0) {
this.loanProduct.penaltyToIncomeAccountMappings.forEach((m: any) => { this.loanProduct.penaltyToIncomeAccountMappings.forEach((m: any) => {
this.penaltyToIncomeAccountMappings.push({ this.penaltyToIncomeAccountMappings.push({
incomeAccount: this.glAccountLookUp(m.incomeAccountId, incomeAccountData), incomeAccount: this.glAccountLookUp(m.incomeAccountId, incomeAccountData),
charge: this.chargeLookUp(m.chargeId, this.loanProductsTemplate.penaltyOptions) charge: this.chargeLookUp(m.chargeId, this.loanProductsTemplate.penaltyOptions)
}); });
}); });
}
}
if (this.loanProduct.isInterestRecalculationEnabled) { if (this.loanProduct.isInterestRecalculationEnabled) {
this.loanProduct.interestRecalculationData = { this.loanProduct.interestRecalculationData = {
@@ -144,7 +144,7 @@ export class DatatableSingleRowComponent implements OnInit {
return columnDisplayType; return columnDisplayType;
} }
case 'TEXT': { case 'TEXT': {
if (columnType == 'JSON') { if (columnType === 'JSON') {
return 'JSON'; return 'JSON';
} else { } else {
return columnDisplayType; return columnDisplayType;
+2 -2
View File
@@ -2,8 +2,8 @@
/* tslint:disable */ /* tslint:disable */
export default { export default {
'mifos_x': { 'mifos_x': {
'version': '0.0.0', 'version': '231121',
'hash': '9b40d307' 'hash': 'f6edab0d'
}, },
'allow_switching_backend_instance': true 'allow_switching_backend_instance': true
}; };