Switched on the @typescript-eslint/no-non-null-assertion rule in eslint.
Fixed the errors it threw up.
This commit is contained in:
@@ -159,7 +159,7 @@ export class PaymentComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
[this.paymentJournal] = this.voucher.journals.filter((x) => x.debit === -1);
|
||||
this.form.setValue({
|
||||
date: moment(this.voucher.date, 'DD-MMM-YYYY').toDate(),
|
||||
paymentAccount: this.paymentJournal.account.id!,
|
||||
paymentAccount: this.paymentJournal.account.id ?? '',
|
||||
paymentAmount: this.paymentJournal.amount,
|
||||
addRow: {
|
||||
account: '',
|
||||
@@ -180,7 +180,7 @@ export class PaymentComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
addRow() {
|
||||
const amount = this.math.parseAmount(this.form.value.addRow?.amount!, 2);
|
||||
const amount = this.math.parseAmount(this.form.value.addRow?.amount ?? '0', 2);
|
||||
const debit = 1;
|
||||
if (this.account === null || amount <= 0) {
|
||||
return;
|
||||
@@ -305,7 +305,7 @@ export class PaymentComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
const formModel = this.form.value;
|
||||
this.voucher.date = moment(formModel.date).format('DD-MMM-YYYY');
|
||||
this.paymentJournal.account.id = formModel.paymentAccount;
|
||||
this.voucher.narration = formModel.narration!;
|
||||
this.voucher.narration = formModel.narration ?? '';
|
||||
return this.voucher;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user