@powerhousedao/contributor-billing 0.1.29 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +165 -8
- package/dist/document-models/billing-statement/actions.d.ts +1 -0
- package/dist/document-models/billing-statement/actions.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/document-model.js +58 -47
- package/dist/document-models/billing-statement/gen/document-schema.d.ts +38 -38
- package/dist/document-models/billing-statement/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/line-items/actions.d.ts +6 -2
- package/dist/document-models/billing-statement/gen/line-items/actions.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/line-items/creators.d.ts +3 -2
- package/dist/document-models/billing-statement/gen/line-items/creators.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/line-items/creators.js +2 -1
- package/dist/document-models/billing-statement/gen/line-items/operations.d.ts +2 -1
- package/dist/document-models/billing-statement/gen/line-items/operations.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/ph-factories.js +1 -1
- package/dist/document-models/billing-statement/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/reducer.js +5 -1
- package/dist/document-models/billing-statement/gen/schema/types.d.ts +3 -0
- package/dist/document-models/billing-statement/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/schema/zod.d.ts +2 -1
- package/dist/document-models/billing-statement/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/schema/zod.js +5 -0
- package/dist/document-models/billing-statement/gen/utils.js +2 -2
- package/dist/document-models/billing-statement/src/reducers/general.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/reducers/general.js +5 -4
- package/dist/document-models/billing-statement/src/reducers/line-items.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/reducers/line-items.js +7 -2
- package/dist/document-models/billing-statement/src/reducers/tags.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/reducers/tags.js +1 -1
- package/dist/document-models/billing-statement/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/billing-statement/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/tests/document-model.test.js +94 -7
- package/dist/document-models/billing-statement/src/tests/general.test.d.ts +2 -1
- package/dist/document-models/billing-statement/src/tests/general.test.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/tests/general.test.js +33 -88
- package/dist/document-models/billing-statement/src/tests/line-items.test.js +22 -125
- package/dist/document-models/billing-statement/src/tests/tags.test.js +13 -47
- package/dist/document-models/document-models.js +2 -2
- package/dist/document-models/expense-report/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/document-model.js +48 -48
- package/dist/document-models/expense-report/gen/document-schema.d.ts +6 -6
- package/dist/document-models/expense-report/gen/utils.js +1 -1
- package/dist/document-models/expense-report/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/expense-report/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/expense-report/src/tests/document-model.test.js +94 -8
- package/dist/document-models/expense-report/src/tests/wallet.test.js +145 -10
- package/dist/document-models/index.d.ts +2 -6
- package/dist/document-models/index.d.ts.map +1 -1
- package/dist/document-models/index.js +2 -6
- package/dist/document-models/integrations/gen/document-model.js +33 -33
- package/dist/document-models/integrations/gen/document-schema.d.ts +6 -6
- package/dist/document-models/integrations/gen/utils.js +1 -1
- package/dist/document-models/integrations/src/reducers/integrations.d.ts.map +1 -1
- package/dist/document-models/integrations/src/reducers/integrations.js +9 -32
- package/dist/document-models/integrations/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/integrations/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/integrations/src/tests/document-model.test.js +91 -5
- package/dist/document-models/integrations/src/tests/integrations.test.js +21 -46
- package/dist/document-models/invoice/gen/document-model.js +147 -147
- package/dist/document-models/invoice/gen/document-schema.d.ts +127 -127
- package/dist/document-models/invoice/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/ph-factories.js +16 -122
- package/dist/document-models/invoice/gen/schema/types.d.ts +4 -4
- package/dist/document-models/invoice/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/schema/zod.js +4 -4
- package/dist/document-models/invoice/gen/utils.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/utils.js +17 -123
- package/dist/document-models/invoice/src/reducers/general.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/general.js +34 -10
- package/dist/document-models/invoice/src/reducers/items.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/items.js +7 -7
- package/dist/document-models/invoice/src/reducers/parties.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/parties.js +96 -50
- package/dist/document-models/invoice/src/reducers/transitions.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/transitions.js +69 -53
- package/dist/document-models/invoice/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/invoice/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/invoice/src/tests/document-model.test.js +91 -4
- package/dist/document-models/invoice/src/tests/general.test.js +24 -26
- package/dist/document-models/invoice/src/tests/items.test.js +37 -17
- package/dist/document-models/invoice/src/tests/parties.test.js +32 -26
- package/dist/document-models/invoice/src/tests/transitions.test.js +52 -500
- package/dist/document-models/invoice/utils/statusTransitions.d.ts.map +1 -1
- package/dist/document-models/invoice/utils/statusTransitions.js +10 -10
- package/dist/editors/billing-statement/components/lineItemsTable.d.ts.map +1 -1
- package/dist/editors/billing-statement/components/lineItemsTable.js +32 -23
- package/dist/editors/billing-statement/components/objectSetTable.d.ts.map +1 -1
- package/dist/editors/billing-statement/components/objectSetTable.js +1 -2
- package/dist/editors/billing-statement/editor.d.ts +4 -0
- package/dist/editors/billing-statement/editor.d.ts.map +1 -1
- package/dist/editors/billing-statement/editor.js +34 -16
- package/dist/editors/billing-statement/lineItemTags/lineItemTags.d.ts.map +1 -1
- package/dist/editors/billing-statement/lineItemTags/lineItemTags.js +36 -37
- package/dist/editors/billing-statement/lineItemTags/tagMapping.d.ts.map +1 -1
- package/dist/editors/billing-statement/lineItemTags/tagMapping.js +28 -10
- package/dist/editors/clean-new-editor/components/CreateDocument.d.ts +6 -0
- package/dist/editors/clean-new-editor/components/CreateDocument.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/CreateDocument.js +18 -0
- package/dist/editors/clean-new-editor/components/DriveContents.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/DriveContents.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/DriveContents.js +10 -0
- package/dist/editors/clean-new-editor/components/DriveExplorer.d.ts +7 -0
- package/dist/editors/clean-new-editor/components/DriveExplorer.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/DriveExplorer.js +16 -0
- package/dist/editors/clean-new-editor/components/EmptyState.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/EmptyState.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/EmptyState.js +10 -0
- package/dist/editors/clean-new-editor/components/Files.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/Files.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/Files.js +12 -0
- package/dist/editors/clean-new-editor/components/FolderTree.d.ts +6 -0
- package/dist/editors/clean-new-editor/components/FolderTree.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/FolderTree.js +65 -0
- package/dist/editors/clean-new-editor/components/Folders.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/Folders.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/Folders.js +12 -0
- package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.js +6 -0
- package/dist/editors/clean-new-editor/config.d.ts +4 -0
- package/dist/editors/clean-new-editor/config.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/config.js +5 -0
- package/dist/editors/clean-new-editor/editor.d.ts +4 -0
- package/dist/editors/clean-new-editor/editor.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/editor.js +11 -0
- package/dist/editors/clean-new-editor/module.d.ts +3 -0
- package/dist/editors/clean-new-editor/module.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/module.js +10 -0
- package/dist/editors/contributor-billing/components/ConfirmationModal.d.ts +14 -0
- package/dist/editors/contributor-billing/components/ConfirmationModal.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/ConfirmationModal.js +6 -0
- package/dist/editors/contributor-billing/components/CreateDocument.d.ts +6 -0
- package/dist/editors/contributor-billing/components/CreateDocument.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/CreateDocument.js +18 -0
- package/dist/editors/contributor-billing/components/DriveContents.d.ts +3 -0
- package/dist/editors/contributor-billing/components/DriveContents.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/DriveContents.js +10 -0
- package/dist/editors/contributor-billing/components/DriveExplorer.d.ts +3 -3
- package/dist/editors/contributor-billing/components/DriveExplorer.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/DriveExplorer.js +13 -180
- package/dist/editors/contributor-billing/components/EmptyState.d.ts +3 -0
- package/dist/editors/contributor-billing/components/EmptyState.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/EmptyState.js +10 -0
- package/dist/editors/contributor-billing/components/Files.d.ts +3 -0
- package/dist/editors/contributor-billing/components/Files.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/Files.js +12 -0
- package/dist/editors/contributor-billing/components/FolderTree.d.ts +6 -0
- package/dist/editors/contributor-billing/components/FolderTree.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/FolderTree.js +65 -0
- package/dist/editors/contributor-billing/components/Folders.d.ts +3 -0
- package/dist/editors/contributor-billing/components/Folders.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/Folders.js +12 -0
- package/dist/editors/contributor-billing/components/HeaderControls.d.ts +38 -0
- package/dist/editors/contributor-billing/components/HeaderControls.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/HeaderControls.js +124 -0
- package/dist/editors/contributor-billing/components/HeaderStats.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/{InvoiceTable/HeaderStats.js → HeaderStats.js} +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable.d.ts +22 -0
- package/dist/editors/contributor-billing/components/InvoiceTable.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTable.js +399 -0
- package/dist/editors/contributor-billing/components/InvoiceTableContainer.d.ts +6 -0
- package/dist/editors/contributor-billing/components/InvoiceTableContainer.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTableContainer.js +111 -0
- package/dist/editors/contributor-billing/components/InvoiceTableRow.d.ts +32 -0
- package/dist/editors/contributor-billing/components/InvoiceTableRow.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTableRow.js +55 -0
- package/dist/editors/contributor-billing/components/InvoiceTableSection.d.ts +13 -0
- package/dist/editors/contributor-billing/components/InvoiceTableSection.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTableSection.js +16 -0
- package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.d.ts +3 -0
- package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.js +6 -0
- package/dist/editors/contributor-billing/config.d.ts +1 -0
- package/dist/editors/contributor-billing/config.d.ts.map +1 -1
- package/dist/editors/contributor-billing/config.js +4 -1
- package/dist/editors/contributor-billing/editor.d.ts +1 -0
- package/dist/editors/contributor-billing/editor.d.ts.map +1 -1
- package/dist/editors/contributor-billing/editor.js +4 -1
- package/dist/editors/contributor-billing/module.d.ts +1 -1
- package/dist/editors/contributor-billing/module.d.ts.map +1 -1
- package/dist/editors/contributor-billing/module.js +3 -2
- package/dist/editors/contributor-billing/utils/exchangeRate.d.ts +15 -0
- package/dist/editors/contributor-billing/utils/exchangeRate.d.ts.map +1 -0
- package/dist/editors/contributor-billing/utils/exchangeRate.js +122 -0
- package/dist/editors/editors.js +2 -2
- package/dist/editors/expense-report/components/AddBillingStatementModal.d.ts.map +1 -1
- package/dist/editors/expense-report/editor.js +8 -8
- package/dist/editors/index.d.ts +2 -2
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +2 -2
- package/dist/editors/integrations/components/EditName.d.ts +3 -0
- package/dist/editors/integrations/components/EditName.d.ts.map +1 -0
- package/dist/editors/integrations/components/EditName.js +31 -0
- package/dist/editors/integrations/editor.d.ts +2 -4
- package/dist/editors/integrations/editor.d.ts.map +1 -1
- package/dist/editors/integrations/editor.js +5 -132
- package/dist/editors/integrations/module.d.ts +1 -0
- package/dist/editors/integrations/module.d.ts.map +1 -1
- package/dist/editors/integrations/module.js +3 -2
- package/dist/editors/invoice/components/confirmationModal.js +1 -1
- package/dist/editors/invoice/components/countryForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/countryForm.js +1 -1
- package/dist/editors/invoice/components/currencyForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/currencyForm.js +1 -1
- package/dist/editors/invoice/components/datePicker.d.ts +1 -1
- package/dist/editors/invoice/components/datePicker.d.ts.map +1 -1
- package/dist/editors/invoice/components/datePicker.js +1 -1
- package/dist/editors/invoice/components/inputField.d.ts.map +1 -1
- package/dist/editors/invoice/components/inputField.js +3 -2
- package/dist/editors/invoice/components/lineItemMobileModal.d.ts.map +1 -1
- package/dist/editors/invoice/components/lineItemMobileModal.js +1 -1
- package/dist/editors/invoice/components/numberForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/selectField.js +7 -7
- package/dist/editors/invoice/components/statusModalComponents.d.ts.map +1 -1
- package/dist/editors/invoice/components/statusModalComponents.js +27 -3
- package/dist/editors/invoice/editor.d.ts +1 -4
- package/dist/editors/invoice/editor.d.ts.map +1 -1
- package/dist/editors/invoice/editor.js +102 -40
- package/dist/editors/invoice/exportUBL.d.ts.map +1 -1
- package/dist/editors/invoice/exportUBL.js +35 -18
- package/dist/editors/invoice/ingestPDF.d.ts.map +1 -1
- package/dist/editors/invoice/ingestPDF.js +15 -9
- package/dist/editors/invoice/invoiceToGnosis.js +2 -2
- package/dist/editors/invoice/legalEntity/bankSection.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/legalEntity.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/walletSection.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/walletSection.js +3 -3
- package/dist/editors/invoice/lineItemTags/lineItemTags.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/lineItemTags.js +1 -1
- package/dist/editors/invoice/lineItemTags/tagMobileModal.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/tagMobileModal.js +4 -3
- package/dist/editors/invoice/lineItems.d.ts.map +1 -1
- package/dist/editors/invoice/module.d.ts +1 -0
- package/dist/editors/invoice/module.d.ts.map +1 -1
- package/dist/editors/invoice/module.js +2 -1
- package/dist/editors/invoice/requestFinance.js +3 -3
- package/dist/editors/invoice/uploadPdfChunked.d.ts.map +1 -1
- package/dist/editors/invoice/uploadPdfChunked.js +4 -3
- package/dist/editors/invoice/utils/utils.d.ts.map +1 -1
- package/dist/editors/invoice/utils/utils.js +5 -4
- package/dist/editors/invoice/validation/validationHandler.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationHandler.js +11 -5
- package/dist/editors/invoice/validation/validationManager.d.ts +2 -2
- package/dist/editors/invoice/validation/validationManager.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationManager.js +5 -5
- package/dist/editors/invoice/validation/validationRules.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationRules.js +178 -178
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/old-contributor-billing/components/DriveExplorer.d.ts +7 -0
- package/dist/old-contributor-billing/components/DriveExplorer.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/DriveExplorer.js +184 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.d.ts +2 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.js +73 -0
- package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +1 -0
- package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableSection.js +1 -1
- package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/RowActionMenu.d.ts +1 -1
- package/dist/old-contributor-billing/components/InvoiceTable/RowActionMenu.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/RowActionMenu.js +2 -0
- package/dist/old-contributor-billing/config.d.ts +3 -0
- package/dist/old-contributor-billing/config.d.ts.map +1 -0
- package/dist/old-contributor-billing/config.js +4 -0
- package/dist/old-contributor-billing/editor.d.ts +3 -0
- package/dist/old-contributor-billing/editor.d.ts.map +1 -0
- package/dist/old-contributor-billing/editor.js +8 -0
- package/dist/old-contributor-billing/module.d.ts +3 -0
- package/dist/old-contributor-billing/module.d.ts.map +1 -0
- package/dist/old-contributor-billing/module.js +9 -0
- package/dist/old-contributor-billing/util.d.ts.map +1 -0
- package/dist/{editors/contributor-billing → old-contributor-billing}/util.js +11 -9
- package/dist/powerhouse.manifest.json +6 -41
- package/dist/processors/index.d.ts +1 -6
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +1 -18
- package/dist/scripts/contributor-billing/createExpenseReportCsv.d.ts.map +1 -1
- package/dist/scripts/contributor-billing/createExpenseReportCsv.js +24 -24
- package/dist/scripts/contributor-billing/createXeroCsv.d.ts.map +1 -1
- package/dist/scripts/contributor-billing/createXeroCsv.js +52 -46
- package/dist/scripts/invoice/autoTagging.d.ts +1 -1
- package/dist/scripts/invoice/autoTagging.d.ts.map +1 -1
- package/dist/scripts/invoice/autoTagging.js +168 -138
- package/dist/scripts/invoice/exampleBatchTxn.js +16 -16
- package/dist/scripts/invoice/gnosisTransactionBuilder.d.ts.map +1 -1
- package/dist/scripts/invoice/gnosisTransactionBuilder.js +32 -25
- package/dist/scripts/invoice/pdfToClaudeAI.d.ts.map +1 -1
- package/dist/scripts/invoice/pdfToClaudeAI.js +36 -30
- package/dist/scripts/invoice/requestFinance.d.ts.map +1 -1
- package/dist/scripts/invoice/requestFinance.js +13 -13
- package/dist/style.css +407 -13659
- package/dist/subgraphs/billing-statement/resolvers.d.ts +1 -1
- package/dist/subgraphs/billing-statement/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/billing-statement/resolvers.js +16 -5
- package/dist/subgraphs/billing-statement/schema.d.ts.map +1 -1
- package/dist/subgraphs/billing-statement/schema.js +12 -67
- package/dist/subgraphs/expense-report/resolvers.d.ts +1 -1
- package/dist/subgraphs/expense-report/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/expense-report/resolvers.js +4 -5
- package/dist/subgraphs/expense-report/schema.d.ts.map +1 -1
- package/dist/subgraphs/expense-report/schema.js +5 -48
- package/dist/subgraphs/index.d.ts +1 -0
- package/dist/subgraphs/index.d.ts.map +1 -1
- package/dist/subgraphs/index.js +1 -0
- package/dist/subgraphs/integrations/resolvers.d.ts +1 -1
- package/dist/subgraphs/integrations/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/integrations/resolvers.js +4 -5
- package/dist/subgraphs/integrations/schema.d.ts.map +1 -1
- package/dist/subgraphs/integrations/schema.js +3 -43
- package/dist/subgraphs/invoice/index.d.ts.map +1 -1
- package/dist/subgraphs/invoice/index.js +1 -20
- package/dist/subgraphs/invoice/resolvers.d.ts +1 -1
- package/dist/subgraphs/invoice/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/invoice/resolvers.js +4 -9
- package/dist/subgraphs/invoice/schema.d.ts.map +1 -1
- package/dist/subgraphs/invoice/schema.js +14 -232
- package/dist/subgraphs/{invoice → invoice-addon}/customResolvers.d.ts +1 -1
- package/dist/subgraphs/invoice-addon/customResolvers.d.ts.map +1 -0
- package/dist/subgraphs/{invoice → invoice-addon}/customResolvers.js +38 -34
- package/dist/subgraphs/invoice-addon/index.d.ts +11 -0
- package/dist/subgraphs/invoice-addon/index.d.ts.map +1 -0
- package/dist/subgraphs/invoice-addon/index.js +11 -0
- package/dist/subgraphs/invoice-addon/resolvers.d.ts +3 -0
- package/dist/subgraphs/invoice-addon/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/invoice-addon/resolvers.js +12 -0
- package/dist/subgraphs/invoice-addon/schema.d.ts +3 -0
- package/dist/subgraphs/invoice-addon/schema.d.ts.map +1 -0
- package/dist/subgraphs/invoice-addon/schema.js +52 -0
- package/package.json +9 -21
- package/dist/document-models/expense-report/gen/expense-report/actions.d.ts +0 -8
- package/dist/document-models/expense-report/gen/expense-report/actions.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/actions.js +0 -1
- package/dist/document-models/expense-report/gen/expense-report/creators.d.ts +0 -4
- package/dist/document-models/expense-report/gen/expense-report/creators.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/creators.js +0 -3
- package/dist/document-models/expense-report/gen/expense-report/error.d.ts +0 -2
- package/dist/document-models/expense-report/gen/expense-report/error.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/error.js +0 -1
- package/dist/document-models/expense-report/gen/expense-report/operations.d.ts +0 -7
- package/dist/document-models/expense-report/gen/expense-report/operations.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/operations.js +0 -3
- package/dist/document-models/expense-report/src/tests/expense-report.test.d.ts +0 -6
- package/dist/document-models/expense-report/src/tests/expense-report.test.d.ts.map +0 -1
- package/dist/document-models/expense-report/src/tests/expense-report.test.js +0 -24
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderStats.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.js +0 -2
- package/dist/editors/contributor-billing/util.d.ts.map +0 -1
- package/dist/editors/hooks/useBillingStatementDocument.d.ts +0 -4
- package/dist/editors/hooks/useBillingStatementDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useBillingStatementDocument.js +0 -8
- package/dist/editors/hooks/useExpenseReportDocument.d.ts +0 -4
- package/dist/editors/hooks/useExpenseReportDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useExpenseReportDocument.js +0 -8
- package/dist/editors/hooks/useIntegrationsDocument.d.ts +0 -4
- package/dist/editors/hooks/useIntegrationsDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useIntegrationsDocument.js +0 -8
- package/dist/editors/hooks/useInvoiceDocument.d.ts +0 -4
- package/dist/editors/hooks/useInvoiceDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useInvoiceDocument.js +0 -8
- package/dist/editors/integrations/config.d.ts +0 -3
- package/dist/editors/integrations/config.d.ts.map +0 -1
- package/dist/editors/integrations/config.js +0 -3
- package/dist/editors/invoice/exportSAFTPT.d.ts +0 -184
- package/dist/editors/invoice/exportSAFTPT.d.ts.map +0 -1
- package/dist/editors/invoice/exportSAFTPT.js +0 -548
- package/dist/processors/line-item-processor/index.d.ts +0 -11
- package/dist/processors/line-item-processor/index.d.ts.map +0 -1
- package/dist/processors/line-item-processor/index.js +0 -36
- package/dist/subgraphs/invoice/customResolvers.d.ts.map +0 -1
- package/editors/invoice/assets/custom.d.ts +0 -4
- package/editors/invoice/assets/powerhouseLogo.png +0 -0
- /package/dist/editors/contributor-billing/components/{InvoiceTable/HeaderStats.d.ts → HeaderStats.d.ts} +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/HeaderControls.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/HeaderControls.js +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTable.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTable.js +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableRow.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableRow.js +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableSection.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/util.d.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Tag, Plus } from "lucide-react";
|
|
2
|
+
import { Tag, Plus, Trash2 } from "lucide-react";
|
|
3
3
|
import { Select } from "@powerhousedao/document-engineering";
|
|
4
4
|
import { InputField } from "../../invoice/components/inputField.js";
|
|
5
5
|
import { NumberForm } from "../../invoice/components/numberForm.js";
|
|
6
|
-
import { actions } from "../../../document-models/billing-statement/index.js";
|
|
6
|
+
import { actions, } from "../../../document-models/billing-statement/index.js";
|
|
7
7
|
import { useState, useRef, useEffect } from "react";
|
|
8
8
|
import { formatNumber } from "../../invoice/lineItems.js";
|
|
9
9
|
import { LineItemTagsTable } from "../lineItemTags/lineItemTags.js";
|
|
@@ -29,7 +29,7 @@ const LineItemsTable = (props) => {
|
|
|
29
29
|
const target = event.target;
|
|
30
30
|
const isSelectMenu = target.closest('[role="listbox"]') || target.closest('[role="option"]');
|
|
31
31
|
// Check if clicking on buttons (save/cancel)
|
|
32
|
-
const isButton = target.closest(
|
|
32
|
+
const isButton = target.closest("button");
|
|
33
33
|
if (tableRef.current &&
|
|
34
34
|
!tableRef.current.contains(event.target) &&
|
|
35
35
|
!isSelectMenu &&
|
|
@@ -151,28 +151,37 @@ const LineItemsTable = (props) => {
|
|
|
151
151
|
setIsAddingNew(false);
|
|
152
152
|
setNewLineItem(initialLineItem);
|
|
153
153
|
};
|
|
154
|
+
const handleDeleteLineItem = (id) => {
|
|
155
|
+
if (editingRow !== null) {
|
|
156
|
+
setEditingRow(null);
|
|
157
|
+
setLocalLineItem(initialLineItem);
|
|
158
|
+
}
|
|
159
|
+
dispatch(actions.deleteLineItem({ id }));
|
|
160
|
+
};
|
|
154
161
|
if (showTagTable) {
|
|
155
162
|
return (_jsx(LineItemTagsTable, { lineItems: state.lineItems, onClose: () => setShowTagTable(false), dispatch: dispatch }));
|
|
156
163
|
}
|
|
157
|
-
return (_jsxs("div", { className: "
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
164
|
+
return (_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "text-xs font-semibold tracking-[0.24em] text-black/60", children: "LINE ITEMS" }), _jsx("div", { className: "text-sm text-black/50", children: "Double\u2011click a row to edit. Click outside to save." })] }), _jsx("div", { className: "flex items-center justify-between gap-3 sm:justify-end", children: _jsxs("button", { type: "button", onClick: () => setShowTagTable(!showTagTable), className: "group inline-flex items-center gap-2 rounded-full border border-black/15 bg-[#efe8da] px-3 py-2 text-xs font-semibold tracking-wide text-black/80 shadow-[0_10px_28px_rgba(15,23,42,0.10)] transition hover:bg-[#e7ddc9] focus:outline-none focus-visible:ring-2 focus-visible:ring-black/20 focus-visible:ring-offset-2 focus-visible:ring-offset-white", "aria-label": "Open tag editor", children: [_jsx(Tag, { className: "h-4 w-4 text-black/70" }), "Tags"] }) })] }), _jsxs("div", { className: "mt-4 overflow-hidden rounded-xl border border-black/10 bg-white shadow-[inset_0_1px_0_rgba(255,255,255,0.9)]", children: [_jsx("div", { className: "overflow-x-auto", ref: tableRef, children: _jsx("div", { className: "min-w-[980px]", children: _jsxs("table", { className: "w-full border-collapse text-sm", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-[#efe8da] text-[#14120f]", children: [_jsx("th", { className: "w-10 border-b border-black/10 px-2 py-3 text-center text-[11px] font-semibold tracking-[0.20em] text-black/70", children: "#" }), _jsx("th", { className: "w-[28rem] border-b border-black/10 px-3 py-3 text-left text-[11px] font-semibold tracking-[0.20em] text-black/70", children: "DESCRIPTION" }), _jsx("th", { className: "w-44 border-b border-black/10 px-3 py-3 text-left text-[11px] font-semibold tracking-[0.20em] text-black/70", children: "UNIT" }), _jsx("th", { className: "w-20 border-b border-black/10 px-3 py-3 text-right text-[11px] font-semibold tracking-[0.20em] text-black/70", children: "QTY" }), _jsx("th", { className: "w-28 border-b border-black/10 px-3 py-3 text-right text-[11px] font-semibold tracking-[0.20em] text-black/70", children: "FIAT/UNIT" }), _jsx("th", { className: "w-28 border-b border-black/10 px-3 py-3 text-right text-[11px] font-semibold tracking-[0.20em] text-black/70", children: "POWT/UNIT" }), _jsx("th", { className: "w-32 border-b border-black/10 px-3 py-3 text-right text-[11px] font-semibold tracking-[0.20em] text-black/70", children: "TOTAL FIAT" }), _jsx("th", { className: "w-32 border-b border-black/10 px-3 py-3 text-right text-[11px] font-semibold tracking-[0.20em] text-black/70", children: "TOTAL POWT" }), _jsx("th", { className: "w-16 border-b border-black/10 px-2 py-3 text-center text-[11px] font-semibold tracking-[0.20em] text-black/70" })] }) }), _jsxs("tbody", { className: "text-black/90", children: [state.lineItems.map((item, idx) => editingRow === idx ? (_jsxs("tr", { className: "bg-[#fff3cf] shadow-[inset_0_0_0_1px_rgba(245,158,11,0.35)]", children: [_jsx("td", { className: "border-b border-black/10 px-2 py-3 text-center font-mono text-xs tabular-nums text-black/60", children: idx + 1 }), _jsx("td", { className: "border-b border-black/10 px-3 py-2", children: _jsx(InputField, { input: localLineItem.description, value: localLineItem.description, onBlur: () => { }, handleInputChange: (e) => handleInputChange("description", e.target.value), className: "w-full rounded-lg border border-black/15 bg-white px-3 py-2 text-sm shadow-[inset_0_1px_0_rgba(255,255,255,0.9)]" }) }), _jsx("td", { className: "border-b border-black/10 px-3 py-2", children: _jsx(Select, { options: units, value: localLineItem.unit, onChange: (value) => handleInputChange("unit", value), className: "w-44 rounded-lg border border-black/15 bg-white px-2 py-2 text-sm" }) }), _jsx("td", { className: "border-b border-black/10 px-3 py-2", children: _jsx(NumberForm, { number: localLineItem.quantity, handleInputChange: (e) => handleInputChange("quantity", e.target.value), className: "w-24 rounded-lg border border-black/15 bg-white px-3 py-2 text-right font-mono tabular-nums shadow-[inset_0_1px_0_rgba(255,255,255,0.9)]" }) }), _jsx("td", { className: "border-b border-black/10 px-3 py-2", children: _jsx(NumberForm, { number: localLineItem.unitPriceCash, handleInputChange: (e) => handleInputChange("unitPriceCash", String(e.target.value)), className: "w-28 rounded-lg border border-black/15 bg-white px-3 py-2 text-right font-mono tabular-nums shadow-[inset_0_1px_0_rgba(255,255,255,0.9)]" }) }), _jsx("td", { className: "border-b border-black/10 px-3 py-2", children: _jsx(NumberForm, { number: localLineItem.unitPricePwt, handleInputChange: (e) => handleInputChange("unitPricePwt", e.target.value), className: "w-28 rounded-lg border border-black/15 bg-white px-3 py-2 text-right font-mono tabular-nums shadow-[inset_0_1px_0_rgba(255,255,255,0.9)]" }) }), _jsx("td", { className: "border-b border-black/10 px-3 py-3 text-right font-mono tabular-nums text-black/70", children: localLineItem.quantity && localLineItem.unitPriceCash
|
|
165
|
+
? Number(localLineItem.quantity) *
|
|
166
|
+
Number(localLineItem.unitPriceCash)
|
|
167
|
+
: "" }), _jsx("td", { className: "border-b border-black/10 px-3 py-3 text-right font-mono tabular-nums text-black/70", children: localLineItem.quantity && localLineItem.unitPricePwt
|
|
168
|
+
? Number(localLineItem.quantity) *
|
|
169
|
+
Number(localLineItem.unitPricePwt)
|
|
170
|
+
: "" }), _jsx("td", { className: "border-b border-black/10 px-2 py-3 text-center", children: _jsx("button", { type: "button", onClick: (e) => {
|
|
171
|
+
e.stopPropagation();
|
|
172
|
+
handleDeleteLineItem(String(localLineItem.id));
|
|
173
|
+
}, className: "inline-flex items-center justify-center rounded-lg p-1.5 text-red-600/70 transition hover:bg-red-50 hover:text-red-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/20 focus-visible:ring-offset-1", "aria-label": "Delete line item", children: _jsx(Trash2, { className: "h-4 w-4" }) }) })] }, item.id)) : (_jsxs("tr", { className: "cursor-pointer odd:bg-[#fbf8f1] even:bg-white hover:bg-[#fff3cf]/60", onDoubleClick: () => {
|
|
174
|
+
setEditingRow(idx);
|
|
175
|
+
setLocalLineItem({ ...item });
|
|
176
|
+
}, children: [_jsx("td", { className: "border-b border-black/10 px-2 py-3 text-center font-mono text-xs tabular-nums text-black/60", children: idx + 1 }), _jsx("td", { className: "border-b border-black/10 px-3 py-3", children: item.description }), _jsx("td", { className: "border-b border-black/10 px-3 py-3 text-center text-xs font-semibold tracking-wide text-black/60", children: item.unit }), _jsx("td", { className: "border-b border-black/10 px-3 py-3 text-right font-mono tabular-nums", children: item.quantity }), _jsx("td", { className: "border-b border-black/10 px-3 py-3 text-right font-mono tabular-nums", children: formatNumber(item.unitPriceCash) }), _jsx("td", { className: "border-b border-black/10 px-3 py-3 text-right font-mono tabular-nums", children: formatNumber(item.unitPricePwt) }), _jsx("td", { className: "border-b border-black/10 px-3 py-3 text-right font-mono tabular-nums", children: formatNumber(item.totalPriceCash) }), _jsx("td", { className: "border-b border-black/10 px-3 py-3 text-right font-mono tabular-nums", children: formatNumber(item.totalPricePwt) }), _jsx("td", { className: "border-b border-black/10 px-2 py-3 text-center", children: _jsx("button", { type: "button", onClick: (e) => {
|
|
177
|
+
e.stopPropagation();
|
|
178
|
+
handleDeleteLineItem(item.id);
|
|
179
|
+
}, className: "inline-flex items-center justify-center rounded-lg p-1.5 text-red-600/70 transition hover:bg-red-50 hover:text-red-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/20 focus-visible:ring-offset-1", "aria-label": "Delete line item", children: _jsx(Trash2, { className: "h-4 w-4" }) }) })] }, item.id))), isAddingNew && (_jsxs("tr", { className: "bg-[#e8fff3] shadow-[inset_0_0_0_1px_rgba(16,185,129,0.22)]", children: [_jsx("td", { className: "border-b border-black/10 px-2 py-3 text-center font-mono text-xs tabular-nums text-black/60", children: state.lineItems.length + 1 }), _jsx("td", { className: "border-b border-black/10 px-3 py-2", children: _jsx(InputField, { input: newLineItem.description, value: newLineItem.description, onBlur: () => { }, handleInputChange: (e) => handleNewLineItemChange("description", e.target.value), className: "w-full rounded-lg border border-black/15 bg-white px-3 py-2 text-sm shadow-[inset_0_1px_0_rgba(255,255,255,0.9)]" }) }), _jsx("td", { className: "border-b border-black/10 px-3 py-2", children: _jsx(Select, { options: units, value: newLineItem.unit, onChange: (value) => handleNewLineItemChange("unit", value), className: "w-44 rounded-lg border border-black/15 bg-white px-2 py-2 text-sm" }) }), _jsx("td", { className: "border-b border-black/10 px-3 py-2", children: _jsx(NumberForm, { number: newLineItem.quantity, handleInputChange: (e) => handleNewLineItemChange("quantity", e.target.value), className: "w-24 rounded-lg border border-black/15 bg-white px-3 py-2 text-right font-mono tabular-nums shadow-[inset_0_1px_0_rgba(255,255,255,0.9)]" }) }), _jsx("td", { className: "border-b border-black/10 px-3 py-2", children: _jsx(NumberForm, { number: newLineItem.unitPriceCash, handleInputChange: (e) => handleNewLineItemChange("unitPriceCash", String(e.target.value)), className: "w-28 rounded-lg border border-black/15 bg-white px-3 py-2 text-right font-mono tabular-nums shadow-[inset_0_1px_0_rgba(255,255,255,0.9)]" }) }), _jsx("td", { className: "border-b border-black/10 px-3 py-2", children: _jsx(NumberForm, { number: newLineItem.unitPricePwt, handleInputChange: (e) => handleNewLineItemChange("unitPricePwt", e.target.value), className: "w-28 rounded-lg border border-black/15 bg-white px-3 py-2 text-right font-mono tabular-nums shadow-[inset_0_1px_0_rgba(255,255,255,0.9)]" }) }), _jsx("td", { className: "border-b border-black/10 px-3 py-3 text-right font-mono tabular-nums text-black/70", children: newLineItem.quantity && newLineItem.unitPriceCash
|
|
180
|
+
? Number(newLineItem.quantity) *
|
|
181
|
+
Number(newLineItem.unitPriceCash)
|
|
182
|
+
: "" }), _jsx("td", { className: "border-b border-black/10 px-3 py-3 text-right font-mono tabular-nums text-black/70", children: newLineItem.quantity && newLineItem.unitPricePwt
|
|
183
|
+
? Number(newLineItem.quantity) *
|
|
184
|
+
Number(newLineItem.unitPricePwt)
|
|
185
|
+
: "" }), _jsx("td", { className: "border-b border-black/10 px-2 py-3 text-center" })] }))] })] }) }) }), !isAddingNew && (_jsx("div", { className: "flex justify-center bg-[#fbf8f1] px-4 py-4", children: _jsxs("button", { onClick: handleAddLineItem, className: "inline-flex items-center gap-2 rounded-full border border-black/15 bg-[#efe8da] px-4 py-2 text-xs font-semibold tracking-wide text-black/80 shadow-[0_10px_28px_rgba(15,23,42,0.10)] transition hover:bg-[#e7ddc9] focus:outline-none focus-visible:ring-2 focus-visible:ring-black/20 focus-visible:ring-offset-2 focus-visible:ring-offset-white", children: [_jsx(Plus, { className: "h-4 w-4 text-black/70" }), "Add Line Item"] }) })), isAddingNew && (_jsxs("div", { className: "flex justify-center gap-2 bg-[#fbf8f1] px-4 py-4", children: [_jsx("button", { onClick: handleSaveNewLineItem, className: "rounded-full bg-emerald-600 px-4 py-2 text-xs font-semibold tracking-wide text-white shadow-[0_10px_28px_rgba(0,0,0,0.18)] transition hover:bg-emerald-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-600/60 focus-visible:ring-offset-2 focus-visible:ring-offset-white", children: "Save Line Item" }), _jsx("button", { onClick: handleCancelAdd, className: "rounded-full bg-[#121319] px-4 py-2 text-xs font-semibold tracking-wide text-[#f6f1e7] shadow-[0_10px_28px_rgba(0,0,0,0.18)] transition hover:bg-[#1b1d26] focus:outline-none focus-visible:ring-2 focus-visible:ring-[#f2d38a]/60 focus-visible:ring-offset-2 focus-visible:ring-offset-white", children: "Cancel" })] }))] })] }));
|
|
177
186
|
};
|
|
178
187
|
export default LineItemsTable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectSetTable.d.ts","sourceRoot":"","sources":["../../../../editors/billing-statement/components/objectSetTable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"objectSetTable.d.ts","sourceRoot":"","sources":["../../../../editors/billing-statement/components/objectSetTable.tsx"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAE5B,MAAM,qDAAqD,CAAC;AAqB7D,QAAA,MAAM,uBAAuB,GAAI,OAAO;IACtC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;CAClD,4CAmKA,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
2
|
import { Tag } from "lucide-react";
|
|
4
3
|
import { ObjectSetTable, Select } from "@powerhousedao/document-engineering";
|
|
5
|
-
import { useMemo
|
|
4
|
+
import { useMemo } from "react";
|
|
6
5
|
import { actions, } from "../../../document-models/billing-statement/index.js";
|
|
7
6
|
const ObjectSetTableComponent = (props) => {
|
|
8
7
|
const { state, dispatch } = props;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { EditorProps } from "document-model";
|
|
2
2
|
export type IProps = EditorProps;
|
|
3
|
+
export declare const currencyList: {
|
|
4
|
+
ticker: string;
|
|
5
|
+
crypto: boolean;
|
|
6
|
+
}[];
|
|
3
7
|
export default function Editor(props: Partial<EditorProps> & {
|
|
4
8
|
documentId?: string;
|
|
5
9
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/billing-statement/editor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAiBlD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AAEjC,MAAM,CAAC,OAAO,UAAU,MAAM,CAC5B,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/billing-statement/editor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAiBlD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AAEjC,eAAO,MAAM,YAAY;;;GAWxB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAC5B,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,kDAuKtD"}
|
|
@@ -2,34 +2,52 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { actions, } from "../../document-models/billing-statement/index.js";
|
|
4
4
|
import { CurrencyForm } from "../invoice/components/currencyForm.js";
|
|
5
|
-
import { Textarea } from "@powerhousedao/document-engineering";
|
|
5
|
+
import { Textarea, Select } from "@powerhousedao/document-engineering";
|
|
6
6
|
import LineItemsTable from "./components/lineItemsTable.js";
|
|
7
7
|
import { formatNumber } from "../invoice/lineItems.js";
|
|
8
|
-
import { useSelectedBillingStatementDocument } from "
|
|
8
|
+
import { useSelectedBillingStatementDocument } from "../../document-models/billing-statement/hooks.js";
|
|
9
9
|
import { DocumentToolbar } from "@powerhousedao/design-system/connect";
|
|
10
10
|
import { setSelectedNode, useParentFolderForSelectedNode, } from "@powerhousedao/reactor-browser";
|
|
11
|
+
export const currencyList = [
|
|
12
|
+
{ ticker: "USDS", crypto: true },
|
|
13
|
+
{ ticker: "USDC", crypto: true },
|
|
14
|
+
{ ticker: "DAI", crypto: true },
|
|
15
|
+
{ ticker: "USD", crypto: false },
|
|
16
|
+
{ ticker: "EUR", crypto: false },
|
|
17
|
+
{ ticker: "DKK", crypto: false },
|
|
18
|
+
{ ticker: "GBP", crypto: false },
|
|
19
|
+
{ ticker: "JPY", crypto: false },
|
|
20
|
+
{ ticker: "CNY", crypto: false },
|
|
21
|
+
{ ticker: "CHF", crypto: false },
|
|
22
|
+
];
|
|
11
23
|
export default function Editor(props) {
|
|
12
24
|
const [doc, dispatch] = useSelectedBillingStatementDocument();
|
|
13
25
|
const state = doc?.state.global;
|
|
26
|
+
// ALL HOOKS MUST BE CALLED BEFORE ANY CONDITIONAL RETURNS
|
|
27
|
+
const [notes, setNotes] = useState(state?.notes ?? "");
|
|
28
|
+
// Get the parent folder node for the currently selected node
|
|
29
|
+
const parentFolder = useParentFolderForSelectedNode();
|
|
14
30
|
if (!state) {
|
|
15
31
|
console.log("Document state not found from document id", props.documentId);
|
|
16
32
|
return null;
|
|
17
33
|
}
|
|
18
|
-
const [notes, setNotes] = useState(state.notes ?? "");
|
|
19
|
-
// Get the parent folder node for the currently selected node
|
|
20
|
-
const parentFolder = useParentFolderForSelectedNode();
|
|
21
34
|
// Set the selected node to the parent folder node (close the editor)
|
|
22
35
|
function handleClose() {
|
|
23
|
-
setSelectedNode(parentFolder
|
|
36
|
+
setSelectedNode(parentFolder);
|
|
24
37
|
}
|
|
25
|
-
return (_jsxs("div", { children: [_jsx(DocumentToolbar, { document: doc, onClose: handleClose }),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
return (_jsxs("div", { className: "min-h-screen w-full bg-white text-[#14120f]", children: [_jsx(DocumentToolbar, { document: doc, onClose: handleClose }), _jsx("div", { className: "w-full bg-white", children: _jsxs("div", { className: "mx-auto w-full max-w-6xl px-4 py-10 sm:px-6 lg:px-8", children: [_jsxs("div", { className: "overflow-hidden rounded-2xl border border-black/10 bg-white text-[#14120f] shadow-[0_18px_50px_rgba(15,23,42,0.10)]", children: [_jsx("div", { className: "border-b border-black/10 bg-[#efe8da] px-6 py-5 text-[#14120f]", children: _jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between", children: [_jsx("div", { className: "space-y-1", children: _jsx("h1", { className: "font-serif text-2xl tracking-tight sm:text-3xl", children: "Billing Statement" }) }), _jsxs("div", { className: "grid grid-cols-2 gap-x-6 gap-y-2 text-sm sm:text-right", children: [_jsx("div", { className: "text-black/60", children: "Submitter" }), _jsx("div", { className: "font-semibold text-black/90", children: state.contributor }), _jsx("div", { className: "text-black/60", children: "Status" }), _jsx("div", { className: "flex justify-start sm:justify-end", children: _jsx("span", { className: "inline-flex items-center rounded-full border border-black/15 bg-black/5 px-3 py-1 text-xs font-semibold tracking-wide text-black/80", children: String(state.status || "—") }) })] })] }) }), _jsxs("div", { className: "px-6 py-6", children: [_jsxs("div", { className: "flex flex-col gap-3 rounded-xl border border-black/10 bg-[#efe8da] px-4 py-3 sm:flex-row sm:items-center sm:justify-between", children: [_jsx("div", { className: "text-sm text-black/60", children: "Keep edits lightweight: double\u2011click a row to edit, click outside to auto\u2011save." }), _jsxs("div", { className: "flex items-center justify-between gap-3 sm:justify-end", children: [_jsx("span", { className: "text-xs font-semibold tracking-wide text-black/60", children: "CURRENCY" }), _jsx("div", { className: "rounded-lg border border-black/10 px-2 py-1 shadow-[inset_0_1px_0_rgba(255,255,255,0.9)]", children: _jsx(Select, { className: "w-28", options: currencyList.map((currency) => ({
|
|
39
|
+
value: currency.ticker,
|
|
40
|
+
label: currency.ticker,
|
|
41
|
+
})), value: state.currency, onChange: (value) => {
|
|
42
|
+
dispatch(actions.editBillingStatement({
|
|
43
|
+
currency: value,
|
|
44
|
+
}));
|
|
45
|
+
} }) })] })] }), _jsx("div", { className: "mt-6", children: _jsx(LineItemsTable, { state: state, dispatch: dispatch }) }), _jsxs("div", { className: "mt-8 grid gap-6 lg:grid-cols-2", children: [_jsxs("div", { className: "rounded-xl border border-black/10 bg-white p-4 shadow-[inset_0_1px_0_rgba(255,255,255,0.9)]", children: [_jsx(Textarea, { label: "Notes", placeholder: "Add notes", autoExpand: true, rows: 4, multiline: true, value: notes, onBlur: (e) => {
|
|
46
|
+
const newValue = e.target.value;
|
|
47
|
+
if (newValue !== state.notes) {
|
|
48
|
+
dispatch(actions.editBillingStatement({ notes: newValue }));
|
|
49
|
+
}
|
|
50
|
+
}, onChange: (e) => {
|
|
51
|
+
setNotes(e.target.value);
|
|
52
|
+
}, className: "p-2" }), _jsx("div", { className: "mt-2 text-xs text-black/50", children: "Tip: notes are saved by clicking outside of the textarea or pressing tab." })] }), _jsxs("div", { className: "rounded-xl border border-black/10 bg-white p-4 shadow-[inset_0_1px_0_rgba(255,255,255,0.9)]", children: [_jsxs("div", { className: "flex items-baseline justify-between", children: [_jsx("div", { className: "text-xs font-semibold tracking-[0.24em] text-black/60", children: "TOTALS" }), _jsx("div", { className: "text-xs text-black/40", children: "read\u2011only" })] }), _jsx("div", { className: "mt-3 overflow-hidden rounded-lg border border-black/10", children: _jsxs("table", { className: "w-full border-collapse", children: [_jsx("thead", { className: "bg-[#efe8da] text-[#14120f]", children: _jsxs("tr", { children: [_jsx("th", { className: "border-b border-black/10 px-4 py-3 text-left text-xs font-semibold tracking-wide text-black/70", children: "Total Fiat" }), _jsx("th", { className: "border-b border-black/10 px-4 py-3 text-left text-xs font-semibold tracking-wide text-black/70", children: "Total POWT" })] }) }), _jsx("tbody", { className: "bg-[#fbf8f1]", children: _jsxs("tr", { children: [_jsx("td", { className: "border-t border-black/10 px-4 py-4 font-mono text-sm tabular-nums text-black/90", children: formatNumber(state.totalCash) }), _jsx("td", { className: "border-t border-black/10 px-4 py-4 font-mono text-sm tabular-nums text-black/90", children: formatNumber(state.totalPowt) })] }) })] }) }), _jsx("div", { className: "mt-3 text-xs text-black/50", children: "Totals update from line items." })] })] })] })] }), _jsx("div", { className: "mt-6 text-center text-xs text-black/40", children: "This view is a styled editor shell \u2014 your document operations remain unchanged." })] }) })] }));
|
|
35
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineItemTags.d.ts","sourceRoot":"","sources":["../../../../editors/billing-statement/lineItemTags/lineItemTags.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAKtC,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC5B,MAAM,qDAAqD,CAAC;AAG7D,UAAU,gBAAgB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,mBAAmB,EAAE,CAAC;CACpC;AAED,UAAU,sBAAsB;IAC9B,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC;CAC5C;AAED,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,OAAO,EACP,QAAQ,GACT,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"lineItemTags.d.ts","sourceRoot":"","sources":["../../../../editors/billing-statement/lineItemTags/lineItemTags.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAKtC,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC5B,MAAM,qDAAqD,CAAC;AAG7D,UAAU,gBAAgB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,mBAAmB,EAAE,CAAC;CACpC;AAED,UAAU,sBAAsB;IAC9B,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC;CAC5C;AAED,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,OAAO,EACP,QAAQ,GACT,EAAE,sBAAsB,2CAiMxB"}
|
|
@@ -19,41 +19,40 @@ export function LineItemTagsTable({ lineItems, onClose, dispatch, }) {
|
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
return (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
} }) })] }, item.id))) })] }) })] }));
|
|
22
|
+
return (_jsx("div", { className: "min-h-screen w-full bg-white text-[#14120f]", children: _jsx("div", { className: "mx-auto w-full max-w-6xl px-4 py-10 sm:px-6 lg:px-8", children: _jsxs("div", { className: "overflow-hidden rounded-2xl border border-black/10 bg-white text-[#14120f] shadow-[0_18px_50px_rgba(15,23,42,0.10)]", children: [_jsxs("div", { className: "flex flex-col gap-4 border-b border-black/10 bg-[#efe8da] px-6 py-5 text-[#14120f] sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "grid h-10 w-10 place-items-center rounded-xl border border-black/10 bg-white", children: _jsx(Tag, { className: "h-5 w-5 text-black/70" }) }), _jsxs("div", { children: [_jsx("div", { className: "text-[11px] font-semibold tracking-[0.22em] text-black/60", children: "TAG EDITOR" }), _jsx("h2", { className: "font-serif text-xl tracking-tight", children: "Assign tags to line items" })] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { color: "light", size: "small", onClick: handleReset, children: "Reset" }), _jsx("button", { type: "button", onClick: onClose, className: "inline-flex items-center justify-center rounded-full border border-black/15 bg-black/5 p-2 text-black/70 transition hover:bg-black/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-black/20 focus-visible:ring-offset-2 focus-visible:ring-offset-[#efe8da]", "aria-label": "Close tag editor", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsxs("div", { className: "p-6", children: [_jsx("div", { className: "overflow-hidden rounded-xl border border-black/10 bg-white shadow-[inset_0_1px_0_rgba(255,255,255,0.9)]", children: _jsx("div", { className: "overflow-x-auto", children: _jsxs("table", { className: "w-full border-collapse", children: [_jsx("thead", { className: "bg-[#efe8da] text-[#14120f]", children: _jsxs("tr", { children: [_jsx("th", { className: "border-b border-black/10 px-3 py-3 text-left text-[11px] font-semibold tracking-[0.20em] text-black/70", children: "ITEM" }), _jsx("th", { className: "border-b border-black/10 px-3 py-3 text-left text-[11px] font-semibold tracking-[0.20em] text-black/70", children: "PERIOD" }), _jsx("th", { className: "border-b border-black/10 px-3 py-3 text-left text-[11px] font-semibold tracking-[0.20em] text-black/70", children: "EXPENSE ACCOUNT" }), _jsx("th", { className: "border-b border-black/10 px-3 py-3 text-left text-[11px] font-semibold tracking-[0.20em] text-black/70", children: "BUDGET" })] }) }), _jsx("tbody", { className: "text-sm text-black/90", children: lineItems.map((item) => (_jsxs("tr", { className: "odd:bg-[#fbf8f1] even:bg-white hover:bg-[#fff3cf]/60", children: [_jsx("td", { className: "border-b border-gray-200 p-2", children: _jsx(InputField, { value: item.description, handleInputChange: (e) => { }, onBlur: (e) => {
|
|
23
|
+
dispatch(actions.editLineItem({
|
|
24
|
+
id: item.id,
|
|
25
|
+
description: e.target.value,
|
|
26
|
+
}));
|
|
27
|
+
}, className: "w-full text-xs" }) }), _jsx("td", { className: "border-b border-gray-200 p-2 w-50", children: _jsx(DatePicker, { name: "period", dateFormat: "YYYY-MM-DD", autoClose: true, placeholder: "Select Period", value: item.lineItemTag.find((tag) => tag.dimension === "accounting-period")?.label || "", onChange: (e) => dispatch(actions.editLineItemTag({
|
|
28
|
+
lineItemId: item.id,
|
|
29
|
+
dimension: "accounting-period",
|
|
30
|
+
value: new Date(e.target.value)
|
|
31
|
+
.toLocaleDateString("en-US", {
|
|
32
|
+
year: "numeric",
|
|
33
|
+
month: "numeric",
|
|
34
|
+
})
|
|
35
|
+
.split("/")
|
|
36
|
+
.reverse()
|
|
37
|
+
.join("/"),
|
|
38
|
+
label: new Date(e.target.value).toLocaleDateString("en-US", {
|
|
39
|
+
month: "long",
|
|
40
|
+
year: "numeric",
|
|
41
|
+
}),
|
|
42
|
+
})), className: "w-full text-xs bg-white" }) }), _jsx("td", { className: "border-b border-gray-200 p-2", children: _jsx(Select, { options: expenseAccountOptions, value: item.lineItemTag.find((tag) => tag.dimension === "expense-account")?.value || "", placeholder: "Select Expense Account", searchable: true, onChange: (value) => {
|
|
43
|
+
const selectedOption = expenseAccountOptions.find((option) => option.value === value);
|
|
44
|
+
dispatch(actions.editLineItemTag({
|
|
45
|
+
lineItemId: item.id,
|
|
46
|
+
dimension: "expense-account",
|
|
47
|
+
value: selectedOption?.value || "",
|
|
48
|
+
label: selectedOption?.label,
|
|
49
|
+
}));
|
|
50
|
+
}, className: "w-full text-xs" }) }), _jsx("td", { className: "border-b border-gray-200 p-2", children: _jsx(Select, { options: budgetOptions, value: item.lineItemTag.find((tag) => tag.dimension === "budget")?.value || "", placeholder: "Select Budget", onChange: (value) => {
|
|
51
|
+
dispatch(actions.editLineItemTag({
|
|
52
|
+
lineItemId: item.id,
|
|
53
|
+
dimension: "budget",
|
|
54
|
+
value: value,
|
|
55
|
+
label: budgetOptions.find((option) => option.value === value)?.label,
|
|
56
|
+
}));
|
|
57
|
+
} }) })] }, item.id))) })] }) }) }), _jsx("div", { className: "mt-4 text-xs text-black/50", children: "Changes persist as you blur fields/selects." })] })] }) }) }));
|
|
59
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tagMapping.d.ts","sourceRoot":"","sources":["../../../../editors/billing-statement/lineItemTags/tagMapping.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"tagMapping.d.ts","sourceRoot":"","sources":["../../../../editors/billing-statement/lineItemTags/tagMapping.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAoHhF,eAAO,MAAM,qBAAqB,EAAE,YAAY,EAO9C,CAAC;AAEH,eAAO,MAAM,aAAa,EAAE,YAAY,EAGvC,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,cAAc,UAAU,EAAE,+BAmBjD,CAAC"}
|
|
@@ -9,15 +9,24 @@ const billingTagMapping = [
|
|
|
9
9
|
{ fusion: "Travel & Entertainment", xero: "3001 - Meals" },
|
|
10
10
|
{ fusion: "Travel & Entertainment", xero: "3002 - Airfare" },
|
|
11
11
|
{ fusion: "Travel & Entertainment", xero: "3003 - Hotels" },
|
|
12
|
-
{
|
|
12
|
+
{
|
|
13
|
+
fusion: "Travel & Entertainment",
|
|
14
|
+
xero: "3004 - Transportation (Uber, Taxi etc)",
|
|
15
|
+
},
|
|
13
16
|
{ fusion: "Travel & Entertainment", xero: "3005 - Other travel cost" },
|
|
14
17
|
{ fusion: "Cost of Goods Sold", xero: "310 - Cost of Goods Sold" },
|
|
15
18
|
{ fusion: "Marketing Expense", xero: "400 - Advertising" },
|
|
16
19
|
{ fusion: "Professional Services", xero: "4001 - Legal Fees Abroad" },
|
|
17
20
|
{ fusion: "Professional Services", xero: "4002 - Legal Fees Switzerland" },
|
|
18
21
|
{ fusion: "Professional Services", xero: "4003 - Finance Team Fees Abroad" },
|
|
19
|
-
{
|
|
20
|
-
|
|
22
|
+
{
|
|
23
|
+
fusion: "Professional Services",
|
|
24
|
+
xero: "4004 - Finance and Accounting Fees Switzerland",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
fusion: "Software Development Expense",
|
|
28
|
+
xero: "4005 - Software Development Team Fees",
|
|
29
|
+
},
|
|
21
30
|
{ fusion: "Professional Services", xero: "4006 - Research Team Fees" },
|
|
22
31
|
{ fusion: "Marketing Expense", xero: "4007 - Marketing Team Fees" },
|
|
23
32
|
{ fusion: "Compensation & Benefits", xero: "4008 - Health Care Fees" },
|
|
@@ -32,7 +41,10 @@ const billingTagMapping = [
|
|
|
32
41
|
{ fusion: "Admin Expense", xero: "453 - Office Expenses" },
|
|
33
42
|
{ fusion: "Admin Expense", xero: "469 - Rent" },
|
|
34
43
|
{ fusion: "Admin Expense", xero: "485 - Subscriptions" },
|
|
35
|
-
{
|
|
44
|
+
{
|
|
45
|
+
fusion: "Other Income Expense (Non-operating)",
|
|
46
|
+
xero: "497 - Bank Revaluations",
|
|
47
|
+
},
|
|
36
48
|
{ fusion: "Other Income", xero: "498 - Unrealised Currency Gains" },
|
|
37
49
|
{ fusion: "Other Income", xero: "499 - Realised Currency Gains" },
|
|
38
50
|
{ fusion: "Income Tax Expense", xero: "505 - Income Tax Expense" },
|
|
@@ -42,9 +54,15 @@ const billingTagMapping = [
|
|
|
42
54
|
{ fusion: "Software Expense", xero: "701 - Software/IT Subscriptions" },
|
|
43
55
|
{ fusion: "Software Expense", xero: "702 - Telephone and Internet Charges" },
|
|
44
56
|
{ fusion: "Fixed Asset", xero: "710 - Office Equipment" },
|
|
45
|
-
{
|
|
57
|
+
{
|
|
58
|
+
fusion: "Fixed Asset",
|
|
59
|
+
xero: "711 - Less Accumulated Depreciation on Office Equipment",
|
|
60
|
+
},
|
|
46
61
|
{ fusion: "Non-Current Asset", xero: "720 - Computer Equipment" },
|
|
47
|
-
{
|
|
62
|
+
{
|
|
63
|
+
fusion: "Non-Current Asset",
|
|
64
|
+
xero: "721 - Less Accumulated Depreciation on Computer Equipment",
|
|
65
|
+
},
|
|
48
66
|
{ fusion: "Current Liability", xero: "800 - Accounts Payable" },
|
|
49
67
|
{ fusion: "Other", xero: "8000 - Bank Fees" },
|
|
50
68
|
{ fusion: "Gas Expense", xero: "8001 - Gas Fees" },
|
|
@@ -64,11 +82,11 @@ const billingTagMapping = [
|
|
|
64
82
|
{ fusion: "Owner Equity", xero: "881 - Owner A Funds Introduced" },
|
|
65
83
|
{ fusion: "Non-current Liability", xero: "900 - Loan" },
|
|
66
84
|
{ fusion: "Equity", xero: "960 - Retained Earnings" },
|
|
67
|
-
{ fusion: "Equity", xero: "970 - Owner A Share Capital" }
|
|
85
|
+
{ fusion: "Equity", xero: "970 - Owner A Share Capital" },
|
|
68
86
|
];
|
|
69
87
|
// Mapping of labels to values
|
|
70
88
|
const fusionLabelToValue = {
|
|
71
|
-
|
|
89
|
+
Budget: "budget",
|
|
72
90
|
"Current Liability": "liabilities/current",
|
|
73
91
|
"Interest Income": "income/interest",
|
|
74
92
|
"Travel & Entertainment": "expenses/headcount/travel-and-entertainment",
|
|
@@ -88,11 +106,11 @@ const fusionLabelToValue = {
|
|
|
88
106
|
"Gas Expense": "expenses/non-headcount/gas",
|
|
89
107
|
"Adjustment A/C": "accounts/adjustment",
|
|
90
108
|
"Temporary Holding Account": "accounts/temporary",
|
|
91
|
-
|
|
109
|
+
Other: "accounts/other",
|
|
92
110
|
"Internal Transfers": "accounts/internal-transfers",
|
|
93
111
|
"Owner Equity": "equity/owner",
|
|
94
112
|
"Non-current Liability": "liabilities/non-current",
|
|
95
|
-
|
|
113
|
+
Equity: "equity/retained",
|
|
96
114
|
};
|
|
97
115
|
export const expenseAccountOptions = Array.from(new Set(billingTagMapping.map((tag) => tag.fusion))).map((tag) => {
|
|
98
116
|
return {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateDocument.d.ts","sourceRoot":"","sources":["../../../../editors/clean-new-editor/components/CreateDocument.tsx"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,cAAc,4CAsB7B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { showCreateDocumentModal, useAllowedDocumentModelModules, } from "@powerhousedao/reactor-browser";
|
|
3
|
+
/**
|
|
4
|
+
* Document creation UI component.
|
|
5
|
+
* Displays available document types as clickable buttons.
|
|
6
|
+
*/
|
|
7
|
+
export function CreateDocument() {
|
|
8
|
+
const allowedDocumentModelModules = useAllowedDocumentModelModules();
|
|
9
|
+
return (_jsxs("div", { children: [_jsx("h3", { className: "mb-3 mt-4 text-sm font-bold text-gray-600", children: "Create document" }), _jsx("div", { className: "flex w-full flex-wrap gap-4", children: allowedDocumentModelModules?.map((documentModelModule) => {
|
|
10
|
+
return (_jsx(CreateDocumentButton, { documentModelModule: documentModelModule }, documentModelModule.documentModel.global.id));
|
|
11
|
+
}) })] }));
|
|
12
|
+
}
|
|
13
|
+
function CreateDocumentButton({ documentModelModule }) {
|
|
14
|
+
const documentType = documentModelModule.documentModel.global.id;
|
|
15
|
+
const documentModelName = documentModelModule.documentModel.global.name || documentType;
|
|
16
|
+
const documentModelDescription = documentModelModule.documentModel.global.description;
|
|
17
|
+
return (_jsx("button", { className: "cursor-pointer rounded-md bg-gray-200 py-2 px-3 hover:bg-gray-300", title: documentModelName, "aria-description": documentModelDescription, onClick: () => showCreateDocumentModal(documentType), children: documentModelName }));
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DriveContents.d.ts","sourceRoot":"","sources":["../../../../editors/clean-new-editor/components/DriveContents.tsx"],"names":[],"mappings":"AAMA,4DAA4D;AAC5D,wBAAgB,aAAa,4CAU5B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CreateDocument } from "./CreateDocument.js";
|
|
3
|
+
import { EmptyState } from "./EmptyState.js";
|
|
4
|
+
import { Files } from "./Files.js";
|
|
5
|
+
import { Folders } from "./Folders.js";
|
|
6
|
+
import { NavigationBreadcrumbs } from "./NavigationBreadcrumbs.js";
|
|
7
|
+
/** Shows the documents and folders in the selected drive */
|
|
8
|
+
export function DriveContents() {
|
|
9
|
+
return (_jsxs("div", { className: "space-y-6 px-6", children: [_jsx(NavigationBreadcrumbs, {}), _jsx(Folders, {}), _jsx(Files, {}), _jsx(EmptyState, {}), _jsx(CreateDocument, {})] }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EditorProps } from "document-model";
|
|
2
|
+
/**
|
|
3
|
+
* Main drive explorer component with sidebar navigation and content area.
|
|
4
|
+
* Layout: Left sidebar (folder tree) + Right content area (files/folders + document editor)
|
|
5
|
+
*/
|
|
6
|
+
export declare function DriveExplorer({ children }: EditorProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=DriveExplorer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DriveExplorer.d.ts","sourceRoot":"","sources":["../../../../editors/clean-new-editor/components/DriveExplorer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW,2CAmBtD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FolderTree } from "./FolderTree.js";
|
|
3
|
+
import { DriveContents } from "./DriveContents.js";
|
|
4
|
+
/**
|
|
5
|
+
* Main drive explorer component with sidebar navigation and content area.
|
|
6
|
+
* Layout: Left sidebar (folder tree) + Right content area (files/folders + document editor)
|
|
7
|
+
*/
|
|
8
|
+
export function DriveExplorer({ children }) {
|
|
9
|
+
// if a document is selected then it's editor will be passed as children
|
|
10
|
+
const showDocumentEditor = !!children;
|
|
11
|
+
return (_jsxs("div", { className: "flex h-full", children: [_jsx(FolderTree, {}), _jsx("div", { className: "flex-1 overflow-y-auto p-4", children: showDocumentEditor ? (
|
|
12
|
+
/* Document editor view */
|
|
13
|
+
children) : (
|
|
14
|
+
/* Folder contents view */
|
|
15
|
+
_jsx(DriveContents, {})) })] }));
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../../editors/clean-new-editor/components/EmptyState.tsx"],"names":[],"mappings":"AAEA,iEAAiE;AACjE,wBAAgB,UAAU,mDAWzB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useNodesInSelectedDriveOrFolder } from "@powerhousedao/reactor-browser";
|
|
3
|
+
/** Shows a message when the selected drive or folder is empty */
|
|
4
|
+
export function EmptyState() {
|
|
5
|
+
const nodes = useNodesInSelectedDriveOrFolder();
|
|
6
|
+
const hasNodes = nodes.length > 0;
|
|
7
|
+
if (hasNodes)
|
|
8
|
+
return null;
|
|
9
|
+
return (_jsxs("div", { className: "py-12 text-center text-gray-500", children: [_jsx("p", { className: "text-lg", children: "This folder is empty" }), _jsx("p", { className: "mt-2 text-sm", children: "Create your first document or folder below" })] }));
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Files.d.ts","sourceRoot":"","sources":["../../../../editors/clean-new-editor/components/Files.tsx"],"names":[],"mappings":"AAMA,sDAAsD;AACtD,wBAAgB,KAAK,mDAiBpB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FileItem } from "@powerhousedao/design-system/connect";
|
|
3
|
+
import { useNodesInSelectedDriveOrFolder, isFileNodeKind, } from "@powerhousedao/reactor-browser";
|
|
4
|
+
/** Shows the files in the selected drive or folder */
|
|
5
|
+
export function Files() {
|
|
6
|
+
const nodes = useNodesInSelectedDriveOrFolder();
|
|
7
|
+
const fileNodes = nodes.filter((n) => isFileNodeKind(n));
|
|
8
|
+
const hasFiles = fileNodes.length > 0;
|
|
9
|
+
if (!hasFiles)
|
|
10
|
+
return null;
|
|
11
|
+
return (_jsxs("div", { children: [_jsx("h3", { className: "mb-2 text-sm font-semibold text-gray-600", children: "Documents" }), _jsx("div", { className: "flex flex-wrap gap-4", children: fileNodes.map((fileNode) => (_jsx(FileItem, { fileNode: fileNode }, fileNode.id))) })] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hierarchical folder tree navigation component using Sidebar from document-engineering.
|
|
3
|
+
* Displays folders and files in a tree structure with expand/collapse functionality, search, and resize support.
|
|
4
|
+
*/
|
|
5
|
+
export declare function FolderTree(): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=FolderTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FolderTree.d.ts","sourceRoot":"","sources":["../../../../editors/clean-new-editor/components/FolderTree.tsx"],"names":[],"mappings":"AAyDA;;;GAGG;AACH,wBAAgB,UAAU,4CA0CzB"}
|