@spaceinvoices/react-ui 0.1.1 → 0.4.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/cli/dist/index.js +1 -1
- package/package.json +1 -1
- package/registry.json +86 -122
- package/src/components/activities/activity-timeline.tsx +8 -1
- package/src/components/activities/locales/es.ts +30 -0
- package/src/components/activities/locales/fr.ts +30 -0
- package/src/components/activities/locales/hr.ts +30 -0
- package/src/components/activities/locales/it.ts +30 -0
- package/src/components/activities/locales/nl.ts +30 -0
- package/src/components/activities/locales/pl.ts +30 -0
- package/src/components/activities/locales/pt.ts +30 -0
- package/src/components/advance-invoices/advance-invoices.hooks.ts +2 -2
- package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +21 -7
- package/src/components/advance-invoices/create/locales/es.ts +29 -0
- package/src/components/advance-invoices/create/locales/fr.ts +28 -0
- package/src/components/advance-invoices/create/locales/hr.ts +27 -0
- package/src/components/advance-invoices/create/locales/it.ts +29 -0
- package/src/components/advance-invoices/create/locales/nl.ts +28 -0
- package/src/components/advance-invoices/create/locales/pl.ts +28 -0
- package/src/components/advance-invoices/create/locales/pt.ts +29 -0
- package/src/components/advance-invoices/create/prepare-advance-invoice-submission.ts +3 -3
- package/src/components/advance-invoices/list/list-table.tsx +20 -3
- package/src/components/advance-invoices/list/locales/de.ts +9 -0
- package/src/components/advance-invoices/list/locales/en.ts +8 -0
- package/src/components/advance-invoices/list/locales/es.ts +41 -0
- package/src/components/advance-invoices/list/locales/fr.ts +41 -0
- package/src/components/advance-invoices/list/locales/hr.ts +41 -0
- package/src/components/advance-invoices/list/locales/it.ts +41 -0
- package/src/components/advance-invoices/list/locales/nl.ts +41 -0
- package/src/components/advance-invoices/list/locales/pl.ts +41 -0
- package/src/components/advance-invoices/list/locales/pt.ts +41 -0
- package/src/components/advance-invoices/list/locales/sl.ts +9 -0
- package/src/components/credit-notes/create/create-credit-note-form.tsx +19 -5
- package/src/components/credit-notes/create/locales/es.ts +68 -0
- package/src/components/credit-notes/create/locales/fr.ts +69 -0
- package/src/components/credit-notes/create/locales/hr.ts +68 -0
- package/src/components/credit-notes/create/locales/it.ts +68 -0
- package/src/components/credit-notes/create/locales/nl.ts +69 -0
- package/src/components/credit-notes/create/locales/pl.ts +68 -0
- package/src/components/credit-notes/create/locales/pt.ts +68 -0
- package/src/components/credit-notes/list/list-table.tsx +25 -8
- package/src/components/credit-notes/list/locales/de.ts +10 -2
- package/src/components/credit-notes/list/locales/en.ts +8 -0
- package/src/components/credit-notes/list/locales/es.ts +41 -0
- package/src/components/credit-notes/list/locales/fr.ts +41 -0
- package/src/components/credit-notes/list/locales/hr.ts +41 -0
- package/src/components/credit-notes/list/locales/it.ts +41 -0
- package/src/components/credit-notes/list/locales/nl.ts +41 -0
- package/src/components/credit-notes/list/locales/pl.ts +41 -0
- package/src/components/credit-notes/list/locales/pt.ts +41 -0
- package/src/components/credit-notes/list/locales/sl.ts +10 -2
- package/src/components/customers/create-customer-form/create-customer-form.tsx +21 -3
- package/src/components/customers/create-customer-form/locales/de.ts +1 -0
- package/src/components/customers/create-customer-form/locales/es.ts +21 -0
- package/src/components/customers/create-customer-form/locales/fr.ts +21 -0
- package/src/components/customers/create-customer-form/locales/hr.ts +21 -0
- package/src/components/customers/create-customer-form/locales/it.ts +21 -0
- package/src/components/customers/create-customer-form/locales/nl.ts +21 -0
- package/src/components/customers/create-customer-form/locales/pl.ts +21 -0
- package/src/components/customers/create-customer-form/locales/pt.ts +21 -0
- package/src/components/customers/create-customer-form/locales/sl.ts +1 -0
- package/src/components/customers/customer-list-table/customer-list-row-actions.tsx +72 -16
- package/src/components/customers/customer-list-table/customer-list-table.tsx +35 -2
- package/src/components/customers/customer-list-table/locales/de.ts +9 -0
- package/src/components/customers/customer-list-table/locales/en.ts +10 -0
- package/src/components/customers/customer-list-table/locales/es.ts +25 -0
- package/src/components/customers/customer-list-table/locales/fr.ts +25 -0
- package/src/components/customers/customer-list-table/locales/hr.ts +25 -0
- package/src/components/customers/customer-list-table/locales/it.ts +25 -0
- package/src/components/customers/customer-list-table/locales/nl.ts +25 -0
- package/src/components/customers/customer-list-table/locales/pl.ts +25 -0
- package/src/components/customers/customer-list-table/locales/pt.ts +25 -0
- package/src/components/customers/customer-list-table/locales/sl.ts +9 -0
- package/src/components/customers/customers.hooks.test.ts +8 -8
- package/src/components/customers/customers.hooks.ts +6 -1
- package/src/components/customers/edit-customer-form/edit-customer-form.tsx +143 -0
- package/src/components/customers/edit-customer-form/locales/de.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/es.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/fr.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/hr.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/it.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/nl.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/pl.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/pt.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/sl.ts +13 -0
- package/src/components/customers/index.ts +1 -0
- package/src/components/dashboard/collection-rate-card/collection-rate-card.tsx +9 -1
- package/src/components/dashboard/collection-rate-card/locales/de.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/es.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/fr.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/hr.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/it.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/nl.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/pl.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/pt.ts +3 -0
- package/src/components/dashboard/invoice-status-chart/invoice-status-chart.tsx +9 -1
- package/src/components/dashboard/invoice-status-chart/locales/de.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/locales/es.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/locales/fr.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/locales/hr.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/locales/it.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/locales/nl.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/locales/pl.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/locales/pt.ts +9 -0
- package/src/components/dashboard/payment-methods-chart/locales/de.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/es.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/fr.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/hr.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/it.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/nl.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/pl.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/pt.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/payment-methods-chart.tsx +9 -1
- package/src/components/dashboard/payment-trend-chart/locales/de.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/locales/es.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/locales/fr.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/locales/hr.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/locales/it.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/locales/nl.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/locales/pl.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/locales/pt.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/payment-trend-chart.tsx +10 -2
- package/src/components/dashboard/revenue-trend-chart/locales/de.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/locales/es.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/locales/fr.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/locales/hr.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/locales/it.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/locales/nl.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/locales/pl.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/locales/pt.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/revenue-trend-chart.tsx +10 -2
- package/src/components/dashboard/top-customers-chart/locales/de.ts +5 -0
- package/src/components/dashboard/top-customers-chart/locales/es.ts +5 -0
- package/src/components/dashboard/top-customers-chart/locales/fr.ts +5 -0
- package/src/components/dashboard/top-customers-chart/locales/hr.ts +5 -0
- package/src/components/dashboard/top-customers-chart/locales/it.ts +5 -0
- package/src/components/dashboard/top-customers-chart/locales/nl.ts +5 -0
- package/src/components/dashboard/top-customers-chart/locales/pl.ts +5 -0
- package/src/components/dashboard/top-customers-chart/locales/pt.ts +5 -0
- package/src/components/dashboard/top-customers-chart/top-customers-chart.tsx +10 -2
- package/src/components/documents/create/document-add-item-form.tsx +1 -1
- package/src/components/documents/create/form-types.ts +1 -5
- package/src/components/documents/create/mark-as-paid-section.tsx +60 -23
- package/src/components/documents/create/prepare-document-submission.test.ts +2 -2
- package/src/components/documents/create/prepare-document-submission.ts +12 -7
- package/src/components/documents/create/prepare-preview-data.test.ts +1 -1
- package/src/components/documents/documents.hooks.ts +5 -48
- package/src/components/documents/shared/document-preview-display.tsx +12 -1
- package/src/components/documents/view/document-actions-bar.tsx +28 -13
- package/src/components/documents/view/document-activities-list.tsx +166 -0
- package/src/components/documents/view/document-details-card.tsx +14 -7
- package/src/components/documents/view/document-payments-list.tsx +8 -1
- package/src/components/documents/view/index.ts +1 -0
- package/src/components/documents/view/locales/de.ts +32 -0
- package/src/components/documents/view/locales/es.ts +115 -0
- package/src/components/documents/view/locales/fr.ts +115 -0
- package/src/components/documents/view/locales/hr.ts +115 -0
- package/src/components/documents/view/locales/it.ts +115 -0
- package/src/components/documents/view/locales/nl.ts +116 -0
- package/src/components/documents/view/locales/pl.ts +115 -0
- package/src/components/documents/view/locales/pt.ts +115 -0
- package/src/components/documents/view/locales/sl.ts +32 -0
- package/src/components/entities/create-entity-form.tsx +12 -2
- package/src/components/entities/entity-settings-form/entity-settings-form.tsx +18 -0
- package/src/components/entities/entity-settings-form/locales/de.ts +3 -1
- package/src/components/entities/entity-settings-form/locales/es.ts +197 -0
- package/src/components/entities/entity-settings-form/locales/fr.ts +196 -0
- package/src/components/entities/entity-settings-form/locales/hr.ts +189 -0
- package/src/components/entities/entity-settings-form/locales/it.ts +195 -0
- package/src/components/entities/entity-settings-form/locales/nl.ts +192 -0
- package/src/components/entities/entity-settings-form/locales/pl.ts +193 -0
- package/src/components/entities/entity-settings-form/locales/pt.ts +194 -0
- package/src/components/entities/entity-settings-form/locales/sl.ts +2 -0
- package/src/components/entities/fina-settings-form/fina-settings-form.tsx +461 -0
- package/src/components/entities/fina-settings-form/fina-settings.hooks.ts +215 -0
- package/src/components/entities/fina-settings-form/index.ts +3 -0
- package/src/components/entities/fina-settings-form/locales/de.ts +148 -0
- package/src/components/entities/fina-settings-form/locales/en.ts +145 -0
- package/src/components/entities/fina-settings-form/locales/es.ts +146 -0
- package/src/components/entities/fina-settings-form/locales/fr.ts +145 -0
- package/src/components/entities/fina-settings-form/locales/hr.ts +147 -0
- package/src/components/entities/fina-settings-form/locales/it.ts +147 -0
- package/src/components/entities/fina-settings-form/locales/nl.ts +147 -0
- package/src/components/entities/fina-settings-form/locales/pl.ts +145 -0
- package/src/components/entities/fina-settings-form/locales/pt.ts +147 -0
- package/src/components/entities/fina-settings-form/locales/sl.ts +147 -0
- package/src/components/entities/fina-settings-form/sections/certificate-settings-section.tsx +233 -0
- package/src/components/entities/fina-settings-form/sections/premises-management-section.tsx +363 -0
- package/src/components/entities/fina-settings-form/sections/register-premise-dialog.tsx +395 -0
- package/src/components/entities/furs-settings-form/furs-settings-form.tsx +24 -9
- package/src/components/entities/furs-settings-form/furs-settings.hooks.ts +15 -11
- package/src/components/entities/furs-settings-form/locales/de.ts +54 -88
- package/src/components/entities/furs-settings-form/locales/en.ts +15 -0
- package/src/components/entities/furs-settings-form/locales/es.ts +198 -0
- package/src/components/entities/furs-settings-form/locales/fr.ts +198 -0
- package/src/components/entities/furs-settings-form/locales/hr.ts +197 -0
- package/src/components/entities/furs-settings-form/locales/it.ts +198 -0
- package/src/components/entities/furs-settings-form/locales/nl.ts +197 -0
- package/src/components/entities/furs-settings-form/locales/pl.ts +196 -0
- package/src/components/entities/furs-settings-form/locales/pt.ts +197 -0
- package/src/components/entities/furs-settings-form/locales/sl.ts +16 -0
- package/src/components/entities/furs-settings-form/sections/certificate-settings-section.tsx +19 -4
- package/src/components/entities/furs-settings-form/sections/general-settings-section.tsx +121 -1
- package/src/components/entities/furs-settings-form/sections/register-premise-dialog.tsx +17 -66
- package/src/components/entities/keys.ts +1 -1
- package/src/components/entities/settings/company-settings-form.tsx +28 -0
- package/src/components/entities/settings/pdf-template-selector/locales/es.ts +18 -0
- package/src/components/entities/settings/pdf-template-selector/locales/fr.ts +18 -0
- package/src/components/entities/settings/pdf-template-selector/locales/hr.ts +18 -0
- package/src/components/entities/settings/pdf-template-selector/locales/it.ts +18 -0
- package/src/components/entities/settings/pdf-template-selector/locales/nl.ts +17 -0
- package/src/components/entities/settings/pdf-template-selector/locales/pl.ts +18 -0
- package/src/components/entities/settings/pdf-template-selector/locales/pt.ts +18 -0
- package/src/components/estimates/create/create-estimate-form.tsx +14 -0
- package/src/components/estimates/create/locales/es.ts +57 -0
- package/src/components/estimates/create/locales/fr.ts +58 -0
- package/src/components/estimates/create/locales/hr.ts +57 -0
- package/src/components/estimates/create/locales/it.ts +57 -0
- package/src/components/estimates/create/locales/nl.ts +58 -0
- package/src/components/estimates/create/locales/pl.ts +57 -0
- package/src/components/estimates/create/locales/pt.ts +58 -0
- package/src/components/estimates/create/prepare-estimate-submission.ts +1 -1
- package/src/components/estimates/list/list-table.tsx +20 -3
- package/src/components/estimates/list/locales/de.ts +9 -0
- package/src/components/estimates/list/locales/en.ts +8 -0
- package/src/components/estimates/list/locales/es.ts +32 -0
- package/src/components/estimates/list/locales/fr.ts +32 -0
- package/src/components/estimates/list/locales/hr.ts +32 -0
- package/src/components/estimates/list/locales/it.ts +32 -0
- package/src/components/estimates/list/locales/nl.ts +32 -0
- package/src/components/estimates/list/locales/pl.ts +32 -0
- package/src/components/estimates/list/locales/pt.ts +32 -0
- package/src/components/estimates/list/locales/sl.ts +9 -0
- package/src/components/export/document-export-form.tsx +0 -2
- package/src/components/invoices/create/create-invoice-form.tsx +24 -10
- package/src/components/invoices/create/eslog-validation.test.ts +2 -0
- package/src/components/invoices/create/locales/es.ts +103 -0
- package/src/components/invoices/create/locales/fr.ts +105 -0
- package/src/components/invoices/create/locales/hr.ts +103 -0
- package/src/components/invoices/create/locales/it.ts +105 -0
- package/src/components/invoices/create/locales/nl.ts +104 -0
- package/src/components/invoices/create/locales/pl.ts +104 -0
- package/src/components/invoices/create/locales/pt.ts +105 -0
- package/src/components/invoices/create/prepare-invoice-submission.test.ts +54 -55
- package/src/components/invoices/create/prepare-invoice-submission.ts +3 -3
- package/src/components/invoices/index.ts +1 -1
- package/src/components/invoices/list/list-table.tsx +20 -3
- package/src/components/invoices/list/locales/de.ts +9 -0
- package/src/components/invoices/list/locales/en.ts +8 -0
- package/src/components/invoices/list/locales/es.ts +42 -0
- package/src/components/invoices/list/locales/fr.ts +42 -0
- package/src/components/invoices/list/locales/hr.ts +42 -0
- package/src/components/invoices/list/locales/it.ts +42 -0
- package/src/components/invoices/list/locales/nl.ts +42 -0
- package/src/components/invoices/list/locales/pl.ts +42 -0
- package/src/components/invoices/list/locales/pt.ts +42 -0
- package/src/components/invoices/list/locales/sl.ts +9 -0
- package/src/components/invoices/send-email-dialog/locales/es.ts +18 -0
- package/src/components/invoices/send-email-dialog/locales/fr.ts +18 -0
- package/src/components/invoices/send-email-dialog/locales/hr.ts +17 -0
- package/src/components/invoices/send-email-dialog/locales/it.ts +18 -0
- package/src/components/invoices/send-email-dialog/locales/nl.ts +18 -0
- package/src/components/invoices/send-email-dialog/locales/pl.ts +18 -0
- package/src/components/invoices/send-email-dialog/locales/pt.ts +18 -0
- package/src/components/invoices/send-email-dialog/send-email-dialog.tsx +22 -14
- package/src/components/invoices/shared/scaled-document-preview.tsx +1 -0
- package/src/components/invoices/view/eslog-info-display.tsx +1 -0
- package/src/components/invoices/view/fiscalization-status-card.tsx +121 -0
- package/src/components/items/create-item-form/create-item-form.tsx +14 -0
- package/src/components/items/create-item-form/locales/en.ts +5 -0
- package/src/components/items/create-item-form/locales/es.ts +14 -0
- package/src/components/items/create-item-form/locales/fr.ts +14 -0
- package/src/components/items/create-item-form/locales/hr.ts +14 -0
- package/src/components/items/create-item-form/locales/it.ts +14 -0
- package/src/components/items/create-item-form/locales/nl.ts +14 -0
- package/src/components/items/create-item-form/locales/pl.ts +14 -0
- package/src/components/items/create-item-form/locales/pt.ts +14 -0
- package/src/components/items/edit-item-form/edit-item-form.tsx +170 -0
- package/src/components/items/edit-item-form/locales/de.ts +12 -0
- package/src/components/items/edit-item-form/locales/es.ts +12 -0
- package/src/components/items/edit-item-form/locales/fr.ts +12 -0
- package/src/components/items/edit-item-form/locales/hr.ts +12 -0
- package/src/components/items/edit-item-form/locales/it.ts +12 -0
- package/src/components/items/edit-item-form/locales/nl.ts +12 -0
- package/src/components/items/edit-item-form/locales/pl.ts +12 -0
- package/src/components/items/edit-item-form/locales/pt.ts +12 -0
- package/src/components/items/edit-item-form/locales/sl.ts +12 -0
- package/src/components/items/item-list-table/item-list-table.tsx +20 -13
- package/src/components/items/item-list-table/locales/de.ts +6 -0
- package/src/components/items/item-list-table/locales/en.ts +5 -0
- package/src/components/items/item-list-table/locales/es.ts +16 -0
- package/src/components/items/item-list-table/locales/fr.ts +16 -0
- package/src/components/items/item-list-table/locales/hr.ts +16 -0
- package/src/components/items/item-list-table/locales/it.ts +16 -0
- package/src/components/items/item-list-table/locales/nl.ts +16 -0
- package/src/components/items/item-list-table/locales/pl.ts +16 -0
- package/src/components/items/item-list-table/locales/pt.ts +16 -0
- package/src/components/items/item-list-table/locales/sl.ts +6 -0
- package/src/components/items/items.hooks.ts +7 -2
- package/src/components/payments/create-payment-form/create-payment-form.tsx +14 -0
- package/src/components/payments/create-payment-form/locales/es.ts +20 -0
- package/src/components/payments/create-payment-form/locales/fr.ts +20 -0
- package/src/components/payments/create-payment-form/locales/hr.ts +20 -0
- package/src/components/payments/create-payment-form/locales/it.ts +20 -0
- package/src/components/payments/create-payment-form/locales/nl.ts +20 -0
- package/src/components/payments/create-payment-form/locales/pl.ts +20 -0
- package/src/components/payments/create-payment-form/locales/pt.ts +20 -0
- package/src/components/payments/edit-payment-form/edit-payment-form.tsx +18 -2
- package/src/components/payments/edit-payment-form/locales/es.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/fr.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/hr.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/it.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/nl.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/pl.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/pt.ts +20 -0
- package/src/components/payments/list/list-row-actions.tsx +14 -0
- package/src/components/payments/list/list-table.tsx +21 -2
- package/src/components/payments/list/locales/de.ts +6 -0
- package/src/components/payments/list/locales/en.ts +7 -0
- package/src/components/payments/list/locales/es.ts +25 -0
- package/src/components/payments/list/locales/fr.ts +25 -0
- package/src/components/payments/list/locales/hr.ts +25 -0
- package/src/components/payments/list/locales/it.ts +25 -0
- package/src/components/payments/list/locales/nl.ts +25 -0
- package/src/components/payments/list/locales/pl.ts +25 -0
- package/src/components/payments/list/locales/pt.ts +25 -0
- package/src/components/payments/list/locales/sl.ts +6 -0
- package/src/components/payments/payments.hooks.ts +7 -2
- package/src/components/request-logs/index.ts +1 -1
- package/src/components/table/data-table.tsx +8 -3
- package/src/components/table/filter-panel.tsx +4 -4
- package/src/components/table/hooks/use-table-query.ts +3 -0
- package/src/components/table/table-empty-state.tsx +11 -4
- package/src/components/table/table-no-results.tsx +6 -4
- package/src/components/table/types.ts +2 -2
- package/src/components/tax-reports/kir-export-form.tsx +0 -1
- package/src/components/taxes/create-tax-form/create-tax-form.tsx +14 -0
- package/src/components/taxes/create-tax-form/locales/en.ts +1 -0
- package/src/components/taxes/create-tax-form/locales/es.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/fr.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/hr.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/it.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/nl.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/pl.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/pt.ts +8 -0
- package/src/components/taxes/edit-tax-form/edit-tax-form.tsx +119 -0
- package/src/components/taxes/edit-tax-form/locales/de.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/es.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/fr.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/hr.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/it.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/nl.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/pl.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/pt.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/sl.ts +6 -0
- package/src/components/taxes/tax-list-table/locales/de.ts +6 -0
- package/src/components/taxes/tax-list-table/locales/en.ts +6 -0
- package/src/components/taxes/tax-list-table/locales/es.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/fr.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/hr.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/it.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/nl.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/pl.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/pt.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/sl.ts +6 -0
- package/src/components/taxes/tax-list-table/tax-list-table.tsx +18 -0
- package/src/components/taxes/taxes.hooks.ts +12 -7
- package/src/components/ui/tooltip.tsx +2 -2
- package/src/components/wl-subscription/locked-feature.tsx +1 -0
- package/src/components/wl-subscription/upgrade-modal.tsx +1 -0
- package/src/generated/schemas/acceptentityinvitation_body.ts +17 -0
- package/src/generated/schemas/addentityuser_body.ts +18 -0
- package/src/generated/schemas/advanceinvoice.ts +184 -12
- package/src/generated/schemas/creditnote.ts +99 -127
- package/src/generated/schemas/customadvanceinvoice.ts +246 -0
- package/src/generated/schemas/customcreditnote.ts +237 -0
- package/src/generated/schemas/customer.ts +26 -0
- package/src/generated/schemas/customestimate.ts +181 -0
- package/src/generated/schemas/custominvoice.ts +237 -0
- package/src/generated/schemas/entity.ts +66 -7
- package/src/generated/schemas/entityuserrole.ts +19 -0
- package/src/generated/schemas/estimate.ts +149 -1
- package/src/generated/schemas/finasettings.ts +25 -0
- package/src/generated/schemas/furssettings.ts +1 -2
- package/src/generated/schemas/index.ts +24 -5
- package/src/generated/schemas/invoice.ts +224 -22
- package/src/generated/schemas/me.ts +22 -0
- package/src/generated/schemas/registerfinamovablepremise_body.ts +26 -0
- package/src/generated/schemas/registerfinarealestatepremise_body.ts +37 -0
- package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +342 -0
- package/src/generated/schemas/rendercreditnotepreview_body.ts +344 -0
- package/src/generated/schemas/renderestimatepreview_body.ts +284 -0
- package/src/generated/schemas/renderinvoicepreview_body.ts +344 -0
- package/src/generated/schemas/senddocument_body.ts +23 -0
- package/src/generated/schemas/sendemail_body.ts +8 -10
- package/src/generated/schemas/stripeappconnect_body.ts +18 -0
- package/src/generated/schemas/stripeappcreateinvoice_body.ts +20 -0
- package/src/generated/schemas/stripeappupdatesettings_body.ts +26 -0
- package/src/generated/schemas/webhook.ts +143 -0
- package/src/hooks/create-resource-hooks.ts +85 -1
- package/src/hooks/use-duplicate-document.ts +19 -11
- package/src/hooks/use-next-document-number.ts +1 -1
- package/src/hooks/use-resource-mutation.ts +4 -3
- package/src/lib/browser-cookies.ts +12 -1
- package/src/lib/cookies.ts +2 -2
- package/src/lib/translation.ts +1 -1
- package/src/providers/entities-provider.tsx +105 -39
- package/src/providers/sdk-provider.tsx +7 -3
- package/src/providers/white-label-provider.tsx +5 -2
- package/src/providers/wl-subscription-provider.tsx +1 -0
- package/src/components/invoices/view/furs-info-display.tsx +0 -213
|
@@ -6,10 +6,18 @@ import { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } f
|
|
|
6
6
|
import { createTranslation } from "@/ui/lib/translation";
|
|
7
7
|
import { ChartEmptyState } from "../chart-empty-state";
|
|
8
8
|
import { LoadingCard } from "../loading-card";
|
|
9
|
+
import de from "./locales/de";
|
|
10
|
+
import es from "./locales/es";
|
|
11
|
+
import fr from "./locales/fr";
|
|
12
|
+
import hr from "./locales/hr";
|
|
13
|
+
import it from "./locales/it";
|
|
14
|
+
import nl from "./locales/nl";
|
|
15
|
+
import pl from "./locales/pl";
|
|
16
|
+
import pt from "./locales/pt";
|
|
9
17
|
import sl from "./locales/sl";
|
|
10
18
|
import { usePaymentTrendData } from "./use-payment-trend";
|
|
11
19
|
|
|
12
|
-
const translations = { sl } as const;
|
|
20
|
+
const translations = { sl, de, it, fr, es, pt, nl, pl, hr } as const;
|
|
13
21
|
|
|
14
22
|
export type PaymentTrendChartData = { month: string; amount: number }[];
|
|
15
23
|
|
|
@@ -113,7 +121,7 @@ export function PaymentTrendChart(props: PaymentTrendChartProps) {
|
|
|
113
121
|
cursor={false}
|
|
114
122
|
content={
|
|
115
123
|
<ChartTooltipContent
|
|
116
|
-
labelFormatter={(label) => formatMonth(label, locale)}
|
|
124
|
+
labelFormatter={(label) => formatMonth(String(label), locale)}
|
|
117
125
|
formatter={(value) => formatCurrency(Number(value), currency, locale)}
|
|
118
126
|
/>
|
|
119
127
|
}
|
|
@@ -6,10 +6,18 @@ import { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } f
|
|
|
6
6
|
import { createTranslation } from "@/ui/lib/translation";
|
|
7
7
|
import { ChartEmptyState } from "../chart-empty-state";
|
|
8
8
|
import { LoadingCard } from "../loading-card";
|
|
9
|
+
import de from "./locales/de";
|
|
10
|
+
import es from "./locales/es";
|
|
11
|
+
import fr from "./locales/fr";
|
|
12
|
+
import hr from "./locales/hr";
|
|
13
|
+
import it from "./locales/it";
|
|
14
|
+
import nl from "./locales/nl";
|
|
15
|
+
import pl from "./locales/pl";
|
|
16
|
+
import pt from "./locales/pt";
|
|
9
17
|
import sl from "./locales/sl";
|
|
10
18
|
import { useRevenueTrendData } from "./use-revenue-trend";
|
|
11
19
|
|
|
12
|
-
const translations = { sl } as const;
|
|
20
|
+
const translations = { sl, de, it, fr, es, pt, nl, pl, hr } as const;
|
|
13
21
|
|
|
14
22
|
export type RevenueTrendChartData = { month: string; revenue: number }[];
|
|
15
23
|
|
|
@@ -113,7 +121,7 @@ export function RevenueTrendChart(props: RevenueTrendChartProps) {
|
|
|
113
121
|
cursor={false}
|
|
114
122
|
content={
|
|
115
123
|
<ChartTooltipContent
|
|
116
|
-
labelFormatter={(label) => formatMonth(label, locale)}
|
|
124
|
+
labelFormatter={(label) => formatMonth(String(label), locale)}
|
|
117
125
|
formatter={(value) => formatCurrency(Number(value), currency, locale)}
|
|
118
126
|
/>
|
|
119
127
|
}
|
|
@@ -6,10 +6,18 @@ import { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } f
|
|
|
6
6
|
import { createTranslation } from "@/ui/lib/translation";
|
|
7
7
|
import { ChartEmptyState } from "../chart-empty-state";
|
|
8
8
|
import { LoadingCard } from "../loading-card";
|
|
9
|
+
import de from "./locales/de";
|
|
10
|
+
import es from "./locales/es";
|
|
11
|
+
import fr from "./locales/fr";
|
|
12
|
+
import hr from "./locales/hr";
|
|
13
|
+
import it from "./locales/it";
|
|
14
|
+
import nl from "./locales/nl";
|
|
15
|
+
import pl from "./locales/pl";
|
|
16
|
+
import pt from "./locales/pt";
|
|
9
17
|
import sl from "./locales/sl";
|
|
10
18
|
import { useTopCustomersData } from "./use-top-customers";
|
|
11
19
|
|
|
12
|
-
const translations = { sl } as const;
|
|
20
|
+
const translations = { sl, de, it, fr, es, pt, nl, pl, hr } as const;
|
|
13
21
|
|
|
14
22
|
export type TopCustomersChartData = { name: string; revenue: number }[];
|
|
15
23
|
|
|
@@ -106,7 +114,7 @@ export function TopCustomersChart(props: TopCustomersChartProps) {
|
|
|
106
114
|
cursor={false}
|
|
107
115
|
content={
|
|
108
116
|
<ChartTooltipContent
|
|
109
|
-
labelFormatter={(_, payload) => payload?.[0]?.payload?.name || ""}
|
|
117
|
+
labelFormatter={(_, payload): React.ReactNode => String(payload?.[0]?.payload?.name || "")}
|
|
110
118
|
formatter={(value) => formatCurrency(Number(value), currency, locale)}
|
|
111
119
|
/>
|
|
112
120
|
}
|
|
@@ -4,14 +4,13 @@
|
|
|
4
4
|
* This file provides type utilities to handle react-hook-form's complex generic types
|
|
5
5
|
* when passing control and other form utilities between components.
|
|
6
6
|
*/
|
|
7
|
-
import type { Control,
|
|
7
|
+
import type { Control, UseFormGetValues, UseFormSetValue, UseFormWatch } from "react-hook-form";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A more permissive Control type that accepts any form control.
|
|
11
11
|
* Use this in component props when the component doesn't need to know
|
|
12
12
|
* the exact form type, only that it has certain fields.
|
|
13
13
|
*/
|
|
14
|
-
// biome-ignore lint/suspicious/noExplicitAny: Required for react-hook-form compatibility
|
|
15
14
|
export type AnyControl = Control<any, any, any>;
|
|
16
15
|
|
|
17
16
|
/**
|
|
@@ -20,11 +19,8 @@ export type AnyControl = Control<any, any, any>;
|
|
|
20
19
|
*/
|
|
21
20
|
export type DocumentFormSectionProps = {
|
|
22
21
|
control: AnyControl;
|
|
23
|
-
// biome-ignore lint/suspicious/noExplicitAny: Required for react-hook-form compatibility
|
|
24
22
|
watch: UseFormWatch<any>;
|
|
25
|
-
// biome-ignore lint/suspicious/noExplicitAny: Required for react-hook-form compatibility
|
|
26
23
|
setValue: UseFormSetValue<any>;
|
|
27
|
-
// biome-ignore lint/suspicious/noExplicitAny: Required for react-hook-form compatibility
|
|
28
24
|
getValues: UseFormGetValues<any>;
|
|
29
25
|
};
|
|
30
26
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { HelpCircle } from "lucide-react";
|
|
1
|
+
import { HelpCircle, Plus, Trash2 } from "lucide-react";
|
|
2
|
+
import { Button } from "@/ui/components/ui/button";
|
|
2
3
|
import { Checkbox } from "@/ui/components/ui/checkbox";
|
|
3
4
|
import { Label } from "@/ui/components/ui/label";
|
|
4
5
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/ui/components/ui/select";
|
|
@@ -22,10 +23,10 @@ type MarkAsPaidSectionProps = {
|
|
|
22
23
|
checked: boolean;
|
|
23
24
|
/** Called when the checkbox changes */
|
|
24
25
|
onCheckedChange: (checked: boolean) => void;
|
|
25
|
-
/** Selected payment
|
|
26
|
-
|
|
27
|
-
/** Called when payment
|
|
28
|
-
|
|
26
|
+
/** Selected payment types */
|
|
27
|
+
paymentTypes: string[];
|
|
28
|
+
/** Called when payment types change */
|
|
29
|
+
onPaymentTypesChange: (values: string[]) => void;
|
|
29
30
|
/** Translation function */
|
|
30
31
|
t: (key: string) => string;
|
|
31
32
|
};
|
|
@@ -33,12 +34,12 @@ type MarkAsPaidSectionProps = {
|
|
|
33
34
|
export function MarkAsPaidSection({
|
|
34
35
|
checked,
|
|
35
36
|
onCheckedChange,
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
paymentTypes,
|
|
38
|
+
onPaymentTypesChange,
|
|
38
39
|
t,
|
|
39
40
|
}: MarkAsPaidSectionProps) {
|
|
40
41
|
return (
|
|
41
|
-
<div className={cn("flex flex-col gap-4 rounded-md border p-4", checked && "
|
|
42
|
+
<div className={cn("flex flex-col gap-4 rounded-md border p-4", checked && "gap-3")}>
|
|
42
43
|
<div className="flex flex-row items-center space-x-3 space-y-0">
|
|
43
44
|
<Checkbox checked={checked} onCheckedChange={(v) => onCheckedChange(v === true)} />
|
|
44
45
|
<div className="flex items-center gap-1 leading-none">
|
|
@@ -61,21 +62,57 @@ export function MarkAsPaidSection({
|
|
|
61
62
|
</div>
|
|
62
63
|
|
|
63
64
|
{checked && (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
<div className="flex flex-col gap-2">
|
|
66
|
+
{paymentTypes.map((type, index) => (
|
|
67
|
+
<div key={index} className="flex items-center gap-2">
|
|
68
|
+
<Select
|
|
69
|
+
value={type}
|
|
70
|
+
onValueChange={(v) => {
|
|
71
|
+
if (v) {
|
|
72
|
+
const updated = [...paymentTypes];
|
|
73
|
+
updated[index] = v;
|
|
74
|
+
onPaymentTypesChange(updated);
|
|
75
|
+
}
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
<SelectTrigger className="w-full md:w-fit">
|
|
79
|
+
<SelectValue placeholder={t("Select payment type")}>{t(PAYMENT_TYPE_LABELS[type])}</SelectValue>
|
|
80
|
+
</SelectTrigger>
|
|
81
|
+
<SelectContent>
|
|
82
|
+
{regularPaymentTypes.map((pt) => (
|
|
83
|
+
<SelectItem key={pt} value={pt}>
|
|
84
|
+
{t(PAYMENT_TYPE_LABELS[pt])}
|
|
85
|
+
</SelectItem>
|
|
86
|
+
))}
|
|
87
|
+
</SelectContent>
|
|
88
|
+
</Select>
|
|
89
|
+
{paymentTypes.length > 1 && (
|
|
90
|
+
<Button
|
|
91
|
+
type="button"
|
|
92
|
+
variant="ghost"
|
|
93
|
+
size="icon"
|
|
94
|
+
className="size-8 shrink-0"
|
|
95
|
+
onClick={() => {
|
|
96
|
+
const updated = paymentTypes.filter((_, i) => i !== index);
|
|
97
|
+
onPaymentTypesChange(updated);
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
100
|
+
<Trash2 className="size-4 text-muted-foreground" />
|
|
101
|
+
</Button>
|
|
102
|
+
)}
|
|
103
|
+
</div>
|
|
104
|
+
))}
|
|
105
|
+
<Button
|
|
106
|
+
type="button"
|
|
107
|
+
variant="ghost"
|
|
108
|
+
size="sm"
|
|
109
|
+
className="w-fit gap-1 text-muted-foreground"
|
|
110
|
+
onClick={() => onPaymentTypesChange([...paymentTypes, "bank_transfer"])}
|
|
111
|
+
>
|
|
112
|
+
<Plus className="size-4" />
|
|
113
|
+
{t("Add payment")}
|
|
114
|
+
</Button>
|
|
115
|
+
</div>
|
|
79
116
|
)}
|
|
80
117
|
</div>
|
|
81
118
|
);
|
|
@@ -121,12 +121,12 @@ describe("prepareDocumentSubmission", () => {
|
|
|
121
121
|
documentType: "invoice",
|
|
122
122
|
isDraft: true,
|
|
123
123
|
markAsPaid: true,
|
|
124
|
-
|
|
124
|
+
paymentTypes: ["cash"],
|
|
125
125
|
});
|
|
126
126
|
|
|
127
127
|
// Both flags can technically be set, though the form logic prevents this
|
|
128
128
|
expect(result.is_draft).toBe(true);
|
|
129
|
-
expect(result.
|
|
129
|
+
expect(result.payments).toBeDefined();
|
|
130
130
|
});
|
|
131
131
|
});
|
|
132
132
|
});
|
|
@@ -30,8 +30,8 @@ type PrepareDocumentOptions = {
|
|
|
30
30
|
wasCustomerFormShown?: boolean;
|
|
31
31
|
/** For invoices/credit notes: whether to mark as paid */
|
|
32
32
|
markAsPaid?: boolean;
|
|
33
|
-
/** For invoices/credit notes: payment
|
|
34
|
-
|
|
33
|
+
/** For invoices/credit notes: payment types when markAsPaid is true */
|
|
34
|
+
paymentTypes?: string[];
|
|
35
35
|
/** Document type for specific date handling */
|
|
36
36
|
documentType: "invoice" | "estimate" | "credit_note" | "advance_invoice";
|
|
37
37
|
/** Secondary date field value (date_due for invoices, date_valid_till for estimates) */
|
|
@@ -167,16 +167,21 @@ export function prepareDocumentSubmission<T extends BaseDocumentValues>(
|
|
|
167
167
|
// Credit notes don't have a secondary date field
|
|
168
168
|
|
|
169
169
|
// Handle markAsPaid for invoices and credit notes
|
|
170
|
-
if (
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
if (
|
|
171
|
+
options.documentType !== "estimate" &&
|
|
172
|
+
options.markAsPaid &&
|
|
173
|
+
options.paymentTypes &&
|
|
174
|
+
options.paymentTypes.length > 0
|
|
175
|
+
) {
|
|
176
|
+
payload.payments = options.paymentTypes.map((type: string) => ({
|
|
177
|
+
type,
|
|
173
178
|
date: payload.date ?? undefined,
|
|
174
|
-
};
|
|
179
|
+
}));
|
|
175
180
|
}
|
|
176
181
|
|
|
177
182
|
// Remove UI-only fields from payload
|
|
178
183
|
delete payload.markAsPaid;
|
|
179
|
-
delete payload.
|
|
184
|
+
delete payload.paymentTypes;
|
|
180
185
|
|
|
181
186
|
// Add draft flag if requested
|
|
182
187
|
if (options.isDraft) {
|
|
@@ -150,6 +150,6 @@ describe("filterUnresolvedTaxes", () => {
|
|
|
150
150
|
];
|
|
151
151
|
const result = filterUnresolvedTaxes(items as any);
|
|
152
152
|
|
|
153
|
-
expect(result[0].taxes).toEqual([{ tax_id: "tax-123", rate: 22, name: "VAT" }]);
|
|
153
|
+
expect(result[0].taxes).toEqual([{ tax_id: "tax-123", rate: 22, name: "VAT" }] as any);
|
|
154
154
|
});
|
|
155
155
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
2
|
-
import {
|
|
3
|
-
import { getCookie } from "@/ui/lib/browser-cookies";
|
|
2
|
+
import { useSDK } from "@/ui/providers/sdk-provider";
|
|
4
3
|
|
|
5
4
|
// Document type union for API calls
|
|
6
5
|
export type DocumentType = "invoice" | "estimate" | "credit_note" | "advance_invoice";
|
|
@@ -13,44 +12,6 @@ const CACHE_KEYS: Record<DocumentType, string> = {
|
|
|
13
12
|
advance_invoice: "advance-invoices",
|
|
14
13
|
};
|
|
15
14
|
|
|
16
|
-
/**
|
|
17
|
-
* Get API base URL from environment
|
|
18
|
-
*/
|
|
19
|
-
function getApiBaseUrl(): string {
|
|
20
|
-
if (typeof window === "undefined") return "";
|
|
21
|
-
return (import.meta.env?.VITE_API_URL || import.meta.env?.BUN_PUBLIC_API_URL || "") as string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Make authenticated API request
|
|
26
|
-
*/
|
|
27
|
-
async function apiRequest<T>(path: string, options: RequestInit & { entityId: string }): Promise<T> {
|
|
28
|
-
const token = getCookie(AUTH_COOKIES.TOKEN);
|
|
29
|
-
const baseUrl = getApiBaseUrl();
|
|
30
|
-
|
|
31
|
-
const response = await fetch(`${baseUrl}${path}`, {
|
|
32
|
-
...options,
|
|
33
|
-
headers: {
|
|
34
|
-
"Content-Type": "application/json",
|
|
35
|
-
Authorization: `Bearer ${token}`,
|
|
36
|
-
"x-entity-id": options.entityId,
|
|
37
|
-
...options.headers,
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
if (!response.ok) {
|
|
42
|
-
const errorData = await response.json().catch(() => ({}));
|
|
43
|
-
throw new Error(errorData.message || `Request failed with status ${response.status}`);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// DELETE returns 204 No Content
|
|
47
|
-
if (response.status === 204) {
|
|
48
|
-
return undefined as T;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return response.json();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
15
|
// ============================================================================
|
|
55
16
|
// Finalize Document Hook
|
|
56
17
|
// ============================================================================
|
|
@@ -71,14 +32,12 @@ type FinalizeDocumentVariables = {
|
|
|
71
32
|
* Assigns a document number and runs fiscalization (if applicable)
|
|
72
33
|
*/
|
|
73
34
|
export function useFinalizeDocument(options: FinalizeDocumentOptions) {
|
|
35
|
+
const { sdk } = useSDK();
|
|
74
36
|
const queryClient = useQueryClient();
|
|
75
37
|
|
|
76
38
|
return useMutation({
|
|
77
39
|
mutationFn: async ({ documentId, documentType }: FinalizeDocumentVariables) => {
|
|
78
|
-
return
|
|
79
|
-
method: "POST",
|
|
80
|
-
entityId: options.entityId,
|
|
81
|
-
});
|
|
40
|
+
return sdk.documents.finalizeDocument(documentId, { type: documentType });
|
|
82
41
|
},
|
|
83
42
|
onSuccess: (data, variables) => {
|
|
84
43
|
// Invalidate list cache
|
|
@@ -118,14 +77,12 @@ type DeleteDraftDocumentVariables = {
|
|
|
118
77
|
* Only draft documents can be deleted
|
|
119
78
|
*/
|
|
120
79
|
export function useDeleteDraftDocument(options: DeleteDraftDocumentOptions) {
|
|
80
|
+
const { sdk } = useSDK();
|
|
121
81
|
const queryClient = useQueryClient();
|
|
122
82
|
|
|
123
83
|
return useMutation({
|
|
124
84
|
mutationFn: async ({ documentId, documentType }: DeleteDraftDocumentVariables) => {
|
|
125
|
-
return
|
|
126
|
-
method: "DELETE",
|
|
127
|
-
entityId: options.entityId,
|
|
128
|
-
});
|
|
85
|
+
return sdk.documents.delete(documentId, { type: documentType });
|
|
129
86
|
},
|
|
130
87
|
onSuccess: (_, variables) => {
|
|
131
88
|
// Invalidate list cache
|
|
@@ -63,6 +63,7 @@ export function DocumentPreviewDisplay({
|
|
|
63
63
|
|
|
64
64
|
const { containerRef, contentRef, scale, contentHeight, A4_WIDTH_PX } = useA4Scaling(previewHtml);
|
|
65
65
|
|
|
66
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: document.updated_at intentionally triggers re-fetch when document changes server-side (e.g. after payment)
|
|
66
67
|
useEffect(() => {
|
|
67
68
|
const fetchPreview = async () => {
|
|
68
69
|
// For public view, use per-type shareable HTML endpoint
|
|
@@ -113,7 +114,17 @@ export function DocumentPreviewDisplay({
|
|
|
113
114
|
};
|
|
114
115
|
|
|
115
116
|
fetchPreview();
|
|
116
|
-
}, [
|
|
117
|
+
}, [
|
|
118
|
+
document?.id,
|
|
119
|
+
document?.updated_at,
|
|
120
|
+
activeEntity?.id,
|
|
121
|
+
template,
|
|
122
|
+
apiBaseUrl,
|
|
123
|
+
locale,
|
|
124
|
+
isPublicView,
|
|
125
|
+
shareableId,
|
|
126
|
+
sdk,
|
|
127
|
+
]);
|
|
117
128
|
|
|
118
129
|
return (
|
|
119
130
|
<div ref={containerRef} className={cn("relative h-full", className)}>
|
|
@@ -28,20 +28,31 @@ import type { ComponentTranslationProps } from "@/ui/lib/translation";
|
|
|
28
28
|
import { createTranslation } from "@/ui/lib/translation";
|
|
29
29
|
import type { Entity } from "@/ui/providers/entities-context";
|
|
30
30
|
import de from "./locales/de";
|
|
31
|
+
import es from "./locales/es";
|
|
32
|
+
import fr from "./locales/fr";
|
|
33
|
+
import hr from "./locales/hr";
|
|
34
|
+
import it from "./locales/it";
|
|
35
|
+
import nl from "./locales/nl";
|
|
36
|
+
import pl from "./locales/pl";
|
|
37
|
+
import pt from "./locales/pt";
|
|
31
38
|
import sl from "./locales/sl";
|
|
32
39
|
import { useDocumentDownload } from "./use-document-download";
|
|
33
40
|
|
|
34
|
-
const translations = { de,
|
|
41
|
+
const translations = { sl, de, it, fr, es, pt, nl, pl, hr } as const;
|
|
35
42
|
|
|
36
43
|
type Document = Invoice | Estimate | CreditNote | AdvanceInvoice;
|
|
37
44
|
|
|
38
|
-
const
|
|
39
|
-
{
|
|
40
|
-
{
|
|
41
|
-
{
|
|
42
|
-
{
|
|
43
|
-
{
|
|
44
|
-
{
|
|
45
|
+
const PDF_LOCALE_CODES = [
|
|
46
|
+
{ label: "English", code: "en-US" },
|
|
47
|
+
{ label: "German", code: "de-DE" },
|
|
48
|
+
{ label: "Slovenian", code: "sl-SI" },
|
|
49
|
+
{ label: "Italian", code: "it-IT" },
|
|
50
|
+
{ label: "French", code: "fr-FR" },
|
|
51
|
+
{ label: "Spanish", code: "es-ES" },
|
|
52
|
+
{ label: "Portuguese", code: "pt-PT" },
|
|
53
|
+
{ label: "Dutch", code: "nl-NL" },
|
|
54
|
+
{ label: "Polish", code: "pl-PL" },
|
|
55
|
+
{ label: "Croatian", code: "hr-HR" },
|
|
45
56
|
] as const;
|
|
46
57
|
|
|
47
58
|
interface DocumentActionsBarProps extends ComponentTranslationProps {
|
|
@@ -82,11 +93,15 @@ interface DocumentActionsBarProps extends ComponentTranslationProps {
|
|
|
82
93
|
function getApiLocale(uiLanguage: string): string {
|
|
83
94
|
const localeMap: Record<string, string> = {
|
|
84
95
|
en: "en-US",
|
|
85
|
-
sl: "sl-SI",
|
|
86
96
|
de: "de-DE",
|
|
87
|
-
|
|
88
|
-
fr: "fr-FR",
|
|
97
|
+
sl: "sl-SI",
|
|
89
98
|
it: "it-IT",
|
|
99
|
+
fr: "fr-FR",
|
|
100
|
+
es: "es-ES",
|
|
101
|
+
pt: "pt-PT",
|
|
102
|
+
nl: "nl-NL",
|
|
103
|
+
pl: "pl-PL",
|
|
104
|
+
hr: "hr-HR",
|
|
90
105
|
};
|
|
91
106
|
return localeMap[uiLanguage] || "en-US";
|
|
92
107
|
}
|
|
@@ -178,13 +193,13 @@ export function DocumentActionsBar({
|
|
|
178
193
|
</Button>
|
|
179
194
|
</DropdownMenuTrigger>
|
|
180
195
|
<DropdownMenuContent align="end">
|
|
181
|
-
{
|
|
196
|
+
{PDF_LOCALE_CODES.map((locale) => (
|
|
182
197
|
<DropdownMenuItem
|
|
183
198
|
key={locale.code}
|
|
184
199
|
onClick={() => handleDownloadPdf(locale.code)}
|
|
185
200
|
className="cursor-pointer"
|
|
186
201
|
>
|
|
187
|
-
{locale.label}
|
|
202
|
+
{t(locale.label)}
|
|
188
203
|
</DropdownMenuItem>
|
|
189
204
|
))}
|
|
190
205
|
</DropdownMenuContent>
|