diff --git a/src/app/clients/clients-view/clients-view.component.ts b/src/app/clients/clients-view/clients-view.component.ts index 3c640346b5..839ea44483 100644 --- a/src/app/clients/clients-view/clients-view.component.ts +++ b/src/app/clients/clients-view/clients-view.component.ts @@ -276,6 +276,9 @@ export class ClientsViewComponent implements OnInit { data: { deleteContext: `client with id: ${this.clientViewData.id}` } }); deleteClientDialogRef.afterClosed().subscribe((response: any) => { + if (!response) { + return; + } if (response.delete) { this.clientsService.deleteClient(this.clientViewData.id).subscribe(() => { this.router.navigate(['/clients'], { relativeTo: this.route }); @@ -290,6 +293,9 @@ export class ClientsViewComponent implements OnInit { private unassignStaff() { const unAssignStaffDialogRef = this.dialog.open(UnassignStaffDialogComponent); unAssignStaffDialogRef.afterClosed().subscribe((response: { confirm: any }) => { + if (!response) { + return; + } if (response.confirm) { this.clientsService .executeClientCommand(this.clientViewData.id, 'unassignStaff', { staffId: this.clientViewData.staffId }) @@ -312,6 +318,9 @@ export class ClientsViewComponent implements OnInit { } }); viewSignatureDialogRef.afterClosed().subscribe((response: any) => { + if (!response) { + return; + } if (response.upload) { this.uploadSignature(); } else if (response.draw) { @@ -360,6 +369,9 @@ export class ClientsViewComponent implements OnInit { data: documents }); deleteSignatureDialogRef.afterClosed().subscribe((response: any) => { + if (!response) { + return; + } if (response.delete) { this.clientsService.deleteClientDocument(this.clientViewData.id, response.id).subscribe(() => { this.reload(); diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts index 5d7efe0e89..2efc8f4e2c 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts @@ -139,7 +139,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit { if (this.recurringDepositsAccountData.charges && this.recurringDepositsAccountData.status.value === 'Matured') { this.charges.forEach((element: any) => { - if (element.name === 'Annual fee - INR') { + if (element.chargeTimeType?.id === 7) { this.buttonConfig.addOption({ name: 'Apply Annual Fees', taskPermissionName: 'APPLYANNUALFEE_SAVINGSACCOUNT' @@ -157,7 +157,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit { } if (this.recurringDepositsAccountData.charges) { this.charges.forEach((element: any) => { - if (element.name === 'Annual fee - INR') { + if (element.chargeTimeType?.id === 7) { this.buttonConfig.addOption({ name: 'Apply Annual Fees', taskPermissionName: 'APPLYANNUALFEE_SAVINGSACCOUNT' diff --git a/src/app/loans/loans-view/loans-view.component.ts b/src/app/loans/loans-view/loans-view.component.ts index 43ba0bfd89..fbc94370c6 100644 --- a/src/app/loans/loans-view/loans-view.component.ts +++ b/src/app/loans/loans-view/loans-view.component.ts @@ -469,6 +469,9 @@ export class LoansViewComponent extends LoanProductBaseComponent implements OnIn } }); recoverFromGuarantorDialogRef.afterClosed().subscribe((response: any) => { + if (!response) { + return; + } if (response.confirm) { this.loansService.loanActionButtons(this.loanId, 'recoverGuarantees').subscribe(() => { this.reload(); @@ -500,6 +503,9 @@ export class LoansViewComponent extends LoanProductBaseComponent implements OnIn } }); undoTransactionAccountDialogRef.afterClosed().subscribe((response: any) => { + if (!response) { + return; + } if (response.confirm) { let undoCommand: string = ''; switch (actionName) { @@ -564,6 +570,9 @@ export class LoansViewComponent extends LoanProductBaseComponent implements OnIn data: { deleteContext: `with loan id: ${this.loanId}` } }); deleteGuarantorDialogRef.afterClosed().subscribe((response: any) => { + if (!response) { + return; + } if (response.delete) { this.loansService.deleteLoanAccount(this.loanId).subscribe(() => { this.router.navigate(['../../'], { relativeTo: this.route }); diff --git a/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts b/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts index a48d332d98..d23a608077 100644 --- a/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts +++ b/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts @@ -92,7 +92,7 @@ export class ApplyAnnualFeesSavingsAccountComponent implements OnInit { applyCharge() { const charges: any[] = this.savingsAccountData.charges; charges.forEach((charge: any) => { - if (charge.name === 'Annual fee - INR') { + if (charge.chargeTimeType?.id === 7) { this.chargeId = charge.id; this.applyAnnualFeesForm.get('amount').patchValue(charge.amount); } diff --git a/src/app/savings/savings-account-view/savings-account-view.component.ts b/src/app/savings/savings-account-view/savings-account-view.component.ts index 849f93f6a5..35996fc02a 100644 --- a/src/app/savings/savings-account-view/savings-account-view.component.ts +++ b/src/app/savings/savings-account-view/savings-account-view.component.ts @@ -156,7 +156,7 @@ export class SavingsAccountViewComponent implements OnInit { if (this.savingsAccountData.charges) { const charges: any[] = this.savingsAccountData.charges; charges.forEach((charge: any) => { - if (charge.name === 'Annual fee - INR') { + if (charge.chargeTimeType?.id === 7) { this.buttonConfig.addOption({ name: 'Apply Annual Fees', taskPermissionName: 'APPLYANNUALFEE_SAVINGSACCOUNT' @@ -281,6 +281,9 @@ export class SavingsAccountViewComponent implements OnInit { data: { deleteContext: `savings account with id: ${this.savingsAccountData.id}` } }); deleteSavingsAccountDialogRef.afterClosed().subscribe((response: any) => { + if (!response) { + return; + } if (response.delete) { this.savingsService.deleteSavingsAccount(this.savingsAccountData.id).subscribe(() => { this.router.navigate(['../../'], { relativeTo: this.route }); @@ -295,6 +298,9 @@ export class SavingsAccountViewComponent implements OnInit { private calculateInterest() { const calculateInterestAccountDialogRef = this.dialog.open(CalculateInterestDialogComponent); calculateInterestAccountDialogRef.afterClosed().subscribe((response: any) => { + if (!response) { + return; + } if (response.confirm) { this.savingsService .executeSavingsAccountCommand(this.savingsAccountData.id, 'calculateInterest', {}) @@ -311,6 +317,9 @@ export class SavingsAccountViewComponent implements OnInit { private postInterest() { const postInterestAccountDialogRef = this.dialog.open(PostInterestDialogComponent); postInterestAccountDialogRef.afterClosed().subscribe((response: any) => { + if (!response) { + return; + } if (response.confirm) { this.savingsService .executeSavingsAccountCommand(this.savingsAccountData.id, 'postInterest', {}) @@ -329,6 +338,9 @@ export class SavingsAccountViewComponent implements OnInit { data: { isEnable: true } }); deleteSavingsAccountDialogRef.afterClosed().subscribe((response: any) => { + if (!response) { + return; + } if (response.confirm) { this.savingsService .executeSavingsAccountUpdateCommand(this.savingsAccountData.id, 'updateWithHoldTax', { withHoldTax: true }) @@ -347,6 +359,9 @@ export class SavingsAccountViewComponent implements OnInit { data: { isEnable: false } }); disableWithHoldTaxDialogRef.afterClosed().subscribe((response: any) => { + if (!response) { + return; + } if (response.confirm) { this.savingsService .executeSavingsAccountUpdateCommand(this.savingsAccountData.id, 'updateWithHoldTax', { withHoldTax: false }) @@ -378,6 +393,9 @@ export class SavingsAccountViewComponent implements OnInit { command = 'unblockDebit'; } unblockSavingsAccountDialogRef.afterClosed().subscribe((response: { confirm: any }) => { + if (!response) { + return; + } if (response.confirm) { this.savingsService.executeSavingsAccountCommand(this.savingsAccountData.id, command, {}).subscribe(() => { this.reload(); diff --git a/src/app/shares/shares-account-view/shares-account-view.component.ts b/src/app/shares/shares-account-view/shares-account-view.component.ts index 28cfc1f28c..ad89352ae1 100644 --- a/src/app/shares/shares-account-view/shares-account-view.component.ts +++ b/src/app/shares/shares-account-view/shares-account-view.component.ts @@ -118,9 +118,9 @@ export class SharesAccountViewComponent implements OnInit { if (this.sharesAccountData.charges) { const charges: any[] = this.sharesAccountData.charges; charges.forEach((charge: any) => { - if (charge.name === 'Annual fee - INR') { + if (charge.chargeTimeType?.id === 7) { this.buttonConfig.addOption({ - name: 'Apply Anuual Fees', + name: 'Apply Annual Fees', taskPermissionName: 'APPLYANNUALFEE_SAVINGSACCOUNT' }); }