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",
"rxjs": "6.6.2",
"tslib": "^2.0.0",
"vkbeautify": "^0.99.2",
"zone.js": "0.11.6"
},
"devDependencies": {
@@ -59,6 +60,7 @@
"@types/jasminewd2": "2.0.6",
"@types/lodash": "4.14.132",
"@types/node": "12.11.1",
"@types/vkbeautify": "^0.99.2",
"codelyzer": "6.0.0",
"cypress": "^10.7.0",
"git-describe": "^4.1.1",
@@ -4198,6 +4200,12 @@
"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": {
"version": "8.5.8",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.8.tgz",
@@ -21791,6 +21799,11 @@
"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": {
"version": "2.0.1",
"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 {
try {
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) {
return false;
}
+2 -2
View File
@@ -10,10 +10,10 @@ export class PrettyPrintPipe implements PipeTransform {
if (value.charAt(0) === '{' && value.charAt(value.length - 1) === '}') {
try {
return vkbeautify.json(value);
} catch(error) {
} catch (error) {
return value;
}
}
return value;
}
}
}
@@ -50,59 +50,68 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges {
this.penaltyToIncomeAccountMappings = this.loanProduct.penaltyToIncomeAccountMappings || [];
} else {
const assetAccountData = this.loanProductsTemplate.accountingMappingOptions.assetAccountOptions || [];
const incomeAccountData = this.loanProductsTemplate.accountingMappingOptions.incomeAccountOptions || [];
const expenseAccountData = this.loanProductsTemplate.accountingMappingOptions.expenseAccountOptions || [];
const liabilityAccountData = this.loanProductsTemplate.accountingMappingOptions.liabilityAccountOptions || [];
const assetAndLiabilityAccountData = this.loanProductsTemplate.accountingMappingOptions.assetAndLiabilityAccountOptions || [];
this.accountingMappings = {};
if ((this.loanProduct.accountingRule && this.loanProduct.accountingRule > 1) || this.loanProductsTemplate.accountingRule.value !== 'NONE') {
const assetAccountData = this.loanProductsTemplate.accountingMappingOptions.assetAccountOptions || [];
const incomeAccountData = this.loanProductsTemplate.accountingMappingOptions.incomeAccountOptions || [];
const expenseAccountData = this.loanProductsTemplate.accountingMappingOptions.expenseAccountOptions || [];
const liabilityAccountData = this.loanProductsTemplate.accountingMappingOptions.liabilityAccountOptions || [];
const assetAndLiabilityAccountData = this.loanProductsTemplate.accountingMappingOptions.assetAndLiabilityAccountOptions || [];
this.accountingMappings = {
'fundSourceAccount': this.glAccountLookUp(this.loanProduct.fundSourceAccountId, assetAndLiabilityAccountData),
'loanPortfolioAccount': this.glAccountLookUp(this.loanProduct.loanPortfolioAccountId, assetAccountData),
'receivableInterestAccount': this.glAccountLookUp(this.loanProduct.receivableInterestAccountId, assetAccountData),
'receivableFeeAccount': this.glAccountLookUp(this.loanProduct.receivableFeeAccountId, assetAccountData),
'receivablePenaltyAccount': this.glAccountLookUp(this.loanProduct.receivablePenaltyAccountId, assetAccountData),
'transfersInSuspenseAccount': this.glAccountLookUp(this.loanProduct.transfersInSuspenseAccountId, assetAccountData),
this.accountingMappings = {
'fundSourceAccount': this.glAccountLookUp(this.loanProduct.fundSourceAccountId, assetAndLiabilityAccountData),
'loanPortfolioAccount': this.glAccountLookUp(this.loanProduct.loanPortfolioAccountId, assetAccountData),
'receivableInterestAccount': this.glAccountLookUp(this.loanProduct.receivableInterestAccountId, assetAccountData),
'receivableFeeAccount': this.glAccountLookUp(this.loanProduct.receivableFeeAccountId, assetAccountData),
'receivablePenaltyAccount': this.glAccountLookUp(this.loanProduct.receivablePenaltyAccountId, assetAccountData),
'transfersInSuspenseAccount': this.glAccountLookUp(this.loanProduct.transfersInSuspenseAccountId, assetAccountData),
'interestOnLoanAccount': this.glAccountLookUp(this.loanProduct.interestOnLoanAccountId, incomeAccountData),
'incomeFromFeeAccount': this.glAccountLookUp(this.loanProduct.incomeFromFeeAccountId, incomeAccountData),
'incomeFromPenaltyAccount': this.glAccountLookUp(this.loanProduct.incomeFromPenaltyAccountId, incomeAccountData),
'incomeFromRecoveryAccount': this.glAccountLookUp(this.loanProduct.incomeFromRecoveryAccountId, incomeAccountData),
'incomeFromChargeOffInterestAccount': this.glAccountLookUp(this.loanProduct.incomeFromChargeOffInterestAccountId, incomeAccountData),
'incomeFromChargeOffFeesAccount': this.glAccountLookUp(this.loanProduct.incomeFromChargeOffFeesAccountId, incomeAccountData),
'incomeFromChargeOffPenaltyAccount': this.glAccountLookUp(this.loanProduct.incomeFromChargeOffPenaltyAccountId, incomeAccountData),
'interestOnLoanAccount': this.glAccountLookUp(this.loanProduct.interestOnLoanAccountId, incomeAccountData),
'incomeFromFeeAccount': this.glAccountLookUp(this.loanProduct.incomeFromFeeAccountId, incomeAccountData),
'incomeFromPenaltyAccount': this.glAccountLookUp(this.loanProduct.incomeFromPenaltyAccountId, incomeAccountData),
'incomeFromRecoveryAccount': this.glAccountLookUp(this.loanProduct.incomeFromRecoveryAccountId, incomeAccountData),
'incomeFromChargeOffInterestAccount': this.glAccountLookUp(this.loanProduct.incomeFromChargeOffInterestAccountId, incomeAccountData),
'incomeFromChargeOffFeesAccount': this.glAccountLookUp(this.loanProduct.incomeFromChargeOffFeesAccountId, incomeAccountData),
'incomeFromChargeOffPenaltyAccount': this.glAccountLookUp(this.loanProduct.incomeFromChargeOffPenaltyAccountId, incomeAccountData),
'writeOffAccount': this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData),
'goodwillCreditAccount': this.glAccountLookUp(this.loanProduct.goodwillCreditAccountId, expenseAccountData),
'chargeOffExpenseAccount': this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData),
'chargeOffFraudExpenseAccount': this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData),
'writeOffAccount': this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData),
'goodwillCreditAccount': this.glAccountLookUp(this.loanProduct.goodwillCreditAccountId, expenseAccountData),
'chargeOffExpenseAccount': this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData),
'chargeOffFraudExpenseAccount': this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData),
'overpaymentLiabilityAccount': this.glAccountLookUp(this.loanProduct.overpaymentLiabilityAccountId, liabilityAccountData),
};
const paymentTypesData = this.loanProductsTemplate.paymentTypeOptions || [];
'overpaymentLiabilityAccount': this.glAccountLookUp(this.loanProduct.overpaymentLiabilityAccountId, liabilityAccountData),
};
this.loanProduct.paymentChannelToFundSourceMappings.forEach((m: any) => {
this.paymentChannelToFundSourceMappings.push({
fundSourceAccount: this.glAccountLookUp(m.fundSourceAccountId, assetAndLiabilityAccountData),
paymentType: this.paymentTypeLookUp(m.paymentTypeId, paymentTypesData)
});
});
if (this.loanProduct.paymentChannelToFundSourceMappings?.length > 0) {
const paymentTypesData = this.loanProductsTemplate.paymentTypeOptions || [];
this.loanProduct.paymentChannelToFundSourceMappings.forEach((m: any) => {
this.paymentChannelToFundSourceMappings.push({
fundSourceAccount: this.glAccountLookUp(m.fundSourceAccountId, assetAndLiabilityAccountData),
paymentType: this.paymentTypeLookUp(m.paymentTypeId, paymentTypesData)
});
});
}
this.feeToIncomeAccountMappings = [];
this.loanProduct.feeToIncomeAccountMappings.forEach((m: any) => {
this.feeToIncomeAccountMappings.push({
incomeAccount: this.glAccountLookUp(m.incomeAccountId, incomeAccountData),
charge: this.chargeLookUp(m.chargeId, this.loanProductsTemplate.chargeOptions)
});
});
this.feeToIncomeAccountMappings = [];
if (this.loanProduct.feeToIncomeAccountMappings?.length > 0) {
this.loanProduct.feeToIncomeAccountMappings.forEach((m: any) => {
this.feeToIncomeAccountMappings.push({
incomeAccount: this.glAccountLookUp(m.incomeAccountId, incomeAccountData),
charge: this.chargeLookUp(m.chargeId, this.loanProductsTemplate.chargeOptions)
});
});
}
this.penaltyToIncomeAccountMappings = [];
this.loanProduct.penaltyToIncomeAccountMappings.forEach((m: any) => {
this.penaltyToIncomeAccountMappings.push({
incomeAccount: this.glAccountLookUp(m.incomeAccountId, incomeAccountData),
charge: this.chargeLookUp(m.chargeId, this.loanProductsTemplate.penaltyOptions)
});
});
this.penaltyToIncomeAccountMappings = [];
if (this.loanProduct.penaltyToIncomeAccountMappings?.length > 0) {
this.loanProduct.penaltyToIncomeAccountMappings.forEach((m: any) => {
this.penaltyToIncomeAccountMappings.push({
incomeAccount: this.glAccountLookUp(m.incomeAccountId, incomeAccountData),
charge: this.chargeLookUp(m.chargeId, this.loanProductsTemplate.penaltyOptions)
});
});
}
}
if (this.loanProduct.isInterestRecalculationEnabled) {
this.loanProduct.interestRecalculationData = {
@@ -144,7 +144,7 @@ export class DatatableSingleRowComponent implements OnInit {
return columnDisplayType;
}
case 'TEXT': {
if (columnType == 'JSON') {
if (columnType === 'JSON') {
return 'JSON';
} else {
return columnDisplayType;
+2 -2
View File
@@ -2,8 +2,8 @@
/* tslint:disable */
export default {
'mifos_x': {
'version': '0.0.0',
'hash': '9b40d307'
'version': '231121',
'hash': 'f6edab0d'
},
'allow_switching_backend_instance': true
};