Merge pull request #2534 from alberto-art3ch/fix/loan_product_details_using_charges

fix: Loan Product detail view using charges
This commit is contained in:
Gopi Kishan
2025-06-23 11:18:45 +05:30
committed by GitHub
2 changed files with 5 additions and 9 deletions
@@ -780,11 +780,7 @@
<mat-divider [inset]="true"></mat-divider>
<table
class="mat-elevation-z1 flex-fill"
mat-table
[dataSource]="loanProduct.charges | chargesPenaltyFilter: false"
>
<table class="mat-elevation-z1 flex-100" mat-table [dataSource]="loanProduct.charges | chargesPenaltyFilter: false">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Name' | translate }}</th>
<td mat-cell *matCellDef="let charge">
@@ -821,7 +817,7 @@
<mat-divider [inset]="true"></mat-divider>
<table class="mat-elevation-z1 flex-fill" mat-table [dataSource]="loanProduct.charges | chargesPenaltyFilter: true">
<table class="mat-elevation-z1 flex-100" mat-table [dataSource]="loanProduct.charges | chargesPenaltyFilter: true">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Name' | translate }}</th>
<td mat-cell *matCellDef="let overdueCharge">
@@ -148,7 +148,7 @@ export class LoanProductAccountingStepComponent implements OnInit, OnChanges {
this.loanProductAccountingForm.patchValue({
enableAccrualActivityPosting: this.loanProductsTemplate.enableAccrualActivityPosting
});
if (this.capitalizedIncome.enableIncomeCapitalization) {
if (this.capitalizedIncome && this.capitalizedIncome.enableIncomeCapitalization) {
this.loanProductAccountingForm.patchValue({
deferredIncomeLiabilityAccountId: accountingMappings.deferredIncomeLiabilityAccount.id,
incomeFromCapitalizationAccountId: accountingMappings.incomeFromCapitalizationAccount.id
@@ -165,7 +165,7 @@ export class LoanProductAccountingStepComponent implements OnInit, OnChanges {
incomeFromPenaltyAccountId: accountingMappings.incomeFromPenaltyAccount.id,
incomeFromRecoveryAccountId: accountingMappings.incomeFromRecoveryAccount.id,
writeOffAccountId: accountingMappings.writeOffAccount.id,
goodwillCreditAccountId: accountingMappings.goodwillCreditAccount.id,
goodwillCreditAccountId: accountingMappings.goodwillCreditAccount?.id || null,
overpaymentLiabilityAccountId: accountingMappings.overpaymentLiabilityAccount.id,
chargeOffFraudExpenseAccountId: accountingMappings.chargeOffFraudExpenseAccount
? accountingMappings.chargeOffFraudExpenseAccount.id
@@ -591,7 +591,7 @@ export class LoanProductAccountingStepComponent implements OnInit, OnChanges {
setCapitalizedIncomeControls() {
if (this.isAccountingAccrualBased) {
if (this.capitalizedIncome.enableIncomeCapitalization) {
if (this.capitalizedIncome && this.capitalizedIncome.enableIncomeCapitalization) {
this.loanProductAccountingForm.addControl(
'deferredIncomeLiabilityAccountId',
new UntypedFormControl('', Validators.required)