@spaceinvoices/react-ui 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/dist/index.js +1 -1
- package/package.json +1 -1
- package/registry.json +287 -122
- package/src/components/activities/activity-timeline.tsx +8 -1
- package/src/components/activities/locales/es.ts +30 -0
- package/src/components/activities/locales/fr.ts +30 -0
- package/src/components/activities/locales/hr.ts +30 -0
- package/src/components/activities/locales/it.ts +30 -0
- package/src/components/activities/locales/nl.ts +30 -0
- package/src/components/activities/locales/pl.ts +30 -0
- package/src/components/activities/locales/pt.ts +30 -0
- package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +21 -7
- package/src/components/advance-invoices/create/locales/es.ts +29 -0
- package/src/components/advance-invoices/create/locales/fr.ts +28 -0
- package/src/components/advance-invoices/create/locales/hr.ts +27 -0
- package/src/components/advance-invoices/create/locales/it.ts +29 -0
- package/src/components/advance-invoices/create/locales/nl.ts +28 -0
- package/src/components/advance-invoices/create/locales/pl.ts +28 -0
- package/src/components/advance-invoices/create/locales/pt.ts +29 -0
- package/src/components/advance-invoices/create/prepare-advance-invoice-submission.ts +3 -3
- package/src/components/advance-invoices/list/list-table.tsx +20 -3
- package/src/components/advance-invoices/list/locales/de.ts +9 -0
- package/src/components/advance-invoices/list/locales/en.ts +8 -0
- package/src/components/advance-invoices/list/locales/es.ts +41 -0
- package/src/components/advance-invoices/list/locales/fr.ts +41 -0
- package/src/components/advance-invoices/list/locales/hr.ts +41 -0
- package/src/components/advance-invoices/list/locales/it.ts +41 -0
- package/src/components/advance-invoices/list/locales/nl.ts +41 -0
- package/src/components/advance-invoices/list/locales/pl.ts +41 -0
- package/src/components/advance-invoices/list/locales/pt.ts +41 -0
- package/src/components/advance-invoices/list/locales/sl.ts +9 -0
- package/src/components/credit-notes/create/create-credit-note-form.tsx +19 -5
- package/src/components/credit-notes/create/locales/es.ts +68 -0
- package/src/components/credit-notes/create/locales/fr.ts +69 -0
- package/src/components/credit-notes/create/locales/hr.ts +68 -0
- package/src/components/credit-notes/create/locales/it.ts +68 -0
- package/src/components/credit-notes/create/locales/nl.ts +69 -0
- package/src/components/credit-notes/create/locales/pl.ts +68 -0
- package/src/components/credit-notes/create/locales/pt.ts +68 -0
- package/src/components/credit-notes/list/list-table.tsx +25 -8
- package/src/components/credit-notes/list/locales/de.ts +10 -2
- package/src/components/credit-notes/list/locales/en.ts +8 -0
- package/src/components/credit-notes/list/locales/es.ts +41 -0
- package/src/components/credit-notes/list/locales/fr.ts +41 -0
- package/src/components/credit-notes/list/locales/hr.ts +41 -0
- package/src/components/credit-notes/list/locales/it.ts +41 -0
- package/src/components/credit-notes/list/locales/nl.ts +41 -0
- package/src/components/credit-notes/list/locales/pl.ts +41 -0
- package/src/components/credit-notes/list/locales/pt.ts +41 -0
- package/src/components/credit-notes/list/locales/sl.ts +10 -2
- package/src/components/customers/create-customer-form/create-customer-form.tsx +21 -3
- package/src/components/customers/create-customer-form/locales/de.ts +1 -0
- package/src/components/customers/create-customer-form/locales/es.ts +21 -0
- package/src/components/customers/create-customer-form/locales/fr.ts +21 -0
- package/src/components/customers/create-customer-form/locales/hr.ts +21 -0
- package/src/components/customers/create-customer-form/locales/it.ts +21 -0
- package/src/components/customers/create-customer-form/locales/nl.ts +21 -0
- package/src/components/customers/create-customer-form/locales/pl.ts +21 -0
- package/src/components/customers/create-customer-form/locales/pt.ts +21 -0
- package/src/components/customers/create-customer-form/locales/sl.ts +1 -0
- package/src/components/customers/customer-list-table/customer-list-row-actions.tsx +72 -16
- package/src/components/customers/customer-list-table/customer-list-table.tsx +35 -2
- package/src/components/customers/customer-list-table/locales/de.ts +9 -0
- package/src/components/customers/customer-list-table/locales/en.ts +10 -0
- package/src/components/customers/customer-list-table/locales/es.ts +25 -0
- package/src/components/customers/customer-list-table/locales/fr.ts +25 -0
- package/src/components/customers/customer-list-table/locales/hr.ts +25 -0
- package/src/components/customers/customer-list-table/locales/it.ts +25 -0
- package/src/components/customers/customer-list-table/locales/nl.ts +25 -0
- package/src/components/customers/customer-list-table/locales/pl.ts +25 -0
- package/src/components/customers/customer-list-table/locales/pt.ts +25 -0
- package/src/components/customers/customer-list-table/locales/sl.ts +9 -0
- package/src/components/customers/customers.hooks.test.ts +8 -8
- package/src/components/customers/customers.hooks.ts +6 -1
- package/src/components/customers/edit-customer-form/edit-customer-form.tsx +143 -0
- package/src/components/customers/edit-customer-form/locales/de.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/es.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/fr.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/hr.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/it.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/nl.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/pl.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/pt.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/sl.ts +13 -0
- package/src/components/customers/index.ts +1 -0
- package/src/components/dashboard/collection-rate-card/collection-rate-card.tsx +9 -1
- package/src/components/dashboard/collection-rate-card/locales/de.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/es.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/fr.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/hr.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/it.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/nl.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/pl.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/pt.ts +3 -0
- package/src/components/dashboard/invoice-status-chart/invoice-status-chart.tsx +9 -1
- package/src/components/dashboard/invoice-status-chart/locales/de.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/locales/es.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/locales/fr.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/locales/hr.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/locales/it.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/locales/nl.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/locales/pl.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/locales/pt.ts +9 -0
- package/src/components/dashboard/payment-methods-chart/locales/de.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/es.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/fr.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/hr.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/it.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/nl.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/pl.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/pt.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/payment-methods-chart.tsx +9 -1
- package/src/components/dashboard/payment-trend-chart/locales/de.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/locales/es.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/locales/fr.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/locales/hr.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/locales/it.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/locales/nl.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/locales/pl.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/locales/pt.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/payment-trend-chart.tsx +10 -2
- package/src/components/dashboard/revenue-trend-chart/locales/de.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/locales/es.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/locales/fr.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/locales/hr.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/locales/it.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/locales/nl.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/locales/pl.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/locales/pt.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/revenue-trend-chart.tsx +10 -2
- package/src/components/dashboard/top-customers-chart/locales/de.ts +5 -0
- package/src/components/dashboard/top-customers-chart/locales/es.ts +5 -0
- package/src/components/dashboard/top-customers-chart/locales/fr.ts +5 -0
- package/src/components/dashboard/top-customers-chart/locales/hr.ts +5 -0
- package/src/components/dashboard/top-customers-chart/locales/it.ts +5 -0
- package/src/components/dashboard/top-customers-chart/locales/nl.ts +5 -0
- package/src/components/dashboard/top-customers-chart/locales/pl.ts +5 -0
- package/src/components/dashboard/top-customers-chart/locales/pt.ts +5 -0
- package/src/components/dashboard/top-customers-chart/top-customers-chart.tsx +10 -2
- package/src/components/documents/create/document-add-item-form.tsx +1 -1
- package/src/components/documents/create/form-types.ts +1 -5
- package/src/components/documents/create/mark-as-paid-section.tsx +60 -23
- package/src/components/documents/create/prepare-document-submission.test.ts +2 -2
- package/src/components/documents/create/prepare-document-submission.ts +12 -7
- package/src/components/documents/create/prepare-preview-data.test.ts +1 -1
- package/src/components/documents/view/document-actions-bar.tsx +8 -1
- package/src/components/documents/view/document-details-card.tsx +8 -1
- package/src/components/documents/view/document-payments-list.tsx +8 -1
- package/src/components/documents/view/locales/es.ts +83 -0
- package/src/components/documents/view/locales/fr.ts +83 -0
- package/src/components/documents/view/locales/hr.ts +83 -0
- package/src/components/documents/view/locales/it.ts +83 -0
- package/src/components/documents/view/locales/nl.ts +84 -0
- package/src/components/documents/view/locales/pl.ts +83 -0
- package/src/components/documents/view/locales/pt.ts +83 -0
- package/src/components/entities/create-entity-form.tsx +12 -2
- package/src/components/entities/entity-settings-form/entity-settings-form.tsx +18 -0
- package/src/components/entities/entity-settings-form/locales/de.ts +3 -1
- package/src/components/entities/entity-settings-form/locales/es.ts +197 -0
- package/src/components/entities/entity-settings-form/locales/fr.ts +196 -0
- package/src/components/entities/entity-settings-form/locales/hr.ts +189 -0
- package/src/components/entities/entity-settings-form/locales/it.ts +195 -0
- package/src/components/entities/entity-settings-form/locales/nl.ts +192 -0
- package/src/components/entities/entity-settings-form/locales/pl.ts +193 -0
- package/src/components/entities/entity-settings-form/locales/pt.ts +194 -0
- package/src/components/entities/entity-settings-form/locales/sl.ts +2 -0
- package/src/components/entities/fina-settings-form/fina-settings-form.tsx +461 -0
- package/src/components/entities/fina-settings-form/fina-settings.hooks.ts +215 -0
- package/src/components/entities/fina-settings-form/index.ts +3 -0
- package/src/components/entities/fina-settings-form/locales/de.ts +145 -0
- package/src/components/entities/fina-settings-form/locales/en.ts +142 -0
- package/src/components/entities/fina-settings-form/locales/es.ts +143 -0
- package/src/components/entities/fina-settings-form/locales/fr.ts +142 -0
- package/src/components/entities/fina-settings-form/locales/hr.ts +144 -0
- package/src/components/entities/fina-settings-form/locales/it.ts +144 -0
- package/src/components/entities/fina-settings-form/locales/nl.ts +144 -0
- package/src/components/entities/fina-settings-form/locales/pl.ts +142 -0
- package/src/components/entities/fina-settings-form/locales/pt.ts +144 -0
- package/src/components/entities/fina-settings-form/locales/sl.ts +144 -0
- package/src/components/entities/fina-settings-form/sections/certificate-settings-section.tsx +233 -0
- package/src/components/entities/fina-settings-form/sections/premises-management-section.tsx +363 -0
- package/src/components/entities/fina-settings-form/sections/register-premise-dialog.tsx +395 -0
- package/src/components/entities/furs-settings-form/furs-settings-form.tsx +9 -2
- package/src/components/entities/furs-settings-form/furs-settings.hooks.ts +15 -11
- package/src/components/entities/furs-settings-form/locales/de.ts +52 -88
- package/src/components/entities/furs-settings-form/locales/en.ts +3 -0
- package/src/components/entities/furs-settings-form/locales/es.ts +196 -0
- package/src/components/entities/furs-settings-form/locales/fr.ts +196 -0
- package/src/components/entities/furs-settings-form/locales/hr.ts +195 -0
- package/src/components/entities/furs-settings-form/locales/it.ts +196 -0
- package/src/components/entities/furs-settings-form/locales/nl.ts +195 -0
- package/src/components/entities/furs-settings-form/locales/pl.ts +194 -0
- package/src/components/entities/furs-settings-form/locales/pt.ts +195 -0
- package/src/components/entities/furs-settings-form/locales/sl.ts +2 -0
- package/src/components/entities/furs-settings-form/sections/certificate-settings-section.tsx +19 -4
- package/src/components/entities/furs-settings-form/sections/register-premise-dialog.tsx +17 -66
- package/src/components/entities/keys.ts +1 -1
- package/src/components/entities/settings/company-settings-form.tsx +28 -0
- package/src/components/entities/settings/pdf-template-selector/locales/es.ts +18 -0
- package/src/components/entities/settings/pdf-template-selector/locales/fr.ts +18 -0
- package/src/components/entities/settings/pdf-template-selector/locales/hr.ts +18 -0
- package/src/components/entities/settings/pdf-template-selector/locales/it.ts +18 -0
- package/src/components/entities/settings/pdf-template-selector/locales/nl.ts +17 -0
- package/src/components/entities/settings/pdf-template-selector/locales/pl.ts +18 -0
- package/src/components/entities/settings/pdf-template-selector/locales/pt.ts +18 -0
- package/src/components/estimates/create/create-estimate-form.tsx +14 -0
- package/src/components/estimates/create/locales/es.ts +57 -0
- package/src/components/estimates/create/locales/fr.ts +58 -0
- package/src/components/estimates/create/locales/hr.ts +57 -0
- package/src/components/estimates/create/locales/it.ts +57 -0
- package/src/components/estimates/create/locales/nl.ts +58 -0
- package/src/components/estimates/create/locales/pl.ts +57 -0
- package/src/components/estimates/create/locales/pt.ts +58 -0
- package/src/components/estimates/create/prepare-estimate-submission.ts +1 -1
- package/src/components/estimates/list/list-table.tsx +20 -3
- package/src/components/estimates/list/locales/de.ts +9 -0
- package/src/components/estimates/list/locales/en.ts +8 -0
- package/src/components/estimates/list/locales/es.ts +32 -0
- package/src/components/estimates/list/locales/fr.ts +32 -0
- package/src/components/estimates/list/locales/hr.ts +32 -0
- package/src/components/estimates/list/locales/it.ts +32 -0
- package/src/components/estimates/list/locales/nl.ts +32 -0
- package/src/components/estimates/list/locales/pl.ts +32 -0
- package/src/components/estimates/list/locales/pt.ts +32 -0
- package/src/components/estimates/list/locales/sl.ts +9 -0
- package/src/components/export/document-export-form.tsx +0 -2
- package/src/components/invoices/create/create-invoice-form.tsx +24 -10
- package/src/components/invoices/create/eslog-validation.test.ts +2 -0
- package/src/components/invoices/create/locales/es.ts +103 -0
- package/src/components/invoices/create/locales/fr.ts +105 -0
- package/src/components/invoices/create/locales/hr.ts +103 -0
- package/src/components/invoices/create/locales/it.ts +105 -0
- package/src/components/invoices/create/locales/nl.ts +104 -0
- package/src/components/invoices/create/locales/pl.ts +104 -0
- package/src/components/invoices/create/locales/pt.ts +105 -0
- package/src/components/invoices/create/prepare-invoice-submission.test.ts +54 -55
- package/src/components/invoices/create/prepare-invoice-submission.ts +3 -3
- package/src/components/invoices/list/list-table.tsx +20 -3
- package/src/components/invoices/list/locales/de.ts +9 -0
- package/src/components/invoices/list/locales/en.ts +8 -0
- package/src/components/invoices/list/locales/es.ts +42 -0
- package/src/components/invoices/list/locales/fr.ts +42 -0
- package/src/components/invoices/list/locales/hr.ts +42 -0
- package/src/components/invoices/list/locales/it.ts +42 -0
- package/src/components/invoices/list/locales/nl.ts +42 -0
- package/src/components/invoices/list/locales/pl.ts +42 -0
- package/src/components/invoices/list/locales/pt.ts +42 -0
- package/src/components/invoices/list/locales/sl.ts +9 -0
- package/src/components/invoices/send-email-dialog/locales/es.ts +18 -0
- package/src/components/invoices/send-email-dialog/locales/fr.ts +18 -0
- package/src/components/invoices/send-email-dialog/locales/hr.ts +17 -0
- package/src/components/invoices/send-email-dialog/locales/it.ts +18 -0
- package/src/components/invoices/send-email-dialog/locales/nl.ts +18 -0
- package/src/components/invoices/send-email-dialog/locales/pl.ts +18 -0
- package/src/components/invoices/send-email-dialog/locales/pt.ts +18 -0
- package/src/components/invoices/send-email-dialog/send-email-dialog.tsx +20 -12
- package/src/components/invoices/shared/scaled-document-preview.tsx +1 -0
- package/src/components/invoices/view/eslog-info-display.tsx +1 -0
- package/src/components/invoices/view/fina-info-display.tsx +196 -0
- package/src/components/items/create-item-form/create-item-form.tsx +14 -0
- package/src/components/items/create-item-form/locales/en.ts +5 -0
- package/src/components/items/create-item-form/locales/es.ts +14 -0
- package/src/components/items/create-item-form/locales/fr.ts +14 -0
- package/src/components/items/create-item-form/locales/hr.ts +14 -0
- package/src/components/items/create-item-form/locales/it.ts +14 -0
- package/src/components/items/create-item-form/locales/nl.ts +14 -0
- package/src/components/items/create-item-form/locales/pl.ts +14 -0
- package/src/components/items/create-item-form/locales/pt.ts +14 -0
- package/src/components/items/edit-item-form/edit-item-form.tsx +170 -0
- package/src/components/items/edit-item-form/locales/de.ts +12 -0
- package/src/components/items/edit-item-form/locales/es.ts +12 -0
- package/src/components/items/edit-item-form/locales/fr.ts +12 -0
- package/src/components/items/edit-item-form/locales/hr.ts +12 -0
- package/src/components/items/edit-item-form/locales/it.ts +12 -0
- package/src/components/items/edit-item-form/locales/nl.ts +12 -0
- package/src/components/items/edit-item-form/locales/pl.ts +12 -0
- package/src/components/items/edit-item-form/locales/pt.ts +12 -0
- package/src/components/items/edit-item-form/locales/sl.ts +12 -0
- package/src/components/items/item-list-table/item-list-table.tsx +20 -13
- package/src/components/items/item-list-table/locales/de.ts +6 -0
- package/src/components/items/item-list-table/locales/en.ts +5 -0
- package/src/components/items/item-list-table/locales/es.ts +16 -0
- package/src/components/items/item-list-table/locales/fr.ts +16 -0
- package/src/components/items/item-list-table/locales/hr.ts +16 -0
- package/src/components/items/item-list-table/locales/it.ts +16 -0
- package/src/components/items/item-list-table/locales/nl.ts +16 -0
- package/src/components/items/item-list-table/locales/pl.ts +16 -0
- package/src/components/items/item-list-table/locales/pt.ts +16 -0
- package/src/components/items/item-list-table/locales/sl.ts +6 -0
- package/src/components/items/items.hooks.ts +7 -2
- package/src/components/payments/create-payment-form/create-payment-form.tsx +14 -0
- package/src/components/payments/create-payment-form/locales/es.ts +20 -0
- package/src/components/payments/create-payment-form/locales/fr.ts +20 -0
- package/src/components/payments/create-payment-form/locales/hr.ts +20 -0
- package/src/components/payments/create-payment-form/locales/it.ts +20 -0
- package/src/components/payments/create-payment-form/locales/nl.ts +20 -0
- package/src/components/payments/create-payment-form/locales/pl.ts +20 -0
- package/src/components/payments/create-payment-form/locales/pt.ts +20 -0
- package/src/components/payments/edit-payment-form/edit-payment-form.tsx +18 -2
- package/src/components/payments/edit-payment-form/locales/es.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/fr.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/hr.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/it.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/nl.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/pl.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/pt.ts +20 -0
- package/src/components/payments/list/list-row-actions.tsx +14 -0
- package/src/components/payments/list/list-table.tsx +21 -2
- package/src/components/payments/list/locales/de.ts +6 -0
- package/src/components/payments/list/locales/en.ts +7 -0
- package/src/components/payments/list/locales/es.ts +25 -0
- package/src/components/payments/list/locales/fr.ts +25 -0
- package/src/components/payments/list/locales/hr.ts +25 -0
- package/src/components/payments/list/locales/it.ts +25 -0
- package/src/components/payments/list/locales/nl.ts +25 -0
- package/src/components/payments/list/locales/pl.ts +25 -0
- package/src/components/payments/list/locales/pt.ts +25 -0
- package/src/components/payments/list/locales/sl.ts +6 -0
- package/src/components/payments/payments.hooks.ts +7 -2
- package/src/components/request-logs/index.ts +1 -1
- package/src/components/table/data-table.tsx +8 -3
- package/src/components/table/filter-panel.tsx +4 -4
- package/src/components/table/hooks/use-table-query.ts +3 -0
- package/src/components/table/table-empty-state.tsx +11 -4
- package/src/components/table/table-no-results.tsx +6 -4
- package/src/components/table/types.ts +2 -2
- package/src/components/tax-reports/kir-export-form.tsx +0 -1
- package/src/components/taxes/create-tax-form/create-tax-form.tsx +14 -0
- package/src/components/taxes/create-tax-form/locales/en.ts +1 -0
- package/src/components/taxes/create-tax-form/locales/es.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/fr.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/hr.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/it.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/nl.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/pl.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/pt.ts +8 -0
- package/src/components/taxes/edit-tax-form/edit-tax-form.tsx +119 -0
- package/src/components/taxes/edit-tax-form/locales/de.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/es.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/fr.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/hr.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/it.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/nl.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/pl.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/pt.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/sl.ts +6 -0
- package/src/components/taxes/tax-list-table/locales/de.ts +6 -0
- package/src/components/taxes/tax-list-table/locales/en.ts +6 -0
- package/src/components/taxes/tax-list-table/locales/es.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/fr.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/hr.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/it.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/nl.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/pl.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/pt.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/sl.ts +6 -0
- package/src/components/taxes/tax-list-table/tax-list-table.tsx +18 -0
- package/src/components/taxes/taxes.hooks.ts +12 -7
- package/src/components/ui/tooltip.tsx +2 -2
- package/src/components/wl-subscription/locked-feature.tsx +1 -0
- package/src/components/wl-subscription/upgrade-modal.tsx +1 -0
- package/src/generated/schemas/acceptentityinvitation_body.ts +17 -0
- package/src/generated/schemas/addentityuser_body.ts +18 -0
- package/src/generated/schemas/advanceinvoice.ts +184 -12
- package/src/generated/schemas/creditnote.ts +96 -127
- package/src/generated/schemas/customadvanceinvoice.ts +246 -0
- package/src/generated/schemas/customcreditnote.ts +237 -0
- package/src/generated/schemas/customer.ts +26 -0
- package/src/generated/schemas/customestimate.ts +181 -0
- package/src/generated/schemas/custominvoice.ts +237 -0
- package/src/generated/schemas/entity.ts +66 -7
- package/src/generated/schemas/entityuserrole.ts +19 -0
- package/src/generated/schemas/estimate.ts +149 -1
- package/src/generated/schemas/finasettings.ts +25 -0
- package/src/generated/schemas/furssettings.ts +1 -2
- package/src/generated/schemas/index.ts +24 -5
- package/src/generated/schemas/invoice.ts +224 -22
- package/src/generated/schemas/me.ts +22 -0
- package/src/generated/schemas/registerfinamovablepremise_body.ts +26 -0
- package/src/generated/schemas/registerfinarealestatepremise_body.ts +37 -0
- package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +342 -0
- package/src/generated/schemas/rendercreditnotepreview_body.ts +344 -0
- package/src/generated/schemas/renderestimatepreview_body.ts +284 -0
- package/src/generated/schemas/renderinvoicepreview_body.ts +344 -0
- package/src/generated/schemas/senddocument_body.ts +23 -0
- package/src/generated/schemas/sendemail_body.ts +8 -10
- package/src/generated/schemas/stripeappconnect_body.ts +18 -0
- package/src/generated/schemas/stripeappcreateinvoice_body.ts +20 -0
- package/src/generated/schemas/stripeappupdatesettings_body.ts +26 -0
- package/src/generated/schemas/webhook.ts +143 -0
- package/src/hooks/create-resource-hooks.ts +85 -1
- package/src/hooks/use-next-document-number.ts +1 -1
- package/src/hooks/use-resource-mutation.ts +4 -3
- package/src/lib/browser-cookies.ts +12 -1
- package/src/lib/cookies.ts +2 -2
- package/src/lib/translation.ts +1 -1
- package/src/providers/entities-provider.tsx +84 -39
- package/src/providers/sdk-provider.tsx +7 -3
- package/src/providers/white-label-provider.tsx +5 -2
- package/src/providers/wl-subscription-provider.tsx +1 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
Recipient: "Odbiorca",
|
|
3
|
+
Name: "Nazwa",
|
|
4
|
+
Details: "Szczegóły",
|
|
5
|
+
Number: "Numer",
|
|
6
|
+
"Number format can be changed in settings": "Format numeru można zmienić w ustawieniach",
|
|
7
|
+
Date: "Data",
|
|
8
|
+
"Pick a date": "Wybierz datę",
|
|
9
|
+
"Due Date": "Termin płatności",
|
|
10
|
+
"Valid Until": "Ważne do",
|
|
11
|
+
Items: "Pozycje",
|
|
12
|
+
"Add item": "Dodaj pozycję",
|
|
13
|
+
Save: "Zapisz",
|
|
14
|
+
Update: "Zaktualizuj",
|
|
15
|
+
"Save as Draft": "Zapisz jako szkic",
|
|
16
|
+
Quantity: "Ilość",
|
|
17
|
+
Price: "Cena",
|
|
18
|
+
Unit: "Jednostka",
|
|
19
|
+
Discount: "Rabat",
|
|
20
|
+
Tax: "Podatek",
|
|
21
|
+
"Tax rate": "Stawka podatkowa",
|
|
22
|
+
"Add tax": "Dodaj podatek",
|
|
23
|
+
"Select tax...": "Wybierz podatek...",
|
|
24
|
+
"Loading...": "Ładowanie...",
|
|
25
|
+
"No taxes found": "Nie znaleziono podatków",
|
|
26
|
+
"Add new tax...": "Dodaj nowy podatek...",
|
|
27
|
+
Description: "Opis",
|
|
28
|
+
"Mark as Paid": "Oznacz jako opłaconą",
|
|
29
|
+
Paid: "Opłacona",
|
|
30
|
+
"Invoice will be marked as fully paid upon creation":
|
|
31
|
+
"Faktura zostanie oznaczona jako w pełni opłacona podczas tworzenia",
|
|
32
|
+
"Payment Type": "Rodzaj płatności",
|
|
33
|
+
"Select payment type": "Wybierz rodzaj płatności",
|
|
34
|
+
Cash: "Gotówka",
|
|
35
|
+
"Bank Transfer": "Przelew bankowy",
|
|
36
|
+
Card: "Karta",
|
|
37
|
+
Check: "Czek",
|
|
38
|
+
Other: "Inne",
|
|
39
|
+
Note: "Uwaga",
|
|
40
|
+
"Insert variable": "Wstaw zmienną",
|
|
41
|
+
"Add payment instructions, terms, or other notes...": "Dodaj instrukcje płatności, warunki lub inne uwagi...",
|
|
42
|
+
"Payment Terms": "Warunki płatności",
|
|
43
|
+
"Add payment terms...": "Dodaj warunki płatności...",
|
|
44
|
+
Entity: "Firma",
|
|
45
|
+
Document: "Dokument",
|
|
46
|
+
Customer: "Klient",
|
|
47
|
+
"Company name": "Nazwa firmy",
|
|
48
|
+
"Email address": "Adres e-mail",
|
|
49
|
+
"Invoice number": "Numer faktury",
|
|
50
|
+
"Invoice date": "Data faktury",
|
|
51
|
+
"Due date": "Termin płatności",
|
|
52
|
+
"Total amount": "Kwota całkowita",
|
|
53
|
+
Currency: "Waluta",
|
|
54
|
+
"Select currency": "Wybierz walutę",
|
|
55
|
+
"Customer name": "Nazwa klienta",
|
|
56
|
+
"Customer email": "E-mail klienta",
|
|
57
|
+
"Today's date": "Dzisiejsza data",
|
|
58
|
+
"Current year": "Bieżący rok",
|
|
59
|
+
"Search or create customer...": "Szukaj lub utwórz klienta...",
|
|
60
|
+
Clear: "Wyczyść",
|
|
61
|
+
Address: "Adres",
|
|
62
|
+
"Address 2": "Adres 2",
|
|
63
|
+
"Post Code": "Kod pocztowy",
|
|
64
|
+
City: "Miasto",
|
|
65
|
+
State: "Województwo",
|
|
66
|
+
Country: "Kraj",
|
|
67
|
+
"Tax Number": "NIP",
|
|
68
|
+
"Percentage discount": "Rabat procentowy",
|
|
69
|
+
"Fixed amount discount": "Rabat kwotowy",
|
|
70
|
+
Percentage: "Procent",
|
|
71
|
+
"Fixed amount": "Kwota stała",
|
|
72
|
+
"FURS Fiscalization": "Fiskalizacja FURS",
|
|
73
|
+
"Business Premise": "Lokal użytkowy",
|
|
74
|
+
"Electronic Device": "Urządzenie elektroniczne",
|
|
75
|
+
Premise: "Lokal",
|
|
76
|
+
Device: "Urządzenie",
|
|
77
|
+
"Select premise": "Wybierz lokal",
|
|
78
|
+
"Select device": "Wybierz urządzenie",
|
|
79
|
+
"Skip Fiscalization": "Pomiń fiskalizację",
|
|
80
|
+
"Skip fiscalization for this invoice (e.g., bank transfers or unpaid invoices)":
|
|
81
|
+
"Pomiń fiskalizację dla tej faktury (np. przelewy bankowe lub nieopłacone faktury)",
|
|
82
|
+
"Cannot skip fiscalization for cash payments": "Nie można pominąć fiskalizacji dla płatności gotówkowych",
|
|
83
|
+
Skipped: "Pominięta",
|
|
84
|
+
Enabled: "Włączona",
|
|
85
|
+
"Click to enable fiscalization": "Kliknij, aby włączyć fiskalizację",
|
|
86
|
+
"Fiscally verify": "Weryfikacja fiskalna",
|
|
87
|
+
"Click to skip fiscalization for this invoice": "Kliknij, aby pominąć fiskalizację dla tej faktury",
|
|
88
|
+
"e-SLOG": "e-SLOG",
|
|
89
|
+
"Click to skip e-SLOG validation for this invoice": "Kliknij, aby pominąć walidację e-SLOG dla tej faktury",
|
|
90
|
+
"Click to enable e-SLOG validation": "Kliknij, aby włączyć walidację e-SLOG",
|
|
91
|
+
"e-SLOG Validation Failed": "Walidacja e-SLOG nie powiodła się",
|
|
92
|
+
"The following entity settings need to be updated:": "Następujące ustawienia podmiotu muszą zostać zaktualizowane:",
|
|
93
|
+
"Reverse charge - tax exempt EU B2B sale": "Odwrotne obciążenie - sprzedaż B2B UE zwolniona z podatku",
|
|
94
|
+
"Taxes disabled": "Podatki wyłączone",
|
|
95
|
+
"Gross price": "Cena brutto",
|
|
96
|
+
"Net price": "Cena netto",
|
|
97
|
+
"Gross price (tax included)": "Cena brutto (z podatkiem)",
|
|
98
|
+
"Net price (before tax)": "Cena netto (przed podatkiem)",
|
|
99
|
+
"Service Date": "Data usługi",
|
|
100
|
+
"Single Date": "Pojedyncza data",
|
|
101
|
+
"Date Range": "Zakres dat",
|
|
102
|
+
From: "Od",
|
|
103
|
+
To: "Do",
|
|
104
|
+
} as const;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
Recipient: "Destinatário",
|
|
3
|
+
Name: "Nome",
|
|
4
|
+
Details: "Detalhes",
|
|
5
|
+
Number: "Número",
|
|
6
|
+
"Number format can be changed in settings": "O formato do número pode ser alterado nas definições",
|
|
7
|
+
Date: "Data",
|
|
8
|
+
"Pick a date": "Selecionar uma data",
|
|
9
|
+
"Due Date": "Data de vencimento",
|
|
10
|
+
"Valid Until": "Válido até",
|
|
11
|
+
Items: "Itens",
|
|
12
|
+
"Add item": "Adicionar item",
|
|
13
|
+
Save: "Guardar",
|
|
14
|
+
Update: "Atualizar",
|
|
15
|
+
"Save as Draft": "Guardar como rascunho",
|
|
16
|
+
Quantity: "Quantidade",
|
|
17
|
+
Price: "Preço",
|
|
18
|
+
Unit: "Unidade",
|
|
19
|
+
Discount: "Desconto",
|
|
20
|
+
Tax: "Imposto",
|
|
21
|
+
"Tax rate": "Taxa de imposto",
|
|
22
|
+
"Add tax": "Adicionar imposto",
|
|
23
|
+
"Select tax...": "Selecionar imposto...",
|
|
24
|
+
"Loading...": "A carregar...",
|
|
25
|
+
"No taxes found": "Nenhum imposto encontrado",
|
|
26
|
+
"Add new tax...": "Adicionar novo imposto...",
|
|
27
|
+
Description: "Descrição",
|
|
28
|
+
"Mark as Paid": "Marcar como paga",
|
|
29
|
+
Paid: "Paga",
|
|
30
|
+
"Invoice will be marked as fully paid upon creation": "A fatura será marcada como totalmente paga ao ser criada",
|
|
31
|
+
"Payment Type": "Tipo de pagamento",
|
|
32
|
+
"Select payment type": "Selecionar tipo de pagamento",
|
|
33
|
+
Cash: "Dinheiro",
|
|
34
|
+
"Bank Transfer": "Transferência bancária",
|
|
35
|
+
Card: "Cartão",
|
|
36
|
+
Check: "Cheque",
|
|
37
|
+
Other: "Outro",
|
|
38
|
+
Note: "Nota",
|
|
39
|
+
"Insert variable": "Inserir variável",
|
|
40
|
+
"Add payment instructions, terms, or other notes...":
|
|
41
|
+
"Adicione instruções de pagamento, condições ou outras notas...",
|
|
42
|
+
"Payment Terms": "Condições de pagamento",
|
|
43
|
+
"Add payment terms...": "Adicione condições de pagamento...",
|
|
44
|
+
Entity: "Empresa",
|
|
45
|
+
Document: "Documento",
|
|
46
|
+
Customer: "Cliente",
|
|
47
|
+
"Company name": "Nome da empresa",
|
|
48
|
+
"Email address": "Endereço de email",
|
|
49
|
+
"Invoice number": "Número da fatura",
|
|
50
|
+
"Invoice date": "Data da fatura",
|
|
51
|
+
"Due date": "Data de vencimento",
|
|
52
|
+
"Total amount": "Montante total",
|
|
53
|
+
Currency: "Moeda",
|
|
54
|
+
"Select currency": "Selecionar moeda",
|
|
55
|
+
"Customer name": "Nome do cliente",
|
|
56
|
+
"Customer email": "Email do cliente",
|
|
57
|
+
"Today's date": "Data de hoje",
|
|
58
|
+
"Current year": "Ano corrente",
|
|
59
|
+
"Search or create customer...": "Pesquisar ou criar cliente...",
|
|
60
|
+
Clear: "Limpar",
|
|
61
|
+
Address: "Morada",
|
|
62
|
+
"Address 2": "Morada 2",
|
|
63
|
+
"Post Code": "Código postal",
|
|
64
|
+
City: "Cidade",
|
|
65
|
+
State: "Distrito",
|
|
66
|
+
Country: "País",
|
|
67
|
+
"Tax Number": "Número fiscal",
|
|
68
|
+
"Percentage discount": "Desconto percentual",
|
|
69
|
+
"Fixed amount discount": "Desconto fixo",
|
|
70
|
+
Percentage: "Percentagem",
|
|
71
|
+
"Fixed amount": "Montante fixo",
|
|
72
|
+
"FURS Fiscalization": "Fiscalização FURS",
|
|
73
|
+
"Business Premise": "Instalação comercial",
|
|
74
|
+
"Electronic Device": "Dispositivo eletrónico",
|
|
75
|
+
Premise: "Instalação",
|
|
76
|
+
Device: "Dispositivo",
|
|
77
|
+
"Select premise": "Selecionar instalação",
|
|
78
|
+
"Select device": "Selecionar dispositivo",
|
|
79
|
+
"Skip Fiscalization": "Ignorar fiscalização",
|
|
80
|
+
"Skip fiscalization for this invoice (e.g., bank transfers or unpaid invoices)":
|
|
81
|
+
"Ignorar a fiscalização para esta fatura (ex. transferências bancárias ou faturas por pagar)",
|
|
82
|
+
"Cannot skip fiscalization for cash payments": "Não é possível ignorar a fiscalização para pagamentos em dinheiro",
|
|
83
|
+
Skipped: "Ignorada",
|
|
84
|
+
Enabled: "Ativada",
|
|
85
|
+
"Click to enable fiscalization": "Clique para ativar a fiscalização",
|
|
86
|
+
"Fiscally verify": "Verificação fiscal",
|
|
87
|
+
"Click to skip fiscalization for this invoice": "Clique para ignorar a fiscalização para esta fatura",
|
|
88
|
+
"e-SLOG": "e-SLOG",
|
|
89
|
+
"Click to skip e-SLOG validation for this invoice": "Clique para ignorar a validação e-SLOG para esta fatura",
|
|
90
|
+
"Click to enable e-SLOG validation": "Clique para ativar a validação e-SLOG",
|
|
91
|
+
"e-SLOG Validation Failed": "Validação e-SLOG falhou",
|
|
92
|
+
"The following entity settings need to be updated:":
|
|
93
|
+
"As seguintes definições da entidade precisam de ser atualizadas:",
|
|
94
|
+
"Reverse charge - tax exempt EU B2B sale": "Autoliquidação - venda B2B UE isenta de imposto",
|
|
95
|
+
"Taxes disabled": "Impostos desativados",
|
|
96
|
+
"Gross price": "Preço bruto",
|
|
97
|
+
"Net price": "Preço líquido",
|
|
98
|
+
"Gross price (tax included)": "Preço bruto (impostos incluídos)",
|
|
99
|
+
"Net price (before tax)": "Preço líquido (antes de impostos)",
|
|
100
|
+
"Service Date": "Data do serviço",
|
|
101
|
+
"Single Date": "Data única",
|
|
102
|
+
"Date Range": "Intervalo de datas",
|
|
103
|
+
From: "De",
|
|
104
|
+
To: "Até",
|
|
105
|
+
} as const;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import type { CreateInvoiceSchema } from "@/ui/generated/schemas";
|
|
3
2
|
import { prepareInvoiceSubmission } from "./prepare-invoice-submission";
|
|
4
3
|
|
|
5
4
|
describe("prepareInvoiceSubmission", () => {
|
|
6
5
|
describe("customer data transformation", () => {
|
|
7
6
|
test("sends only customer_id when customer not editable", () => {
|
|
8
|
-
const values:
|
|
7
|
+
const values: any = {
|
|
9
8
|
customer_id: "cust-123",
|
|
10
9
|
customer: {} as any,
|
|
11
10
|
number: "INV-001",
|
|
@@ -29,7 +28,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
29
28
|
address: "123 Test St",
|
|
30
29
|
};
|
|
31
30
|
|
|
32
|
-
const values:
|
|
31
|
+
const values: any = {
|
|
33
32
|
customer_id: "cust-123",
|
|
34
33
|
customer: originalCustomer as any,
|
|
35
34
|
number: "INV-001",
|
|
@@ -58,7 +57,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
58
57
|
address: "456 New St",
|
|
59
58
|
};
|
|
60
59
|
|
|
61
|
-
const values:
|
|
60
|
+
const values: any = {
|
|
62
61
|
customer_id: "cust-123",
|
|
63
62
|
customer: modifiedCustomer as any,
|
|
64
63
|
number: "INV-001",
|
|
@@ -86,7 +85,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
86
85
|
city: "New City",
|
|
87
86
|
};
|
|
88
87
|
|
|
89
|
-
const values:
|
|
88
|
+
const values: any = {
|
|
90
89
|
customer: newCustomer as any,
|
|
91
90
|
number: "INV-001",
|
|
92
91
|
date: "2024-01-01",
|
|
@@ -115,7 +114,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
115
114
|
post_code: "12345",
|
|
116
115
|
};
|
|
117
116
|
|
|
118
|
-
const values:
|
|
117
|
+
const values: any = {
|
|
119
118
|
customer: customerWithEmpty as any,
|
|
120
119
|
number: "INV-001",
|
|
121
120
|
date: "2024-01-01",
|
|
@@ -143,7 +142,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
143
142
|
state: undefined,
|
|
144
143
|
};
|
|
145
144
|
|
|
146
|
-
const values:
|
|
145
|
+
const values: any = {
|
|
147
146
|
customer: emptyCustomer as any,
|
|
148
147
|
number: "INV-001",
|
|
149
148
|
date: "2024-01-01",
|
|
@@ -160,7 +159,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
160
159
|
});
|
|
161
160
|
|
|
162
161
|
test("removes customer_id when empty", () => {
|
|
163
|
-
const values:
|
|
162
|
+
const values: any = {
|
|
164
163
|
customer_id: "",
|
|
165
164
|
number: "INV-001",
|
|
166
165
|
date: "2024-01-01",
|
|
@@ -179,14 +178,14 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
179
178
|
|
|
180
179
|
describe("date conversion", () => {
|
|
181
180
|
test("converts date string to Date object", () => {
|
|
182
|
-
const values:
|
|
181
|
+
const values: any = {
|
|
183
182
|
number: "INV-001",
|
|
184
183
|
date: "2024-01-15",
|
|
185
184
|
date_due: "2024-02-15",
|
|
186
185
|
items: [],
|
|
187
186
|
};
|
|
188
187
|
|
|
189
|
-
const result = prepareInvoiceSubmission(values, {
|
|
188
|
+
const result: any = prepareInvoiceSubmission(values, {
|
|
190
189
|
wasCustomerFormShown: false,
|
|
191
190
|
originalCustomer: null,
|
|
192
191
|
});
|
|
@@ -196,14 +195,14 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
196
195
|
});
|
|
197
196
|
|
|
198
197
|
test("converts date_due string to Date object", () => {
|
|
199
|
-
const values:
|
|
198
|
+
const values: any = {
|
|
200
199
|
number: "INV-001",
|
|
201
200
|
date: "2024-01-15",
|
|
202
201
|
date_due: "2024-02-15",
|
|
203
202
|
items: [],
|
|
204
203
|
};
|
|
205
204
|
|
|
206
|
-
const result = prepareInvoiceSubmission(values, {
|
|
205
|
+
const result: any = prepareInvoiceSubmission(values, {
|
|
207
206
|
wasCustomerFormShown: false,
|
|
208
207
|
originalCustomer: null,
|
|
209
208
|
});
|
|
@@ -213,7 +212,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
213
212
|
});
|
|
214
213
|
|
|
215
214
|
test("handles undefined dates", () => {
|
|
216
|
-
const values:
|
|
215
|
+
const values: any = {
|
|
217
216
|
number: "INV-001",
|
|
218
217
|
items: [],
|
|
219
218
|
} as any;
|
|
@@ -230,79 +229,79 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
230
229
|
|
|
231
230
|
describe("payment data", () => {
|
|
232
231
|
test("adds payment data when markAsPaid is true", () => {
|
|
233
|
-
const values:
|
|
232
|
+
const values: any = {
|
|
234
233
|
number: "INV-001",
|
|
235
234
|
date: "2024-01-15",
|
|
236
235
|
date_due: "2024-02-15",
|
|
237
236
|
items: [],
|
|
238
237
|
};
|
|
239
238
|
|
|
240
|
-
const result = prepareInvoiceSubmission(values, {
|
|
239
|
+
const result: any = prepareInvoiceSubmission(values, {
|
|
241
240
|
wasCustomerFormShown: false,
|
|
242
241
|
originalCustomer: null,
|
|
243
242
|
markAsPaid: true,
|
|
244
|
-
|
|
243
|
+
paymentTypes: ["bank_transfer"],
|
|
245
244
|
});
|
|
246
245
|
|
|
247
|
-
expect(result.
|
|
248
|
-
expect(result.
|
|
249
|
-
expect(result.
|
|
246
|
+
expect(result.payments).toBeDefined();
|
|
247
|
+
expect(result.payments?.[0]?.type).toBe("bank_transfer");
|
|
248
|
+
expect(result.payments?.[0]?.date).toBeInstanceOf(Date);
|
|
250
249
|
});
|
|
251
250
|
|
|
252
251
|
test("uses correct payment type", () => {
|
|
253
|
-
const values:
|
|
252
|
+
const values: any = {
|
|
254
253
|
number: "INV-001",
|
|
255
254
|
date: "2024-01-15",
|
|
256
255
|
date_due: "2024-02-15",
|
|
257
256
|
items: [],
|
|
258
257
|
};
|
|
259
258
|
|
|
260
|
-
const result = prepareInvoiceSubmission(values, {
|
|
259
|
+
const result: any = prepareInvoiceSubmission(values, {
|
|
261
260
|
wasCustomerFormShown: false,
|
|
262
261
|
originalCustomer: null,
|
|
263
262
|
markAsPaid: true,
|
|
264
|
-
|
|
263
|
+
paymentTypes: ["cash"],
|
|
265
264
|
});
|
|
266
265
|
|
|
267
|
-
expect(result.
|
|
266
|
+
expect(result.payments?.[0]?.type).toBe("cash");
|
|
268
267
|
});
|
|
269
268
|
|
|
270
269
|
test("uses default payment type when not specified", () => {
|
|
271
|
-
const values:
|
|
270
|
+
const values: any = {
|
|
272
271
|
number: "INV-001",
|
|
273
272
|
date: "2024-01-15",
|
|
274
273
|
date_due: "2024-02-15",
|
|
275
274
|
items: [],
|
|
276
275
|
};
|
|
277
276
|
|
|
278
|
-
const result = prepareInvoiceSubmission(values, {
|
|
277
|
+
const result: any = prepareInvoiceSubmission(values, {
|
|
279
278
|
wasCustomerFormShown: false,
|
|
280
279
|
originalCustomer: null,
|
|
281
280
|
markAsPaid: true,
|
|
282
281
|
});
|
|
283
282
|
|
|
284
|
-
expect(result.
|
|
283
|
+
expect(result.payments).toBeUndefined();
|
|
285
284
|
});
|
|
286
285
|
|
|
287
286
|
test("does not add payment data when markAsPaid is false", () => {
|
|
288
|
-
const values:
|
|
287
|
+
const values: any = {
|
|
289
288
|
number: "INV-001",
|
|
290
289
|
date: "2024-01-15",
|
|
291
290
|
date_due: "2024-02-15",
|
|
292
291
|
items: [],
|
|
293
292
|
};
|
|
294
293
|
|
|
295
|
-
const result = prepareInvoiceSubmission(values, {
|
|
294
|
+
const result: any = prepareInvoiceSubmission(values, {
|
|
296
295
|
wasCustomerFormShown: false,
|
|
297
296
|
originalCustomer: null,
|
|
298
297
|
markAsPaid: false,
|
|
299
298
|
});
|
|
300
299
|
|
|
301
|
-
expect(result.
|
|
300
|
+
expect(result.payments).toBeUndefined();
|
|
302
301
|
});
|
|
303
302
|
|
|
304
303
|
test("does not add payment data when markAsPaid not provided", () => {
|
|
305
|
-
const values:
|
|
304
|
+
const values: any = {
|
|
306
305
|
number: "INV-001",
|
|
307
306
|
date: "2024-01-15",
|
|
308
307
|
date_due: "2024-02-15",
|
|
@@ -314,7 +313,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
314
313
|
originalCustomer: null,
|
|
315
314
|
});
|
|
316
315
|
|
|
317
|
-
expect(result.
|
|
316
|
+
expect(result.payments).toBeUndefined();
|
|
318
317
|
});
|
|
319
318
|
});
|
|
320
319
|
|
|
@@ -326,7 +325,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
326
325
|
// Missing other fields
|
|
327
326
|
};
|
|
328
327
|
|
|
329
|
-
const values:
|
|
328
|
+
const values: any = {
|
|
330
329
|
customer: customer as any,
|
|
331
330
|
number: "INV-001",
|
|
332
331
|
date: "2024-01-15",
|
|
@@ -347,7 +346,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
347
346
|
});
|
|
348
347
|
|
|
349
348
|
test("preserves other invoice fields", () => {
|
|
350
|
-
const values:
|
|
349
|
+
const values: any = {
|
|
351
350
|
number: "INV-001",
|
|
352
351
|
date: "2024-01-15",
|
|
353
352
|
date_due: "2024-02-15",
|
|
@@ -373,14 +372,14 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
373
372
|
});
|
|
374
373
|
|
|
375
374
|
test("never includes number in payload (server auto-generates)", () => {
|
|
376
|
-
const values:
|
|
375
|
+
const values: any = {
|
|
377
376
|
number: "INV-001", // Even if form has a preview number
|
|
378
377
|
date: "2024-01-15",
|
|
379
378
|
date_due: "2024-02-15",
|
|
380
379
|
items: [],
|
|
381
380
|
};
|
|
382
381
|
|
|
383
|
-
const result = prepareInvoiceSubmission(values, {
|
|
382
|
+
const result: any = prepareInvoiceSubmission(values, {
|
|
384
383
|
wasCustomerFormShown: false,
|
|
385
384
|
originalCustomer: null,
|
|
386
385
|
});
|
|
@@ -392,7 +391,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
392
391
|
|
|
393
392
|
describe("gross price transformation", () => {
|
|
394
393
|
test("transforms items with priceModes[index]=true to send gross_price", () => {
|
|
395
|
-
const values:
|
|
394
|
+
const values: any = {
|
|
396
395
|
number: "INV-001",
|
|
397
396
|
date: "2024-01-15",
|
|
398
397
|
date_due: "2024-02-15",
|
|
@@ -417,7 +416,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
417
416
|
});
|
|
418
417
|
|
|
419
418
|
test("transforms items with priceModes[index]=false to send price", () => {
|
|
420
|
-
const values:
|
|
419
|
+
const values: any = {
|
|
421
420
|
number: "INV-001",
|
|
422
421
|
date: "2024-01-15",
|
|
423
422
|
date_due: "2024-02-15",
|
|
@@ -442,7 +441,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
442
441
|
});
|
|
443
442
|
|
|
444
443
|
test("defaults to net price when priceModes not provided", () => {
|
|
445
|
-
const values:
|
|
444
|
+
const values: any = {
|
|
446
445
|
number: "INV-001",
|
|
447
446
|
date: "2024-01-15",
|
|
448
447
|
date_due: "2024-02-15",
|
|
@@ -466,7 +465,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
466
465
|
});
|
|
467
466
|
|
|
468
467
|
test("handles mixed net and gross price items via priceModes", () => {
|
|
469
|
-
const values:
|
|
468
|
+
const values: any = {
|
|
470
469
|
number: "INV-001",
|
|
471
470
|
date: "2024-01-15",
|
|
472
471
|
date_due: "2024-02-15",
|
|
@@ -501,7 +500,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
501
500
|
|
|
502
501
|
describe("FURS fiscalization data", () => {
|
|
503
502
|
test("adds FURS data when premise and device provided", () => {
|
|
504
|
-
const values:
|
|
503
|
+
const values: any = {
|
|
505
504
|
number: "INV-001",
|
|
506
505
|
date: "2024-01-15",
|
|
507
506
|
date_due: "2024-02-15",
|
|
@@ -524,7 +523,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
524
523
|
});
|
|
525
524
|
|
|
526
525
|
test("does not add FURS data when no options provided", () => {
|
|
527
|
-
const values:
|
|
526
|
+
const values: any = {
|
|
528
527
|
number: "INV-001",
|
|
529
528
|
date: "2024-01-15",
|
|
530
529
|
date_due: "2024-02-15",
|
|
@@ -540,7 +539,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
540
539
|
});
|
|
541
540
|
|
|
542
541
|
test("does not add FURS data when only premise provided", () => {
|
|
543
|
-
const values:
|
|
542
|
+
const values: any = {
|
|
544
543
|
number: "INV-001",
|
|
545
544
|
date: "2024-01-15",
|
|
546
545
|
date_due: "2024-02-15",
|
|
@@ -559,7 +558,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
559
558
|
});
|
|
560
559
|
|
|
561
560
|
test("does not add FURS data when only device provided", () => {
|
|
562
|
-
const values:
|
|
561
|
+
const values: any = {
|
|
563
562
|
number: "INV-001",
|
|
564
563
|
date: "2024-01-15",
|
|
565
564
|
date_due: "2024-02-15",
|
|
@@ -578,7 +577,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
578
577
|
});
|
|
579
578
|
|
|
580
579
|
test("adds skip flag when skip fiscalization is true", () => {
|
|
581
|
-
const values:
|
|
580
|
+
const values: any = {
|
|
582
581
|
number: "INV-001",
|
|
583
582
|
date: "2024-01-15",
|
|
584
583
|
date_due: "2024-02-15",
|
|
@@ -597,7 +596,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
597
596
|
});
|
|
598
597
|
|
|
599
598
|
test("skip flag takes precedence over premise/device", () => {
|
|
600
|
-
const values:
|
|
599
|
+
const values: any = {
|
|
601
600
|
number: "INV-001",
|
|
602
601
|
date: "2024-01-15",
|
|
603
602
|
date_due: "2024-02-15",
|
|
@@ -619,7 +618,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
619
618
|
});
|
|
620
619
|
|
|
621
620
|
test("FURS data works with payment data", () => {
|
|
622
|
-
const values:
|
|
621
|
+
const values: any = {
|
|
623
622
|
number: "INV-001",
|
|
624
623
|
date: "2024-01-15",
|
|
625
624
|
date_due: "2024-02-15",
|
|
@@ -630,7 +629,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
630
629
|
wasCustomerFormShown: false,
|
|
631
630
|
originalCustomer: null,
|
|
632
631
|
markAsPaid: true,
|
|
633
|
-
|
|
632
|
+
paymentTypes: ["cash"],
|
|
634
633
|
furs: {
|
|
635
634
|
business_premise_name: "P1",
|
|
636
635
|
electronic_device_name: "E1",
|
|
@@ -641,14 +640,14 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
641
640
|
business_premise_name: "P1",
|
|
642
641
|
electronic_device_name: "E1",
|
|
643
642
|
});
|
|
644
|
-
expect(result.
|
|
645
|
-
expect(result.
|
|
643
|
+
expect(result.payments).toBeDefined();
|
|
644
|
+
expect(result.payments?.[0]?.type).toBe("cash");
|
|
646
645
|
});
|
|
647
646
|
});
|
|
648
647
|
|
|
649
648
|
describe("draft invoices", () => {
|
|
650
649
|
test("sets is_draft to true when isDraft option is true", () => {
|
|
651
|
-
const values:
|
|
650
|
+
const values: any = {
|
|
652
651
|
number: "INV-001",
|
|
653
652
|
date: "2024-01-15",
|
|
654
653
|
date_due: "2024-02-15",
|
|
@@ -665,7 +664,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
665
664
|
});
|
|
666
665
|
|
|
667
666
|
test("does not set is_draft when isDraft is false", () => {
|
|
668
|
-
const values:
|
|
667
|
+
const values: any = {
|
|
669
668
|
number: "INV-001",
|
|
670
669
|
date: "2024-01-15",
|
|
671
670
|
date_due: "2024-02-15",
|
|
@@ -682,7 +681,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
682
681
|
});
|
|
683
682
|
|
|
684
683
|
test("draft invoice without FURS data (form skips FURS for drafts)", () => {
|
|
685
|
-
const values:
|
|
684
|
+
const values: any = {
|
|
686
685
|
number: "INV-001",
|
|
687
686
|
date: "2024-01-15",
|
|
688
687
|
date_due: "2024-02-15",
|
|
@@ -702,7 +701,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
702
701
|
});
|
|
703
702
|
|
|
704
703
|
test("draft invoice without e-SLOG validation (form skips e-SLOG for drafts)", () => {
|
|
705
|
-
const values:
|
|
704
|
+
const values: any = {
|
|
706
705
|
number: "INV-001",
|
|
707
706
|
date: "2024-01-15",
|
|
708
707
|
date_due: "2024-02-15",
|
|
@@ -722,7 +721,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
722
721
|
});
|
|
723
722
|
|
|
724
723
|
test("draft invoice without payment data (form skips markAsPaid for drafts)", () => {
|
|
725
|
-
const values:
|
|
724
|
+
const values: any = {
|
|
726
725
|
number: "INV-001",
|
|
727
726
|
date: "2024-01-15",
|
|
728
727
|
date_due: "2024-02-15",
|
|
@@ -742,7 +741,7 @@ describe("prepareInvoiceSubmission", () => {
|
|
|
742
741
|
});
|
|
743
742
|
|
|
744
743
|
test("draft invoice preserves all other invoice data", () => {
|
|
745
|
-
const values:
|
|
744
|
+
const values: any = {
|
|
746
745
|
number: "DRAFT-123",
|
|
747
746
|
date: "2024-01-15",
|
|
748
747
|
date_due: "2024-02-15",
|
|
@@ -19,7 +19,7 @@ type PrepareOptions = {
|
|
|
19
19
|
originalCustomer: any;
|
|
20
20
|
wasCustomerFormShown?: boolean;
|
|
21
21
|
markAsPaid?: boolean;
|
|
22
|
-
|
|
22
|
+
paymentTypes?: string[];
|
|
23
23
|
/** FURS fiscalization data (for Slovenia) */
|
|
24
24
|
furs?: FursData;
|
|
25
25
|
/** e-SLOG validation data (for Slovenia) */
|
|
@@ -39,9 +39,9 @@ export function prepareInvoiceSubmission(values: CreateInvoiceSchema, options: P
|
|
|
39
39
|
originalCustomer: options.originalCustomer,
|
|
40
40
|
wasCustomerFormShown: options.wasCustomerFormShown,
|
|
41
41
|
markAsPaid: options.markAsPaid,
|
|
42
|
-
|
|
42
|
+
paymentTypes: options.paymentTypes,
|
|
43
43
|
documentType: "invoice",
|
|
44
|
-
secondaryDate: values.date_due,
|
|
44
|
+
secondaryDate: values.date_due ?? undefined,
|
|
45
45
|
priceModes: options.priceModes,
|
|
46
46
|
isDraft: options.isDraft,
|
|
47
47
|
}) as CreateInvoiceRequest;
|