@things-factory/accounting 8.0.0-alpha.1 → 8.0.0-alpha.11
Sign up to get free protection for your applications and to get access to all the features.
- package/client/bootstrap.ts +10 -1
- package/client/components/accounting-category-selector.ts +136 -0
- package/client/components/accounting-category-view.ts +75 -0
- package/client/grist-editors/grist-editor-accounting-category-object.ts +83 -0
- package/client/grist-editors/grist-renderer-accounting-category-object.ts +13 -0
- package/client/pages/account/account-list-page.ts +33 -2
- package/client/pages/accounting-category/accounting-category-list-page.ts +31 -1
- package/client/pages/accounting-category/accounting-category-tree-page.ts +338 -0
- package/client/pages/accounting-document/accounting-document-importer.ts +90 -0
- package/client/pages/accounting-document/accounting-document-list-page.ts +398 -0
- package/client/pages/bank/bank-importer.ts +90 -0
- package/client/pages/{ledger/ledger-list-page.ts → bank/bank-list-page.ts} +118 -57
- package/client/pages/{ledger/ledger-importer.ts → bank-account/bank-account-importer.ts} +10 -17
- package/client/pages/bank-account/bank-account-list-page.ts +398 -0
- package/client/pages/financial-institution/financial-institution-importer.ts +90 -0
- package/client/pages/financial-institution/financial-institution-list-page.ts +398 -0
- package/client/pages/payment/payment-importer.ts +90 -0
- package/client/pages/payment/payment-list-page.ts +398 -0
- package/client/route.ts +0 -4
- package/client/types/accounting-category.ts +23 -0
- package/client/types/index.ts +1 -0
- package/dist-client/bootstrap.js +7 -1
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/accounting-category-selector.d.ts +16 -0
- package/dist-client/components/accounting-category-selector.js +134 -0
- package/dist-client/components/accounting-category-selector.js.map +1 -0
- package/dist-client/components/accounting-category-view.d.ts +14 -0
- package/dist-client/components/accounting-category-view.js +81 -0
- package/dist-client/components/accounting-category-view.js.map +1 -0
- package/dist-client/grist-editors/grist-editor-accounting-category-object.d.ts +11 -0
- package/dist-client/grist-editors/grist-editor-accounting-category-object.js +71 -0
- package/dist-client/grist-editors/grist-editor-accounting-category-object.js.map +1 -0
- package/dist-client/grist-editors/grist-renderer-accounting-category-object.d.ts +2 -0
- package/dist-client/grist-editors/grist-renderer-accounting-category-object.js +9 -0
- package/dist-client/grist-editors/grist-renderer-accounting-category-object.js.map +1 -0
- package/dist-client/pages/account/account-list-page.js +33 -2
- package/dist-client/pages/account/account-list-page.js.map +1 -1
- package/dist-client/pages/accounting-category/accounting-category-list-page.js +31 -1
- package/dist-client/pages/accounting-category/accounting-category-list-page.js.map +1 -1
- package/dist-client/pages/accounting-category/accounting-category-tree-page.d.ts +46 -0
- package/dist-client/pages/accounting-category/accounting-category-tree-page.js +329 -0
- package/dist-client/pages/accounting-category/accounting-category-tree-page.js.map +1 -0
- package/dist-client/pages/accounting-document/accounting-document-importer.d.ts +23 -0
- package/dist-client/pages/accounting-document/accounting-document-importer.js +93 -0
- package/dist-client/pages/accounting-document/accounting-document-importer.js.map +1 -0
- package/dist-client/pages/accounting-document/accounting-document-list-page.d.ts +66 -0
- package/dist-client/pages/accounting-document/accounting-document-list-page.js +370 -0
- package/dist-client/pages/accounting-document/accounting-document-list-page.js.map +1 -0
- package/dist-client/pages/{ledger/ledger-importer.d.ts → bank/bank-importer.d.ts} +3 -2
- package/dist-client/pages/{ledger/ledger-importer.js → bank/bank-importer.js} +14 -21
- package/dist-client/pages/bank/bank-importer.js.map +1 -0
- package/dist-client/pages/{ledger/ledger-list-page.d.ts → bank/bank-list-page.d.ts} +12 -8
- package/dist-client/pages/{ledger/ledger-list-page.js → bank/bank-list-page.js} +114 -67
- package/dist-client/pages/bank/bank-list-page.js.map +1 -0
- package/dist-client/pages/bank-account/bank-account-importer.d.ts +23 -0
- package/dist-client/pages/bank-account/bank-account-importer.js +93 -0
- package/dist-client/pages/bank-account/bank-account-importer.js.map +1 -0
- package/dist-client/pages/bank-account/bank-account-list-page.d.ts +66 -0
- package/dist-client/pages/bank-account/bank-account-list-page.js +370 -0
- package/dist-client/pages/bank-account/bank-account-list-page.js.map +1 -0
- package/dist-client/pages/financial-institution/financial-institution-importer.d.ts +23 -0
- package/dist-client/pages/financial-institution/financial-institution-importer.js +93 -0
- package/dist-client/pages/financial-institution/financial-institution-importer.js.map +1 -0
- package/dist-client/pages/financial-institution/financial-institution-list-page.d.ts +66 -0
- package/dist-client/pages/financial-institution/financial-institution-list-page.js +370 -0
- package/dist-client/pages/financial-institution/financial-institution-list-page.js.map +1 -0
- package/dist-client/pages/payment/payment-importer.d.ts +23 -0
- package/dist-client/pages/payment/payment-importer.js +93 -0
- package/dist-client/pages/payment/payment-importer.js.map +1 -0
- package/dist-client/pages/payment/payment-list-page.d.ts +66 -0
- package/dist-client/pages/payment/payment-list-page.js +370 -0
- package/dist-client/pages/payment/payment-list-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +0 -3
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/types/accounting-category.d.ts +16 -0
- package/dist-client/types/accounting-category.js +3 -0
- package/dist-client/types/accounting-category.js.map +1 -0
- package/dist-client/types/index.d.ts +1 -0
- package/dist-client/types/index.js +2 -0
- package/dist-client/types/index.js.map +1 -0
- package/dist-server/activities/activity-book.js +31 -19
- package/dist-server/activities/activity-book.js.map +1 -1
- package/dist-server/controllers/summary-statements.js +13 -7
- package/dist-server/controllers/summary-statements.js.map +1 -1
- package/dist-server/index.d.ts +1 -0
- package/dist-server/index.js +1 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/1725200507196-seed-fiscal-entities.js +3 -3
- package/dist-server/migrations/1725200507196-seed-fiscal-entities.js.map +1 -1
- package/dist-server/migrations/1725201467183-seed-accounts.js +31 -31
- package/dist-server/migrations/1725201467183-seed-accounts.js.map +1 -1
- package/dist-server/migrations/1725201567284-seed-country-codes.d.ts +5 -0
- package/dist-server/migrations/1725201567284-seed-country-codes.js +248 -0
- package/dist-server/migrations/1725201567284-seed-country-codes.js.map +1 -0
- package/dist-server/migrations/1725201667385-seed-financial-institutions.d.ts +5 -0
- package/dist-server/migrations/1725201667385-seed-financial-institutions.js +348 -0
- package/dist-server/migrations/1725201667385-seed-financial-institutions.js.map +1 -0
- package/dist-server/routes.d.ts +0 -1
- package/dist-server/routes.js +0 -1
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/account/account-history.d.ts +4 -1
- package/dist-server/service/account/account-history.js +14 -4
- package/dist-server/service/account/account-history.js.map +1 -1
- package/dist-server/service/account/account-mutation.js +13 -9
- package/dist-server/service/account/account-mutation.js.map +1 -1
- package/dist-server/service/account/account-query.js +2 -0
- package/dist-server/service/account/account-query.js.map +1 -1
- package/dist-server/service/account/account.d.ts +1 -1
- package/dist-server/service/account/account.js +15 -4
- package/dist-server/service/account/account.js.map +1 -1
- package/dist-server/service/account/index.d.ts +1 -2
- package/dist-server/service/accounting-category/accounting-category-history.d.ts +26 -0
- package/dist-server/service/accounting-category/accounting-category-history.js +136 -0
- package/dist-server/service/accounting-category/accounting-category-history.js.map +1 -0
- package/dist-server/service/accounting-category/accounting-category-mutation.js +12 -8
- package/dist-server/service/accounting-category/accounting-category-mutation.js.map +1 -1
- package/dist-server/service/accounting-category/accounting-category-query.d.ts +1 -0
- package/dist-server/service/accounting-category/accounting-category-query.js +23 -0
- package/dist-server/service/accounting-category/accounting-category-query.js.map +1 -1
- package/dist-server/service/accounting-category/accounting-category.d.ts +1 -0
- package/dist-server/service/accounting-category/accounting-category.js +14 -3
- package/dist-server/service/accounting-category/accounting-category.js.map +1 -1
- package/dist-server/service/accounting-category/event-subscriber.d.ts +7 -0
- package/dist-server/service/accounting-category/event-subscriber.js +21 -0
- package/dist-server/service/accounting-category/event-subscriber.js.map +1 -0
- package/dist-server/service/accounting-category/index.d.ts +2 -1
- package/dist-server/service/accounting-category/index.js +4 -2
- package/dist-server/service/accounting-category/index.js.map +1 -1
- package/dist-server/service/accounting-document/accounting-document-history.d.ts +26 -0
- package/dist-server/service/accounting-document/accounting-document-history.js +129 -0
- package/dist-server/service/accounting-document/accounting-document-history.js.map +1 -0
- package/dist-server/service/accounting-document/accounting-document-mutation.d.ts +10 -0
- package/dist-server/service/accounting-document/accounting-document-mutation.js +128 -0
- package/dist-server/service/accounting-document/accounting-document-mutation.js.map +1 -0
- package/dist-server/service/accounting-document/accounting-document-query.d.ts +11 -0
- package/dist-server/service/accounting-document/accounting-document-query.js +79 -0
- package/dist-server/service/accounting-document/accounting-document-query.js.map +1 -0
- package/dist-server/service/accounting-document/accounting-document-type.d.ts +20 -0
- package/dist-server/service/accounting-document/accounting-document-type.js +74 -0
- package/dist-server/service/accounting-document/accounting-document-type.js.map +1 -0
- package/dist-server/service/accounting-document/accounting-document.d.ts +21 -0
- package/dist-server/service/accounting-document/accounting-document.js +104 -0
- package/dist-server/service/accounting-document/accounting-document.js.map +1 -0
- package/dist-server/service/accounting-document/event-subscriber.d.ts +7 -0
- package/dist-server/service/accounting-document/event-subscriber.js +21 -0
- package/dist-server/service/accounting-document/event-subscriber.js.map +1 -0
- package/dist-server/service/accounting-document/index.d.ts +7 -0
- package/dist-server/service/accounting-document/index.js +12 -0
- package/dist-server/service/accounting-document/index.js.map +1 -0
- package/dist-server/service/bank-account/bank-account-history.d.ts +34 -0
- package/dist-server/service/bank-account/bank-account-history.js +172 -0
- package/dist-server/service/bank-account/bank-account-history.js.map +1 -0
- package/dist-server/service/bank-account/bank-account-mutation.d.ts +10 -0
- package/dist-server/service/bank-account/bank-account-mutation.js +128 -0
- package/dist-server/service/bank-account/bank-account-mutation.js.map +1 -0
- package/dist-server/service/bank-account/bank-account-query.d.ts +11 -0
- package/dist-server/service/bank-account/bank-account-query.js +79 -0
- package/dist-server/service/bank-account/bank-account-query.js.map +1 -0
- package/dist-server/service/bank-account/bank-account-type.d.ts +39 -0
- package/dist-server/service/bank-account/bank-account-type.js +153 -0
- package/dist-server/service/bank-account/bank-account-type.js.map +1 -0
- package/dist-server/service/bank-account/bank-account.d.ts +38 -0
- package/dist-server/service/bank-account/bank-account.js +164 -0
- package/dist-server/service/bank-account/bank-account.js.map +1 -0
- package/dist-server/service/bank-account/event-subscriber.d.ts +7 -0
- package/dist-server/service/bank-account/event-subscriber.js +21 -0
- package/dist-server/service/bank-account/event-subscriber.js.map +1 -0
- package/dist-server/service/bank-account/index.d.ts +7 -0
- package/dist-server/service/bank-account/index.js +12 -0
- package/dist-server/service/bank-account/index.js.map +1 -0
- package/dist-server/service/financial-institution/financial-institution-mutation.d.ts +10 -0
- package/dist-server/service/financial-institution/financial-institution-mutation.js +169 -0
- package/dist-server/service/financial-institution/financial-institution-mutation.js.map +1 -0
- package/dist-server/service/financial-institution/financial-institution-query.d.ts +12 -0
- package/dist-server/service/financial-institution/financial-institution-query.js +97 -0
- package/dist-server/service/financial-institution/financial-institution-query.js.map +1 -0
- package/dist-server/service/financial-institution/financial-institution-type.d.ts +32 -0
- package/dist-server/service/financial-institution/financial-institution-type.js +126 -0
- package/dist-server/service/financial-institution/financial-institution-type.js.map +1 -0
- package/dist-server/service/financial-institution/financial-institution.d.ts +34 -0
- package/dist-server/service/financial-institution/financial-institution.js +137 -0
- package/dist-server/service/financial-institution/financial-institution.js.map +1 -0
- package/dist-server/service/financial-institution/index.d.ts +6 -0
- package/dist-server/service/financial-institution/index.js +10 -0
- package/dist-server/service/financial-institution/index.js.map +1 -0
- package/dist-server/service/financial-statement/financial-statement-history.d.ts +9 -6
- package/dist-server/service/financial-statement/financial-statement-history.js +30 -20
- package/dist-server/service/financial-statement/financial-statement-history.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement-line-item.d.ts +19 -0
- package/dist-server/service/financial-statement/financial-statement-line-item.js +94 -0
- package/dist-server/service/financial-statement/financial-statement-line-item.js.map +1 -0
- package/dist-server/service/financial-statement/financial-statement-mutation.js +12 -8
- package/dist-server/service/financial-statement/financial-statement-mutation.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement-query.js +2 -0
- package/dist-server/service/financial-statement/financial-statement-query.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement.d.ts +2 -0
- package/dist-server/service/financial-statement/financial-statement.js +45 -24
- package/dist-server/service/financial-statement/financial-statement.js.map +1 -1
- package/dist-server/service/financial-statement/index.d.ts +2 -2
- package/dist-server/service/financial-statement/index.js +2 -1
- package/dist-server/service/financial-statement/index.js.map +1 -1
- package/dist-server/service/fiscal-month/fiscal-month-mutation.js +6 -0
- package/dist-server/service/fiscal-month/fiscal-month-mutation.js.map +1 -1
- package/dist-server/service/fiscal-month/fiscal-month-query.js +2 -0
- package/dist-server/service/fiscal-month/fiscal-month-query.js.map +1 -1
- package/dist-server/service/fiscal-month/fiscal-month.js +1 -1
- package/dist-server/service/fiscal-month/fiscal-month.js.map +1 -1
- package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js +6 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js.map +1 -1
- package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js +2 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js.map +1 -1
- package/dist-server/service/fiscal-quarter/fiscal-quarter.js +1 -1
- package/dist-server/service/fiscal-quarter/fiscal-quarter.js.map +1 -1
- package/dist-server/service/fiscal-year/fiscal-year-mutation.js +6 -0
- package/dist-server/service/fiscal-year/fiscal-year-mutation.js.map +1 -1
- package/dist-server/service/fiscal-year/fiscal-year-query.js +2 -0
- package/dist-server/service/fiscal-year/fiscal-year-query.js.map +1 -1
- package/dist-server/service/fiscal-year/fiscal-year.js +1 -1
- package/dist-server/service/fiscal-year/fiscal-year.js.map +1 -1
- package/dist-server/service/income-statement/income-statement-history.d.ts +9 -5
- package/dist-server/service/income-statement/income-statement-history.js +35 -20
- package/dist-server/service/income-statement/income-statement-history.js.map +1 -1
- package/dist-server/service/income-statement/income-statement-line-item.d.ts +19 -0
- package/dist-server/service/income-statement/income-statement-line-item.js +96 -0
- package/dist-server/service/income-statement/income-statement-line-item.js.map +1 -0
- package/dist-server/service/income-statement/income-statement-mutation.js +12 -8
- package/dist-server/service/income-statement/income-statement-mutation.js.map +1 -1
- package/dist-server/service/income-statement/income-statement-query.js +2 -0
- package/dist-server/service/income-statement/income-statement-query.js.map +1 -1
- package/dist-server/service/income-statement/income-statement.d.ts +2 -0
- package/dist-server/service/income-statement/income-statement.js +46 -26
- package/dist-server/service/income-statement/income-statement.js.map +1 -1
- package/dist-server/service/income-statement/index.d.ts +2 -2
- package/dist-server/service/income-statement/index.js +2 -1
- package/dist-server/service/income-statement/index.js.map +1 -1
- package/dist-server/service/index.d.ts +4 -2
- package/dist-server/service/index.js +10 -0
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/payment/event-subscriber.d.ts +7 -0
- package/dist-server/service/payment/event-subscriber.js +21 -0
- package/dist-server/service/payment/event-subscriber.js.map +1 -0
- package/dist-server/service/payment/index.d.ts +7 -0
- package/dist-server/service/payment/index.js +12 -0
- package/dist-server/service/payment/index.js.map +1 -0
- package/dist-server/service/payment/payment-history.d.ts +37 -0
- package/dist-server/service/payment/payment-history.js +174 -0
- package/dist-server/service/payment/payment-history.js.map +1 -0
- package/dist-server/service/payment/payment-mutation.d.ts +10 -0
- package/dist-server/service/payment/payment-mutation.js +134 -0
- package/dist-server/service/payment/payment-mutation.js.map +1 -0
- package/dist-server/service/payment/payment-query.d.ts +11 -0
- package/dist-server/service/payment/payment-query.js +81 -0
- package/dist-server/service/payment/payment-query.js.map +1 -0
- package/dist-server/service/payment/payment-type.d.ts +30 -0
- package/dist-server/service/payment/payment-type.js +114 -0
- package/dist-server/service/payment/payment-type.js.map +1 -0
- package/dist-server/service/payment/payment.d.ts +42 -0
- package/dist-server/service/payment/payment.js +181 -0
- package/dist-server/service/payment/payment.js.map +1 -0
- package/dist-server/service/transaction/index.d.ts +2 -1
- package/dist-server/service/transaction/transaction-history.d.ts +6 -2
- package/dist-server/service/transaction/transaction-history.js +28 -9
- package/dist-server/service/transaction/transaction-history.js.map +1 -1
- package/dist-server/service/transaction/transaction-mutation.js +13 -9
- package/dist-server/service/transaction/transaction-mutation.js.map +1 -1
- package/dist-server/service/transaction/transaction-query.js +2 -0
- package/dist-server/service/transaction/transaction-query.js.map +1 -1
- package/dist-server/service/transaction/transaction.d.ts +28 -6
- package/dist-server/service/transaction/transaction.js +119 -31
- package/dist-server/service/transaction/transaction.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/accounting/accounting-document.md +160 -0
- package/helps/accounting/bank-account.md +160 -0
- package/helps/accounting/bank.md +160 -0
- package/helps/accounting/contract.md +160 -0
- package/helps/accounting/financial-institution.md +160 -0
- package/helps/accounting/payment.md +160 -0
- package/package.json +5 -5
- package/server/activities/activity-book.ts +31 -19
- package/server/controllers/summary-statements.ts +13 -7
- package/server/index.ts +1 -0
- package/server/migrations/1725200507196-seed-fiscal-entities.ts +3 -3
- package/server/migrations/1725201467183-seed-accounts.ts +31 -31
- package/server/migrations/1725201567284-seed-country-codes.ts +261 -0
- package/server/migrations/1725201667385-seed-financial-institutions.ts +348 -0
- package/server/routes.ts +0 -2
- package/server/service/account/account-history.ts +14 -6
- package/server/service/account/account-mutation.ts +13 -10
- package/server/service/account/account-query.ts +2 -0
- package/server/service/account/account.ts +15 -4
- package/server/service/accounting-category/accounting-category-history.ts +123 -0
- package/server/service/accounting-category/accounting-category-mutation.ts +12 -9
- package/server/service/accounting-category/accounting-category-query.ts +23 -0
- package/server/service/accounting-category/accounting-category.ts +14 -3
- package/server/service/accounting-category/event-subscriber.ts +20 -0
- package/server/service/accounting-category/index.ts +4 -2
- package/server/service/accounting-document/accounting-document-history.ts +117 -0
- package/server/service/accounting-document/accounting-document-mutation.ts +137 -0
- package/server/service/accounting-document/accounting-document-query.ts +48 -0
- package/server/service/accounting-document/accounting-document-type.ts +52 -0
- package/server/service/accounting-document/accounting-document.ts +93 -0
- package/server/service/accounting-document/event-subscriber.ts +17 -0
- package/server/service/accounting-document/index.ts +9 -0
- package/server/service/bank-account/bank-account-history.ts +149 -0
- package/server/service/bank-account/bank-account-mutation.ts +137 -0
- package/server/service/bank-account/bank-account-query.ts +48 -0
- package/server/service/bank-account/bank-account-type.ts +112 -0
- package/server/service/bank-account/bank-account.ts +142 -0
- package/server/service/bank-account/event-subscriber.ts +17 -0
- package/server/service/bank-account/index.ts +9 -0
- package/server/service/financial-institution/financial-institution-mutation.ts +198 -0
- package/server/service/financial-institution/financial-institution-query.ts +62 -0
- package/server/service/financial-institution/financial-institution-type.ts +91 -0
- package/server/service/financial-institution/financial-institution.ts +122 -0
- package/server/service/financial-institution/index.ts +7 -0
- package/server/service/financial-statement/financial-statement-history.ts +27 -18
- package/server/service/financial-statement/financial-statement-line-item.ts +82 -0
- package/server/service/financial-statement/financial-statement-mutation.ts +12 -9
- package/server/service/financial-statement/financial-statement-query.ts +2 -0
- package/server/service/financial-statement/financial-statement.ts +52 -36
- package/server/service/financial-statement/index.ts +2 -1
- package/server/service/fiscal-month/fiscal-month-mutation.ts +10 -2
- package/server/service/fiscal-month/fiscal-month-query.ts +3 -1
- package/server/service/fiscal-month/fiscal-month.ts +1 -1
- package/server/service/fiscal-quarter/fiscal-quarter-mutation.ts +14 -3
- package/server/service/fiscal-quarter/fiscal-quarter-query.ts +2 -0
- package/server/service/fiscal-quarter/fiscal-quarter.ts +1 -1
- package/server/service/fiscal-year/fiscal-year-mutation.ts +10 -2
- package/server/service/fiscal-year/fiscal-year-query.ts +2 -0
- package/server/service/fiscal-year/fiscal-year.ts +1 -1
- package/server/service/income-statement/income-statement-history.ts +30 -17
- package/server/service/income-statement/income-statement-line-item.ts +84 -0
- package/server/service/income-statement/income-statement-mutation.ts +12 -10
- package/server/service/income-statement/income-statement-query.ts +2 -0
- package/server/service/income-statement/income-statement.ts +54 -39
- package/server/service/income-statement/index.ts +2 -1
- package/server/service/index.ts +18 -0
- package/server/service/payment/event-subscriber.ts +17 -0
- package/server/service/payment/index.ts +9 -0
- package/server/service/payment/payment-history.ts +149 -0
- package/server/service/payment/payment-mutation.ts +139 -0
- package/server/service/payment/payment-query.ts +50 -0
- package/server/service/payment/payment-type.ts +82 -0
- package/server/service/payment/payment.ts +154 -0
- package/server/service/transaction/transaction-history.ts +24 -8
- package/server/service/transaction/transaction-mutation.ts +13 -10
- package/server/service/transaction/transaction-query.ts +2 -0
- package/server/service/transaction/transaction.ts +130 -34
- package/things-factory.config.js +0 -1
- package/translations/en.json +9 -1
- package/translations/ja.json +9 -1
- package/translations/ko.json +9 -1
- package/translations/ms.json +9 -1
- package/translations/zh.json +9 -1
- package/client/pages/main.ts +0 -24
- package/dist-client/pages/ledger/ledger-importer.js.map +0 -1
- package/dist-client/pages/ledger/ledger-list-page.js.map +0 -1
- package/dist-client/pages/main.d.ts +0 -1
- package/dist-client/pages/main.js +0 -27
- package/dist-client/pages/main.js.map +0 -1
@@ -0,0 +1,338 @@
|
|
1
|
+
import '@operato/data-tree'
|
2
|
+
import '@operato/context/ox-context-page-toolbar.js'
|
3
|
+
|
4
|
+
import { css, html, PropertyValues } from 'lit'
|
5
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
6
|
+
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
7
|
+
import { client } from '@operato/graphql'
|
8
|
+
import { i18next, localize } from '@operato/i18n'
|
9
|
+
import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
|
10
|
+
import { CustomAlert, PageView, store } from '@operato/shell'
|
11
|
+
|
12
|
+
import { connect } from 'pwa-helpers/connect-mixin'
|
13
|
+
import gql from 'graphql-tag'
|
14
|
+
|
15
|
+
import { AccountingCategory } from '../../types/accounting-category'
|
16
|
+
|
17
|
+
import { AccountingCategoryView } from '../../components/accounting-category-view'
|
18
|
+
|
19
|
+
const SubAccountingCategoryFragment = gql`
|
20
|
+
fragment SubAccountingCategoryFragment on AccountingCategory {
|
21
|
+
id
|
22
|
+
code
|
23
|
+
name
|
24
|
+
description
|
25
|
+
active
|
26
|
+
updater {
|
27
|
+
id
|
28
|
+
name
|
29
|
+
}
|
30
|
+
updatedAt
|
31
|
+
}
|
32
|
+
`
|
33
|
+
|
34
|
+
@customElement('accounting-category-tree-page')
|
35
|
+
export class AccountingCategoryTreePage extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {
|
36
|
+
static styles = [
|
37
|
+
CommonHeaderStyles,
|
38
|
+
ScrollbarStyles,
|
39
|
+
css`
|
40
|
+
:host {
|
41
|
+
display: flex;
|
42
|
+
flex-direction: column;
|
43
|
+
|
44
|
+
width: 100%;
|
45
|
+
overflow: auto;
|
46
|
+
}
|
47
|
+
|
48
|
+
content {
|
49
|
+
flex: 1;
|
50
|
+
display: flex;
|
51
|
+
flex-direction: row;
|
52
|
+
}
|
53
|
+
|
54
|
+
div[editor] {
|
55
|
+
width: 300px;
|
56
|
+
display: flex;
|
57
|
+
flex-direction: column;
|
58
|
+
}
|
59
|
+
|
60
|
+
ox-tree-vertical {
|
61
|
+
flex: 1;
|
62
|
+
overflow: auto;
|
63
|
+
}
|
64
|
+
|
65
|
+
accounting-category-view {
|
66
|
+
flex: 1;
|
67
|
+
padding: var(--spacing-medium);
|
68
|
+
background-color: var(--md-sys-color-surface-variant);
|
69
|
+
overflow: auto;
|
70
|
+
}
|
71
|
+
|
72
|
+
.footer button[disabled] {
|
73
|
+
color: var(--md-sys-color-surface-dim);
|
74
|
+
background-color: transparent;
|
75
|
+
}
|
76
|
+
`
|
77
|
+
]
|
78
|
+
|
79
|
+
@state() root?: AccountingCategory
|
80
|
+
@state() selected?: AccountingCategory
|
81
|
+
@state() accountingCategory?: AccountingCategory
|
82
|
+
@state() modified: boolean = false
|
83
|
+
@state() appendable: boolean = false
|
84
|
+
|
85
|
+
@query('accounting-category-view') accountingCategoryView!: AccountingCategoryView
|
86
|
+
|
87
|
+
get context() {
|
88
|
+
return {
|
89
|
+
title: i18next.t('title.accounting-category list'),
|
90
|
+
help: 'accounting/accounting-category',
|
91
|
+
actions: [
|
92
|
+
{
|
93
|
+
icon: 'delete',
|
94
|
+
title: i18next.t('button.delete'),
|
95
|
+
action: this.delete.bind(this),
|
96
|
+
emphasis: {
|
97
|
+
danger: true
|
98
|
+
}
|
99
|
+
}
|
100
|
+
].filter(Boolean),
|
101
|
+
toolbar: false
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
render() {
|
106
|
+
return html`
|
107
|
+
<div class="header">
|
108
|
+
<ox-context-page-toolbar class="actions" .context=${this.context}></ox-context-page-toolbar>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
<content>
|
112
|
+
<ox-tree-vertical
|
113
|
+
.data=${this.root}
|
114
|
+
.selected=${this.selected}
|
115
|
+
@select=${this.onSelect.bind(this)}
|
116
|
+
id-property="code"
|
117
|
+
label-property="name"
|
118
|
+
description-property="description"
|
119
|
+
></ox-tree-vertical>
|
120
|
+
|
121
|
+
<div editor>
|
122
|
+
<accounting-category-view
|
123
|
+
.accountingCategory=${this.accountingCategory}
|
124
|
+
@property-change=${(e: CustomEvent) => {
|
125
|
+
const { code, name } = e.detail || {}
|
126
|
+
|
127
|
+
this.modified = true
|
128
|
+
this.appendable = code && code !== this.selected?.code && name !== this.selected?.name
|
129
|
+
}}
|
130
|
+
></accounting-category-view>
|
131
|
+
<div class="footer">
|
132
|
+
<button @click=${this.reset.bind(this)}><md-icon>restart_alt</md-icon>${i18next.t('button.reset')}</button>
|
133
|
+
<div filler></div>
|
134
|
+
<button @click=${this.create.bind(this)} ?disabled=${!this.appendable}>
|
135
|
+
<md-icon>add</md-icon>${i18next.t('button.add')}
|
136
|
+
</button>
|
137
|
+
<button @click=${this.save.bind(this)} ?disabled=${!this.modified} done>
|
138
|
+
<md-icon>save</md-icon>${i18next.t('button.save')}
|
139
|
+
</button>
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
</content>
|
143
|
+
`
|
144
|
+
}
|
145
|
+
|
146
|
+
updated(changes: PropertyValues<this>) {
|
147
|
+
if (changes.has('selected')) {
|
148
|
+
this.modified = false
|
149
|
+
this.accountingCategory = { ...this.selected }
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
onSelect(e: CustomEvent) {
|
154
|
+
this.selected = e.detail as AccountingCategory
|
155
|
+
this.updateContext()
|
156
|
+
}
|
157
|
+
|
158
|
+
reset() {
|
159
|
+
this.accountingCategoryView.accountingCategory = {}
|
160
|
+
}
|
161
|
+
|
162
|
+
async create() {
|
163
|
+
const { id: parentId } = this.accountingCategory || {}
|
164
|
+
const { code, name, description, active } = this.accountingCategory || {}
|
165
|
+
|
166
|
+
var accountingCategory = {
|
167
|
+
code,
|
168
|
+
name,
|
169
|
+
description,
|
170
|
+
active
|
171
|
+
} as any
|
172
|
+
|
173
|
+
if (parentId) {
|
174
|
+
accountingCategory.parent = { id: parentId }
|
175
|
+
}
|
176
|
+
|
177
|
+
const response = await client.mutate({
|
178
|
+
mutation: gql`
|
179
|
+
mutation ($accountingCategory: NewAccountingCategory!) {
|
180
|
+
createAccountingCategory(accountingCategory: $accountingCategory) {
|
181
|
+
...SubAccountingCategoryFragment
|
182
|
+
}
|
183
|
+
}
|
184
|
+
|
185
|
+
${SubAccountingCategoryFragment}
|
186
|
+
`,
|
187
|
+
variables: {
|
188
|
+
accountingCategory
|
189
|
+
}
|
190
|
+
})
|
191
|
+
|
192
|
+
this.selected = response.data.createAccountingCategory
|
193
|
+
this.updateContext()
|
194
|
+
|
195
|
+
await this.fetch()
|
196
|
+
}
|
197
|
+
|
198
|
+
async save() {
|
199
|
+
const { id, code, name, description, active } = this.accountingCategory || {}
|
200
|
+
|
201
|
+
if (!id) {
|
202
|
+
await CustomAlert({
|
203
|
+
type: 'warning',
|
204
|
+
title: 'accounting-category not selected',
|
205
|
+
text: 'Please select accounting-category first.',
|
206
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
207
|
+
})
|
208
|
+
|
209
|
+
return
|
210
|
+
}
|
211
|
+
|
212
|
+
var patch = {
|
213
|
+
code,
|
214
|
+
name,
|
215
|
+
description,
|
216
|
+
active
|
217
|
+
} as any
|
218
|
+
|
219
|
+
const response = await client.mutate({
|
220
|
+
mutation: gql`
|
221
|
+
mutation ($id: String!, $patch: AccountingCategoryPatch!) {
|
222
|
+
updateAccountingCategory(id: $id, patch: $patch) {
|
223
|
+
...SubAccountingCategoryFragment
|
224
|
+
}
|
225
|
+
}
|
226
|
+
|
227
|
+
${SubAccountingCategoryFragment}
|
228
|
+
`,
|
229
|
+
variables: {
|
230
|
+
id,
|
231
|
+
patch
|
232
|
+
},
|
233
|
+
context: {
|
234
|
+
hasUpload: true
|
235
|
+
}
|
236
|
+
})
|
237
|
+
|
238
|
+
this.selected = response.data.updateAccountingCategory
|
239
|
+
|
240
|
+
this.fetch()
|
241
|
+
}
|
242
|
+
|
243
|
+
async delete() {
|
244
|
+
if (!this.selected) {
|
245
|
+
await CustomAlert({
|
246
|
+
type: 'warning',
|
247
|
+
title: 'accounting category not selected',
|
248
|
+
text: 'Please select accounting category first.',
|
249
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
250
|
+
})
|
251
|
+
|
252
|
+
return
|
253
|
+
}
|
254
|
+
|
255
|
+
const children = this.selected?.children
|
256
|
+
if (children && children.length > 0) {
|
257
|
+
await CustomAlert({
|
258
|
+
type: 'warning',
|
259
|
+
title: 'AccountingCategorys with subordinates cannot be deleted.',
|
260
|
+
text: 'AccountingCategory having children cannot be deleted.',
|
261
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
262
|
+
})
|
263
|
+
|
264
|
+
return
|
265
|
+
}
|
266
|
+
|
267
|
+
if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {
|
268
|
+
const { id } = this.selected || {}
|
269
|
+
|
270
|
+
const response = await client.mutate({
|
271
|
+
mutation: gql`
|
272
|
+
mutation ($id: String!) {
|
273
|
+
deleteAccountingCategory(id: $id)
|
274
|
+
}
|
275
|
+
`,
|
276
|
+
variables: {
|
277
|
+
id
|
278
|
+
}
|
279
|
+
})
|
280
|
+
|
281
|
+
this.selected = {}
|
282
|
+
this.updateContext()
|
283
|
+
|
284
|
+
await this.fetch()
|
285
|
+
}
|
286
|
+
}
|
287
|
+
|
288
|
+
async pageInitialized(lifecycle: any) {
|
289
|
+
this.fetch()
|
290
|
+
}
|
291
|
+
|
292
|
+
async pageUpdated(changes: any, lifecycle: any) {
|
293
|
+
if (this.active) {
|
294
|
+
// do something here when this page just became as active
|
295
|
+
}
|
296
|
+
}
|
297
|
+
|
298
|
+
async fetch() {
|
299
|
+
const response = await client.query({
|
300
|
+
query: gql`
|
301
|
+
query {
|
302
|
+
responses: accountingCategoryRoots {
|
303
|
+
total
|
304
|
+
items {
|
305
|
+
...SubAccountingCategoryFragment
|
306
|
+
children {
|
307
|
+
...SubAccountingCategoryFragment
|
308
|
+
children {
|
309
|
+
...SubAccountingCategoryFragment
|
310
|
+
children {
|
311
|
+
...SubAccountingCategoryFragment
|
312
|
+
children {
|
313
|
+
...SubAccountingCategoryFragment
|
314
|
+
children {
|
315
|
+
...SubAccountingCategoryFragment
|
316
|
+
children {
|
317
|
+
...SubAccountingCategoryFragment
|
318
|
+
children {
|
319
|
+
...SubAccountingCategoryFragment
|
320
|
+
}
|
321
|
+
}
|
322
|
+
}
|
323
|
+
}
|
324
|
+
}
|
325
|
+
}
|
326
|
+
}
|
327
|
+
}
|
328
|
+
}
|
329
|
+
}
|
330
|
+
|
331
|
+
${SubAccountingCategoryFragment}
|
332
|
+
`
|
333
|
+
})
|
334
|
+
const { items: records, total } = response.data.responses
|
335
|
+
|
336
|
+
this.root = records[0]
|
337
|
+
}
|
338
|
+
}
|
@@ -0,0 +1,90 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
2
|
+
import '@operato/data-grist'
|
3
|
+
|
4
|
+
import gql from 'graphql-tag'
|
5
|
+
import { css, html, LitElement } from 'lit'
|
6
|
+
import { property } from 'lit/decorators.js'
|
7
|
+
|
8
|
+
import { client } from '@operato/graphql'
|
9
|
+
import { i18next } from '@operato/i18n'
|
10
|
+
import { isMobileDevice } from '@operato/utils'
|
11
|
+
import { ButtonContainerStyles } from '@operato/styles'
|
12
|
+
|
13
|
+
export class AccountingDocumentImporter extends LitElement {
|
14
|
+
static styles = [
|
15
|
+
ButtonContainerStyles,
|
16
|
+
css`
|
17
|
+
:host {
|
18
|
+
display: flex;
|
19
|
+
flex-direction: column;
|
20
|
+
|
21
|
+
background-color: #fff;
|
22
|
+
}
|
23
|
+
|
24
|
+
ox-grist {
|
25
|
+
flex: 1;
|
26
|
+
}
|
27
|
+
`
|
28
|
+
]
|
29
|
+
|
30
|
+
@property({ type: Array }) accountingDocuments: any[] = []
|
31
|
+
@property({ type: Object }) columns = {
|
32
|
+
list: { fields: ['name', 'description'] },
|
33
|
+
pagination: { infinite: true },
|
34
|
+
columns: [
|
35
|
+
{
|
36
|
+
type: 'string',
|
37
|
+
name: 'name',
|
38
|
+
header: i18next.t('field.name'),
|
39
|
+
width: 150
|
40
|
+
},
|
41
|
+
{
|
42
|
+
type: 'string',
|
43
|
+
name: 'description',
|
44
|
+
header: i18next.t('field.description'),
|
45
|
+
width: 200
|
46
|
+
},
|
47
|
+
{
|
48
|
+
type: 'checkbox',
|
49
|
+
name: 'active',
|
50
|
+
header: i18next.t('field.active'),
|
51
|
+
width: 60
|
52
|
+
}
|
53
|
+
]
|
54
|
+
}
|
55
|
+
|
56
|
+
|
57
|
+
render() {
|
58
|
+
return html`
|
59
|
+
<ox-grist
|
60
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
61
|
+
.config=${this.columns}
|
62
|
+
.data=${
|
63
|
+
{
|
64
|
+
records: this.accountingDocuments
|
65
|
+
}
|
66
|
+
}
|
67
|
+
></ox-grist>
|
68
|
+
|
69
|
+
<div class="button-container">
|
70
|
+
<button @click="${this.save.bind(this)}"><md-icon>save</md-icon>${i18next.t('button.save')}</button>
|
71
|
+
</div>
|
72
|
+
`
|
73
|
+
}
|
74
|
+
|
75
|
+
async save() {
|
76
|
+
const response = await client.mutate({
|
77
|
+
mutation: gql`
|
78
|
+
mutation importAccountingDocuments($accountingDocuments: [AccountingDocumentPatch!]!) {
|
79
|
+
importAccountingDocuments(accountingDocuments: $accountingDocuments)
|
80
|
+
}
|
81
|
+
`,
|
82
|
+
variables: { accountingDocuments: this.accountingDocuments }
|
83
|
+
})
|
84
|
+
|
85
|
+
if (response.errors?.length) return
|
86
|
+
|
87
|
+
this.dispatchEvent(new CustomEvent('imported'))
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|