@spaceinvoices/react-ui 0.4.8 → 0.4.11
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 +24 -8
- package/cli/dist/index.js +89 -26
- package/package.json +4 -1
- package/spaceinvoices.schema.json +6 -1
- package/src/common/autocomplete.tsx +69 -6
- package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +124 -285
- package/src/components/advance-invoices/list/list-table.tsx +10 -3
- package/src/components/advance-invoices/list/locales/de.ts +2 -0
- package/src/components/advance-invoices/list/locales/en.ts +1 -0
- package/src/components/advance-invoices/list/locales/es.ts +1 -0
- package/src/components/advance-invoices/list/locales/fr.ts +1 -0
- package/src/components/advance-invoices/list/locales/hr.ts +1 -0
- package/src/components/advance-invoices/list/locales/it.ts +1 -0
- package/src/components/advance-invoices/list/locales/nl.ts +1 -0
- package/src/components/advance-invoices/list/locales/pl.ts +1 -0
- package/src/components/advance-invoices/list/locales/pt.ts +1 -0
- package/src/components/advance-invoices/list/locales/sl.ts +1 -0
- package/src/components/advance-invoices/list/use-advance-invoice-download.ts +1 -12
- package/src/components/credit-notes/create/create-credit-note-form.tsx +116 -238
- package/src/components/credit-notes/list/list-table.tsx +6 -3
- package/src/components/credit-notes/list/use-credit-note-download.ts +1 -12
- package/src/components/customers/customer-autocomplete.tsx +64 -11
- package/src/components/customers/customer-list-table/customer-list-table.tsx +3 -2
- package/src/components/dashboard/collection-rate-card/collection-rate-card.tsx +9 -1
- package/src/components/dashboard/collection-rate-card/locales/bg.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/cs.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/et.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/fi.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/is.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/nb.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/sk.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/sv.ts +3 -0
- package/src/components/dashboard/invoice-status-chart/invoice-status-chart.tsx +10 -2
- package/src/components/dashboard/invoice-status-chart/locales/bg.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/cs.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/de.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/es.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/et.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/fi.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/fr.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/hr.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/is.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/it.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/nb.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/nl.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/pl.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/pt.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/sk.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/sl.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/sv.ts +10 -0
- package/src/components/dashboard/payment-methods-chart/locales/bg.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/cs.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/et.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/fi.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/is.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/nb.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/sk.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/sv.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/payment-methods-chart.tsx +9 -1
- package/src/components/dashboard/payment-trend-chart/locales/bg.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/cs.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/de.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/es.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/et.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/fi.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/fr.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/hr.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/is.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/it.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/nb.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/nl.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/pl.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/pt.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/sk.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/sl.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/sv.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/payment-trend-chart.tsx +15 -8
- package/src/components/dashboard/revenue-trend-chart/locales/bg.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/cs.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/de.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/es.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/et.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/fi.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/fr.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/hr.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/is.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/it.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/nb.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/nl.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/pl.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/pt.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/sk.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/sl.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/sv.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/revenue-trend-chart.tsx +15 -8
- package/src/components/dashboard/tax-collected-card/locales.ts +110 -0
- package/src/components/dashboard/tax-collected-card/tax-collected-card.tsx +8 -2
- package/src/components/dashboard/tax-collected-card/use-tax-collected.ts +4 -4
- package/src/components/dashboard/top-customers-chart/locales/bg.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/cs.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/de.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/es.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/et.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/fi.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/fr.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/hr.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/is.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/it.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/nb.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/nl.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/pl.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/pt.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/sk.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/sl.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/sv.ts +7 -0
- package/src/components/dashboard/top-customers-chart/top-customers-chart.tsx +23 -12
- package/src/components/delivery-notes/create/create-delivery-note-form.tsx +33 -20
- package/src/components/delivery-notes/list/list-table.tsx +22 -13
- package/src/components/delivery-notes/list/locales/de.ts +2 -0
- package/src/components/delivery-notes/list/locales/en.ts +1 -0
- package/src/components/delivery-notes/list/locales/es.ts +1 -0
- package/src/components/delivery-notes/list/locales/fr.ts +1 -0
- package/src/components/delivery-notes/list/locales/hr.ts +1 -0
- package/src/components/delivery-notes/list/locales/it.ts +1 -0
- package/src/components/delivery-notes/list/locales/nl.ts +1 -0
- package/src/components/delivery-notes/list/locales/pl.ts +1 -0
- package/src/components/delivery-notes/list/locales/pt.ts +1 -0
- package/src/components/delivery-notes/list/locales/sl.ts +1 -0
- package/src/components/delivery-notes/list/use-delivery-note-download.ts +1 -12
- package/src/components/documents/create/document-add-item-form.tsx +28 -16
- package/src/components/documents/create/document-add-item-tax-rate-field.tsx +12 -2
- package/src/components/documents/create/document-items-section.tsx +70 -39
- package/src/components/documents/create/document-recipient-section.tsx +10 -1
- package/src/components/documents/create/live-preview.tsx +113 -15
- package/src/components/documents/create/prepare-document-submission.ts +35 -16
- package/src/components/documents/create/use-document-customer-form.ts +14 -3
- package/src/components/documents/documents.hooks.ts +7 -2
- package/src/components/documents/shared/document-preview-display.tsx +136 -67
- package/src/components/documents/shared/scaled-document-preview.tsx +45 -5
- package/src/components/documents/view/document-actions-bar.tsx +284 -182
- package/src/components/documents/view/document-activities-list.tsx +3 -0
- package/src/components/documents/view/document-payments-list.tsx +3 -0
- package/src/components/documents/view/locales/de.ts +8 -0
- package/src/components/documents/view/locales/es.ts +8 -0
- package/src/components/documents/view/locales/fr.ts +8 -0
- package/src/components/documents/view/locales/hr.ts +8 -0
- package/src/components/documents/view/locales/it.ts +8 -0
- package/src/components/documents/view/locales/nl.ts +8 -0
- package/src/components/documents/view/locales/pl.ts +8 -0
- package/src/components/documents/view/locales/pt.ts +8 -0
- package/src/components/documents/view/locales/sl.ts +8 -0
- package/src/components/documents/view/use-document-download.ts +14 -25
- package/src/components/entities/create-entity-form.tsx +101 -16
- package/src/components/entities/entity-settings-form/entity-settings-form.tsx +10 -10
- package/src/components/entities/entity-settings-form/locales/de.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/es.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/fr.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/hr.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/it.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/nl.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/pl.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/pt.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/sl.ts +10 -0
- package/src/components/entities/fina-settings-form/fina-operator-required-dialog.tsx +3 -3
- package/src/components/entities/fina-settings-form/fina-settings-form.tsx +78 -124
- package/src/components/entities/fina-settings-form/sections/certificate-settings-section.tsx +8 -1
- package/src/components/entities/fina-settings-form/sections/premises-management-section.tsx +14 -2
- package/src/components/entities/fina-settings-form/sections/register-premise-dialog.tsx +7 -2
- package/src/components/entities/furs-settings-form/furs-settings-form.tsx +56 -130
- package/src/components/entities/furs-settings-form/sections/certificate-settings-section.tsx +8 -1
- package/src/components/entities/furs-settings-form/sections/enable-fiscalization-section.tsx +1 -0
- package/src/components/entities/furs-settings-form/sections/general-settings-section.tsx +15 -2
- package/src/components/entities/furs-settings-form/sections/premises-management-section.tsx +20 -3
- package/src/components/entities/furs-settings-form/sections/register-premise-dialog.tsx +38 -12
- package/src/components/entities/settings/defaults-settings-form.tsx +6 -6
- package/src/components/entities/settings/eslog-settings-form.tsx +13 -1
- package/src/components/entities/settings/pdf-template-selector/demo-invoice-data.ts +3 -22
- package/src/components/entities/shared/fiscalization-step-flow.ts +77 -0
- package/src/components/entities/shared/fiscalization-step-tabs.tsx +71 -0
- package/src/components/estimates/create/create-estimate-form.tsx +34 -21
- package/src/components/estimates/list/list-table.tsx +23 -14
- package/src/components/estimates/list/locales/de.ts +2 -0
- package/src/components/estimates/list/locales/en.ts +1 -0
- package/src/components/estimates/list/locales/es.ts +1 -0
- package/src/components/estimates/list/locales/fr.ts +1 -0
- package/src/components/estimates/list/locales/hr.ts +1 -0
- package/src/components/estimates/list/locales/it.ts +1 -0
- package/src/components/estimates/list/locales/nl.ts +1 -0
- package/src/components/estimates/list/locales/pl.ts +1 -0
- package/src/components/estimates/list/locales/pt.ts +1 -0
- package/src/components/estimates/list/locales/sl.ts +1 -0
- package/src/components/estimates/list/use-estimate-download.ts +1 -12
- package/src/components/export/document-export-form.tsx +33 -7
- package/src/components/export/sales-per-item-export-form.tsx +23 -7
- package/src/components/invoices/create/create-invoice-form.tsx +295 -329
- package/src/components/invoices/create/prepare-invoice-submission.ts +0 -8
- package/src/components/invoices/list/list-table.tsx +7 -4
- package/src/components/invoices/list/use-invoice-download.ts +1 -11
- package/src/components/invoices/send-email-dialog/locales/de.ts +20 -0
- package/src/components/invoices/send-email-dialog/locales/es.ts +20 -0
- package/src/components/invoices/send-email-dialog/locales/fr.ts +20 -0
- package/src/components/invoices/send-email-dialog/locales/hr.ts +20 -0
- package/src/components/invoices/send-email-dialog/locales/it.ts +20 -0
- package/src/components/invoices/send-email-dialog/locales/nl.ts +20 -0
- package/src/components/invoices/send-email-dialog/locales/pl.ts +20 -0
- package/src/components/invoices/send-email-dialog/locales/pt.ts +20 -0
- package/src/components/invoices/send-email-dialog/locales/sl.ts +20 -0
- package/src/components/invoices/send-email-dialog/send-email-dialog.tsx +77 -8
- package/src/components/invoices/view/eslog-info-display.tsx +17 -1
- package/src/components/invoices/view/fiscalization-status-card.tsx +7 -3
- package/src/components/items/item-combobox.tsx +26 -6
- package/src/components/items/item-list-table/item-list-table.tsx +5 -2
- package/src/components/payments/create-payment-form/index.ts +1 -0
- package/src/components/payments/list/list-table.tsx +14 -4
- package/src/components/recurring-invoices/list/list-table.tsx +7 -4
- package/src/components/request-logs/locales.ts +412 -0
- package/src/components/request-logs/request-log-detail.tsx +37 -21
- package/src/components/request-logs/request-log-list-table.tsx +57 -11
- package/src/components/table/data-table.tsx +5 -2
- package/src/components/table/date-cell.tsx +3 -1
- package/src/components/table/filter-bar.tsx +14 -2
- package/src/components/table/hooks/use-table-query.ts +1 -1
- package/src/components/table/locales.ts +1116 -0
- package/src/components/table/search-input.tsx +12 -3
- package/src/components/table/selection-toolbar.tsx +23 -6
- package/src/components/table/table-empty-state.tsx +43 -3
- package/src/components/table/table-no-results.tsx +3 -3
- package/src/components/table/table-pagination.tsx +4 -3
- package/src/components/table/types.ts +1 -0
- package/src/components/tax-reports/index.ts +1 -0
- package/src/components/tax-reports/kir-export-form.tsx +46 -8
- package/src/components/tax-reports/slovenia-tax-profile-step.tsx +191 -0
- package/src/components/tax-reports/slovenia-yearly-export-form.tsx +509 -0
- package/src/components/tax-reports/slovenia-yearly-review-step.tsx +253 -0
- package/src/components/tax-reports/slovenia-yearly-summary.tsx +19 -0
- package/src/components/taxes/tax-list-table/tax-list-table.tsx +3 -2
- package/src/components/ui/sidebar.tsx +3 -2
- package/src/components/ui/sticky-form-footer.tsx +7 -1
- package/src/components/webhook-logs/index.ts +6 -0
- package/src/components/webhook-logs/locales.ts +392 -0
- package/src/components/webhook-logs/webhook-delivery-detail.tsx +255 -0
- package/src/components/webhook-logs/webhook-delivery-list-table.tsx +278 -0
- package/src/components/wl-subscription/index.ts +1 -0
- package/src/components/wl-subscription/locked-feature.tsx +1 -0
- package/src/components/wl-subscription/paywall.tsx +193 -0
- package/src/components/wl-subscription/upgrade-modal.tsx +93 -29
- package/src/generate-schemas.ts +12 -7
- package/src/generated/schemas/customer.ts +2 -0
- package/src/generated/schemas/entity.ts +134 -0
- package/src/generated/schemas/exportsloveniayearlynormiranireport_body.ts +27 -0
- package/src/generated/schemas/index.ts +2 -0
- package/src/generated/schemas/me.ts +20 -1
- package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +40 -34
- package/src/generated/schemas/rendercreditnotepreview_body.ts +42 -36
- package/src/generated/schemas/renderdeliverynotepreview_body.ts +23 -13
- package/src/generated/schemas/renderestimatepreview_body.ts +23 -13
- package/src/generated/schemas/renderinvoicepreview_body.ts +40 -34
- package/src/generated/schemas/sendemail_body.ts +44 -0
- package/src/generated/schemas/sloveniataxprofile.ts +42 -0
- package/src/generated/schemas/startpdfexport_body.ts +91 -1
- package/src/generated/schemas/webhook.ts +10 -0
- package/src/hooks/use-duplicate-document.ts +51 -13
- package/src/hooks/use-eslog-validation.ts +59 -0
- package/src/hooks/use-premise-selection.ts +186 -0
- package/src/lib/browser-cookies.ts +4 -4
- package/src/lib/date-fns-locale.ts +48 -0
- package/src/lib/fiscalization-options.ts +81 -0
- package/src/lib/locale.ts +38 -0
- package/src/lib/template-variables.tsx +1 -1
- package/src/lib/translation.ts +14 -3
- package/src/providers/entities-context.tsx +1 -0
- package/src/providers/entities-provider.tsx +102 -3
- package/src/providers/form-footer-context.tsx +37 -4
- package/src/providers/sdk-provider.tsx +7 -2
- package/src/providers/white-label-provider.tsx +4 -1
- package/src/providers/wl-subscription-provider.tsx +90 -3
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
export interface FiscalizationStepConfig<T extends string> {
|
|
4
|
+
id: T;
|
|
5
|
+
title: string;
|
|
6
|
+
complete: boolean;
|
|
7
|
+
unlocked: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface UseFiscalizationStepFlowOptions<T extends string> {
|
|
11
|
+
initialStep: T;
|
|
12
|
+
isReady: boolean;
|
|
13
|
+
steps: FiscalizationStepConfig<T>[];
|
|
14
|
+
getDefaultStep: () => T;
|
|
15
|
+
onStepChange?: (step: T) => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function useFiscalizationStepFlow<T extends string>({
|
|
19
|
+
initialStep,
|
|
20
|
+
isReady,
|
|
21
|
+
steps,
|
|
22
|
+
getDefaultStep,
|
|
23
|
+
onStepChange,
|
|
24
|
+
}: UseFiscalizationStepFlowOptions<T>) {
|
|
25
|
+
const [activeStep, setActiveStep] = useState<T>(initialStep);
|
|
26
|
+
const [hasInitializedStep, setHasInitializedStep] = useState(false);
|
|
27
|
+
const previousInitialStep = useRef(initialStep);
|
|
28
|
+
|
|
29
|
+
const handleStepChange = useCallback(
|
|
30
|
+
(newStep: T) => {
|
|
31
|
+
setActiveStep(newStep);
|
|
32
|
+
onStepChange?.(newStep);
|
|
33
|
+
},
|
|
34
|
+
[onStepChange],
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: caller controls step definitions and default-step logic
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (!hasInitializedStep && isReady) {
|
|
40
|
+
const smartStep = getDefaultStep();
|
|
41
|
+
if (smartStep !== activeStep) {
|
|
42
|
+
handleStepChange(smartStep);
|
|
43
|
+
}
|
|
44
|
+
setHasInitializedStep(true);
|
|
45
|
+
}
|
|
46
|
+
}, [isReady, hasInitializedStep]);
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
const currentStepInfo = steps.find((step) => step.id === activeStep);
|
|
50
|
+
if (currentStepInfo && !currentStepInfo.unlocked) {
|
|
51
|
+
const firstUnlockedStep = steps.find((step) => step.unlocked);
|
|
52
|
+
if (firstUnlockedStep) {
|
|
53
|
+
handleStepChange(firstUnlockedStep.id);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}, [activeStep, steps, handleStepChange]);
|
|
57
|
+
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (!hasInitializedStep) return;
|
|
60
|
+
|
|
61
|
+
if (previousInitialStep.current === initialStep) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
previousInitialStep.current = initialStep;
|
|
66
|
+
|
|
67
|
+
const nextStepInfo = steps.find((step) => step.id === initialStep);
|
|
68
|
+
if (nextStepInfo?.unlocked && initialStep !== activeStep) {
|
|
69
|
+
setActiveStep(initialStep);
|
|
70
|
+
}
|
|
71
|
+
}, [activeStep, hasInitializedStep, initialStep, steps]);
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
activeStep,
|
|
75
|
+
handleStepChange,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { CheckCircle2 } from "lucide-react";
|
|
2
|
+
import { Tabs, TabsList, TabsTrigger } from "@/ui/components/ui/tabs";
|
|
3
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@/ui/components/ui/tooltip";
|
|
4
|
+
import { cn } from "@/ui/lib/utils";
|
|
5
|
+
import type { FiscalizationStepConfig } from "./fiscalization-step-flow";
|
|
6
|
+
|
|
7
|
+
interface FiscalizationStepTabsProps<T extends string> {
|
|
8
|
+
activeStep: T;
|
|
9
|
+
steps: FiscalizationStepConfig<T>[];
|
|
10
|
+
testIdPrefix: string;
|
|
11
|
+
onStepChange: (step: T) => void;
|
|
12
|
+
getTooltipText: (step: FiscalizationStepConfig<T>) => string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function FiscalizationStepTabs<T extends string>({
|
|
16
|
+
activeStep,
|
|
17
|
+
steps,
|
|
18
|
+
testIdPrefix,
|
|
19
|
+
onStepChange,
|
|
20
|
+
getTooltipText,
|
|
21
|
+
}: FiscalizationStepTabsProps<T>) {
|
|
22
|
+
return (
|
|
23
|
+
<div className="grid items-start gap-6 lg:grid-cols-[1fr_280px]">
|
|
24
|
+
<Tabs value={activeStep} onValueChange={(value) => onStepChange(value as T)} className="w-full">
|
|
25
|
+
<TabsList className="grid w-full grid-cols-4 rounded-none p-0">
|
|
26
|
+
{steps.map((step, index) => {
|
|
27
|
+
const isLocked = !step.unlocked;
|
|
28
|
+
|
|
29
|
+
const trigger = (
|
|
30
|
+
<TabsTrigger
|
|
31
|
+
value={step.id}
|
|
32
|
+
disabled={isLocked}
|
|
33
|
+
data-testid={`${testIdPrefix}-${step.id}`}
|
|
34
|
+
className={cn("cursor-pointer justify-center", !step.unlocked && "opacity-50")}
|
|
35
|
+
>
|
|
36
|
+
<span className="flex items-center gap-2">
|
|
37
|
+
{step.complete ? (
|
|
38
|
+
<CheckCircle2 className="h-4 w-4 text-green-500" />
|
|
39
|
+
) : (
|
|
40
|
+
<span className="text-xs">{index + 1}</span>
|
|
41
|
+
)}
|
|
42
|
+
{step.title}
|
|
43
|
+
</span>
|
|
44
|
+
</TabsTrigger>
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
if (isLocked) {
|
|
48
|
+
return (
|
|
49
|
+
<Tooltip key={step.id} delayDuration={0}>
|
|
50
|
+
<TooltipTrigger asChild>
|
|
51
|
+
<span className="flex cursor-not-allowed justify-center">{trigger}</span>
|
|
52
|
+
</TooltipTrigger>
|
|
53
|
+
<TooltipContent>
|
|
54
|
+
<p>{getTooltipText(step)}</p>
|
|
55
|
+
</TooltipContent>
|
|
56
|
+
</Tooltip>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<span key={step.id} className="flex justify-center">
|
|
62
|
+
{trigger}
|
|
63
|
+
</span>
|
|
64
|
+
);
|
|
65
|
+
})}
|
|
66
|
+
</TabsList>
|
|
67
|
+
</Tabs>
|
|
68
|
+
<div className="hidden lg:block" />
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
@@ -250,6 +250,7 @@ export default function CreateEstimateForm({
|
|
|
250
250
|
const formValues = useWatch({
|
|
251
251
|
control: form.control,
|
|
252
252
|
});
|
|
253
|
+
const prevPayloadRef = useRef("");
|
|
253
254
|
|
|
254
255
|
// ============================================================================
|
|
255
256
|
// VIES Check - determine if reverse charge applies
|
|
@@ -380,37 +381,48 @@ export default function CreateEstimateForm({
|
|
|
380
381
|
form.setValue("date_valid_till", calculateDueDate(currentDate, validDays));
|
|
381
382
|
}, [formValues.date, activeEntity, form]);
|
|
382
383
|
|
|
383
|
-
|
|
384
|
-
const
|
|
385
|
-
if (!callback) return;
|
|
386
|
-
|
|
387
|
-
const currentItems = form.getValues("items") || [];
|
|
384
|
+
const buildPreviewPayload = useCallback((values: CreateEstimateFormValues): EstimatePreviewPayload => {
|
|
385
|
+
const currentItems = values.items || [];
|
|
388
386
|
|
|
389
|
-
// Transform items to use gross_price when price mode is gross
|
|
390
387
|
const transformedItems = currentItems.map((item: any, index: number) => {
|
|
391
388
|
const { price, ...rest } = item;
|
|
392
389
|
const isGross = priceModesRef.current[index] ?? false;
|
|
393
|
-
|
|
394
|
-
return { ...rest, gross_price: price };
|
|
395
|
-
}
|
|
396
|
-
return { ...rest, price };
|
|
390
|
+
return isGross ? { ...rest, gross_price: price } : { ...rest, price };
|
|
397
391
|
});
|
|
398
392
|
|
|
399
|
-
|
|
400
|
-
number:
|
|
401
|
-
date:
|
|
402
|
-
customer_id:
|
|
403
|
-
customer:
|
|
393
|
+
return {
|
|
394
|
+
number: values.number,
|
|
395
|
+
date: values.date,
|
|
396
|
+
customer_id: values.customer_id,
|
|
397
|
+
customer: values.customer,
|
|
404
398
|
items: transformedItems,
|
|
405
|
-
currency_code:
|
|
406
|
-
reference:
|
|
407
|
-
note:
|
|
408
|
-
payment_terms:
|
|
409
|
-
signature:
|
|
399
|
+
currency_code: values.currency_code,
|
|
400
|
+
reference: values.reference,
|
|
401
|
+
note: values.note,
|
|
402
|
+
payment_terms: values.payment_terms,
|
|
403
|
+
signature: values.signature,
|
|
410
404
|
title_type: titleType,
|
|
411
405
|
};
|
|
406
|
+
}, [titleType]);
|
|
407
|
+
|
|
408
|
+
const emitPreviewPayload = useCallback((payload: EstimatePreviewPayload) => {
|
|
409
|
+
const callback = onChangeRef.current;
|
|
410
|
+
if (!callback) return;
|
|
411
|
+
|
|
412
|
+
const payloadStr = JSON.stringify(payload);
|
|
413
|
+
if (payloadStr === prevPayloadRef.current) return;
|
|
414
|
+
prevPayloadRef.current = payloadStr;
|
|
415
|
+
|
|
412
416
|
callback(payload);
|
|
413
|
-
}, [
|
|
417
|
+
}, []);
|
|
418
|
+
|
|
419
|
+
useEffect(() => {
|
|
420
|
+
emitPreviewPayload(buildPreviewPayload(formValues as CreateEstimateFormValues));
|
|
421
|
+
}, [buildPreviewPayload, emitPreviewPayload, formValues]);
|
|
422
|
+
|
|
423
|
+
const emitCurrentPreviewPayload = useCallback(() => {
|
|
424
|
+
emitPreviewPayload(buildPreviewPayload(form.getValues()));
|
|
425
|
+
}, [buildPreviewPayload, emitPreviewPayload, form]);
|
|
414
426
|
|
|
415
427
|
const onSubmit = (values: CreateEstimateFormValues) => {
|
|
416
428
|
submitEstimate(values, false);
|
|
@@ -447,6 +459,7 @@ export default function CreateEstimateForm({
|
|
|
447
459
|
maxTaxesPerItem={activeEntity?.country_rules?.max_taxes_per_item}
|
|
448
460
|
priceModesRef={priceModesRef}
|
|
449
461
|
initialPriceModes={initialPriceModes}
|
|
462
|
+
onItemsStateChange={emitCurrentPreviewPayload}
|
|
450
463
|
taxesDisabled={reverseChargeApplies}
|
|
451
464
|
taxesDisabledMessage={
|
|
452
465
|
reverseChargeApplies ? t("Reverse charge - tax exempt EU B2B sale") : viesWarning ? viesWarning : undefined
|
|
@@ -3,6 +3,7 @@ import { useCallback, useMemo, useState } from "react";
|
|
|
3
3
|
import { DataTable } from "@/ui/components/table/data-table";
|
|
4
4
|
import { FormattedDate } from "@/ui/components/table/date-cell";
|
|
5
5
|
import { useTableFetch } from "@/ui/components/table/hooks/use-table-fetch";
|
|
6
|
+
import { withTableTranslations } from "@/ui/components/table/locales";
|
|
6
7
|
import { SelectionToolbar } from "@/ui/components/table/selection-toolbar";
|
|
7
8
|
import type {
|
|
8
9
|
Column,
|
|
@@ -28,7 +29,7 @@ import pl from "./locales/pl";
|
|
|
28
29
|
import pt from "./locales/pt";
|
|
29
30
|
import sl from "./locales/sl";
|
|
30
31
|
|
|
31
|
-
const translations = {
|
|
32
|
+
const translations = withTableTranslations({
|
|
32
33
|
en,
|
|
33
34
|
sl,
|
|
34
35
|
de,
|
|
@@ -39,12 +40,13 @@ const translations = {
|
|
|
39
40
|
nl,
|
|
40
41
|
pl,
|
|
41
42
|
hr,
|
|
42
|
-
} as const;
|
|
43
|
+
} as const);
|
|
43
44
|
|
|
44
45
|
type EstimateListTableProps = {
|
|
45
46
|
t?: (key: string) => string;
|
|
46
47
|
namespace?: string;
|
|
47
48
|
locale?: string;
|
|
49
|
+
translationLocale?: string;
|
|
48
50
|
entityId?: string;
|
|
49
51
|
onView?: (estimate: Estimate) => void;
|
|
50
52
|
onDuplicate?: (estimate: Estimate) => void;
|
|
@@ -73,6 +75,7 @@ export default function EstimateListTable({
|
|
|
73
75
|
}: EstimateListTableProps) {
|
|
74
76
|
const t = createTranslation({
|
|
75
77
|
translations,
|
|
78
|
+
locale: i18nProps.translationLocale ?? i18nProps.locale,
|
|
76
79
|
...i18nProps,
|
|
77
80
|
});
|
|
78
81
|
|
|
@@ -123,16 +126,22 @@ export default function EstimateListTable({
|
|
|
123
126
|
}, []);
|
|
124
127
|
|
|
125
128
|
const selectionToolbar = useCallback(
|
|
126
|
-
(count: number) =>
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
(count: number, data: Estimate[]) => {
|
|
130
|
+
const hasDrafts = data.some((d) => selectedIds.has(d.id) && (d as any).is_draft);
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<SelectionToolbar
|
|
134
|
+
selectedCount={count}
|
|
135
|
+
onExportPdfs={onExportSelected ? handleExportPdfs : undefined}
|
|
136
|
+
onCopyToInvoice={onCopyToInvoice ? handleCopyToInvoice : undefined}
|
|
137
|
+
copyToInvoiceDisabled={hasDrafts}
|
|
138
|
+
copyToInvoiceTooltip={hasDrafts ? t("Finalize draft documents before copying to invoice") : undefined}
|
|
139
|
+
onDeselectAll={handleDeselectAll}
|
|
140
|
+
t={t}
|
|
141
|
+
/>
|
|
142
|
+
);
|
|
143
|
+
},
|
|
144
|
+
[handleExportPdfs, handleCopyToInvoice, handleDeselectAll, onExportSelected, onCopyToInvoice, selectedIds, t],
|
|
136
145
|
);
|
|
137
146
|
|
|
138
147
|
const columns: Column<Estimate>[] = useMemo(
|
|
@@ -164,12 +173,12 @@ export default function EstimateListTable({
|
|
|
164
173
|
{
|
|
165
174
|
id: "date",
|
|
166
175
|
header: t("Date"),
|
|
167
|
-
cell: (estimate) => <FormattedDate date={estimate.date} />,
|
|
176
|
+
cell: (estimate) => <FormattedDate date={estimate.date} locale={i18nProps.locale} />,
|
|
168
177
|
},
|
|
169
178
|
{
|
|
170
179
|
id: "date_valid_till",
|
|
171
180
|
header: t("Valid Until"),
|
|
172
|
-
cell: (estimate) => <FormattedDate date={estimate.date_valid_till} />,
|
|
181
|
+
cell: (estimate) => <FormattedDate date={estimate.date_valid_till} locale={i18nProps.locale} />,
|
|
173
182
|
},
|
|
174
183
|
{
|
|
175
184
|
id: "total",
|
|
@@ -37,4 +37,6 @@ export default {
|
|
|
37
37
|
"Export PDFs": "PDFs exportieren",
|
|
38
38
|
"Deselect all": "Auswahl aufheben",
|
|
39
39
|
"Copy to Invoice": "In Rechnung kopieren",
|
|
40
|
+
"Finalize draft documents before copying to invoice":
|
|
41
|
+
"Entwurfsdokumente abschließen, bevor Sie in eine Rechnung kopieren",
|
|
40
42
|
} as const;
|
|
@@ -34,4 +34,5 @@ export default {
|
|
|
34
34
|
"Export PDFs": "Exporter les PDF",
|
|
35
35
|
"Deselect all": "Tout désélectionner",
|
|
36
36
|
"Copy to Invoice": "Copier vers facture",
|
|
37
|
+
"Finalize draft documents before copying to invoice": "Finalisez les brouillons avant de copier en facture",
|
|
37
38
|
} as const;
|
|
@@ -34,4 +34,5 @@ export default {
|
|
|
34
34
|
"Export PDFs": "PDFs exporteren",
|
|
35
35
|
"Deselect all": "Alles deselecteren",
|
|
36
36
|
"Copy to Invoice": "Kopieer naar factuur",
|
|
37
|
+
"Finalize draft documents before copying to invoice": "Rond conceptdocumenten af voordat u naar factuur kopieert",
|
|
37
38
|
} as const;
|
|
@@ -33,19 +33,8 @@ export function useEstimateDownload({
|
|
|
33
33
|
onDownloadStart?.();
|
|
34
34
|
|
|
35
35
|
try {
|
|
36
|
-
// SDK signature: renderPdf(id, params?, SDKMethodOptions?)
|
|
37
|
-
// entity_id goes in SDKMethodOptions (last arg), not params
|
|
38
|
-
// Note: renderPdf is on invoices module but works with any document ID
|
|
39
|
-
const blob = await sdk.invoices.renderPdf(estimate.id, {}, { entity_id: activeEntity.id });
|
|
40
|
-
const downloadUrl = window.URL.createObjectURL(blob);
|
|
41
|
-
const link = document.createElement("a");
|
|
42
|
-
link.href = downloadUrl;
|
|
43
36
|
const fileName = `${t("Estimate")} ${estimate.number}.pdf`;
|
|
44
|
-
|
|
45
|
-
document.body.appendChild(link);
|
|
46
|
-
link.click();
|
|
47
|
-
document.body.removeChild(link);
|
|
48
|
-
window.URL.revokeObjectURL(downloadUrl);
|
|
37
|
+
await sdk.invoices.downloadPdf(estimate.id, fileName, {}, { entity_id: activeEntity.id });
|
|
49
38
|
|
|
50
39
|
onDownloadSuccess?.(fileName);
|
|
51
40
|
} catch (error) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { getClientHeaders } from "@spaceinvoices/js-sdk";
|
|
3
2
|
import { Calendar, Download, Loader2 } from "lucide-react";
|
|
4
3
|
import { useRef, useState } from "react";
|
|
4
|
+
import type { ComponentTranslationProps } from "@/ui/lib/translation";
|
|
5
|
+
import { createTranslation } from "@/ui/lib/translation";
|
|
5
6
|
import { Button } from "../ui/button";
|
|
6
7
|
import { Checkbox } from "../ui/checkbox";
|
|
7
8
|
import { Input } from "../ui/input";
|
|
@@ -45,27 +46,52 @@ export type DocumentExportFormProps = {
|
|
|
45
46
|
token: string;
|
|
46
47
|
accountId?: string | null;
|
|
47
48
|
language: string;
|
|
48
|
-
t: TFunction;
|
|
49
49
|
/** Base URL for API calls (required in embed context where relative paths don't reach the API) */
|
|
50
50
|
apiBaseUrl?: string;
|
|
51
51
|
onSuccess?: (fileName: string) => void;
|
|
52
52
|
onError?: (error: Error) => void;
|
|
53
53
|
onPdfExportStarted?: (jobId: string) => void;
|
|
54
54
|
onLoadingChange?: (isLoading: boolean, toastId: string | number | null) => void;
|
|
55
|
-
};
|
|
55
|
+
} & ComponentTranslationProps;
|
|
56
|
+
|
|
57
|
+
const translations = {
|
|
58
|
+
en: {
|
|
59
|
+
"export-page.document-type": "Document type",
|
|
60
|
+
"export-page.types.invoice": "Invoice",
|
|
61
|
+
"export-page.types.estimate": "Estimate",
|
|
62
|
+
"export-page.types.credit_note": "Credit note",
|
|
63
|
+
"export-page.types.advance_invoice": "Advance invoice",
|
|
64
|
+
"export-page.types.delivery_note": "Delivery note",
|
|
65
|
+
"export-page.format": "Format",
|
|
66
|
+
"export-page.formats.xlsx": "Excel (.xlsx)",
|
|
67
|
+
"export-page.formats.csv": "CSV (.csv)",
|
|
68
|
+
"export-page.formats.pdf_zip": "PDF ZIP archive",
|
|
69
|
+
"export-page.pdf-export-info":
|
|
70
|
+
"PDF export runs asynchronously and generates a ZIP archive for the selected document types.",
|
|
71
|
+
"export-page.date-from": "Date from",
|
|
72
|
+
"export-page.date-to": "Date to",
|
|
73
|
+
"export-page.error.date-range-exceeded": "Date range cannot exceed one year.",
|
|
74
|
+
"export-page.clear-dates": "Clear dates",
|
|
75
|
+
"export-page.exporting": "Exporting...",
|
|
76
|
+
"export-page.export-button": "Export documents",
|
|
77
|
+
},
|
|
78
|
+
} as const;
|
|
56
79
|
|
|
57
80
|
export function DocumentExportForm({
|
|
58
81
|
entityId,
|
|
59
82
|
token,
|
|
60
83
|
accountId,
|
|
61
84
|
language,
|
|
62
|
-
t,
|
|
85
|
+
t: translateFn,
|
|
86
|
+
namespace,
|
|
87
|
+
locale,
|
|
63
88
|
apiBaseUrl = "",
|
|
64
89
|
onSuccess,
|
|
65
90
|
onError,
|
|
66
91
|
onPdfExportStarted,
|
|
67
92
|
onLoadingChange,
|
|
68
93
|
}: DocumentExportFormProps) {
|
|
94
|
+
const t = createTranslation({ t: translateFn, namespace, locale, translations });
|
|
69
95
|
const defaultDates = getPreviousMonthRange();
|
|
70
96
|
const [documentType, setDocumentType] = useState<DocumentType>("invoice");
|
|
71
97
|
const [selectedTypes, setSelectedTypes] = useState<DocumentType[]>(["invoice"]);
|
|
@@ -112,6 +138,7 @@ export function DocumentExportForm({
|
|
|
112
138
|
Authorization: `Bearer ${token}`,
|
|
113
139
|
"x-entity-id": entityId,
|
|
114
140
|
...(accountId && { "x-account-id": accountId }),
|
|
141
|
+
...getClientHeaders("ui"),
|
|
115
142
|
"Content-Type": "application/json",
|
|
116
143
|
},
|
|
117
144
|
body: JSON.stringify({
|
|
@@ -140,11 +167,9 @@ export function DocumentExportForm({
|
|
|
140
167
|
|
|
141
168
|
// XLSX/CSV export - synchronous download
|
|
142
169
|
try {
|
|
143
|
-
const exportLanguage = language === "sl" ? "sl" : "en";
|
|
144
170
|
const queryParams: Record<string, string> = {
|
|
145
171
|
type: documentType,
|
|
146
172
|
format: exportFormat,
|
|
147
|
-
language: exportLanguage,
|
|
148
173
|
};
|
|
149
174
|
if (dateFrom) {
|
|
150
175
|
queryParams.date_from = dateFrom;
|
|
@@ -158,6 +183,7 @@ export function DocumentExportForm({
|
|
|
158
183
|
Authorization: `Bearer ${token}`,
|
|
159
184
|
"x-entity-id": entityId,
|
|
160
185
|
...(accountId && { "x-account-id": accountId }),
|
|
186
|
+
...getClientHeaders("ui"),
|
|
161
187
|
},
|
|
162
188
|
});
|
|
163
189
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { getClientHeaders } from "@spaceinvoices/js-sdk";
|
|
3
2
|
import { Calendar, Download, Loader2 } from "lucide-react";
|
|
4
3
|
import { useState } from "react";
|
|
4
|
+
import type { ComponentTranslationProps } from "@/ui/lib/translation";
|
|
5
|
+
import { createTranslation } from "@/ui/lib/translation";
|
|
5
6
|
import { Button } from "../ui/button";
|
|
6
7
|
import { Input } from "../ui/input";
|
|
7
8
|
import { Label } from "../ui/label";
|
|
@@ -41,23 +42,39 @@ export type SalesPerItemExportFormProps = {
|
|
|
41
42
|
token: string;
|
|
42
43
|
accountId?: string | null;
|
|
43
44
|
language: string;
|
|
44
|
-
t: TFunction;
|
|
45
45
|
/** Base URL for API calls (required in embed context where relative paths don't reach the API) */
|
|
46
46
|
apiBaseUrl?: string;
|
|
47
47
|
onSuccess?: (fileName: string) => void;
|
|
48
48
|
onError?: (error: Error) => void;
|
|
49
|
-
};
|
|
49
|
+
} & ComponentTranslationProps;
|
|
50
|
+
|
|
51
|
+
const translations = {
|
|
52
|
+
en: {
|
|
53
|
+
"sales-per-item-export.error.dates-required": "Select both a start and end date.",
|
|
54
|
+
"export-page.error.date-range-exceeded": "Date range cannot exceed one year.",
|
|
55
|
+
"export-page.format": "Format",
|
|
56
|
+
"export-page.formats.xlsx": "Excel (.xlsx)",
|
|
57
|
+
"export-page.formats.csv": "CSV (.csv)",
|
|
58
|
+
"export-page.date-from": "Date from",
|
|
59
|
+
"export-page.date-to": "Date to",
|
|
60
|
+
"export-page.exporting": "Exporting...",
|
|
61
|
+
"export-page.export-button": "Export sales per item",
|
|
62
|
+
},
|
|
63
|
+
} as const;
|
|
50
64
|
|
|
51
65
|
export function SalesPerItemExportForm({
|
|
52
66
|
entityId,
|
|
53
67
|
token,
|
|
54
68
|
accountId,
|
|
55
69
|
language,
|
|
56
|
-
t,
|
|
70
|
+
t: translateFn,
|
|
71
|
+
namespace,
|
|
72
|
+
locale,
|
|
57
73
|
apiBaseUrl = "",
|
|
58
74
|
onSuccess,
|
|
59
75
|
onError,
|
|
60
76
|
}: SalesPerItemExportFormProps) {
|
|
77
|
+
const t = createTranslation({ t: translateFn, namespace, locale, translations });
|
|
61
78
|
const defaultDates = getPreviousMonthRange();
|
|
62
79
|
const [exportFormat, setExportFormat] = useState<ExportFormat>("xlsx");
|
|
63
80
|
const [dateFrom, setDateFrom] = useState(defaultDates.from);
|
|
@@ -85,12 +102,10 @@ export function SalesPerItemExportForm({
|
|
|
85
102
|
setIsExporting(true);
|
|
86
103
|
|
|
87
104
|
try {
|
|
88
|
-
const exportLanguage = language === "sl" ? "sl" : "en";
|
|
89
105
|
const queryParams: Record<string, string> = {
|
|
90
106
|
format: exportFormat,
|
|
91
107
|
date_from: dateFrom,
|
|
92
108
|
date_to: dateTo,
|
|
93
|
-
language: exportLanguage,
|
|
94
109
|
};
|
|
95
110
|
|
|
96
111
|
const response = await fetch(
|
|
@@ -100,6 +115,7 @@ export function SalesPerItemExportForm({
|
|
|
100
115
|
Authorization: `Bearer ${token}`,
|
|
101
116
|
"x-entity-id": entityId,
|
|
102
117
|
...(accountId && { "x-account-id": accountId }),
|
|
118
|
+
...getClientHeaders("ui"),
|
|
103
119
|
},
|
|
104
120
|
},
|
|
105
121
|
);
|