@spaceinvoices/react-ui 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/dist/index.js +1 -1
- package/package.json +1 -1
- package/registry.json +23 -27
- package/src/components/advance-invoices/advance-invoices.hooks.ts +32 -2
- package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +109 -4
- package/src/components/advance-invoices/create/locales/de.ts +2 -0
- package/src/components/advance-invoices/create/locales/es.ts +2 -0
- package/src/components/advance-invoices/create/locales/fr.ts +2 -0
- package/src/components/advance-invoices/create/locales/hr.ts +2 -0
- package/src/components/advance-invoices/create/locales/it.ts +2 -0
- package/src/components/advance-invoices/create/locales/nl.ts +2 -0
- package/src/components/advance-invoices/create/locales/pl.ts +2 -0
- package/src/components/advance-invoices/create/locales/pt.ts +2 -0
- package/src/components/advance-invoices/create/locales/sl.ts +2 -0
- package/src/components/advance-invoices/create/prepare-advance-invoice-submission.ts +17 -0
- package/src/components/advance-invoices/list/list-row-actions.tsx +3 -6
- package/src/components/advance-invoices/list/list-table.tsx +45 -2
- package/src/components/advance-invoices/list/locales/de.ts +3 -0
- package/src/components/advance-invoices/list/locales/en.ts +3 -0
- package/src/components/advance-invoices/list/locales/es.ts +3 -0
- package/src/components/advance-invoices/list/locales/fr.ts +3 -0
- package/src/components/advance-invoices/list/locales/hr.ts +3 -0
- package/src/components/advance-invoices/list/locales/it.ts +3 -0
- package/src/components/advance-invoices/list/locales/nl.ts +3 -0
- package/src/components/advance-invoices/list/locales/pl.ts +3 -0
- package/src/components/advance-invoices/list/locales/pt.ts +3 -0
- package/src/components/advance-invoices/list/locales/sl.ts +3 -0
- package/src/components/credit-notes/create/create-credit-note-form.tsx +177 -6
- package/src/components/credit-notes/create/locales/de.ts +8 -0
- package/src/components/credit-notes/create/locales/es.ts +8 -0
- package/src/components/credit-notes/create/locales/fr.ts +7 -0
- package/src/components/credit-notes/create/locales/hr.ts +7 -0
- package/src/components/credit-notes/create/locales/it.ts +9 -0
- package/src/components/credit-notes/create/locales/nl.ts +7 -0
- package/src/components/credit-notes/create/locales/pl.ts +7 -0
- package/src/components/credit-notes/create/locales/pt.ts +7 -0
- package/src/components/credit-notes/create/locales/sl.ts +7 -0
- package/src/components/credit-notes/credit-notes.hooks.ts +30 -0
- package/src/components/credit-notes/list/list-row-actions.tsx +3 -6
- package/src/components/credit-notes/list/list-table.tsx +45 -2
- package/src/components/credit-notes/list/locales/de.ts +3 -0
- package/src/components/credit-notes/list/locales/en.ts +3 -0
- package/src/components/credit-notes/list/locales/es.ts +3 -0
- package/src/components/credit-notes/list/locales/fr.ts +3 -0
- package/src/components/credit-notes/list/locales/hr.ts +3 -0
- package/src/components/credit-notes/list/locales/it.ts +3 -0
- package/src/components/credit-notes/list/locales/nl.ts +3 -0
- package/src/components/credit-notes/list/locales/pl.ts +3 -0
- package/src/components/credit-notes/list/locales/pt.ts +3 -0
- package/src/components/credit-notes/list/locales/sl.ts +3 -0
- package/src/components/customers/create-customer-form/create-customer-form.tsx +0 -1
- package/src/components/documents/create/document-details-section.tsx +67 -1
- package/src/components/documents/create/mark-as-paid-section.tsx +11 -2
- package/src/components/documents/view/document-actions-bar.tsx +30 -0
- package/src/components/documents/view/locales/de.ts +5 -0
- package/src/components/documents/view/locales/es.ts +5 -0
- package/src/components/documents/view/locales/fr.ts +5 -0
- package/src/components/documents/view/locales/hr.ts +5 -0
- package/src/components/documents/view/locales/it.ts +5 -0
- package/src/components/documents/view/locales/nl.ts +5 -0
- package/src/components/documents/view/locales/pl.ts +5 -0
- package/src/components/documents/view/locales/pt.ts +5 -0
- package/src/components/documents/view/locales/sl.ts +5 -0
- package/src/components/entities/create-entity-form.tsx +1 -1
- package/src/components/entities/entity-settings-form/entity-settings-form.tsx +2 -3
- package/src/components/entities/entity-settings-form/locales/es.ts +2 -0
- package/src/components/entities/entity-settings-form/locales/fr.ts +2 -0
- package/src/components/entities/entity-settings-form/locales/hr.ts +2 -0
- package/src/components/entities/entity-settings-form/locales/it.ts +2 -0
- package/src/components/entities/entity-settings-form/locales/nl.ts +2 -0
- package/src/components/entities/entity-settings-form/locales/pl.ts +2 -0
- package/src/components/entities/entity-settings-form/locales/pt.ts +2 -0
- package/src/components/entities/fina-settings-form/fina-operator-required-dialog.tsx +109 -0
- package/src/components/entities/fina-settings-form/fina-settings-form.tsx +365 -35
- package/src/components/entities/fina-settings-form/fina-settings.hooks.ts +101 -20
- package/src/components/entities/fina-settings-form/index.ts +1 -0
- package/src/components/entities/fina-settings-form/locales/de.ts +54 -34
- package/src/components/entities/fina-settings-form/locales/en.ts +51 -34
- package/src/components/entities/fina-settings-form/locales/es.ts +50 -34
- package/src/components/entities/fina-settings-form/locales/fr.ts +50 -34
- package/src/components/entities/fina-settings-form/locales/hr.ts +50 -34
- package/src/components/entities/fina-settings-form/locales/it.ts +50 -34
- package/src/components/entities/fina-settings-form/locales/nl.ts +50 -34
- package/src/components/entities/fina-settings-form/locales/pl.ts +50 -34
- package/src/components/entities/fina-settings-form/locales/pt.ts +50 -34
- package/src/components/entities/fina-settings-form/locales/sl.ts +50 -34
- package/src/components/entities/fina-settings-form/sections/certificate-settings-section.tsx +18 -0
- package/src/components/entities/fina-settings-form/sections/premises-management-section.tsx +64 -89
- package/src/components/entities/fina-settings-form/sections/register-premise-dialog.tsx +51 -323
- package/src/components/entities/furs-settings-form/furs-operator-required-dialog.tsx +106 -0
- package/src/components/entities/furs-settings-form/furs-settings-form.tsx +24 -10
- package/src/components/entities/furs-settings-form/furs-settings.hooks.ts +5 -9
- package/src/components/entities/furs-settings-form/index.ts +1 -0
- package/src/components/entities/furs-settings-form/locales/de.ts +27 -3
- package/src/components/entities/furs-settings-form/locales/en.ts +17 -3
- package/src/components/entities/furs-settings-form/locales/es.ts +26 -3
- package/src/components/entities/furs-settings-form/locales/fr.ts +26 -3
- package/src/components/entities/furs-settings-form/locales/hr.ts +26 -3
- package/src/components/entities/furs-settings-form/locales/it.ts +26 -3
- package/src/components/entities/furs-settings-form/locales/nl.ts +26 -3
- package/src/components/entities/furs-settings-form/locales/pl.ts +26 -3
- package/src/components/entities/furs-settings-form/locales/pt.ts +26 -3
- package/src/components/entities/furs-settings-form/locales/sl.ts +16 -3
- package/src/components/entities/furs-settings-form/sections/certificate-settings-section.tsx +22 -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 +1 -0
- package/src/components/entities/furs-settings-form/sections/register-premise-dialog.tsx +58 -34
- package/src/components/entities/settings/tax-rules-settings-form.tsx +4 -4
- package/src/components/estimates/list/list-row-actions.tsx +3 -7
- package/src/components/estimates/list/list-table.tsx +35 -2
- package/src/components/estimates/list/locales/de.ts +3 -0
- package/src/components/estimates/list/locales/en.ts +3 -0
- package/src/components/estimates/list/locales/es.ts +3 -0
- package/src/components/estimates/list/locales/fr.ts +3 -0
- package/src/components/estimates/list/locales/hr.ts +3 -0
- package/src/components/estimates/list/locales/it.ts +3 -0
- package/src/components/estimates/list/locales/nl.ts +3 -0
- package/src/components/estimates/list/locales/pl.ts +3 -0
- package/src/components/estimates/list/locales/pt.ts +3 -0
- package/src/components/estimates/list/locales/sl.ts +3 -0
- package/src/components/export/document-export-form.tsx +34 -34
- package/src/components/invoices/create/create-invoice-form.tsx +107 -5
- package/src/components/invoices/create/prepare-invoice-submission.ts +17 -0
- package/src/components/invoices/invoices.hooks.ts +32 -2
- package/src/components/invoices/list/list-row-actions.tsx +23 -8
- package/src/components/invoices/list/list-table.tsx +53 -2
- package/src/components/invoices/list/locales/de.ts +4 -0
- package/src/components/invoices/list/locales/en.ts +4 -0
- package/src/components/invoices/list/locales/es.ts +4 -0
- package/src/components/invoices/list/locales/fr.ts +4 -0
- package/src/components/invoices/list/locales/hr.ts +4 -0
- package/src/components/invoices/list/locales/it.ts +4 -0
- package/src/components/invoices/list/locales/nl.ts +4 -0
- package/src/components/invoices/list/locales/pl.ts +4 -0
- package/src/components/invoices/list/locales/pt.ts +4 -0
- package/src/components/invoices/list/locales/sl.ts +4 -0
- package/src/components/invoices/view/fiscalization-status-card.tsx +4 -1
- package/src/components/items/item-list-table/item-list-row-actions.tsx +3 -7
- package/src/components/items/item-list-table/item-list-row.tsx +3 -2
- package/src/components/items/item-list-table/item-list-table.tsx +5 -1
- package/src/components/recurring-invoices/create-recurring-invoice-form/create-recurring-invoice-form.tsx +418 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/de.ts +45 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/es.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/fr.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/hr.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/it.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/nl.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/pl.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/pt.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/sl.ts +44 -0
- package/src/components/recurring-invoices/index.ts +3 -0
- package/src/components/recurring-invoices/list/index.ts +2 -0
- package/src/components/recurring-invoices/list/list-row-actions.tsx +139 -0
- package/src/components/recurring-invoices/list/list-table.tsx +179 -0
- package/src/components/recurring-invoices/list/locales/de.ts +27 -0
- package/src/components/recurring-invoices/list/locales/en.ts +5 -0
- package/src/components/recurring-invoices/list/locales/es.ts +27 -0
- package/src/components/recurring-invoices/list/locales/fr.ts +27 -0
- package/src/components/recurring-invoices/list/locales/hr.ts +27 -0
- package/src/components/recurring-invoices/list/locales/it.ts +27 -0
- package/src/components/recurring-invoices/list/locales/nl.ts +27 -0
- package/src/components/recurring-invoices/list/locales/pl.ts +27 -0
- package/src/components/recurring-invoices/list/locales/pt.ts +27 -0
- package/src/components/recurring-invoices/list/locales/sl.ts +27 -0
- package/src/components/recurring-invoices/recurring-invoices.hooks.ts +28 -0
- package/src/components/table/data-table.tsx +122 -5
- package/src/components/table/selection-toolbar.tsx +36 -0
- package/src/components/tax-reports/kir-export-form.tsx +75 -55
- package/src/components/taxes/tax-list-table/tax-list-row-actions.tsx +3 -6
- package/src/components/taxes/tax-list-table/tax-list-row.tsx +3 -2
- package/src/components/taxes/tax-list-table/tax-list-table.tsx +5 -1
- package/src/components/ui/checkbox.tsx +5 -5
- package/src/generate-schemas.ts +46 -7
- package/src/generated/schemas/advanceinvoice.ts +79 -187
- package/src/generated/schemas/authorizeshopify_body.ts +22 -0
- package/src/generated/schemas/creditnote.ts +60 -88
- package/src/generated/schemas/customadvanceinvoice.ts +70 -97
- package/src/generated/schemas/customcreditnote.ts +70 -97
- package/src/generated/schemas/customestimate.ts +68 -97
- package/src/generated/schemas/custominvoice.ts +70 -97
- package/src/generated/schemas/entity.ts +1 -1
- package/src/generated/schemas/estimate.ts +67 -172
- package/src/generated/schemas/index.ts +39 -28
- package/src/generated/schemas/invoice.ts +79 -187
- package/src/generated/schemas/order.ts +127 -0
- package/src/generated/schemas/orderintegration.ts +51 -0
- package/src/generated/schemas/payment.ts +2 -0
- package/src/generated/schemas/recurringinvoice.ts +61 -0
- package/src/generated/schemas/registerfursrealestatepremise_body.ts +11 -7
- package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +140 -269
- package/src/generated/schemas/rendercreditnotepreview_body.ts +141 -270
- package/src/generated/schemas/renderestimatepreview_body.ts +112 -212
- package/src/generated/schemas/renderinvoicepreview_body.ts +141 -270
- package/src/generated/schemas/webhook.ts +42 -0
- package/src/lib/furs-error-utils.ts +36 -0
- package/src/lib/schemas/advance-invoice.ts +3 -3
- package/src/lib/schemas/credit-note.ts +3 -3
- package/src/lib/schemas/estimate.ts +3 -3
- package/src/lib/schemas/invoice.ts +3 -3
- package/src/providers/white-label-provider.tsx +3 -0
|
@@ -43,7 +43,7 @@ export default {
|
|
|
43
43
|
"Tax number of the operator for API key usage (optional)":
|
|
44
44
|
"Numer podatkowy operatora do użycia z kluczem API (opcjonalnie)",
|
|
45
45
|
"Operator Label": "Etykieta operatora",
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
"Digital Certificate": "Certyfikat cyfrowy",
|
|
48
48
|
"Upload your FURS digital certificate": "Prześlij swój certyfikat cyfrowy FURS",
|
|
49
49
|
"Your certificate is required to digitally sign all fiscalized invoices. The certificate must be obtained from the Slovenian Financial Administration (FURS).":
|
|
@@ -53,6 +53,10 @@ export default {
|
|
|
53
53
|
"Invalid file type. Please upload a .p12 or .pfx certificate file.":
|
|
54
54
|
"Nieprawidłowy typ pliku. Prześlij plik certyfikatu .p12 lub .pfx.",
|
|
55
55
|
"Please select a certificate file and enter the passphrase": "Wybierz plik certyfikatu i wprowadź hasło",
|
|
56
|
+
"Invalid certificate passphrase. Please check your passphrase and try again.":
|
|
57
|
+
"Nieprawidłowe hasło certyfikatu. Sprawdź hasło i spróbuj ponownie.",
|
|
58
|
+
"Certificate tax number does not match entity tax number. Please upload a certificate for this entity.":
|
|
59
|
+
"Numer podatkowy certyfikatu nie zgadza się z numerem podatkowym podmiotu. Prześlij certifikat dla tego podmiotu.",
|
|
56
60
|
Valid: "Ważny",
|
|
57
61
|
"Expiring Soon": "Wkrótce wygasa",
|
|
58
62
|
Expired: "Wygasł",
|
|
@@ -176,8 +180,8 @@ export default {
|
|
|
176
180
|
"Your personal operator info for FURS invoices": "Twoje osobiste informacje operatora dla faktur FURS",
|
|
177
181
|
"Save Operator Settings": "Zapisz ustawienia operatora",
|
|
178
182
|
"Your tax number for FURS fiscalization": "Twój numer podatkowy do fiskalizacji FURS",
|
|
179
|
-
"
|
|
180
|
-
"
|
|
183
|
+
"Descriptive label for the operator (e.g. Cashier 1)": "Opisowa etykieta operatora (np. Kasjer 1)",
|
|
184
|
+
"e.g. Cashier 1": "np. Kasjer 1",
|
|
181
185
|
"Fiscalization Settings": "Ustawienia fiskalizacji",
|
|
182
186
|
"Advanced Settings": "Ustawienia zaawansowane",
|
|
183
187
|
"API Default Operator": "Domyślny operator API",
|
|
@@ -193,4 +197,23 @@ export default {
|
|
|
193
197
|
"Domyślne informacje operatora używane, gdy faktury są tworzone przez API bez zalogowanego użytkownika.",
|
|
194
198
|
"Certificate uploaded successfully": "Certyfikat przesłany pomyślnie",
|
|
195
199
|
"Loading certificate details...": "Ładowanie szczegółów certyfikatu...",
|
|
200
|
+
// Entity info section
|
|
201
|
+
"Entity Information": "Entity Information",
|
|
202
|
+
"Required company details for FURS fiscalization": "Required company details for FURS fiscalization",
|
|
203
|
+
"Entity Tax Number": "Entity Tax Number",
|
|
204
|
+
"Your company's tax number (must match FURS certificate)": "Your company's tax number (must match FURS certificate)",
|
|
205
|
+
Address: "Address",
|
|
206
|
+
"Post Code": "Post Code",
|
|
207
|
+
"Save Entity Info": "Save Entity Info",
|
|
208
|
+
"Tax number is required for FURS fiscalization": "Tax number is required for FURS fiscalization",
|
|
209
|
+
"Set entity tax number in General Settings first": "Set entity tax number in General Settings first",
|
|
210
|
+
"Set operator tax number and label in General Settings first":
|
|
211
|
+
"Set operator tax number and label in General Settings first",
|
|
212
|
+
"Complete General Settings first": "Complete General Settings first",
|
|
213
|
+
"Operator tax number and label are required for FURS fiscalization":
|
|
214
|
+
"Operator tax number and label are required for FURS fiscalization",
|
|
215
|
+
"FURS Operator Settings Required": "FURS Operator Settings Required",
|
|
216
|
+
"Your FURS operator information is needed to fiscalize this document. Please enter your operator details.":
|
|
217
|
+
"Your FURS operator information is needed to fiscalize this document. Please enter your operator details.",
|
|
218
|
+
"Save & Retry": "Save & Retry",
|
|
196
219
|
} as const;
|
|
@@ -43,7 +43,7 @@ export default {
|
|
|
43
43
|
"Tax number of the operator for API key usage (optional)":
|
|
44
44
|
"Número fiscal do operador para utilização da chave API (opcional)",
|
|
45
45
|
"Operator Label": "Etiqueta do operador",
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
"Digital Certificate": "Certificado digital",
|
|
48
48
|
"Upload your FURS digital certificate": "Carregue o seu certificado digital FURS",
|
|
49
49
|
"Your certificate is required to digitally sign all fiscalized invoices. The certificate must be obtained from the Slovenian Financial Administration (FURS).":
|
|
@@ -54,6 +54,10 @@ export default {
|
|
|
54
54
|
"Tipo de ficheiro inválido. Carregue um ficheiro de certificado .p12 ou .pfx.",
|
|
55
55
|
"Please select a certificate file and enter the passphrase":
|
|
56
56
|
"Selecione um ficheiro de certificado e introduza a palavra-passe",
|
|
57
|
+
"Invalid certificate passphrase. Please check your passphrase and try again.":
|
|
58
|
+
"Senha do certificado inválida. Verifique sua senha e tente novamente.",
|
|
59
|
+
"Certificate tax number does not match entity tax number. Please upload a certificate for this entity.":
|
|
60
|
+
"Número fiscal do certificado não corresponde ao número fiscal da entidade. Envie um certificado para esta entidade.",
|
|
57
61
|
Valid: "Válido",
|
|
58
62
|
"Expiring Soon": "Expira em breve",
|
|
59
63
|
Expired: "Expirado",
|
|
@@ -177,8 +181,8 @@ export default {
|
|
|
177
181
|
"Your personal operator info for FURS invoices": "As suas informações pessoais de operador para faturas FURS",
|
|
178
182
|
"Save Operator Settings": "Guardar definições do operador",
|
|
179
183
|
"Your tax number for FURS fiscalization": "O seu número fiscal para a fiscalização FURS",
|
|
180
|
-
"
|
|
181
|
-
"
|
|
184
|
+
"Descriptive label for the operator (e.g. Cashier 1)": "Etiqueta descritiva do operador (ex. Caixa 1)",
|
|
185
|
+
"e.g. Cashier 1": "ex. Caixa 1",
|
|
182
186
|
"Fiscalization Settings": "Definições de fiscalização",
|
|
183
187
|
"Advanced Settings": "Definições avançadas",
|
|
184
188
|
"API Default Operator": "Operador predefinido API",
|
|
@@ -194,4 +198,23 @@ export default {
|
|
|
194
198
|
"Informações do operador predefinidas utilizadas quando as faturas são criadas via API sem um utilizador com sessão iniciada.",
|
|
195
199
|
"Certificate uploaded successfully": "Certificado carregado com sucesso",
|
|
196
200
|
"Loading certificate details...": "A carregar detalhes do certificado...",
|
|
201
|
+
// Entity info section
|
|
202
|
+
"Entity Information": "Entity Information",
|
|
203
|
+
"Required company details for FURS fiscalization": "Required company details for FURS fiscalization",
|
|
204
|
+
"Entity Tax Number": "Entity Tax Number",
|
|
205
|
+
"Your company's tax number (must match FURS certificate)": "Your company's tax number (must match FURS certificate)",
|
|
206
|
+
Address: "Address",
|
|
207
|
+
"Post Code": "Post Code",
|
|
208
|
+
"Save Entity Info": "Save Entity Info",
|
|
209
|
+
"Tax number is required for FURS fiscalization": "Tax number is required for FURS fiscalization",
|
|
210
|
+
"Set entity tax number in General Settings first": "Set entity tax number in General Settings first",
|
|
211
|
+
"Set operator tax number and label in General Settings first":
|
|
212
|
+
"Set operator tax number and label in General Settings first",
|
|
213
|
+
"Complete General Settings first": "Complete General Settings first",
|
|
214
|
+
"Operator tax number and label are required for FURS fiscalization":
|
|
215
|
+
"Operator tax number and label are required for FURS fiscalization",
|
|
216
|
+
"FURS Operator Settings Required": "FURS Operator Settings Required",
|
|
217
|
+
"Your FURS operator information is needed to fiscalize this document. Please enter your operator details.":
|
|
218
|
+
"Your FURS operator information is needed to fiscalize this document. Please enter your operator details.",
|
|
219
|
+
"Save & Retry": "Save & Retry",
|
|
197
220
|
} as const;
|
|
@@ -43,7 +43,7 @@ export default {
|
|
|
43
43
|
"Tax number of the operator for API key usage (optional)":
|
|
44
44
|
"Davčna številka operaterja za uporabo z API ključem (opcijsko)",
|
|
45
45
|
"Operator Label": "Oznaka operaterja",
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
"Digital Certificate": "Digitalni certifikat",
|
|
48
48
|
"Upload your FURS digital certificate": "Naložite svoj digitalni certifikat FURS",
|
|
49
49
|
"Your certificate is required to digitally sign all fiscalized invoices. The certificate must be obtained from the Slovenian Financial Administration (FURS).":
|
|
@@ -54,6 +54,10 @@ export default {
|
|
|
54
54
|
"Neveljavna vrsta datoteke. Prosimo, naložite datoteko certifikata .p12 ali .pfx.",
|
|
55
55
|
"Please select a certificate file and enter the passphrase":
|
|
56
56
|
"Prosimo, izberite datoteko certifikata in vnesite geslo",
|
|
57
|
+
"Invalid certificate passphrase. Please check your passphrase and try again.":
|
|
58
|
+
"Neveljavno geslo certifikata. Preverite geslo in poskusite znova.",
|
|
59
|
+
"Certificate tax number does not match entity tax number. Please upload a certificate for this entity.":
|
|
60
|
+
"Davčna številka certifikata se ne ujema z davčno številko entitete. Naložite certifikat za to entiteto.",
|
|
57
61
|
Valid: "Veljaven",
|
|
58
62
|
"Expiring Soon": "Kmalu poteče",
|
|
59
63
|
Expired: "Potekel",
|
|
@@ -179,8 +183,8 @@ export default {
|
|
|
179
183
|
"Your personal operator info for FURS invoices": "Vaši osebni podatki operaterja za FURS račune",
|
|
180
184
|
"Save Operator Settings": "Shrani nastavitve operaterja",
|
|
181
185
|
"Your tax number for FURS fiscalization": "Vaša davčna številka za fiskalizacijo FURS",
|
|
182
|
-
"
|
|
183
|
-
"
|
|
186
|
+
"Descriptive label for the operator (e.g. Cashier 1)": "Opisna oznaka za operaterja (npr. Blagajnik 1)",
|
|
187
|
+
"e.g. Cashier 1": "npr. Blagajnik 1",
|
|
184
188
|
"Fiscalization Settings": "Nastavitve fiskalizacije",
|
|
185
189
|
"Advanced Settings": "Napredne nastavitve",
|
|
186
190
|
"API Default Operator": "Privzeti operater za API",
|
|
@@ -209,4 +213,13 @@ export default {
|
|
|
209
213
|
"Tax number is required for FURS fiscalization": "Davčna številka je obvezna za fiskalizacijo FURS",
|
|
210
214
|
"Set entity tax number in General Settings first":
|
|
211
215
|
"Najprej nastavite davčno številko podjetja v splošnih nastavitvah",
|
|
216
|
+
"Set operator tax number and label in General Settings first":
|
|
217
|
+
"Set operator tax number and label in General Settings first",
|
|
218
|
+
"Complete General Settings first": "Complete General Settings first",
|
|
219
|
+
"Operator tax number and label are required for FURS fiscalization":
|
|
220
|
+
"Operator tax number and label are required for FURS fiscalization",
|
|
221
|
+
"FURS Operator Settings Required": "FURS Operator Settings Required",
|
|
222
|
+
"Your FURS operator information is needed to fiscalize this document. Please enter your operator details.":
|
|
223
|
+
"Your FURS operator information is needed to fiscalize this document. Please enter your operator details.",
|
|
224
|
+
"Save & Retry": "Save & Retry",
|
|
212
225
|
} as const;
|
package/src/components/entities/furs-settings-form/sections/certificate-settings-section.tsx
CHANGED
|
@@ -53,6 +53,28 @@ export const CertificateSettingsSection: FC<CertificateSettingsSectionProps> = (
|
|
|
53
53
|
onSuccess?.();
|
|
54
54
|
},
|
|
55
55
|
onError: (error) => {
|
|
56
|
+
const apiMsg = (error as any)?.data?.message || (error as any)?.message;
|
|
57
|
+
if (typeof apiMsg === "string") {
|
|
58
|
+
if (apiMsg.includes("certificate") && apiMsg.includes("mode")) {
|
|
59
|
+
onError?.(new Error(t(apiMsg)));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (apiMsg.includes("Invalid certificate passphrase")) {
|
|
63
|
+
onError?.(new Error(t("Invalid certificate passphrase. Please check your passphrase and try again.")));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const taxMatch = apiMsg.match(/Certificate tax number .+ does not match entity tax number/);
|
|
67
|
+
if (taxMatch) {
|
|
68
|
+
onError?.(
|
|
69
|
+
new Error(
|
|
70
|
+
t(
|
|
71
|
+
"Certificate tax number does not match entity tax number. Please upload a certificate for this entity.",
|
|
72
|
+
),
|
|
73
|
+
),
|
|
74
|
+
);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
56
78
|
onError?.(error);
|
|
57
79
|
},
|
|
58
80
|
});
|
|
@@ -8,6 +8,7 @@ import { Button } from "@/ui/components/ui/button";
|
|
|
8
8
|
import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from "@/ui/components/ui/form";
|
|
9
9
|
import { Input } from "@/ui/components/ui/input";
|
|
10
10
|
import { RadioGroup, RadioGroupItem } from "@/ui/components/ui/radio-group";
|
|
11
|
+
import { Separator } from "@/ui/components/ui/separator";
|
|
11
12
|
import { cn } from "@/ui/lib/utils";
|
|
12
13
|
import { useUpdateUserFursSettings, useUserFursSettings } from "../furs-settings.hooks";
|
|
13
14
|
import type { FursSettingsFormSchema, SectionType } from "../furs-settings-form";
|
|
@@ -190,6 +191,13 @@ export const GeneralSettingsSection: FC<GeneralSettingsSectionProps> = ({
|
|
|
190
191
|
</div>
|
|
191
192
|
</div>
|
|
192
193
|
|
|
194
|
+
{(!userFursSettings?.operator_tax_number || !userFursSettings?.operator_label) && (
|
|
195
|
+
<Alert variant="destructive">
|
|
196
|
+
<AlertTriangle className="h-4 w-4" />
|
|
197
|
+
<AlertDescription>{t("Operator tax number and label are required for FURS fiscalization")}</AlertDescription>
|
|
198
|
+
</Alert>
|
|
199
|
+
)}
|
|
200
|
+
|
|
193
201
|
<div className="space-y-4">
|
|
194
202
|
<div>
|
|
195
203
|
<label htmlFor="operator-tax-number" className="font-medium text-sm">
|
|
@@ -212,13 +220,15 @@ export const GeneralSettingsSection: FC<GeneralSettingsSectionProps> = ({
|
|
|
212
220
|
</label>
|
|
213
221
|
<Input
|
|
214
222
|
id="operator-label"
|
|
215
|
-
placeholder={t("
|
|
223
|
+
placeholder={t("e.g. Cashier 1")}
|
|
216
224
|
value={operatorLabel}
|
|
217
225
|
onChange={(e) => setOperatorLabel(e.target.value)}
|
|
218
226
|
className="mt-2 h-10"
|
|
219
227
|
disabled={userSettingsLoading}
|
|
220
228
|
/>
|
|
221
|
-
<p className="mt-1 text-muted-foreground text-xs">
|
|
229
|
+
<p className="mt-1 text-muted-foreground text-xs">
|
|
230
|
+
{t("Descriptive label for the operator (e.g. Cashier 1)")}
|
|
231
|
+
</p>
|
|
222
232
|
</div>
|
|
223
233
|
|
|
224
234
|
<Button
|
|
@@ -364,8 +374,11 @@ export const GeneralSettingsSection: FC<GeneralSettingsSectionProps> = ({
|
|
|
364
374
|
return (
|
|
365
375
|
<div className="space-y-6">
|
|
366
376
|
{wrap("entity-info", entityInfoContent)}
|
|
377
|
+
<Separator />
|
|
367
378
|
{wrap("operator", operatorContent)}
|
|
379
|
+
<Separator />
|
|
368
380
|
{wrap("fiscalization", fiscalizationContent)}
|
|
381
|
+
<Separator />
|
|
369
382
|
{wrap("advanced", advancedContent)}
|
|
370
383
|
</div>
|
|
371
384
|
);
|
|
@@ -307,6 +307,7 @@ export const PremisesManagementSection: FC<PremisesManagementSectionProps> = ({
|
|
|
307
307
|
entity={entity}
|
|
308
308
|
type={registerType}
|
|
309
309
|
t={t}
|
|
310
|
+
existingPremiseNames={premises.map((p) => p.business_premise_name)}
|
|
310
311
|
onSuccess={() => {
|
|
311
312
|
setRegisterDialogOpen(false);
|
|
312
313
|
onSuccess?.();
|
|
@@ -41,6 +41,7 @@ interface RegisterPremiseDialogProps {
|
|
|
41
41
|
entity: Entity;
|
|
42
42
|
type: "real-estate" | "movable";
|
|
43
43
|
t: (key: string) => string;
|
|
44
|
+
existingPremiseNames?: string[];
|
|
44
45
|
onSuccess?: () => void;
|
|
45
46
|
onError?: (error: unknown) => void;
|
|
46
47
|
}
|
|
@@ -51,6 +52,7 @@ export const RegisterPremiseDialog: FC<RegisterPremiseDialogProps> = ({
|
|
|
51
52
|
entity,
|
|
52
53
|
type,
|
|
53
54
|
t,
|
|
55
|
+
existingPremiseNames = [],
|
|
54
56
|
onSuccess,
|
|
55
57
|
onError,
|
|
56
58
|
}) => {
|
|
@@ -63,8 +65,8 @@ export const RegisterPremiseDialog: FC<RegisterPremiseDialogProps> = ({
|
|
|
63
65
|
business_premise_name: "",
|
|
64
66
|
real_estate: {
|
|
65
67
|
cadastral_number: "",
|
|
66
|
-
building_number: "",
|
|
67
|
-
building_section: "",
|
|
68
|
+
building_number: "0",
|
|
69
|
+
building_section: "0",
|
|
68
70
|
community: "",
|
|
69
71
|
city: "",
|
|
70
72
|
street: "",
|
|
@@ -86,12 +88,21 @@ export const RegisterPremiseDialog: FC<RegisterPremiseDialogProps> = ({
|
|
|
86
88
|
},
|
|
87
89
|
});
|
|
88
90
|
|
|
91
|
+
const handleMutationError = (error: unknown, form: typeof realEstateForm | typeof movableForm) => {
|
|
92
|
+
const err = error as { status?: number; data?: { message?: string } };
|
|
93
|
+
if (err?.status === 409 && err?.data?.message) {
|
|
94
|
+
form.setError("business_premise_name", { message: err.data.message });
|
|
95
|
+
} else {
|
|
96
|
+
onError?.(error);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
89
100
|
const { mutate: registerRealEstate, isPending: isRealEstatePending } = useRegisterRealEstatePremise({
|
|
90
101
|
onSuccess: () => {
|
|
91
102
|
realEstateForm.reset();
|
|
92
103
|
onSuccess?.();
|
|
93
104
|
},
|
|
94
|
-
onError,
|
|
105
|
+
onError: (error) => handleMutationError(error, realEstateForm),
|
|
95
106
|
});
|
|
96
107
|
|
|
97
108
|
const { mutate: registerMovable, isPending: isMovablePending } = useRegisterMovablePremise({
|
|
@@ -99,10 +110,18 @@ export const RegisterPremiseDialog: FC<RegisterPremiseDialogProps> = ({
|
|
|
99
110
|
movableForm.reset();
|
|
100
111
|
onSuccess?.();
|
|
101
112
|
},
|
|
102
|
-
onError,
|
|
113
|
+
onError: (error) => handleMutationError(error, movableForm),
|
|
103
114
|
});
|
|
104
115
|
|
|
116
|
+
const isDuplicateName = (name: string) => existingPremiseNames.some((n) => n.toUpperCase() === name.toUpperCase());
|
|
117
|
+
|
|
105
118
|
const handleRealEstateSubmit = (data: RealEstatePremiseForm) => {
|
|
119
|
+
if (isDuplicateName(data.business_premise_name)) {
|
|
120
|
+
realEstateForm.setError("business_premise_name", {
|
|
121
|
+
message: t("A premise with this name already exists"),
|
|
122
|
+
});
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
106
125
|
registerRealEstate({
|
|
107
126
|
entityId: entity.id,
|
|
108
127
|
data,
|
|
@@ -110,6 +129,12 @@ export const RegisterPremiseDialog: FC<RegisterPremiseDialogProps> = ({
|
|
|
110
129
|
};
|
|
111
130
|
|
|
112
131
|
const handleMovableSubmit = (data: MovablePremiseForm) => {
|
|
132
|
+
if (isDuplicateName(data.business_premise_name)) {
|
|
133
|
+
movableForm.setError("business_premise_name", {
|
|
134
|
+
message: t("A premise with this name already exists"),
|
|
135
|
+
});
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
113
138
|
registerMovable({
|
|
114
139
|
entityId: entity.id,
|
|
115
140
|
data,
|
|
@@ -132,7 +157,13 @@ export const RegisterPremiseDialog: FC<RegisterPremiseDialogProps> = ({
|
|
|
132
157
|
|
|
133
158
|
{isRealEstate ? (
|
|
134
159
|
<Form {...realEstateForm}>
|
|
135
|
-
<form
|
|
160
|
+
<form
|
|
161
|
+
onSubmit={(e) => {
|
|
162
|
+
e.stopPropagation();
|
|
163
|
+
realEstateForm.handleSubmit(handleRealEstateSubmit as any)(e);
|
|
164
|
+
}}
|
|
165
|
+
className="space-y-4"
|
|
166
|
+
>
|
|
136
167
|
{/* Premise Name */}
|
|
137
168
|
<FormField
|
|
138
169
|
control={realEstateForm.control as any}
|
|
@@ -172,18 +203,11 @@ export const RegisterPremiseDialog: FC<RegisterPremiseDialogProps> = ({
|
|
|
172
203
|
name="real_estate.building_number"
|
|
173
204
|
render={({ field }) => (
|
|
174
205
|
<FormItem>
|
|
175
|
-
<FormLabel>{t("Building Number")}
|
|
206
|
+
<FormLabel>{t("Building Number")} *</FormLabel>
|
|
176
207
|
<FormControl>
|
|
177
|
-
<Input
|
|
178
|
-
type="text"
|
|
179
|
-
inputMode="numeric"
|
|
180
|
-
pattern="[0-9]*"
|
|
181
|
-
placeholder="456"
|
|
182
|
-
{...field}
|
|
183
|
-
value={field.value || ""}
|
|
184
|
-
/>
|
|
208
|
+
<Input type="text" inputMode="numeric" pattern="[0-9]*" placeholder="456" {...field} />
|
|
185
209
|
</FormControl>
|
|
186
|
-
<FormDescription className="text-xs">{t("
|
|
210
|
+
<FormDescription className="text-xs">{t("Numeric, use 0 if not applicable")}</FormDescription>
|
|
187
211
|
<FormMessage />
|
|
188
212
|
</FormItem>
|
|
189
213
|
)}
|
|
@@ -193,18 +217,11 @@ export const RegisterPremiseDialog: FC<RegisterPremiseDialogProps> = ({
|
|
|
193
217
|
name="real_estate.building_section"
|
|
194
218
|
render={({ field }) => (
|
|
195
219
|
<FormItem>
|
|
196
|
-
<FormLabel>{t("Building Section")}
|
|
220
|
+
<FormLabel>{t("Building Section")} *</FormLabel>
|
|
197
221
|
<FormControl>
|
|
198
|
-
<Input
|
|
199
|
-
type="text"
|
|
200
|
-
inputMode="numeric"
|
|
201
|
-
pattern="[0-9]*"
|
|
202
|
-
placeholder="1"
|
|
203
|
-
{...field}
|
|
204
|
-
value={field.value || ""}
|
|
205
|
-
/>
|
|
222
|
+
<Input type="text" inputMode="numeric" pattern="[0-9]*" placeholder="1" {...field} />
|
|
206
223
|
</FormControl>
|
|
207
|
-
<FormDescription className="text-xs">{t("
|
|
224
|
+
<FormDescription className="text-xs">{t("Numeric, use 0 if not applicable")}</FormDescription>
|
|
208
225
|
<FormMessage />
|
|
209
226
|
</FormItem>
|
|
210
227
|
)}
|
|
@@ -233,9 +250,9 @@ export const RegisterPremiseDialog: FC<RegisterPremiseDialogProps> = ({
|
|
|
233
250
|
name="real_estate.street"
|
|
234
251
|
render={({ field }) => (
|
|
235
252
|
<FormItem>
|
|
236
|
-
<FormLabel>{t("Street")}
|
|
253
|
+
<FormLabel>{t("Street")} *</FormLabel>
|
|
237
254
|
<FormControl>
|
|
238
|
-
<Input placeholder="Dunajska cesta" {...field}
|
|
255
|
+
<Input placeholder="Dunajska cesta" {...field} />
|
|
239
256
|
</FormControl>
|
|
240
257
|
<FormMessage />
|
|
241
258
|
</FormItem>
|
|
@@ -248,9 +265,9 @@ export const RegisterPremiseDialog: FC<RegisterPremiseDialogProps> = ({
|
|
|
248
265
|
name="real_estate.house_number"
|
|
249
266
|
render={({ field }) => (
|
|
250
267
|
<FormItem>
|
|
251
|
-
<FormLabel>{t("House Number")}
|
|
268
|
+
<FormLabel>{t("House Number")} *</FormLabel>
|
|
252
269
|
<FormControl>
|
|
253
|
-
<Input placeholder="22" {...field}
|
|
270
|
+
<Input placeholder="22" {...field} />
|
|
254
271
|
</FormControl>
|
|
255
272
|
<FormMessage />
|
|
256
273
|
</FormItem>
|
|
@@ -277,9 +294,9 @@ export const RegisterPremiseDialog: FC<RegisterPremiseDialogProps> = ({
|
|
|
277
294
|
name="real_estate.city"
|
|
278
295
|
render={({ field }) => (
|
|
279
296
|
<FormItem>
|
|
280
|
-
<FormLabel>{t("City")}
|
|
297
|
+
<FormLabel>{t("City")} *</FormLabel>
|
|
281
298
|
<FormControl>
|
|
282
|
-
<Input placeholder="Ljubljana" {...field}
|
|
299
|
+
<Input placeholder="Ljubljana" {...field} />
|
|
283
300
|
</FormControl>
|
|
284
301
|
<FormMessage />
|
|
285
302
|
</FormItem>
|
|
@@ -290,10 +307,11 @@ export const RegisterPremiseDialog: FC<RegisterPremiseDialogProps> = ({
|
|
|
290
307
|
name="real_estate.postal_code"
|
|
291
308
|
render={({ field }) => (
|
|
292
309
|
<FormItem>
|
|
293
|
-
<FormLabel>{t("Postal Code")}
|
|
310
|
+
<FormLabel>{t("Postal Code")} *</FormLabel>
|
|
294
311
|
<FormControl>
|
|
295
|
-
<Input placeholder="1000" {...field}
|
|
312
|
+
<Input placeholder="1000" {...field} />
|
|
296
313
|
</FormControl>
|
|
314
|
+
<FormDescription className="text-xs">{t("Exactly 4 digits")}</FormDescription>
|
|
297
315
|
<FormMessage />
|
|
298
316
|
</FormItem>
|
|
299
317
|
)}
|
|
@@ -312,7 +330,13 @@ export const RegisterPremiseDialog: FC<RegisterPremiseDialogProps> = ({
|
|
|
312
330
|
</Form>
|
|
313
331
|
) : (
|
|
314
332
|
<Form {...movableForm}>
|
|
315
|
-
<form
|
|
333
|
+
<form
|
|
334
|
+
onSubmit={(e) => {
|
|
335
|
+
e.stopPropagation();
|
|
336
|
+
movableForm.handleSubmit(handleMovableSubmit as any)(e);
|
|
337
|
+
}}
|
|
338
|
+
className="space-y-4"
|
|
339
|
+
>
|
|
316
340
|
{/* Premise Name */}
|
|
317
341
|
<FormField
|
|
318
342
|
control={movableForm.control as any}
|
|
@@ -2,9 +2,9 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
|
|
2
2
|
import type {
|
|
3
3
|
Entity,
|
|
4
4
|
EntitySettings,
|
|
5
|
-
|
|
5
|
+
EntitySettingsTaxClauseDefaults,
|
|
6
6
|
GetEntities200DataItem,
|
|
7
|
-
|
|
7
|
+
TaxRules,
|
|
8
8
|
} from "@spaceinvoices/js-sdk";
|
|
9
9
|
import { ChevronDown, Globe, MessageSquareText } from "lucide-react";
|
|
10
10
|
import type { ReactNode } from "react";
|
|
@@ -81,9 +81,9 @@ export function TaxRulesSettingsForm({
|
|
|
81
81
|
const showTaxClauseDefaults = entity.country_rules?.features?.includes("tax_clause_defaults") ?? false;
|
|
82
82
|
|
|
83
83
|
const currentSettings = (entity.settings as EntitySettings) || {};
|
|
84
|
-
const currentTaxRules = (currentSettings.tax_rules as
|
|
84
|
+
const currentTaxRules = (currentSettings.tax_rules as TaxRules | null)?.eu || {};
|
|
85
85
|
const currentTaxClauseDefaults =
|
|
86
|
-
(currentSettings.tax_clause_defaults as
|
|
86
|
+
(currentSettings.tax_clause_defaults as EntitySettingsTaxClauseDefaults | null) || {};
|
|
87
87
|
|
|
88
88
|
const form = useForm<TaxRulesSettingsSchema>({
|
|
89
89
|
resolver: zodResolver(taxRulesSettingsSchema),
|
|
@@ -17,6 +17,7 @@ import { useEstimateDownload } from "./use-estimate-download";
|
|
|
17
17
|
|
|
18
18
|
type EstimateListRowActionsProps = {
|
|
19
19
|
estimate: Estimate;
|
|
20
|
+
onView?: (estimate: Estimate) => void;
|
|
20
21
|
onDuplicate?: (estimate: Estimate) => void;
|
|
21
22
|
onDownloadStart?: () => void;
|
|
22
23
|
onDownloadSuccess?: (fileName: string) => void;
|
|
@@ -27,6 +28,7 @@ type EstimateListRowActionsProps = {
|
|
|
27
28
|
|
|
28
29
|
export default function EstimateListRowActions({
|
|
29
30
|
estimate,
|
|
31
|
+
onView,
|
|
30
32
|
onDuplicate,
|
|
31
33
|
onDownloadStart,
|
|
32
34
|
onDownloadSuccess,
|
|
@@ -61,13 +63,7 @@ export default function EstimateListRowActions({
|
|
|
61
63
|
</DropdownMenuGroup>
|
|
62
64
|
<DropdownMenuSeparator />
|
|
63
65
|
<DropdownMenuGroup>
|
|
64
|
-
<DropdownMenuItem
|
|
65
|
-
className="cursor-pointer"
|
|
66
|
-
onClick={() => {
|
|
67
|
-
// TODO: Use router
|
|
68
|
-
window.location.href = `/app/estimates/view/${estimate.id}`;
|
|
69
|
-
}}
|
|
70
|
-
>
|
|
66
|
+
<DropdownMenuItem className="cursor-pointer" onClick={() => onView?.(estimate)}>
|
|
71
67
|
<Eye className="h-4 w-4" />
|
|
72
68
|
{t("View estimate")}
|
|
73
69
|
</DropdownMenuItem>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Estimate } from "@spaceinvoices/js-sdk";
|
|
2
|
-
import { useMemo } from "react";
|
|
2
|
+
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 { SelectionToolbar } from "@/ui/components/table/selection-toolbar";
|
|
6
7
|
import type {
|
|
7
8
|
Column,
|
|
8
9
|
FilterConfig,
|
|
@@ -45,21 +46,25 @@ type EstimateListTableProps = {
|
|
|
45
46
|
namespace?: string;
|
|
46
47
|
locale?: string;
|
|
47
48
|
entityId?: string;
|
|
49
|
+
onView?: (estimate: Estimate) => void;
|
|
48
50
|
onDuplicate?: (estimate: Estimate) => void;
|
|
49
51
|
onDownloadStart?: () => void;
|
|
50
52
|
onDownloadSuccess?: (fileName: string) => void;
|
|
51
53
|
onDownloadError?: (error: string) => void;
|
|
54
|
+
onExportSelected?: (documentIds: string[]) => void;
|
|
52
55
|
} & ListTableProps<Estimate>;
|
|
53
56
|
|
|
54
57
|
export default function EstimateListTable({
|
|
55
58
|
queryParams,
|
|
56
59
|
onRowClick,
|
|
60
|
+
onView,
|
|
57
61
|
onDuplicate,
|
|
58
62
|
onChangeParams,
|
|
59
63
|
entityId,
|
|
60
64
|
onDownloadStart,
|
|
61
65
|
onDownloadSuccess,
|
|
62
66
|
onDownloadError,
|
|
67
|
+
onExportSelected,
|
|
63
68
|
...i18nProps
|
|
64
69
|
}: EstimateListTableProps) {
|
|
65
70
|
const t = createTranslation({
|
|
@@ -68,6 +73,7 @@ export default function EstimateListTable({
|
|
|
68
73
|
});
|
|
69
74
|
|
|
70
75
|
const { sdk } = useSDK();
|
|
76
|
+
const [selectedIds, setSelectedIds] = useState<Set<string>>(new Set());
|
|
71
77
|
|
|
72
78
|
const handleFetch = useTableFetch(async (params: TableQueryParams) => {
|
|
73
79
|
if (!sdk) throw new Error("SDK not initialized");
|
|
@@ -97,6 +103,28 @@ export default function EstimateListTable({
|
|
|
97
103
|
[t],
|
|
98
104
|
);
|
|
99
105
|
|
|
106
|
+
const handleExportPdfs = useCallback(() => {
|
|
107
|
+
if (selectedIds.size > 0 && onExportSelected) {
|
|
108
|
+
onExportSelected(Array.from(selectedIds));
|
|
109
|
+
}
|
|
110
|
+
}, [selectedIds, onExportSelected]);
|
|
111
|
+
|
|
112
|
+
const handleDeselectAll = useCallback(() => {
|
|
113
|
+
setSelectedIds(new Set());
|
|
114
|
+
}, []);
|
|
115
|
+
|
|
116
|
+
const selectionToolbar = useCallback(
|
|
117
|
+
(count: number) => (
|
|
118
|
+
<SelectionToolbar
|
|
119
|
+
selectedCount={count}
|
|
120
|
+
onExportPdfs={onExportSelected ? handleExportPdfs : undefined}
|
|
121
|
+
onDeselectAll={handleDeselectAll}
|
|
122
|
+
t={t}
|
|
123
|
+
/>
|
|
124
|
+
),
|
|
125
|
+
[handleExportPdfs, handleDeselectAll, onExportSelected, t],
|
|
126
|
+
);
|
|
127
|
+
|
|
100
128
|
const columns: Column<Estimate>[] = useMemo(
|
|
101
129
|
() => [
|
|
102
130
|
{
|
|
@@ -157,6 +185,7 @@ export default function EstimateListTable({
|
|
|
157
185
|
cell: (estimate) => (
|
|
158
186
|
<EstimateListRowActions
|
|
159
187
|
estimate={estimate}
|
|
188
|
+
onView={onView}
|
|
160
189
|
onDuplicate={onDuplicate}
|
|
161
190
|
onDownloadStart={onDownloadStart}
|
|
162
191
|
onDownloadSuccess={onDownloadSuccess}
|
|
@@ -167,7 +196,7 @@ export default function EstimateListTable({
|
|
|
167
196
|
),
|
|
168
197
|
},
|
|
169
198
|
],
|
|
170
|
-
[t, onRowClick, onDuplicate, onDownloadStart, onDownloadSuccess, onDownloadError, i18nProps.locale],
|
|
199
|
+
[t, onRowClick, onView, onDuplicate, onDownloadStart, onDownloadSuccess, onDownloadError, i18nProps.locale],
|
|
171
200
|
);
|
|
172
201
|
|
|
173
202
|
return (
|
|
@@ -183,6 +212,10 @@ export default function EstimateListTable({
|
|
|
183
212
|
filterConfig={filterConfig}
|
|
184
213
|
t={t}
|
|
185
214
|
locale={i18nProps.locale}
|
|
215
|
+
selectable={!!onExportSelected}
|
|
216
|
+
selectedIds={selectedIds}
|
|
217
|
+
onSelectionChange={setSelectedIds}
|
|
218
|
+
selectionToolbar={selectionToolbar}
|
|
186
219
|
/>
|
|
187
220
|
);
|
|
188
221
|
}
|
|
@@ -32,4 +32,7 @@ export default {
|
|
|
32
32
|
"No results found": "Keine Angebote gefunden",
|
|
33
33
|
"Try adjusting your search criteria": "Versuchen Sie, Ihre Suchkriterien anzupassen",
|
|
34
34
|
"Clear search": "Suche zurücksetzen",
|
|
35
|
+
selected: "ausgewählt",
|
|
36
|
+
"Export PDFs": "PDFs exportieren",
|
|
37
|
+
"Deselect all": "Auswahl aufheben",
|
|
35
38
|
} as const;
|
|
@@ -29,4 +29,7 @@ export default {
|
|
|
29
29
|
"No results found": "No se encontraron presupuestos",
|
|
30
30
|
"Try adjusting your search criteria": "Intente ajustar sus criterios de búsqueda",
|
|
31
31
|
"Clear search": "Limpiar búsqueda",
|
|
32
|
+
selected: "seleccionados",
|
|
33
|
+
"Export PDFs": "Exportar PDFs",
|
|
34
|
+
"Deselect all": "Deseleccionar todo",
|
|
32
35
|
} as const;
|
|
@@ -29,4 +29,7 @@ export default {
|
|
|
29
29
|
"No results found": "Aucun devis trouvé",
|
|
30
30
|
"Try adjusting your search criteria": "Essayez d'ajuster vos critères de recherche",
|
|
31
31
|
"Clear search": "Effacer la recherche",
|
|
32
|
+
selected: "sélectionnés",
|
|
33
|
+
"Export PDFs": "Exporter les PDF",
|
|
34
|
+
"Deselect all": "Tout désélectionner",
|
|
32
35
|
} as const;
|
|
@@ -29,4 +29,7 @@ export default {
|
|
|
29
29
|
"No results found": "Nisu pronađeni predračuni",
|
|
30
30
|
"Try adjusting your search criteria": "Pokušajte prilagoditi kriterije pretraživanja",
|
|
31
31
|
"Clear search": "Očisti pretraživanje",
|
|
32
|
+
selected: "odabranih",
|
|
33
|
+
"Export PDFs": "Izvezi PDF-ove",
|
|
34
|
+
"Deselect all": "Poništi odabir",
|
|
32
35
|
} as const;
|