diff --git a/models/baseModels/Account/Account.ts b/models/baseModels/Account/Account.ts index 55ebfe16..1d222d1b 100644 --- a/models/baseModels/Account/Account.ts +++ b/models/baseModels/Account/Account.ts @@ -19,11 +19,15 @@ export class Account extends Doc { parentAccount?: string; get isDebit() { - const debitAccounts = [ - AccountRootTypeEnum.Asset, - AccountRootTypeEnum.Expense, - ] as AccountRootType[]; - return debitAccounts.includes(this.rootType!); + if (this.rootType === AccountRootTypeEnum.Asset) { + return true; + } + + if (this.rootType === AccountRootTypeEnum.Expense) { + return true; + } + + return false; } get isCredit() { @@ -100,7 +104,7 @@ export class Account extends Doc { isGroup: true, }; - if (doc.rootType) { + if (doc?.rootType) { filter.rootType = doc.rootType as string; } diff --git a/src/components/QuickView.vue b/src/components/QuickView.vue index 071bb004..50638939 100644 --- a/src/components/QuickView.vue +++ b/src/components/QuickView.vue @@ -69,6 +69,10 @@ export default defineComponent({ }) )[0]; + if (!data) { + return; + } + this.values = fields .map((f) => { const value = data[f.fieldname]; diff --git a/src/errorHandling.ts b/src/errorHandling.ts index d52922ff..731782f4 100644 --- a/src/errorHandling.ts +++ b/src/errorHandling.ts @@ -36,7 +36,7 @@ export async function sendError(errorLogObj: ErrorLog) { device_id: fyo.store.deviceId, open_count: fyo.store.openCount, country_code: fyo.singles.SystemSettings?.countryCode, - more: stringifyCircular(errorLogObj.more!), + more: stringifyCircular(errorLogObj.more), }; if (fyo.store.isDevelopment) {