@spaceinvoices/react-ui 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/advance-invoices/advance-invoices.hooks.ts +2 -2
- package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +151 -45
- package/src/components/advance-invoices/create/locales/de.ts +20 -0
- package/src/components/advance-invoices/create/locales/es.ts +20 -0
- package/src/components/advance-invoices/create/locales/fr.ts +20 -0
- package/src/components/advance-invoices/create/locales/hr.ts +20 -0
- package/src/components/advance-invoices/create/locales/it.ts +20 -0
- package/src/components/advance-invoices/create/locales/nl.ts +20 -0
- package/src/components/advance-invoices/create/locales/pl.ts +20 -0
- package/src/components/advance-invoices/create/locales/pt.ts +20 -0
- package/src/components/advance-invoices/create/locales/sl.ts +20 -0
- package/src/components/advance-invoices/create/prepare-advance-invoice-submission.ts +5 -5
- package/src/components/advance-invoices/list/list-row-actions.tsx +48 -1
- package/src/components/advance-invoices/list/list-table.tsx +21 -1
- package/src/components/advance-invoices/list/locales/de.ts +4 -0
- package/src/components/advance-invoices/list/locales/en.ts +3 -0
- package/src/components/advance-invoices/list/locales/es.ts +4 -0
- package/src/components/advance-invoices/list/locales/fr.ts +4 -0
- package/src/components/advance-invoices/list/locales/hr.ts +3 -0
- package/src/components/advance-invoices/list/locales/it.ts +4 -0
- package/src/components/advance-invoices/list/locales/nl.ts +4 -0
- package/src/components/advance-invoices/list/locales/pl.ts +3 -0
- package/src/components/advance-invoices/list/locales/pt.ts +4 -0
- package/src/components/advance-invoices/list/locales/sl.ts +3 -0
- package/src/components/credit-notes/create/create-credit-note-form.tsx +161 -42
- package/src/components/credit-notes/create/locales/de.ts +21 -0
- package/src/components/credit-notes/create/locales/es.ts +21 -0
- package/src/components/credit-notes/create/locales/fr.ts +21 -0
- package/src/components/credit-notes/create/locales/hr.ts +21 -0
- package/src/components/credit-notes/create/locales/it.ts +21 -0
- package/src/components/credit-notes/create/locales/nl.ts +21 -0
- package/src/components/credit-notes/create/locales/pl.ts +21 -0
- package/src/components/credit-notes/create/locales/pt.ts +21 -0
- package/src/components/credit-notes/create/locales/sl.ts +22 -1
- package/src/components/credit-notes/credit-notes.hooks.ts +2 -2
- package/src/components/credit-notes/list/list-row-actions.tsx +44 -1
- package/src/components/credit-notes/list/list-table.tsx +16 -2
- package/src/components/credit-notes/list/locales/de.ts +2 -0
- package/src/components/credit-notes/list/locales/en.ts +2 -0
- package/src/components/credit-notes/list/locales/es.ts +2 -0
- package/src/components/credit-notes/list/locales/fr.ts +2 -0
- package/src/components/credit-notes/list/locales/hr.ts +2 -0
- package/src/components/credit-notes/list/locales/it.ts +2 -0
- package/src/components/credit-notes/list/locales/nl.ts +2 -0
- package/src/components/credit-notes/list/locales/pl.ts +2 -0
- package/src/components/credit-notes/list/locales/pt.ts +2 -0
- package/src/components/credit-notes/list/locales/sl.ts +2 -0
- package/src/components/dashboard/collection-rate-card/use-collection-rate.ts +48 -9
- package/src/components/dashboard/revenue-trend-chart/use-revenue-trend.ts +77 -48
- package/src/components/dashboard/shared/use-revenue-data.ts +77 -9
- package/src/components/delivery-notes/create/create-delivery-note-form.tsx +114 -7
- package/src/components/delivery-notes/create/locales/de.ts +21 -0
- package/src/components/delivery-notes/create/locales/es.ts +21 -0
- package/src/components/delivery-notes/create/locales/fr.ts +21 -0
- package/src/components/delivery-notes/create/locales/hr.ts +21 -0
- package/src/components/delivery-notes/create/locales/it.ts +21 -0
- package/src/components/delivery-notes/create/locales/nl.ts +21 -0
- package/src/components/delivery-notes/create/locales/pl.ts +21 -0
- package/src/components/delivery-notes/create/locales/pt.ts +21 -0
- package/src/components/delivery-notes/create/locales/sl.ts +22 -1
- package/src/components/delivery-notes/list/list-table.tsx +17 -8
- package/src/components/delivery-notes/list/locales/de.ts +32 -1
- package/src/components/delivery-notes/list/locales/en.ts +31 -0
- package/src/components/delivery-notes/list/locales/es.ts +32 -1
- package/src/components/delivery-notes/list/locales/fr.ts +32 -1
- package/src/components/delivery-notes/list/locales/hr.ts +32 -1
- package/src/components/delivery-notes/list/locales/it.ts +32 -1
- package/src/components/delivery-notes/list/locales/nl.ts +32 -1
- package/src/components/delivery-notes/list/locales/pl.ts +32 -1
- package/src/components/delivery-notes/list/locales/pt.ts +32 -1
- package/src/components/delivery-notes/list/locales/sl.ts +32 -1
- package/src/components/documents/create/document-add-item-form.tsx +70 -0
- package/src/components/documents/create/document-details-section.tsx +590 -344
- package/src/components/documents/create/document-items-section.tsx +21 -4
- package/src/components/documents/create/live-preview.tsx +24 -4
- package/src/components/documents/create/mark-as-paid-section.tsx +29 -20
- package/src/components/documents/create/prepare-document-submission.ts +22 -8
- package/src/components/documents/create/smart-code-insert-button.tsx +6 -0
- package/src/components/documents/shared/document-preview-display.tsx +3 -4
- package/src/components/documents/view/document-actions-bar.tsx +7 -27
- package/src/components/documents/view/document-details-card.tsx +32 -9
- package/src/components/documents/view/locales/de.ts +3 -0
- package/src/components/documents/view/locales/es.ts +3 -0
- package/src/components/documents/view/locales/fr.ts +3 -0
- package/src/components/documents/view/locales/hr.ts +3 -0
- package/src/components/documents/view/locales/it.ts +3 -0
- package/src/components/documents/view/locales/nl.ts +3 -0
- package/src/components/documents/view/locales/pl.ts +3 -0
- package/src/components/documents/view/locales/pt.ts +3 -0
- package/src/components/documents/view/locales/sl.ts +4 -1
- package/src/components/documents/view/use-document-download.ts +6 -3
- package/src/components/entities/create-entity-form.tsx +2 -1
- package/src/components/entities/entity-settings-form/email-template-variables-info.tsx +6 -0
- package/src/components/entities/entity-settings-form/input-with-preview.tsx +2 -117
- package/src/components/entities/entity-settings-form/locales/de.ts +5 -0
- package/src/components/entities/entity-settings-form/locales/es.ts +5 -0
- package/src/components/entities/entity-settings-form/locales/fr.ts +5 -0
- package/src/components/entities/entity-settings-form/locales/hr.ts +5 -0
- package/src/components/entities/entity-settings-form/locales/it.ts +5 -0
- package/src/components/entities/entity-settings-form/locales/nl.ts +5 -0
- package/src/components/entities/entity-settings-form/locales/pl.ts +5 -0
- package/src/components/entities/entity-settings-form/locales/pt.ts +5 -0
- package/src/components/entities/entity-settings-form/locales/sl.ts +5 -0
- package/src/components/entities/fina-settings-form/fina-settings-form.tsx +15 -0
- package/src/components/entities/fina-settings-form/fina-settings.hooks.ts +5 -1
- package/src/components/entities/fina-settings-form/locales/de.ts +3 -0
- package/src/components/entities/fina-settings-form/locales/en.ts +3 -0
- package/src/components/entities/fina-settings-form/locales/es.ts +3 -0
- package/src/components/entities/fina-settings-form/locales/fr.ts +3 -0
- package/src/components/entities/fina-settings-form/locales/hr.ts +3 -0
- package/src/components/entities/fina-settings-form/locales/it.ts +3 -0
- package/src/components/entities/fina-settings-form/locales/nl.ts +3 -0
- package/src/components/entities/fina-settings-form/locales/pl.ts +3 -0
- package/src/components/entities/fina-settings-form/locales/pt.ts +3 -0
- package/src/components/entities/fina-settings-form/locales/sl.ts +3 -0
- package/src/components/entities/fina-settings-form/sections/premises-management-section.tsx +4 -4
- package/src/components/entities/fina-settings-form/sections/register-premise-dialog.tsx +3 -3
- package/src/components/entities/settings/company-settings-form.tsx +173 -20
- package/src/components/entities/settings/defaults-settings-form.tsx +38 -1
- package/src/components/entities/settings/tax-rules-settings-form.tsx +1 -2
- package/src/components/estimates/create/create-estimate-form.tsx +107 -8
- package/src/components/estimates/create/locales/de.ts +21 -0
- package/src/components/estimates/create/locales/es.ts +21 -0
- package/src/components/estimates/create/locales/fr.ts +21 -0
- package/src/components/estimates/create/locales/hr.ts +21 -0
- package/src/components/estimates/create/locales/it.ts +21 -0
- package/src/components/estimates/create/locales/nl.ts +21 -0
- package/src/components/estimates/create/locales/pl.ts +21 -0
- package/src/components/estimates/create/locales/pt.ts +21 -0
- package/src/components/estimates/create/locales/sl.ts +22 -1
- package/src/components/estimates/list/list-table.tsx +11 -2
- package/src/components/estimates/list/locales/de.ts +1 -0
- package/src/components/estimates/list/locales/en.ts +1 -0
- package/src/components/estimates/list/locales/es.ts +1 -0
- package/src/components/estimates/list/locales/fr.ts +1 -0
- package/src/components/estimates/list/locales/hr.ts +1 -0
- package/src/components/estimates/list/locales/it.ts +1 -0
- package/src/components/estimates/list/locales/nl.ts +1 -0
- package/src/components/estimates/list/locales/pl.ts +1 -0
- package/src/components/estimates/list/locales/pt.ts +1 -0
- package/src/components/estimates/list/locales/sl.ts +1 -0
- package/src/components/export/document-export-form.tsx +46 -12
- package/src/components/invoices/create/create-invoice-form.tsx +186 -48
- package/src/components/invoices/create/locales/de.ts +28 -0
- package/src/components/invoices/create/locales/es.ts +28 -0
- package/src/components/invoices/create/locales/fr.ts +28 -0
- package/src/components/invoices/create/locales/hr.ts +28 -0
- package/src/components/invoices/create/locales/it.ts +28 -0
- package/src/components/invoices/create/locales/nl.ts +28 -0
- package/src/components/invoices/create/locales/pl.ts +28 -0
- package/src/components/invoices/create/locales/pt.ts +28 -0
- package/src/components/invoices/create/locales/sl.ts +29 -1
- package/src/components/invoices/create/prepare-invoice-submission.ts +5 -5
- package/src/components/invoices/invoices.hooks.ts +2 -2
- package/src/components/invoices/view/fiscalization-status-card.tsx +10 -8
- package/src/components/table/search-input.tsx +17 -0
- package/src/components/table/table-pagination.tsx +1 -1
- package/src/generated/schemas/advanceinvoice.ts +6 -2
- package/src/generated/schemas/creditnote.ts +3 -1
- package/src/generated/schemas/deliverynote.ts +3 -1
- package/src/generated/schemas/entity.ts +4 -4
- package/src/generated/schemas/entityapikey.ts +19 -0
- package/src/generated/schemas/estimate.ts +6 -2
- package/src/generated/schemas/index.ts +1 -0
- package/src/generated/schemas/invoice.ts +4 -1
- package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +17 -23
- package/src/generated/schemas/rendercreditnotepreview_body.ts +17 -23
- package/src/generated/schemas/renderdeliverynotepreview_body.ts +17 -23
- package/src/generated/schemas/renderestimatepreview_body.ts +17 -23
- package/src/generated/schemas/renderinvoicepreview_body.ts +19 -23
- package/src/generated/schemas/startpdfexport_body.ts +14 -2
- package/src/generated/schemas/webhook.ts +4 -0
- package/src/hooks/use-duplicate-document.ts +16 -9
- package/src/hooks/use-vies-check.ts +3 -0
- package/src/lib/template-variables.tsx +167 -0
- package/src/providers/entities-context.tsx +2 -2
|
@@ -39,6 +39,9 @@ export default {
|
|
|
39
39
|
"Insert variable": "Variabele invoegen",
|
|
40
40
|
"Add payment instructions, terms, or other notes...":
|
|
41
41
|
"Voeg betalingsinstructies, voorwaarden of andere notities toe...",
|
|
42
|
+
// Signature field
|
|
43
|
+
Signature: "Handtekening",
|
|
44
|
+
"Add signature text...": "Handtekeningtekst toevoegen...",
|
|
42
45
|
"Payment Terms": "Betalingsvoorwaarden",
|
|
43
46
|
"Add payment terms...": "Voeg betalingsvoorwaarden toe...",
|
|
44
47
|
Entity: "Bedrijf",
|
|
@@ -107,9 +110,34 @@ export default {
|
|
|
107
110
|
"Advance invoice": "Voorschotfactuur",
|
|
108
111
|
"FINA fiscalized invoices always use the current date":
|
|
109
112
|
"FINA-gefiscaliseerde facturen gebruiken altijd de huidige datum",
|
|
113
|
+
// Due days selector
|
|
114
|
+
"On receipt": "Bij ontvangst",
|
|
115
|
+
"7 days": "7 dagen",
|
|
116
|
+
"14 days": "14 dagen",
|
|
117
|
+
"30 days": "30 dagen",
|
|
118
|
+
"60 days": "60 dagen",
|
|
119
|
+
"90 days": "90 dagen",
|
|
120
|
+
Custom: "Aangepast",
|
|
110
121
|
"Service Date": "Servicedatum",
|
|
111
122
|
"Single Date": "Enkele datum",
|
|
112
123
|
"Date Range": "Datumbereik",
|
|
113
124
|
From: "Van",
|
|
114
125
|
To: "Tot",
|
|
126
|
+
// Separator items
|
|
127
|
+
"Add separator": "Scheidingslijn toevoegen",
|
|
128
|
+
"Section header": "Sectiekop",
|
|
129
|
+
"Section title...": "Sectietitel...",
|
|
130
|
+
// Transaction type
|
|
131
|
+
"Transaction type": "Transactietype",
|
|
132
|
+
Domestic: "Binnenland",
|
|
133
|
+
"EU B2B": "EU B2B",
|
|
134
|
+
"EU B2C": "EU B2C",
|
|
135
|
+
Export: "Export",
|
|
136
|
+
"Determining transaction type...": "Transactietype bepalen...",
|
|
137
|
+
"This invoice will not be fiscalized (non-domestic transaction)":
|
|
138
|
+
"Deze factuur wordt niet gefiscaliseerd (niet-binnenlandse transactie)",
|
|
139
|
+
"Tax Clause": "Belastingclausule",
|
|
140
|
+
"Add tax clause...": "Belastingclausule toevoegen...",
|
|
141
|
+
Footer: "Voettekst",
|
|
142
|
+
"Add document footer...": "Documentvoettekst toevoegen...",
|
|
115
143
|
} as const;
|
|
@@ -39,6 +39,9 @@ export default {
|
|
|
39
39
|
Note: "Uwaga",
|
|
40
40
|
"Insert variable": "Wstaw zmienną",
|
|
41
41
|
"Add payment instructions, terms, or other notes...": "Dodaj instrukcje płatności, warunki lub inne uwagi...",
|
|
42
|
+
// Signature field
|
|
43
|
+
Signature: "Podpis",
|
|
44
|
+
"Add signature text...": "Dodaj tekst podpisu...",
|
|
42
45
|
"Payment Terms": "Warunki płatności",
|
|
43
46
|
"Add payment terms...": "Dodaj warunki płatności...",
|
|
44
47
|
Entity: "Firma",
|
|
@@ -106,9 +109,34 @@ export default {
|
|
|
106
109
|
"Credit note": "Nota kredytowa",
|
|
107
110
|
"Advance invoice": "Faktura zaliczkowa",
|
|
108
111
|
"FINA fiscalized invoices always use the current date": "Faktury fiskalizowane FINA zawsze używają bieżącej daty",
|
|
112
|
+
// Due days selector
|
|
113
|
+
"On receipt": "Przy odbiorze",
|
|
114
|
+
"7 days": "7 dni",
|
|
115
|
+
"14 days": "14 dni",
|
|
116
|
+
"30 days": "30 dni",
|
|
117
|
+
"60 days": "60 dni",
|
|
118
|
+
"90 days": "90 dni",
|
|
119
|
+
Custom: "Niestandardowe",
|
|
109
120
|
"Service Date": "Data usługi",
|
|
110
121
|
"Single Date": "Pojedyncza data",
|
|
111
122
|
"Date Range": "Zakres dat",
|
|
112
123
|
From: "Od",
|
|
113
124
|
To: "Do",
|
|
125
|
+
// Separator items
|
|
126
|
+
"Add separator": "Dodaj separator",
|
|
127
|
+
"Section header": "Nagłówek sekcji",
|
|
128
|
+
"Section title...": "Tytuł sekcji...",
|
|
129
|
+
// Transaction type
|
|
130
|
+
"Transaction type": "Typ transakcji",
|
|
131
|
+
Domestic: "Krajowa",
|
|
132
|
+
"EU B2B": "EU B2B",
|
|
133
|
+
"EU B2C": "EU B2C",
|
|
134
|
+
Export: "Eksport",
|
|
135
|
+
"Determining transaction type...": "Określanie typu transakcji...",
|
|
136
|
+
"This invoice will not be fiscalized (non-domestic transaction)":
|
|
137
|
+
"Ta faktura nie będzie fiskalizowana (transakcja niekrajowa)",
|
|
138
|
+
"Tax Clause": "Klauzula podatkowa",
|
|
139
|
+
"Add tax clause...": "Dodaj klauzulę podatkową...",
|
|
140
|
+
Footer: "Stopka",
|
|
141
|
+
"Add document footer...": "Dodaj stopkę dokumentu...",
|
|
114
142
|
} as const;
|
|
@@ -39,6 +39,9 @@ export default {
|
|
|
39
39
|
"Insert variable": "Inserir variável",
|
|
40
40
|
"Add payment instructions, terms, or other notes...":
|
|
41
41
|
"Adicione instruções de pagamento, condições ou outras notas...",
|
|
42
|
+
// Signature field
|
|
43
|
+
Signature: "Assinatura",
|
|
44
|
+
"Add signature text...": "Adicionar texto de assinatura...",
|
|
42
45
|
"Payment Terms": "Condições de pagamento",
|
|
43
46
|
"Add payment terms...": "Adicione condições de pagamento...",
|
|
44
47
|
Entity: "Empresa",
|
|
@@ -107,9 +110,34 @@ export default {
|
|
|
107
110
|
"Credit note": "Nota de crédito",
|
|
108
111
|
"Advance invoice": "Fatura antecipada",
|
|
109
112
|
"FINA fiscalized invoices always use the current date": "As faturas fiscalizadas FINA usam sempre a data atual",
|
|
113
|
+
// Due days selector
|
|
114
|
+
"On receipt": "No recebimento",
|
|
115
|
+
"7 days": "7 dias",
|
|
116
|
+
"14 days": "14 dias",
|
|
117
|
+
"30 days": "30 dias",
|
|
118
|
+
"60 days": "60 dias",
|
|
119
|
+
"90 days": "90 dias",
|
|
120
|
+
Custom: "Personalizado",
|
|
110
121
|
"Service Date": "Data do serviço",
|
|
111
122
|
"Single Date": "Data única",
|
|
112
123
|
"Date Range": "Intervalo de datas",
|
|
113
124
|
From: "De",
|
|
114
125
|
To: "Até",
|
|
126
|
+
// Separator items
|
|
127
|
+
"Add separator": "Adicionar separador",
|
|
128
|
+
"Section header": "Cabeçalho da secção",
|
|
129
|
+
"Section title...": "Título da secção...",
|
|
130
|
+
// Transaction type
|
|
131
|
+
"Transaction type": "Tipo de transação",
|
|
132
|
+
Domestic: "Nacional",
|
|
133
|
+
"EU B2B": "EU B2B",
|
|
134
|
+
"EU B2C": "EU B2C",
|
|
135
|
+
Export: "Exportação",
|
|
136
|
+
"Determining transaction type...": "Determinando tipo de transação...",
|
|
137
|
+
"This invoice will not be fiscalized (non-domestic transaction)":
|
|
138
|
+
"Esta fatura não será fiscalizada (transação não nacional)",
|
|
139
|
+
"Tax Clause": "Cláusula fiscal",
|
|
140
|
+
"Add tax clause...": "Adicionar cláusula fiscal...",
|
|
141
|
+
Footer: "Rodapé",
|
|
142
|
+
"Add document footer...": "Adicionar rodapé do documento...",
|
|
115
143
|
} as const;
|
|
@@ -17,7 +17,7 @@ export default {
|
|
|
17
17
|
Price: "Cena",
|
|
18
18
|
Unit: "Enota",
|
|
19
19
|
Discount: "Popust",
|
|
20
|
-
Tax: "
|
|
20
|
+
Tax: "DDV",
|
|
21
21
|
"Tax rate": "Davčna stopnja",
|
|
22
22
|
"Add tax": "Dodaj davek",
|
|
23
23
|
"Select tax...": "Izberi davek...",
|
|
@@ -39,6 +39,9 @@ export default {
|
|
|
39
39
|
Note: "Opomba",
|
|
40
40
|
"Insert variable": "Vstavi spremenljivko",
|
|
41
41
|
"Add payment instructions, terms, or other notes...": "Dodajte navodila za plačilo, pogoje ali druge opombe...",
|
|
42
|
+
// Signature field
|
|
43
|
+
Signature: "Podpis",
|
|
44
|
+
"Add signature text...": "Dodaj besedilo podpisa...",
|
|
42
45
|
// Payment terms field
|
|
43
46
|
"Payment Terms": "Plačilni pogoji",
|
|
44
47
|
"Add payment terms...": "Dodajte plačilne pogoje...",
|
|
@@ -115,10 +118,35 @@ export default {
|
|
|
115
118
|
"Credit note": "Dobropis",
|
|
116
119
|
"Advance invoice": "Avansni račun",
|
|
117
120
|
"FINA fiscalized invoices always use the current date": "FINA fiskalizirani računi vedno uporabijo trenutni datum",
|
|
121
|
+
// Due days selector
|
|
122
|
+
"On receipt": "Ob prejemu",
|
|
123
|
+
"7 days": "7 dni",
|
|
124
|
+
"14 days": "14 dni",
|
|
125
|
+
"30 days": "30 dni",
|
|
126
|
+
"60 days": "60 dni",
|
|
127
|
+
"90 days": "90 dni",
|
|
128
|
+
Custom: "Po meri",
|
|
118
129
|
// Service date
|
|
119
130
|
"Service Date": "Datum storitve",
|
|
120
131
|
"Single Date": "Datum",
|
|
121
132
|
"Date Range": "Obdobje",
|
|
122
133
|
From: "Od",
|
|
123
134
|
To: "Do",
|
|
135
|
+
// Separator items
|
|
136
|
+
"Add separator": "Dodaj ločilnik",
|
|
137
|
+
"Section header": "Naslov razdelka",
|
|
138
|
+
"Section title...": "Naslov razdelka...",
|
|
139
|
+
// Transaction type
|
|
140
|
+
"Transaction type": "Vrsta transakcije",
|
|
141
|
+
Domestic: "Domača",
|
|
142
|
+
"EU B2B": "EU B2B",
|
|
143
|
+
"EU B2C": "EU B2C",
|
|
144
|
+
Export: "Izvoz",
|
|
145
|
+
"Determining transaction type...": "Določanje vrste transakcije...",
|
|
146
|
+
"This invoice will not be fiscalized (non-domestic transaction)":
|
|
147
|
+
"Ta račun ne bo fiskaliziran (nedomača transakcija)",
|
|
148
|
+
"Tax Clause": "Davčna klavzula",
|
|
149
|
+
"Add tax clause...": "Dodajte davčno klavzulo...",
|
|
150
|
+
Footer: "Noga dokumenta",
|
|
151
|
+
"Add document footer...": "Dodajte nogo dokumenta...",
|
|
124
152
|
} as const;
|
|
@@ -9,8 +9,8 @@ type FursData = {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
type FinaData = {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
business_premise_name?: string;
|
|
13
|
+
electronic_device_name?: string;
|
|
14
14
|
payment_type?: string;
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -77,10 +77,10 @@ export function prepareInvoiceSubmission(values: CreateInvoiceSchema, options: P
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
// Add FINA data if provided (FINA can't be skipped - all invoices must be fiscalized)
|
|
80
|
-
if (options.fina?.
|
|
80
|
+
if (options.fina?.business_premise_name && options.fina.electronic_device_name) {
|
|
81
81
|
(payload as any).fina = {
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
business_premise_name: options.fina.business_premise_name,
|
|
83
|
+
electronic_device_name: options.fina.electronic_device_name,
|
|
84
84
|
...(options.fina.payment_type && { payment_type: options.fina.payment_type }),
|
|
85
85
|
};
|
|
86
86
|
}
|
|
@@ -116,8 +116,8 @@ export function setLastUsedFursCombo(entityId: string, combo: FursCombo): void {
|
|
|
116
116
|
const FINA_LAST_USED_KEY = "hr:fina:last-used";
|
|
117
117
|
|
|
118
118
|
export type FinaCombo = {
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
business_premise_name: string;
|
|
120
|
+
electronic_device_name: string;
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
export function getLastUsedFinaCombo(entityId: string): FinaCombo | null {
|
|
@@ -91,10 +91,16 @@ export function FiscalizationStatusCard({
|
|
|
91
91
|
|
|
92
92
|
const bodyContent = (
|
|
93
93
|
<>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
{fiscalizationData.status === "skipped" ? (
|
|
95
|
+
<div className="text-muted-foreground text-sm">
|
|
96
|
+
{label} · {t("Skipped by user")}
|
|
97
|
+
</div>
|
|
98
|
+
) : (
|
|
99
|
+
<div className="text-muted-foreground text-sm">
|
|
100
|
+
{label} ·{" "}
|
|
101
|
+
{fiscalizationData.fiscalized_at && new Date(fiscalizationData.fiscalized_at).toLocaleString(locale)}
|
|
102
|
+
</div>
|
|
103
|
+
)}
|
|
98
104
|
|
|
99
105
|
{fiscalizationData.status === "failed" && fiscalizationData.error && (
|
|
100
106
|
<Alert variant="destructive">
|
|
@@ -103,10 +109,6 @@ export function FiscalizationStatusCard({
|
|
|
103
109
|
</Alert>
|
|
104
110
|
)}
|
|
105
111
|
|
|
106
|
-
{fiscalizationData.status === "skipped" && (fiscalizationData as any).data?.reason && (
|
|
107
|
-
<div className="text-muted-foreground text-sm">{(fiscalizationData as any).data.reason}</div>
|
|
108
|
-
)}
|
|
109
|
-
|
|
110
112
|
{fiscalizationData.status === "failed" && onRetry && (
|
|
111
113
|
<Button variant="outline" size="sm" onClick={onRetry} disabled={isRetrying}>
|
|
112
114
|
{isRetrying ? <Loader2 className="mr-2 h-4 w-4 animate-spin" /> : <RefreshCw className="mr-2 h-4 w-4" />}
|
|
@@ -16,6 +16,7 @@ type SearchInputProps = {
|
|
|
16
16
|
*/
|
|
17
17
|
export function SearchInput({ initialValue = "", onSearch, placeholder = "Search...", debounceMs }: SearchInputProps) {
|
|
18
18
|
const [value, setValue] = useState(initialValue);
|
|
19
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
19
20
|
|
|
20
21
|
// Use ref to keep onSearch stable in useEffect
|
|
21
22
|
const onSearchRef = useRef(onSearch);
|
|
@@ -56,6 +57,9 @@ export function SearchInput({ initialValue = "", onSearch, placeholder = "Search
|
|
|
56
57
|
onSearchRef.current(null);
|
|
57
58
|
}, []);
|
|
58
59
|
|
|
60
|
+
// Show "Enter ↵" hint when input requires Enter to search (no debounce) and user is typing
|
|
61
|
+
const showEnterHint = debounceMs === undefined && value && isFocused;
|
|
62
|
+
|
|
59
63
|
return (
|
|
60
64
|
<form onSubmit={handleSubmit} className="relative inline-block" data-testid="search-form">
|
|
61
65
|
<Search className="pointer-events-none absolute top-1/2 left-2.5 z-10 h-3 w-3 -translate-y-1/2 text-muted-foreground" />
|
|
@@ -66,8 +70,21 @@ export function SearchInput({ initialValue = "", onSearch, placeholder = "Search
|
|
|
66
70
|
placeholder={placeholder}
|
|
67
71
|
value={value}
|
|
68
72
|
onChange={handleChange}
|
|
73
|
+
onFocus={() => setIsFocused(true)}
|
|
74
|
+
onBlur={() => setIsFocused(false)}
|
|
69
75
|
className="h-8 w-[150px] pr-8 pl-8 lg:w-[250px] [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden"
|
|
70
76
|
/>
|
|
77
|
+
{/* Overlay that mirrors input padding to position hint right after typed text */}
|
|
78
|
+
{showEnterHint && (
|
|
79
|
+
<span
|
|
80
|
+
aria-hidden="true"
|
|
81
|
+
className="pointer-events-none absolute inset-0 flex items-center overflow-hidden pl-8 text-sm"
|
|
82
|
+
>
|
|
83
|
+
{/* Invisible text matching input value to push hint to the right */}
|
|
84
|
+
<span className="invisible whitespace-pre">{value}</span>
|
|
85
|
+
<span className="ml-1.5 shrink-0 text-muted-foreground/50 text-xs">Enter ↵</span>
|
|
86
|
+
</span>
|
|
87
|
+
)}
|
|
71
88
|
{value && (
|
|
72
89
|
<Button
|
|
73
90
|
type="button"
|
|
@@ -16,7 +16,7 @@ export function Pagination({ prevCursor, nextCursor, onPageChange }: PaginationP
|
|
|
16
16
|
const hasNext = Boolean(nextCursor);
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
|
-
<div className="flex items-center justify-
|
|
19
|
+
<div className="flex items-center justify-start space-x-2">
|
|
20
20
|
<Button
|
|
21
21
|
variant="outline"
|
|
22
22
|
size="sm"
|
|
@@ -96,6 +96,7 @@ const createAdvanceInvoiceSchemaDefinition = z.object({
|
|
|
96
96
|
).optional(),
|
|
97
97
|
note: z.union([z.string(), z.null()]).optional(),
|
|
98
98
|
tax_clause: z.union([z.string(), z.null()]).optional(),
|
|
99
|
+
footer: z.union([z.string(), z.null()]).optional(),
|
|
99
100
|
currency_code: z.string().max(3).optional(),
|
|
100
101
|
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
101
102
|
date_due: z.union([z.string(), z.null()]).optional(),
|
|
@@ -104,11 +105,12 @@ const createAdvanceInvoiceSchemaDefinition = z.object({
|
|
|
104
105
|
items: z
|
|
105
106
|
.array(
|
|
106
107
|
z.object({
|
|
108
|
+
type: z.enum(["separator"]).optional(),
|
|
107
109
|
name: z.string().min(1).optional(),
|
|
108
110
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
109
111
|
price: z.number().optional(),
|
|
110
112
|
gross_price: z.number().optional(),
|
|
111
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
113
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
112
114
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
113
115
|
taxes: z.array(DocumentItemTax).optional(),
|
|
114
116
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
@@ -202,11 +204,12 @@ const updateAdvanceInvoiceSchemaDefinition = z
|
|
|
202
204
|
items: z
|
|
203
205
|
.array(
|
|
204
206
|
z.object({
|
|
207
|
+
type: z.enum(["separator"]).optional(),
|
|
205
208
|
name: z.string().min(1).optional(),
|
|
206
209
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
207
210
|
price: z.number().optional(),
|
|
208
211
|
gross_price: z.number().optional(),
|
|
209
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
212
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
210
213
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
211
214
|
taxes: z.array(DocumentItemTax).optional(),
|
|
212
215
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
@@ -226,6 +229,7 @@ const updateAdvanceInvoiceSchemaDefinition = z
|
|
|
226
229
|
)
|
|
227
230
|
.min(1),
|
|
228
231
|
note: z.union([z.string(), z.null()]),
|
|
232
|
+
footer: z.union([z.string(), z.null()]),
|
|
229
233
|
currency_code: z.string(),
|
|
230
234
|
metadata: z.union([z.object({}).partial().passthrough(), z.null()]),
|
|
231
235
|
change_reason: z.string().max(500),
|
|
@@ -85,11 +85,12 @@ const updateCreditNoteSchemaDefinition = z
|
|
|
85
85
|
items: z
|
|
86
86
|
.array(
|
|
87
87
|
z.object({
|
|
88
|
+
type: z.enum(["separator"]).optional(),
|
|
88
89
|
name: z.string().min(1).optional(),
|
|
89
90
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
90
91
|
price: z.number().optional(),
|
|
91
92
|
gross_price: z.number().optional(),
|
|
92
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
93
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
93
94
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
94
95
|
taxes: z.array(DocumentItemTax).optional(),
|
|
95
96
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
@@ -109,6 +110,7 @@ const updateCreditNoteSchemaDefinition = z
|
|
|
109
110
|
)
|
|
110
111
|
.min(1),
|
|
111
112
|
note: z.union([z.string(), z.null()]),
|
|
113
|
+
footer: z.union([z.string(), z.null()]),
|
|
112
114
|
payment_terms: z.union([z.string(), z.null()]),
|
|
113
115
|
currency_code: z.string(),
|
|
114
116
|
metadata: z.union([z.object({}).partial().passthrough(), z.null()]),
|
|
@@ -84,6 +84,7 @@ const createDeliveryNoteSchemaDefinition = z.object({
|
|
|
84
84
|
note: z.union([z.string(), z.null()]).optional(),
|
|
85
85
|
payment_terms: z.union([z.string(), z.null()]).optional(),
|
|
86
86
|
tax_clause: z.union([z.string(), z.null()]).optional(),
|
|
87
|
+
footer: z.union([z.string(), z.null()]).optional(),
|
|
87
88
|
currency_code: z.string().max(3).optional(),
|
|
88
89
|
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
89
90
|
hide_prices: z.boolean().optional(),
|
|
@@ -93,11 +94,12 @@ const createDeliveryNoteSchemaDefinition = z.object({
|
|
|
93
94
|
items: z
|
|
94
95
|
.array(
|
|
95
96
|
z.object({
|
|
97
|
+
type: z.enum(["separator"]).optional(),
|
|
96
98
|
name: z.string().min(1).optional(),
|
|
97
99
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
98
100
|
price: z.number().optional(),
|
|
99
101
|
gross_price: z.number().optional(),
|
|
100
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
102
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
101
103
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
102
104
|
taxes: z.array(DocumentItemTax).optional(),
|
|
103
105
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
@@ -30,7 +30,7 @@ const createEntitySchemaDefinition = z.object({
|
|
|
30
30
|
settings: z
|
|
31
31
|
.object({
|
|
32
32
|
pdf_template: z.union([
|
|
33
|
-
z.enum(["modern", "classic", "minimal", "fashion"]),
|
|
33
|
+
z.enum(["modern", "classic", "condensed", "minimal", "fashion"]),
|
|
34
34
|
z.null(),
|
|
35
35
|
]),
|
|
36
36
|
number_formats: z.union([
|
|
@@ -90,7 +90,7 @@ const createEntitySchemaDefinition = z.object({
|
|
|
90
90
|
operator_oib: z.string().min(11).max(11),
|
|
91
91
|
operator_label: z.string(),
|
|
92
92
|
u_sust_pdv: z.boolean().default(true),
|
|
93
|
-
numbering_sequence: z.enum(["N", "P"]).default("
|
|
93
|
+
numbering_sequence: z.enum(["N", "P"]).default("P"),
|
|
94
94
|
certificate_expiry: z.string(),
|
|
95
95
|
})
|
|
96
96
|
.partial()
|
|
@@ -181,7 +181,7 @@ const patchEntitySchemaDefinition = z
|
|
|
181
181
|
settings: z
|
|
182
182
|
.object({
|
|
183
183
|
pdf_template: z.union([
|
|
184
|
-
z.enum(["modern", "classic", "minimal", "fashion"]),
|
|
184
|
+
z.enum(["modern", "classic", "condensed", "minimal", "fashion"]),
|
|
185
185
|
z.null(),
|
|
186
186
|
]),
|
|
187
187
|
number_formats: z.union([
|
|
@@ -241,7 +241,7 @@ const patchEntitySchemaDefinition = z
|
|
|
241
241
|
operator_oib: z.string().min(11).max(11),
|
|
242
242
|
operator_label: z.string(),
|
|
243
243
|
u_sust_pdv: z.boolean().default(true),
|
|
244
|
-
numbering_sequence: z.enum(["N", "P"]).default("
|
|
244
|
+
numbering_sequence: z.enum(["N", "P"]).default("P"),
|
|
245
245
|
certificate_expiry: z.string(),
|
|
246
246
|
})
|
|
247
247
|
.partial()
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated using 'bun generate-schemas'.
|
|
3
|
+
* Do not edit this file manually. To update, run the generator again.
|
|
4
|
+
* @generated
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
// Schemas for entityapikey endpoints
|
|
10
|
+
|
|
11
|
+
// Schema for create entityapikey operation
|
|
12
|
+
const createEntityApiKeySchemaDefinition = z
|
|
13
|
+
.object({ name: z.string().max(255), ttl: z.number().int().gte(60) })
|
|
14
|
+
.partial();
|
|
15
|
+
|
|
16
|
+
// Type for create entityapikey operation
|
|
17
|
+
export type CreateEntityApiKeySchema = z.infer<typeof createEntityApiKeySchemaDefinition>;
|
|
18
|
+
|
|
19
|
+
export const createEntityApiKeySchema = createEntityApiKeySchemaDefinition;
|
|
@@ -86,6 +86,7 @@ const createEstimateSchemaDefinition = z.object({
|
|
|
86
86
|
note: z.union([z.string(), z.null()]).optional(),
|
|
87
87
|
payment_terms: z.union([z.string(), z.null()]).optional(),
|
|
88
88
|
tax_clause: z.union([z.string(), z.null()]).optional(),
|
|
89
|
+
footer: z.union([z.string(), z.null()]).optional(),
|
|
89
90
|
currency_code: z.string().max(3).optional(),
|
|
90
91
|
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
91
92
|
date_valid_till: z.union([z.string(), z.null()]).optional(),
|
|
@@ -96,11 +97,12 @@ const createEstimateSchemaDefinition = z.object({
|
|
|
96
97
|
items: z
|
|
97
98
|
.array(
|
|
98
99
|
z.object({
|
|
100
|
+
type: z.enum(["separator"]).optional(),
|
|
99
101
|
name: z.string().min(1).optional(),
|
|
100
102
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
101
103
|
price: z.number().optional(),
|
|
102
104
|
gross_price: z.number().optional(),
|
|
103
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
105
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
104
106
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
105
107
|
taxes: z.array(DocumentItemTax).optional(),
|
|
106
108
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
@@ -155,11 +157,12 @@ const updateEstimateSchemaDefinition = z
|
|
|
155
157
|
items: z
|
|
156
158
|
.array(
|
|
157
159
|
z.object({
|
|
160
|
+
type: z.enum(["separator"]).optional(),
|
|
158
161
|
name: z.string().min(1).optional(),
|
|
159
162
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
160
163
|
price: z.number().optional(),
|
|
161
164
|
gross_price: z.number().optional(),
|
|
162
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
165
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
163
166
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
164
167
|
taxes: z.array(DocumentItemTax).optional(),
|
|
165
168
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
@@ -179,6 +182,7 @@ const updateEstimateSchemaDefinition = z
|
|
|
179
182
|
)
|
|
180
183
|
.min(1),
|
|
181
184
|
note: z.union([z.string(), z.null()]),
|
|
185
|
+
footer: z.union([z.string(), z.null()]),
|
|
182
186
|
payment_terms: z.union([z.string(), z.null()]),
|
|
183
187
|
currency_code: z.string(),
|
|
184
188
|
metadata: z.union([z.object({}).partial().passthrough(), z.null()]),
|
|
@@ -16,6 +16,7 @@ export * from './customestimate';
|
|
|
16
16
|
export * from './custominvoice';
|
|
17
17
|
export * from './deliverynote';
|
|
18
18
|
export * from './entity';
|
|
19
|
+
export * from './entityapikey';
|
|
19
20
|
export * from './entityuserrole';
|
|
20
21
|
export * from './estimate';
|
|
21
22
|
export * from './finasettings';
|
|
@@ -97,6 +97,7 @@ const createInvoiceSchemaDefinition = z.object({
|
|
|
97
97
|
note: z.union([z.string(), z.null()]).optional(),
|
|
98
98
|
payment_terms: z.union([z.string(), z.null()]).optional(),
|
|
99
99
|
tax_clause: z.union([z.string(), z.null()]).optional(),
|
|
100
|
+
footer: z.union([z.string(), z.null()]).optional(),
|
|
100
101
|
currency_code: z.string().max(3).optional(),
|
|
101
102
|
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
102
103
|
date_due: z.union([z.string(), z.null()]).optional(),
|
|
@@ -105,11 +106,12 @@ const createInvoiceSchemaDefinition = z.object({
|
|
|
105
106
|
items: z
|
|
106
107
|
.array(
|
|
107
108
|
z.object({
|
|
109
|
+
type: z.enum(["separator"]).optional(),
|
|
108
110
|
name: z.string().min(1).optional(),
|
|
109
111
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
110
112
|
price: z.number().optional(),
|
|
111
113
|
gross_price: z.number().optional(),
|
|
112
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
114
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
113
115
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
114
116
|
taxes: z.array(DocumentItemTax).optional(),
|
|
115
117
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
@@ -236,6 +238,7 @@ const updateInvoiceSchemaDefinition = z
|
|
|
236
238
|
)
|
|
237
239
|
.min(1),
|
|
238
240
|
note: z.union([z.string(), z.null()]),
|
|
241
|
+
footer: z.union([z.string(), z.null()]),
|
|
239
242
|
payment_terms: z.union([z.string(), z.null()]),
|
|
240
243
|
currency_code: z.string(),
|
|
241
244
|
metadata: z.union([z.object({}).partial().passthrough(), z.null()]),
|
|
@@ -112,6 +112,7 @@ const PartialAdvanceInvoicePreview = z.object({
|
|
|
112
112
|
.array(
|
|
113
113
|
z
|
|
114
114
|
.object({
|
|
115
|
+
type: z.literal("separator"),
|
|
115
116
|
name: z.string(),
|
|
116
117
|
quantity: z.number(),
|
|
117
118
|
price: z.number(),
|
|
@@ -154,29 +155,22 @@ const LineDiscount = z.object({
|
|
|
154
155
|
|
|
155
156
|
|
|
156
157
|
// Dependency schema for renderadvanceinvoicepreview_body
|
|
157
|
-
const CreateDocumentItem = z
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
z.object({}).partial().passthrough(),
|
|
174
|
-
z.array(z.unknown()),
|
|
175
|
-
z.null(),
|
|
176
|
-
])
|
|
177
|
-
.optional(),
|
|
178
|
-
item_id: z.string().optional(),
|
|
179
|
-
});
|
|
158
|
+
const CreateDocumentItem = z
|
|
159
|
+
.object({
|
|
160
|
+
type: z.literal("separator"),
|
|
161
|
+
name: z.string().min(1),
|
|
162
|
+
description: z.union([z.string(), z.null()]),
|
|
163
|
+
price: z.number(),
|
|
164
|
+
gross_price: z.number(),
|
|
165
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
166
|
+
unit: z.union([z.string(), z.null()]),
|
|
167
|
+
taxes: z.array(DocumentItemTax),
|
|
168
|
+
discounts: z.array(LineDiscount).max(5),
|
|
169
|
+
item_id: z.string(),
|
|
170
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]),
|
|
171
|
+
save_item: z.boolean().default(true),
|
|
172
|
+
})
|
|
173
|
+
.partial();
|
|
180
174
|
|
|
181
175
|
|
|
182
176
|
// Dependency schema for renderadvanceinvoicepreview_body
|
|
@@ -113,6 +113,7 @@ const PartialCreditNotePreview = z.object({
|
|
|
113
113
|
.array(
|
|
114
114
|
z
|
|
115
115
|
.object({
|
|
116
|
+
type: z.literal("separator"),
|
|
116
117
|
name: z.string(),
|
|
117
118
|
quantity: z.number(),
|
|
118
119
|
price: z.number(),
|
|
@@ -155,29 +156,22 @@ const LineDiscount = z.object({
|
|
|
155
156
|
|
|
156
157
|
|
|
157
158
|
// Dependency schema for rendercreditnotepreview_body
|
|
158
|
-
const CreateDocumentItem = z
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
z.object({}).partial().passthrough(),
|
|
175
|
-
z.array(z.unknown()),
|
|
176
|
-
z.null(),
|
|
177
|
-
])
|
|
178
|
-
.optional(),
|
|
179
|
-
item_id: z.string().optional(),
|
|
180
|
-
});
|
|
159
|
+
const CreateDocumentItem = z
|
|
160
|
+
.object({
|
|
161
|
+
type: z.literal("separator"),
|
|
162
|
+
name: z.string().min(1),
|
|
163
|
+
description: z.union([z.string(), z.null()]),
|
|
164
|
+
price: z.number(),
|
|
165
|
+
gross_price: z.number(),
|
|
166
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
167
|
+
unit: z.union([z.string(), z.null()]),
|
|
168
|
+
taxes: z.array(DocumentItemTax),
|
|
169
|
+
discounts: z.array(LineDiscount).max(5),
|
|
170
|
+
item_id: z.string(),
|
|
171
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]),
|
|
172
|
+
save_item: z.boolean().default(true),
|
|
173
|
+
})
|
|
174
|
+
.partial();
|
|
181
175
|
|
|
182
176
|
|
|
183
177
|
// Dependency schema for rendercreditnotepreview_body
|