@spaceinvoices/react-ui 0.4.2 → 0.4.4
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 +0 -1
- package/src/components/advance-invoices/create/locales/de.ts +2 -0
- package/src/components/advance-invoices/create/locales/es.ts +2 -0
- package/src/components/advance-invoices/create/locales/fr.ts +2 -0
- package/src/components/advance-invoices/create/locales/hr.ts +1 -0
- package/src/components/advance-invoices/create/locales/it.ts +2 -0
- package/src/components/advance-invoices/create/locales/nl.ts +2 -0
- package/src/components/advance-invoices/create/locales/pl.ts +1 -0
- package/src/components/advance-invoices/create/locales/pt.ts +1 -0
- package/src/components/advance-invoices/create/locales/sl.ts +1 -0
- package/src/components/advance-invoices/create/prepare-advance-invoice-submission.ts +0 -1
- package/src/components/advance-invoices/list/list-table.tsx +130 -40
- package/src/components/advance-invoices/list/locales/de.ts +6 -0
- package/src/components/advance-invoices/list/locales/en.ts +5 -0
- package/src/components/advance-invoices/list/locales/es.ts +6 -0
- package/src/components/advance-invoices/list/locales/fr.ts +6 -0
- package/src/components/advance-invoices/list/locales/hr.ts +6 -0
- package/src/components/advance-invoices/list/locales/it.ts +6 -0
- package/src/components/advance-invoices/list/locales/nl.ts +6 -0
- package/src/components/advance-invoices/list/locales/pl.ts +6 -0
- package/src/components/advance-invoices/list/locales/pt.ts +6 -0
- package/src/components/advance-invoices/list/locales/sl.ts +6 -0
- package/src/components/credit-notes/create/create-credit-note-form.tsx +114 -3
- package/src/components/credit-notes/create/locales/de.ts +2 -0
- package/src/components/credit-notes/create/locales/es.ts +2 -0
- package/src/components/credit-notes/create/locales/fr.ts +2 -0
- package/src/components/credit-notes/create/locales/hr.ts +1 -0
- package/src/components/credit-notes/create/locales/it.ts +2 -0
- package/src/components/credit-notes/create/locales/nl.ts +2 -0
- package/src/components/credit-notes/create/locales/pl.ts +1 -0
- package/src/components/credit-notes/create/locales/pt.ts +1 -0
- package/src/components/credit-notes/create/locales/sl.ts +1 -0
- package/src/components/credit-notes/credit-notes.hooks.ts +30 -0
- package/src/components/credit-notes/list/list-table.tsx +111 -36
- package/src/components/credit-notes/list/locales/de.ts +6 -1
- package/src/components/credit-notes/list/locales/en.ts +6 -0
- package/src/components/credit-notes/list/locales/es.ts +6 -1
- package/src/components/credit-notes/list/locales/fr.ts +6 -1
- package/src/components/credit-notes/list/locales/hr.ts +6 -1
- package/src/components/credit-notes/list/locales/it.ts +6 -1
- package/src/components/credit-notes/list/locales/nl.ts +6 -1
- package/src/components/credit-notes/list/locales/pl.ts +6 -1
- package/src/components/credit-notes/list/locales/pt.ts +6 -1
- package/src/components/credit-notes/list/locales/sl.ts +6 -1
- 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 +2 -2
- package/src/components/dashboard/invoice-status-chart/use-invoice-status.ts +3 -3
- package/src/components/dashboard/payment-methods-chart/use-payment-methods.ts +1 -1
- package/src/components/dashboard/payment-trend-chart/use-payment-trend.ts +1 -1
- package/src/components/dashboard/revenue-trend-chart/use-revenue-trend.ts +1 -1
- package/src/components/dashboard/shared/use-revenue-data.ts +4 -4
- package/src/components/dashboard/shared/use-stats-counts.ts +4 -4
- package/src/components/dashboard/shared/use-stats-query.ts +1 -1
- package/src/components/dashboard/tax-collected-card/use-tax-collected.ts +2 -2
- package/src/components/dashboard/top-customers-chart/use-top-customers.ts +1 -1
- package/src/components/delivery-notes/create/create-delivery-note-form.tsx +332 -0
- package/src/components/delivery-notes/create/locales/de.ts +50 -0
- package/src/components/delivery-notes/create/locales/es.ts +49 -0
- package/src/components/delivery-notes/create/locales/fr.ts +50 -0
- package/src/components/delivery-notes/create/locales/hr.ts +49 -0
- package/src/components/delivery-notes/create/locales/it.ts +49 -0
- package/src/components/delivery-notes/create/locales/nl.ts +50 -0
- package/src/components/delivery-notes/create/locales/pl.ts +49 -0
- package/src/components/delivery-notes/create/locales/pt.ts +50 -0
- package/src/components/delivery-notes/create/locales/sl.ts +49 -0
- package/src/components/delivery-notes/create/prepare-delivery-note-submission.ts +38 -0
- package/src/components/delivery-notes/create/use-delivery-note-customer-form.ts +1 -0
- package/src/components/delivery-notes/delivery-notes.hooks.ts +15 -0
- package/src/components/delivery-notes/list/index.ts +3 -0
- package/src/components/delivery-notes/list/list-row-actions.tsx +122 -0
- package/src/components/delivery-notes/list/list-table.tsx +247 -0
- package/src/components/delivery-notes/list/locales/de.ts +13 -0
- package/src/components/delivery-notes/list/locales/en.ts +13 -0
- package/src/components/delivery-notes/list/locales/es.ts +13 -0
- package/src/components/delivery-notes/list/locales/fr.ts +13 -0
- package/src/components/delivery-notes/list/locales/hr.ts +13 -0
- package/src/components/delivery-notes/list/locales/it.ts +13 -0
- package/src/components/delivery-notes/list/locales/nl.ts +13 -0
- package/src/components/delivery-notes/list/locales/pl.ts +13 -0
- package/src/components/delivery-notes/list/locales/pt.ts +13 -0
- package/src/components/delivery-notes/list/locales/sl.ts +13 -0
- package/src/components/delivery-notes/list/use-delivery-note-download.ts +63 -0
- package/src/components/documents/create/document-details-section.tsx +76 -58
- package/src/components/documents/create/linked-documents-info.tsx +82 -0
- package/src/components/documents/create/live-preview.tsx +38 -11
- package/src/components/documents/create/prepare-document-submission.ts +1 -1
- package/src/components/documents/documents.hooks.ts +2 -1
- package/src/components/documents/shared/document-preview-display.tsx +12 -5
- package/src/components/documents/types.ts +12 -3
- package/src/components/documents/view/document-activities-list.tsx +65 -47
- package/src/components/documents/view/document-details-card.tsx +102 -77
- package/src/components/documents/view/document-payments-list.tsx +102 -68
- package/src/components/documents/view/document-relations-list.tsx +120 -0
- 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 +23 -0
- package/src/components/documents/view/locales/es.ts +23 -0
- package/src/components/documents/view/locales/fr.ts +23 -0
- package/src/components/documents/view/locales/hr.ts +23 -0
- package/src/components/documents/view/locales/it.ts +23 -0
- package/src/components/documents/view/locales/nl.ts +23 -0
- package/src/components/documents/view/locales/pl.ts +23 -0
- package/src/components/documents/view/locales/pt.ts +23 -0
- package/src/components/documents/view/locales/sl.ts +23 -0
- package/src/components/documents/view/use-document-download.ts +8 -5
- package/src/components/entities/create-entity-form.tsx +165 -13
- package/src/components/entities/entity-settings-form/entity-settings-form.tsx +101 -1
- package/src/components/entities/entity-settings-form/locales/de.ts +9 -0
- package/src/components/entities/entity-settings-form/locales/es.ts +9 -0
- package/src/components/entities/entity-settings-form/locales/fr.ts +9 -0
- package/src/components/entities/entity-settings-form/locales/hr.ts +9 -0
- package/src/components/entities/entity-settings-form/locales/it.ts +9 -0
- package/src/components/entities/entity-settings-form/locales/nl.ts +9 -0
- package/src/components/entities/entity-settings-form/locales/pl.ts +9 -0
- package/src/components/entities/entity-settings-form/locales/pt.ts +9 -0
- package/src/components/entities/entity-settings-form/locales/sl.ts +9 -0
- package/src/components/entities/fina-settings-form/fina-settings-form.tsx +83 -71
- package/src/components/entities/fina-settings-form/fina-settings.hooks.ts +7 -2
- 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/furs-settings-form.tsx +10 -1
- package/src/components/entities/furs-settings-form/furs-settings.hooks.ts +7 -2
- package/src/components/entities/furs-settings-form/locales/en.ts +0 -1
- package/src/components/entities/furs-settings-form/sections/general-settings-section.tsx +12 -4
- 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 +29 -2
- package/src/components/estimates/list/list-table.tsx +3 -6
- package/src/components/estimates/list/locales/de.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 +9 -2
- 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 +48 -1
- package/src/components/invoices/create/locales/de.ts +11 -0
- package/src/components/invoices/create/locales/es.ts +11 -0
- package/src/components/invoices/create/locales/fr.ts +11 -0
- package/src/components/invoices/create/locales/hr.ts +10 -0
- package/src/components/invoices/create/locales/it.ts +11 -0
- package/src/components/invoices/create/locales/nl.ts +11 -0
- package/src/components/invoices/create/locales/pl.ts +10 -0
- package/src/components/invoices/create/locales/pt.ts +10 -0
- package/src/components/invoices/create/locales/sl.ts +10 -0
- package/src/components/invoices/invoices-furs.hooks.ts +27 -9
- package/src/components/invoices/list/list-row-actions.tsx +3 -3
- package/src/components/invoices/list/list-table.tsx +132 -21
- package/src/components/invoices/list/locales/de.ts +6 -0
- package/src/components/invoices/list/locales/en.ts +5 -0
- package/src/components/invoices/list/locales/es.ts +6 -0
- package/src/components/invoices/list/locales/fr.ts +6 -0
- package/src/components/invoices/list/locales/hr.ts +6 -0
- package/src/components/invoices/list/locales/it.ts +6 -0
- package/src/components/invoices/list/locales/nl.ts +6 -0
- package/src/components/invoices/list/locales/pl.ts +6 -0
- package/src/components/invoices/list/locales/pt.ts +6 -0
- package/src/components/invoices/list/locales/sl.ts +6 -0
- package/src/components/invoices/view/fiscalization-status-card.tsx +42 -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-row-actions.tsx +3 -2
- package/src/components/items/item-list-table/item-list-row.tsx +3 -2
- 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/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/deliverynote.ts +134 -0
- package/src/generated/schemas/entity.ts +4 -0
- package/src/generated/schemas/index.ts +3 -0
- package/src/generated/schemas/order.ts +5 -3
- package/src/generated/schemas/payment.ts +22 -2
- package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +1 -0
- package/src/generated/schemas/rendercreditnotepreview_body.ts +1 -0
- package/src/generated/schemas/renderdeliverynotepreview_body.ts +185 -0
- package/src/generated/schemas/renderestimatepreview_body.ts +1 -0
- package/src/generated/schemas/renderinvoicepreview_body.ts +1 -0
- package/src/generated/schemas/startpdfexport_body.ts +18 -2
- package/src/generated/schemas/userfinasettings.ts +19 -0
- package/src/generated/schemas/webhook.ts +12 -0
- package/src/hooks/use-duplicate-document.ts +49 -6
- package/src/hooks/use-next-document-number.ts +2 -2
- package/src/lib/fiscalization.ts +12 -0
- package/src/lib/schemas/advance-invoice.ts +0 -1
- package/src/providers/sdk-provider.tsx +5 -7
- package/src/components/table/sortable-header.tsx +0 -56
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AdvanceInvoice,
|
|
3
|
+
CreditNote,
|
|
4
|
+
DeliveryNote,
|
|
5
|
+
DocumentRelation,
|
|
6
|
+
Estimate,
|
|
7
|
+
Invoice,
|
|
8
|
+
Payment,
|
|
9
|
+
} from "@spaceinvoices/js-sdk";
|
|
10
|
+
import { Card, CardContent } from "@/ui/components/ui/card";
|
|
11
|
+
import { Separator } from "@/ui/components/ui/separator";
|
|
12
|
+
import type { ComponentTranslationProps } from "@/ui/lib/translation";
|
|
13
|
+
import { FiscalizationStatusCard } from "../../invoices/view/fiscalization-status-card";
|
|
14
|
+
import { DocumentActivitiesList } from "./document-activities-list";
|
|
15
|
+
import { DocumentDetailsCard } from "./document-details-card";
|
|
16
|
+
import { DocumentPaymentsList } from "./document-payments-list";
|
|
17
|
+
import { DocumentRelationsList } from "./document-relations-list";
|
|
18
|
+
|
|
19
|
+
type Document = Invoice | Estimate | CreditNote | AdvanceInvoice | DeliveryNote;
|
|
20
|
+
type DocumentType = "invoice" | "estimate" | "credit_note" | "advance_invoice" | "delivery_note";
|
|
21
|
+
|
|
22
|
+
interface DocumentSidebarProps extends ComponentTranslationProps {
|
|
23
|
+
document: Document;
|
|
24
|
+
documentType: DocumentType;
|
|
25
|
+
entityId: string;
|
|
26
|
+
locale?: string;
|
|
27
|
+
currentUserId?: string;
|
|
28
|
+
/** Show payments section */
|
|
29
|
+
showPayments?: boolean;
|
|
30
|
+
onAddPayment?: () => void;
|
|
31
|
+
onEditPayment?: (payment: Payment) => void;
|
|
32
|
+
onPaymentDeleteSuccess?: () => void;
|
|
33
|
+
onPaymentDeleteError?: (error: string) => void;
|
|
34
|
+
/** Navigate to a related document */
|
|
35
|
+
onNavigateRelation?: (documentId: string) => void;
|
|
36
|
+
/** FURS fiscalization */
|
|
37
|
+
showFurs?: boolean;
|
|
38
|
+
fursFiscalizationData?: any;
|
|
39
|
+
/** FINA fiscalization */
|
|
40
|
+
showFina?: boolean;
|
|
41
|
+
finaFiscalizationData?: any;
|
|
42
|
+
onRetryFiscalization?: () => void;
|
|
43
|
+
isRetryingFiscalization?: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function DocumentSidebar({
|
|
47
|
+
document,
|
|
48
|
+
documentType,
|
|
49
|
+
entityId,
|
|
50
|
+
locale = "en",
|
|
51
|
+
currentUserId,
|
|
52
|
+
showPayments,
|
|
53
|
+
onAddPayment,
|
|
54
|
+
onEditPayment,
|
|
55
|
+
onPaymentDeleteSuccess,
|
|
56
|
+
onPaymentDeleteError,
|
|
57
|
+
onNavigateRelation,
|
|
58
|
+
showFurs,
|
|
59
|
+
fursFiscalizationData,
|
|
60
|
+
showFina,
|
|
61
|
+
finaFiscalizationData,
|
|
62
|
+
onRetryFiscalization,
|
|
63
|
+
isRetryingFiscalization,
|
|
64
|
+
...i18nProps
|
|
65
|
+
}: DocumentSidebarProps) {
|
|
66
|
+
const documentRelations = (document as unknown as { document_relations?: DocumentRelation[] }).document_relations;
|
|
67
|
+
const hasRelations = documentRelations && documentRelations.length > 0;
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Card size="sm">
|
|
71
|
+
<CardContent className="space-y-5">
|
|
72
|
+
<DocumentDetailsCard
|
|
73
|
+
variant="inline"
|
|
74
|
+
document={document}
|
|
75
|
+
documentType={documentType}
|
|
76
|
+
locale={locale}
|
|
77
|
+
{...i18nProps}
|
|
78
|
+
/>
|
|
79
|
+
|
|
80
|
+
{showPayments && (
|
|
81
|
+
<>
|
|
82
|
+
<Separator />
|
|
83
|
+
<DocumentPaymentsList
|
|
84
|
+
variant="inline"
|
|
85
|
+
documentId={document.id}
|
|
86
|
+
documentType={documentType as "invoice" | "credit_note" | "advance_invoice"}
|
|
87
|
+
entityId={entityId}
|
|
88
|
+
currencyCode={document.currency_code}
|
|
89
|
+
locale={locale}
|
|
90
|
+
onAddPayment={onAddPayment}
|
|
91
|
+
onEditPayment={onEditPayment}
|
|
92
|
+
onDeleteSuccess={onPaymentDeleteSuccess}
|
|
93
|
+
onDeleteError={onPaymentDeleteError}
|
|
94
|
+
{...i18nProps}
|
|
95
|
+
/>
|
|
96
|
+
</>
|
|
97
|
+
)}
|
|
98
|
+
|
|
99
|
+
{hasRelations && (
|
|
100
|
+
<>
|
|
101
|
+
<Separator />
|
|
102
|
+
<DocumentRelationsList
|
|
103
|
+
variant="inline"
|
|
104
|
+
documentId={document.id}
|
|
105
|
+
documentRelations={documentRelations}
|
|
106
|
+
locale={locale}
|
|
107
|
+
onNavigate={onNavigateRelation}
|
|
108
|
+
{...i18nProps}
|
|
109
|
+
/>
|
|
110
|
+
</>
|
|
111
|
+
)}
|
|
112
|
+
|
|
113
|
+
<Separator />
|
|
114
|
+
<DocumentActivitiesList
|
|
115
|
+
variant="inline"
|
|
116
|
+
documentId={document.id}
|
|
117
|
+
entityId={entityId}
|
|
118
|
+
currentUserId={currentUserId}
|
|
119
|
+
locale={locale}
|
|
120
|
+
{...i18nProps}
|
|
121
|
+
/>
|
|
122
|
+
|
|
123
|
+
{(showFurs || showFina) && (
|
|
124
|
+
<>
|
|
125
|
+
<Separator />
|
|
126
|
+
{showFurs && (
|
|
127
|
+
<FiscalizationStatusCard
|
|
128
|
+
variant="inline"
|
|
129
|
+
fiscalizationType="furs"
|
|
130
|
+
fiscalizationData={fursFiscalizationData}
|
|
131
|
+
onRetry={onRetryFiscalization}
|
|
132
|
+
isRetrying={isRetryingFiscalization}
|
|
133
|
+
locale={locale}
|
|
134
|
+
/>
|
|
135
|
+
)}
|
|
136
|
+
{showFina && (
|
|
137
|
+
<FiscalizationStatusCard
|
|
138
|
+
variant="inline"
|
|
139
|
+
fiscalizationType="fina"
|
|
140
|
+
fiscalizationData={finaFiscalizationData}
|
|
141
|
+
onRetry={onRetryFiscalization}
|
|
142
|
+
isRetrying={isRetryingFiscalization}
|
|
143
|
+
locale={locale}
|
|
144
|
+
/>
|
|
145
|
+
)}
|
|
146
|
+
</>
|
|
147
|
+
)}
|
|
148
|
+
</CardContent>
|
|
149
|
+
</Card>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
@@ -2,4 +2,6 @@ export { DocumentActionsBar } from "./document-actions-bar";
|
|
|
2
2
|
export { DocumentActivitiesList } from "./document-activities-list";
|
|
3
3
|
export { DocumentDetailsCard } from "./document-details-card";
|
|
4
4
|
export { DocumentPaymentsList } from "./document-payments-list";
|
|
5
|
+
export { DocumentRelationsList } from "./document-relations-list";
|
|
6
|
+
export { DocumentSidebar } from "./document-sidebar";
|
|
5
7
|
export { useDocumentDownload } from "./use-document-download";
|
|
@@ -20,10 +20,12 @@ export default {
|
|
|
20
20
|
"Duplicate estimate": "Angebot duplizieren",
|
|
21
21
|
"Duplicate credit_note": "Gutschrift duplizieren",
|
|
22
22
|
"Duplicate advance_invoice": "Anzahlungsrechnung duplizieren",
|
|
23
|
+
"Duplicate delivery_note": "Lieferschein duplizieren",
|
|
23
24
|
"Create invoice": "Rechnung erstellen",
|
|
24
25
|
"Create estimate": "Angebot erstellen",
|
|
25
26
|
"Create credit_note": "Gutschrift erstellen",
|
|
26
27
|
"Create advance_invoice": "Anzahlungsrechnung erstellen",
|
|
28
|
+
"Create delivery_note": "Lieferschein erstellen",
|
|
27
29
|
|
|
28
30
|
// Details card
|
|
29
31
|
Details: "Details",
|
|
@@ -119,4 +121,25 @@ export default {
|
|
|
119
121
|
Dutch: "Niederländisch",
|
|
120
122
|
Polish: "Polnisch",
|
|
121
123
|
Croatian: "Kroatisch",
|
|
124
|
+
|
|
125
|
+
// Linked documents
|
|
126
|
+
"Linked documents": "Verknüpfte Dokumente",
|
|
127
|
+
"No linked documents": "Keine verknüpften Dokumente",
|
|
128
|
+
Invoice: "Rechnung",
|
|
129
|
+
Estimate: "Angebot",
|
|
130
|
+
"Credit note": "Gutschrift",
|
|
131
|
+
"Advance invoice": "Anzahlungsrechnung",
|
|
132
|
+
"Delivery note": "Lieferschein",
|
|
133
|
+
"Credit for": "Gutschrift für",
|
|
134
|
+
"Converted from": "Konvertiert von",
|
|
135
|
+
"Converted to": "Konvertiert zu",
|
|
136
|
+
"Has credit": "Hat Gutschrift",
|
|
137
|
+
"Advance applied": "Anzahlung angewendet",
|
|
138
|
+
"Applied to": "Angewendet auf",
|
|
139
|
+
"Delivered for": "Geliefert für",
|
|
140
|
+
"Has delivery": "Hat Lieferschein",
|
|
141
|
+
Fulfills: "Erfüllt",
|
|
142
|
+
"Fulfilled by": "Erfüllt durch",
|
|
143
|
+
References: "Verweist auf",
|
|
144
|
+
View: "Ansehen",
|
|
122
145
|
} as const;
|
|
@@ -19,10 +19,12 @@ export default {
|
|
|
19
19
|
"Duplicate estimate": "Duplicar presupuesto",
|
|
20
20
|
"Duplicate credit_note": "Duplicar nota de crédito",
|
|
21
21
|
"Duplicate advance_invoice": "Duplicar factura anticipada",
|
|
22
|
+
"Duplicate delivery_note": "Duplicar albarán",
|
|
22
23
|
"Create invoice": "Crear factura",
|
|
23
24
|
"Create estimate": "Crear presupuesto",
|
|
24
25
|
"Create credit_note": "Crear nota de crédito",
|
|
25
26
|
"Create advance_invoice": "Crear factura anticipada",
|
|
27
|
+
"Create delivery_note": "Crear albarán",
|
|
26
28
|
|
|
27
29
|
// Details card
|
|
28
30
|
Details: "Detalles",
|
|
@@ -117,4 +119,25 @@ export default {
|
|
|
117
119
|
Dutch: "Neerlandés",
|
|
118
120
|
Polish: "Polaco",
|
|
119
121
|
Croatian: "Croata",
|
|
122
|
+
|
|
123
|
+
// Linked documents
|
|
124
|
+
"Linked documents": "Documentos vinculados",
|
|
125
|
+
"No linked documents": "Sin documentos vinculados",
|
|
126
|
+
Invoice: "Factura",
|
|
127
|
+
Estimate: "Presupuesto",
|
|
128
|
+
"Credit note": "Nota de crédito",
|
|
129
|
+
"Advance invoice": "Factura anticipada",
|
|
130
|
+
"Delivery note": "Albarán",
|
|
131
|
+
"Credit for": "Crédito para",
|
|
132
|
+
"Converted from": "Convertido desde",
|
|
133
|
+
"Converted to": "Convertido a",
|
|
134
|
+
"Has credit": "Tiene crédito",
|
|
135
|
+
"Advance applied": "Anticipo aplicado",
|
|
136
|
+
"Applied to": "Aplicado a",
|
|
137
|
+
"Delivered for": "Entregado para",
|
|
138
|
+
"Has delivery": "Tiene albarán",
|
|
139
|
+
Fulfills: "Cumple",
|
|
140
|
+
"Fulfilled by": "Cumplido por",
|
|
141
|
+
References: "Referencia",
|
|
142
|
+
View: "Ver",
|
|
120
143
|
} as const;
|
|
@@ -19,10 +19,12 @@ export default {
|
|
|
19
19
|
"Duplicate estimate": "Dupliquer le devis",
|
|
20
20
|
"Duplicate credit_note": "Dupliquer l'avoir",
|
|
21
21
|
"Duplicate advance_invoice": "Dupliquer la facture d'acompte",
|
|
22
|
+
"Duplicate delivery_note": "Dupliquer le bon de livraison",
|
|
22
23
|
"Create invoice": "Créer une facture",
|
|
23
24
|
"Create estimate": "Créer un devis",
|
|
24
25
|
"Create credit_note": "Créer un avoir",
|
|
25
26
|
"Create advance_invoice": "Créer une facture d'acompte",
|
|
27
|
+
"Create delivery_note": "Créer un bon de livraison",
|
|
26
28
|
|
|
27
29
|
// Details card
|
|
28
30
|
Details: "Détails",
|
|
@@ -117,4 +119,25 @@ export default {
|
|
|
117
119
|
Dutch: "Néerlandais",
|
|
118
120
|
Polish: "Polonais",
|
|
119
121
|
Croatian: "Croate",
|
|
122
|
+
|
|
123
|
+
// Linked documents
|
|
124
|
+
"Linked documents": "Documents liés",
|
|
125
|
+
"No linked documents": "Aucun document lié",
|
|
126
|
+
Invoice: "Facture",
|
|
127
|
+
Estimate: "Devis",
|
|
128
|
+
"Credit note": "Avoir",
|
|
129
|
+
"Advance invoice": "Facture d'acompte",
|
|
130
|
+
"Delivery note": "Bon de livraison",
|
|
131
|
+
"Credit for": "Avoir pour",
|
|
132
|
+
"Converted from": "Converti depuis",
|
|
133
|
+
"Converted to": "Converti en",
|
|
134
|
+
"Has credit": "A un avoir",
|
|
135
|
+
"Advance applied": "Acompte appliqué",
|
|
136
|
+
"Applied to": "Appliqué à",
|
|
137
|
+
"Delivered for": "Livré pour",
|
|
138
|
+
"Has delivery": "A un bon de livraison",
|
|
139
|
+
Fulfills: "Remplit",
|
|
140
|
+
"Fulfilled by": "Rempli par",
|
|
141
|
+
References: "Référence",
|
|
142
|
+
View: "Voir",
|
|
120
143
|
} as const;
|
|
@@ -19,10 +19,12 @@ export default {
|
|
|
19
19
|
"Duplicate estimate": "Dupliciraj ponudu",
|
|
20
20
|
"Duplicate credit_note": "Dupliciraj knjižno odobrenje",
|
|
21
21
|
"Duplicate advance_invoice": "Dupliciraj avansni račun",
|
|
22
|
+
"Duplicate delivery_note": "Dupliciraj otpremnicu",
|
|
22
23
|
"Create invoice": "Stvori račun",
|
|
23
24
|
"Create estimate": "Stvori ponudu",
|
|
24
25
|
"Create credit_note": "Stvori knjižno odobrenje",
|
|
25
26
|
"Create advance_invoice": "Stvori avansni račun",
|
|
27
|
+
"Create delivery_note": "Stvori otpremnicu",
|
|
26
28
|
|
|
27
29
|
// Details card
|
|
28
30
|
Details: "Pojedinosti",
|
|
@@ -117,4 +119,25 @@ export default {
|
|
|
117
119
|
Dutch: "Nizozemski",
|
|
118
120
|
Polish: "Poljski",
|
|
119
121
|
Croatian: "Hrvatski",
|
|
122
|
+
|
|
123
|
+
// Linked documents
|
|
124
|
+
"Linked documents": "Povezani dokumenti",
|
|
125
|
+
"No linked documents": "Nema povezanih dokumenata",
|
|
126
|
+
Invoice: "Račun",
|
|
127
|
+
Estimate: "Ponuda",
|
|
128
|
+
"Credit note": "Knjižno odobrenje",
|
|
129
|
+
"Advance invoice": "Avansni račun",
|
|
130
|
+
"Delivery note": "Otpremnica",
|
|
131
|
+
"Credit for": "Odobrenje za",
|
|
132
|
+
"Converted from": "Pretvoreno iz",
|
|
133
|
+
"Converted to": "Pretvoreno u",
|
|
134
|
+
"Has credit": "Ima odobrenje",
|
|
135
|
+
"Advance applied": "Avans primijenjen",
|
|
136
|
+
"Applied to": "Primijenjeno na",
|
|
137
|
+
"Delivered for": "Dostavljeno za",
|
|
138
|
+
"Has delivery": "Ima otpremnicu",
|
|
139
|
+
Fulfills: "Ispunjava",
|
|
140
|
+
"Fulfilled by": "Ispunjeno od",
|
|
141
|
+
References: "Upućuje na",
|
|
142
|
+
View: "Pogledaj",
|
|
120
143
|
} as const;
|
|
@@ -19,10 +19,12 @@ export default {
|
|
|
19
19
|
"Duplicate estimate": "Duplica preventivo",
|
|
20
20
|
"Duplicate credit_note": "Duplica nota di credito",
|
|
21
21
|
"Duplicate advance_invoice": "Duplica fattura di acconto",
|
|
22
|
+
"Duplicate delivery_note": "Duplica bolla di consegna",
|
|
22
23
|
"Create invoice": "Crea fattura",
|
|
23
24
|
"Create estimate": "Crea preventivo",
|
|
24
25
|
"Create credit_note": "Crea nota di credito",
|
|
25
26
|
"Create advance_invoice": "Crea fattura di acconto",
|
|
27
|
+
"Create delivery_note": "Crea bolla di consegna",
|
|
26
28
|
|
|
27
29
|
// Details card
|
|
28
30
|
Details: "Dettagli",
|
|
@@ -117,4 +119,25 @@ export default {
|
|
|
117
119
|
Dutch: "Olandese",
|
|
118
120
|
Polish: "Polacco",
|
|
119
121
|
Croatian: "Croato",
|
|
122
|
+
|
|
123
|
+
// Linked documents
|
|
124
|
+
"Linked documents": "Documenti collegati",
|
|
125
|
+
"No linked documents": "Nessun documento collegato",
|
|
126
|
+
Invoice: "Fattura",
|
|
127
|
+
Estimate: "Preventivo",
|
|
128
|
+
"Credit note": "Nota di credito",
|
|
129
|
+
"Advance invoice": "Fattura di acconto",
|
|
130
|
+
"Delivery note": "Bolla di consegna",
|
|
131
|
+
"Credit for": "Credito per",
|
|
132
|
+
"Converted from": "Convertito da",
|
|
133
|
+
"Converted to": "Convertito in",
|
|
134
|
+
"Has credit": "Ha credito",
|
|
135
|
+
"Advance applied": "Acconto applicato",
|
|
136
|
+
"Applied to": "Applicato a",
|
|
137
|
+
"Delivered for": "Consegnato per",
|
|
138
|
+
"Has delivery": "Ha bolla di consegna",
|
|
139
|
+
Fulfills: "Adempie",
|
|
140
|
+
"Fulfilled by": "Adempiuto da",
|
|
141
|
+
References: "Riferisce a",
|
|
142
|
+
View: "Visualizza",
|
|
120
143
|
} as const;
|
|
@@ -19,10 +19,12 @@ export default {
|
|
|
19
19
|
"Duplicate estimate": "Offerte dupliceren",
|
|
20
20
|
"Duplicate credit_note": "Creditnota dupliceren",
|
|
21
21
|
"Duplicate advance_invoice": "Voorschotfactuur dupliceren",
|
|
22
|
+
"Duplicate delivery_note": "Afleverbon dupliceren",
|
|
22
23
|
"Create invoice": "Factuur aanmaken",
|
|
23
24
|
"Create estimate": "Offerte aanmaken",
|
|
24
25
|
"Create credit_note": "Creditnota aanmaken",
|
|
25
26
|
"Create advance_invoice": "Voorschotfactuur aanmaken",
|
|
27
|
+
"Create delivery_note": "Afleverbon aanmaken",
|
|
26
28
|
|
|
27
29
|
// Details card
|
|
28
30
|
Details: "Details",
|
|
@@ -118,4 +120,25 @@ export default {
|
|
|
118
120
|
Dutch: "Nederlands",
|
|
119
121
|
Polish: "Pools",
|
|
120
122
|
Croatian: "Kroatisch",
|
|
123
|
+
|
|
124
|
+
// Linked documents
|
|
125
|
+
"Linked documents": "Gekoppelde documenten",
|
|
126
|
+
"No linked documents": "Geen gekoppelde documenten",
|
|
127
|
+
Invoice: "Factuur",
|
|
128
|
+
Estimate: "Offerte",
|
|
129
|
+
"Credit note": "Creditnota",
|
|
130
|
+
"Advance invoice": "Voorschotfactuur",
|
|
131
|
+
"Delivery note": "Afleverbon",
|
|
132
|
+
"Credit for": "Creditering voor",
|
|
133
|
+
"Converted from": "Geconverteerd van",
|
|
134
|
+
"Converted to": "Geconverteerd naar",
|
|
135
|
+
"Has credit": "Heeft creditering",
|
|
136
|
+
"Advance applied": "Voorschot toegepast",
|
|
137
|
+
"Applied to": "Toegepast op",
|
|
138
|
+
"Delivered for": "Geleverd voor",
|
|
139
|
+
"Has delivery": "Heeft afleverbon",
|
|
140
|
+
Fulfills: "Vervult",
|
|
141
|
+
"Fulfilled by": "Vervuld door",
|
|
142
|
+
References: "Verwijst naar",
|
|
143
|
+
View: "Bekijken",
|
|
121
144
|
} as const;
|
|
@@ -19,10 +19,12 @@ export default {
|
|
|
19
19
|
"Duplicate estimate": "Duplikuj kosztorys",
|
|
20
20
|
"Duplicate credit_note": "Duplikuj notę kredytową",
|
|
21
21
|
"Duplicate advance_invoice": "Duplikuj fakturę zaliczkową",
|
|
22
|
+
"Duplicate delivery_note": "Duplikuj dowód dostawy",
|
|
22
23
|
"Create invoice": "Utwórz fakturę",
|
|
23
24
|
"Create estimate": "Utwórz kosztorys",
|
|
24
25
|
"Create credit_note": "Utwórz notę kredytową",
|
|
25
26
|
"Create advance_invoice": "Utwórz fakturę zaliczkową",
|
|
27
|
+
"Create delivery_note": "Utwórz dowód dostawy",
|
|
26
28
|
|
|
27
29
|
// Details card
|
|
28
30
|
Details: "Szczegóły",
|
|
@@ -117,4 +119,25 @@ export default {
|
|
|
117
119
|
Dutch: "Niderlandzki",
|
|
118
120
|
Polish: "Polski",
|
|
119
121
|
Croatian: "Chorwacki",
|
|
122
|
+
|
|
123
|
+
// Linked documents
|
|
124
|
+
"Linked documents": "Powiązane dokumenty",
|
|
125
|
+
"No linked documents": "Brak powiązanych dokumentów",
|
|
126
|
+
Invoice: "Faktura",
|
|
127
|
+
Estimate: "Kosztorys",
|
|
128
|
+
"Credit note": "Nota kredytowa",
|
|
129
|
+
"Advance invoice": "Faktura zaliczkowa",
|
|
130
|
+
"Delivery note": "Dowód dostawy",
|
|
131
|
+
"Credit for": "Kredyt dla",
|
|
132
|
+
"Converted from": "Przekonwertowano z",
|
|
133
|
+
"Converted to": "Przekonwertowano na",
|
|
134
|
+
"Has credit": "Ma kredyt",
|
|
135
|
+
"Advance applied": "Zaliczka zastosowana",
|
|
136
|
+
"Applied to": "Zastosowano do",
|
|
137
|
+
"Delivered for": "Dostarczone dla",
|
|
138
|
+
"Has delivery": "Ma dowód dostawy",
|
|
139
|
+
Fulfills: "Realizuje",
|
|
140
|
+
"Fulfilled by": "Zrealizowano przez",
|
|
141
|
+
References: "Odnosi się do",
|
|
142
|
+
View: "Zobacz",
|
|
120
143
|
} as const;
|
|
@@ -19,10 +19,12 @@ export default {
|
|
|
19
19
|
"Duplicate estimate": "Duplicar orçamento",
|
|
20
20
|
"Duplicate credit_note": "Duplicar nota de crédito",
|
|
21
21
|
"Duplicate advance_invoice": "Duplicar fatura antecipada",
|
|
22
|
+
"Duplicate delivery_note": "Duplicar guia de remessa",
|
|
22
23
|
"Create invoice": "Criar fatura",
|
|
23
24
|
"Create estimate": "Criar orçamento",
|
|
24
25
|
"Create credit_note": "Criar nota de crédito",
|
|
25
26
|
"Create advance_invoice": "Criar fatura antecipada",
|
|
27
|
+
"Create delivery_note": "Criar guia de remessa",
|
|
26
28
|
|
|
27
29
|
// Details card
|
|
28
30
|
Details: "Detalhes",
|
|
@@ -117,4 +119,25 @@ export default {
|
|
|
117
119
|
Dutch: "Neerlandês",
|
|
118
120
|
Polish: "Polaco",
|
|
119
121
|
Croatian: "Croata",
|
|
122
|
+
|
|
123
|
+
// Linked documents
|
|
124
|
+
"Linked documents": "Documentos vinculados",
|
|
125
|
+
"No linked documents": "Sem documentos vinculados",
|
|
126
|
+
Invoice: "Fatura",
|
|
127
|
+
Estimate: "Orçamento",
|
|
128
|
+
"Credit note": "Nota de crédito",
|
|
129
|
+
"Advance invoice": "Fatura antecipada",
|
|
130
|
+
"Delivery note": "Guia de remessa",
|
|
131
|
+
"Credit for": "Crédito para",
|
|
132
|
+
"Converted from": "Convertido de",
|
|
133
|
+
"Converted to": "Convertido para",
|
|
134
|
+
"Has credit": "Tem crédito",
|
|
135
|
+
"Advance applied": "Adiantamento aplicado",
|
|
136
|
+
"Applied to": "Aplicado a",
|
|
137
|
+
"Delivered for": "Entregue para",
|
|
138
|
+
"Has delivery": "Tem guia de remessa",
|
|
139
|
+
Fulfills: "Cumpre",
|
|
140
|
+
"Fulfilled by": "Cumprido por",
|
|
141
|
+
References: "Referência",
|
|
142
|
+
View: "Ver",
|
|
120
143
|
} as const;
|
|
@@ -19,10 +19,12 @@ export default {
|
|
|
19
19
|
"Duplicate estimate": "Podvoji predračun",
|
|
20
20
|
"Duplicate credit_note": "Podvoji dobropis",
|
|
21
21
|
"Duplicate advance_invoice": "Podvoji avansni račun",
|
|
22
|
+
"Duplicate delivery_note": "Podvoji dobavnico",
|
|
22
23
|
"Create invoice": "Ustvari račun",
|
|
23
24
|
"Create estimate": "Ustvari predračun",
|
|
24
25
|
"Create credit_note": "Ustvari dobropis",
|
|
25
26
|
"Create advance_invoice": "Ustvari avansni račun",
|
|
27
|
+
"Create delivery_note": "Ustvari dobavnico",
|
|
26
28
|
|
|
27
29
|
// Details card
|
|
28
30
|
Details: "Podrobnosti",
|
|
@@ -118,4 +120,25 @@ export default {
|
|
|
118
120
|
Dutch: "Nizozemščina",
|
|
119
121
|
Polish: "Poljščina",
|
|
120
122
|
Croatian: "Hrvaščina",
|
|
123
|
+
|
|
124
|
+
// Linked documents
|
|
125
|
+
"Linked documents": "Povezani dokumenti",
|
|
126
|
+
"No linked documents": "Ni povezanih dokumentov",
|
|
127
|
+
Invoice: "Račun",
|
|
128
|
+
Estimate: "Predračun",
|
|
129
|
+
"Credit note": "Dobropis",
|
|
130
|
+
"Advance invoice": "Avansni račun",
|
|
131
|
+
"Delivery note": "Dobavnica",
|
|
132
|
+
"Credit for": "Dobropis za",
|
|
133
|
+
"Converted from": "Pretvorjeno iz",
|
|
134
|
+
"Converted to": "Pretvorjeno v",
|
|
135
|
+
"Has credit": "Ima dobropis",
|
|
136
|
+
"Advance applied": "Avans uporabljen",
|
|
137
|
+
"Applied to": "Uporabljen za",
|
|
138
|
+
"Delivered for": "Dostavljeno za",
|
|
139
|
+
"Has delivery": "Ima dobavnico",
|
|
140
|
+
Fulfills: "Izpolnjuje",
|
|
141
|
+
"Fulfilled by": "Izpolnjeno z",
|
|
142
|
+
References: "Sklicuje se na",
|
|
143
|
+
View: "Poglej",
|
|
121
144
|
} as const;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { AdvanceInvoice, CreditNote, Estimate, Invoice } from "@spaceinvoices/js-sdk";
|
|
1
|
+
import type { AdvanceInvoice, CreditNote, DeliveryNote, Estimate, Invoice } from "@spaceinvoices/js-sdk";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { useEntities } from "@/ui/providers/entities-context";
|
|
4
4
|
import { useSDK } from "@/ui/providers/sdk-provider";
|
|
5
5
|
|
|
6
|
-
type Document = Invoice | Estimate | CreditNote | AdvanceInvoice;
|
|
7
|
-
type DocumentType = "invoice" | "estimate" | "credit_note" | "advance_invoice";
|
|
6
|
+
type Document = Invoice | Estimate | CreditNote | AdvanceInvoice | DeliveryNote;
|
|
7
|
+
type DocumentType = "invoice" | "estimate" | "credit_note" | "advance_invoice" | "delivery_note";
|
|
8
8
|
|
|
9
9
|
// Document type labels for PDF filename
|
|
10
10
|
const TYPE_LABELS: Record<string, string> = {
|
|
@@ -12,6 +12,7 @@ const TYPE_LABELS: Record<string, string> = {
|
|
|
12
12
|
estimate: "Estimate",
|
|
13
13
|
credit_note: "Credit Note",
|
|
14
14
|
advance_invoice: "Advance Invoice",
|
|
15
|
+
delivery_note: "Delivery Note",
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
interface UseDocumentDownloadOptions {
|
|
@@ -37,7 +38,7 @@ export function useDocumentDownload({
|
|
|
37
38
|
/**
|
|
38
39
|
* Download PDF in specified locale
|
|
39
40
|
*/
|
|
40
|
-
const downloadPdf = async (document: Document, documentType: DocumentType,
|
|
41
|
+
const downloadPdf = async (document: Document, documentType: DocumentType, locale: string) => {
|
|
41
42
|
if (!sdk || !activeEntity?.id) {
|
|
42
43
|
onDownloadError?.("Download failed");
|
|
43
44
|
return;
|
|
@@ -50,7 +51,8 @@ export function useDocumentDownload({
|
|
|
50
51
|
// SDK signature: renderPdf(id, params?, SDKMethodOptions?)
|
|
51
52
|
// entity_id goes in SDKMethodOptions (last arg), not params
|
|
52
53
|
// Note: renderPdf is on invoices module but works with any document ID via /documents/{id}/pdf
|
|
53
|
-
const
|
|
54
|
+
const params = locale ? { locale } : {};
|
|
55
|
+
const blob = await sdk.invoices.renderPdf(document.id, params, { entity_id: activeEntity.id });
|
|
54
56
|
const downloadUrl = window.URL.createObjectURL(blob);
|
|
55
57
|
const link = window.document.createElement("a");
|
|
56
58
|
link.href = downloadUrl;
|
|
@@ -90,6 +92,7 @@ export function useDocumentDownload({
|
|
|
90
92
|
advance_invoice: "advance_invoice",
|
|
91
93
|
credit_note: "credit_note",
|
|
92
94
|
estimate: "estimate",
|
|
95
|
+
delivery_note: "delivery_note",
|
|
93
96
|
};
|
|
94
97
|
|
|
95
98
|
// e-SLOG download - cast to any since the SDK structure may vary
|