@powerhousedao/contributor-billing 0.1.27 → 0.1.30
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/bankSection.js +19 -10
- package/dist/editors/invoice/legalEntity/legalEntity.d.ts +4 -0
- package/dist/editors/invoice/legalEntity/legalEntity.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/legalEntity.js +66 -2
- 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 +5 -4
- 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 -20
- 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/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
|
@@ -23,42 +23,52 @@ import ConfirmationModal from "./components/confirmationModal.js";
|
|
|
23
23
|
import { ClosePaymentModalContent, ConfirmPaymentModalContent, FinalRejectionModalContent, IssueInvoiceModalContent, RegisterPaymentTxModalContent, RejectInvoiceModalContent, ReportPaymentIssueModalContent, SchedulePaymentModalContent, } from "./components/statusModalComponents.js";
|
|
24
24
|
import { InvoiceStateSchema } from "../../document-models/invoice/gen/schema/zod.js";
|
|
25
25
|
import validateStatusBeforeContinue from "./validation/validationHandler.js";
|
|
26
|
-
import { useSelectedInvoiceDocument } from "
|
|
26
|
+
import { useSelectedInvoiceDocument } from "../../document-models/invoice/hooks.js";
|
|
27
27
|
import { DocumentToolbar } from "@powerhousedao/design-system/connect";
|
|
28
28
|
import { setSelectedNode, useParentFolderForSelectedNode, } from "@powerhousedao/reactor-browser";
|
|
29
29
|
function isFiatCurrency(currency) {
|
|
30
30
|
return currencyList.find((c) => c.ticker === currency)?.crypto === false;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Converts a date-only string (YYYY-MM-DD) to ISO datetime string (YYYY-MM-DDTHH:mm:ss.sssZ)
|
|
34
|
+
* Used when dispatching date values to match the Zod schema requirements
|
|
35
|
+
*/
|
|
36
|
+
function dateToDatetime(dateStr) {
|
|
37
|
+
if (!dateStr || dateStr.trim() === "")
|
|
38
|
+
return null;
|
|
39
|
+
// If it's already a datetime string, return as is
|
|
40
|
+
if (dateStr.includes("T"))
|
|
41
|
+
return dateStr;
|
|
42
|
+
// Convert date-only to datetime at midnight UTC
|
|
43
|
+
return `${dateStr}T00:00:00.000Z`;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Converts an ISO datetime string to date-only string (YYYY-MM-DD) for DatePicker
|
|
47
|
+
* Used when displaying date values from state
|
|
48
|
+
*/
|
|
49
|
+
function datetimeToDate(datetimeStr) {
|
|
50
|
+
if (!datetimeStr || datetimeStr.trim() === "")
|
|
51
|
+
return "";
|
|
52
|
+
// Extract date part from datetime string
|
|
53
|
+
return datetimeStr.split("T")[0];
|
|
54
|
+
}
|
|
55
|
+
export default function Editor() {
|
|
33
56
|
const [doc, dispatch] = useSelectedInvoiceDocument();
|
|
34
57
|
const state = doc?.state.global;
|
|
58
|
+
// ALL HOOKS MUST BE CALLED BEFORE ANY CONDITIONAL RETURNS
|
|
59
|
+
// Get the parent folder node for the currently selected node
|
|
60
|
+
const parentFolder = useParentFolderForSelectedNode();
|
|
35
61
|
// Mobile header menu state
|
|
36
62
|
const [mobileHeaderOpen, setMobileHeaderOpen] = useState(false);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
// Dynamic property check based on the actual schema
|
|
42
|
-
try {
|
|
43
|
-
const schema = InvoiceStateSchema();
|
|
44
|
-
const expectedProperties = Object.keys(schema.shape).filter((prop) => prop !== "__typename");
|
|
45
|
-
const missingProperties = expectedProperties.filter((prop) => !(prop in state));
|
|
46
|
-
if (missingProperties.length > 0) {
|
|
47
|
-
// Show error message for missing properties
|
|
48
|
-
return (_jsx("div", { className: "flex items-center justify-center min-h-screen bg-gray-50", children: _jsxs("div", { className: "max-w-md mx-auto text-center p-8 bg-white rounded-lg shadow-lg border border-red-200", children: [_jsx("div", { className: "w-16 h-16 mx-auto mb-4 bg-red-100 rounded-full flex items-center justify-center", children: _jsx("svg", { className: "w-8 h-8 text-red-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z" }) }) }), _jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-2", children: "Document Schema Mismatch" }), _jsx("p", { className: "text-gray-600 mb-4", children: "The current document structure doesn't match the expected schema. This usually happens when using an outdated document model." }), _jsx("p", { className: "text-sm text-gray-500 mb-4", children: "Please create a new document using the latest document model to ensure compatibility." }), _jsxs("details", { className: "text-left text-xs text-gray-600", children: [_jsx("summary", { className: "cursor-pointer hover:text-gray-800", children: "View missing properties" }), _jsx("pre", { className: "mt-2 p-2 bg-gray-100 rounded text-xs overflow-auto max-h-32", children: JSON.stringify(missingProperties, null, 2) })] })] }) }));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
catch (error) {
|
|
52
|
-
console.error("Error checking schema properties:", error);
|
|
53
|
-
}
|
|
54
|
-
const [fiatMode, setFiatMode] = useState(isFiatCurrency(state.currency));
|
|
63
|
+
// Initialize hooks with safe defaults that don't depend on state being available
|
|
64
|
+
const [fiatMode, setFiatMode] = useState(false);
|
|
55
65
|
const [uploadDropdownOpen, setUploadDropdownOpen] = useState(false);
|
|
56
66
|
const [exportDropdownOpen, setExportDropdownOpen] = useState(false);
|
|
57
|
-
const [invoiceNoInput, setInvoiceNoInput] = useState(
|
|
67
|
+
const [invoiceNoInput, setInvoiceNoInput] = useState("");
|
|
58
68
|
const uploadDropdownRef = useRef(null);
|
|
59
69
|
const exportDropdownRef = useRef(null);
|
|
60
70
|
const [isPdfLoading, setIsPdfLoading] = useState(false);
|
|
61
|
-
const [notes, setNotes] = useState(
|
|
71
|
+
const [notes, setNotes] = useState("");
|
|
62
72
|
// Validation state
|
|
63
73
|
const [invoiceValidation, setInvoiceValidation] = useState(null);
|
|
64
74
|
const [walletValidation, setWalletValidation] = useState(null);
|
|
@@ -89,8 +99,20 @@ export default function Editor(props) {
|
|
|
89
99
|
const [paymentAmount, setPaymentAmount] = useState("");
|
|
90
100
|
const [editingItemValues, setEditingItemValues] = useState(null);
|
|
91
101
|
useEffect(() => {
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
if (state?.currency) {
|
|
103
|
+
setFiatMode(isFiatCurrency(state.currency));
|
|
104
|
+
}
|
|
105
|
+
}, [state?.currency]);
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
if (state?.invoiceNo !== undefined) {
|
|
108
|
+
setInvoiceNoInput(state.invoiceNo || "");
|
|
109
|
+
}
|
|
110
|
+
}, [state?.invoiceNo]);
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
if (state?.notes !== undefined) {
|
|
113
|
+
setNotes(state.notes || "");
|
|
114
|
+
}
|
|
115
|
+
}, [state?.notes]);
|
|
94
116
|
// Add click outside listener to close dropdowns
|
|
95
117
|
useEffect(() => {
|
|
96
118
|
function handleClickOutside(event) {
|
|
@@ -109,6 +131,8 @@ export default function Editor(props) {
|
|
|
109
131
|
};
|
|
110
132
|
}, []);
|
|
111
133
|
const itemsTotalTaxExcl = useMemo(() => {
|
|
134
|
+
if (!state?.lineItems)
|
|
135
|
+
return 0;
|
|
112
136
|
let total = state.lineItems.reduce((sum, lineItem) => {
|
|
113
137
|
return sum + lineItem.quantity * lineItem.unitPriceTaxExcl;
|
|
114
138
|
}, 0.0);
|
|
@@ -124,8 +148,10 @@ export default function Editor(props) {
|
|
|
124
148
|
}
|
|
125
149
|
}
|
|
126
150
|
return total;
|
|
127
|
-
}, [state
|
|
151
|
+
}, [state?.lineItems, editingItemValues]);
|
|
128
152
|
const itemsTotalTaxIncl = useMemo(() => {
|
|
153
|
+
if (!state?.lineItems)
|
|
154
|
+
return 0;
|
|
129
155
|
let total = state.lineItems.reduce((sum, lineItem) => {
|
|
130
156
|
return sum + lineItem.quantity * lineItem.unitPriceTaxIncl;
|
|
131
157
|
}, 0.0);
|
|
@@ -141,7 +167,27 @@ export default function Editor(props) {
|
|
|
141
167
|
}
|
|
142
168
|
}
|
|
143
169
|
return total;
|
|
144
|
-
}, [state
|
|
170
|
+
}, [state?.lineItems, editingItemValues]);
|
|
171
|
+
// Dynamic property check based on the actual schema
|
|
172
|
+
let missingProperties = [];
|
|
173
|
+
try {
|
|
174
|
+
const schema = InvoiceStateSchema();
|
|
175
|
+
const expectedProperties = Object.keys(schema.shape).filter((prop) => prop !== "__typename");
|
|
176
|
+
if (state) {
|
|
177
|
+
missingProperties = expectedProperties.filter((prop) => !(prop in state));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
console.error("Error checking schema properties:", error);
|
|
182
|
+
}
|
|
183
|
+
if (missingProperties.length > 0) {
|
|
184
|
+
// Show error message for missing properties
|
|
185
|
+
return (_jsx("div", { className: "flex items-center justify-center min-h-screen bg-gray-50", children: _jsxs("div", { className: "max-w-md mx-auto text-center p-8 bg-white rounded-lg shadow-lg border border-red-200", children: [_jsx("div", { className: "w-16 h-16 mx-auto mb-4 bg-red-100 rounded-full flex items-center justify-center", children: _jsx("svg", { className: "w-8 h-8 text-red-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z" }) }) }), _jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-2", children: "Document Schema Mismatch" }), _jsx("p", { className: "text-gray-600 mb-4", children: "The current document structure doesn't match the expected schema. This usually happens when using an outdated document model." }), _jsx("p", { className: "text-sm text-gray-500 mb-4", children: "Please create a new document using the latest document model to ensure compatibility." }), _jsxs("details", { className: "text-left text-xs text-gray-600", children: [_jsx("summary", { className: "cursor-pointer hover:text-gray-800", children: "View missing properties" }), _jsx("pre", { className: "mt-2 p-2 bg-gray-100 rounded text-xs overflow-auto max-h-32", children: JSON.stringify(missingProperties, null, 2) })] })] }) }));
|
|
186
|
+
}
|
|
187
|
+
// NOW ALL HOOKS ARE CALLED - SAFE TO DO CONDITIONAL RETURNS
|
|
188
|
+
if (!state) {
|
|
189
|
+
return (_jsx("div", { className: "flex items-center justify-center min-h-screen bg-gray-50", children: _jsxs("div", { className: "max-w-md mx-auto text-center p-8 bg-white rounded-lg shadow-lg border border-red-200", children: [_jsx("div", { className: "w-16 h-16 mx-auto mb-4 bg-red-100 rounded-full flex items-center justify-center", children: _jsx("svg", { className: "w-8 h-8 text-red-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z" }) }) }), _jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-2", children: "Document Schema Mismatch" }), _jsx("p", { className: "text-gray-600 mb-4", children: "The current document structure doesn't match the expected schema. This usually happens when using an outdated document model." }), _jsx("p", { className: "text-sm text-gray-500 mb-4", children: "Please create a new document using the latest document model to ensure compatibility." })] }) }));
|
|
190
|
+
}
|
|
145
191
|
const STATUS_OPTIONS = [
|
|
146
192
|
"DRAFT",
|
|
147
193
|
"ISSUED",
|
|
@@ -367,13 +413,11 @@ export default function Editor(props) {
|
|
|
367
413
|
reportPaymentIssue: "Confirm",
|
|
368
414
|
// Add more labels as needed
|
|
369
415
|
};
|
|
370
|
-
// Get the parent folder node for the currently selected node
|
|
371
|
-
const parentFolder = useParentFolderForSelectedNode();
|
|
372
416
|
// Set the selected node to the parent folder node (close the editor)
|
|
373
417
|
function handleClose() {
|
|
374
|
-
setSelectedNode(parentFolder
|
|
418
|
+
setSelectedNode(parentFolder);
|
|
375
419
|
}
|
|
376
|
-
return (_jsxs("div", { children: [_jsx(DocumentToolbar, { document: doc, onClose: handleClose }), _jsxs("div", { className: "
|
|
420
|
+
return (_jsxs("div", { children: [_jsx(DocumentToolbar, { document: doc, onClose: handleClose }), _jsxs("div", { className: "container mx-auto", children: [_jsx(ToastContainer, { position: "bottom-right", autoClose: 5000, hideProgressBar: false, newestOnTop: false, closeOnClick: false, rtl: false, pauseOnFocusLoss: true, draggable: true, pauseOnHover: true, theme: "light" }), _jsxs("div", { className: "mb-6", children: [_jsxs("div", { className: "hidden md:flex flex-row items-center justify-between gap-4", children: [_jsxs("div", { className: "flex flex-row items-center gap-4 flex-wrap", children: [_jsx("h1", { className: "text-3xl font-bold whitespace-nowrap", children: "Invoice" }), _jsx(InputField, { placeholder: "Add invoice number", value: invoiceNoInput, handleInputChange: (e) => setInvoiceNoInput(e.target.value), onBlur: (e) => {
|
|
377
421
|
const newValue = e.target.value;
|
|
378
422
|
if (newValue !== state.invoiceNo) {
|
|
379
423
|
dispatch(actions.editInvoice({ invoiceNo: newValue }));
|
|
@@ -406,18 +450,24 @@ export default function Editor(props) {
|
|
|
406
450
|
handleExportPDF();
|
|
407
451
|
setExportDropdownOpen(false);
|
|
408
452
|
}, className: "block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 cursor-pointer", children: "Export PDF" })] }) }))] })] })] }))] })] }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-0 lg:gap-4", children: [_jsxs("div", { className: "border-0 lg:border lg:border-gray-200 lg:rounded-lg p-0 lg:p-4", children: [_jsx("h3", { className: "text-lg font-semibold mb-4", children: "Issuer" }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "mb-2", children: [_jsx("label", { className: "block mb-1 text-sm", children: "Issue Date:" }), _jsx(DatePicker, { name: "issueDate", className: String.raw `w-full p-0 bg-white`, onChange: (e) => {
|
|
409
|
-
const
|
|
453
|
+
const dateOnly = e.target.value.split("T")[0];
|
|
454
|
+
const datetime = dateToDatetime(dateOnly);
|
|
410
455
|
dispatch(actions.editInvoice({
|
|
411
|
-
dateIssued:
|
|
456
|
+
dateIssued: datetime,
|
|
412
457
|
}));
|
|
413
|
-
}, value: state.dateIssued })] }), _jsxs("div", { className: "mb-2", children: [_jsx("label", { className: "block mb-1 text-sm", children: "Delivery Date:" }), _jsx(DatePicker, { name: "deliveryDate", className: String.raw `w-full p-0 bg-white`, onChange: (e) => {
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
|
|
458
|
+
}, value: datetimeToDate(state.dateIssued) })] }), _jsxs("div", { className: "mb-2", children: [_jsx("label", { className: "block mb-1 text-sm", children: "Delivery Date:" }), _jsx(DatePicker, { name: "deliveryDate", className: String.raw `w-full p-0 bg-white`, onChange: (e) => {
|
|
459
|
+
const dateOnly = e.target.value.split("T")[0];
|
|
460
|
+
const datetime = dateToDatetime(dateOnly);
|
|
461
|
+
if (datetime !== state.dateDelivered) {
|
|
462
|
+
dispatch(actions.editInvoice({ dateDelivered: datetime }));
|
|
417
463
|
}
|
|
418
|
-
}, value: state.dateDelivered
|
|
419
|
-
|
|
420
|
-
|
|
464
|
+
}, value: datetimeToDate(state.dateDelivered) })] })] }), _jsx(LegalEntityForm, { legalEntity: state.issuer, onChangeInfo: (input) => dispatch(actions.editIssuer(input)), onChangeBank: (input) => dispatch(actions.editIssuerBank(input)), onChangeWallet: (input) => dispatch(actions.editIssuerWallet(input)), basicInfoDisabled: false, bankDisabled: !fiatMode, walletDisabled: fiatMode, currency: state.currency, status: state.status, walletvalidation: walletValidation, mainCountryValidation: mainCountryValidation, bankCountryValidation: bankCountryValidation, ibanvalidation: ibanValidation, bicvalidation: bicValidation, banknamevalidation: bankNameValidation, streetaddressvalidation: streetAddressValidation, cityvalidation: cityValidation, postalcodevalidation: postalCodeValidation, payeremailvalidation: payerEmailValidation, routingNumbervalidation: routingNumberValidation, accountNumbervalidation: accountNumberValidation })] }), _jsxs("div", { className: "border-0 lg:border lg:border-gray-200 lg:rounded-lg p-0 lg:p-4", children: [_jsx("h3", { className: "text-lg font-semibold mb-4", children: "Payer" }), _jsxs("div", { className: "mb-2 w-64", children: [_jsx("label", { className: "block mb-1 text-sm", children: "Due Date:" }), _jsx(DatePicker, { name: "dateDue", className: String.raw `w-full p-0 bg-white`, onChange: (e) => {
|
|
465
|
+
const dateOnly = e.target.value.split("T")[0];
|
|
466
|
+
const datetime = dateToDatetime(dateOnly);
|
|
467
|
+
dispatch(actions.editInvoice({
|
|
468
|
+
dateDue: datetime,
|
|
469
|
+
}));
|
|
470
|
+
}, value: datetimeToDate(state.dateDue) })] }), _jsx(LegalEntityForm, { bankDisabled: true, legalEntity: state.payer, onChangeInfo: (input) => dispatch(actions.editPayer(input)), currency: state.currency, status: state.status, payeremailvalidation: payerEmailValidation })] })] }), _jsx("div", { className: "mb-8", children: _jsx(LineItemsTable, { currency: state.currency, lineItems: state.lineItems.map((item) => ({
|
|
421
471
|
...item,
|
|
422
472
|
lineItemTag: item.lineItemTag ?? [],
|
|
423
473
|
})), onAddItem: (item) => dispatch(actions.addLineItem(item)), onDeleteItem: (input) => dispatch(actions.deleteLineItem(input)), onUpdateCurrency: (input) => {
|
|
@@ -432,9 +482,21 @@ export default function Editor(props) {
|
|
|
432
482
|
setNotes(e.target.value);
|
|
433
483
|
}, className: "p-2 mb-4" }) }) }), _jsx("div", { className: "col-span-1", children: _jsx("div", { className: "rounded-lg border border-gray-200 bg-gray-50 p-6 shadow-sm h-32", children: _jsxs("div", { className: "", children: [_jsxs("div", { className: "flex justify-between text-gray-700", children: [_jsx("span", { className: "font-medium", children: "Subtotal (excl. tax):" }), _jsxs("span", { children: [formatNumber(itemsTotalTaxExcl), " ", state.currency] })] }), _jsxs("div", { className: "flex justify-between border-t border-gray-200 pt-6 text-lg font-bold text-gray-900", children: [_jsx("span", { children: "Total (incl. tax):" }), _jsxs("span", { children: [formatNumber(itemsTotalTaxIncl), " ", state.currency] })] })] }) }) })] }), activeModal && (_jsx(ConfirmationModal, { open: !!activeModal, header: modalHeaders[activeModal], onCancel: () => setActiveModal(null), onContinue: () => {
|
|
434
484
|
if (activeModal === "issueInvoice") {
|
|
485
|
+
// Ensure dateIssued is a valid datetime string for the issue action
|
|
486
|
+
// The issue action requires a non-null string, so use current date if not set
|
|
487
|
+
let issueDate;
|
|
488
|
+
if (state.dateIssued && state.dateIssued.trim() !== "") {
|
|
489
|
+
issueDate = state.dateIssued.includes("T")
|
|
490
|
+
? state.dateIssued
|
|
491
|
+
: dateToDatetime(state.dateIssued) ||
|
|
492
|
+
new Date().toISOString();
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
issueDate = new Date().toISOString();
|
|
496
|
+
}
|
|
435
497
|
dispatch(actions.issue({
|
|
436
498
|
invoiceNo: invoiceNoInput,
|
|
437
|
-
dateIssued:
|
|
499
|
+
dateIssued: issueDate,
|
|
438
500
|
}));
|
|
439
501
|
}
|
|
440
502
|
if (activeModal === "rejectInvoice") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportUBL.d.ts","sourceRoot":"","sources":["../../../editors/invoice/exportUBL.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAKb,MAAM,wCAAwC,CAAC;AAEhD,UAAU,gBAAgB;IACxB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAqBD,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,OAAO,CAAC,CAAO;gBAEX,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,IAAI;IAKjD;;;OAGG;IACG,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC;IAkC5C;;;;OAIG;IACG,YAAY,CAAC,EACjB,QAAwB,GACzB,GAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAM7C;;OAEG;IACG,WAAW,CAAC,QAAQ,SAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAa1D;;OAEG;IACH,OAAO,CAAC,UAAU;IAalB;;OAEG;IACH,OAAO,CAAC,SAAS;IASjB;;OAEG;IACH,OAAO,CAAC,qBAAqB;
|
|
1
|
+
{"version":3,"file":"exportUBL.d.ts","sourceRoot":"","sources":["../../../editors/invoice/exportUBL.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAKb,MAAM,wCAAwC,CAAC;AAEhD,UAAU,gBAAgB;IACxB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAqBD,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,OAAO,CAAC,CAAO;gBAEX,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,IAAI;IAKjD;;;OAGG;IACG,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC;IAkC5C;;;;OAIG;IACG,YAAY,CAAC,EACjB,QAAwB,GACzB,GAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAM7C;;OAEG;IACG,WAAW,CAAC,QAAQ,SAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAa1D;;OAEG;IACH,OAAO,CAAC,UAAU;IAalB;;OAEG;IACH,OAAO,CAAC,SAAS;IASjB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAuD7B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAqC7B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAkB5B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA2B5B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAuE1B;;OAEG;IACH,OAAO,CAAC,0BAA0B;IA2BlC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA+B5B;;OAEG;YACW,qBAAqB;IAuBnC;;OAEG;IACH,OAAO,CAAC,YAAY;CAarB;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,EAChC,OAAO,EACP,QAAwB,EACxB,OAAO,GACR,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGlC;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,EAChC,OAAO,EACP,QAAwB,EACxB,OAAO,GACR,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGlC"}
|
|
@@ -30,7 +30,7 @@ export class UBLExporter {
|
|
|
30
30
|
const deliveryDate = this.formatDate(this.invoice.dateDelivered);
|
|
31
31
|
// Generate PDF attachment section first
|
|
32
32
|
const pdfAttachmentSection = await this.generatePDFAttachment();
|
|
33
|
-
|
|
33
|
+
const xml = `<?xml version="1.0" encoding="UTF-8"?>
|
|
34
34
|
<Invoice xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
|
35
35
|
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
|
36
36
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
@@ -112,35 +112,44 @@ export class UBLExporter {
|
|
|
112
112
|
if (!issuer)
|
|
113
113
|
return "";
|
|
114
114
|
const taxId = issuer.id?.taxId;
|
|
115
|
-
const corpRegId = issuer.id
|
|
115
|
+
const corpRegId = issuer.id
|
|
116
|
+
?.corpRegId;
|
|
116
117
|
const companyId = taxId || corpRegId;
|
|
117
118
|
return `<cac:AccountingSupplierParty>
|
|
118
119
|
<cac:Party>
|
|
119
120
|
${companyId ? `<cbc:EndpointID schemeID="0106">${this.escapeXml(companyId)}</cbc:EndpointID>` : ""}
|
|
120
|
-
${issuer.name
|
|
121
|
+
${issuer.name
|
|
122
|
+
? `<cac:PartyName>
|
|
121
123
|
<cbc:Name>${this.escapeXml(issuer.name)}</cbc:Name>
|
|
122
|
-
</cac:PartyName>`
|
|
124
|
+
</cac:PartyName>`
|
|
125
|
+
: ""}
|
|
123
126
|
<cac:PostalAddress>
|
|
124
127
|
${issuer.address?.streetAddress ? `<cbc:StreetName>${this.escapeXml(issuer.address?.streetAddress)}</cbc:StreetName>` : ""}
|
|
125
128
|
${issuer.address?.city ? `<cbc:CityName>${this.escapeXml(issuer.address?.city)}</cbc:CityName>` : ""}
|
|
126
129
|
${issuer.address?.postalCode ? `<cbc:PostalZone>${this.escapeXml(issuer.address?.postalCode)}</cbc:PostalZone>` : ""}
|
|
127
|
-
${issuer.country
|
|
130
|
+
${issuer.country
|
|
131
|
+
? `<cac:Country>
|
|
128
132
|
<cbc:IdentificationCode listID="ISO3166-1:Alpha2" listAgencyID="6">${this.escapeXml(issuer.country)}</cbc:IdentificationCode>
|
|
129
|
-
</cac:Country>`
|
|
133
|
+
</cac:Country>`
|
|
134
|
+
: ""}
|
|
130
135
|
</cac:PostalAddress>
|
|
131
|
-
${taxId && issuer.country
|
|
136
|
+
${taxId && issuer.country
|
|
137
|
+
? `<cac:PartyTaxScheme>
|
|
132
138
|
<cbc:CompanyID schemeID="${issuer.country}:VAT">${this.escapeXml(taxId)}</cbc:CompanyID>
|
|
133
139
|
<cac:TaxScheme>
|
|
134
140
|
<cbc:ID schemeID="UN/ECE 5153">VAT</cbc:ID>
|
|
135
141
|
</cac:TaxScheme>
|
|
136
|
-
</cac:PartyTaxScheme>`
|
|
142
|
+
</cac:PartyTaxScheme>`
|
|
143
|
+
: ""}
|
|
137
144
|
<cac:PartyLegalEntity>
|
|
138
145
|
<cbc:RegistrationName>${this.escapeXml(issuer.name || "")}</cbc:RegistrationName>
|
|
139
146
|
${companyId ? `<cbc:CompanyID schemeID="0106">${this.escapeXml(companyId)}</cbc:CompanyID>` : ""}
|
|
140
147
|
</cac:PartyLegalEntity>
|
|
141
|
-
${issuer.contactInfo?.email
|
|
148
|
+
${issuer.contactInfo?.email
|
|
149
|
+
? `<cac:Contact>
|
|
142
150
|
<cbc:ElectronicMail>${this.escapeXml(issuer.contactInfo.email)}</cbc:ElectronicMail>
|
|
143
|
-
</cac:Contact>`
|
|
151
|
+
</cac:Contact>`
|
|
152
|
+
: ""}
|
|
144
153
|
</cac:Party>
|
|
145
154
|
</cac:AccountingSupplierParty>`;
|
|
146
155
|
}
|
|
@@ -152,22 +161,28 @@ export class UBLExporter {
|
|
|
152
161
|
return "";
|
|
153
162
|
return `<cac:AccountingCustomerParty>
|
|
154
163
|
<cac:Party>
|
|
155
|
-
${payer.name
|
|
164
|
+
${payer.name
|
|
165
|
+
? `<cac:PartyName>
|
|
156
166
|
<cbc:Name>${this.escapeXml(payer.name)}</cbc:Name>
|
|
157
|
-
</cac:PartyName>`
|
|
167
|
+
</cac:PartyName>`
|
|
168
|
+
: ""}
|
|
158
169
|
<cac:PostalAddress>
|
|
159
170
|
${payer.address?.streetAddress ? `<cbc:StreetName>${this.escapeXml(payer.address?.streetAddress)}</cbc:StreetName>` : ""}
|
|
160
171
|
${payer.address?.city ? `<cbc:CityName>${this.escapeXml(payer.address?.city)}</cbc:CityName>` : ""}
|
|
161
172
|
${payer.address?.postalCode ? `<cbc:PostalZone>${this.escapeXml(payer.address?.postalCode)}</cbc:PostalZone>` : ""}
|
|
162
|
-
${payer.country
|
|
173
|
+
${payer.country
|
|
174
|
+
? `<cac:Country>
|
|
163
175
|
<cbc:IdentificationCode listID="ISO3166-1:Alpha2" listAgencyID="6">${this.escapeXml(payer.country)}</cbc:IdentificationCode>
|
|
164
|
-
</cac:Country>`
|
|
176
|
+
</cac:Country>`
|
|
177
|
+
: ""}
|
|
165
178
|
</cac:PostalAddress>
|
|
166
179
|
<cac:PartyLegalEntity>
|
|
167
180
|
<cbc:RegistrationName>${this.escapeXml(payer.name || "")}</cbc:RegistrationName>
|
|
168
181
|
</cac:PartyLegalEntity>
|
|
169
|
-
${payer.contactInfo?.email
|
|
170
|
-
|
|
182
|
+
${payer.contactInfo?.email
|
|
183
|
+
? `<cac:Contact>
|
|
184
|
+
</cac:Contact>`
|
|
185
|
+
: ""}
|
|
171
186
|
</cac:Party>
|
|
172
187
|
</cac:AccountingCustomerParty>`;
|
|
173
188
|
}
|
|
@@ -202,11 +217,13 @@ export class UBLExporter {
|
|
|
202
217
|
${paymentRef ? `<cbc:PaymentID>${this.escapeXml(paymentRef)}</cbc:PaymentID>` : ""}
|
|
203
218
|
<cac:PayeeFinancialAccount>
|
|
204
219
|
<cbc:ID schemeID="IBAN">${this.escapeXml(bank.accountNum)}</cbc:ID>
|
|
205
|
-
${bank.BIC || bank.SWIFT
|
|
220
|
+
${bank.BIC || bank.SWIFT
|
|
221
|
+
? `<cac:FinancialInstitutionBranch>
|
|
206
222
|
<cac:FinancialInstitution>
|
|
207
223
|
<cbc:ID schemeID="BIC">${this.escapeXml(bank.BIC || bank.SWIFT || "")}</cbc:ID>
|
|
208
224
|
</cac:FinancialInstitution>
|
|
209
|
-
</cac:FinancialInstitutionBranch>`
|
|
225
|
+
</cac:FinancialInstitutionBranch>`
|
|
226
|
+
: ""}
|
|
210
227
|
</cac:PayeeFinancialAccount>
|
|
211
228
|
</cac:PaymentMeans>`;
|
|
212
229
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestPDF.d.ts","sourceRoot":"","sources":["../../../editors/invoice/ingestPDF.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"ingestPDF.d.ts","sourceRoot":"","sources":["../../../editors/invoice/ingestPDF.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,wCAAwC,CAAC;AAYhD,wBAAsB,WAAW,CAAC,EAChC,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3C,iBAUA;AAED,UAAU,gBAAgB;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC7C;AA0BD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,QAAQ,EACR,kBAAkB,GACnB,EAAE,gBAAgB,2CA6SlB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useState } from "react";
|
|
3
|
-
import { actions } from "../../document-models/invoice/index.js";
|
|
3
|
+
import { actions, } from "../../document-models/invoice/index.js";
|
|
4
4
|
import { toast } from "@powerhousedao/design-system/connect";
|
|
5
5
|
import { uploadPdfChunked } from "./uploadPdfChunked.js";
|
|
6
6
|
import { getCountryCodeFromName, mapChainNameToConfig } from "./utils/utils.js";
|
|
7
7
|
import { LoaderCircle } from "lucide-react";
|
|
8
|
-
let GRAPHQL_URL = "http://localhost:4001/graphql
|
|
8
|
+
let GRAPHQL_URL = "http://localhost:4001/graphql";
|
|
9
9
|
if (!window.document.baseURI.includes("localhost")) {
|
|
10
|
-
GRAPHQL_URL = "https://
|
|
10
|
+
GRAPHQL_URL = "https://switchboard-dev.powerhouse.xyz/graphql";
|
|
11
11
|
}
|
|
12
12
|
export async function loadPDFFile({ file, dispatch, }) {
|
|
13
13
|
if (!file)
|
|
@@ -142,9 +142,12 @@ export default function PDFUploader({ dispatch, changeDropdownOpen, }) {
|
|
|
142
142
|
const chainConfig = mapChainNameToConfig(invoiceData.issuer.paymentRouting.wallet.chainName);
|
|
143
143
|
dispatch(actions.editIssuerWallet({
|
|
144
144
|
address: invoiceData.issuer.paymentRouting.wallet.address || "",
|
|
145
|
-
chainId: invoiceData.issuer.paymentRouting.wallet.chainId ||
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
chainId: invoiceData.issuer.paymentRouting.wallet.chainId ||
|
|
146
|
+
chainConfig.chainId,
|
|
147
|
+
chainName: invoiceData.issuer.paymentRouting.wallet.chainName ||
|
|
148
|
+
chainConfig.chainName,
|
|
149
|
+
rpc: invoiceData.issuer.paymentRouting.wallet.rpc ||
|
|
150
|
+
chainConfig.rpc,
|
|
148
151
|
}));
|
|
149
152
|
}
|
|
150
153
|
}
|
|
@@ -181,9 +184,12 @@ export default function PDFUploader({ dispatch, changeDropdownOpen, }) {
|
|
|
181
184
|
const payerChainConfig = mapChainNameToConfig(invoiceData.payer.paymentRouting.wallet.chainName);
|
|
182
185
|
dispatch(actions.editPayerWallet({
|
|
183
186
|
address: invoiceData.payer.paymentRouting.wallet.address || "",
|
|
184
|
-
chainId: invoiceData.payer.paymentRouting.wallet.chainId ||
|
|
185
|
-
|
|
186
|
-
|
|
187
|
+
chainId: invoiceData.payer.paymentRouting.wallet.chainId ||
|
|
188
|
+
payerChainConfig.chainId,
|
|
189
|
+
chainName: invoiceData.payer.paymentRouting.wallet.chainName ||
|
|
190
|
+
payerChainConfig.chainName,
|
|
191
|
+
rpc: invoiceData.payer.paymentRouting.wallet.rpc ||
|
|
192
|
+
payerChainConfig.rpc,
|
|
187
193
|
}));
|
|
188
194
|
}
|
|
189
195
|
}
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import React, { useState, useEffect } from "react";
|
|
3
3
|
import { actions } from "../../document-models/invoice/index.js";
|
|
4
4
|
import { generateId } from "document-model";
|
|
5
|
-
let GRAPHQL_URL = "http://localhost:4001/graphql
|
|
5
|
+
let GRAPHQL_URL = "http://localhost:4001/graphql";
|
|
6
6
|
if (!window.document.baseURI.includes("localhost")) {
|
|
7
|
-
GRAPHQL_URL = "https://
|
|
7
|
+
GRAPHQL_URL = "https://switchboard-dev.powerhouse.xyz/graphql";
|
|
8
8
|
}
|
|
9
9
|
const InvoiceToGnosis = ({ docState, dispatch, }) => {
|
|
10
10
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bankSection.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/legalEntity/bankSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAO3B,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAGjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"bankSection.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/legalEntity/bankSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAO3B,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAGjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAO3E,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAC5C,qBAAqB,CAAC,KAAK,CAAC,EAC5B,UAAU,CACX,GAAG;IACF,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACrD,QAAQ,CAAC,cAAc,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClD,QAAQ,CAAC,aAAa,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjD,QAAQ,CAAC,uBAAuB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC3D,QAAQ,CAAC,kBAAkB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACtD,QAAQ,CAAC,uBAAuB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC3D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAAC;AAmCF,eAAO,MAAM,sBAAsB,qIAklBlC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useCallback, useState, useEffect, useMemo, } from "react";
|
|
3
3
|
import { twMerge } from "tailwind-merge";
|
|
4
4
|
import { CountryForm } from "../components/countryForm.js";
|
|
5
5
|
import { InputField } from "../components/inputField.js";
|
|
6
6
|
import { Select } from "@powerhousedao/document-engineering";
|
|
7
7
|
import { isValidIBAN } from "../validation/validationRules.js";
|
|
8
|
+
import { STATE_PROVINCE_OPTIONS } from "./legalEntity.js";
|
|
8
9
|
const ACCOUNT_TYPES = ["CHECKING", "SAVINGS", "TRUST"];
|
|
9
10
|
function flattenBankInput(value) {
|
|
10
11
|
return {
|
|
@@ -129,11 +130,15 @@ export const LegalEntityBankSection = forwardRef(function LegalEntityBankSection
|
|
|
129
130
|
// input={localState.city ?? ""}
|
|
130
131
|
, {
|
|
131
132
|
// input={localState.city ?? ""}
|
|
132
|
-
value: localState.city ?? "", label: "City", placeholder: "City", onBlur: createBlurHandler("city"), handleInputChange: createInputHandler("city"), className: "h-10 w-full text-md mb-2" }), _jsx(
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
value: localState.city ?? "", label: "City", placeholder: "City", onBlur: createBlurHandler("city"), handleInputChange: createInputHandler("city"), className: "h-10 w-full text-md mb-2" }), _jsx("div", { className: "space-y-2", children: localState.country === "US" ? (_jsxs(_Fragment, { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "State/Province" }), _jsx(Select, { options: STATE_PROVINCE_OPTIONS, value: localState.stateProvince ?? "", onChange: (value) => {
|
|
134
|
+
createBlurHandler("stateProvince")({
|
|
135
|
+
target: { value: value },
|
|
136
|
+
});
|
|
137
|
+
}, className: "h-10 w-full text-md mb-2", searchable: true })] })) : (_jsx(InputField
|
|
135
138
|
// input={localState.stateProvince ?? ""}
|
|
136
|
-
|
|
139
|
+
, {
|
|
140
|
+
// input={localState.stateProvince ?? ""}
|
|
141
|
+
value: localState.stateProvince ?? "", label: "State/Province", placeholder: "State/Province", onBlur: createBlurHandler("stateProvince"), handleInputChange: createInputHandler("stateProvince"), className: "h-10 w-full text-md mb-2" })) })] }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsx(InputField
|
|
137
142
|
// input={localState.postalCode ?? ""}
|
|
138
143
|
, {
|
|
139
144
|
// input={localState.postalCode ?? ""}
|
|
@@ -182,11 +187,15 @@ export const LegalEntityBankSection = forwardRef(function LegalEntityBankSection
|
|
|
182
187
|
// input={localState.cityIntermediary ?? ""}
|
|
183
188
|
, {
|
|
184
189
|
// input={localState.cityIntermediary ?? ""}
|
|
185
|
-
value: localState.cityIntermediary ?? "", label: "City", placeholder: "City", onBlur: createBlurHandler("cityIntermediary"), handleInputChange: createInputHandler("cityIntermediary"), className: "h-10 w-full text-md mb-2" }), _jsx(
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
+
value: localState.cityIntermediary ?? "", label: "City", placeholder: "City", onBlur: createBlurHandler("cityIntermediary"), handleInputChange: createInputHandler("cityIntermediary"), className: "h-10 w-full text-md mb-2" }), _jsx("div", { className: "space-y-2", children: localState.countryIntermediary === "US" ? (_jsxs(_Fragment, { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "State/Province" }), _jsx(Select, { options: STATE_PROVINCE_OPTIONS, value: localState.stateProvinceIntermediary ?? "", onChange: (value) => {
|
|
191
|
+
createBlurHandler("stateProvinceIntermediary")({
|
|
192
|
+
target: { value: value },
|
|
193
|
+
});
|
|
194
|
+
}, className: "h-10 w-full text-md mb-2", searchable: true })] })) : (_jsx(InputField
|
|
195
|
+
// input={localState.stateProvince ?? ""}
|
|
196
|
+
, {
|
|
197
|
+
// input={localState.stateProvince ?? ""}
|
|
198
|
+
value: localState.stateProvinceIntermediary ?? "", label: "State/Province", placeholder: "State/Province", onBlur: createBlurHandler("stateProvinceIntermediary"), handleInputChange: createInputHandler("stateProvince"), className: "h-10 w-full text-md mb-2" })) })] }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsx(InputField
|
|
190
199
|
// input={localState.postalCodeIntermediary ?? ""}
|
|
191
200
|
, {
|
|
192
201
|
// input={localState.postalCodeIntermediary ?? ""}
|
|
@@ -4,6 +4,10 @@ import type { ValidationResult } from "../validation/validationManager.js";
|
|
|
4
4
|
export type EditLegalEntityWalletInput = EditIssuerWalletInput | EditPayerWalletInput;
|
|
5
5
|
export type EditLegalEntityBankInput = EditIssuerBankInput | EditPayerBankInput;
|
|
6
6
|
export type EditLegalEntityInput = EditIssuerInput | EditPayerInput;
|
|
7
|
+
export declare const STATE_PROVINCE_OPTIONS: {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}[];
|
|
7
11
|
export type LegalEntityMainSectionProps = Omit<ComponentPropsWithRef<"div">, "children"> & {
|
|
8
12
|
readonly value: EditLegalEntityInput;
|
|
9
13
|
readonly onChange: (value: EditLegalEntityInput) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legalEntity.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/legalEntity/legalEntity.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"legalEntity.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/legalEntity/legalEntity.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,WAAW,EACZ,MAAM,2CAA2C,CAAC;AACnD,OAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAK1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAI3E,MAAM,MAAM,0BAA0B,GAClC,qBAAqB,GACrB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AAChF,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAAG,cAAc,CAAC;AAMpE,eAAO,MAAM,sBAAsB;;;GA0DlC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAC5C,qBAAqB,CAAC,KAAK,CAAC,EAC5B,UAAU,CACX,GAAG;IACF,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACzD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,qBAAqB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACzD,QAAQ,CAAC,qBAAqB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACzD,QAAQ,CAAC,uBAAuB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC3D,QAAQ,CAAC,cAAc,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACxD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACzD,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,OAAO,2BAA2B,4CA8LxE,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,wBAAwB,KAAK,IAAI,CAAC;IACjE,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACvE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACpD,QAAQ,CAAC,qBAAqB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACzD,QAAQ,CAAC,qBAAqB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACzD,QAAQ,CAAC,cAAc,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClD,QAAQ,CAAC,aAAa,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjD,QAAQ,CAAC,kBAAkB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACtD,QAAQ,CAAC,uBAAuB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC3D,QAAQ,CAAC,cAAc,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACxD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACxD,QAAQ,CAAC,uBAAuB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC3D,QAAQ,CAAC,uBAAuB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC5D,CAAC;AA+BF,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,MAAM,EACN,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,GACxB,EAAE,oBAAoB,2CA4CtB"}
|