WEB-306: Allow customer to provide write-off reasons

This commit is contained in:
Jose Alberto Hernandez
2025-09-05 20:31:27 -05:00
parent 9697d90367
commit ee5ee3d66f
15 changed files with 34 additions and 4 deletions
@@ -26,6 +26,15 @@
<input matInput formControlName="amount" /> <input matInput formControlName="amount" />
</mat-form-field> </mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Reason for Write-Off' | translate }}</mat-label>
<mat-select formControlName="writeoffReasonId">
<mat-option *ngFor="let writeOffReason of writeOffReasonOptions" [value]="writeOffReason.id">
{{ writeOffReason.name }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field> <mat-form-field>
<mat-label>{{ 'labels.inputs.Note' | translate }}</mat-label> <mat-label>{{ 'labels.inputs.Note' | translate }}</mat-label>
<textarea matInput formControlName="note" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea> <textarea matInput formControlName="note" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
@@ -24,7 +24,8 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
}) })
export class WriteOffPageComponent implements OnInit { export class WriteOffPageComponent implements OnInit {
@Input() dataObject: any; @Input() dataObject: any;
/** Loan Id */
loanId: string;
/** Minimum Date allowed. */ /** Minimum Date allowed. */
minDate = new Date(2000, 0, 1); minDate = new Date(2000, 0, 1);
/** Maximum Date allowed. */ /** Maximum Date allowed. */
@@ -32,6 +33,7 @@ export class WriteOffPageComponent implements OnInit {
/** Write Off form. */ /** Write Off form. */
writeOffForm: UntypedFormGroup; writeOffForm: UntypedFormGroup;
writeOffReasonOptions: any[] = [];
/** /**
* Get data from `Resolver`. * Get data from `Resolver`.
@@ -49,11 +51,14 @@ export class WriteOffPageComponent implements OnInit {
private dateUtils: Dates, private dateUtils: Dates,
private router: Router, private router: Router,
private settingsService: SettingsService private settingsService: SettingsService
) {} ) {
this.loanId = this.route.snapshot.params['loanId'];
}
ngOnInit() { ngOnInit() {
this.maxDate = this.settingsService.businessDate; this.maxDate = this.settingsService.businessDate;
this.setWriteOffForm(); this.setWriteOffForm();
this.writeOffReasonOptions = this.dataObject.writeOffReasonOptions;
} }
/** /**
@@ -66,6 +71,7 @@ export class WriteOffPageComponent implements OnInit {
Validators.required Validators.required
], ],
amount: [{ value: this.dataObject.amount, disabled: true }], amount: [{ value: this.dataObject.amount, disabled: true }],
writeoffReasonId: [''],
note: [''] note: ['']
}); });
} }
@@ -81,14 +87,16 @@ export class WriteOffPageComponent implements OnInit {
if (writeOffFormData.transactionDate instanceof Date) { if (writeOffFormData.transactionDate instanceof Date) {
writeOffFormData.transactionDate = this.dateUtils.formatDate(prevTransactionDate, dateFormat); writeOffFormData.transactionDate = this.dateUtils.formatDate(prevTransactionDate, dateFormat);
} }
if (writeOffFormData.writeoffReasonId === null || writeOffFormData.writeoffReasonId === '') {
delete writeOffFormData.writeoffReasonId;
}
const data = { const data = {
...writeOffFormData, ...writeOffFormData,
dateFormat, dateFormat,
locale locale
}; };
const loanId = this.route.snapshot.params['loanId'];
delete data.amount; delete data.amount;
this.loanService.submitLoanActionButton(loanId, data, 'writeoff').subscribe((response: any) => { this.loanService.submitLoanActionButton(this.loanId, data, 'writeoff').subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route }); this.router.navigate(['../../general'], { relativeTo: this.route });
}); });
} }
+1
View File
@@ -2139,6 +2139,7 @@
"Reason": "Důvod", "Reason": "Důvod",
"Reason for Charge-Off": "Důvod pro nabíjení", "Reason for Charge-Off": "Důvod pro nabíjení",
"Reason for Rescheduling": "Důvod přeplánování", "Reason for Rescheduling": "Důvod přeplánování",
"Reason for Write-Off": "Důvod odepsání",
"Recalculate Interest": "Přepočítat úrok", "Recalculate Interest": "Přepočítat úrok",
"Recalculate Interest based on new terms": "Přepočítat úrok na základě nových podmínek", "Recalculate Interest based on new terms": "Přepočítat úrok na základě nových podmínek",
"Receipt No": "Potvrzení č", "Receipt No": "Potvrzení č",
+1
View File
@@ -2139,6 +2139,7 @@
"Reason": "Grund", "Reason": "Grund",
"Reason for Charge-Off": "Grund für die Abbuchung", "Reason for Charge-Off": "Grund für die Abbuchung",
"Reason for Rescheduling": "Grund für die Umplanung", "Reason for Rescheduling": "Grund für die Umplanung",
"Reason for Write-Off": "Grund für die Abschreibung",
"Recalculate Interest": "Zinsen neu berechnen", "Recalculate Interest": "Zinsen neu berechnen",
"Recalculate Interest based on new terms": "Zinsen basierend auf neuen Konditionen neu berechnen", "Recalculate Interest based on new terms": "Zinsen basierend auf neuen Konditionen neu berechnen",
"Receipt No": "Quittung Nr", "Receipt No": "Quittung Nr",
+1
View File
@@ -2146,6 +2146,7 @@
"Reason": "Reason", "Reason": "Reason",
"Reason for Charge-Off": "Reason for Charge-Off", "Reason for Charge-Off": "Reason for Charge-Off",
"Reason for Rescheduling": "Reason for Rescheduling", "Reason for Rescheduling": "Reason for Rescheduling",
"Reason for Write-Off": "Reason for Write-Off",
"Recalculate Interest": "Recalculate Interest", "Recalculate Interest": "Recalculate Interest",
"Recalculate Interest based on new terms": "Recalculate Interest based on new terms", "Recalculate Interest based on new terms": "Recalculate Interest based on new terms",
"Receipt No": "Receipt No", "Receipt No": "Receipt No",
+1
View File
@@ -2139,6 +2139,7 @@
"Reason": "Razón", "Reason": "Razón",
"Reason for Charge-Off": "Motivo de la cancelación", "Reason for Charge-Off": "Motivo de la cancelación",
"Reason for Rescheduling": "Motivo de la reprogramación", "Reason for Rescheduling": "Motivo de la reprogramación",
"Reason for Write-Off": "Motivo de la cancelación",
"Recalculate Interest": "Recalcular el interés", "Recalculate Interest": "Recalcular el interés",
"Recalculate Interest based on new terms": "Recalcular el interés según los nuevos términos", "Recalculate Interest based on new terms": "Recalcular el interés según los nuevos términos",
"Receipt No": "Número de recibo", "Receipt No": "Número de recibo",
+1
View File
@@ -2139,6 +2139,7 @@
"Reason": "Razón", "Reason": "Razón",
"Reason for Charge-Off": "Motivo de la cancelación", "Reason for Charge-Off": "Motivo de la cancelación",
"Reason for Rescheduling": "Motivo de la reprogramación", "Reason for Rescheduling": "Motivo de la reprogramación",
"Reason for Write-Off": "Motivo de la cancelación",
"Recalculate Interest": "Recalcular el interés", "Recalculate Interest": "Recalcular el interés",
"Recalculate Interest based on new terms": "Recalcular el interés según los nuevos términos", "Recalculate Interest based on new terms": "Recalcular el interés según los nuevos términos",
"Receipt No": "Número de recibo", "Receipt No": "Número de recibo",
+1
View File
@@ -2139,6 +2139,7 @@
"Reason": "Raison", "Reason": "Raison",
"Reason for Charge-Off": "Raison de la radiation", "Reason for Charge-Off": "Raison de la radiation",
"Reason for Rescheduling": "Raison du report", "Reason for Rescheduling": "Raison du report",
"Reason for Write-Off": "Motif de la radiation",
"Recalculate Interest": "Recalculer les intérêts", "Recalculate Interest": "Recalculer les intérêts",
"Recalculate Interest based on new terms": "Recalculer les intérêts en fonction de nouvelles conditions", "Recalculate Interest based on new terms": "Recalculer les intérêts en fonction de nouvelles conditions",
"Receipt No": "Numéro de reçu", "Receipt No": "Numéro de reçu",
+1
View File
@@ -2139,6 +2139,7 @@
"Reason": "Motivo", "Reason": "Motivo",
"Reason for Charge-Off": "Motivo dell'addebito", "Reason for Charge-Off": "Motivo dell'addebito",
"Reason for Rescheduling": "Motivo della riprogrammazione", "Reason for Rescheduling": "Motivo della riprogrammazione",
"Reason for Write-Off": "Motivo della cancellazione",
"Recalculate Interest": "Ricalcolare gli interessi", "Recalculate Interest": "Ricalcolare gli interessi",
"Recalculate Interest based on new terms": "Ricalcolare gli interessi in base ai nuovi termini", "Recalculate Interest based on new terms": "Ricalcolare gli interessi in base ai nuovi termini",
"Receipt No": "Numero di ricevuta", "Receipt No": "Numero di ricevuta",
+1
View File
@@ -2140,6 +2140,7 @@
"Reason": "이유", "Reason": "이유",
"Reason for Charge-Off": "상각 사유", "Reason for Charge-Off": "상각 사유",
"Reason for Rescheduling": "일정을 변경하는 이유", "Reason for Rescheduling": "일정을 변경하는 이유",
"Reason for Write-Off": "삭감 사유",
"Recalculate Interest": "이자 재계산", "Recalculate Interest": "이자 재계산",
"Recalculate Interest based on new terms": "새로운 조건에 따라 이자를 다시 계산합니다.", "Recalculate Interest based on new terms": "새로운 조건에 따라 이자를 다시 계산합니다.",
"Receipt No": "영수증 번호", "Receipt No": "영수증 번호",
+1
View File
@@ -2139,6 +2139,7 @@
"Reason": "Priežastis", "Reason": "Priežastis",
"Reason for Charge-Off": "Apmokestinimo priežastis", "Reason for Charge-Off": "Apmokestinimo priežastis",
"Reason for Rescheduling": "Perkėlimo priežastis", "Reason for Rescheduling": "Perkėlimo priežastis",
"Reason for Write-Off": "Nurašymo priežastis",
"Recalculate Interest": "Perskaičiuoti palūkanas", "Recalculate Interest": "Perskaičiuoti palūkanas",
"Recalculate Interest based on new terms": "Perskaičiuokite palūkanas pagal naujas sąlygas", "Recalculate Interest based on new terms": "Perskaičiuokite palūkanas pagal naujas sąlygas",
"Receipt No": "Kvitas Nr", "Receipt No": "Kvitas Nr",
+1
View File
@@ -2139,6 +2139,7 @@
"Reason": "Iemesls", "Reason": "Iemesls",
"Reason for Charge-Off": "Izmaksas iemesls", "Reason for Charge-Off": "Izmaksas iemesls",
"Reason for Rescheduling": "Pārplānošanas iemesls", "Reason for Rescheduling": "Pārplānošanas iemesls",
"Reason for Write-Off": "Norakstīšanas iemesls",
"Recalculate Interest": "Pārrēķināt procentus", "Recalculate Interest": "Pārrēķināt procentus",
"Recalculate Interest based on new terms": "Pārrēķiniet procentus, pamatojoties uz jauniem noteikumiem", "Recalculate Interest based on new terms": "Pārrēķiniet procentus, pamatojoties uz jauniem noteikumiem",
"Receipt No": "Kvīts Nr", "Receipt No": "Kvīts Nr",
+1
View File
@@ -2139,6 +2139,7 @@
"Reason": "कारण", "Reason": "कारण",
"Reason for Charge-Off": "चार्ज-अफको कारण", "Reason for Charge-Off": "चार्ज-अफको कारण",
"Reason for Rescheduling": "पुन: तालिकाको कारण", "Reason for Rescheduling": "पुन: तालिकाको कारण",
"Reason for Write-Off": "राइट-अफको कारण",
"Recalculate Interest": "ब्याज पुन: गणना गर्नुहोस्", "Recalculate Interest": "ब्याज पुन: गणना गर्नुहोस्",
"Recalculate Interest based on new terms": "नयाँ सर्तहरूमा आधारित ब्याज पुन: गणना गर्नुहोस्", "Recalculate Interest based on new terms": "नयाँ सर्तहरूमा आधारित ब्याज पुन: गणना गर्नुहोस्",
"Receipt No": "रसिद नं", "Receipt No": "रसिद नं",
+1
View File
@@ -2139,6 +2139,7 @@
"Reason": "Razão", "Reason": "Razão",
"Reason for Charge-Off": "Motivo da cobrança", "Reason for Charge-Off": "Motivo da cobrança",
"Reason for Rescheduling": "Motivo do reagendamento", "Reason for Rescheduling": "Motivo do reagendamento",
"Reason for Write-Off": "Motivo da baixa",
"Recalculate Interest": "Recalcular juros", "Recalculate Interest": "Recalcular juros",
"Recalculate Interest based on new terms": "Recalcular juros com base em novos termos", "Recalculate Interest based on new terms": "Recalcular juros com base em novos termos",
"Receipt No": "Número do recibo", "Receipt No": "Número do recibo",
+1
View File
@@ -2139,6 +2139,7 @@
"Reason": "Sababu", "Reason": "Sababu",
"Reason for Charge-Off": "Sababu ya Kuzimwa", "Reason for Charge-Off": "Sababu ya Kuzimwa",
"Reason for Rescheduling": "Sababu ya Kupanga Upya", "Reason for Rescheduling": "Sababu ya Kupanga Upya",
"Reason for Write-Off": "Sababu ya Kufuta",
"Recalculate Interest": "Kokotoa upya Maslahi", "Recalculate Interest": "Kokotoa upya Maslahi",
"Recalculate Interest based on new terms": "Kokotoa upya Maslahi kulingana na masharti mapya", "Recalculate Interest based on new terms": "Kokotoa upya Maslahi kulingana na masharti mapya",
"Receipt No": "Risiti Na", "Receipt No": "Risiti Na",