From 815b4843e23c47061f89de5d8945dfc3216d0465 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Mon, 2 Jun 2025 23:19:41 +1000 Subject: [PATCH] Include austax account kinds in chart of accounts --- libdrcr/plugins/austax/account_kinds.luau | 4 + package.json | 1 + pnpm-lock.yaml | 10 +++ src-tauri/Cargo.lock | 1 + src-tauri/Cargo.toml | 1 + src-tauri/capabilities/default.json | 3 + src-tauri/src/lib.rs | 1 + src/main.ts | 2 +- src/pages/ChartOfAccountsView.vue | 26 ++++--- src/{ => plugins}/austax/TaxSummaryReport.vue | 4 +- src/plugins/austax/account_kinds.ts | 75 +++++++++++++++++++ src/registry.ts | 13 +++- 12 files changed, 127 insertions(+), 14 deletions(-) rename src/{ => plugins}/austax/TaxSummaryReport.vue (88%) create mode 100644 src/plugins/austax/account_kinds.ts diff --git a/libdrcr/plugins/austax/account_kinds.luau b/libdrcr/plugins/austax/account_kinds.luau index 3fca6ad..afdbcae 100644 --- a/libdrcr/plugins/austax/account_kinds.luau +++ b/libdrcr/plugins/austax/account_kinds.luau @@ -15,6 +15,8 @@ -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . +-- NB: Content of this file is also parsed by frontend src/plugins/austax/account_kinds.ts +-- Check the syntax is compatible with that parser! local income_types = { {'income1', 'Salary or wages', '1'}, {'income2', 'Allowances, earnings, tips, director\'s fees etc.', '2'}, @@ -42,6 +44,8 @@ local income_types = { {'income24', 'Other income', '24'}, } +-- NB: Content of this file is also parsed by frontend src/plugins/austax/account_kinds.ts +-- Check the syntax is compatible with that parser! local deduction_types = { {'d1', 'Work-related car expenses', 'D1'}, {'d2', 'Work-related travel expenses', 'D2'}, diff --git a/package.json b/package.json index 5c42f07..3bdbb55 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@heroicons/vue": "^2.2.0", "@tauri-apps/api": "^2.5.0", "@tauri-apps/plugin-dialog": "~2.2.2", + "@tauri-apps/plugin-fs": "~2.3.0", "@tauri-apps/plugin-shell": "^2.2.1", "@tauri-apps/plugin-sql": "~2.2.0", "@tauri-apps/plugin-store": "~2.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index df54b27..91defa3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: '@tauri-apps/plugin-dialog': specifier: ~2.2.2 version: 2.2.2 + '@tauri-apps/plugin-fs': + specifier: ~2.3.0 + version: 2.3.0 '@tauri-apps/plugin-shell': specifier: ^2.2.1 version: 2.2.1 @@ -459,6 +462,9 @@ packages: '@tauri-apps/plugin-dialog@2.2.2': resolution: {integrity: sha512-Pm9qnXQq8ZVhAMFSEPwxvh+nWb2mk7LASVlNEHYaksHvcz8P6+ElR5U5dNL9Ofrm+uwhh1/gYKWswK8JJJAh6A==} + '@tauri-apps/plugin-fs@2.3.0': + resolution: {integrity: sha512-G9gEyYVUaaxhdRJBgQTTLmzAe0vtHYxYyN1oTQzU3zwvb8T+tVLcAqCdFMWHq0qGeGbmynI5whvYpcXo5LvZ1w==} + '@tauri-apps/plugin-shell@2.2.1': resolution: {integrity: sha512-G1GFYyWe/KlCsymuLiNImUgC8zGY0tI0Y3p8JgBCWduR5IEXlIJS+JuG1qtveitwYXlfJrsExt3enhv5l2/yhA==} @@ -1305,6 +1311,10 @@ snapshots: dependencies: '@tauri-apps/api': 2.5.0 + '@tauri-apps/plugin-fs@2.3.0': + dependencies: + '@tauri-apps/api': 2.5.0 + '@tauri-apps/plugin-shell@2.2.1': dependencies: '@tauri-apps/api': 2.5.0 diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 58192ff..0fe0fbc 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -804,6 +804,7 @@ dependencies = [ "tauri", "tauri-build", "tauri-plugin-dialog", + "tauri-plugin-fs", "tauri-plugin-shell", "tauri-plugin-sql", "tauri-plugin-store", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 2ecbb33..84bf0df 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -26,6 +26,7 @@ serde_json = "1" sqlx = { version = "0.8", features = ["json", "time"] } tauri = { version = "2", features = [] } tauri-plugin-dialog = "2" +tauri-plugin-fs = "2" tauri-plugin-shell = "2" tauri-plugin-sql = { version = "2", features = ["sqlite"] } tauri-plugin-store = "2" diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 4a93c57..baba95e 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -12,6 +12,9 @@ "core:window:allow-set-title", "core:window:allow-show", "dialog:default", + "fs:default", + "fs:allow-read-text-file", + "fs:allow-resource-read-recursive", "shell:allow-open", "sql:default", "sql:allow-execute", diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 8c70573..1bedc26 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -85,6 +85,7 @@ pub fn run() { Ok(()) }) .plugin(tauri_plugin_dialog::init()) + .plugin(tauri_plugin_fs::init()) .plugin(tauri_plugin_shell::init()) .plugin(tauri_plugin_sql::Builder::new().build()) .plugin(tauri_plugin_store::Builder::new().build()) diff --git a/src/main.ts b/src/main.ts index 1ddedf2..eefc581 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,7 +44,7 @@ async function initApp() { { path: '/statement-lines/import', name: 'import-statement', component: () => import('./pages/ImportStatementView.vue') }, { path: '/transactions/:account', name: 'transactions', component: () => import('./pages/TransactionsView.vue') }, { path: '/trial-balance', name: 'trial-balance', component: () => import('./reports/TrialBalanceReport.vue') }, - { path: '/austax/tax-summary', name: 'tax-summary', component: () => import('./austax/TaxSummaryReport.vue') }, + { path: '/austax/tax-summary', name: 'tax-summary', component: () => import('./plugins/austax/TaxSummaryReport.vue') }, ]; const router = createRouter({ history: createWebHistory(), diff --git a/src/pages/ChartOfAccountsView.vue b/src/pages/ChartOfAccountsView.vue index 6a6752c..dcc8262 100644 --- a/src/pages/ChartOfAccountsView.vue +++ b/src/pages/ChartOfAccountsView.vue @@ -1,6 +1,6 @@