@powerhousedao/contributor-billing 0.1.22 → 0.1.24
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/dist/document-models/billing-statement/actions.d.ts +18 -0
- package/dist/document-models/billing-statement/actions.d.ts.map +1 -0
- package/dist/document-models/billing-statement/actions.js +9 -0
- package/dist/document-models/billing-statement/gen/creators.d.ts +3 -0
- package/dist/document-models/billing-statement/gen/creators.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/creators.js +3 -0
- package/dist/document-models/billing-statement/gen/document-model.d.ts +2 -2
- package/dist/document-models/billing-statement/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/document-schema.d.ts +294 -0
- package/dist/document-models/billing-statement/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/billing-statement/gen/document-schema.js +33 -0
- package/dist/document-models/billing-statement/gen/document-type.d.ts +2 -0
- package/dist/document-models/billing-statement/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/billing-statement/gen/document-type.js +1 -0
- package/dist/document-models/billing-statement/gen/general/actions.js +1 -1
- package/dist/document-models/billing-statement/gen/general/creators.d.ts +2 -2
- package/dist/document-models/billing-statement/gen/general/creators.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/general/creators.js +5 -5
- package/dist/document-models/billing-statement/gen/general/operations.js +3 -1
- package/dist/document-models/billing-statement/gen/index.d.ts +9 -3
- package/dist/document-models/billing-statement/gen/index.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/index.js +9 -2
- package/dist/document-models/billing-statement/gen/line-items/actions.js +1 -1
- package/dist/document-models/billing-statement/gen/line-items/creators.d.ts +2 -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 +4 -4
- package/dist/document-models/billing-statement/gen/line-items/operations.js +3 -1
- package/dist/document-models/billing-statement/gen/ph-factories.d.ts +6 -10
- package/dist/document-models/billing-statement/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/ph-factories.js +1 -4
- package/dist/document-models/billing-statement/gen/reducer.d.ts +1 -3
- package/dist/document-models/billing-statement/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/reducer.js +18 -21
- package/dist/document-models/billing-statement/gen/schema/index.d.ts +1 -1
- package/dist/document-models/billing-statement/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/schema/index.js +1 -1
- package/dist/document-models/billing-statement/gen/tags/actions.js +1 -1
- package/dist/document-models/billing-statement/gen/tags/creators.d.ts +2 -2
- package/dist/document-models/billing-statement/gen/tags/creators.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/tags/creators.js +3 -3
- package/dist/document-models/billing-statement/gen/tags/operations.js +3 -1
- package/dist/document-models/billing-statement/gen/types.d.ts +9 -7
- package/dist/document-models/billing-statement/gen/types.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/types.js +1 -1
- package/dist/document-models/billing-statement/gen/utils.d.ts +13 -20
- package/dist/document-models/billing-statement/gen/utils.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/utils.js +45 -36
- package/dist/document-models/billing-statement/hooks.d.ts +11 -0
- package/dist/document-models/billing-statement/hooks.d.ts.map +1 -0
- package/dist/document-models/billing-statement/hooks.js +26 -0
- package/dist/document-models/billing-statement/index.d.ts +5 -25
- package/dist/document-models/billing-statement/index.d.ts.map +1 -1
- package/dist/document-models/billing-statement/index.js +5 -17
- package/dist/document-models/billing-statement/module.d.ts +5 -0
- package/dist/document-models/billing-statement/module.d.ts.map +1 -0
- package/dist/document-models/billing-statement/module.js +10 -0
- package/dist/document-models/billing-statement/src/index.d.ts +2 -0
- package/dist/document-models/billing-statement/src/index.d.ts.map +1 -0
- package/dist/document-models/billing-statement/src/index.js +1 -0
- package/dist/document-models/billing-statement/src/reducers/general.d.ts +2 -7
- package/dist/document-models/billing-statement/src/reducers/general.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/reducers/general.js +2 -7
- package/dist/document-models/billing-statement/src/reducers/line-items.d.ts +2 -7
- 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 +1 -6
- package/dist/document-models/billing-statement/src/reducers/tags.d.ts +2 -7
- 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 -6
- package/dist/document-models/billing-statement/src/tests/document-model.test.js +3 -3
- package/dist/document-models/billing-statement/src/tests/general.test.js +3 -2
- package/dist/document-models/billing-statement/src/tests/line-items.test.js +2 -1
- package/dist/document-models/billing-statement/src/tests/tags.test.js +2 -1
- package/dist/document-models/billing-statement/utils.d.ts +14 -0
- package/dist/document-models/billing-statement/utils.d.ts.map +1 -0
- package/dist/document-models/billing-statement/utils.js +7 -0
- package/dist/document-models/document-models.d.ts +3 -0
- package/dist/document-models/document-models.d.ts.map +1 -0
- package/dist/document-models/document-models.js +10 -0
- package/dist/document-models/expense-report/actions.d.ts +27 -0
- package/dist/document-models/expense-report/actions.d.ts.map +1 -0
- package/dist/document-models/expense-report/actions.js +4 -0
- package/dist/document-models/expense-report/gen/creators.d.ts +1 -0
- package/dist/document-models/expense-report/gen/creators.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/creators.js +1 -0
- package/dist/document-models/expense-report/gen/document-model.d.ts +2 -2
- package/dist/document-models/expense-report/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/document-schema.d.ts +199 -0
- package/dist/document-models/expense-report/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/expense-report/gen/document-schema.js +33 -0
- package/dist/document-models/expense-report/gen/document-type.d.ts +2 -0
- package/dist/document-models/expense-report/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/expense-report/gen/document-type.js +1 -0
- package/dist/document-models/expense-report/gen/expense-report/actions.js +1 -1
- package/dist/document-models/expense-report/gen/expense-report/creators.d.ts +2 -2
- package/dist/document-models/expense-report/gen/expense-report/creators.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/expense-report/creators.js +3 -3
- package/dist/document-models/expense-report/gen/expense-report/operations.js +3 -1
- package/dist/document-models/expense-report/gen/index.d.ts +7 -3
- package/dist/document-models/expense-report/gen/index.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/index.js +7 -2
- package/dist/document-models/expense-report/gen/ph-factories.d.ts +6 -10
- package/dist/document-models/expense-report/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/ph-factories.js +1 -4
- package/dist/document-models/expense-report/gen/reducer.d.ts +1 -3
- package/dist/document-models/expense-report/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/reducer.js +34 -37
- package/dist/document-models/expense-report/gen/schema/index.d.ts +1 -1
- package/dist/document-models/expense-report/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/schema/index.js +1 -1
- package/dist/document-models/expense-report/gen/types.d.ts +9 -7
- package/dist/document-models/expense-report/gen/types.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/types.js +1 -1
- package/dist/document-models/expense-report/gen/utils.d.ts +13 -20
- package/dist/document-models/expense-report/gen/utils.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/utils.js +44 -35
- package/dist/document-models/expense-report/gen/wallet/actions.js +1 -1
- package/dist/document-models/expense-report/gen/wallet/creators.d.ts +2 -2
- package/dist/document-models/expense-report/gen/wallet/creators.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/wallet/creators.js +17 -17
- package/dist/document-models/expense-report/gen/wallet/operations.js +3 -1
- package/dist/document-models/expense-report/hooks.d.ts +11 -0
- package/dist/document-models/expense-report/hooks.d.ts.map +1 -0
- package/dist/document-models/expense-report/hooks.js +26 -0
- package/dist/document-models/expense-report/index.d.ts +5 -34
- package/dist/document-models/expense-report/index.d.ts.map +1 -1
- package/dist/document-models/expense-report/index.js +5 -17
- package/dist/document-models/expense-report/module.d.ts +5 -0
- package/dist/document-models/expense-report/module.d.ts.map +1 -0
- package/dist/document-models/expense-report/module.js +10 -0
- package/dist/document-models/expense-report/src/index.d.ts +2 -0
- package/dist/document-models/expense-report/src/index.d.ts.map +1 -0
- package/dist/document-models/expense-report/src/index.js +1 -0
- package/dist/document-models/expense-report/src/reducers/wallet.d.ts +2 -2
- package/dist/document-models/expense-report/src/reducers/wallet.d.ts.map +1 -1
- package/dist/document-models/expense-report/src/reducers/wallet.js +1 -1
- package/dist/document-models/expense-report/src/tests/document-model.test.js +4 -4
- package/dist/document-models/expense-report/src/tests/expense-report.test.js +3 -3
- package/dist/document-models/expense-report/src/tests/wallet.test.js +3 -3
- package/dist/document-models/expense-report/utils.d.ts +14 -0
- package/dist/document-models/expense-report/utils.d.ts.map +1 -0
- package/dist/document-models/expense-report/utils.js +7 -0
- package/dist/document-models/index.d.ts +8 -4
- package/dist/document-models/index.d.ts.map +1 -1
- package/dist/document-models/index.js +8 -4
- package/dist/document-models/integrations/actions.d.ts +15 -0
- package/dist/document-models/integrations/actions.d.ts.map +1 -0
- package/dist/document-models/integrations/actions.js +4 -0
- package/dist/document-models/integrations/gen/creators.d.ts +1 -0
- package/dist/document-models/integrations/gen/creators.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/creators.js +1 -0
- package/dist/document-models/integrations/gen/document-model.d.ts +2 -2
- package/dist/document-models/integrations/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/document-schema.d.ts +180 -0
- package/dist/document-models/integrations/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/integrations/gen/document-schema.js +33 -0
- package/dist/document-models/integrations/gen/document-type.d.ts +2 -0
- package/dist/document-models/integrations/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/integrations/gen/document-type.js +1 -0
- package/dist/document-models/integrations/gen/index.d.ts +7 -3
- package/dist/document-models/integrations/gen/index.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/index.js +7 -2
- package/dist/document-models/integrations/gen/integrations/actions.js +1 -1
- package/dist/document-models/integrations/gen/integrations/creators.d.ts +2 -2
- package/dist/document-models/integrations/gen/integrations/creators.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/integrations/creators.js +5 -5
- package/dist/document-models/integrations/gen/integrations/operations.js +3 -1
- package/dist/document-models/integrations/gen/ph-factories.d.ts +6 -10
- package/dist/document-models/integrations/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/ph-factories.js +4 -18
- package/dist/document-models/integrations/gen/reducer.d.ts +1 -3
- package/dist/document-models/integrations/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/reducer.js +10 -13
- package/dist/document-models/integrations/gen/schema/index.d.ts +1 -1
- package/dist/document-models/integrations/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/schema/index.js +1 -1
- package/dist/document-models/integrations/gen/types.d.ts +9 -7
- package/dist/document-models/integrations/gen/types.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/types.js +1 -1
- package/dist/document-models/integrations/gen/utils.d.ts +13 -20
- package/dist/document-models/integrations/gen/utils.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/utils.js +47 -49
- package/dist/document-models/integrations/hooks.d.ts +11 -0
- package/dist/document-models/integrations/hooks.d.ts.map +1 -0
- package/dist/document-models/integrations/hooks.js +26 -0
- package/dist/document-models/integrations/index.d.ts +5 -22
- package/dist/document-models/integrations/index.d.ts.map +1 -1
- package/dist/document-models/integrations/index.js +5 -17
- package/dist/document-models/integrations/module.d.ts +5 -0
- package/dist/document-models/integrations/module.d.ts.map +1 -0
- package/dist/document-models/integrations/module.js +10 -0
- package/dist/document-models/integrations/src/index.d.ts +2 -0
- package/dist/document-models/integrations/src/index.d.ts.map +1 -0
- package/dist/document-models/integrations/src/index.js +1 -0
- package/dist/document-models/integrations/src/reducers/integrations.d.ts +2 -7
- package/dist/document-models/integrations/src/reducers/integrations.d.ts.map +1 -1
- package/dist/document-models/integrations/src/reducers/integrations.js +1 -6
- package/dist/document-models/integrations/src/tests/document-model.test.js +4 -4
- package/dist/document-models/integrations/src/tests/integrations.test.js +2 -1
- package/dist/document-models/integrations/utils.d.ts +14 -0
- package/dist/document-models/integrations/utils.d.ts.map +1 -0
- package/dist/document-models/integrations/utils.js +7 -0
- package/dist/document-models/invoice/actions.d.ts +40 -0
- package/dist/document-models/invoice/actions.d.ts.map +1 -0
- package/dist/document-models/invoice/actions.js +10 -0
- package/dist/document-models/invoice/gen/creators.d.ts +4 -0
- package/dist/document-models/invoice/gen/creators.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/creators.js +4 -0
- package/dist/document-models/invoice/gen/document-model.d.ts +2 -2
- package/dist/document-models/invoice/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/document-schema.d.ts +465 -0
- package/dist/document-models/invoice/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/invoice/gen/document-schema.js +33 -0
- package/dist/document-models/invoice/gen/document-type.d.ts +2 -0
- package/dist/document-models/invoice/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/invoice/gen/document-type.js +1 -0
- package/dist/document-models/invoice/gen/general/actions.js +1 -1
- package/dist/document-models/invoice/gen/general/creators.d.ts +2 -2
- package/dist/document-models/invoice/gen/general/creators.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/general/creators.js +7 -7
- package/dist/document-models/invoice/gen/general/operations.js +3 -1
- package/dist/document-models/invoice/gen/index.d.ts +10 -3
- package/dist/document-models/invoice/gen/index.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/index.js +10 -2
- package/dist/document-models/invoice/gen/items/actions.js +1 -1
- package/dist/document-models/invoice/gen/items/creators.d.ts +2 -2
- package/dist/document-models/invoice/gen/items/creators.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/items/creators.js +7 -7
- package/dist/document-models/invoice/gen/items/operations.js +3 -1
- package/dist/document-models/invoice/gen/parties/actions.js +1 -1
- package/dist/document-models/invoice/gen/parties/creators.d.ts +2 -2
- package/dist/document-models/invoice/gen/parties/creators.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/parties/creators.js +8 -8
- package/dist/document-models/invoice/gen/parties/operations.js +3 -1
- package/dist/document-models/invoice/gen/ph-factories.d.ts +6 -10
- package/dist/document-models/invoice/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/ph-factories.js +5 -5
- package/dist/document-models/invoice/gen/reducer.d.ts +1 -3
- package/dist/document-models/invoice/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/reducer.js +63 -66
- package/dist/document-models/invoice/gen/schema/index.d.ts +1 -1
- package/dist/document-models/invoice/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/schema/index.js +1 -1
- package/dist/document-models/invoice/gen/schema/types.d.ts +1 -1
- package/dist/document-models/invoice/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/transitions/actions.js +1 -1
- package/dist/document-models/invoice/gen/transitions/creators.d.ts +2 -2
- package/dist/document-models/invoice/gen/transitions/creators.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/transitions/creators.js +14 -14
- package/dist/document-models/invoice/gen/transitions/operations.js +3 -1
- package/dist/document-models/invoice/gen/types.d.ts +9 -7
- package/dist/document-models/invoice/gen/types.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/types.js +1 -1
- package/dist/document-models/invoice/gen/utils.d.ts +13 -20
- package/dist/document-models/invoice/gen/utils.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/utils.js +48 -36
- package/dist/document-models/invoice/hooks.d.ts +11 -0
- package/dist/document-models/invoice/hooks.d.ts.map +1 -0
- package/dist/document-models/invoice/hooks.js +26 -0
- package/dist/document-models/invoice/index.d.ts +5 -47
- package/dist/document-models/invoice/index.d.ts.map +1 -1
- package/dist/document-models/invoice/index.js +5 -17
- package/dist/document-models/invoice/module.d.ts +5 -0
- package/dist/document-models/invoice/module.d.ts.map +1 -0
- package/dist/document-models/invoice/module.js +10 -0
- package/dist/document-models/invoice/src/index.d.ts +2 -0
- package/dist/document-models/invoice/src/index.d.ts.map +1 -0
- package/dist/document-models/invoice/src/index.js +1 -0
- package/dist/document-models/invoice/src/reducers/general.d.ts +2 -7
- package/dist/document-models/invoice/src/reducers/general.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/general.js +1 -6
- package/dist/document-models/invoice/src/reducers/items.d.ts +2 -7
- package/dist/document-models/invoice/src/reducers/items.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/items.js +1 -6
- package/dist/document-models/invoice/src/reducers/parties.d.ts +2 -7
- package/dist/document-models/invoice/src/reducers/parties.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/parties.js +1 -6
- package/dist/document-models/invoice/src/reducers/transitions.d.ts +2 -2
- package/dist/document-models/invoice/src/reducers/transitions.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/transitions.js +1 -1
- package/dist/document-models/invoice/src/tests/document-model.test.js +3 -3
- package/dist/document-models/invoice/src/tests/general.test.js +4 -4
- package/dist/document-models/invoice/src/tests/items.test.js +5 -5
- package/dist/document-models/invoice/src/tests/parties.test.js +8 -8
- package/dist/document-models/invoice/src/tests/transitions.test.js +2 -1
- package/dist/document-models/invoice/utils.d.ts +14 -0
- package/dist/document-models/invoice/utils.d.ts.map +1 -0
- package/dist/document-models/invoice/utils.js +7 -0
- package/dist/editors/billing-statement/components/objectSetTable.js +3 -1
- package/dist/editors/billing-statement/config.d.ts +3 -0
- package/dist/editors/billing-statement/config.d.ts.map +1 -0
- package/dist/editors/billing-statement/config.js +3 -0
- package/dist/editors/billing-statement/editor.d.ts.map +1 -1
- package/dist/editors/billing-statement/editor.js +18 -10
- package/dist/editors/billing-statement/lineItemTags/lineItemTags.d.ts +2 -2
- package/dist/editors/billing-statement/lineItemTags/lineItemTags.d.ts.map +1 -1
- package/dist/editors/billing-statement/lineItemTags/lineItemTags.js +2 -2
- package/dist/editors/billing-statement/lineItemTags/tagMapping.d.ts +2 -2
- package/dist/editors/billing-statement/lineItemTags/tagMapping.d.ts.map +1 -1
- package/dist/editors/billing-statement/lineItemTags/tagMapping.js +2 -0
- package/dist/editors/billing-statement/module.d.ts +3 -0
- package/dist/editors/billing-statement/module.d.ts.map +1 -0
- package/dist/editors/billing-statement/module.js +9 -0
- package/dist/editors/contributor-billing/components/DriveExplorer.d.ts +2 -9
- package/dist/editors/contributor-billing/components/DriveExplorer.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/DriveExplorer.js +13 -20
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts +8 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.js +97 -6
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderStats.js +3 -3
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts +4 -4
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.js +45 -32
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.js +3 -8
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts +3 -3
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.js +1 -1
- package/dist/editors/contributor-billing/config.d.ts +3 -0
- package/dist/editors/contributor-billing/config.d.ts.map +1 -0
- package/dist/editors/contributor-billing/config.js +7 -0
- package/dist/editors/contributor-billing/editor.d.ts +2 -1
- package/dist/editors/contributor-billing/editor.d.ts.map +1 -1
- package/dist/editors/contributor-billing/editor.js +7 -2
- package/dist/editors/contributor-billing/module.d.ts +3 -0
- package/dist/editors/contributor-billing/module.d.ts.map +1 -0
- package/dist/editors/contributor-billing/module.js +9 -0
- package/dist/editors/editors.d.ts +3 -0
- package/dist/editors/editors.d.ts.map +1 -0
- package/dist/editors/editors.js +12 -0
- package/dist/editors/expense-report/components/AddBillingStatementModal.js +2 -2
- package/dist/editors/expense-report/components/WalletsTable.d.ts.map +1 -1
- package/dist/editors/expense-report/components/WalletsTable.js +15 -8
- package/dist/editors/expense-report/config.d.ts +3 -0
- package/dist/editors/expense-report/config.d.ts.map +1 -0
- package/dist/editors/expense-report/config.js +3 -0
- package/dist/editors/expense-report/editor.d.ts +1 -1
- package/dist/editors/expense-report/editor.d.ts.map +1 -1
- package/dist/editors/expense-report/editor.js +12 -3
- package/dist/editors/expense-report/hooks/useSyncWallet.js +2 -2
- package/dist/editors/expense-report/hooks/useWalletSync.js +2 -2
- package/dist/editors/expense-report/module.d.ts +3 -0
- package/dist/editors/expense-report/module.d.ts.map +1 -0
- package/dist/editors/expense-report/module.js +9 -0
- package/dist/editors/hooks/useExpenseReportDocument.d.ts +2 -2
- package/dist/editors/hooks/useExpenseReportDocument.d.ts.map +1 -1
- package/dist/editors/hooks/useIntegrationsDocument.d.ts +2 -2
- package/dist/editors/hooks/useIntegrationsDocument.d.ts.map +1 -1
- package/dist/editors/index.d.ts +5 -5
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +5 -5
- package/dist/editors/integrations/config.d.ts +3 -0
- package/dist/editors/integrations/config.d.ts.map +1 -0
- package/dist/editors/integrations/config.js +3 -0
- package/dist/editors/integrations/editor.d.ts.map +1 -1
- package/dist/editors/integrations/editor.js +74 -52
- package/dist/editors/integrations/module.d.ts +3 -0
- package/dist/editors/integrations/module.d.ts.map +1 -0
- package/dist/editors/integrations/module.js +9 -0
- package/dist/editors/invoice/InvoicePDF.d.ts +1 -1
- package/dist/editors/invoice/InvoicePDF.d.ts.map +1 -1
- package/dist/editors/invoice/components/confirmationModal.js +1 -0
- package/dist/editors/invoice/components/countryForm.d.ts +1 -1
- package/dist/editors/invoice/components/countryForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/countryForm.js +1 -0
- package/dist/editors/invoice/components/currencyForm.d.ts +1 -1
- package/dist/editors/invoice/components/currencyForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/currencyForm.js +1 -0
- package/dist/editors/invoice/components/datePicker.js +1 -0
- package/dist/editors/invoice/components/inputField.d.ts +1 -1
- package/dist/editors/invoice/components/inputField.d.ts.map +1 -1
- package/dist/editors/invoice/components/inputField.js +1 -0
- package/dist/editors/invoice/components/selectField.d.ts.map +1 -1
- package/dist/editors/invoice/components/selectField.js +0 -12
- package/dist/editors/invoice/components/statusModalComponents.js +4 -4
- package/dist/editors/invoice/config.d.ts +3 -0
- package/dist/editors/invoice/config.d.ts.map +1 -0
- package/dist/editors/invoice/config.js +3 -0
- package/dist/editors/invoice/editor.d.ts.map +1 -1
- package/dist/editors/invoice/editor.js +103 -95
- package/dist/editors/invoice/exportUBL.d.ts +1 -1
- package/dist/editors/invoice/exportUBL.d.ts.map +1 -1
- package/dist/editors/invoice/ingestPDF.d.ts +1 -1
- package/dist/editors/invoice/ingestPDF.d.ts.map +1 -1
- package/dist/editors/invoice/ingestPDF.js +34 -18
- package/dist/editors/invoice/ingestUBL.d.ts +1 -1
- package/dist/editors/invoice/ingestUBL.d.ts.map +1 -1
- package/dist/editors/invoice/invoiceToGnosis.js +2 -2
- package/dist/editors/invoice/legalEntity/bankSection.d.ts +3 -3
- package/dist/editors/invoice/legalEntity/bankSection.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/common.d.ts +1 -1
- package/dist/editors/invoice/legalEntity/common.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/legalEntity.d.ts +3 -3
- package/dist/editors/invoice/legalEntity/legalEntity.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/legalEntity.js +1 -0
- package/dist/editors/invoice/legalEntity/walletSection.d.ts +3 -3
- package/dist/editors/invoice/legalEntity/walletSection.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/walletSection.js +5 -6
- package/dist/editors/invoice/lineItemTags/lineItemTags.d.ts +2 -2
- package/dist/editors/invoice/lineItemTags/lineItemTags.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/lineItemTags.js +2 -2
- package/dist/editors/invoice/lineItemTags/tagMapping.d.ts +1 -1
- package/dist/editors/invoice/lineItemTags/tagMapping.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/tagMobileModal.d.ts +2 -2
- package/dist/editors/invoice/lineItemTags/tagMobileModal.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/tagMobileModal.js +2 -2
- package/dist/editors/invoice/lineItems.d.ts.map +1 -1
- package/dist/editors/invoice/lineItems.js +3 -1
- package/dist/editors/invoice/module.d.ts +3 -0
- package/dist/editors/invoice/module.d.ts.map +1 -0
- package/dist/editors/invoice/module.js +9 -0
- package/dist/editors/invoice/requestFinance.js +3 -3
- package/dist/editors/invoice/uploadPdfChunked.js +1 -1
- package/dist/editors/invoice/utils/utils.d.ts +25 -0
- package/dist/editors/invoice/utils/utils.d.ts.map +1 -1
- package/dist/editors/invoice/utils/utils.js +66 -0
- package/dist/editors/invoice/validation/validationHandler.d.ts +1 -1
- package/dist/editors/invoice/validation/validationHandler.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationHandler.js +1 -1
- package/dist/editors/invoice/validation/validationManager.d.ts +1 -1
- package/dist/editors/invoice/validation/validationManager.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationManager.js +1 -0
- package/dist/editors/invoice/validation/validationRules.d.ts +1 -1
- package/dist/editors/invoice/validation/validationRules.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/processors/index.d.ts +1 -1
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/line-item-processor/index.d.ts +2 -2
- package/dist/processors/line-item-processor/index.d.ts.map +1 -1
- package/dist/processors/line-item-processor/index.js +2 -1
- package/dist/scripts/invoice/autoTagging.d.ts +32 -0
- package/dist/scripts/invoice/autoTagging.d.ts.map +1 -0
- package/dist/scripts/invoice/autoTagging.js +341 -0
- package/dist/scripts/invoice/gnosisTransactionBuilder.d.ts.map +1 -1
- package/dist/scripts/invoice/gnosisTransactionBuilder.js +4 -9
- package/dist/scripts/invoice/pdfToClaudeAI.d.ts.map +1 -1
- package/dist/scripts/invoice/pdfToClaudeAI.js +8 -4
- package/dist/style.css +276 -4773
- package/dist/subgraphs/billing-statement/index.d.ts +2 -2
- package/dist/subgraphs/billing-statement/index.d.ts.map +1 -1
- package/dist/subgraphs/billing-statement/index.js +2 -2
- package/dist/subgraphs/billing-statement/resolvers.d.ts +2 -2
- package/dist/subgraphs/billing-statement/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/billing-statement/resolvers.js +1 -0
- package/dist/subgraphs/expense-report/index.d.ts +2 -2
- package/dist/subgraphs/expense-report/index.d.ts.map +1 -1
- package/dist/subgraphs/expense-report/index.js +2 -2
- package/dist/subgraphs/expense-report/resolvers.d.ts +2 -2
- package/dist/subgraphs/expense-report/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/expense-report/resolvers.js +1 -0
- package/dist/subgraphs/integrations/index.d.ts +2 -2
- package/dist/subgraphs/integrations/index.d.ts.map +1 -1
- package/dist/subgraphs/integrations/index.js +2 -2
- package/dist/subgraphs/integrations/resolvers.d.ts +2 -2
- package/dist/subgraphs/integrations/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/integrations/resolvers.js +1 -0
- package/dist/subgraphs/invoice/index.d.ts +2 -2
- package/dist/subgraphs/invoice/index.d.ts.map +1 -1
- package/dist/subgraphs/invoice/index.js +2 -2
- package/dist/subgraphs/invoice/resolvers.d.ts +2 -2
- package/dist/subgraphs/invoice/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/invoice/resolvers.js +1 -0
- package/dist/vite.config.d.ts +3 -0
- package/dist/vite.config.d.ts.map +1 -0
- package/dist/vite.config.js +13 -0
- package/package.json +66 -49
- package/dist/document-models/billing-statement/gen/general/object.d.ts +0 -9
- package/dist/document-models/billing-statement/gen/general/object.d.ts.map +0 -1
- package/dist/document-models/billing-statement/gen/general/object.js +0 -13
- package/dist/document-models/billing-statement/gen/line-items/object.d.ts +0 -8
- package/dist/document-models/billing-statement/gen/line-items/object.d.ts.map +0 -1
- package/dist/document-models/billing-statement/gen/line-items/object.js +0 -10
- package/dist/document-models/billing-statement/gen/object.d.ts +0 -19
- package/dist/document-models/billing-statement/gen/object.d.ts.map +0 -1
- package/dist/document-models/billing-statement/gen/object.js +0 -33
- package/dist/document-models/billing-statement/gen/tags/object.d.ts +0 -7
- package/dist/document-models/billing-statement/gen/tags/object.d.ts.map +0 -1
- package/dist/document-models/billing-statement/gen/tags/object.js +0 -7
- package/dist/document-models/expense-report/gen/expense-report/object.d.ts +0 -7
- package/dist/document-models/expense-report/gen/expense-report/object.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/object.js +0 -7
- package/dist/document-models/expense-report/gen/object.d.ts +0 -15
- package/dist/document-models/expense-report/gen/object.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/object.js +0 -25
- package/dist/document-models/expense-report/gen/wallet/object.d.ts +0 -21
- package/dist/document-models/expense-report/gen/wallet/object.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/wallet/object.js +0 -49
- package/dist/document-models/integrations/gen/integrations/object.d.ts +0 -9
- package/dist/document-models/integrations/gen/integrations/object.d.ts.map +0 -1
- package/dist/document-models/integrations/gen/integrations/object.js +0 -13
- package/dist/document-models/integrations/gen/object.d.ts +0 -15
- package/dist/document-models/integrations/gen/object.d.ts.map +0 -1
- package/dist/document-models/integrations/gen/object.js +0 -25
- package/dist/document-models/invoice/gen/general/object.d.ts +0 -11
- package/dist/document-models/invoice/gen/general/object.d.ts.map +0 -1
- package/dist/document-models/invoice/gen/general/object.js +0 -19
- package/dist/document-models/invoice/gen/items/object.d.ts +0 -11
- package/dist/document-models/invoice/gen/items/object.d.ts.map +0 -1
- package/dist/document-models/invoice/gen/items/object.js +0 -19
- package/dist/document-models/invoice/gen/object.d.ts +0 -21
- package/dist/document-models/invoice/gen/object.d.ts.map +0 -1
- package/dist/document-models/invoice/gen/object.js +0 -36
- package/dist/document-models/invoice/gen/parties/object.d.ts +0 -12
- package/dist/document-models/invoice/gen/parties/object.d.ts.map +0 -1
- package/dist/document-models/invoice/gen/parties/object.js +0 -22
- package/dist/document-models/invoice/gen/transitions/object.d.ts +0 -18
- package/dist/document-models/invoice/gen/transitions/object.d.ts.map +0 -1
- package/dist/document-models/invoice/gen/transitions/object.js +0 -40
- package/dist/editors/billing-statement/index.d.ts +0 -4
- package/dist/editors/billing-statement/index.d.ts.map +0 -1
- package/dist/editors/billing-statement/index.js +0 -12
- package/dist/editors/contributor-billing/components/CreateDocument.d.ts +0 -6
- package/dist/editors/contributor-billing/components/CreateDocument.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/CreateDocument.js +0 -23
- package/dist/editors/contributor-billing/components/DocumentDispatch.d.ts +0 -12
- package/dist/editors/contributor-billing/components/DocumentDispatch.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/DocumentDispatch.js +0 -20
- package/dist/editors/contributor-billing/components/EditorContainer.d.ts +0 -10
- package/dist/editors/contributor-billing/components/EditorContainer.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/EditorContainer.js +0 -56
- package/dist/editors/contributor-billing/components/FileItemsGrid.d.ts +0 -12
- package/dist/editors/contributor-billing/components/FileItemsGrid.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/FileItemsGrid.js +0 -7
- package/dist/editors/contributor-billing/components/FolderItemsGrid.d.ts +0 -17
- package/dist/editors/contributor-billing/components/FolderItemsGrid.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/FolderItemsGrid.js +0 -14
- package/dist/editors/contributor-billing/components/FolderTree.d.ts +0 -13
- package/dist/editors/contributor-billing/components/FolderTree.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/FolderTree.js +0 -38
- package/dist/editors/contributor-billing/hooks/useDispatchMap.d.ts +0 -9
- package/dist/editors/contributor-billing/hooks/useDispatchMap.d.ts.map +0 -1
- package/dist/editors/contributor-billing/hooks/useDispatchMap.js +0 -21
- package/dist/editors/contributor-billing/hooks/useDrop.d.ts +0 -22
- package/dist/editors/contributor-billing/hooks/useDrop.d.ts.map +0 -1
- package/dist/editors/contributor-billing/hooks/useDrop.js +0 -57
- package/dist/editors/contributor-billing/hooks/useSelectedFolderChildren.d.ts +0 -8
- package/dist/editors/contributor-billing/hooks/useSelectedFolderChildren.d.ts.map +0 -1
- package/dist/editors/contributor-billing/hooks/useSelectedFolderChildren.js +0 -19
- package/dist/editors/contributor-billing/hooks/useTransformedNodes.d.ts +0 -3
- package/dist/editors/contributor-billing/hooks/useTransformedNodes.d.ts.map +0 -1
- package/dist/editors/contributor-billing/hooks/useTransformedNodes.js +0 -32
- package/dist/editors/contributor-billing/index.d.ts +0 -4
- package/dist/editors/contributor-billing/index.d.ts.map +0 -1
- package/dist/editors/contributor-billing/index.js +0 -19
- package/dist/editors/contributor-billing/utils/withDropZone.d.ts +0 -4
- package/dist/editors/contributor-billing/utils/withDropZone.d.ts.map +0 -1
- package/dist/editors/contributor-billing/utils/withDropZone.js +0 -19
- package/dist/editors/expense-report/index.d.ts +0 -3
- package/dist/editors/expense-report/index.d.ts.map +0 -1
- package/dist/editors/expense-report/index.js +0 -11
- package/dist/editors/integrations/index.d.ts +0 -4
- package/dist/editors/integrations/index.d.ts.map +0 -1
- package/dist/editors/integrations/index.js +0 -12
- package/dist/editors/invoice/assets/custom.d.ts +0 -4
- package/dist/editors/invoice/assets/powerhouseLogo.png +0 -0
- package/dist/editors/invoice/index.d.ts +0 -4
- package/dist/editors/invoice/index.d.ts.map +0 -1
- package/dist/editors/invoice/index.js +0 -12
- package/dist/migrate-zip.d.ts +0 -2
- package/dist/migrate-zip.d.ts.map +0 -1
- package/dist/migrate-zip.js +0 -56
- package/dist/reducers/general.d.ts +0 -8
- package/dist/reducers/general.d.ts.map +0 -1
- package/dist/reducers/general.js +0 -73
- package/dist/reducers/items.d.ts +0 -8
- package/dist/reducers/items.d.ts.map +0 -1
- package/dist/reducers/items.js +0 -195
- package/dist/reducers/parties.d.ts +0 -8
- package/dist/reducers/parties.d.ts.map +0 -1
- package/dist/reducers/parties.js +0 -266
- package/dist/reducers/transitions.d.ts +0 -8
- package/dist/reducers/transitions.d.ts.map +0 -1
- package/dist/reducers/transitions.js +0 -162
- package/dist/scripts/invoice/pdfToDocumentAi.d.ts +0 -5
- package/dist/scripts/invoice/pdfToDocumentAi.d.ts.map +0 -1
- package/dist/scripts/invoice/pdfToDocumentAi.js +0 -659
- package/dist/tailwind.config.d.ts +0 -13
- package/dist/tailwind.config.d.ts.map +0 -1
- package/dist/tailwind.config.js +0 -16
|
@@ -3,12 +3,14 @@ import React from "react";
|
|
|
3
3
|
import { HeaderControls } from "./HeaderControls.js";
|
|
4
4
|
import { InvoiceTableSection } from "./InvoiceTableSection.js";
|
|
5
5
|
import { InvoiceTableRow } from "./InvoiceTableRow.js";
|
|
6
|
+
import {} from "document-model";
|
|
6
7
|
import { mapTags } from "../../../billing-statement/lineItemTags/tagMapping.js";
|
|
7
8
|
import { exportInvoicesToXeroCSV } from "../../../../scripts/contributor-billing/createXeroCsv.js";
|
|
8
9
|
import { exportExpenseReportCSV } from "../../../../scripts/contributor-billing/createExpenseReportCsv.js";
|
|
9
|
-
import { toast } from "@powerhousedao/design-system";
|
|
10
|
+
import { toast } from "@powerhousedao/design-system/connect";
|
|
10
11
|
import { actions, } from "../../../../document-models/invoice/index.js";
|
|
11
12
|
import { addDocument, useSelectedDrive, dispatchActions, setSelectedNode, } from "@powerhousedao/reactor-browser";
|
|
13
|
+
import { useReactor } from "@powerhousedao/reactor-browser/connect";
|
|
12
14
|
import { actions as billingStatementActions } from "../../../../document-models/billing-statement/index.js";
|
|
13
15
|
const statusOptions = [
|
|
14
16
|
{ label: "Draft", value: "DRAFT" },
|
|
@@ -21,8 +23,9 @@ const statusOptions = [
|
|
|
21
23
|
{ label: "Rejected", value: "REJECTED" },
|
|
22
24
|
{ label: "Other", value: "OTHER" },
|
|
23
25
|
];
|
|
24
|
-
export const InvoiceTable = ({ files, state, selected, filteredDocumentModels, onSelectDocumentModel, getDocDispatcher, selectedStatuses, onStatusChange, onRowSelection, canExportSelectedRows, }) => {
|
|
26
|
+
export const InvoiceTable = ({ files, state, selected, setSelected, filteredDocumentModels, onSelectDocumentModel, getDocDispatcher, selectedStatuses, onStatusChange, onRowSelection, canExportSelectedRows, }) => {
|
|
25
27
|
const [selectedDrive] = useSelectedDrive();
|
|
28
|
+
const reactor = useReactor();
|
|
26
29
|
const billingDocStates = state
|
|
27
30
|
.filter((doc) => doc.header.documentType === "powerhouse/billing-statement")
|
|
28
31
|
.map((doc) => ({
|
|
@@ -91,12 +94,9 @@ export const InvoiceTable = ({ files, state, selected, filteredDocumentModels, o
|
|
|
91
94
|
console.log("created billing statement doc", createdNode);
|
|
92
95
|
if (!createdNode?.id) {
|
|
93
96
|
console.error("Failed to create billing statement");
|
|
94
|
-
return
|
|
97
|
+
return;
|
|
95
98
|
}
|
|
96
|
-
|
|
97
|
-
contributor: id,
|
|
98
|
-
}), createdNode.id);
|
|
99
|
-
// Prepare billing statement data with empty input handlers
|
|
99
|
+
// Prepare billing statement data
|
|
100
100
|
const billingStatementData = {
|
|
101
101
|
dateIssued: invoiceState.state.global.dateIssued &&
|
|
102
102
|
invoiceState.state.global.dateIssued.trim() !== ""
|
|
@@ -109,33 +109,46 @@ export const InvoiceTable = ({ files, state, selected, filteredDocumentModels, o
|
|
|
109
109
|
currency: invoiceState.state.global.currency || "",
|
|
110
110
|
notes: invoiceState.state.global.notes || "",
|
|
111
111
|
};
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
112
|
+
// Dispatch initial setup actions together
|
|
113
|
+
await dispatchActions([
|
|
114
|
+
billingStatementActions.editContributor({
|
|
115
|
+
contributor: id,
|
|
116
|
+
}),
|
|
117
|
+
billingStatementActions.editBillingStatement(billingStatementData),
|
|
118
|
+
], createdNode.id);
|
|
119
|
+
// Collect all line item actions
|
|
120
|
+
const lineItemActions = invoiceState.state.global.lineItems.map((lineItem) => billingStatementActions.addLineItem({
|
|
121
|
+
id: lineItem.id,
|
|
122
|
+
description: lineItem.description,
|
|
123
|
+
quantity: lineItem.quantity,
|
|
124
|
+
// Map invoice fields to billing statement fields
|
|
125
|
+
totalPriceCash: lineItem.totalPriceTaxIncl || 0,
|
|
126
|
+
totalPricePwt: 0, // Default to 0 since invoice doesn't have POWT pricing
|
|
127
|
+
unit: "UNIT", // Default to UNIT since invoice doesn't have unit field
|
|
128
|
+
unitPriceCash: lineItem.unitPriceTaxIncl || 0,
|
|
129
|
+
unitPricePwt: 0, // Default to 0 since invoice doesn't have POWT pricing
|
|
130
|
+
}));
|
|
131
|
+
// Dispatch all line items in one batch
|
|
132
|
+
if (lineItemActions.length > 0) {
|
|
133
|
+
await dispatchActions(lineItemActions, createdNode.id);
|
|
134
|
+
}
|
|
135
|
+
// Collect all tag actions
|
|
136
|
+
const tagActions = [];
|
|
137
|
+
for (const lineItem of invoiceState.state.global.lineItems) {
|
|
129
138
|
const lineItemTag = mapTags(lineItem.lineItemTag || []);
|
|
130
|
-
|
|
131
|
-
|
|
139
|
+
for (const tag of lineItemTag) {
|
|
140
|
+
tagActions.push(billingStatementActions.editLineItemTag({
|
|
132
141
|
lineItemId: lineItem.id,
|
|
133
142
|
dimension: tag.dimension,
|
|
134
143
|
value: tag.value,
|
|
135
144
|
label: tag.label,
|
|
136
|
-
})
|
|
137
|
-
}
|
|
138
|
-
}
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// Dispatch all tags in one batch
|
|
149
|
+
if (tagActions.length > 0) {
|
|
150
|
+
await dispatchActions(tagActions, createdNode.id);
|
|
151
|
+
}
|
|
139
152
|
};
|
|
140
153
|
const selectedInvoiceIds = Object.keys(selected).filter((id) => selected[id]);
|
|
141
154
|
const selectedInvoices = selectedInvoiceIds
|
|
@@ -203,7 +216,7 @@ export const InvoiceTable = ({ files, state, selected, filteredDocumentModels, o
|
|
|
203
216
|
// check if integrations document exists
|
|
204
217
|
const integrationsDoc = files.find((file) => file.documentType === "powerhouse/integrations");
|
|
205
218
|
const createIntegrationsDocument = async () => {
|
|
206
|
-
const integrationsDocument = filteredDocumentModels?.find((model) => model.
|
|
219
|
+
const integrationsDocument = filteredDocumentModels?.find((model) => model.id === "powerhouse/integrations");
|
|
207
220
|
if (integrationsDocument) {
|
|
208
221
|
const createdNode = await addDocument(selectedDrive?.header.id || "", `integration-settings`, "powerhouse/integrations", undefined, undefined, undefined, "integrations-editor");
|
|
209
222
|
console.log("created integrations document", createdNode);
|
|
@@ -225,7 +238,7 @@ export const InvoiceTable = ({ files, state, selected, filteredDocumentModels, o
|
|
|
225
238
|
}
|
|
226
239
|
else {
|
|
227
240
|
// Create new expense report
|
|
228
|
-
const expenseReportModel = filteredDocumentModels?.find((model) => model.
|
|
241
|
+
const expenseReportModel = filteredDocumentModels?.find((model) => model.id === "powerhouse/expense-report");
|
|
229
242
|
if (expenseReportModel) {
|
|
230
243
|
const createdNode = await addDocument(selectedDrive?.header.id || "", `expense-report`, "powerhouse/expense-report", undefined, undefined, undefined, "powerhouse-expense-report-editor");
|
|
231
244
|
console.log("created expense report document", createdNode);
|
|
@@ -237,5 +250,5 @@ export const InvoiceTable = ({ files, state, selected, filteredDocumentModels, o
|
|
|
237
250
|
}
|
|
238
251
|
}
|
|
239
252
|
};
|
|
240
|
-
return (_jsxs("div", { className: "w-full h-full bg-white rounded-lg p-4 border border-gray-200 shadow-md mt-4 overflow-x-auto", children: [_jsx(HeaderControls, { statusOptions: statusOptions, onStatusChange: onStatusChange, onExport: handleCSVExport, onExpenseReportExport: handleExportCSVExpenseReport, selectedStatuses: selectedStatuses, createIntegrationsDocument: createIntegrationsDocument, integrationsDoc: integrationsDoc, canExportSelectedRows: canExportSelectedRows, hasBillingStatements: hasBillingStatements, expenseReportDoc: expenseReportDoc, onCreateOrOpenExpenseReport: handleCreateOrOpenExpenseReport }), shouldShowSection("DRAFT") && (_jsx(InvoiceTableSection, { title: "Draft", count: draft.length, onSelectDocumentModel: onSelectDocumentModel, filteredDocumentModels: filteredDocumentModels, children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: draft.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status) }, row.id))) })] }) })), shouldShowSection("ISSUED") && (_jsx(InvoiceTableSection, { title: "Issued", count: issued.length, children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: issued.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("ACCEPTED") && (_jsx(InvoiceTableSection, { title: "Accepted", count: accepted.length, color: "bg-green-100 text-green-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: accepted.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTSCHEDULED") && (_jsx(InvoiceTableSection, { title: "Payment Scheduled", count: paymentScheduled.length, color: "bg-green-100 text-green-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: paymentScheduled.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTSENT") && (_jsx(InvoiceTableSection, { title: "Payment Sent", count: paymentSent.length, color: "bg-green-100 text-green-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: paymentSent.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTISSUE") && (_jsx(InvoiceTableSection, { title: "Payment Issue", count: paymentIssue.length, color: "bg-yellow-100 text-yellow-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: paymentIssue.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTCLOSED") && (_jsx(InvoiceTableSection, { title: "Payment Closed", count: paymentClosed.length, color: "bg-red-500 text-black-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: paymentClosed.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status) }, row.id))) })] }) })), shouldShowSection("REJECTED") && (_jsx(InvoiceTableSection, { title: "Rejected", count: rejected.length, color: "bg-red-500 text-black-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2", children: "Exported" })] }) }), _jsx("tbody", { children: rejected.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status) }, row.id))) })] }) })), shouldShowSection("OTHER") && (_jsx(InvoiceTableSection, { title: "Other", count: otherInvoices.length, children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Exported" })] }) }), _jsx("tbody", { children: otherInvoices.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status) }, row.id))) })] }) }))] }, `${state.length}`));
|
|
253
|
+
return (_jsxs("div", { className: "w-full h-full bg-white rounded-lg p-4 border border-gray-200 shadow-md mt-4 overflow-x-auto", children: [_jsx(HeaderControls, { statusOptions: statusOptions, onStatusChange: onStatusChange, onExport: handleCSVExport, onExpenseReportExport: handleExportCSVExpenseReport, selectedStatuses: selectedStatuses, createIntegrationsDocument: createIntegrationsDocument, integrationsDoc: integrationsDoc, canExportSelectedRows: canExportSelectedRows, hasBillingStatements: hasBillingStatements, expenseReportDoc: expenseReportDoc, onCreateOrOpenExpenseReport: handleCreateOrOpenExpenseReport, selected: selected, handleCreateBillingStatement: handleCreateBillingStatement, setSelected: setSelected }), shouldShowSection("DRAFT") && (_jsx(InvoiceTableSection, { title: "Draft", count: draft.length, onSelectDocumentModel: onSelectDocumentModel, filteredDocumentModels: filteredDocumentModels, children: _jsxs("table", { className: "w-full text-sm rounded-sm border-separate border-spacing-0 border border-gray-400 overflow-hidden", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50 font-medium text-gray-500", children: [_jsx("th", { className: "px-2 py-2 w-8 rounded-tl-sm" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 rounded-tr-sm", children: "Exported" })] }) }), _jsx("tbody", { children: draft.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status) }, row.id))) })] }) })), shouldShowSection("ISSUED") && (_jsx(InvoiceTableSection, { title: "Issued", count: issued.length, children: _jsxs("table", { className: "w-full text-sm rounded-sm border-separate border-spacing-0 border border-gray-400 overflow-hidden", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50 font-medium text-gray-500", children: [_jsx("th", { className: "px-2 py-2 w-8 rounded-tl-sm" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2 rounded-tr-sm", children: "Exported" })] }) }), _jsx("tbody", { children: issued.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("ACCEPTED") && (_jsx(InvoiceTableSection, { title: "Accepted", count: accepted.length, color: "bg-green-100 text-green-600", children: _jsxs("table", { className: "w-full text-sm rounded-sm border-separate border-spacing-0 border border-gray-400 overflow-hidden", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50 font-medium text-gray-500", children: [_jsx("th", { className: "px-2 py-2 w-8 rounded-tl-sm" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2 rounded-tr-sm", children: "Exported" })] }) }), _jsx("tbody", { children: accepted.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTSCHEDULED") && (_jsx(InvoiceTableSection, { title: "Payment Scheduled", count: paymentScheduled.length, color: "bg-green-100 text-green-600", children: _jsxs("table", { className: "w-full text-sm rounded-sm border-separate border-spacing-0 border border-gray-400 overflow-hidden", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50 font-medium text-gray-500", children: [_jsx("th", { className: "px-2 py-2 w-8 rounded-tl-sm" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2 rounded-tr-sm", children: "Exported" })] }) }), _jsx("tbody", { children: paymentScheduled.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTSENT") && (_jsx(InvoiceTableSection, { title: "Payment Sent", count: paymentSent.length, color: "bg-green-100 text-green-600", children: _jsxs("table", { className: "w-full text-sm rounded-sm border-separate border-spacing-0 border border-gray-400 overflow-hidden", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50 font-medium text-gray-500", children: [_jsx("th", { className: "px-2 py-2 w-8 rounded-tl-sm" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2 rounded-tr-sm", children: "Exported" })] }) }), _jsx("tbody", { children: paymentSent.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTISSUE") && (_jsx(InvoiceTableSection, { title: "Payment Issue", count: paymentIssue.length, color: "bg-yellow-100 text-yellow-600", children: _jsxs("table", { className: "w-full text-sm rounded-sm border-separate border-spacing-0 border border-gray-400 overflow-hidden", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50 font-medium text-gray-500", children: [_jsx("th", { className: "px-2 py-2 w-8 rounded-tl-sm" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Billing Statement" }), _jsx("th", { className: "px-2 py-2 rounded-tr-sm", children: "Exported" })] }) }), _jsx("tbody", { children: paymentIssue.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status), onCreateBillingStatement: handleCreateBillingStatement, billingDocStates: billingDocStates }, row.id))) })] }) })), shouldShowSection("PAYMENTCLOSED") && (_jsx(InvoiceTableSection, { title: "Payment Closed", count: paymentClosed.length, color: "bg-red-500 text-black-600", children: _jsxs("table", { className: "w-full text-sm rounded-sm border-separate border-spacing-0 border border-gray-400 overflow-hidden", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50 font-medium text-gray-500", children: [_jsx("th", { className: "px-2 py-2 w-8 rounded-tl-sm" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 rounded-tr-sm", children: "Exported" })] }) }), _jsx("tbody", { children: paymentClosed.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status) }, row.id))) })] }) })), shouldShowSection("REJECTED") && (_jsx(InvoiceTableSection, { title: "Rejected", count: rejected.length, color: "bg-red-500 text-black-600", children: _jsxs("table", { className: "w-full text-sm rounded-sm border-separate border-spacing-0 border border-gray-400 overflow-hidden", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50 font-medium text-gray-500", children: [_jsx("th", { className: "px-2 py-2 w-8 rounded-tl-sm" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 rounded-tr-sm", children: "Exported" })] }) }), _jsx("tbody", { children: rejected.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status) }, row.id))) })] }) })), shouldShowSection("OTHER") && (_jsx(InvoiceTableSection, { title: "Other", count: otherInvoices.length, children: _jsxs("table", { className: "w-full text-sm rounded-sm border-separate border-spacing-0 border border-gray-400 overflow-hidden", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50 font-medium text-gray-500", children: [_jsx("th", { className: "px-2 py-2 w-8 rounded-tl-sm" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-center", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-center", children: "Amount" }), _jsx("th", { className: "px-2 py-2 text-center rounded-tr-sm", children: "Exported" })] }) }), _jsx("tbody", { children: otherInvoices.map((row) => (_jsx(InvoiceTableRow, { files: files, row: row, isSelected: !!selected[row.id], onSelect: (checked) => onRowSelection(row.id, checked, row.status) }, row.id))) })] }) }))] }, `${state.length}`));
|
|
241
254
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvoiceTableRow.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InvoiceTableRow.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,GAAI,mFAO7B;IACD,KAAK,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC9D,GAAG,EAAE,GAAG,CAAC;IACT,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,wBAAwB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,gBAAgB,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1D,4CA2GA,CAAC"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { FileItem } from "@powerhousedao/design-system";
|
|
3
|
-
import { getSyncStatusSync, setSelectedNode, showDeleteNodeModal, useDriveSharingType, useNodeActions, useSelectedDriveDocument, } from "@powerhousedao/reactor-browser";
|
|
2
|
+
import { FileItem } from "@powerhousedao/design-system/connect";
|
|
4
3
|
export const InvoiceTableRow = ({ files, row, isSelected, onSelect, onCreateBillingStatement, billingDocStates, }) => {
|
|
5
|
-
const [selectedDrive] = useSelectedDriveDocument(); // Currently selected drive
|
|
6
|
-
const sharingType = useDriveSharingType(selectedDrive.header.id);
|
|
7
|
-
// Core drive operations and document models
|
|
8
|
-
const { onAddFile, onAddFolder, onCopyNode, onDuplicateNode, onMoveNode, onRenameNode, } = useNodeActions();
|
|
9
4
|
const formatTimestamp = (timestamp) => {
|
|
10
5
|
const date = new Date(timestamp);
|
|
11
6
|
const day = date.getDate().toString().padStart(2, "0");
|
|
@@ -43,10 +38,10 @@ export const InvoiceTableRow = ({ files, row, isSelected, onSelect, onCreateBill
|
|
|
43
38
|
const billingFile = files?.find((file) => file.id === billingDoc?.id);
|
|
44
39
|
const file = files?.find((file) => file.id === row.id);
|
|
45
40
|
const hasExportedData = row.exported != null && Boolean(row.exported.timestamp?.trim());
|
|
46
|
-
return (_jsxs("tr", { className: "hover:bg-gray-50", children: [_jsx("td", { className: "px-2 py-2", children: _jsx("input", { type: "checkbox", checked: isSelected, onChange: (e) => onSelect(e.target.checked), className: "size-4 rounded border-gray-300 text-blue-600 focus:ring-2 focus:ring-blue-500" }) }), _jsx("td", { className: "py-1 w-10", children: file && (_jsx(FileItem, { fileNode: file,
|
|
41
|
+
return (_jsxs("tr", { className: "hover:bg-gray-50", children: [_jsx("td", { className: "px-2 py-2", children: _jsx("input", { type: "checkbox", checked: isSelected, onChange: (e) => onSelect(e.target.checked), className: "size-4 rounded border-gray-300 text-blue-600 focus:ring-2 focus:ring-blue-500" }) }), _jsx("td", { className: "py-1 w-10", children: file && (_jsx(FileItem, { fileNode: file, className: "h-10" }, row.id)) }), _jsx("td", { className: "px-2 py-2 text-center", children: row.invoiceNo }), _jsx("td", { className: "px-2 py-2 text-center", children: row.issueDate }), _jsx("td", { className: "px-2 py-2 text-center", children: row.dueDate }), _jsx("td", { className: "px-2 py-2 text-center", children: row.currency }), _jsx("td", { className: "px-2 py-2 text-center", children: formatAmount(row.amount) }), (row.status === "ISSUED" ||
|
|
47
42
|
row.status === "ACCEPTED" ||
|
|
48
43
|
row.status === "PAYMENTSCHEDULED" ||
|
|
49
44
|
row.status === "PAYMENTRECEIVED" ||
|
|
50
45
|
row.status === "PAYMENTSENT") &&
|
|
51
|
-
!billingFile && (_jsx("td", { className: "px-2 py-2 text-center", children: _jsx("button", { className: "bg-white border border-gray-300 rounded px-3 py-1 text-sm hover:bg-gray-100 col-span-1 justify-self-end", onClick: () => onCreateBillingStatement?.(row.id), children: "Generate Billing Statement" }) })), billingFile && (_jsx("td", { className: "px-2 py-2 text-center", children: _jsx(FileItem, { fileNode: billingFile,
|
|
46
|
+
!billingFile && (_jsx("td", { className: "px-2 py-2 text-center", children: _jsx("button", { className: "bg-white border border-gray-300 rounded px-3 py-1 text-sm hover:bg-gray-100 col-span-1 justify-self-end", onClick: () => onCreateBillingStatement?.(row.id), children: "Generate Billing Statement" }) })), billingFile && (_jsx("td", { className: "px-2 py-2 text-center", children: _jsx(FileItem, { fileNode: billingFile, className: "h-10" }, billingDoc?.id) })), _jsx("td", { className: "px-2 py-2 text-center", children: hasExportedData ? (_jsxs("div", { className: "flex flex-col items-center", children: [_jsx("span", { className: "text-green-500", children: "Yes" }), _jsx("span", { className: "text-green-500 text-xs", children: formatTimestamp(row.exported.timestamp) })] })) : (_jsx("span", { className: "text-red-500", children: "No" })) })] }));
|
|
52
47
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { VetraDocumentModelModule } from "@powerhousedao/reactor-browser";
|
|
2
2
|
export declare const InvoiceTableSection: ({ title, count, children, color, onSelectDocumentModel, filteredDocumentModels, }: {
|
|
3
3
|
title: string;
|
|
4
4
|
count: number;
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
color?: string;
|
|
7
|
-
onSelectDocumentModel?: (model:
|
|
8
|
-
filteredDocumentModels?:
|
|
7
|
+
onSelectDocumentModel?: (model: VetraDocumentModelModule) => void;
|
|
8
|
+
filteredDocumentModels?: VetraDocumentModelModule[];
|
|
9
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
//# sourceMappingURL=InvoiceTableSection.d.ts.map
|
package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvoiceTableSection.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InvoiceTableSection.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE/E,eAAO,MAAM,mBAAmB,GAAI,mFAOjC;IACD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAClE,sBAAsB,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACrD,4CAsCA,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { useState } from "react";
|
|
|
3
3
|
import { ChevronDown, ChevronRight } from "lucide-react";
|
|
4
4
|
export const InvoiceTableSection = ({ title, count, children, color = "bg-blue-100 text-blue-600", onSelectDocumentModel, filteredDocumentModels, }) => {
|
|
5
5
|
const [isExpanded, setIsExpanded] = useState(true);
|
|
6
|
-
const invoiceDodModel = filteredDocumentModels?.find(model => model.
|
|
6
|
+
const invoiceDodModel = filteredDocumentModels?.find(model => model.id === "powerhouse/invoice");
|
|
7
7
|
return (_jsxs("div", { className: "mb-2", children: [_jsxs("div", { className: "grid grid-cols-2", children: [_jsxs("button", { onClick: () => setIsExpanded(!isExpanded), className: "w-full flex items-center gap-2 hover:opacity-80 transition-opacity col-span-1", children: [_jsx("span", { className: "font-medium", children: title }), _jsx("span", { className: `inline-flex items-center justify-center rounded-full text-xs font-bold px-2 ${color}`, children: count }), isExpanded ? (_jsx(ChevronDown, { className: "w-4 h-4 text-gray-900" })) : (_jsx(ChevronRight, { className: "w-4 h-4 text-gray-900" }))] }), title === "Draft" && (_jsx("button", { className: "bg-white border border-gray-300 rounded px-3 py-1 text-sm hover:bg-gray-100 col-span-1 justify-self-end", onClick: () => {
|
|
8
8
|
onSelectDocumentModel?.(invoiceDodModel);
|
|
9
9
|
}, children: "Create Invoice" }))] }), isExpanded && _jsx("div", { className: "mt-2", children: children })] }));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../editors/contributor-billing/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,YAAY,EAAE,mBAM1B,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import type { EditorProps } from "document-model";
|
|
2
|
+
export default function Editor(props: EditorProps): import("react/jsx-runtime").JSX.Element;
|
|
2
3
|
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/contributor-billing/editor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/contributor-billing/editor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,2CAG9C"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { DriveExplorer } from "./components/DriveExplorer.js";
|
|
3
|
-
|
|
3
|
+
import { useSetPHDriveEditorConfig } from "@powerhousedao/reactor-browser";
|
|
4
|
+
import { editorConfig } from "./config.js";
|
|
5
|
+
export default function Editor(props) {
|
|
6
|
+
useSetPHDriveEditorConfig(editorConfig);
|
|
7
|
+
return _jsx(DriveExplorer, { ...props });
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../editors/contributor-billing/module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,eAAO,MAAM,kBAAkB,EAAE,YAOhC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editors.d.ts","sourceRoot":"","sources":["../../editors/editors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAOnD,eAAO,MAAM,OAAO,EAAE,YAAY,EAMjC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BillingStatement } from "./billing-statement/module.js";
|
|
2
|
+
import { ContributorBilling } from "./contributor-billing/module.js";
|
|
3
|
+
import { ExpenseReport } from "./expense-report/module.js";
|
|
4
|
+
import { Integrations } from "./integrations/module.js";
|
|
5
|
+
import { Invoice } from "./invoice/module.js";
|
|
6
|
+
export const editors = [
|
|
7
|
+
BillingStatement,
|
|
8
|
+
ContributorBilling,
|
|
9
|
+
ExpenseReport,
|
|
10
|
+
Integrations,
|
|
11
|
+
Invoice,
|
|
12
|
+
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useMemo } from "react";
|
|
3
3
|
import { Button } from "@powerhousedao/document-engineering";
|
|
4
|
-
import {
|
|
4
|
+
import { useDocumentsInSelectedDrive } from "@powerhousedao/reactor-browser";
|
|
5
5
|
import { generateId } from "document-model";
|
|
6
6
|
import { X, FileText, Check } from "lucide-react";
|
|
7
7
|
import { actions } from "../../../document-models/expense-report/index.js";
|
|
@@ -34,7 +34,7 @@ const fusionLabelToValue = {
|
|
|
34
34
|
Equity: "equity/retained",
|
|
35
35
|
};
|
|
36
36
|
export function AddBillingStatementModal({ isOpen, onClose, walletAddress, dispatch, groups, }) {
|
|
37
|
-
const documents =
|
|
37
|
+
const documents = useDocumentsInSelectedDrive();
|
|
38
38
|
const [selectedStatements, setSelectedStatements] = useState(new Set());
|
|
39
39
|
const [searchTerm, setSearchTerm] = useState("");
|
|
40
40
|
// Get already added billing statement IDs for this wallet from documents
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletsTable.d.ts","sourceRoot":"","sources":["../../../../editors/expense-report/components/WalletsTable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WalletsTable.d.ts","sourceRoot":"","sources":["../../../../editors/expense-report/components/WalletsTable.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACd,MAAM,sDAAsD,CAAC;AAK9D,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,qBAAqB,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,QAAQ,EAAE,GAAG,CAAC;CACf;AAED,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,MAAM,EACN,qBAAqB,EACrB,QAAQ,GACT,EAAE,iBAAiB,2CAmdnB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { Button, TextInput } from "@powerhousedao/document-engineering";
|
|
4
|
-
import { Plus, Trash2, Pencil, Check, X, Copy, CheckCheck, RefreshCw } from "lucide-react";
|
|
4
|
+
import { Plus, Trash2, Pencil, Check, X, Copy, CheckCheck, RefreshCw, } from "lucide-react";
|
|
5
5
|
import { actions } from "../../../document-models/expense-report/index.js";
|
|
6
6
|
import { useWalletSync } from "../hooks/useWalletSync.js";
|
|
7
7
|
import { useSyncWallet } from "../hooks/useSyncWallet.js";
|
|
@@ -21,7 +21,7 @@ export function WalletsTable({ wallets, groups, onAddBillingStatement, dispatch,
|
|
|
21
21
|
const trimmedAddress = newWalletAddress.trim();
|
|
22
22
|
if (trimmedAddress) {
|
|
23
23
|
// Check if wallet already exists
|
|
24
|
-
const walletExists = wallets.some(w => w.wallet === trimmedAddress);
|
|
24
|
+
const walletExists = wallets.some((w) => w.wallet === trimmedAddress);
|
|
25
25
|
if (walletExists) {
|
|
26
26
|
setWalletError("This wallet already exists");
|
|
27
27
|
return;
|
|
@@ -40,7 +40,7 @@ export function WalletsTable({ wallets, groups, onAddBillingStatement, dispatch,
|
|
|
40
40
|
setEditingName(wallet.name || "");
|
|
41
41
|
};
|
|
42
42
|
const handleSaveEditName = (walletAddress) => {
|
|
43
|
-
const wallet = wallets.find(w => w.wallet === walletAddress);
|
|
43
|
+
const wallet = wallets.find((w) => w.wallet === walletAddress);
|
|
44
44
|
const trimmedName = editingName.trim();
|
|
45
45
|
// Only update if the name has changed
|
|
46
46
|
if (trimmedName && wallet && trimmedName !== (wallet.name || "")) {
|
|
@@ -67,7 +67,9 @@ export function WalletsTable({ wallets, groups, onAddBillingStatement, dispatch,
|
|
|
67
67
|
return `${address.substring(0, 6)}...${address.substring(address.length - 5)}`;
|
|
68
68
|
};
|
|
69
69
|
const handleSyncWallet = async (wallet) => {
|
|
70
|
-
if (!wallet.wallet ||
|
|
70
|
+
if (!wallet.wallet ||
|
|
71
|
+
!wallet.billingStatements ||
|
|
72
|
+
wallet.billingStatements.length === 0) {
|
|
71
73
|
return;
|
|
72
74
|
}
|
|
73
75
|
setSyncingWallet(wallet.wallet);
|
|
@@ -125,7 +127,7 @@ export function WalletsTable({ wallets, groups, onAddBillingStatement, dispatch,
|
|
|
125
127
|
return (_jsxs("div", { className: "space-y-4", children: [wallets.length > 0 ? (_jsx("div", { className: "overflow-x-auto", children: _jsxs("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [_jsx("thead", { className: "bg-gray-50 dark:bg-gray-800", children: _jsxs("tr", { children: [_jsx("th", { className: "px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider", children: "Wallet" }), _jsx("th", { className: "px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider", children: "Monthly Budget" }), _jsx("th", { className: "px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider", children: "Forecast" }), _jsx("th", { className: "px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider", children: _jsxs("div", { className: "flex items-center justify-end gap-2", children: [needsSync && (_jsx("button", { onClick: () => {
|
|
126
128
|
// Sync all outdated wallets
|
|
127
129
|
[...tagChangedWallets, ...outdatedWallets].forEach((walletAddress) => {
|
|
128
|
-
const wallet = wallets.find(w => w.wallet === walletAddress);
|
|
130
|
+
const wallet = wallets.find((w) => w.wallet === walletAddress);
|
|
129
131
|
if (wallet) {
|
|
130
132
|
handleSyncWallet(wallet);
|
|
131
133
|
}
|
|
@@ -144,11 +146,14 @@ export function WalletsTable({ wallets, groups, onAddBillingStatement, dispatch,
|
|
|
144
146
|
else if (e.key === "Escape") {
|
|
145
147
|
handleCancelEditName();
|
|
146
148
|
}
|
|
147
|
-
}, autoFocus: true }), _jsx("button", { onClick: () => handleSaveEditName(wallet.wallet || ""), className: "inline-flex items-center justify-center w-7 h-7 text-green-600 dark:text-green-400 hover:bg-green-50 dark:hover:bg-green-900/20 rounded-md transition-colors", title: "Save", children: _jsx(Check, { size: 14 }) }), _jsx("button", { onClick: handleCancelEditName, className: "inline-flex items-center justify-center w-7 h-7 text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-900/20 rounded-md transition-colors", title: "Cancel", children: _jsx(X, { size: 14 }) })] })) : (_jsxs("div", { className: "flex items-center gap-
|
|
149
|
+
}, autoFocus: true }), _jsx("button", { onClick: () => handleSaveEditName(wallet.wallet || ""), className: "inline-flex items-center justify-center w-7 h-7 text-green-600 dark:text-green-400 hover:bg-green-50 dark:hover:bg-green-900/20 rounded-md transition-colors", title: "Save", children: _jsx(Check, { size: 14 }) }), _jsx("button", { onClick: handleCancelEditName, className: "inline-flex items-center justify-center w-7 h-7 text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-900/20 rounded-md transition-colors", title: "Cancel", children: _jsx(X, { size: 14 }) })] })) : (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-white", children: wallet.name || "Unnamed Wallet" }), _jsx("button", { onClick: () => handleStartEditName(wallet), className: "inline-flex items-center justify-center w-6 h-6 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors", title: "Edit name", children: _jsx(Pencil, { size: 12 }) }), _jsxs("button", { onClick: () => handleCopyAddress(wallet.wallet || ""), className: "inline-flex items-center gap-1 px-2 py-1 text-xs text-gray-500 dark:text-gray-400 font-mono hover:bg-gray-100 dark:hover:bg-gray-700 rounded transition-colors", title: `Copy address: ${wallet.wallet}`, children: [formatAddress(wallet.wallet || ""), copiedWallet === wallet.wallet ? (_jsx(CheckCheck, { size: 12, className: "text-green-500" })) : (_jsx(Copy, { size: 12 }))] })] })) }), _jsx("td", { className: "px-6 py-4 whitespace-nowrap text-right text-sm text-gray-900 dark:text-white", children: formatCurrency(totals.budget) }), _jsx("td", { className: "px-6 py-4 whitespace-nowrap text-right text-sm text-gray-900 dark:text-white", children: formatCurrency(totals.forecast) }), _jsx("td", { className: "px-6 py-4 whitespace-nowrap text-right text-sm", children: totals.actuals === 0 &&
|
|
150
|
+
(!wallet.billingStatements ||
|
|
151
|
+
wallet.billingStatements.length === 0) ? (
|
|
148
152
|
// When actuals is 0 and no billing statements, only show the Add Bills button
|
|
149
153
|
_jsx("div", { className: "flex items-center justify-end", children: _jsxs("button", { onClick: () => onAddBillingStatement(wallet.wallet || ""), className: "inline-flex items-center gap-1 px-3 py-1 text-sm font-medium text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30 rounded-md transition-colors", title: "Add billing statement for this wallet", children: [_jsx(Plus, { size: 16 }), _jsx("span", { children: "Add Bills" })] }) })) : (
|
|
150
154
|
// When actuals is not 0 or has billing statements, show compact buttons + value horizontally
|
|
151
|
-
_jsxs("div", { className: "flex items-center justify-end gap-2", children: [_jsx("button", { onClick: () => onAddBillingStatement(wallet.wallet || ""), className: "inline-flex items-center justify-center w-8 h-8 text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30 rounded-md transition-colors", title: "Add billing statement for this wallet", children: _jsx(Plus, { size: 16 }) }), wallet.billingStatements &&
|
|
155
|
+
_jsxs("div", { className: "flex items-center justify-end gap-2", children: [_jsx("button", { onClick: () => onAddBillingStatement(wallet.wallet || ""), className: "inline-flex items-center justify-center w-8 h-8 text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30 rounded-md transition-colors", title: "Add billing statement for this wallet", children: _jsx(Plus, { size: 16 }) }), wallet.billingStatements &&
|
|
156
|
+
wallet.billingStatements.length > 0 && (_jsx("button", { onClick: () => handleSyncWallet(wallet), disabled: syncingWallet === wallet.wallet, className: `inline-flex items-center justify-center w-8 h-8 rounded-md transition-colors ${tagChangedWallets.includes(wallet.wallet || "")
|
|
152
157
|
? "text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 hover:bg-red-100 dark:hover:bg-red-900/30 animate-pulse"
|
|
153
158
|
: outdatedWallets.includes(wallet.wallet || "")
|
|
154
159
|
? "text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20 hover:bg-amber-100 dark:hover:bg-amber-900/30 animate-pulse"
|
|
@@ -156,7 +161,9 @@ export function WalletsTable({ wallets, groups, onAddBillingStatement, dispatch,
|
|
|
156
161
|
? "ALERT: Tags have changed - sync required!"
|
|
157
162
|
: outdatedWallets.includes(wallet.wallet || "")
|
|
158
163
|
? "Sync needed - billing statements updated"
|
|
159
|
-
: "Sync with latest billing statements", children: _jsx(RefreshCw, { size: 16, className: syncingWallet === wallet.wallet
|
|
164
|
+
: "Sync with latest billing statements", children: _jsx(RefreshCw, { size: 16, className: syncingWallet === wallet.wallet
|
|
165
|
+
? "animate-spin"
|
|
166
|
+
: "" }) })), _jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-white", children: formatCurrency(totals.actuals) })] })) }), _jsx("td", { className: `px-6 py-4 whitespace-nowrap text-right text-sm font-medium ${totals.difference > 0
|
|
160
167
|
? "text-red-600 dark:text-red-400"
|
|
161
168
|
: totals.difference < 0
|
|
162
169
|
? "text-green-600 dark:text-green-400"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../editors/expense-report/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,eAAO,MAAM,YAAY,EAAE,sBAE1B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export default function Editor(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/expense-report/editor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/expense-report/editor.tsx"],"names":[],"mappings":"AAgBA,MAAM,CAAC,OAAO,UAAU,MAAM,4CA+M7B"}
|
|
@@ -8,7 +8,10 @@ import { AggregatedExpensesTable } from "./components/AggregatedExpensesTable.js
|
|
|
8
8
|
import { AddBillingStatementModal } from "./components/AddBillingStatementModal.js";
|
|
9
9
|
import { ExpenseReportPDF } from "./components/ExpenseReportPDF.js";
|
|
10
10
|
import { pdf } from "@react-pdf/renderer";
|
|
11
|
-
|
|
11
|
+
import { PDFViewer } from "@react-pdf/renderer";
|
|
12
|
+
import { DocumentToolbar } from "@powerhousedao/design-system/connect";
|
|
13
|
+
import { setSelectedNode, useParentFolderForSelectedNode, } from "@powerhousedao/reactor-browser";
|
|
14
|
+
export default function Editor() {
|
|
12
15
|
const [document, dispatch] = useSelectedExpenseReportDocument();
|
|
13
16
|
const [selectedWallet, setSelectedWallet] = useState(null);
|
|
14
17
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
@@ -50,7 +53,7 @@ export function Editor() {
|
|
|
50
53
|
link.href = url;
|
|
51
54
|
// Generate filename with period
|
|
52
55
|
const filename = periodStart
|
|
53
|
-
? `expense-report-${new Date(periodStart).toISOString().split(
|
|
56
|
+
? `expense-report-${new Date(periodStart).toISOString().split("T")[0]}.pdf`
|
|
54
57
|
: "expense-report.pdf";
|
|
55
58
|
link.download = filename;
|
|
56
59
|
link.click();
|
|
@@ -70,5 +73,11 @@ export function Editor() {
|
|
|
70
73
|
const year = date.getFullYear();
|
|
71
74
|
return `${month} ${year} Breakdown`;
|
|
72
75
|
}, [periodStart]);
|
|
73
|
-
|
|
76
|
+
// Get the parent folder node for the currently selected node
|
|
77
|
+
const parentFolder = useParentFolderForSelectedNode();
|
|
78
|
+
// Set the selected node to the parent folder node (close the editor)
|
|
79
|
+
function handleClose() {
|
|
80
|
+
setSelectedNode(parentFolder?.id);
|
|
81
|
+
}
|
|
82
|
+
return (_jsxs("div", { children: [_jsx(DocumentToolbar, { document: document, onClose: handleClose }), _jsxs("div", { className: "ph-default-styles flex flex-col h-full w-full bg-gray-50 dark:bg-gray-900", children: [_jsx("div", { className: "flex-1 overflow-auto px-8 py-6", children: _jsxs("div", { className: "max-w-7xl mx-auto space-y-8", children: [_jsx("section", { className: "bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700", children: _jsx("div", { className: "px-6 py-6", children: _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "text-center", children: [_jsx("h1", { className: "text-3xl font-bold text-gray-900 dark:text-white mb-4", children: "Expense Report" }), _jsx("div", { className: "flex items-center justify-center gap-4 text-sm text-gray-600 dark:text-gray-400", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "font-medium", children: "Period:" }), _jsx(DatePicker, { name: "periodStart", value: periodStart, onChange: handlePeriodStartChange, className: "bg-white" }), _jsx("span", { children: "to" }), _jsx(DatePicker, { name: "periodEnd", value: periodEnd, onChange: handlePeriodEndChange, className: "bg-white" })] }) })] }), _jsxs(Button, { variant: "ghost", onClick: handleExportPDF, className: "absolute top-0 right-0 flex items-center gap-2", children: [_jsx(Icon, { name: "ExportPdf", size: 18 }), "Export to PDF"] })] }) }) }), _jsxs("section", { className: "bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700", children: [_jsx("div", { className: "px-6 py-4 border-b border-gray-200 dark:border-gray-700", children: _jsx("h2", { className: "text-xl font-semibold text-gray-900 dark:text-white", children: "Wallets" }) }), _jsx("div", { className: "p-6", children: _jsx(WalletsTable, { wallets: wallets, groups: groups, onAddBillingStatement: handleAddBillingStatement, dispatch: dispatch }) })] }), wallets.length > 0 && (_jsxs("section", { className: "bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700", children: [_jsx("div", { className: "px-6 py-4 border-b border-gray-200 dark:border-gray-700", children: _jsx("h2", { className: "text-xl font-semibold text-gray-900 dark:text-white", children: breakdownTitle }) }), _jsx("div", { className: "p-6", children: _jsx(AggregatedExpensesTable, { wallets: wallets, groups: groups, periodStart: periodStart, periodEnd: periodEnd, dispatch: dispatch }) })] }))] }) }), isModalOpen && selectedWallet && (_jsx(AddBillingStatementModal, { isOpen: isModalOpen, onClose: handleCloseModal, walletAddress: selectedWallet, dispatch: dispatch, groups: groups }))] })] }));
|
|
74
83
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useDocumentsInSelectedDrive } from "@powerhousedao/reactor-browser";
|
|
2
2
|
import { actions } from "../../../document-models/expense-report/index.js";
|
|
3
3
|
import { generateId } from "document-model";
|
|
4
4
|
export function useSyncWallet() {
|
|
5
|
-
const documents =
|
|
5
|
+
const documents = useDocumentsInSelectedDrive();
|
|
6
6
|
const syncWallet = (walletAddress, billingStatementIds, groups, dispatch) => {
|
|
7
7
|
if (!documents)
|
|
8
8
|
return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { useDocumentsInSelectedDrive } from "@powerhousedao/reactor-browser";
|
|
3
3
|
export function useWalletSync(wallets) {
|
|
4
|
-
const documents =
|
|
4
|
+
const documents = useDocumentsInSelectedDrive();
|
|
5
5
|
const syncStatus = useMemo(() => {
|
|
6
6
|
if (!documents || wallets.length === 0) {
|
|
7
7
|
return { needsSync: false, outdatedWallets: [], tagChangedWallets: [] };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../editors/expense-report/module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,eAAO,MAAM,aAAa,EAAE,YAO3B,CAAC"}
|