Skip to content

Commit 0966d2c

Browse files
authored
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
2 parents 9697d90 + ee5ee3d commit 0966d2c

File tree

15 files changed

+34
-4
lines changed

15 files changed

+34
-4
lines changed

src/app/loans/loans-view/loan-account-actions/write-off-page/write-off-page.component.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
<input matInput formControlName="amount" />
2727
</mat-form-field>
2828

29+
<mat-form-field>
30+
<mat-label>{{ 'labels.inputs.Reason for Write-Off' | translate }}</mat-label>
31+
<mat-select formControlName="writeoffReasonId">
32+
<mat-option *ngFor="let writeOffReason of writeOffReasonOptions" [value]="writeOffReason.id">
33+
{{ writeOffReason.name }}
34+
</mat-option>
35+
</mat-select>
36+
</mat-form-field>
37+
2938
<mat-form-field>
3039
<mat-label>{{ 'labels.inputs.Note' | translate }}</mat-label>
3140
<textarea matInput formControlName="note" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>

src/app/loans/loans-view/loan-account-actions/write-off-page/write-off-page.component.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
2424
})
2525
export class WriteOffPageComponent implements OnInit {
2626
@Input() dataObject: any;
27-
27+
/** Loan Id */
28+
loanId: string;
2829
/** Minimum Date allowed. */
2930
minDate = new Date(2000, 0, 1);
3031
/** Maximum Date allowed. */
3132
maxDate = new Date();
3233

3334
/** Write Off form. */
3435
writeOffForm: UntypedFormGroup;
36+
writeOffReasonOptions: any[] = [];
3537

3638
/**
3739
* Get data from `Resolver`.
@@ -49,11 +51,14 @@ export class WriteOffPageComponent implements OnInit {
4951
private dateUtils: Dates,
5052
private router: Router,
5153
private settingsService: SettingsService
52-
) {}
54+
) {
55+
this.loanId = this.route.snapshot.params['loanId'];
56+
}
5357

5458
ngOnInit() {
5559
this.maxDate = this.settingsService.businessDate;
5660
this.setWriteOffForm();
61+
this.writeOffReasonOptions = this.dataObject.writeOffReasonOptions;
5762
}
5863

5964
/**
@@ -66,6 +71,7 @@ export class WriteOffPageComponent implements OnInit {
6671
Validators.required
6772
],
6873
amount: [{ value: this.dataObject.amount, disabled: true }],
74+
writeoffReasonId: [''],
6975
note: ['']
7076
});
7177
}
@@ -81,14 +87,16 @@ export class WriteOffPageComponent implements OnInit {
8187
if (writeOffFormData.transactionDate instanceof Date) {
8288
writeOffFormData.transactionDate = this.dateUtils.formatDate(prevTransactionDate, dateFormat);
8389
}
90+
if (writeOffFormData.writeoffReasonId === null || writeOffFormData.writeoffReasonId === '') {
91+
delete writeOffFormData.writeoffReasonId;
92+
}
8493
const data = {
8594
...writeOffFormData,
8695
dateFormat,
8796
locale
8897
};
89-
const loanId = this.route.snapshot.params['loanId'];
9098
delete data.amount;
91-
this.loanService.submitLoanActionButton(loanId, data, 'writeoff').subscribe((response: any) => {
99+
this.loanService.submitLoanActionButton(this.loanId, data, 'writeoff').subscribe((response: any) => {
92100
this.router.navigate(['../../general'], { relativeTo: this.route });
93101
});
94102
}

src/assets/translations/cs-CS.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,6 +2139,7 @@
21392139
"Reason": "Důvod",
21402140
"Reason for Charge-Off": "Důvod pro nabíjení",
21412141
"Reason for Rescheduling": "Důvod přeplánování",
2142+
"Reason for Write-Off": "Důvod odepsání",
21422143
"Recalculate Interest": "Přepočítat úrok",
21432144
"Recalculate Interest based on new terms": "Přepočítat úrok na základě nových podmínek",
21442145
"Receipt No": "Potvrzení č",

src/assets/translations/de-DE.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,6 +2139,7 @@
21392139
"Reason": "Grund",
21402140
"Reason for Charge-Off": "Grund für die Abbuchung",
21412141
"Reason for Rescheduling": "Grund für die Umplanung",
2142+
"Reason for Write-Off": "Grund für die Abschreibung",
21422143
"Recalculate Interest": "Zinsen neu berechnen",
21432144
"Recalculate Interest based on new terms": "Zinsen basierend auf neuen Konditionen neu berechnen",
21442145
"Receipt No": "Quittung Nr",

src/assets/translations/en-US.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,6 +2146,7 @@
21462146
"Reason": "Reason",
21472147
"Reason for Charge-Off": "Reason for Charge-Off",
21482148
"Reason for Rescheduling": "Reason for Rescheduling",
2149+
"Reason for Write-Off": "Reason for Write-Off",
21492150
"Recalculate Interest": "Recalculate Interest",
21502151
"Recalculate Interest based on new terms": "Recalculate Interest based on new terms",
21512152
"Receipt No": "Receipt No",

src/assets/translations/es-CL.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,6 +2139,7 @@
21392139
"Reason": "Razón",
21402140
"Reason for Charge-Off": "Motivo de la cancelación",
21412141
"Reason for Rescheduling": "Motivo de la reprogramación",
2142+
"Reason for Write-Off": "Motivo de la cancelación",
21422143
"Recalculate Interest": "Recalcular el interés",
21432144
"Recalculate Interest based on new terms": "Recalcular el interés según los nuevos términos",
21442145
"Receipt No": "Número de recibo",

src/assets/translations/es-MX.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,6 +2139,7 @@
21392139
"Reason": "Razón",
21402140
"Reason for Charge-Off": "Motivo de la cancelación",
21412141
"Reason for Rescheduling": "Motivo de la reprogramación",
2142+
"Reason for Write-Off": "Motivo de la cancelación",
21422143
"Recalculate Interest": "Recalcular el interés",
21432144
"Recalculate Interest based on new terms": "Recalcular el interés según los nuevos términos",
21442145
"Receipt No": "Número de recibo",

src/assets/translations/fr-FR.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,6 +2139,7 @@
21392139
"Reason": "Raison",
21402140
"Reason for Charge-Off": "Raison de la radiation",
21412141
"Reason for Rescheduling": "Raison du report",
2142+
"Reason for Write-Off": "Motif de la radiation",
21422143
"Recalculate Interest": "Recalculer les intérêts",
21432144
"Recalculate Interest based on new terms": "Recalculer les intérêts en fonction de nouvelles conditions",
21442145
"Receipt No": "Numéro de reçu",

src/assets/translations/it-IT.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,6 +2139,7 @@
21392139
"Reason": "Motivo",
21402140
"Reason for Charge-Off": "Motivo dell'addebito",
21412141
"Reason for Rescheduling": "Motivo della riprogrammazione",
2142+
"Reason for Write-Off": "Motivo della cancellazione",
21422143
"Recalculate Interest": "Ricalcolare gli interessi",
21432144
"Recalculate Interest based on new terms": "Ricalcolare gli interessi in base ai nuovi termini",
21442145
"Receipt No": "Numero di ricevuta",

src/assets/translations/ko-KO.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,6 +2140,7 @@
21402140
"Reason": "이유",
21412141
"Reason for Charge-Off": "상각 사유",
21422142
"Reason for Rescheduling": "일정을 변경하는 이유",
2143+
"Reason for Write-Off": "삭감 사유",
21432144
"Recalculate Interest": "이자 재계산",
21442145
"Recalculate Interest based on new terms": "새로운 조건에 따라 이자를 다시 계산합니다.",
21452146
"Receipt No": "영수증 번호",

0 commit comments

Comments
 (0)