fix: Loan product charge-off reasons accounting mappings
This commit is contained in:
committed by
Jose Alberto Hernandez
parent
d04890fd3f
commit
c9ff1438a3
+1
-1
@@ -256,7 +256,7 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges {
|
||||
optionData = {
|
||||
id: o.id,
|
||||
code: o.code,
|
||||
value: o.value
|
||||
value: o.value || o.name
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
@@ -61,16 +61,12 @@ export class EditLoanProductComponent implements OnInit {
|
||||
private advancedPaymentStrategy: AdvancedPaymentStrategy) {
|
||||
this.route.data.subscribe((data: { loanProductAndTemplate: any, configurations: any }) => {
|
||||
this.loanProductAndTemplate = data.loanProductAndTemplate;
|
||||
console.log(this.loanProductAndTemplate);
|
||||
const assetAccountData = this.loanProductAndTemplate.accountingMappingOptions.assetAccountOptions || [];
|
||||
const liabilityAccountData = this.loanProductAndTemplate.accountingMappingOptions.liabilityAccountOptions || [];
|
||||
this.loanProductAndTemplate.accountingMappingOptions.assetAndLiabilityAccountOptions = assetAccountData.concat(liabilityAccountData);
|
||||
|
||||
this.itemsByDefault = loanProducts.setItemsByDefault(data.configurations);
|
||||
this.loanProductAndTemplate['itemsByDefault'] = this.itemsByDefault;
|
||||
// this.loanProductAndTemplate = loanProducts.updateLoanProductDefaults(this.loanProductAndTemplate, true);
|
||||
|
||||
console.log(this.loanProductAndTemplate);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+5
-4
@@ -302,7 +302,7 @@
|
||||
>
|
||||
<fa-icon icon="edit"></fa-icon>
|
||||
</button>
|
||||
<button mat-icon-button color="warn" (click)="delete(paymentChannelToFundSourceMappings, i)">
|
||||
<button mat-icon-button color="warn" (click)="delete('PaymentFundSource', paymentChannelToFundSourceMappings, i)">
|
||||
<fa-icon icon="trash"></fa-icon>
|
||||
</button>
|
||||
</td>
|
||||
@@ -353,7 +353,7 @@
|
||||
<button mat-icon-button color="primary" (click)="edit('FeesIncome', feeToIncomeAccountMappings, i)">
|
||||
<fa-icon icon="edit"></fa-icon>
|
||||
</button>
|
||||
<button mat-icon-button color="warn" (click)="delete(feeToIncomeAccountMappings, i)">
|
||||
<button mat-icon-button color="warn" (click)="delete('FeesIncome', feeToIncomeAccountMappings, i)">
|
||||
<fa-icon icon="trash"></fa-icon>
|
||||
</button>
|
||||
</td>
|
||||
@@ -410,7 +410,7 @@
|
||||
>
|
||||
<fa-icon icon="edit"></fa-icon>
|
||||
</button>
|
||||
<button mat-icon-button color="warn" (click)="delete(penaltyToIncomeAccountMappings, i)">
|
||||
<button mat-icon-button color="warn" (click)="delete('PenaltyIncome', penaltyToIncomeAccountMappings, i)">
|
||||
<fa-icon icon="trash"></fa-icon>
|
||||
</button>
|
||||
</td>
|
||||
@@ -429,6 +429,7 @@
|
||||
type="button"
|
||||
mat-raised-button
|
||||
color="primary"
|
||||
[disabled]="!allowAddChargeOffReasonExpense"
|
||||
(click)="add('ChargeOffReasonExpense', chargeOffReasonToExpenseAccountMappings)"
|
||||
>
|
||||
<fa-icon icon="plus" class="m-r-10"></fa-icon>
|
||||
@@ -466,7 +467,7 @@
|
||||
>
|
||||
<fa-icon icon="edit"></fa-icon>
|
||||
</button>
|
||||
<button mat-icon-button color="warn" (click)="delete(chargeOffReasonToExpenseAccountMappings, i)">
|
||||
<button mat-icon-button color="warn" (click)="delete('ChargeOffReasonExpense', chargeOffReasonToExpenseAccountMappings, i)">
|
||||
<fa-icon icon="trash"></fa-icon>
|
||||
</button>
|
||||
</td>
|
||||
|
||||
+23
-3
@@ -34,6 +34,9 @@ export class LoanProductAccountingStepComponent implements OnInit {
|
||||
assetAndLiabilityAccountData: any;
|
||||
chargeOffReasonOptions: any;
|
||||
|
||||
currentFormValues: any[] = [];
|
||||
allowAddChargeOffReasonExpense = true;
|
||||
|
||||
paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId', 'actions'];
|
||||
feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId', 'actions'];
|
||||
chargeOffReasonExpenseDisplayedColumns: string[] = ['chargeOffReasonCodeValueId', 'expenseAccountId', 'actions'];
|
||||
@@ -215,11 +218,24 @@ export class LoanProductAccountingStepComponent implements OnInit {
|
||||
}
|
||||
|
||||
add(formType: string, formArray: UntypedFormArray) {
|
||||
this.currentFormValues = [];
|
||||
if (formType == 'ChargeOffReasonExpense') {
|
||||
this.allowAddChargeOffReasonExpense = true;
|
||||
formArray.value.forEach((item: any) => this.currentFormValues.push(item.chargeOffReasonCodeValueId));
|
||||
if (this.chargeOffReasonOptions.length == this.currentFormValues.length) {
|
||||
this.allowAddChargeOffReasonExpense = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
const data = { ...this.getData(formType), pristine: false };
|
||||
const dialogRef = this.dialog.open(FormDialogComponent, { data });
|
||||
dialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.data) {
|
||||
formArray.push(response.data);
|
||||
if (formType == 'ChargeOffReasonExpense') {
|
||||
this.allowAddChargeOffReasonExpense = (formArray.value.length < this.chargeOffReasonOptions.length);
|
||||
}
|
||||
|
||||
this.setLoanProductAccountingFormDirty();
|
||||
}
|
||||
});
|
||||
@@ -236,13 +252,16 @@ export class LoanProductAccountingStepComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
delete(formArray: UntypedFormArray, index: number) {
|
||||
delete(formType: string, formArray: UntypedFormArray, index: number) {
|
||||
const dialogRef = this.dialog.open(DeleteDialogComponent, {
|
||||
data: { deleteContext: this.translateService.instant('labels.text.this') }
|
||||
});
|
||||
dialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.delete) {
|
||||
formArray.removeAt(index);
|
||||
if (formType == 'ChargeOffReasonExpense') {
|
||||
this.allowAddChargeOffReasonExpense = (formArray.value.length < this.chargeOffReasonOptions.length);
|
||||
}
|
||||
this.setLoanProductAccountingFormDirty();
|
||||
}
|
||||
});
|
||||
@@ -324,12 +343,13 @@ export class LoanProductAccountingStepComponent implements OnInit {
|
||||
}
|
||||
|
||||
getChargeOffReasonExpenseFormfields(values?: any) {
|
||||
const reasonOptions = this.chargeOffReasonOptions.filter((item: any) => !this.currentFormValues.includes(item.id));
|
||||
const formfields: FormfieldBase[] = [
|
||||
new SelectBase({
|
||||
controlName: 'chargeOffReasonCodeValueId',
|
||||
label: 'Charge-off reason',
|
||||
value: values ? values.chargeOffReasonCodeValueId : this.chargeOffReasonOptions[0].id,
|
||||
options: { label: 'name', value: 'id', data: this.chargeOffReasonOptions },
|
||||
value: values ? values.chargeOffReasonCodeValueId : reasonOptions[0].id,
|
||||
options: { label: 'name', value: 'id', data: reasonOptions },
|
||||
required: true,
|
||||
order: 1
|
||||
}),
|
||||
|
||||
+4
-4
@@ -2,14 +2,14 @@
|
||||
window["env"] = window["env"] || {};
|
||||
|
||||
// BackEnd Environment variables
|
||||
window["env"]["fineractApiUrls"] = 'https://ps-test.dev.alluvial.cloud';
|
||||
window["env"]["fineractApiUrl"] = 'https://ps-test.dev.alluvial.cloud';
|
||||
window["env"]["fineractApiUrls"] = '';
|
||||
window["env"]["fineractApiUrl"] = '';
|
||||
|
||||
window["env"]["apiProvider"] = '';
|
||||
window["env"]["apiVersion"] = '';
|
||||
|
||||
window["env"]["fineractPlatformTenantId"] = 'pstest';
|
||||
window["env"]["fineractPlatformTenantIds"] = 'pstest';
|
||||
window["env"]["fineractPlatformTenantId"] = '';
|
||||
window["env"]["fineractPlatformTenantIds"] = '';
|
||||
|
||||
// Language Environment variables
|
||||
window["env"]["defaultLanguage"] = '';
|
||||
|
||||
Reference in New Issue
Block a user