From d1b21954236970e8e290fa1426f79cd9db284a4e Mon Sep 17 00:00:00 2001 From: Jose Alberto Hernandez Date: Wed, 6 Mar 2024 07:25:51 -0600 Subject: [PATCH] Fix: Add the reason text for ReAge and ReAmortize Loan transactions --- .../loan-reaging/loan-reaging.component.html | 7 +++++++ .../loan-reaging/loan-reaging.component.ts | 1 + .../loan-reamortize/loan-reamortize.component.html | 7 +++++++ .../loan-reamortize/loan-reamortize.component.ts | 1 + .../transactions-tab/transactions-tab.component.ts | 4 +++- .../view-transaction/view-transaction.component.ts | 8 +++++--- 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.html b/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.html index 49e7fb603..ad4b4e59d 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.html +++ b/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.html @@ -34,6 +34,13 @@ +
+ + {{"labels.inputs.Reason" | translate}} + + +
+ {{"labels.inputs.External Id" | translate}} diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.ts b/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.ts index 4b37d7a23..5552f5030 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.ts @@ -47,6 +47,7 @@ export class LoanReagingComponent implements OnInit { 'numberOfInstallments': [1, Validators.required], 'startDate': [this.settingsService.businessDate, Validators.required], 'frequency': [, Validators.required], + 'note': '', 'externalId': '' }); } diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.html b/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.html index 0b09cf8cb..bee2ee5eb 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.html +++ b/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.html @@ -6,6 +6,13 @@ +
+ + {{"labels.inputs.Reason" | translate}} + + +
+
{{"labels.inputs.External Id" | translate}} diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.ts b/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.ts index 58d3453ae..54de24bc2 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.ts @@ -28,6 +28,7 @@ export class LoanReamortizeComponent implements OnInit { createReAmortizeLoanForm() { this.reamortizeLoanForm = this.formBuilder.group({ + 'note': '', 'externalId': '' }); } 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 1d5e89d9d..4af57be3b 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 @@ -112,9 +112,11 @@ export class TransactionsTabComponent implements OnInit { * GOODWILL_CREDIT:23 * CHARGE_ADJUSTMENT:26 * DOWN_PAYMENT:28 + * REAGE:29 + * REAMORTIZE:30 */ showTransactions(transactionsData: any) { - if ([1, 2, 4, 9, 20, 21, 22, 23, 26, 28].includes(transactionsData.type.id)) { + if ([1, 2, 4, 9, 20, 21, 22, 23, 26, 28, 29, 30].includes(transactionsData.type.id)) { this.router.navigate([transactionsData.id], { relativeTo: this.route }); } } diff --git a/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.ts b/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.ts index 12a782aec..d9900bc1c 100644 --- a/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.ts +++ b/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.ts @@ -33,6 +33,7 @@ export class ViewTransactionComponent implements OnInit { /** Transaction data. */ transactionData: any; + transactionType: LoanTransactionType; /** Is Editable */ allowEdition = true; /** Is Undoable */ @@ -72,9 +73,10 @@ export class ViewTransactionComponent implements OnInit { private alertService: AlertService) { this.route.data.subscribe((data: { loansAccountTransaction: any }) => { this.transactionData = data.loansAccountTransaction; + this.transactionType = this.transactionData.type; this.allowEdition = !this.transactionData.manuallyReversed && !this.allowTransactionEdition(this.transactionData.type.id); this.allowUndo = !this.transactionData.manuallyReversed; - this.allowChargeback = this.allowChargebackTransaction(this.transactionData.type) && !this.transactionData.manuallyReversed; + this.allowChargeback = this.allowChargebackTransaction(this.transactionType) && !this.transactionData.manuallyReversed; let transactionsChargebackRelated = false; if (this.allowChargeback) { if (this.transactionData.transactionRelations) { @@ -89,13 +91,13 @@ export class ViewTransactionComponent implements OnInit { }); this.amountRelationsAllowed = this.transactionData.amount - amountRelations; this.isFullRelated = (this.amountRelationsAllowed === 0); - this.allowChargeback = this.allowChargebackTransaction(this.transactionData.type) && !this.isFullRelated; + this.allowChargeback = this.allowChargebackTransaction(this.transactionType) && !this.isFullRelated; } } if (!this.allowChargeback) { this.allowEdition = false; } - if (this.existTransactionRelations && transactionsChargebackRelated) { + if ((this.existTransactionRelations && transactionsChargebackRelated) || this.transactionType.reAge || this.transactionType.reAmortize) { this.allowUndo = false; } });