diff --git a/src/app/centers/centers-view/centers-view.component.ts b/src/app/centers/centers-view/centers-view.component.ts index 853fa8920..233aa8e59 100644 --- a/src/app/centers/centers-view/centers-view.component.ts +++ b/src/app/centers/centers-view/centers-view.component.ts @@ -98,7 +98,6 @@ export class CentersViewComponent implements OnInit { * Unassign's the centers's staff. */ private centersUnassignStaff() { - const dialogcontext: string = "" const unAssignStaffDialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { heading: this.translateService.instant('labels.heading.Unassign Staff'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want Unassign Staff') } }); diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.ts index 36f441f08..7c8c6a941 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.ts @@ -66,7 +66,7 @@ export class ChargesTabComponent implements OnInit { private router: Router, public dialog: MatDialog, private translateService: TranslateService, - private settingsService: SettingsService,) { + private settingsService: SettingsService) { this.route.parent.data.subscribe((data: { recurringDepositsAccountData: any }) => { this.recurringDepositsAccountData = data.recurringDepositsAccountData; this.chargesData = this.recurringDepositsAccountData.charges; @@ -128,7 +128,9 @@ export class ChargesTabComponent implements OnInit { * @param {any} chargeId Charge Id */ waiveCharge(chargeId: any) { - const waiveChargeDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { data: { heading: this.translateService.instant('labels.heading.Waive Charge'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to waive charge with id: ')+ `${chargeId} ?` } }); + const waiveChargeDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, + { data: { heading: this.translateService.instant('labels.heading.Waive Charge'), + dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to waive charge with id: ') + `${chargeId} ?` } }); waiveChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { this.savingsService.executeSavingsAccountChargesCommand(this.recurringDepositsAccountData.id, 'waive', {}, chargeId) 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 0807ffdbc..0760ea6a4 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 @@ -50,7 +50,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit { private recurringDepositsService: RecurringDepositsService, private savingsService: SavingsService, public dialog: MatDialog, - private translateService:TranslateService) { + private translateService: TranslateService) { this.route.data.subscribe((data: { recurringDepositsAccountData: any, savingsDatatables: any }) => { this.recurringDepositsAccountData = data.recurringDepositsAccountData; this.charges = this.recurringDepositsAccountData.charges; @@ -225,7 +225,9 @@ export class RecurringDepositsAccountViewComponent implements OnInit { */ private postInterest() { const postInterestAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { - data: { heading: this.translateService.instant('labels.heading.Post Interest'), dialogContext:this.translateService.instant('lables.dialogContext.Are you sure you want to post interest ?') } + data: { heading: this.translateService.instant('labels.heading.Post Interest'), + dialogContext: this.translateService.instant('lables.dialogContext.Are you sure you want to post interest ?') + } }); postInterestAccountDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.ts index c9462f5ad..549ed3def 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.ts @@ -25,7 +25,6 @@ export class ViewTransactionComponent { /** Transaction data. */ transactionData: any; - /** * Retrieves the Transaction data from `resolve`. @@ -41,7 +40,7 @@ export class ViewTransactionComponent { private dateUtils: Dates, private router: Router, public dialog: MatDialog, - private translateService:TranslateService, + private translateService: TranslateService, private settingsService: SettingsService, ) { this.route.data.subscribe((data: { recurringDepositsAccountTransaction: any }) => { this.transactionData = data.recurringDepositsAccountTransaction; diff --git a/src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.html b/src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.html index 80259a7c8..0744d0de0 100644 --- a/src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.html +++ b/src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.html @@ -54,7 +54,7 @@
- {{"labels.inputs.Loan term" | translate}}: + {{"labels.inputs.Loan Term" | translate}}: {{ loansAccount.loanTermFrequency }} {{loansAccount.loanTermFrequencyType | find: loansAccountProductTemplate.termFrequencyTypeOptions:'id':'name'}}
diff --git a/src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts b/src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts index e34557e8b..3820d0402 100644 --- a/src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts +++ b/src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts @@ -179,7 +179,9 @@ export class TransactionsTabComponent implements OnInit { } const undoTransactionAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, { - data: { heading: this.translateService.instant('labels.heading.Undo Transaction'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction type') + `${transaction.type.value}` + this.translateService.instant('labels.dialogContext.with id') + `${transaction.id}` } + data: { heading: this.translateService.instant('labels.heading.Undo Transaction'), + dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction type') + `${transaction.type.value}` + this.translateService.instant('labels.dialogContext.with id') + `${transaction.id}` + } }); undoTransactionAccountDialogRef.afterClosed().subscribe((response: { confirm: any }) => { if (response.confirm) { diff --git a/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.html b/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.html index 12fbf73f9..453d8b7e8 100644 --- a/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.html +++ b/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.html @@ -384,7 +384,13 @@
Delinquency Bucket: - {{ loanProduct.delinquencyBucket.name }} + {{ loanProduct.delinquencyBucket.name }} + {{ 'labels.inputs.Unassigned' | translate }} +
+ +
+ Delinquency Bucket: + {{ 'labels.inputs.Unassigned' | translate }}
diff --git a/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.ts b/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.ts index f7999f74e..4d3436a8b 100644 --- a/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.ts +++ b/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; -import { LoanProduct } from '../../models/loan-product.model'; +import { DelinquencyBucket, LoanProduct } from '../../models/loan-product.model'; import { AccountingMapping, Charge, ChargeToIncomeAccountMapping, GLAccount, PaymentChannelToFundSourceMapping, PaymentType, PaymentTypeOption } from '../../../../shared/models/general.model'; import { AdvancePaymentAllocationData, PaymentAllocation } from '../../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model'; import { LoanProducts } from '../../loan-products'; @@ -62,6 +62,7 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges { } else { 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 || []; @@ -162,6 +163,10 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges { optionValue = this.optionDataLookUp(this.loanProduct.repaymentStartDateType, this.loanProductsTemplate.repaymentStartDateTypeOptions); this.loanProduct.repaymentStartDateType = optionValue; + if (this.loanProduct.delinquencyBucketId) { + this.loanProduct.delinquencyBucket = this.delinquencyBucketLookUp(this.loanProduct.delinquencyBucketId, this.loanProductsTemplate.delinquencyBucketOptions); + } + const codeValue: CodeName = this.codeNameLookUpByCode(this.loanProduct.transactionProcessingStrategyCode, this.loanProductsTemplate.transactionProcessingStrategyOptions); this.loanProduct.transactionProcessingStrategyName = codeValue.name; @@ -275,6 +280,18 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges { return paymentType; } + delinquencyBucketLookUp(delinquencyBucketId: any, delinquencyBuckets: DelinquencyBucket[]): DelinquencyBucket { + let delinquencyBucketData: DelinquencyBucket | null = null; + if (delinquencyBucketId) { + delinquencyBuckets.some((delinquencyBucket: DelinquencyBucket) => { + if (delinquencyBucket.id === delinquencyBucketId) { + delinquencyBucketData = { id: delinquencyBucket.id, name: delinquencyBucket.name }; + } + }); + } + return delinquencyBucketData; + } + accountingRule(): number { return this.loanProduct.accountingRule.id ? this.loanProduct.accountingRule.id : this.loanProduct.accountingRule; diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html index 66e8544ac..494cc408b 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html @@ -168,6 +168,10 @@ {{ delinquencyBucket.name }} + diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts index 39c4c0725..7b70c535c 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts @@ -496,6 +496,16 @@ export class LoanProductSettingsStepComponent implements OnInit { return value; } + clearProperty($event: Event, propertyName: string): void { + if (propertyName === 'delinquencyBucketId') { + this.loanProductSettingsForm.patchValue({ + 'delinquencyBucketId': '' + }); + } + this.loanProductSettingsForm.markAsDirty(); + $event.stopPropagation(); + } + get loanProductSettings() { const productSettings = this.loanProductSettingsForm.value; if (!this.loanProductSettingsForm.value.multiDisburseLoan) { @@ -505,6 +515,9 @@ export class LoanProductSettingsStepComponent implements OnInit { productSettings['dueDaysForRepaymentEvent'] = null; productSettings['overDueDaysForRepaymentEvent'] = null; } + if (productSettings['delinquencyBucketId'] === '') { + delete productSettings['delinquencyBucketId']; + } return productSettings; } diff --git a/src/app/products/loan-products/models/loan-product.model.ts b/src/app/products/loan-products/models/loan-product.model.ts index 303885a16..0e3af4889 100644 --- a/src/app/products/loan-products/models/loan-product.model.ts +++ b/src/app/products/loan-products/models/loan-product.model.ts @@ -82,6 +82,7 @@ export interface LoanProduct { isEqualAmortization: boolean; delinquencyBucketOptions: DelinquencyBucket[]; delinquencyBucket: DelinquencyBucket; + delinquencyBucketId?: number; graceOnPrincipalPayment?: number; graceOnInterestPayment?: number; graceOnInterestCharged?: number; @@ -137,9 +138,9 @@ export interface AllowAttributeOverrides { } export interface DelinquencyBucket { - id: number; - name: string; - ranges: Range[]; + id: number; + name: string; + ranges?: Range[]; } export interface Range {