Merge pull request #2636 from alberto-art3ch/WEB-306/allow-customer-to-provide-write-off-reasons

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