-
Notifications
You must be signed in to change notification settings - Fork 961
Fix: Make "Apply Annual Fees" currency-agnostic for non-INR deployments #3552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if the id is not 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) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if the id is not 7? |
||
| this.buttonConfig.addOption({ | ||
| name: 'Apply Annual Fees', | ||
| taskPermissionName: 'APPLYANNUALFEE_SAVINGSACCOUNT' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if the id is not 7?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the same applies for savings too. If the id is not 7, the Annual Fee action is not shown, because 7 is the backend chargeTimeType id for Annual Fee. |
||
| this.chargeId = charge.id; | ||
| this.applyAnnualFeesForm.get('amount').patchValue(charge.amount); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if the id is not 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(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if the id is not 7?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the id is not 7, the action is not added, so the “Apply Annual Fees” option won’t be shown. That is intentional because this feature is only meant for the Annual Fee charge type. |
||
| this.buttonConfig.addOption({ | ||
| name: 'Apply Anuual Fees', | ||
| name: 'Apply Annual Fees', | ||
| taskPermissionName: 'APPLYANNUALFEE_SAVINGSACCOUNT' | ||
| }); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.