Fix repayment date change issue
Wrong initial transaction date; Fix transaction date disappearance after submit; Redirect to the "transactions" list
This commit is contained in:
committed by
Arnold Gálovics
parent
e8d0777204
commit
dca1c5f09a
+3
-6
@@ -72,8 +72,7 @@ export class MakeRepaymentComponent implements OnInit {
|
|||||||
setRepaymentLoanDetails() {
|
setRepaymentLoanDetails() {
|
||||||
this.paymentTypes = this.dataObject.paymentTypeOptions;
|
this.paymentTypes = this.dataObject.paymentTypeOptions;
|
||||||
this.repaymentLoanForm.patchValue({
|
this.repaymentLoanForm.patchValue({
|
||||||
transactionAmount: this.dataObject.amount,
|
transactionAmount: this.dataObject.amount
|
||||||
transactionDate: new Date(this.dataObject.date)
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,15 +101,13 @@ export class MakeRepaymentComponent implements OnInit {
|
|||||||
const prevTransactionDate: Date = this.repaymentLoanForm.value.transactionDate;
|
const prevTransactionDate: Date = this.repaymentLoanForm.value.transactionDate;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = this.settingsService.dateFormat;
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.repaymentLoanForm.patchValue({
|
|
||||||
transactionDate: this.dateUtils.formatDate(prevTransactionDate, dateFormat)
|
|
||||||
});
|
|
||||||
const repaymentLoanData = this.repaymentLoanForm.value;
|
const repaymentLoanData = this.repaymentLoanForm.value;
|
||||||
|
repaymentLoanData.transactionDate = this.dateUtils.formatDate(prevTransactionDate, dateFormat);
|
||||||
repaymentLoanData.locale = this.settingsService.language.code;
|
repaymentLoanData.locale = this.settingsService.language.code;
|
||||||
repaymentLoanData.dateFormat = dateFormat;
|
repaymentLoanData.dateFormat = dateFormat;
|
||||||
this.loanService.submitLoanActionButton(this.loanId, repaymentLoanData, 'repayment')
|
this.loanService.submitLoanActionButton(this.loanId, repaymentLoanData, 'repayment')
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
this.router.navigate(['../../../general'], { relativeTo: this.route });
|
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user