@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,253 @@
|
|
|
1
|
+
import { AlertCircle, TriangleAlert } from "lucide-react";
|
|
2
|
+
import type { ChangeEvent } from "react";
|
|
3
|
+
import { SloveniaYearlySummary } from "./slovenia-yearly-summary";
|
|
4
|
+
import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
|
|
5
|
+
import { Input } from "../ui/input";
|
|
6
|
+
import { Label } from "../ui/label";
|
|
7
|
+
|
|
8
|
+
type Warning = {
|
|
9
|
+
code: string;
|
|
10
|
+
message: string;
|
|
11
|
+
severity: "info" | "warning";
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type IssueDetail = {
|
|
15
|
+
code: string;
|
|
16
|
+
title: string;
|
|
17
|
+
summary: string;
|
|
18
|
+
explanation: string;
|
|
19
|
+
action: string | null;
|
|
20
|
+
severity: "info" | "warning";
|
|
21
|
+
official_sources: Array<{
|
|
22
|
+
label: string;
|
|
23
|
+
url: string;
|
|
24
|
+
issuer: "FURS" | "PISRS";
|
|
25
|
+
}>;
|
|
26
|
+
affected_documents: Array<{
|
|
27
|
+
id: string;
|
|
28
|
+
type: "invoice" | "credit_note";
|
|
29
|
+
number: string;
|
|
30
|
+
date: string;
|
|
31
|
+
customer_name: string | null;
|
|
32
|
+
customer_country_code: string | null;
|
|
33
|
+
customer_tax_number: string | null;
|
|
34
|
+
currency_code: string;
|
|
35
|
+
total: number;
|
|
36
|
+
total_converted: number | null;
|
|
37
|
+
reason: string;
|
|
38
|
+
document_path: string;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
type Draft = {
|
|
43
|
+
auto_values: {
|
|
44
|
+
total_invoice_revenue: number;
|
|
45
|
+
total_credit_note_reduction: number;
|
|
46
|
+
adjusted_revenue: number;
|
|
47
|
+
normative_expenses: number;
|
|
48
|
+
tax_base: number;
|
|
49
|
+
income_tax_amount: number;
|
|
50
|
+
advance_tax_amount: number;
|
|
51
|
+
monthly_installment_amount: number;
|
|
52
|
+
quarterly_installment_amount: number;
|
|
53
|
+
};
|
|
54
|
+
warnings: Warning[];
|
|
55
|
+
issue_details: IssueDetail[];
|
|
56
|
+
rule_summary: {
|
|
57
|
+
normative_expense_rule: string;
|
|
58
|
+
income_tax_rule: string;
|
|
59
|
+
advance_rule: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
type ManualValues = {
|
|
64
|
+
withholding_tax_amount: number;
|
|
65
|
+
foreign_tax_credit_amount: number;
|
|
66
|
+
prior_advance_income_tax_amount: number;
|
|
67
|
+
revenue_adjustment_decrease: number;
|
|
68
|
+
revenue_adjustment_increase: number;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
type SloveniaYearlyReviewStepProps = {
|
|
72
|
+
draft: Draft;
|
|
73
|
+
manualValues: ManualValues;
|
|
74
|
+
t: (key: string) => string;
|
|
75
|
+
onManualValueChange: (field: keyof ManualValues, value: number) => void;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
function formatCurrency(value: number): string {
|
|
79
|
+
return new Intl.NumberFormat("sl-SI", {
|
|
80
|
+
style: "currency",
|
|
81
|
+
currency: "EUR",
|
|
82
|
+
}).format(value);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function SloveniaYearlyReviewStep({
|
|
86
|
+
draft,
|
|
87
|
+
manualValues,
|
|
88
|
+
t,
|
|
89
|
+
onManualValueChange,
|
|
90
|
+
}: SloveniaYearlyReviewStepProps) {
|
|
91
|
+
return (
|
|
92
|
+
<div className="space-y-4">
|
|
93
|
+
<SloveniaYearlySummary
|
|
94
|
+
items={[
|
|
95
|
+
{
|
|
96
|
+
label: t("slovenia-yearly.review.summary.adjusted-revenue"),
|
|
97
|
+
value: formatCurrency(draft.auto_values.adjusted_revenue),
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: t("slovenia-yearly.review.summary.normative-expenses"),
|
|
101
|
+
value: formatCurrency(draft.auto_values.normative_expenses),
|
|
102
|
+
},
|
|
103
|
+
{ label: t("slovenia-yearly.review.summary.income-tax"), value: formatCurrency(draft.auto_values.income_tax_amount) },
|
|
104
|
+
]}
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
<div className="grid gap-4 md:grid-cols-2">
|
|
108
|
+
<div className="rounded-md border p-4">
|
|
109
|
+
<h4 className="font-medium">{t("slovenia-yearly.review.rules.title")}</h4>
|
|
110
|
+
<div className="mt-3 space-y-3 text-sm">
|
|
111
|
+
<p>{draft.rule_summary.normative_expense_rule}</p>
|
|
112
|
+
<p>{draft.rule_summary.income_tax_rule}</p>
|
|
113
|
+
<p>{draft.rule_summary.advance_rule}</p>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<div className="rounded-md border p-4">
|
|
118
|
+
<h4 className="font-medium">{t("slovenia-yearly.review.installments.title")}</h4>
|
|
119
|
+
<div className="mt-3 space-y-2 text-sm">
|
|
120
|
+
<p>
|
|
121
|
+
{t("slovenia-yearly.review.installments.advance-tax")}: {formatCurrency(draft.auto_values.advance_tax_amount)}
|
|
122
|
+
</p>
|
|
123
|
+
<p>
|
|
124
|
+
{t("slovenia-yearly.review.installments.monthly")}: {formatCurrency(draft.auto_values.monthly_installment_amount)}
|
|
125
|
+
</p>
|
|
126
|
+
<p>
|
|
127
|
+
{t("slovenia-yearly.review.installments.quarterly")}: {formatCurrency(draft.auto_values.quarterly_installment_amount)}
|
|
128
|
+
</p>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
|
|
133
|
+
{draft.warnings.length > 0 && (
|
|
134
|
+
<div className="space-y-3">
|
|
135
|
+
{draft.warnings.map((warning) => (
|
|
136
|
+
<Alert key={warning.code} variant={warning.severity === "warning" ? "destructive" : "default"}>
|
|
137
|
+
{warning.severity === "warning" ? <TriangleAlert className="h-4 w-4" /> : <AlertCircle className="h-4 w-4" />}
|
|
138
|
+
<AlertTitle>
|
|
139
|
+
{warning.severity === "warning"
|
|
140
|
+
? t("slovenia-yearly.review.warnings.review-required")
|
|
141
|
+
: t("slovenia-yearly.review.warnings.check-before-export")}
|
|
142
|
+
</AlertTitle>
|
|
143
|
+
<AlertDescription>{warning.message}</AlertDescription>
|
|
144
|
+
</Alert>
|
|
145
|
+
))}
|
|
146
|
+
</div>
|
|
147
|
+
)}
|
|
148
|
+
|
|
149
|
+
{draft.issue_details.length > 0 && (
|
|
150
|
+
<div className="space-y-4">
|
|
151
|
+
{draft.issue_details.map((issue) => (
|
|
152
|
+
<div key={issue.code} className="rounded-md border p-4">
|
|
153
|
+
<div className="space-y-2">
|
|
154
|
+
<h4 className="font-medium">{issue.title}</h4>
|
|
155
|
+
<p className="text-sm">{issue.explanation}</p>
|
|
156
|
+
{issue.action && <p className="text-muted-foreground text-sm">{issue.action}</p>}
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
{issue.official_sources.length > 0 && (
|
|
160
|
+
<div className="mt-4 space-y-2">
|
|
161
|
+
<p className="text-sm font-medium">{t("slovenia-yearly.review.issues.official-guidance")}</p>
|
|
162
|
+
<div className="space-y-1 text-sm">
|
|
163
|
+
{issue.official_sources.map((source) => (
|
|
164
|
+
<a
|
|
165
|
+
key={source.url}
|
|
166
|
+
className="text-primary block underline underline-offset-4"
|
|
167
|
+
href={source.url}
|
|
168
|
+
rel="noreferrer"
|
|
169
|
+
target="_blank"
|
|
170
|
+
>
|
|
171
|
+
{source.issuer}: {source.label}
|
|
172
|
+
</a>
|
|
173
|
+
))}
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
)}
|
|
177
|
+
|
|
178
|
+
{issue.affected_documents.length > 0 && (
|
|
179
|
+
<div className="mt-4 space-y-3">
|
|
180
|
+
<p className="text-sm font-medium">{t("slovenia-yearly.review.issues.affected-documents")}</p>
|
|
181
|
+
<div className="space-y-2">
|
|
182
|
+
{issue.affected_documents.map((document) => (
|
|
183
|
+
<div
|
|
184
|
+
key={`${issue.code}-${document.id}`}
|
|
185
|
+
className="bg-muted/40 flex flex-col gap-2 rounded-md border p-3 text-sm"
|
|
186
|
+
>
|
|
187
|
+
<div className="flex flex-wrap items-center justify-between gap-2">
|
|
188
|
+
<div className="font-medium">
|
|
189
|
+
{document.number} ·{" "}
|
|
190
|
+
{document.type === "invoice"
|
|
191
|
+
? t("slovenia-yearly.review.issues.document-type.invoice")
|
|
192
|
+
: t("slovenia-yearly.review.issues.document-type.credit-note")}
|
|
193
|
+
</div>
|
|
194
|
+
<a
|
|
195
|
+
className="text-primary underline underline-offset-4"
|
|
196
|
+
href={document.document_path}
|
|
197
|
+
rel="noreferrer"
|
|
198
|
+
target="_blank"
|
|
199
|
+
>
|
|
200
|
+
{t("slovenia-yearly.review.issues.open-document")}
|
|
201
|
+
</a>
|
|
202
|
+
</div>
|
|
203
|
+
<div className="text-muted-foreground flex flex-wrap gap-x-4 gap-y-1">
|
|
204
|
+
<span>{t("slovenia-yearly.review.issues.fields.date")}: {document.date}</span>
|
|
205
|
+
{document.customer_name && (
|
|
206
|
+
<span>{t("slovenia-yearly.review.issues.fields.customer")}: {document.customer_name}</span>
|
|
207
|
+
)}
|
|
208
|
+
{document.customer_country_code && (
|
|
209
|
+
<span>{t("slovenia-yearly.review.issues.fields.country")}: {document.customer_country_code}</span>
|
|
210
|
+
)}
|
|
211
|
+
{document.customer_tax_number && (
|
|
212
|
+
<span>{t("slovenia-yearly.review.issues.fields.tax-number")}: {document.customer_tax_number}</span>
|
|
213
|
+
)}
|
|
214
|
+
<span>{t("slovenia-yearly.review.issues.fields.currency")}: {document.currency_code}</span>
|
|
215
|
+
</div>
|
|
216
|
+
<p>{document.reason}</p>
|
|
217
|
+
</div>
|
|
218
|
+
))}
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
)}
|
|
222
|
+
</div>
|
|
223
|
+
))}
|
|
224
|
+
</div>
|
|
225
|
+
)}
|
|
226
|
+
|
|
227
|
+
<div className="grid gap-4 md:grid-cols-2">
|
|
228
|
+
{(
|
|
229
|
+
[
|
|
230
|
+
["withholding_tax_amount", t("slovenia-yearly.review.manual.withholding-tax")],
|
|
231
|
+
["foreign_tax_credit_amount", t("slovenia-yearly.review.manual.foreign-tax-credit")],
|
|
232
|
+
["prior_advance_income_tax_amount", t("slovenia-yearly.review.manual.prior-advance-income-tax")],
|
|
233
|
+
["revenue_adjustment_decrease", t("slovenia-yearly.review.manual.revenue-adjustment-decrease")],
|
|
234
|
+
["revenue_adjustment_increase", t("slovenia-yearly.review.manual.revenue-adjustment-increase")],
|
|
235
|
+
] as Array<[keyof ManualValues, string]>
|
|
236
|
+
).map(([field, label]) => (
|
|
237
|
+
<div key={field} className="space-y-2">
|
|
238
|
+
<Label htmlFor={`si-yearly-${field}`}>{label}</Label>
|
|
239
|
+
<Input
|
|
240
|
+
id={`si-yearly-${field}`}
|
|
241
|
+
inputMode="decimal"
|
|
242
|
+
type="number"
|
|
243
|
+
min="0"
|
|
244
|
+
step="0.01"
|
|
245
|
+
value={String(manualValues[field])}
|
|
246
|
+
onChange={(event: ChangeEvent<HTMLInputElement>) => onManualValueChange(field, Number(event.target.value) || 0)}
|
|
247
|
+
/>
|
|
248
|
+
</div>
|
|
249
|
+
))}
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type SloveniaYearlySummaryProps = {
|
|
2
|
+
items: Array<{
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}>;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export function SloveniaYearlySummary({ items }: SloveniaYearlySummaryProps) {
|
|
9
|
+
return (
|
|
10
|
+
<div className="grid gap-3 md:grid-cols-3">
|
|
11
|
+
{items.map((item) => (
|
|
12
|
+
<div key={item.label} className="rounded-md border bg-muted/30 p-3">
|
|
13
|
+
<p className="text-muted-foreground text-sm">{item.label}</p>
|
|
14
|
+
<p className="font-semibold text-base">{item.value}</p>
|
|
15
|
+
</div>
|
|
16
|
+
))}
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Tax } from "@spaceinvoices/js-sdk";
|
|
2
|
+
import { withTableTranslations } from "../../table/locales";
|
|
2
3
|
import type { ComponentTranslationProps } from "@/ui/lib/translation";
|
|
3
4
|
import { createTranslation } from "@/ui/lib/translation";
|
|
4
5
|
import { useSDK } from "@/ui/providers/sdk-provider";
|
|
@@ -19,7 +20,7 @@ import sl from "./locales/sl";
|
|
|
19
20
|
import TaxListHeader from "./tax-list-header";
|
|
20
21
|
import TaxListRow from "./tax-list-row";
|
|
21
22
|
|
|
22
|
-
const translations = {
|
|
23
|
+
const translations = withTableTranslations({
|
|
23
24
|
en,
|
|
24
25
|
sl,
|
|
25
26
|
de,
|
|
@@ -30,7 +31,7 @@ const translations = {
|
|
|
30
31
|
nl,
|
|
31
32
|
pl,
|
|
32
33
|
hr,
|
|
33
|
-
} as const;
|
|
34
|
+
} as const);
|
|
34
35
|
|
|
35
36
|
type TaxListTableProps = {
|
|
36
37
|
entityId?: string;
|
|
@@ -149,6 +149,7 @@ function SidebarProvider({
|
|
|
149
149
|
{
|
|
150
150
|
"--sidebar-width": SIDEBAR_WIDTH,
|
|
151
151
|
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
152
|
+
"--sidebar-shell-offset": "0px",
|
|
152
153
|
...style,
|
|
153
154
|
} as React.CSSProperties
|
|
154
155
|
}
|
|
@@ -244,8 +245,8 @@ function Sidebar({
|
|
|
244
245
|
className={cn(
|
|
245
246
|
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
246
247
|
side === "left"
|
|
247
|
-
? "left-
|
|
248
|
-
: "right-
|
|
248
|
+
? "left-[var(--sidebar-shell-offset)] group-data-[collapsible=offExamples]:left-[calc(var(--sidebar-shell-offset)-var(--sidebar-width))]"
|
|
249
|
+
: "right-[var(--sidebar-shell-offset)] group-data-[collapsible=offExamples]:right-[calc(var(--sidebar-shell-offset)-var(--sidebar-width))]",
|
|
249
250
|
// Adjust the padding for floating and inset variants.
|
|
250
251
|
variant === "floating" || variant === "inset"
|
|
251
252
|
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
|
|
@@ -35,7 +35,12 @@ export function StickyFormFooter({
|
|
|
35
35
|
return (
|
|
36
36
|
<div className={cn("sticky bottom-0 z-10 border-t bg-sidebar px-4 py-3", className)}>
|
|
37
37
|
<div className="flex gap-2">
|
|
38
|
-
<Button
|
|
38
|
+
<Button
|
|
39
|
+
{...buttonProps}
|
|
40
|
+
className="cursor-pointer px-8"
|
|
41
|
+
disabled={isPending || !isDirty}
|
|
42
|
+
data-testid={`${formId}-submit`}
|
|
43
|
+
>
|
|
39
44
|
{isPending ? <ButtonLoader /> : label}
|
|
40
45
|
</Button>
|
|
41
46
|
{secondaryAction && (
|
|
@@ -45,6 +50,7 @@ export function StickyFormFooter({
|
|
|
45
50
|
className="cursor-pointer px-8"
|
|
46
51
|
disabled={secondaryAction.isPending || !isDirty}
|
|
47
52
|
onClick={secondaryAction.onClick}
|
|
53
|
+
data-testid={`${formId}-secondary-submit`}
|
|
48
54
|
>
|
|
49
55
|
{secondaryAction.isPending ? <ButtonLoader /> : secondaryAction.label}
|
|
50
56
|
</Button>
|