@hub-kit/core 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +125 -0
- package/cli/hub-kit.mjs +112 -0
- package/dist/adapters/bank-reconciliation.d.ts +100 -0
- package/dist/adapters/bank-reconciliation.js +1 -0
- package/dist/adapters/bank-sync-log.d.ts +46 -0
- package/dist/adapters/bank-sync-log.js +1 -0
- package/dist/adapters/category-rules.d.ts +94 -0
- package/dist/adapters/category-rules.js +1 -0
- package/dist/adapters/companies.d.ts +85 -0
- package/dist/adapters/companies.js +3 -0
- package/dist/adapters/customers.d.ts +71 -0
- package/dist/adapters/customers.js +1 -0
- package/dist/adapters/exclusion-rules.d.ts +34 -0
- package/dist/adapters/exclusion-rules.js +15 -0
- package/dist/adapters/file-naming.d.ts +36 -0
- package/dist/adapters/file-naming.js +1 -0
- package/dist/adapters/index.d.ts +24 -0
- package/dist/adapters/index.js +1 -0
- package/dist/adapters/invoice-detail.d.ts +126 -0
- package/dist/adapters/invoice-detail.js +1 -0
- package/dist/adapters/invoice-list.d.ts +63 -0
- package/dist/adapters/invoice-list.js +1 -0
- package/dist/adapters/invoice-upload.d.ts +26 -0
- package/dist/adapters/invoice-upload.js +1 -0
- package/dist/adapters/manual-bookings.d.ts +56 -0
- package/dist/adapters/manual-bookings.js +1 -0
- package/dist/adapters/notifications.d.ts +31 -0
- package/dist/adapters/notifications.js +1 -0
- package/dist/adapters/open-items.d.ts +42 -0
- package/dist/adapters/open-items.js +1 -0
- package/dist/adapters/opos-whitelist.d.ts +38 -0
- package/dist/adapters/opos-whitelist.js +1 -0
- package/dist/adapters/outgoing-invoices.d.ts +32 -0
- package/dist/adapters/outgoing-invoices.js +1 -0
- package/dist/adapters/overview.d.ts +68 -0
- package/dist/adapters/overview.js +1 -0
- package/dist/adapters/processing-log.d.ts +48 -0
- package/dist/adapters/processing-log.js +1 -0
- package/dist/adapters/properties.d.ts +87 -0
- package/dist/adapters/properties.js +1 -0
- package/dist/adapters/supplier-detail.d.ts +64 -0
- package/dist/adapters/supplier-detail.js +1 -0
- package/dist/adapters/supplier-list.d.ts +21 -0
- package/dist/adapters/supplier-list.js +1 -0
- package/dist/adapters/team.d.ts +79 -0
- package/dist/adapters/team.js +1 -0
- package/dist/adapters/trash.d.ts +26 -0
- package/dist/adapters/trash.js +1 -0
- package/dist/adapters/vat-rules.d.ts +83 -0
- package/dist/adapters/vat-rules.js +1 -0
- package/dist/components/access/index.d.ts +3 -0
- package/dist/components/access/index.js +3 -0
- package/dist/components/access/permission-checklist.d.ts +13 -0
- package/dist/components/access/permission-checklist.js +19 -0
- package/dist/components/access/permission-matrix.d.ts +12 -0
- package/dist/components/access/permission-matrix.js +18 -0
- package/dist/components/access/types.d.ts +15 -0
- package/dist/components/access/types.js +1 -0
- package/dist/components/dashboard/date-range-calendar.d.ts +19 -0
- package/dist/components/dashboard/date-range-calendar.js +97 -0
- package/dist/components/dashboard/index.d.ts +23 -0
- package/dist/components/dashboard/index.js +14 -0
- package/dist/components/dashboard/kpi-card.d.ts +13 -0
- package/dist/components/dashboard/kpi-card.js +7 -0
- package/dist/components/dashboard/money-cards-row.d.ts +29 -0
- package/dist/components/dashboard/money-cards-row.js +28 -0
- package/dist/components/dashboard/money-trend-chart.d.ts +13 -0
- package/dist/components/dashboard/money-trend-chart.js +16 -0
- package/dist/components/dashboard/panel.d.ts +9 -0
- package/dist/components/dashboard/panel.js +5 -0
- package/dist/components/dashboard/period-picker.d.ts +25 -0
- package/dist/components/dashboard/period-picker.js +82 -0
- package/dist/components/dashboard/periods.d.ts +13 -0
- package/dist/components/dashboard/periods.js +63 -0
- package/dist/components/dashboard/pipeline-stages-panel.d.ts +14 -0
- package/dist/components/dashboard/pipeline-stages-panel.js +12 -0
- package/dist/components/dashboard/processing-summary-panel.d.ts +34 -0
- package/dist/components/dashboard/processing-summary-panel.js +11 -0
- package/dist/components/dashboard/ranked-bars.d.ts +15 -0
- package/dist/components/dashboard/ranked-bars.js +16 -0
- package/dist/components/dashboard/ranked-list-panel.d.ts +14 -0
- package/dist/components/dashboard/ranked-list-panel.js +9 -0
- package/dist/components/dashboard/stage-tiles.d.ts +15 -0
- package/dist/components/dashboard/stage-tiles.js +6 -0
- package/dist/components/dashboard/stat-rows-panel.d.ts +25 -0
- package/dist/components/dashboard/stat-rows-panel.js +7 -0
- package/dist/components/dashboard/stat-tile.d.ts +20 -0
- package/dist/components/dashboard/stat-tile.js +9 -0
- package/dist/components/feedback/index.d.ts +4 -0
- package/dist/components/feedback/index.js +2 -0
- package/dist/components/feedback/query-states.d.ts +27 -0
- package/dist/components/feedback/query-states.js +38 -0
- package/dist/components/feedback/table-pagination.d.ts +20 -0
- package/dist/components/feedback/table-pagination.js +15 -0
- package/dist/components/invoice-queue/index.d.ts +5 -0
- package/dist/components/invoice-queue/index.js +3 -0
- package/dist/components/invoice-queue/next-action-cell.d.ts +5 -0
- package/dist/components/invoice-queue/next-action-cell.js +9 -0
- package/dist/components/invoice-queue/queue-kpi-card.d.ts +19 -0
- package/dist/components/invoice-queue/queue-kpi-card.js +31 -0
- package/dist/components/invoice-queue/queue-kpi-row.d.ts +22 -0
- package/dist/components/invoice-queue/queue-kpi-row.js +12 -0
- package/dist/components/notifications/alerts.d.ts +25 -0
- package/dist/components/notifications/alerts.js +66 -0
- package/dist/components/notifications/bell.d.ts +14 -0
- package/dist/components/notifications/bell.js +17 -0
- package/dist/components/notifications/highlight.d.ts +4 -0
- package/dist/components/notifications/highlight.js +7 -0
- package/dist/components/notifications/index.d.ts +7 -0
- package/dist/components/notifications/index.js +6 -0
- package/dist/components/notifications/reminder-dialog.d.ts +24 -0
- package/dist/components/notifications/reminder-dialog.js +54 -0
- package/dist/components/notifications/types.d.ts +27 -0
- package/dist/components/notifications/types.js +1 -0
- package/dist/components/notifications/use-notification-acks.d.ts +7 -0
- package/dist/components/notifications/use-notification-acks.js +37 -0
- package/dist/components/shell/breadcrumbs.d.ts +7 -0
- package/dist/components/shell/breadcrumbs.js +38 -0
- package/dist/components/shell/index.d.ts +3 -0
- package/dist/components/shell/index.js +3 -0
- package/dist/components/shell/shell.d.ts +30 -0
- package/dist/components/shell/shell.js +110 -0
- package/dist/components/shell/types.d.ts +23 -0
- package/dist/components/shell/types.js +3 -0
- package/dist/components/tour/find-target.d.ts +1 -0
- package/dist/components/tour/find-target.js +3 -0
- package/dist/components/tour/index.d.ts +14 -0
- package/dist/components/tour/index.js +8 -0
- package/dist/components/tour/labels.d.ts +10 -0
- package/dist/components/tour/labels.js +9 -0
- package/dist/components/tour/seen-store.d.ts +3 -0
- package/dist/components/tour/seen-store.js +34 -0
- package/dist/components/tour/tour-blocks.d.ts +4 -0
- package/dist/components/tour/tour-blocks.js +27 -0
- package/dist/components/tour/tour-button.d.ts +4 -0
- package/dist/components/tour/tour-button.js +12 -0
- package/dist/components/tour/tour-card.d.ts +11 -0
- package/dist/components/tour/tour-card.js +7 -0
- package/dist/components/tour/tour-context.d.ts +16 -0
- package/dist/components/tour/tour-context.js +2 -0
- package/dist/components/tour/tour-overlay.d.ts +1 -0
- package/dist/components/tour/tour-overlay.js +165 -0
- package/dist/components/tour/tour-provider.d.ts +9 -0
- package/dist/components/tour/tour-provider.js +80 -0
- package/dist/components/tour/types.d.ts +44 -0
- package/dist/components/tour/types.js +1 -0
- package/dist/components/tour/use-tour.d.ts +3 -0
- package/dist/components/tour/use-tour.js +9 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/i18n/index.d.ts +15 -0
- package/dist/i18n/index.js +15 -0
- package/dist/lib/bank-import/classify.d.ts +8 -0
- package/dist/lib/bank-import/classify.js +89 -0
- package/dist/lib/bank-import/column-guess.d.ts +2 -0
- package/dist/lib/bank-import/column-guess.js +40 -0
- package/dist/lib/bank-import/csv.d.ts +3 -0
- package/dist/lib/bank-import/csv.js +20 -0
- package/dist/lib/bank-import/duplicates.d.ts +2 -0
- package/dist/lib/bank-import/duplicates.js +21 -0
- package/dist/lib/bank-import/index.d.ts +12 -0
- package/dist/lib/bank-import/index.js +9 -0
- package/dist/lib/bank-import/mapping-storage.d.ts +3 -0
- package/dist/lib/bank-import/mapping-storage.js +29 -0
- package/dist/lib/bank-import/normalize.d.ts +4 -0
- package/dist/lib/bank-import/normalize.js +82 -0
- package/dist/lib/bank-import/parse-file.d.ts +7 -0
- package/dist/lib/bank-import/parse-file.js +23 -0
- package/dist/lib/bank-import/types.d.ts +31 -0
- package/dist/lib/bank-import/types.js +1 -0
- package/dist/lib/bank-import/xlsx.d.ts +2 -0
- package/dist/lib/bank-import/xlsx.js +25 -0
- package/dist/lib/class-names.d.ts +2 -0
- package/dist/lib/class-names.js +5 -0
- package/dist/lib/download.d.ts +2 -0
- package/dist/lib/download.js +14 -0
- package/dist/lib/formatters.d.ts +6 -0
- package/dist/lib/formatters.js +24 -0
- package/dist/lib/index.d.ts +9 -0
- package/dist/lib/index.js +6 -0
- package/dist/lib/opos-whitelist/index.d.ts +2 -0
- package/dist/lib/opos-whitelist/index.js +1 -0
- package/dist/lib/opos-whitelist/opos.d.ts +14 -0
- package/dist/lib/opos-whitelist/opos.js +49 -0
- package/dist/lib/query-result.d.ts +12 -0
- package/dist/lib/query-result.js +1 -0
- package/dist/lib/tour-placeholders/index.d.ts +2 -0
- package/dist/lib/tour-placeholders/index.js +1 -0
- package/dist/lib/tour-placeholders/overview.d.ts +12 -0
- package/dist/lib/tour-placeholders/overview.js +139 -0
- package/dist/pages/bank-accounts/BankAccountsPage.d.ts +7 -0
- package/dist/pages/bank-accounts/BankAccountsPage.js +21 -0
- package/dist/pages/bank-accounts/index.d.ts +4 -0
- package/dist/pages/bank-accounts/index.js +2 -0
- package/dist/pages/bank-accounts/labels.d.ts +15 -0
- package/dist/pages/bank-accounts/labels.js +14 -0
- package/dist/pages/bank-import/BankImportWizard.d.ts +9 -0
- package/dist/pages/bank-import/BankImportWizard.js +158 -0
- package/dist/pages/bank-import/index.d.ts +4 -0
- package/dist/pages/bank-import/index.js +2 -0
- package/dist/pages/bank-import/labels.d.ts +44 -0
- package/dist/pages/bank-import/labels.js +43 -0
- package/dist/pages/bank-sync-log/BankSyncLogPage.d.ts +7 -0
- package/dist/pages/bank-sync-log/BankSyncLogPage.js +77 -0
- package/dist/pages/bank-sync-log/index.d.ts +4 -0
- package/dist/pages/bank-sync-log/index.js +2 -0
- package/dist/pages/bank-sync-log/labels.d.ts +21 -0
- package/dist/pages/bank-sync-log/labels.js +20 -0
- package/dist/pages/bank-transactions/BankMatchPanel.d.ts +8 -0
- package/dist/pages/bank-transactions/BankMatchPanel.js +75 -0
- package/dist/pages/bank-transactions/BankTransactionsPage.d.ts +7 -0
- package/dist/pages/bank-transactions/BankTransactionsPage.js +59 -0
- package/dist/pages/bank-transactions/badges.d.ts +8 -0
- package/dist/pages/bank-transactions/badges.js +24 -0
- package/dist/pages/bank-transactions/index.d.ts +6 -0
- package/dist/pages/bank-transactions/index.js +4 -0
- package/dist/pages/bank-transactions/labels.d.ts +41 -0
- package/dist/pages/bank-transactions/labels.js +40 -0
- package/dist/pages/bank-transactions/sort-control.d.ts +17 -0
- package/dist/pages/bank-transactions/sort-control.js +8 -0
- package/dist/pages/bank-transactions/use-table-view.d.ts +23 -0
- package/dist/pages/bank-transactions/use-table-view.js +54 -0
- package/dist/pages/category-rules/CategoryRulesPage.d.ts +7 -0
- package/dist/pages/category-rules/CategoryRulesPage.js +160 -0
- package/dist/pages/category-rules/index.d.ts +4 -0
- package/dist/pages/category-rules/index.js +2 -0
- package/dist/pages/category-rules/labels.d.ts +66 -0
- package/dist/pages/category-rules/labels.js +72 -0
- package/dist/pages/companies/company-detail-page.d.ts +10 -0
- package/dist/pages/companies/company-detail-page.js +184 -0
- package/dist/pages/companies/company-form.d.ts +20 -0
- package/dist/pages/companies/company-form.js +23 -0
- package/dist/pages/companies/company-list-page.d.ts +9 -0
- package/dist/pages/companies/company-list-page.js +109 -0
- package/dist/pages/companies/known-spellings-card.d.ts +8 -0
- package/dist/pages/companies/known-spellings-card.js +65 -0
- package/dist/pages/companies/labels.d.ts +105 -0
- package/dist/pages/companies/labels.js +104 -0
- package/dist/pages/companies/sort-control.d.ts +17 -0
- package/dist/pages/companies/sort-control.js +8 -0
- package/dist/pages/companies/use-infinite-rows.d.ts +6 -0
- package/dist/pages/companies/use-infinite-rows.js +24 -0
- package/dist/pages/companies/use-table-view.d.ts +23 -0
- package/dist/pages/companies/use-table-view.js +56 -0
- package/dist/pages/customers/company-chip.d.ts +6 -0
- package/dist/pages/customers/company-chip.js +9 -0
- package/dist/pages/customers/copy-button.d.ts +6 -0
- package/dist/pages/customers/copy-button.js +31 -0
- package/dist/pages/customers/customer-detail-page.d.ts +10 -0
- package/dist/pages/customers/customer-detail-page.js +83 -0
- package/dist/pages/customers/customer-list-page.d.ts +9 -0
- package/dist/pages/customers/customer-list-page.js +65 -0
- package/dist/pages/customers/edit-customer-dialog.d.ts +9 -0
- package/dist/pages/customers/edit-customer-dialog.js +72 -0
- package/dist/pages/customers/form-hints.d.ts +6 -0
- package/dist/pages/customers/form-hints.js +9 -0
- package/dist/pages/customers/invoice-status-badge.d.ts +10 -0
- package/dist/pages/customers/invoice-status-badge.js +22 -0
- package/dist/pages/customers/labels.d.ts +116 -0
- package/dist/pages/customers/labels.js +117 -0
- package/dist/pages/customers/new-customer-dialog.d.ts +6 -0
- package/dist/pages/customers/new-customer-dialog.js +93 -0
- package/dist/pages/customers/sort-control.d.ts +14 -0
- package/dist/pages/customers/sort-control.js +9 -0
- package/dist/pages/customers/use-table-view.d.ts +23 -0
- package/dist/pages/customers/use-table-view.js +56 -0
- package/dist/pages/exclusion-rules/exclusion-rules-page.d.ts +7 -0
- package/dist/pages/exclusion-rules/exclusion-rules-page.js +114 -0
- package/dist/pages/exclusion-rules/labels.d.ts +53 -0
- package/dist/pages/exclusion-rules/labels.js +61 -0
- package/dist/pages/file-naming/build-filename.d.ts +3 -0
- package/dist/pages/file-naming/build-filename.js +82 -0
- package/dist/pages/file-naming/file-naming-page.d.ts +10 -0
- package/dist/pages/file-naming/file-naming-page.js +120 -0
- package/dist/pages/file-naming/labels.d.ts +44 -0
- package/dist/pages/file-naming/labels.js +44 -0
- package/dist/pages/index.d.ts +63 -0
- package/dist/pages/index.js +48 -0
- package/dist/pages/invoice-detail/InvoiceDetailPage.d.ts +11 -0
- package/dist/pages/invoice-detail/InvoiceDetailPage.js +292 -0
- package/dist/pages/invoice-detail/OutgoingInvoiceFlag.d.ts +26 -0
- package/dist/pages/invoice-detail/OutgoingInvoiceFlag.js +16 -0
- package/dist/pages/invoice-detail/ReviewBadge.d.ts +15 -0
- package/dist/pages/invoice-detail/ReviewBadge.js +23 -0
- package/dist/pages/invoice-detail/ReviewCard.d.ts +17 -0
- package/dist/pages/invoice-detail/ReviewCard.js +12 -0
- package/dist/pages/invoice-detail/SideBySide.d.ts +5 -0
- package/dist/pages/invoice-detail/SideBySide.js +5 -0
- package/dist/pages/invoice-detail/WorkflowHistoryList.d.ts +23 -0
- package/dist/pages/invoice-detail/WorkflowHistoryList.js +32 -0
- package/dist/pages/invoice-detail/WorkflowLadder.d.ts +20 -0
- package/dist/pages/invoice-detail/WorkflowLadder.js +16 -0
- package/dist/pages/invoice-detail/history.d.ts +23 -0
- package/dist/pages/invoice-detail/history.js +76 -0
- package/dist/pages/invoice-detail/index.d.ts +21 -0
- package/dist/pages/invoice-detail/index.js +11 -0
- package/dist/pages/invoice-detail/labels.d.ts +79 -0
- package/dist/pages/invoice-detail/labels.js +139 -0
- package/dist/pages/invoice-detail/pipeline-types.d.ts +58 -0
- package/dist/pages/invoice-detail/pipeline-types.js +1 -0
- package/dist/pages/invoice-detail/review-recheck.d.ts +8 -0
- package/dist/pages/invoice-detail/review-recheck.js +103 -0
- package/dist/pages/invoice-detail/review.d.ts +91 -0
- package/dist/pages/invoice-detail/review.js +310 -0
- package/dist/pages/invoice-list/badges.d.ts +23 -0
- package/dist/pages/invoice-list/badges.js +26 -0
- package/dist/pages/invoice-list/index.d.ts +5 -0
- package/dist/pages/invoice-list/index.js +3 -0
- package/dist/pages/invoice-list/invoice-list-page.d.ts +13 -0
- package/dist/pages/invoice-list/invoice-list-page.js +114 -0
- package/dist/pages/invoice-list/labels.d.ts +36 -0
- package/dist/pages/invoice-list/labels.js +29 -0
- package/dist/pages/invoice-list/sort-control.d.ts +17 -0
- package/dist/pages/invoice-list/sort-control.js +8 -0
- package/dist/pages/invoice-list/use-table-view.d.ts +23 -0
- package/dist/pages/invoice-list/use-table-view.js +54 -0
- package/dist/pages/invoice-upload/InvoiceUploadPage.d.ts +7 -0
- package/dist/pages/invoice-upload/InvoiceUploadPage.js +115 -0
- package/dist/pages/invoice-upload/index.d.ts +4 -0
- package/dist/pages/invoice-upload/index.js +2 -0
- package/dist/pages/invoice-upload/labels.d.ts +29 -0
- package/dist/pages/invoice-upload/labels.js +28 -0
- package/dist/pages/manual-bookings/ManualBookingsPage.d.ts +7 -0
- package/dist/pages/manual-bookings/ManualBookingsPage.js +161 -0
- package/dist/pages/manual-bookings/index.d.ts +4 -0
- package/dist/pages/manual-bookings/index.js +2 -0
- package/dist/pages/manual-bookings/labels.d.ts +53 -0
- package/dist/pages/manual-bookings/labels.js +52 -0
- package/dist/pages/notifications/labels.d.ts +22 -0
- package/dist/pages/notifications/labels.js +21 -0
- package/dist/pages/notifications/notifications-page.d.ts +14 -0
- package/dist/pages/notifications/notifications-page.js +81 -0
- package/dist/pages/open-items/OpenItemsPage.d.ts +11 -0
- package/dist/pages/open-items/OpenItemsPage.js +110 -0
- package/dist/pages/open-items/index.d.ts +6 -0
- package/dist/pages/open-items/index.js +3 -0
- package/dist/pages/open-items/labels.d.ts +37 -0
- package/dist/pages/open-items/labels.js +36 -0
- package/dist/pages/open-items/urgency.d.ts +8 -0
- package/dist/pages/open-items/urgency.js +27 -0
- package/dist/pages/opos-whitelist/OposWhitelistPage.d.ts +7 -0
- package/dist/pages/opos-whitelist/OposWhitelistPage.js +165 -0
- package/dist/pages/opos-whitelist/index.d.ts +4 -0
- package/dist/pages/opos-whitelist/index.js +2 -0
- package/dist/pages/opos-whitelist/labels.d.ts +56 -0
- package/dist/pages/opos-whitelist/labels.js +70 -0
- package/dist/pages/outgoing-invoices/OutgoingInvoicesPage.d.ts +7 -0
- package/dist/pages/outgoing-invoices/OutgoingInvoicesPage.js +169 -0
- package/dist/pages/outgoing-invoices/index.d.ts +4 -0
- package/dist/pages/outgoing-invoices/index.js +2 -0
- package/dist/pages/outgoing-invoices/labels.d.ts +43 -0
- package/dist/pages/outgoing-invoices/labels.js +42 -0
- package/dist/pages/outgoing-invoices/sort-control.d.ts +17 -0
- package/dist/pages/outgoing-invoices/sort-control.js +8 -0
- package/dist/pages/outgoing-invoices/use-table-view.d.ts +23 -0
- package/dist/pages/outgoing-invoices/use-table-view.js +54 -0
- package/dist/pages/overview/labels.d.ts +35 -0
- package/dist/pages/overview/labels.js +34 -0
- package/dist/pages/overview/overview-page.d.ts +22 -0
- package/dist/pages/overview/overview-page.js +127 -0
- package/dist/pages/processing-log/labels.d.ts +54 -0
- package/dist/pages/processing-log/labels.js +53 -0
- package/dist/pages/processing-log/mail-parsing.d.ts +21 -0
- package/dist/pages/processing-log/mail-parsing.js +52 -0
- package/dist/pages/processing-log/processing-log-page.d.ts +9 -0
- package/dist/pages/processing-log/processing-log-page.js +206 -0
- package/dist/pages/properties/badges.d.ts +20 -0
- package/dist/pages/properties/badges.js +45 -0
- package/dist/pages/properties/company-assignment-field.d.ts +11 -0
- package/dist/pages/properties/company-assignment-field.js +13 -0
- package/dist/pages/properties/form-field.d.ts +6 -0
- package/dist/pages/properties/form-field.js +9 -0
- package/dist/pages/properties/labels.d.ts +124 -0
- package/dist/pages/properties/labels.js +128 -0
- package/dist/pages/properties/name-variants-card.d.ts +7 -0
- package/dist/pages/properties/name-variants-card.js +60 -0
- package/dist/pages/properties/property-detail-page.d.ts +10 -0
- package/dist/pages/properties/property-detail-page.js +150 -0
- package/dist/pages/properties/property-list-page.d.ts +13 -0
- package/dist/pages/properties/property-list-page.js +201 -0
- package/dist/pages/properties/sort-control.d.ts +14 -0
- package/dist/pages/properties/sort-control.js +9 -0
- package/dist/pages/properties/use-infinite-rows.d.ts +6 -0
- package/dist/pages/properties/use-infinite-rows.js +26 -0
- package/dist/pages/properties/use-table-view.d.ts +23 -0
- package/dist/pages/properties/use-table-view.js +56 -0
- package/dist/pages/supplier-detail/SupplierDetailPage.d.ts +10 -0
- package/dist/pages/supplier-detail/SupplierDetailPage.js +157 -0
- package/dist/pages/supplier-detail/index.d.ts +4 -0
- package/dist/pages/supplier-detail/index.js +2 -0
- package/dist/pages/supplier-detail/labels.d.ts +46 -0
- package/dist/pages/supplier-detail/labels.js +45 -0
- package/dist/pages/supplier-list/SupplierListPage.d.ts +9 -0
- package/dist/pages/supplier-list/SupplierListPage.js +102 -0
- package/dist/pages/supplier-list/index.d.ts +4 -0
- package/dist/pages/supplier-list/index.js +2 -0
- package/dist/pages/supplier-list/labels.d.ts +33 -0
- package/dist/pages/supplier-list/labels.js +32 -0
- package/dist/pages/supplier-list/sort-control.d.ts +17 -0
- package/dist/pages/supplier-list/sort-control.js +8 -0
- package/dist/pages/supplier-list/use-table-view.d.ts +23 -0
- package/dist/pages/supplier-list/use-table-view.js +54 -0
- package/dist/pages/team/account-dialogs.d.ts +12 -0
- package/dist/pages/team/account-dialogs.js +49 -0
- package/dist/pages/team/employee-editor.d.ts +19 -0
- package/dist/pages/team/employee-editor.js +124 -0
- package/dist/pages/team/labels.d.ts +99 -0
- package/dist/pages/team/labels.js +98 -0
- package/dist/pages/team/new-employee.d.ts +8 -0
- package/dist/pages/team/new-employee.js +103 -0
- package/dist/pages/team/roles-tab.d.ts +6 -0
- package/dist/pages/team/roles-tab.js +46 -0
- package/dist/pages/team/team-page.d.ts +7 -0
- package/dist/pages/team/team-page.js +81 -0
- package/dist/pages/team/temp-password-dialog.d.ts +11 -0
- package/dist/pages/team/temp-password-dialog.js +23 -0
- package/dist/pages/trash/labels.d.ts +68 -0
- package/dist/pages/trash/labels.js +69 -0
- package/dist/pages/trash/trash-page.d.ts +9 -0
- package/dist/pages/trash/trash-page.js +259 -0
- package/dist/pages/vat-rules/labels.d.ts +110 -0
- package/dist/pages/vat-rules/labels.js +109 -0
- package/dist/pages/vat-rules/new-rule-dialog.d.ts +7 -0
- package/dist/pages/vat-rules/new-rule-dialog.js +134 -0
- package/dist/pages/vat-rules/rule-row.d.ts +20 -0
- package/dist/pages/vat-rules/rule-row.js +120 -0
- package/dist/pages/vat-rules/vat-rules-page.d.ts +9 -0
- package/dist/pages/vat-rules/vat-rules-page.js +61 -0
- package/dist/ui/alert-dialog.d.ts +20 -0
- package/dist/ui/alert-dialog.js +41 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/badge.js +20 -0
- package/dist/ui/breadcrumb.d.ts +19 -0
- package/dist/ui/breadcrumb.js +23 -0
- package/dist/ui/button.d.ts +11 -0
- package/dist/ui/button.js +33 -0
- package/dist/ui/calendar.d.ts +8 -0
- package/dist/ui/calendar.js +75 -0
- package/dist/ui/card.d.ts +8 -0
- package/dist/ui/card.js +16 -0
- package/dist/ui/chart.d.ts +62 -0
- package/dist/ui/chart.js +118 -0
- package/dist/ui/checkbox.d.ts +4 -0
- package/dist/ui/checkbox.js +11 -0
- package/dist/ui/collapsible.d.ts +5 -0
- package/dist/ui/collapsible.js +5 -0
- package/dist/ui/combobox.d.ts +24 -0
- package/dist/ui/combobox.js +55 -0
- package/dist/ui/command.d.ts +80 -0
- package/dist/ui/command.js +29 -0
- package/dist/ui/dialog.d.ts +19 -0
- package/dist/ui/dialog.js +58 -0
- package/dist/ui/dropdown-menu.d.ts +27 -0
- package/dist/ui/dropdown-menu.js +33 -0
- package/dist/ui/field-context.d.ts +4 -0
- package/dist/ui/field-context.js +6 -0
- package/dist/ui/field.d.ts +3 -0
- package/dist/ui/field.js +8 -0
- package/dist/ui/icon-action.d.ts +3 -0
- package/dist/ui/icon-action.js +8 -0
- package/dist/ui/index.d.ts +32 -0
- package/dist/ui/index.js +32 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +11 -0
- package/dist/ui/label.d.ts +5 -0
- package/dist/ui/label.js +15 -0
- package/dist/ui/multi-combobox.d.ts +18 -0
- package/dist/ui/multi-combobox.js +40 -0
- package/dist/ui/popover.d.ts +9 -0
- package/dist/ui/popover.js +12 -0
- package/dist/ui/scroll-area.d.ts +5 -0
- package/dist/ui/scroll-area.js +9 -0
- package/dist/ui/scroll-shadow.d.ts +8 -0
- package/dist/ui/scroll-shadow.js +57 -0
- package/dist/ui/select.d.ts +13 -0
- package/dist/ui/select.js +31 -0
- package/dist/ui/separator.d.ts +4 -0
- package/dist/ui/separator.js +7 -0
- package/dist/ui/sheet.d.ts +25 -0
- package/dist/ui/sheet.js +40 -0
- package/dist/ui/sidebar.d.ts +65 -0
- package/dist/ui/sidebar.js +207 -0
- package/dist/ui/skeleton.d.ts +2 -0
- package/dist/ui/skeleton.js +6 -0
- package/dist/ui/sonner.d.ts +5 -0
- package/dist/ui/sonner.js +13 -0
- package/dist/ui/switch.d.ts +4 -0
- package/dist/ui/switch.js +7 -0
- package/dist/ui/table.d.ts +12 -0
- package/dist/ui/table.js +24 -0
- package/dist/ui/tabs.d.ts +7 -0
- package/dist/ui/tabs.js +12 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/textarea.js +11 -0
- package/dist/ui/tooltip.d.ts +7 -0
- package/dist/ui/tooltip.js +11 -0
- package/package.json +80 -0
- package/themes/TOKENS.md +57 -0
- package/themes/default.css +60 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from "react";
|
|
3
|
+
import { ArrowLeft, Archive, ArchiveRestore, MoreVertical, Trash2 } from "lucide-react";
|
|
4
|
+
import { toast } from "sonner";
|
|
5
|
+
import { Button } from "../../ui/button.js";
|
|
6
|
+
import { Input } from "../../ui/input.js";
|
|
7
|
+
import { Label } from "../../ui/label.js";
|
|
8
|
+
import { Textarea } from "../../ui/textarea.js";
|
|
9
|
+
import { Combobox } from "../../ui/combobox.js";
|
|
10
|
+
import { Switch } from "../../ui/switch.js";
|
|
11
|
+
import { Skeleton } from "../../ui/skeleton.js";
|
|
12
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../ui/tabs.js";
|
|
13
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "../../ui/dialog.js";
|
|
14
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "../../ui/dropdown-menu.js";
|
|
15
|
+
import { ErrorState, readableErrorMessage } from "../../components/feedback/query-states.js";
|
|
16
|
+
import { cn } from "../../lib/class-names.js";
|
|
17
|
+
import { englishFormatters } from "../../lib/formatters.js";
|
|
18
|
+
import { OutgoingInvoiceBanner } from "./OutgoingInvoiceFlag.js";
|
|
19
|
+
import { buildReviewSummary, hasNoReviewChecks, reviewLines } from "./review.js";
|
|
20
|
+
import { ReviewBadge } from "./ReviewBadge.js";
|
|
21
|
+
import { ReviewCard } from "./ReviewCard.js";
|
|
22
|
+
import { WorkflowLadder } from "./WorkflowLadder.js";
|
|
23
|
+
import { WorkflowHistoryList } from "./WorkflowHistoryList.js";
|
|
24
|
+
import { historyLines, historyQualifier, historyStateLabel } from "./history.js";
|
|
25
|
+
import { englishInvoiceDetailLabels } from "./labels.js";
|
|
26
|
+
const NONE = "__none";
|
|
27
|
+
function overviewFormFrom(invoice) {
|
|
28
|
+
const s = (v) => v ?? "";
|
|
29
|
+
const n = (v) => (v == null ? "" : String(v));
|
|
30
|
+
return {
|
|
31
|
+
issuer: s(invoice.issuer),
|
|
32
|
+
invoice_number: s(invoice.invoice_number),
|
|
33
|
+
order_number: s(invoice.order_number),
|
|
34
|
+
document_date: s(invoice.document_date),
|
|
35
|
+
due_date: s(invoice.due_date),
|
|
36
|
+
service_date: s(invoice.service_date),
|
|
37
|
+
amount_net: n(invoice.amount_net),
|
|
38
|
+
vat_rate: n(invoice.vat_rate),
|
|
39
|
+
vat_amount: n(invoice.vat_amount),
|
|
40
|
+
amount_gross: n(invoice.amount_gross),
|
|
41
|
+
currency: s(invoice.currency),
|
|
42
|
+
company_code: s(invoice.company_code),
|
|
43
|
+
property_code: s(invoice.property_code),
|
|
44
|
+
category_id: s(invoice.category_id),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function detailsFormFrom(invoice) {
|
|
48
|
+
const s = (v) => v ?? "";
|
|
49
|
+
return {
|
|
50
|
+
recipient_name: s(invoice.recipient_name),
|
|
51
|
+
customer_number: s(invoice.customer_number),
|
|
52
|
+
payment_reference: s(invoice.payment_reference),
|
|
53
|
+
payment_method: s(invoice.payment_method),
|
|
54
|
+
tax_note: s(invoice.tax_note),
|
|
55
|
+
service_description: s(invoice.service_description),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function parseNumber(value) {
|
|
59
|
+
const trimmed = value.trim();
|
|
60
|
+
if (trimmed === "")
|
|
61
|
+
return null;
|
|
62
|
+
const n = Number(trimmed.replace(",", "."));
|
|
63
|
+
return Number.isFinite(n) ? n : NaN;
|
|
64
|
+
}
|
|
65
|
+
function diff(form, base, numericKeys, labelFor) {
|
|
66
|
+
const changes = {};
|
|
67
|
+
const labels = [];
|
|
68
|
+
const invalid = [];
|
|
69
|
+
for (const key of Object.keys(form)) {
|
|
70
|
+
const isNumeric = numericKeys.includes(key);
|
|
71
|
+
const raw = form[key];
|
|
72
|
+
const next = isNumeric ? parseNumber(raw) : raw.trim() === "" ? null : raw.trim();
|
|
73
|
+
if (isNumeric && Number.isNaN(next)) {
|
|
74
|
+
invalid.push(labelFor(key));
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const prev = base[key] ?? null;
|
|
78
|
+
if (next !== prev) {
|
|
79
|
+
changes[key] = next;
|
|
80
|
+
labels.push(labelFor(key));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return { changes, labels, invalid };
|
|
84
|
+
}
|
|
85
|
+
export function InvoiceDetailPage({ invoiceId, adapter, config, labels = englishInvoiceDetailLabels, formatters = englishFormatters, }) {
|
|
86
|
+
const page = labels.page;
|
|
87
|
+
const invoiceQuery = adapter.useInvoice(invoiceId);
|
|
88
|
+
const historyQuery = adapter.useHistory(invoiceId);
|
|
89
|
+
const companyOptionsQuery = adapter.useCompanyOptions();
|
|
90
|
+
const propertyOptionsQuery = adapter.usePropertyOptions();
|
|
91
|
+
const categoryOptionsQuery = adapter.useCategoryOptions();
|
|
92
|
+
const [activeTab, setActiveTab] = useState("overview");
|
|
93
|
+
const [overviewEditOpen, setOverviewEditOpen] = useState(false);
|
|
94
|
+
const [detailsEditOpen, setDetailsEditOpen] = useState(false);
|
|
95
|
+
const [overviewForm, setOverviewForm] = useState(null);
|
|
96
|
+
const [detailsForm, setDetailsForm] = useState(null);
|
|
97
|
+
const [isSaving, setIsSaving] = useState(false);
|
|
98
|
+
const [noteText, setNoteText] = useState("");
|
|
99
|
+
const [deleteOpen, setDeleteOpen] = useState(false);
|
|
100
|
+
const [deleteReason, setDeleteReason] = useState("");
|
|
101
|
+
const [approvalComment, setApprovalComment] = useState("");
|
|
102
|
+
const [reviewOpen, setReviewOpen] = useState(false);
|
|
103
|
+
const [reviewFlash, setReviewFlash] = useState(false);
|
|
104
|
+
const invoice = invoiceQuery.data;
|
|
105
|
+
const legalActionsQuery = adapter.approval?.useLegalActions(invoice ?? {});
|
|
106
|
+
const payableAccountQuery = adapter.payment?.usePayableAccount(invoice ?? {});
|
|
107
|
+
const reviewSummary = useMemo(() => (invoice ? buildReviewSummary(invoice) : null), [invoice]);
|
|
108
|
+
const lines = useMemo(() => reviewSummary
|
|
109
|
+
? reviewLines(reviewSummary.reasons, labels.review, config.fieldJumpTargets)
|
|
110
|
+
: [], [reviewSummary, labels.review, config.fieldJumpTargets]);
|
|
111
|
+
const historyRows = useMemo(() => {
|
|
112
|
+
const rows = historyQuery.data;
|
|
113
|
+
const sorted = [...rows].sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
114
|
+
const historyFormat = {
|
|
115
|
+
approvalActionLabelDe: () => "",
|
|
116
|
+
workflowLabelDe: () => "",
|
|
117
|
+
workflowOrder: config.workflowSteps,
|
|
118
|
+
};
|
|
119
|
+
let lastTime = invoice ? new Date(invoice.created_at).getTime() : 0;
|
|
120
|
+
return sorted.map((entry) => {
|
|
121
|
+
const createdTime = new Date(entry.createdAt).getTime();
|
|
122
|
+
const durationMs = Math.max(0, createdTime - lastTime);
|
|
123
|
+
lastTime = createdTime;
|
|
124
|
+
const allLines = historyLines(entry, config, historyFormat);
|
|
125
|
+
return {
|
|
126
|
+
entry,
|
|
127
|
+
from: "",
|
|
128
|
+
to: historyStateLabel(entry, config, historyFormat, labels.history),
|
|
129
|
+
qualifier: historyQualifier(entry, labels.history),
|
|
130
|
+
comment: allLines[0] ?? null,
|
|
131
|
+
durationMs,
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
}, [historyQuery.data, config, labels.history, invoice]);
|
|
135
|
+
if (invoiceQuery.error) {
|
|
136
|
+
return _jsx(ErrorState, { error: invoiceQuery.error, onRetry: () => invoiceQuery.refetch() });
|
|
137
|
+
}
|
|
138
|
+
if (invoiceQuery.loading) {
|
|
139
|
+
return (_jsxs("div", { className: "space-y-6", children: [_jsx(Skeleton, { className: "h-8 w-64" }), _jsx(Skeleton, { className: "h-48 rounded-xl" }), _jsx(Skeleton, { className: "h-96 rounded-xl" })] }));
|
|
140
|
+
}
|
|
141
|
+
if (!invoice) {
|
|
142
|
+
return (_jsxs("div", { className: "mx-auto max-w-md py-20 text-center", children: [_jsx("h1", { className: "text-xl font-semibold tracking-tight text-foreground", children: page.notFoundTitle }), _jsx("p", { className: "mt-2 text-base text-muted-foreground", children: page.notFoundBody(invoiceId) }), _jsx(Button, { className: "mt-6", onClick: adapter.openInvoiceList, children: page.backToList })] }));
|
|
143
|
+
}
|
|
144
|
+
function openOverviewEdit() {
|
|
145
|
+
setOverviewForm(overviewFormFrom(invoice));
|
|
146
|
+
setOverviewEditOpen(true);
|
|
147
|
+
}
|
|
148
|
+
function openDetailsEdit() {
|
|
149
|
+
setDetailsForm(detailsFormFrom(invoice));
|
|
150
|
+
setDetailsEditOpen(true);
|
|
151
|
+
}
|
|
152
|
+
async function saveOverview() {
|
|
153
|
+
if (!overviewForm)
|
|
154
|
+
return;
|
|
155
|
+
const { changes, labels: changed, invalid } = diff(overviewForm, invoice, ["amount_net", "vat_rate", "vat_amount", "amount_gross"], fieldLabel);
|
|
156
|
+
if (invalid.length > 0) {
|
|
157
|
+
toast.error(page.saveFailed(invalid.join(", ")));
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (Object.keys(changes).length === 0) {
|
|
161
|
+
setOverviewEditOpen(false);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
setIsSaving(true);
|
|
165
|
+
try {
|
|
166
|
+
await adapter.updateInvoice(invoice.id, changes, changed);
|
|
167
|
+
toast.success(page.saved);
|
|
168
|
+
setOverviewEditOpen(false);
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
toast.error(page.saveFailed(readableErrorMessage(error, "")));
|
|
172
|
+
}
|
|
173
|
+
finally {
|
|
174
|
+
setIsSaving(false);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async function saveDetails() {
|
|
178
|
+
if (!detailsForm)
|
|
179
|
+
return;
|
|
180
|
+
const { changes, labels: changed } = diff(detailsForm, invoice, [], fieldLabel);
|
|
181
|
+
if (Object.keys(changes).length === 0) {
|
|
182
|
+
setDetailsEditOpen(false);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
setIsSaving(true);
|
|
186
|
+
try {
|
|
187
|
+
await adapter.updateInvoice(invoice.id, changes, changed);
|
|
188
|
+
toast.success(page.saved);
|
|
189
|
+
setDetailsEditOpen(false);
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
toast.error(page.saveFailed(readableErrorMessage(error, "")));
|
|
193
|
+
}
|
|
194
|
+
finally {
|
|
195
|
+
setIsSaving(false);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function fieldLabel(key) {
|
|
199
|
+
const map = {
|
|
200
|
+
issuer: page.fieldIssuer,
|
|
201
|
+
invoice_number: page.fieldInvoiceNumber,
|
|
202
|
+
order_number: page.fieldOrderNumber,
|
|
203
|
+
document_date: page.fieldDocumentDate,
|
|
204
|
+
due_date: page.fieldDueDate,
|
|
205
|
+
service_date: page.fieldServiceDate,
|
|
206
|
+
amount_net: page.fieldAmountNet,
|
|
207
|
+
vat_rate: page.fieldVatRate,
|
|
208
|
+
vat_amount: page.fieldVatAmount,
|
|
209
|
+
amount_gross: page.fieldAmountGross,
|
|
210
|
+
currency: page.fieldCurrency,
|
|
211
|
+
company_code: page.fieldCompany,
|
|
212
|
+
property_code: page.fieldProperty,
|
|
213
|
+
category_id: page.fieldCategory,
|
|
214
|
+
recipient_name: page.fieldRecipientName,
|
|
215
|
+
customer_number: page.fieldCustomerNumber,
|
|
216
|
+
payment_reference: page.fieldPaymentReference,
|
|
217
|
+
payment_method: page.fieldPaymentMethod,
|
|
218
|
+
tax_note: page.fieldTaxNote,
|
|
219
|
+
service_description: page.fieldServiceDescription,
|
|
220
|
+
};
|
|
221
|
+
return map[key] ?? key;
|
|
222
|
+
}
|
|
223
|
+
async function addNote() {
|
|
224
|
+
const text = noteText.trim();
|
|
225
|
+
if (!text)
|
|
226
|
+
return;
|
|
227
|
+
try {
|
|
228
|
+
await adapter.addNote(invoice.id, text);
|
|
229
|
+
setNoteText("");
|
|
230
|
+
toast.success(page.noteAdded);
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
toast.error(readableErrorMessage(error, ""));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
async function confirmDelete() {
|
|
237
|
+
try {
|
|
238
|
+
await adapter.softDelete(invoice.id, deleteReason.trim());
|
|
239
|
+
toast.success(page.deletedToast);
|
|
240
|
+
setDeleteOpen(false);
|
|
241
|
+
adapter.openInvoiceList();
|
|
242
|
+
}
|
|
243
|
+
catch (error) {
|
|
244
|
+
toast.error(readableErrorMessage(error, ""));
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
async function togglePaid() {
|
|
248
|
+
if (!adapter.payment)
|
|
249
|
+
return;
|
|
250
|
+
try {
|
|
251
|
+
await adapter.payment.setPaid(invoice.id, !invoice.paid_at);
|
|
252
|
+
toast.success(page.paidToast);
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
toast.error(readableErrorMessage(error, ""));
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
async function runApprovalAction(actionId, requiresComment) {
|
|
259
|
+
if (!adapter.approval)
|
|
260
|
+
return;
|
|
261
|
+
if (requiresComment && !approvalComment.trim())
|
|
262
|
+
return;
|
|
263
|
+
try {
|
|
264
|
+
await adapter.approval.runAction(invoice.id, actionId, approvalComment.trim() || undefined);
|
|
265
|
+
setApprovalComment("");
|
|
266
|
+
}
|
|
267
|
+
catch (error) {
|
|
268
|
+
toast.error(readableErrorMessage(error, ""));
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
const reasonCount = reviewSummary?.reasons.length ?? 0;
|
|
272
|
+
const unchecked = hasNoReviewChecks(invoice);
|
|
273
|
+
const currentStepIndex = config.workflowSteps.indexOf(invoice.workflow_status ?? config.workflowSteps[0]);
|
|
274
|
+
const legalActionsMap = new Map(legalActionsQuery?.data
|
|
275
|
+
? Array.from(legalActionsQuery.data.entries()).map(([step, action]) => [step, action])
|
|
276
|
+
: []);
|
|
277
|
+
return (_jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs(Button, { variant: "ghost", size: "sm", className: "-ml-2 gap-1.5 text-muted-foreground", onClick: adapter.openInvoiceList, children: [_jsx(ArrowLeft, { className: "size-4" }), page.backToList] }), _jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: [_jsx("h1", { className: "truncate text-2xl font-semibold tracking-tight text-foreground", children: invoice.issuer ?? "—" }), _jsx(ReviewBadge, { reasonCount: reasonCount, unchecked: unchecked, status: invoice.status, alreadyPaid: !!invoice.paid_at, labels: labels.review })] }), _jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: invoice.invoice_number ? `#${invoice.invoice_number}` : page.noInvoiceNumber })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [adapter.archive && (_jsxs(Button, { variant: "outline", size: "sm", className: "gap-1.5", onClick: () => invoice.archived_at ? adapter.archive.unarchive(invoice.id) : adapter.archive.archive(invoice.id, ""), children: [invoice.archived_at ? _jsx(ArchiveRestore, { className: "size-4" }) : _jsx(Archive, { className: "size-4" }), invoice.archived_at ? page.unarchiveButton : page.archiveButton] })), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", children: _jsx(MoreVertical, { className: "size-4" }) }) }), _jsx(DropdownMenuContent, { align: "end", children: _jsxs(DropdownMenuItem, { onClick: () => setDeleteOpen(true), className: "text-destructive", children: [_jsx(Trash2, { className: "size-4" }), page.deleteButton] }) })] })] })] }), invoice.archived_at && (_jsx("div", { className: "rounded-xl border border-border bg-muted/40 px-4 py-3 text-sm text-muted-foreground", children: page.archivedBanner(formatters.formatDate(invoice.archived_at)) })), _jsx(OutgoingInvoiceBanner, { invoice: invoice, labels: labels.outgoing }), lines.length > 0 && (_jsx(ReviewCard, { lines: lines, anchorId: "review-box", open: reviewOpen, onOpenChange: setReviewOpen, flash: reviewFlash, onJump: (tab) => {
|
|
278
|
+
setActiveTab(tab);
|
|
279
|
+
setReviewFlash(true);
|
|
280
|
+
window.setTimeout(() => setReviewFlash(false), 1800);
|
|
281
|
+
}, labels: labels.review })), adapter.approval && (_jsx("div", { className: "rounded-xl border border-border bg-card p-4", children: _jsx(WorkflowLadder, { steps: config.workflowSteps, currentStep: currentStepIndex, actions: legalActionsMap, onAction: (step) => {
|
|
282
|
+
const action = legalActionsQuery?.data.get(step);
|
|
283
|
+
if (action)
|
|
284
|
+
void runApprovalAction(action.id, action.requiresComment);
|
|
285
|
+
}, labels: labels.workflowLadder, ladderColors: config.ladderColors }) })), _jsxs(Tabs, { value: activeTab, onValueChange: setActiveTab, children: [_jsxs(TabsList, { children: [_jsx(TabsTrigger, { value: "overview", children: page.tabOverview }), adapter.approval && _jsx(TabsTrigger, { value: "approval", children: page.tabApproval }), adapter.payment && _jsx(TabsTrigger, { value: "payment", children: page.tabPayment }), _jsx(TabsTrigger, { value: "details", children: page.tabDetails }), _jsx(TabsTrigger, { value: "history", children: page.tabHistory })] }), _jsxs(TabsContent, { value: "overview", className: "mt-4 space-y-4", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-base font-semibold text-foreground", children: page.tabOverview }), adapter.canEdit && (_jsx(Button, { variant: "outline", size: "sm", onClick: openOverviewEdit, children: page.edit }))] }), _jsxs("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: [_jsx(Field, { label: page.fieldAmountNet, value: formatters.formatMoney(invoice.amount_net) }), _jsx(Field, { label: page.fieldVatAmount, value: formatters.formatMoney(invoice.vat_amount) }), _jsx(Field, { label: page.fieldAmountGross, value: formatters.formatMoney(invoice.amount_gross) }), _jsx(Field, { label: page.fieldInvoiceNumber, value: invoice.invoice_number ?? "—" }), _jsx(Field, { label: page.fieldDocumentDate, value: formatters.formatDate(invoice.document_date) }), _jsx(Field, { label: page.fieldDueDate, value: formatters.formatDate(invoice.due_date) }), _jsx(Field, { label: page.fieldCompany, value: invoice.company_code ?? "—" }), _jsx(Field, { label: page.fieldProperty, value: invoice.property_code ?? "—" }), _jsx(Field, { label: page.fieldCategory, value: invoice.cost_category ?? "—" })] })] }), adapter.approval && (_jsx(TabsContent, { value: "approval", className: "mt-4 space-y-4", children: legalActionsMap.size > 0 ? (_jsxs("div", { className: "space-y-3 rounded-xl border border-border bg-card p-4", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: page.approvalComment }), _jsx(Textarea, { value: approvalComment, onChange: (event) => setApprovalComment(event.target.value), placeholder: page.approvalCommentPlaceholder, rows: 2 }), _jsx("div", { className: "flex flex-wrap gap-2", children: Array.from(legalActionsQuery?.data?.entries() ?? []).map(([step, action]) => (_jsxs(Button, { size: "sm", onClick: () => runApprovalAction(action.id, action.requiresComment), children: [page.runAction, " \u2014 ", step] }, step))) })] })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: page.noActionsAvailable })) })), adapter.payment && (_jsxs(TabsContent, { value: "payment", className: "mt-4 space-y-4", children: [_jsxs("div", { className: "flex items-center justify-between rounded-xl border border-border bg-card p-4", children: [_jsx("span", { className: "text-sm text-foreground", children: invoice.paid_at ? page.markUnpaid : page.markPaid }), _jsx(Switch, { checked: !!invoice.paid_at, onCheckedChange: togglePaid })] }), _jsxs("div", { className: "rounded-xl border border-border bg-card p-4", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: page.payableAccount }), payableAccountQuery?.loading ? (_jsx(Skeleton, { className: "mt-2 h-4 w-48" })) : payableAccountQuery?.data ? (_jsxs("p", { className: "mt-1 text-sm text-foreground", children: [payableAccountQuery.data.iban, payableAccountQuery.data.bankName ? ` · ${payableAccountQuery.data.bankName}` : ""] })) : (_jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: page.noPayableAccount }))] })] })), _jsxs(TabsContent, { value: "details", className: "mt-4 space-y-4", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-base font-semibold text-foreground", children: page.tabDetails }), adapter.canEdit && (_jsx(Button, { variant: "outline", size: "sm", onClick: openDetailsEdit, children: page.edit }))] }), _jsxs("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: [_jsx(Field, { label: page.fieldRecipientName, value: invoice.recipient_name ?? "—" }), _jsx(Field, { label: page.fieldCustomerNumber, value: invoice.customer_number ?? "—" }), _jsx(Field, { label: page.fieldPaymentReference, value: invoice.payment_reference ?? "—" }), _jsx(Field, { label: page.fieldPaymentMethod, value: invoice.payment_method ?? "—" }), _jsx(Field, { label: page.fieldTaxNote, value: invoice.tax_note ?? "—" }), _jsx(Field, { label: page.fieldServiceDescription, value: invoice.service_description ?? "—" })] }), adapter.supplier && invoice.supplier_id && (_jsx(Button, { variant: "outline", size: "sm", onClick: () => adapter.supplier.openSupplier(invoice.supplier_id), children: page.openSupplier }))] }), _jsxs(TabsContent, { value: "history", className: "mt-4 space-y-4", children: [_jsxs("div", { className: "flex gap-2", children: [_jsx(Textarea, { value: noteText, onChange: (event) => setNoteText(event.target.value), placeholder: page.addNotePlaceholder, rows: 2, className: "flex-1" }), _jsx(Button, { onClick: addNote, disabled: !noteText.trim(), children: page.addNoteButton })] }), historyQuery.loading ? (_jsx(Skeleton, { className: "h-48 w-full rounded-xl" })) : (_jsx(WorkflowHistoryList, { rows: historyRows, arrivedAt: invoice.created_at, labels: labels.workflowHistory }))] })] }), _jsx(Dialog, { open: overviewEditOpen, onOpenChange: setOverviewEditOpen, children: _jsxs(DialogContent, { className: "max-w-2xl", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: page.tabOverview }) }), overviewForm && (_jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [_jsx(TextField, { label: page.fieldIssuer, value: overviewForm.issuer, onChange: (v) => setOverviewForm({ ...overviewForm, issuer: v }) }), _jsx(TextField, { label: page.fieldInvoiceNumber, value: overviewForm.invoice_number, onChange: (v) => setOverviewForm({ ...overviewForm, invoice_number: v }) }), _jsx(TextField, { label: page.fieldOrderNumber, value: overviewForm.order_number, onChange: (v) => setOverviewForm({ ...overviewForm, order_number: v }) }), _jsx(TextField, { label: page.fieldDocumentDate, value: overviewForm.document_date, onChange: (v) => setOverviewForm({ ...overviewForm, document_date: v }), type: "date" }), _jsx(TextField, { label: page.fieldDueDate, value: overviewForm.due_date, onChange: (v) => setOverviewForm({ ...overviewForm, due_date: v }), type: "date" }), _jsx(TextField, { label: page.fieldServiceDate, value: overviewForm.service_date, onChange: (v) => setOverviewForm({ ...overviewForm, service_date: v }), type: "date" }), _jsx(TextField, { label: page.fieldAmountNet, value: overviewForm.amount_net, onChange: (v) => setOverviewForm({ ...overviewForm, amount_net: v }) }), _jsx(TextField, { label: page.fieldVatRate, value: overviewForm.vat_rate, onChange: (v) => setOverviewForm({ ...overviewForm, vat_rate: v }) }), _jsx(TextField, { label: page.fieldVatAmount, value: overviewForm.vat_amount, onChange: (v) => setOverviewForm({ ...overviewForm, vat_amount: v }) }), _jsx(TextField, { label: page.fieldAmountGross, value: overviewForm.amount_gross, onChange: (v) => setOverviewForm({ ...overviewForm, amount_gross: v }) }), _jsx(TextField, { label: page.fieldCurrency, value: overviewForm.currency, onChange: (v) => setOverviewForm({ ...overviewForm, currency: v }) }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: page.fieldCompany }), _jsx(Combobox, { value: overviewForm.company_code || NONE, onValueChange: (v) => setOverviewForm({ ...overviewForm, company_code: v === NONE ? "" : v }), options: [{ value: NONE, label: "—" }, ...(companyOptionsQuery.data ?? []).map((c) => ({ value: c.code, label: `${c.code} — ${c.name}` }))] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: page.fieldProperty }), _jsx(Combobox, { value: overviewForm.property_code || NONE, onValueChange: (v) => setOverviewForm({ ...overviewForm, property_code: v === NONE ? "" : v }), options: [{ value: NONE, label: "—" }, ...(propertyOptionsQuery.data ?? []).map((p) => ({ value: p.code, label: `${p.code} — ${p.name}` }))] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: page.fieldCategory }), _jsx(Combobox, { value: overviewForm.category_id || NONE, onValueChange: (v) => setOverviewForm({ ...overviewForm, category_id: v === NONE ? "" : v }), options: [{ value: NONE, label: "—" }, ...(categoryOptionsQuery.data ?? []).map((c) => ({ value: c.id, label: c.name }))] })] })] })), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", onClick: () => setOverviewEditOpen(false), children: page.cancel }), _jsx(Button, { onClick: saveOverview, disabled: isSaving, children: isSaving ? page.saving : page.save })] })] }) }), _jsx(Dialog, { open: detailsEditOpen, onOpenChange: setDetailsEditOpen, children: _jsxs(DialogContent, { className: "max-w-2xl", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: page.tabDetails }) }), detailsForm && (_jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [_jsx(TextField, { label: page.fieldRecipientName, value: detailsForm.recipient_name, onChange: (v) => setDetailsForm({ ...detailsForm, recipient_name: v }) }), _jsx(TextField, { label: page.fieldCustomerNumber, value: detailsForm.customer_number, onChange: (v) => setDetailsForm({ ...detailsForm, customer_number: v }) }), _jsx(TextField, { label: page.fieldPaymentReference, value: detailsForm.payment_reference, onChange: (v) => setDetailsForm({ ...detailsForm, payment_reference: v }) }), _jsx(TextField, { label: page.fieldPaymentMethod, value: detailsForm.payment_method, onChange: (v) => setDetailsForm({ ...detailsForm, payment_method: v }) }), _jsx(TextField, { label: page.fieldTaxNote, value: detailsForm.tax_note, onChange: (v) => setDetailsForm({ ...detailsForm, tax_note: v }) }), _jsx(TextField, { label: page.fieldServiceDescription, value: detailsForm.service_description, onChange: (v) => setDetailsForm({ ...detailsForm, service_description: v }) })] })), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", onClick: () => setDetailsEditOpen(false), children: page.cancel }), _jsx(Button, { onClick: saveDetails, disabled: isSaving, children: isSaving ? page.saving : page.save })] })] }) }), _jsx(Dialog, { open: deleteOpen, onOpenChange: setDeleteOpen, children: _jsxs(DialogContent, { children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: page.deleteDialogTitle }), _jsx(DialogDescription, { children: page.deleteDialogDescription })] }), _jsx(Textarea, { value: deleteReason, onChange: (event) => setDeleteReason(event.target.value), placeholder: page.deleteReasonPlaceholder, rows: 2 }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", onClick: () => setDeleteOpen(false), children: page.cancel }), _jsx(Button, { variant: "destructive", onClick: confirmDelete, children: page.deleteConfirm })] })] }) })] }));
|
|
286
|
+
}
|
|
287
|
+
function Field({ label, value }) {
|
|
288
|
+
return (_jsxs("div", { children: [_jsx("div", { className: "text-xs text-muted-foreground", children: label }), _jsx("div", { className: cn("mt-0.5 text-sm text-foreground", value === "—" && "text-muted-foreground"), children: value })] }));
|
|
289
|
+
}
|
|
290
|
+
function TextField({ label, value, onChange, type = "text", }) {
|
|
291
|
+
return (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: label }), _jsx(Input, { type: type, value: value, onChange: (event) => onChange(event.target.value) })] }));
|
|
292
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Extracted } from "./pipeline-types";
|
|
2
|
+
export declare function isOutgoingInvoice(invoice: {
|
|
3
|
+
extracted: Extracted | null;
|
|
4
|
+
}): boolean;
|
|
5
|
+
export interface OutgoingInvoiceLabels {
|
|
6
|
+
banner: (issuer: string, recipient: string) => string;
|
|
7
|
+
bannerShort: string;
|
|
8
|
+
unknownIssuer: string;
|
|
9
|
+
unknownRecipient: string;
|
|
10
|
+
}
|
|
11
|
+
interface OutgoingInvoiceFields {
|
|
12
|
+
extracted: Extracted | null;
|
|
13
|
+
issuer: string | null;
|
|
14
|
+
recipient_name: string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare function OutgoingInvoiceBanner({ invoice, labels, className, }: {
|
|
17
|
+
invoice: OutgoingInvoiceFields;
|
|
18
|
+
labels: OutgoingInvoiceLabels;
|
|
19
|
+
className?: string;
|
|
20
|
+
}): import("react").JSX.Element | null;
|
|
21
|
+
export declare function OutgoingInvoiceBadge({ invoice, labels, className, }: {
|
|
22
|
+
invoice: OutgoingInvoiceFields;
|
|
23
|
+
labels: OutgoingInvoiceLabels;
|
|
24
|
+
className?: string;
|
|
25
|
+
}): import("react").JSX.Element | null;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Send } from "lucide-react";
|
|
3
|
+
import { cn } from "../../lib/class-names.js";
|
|
4
|
+
export function isOutgoingInvoice(invoice) {
|
|
5
|
+
return invoice.extracted?.richtung?.trim().toLowerCase() === "ausgang";
|
|
6
|
+
}
|
|
7
|
+
export function OutgoingInvoiceBanner({ invoice, labels, className, }) {
|
|
8
|
+
if (!isOutgoingInvoice(invoice))
|
|
9
|
+
return null;
|
|
10
|
+
return (_jsx("div", { className: cn("rounded-xl border border-rose-300 bg-rose-50 px-4 py-3 text-base text-rose-900", className), children: _jsxs("div", { className: "flex items-center gap-2 font-semibold", children: [_jsx(Send, { className: "size-4 shrink-0" }), labels.banner(invoice.issuer ?? labels.unknownIssuer, invoice.recipient_name ?? labels.unknownRecipient)] }) }));
|
|
11
|
+
}
|
|
12
|
+
export function OutgoingInvoiceBadge({ invoice, labels, className, }) {
|
|
13
|
+
if (!isOutgoingInvoice(invoice))
|
|
14
|
+
return null;
|
|
15
|
+
return (_jsx("span", { title: labels.banner(invoice.issuer ?? labels.unknownIssuer, invoice.recipient_name ?? labels.unknownRecipient), className: cn("inline-flex shrink-0 items-center gap-1 rounded-md border border-rose-300 bg-rose-50 px-1.5 py-0.5 text-xs font-medium text-rose-900", className), children: labels.bannerShort }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ReviewBadgeLabels {
|
|
2
|
+
none: string;
|
|
3
|
+
duplicate: string;
|
|
4
|
+
excluded: string;
|
|
5
|
+
alreadyPaid: string;
|
|
6
|
+
needed: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ReviewBadge({ reasonCount, status, alreadyPaid, unchecked, labels, className, }: {
|
|
9
|
+
reasonCount?: number;
|
|
10
|
+
unchecked?: boolean;
|
|
11
|
+
status?: string | null;
|
|
12
|
+
alreadyPaid?: boolean;
|
|
13
|
+
labels: ReviewBadgeLabels;
|
|
14
|
+
className?: string;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Check, Copy, TriangleAlert, X } from "lucide-react";
|
|
3
|
+
import { cn } from "../../lib/class-names.js";
|
|
4
|
+
export function ReviewBadge({ reasonCount = 0, status, alreadyPaid = false, unchecked = false, labels, className, }) {
|
|
5
|
+
const state = status === "duplikat"
|
|
6
|
+
? "duplicate"
|
|
7
|
+
: status === "ausgeschlossen"
|
|
8
|
+
? "excluded"
|
|
9
|
+
: alreadyPaid
|
|
10
|
+
? "alreadyPaid"
|
|
11
|
+
: reasonCount > 0 || (unchecked && status === "zu_pruefen")
|
|
12
|
+
? "needed"
|
|
13
|
+
: "none";
|
|
14
|
+
return (_jsxs("span", { className: cn("inline-flex items-center gap-1.5 whitespace-nowrap rounded-md px-2 py-0.5 text-xs font-medium", state === "needed"
|
|
15
|
+
? "bg-red-100 text-red-800"
|
|
16
|
+
: state === "duplicate"
|
|
17
|
+
? "bg-orange-100 text-orange-800"
|
|
18
|
+
: state === "excluded"
|
|
19
|
+
? "bg-muted text-muted-foreground"
|
|
20
|
+
: state === "alreadyPaid"
|
|
21
|
+
? "bg-slate-100 text-slate-700"
|
|
22
|
+
: "bg-emerald-100 text-emerald-800", className), children: [state === "none" ? (_jsx(Check, { className: "size-3.5 shrink-0" })) : state === "duplicate" ? (_jsx(Copy, { className: "size-3.5 shrink-0" })) : state === "excluded" ? (_jsx(X, { className: "size-3.5 shrink-0" })) : (_jsx(TriangleAlert, { className: "size-3.5 shrink-0" })), labels[state], state === "needed" && reasonCount > 0 && _jsxs("span", { className: "tabular-nums opacity-70", children: ["\u00B7 ", reasonCount] })] }));
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReviewLine } from "./review";
|
|
2
|
+
export interface ReviewCardLabels {
|
|
3
|
+
title: string;
|
|
4
|
+
checks: (count: number) => string;
|
|
5
|
+
choose: string;
|
|
6
|
+
fix: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ReviewCard({ lines, anchorId, open, onOpenChange, flash, onJump, labels, className, }: {
|
|
9
|
+
lines: ReviewLine[];
|
|
10
|
+
anchorId: string;
|
|
11
|
+
open: boolean;
|
|
12
|
+
onOpenChange: (open: boolean) => void;
|
|
13
|
+
flash: boolean;
|
|
14
|
+
onJump: (tab: string, anchor: string) => void;
|
|
15
|
+
labels: ReviewCardLabels;
|
|
16
|
+
className?: string;
|
|
17
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowRight, ChevronRight, TriangleAlert } from "lucide-react";
|
|
3
|
+
import { cn } from "../../lib/class-names.js";
|
|
4
|
+
import { SEVERITY_ACTION_REQUIRED } from "./review.js";
|
|
5
|
+
export function ReviewCard({ lines, anchorId, open, onOpenChange, flash, onJump, labels, className, }) {
|
|
6
|
+
if (lines.length === 0)
|
|
7
|
+
return null;
|
|
8
|
+
return (_jsxs("details", { id: anchorId, open: open, onToggle: (e) => onOpenChange(e.currentTarget.open), className: cn("group scroll-mt-24 rounded-xl border p-4 text-base transition-shadow duration-500", className, flash && "ring-2 ring-destructive ring-offset-2", "border-destructive/40 bg-destructive/5 text-destructive"), children: [_jsxs("summary", { className: "flex cursor-pointer list-none items-center gap-2 font-medium [&::-webkit-details-marker]:hidden", children: [_jsx(TriangleAlert, { className: "size-4 shrink-0 text-destructive" }), _jsx("span", { className: "min-w-0 flex-1", children: labels.title }), _jsx("span", { className: "shrink-0 text-sm font-normal opacity-80", children: labels.checks(lines.length) }), _jsx(ChevronRight, { className: "size-3.5 shrink-0 opacity-60 transition-transform group-open:rotate-90" })] }), _jsx("ul", { className: "mt-3 list-disc space-y-2 pl-10 marker:text-destructive/60", children: lines.map((r, i) => {
|
|
9
|
+
const fixMark = r.jumpTo ? (_jsxs("button", { type: "button", onClick: () => onJump(r.jumpTo.tab, r.jumpTo.anchor), className: "group/fix inline-flex shrink-0 cursor-pointer items-center gap-0.5 whitespace-nowrap rounded px-1 text-xs font-medium text-destructive underline-offset-4 transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-destructive/40", children: [r.severity === SEVERITY_ACTION_REQUIRED ? labels.choose : labels.fix, _jsx(ArrowRight, { className: "size-3 transition-transform group-hover/fix:translate-x-0.5" })] })) : null;
|
|
10
|
+
return (_jsx("li", { className: "py-0.5 pl-1", children: _jsxs("span", { className: "min-w-0 flex-1", children: [_jsxs("span", { className: "flex flex-wrap items-center gap-x-1.5", children: [r.title && _jsx("span", { className: "min-w-0 truncate font-medium text-foreground", children: r.title }), _jsx("span", { className: cn("text-sm text-muted-foreground", !r.title && "text-base"), children: r.text }), fixMark] }), r.numbers && (_jsx("span", { className: "block text-sm tabular-nums text-muted-foreground", children: r.numbers }))] }) }, `${r.field ?? "-"}-${i}`));
|
|
11
|
+
}) })] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { InvoiceHistoryEntry } from "./pipeline-types";
|
|
2
|
+
export interface WorkflowHistoryRow {
|
|
3
|
+
entry: InvoiceHistoryEntry;
|
|
4
|
+
from: string;
|
|
5
|
+
to: string;
|
|
6
|
+
qualifier: string | null;
|
|
7
|
+
comment: string | null;
|
|
8
|
+
durationMs: number;
|
|
9
|
+
}
|
|
10
|
+
export interface WorkflowHistoryLabels {
|
|
11
|
+
emptyText: string;
|
|
12
|
+
actorSystem: string;
|
|
13
|
+
actingAs: (name: string) => string;
|
|
14
|
+
reason: string;
|
|
15
|
+
arrivedLabel: string;
|
|
16
|
+
formatDateTime: (iso: string) => string;
|
|
17
|
+
durationShort: (value: number, unit: "minuten" | "stunden" | "tage") => string;
|
|
18
|
+
}
|
|
19
|
+
export declare function WorkflowHistoryList({ rows, arrivedAt, labels, }: {
|
|
20
|
+
rows: WorkflowHistoryRow[];
|
|
21
|
+
arrivedAt?: string | null;
|
|
22
|
+
labels: WorkflowHistoryLabels;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowUp } from "lucide-react";
|
|
3
|
+
import { cn } from "../../lib/class-names.js";
|
|
4
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../../ui/tooltip.js";
|
|
5
|
+
function durationParts(ms) {
|
|
6
|
+
const minutes = ms / 60_000;
|
|
7
|
+
if (minutes < 60)
|
|
8
|
+
return { value: Math.max(1, Math.round(minutes)), unit: "minuten" };
|
|
9
|
+
const hours = minutes / 60;
|
|
10
|
+
if (hours < 24)
|
|
11
|
+
return { value: Math.round(hours), unit: "stunden" };
|
|
12
|
+
return { value: Math.round(hours / 24), unit: "tage" };
|
|
13
|
+
}
|
|
14
|
+
export function WorkflowHistoryList({ rows, arrivedAt, labels, }) {
|
|
15
|
+
if (rows.length === 0) {
|
|
16
|
+
return _jsx("p", { className: "text-base text-muted-foreground", children: labels.emptyText });
|
|
17
|
+
}
|
|
18
|
+
const display = [...rows].reverse();
|
|
19
|
+
return (_jsxs("ol", { children: [display.map(({ entry, to, qualifier, comment, durationMs }, i) => {
|
|
20
|
+
const newest = i === 0;
|
|
21
|
+
const duration = durationParts(durationMs);
|
|
22
|
+
const actingAs = entry.data?.handelnd_als;
|
|
23
|
+
const bad = entry.type === "ablehnung" || entry.type === "zahlung_fehlgeschlagen";
|
|
24
|
+
const chipTone = bad
|
|
25
|
+
? "bg-red-100 text-red-800"
|
|
26
|
+
: entry.type === "rueckfrage"
|
|
27
|
+
? "bg-orange-100 text-orange-800"
|
|
28
|
+
: "bg-violet-100 text-violet-800";
|
|
29
|
+
return (_jsxs("li", { className: "flex gap-2", children: [_jsxs("div", { className: "flex w-12 shrink-0 flex-col items-end pr-1", children: [_jsx("span", { className: "mt-1 h-3.5 shrink-0", "aria-hidden": "true" }), duration.value > 0 && (_jsx("span", { className: "flex flex-1 items-center whitespace-nowrap text-xs tabular-nums text-muted-foreground", children: labels.durationShort(duration.value, duration.unit) }))] }), _jsxs("div", { className: "flex w-5 shrink-0 flex-col items-center", children: [_jsx("span", { className: cn("mt-1 size-3.5 shrink-0 rounded-full", bad ? "bg-red-500" : "bg-brand", newest && "ring-2 ring-brand/60 ring-offset-2 ring-offset-card") }), _jsx(ArrowUp, { className: "mt-1.5 size-3.5 shrink-0 text-muted-foreground/70", "aria-hidden": "true" }), _jsx("span", { className: "-mt-1 mb-1 w-0 flex-1 border-l-2 border-muted-foreground/20" })] }), _jsxs("div", { className: "min-w-0 pb-5", children: [_jsxs("div", { className: "w-full flex items-center gap-2", children: [_jsx("p", { className: "text-base font-medium text-foreground", children: to }), _jsxs("p", { className: "mt-0.5 flex min-h-6 flex-wrap items-center gap-1.5 text-sm text-muted-foreground", children: [qualifier &&
|
|
30
|
+
(comment ? (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("span", { tabIndex: 0, className: cn("rounded-md px-1.5 py-0.5 text-xs font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2", chipTone), children: qualifier }) }), _jsx(TooltipContent, { side: "bottom", className: "max-w-[18rem]", children: comment })] })) : (_jsx("span", { className: cn("rounded-md px-1.5 py-0.5 text-xs font-medium", chipTone), children: qualifier }))), !qualifier && comment && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("span", { tabIndex: 0, className: cn("rounded-md px-1.5 py-0.5 text-xs font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2", chipTone), children: labels.reason }) }), _jsx(TooltipContent, { side: "bottom", className: "max-w-[18rem]", children: comment })] }))] })] }), _jsxs("p", { className: "mt-0.5 text-sm text-muted-foreground", children: [entry.actor ?? labels.actorSystem, actingAs && ` · ${labels.actingAs(actingAs)}`, " \u00B7 ", labels.formatDateTime(entry.createdAt)] })] })] }, entry.id));
|
|
31
|
+
}), arrivedAt && (_jsxs("li", { className: "flex gap-2", children: [_jsx("div", { className: "w-12 shrink-0", "aria-hidden": "true" }), _jsx("div", { className: "flex w-5 shrink-0 flex-col items-center", children: _jsx("span", { className: "mt-1 size-3.5 shrink-0 rounded-full bg-brand" }) }), _jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-base font-medium text-foreground", children: labels.arrivedLabel }), _jsx("p", { className: "mt-0.5 text-sm text-muted-foreground", children: labels.formatDateTime(arrivedAt) })] })] }))] }));
|
|
32
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface LadderColors {
|
|
2
|
+
circle: string;
|
|
3
|
+
currentRing: string;
|
|
4
|
+
line: string;
|
|
5
|
+
}
|
|
6
|
+
export interface WorkflowLadderLabels {
|
|
7
|
+
navAriaLabel: string;
|
|
8
|
+
stepLabel: (step: string) => string;
|
|
9
|
+
}
|
|
10
|
+
export declare function WorkflowLadder({ steps, currentStep, since, actions, onAction, hint, labels, ladderColors, className, }: {
|
|
11
|
+
steps: readonly string[];
|
|
12
|
+
currentStep: number;
|
|
13
|
+
since?: string | null;
|
|
14
|
+
actions?: Map<string, unknown>;
|
|
15
|
+
onAction?: (step: string, action: unknown) => void;
|
|
16
|
+
hint?: (step: string) => string;
|
|
17
|
+
labels: WorkflowLadderLabels;
|
|
18
|
+
ladderColors: LadderColors;
|
|
19
|
+
className?: string;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowDown } from "lucide-react";
|
|
3
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../../ui/tooltip.js";
|
|
4
|
+
import { cn } from "../../lib/class-names.js";
|
|
5
|
+
export function WorkflowLadder({ steps, currentStep, since, actions, onAction, hint, labels, ladderColors, className, }) {
|
|
6
|
+
const nextAction = steps.reduce((nearest, step, i) => (nearest == null && actions?.has(step) ? i : nearest), null);
|
|
7
|
+
return (_jsx("ol", { className: cn("flex w-full items-start px-2 sm:px-[4.5rem]", className), "aria-label": labels.navAriaLabel, children: steps.map((step, i) => {
|
|
8
|
+
const last = i === steps.length - 1;
|
|
9
|
+
const reached = currentStep >= 0 && i <= currentStep;
|
|
10
|
+
const current = i === currentStep;
|
|
11
|
+
const action = actions?.get(step) ?? null;
|
|
12
|
+
const dashed = nextAction != null && i >= currentStep && i < nextAction;
|
|
13
|
+
void dashed;
|
|
14
|
+
return (_jsxs("li", { className: cn("flex min-w-0 flex-col", last ? "shrink-0" : "flex-1"), "aria-current": current ? "step" : undefined, children: [_jsx("div", { className: "flex h-4 w-7 items-end justify-center", children: action && (_jsx(ArrowDown, { className: "size-3.5 animate-bounce text-brand motion-reduce:animate-none", "aria-hidden": "true" })) }), _jsxs("div", { className: "flex items-center", children: [action ? (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: () => onAction?.(step, action), "aria-label": hint?.(step) ?? labels.stepLabel(step), className: cn("relative grid size-7 shrink-0 cursor-pointer place-items-center rounded-full border-2 transition-colors before:absolute before:-inset-2 before:content-[''] hover:bg-brand focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2", reached ? ladderColors.circle : "border-brand bg-background", current && ladderColors.currentRing) }) }), _jsx(TooltipContent, { side: "bottom", children: hint?.(step) ?? labels.stepLabel(step) })] })) : (_jsx("span", { className: cn("grid size-7 shrink-0 place-items-center rounded-full border-2", reached ? ladderColors.circle : "border-muted-foreground/30 bg-background", current && ladderColors.currentRing), "aria-hidden": "true" })), !last && (_jsx("span", { className: cn("h-0 min-w-0 flex-1 border-t-2", reached && i < currentStep ? ladderColors.line : "border-muted-foreground/20"), "aria-hidden": "true" }))] }), _jsxs("div", { className: "-ml-[4.5rem] mt-2 w-[9rem] text-center", children: [_jsx("span", { className: cn("block text-sm leading-tight", current ? "font-medium text-foreground" : "text-muted-foreground"), children: labels.stepLabel(step) }), current && since && (_jsx("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: since }))] })] }, step));
|
|
15
|
+
}) }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { InvoiceHistoryEntry } from "./pipeline-types";
|
|
2
|
+
export interface HistoryConfig {
|
|
3
|
+
legacyActionIds: string[];
|
|
4
|
+
actionTargetStatus: Partial<Record<string, string>>;
|
|
5
|
+
approvalHistoryTypes: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface HistoryFormat {
|
|
8
|
+
approvalActionLabelDe: (id: string) => string;
|
|
9
|
+
workflowLabelDe: (status: string) => string;
|
|
10
|
+
workflowOrder: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
export interface HistoryLabels {
|
|
13
|
+
typeLabel: (type: string) => string;
|
|
14
|
+
stateLabel: (targetStatus: string) => string;
|
|
15
|
+
corrected: string;
|
|
16
|
+
queryAdditional: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function historyTypeLabel(type: string, config: HistoryConfig, labels: HistoryLabels): string;
|
|
19
|
+
export declare function historyComment(entry: InvoiceHistoryEntry, config: HistoryConfig, format: HistoryFormat): string | null;
|
|
20
|
+
export declare function historyTargetStatus(entry: InvoiceHistoryEntry, config: HistoryConfig, format: HistoryFormat): string | null;
|
|
21
|
+
export declare function historyStateLabel(entry: InvoiceHistoryEntry, config: HistoryConfig, format: HistoryFormat, labels: HistoryLabels): string;
|
|
22
|
+
export declare function historyQualifier(entry: InvoiceHistoryEntry, labels: HistoryLabels): string | null;
|
|
23
|
+
export declare function historyLines(entry: InvoiceHistoryEntry, config: HistoryConfig, format: HistoryFormat): string[];
|