diff --git a/fyo/model/doc.ts b/fyo/model/doc.ts index 9330d3ce..ea16882d 100644 --- a/fyo/model/doc.ts +++ b/fyo/model/doc.ts @@ -86,6 +86,10 @@ export class Doc extends Observable { return this._notInserted; } + get inserted(): boolean { + return !this._notInserted; + } + get tableFields(): TargetField[] { return this.schema.fields.filter( (f) => f.fieldtype === FieldTypeEnum.Table diff --git a/main.ts b/main.ts index b4784dd0..87d8432c 100644 --- a/main.ts +++ b/main.ts @@ -84,7 +84,7 @@ export class Main { .ELECTRON_NODE_INTEGRATION as unknown as boolean, }, frame: this.isLinux, - resizable: true, + resizable: false, }; if (this.isDevelopment || this.isLinux) { Object.assign(options, { icon: this.icon }); @@ -139,6 +139,10 @@ export class Main { this.mainWindow = null; }); + this.mainWindow.on('will-resize', (e) => { + e.preventDefault(); + }); + this.mainWindow.webContents.on('did-finish-load', () => { if (this.mainWindow === null) { return; diff --git a/reports/BalanceSheet/BalanceSheet.ts b/reports/BalanceSheet/BalanceSheet.ts index bd704b7a..9129f899 100644 --- a/reports/BalanceSheet/BalanceSheet.ts +++ b/reports/BalanceSheet/BalanceSheet.ts @@ -13,6 +13,7 @@ import { getMapFromList } from 'utils'; export class BalanceSheet extends AccountReport { static title = t`Balance Sheet`; static reportName = 'balance-sheet'; + loading: boolean = false; get rootTypes(): AccountRootType[] { return [ @@ -23,6 +24,7 @@ export class BalanceSheet extends AccountReport { } async setReportData(filter?: string) { + this.loading = true; if (filter !== 'hideGroupAmounts') { await this._setRawData(); } @@ -55,6 +57,7 @@ export class BalanceSheet extends AccountReport { this.reportData = await this.getReportDataFromRows( getMapFromList(rootTypeRows, 'rootType') ); + this.loading = false; } async getReportDataFromRows( diff --git a/reports/GeneralLedger/GeneralLedger.ts b/reports/GeneralLedger/GeneralLedger.ts index ec169f73..0c39a12e 100644 --- a/reports/GeneralLedger/GeneralLedger.ts +++ b/reports/GeneralLedger/GeneralLedger.ts @@ -23,6 +23,7 @@ export class GeneralLedger extends LedgerReport { static title = t`General Ledger`; static reportName = 'general-ledger'; usePagination: boolean = true; + loading: boolean = false; ascending: boolean = false; reverted: boolean = false; @@ -42,6 +43,7 @@ export class GeneralLedger extends LedgerReport { } async setReportData(filter?: string) { + this.loading = true; let sort = true; if (filter !== 'grouped' || this._rawData.length === 0) { await this._setRawData(); @@ -78,6 +80,7 @@ export class GeneralLedger extends LedgerReport { }); this.reportData = this._convertEntriesToReportData(consolidated); + this.loading = false; } _setIndexOnEntries(map: GroupedMap) { diff --git a/reports/GoodsAndServiceTax/BaseGSTR.ts b/reports/GoodsAndServiceTax/BaseGSTR.ts index 92e39afa..245bec08 100644 --- a/reports/GoodsAndServiceTax/BaseGSTR.ts +++ b/reports/GoodsAndServiceTax/BaseGSTR.ts @@ -19,6 +19,7 @@ export abstract class BaseGSTR extends Report { transferType?: TransferType; usePagination: boolean = true; gstrRows?: GSTRRow[]; + loading: boolean = false; abstract gstrType: GSTRType; @@ -46,10 +47,12 @@ export abstract class BaseGSTR extends Report { } async setReportData(): Promise { + this.loading = true; const gstrRows = await this.getGstrRows(); const filteredRows = this.filterGstrRows(gstrRows); this.gstrRows = filteredRows; this.reportData = this.getReportDataFromGSTRRows(filteredRows); + this.loading = false; } getReportDataFromGSTRRows(gstrRows: GSTRRow[]): ReportData { diff --git a/reports/ProfitAndLoss/ProfitAndLoss.ts b/reports/ProfitAndLoss/ProfitAndLoss.ts index e4965624..40f5f67b 100644 --- a/reports/ProfitAndLoss/ProfitAndLoss.ts +++ b/reports/ProfitAndLoss/ProfitAndLoss.ts @@ -17,12 +17,14 @@ import { export class ProfitAndLoss extends AccountReport { static title = t`Profit And Loss`; static reportName = 'profit-and-loss'; + loading: boolean = false; get rootTypes(): AccountRootType[] { return [AccountRootTypeEnum.Income, AccountRootTypeEnum.Expense]; } async setReportData(filter?: string) { + this.loading = true; if (filter !== 'hideGroupAmounts') { await this._setRawData(); } @@ -66,6 +68,7 @@ export class ProfitAndLoss extends AccountReport { incomeRoot, expenseRoot ); + this.loading = false; } async getReportDataFromRows( diff --git a/reports/Report.ts b/reports/Report.ts index 4f000073..2e2797a4 100644 --- a/reports/Report.ts +++ b/reports/Report.ts @@ -14,6 +14,7 @@ export abstract class Report extends Observable { filters: Field[] = []; reportData: ReportData; usePagination: boolean = false; + abstract loading: boolean; constructor(fyo: Fyo) { super(); diff --git a/reports/TrialBalance/TrialBalance.ts b/reports/TrialBalance/TrialBalance.ts index 03720391..66c7c6f3 100644 --- a/reports/TrialBalance/TrialBalance.ts +++ b/reports/TrialBalance/TrialBalance.ts @@ -36,6 +36,7 @@ export class TrialBalance extends AccountReport { fromDate?: string; toDate?: string; hideGroupAmounts: boolean = false; + loading: boolean = false; _rawData: LedgerEntry[] = []; _dateRanges?: DateRange[]; @@ -53,6 +54,7 @@ export class TrialBalance extends AccountReport { } async setReportData(filter?: string) { + this.loading = true; if (filter !== 'hideGroupAmounts') { await this._setRawData(); } @@ -74,6 +76,7 @@ export class TrialBalance extends AccountReport { .filter((row) => !!row.rootNode); this.reportData = await this.getReportDataFromRows(rootTypeRows); + this.loading = false; } async getReportDataFromRows( diff --git a/src/components/Charts/BarChart.vue b/src/components/Charts/BarChart.vue index f0c32f69..d3726a59 100644 --- a/src/components/Charts/BarChart.vue +++ b/src/components/Charts/BarChart.vue @@ -161,10 +161,10 @@ export default { format: { type: Function, default: (n) => n.toFixed(1) }, formatY: { type: Function, default: prefixFormat }, formatX: { type: Function, default: (v) => v }, - fontSize: { type: Number, default: 25 }, + fontSize: { type: Number, default: 22 }, fontColor: { type: String, default: '#415668' }, bottom: { type: Number, default: 0 }, - width: { type: Number, default: 34 }, + width: { type: Number, default: 28 }, left: { type: Number, default: 65 }, radius: { type: Number, default: 17 }, extendGridX: { type: Number, default: -20 }, diff --git a/src/components/Charts/LineChart.vue b/src/components/Charts/LineChart.vue index 3e4469f6..b2307146 100644 --- a/src/components/Charts/LineChart.vue +++ b/src/components/Charts/LineChart.vue @@ -160,7 +160,7 @@ export default { format: { type: Function, default: (n) => n.toFixed(1) }, formatY: { type: Function, default: prefixFormat }, formatX: { type: Function, default: (v) => v }, - fontSize: { type: Number, default: 18 }, + fontSize: { type: Number, default: 20 }, fontColor: { type: String, default: '#415668' }, bottom: { type: Number, default: 0 }, left: { type: Number, default: 55 }, diff --git a/src/components/Report/ListReport.vue b/src/components/Report/ListReport.vue index 356ac69b..5e1bab09 100644 --- a/src/components/Report/ListReport.vue +++ b/src/components/Report/ListReport.vue @@ -1,7 +1,7 @@