@spaceinvoices/react-ui 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/common/autocomplete.tsx +18 -2
- package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +61 -12
- package/src/components/advance-invoices/create/locales/de.ts +17 -0
- package/src/components/advance-invoices/create/locales/es.ts +17 -0
- package/src/components/advance-invoices/create/locales/fr.ts +17 -0
- package/src/components/advance-invoices/create/locales/hr.ts +16 -0
- package/src/components/advance-invoices/create/locales/it.ts +17 -0
- package/src/components/advance-invoices/create/locales/nl.ts +17 -0
- package/src/components/advance-invoices/create/locales/pl.ts +16 -0
- package/src/components/advance-invoices/create/locales/pt.ts +16 -0
- package/src/components/advance-invoices/create/locales/sl.ts +16 -0
- package/src/components/advance-invoices/create/prepare-advance-invoice-submission.ts +0 -1
- package/src/components/advance-invoices/list/list-row-actions.tsx +48 -1
- package/src/components/advance-invoices/list/list-table.tsx +100 -50
- package/src/components/advance-invoices/list/locales/de.ts +9 -0
- package/src/components/advance-invoices/list/locales/en.ts +7 -0
- package/src/components/advance-invoices/list/locales/es.ts +9 -0
- package/src/components/advance-invoices/list/locales/fr.ts +9 -0
- package/src/components/advance-invoices/list/locales/hr.ts +8 -0
- package/src/components/advance-invoices/list/locales/it.ts +9 -0
- package/src/components/advance-invoices/list/locales/nl.ts +9 -0
- package/src/components/advance-invoices/list/locales/pl.ts +8 -0
- package/src/components/advance-invoices/list/locales/pt.ts +9 -0
- package/src/components/advance-invoices/list/locales/sl.ts +8 -0
- package/src/components/credit-notes/create/create-credit-note-form.tsx +185 -11
- package/src/components/credit-notes/create/locales/de.ts +18 -0
- package/src/components/credit-notes/create/locales/es.ts +18 -0
- package/src/components/credit-notes/create/locales/fr.ts +18 -0
- package/src/components/credit-notes/create/locales/hr.ts +17 -0
- package/src/components/credit-notes/create/locales/it.ts +18 -0
- package/src/components/credit-notes/create/locales/nl.ts +18 -0
- package/src/components/credit-notes/create/locales/pl.ts +17 -0
- package/src/components/credit-notes/create/locales/pt.ts +17 -0
- package/src/components/credit-notes/create/locales/sl.ts +18 -1
- package/src/components/credit-notes/credit-notes.hooks.ts +30 -0
- package/src/components/credit-notes/list/list-row-actions.tsx +44 -1
- package/src/components/credit-notes/list/list-table.tsx +93 -32
- package/src/components/credit-notes/list/locales/de.ts +7 -0
- package/src/components/credit-notes/list/locales/en.ts +6 -0
- package/src/components/credit-notes/list/locales/es.ts +7 -0
- package/src/components/credit-notes/list/locales/fr.ts +7 -0
- package/src/components/credit-notes/list/locales/hr.ts +7 -0
- package/src/components/credit-notes/list/locales/it.ts +7 -0
- package/src/components/credit-notes/list/locales/nl.ts +7 -0
- package/src/components/credit-notes/list/locales/pl.ts +7 -0
- package/src/components/credit-notes/list/locales/pt.ts +7 -0
- package/src/components/credit-notes/list/locales/sl.ts +7 -0
- package/src/components/customers/customer-list-table/customer-list-table.tsx +0 -3
- package/src/components/customers/customer-list-table/locales/de.ts +1 -0
- package/src/components/customers/customer-list-table/locales/es.ts +1 -0
- package/src/components/customers/customer-list-table/locales/fr.ts +1 -0
- package/src/components/customers/customer-list-table/locales/hr.ts +1 -0
- package/src/components/customers/customer-list-table/locales/it.ts +1 -0
- package/src/components/customers/customer-list-table/locales/nl.ts +1 -0
- package/src/components/customers/customer-list-table/locales/pl.ts +1 -0
- package/src/components/customers/customer-list-table/locales/pt.ts +1 -0
- package/src/components/customers/customer-list-table/locales/sl.ts +1 -0
- package/src/components/dashboard/collection-rate-card/use-collection-rate.ts +48 -9
- package/src/components/dashboard/revenue-trend-chart/use-revenue-trend.ts +77 -48
- package/src/components/dashboard/shared/use-revenue-data.ts +77 -9
- package/src/components/delivery-notes/create/create-delivery-note-form.tsx +67 -7
- package/src/components/delivery-notes/create/locales/de.ts +16 -0
- package/src/components/delivery-notes/create/locales/es.ts +16 -0
- package/src/components/delivery-notes/create/locales/fr.ts +16 -0
- package/src/components/delivery-notes/create/locales/hr.ts +16 -0
- package/src/components/delivery-notes/create/locales/it.ts +16 -0
- package/src/components/delivery-notes/create/locales/nl.ts +16 -0
- package/src/components/delivery-notes/create/locales/pl.ts +16 -0
- package/src/components/delivery-notes/create/locales/pt.ts +16 -0
- package/src/components/delivery-notes/create/locales/sl.ts +17 -1
- package/src/components/delivery-notes/list/list-row-actions.tsx +20 -1
- package/src/components/delivery-notes/list/list-table.tsx +50 -8
- package/src/components/delivery-notes/list/locales/de.ts +35 -0
- package/src/components/delivery-notes/list/locales/en.ts +33 -0
- package/src/components/delivery-notes/list/locales/es.ts +35 -0
- package/src/components/delivery-notes/list/locales/fr.ts +35 -0
- package/src/components/delivery-notes/list/locales/hr.ts +35 -0
- package/src/components/delivery-notes/list/locales/it.ts +35 -0
- package/src/components/delivery-notes/list/locales/nl.ts +35 -0
- package/src/components/delivery-notes/list/locales/pl.ts +35 -0
- package/src/components/delivery-notes/list/locales/pt.ts +35 -0
- package/src/components/delivery-notes/list/locales/sl.ts +35 -0
- package/src/components/documents/create/document-add-item-form.tsx +70 -0
- package/src/components/documents/create/document-details-section.tsx +163 -29
- package/src/components/documents/create/document-items-section.tsx +21 -4
- package/src/components/documents/create/linked-documents-info.tsx +82 -0
- package/src/components/documents/create/live-preview.tsx +25 -5
- package/src/components/documents/create/mark-as-paid-section.tsx +29 -20
- package/src/components/documents/create/prepare-document-submission.ts +19 -7
- package/src/components/documents/shared/document-preview-display.tsx +3 -4
- package/src/components/documents/types.ts +2 -2
- package/src/components/documents/view/document-actions-bar.tsx +7 -27
- package/src/components/documents/view/document-activities-list.tsx +65 -47
- package/src/components/documents/view/document-details-card.tsx +118 -76
- package/src/components/documents/view/document-payments-list.tsx +99 -65
- package/src/components/documents/view/document-relations-list.tsx +43 -28
- package/src/components/documents/view/document-sidebar.tsx +151 -0
- package/src/components/documents/view/index.ts +2 -0
- package/src/components/documents/view/locales/de.ts +4 -0
- package/src/components/documents/view/locales/es.ts +4 -0
- package/src/components/documents/view/locales/fr.ts +4 -0
- package/src/components/documents/view/locales/hr.ts +4 -0
- package/src/components/documents/view/locales/it.ts +4 -0
- package/src/components/documents/view/locales/nl.ts +4 -0
- package/src/components/documents/view/locales/pl.ts +4 -0
- package/src/components/documents/view/locales/pt.ts +4 -0
- package/src/components/documents/view/locales/sl.ts +5 -1
- package/src/components/documents/view/use-document-download.ts +7 -3
- package/src/components/entities/create-entity-form.tsx +166 -13
- package/src/components/entities/entity-settings-form/entity-settings-form.tsx +101 -1
- package/src/components/entities/entity-settings-form/input-with-preview.tsx +30 -2
- package/src/components/entities/entity-settings-form/locales/de.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/es.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/fr.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/hr.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/it.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/nl.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/pl.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/pt.ts +10 -0
- package/src/components/entities/entity-settings-form/locales/sl.ts +10 -0
- package/src/components/entities/fina-settings-form/fina-settings-form.tsx +6 -6
- package/src/components/entities/fina-settings-form/locales/de.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/en.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/es.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/fr.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/hr.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/it.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/nl.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/pl.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/pt.ts +2 -2
- package/src/components/entities/fina-settings-form/locales/sl.ts +2 -2
- package/src/components/entities/furs-settings-form/locales/en.ts +0 -1
- package/src/components/entities/settings/company-settings-form.tsx +173 -20
- package/src/components/entities/settings/pdf-template-selector/locales/de.ts +3 -1
- package/src/components/entities/settings/pdf-template-selector/locales/es.ts +3 -1
- package/src/components/entities/settings/pdf-template-selector/locales/fr.ts +4 -1
- package/src/components/entities/settings/pdf-template-selector/locales/hr.ts +4 -1
- package/src/components/entities/settings/pdf-template-selector/locales/it.ts +3 -1
- package/src/components/entities/settings/pdf-template-selector/locales/nl.ts +3 -1
- package/src/components/entities/settings/pdf-template-selector/locales/pl.ts +3 -1
- package/src/components/entities/settings/pdf-template-selector/locales/pt.ts +3 -1
- package/src/components/entities/settings/pdf-template-selector/locales/sl.ts +3 -1
- package/src/components/entities/settings/pdf-template-selector/pdf-template-cards.tsx +1 -0
- package/src/components/estimates/create/create-estimate-form.tsx +93 -8
- package/src/components/estimates/create/locales/de.ts +16 -0
- package/src/components/estimates/create/locales/es.ts +16 -0
- package/src/components/estimates/create/locales/fr.ts +16 -0
- package/src/components/estimates/create/locales/hr.ts +16 -0
- package/src/components/estimates/create/locales/it.ts +16 -0
- package/src/components/estimates/create/locales/nl.ts +16 -0
- package/src/components/estimates/create/locales/pl.ts +16 -0
- package/src/components/estimates/create/locales/pt.ts +16 -0
- package/src/components/estimates/create/locales/sl.ts +17 -1
- package/src/components/estimates/list/list-table.tsx +14 -8
- package/src/components/estimates/list/locales/de.ts +2 -0
- package/src/components/estimates/list/locales/en.ts +1 -0
- package/src/components/estimates/list/locales/es.ts +2 -0
- package/src/components/estimates/list/locales/fr.ts +2 -0
- package/src/components/estimates/list/locales/hr.ts +2 -0
- package/src/components/estimates/list/locales/it.ts +2 -0
- package/src/components/estimates/list/locales/nl.ts +2 -0
- package/src/components/estimates/list/locales/pl.ts +2 -0
- package/src/components/estimates/list/locales/pt.ts +2 -0
- package/src/components/estimates/list/locales/sl.ts +2 -0
- package/src/components/export/document-export-form.tsx +55 -14
- package/src/components/export/index.ts +2 -0
- package/src/components/export/sales-per-item-export-form.tsx +223 -0
- package/src/components/invoices/create/create-invoice-form.tsx +106 -11
- package/src/components/invoices/create/locales/de.ts +26 -0
- package/src/components/invoices/create/locales/es.ts +26 -0
- package/src/components/invoices/create/locales/fr.ts +26 -0
- package/src/components/invoices/create/locales/hr.ts +25 -0
- package/src/components/invoices/create/locales/it.ts +26 -0
- package/src/components/invoices/create/locales/nl.ts +26 -0
- package/src/components/invoices/create/locales/pl.ts +25 -0
- package/src/components/invoices/create/locales/pt.ts +25 -0
- package/src/components/invoices/create/locales/sl.ts +26 -1
- package/src/components/invoices/invoices-furs.hooks.ts +4 -1
- package/src/components/invoices/list/list-table.tsx +77 -31
- package/src/components/invoices/list/locales/de.ts +5 -0
- package/src/components/invoices/list/locales/en.ts +4 -0
- package/src/components/invoices/list/locales/es.ts +5 -0
- package/src/components/invoices/list/locales/fr.ts +5 -0
- package/src/components/invoices/list/locales/hr.ts +5 -0
- package/src/components/invoices/list/locales/it.ts +5 -0
- package/src/components/invoices/list/locales/nl.ts +5 -0
- package/src/components/invoices/list/locales/pl.ts +5 -0
- package/src/components/invoices/list/locales/pt.ts +5 -0
- package/src/components/invoices/list/locales/sl.ts +5 -0
- package/src/components/invoices/view/fiscalization-status-card.tsx +44 -24
- package/src/components/items/item-combobox.tsx +5 -3
- package/src/components/items/item-list-table/item-list-header.tsx +4 -17
- package/src/components/items/item-list-table/item-list-table.tsx +3 -3
- package/src/components/items/item-list-table/locales/de.ts +1 -0
- package/src/components/items/item-list-table/locales/es.ts +1 -0
- package/src/components/items/item-list-table/locales/fr.ts +1 -0
- package/src/components/items/item-list-table/locales/hr.ts +1 -0
- package/src/components/items/item-list-table/locales/it.ts +1 -0
- package/src/components/items/item-list-table/locales/nl.ts +1 -0
- package/src/components/items/item-list-table/locales/pl.ts +1 -0
- package/src/components/items/item-list-table/locales/pt.ts +1 -0
- package/src/components/items/item-list-table/locales/sl.ts +1 -0
- package/src/components/payments/list/list-table.tsx +0 -4
- package/src/components/payments/list/locales/de.ts +1 -0
- package/src/components/payments/list/locales/es.ts +1 -0
- package/src/components/payments/list/locales/fr.ts +1 -0
- package/src/components/payments/list/locales/hr.ts +1 -0
- package/src/components/payments/list/locales/it.ts +1 -0
- package/src/components/payments/list/locales/nl.ts +1 -0
- package/src/components/payments/list/locales/pl.ts +1 -0
- package/src/components/payments/list/locales/pt.ts +1 -0
- package/src/components/payments/list/locales/sl.ts +1 -0
- package/src/components/recurring-invoices/list/list-table.tsx +0 -7
- package/src/components/recurring-invoices/list/locales/de.ts +1 -0
- package/src/components/recurring-invoices/list/locales/es.ts +1 -0
- package/src/components/recurring-invoices/list/locales/fr.ts +1 -0
- package/src/components/recurring-invoices/list/locales/hr.ts +1 -0
- package/src/components/recurring-invoices/list/locales/it.ts +1 -0
- package/src/components/recurring-invoices/list/locales/nl.ts +1 -0
- package/src/components/recurring-invoices/list/locales/pl.ts +1 -0
- package/src/components/recurring-invoices/list/locales/pt.ts +1 -0
- package/src/components/recurring-invoices/list/locales/sl.ts +1 -0
- package/src/components/request-logs/request-log-list-table.tsx +0 -3
- package/src/components/table/README.md +14 -121
- package/src/components/table/data-table.tsx +22 -37
- package/src/components/table/hooks/use-table-state.ts +3 -27
- package/src/components/table/index.ts +0 -2
- package/src/components/table/search-input.tsx +17 -0
- package/src/components/table/selection-toolbar.tsx +35 -1
- package/src/components/table/table-empty-state.tsx +6 -3
- package/src/components/table/table-no-results.tsx +10 -5
- package/src/components/table/types.ts +0 -5
- package/src/components/taxes/tax-list-table/locales/de.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/es.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/fr.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/hr.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/it.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/nl.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/pl.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/pt.ts +1 -0
- package/src/components/taxes/tax-list-table/locales/sl.ts +1 -0
- package/src/components/taxes/tax-list-table/tax-list-header.tsx +3 -14
- package/src/components/taxes/tax-list-table/tax-list-table.tsx +3 -3
- package/src/components/ui/popover.tsx +3 -1
- package/src/components/ui/tooltip.tsx +3 -1
- package/src/generated/schemas/advanceinvoice.ts +4 -2
- package/src/generated/schemas/creditnote.ts +2 -1
- package/src/generated/schemas/deliverynote.ts +2 -1
- package/src/generated/schemas/estimate.ts +4 -2
- package/src/generated/schemas/index.ts +1 -1
- package/src/generated/schemas/invoice.ts +2 -1
- package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +17 -23
- package/src/generated/schemas/rendercreditnotepreview_body.ts +17 -23
- package/src/generated/schemas/renderdeliverynotepreview_body.ts +17 -23
- package/src/generated/schemas/renderestimatepreview_body.ts +17 -23
- package/src/generated/schemas/renderinvoicepreview_body.ts +19 -23
- package/src/hooks/use-duplicate-document.ts +56 -14
- package/src/hooks/use-vies-check.ts +3 -0
- package/src/lib/fiscalization.ts +12 -0
- package/src/lib/schemas/advance-invoice.ts +0 -1
- package/src/components/table/sortable-header.tsx +0 -56
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
import { TableHead, TableHeader, TableRow } from "@/ui/components/ui/table";
|
|
2
|
-
import { SortableHeader } from "../../table/sortable-header";
|
|
3
2
|
|
|
4
3
|
type TaxListHeaderProps = {
|
|
5
|
-
orderBy?: string;
|
|
6
|
-
onSort?: (order: string | null) => void;
|
|
7
4
|
t: (key: string) => string;
|
|
8
5
|
};
|
|
9
6
|
|
|
10
|
-
export default function TaxListHeader({
|
|
7
|
+
export default function TaxListHeader({ t }: TaxListHeaderProps) {
|
|
11
8
|
return (
|
|
12
9
|
<TableHeader>
|
|
13
10
|
<TableRow>
|
|
14
|
-
<TableHead>
|
|
15
|
-
<SortableHeader field="name" currentOrder={orderBy} onSort={onSort}>
|
|
16
|
-
{t("Name")}
|
|
17
|
-
</SortableHeader>
|
|
18
|
-
</TableHead>
|
|
11
|
+
<TableHead>{t("Name")}</TableHead>
|
|
19
12
|
<TableHead>{t("Tax Rates")}</TableHead>
|
|
20
|
-
<TableHead>
|
|
21
|
-
<SortableHeader field="created_at" currentOrder={orderBy} onSort={onSort}>
|
|
22
|
-
{t("Created")}
|
|
23
|
-
</SortableHeader>
|
|
24
|
-
</TableHead>
|
|
13
|
+
<TableHead>{t("Created")}</TableHead>
|
|
25
14
|
<TableHead className="text-right" />
|
|
26
15
|
</TableRow>
|
|
27
16
|
</TableHeader>
|
|
@@ -58,15 +58,15 @@ export default function TaxListTable({
|
|
|
58
58
|
return (
|
|
59
59
|
<DataTable
|
|
60
60
|
columns={[
|
|
61
|
-
{ id: "name", header: t("Name")
|
|
61
|
+
{ id: "name", header: t("Name") },
|
|
62
62
|
{ id: "tax_rates", header: t("Tax Rates") },
|
|
63
|
-
{ id: "created_at", header: t("Created")
|
|
63
|
+
{ id: "created_at", header: t("Created") },
|
|
64
64
|
{ id: "actions", header: "", align: "right" },
|
|
65
65
|
]}
|
|
66
66
|
renderRow={(tax) => (
|
|
67
67
|
<TaxListRow tax={tax} key={tax.id} onRowClick={(tax) => onRowClick?.(tax)} onView={onView} t={t} />
|
|
68
68
|
)}
|
|
69
|
-
renderHeader={(
|
|
69
|
+
renderHeader={() => <TaxListHeader t={t} />}
|
|
70
70
|
queryParams={queryParams}
|
|
71
71
|
resourceName="tax"
|
|
72
72
|
cacheKey={TAXES_CACHE_KEY}
|
|
@@ -37,11 +37,12 @@ function PopoverContent({
|
|
|
37
37
|
alignOffset = 0,
|
|
38
38
|
side = "bottom",
|
|
39
39
|
sideOffset = 4,
|
|
40
|
+
positionMethod = "fixed",
|
|
40
41
|
...props
|
|
41
42
|
}: PopoverPrimitive.Popup.Props &
|
|
42
43
|
Pick<
|
|
43
44
|
PopoverPrimitive.Positioner.Props,
|
|
44
|
-
"align" | "alignOffset" | "side" | "sideOffset"
|
|
45
|
+
"align" | "alignOffset" | "side" | "sideOffset" | "positionMethod"
|
|
45
46
|
>) {
|
|
46
47
|
return (
|
|
47
48
|
<PopoverPrimitive.Portal>
|
|
@@ -50,6 +51,7 @@ function PopoverContent({
|
|
|
50
51
|
alignOffset={alignOffset}
|
|
51
52
|
side={side}
|
|
52
53
|
sideOffset={sideOffset}
|
|
54
|
+
positionMethod={positionMethod}
|
|
53
55
|
className="isolate z-50"
|
|
54
56
|
>
|
|
55
57
|
<PopoverPrimitive.Popup
|
|
@@ -54,12 +54,13 @@ function TooltipContent({
|
|
|
54
54
|
sideOffset = 4,
|
|
55
55
|
align = "center",
|
|
56
56
|
alignOffset = 0,
|
|
57
|
+
positionMethod = "fixed",
|
|
57
58
|
children,
|
|
58
59
|
...props
|
|
59
60
|
}: TooltipPrimitive.Popup.Props &
|
|
60
61
|
Pick<
|
|
61
62
|
TooltipPrimitive.Positioner.Props,
|
|
62
|
-
"align" | "alignOffset" | "side" | "sideOffset"
|
|
63
|
+
"align" | "alignOffset" | "side" | "sideOffset" | "positionMethod"
|
|
63
64
|
>) {
|
|
64
65
|
return (
|
|
65
66
|
<TooltipPrimitive.Portal>
|
|
@@ -68,6 +69,7 @@ function TooltipContent({
|
|
|
68
69
|
alignOffset={alignOffset}
|
|
69
70
|
side={side}
|
|
70
71
|
sideOffset={sideOffset}
|
|
72
|
+
positionMethod={positionMethod}
|
|
71
73
|
className="isolate z-50"
|
|
72
74
|
>
|
|
73
75
|
<TooltipPrimitive.Popup
|
|
@@ -104,11 +104,12 @@ const createAdvanceInvoiceSchemaDefinition = z.object({
|
|
|
104
104
|
items: z
|
|
105
105
|
.array(
|
|
106
106
|
z.object({
|
|
107
|
+
type: z.enum(["separator"]).optional(),
|
|
107
108
|
name: z.string().min(1).optional(),
|
|
108
109
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
109
110
|
price: z.number().optional(),
|
|
110
111
|
gross_price: z.number().optional(),
|
|
111
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
112
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
112
113
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
113
114
|
taxes: z.array(DocumentItemTax).optional(),
|
|
114
115
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
@@ -202,11 +203,12 @@ const updateAdvanceInvoiceSchemaDefinition = z
|
|
|
202
203
|
items: z
|
|
203
204
|
.array(
|
|
204
205
|
z.object({
|
|
206
|
+
type: z.enum(["separator"]).optional(),
|
|
205
207
|
name: z.string().min(1).optional(),
|
|
206
208
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
207
209
|
price: z.number().optional(),
|
|
208
210
|
gross_price: z.number().optional(),
|
|
209
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
211
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
210
212
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
211
213
|
taxes: z.array(DocumentItemTax).optional(),
|
|
212
214
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
@@ -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(),
|
|
@@ -93,11 +93,12 @@ const createDeliveryNoteSchemaDefinition = z.object({
|
|
|
93
93
|
items: z
|
|
94
94
|
.array(
|
|
95
95
|
z.object({
|
|
96
|
+
type: z.enum(["separator"]).optional(),
|
|
96
97
|
name: z.string().min(1).optional(),
|
|
97
98
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
98
99
|
price: z.number().optional(),
|
|
99
100
|
gross_price: z.number().optional(),
|
|
100
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
101
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
101
102
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
102
103
|
taxes: z.array(DocumentItemTax).optional(),
|
|
103
104
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
@@ -96,11 +96,12 @@ const createEstimateSchemaDefinition = z.object({
|
|
|
96
96
|
items: z
|
|
97
97
|
.array(
|
|
98
98
|
z.object({
|
|
99
|
+
type: z.enum(["separator"]).optional(),
|
|
99
100
|
name: z.string().min(1).optional(),
|
|
100
101
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
101
102
|
price: z.number().optional(),
|
|
102
103
|
gross_price: z.number().optional(),
|
|
103
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
104
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
104
105
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
105
106
|
taxes: z.array(DocumentItemTax).optional(),
|
|
106
107
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
@@ -155,11 +156,12 @@ const updateEstimateSchemaDefinition = z
|
|
|
155
156
|
items: z
|
|
156
157
|
.array(
|
|
157
158
|
z.object({
|
|
159
|
+
type: z.enum(["separator"]).optional(),
|
|
158
160
|
name: z.string().min(1).optional(),
|
|
159
161
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
160
162
|
price: z.number().optional(),
|
|
161
163
|
gross_price: z.number().optional(),
|
|
162
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
164
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
163
165
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
164
166
|
taxes: z.array(DocumentItemTax).optional(),
|
|
165
167
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
@@ -13,8 +13,8 @@ export * from './customadvanceinvoice';
|
|
|
13
13
|
export * from './customcreditnote';
|
|
14
14
|
export * from './customer';
|
|
15
15
|
export * from './customestimate';
|
|
16
|
-
export * from './deliverynote';
|
|
17
16
|
export * from './custominvoice';
|
|
17
|
+
export * from './deliverynote';
|
|
18
18
|
export * from './entity';
|
|
19
19
|
export * from './entityuserrole';
|
|
20
20
|
export * from './estimate';
|
|
@@ -105,11 +105,12 @@ const createInvoiceSchemaDefinition = z.object({
|
|
|
105
105
|
items: z
|
|
106
106
|
.array(
|
|
107
107
|
z.object({
|
|
108
|
+
type: z.enum(["separator"]).optional(),
|
|
108
109
|
name: z.string().min(1).optional(),
|
|
109
110
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
110
111
|
price: z.number().optional(),
|
|
111
112
|
gross_price: z.number().optional(),
|
|
112
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
113
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
113
114
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
114
115
|
taxes: z.array(DocumentItemTax).optional(),
|
|
115
116
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
@@ -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.union([z.number(), z.null()]),
|
|
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.union([z.number(), z.null()]),
|
|
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
|
|
@@ -81,6 +81,7 @@ const PartialDeliveryNotePreview = z.object({
|
|
|
81
81
|
.array(
|
|
82
82
|
z
|
|
83
83
|
.object({
|
|
84
|
+
type: z.literal("separator"),
|
|
84
85
|
name: z.string(),
|
|
85
86
|
quantity: z.number(),
|
|
86
87
|
price: z.number(),
|
|
@@ -123,29 +124,22 @@ const LineDiscount = z.object({
|
|
|
123
124
|
|
|
124
125
|
|
|
125
126
|
// Dependency schema for renderdeliverynotepreview_body
|
|
126
|
-
const CreateDocumentItem = z
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
z.object({}).partial().passthrough(),
|
|
143
|
-
z.array(z.unknown()),
|
|
144
|
-
z.null(),
|
|
145
|
-
])
|
|
146
|
-
.optional(),
|
|
147
|
-
item_id: z.string().optional(),
|
|
148
|
-
});
|
|
127
|
+
const CreateDocumentItem = z
|
|
128
|
+
.object({
|
|
129
|
+
type: z.literal("separator"),
|
|
130
|
+
name: z.string().min(1),
|
|
131
|
+
description: z.union([z.string(), z.null()]),
|
|
132
|
+
price: z.number(),
|
|
133
|
+
gross_price: z.number(),
|
|
134
|
+
quantity: z.union([z.number(), z.null()]),
|
|
135
|
+
unit: z.union([z.string(), z.null()]),
|
|
136
|
+
taxes: z.array(DocumentItemTax),
|
|
137
|
+
discounts: z.array(LineDiscount).max(5),
|
|
138
|
+
item_id: z.string(),
|
|
139
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]),
|
|
140
|
+
save_item: z.boolean().default(true),
|
|
141
|
+
})
|
|
142
|
+
.partial();
|
|
149
143
|
|
|
150
144
|
|
|
151
145
|
// Dependency schema for renderdeliverynotepreview_body
|
|
@@ -82,6 +82,7 @@ const PartialEstimatePreview = z.object({
|
|
|
82
82
|
.array(
|
|
83
83
|
z
|
|
84
84
|
.object({
|
|
85
|
+
type: z.literal("separator"),
|
|
85
86
|
name: z.string(),
|
|
86
87
|
quantity: z.number(),
|
|
87
88
|
price: z.number(),
|
|
@@ -123,29 +124,22 @@ const LineDiscount = z.object({
|
|
|
123
124
|
|
|
124
125
|
|
|
125
126
|
// Dependency schema for renderestimatepreview_body
|
|
126
|
-
const CreateDocumentItem = z
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
z.object({}).partial().passthrough(),
|
|
143
|
-
z.array(z.unknown()),
|
|
144
|
-
z.null(),
|
|
145
|
-
])
|
|
146
|
-
.optional(),
|
|
147
|
-
item_id: z.string().optional(),
|
|
148
|
-
});
|
|
127
|
+
const CreateDocumentItem = z
|
|
128
|
+
.object({
|
|
129
|
+
type: z.literal("separator"),
|
|
130
|
+
name: z.string().min(1),
|
|
131
|
+
description: z.union([z.string(), z.null()]),
|
|
132
|
+
price: z.number(),
|
|
133
|
+
gross_price: z.number(),
|
|
134
|
+
quantity: z.union([z.number(), z.null()]),
|
|
135
|
+
unit: z.union([z.string(), z.null()]),
|
|
136
|
+
taxes: z.array(DocumentItemTax),
|
|
137
|
+
discounts: z.array(LineDiscount).max(5),
|
|
138
|
+
item_id: z.string(),
|
|
139
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]),
|
|
140
|
+
save_item: z.boolean().default(true),
|
|
141
|
+
})
|
|
142
|
+
.partial();
|
|
149
143
|
|
|
150
144
|
|
|
151
145
|
// Dependency schema for renderestimatepreview_body
|
|
@@ -113,6 +113,7 @@ const PartialInvoicePreview = 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(),
|
|
@@ -132,6 +133,7 @@ const PartialInvoicePreview = z.object({
|
|
|
132
133
|
.min(1),
|
|
133
134
|
fina: CreateFinaInvoiceData.optional(),
|
|
134
135
|
expected_total_with_tax: z.number().gt(0).optional(),
|
|
136
|
+
force_linked_documents: z.boolean().optional(),
|
|
135
137
|
});
|
|
136
138
|
|
|
137
139
|
|
|
@@ -155,29 +157,22 @@ const LineDiscount = z.object({
|
|
|
155
157
|
|
|
156
158
|
|
|
157
159
|
// Dependency schema for renderinvoicepreview_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
|
-
});
|
|
160
|
+
const CreateDocumentItem = z
|
|
161
|
+
.object({
|
|
162
|
+
type: z.literal("separator"),
|
|
163
|
+
name: z.string().min(1),
|
|
164
|
+
description: z.union([z.string(), z.null()]),
|
|
165
|
+
price: z.number(),
|
|
166
|
+
gross_price: z.number(),
|
|
167
|
+
quantity: z.union([z.number(), z.null()]),
|
|
168
|
+
unit: z.union([z.string(), z.null()]),
|
|
169
|
+
taxes: z.array(DocumentItemTax),
|
|
170
|
+
discounts: z.array(LineDiscount).max(5),
|
|
171
|
+
item_id: z.string(),
|
|
172
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]),
|
|
173
|
+
save_item: z.boolean().default(true),
|
|
174
|
+
})
|
|
175
|
+
.partial();
|
|
181
176
|
|
|
182
177
|
|
|
183
178
|
// Dependency schema for renderinvoicepreview_body
|
|
@@ -201,6 +196,7 @@ const CompleteInvoicePreview = z.object({
|
|
|
201
196
|
items: z.array(CreateDocumentItem).min(1),
|
|
202
197
|
fina: CreateFinaInvoiceData.optional(),
|
|
203
198
|
expected_total_with_tax: z.number().gt(0).optional(),
|
|
199
|
+
force_linked_documents: z.boolean().optional(),
|
|
204
200
|
});
|
|
205
201
|
|
|
206
202
|
|