@spaceinvoices/react-ui 0.4.3 → 0.4.5
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/src/common/autocomplete.tsx +18 -2
- package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +61 -12
- package/src/components/advance-invoices/create/locales/de.ts +17 -0
- package/src/components/advance-invoices/create/locales/es.ts +17 -0
- package/src/components/advance-invoices/create/locales/fr.ts +17 -0
- package/src/components/advance-invoices/create/locales/hr.ts +16 -0
- package/src/components/advance-invoices/create/locales/it.ts +17 -0
- package/src/components/advance-invoices/create/locales/nl.ts +17 -0
- package/src/components/advance-invoices/create/locales/pl.ts +16 -0
- package/src/components/advance-invoices/create/locales/pt.ts +16 -0
- package/src/components/advance-invoices/create/locales/sl.ts +16 -0
- package/src/components/advance-invoices/create/prepare-advance-invoice-submission.ts +0 -1
- package/src/components/advance-invoices/list/list-row-actions.tsx +48 -1
- package/src/components/advance-invoices/list/list-table.tsx +100 -50
- package/src/components/advance-invoices/list/locales/de.ts +9 -0
- package/src/components/advance-invoices/list/locales/en.ts +7 -0
- package/src/components/advance-invoices/list/locales/es.ts +9 -0
- package/src/components/advance-invoices/list/locales/fr.ts +9 -0
- package/src/components/advance-invoices/list/locales/hr.ts +8 -0
- package/src/components/advance-invoices/list/locales/it.ts +9 -0
- package/src/components/advance-invoices/list/locales/nl.ts +9 -0
- package/src/components/advance-invoices/list/locales/pl.ts +8 -0
- package/src/components/advance-invoices/list/locales/pt.ts +9 -0
- package/src/components/advance-invoices/list/locales/sl.ts +8 -0
- package/src/components/credit-notes/create/create-credit-note-form.tsx +185 -11
- package/src/components/credit-notes/create/locales/de.ts +18 -0
- package/src/components/credit-notes/create/locales/es.ts +18 -0
- package/src/components/credit-notes/create/locales/fr.ts +18 -0
- package/src/components/credit-notes/create/locales/hr.ts +17 -0
- package/src/components/credit-notes/create/locales/it.ts +18 -0
- package/src/components/credit-notes/create/locales/nl.ts +18 -0
- package/src/components/credit-notes/create/locales/pl.ts +17 -0
- package/src/components/credit-notes/create/locales/pt.ts +17 -0
- package/src/components/credit-notes/create/locales/sl.ts +18 -1
- package/src/components/credit-notes/credit-notes.hooks.ts +30 -0
- package/src/components/credit-notes/list/list-row-actions.tsx +44 -1
- package/src/components/credit-notes/list/list-table.tsx +93 -32
- package/src/components/credit-notes/list/locales/de.ts +7 -0
- package/src/components/credit-notes/list/locales/en.ts +6 -0
- package/src/components/credit-notes/list/locales/es.ts +7 -0
- package/src/components/credit-notes/list/locales/fr.ts +7 -0
- package/src/components/credit-notes/list/locales/hr.ts +7 -0
- package/src/components/credit-notes/list/locales/it.ts +7 -0
- package/src/components/credit-notes/list/locales/nl.ts +7 -0
- package/src/components/credit-notes/list/locales/pl.ts +7 -0
- package/src/components/credit-notes/list/locales/pt.ts +7 -0
- package/src/components/credit-notes/list/locales/sl.ts +7 -0
- package/src/components/customers/customer-list-table/customer-list-table.tsx +0 -3
- package/src/components/customers/customer-list-table/locales/de.ts +1 -0
- package/src/components/customers/customer-list-table/locales/es.ts +1 -0
- package/src/components/customers/customer-list-table/locales/fr.ts +1 -0
- package/src/components/customers/customer-list-table/locales/hr.ts +1 -0
- package/src/components/customers/customer-list-table/locales/it.ts +1 -0
- package/src/components/customers/customer-list-table/locales/nl.ts +1 -0
- package/src/components/customers/customer-list-table/locales/pl.ts +1 -0
- package/src/components/customers/customer-list-table/locales/pt.ts +1 -0
- package/src/components/customers/customer-list-table/locales/sl.ts +1 -0
- package/src/components/dashboard/collection-rate-card/use-collection-rate.ts +48 -9
- package/src/components/dashboard/revenue-trend-chart/use-revenue-trend.ts +77 -48
- package/src/components/dashboard/shared/use-revenue-data.ts +77 -9
- package/src/components/delivery-notes/create/create-delivery-note-form.tsx +67 -7
- package/src/components/delivery-notes/create/locales/de.ts +16 -0
- package/src/components/delivery-notes/create/locales/es.ts +16 -0
- package/src/components/delivery-notes/create/locales/fr.ts +16 -0
- package/src/components/delivery-notes/create/locales/hr.ts +16 -0
- package/src/components/delivery-notes/create/locales/it.ts +16 -0
- package/src/components/delivery-notes/create/locales/nl.ts +16 -0
- package/src/components/delivery-notes/create/locales/pl.ts +16 -0
- package/src/components/delivery-notes/create/locales/pt.ts +16 -0
- package/src/components/delivery-notes/create/locales/sl.ts +17 -1
- package/src/components/delivery-notes/list/list-row-actions.tsx +20 -1
- package/src/components/delivery-notes/list/list-table.tsx +50 -8
- package/src/components/delivery-notes/list/locales/de.ts +35 -0
- package/src/components/delivery-notes/list/locales/en.ts +33 -0
- package/src/components/delivery-notes/list/locales/es.ts +35 -0
- package/src/components/delivery-notes/list/locales/fr.ts +35 -0
- package/src/components/delivery-notes/list/locales/hr.ts +35 -0
- package/src/components/delivery-notes/list/locales/it.ts +35 -0
- package/src/components/delivery-notes/list/locales/nl.ts +35 -0
- package/src/components/delivery-notes/list/locales/pl.ts +35 -0
- package/src/components/delivery-notes/list/locales/pt.ts +35 -0
- package/src/components/delivery-notes/list/locales/sl.ts +35 -0
- package/src/components/documents/create/document-add-item-form.tsx +70 -0
- package/src/components/documents/create/document-details-section.tsx +163 -29
- package/src/components/documents/create/document-items-section.tsx +21 -4
- package/src/components/documents/create/linked-documents-info.tsx +82 -0
- package/src/components/documents/create/live-preview.tsx +25 -5
- package/src/components/documents/create/mark-as-paid-section.tsx +29 -20
- package/src/components/documents/create/prepare-document-submission.ts +19 -7
- package/src/components/documents/shared/document-preview-display.tsx +3 -4
- package/src/components/documents/types.ts +2 -2
- package/src/components/documents/view/document-actions-bar.tsx +7 -27
- package/src/components/documents/view/document-activities-list.tsx +65 -47
- package/src/components/documents/view/document-details-card.tsx +118 -76
- package/src/components/documents/view/document-payments-list.tsx +99 -65
- package/src/components/documents/view/document-relations-list.tsx +43 -28
- package/src/components/documents/view/document-sidebar.tsx +151 -0
- package/src/components/documents/view/index.ts +2 -0
- package/src/components/documents/view/locales/de.ts +4 -0
- package/src/components/documents/view/locales/es.ts +4 -0
- package/src/components/documents/view/locales/fr.ts +4 -0
- package/src/components/documents/view/locales/hr.ts +4 -0
- package/src/components/documents/view/locales/it.ts +4 -0
- package/src/components/documents/view/locales/nl.ts +4 -0
- package/src/components/documents/view/locales/pl.ts +4 -0
- package/src/components/documents/view/locales/pt.ts +4 -0
- package/src/components/documents/view/locales/sl.ts +5 -1
- package/src/components/documents/view/use-document-download.ts +7 -3
- package/src/components/entities/create-entity-form.tsx +166 -13
- package/src/components/entities/entity-settings-form/entity-settings-form.tsx +101 -1
- package/src/components/entities/entity-settings-form/input-with-preview.tsx +30 -2
- 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-settings-form.tsx +6 -6
- package/src/components/entities/fina-settings-form/locales/de.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/en.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/es.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/fr.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/hr.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/it.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/nl.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/pl.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/pt.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/sl.ts +2 -2
- package/src/components/entities/furs-settings-form/locales/en.ts +0 -1
- package/src/components/entities/settings/company-settings-form.tsx +173 -20
- package/src/components/entities/settings/pdf-template-selector/locales/de.ts +3 -1
- package/src/components/entities/settings/pdf-template-selector/locales/es.ts +3 -1
- package/src/components/entities/settings/pdf-template-selector/locales/fr.ts +4 -1
- package/src/components/entities/settings/pdf-template-selector/locales/hr.ts +4 -1
- package/src/components/entities/settings/pdf-template-selector/locales/it.ts +3 -1
- package/src/components/entities/settings/pdf-template-selector/locales/nl.ts +3 -1
- package/src/components/entities/settings/pdf-template-selector/locales/pl.ts +3 -1
- package/src/components/entities/settings/pdf-template-selector/locales/pt.ts +3 -1
- package/src/components/entities/settings/pdf-template-selector/locales/sl.ts +3 -1
- package/src/components/entities/settings/pdf-template-selector/pdf-template-cards.tsx +1 -0
- package/src/components/estimates/create/create-estimate-form.tsx +93 -8
- package/src/components/estimates/create/locales/de.ts +16 -0
- package/src/components/estimates/create/locales/es.ts +16 -0
- package/src/components/estimates/create/locales/fr.ts +16 -0
- package/src/components/estimates/create/locales/hr.ts +16 -0
- package/src/components/estimates/create/locales/it.ts +16 -0
- package/src/components/estimates/create/locales/nl.ts +16 -0
- package/src/components/estimates/create/locales/pl.ts +16 -0
- package/src/components/estimates/create/locales/pt.ts +16 -0
- package/src/components/estimates/create/locales/sl.ts +17 -1
- package/src/components/estimates/list/list-table.tsx +14 -8
- 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 +2 -0
- package/src/components/estimates/list/locales/fr.ts +2 -0
- package/src/components/estimates/list/locales/hr.ts +2 -0
- package/src/components/estimates/list/locales/it.ts +2 -0
- package/src/components/estimates/list/locales/nl.ts +2 -0
- package/src/components/estimates/list/locales/pl.ts +2 -0
- package/src/components/estimates/list/locales/pt.ts +2 -0
- package/src/components/estimates/list/locales/sl.ts +2 -0
- package/src/components/export/document-export-form.tsx +55 -14
- package/src/components/export/index.ts +2 -0
- package/src/components/export/sales-per-item-export-form.tsx +223 -0
- package/src/components/invoices/create/create-invoice-form.tsx +106 -11
- package/src/components/invoices/create/locales/de.ts +26 -0
- package/src/components/invoices/create/locales/es.ts +26 -0
- package/src/components/invoices/create/locales/fr.ts +26 -0
- package/src/components/invoices/create/locales/hr.ts +25 -0
- package/src/components/invoices/create/locales/it.ts +26 -0
- package/src/components/invoices/create/locales/nl.ts +26 -0
- package/src/components/invoices/create/locales/pl.ts +25 -0
- package/src/components/invoices/create/locales/pt.ts +25 -0
- package/src/components/invoices/create/locales/sl.ts +26 -1
- package/src/components/invoices/invoices-furs.hooks.ts +4 -1
- package/src/components/invoices/list/list-table.tsx +77 -31
- package/src/components/invoices/list/locales/de.ts +5 -0
- package/src/components/invoices/list/locales/en.ts +4 -0
- package/src/components/invoices/list/locales/es.ts +5 -0
- package/src/components/invoices/list/locales/fr.ts +5 -0
- package/src/components/invoices/list/locales/hr.ts +5 -0
- package/src/components/invoices/list/locales/it.ts +5 -0
- package/src/components/invoices/list/locales/nl.ts +5 -0
- package/src/components/invoices/list/locales/pl.ts +5 -0
- package/src/components/invoices/list/locales/pt.ts +5 -0
- package/src/components/invoices/list/locales/sl.ts +5 -0
- package/src/components/invoices/view/fiscalization-status-card.tsx +44 -24
- package/src/components/items/item-combobox.tsx +5 -3
- package/src/components/items/item-list-table/item-list-header.tsx +4 -17
- package/src/components/items/item-list-table/item-list-table.tsx +3 -3
- package/src/components/items/item-list-table/locales/de.ts +1 -0
- package/src/components/items/item-list-table/locales/es.ts +1 -0
- package/src/components/items/item-list-table/locales/fr.ts +1 -0
- package/src/components/items/item-list-table/locales/hr.ts +1 -0
- package/src/components/items/item-list-table/locales/it.ts +1 -0
- package/src/components/items/item-list-table/locales/nl.ts +1 -0
- package/src/components/items/item-list-table/locales/pl.ts +1 -0
- package/src/components/items/item-list-table/locales/pt.ts +1 -0
- package/src/components/items/item-list-table/locales/sl.ts +1 -0
- package/src/components/payments/list/list-table.tsx +0 -4
- package/src/components/payments/list/locales/de.ts +1 -0
- package/src/components/payments/list/locales/es.ts +1 -0
- package/src/components/payments/list/locales/fr.ts +1 -0
- package/src/components/payments/list/locales/hr.ts +1 -0
- package/src/components/payments/list/locales/it.ts +1 -0
- package/src/components/payments/list/locales/nl.ts +1 -0
- package/src/components/payments/list/locales/pl.ts +1 -0
- package/src/components/payments/list/locales/pt.ts +1 -0
- package/src/components/payments/list/locales/sl.ts +1 -0
- package/src/components/recurring-invoices/list/list-table.tsx +0 -7
- package/src/components/recurring-invoices/list/locales/de.ts +1 -0
- package/src/components/recurring-invoices/list/locales/es.ts +1 -0
- package/src/components/recurring-invoices/list/locales/fr.ts +1 -0
- package/src/components/recurring-invoices/list/locales/hr.ts +1 -0
- package/src/components/recurring-invoices/list/locales/it.ts +1 -0
- package/src/components/recurring-invoices/list/locales/nl.ts +1 -0
- package/src/components/recurring-invoices/list/locales/pl.ts +1 -0
- package/src/components/recurring-invoices/list/locales/pt.ts +1 -0
- package/src/components/recurring-invoices/list/locales/sl.ts +1 -0
- package/src/components/request-logs/request-log-list-table.tsx +0 -3
- package/src/components/table/README.md +14 -121
- package/src/components/table/data-table.tsx +22 -37
- package/src/components/table/hooks/use-table-state.ts +3 -27
- package/src/components/table/index.ts +0 -2
- package/src/components/table/search-input.tsx +17 -0
- package/src/components/table/selection-toolbar.tsx +35 -1
- package/src/components/table/table-empty-state.tsx +6 -3
- package/src/components/table/table-no-results.tsx +10 -5
- package/src/components/table/types.ts +0 -5
- package/src/components/taxes/tax-list-table/locales/de.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/es.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/fr.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/hr.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/it.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/nl.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/pl.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/pt.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/sl.ts +1 -0
- package/src/components/taxes/tax-list-table/tax-list-header.tsx +3 -14
- package/src/components/taxes/tax-list-table/tax-list-table.tsx +3 -3
- package/src/components/ui/popover.tsx +3 -1
- package/src/components/ui/tooltip.tsx +3 -1
- package/src/generated/schemas/advanceinvoice.ts +4 -2
- package/src/generated/schemas/creditnote.ts +2 -1
- package/src/generated/schemas/deliverynote.ts +2 -1
- package/src/generated/schemas/estimate.ts +4 -2
- package/src/generated/schemas/index.ts +1 -1
- package/src/generated/schemas/invoice.ts +2 -1
- package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +17 -23
- package/src/generated/schemas/rendercreditnotepreview_body.ts +17 -23
- package/src/generated/schemas/renderdeliverynotepreview_body.ts +17 -23
- package/src/generated/schemas/renderestimatepreview_body.ts +17 -23
- package/src/generated/schemas/renderinvoicepreview_body.ts +19 -23
- package/src/hooks/use-duplicate-document.ts +56 -14
- package/src/hooks/use-vies-check.ts +3 -0
- package/src/lib/fiscalization.ts +12 -0
- package/src/lib/schemas/advance-invoice.ts +0 -1
- package/src/components/table/sortable-header.tsx +0 -56
|
@@ -39,9 +39,14 @@ export default {
|
|
|
39
39
|
"No results found": "Nenhuma fatura encontrada",
|
|
40
40
|
"Try adjusting your search criteria": "Tente ajustar os seus critérios de pesquisa",
|
|
41
41
|
"Clear search": "Limpar pesquisa",
|
|
42
|
+
"Clear all": "Limpar tudo",
|
|
42
43
|
selected: "selecionados",
|
|
43
44
|
"Export PDFs": "Exportar PDFs",
|
|
44
45
|
"Deselect all": "Desselecionar tudo",
|
|
45
46
|
Void: "Anular",
|
|
46
47
|
"Partially Paid": "Parcialmente pago",
|
|
48
|
+
"FURS fiscalization failed": "FURS fiscalization failed",
|
|
49
|
+
"FINA fiscalization failed": "FINA fiscalization failed",
|
|
50
|
+
"Retry Fiscalization": "Retry Fiscalization",
|
|
51
|
+
"Some selected documents don't have failed fiscalization": "Some selected documents don't have failed fiscalization",
|
|
47
52
|
} as const;
|
|
@@ -39,9 +39,14 @@ export default {
|
|
|
39
39
|
"No results found": "Ni najdenih računov",
|
|
40
40
|
"Try adjusting your search criteria": "Poskusite prilagoditi iskalne kriterije",
|
|
41
41
|
"Clear search": "Počisti iskanje",
|
|
42
|
+
"Clear all": "Počisti vse",
|
|
42
43
|
selected: "izbranih",
|
|
43
44
|
"Export PDFs": "Izvozi PDF-je",
|
|
44
45
|
"Deselect all": "Počisti izbiro",
|
|
45
46
|
Void: "Storniraj",
|
|
46
47
|
"Partially Paid": "Delno plačano",
|
|
48
|
+
"FURS fiscalization failed": "FURS davčno potrjevanje ni uspelo",
|
|
49
|
+
"FINA fiscalization failed": "FINA fiskalizacija ni uspela",
|
|
50
|
+
"Retry Fiscalization": "Ponovi fiskalizacijo",
|
|
51
|
+
"Some selected documents don't have failed fiscalization": "Nekateri izbrani dokumenti nimajo neuspele fiskalizacije",
|
|
47
52
|
} as const;
|
|
@@ -28,6 +28,7 @@ interface FiscalizationStatusCardProps extends ComponentTranslationProps {
|
|
|
28
28
|
fiscalizationData: FiscalizationData | null | undefined;
|
|
29
29
|
onRetry?: () => void;
|
|
30
30
|
isRetrying?: boolean;
|
|
31
|
+
variant?: "card" | "inline";
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
export function FiscalizationStatusCard({
|
|
@@ -35,6 +36,7 @@ export function FiscalizationStatusCard({
|
|
|
35
36
|
fiscalizationData,
|
|
36
37
|
onRetry,
|
|
37
38
|
isRetrying,
|
|
39
|
+
variant = "card",
|
|
38
40
|
t: translateFn,
|
|
39
41
|
namespace,
|
|
40
42
|
locale,
|
|
@@ -87,6 +89,47 @@ export function FiscalizationStatusCard({
|
|
|
87
89
|
}
|
|
88
90
|
};
|
|
89
91
|
|
|
92
|
+
const bodyContent = (
|
|
93
|
+
<>
|
|
94
|
+
{fiscalizationData.status === "skipped" ? (
|
|
95
|
+
<div className="text-muted-foreground text-sm">
|
|
96
|
+
{label} · {t("Skipped by user")}
|
|
97
|
+
</div>
|
|
98
|
+
) : (
|
|
99
|
+
<div className="text-muted-foreground text-sm">
|
|
100
|
+
{label} ·{" "}
|
|
101
|
+
{fiscalizationData.fiscalized_at && new Date(fiscalizationData.fiscalized_at).toLocaleString(locale)}
|
|
102
|
+
</div>
|
|
103
|
+
)}
|
|
104
|
+
|
|
105
|
+
{fiscalizationData.status === "failed" && fiscalizationData.error && (
|
|
106
|
+
<Alert variant="destructive">
|
|
107
|
+
<AlertCircle className="h-4 w-4" />
|
|
108
|
+
<AlertDescription className="text-sm">{fiscalizationData.error}</AlertDescription>
|
|
109
|
+
</Alert>
|
|
110
|
+
)}
|
|
111
|
+
|
|
112
|
+
{fiscalizationData.status === "failed" && onRetry && (
|
|
113
|
+
<Button variant="outline" size="sm" onClick={onRetry} disabled={isRetrying}>
|
|
114
|
+
{isRetrying ? <Loader2 className="mr-2 h-4 w-4 animate-spin" /> : <RefreshCw className="mr-2 h-4 w-4" />}
|
|
115
|
+
{t("Retry fiscalization")}
|
|
116
|
+
</Button>
|
|
117
|
+
)}
|
|
118
|
+
</>
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
if (variant === "inline") {
|
|
122
|
+
return (
|
|
123
|
+
<div className="space-y-3">
|
|
124
|
+
<div className="flex items-center justify-between font-medium text-sm">
|
|
125
|
+
<span>{t("Fiscalization")}</span>
|
|
126
|
+
{getStatusBadge()}
|
|
127
|
+
</div>
|
|
128
|
+
{bodyContent}
|
|
129
|
+
</div>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
90
133
|
return (
|
|
91
134
|
<Card>
|
|
92
135
|
<CardHeader className="pb-3">
|
|
@@ -95,30 +138,7 @@ export function FiscalizationStatusCard({
|
|
|
95
138
|
{getStatusBadge()}
|
|
96
139
|
</CardTitle>
|
|
97
140
|
</CardHeader>
|
|
98
|
-
<CardContent className="space-y-3">
|
|
99
|
-
<div className="text-muted-foreground text-sm">
|
|
100
|
-
{label} ·{" "}
|
|
101
|
-
{fiscalizationData.fiscalized_at && new Date(fiscalizationData.fiscalized_at).toLocaleString(locale)}
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
{fiscalizationData.status === "failed" && fiscalizationData.error && (
|
|
105
|
-
<Alert variant="destructive">
|
|
106
|
-
<AlertCircle className="h-4 w-4" />
|
|
107
|
-
<AlertDescription className="text-sm">{fiscalizationData.error}</AlertDescription>
|
|
108
|
-
</Alert>
|
|
109
|
-
)}
|
|
110
|
-
|
|
111
|
-
{fiscalizationData.status === "skipped" && (fiscalizationData as any).data?.reason && (
|
|
112
|
-
<div className="text-muted-foreground text-sm">{(fiscalizationData as any).data.reason}</div>
|
|
113
|
-
)}
|
|
114
|
-
|
|
115
|
-
{fiscalizationData.status === "failed" && onRetry && (
|
|
116
|
-
<Button variant="outline" size="sm" onClick={onRetry} disabled={isRetrying}>
|
|
117
|
-
{isRetrying ? <Loader2 className="mr-2 h-4 w-4 animate-spin" /> : <RefreshCw className="mr-2 h-4 w-4" />}
|
|
118
|
-
{t("Retry fiscalization")}
|
|
119
|
-
</Button>
|
|
120
|
-
)}
|
|
121
|
-
</CardContent>
|
|
141
|
+
<CardContent className="space-y-3">{bodyContent}</CardContent>
|
|
122
142
|
</Card>
|
|
123
143
|
);
|
|
124
144
|
}
|
|
@@ -30,7 +30,7 @@ export function ItemCombobox({
|
|
|
30
30
|
disabled,
|
|
31
31
|
}: ItemComboboxProps) {
|
|
32
32
|
const [search, setSearch] = useState("");
|
|
33
|
-
const [displayValue, setDisplayValue] = useState("");
|
|
33
|
+
const [displayValue, setDisplayValue] = useState(value || "");
|
|
34
34
|
const debouncedSearch = useDebounce(search, 300);
|
|
35
35
|
|
|
36
36
|
// Fetch recent items (non-blocking, cached)
|
|
@@ -120,9 +120,11 @@ export function ItemCombobox({
|
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
122
|
|
|
123
|
-
//
|
|
123
|
+
// Sync when value changes externally (e.g., duplication, form reset)
|
|
124
124
|
useEffect(() => {
|
|
125
|
-
if (
|
|
125
|
+
if (value) {
|
|
126
|
+
setDisplayValue(value);
|
|
127
|
+
} else {
|
|
126
128
|
setSearch("");
|
|
127
129
|
setDisplayValue("");
|
|
128
130
|
}
|
|
@@ -2,29 +2,16 @@ import { TableHead, TableHeader, TableRow } from "@/ui/components/ui/table";
|
|
|
2
2
|
import type { ComponentTranslationProps } from "@/ui/lib/translation";
|
|
3
3
|
import { createTranslation } from "@/ui/lib/translation";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
type ItemListHeaderProps = ComponentTranslationProps;
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
orderBy?: string;
|
|
9
|
-
onSort?: (order: string | null) => void;
|
|
10
|
-
} & ComponentTranslationProps;
|
|
11
|
-
|
|
12
|
-
export default function ItemListHeader({ orderBy, onSort, ...i18nProps }: ItemListHeaderProps) {
|
|
7
|
+
export default function ItemListHeader({ ...i18nProps }: ItemListHeaderProps) {
|
|
13
8
|
const t = createTranslation(i18nProps);
|
|
14
9
|
|
|
15
10
|
return (
|
|
16
11
|
<TableHeader>
|
|
17
12
|
<TableRow>
|
|
18
|
-
<TableHead>
|
|
19
|
-
|
|
20
|
-
{t("Name")}
|
|
21
|
-
</SortableHeader>
|
|
22
|
-
</TableHead>
|
|
23
|
-
<TableHead>
|
|
24
|
-
<SortableHeader field="description" currentOrder={orderBy} onSort={onSort}>
|
|
25
|
-
{t("Description")}
|
|
26
|
-
</SortableHeader>
|
|
27
|
-
</TableHead>
|
|
13
|
+
<TableHead>{t("Name")}</TableHead>
|
|
14
|
+
<TableHead>{t("Description")}</TableHead>
|
|
28
15
|
<TableHead className="text-right">{t("Price")}</TableHead>
|
|
29
16
|
<TableHead className="w-[42px] text-right" />
|
|
30
17
|
</TableRow>
|
|
@@ -63,8 +63,8 @@ export default function ItemListTable({
|
|
|
63
63
|
return (
|
|
64
64
|
<DataTable
|
|
65
65
|
columns={[
|
|
66
|
-
{ id: "name", header: t("Name")
|
|
67
|
-
{ id: "description", header: t("Description")
|
|
66
|
+
{ id: "name", header: t("Name") },
|
|
67
|
+
{ id: "description", header: t("Description") },
|
|
68
68
|
{ id: "unit", header: t("Unit") },
|
|
69
69
|
{ id: "price", header: t("Price"), align: "right" },
|
|
70
70
|
{ id: "actions", header: "", align: "right" },
|
|
@@ -72,7 +72,7 @@ export default function ItemListTable({
|
|
|
72
72
|
renderRow={(item) => (
|
|
73
73
|
<ItemListRow item={item} key={item.id} onRowClick={(item) => onRowClick?.(item)} onView={onView} t={t} />
|
|
74
74
|
)}
|
|
75
|
-
renderHeader={(
|
|
75
|
+
renderHeader={() => <ItemListHeader t={t} />}
|
|
76
76
|
queryParams={queryParams}
|
|
77
77
|
resourceName="item"
|
|
78
78
|
cacheKey={ITEMS_CACHE_KEY}
|
|
@@ -77,7 +77,6 @@ export default function PaymentListTable({
|
|
|
77
77
|
limit: params.limit,
|
|
78
78
|
next_cursor: params.next_cursor,
|
|
79
79
|
prev_cursor: params.prev_cursor,
|
|
80
|
-
order_by: params.order_by,
|
|
81
80
|
search: params.search,
|
|
82
81
|
query: params.query,
|
|
83
82
|
});
|
|
@@ -100,20 +99,17 @@ export default function PaymentListTable({
|
|
|
100
99
|
{
|
|
101
100
|
id: "date",
|
|
102
101
|
header: t("Date"),
|
|
103
|
-
sortable: true,
|
|
104
102
|
cell: (payment) => <FormattedDate date={payment.date} />,
|
|
105
103
|
},
|
|
106
104
|
{
|
|
107
105
|
id: "amount",
|
|
108
106
|
header: t("Amount"),
|
|
109
|
-
sortable: true,
|
|
110
107
|
align: "right",
|
|
111
108
|
cell: (payment) => <span className="font-medium">{payment.amount.toFixed(2)}</span>,
|
|
112
109
|
},
|
|
113
110
|
{
|
|
114
111
|
id: "type",
|
|
115
112
|
header: t("Type"),
|
|
116
|
-
sortable: true,
|
|
117
113
|
cell: (payment) => typeLabels[payment.type] ?? payment.type,
|
|
118
114
|
},
|
|
119
115
|
{
|
|
@@ -79,7 +79,6 @@ export default function RecurringInvoiceListTable({
|
|
|
79
79
|
limit: params.limit,
|
|
80
80
|
next_cursor: params.next_cursor,
|
|
81
81
|
prev_cursor: params.prev_cursor,
|
|
82
|
-
order_by: params.order_by,
|
|
83
82
|
search: params.search,
|
|
84
83
|
query: params.query,
|
|
85
84
|
});
|
|
@@ -101,13 +100,11 @@ export default function RecurringInvoiceListTable({
|
|
|
101
100
|
{
|
|
102
101
|
id: "name",
|
|
103
102
|
header: t("Name"),
|
|
104
|
-
sortable: true,
|
|
105
103
|
cell: (ri) => <span className="font-medium">{ri.name}</span>,
|
|
106
104
|
},
|
|
107
105
|
{
|
|
108
106
|
id: "frequency",
|
|
109
107
|
header: t("Frequency"),
|
|
110
|
-
sortable: true,
|
|
111
108
|
cell: (ri) => {
|
|
112
109
|
const label = frequencyLabels[ri.frequency] ?? ri.frequency;
|
|
113
110
|
return ri.interval > 1 ? `${t("Every")} ${ri.interval} ${label.toLowerCase()}` : label;
|
|
@@ -116,13 +113,11 @@ export default function RecurringInvoiceListTable({
|
|
|
116
113
|
{
|
|
117
114
|
id: "status",
|
|
118
115
|
header: t("Status"),
|
|
119
|
-
sortable: true,
|
|
120
116
|
cell: (ri) => <Badge variant={statusVariant(ri.status)}>{t(`status.${ri.status}`)}</Badge>,
|
|
121
117
|
},
|
|
122
118
|
{
|
|
123
119
|
id: "next_run_date",
|
|
124
120
|
header: t("Next Run"),
|
|
125
|
-
sortable: true,
|
|
126
121
|
cell: (ri) =>
|
|
127
122
|
ri.next_run_date ? (
|
|
128
123
|
<FormattedDate date={ri.next_run_date} />
|
|
@@ -133,14 +128,12 @@ export default function RecurringInvoiceListTable({
|
|
|
133
128
|
{
|
|
134
129
|
id: "invoices_generated",
|
|
135
130
|
header: t("Generated"),
|
|
136
|
-
sortable: true,
|
|
137
131
|
align: "right",
|
|
138
132
|
cell: (ri) => ri.invoices_generated,
|
|
139
133
|
},
|
|
140
134
|
{
|
|
141
135
|
id: "created_at",
|
|
142
136
|
header: t("Created"),
|
|
143
|
-
sortable: true,
|
|
144
137
|
cell: (ri) => <FormattedDate date={ri.created_at} />,
|
|
145
138
|
},
|
|
146
139
|
{
|
|
@@ -24,4 +24,5 @@ export default {
|
|
|
24
24
|
"Your list is empty": "Ihre Liste der wiederkehrenden Rechnungen ist leer",
|
|
25
25
|
"Get started by creating your first entry": "Erstellen Sie Ihren ersten wiederkehrenden Plan",
|
|
26
26
|
"No results found": "Keine wiederkehrenden Rechnungen gefunden",
|
|
27
|
+
"Clear all": "Alles zurücksetzen",
|
|
27
28
|
} as const;
|
|
@@ -24,4 +24,5 @@ export default {
|
|
|
24
24
|
"Your list is empty": "Su lista de facturas recurrentes está vacía",
|
|
25
25
|
"Get started by creating your first entry": "Comience creando su primer programa recurrente",
|
|
26
26
|
"No results found": "No se encontraron facturas recurrentes",
|
|
27
|
+
"Clear all": "Borrar todo",
|
|
27
28
|
} as const;
|
|
@@ -24,4 +24,5 @@ export default {
|
|
|
24
24
|
"Your list is empty": "Votre liste de factures récurrentes est vide",
|
|
25
25
|
"Get started by creating your first entry": "Commencez par créer votre premier programme récurrent",
|
|
26
26
|
"No results found": "Aucune facture récurrente trouvée",
|
|
27
|
+
"Clear all": "Tout effacer",
|
|
27
28
|
} as const;
|
|
@@ -24,4 +24,5 @@ export default {
|
|
|
24
24
|
"Your list is empty": "Vaš popis ponavljajućih računa je prazan",
|
|
25
25
|
"Get started by creating your first entry": "Počnite kreiranjem prvog ponavljajućeg rasporeda",
|
|
26
26
|
"No results found": "Nisu pronađeni ponavljajući računi",
|
|
27
|
+
"Clear all": "Očisti sve",
|
|
27
28
|
} as const;
|
|
@@ -24,4 +24,5 @@ export default {
|
|
|
24
24
|
"Your list is empty": "La lista delle fatture ricorrenti è vuota",
|
|
25
25
|
"Get started by creating your first entry": "Inizia creando il tuo primo programma ricorrente",
|
|
26
26
|
"No results found": "Nessuna fattura ricorrente trovata",
|
|
27
|
+
"Clear all": "Cancella tutto",
|
|
27
28
|
} as const;
|
|
@@ -24,4 +24,5 @@ export default {
|
|
|
24
24
|
"Your list is empty": "Uw lijst met terugkerende facturen is leeg",
|
|
25
25
|
"Get started by creating your first entry": "Begin met het maken van uw eerste terugkerend schema",
|
|
26
26
|
"No results found": "Geen terugkerende facturen gevonden",
|
|
27
|
+
"Clear all": "Alles wissen",
|
|
27
28
|
} as const;
|
|
@@ -24,4 +24,5 @@ export default {
|
|
|
24
24
|
"Your list is empty": "Twoja lista faktur cyklicznych jest pusta",
|
|
25
25
|
"Get started by creating your first entry": "Zacznij od utworzenia pierwszego harmonogramu cyklicznego",
|
|
26
26
|
"No results found": "Nie znaleziono faktur cyklicznych",
|
|
27
|
+
"Clear all": "Wyczyść wszystko",
|
|
27
28
|
} as const;
|
|
@@ -24,4 +24,5 @@ export default {
|
|
|
24
24
|
"Your list is empty": "A sua lista de faturas recorrentes está vazia",
|
|
25
25
|
"Get started by creating your first entry": "Comece criando o seu primeiro agendamento recorrente",
|
|
26
26
|
"No results found": "Nenhuma fatura recorrente encontrada",
|
|
27
|
+
"Clear all": "Limpar tudo",
|
|
27
28
|
} as const;
|
|
@@ -24,4 +24,5 @@ export default {
|
|
|
24
24
|
"Your list is empty": "Vaš seznam ponavljajočih računov je prazen",
|
|
25
25
|
"Get started by creating your first entry": "Začnite z ustvarjanjem prvega ponavljajočega urnika",
|
|
26
26
|
"No results found": "Ni najdenih ponavljajočih računov",
|
|
27
|
+
"Clear all": "Počisti vse",
|
|
27
28
|
} as const;
|
|
@@ -209,8 +209,6 @@ export function RequestLogListTable({
|
|
|
209
209
|
id: "created_at",
|
|
210
210
|
header: "Time",
|
|
211
211
|
align: "right",
|
|
212
|
-
sortable: true,
|
|
213
|
-
sortField: "created_at",
|
|
214
212
|
cell: (log) => (
|
|
215
213
|
<span className="text-muted-foreground text-xs">
|
|
216
214
|
{formatDistanceToNow(new Date(log.created_at), { addSuffix: true })}
|
|
@@ -243,7 +241,6 @@ export function RequestLogListTable({
|
|
|
243
241
|
entityId={entityId}
|
|
244
242
|
filterConfig={filterConfig}
|
|
245
243
|
onRowClick={(log) => onSelectLog?.(log)}
|
|
246
|
-
defaultOrderBy="-created_at"
|
|
247
244
|
/>
|
|
248
245
|
|
|
249
246
|
<Sheet open={!!selectedLog} onOpenChange={(open) => !open && onSelectLog?.(null)}>
|