Fix: Add the reason text for ReAge and ReAmortize Loan transactions

This commit is contained in:
Jose Alberto Hernandez
2024-03-07 14:54:12 +01:00
committed by Adam Saghy
parent f52efaef44
commit d1b2195423
6 changed files with 24 additions and 4 deletions
@@ -34,6 +34,13 @@
</mat-error>
</mat-form-field>
<div fxLayout="column">
<mat-form-field>
<mat-label>{{"labels.inputs.Reason" | translate}}</mat-label>
<input matInput formControlName="note">
</mat-form-field>
</div>
<mat-form-field>
<mat-label>{{"labels.inputs.External Id" | translate}}</mat-label>
<input matInput formControlName="externalId">
@@ -47,6 +47,7 @@ export class LoanReagingComponent implements OnInit {
'numberOfInstallments': [1, Validators.required],
'startDate': [this.settingsService.businessDate, Validators.required],
'frequency': [, Validators.required],
'note': '',
'externalId': ''
});
}
@@ -6,6 +6,13 @@
<mat-card-content>
<div fxLayout="column">
<mat-form-field>
<mat-label>{{"labels.inputs.Reason" | translate}}</mat-label>
<input matInput formControlName="note">
</mat-form-field>
</div>
<div fxLayout="column">
<mat-form-field>
<mat-label>{{"labels.inputs.External Id" | translate}}</mat-label>
@@ -28,6 +28,7 @@ export class LoanReamortizeComponent implements OnInit {
createReAmortizeLoanForm() {
this.reamortizeLoanForm = this.formBuilder.group({
'note': '',
'externalId': ''
});
}
@@ -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 });
}
}
@@ -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;
}
});