Switched on the @typescript-eslint/no-non-null-assertion rule in eslint.
Fixed the errors it threw up.
This commit is contained in:
@ -158,7 +158,7 @@ export class ReceiptComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
[this.receiptJournal] = this.voucher.journals.filter((x) => x.debit === 1);
|
||||
this.form.setValue({
|
||||
date: moment(this.voucher.date, 'DD-MMM-YYYY').toDate(),
|
||||
receiptAccount: this.receiptJournal.account.id!,
|
||||
receiptAccount: this.receiptJournal.account.id ?? '',
|
||||
receiptAmount: this.receiptJournal.amount,
|
||||
addRow: {
|
||||
account: '',
|
||||
@ -179,7 +179,7 @@ export class ReceiptComponent 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;
|
||||
@ -304,7 +304,7 @@ export class ReceiptComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
const formModel = this.form.value;
|
||||
this.voucher.date = moment(formModel.date).format('DD-MMM-YYYY');
|
||||
this.receiptJournal.account.id = formModel.receiptAccount;
|
||||
this.voucher.narration = formModel.narration!;
|
||||
this.voucher.narration = formModel.narration ?? '';
|
||||
return this.voucher;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user