@loczer/storefront-sdk 0.178.0 → 0.179.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/Invoice.js +9 -9
- package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/InvoiceDetails.js +57 -57
- package/dist/i18n/en.d.ts +2 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +2 -0
- package/dist/i18n/fr.d.ts +2 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +2 -0
- package/dist/index.d.ts +9 -0
- package/dist/lib/contractSaleDocument.d.ts +2 -0
- package/dist/lib/contractSaleDocument.d.ts.map +1 -1
- package/dist/lib/contractSaleDocument.js +1 -1
- package/dist/lib/contractSaleDocumentApi.d.ts +3 -0
- package/dist/lib/contractSaleDocumentApi.d.ts.map +1 -1
- package/dist/pages/ContractSaleDocumentPage.d.ts +1 -1
- package/dist/pages/ContractSaleDocumentPage.js +12 -12
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Invoice.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/Invoice.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,oBAAoB,IAAI,wBAAwB,EAChD,oCAAoC,EAIrC,MAAM,gCAAgC,CAAA;AAWvC,OAAO,eAAe,CAAA;AAGtB,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,wBAAwB,CAAA;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,UAAU,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAClC,UAAU,CAAC,EAAE,aAAa,GAAG,KAAK,CAAA;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,CACT,UAAU,EAAE,oCAAoC,KAC7C,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,GAAG,wBAAwB,GAAG,IAAI,CAAA;CAChF,CAAA;AAwJD,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EAAE,WAAW,EACjB,aAAoB,EACpB,sBAA6B,EAC7B,UAAuB,EACvB,UAA0B,EAC1B,iBAAiB,EACjB,QAAQ,GACT,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"Invoice.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/Invoice.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,oBAAoB,IAAI,wBAAwB,EAChD,oCAAoC,EAIrC,MAAM,gCAAgC,CAAA;AAWvC,OAAO,eAAe,CAAA;AAGtB,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,wBAAwB,CAAA;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,UAAU,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAClC,UAAU,CAAC,EAAE,aAAa,GAAG,KAAK,CAAA;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,CACT,UAAU,EAAE,oCAAoC,KAC7C,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,GAAG,wBAAwB,GAAG,IAAI,CAAA;CAChF,CAAA;AAwJD,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EAAE,WAAW,EACjB,aAAoB,EACpB,sBAA6B,EAC7B,UAAuB,EACvB,UAA0B,EAC1B,iBAAiB,EACjB,QAAQ,GACT,EAAE,yBAAyB,2CAqe3B;AAED,YAAY,EAAE,yBAAyB,EAAE,CAAA"}
|
|
@@ -84,7 +84,7 @@ const U = 22, G = 10, j = 14, re = 14, Ge = 3, je = 6, ae = (o, r) => {
|
|
|
84
84
|
title: r,
|
|
85
85
|
showTitle: f === 0,
|
|
86
86
|
articles: S
|
|
87
|
-
})),
|
|
87
|
+
})), qe = (o) => o.kind === "credit_note" ? [] : !o.terms || o.terms.articles.length === 0 ? Oe : o.terms.articles, Ve = (o) => o.terms?.title ?? $e;
|
|
88
88
|
function ut({
|
|
89
89
|
data: o,
|
|
90
90
|
showTermsPage: r = !0,
|
|
@@ -94,7 +94,7 @@ function ut({
|
|
|
94
94
|
publicDocumentUrl: S,
|
|
95
95
|
onAccept: f
|
|
96
96
|
}) {
|
|
97
|
-
const { t: u, i18n: M } = xe(), _ = S?.trim() ?? "", d = b === "pdf", [n, D] = h(o), [L, z] = h(!1), [Q, w] = h(null), [se,
|
|
97
|
+
const { t: u, i18n: M } = xe(), _ = S?.trim() ?? "", d = b === "pdf", [n, D] = h(o), [L, z] = h(!1), [Q, w] = h(null), [se, q] = h(0), [$, V] = h([]), [ie, O] = h(!0), [le, I] = h(0), [X, A] = h(""), [ue, B] = h(
|
|
98
98
|
_.length === 0 && !d
|
|
99
99
|
), F = H(null), W = H(null), v = H([]);
|
|
100
100
|
p(() => {
|
|
@@ -121,7 +121,7 @@ function ut({
|
|
|
121
121
|
e = !0;
|
|
122
122
|
};
|
|
123
123
|
}, [_, d]);
|
|
124
|
-
const m = He(n, M.language), de = (e, t = {}) => Ue(u, m, e, t), me = n.kind === "credit_note" ? -1 : 1, N = n.items.reduce((e, t) => e + t.quantity * t.unitPrice, 0) * me, K = n.taxRate != null ? N / (1 + n.taxRate) : N, he = n.taxRate != null ? N - K : 0, fe = n.kind === "credit_note" ? "docs_contract_sale_credit_note_title" : "docs_contract_sale_invoice_title", J = de(fe), Y =
|
|
124
|
+
const m = He(n, M.language), de = (e, t = {}) => Ue(u, m, e, t), me = n.kind === "credit_note" ? -1 : 1, N = n.items.reduce((e, t) => e + t.quantity * t.unitPrice, 0) * me, K = n.taxRate != null ? N / (1 + n.taxRate) : N, he = n.taxRate != null ? N - K : 0, fe = n.kind === "credit_note" ? "docs_contract_sale_credit_note_title" : n.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title", J = de(fe), Y = Ve(n), Z = qe(n), ge = ze(n.items), k = s, pe = r ? Qe(Z, Y, k) : [], x = [...ge, ...pe], i = x.length, _e = [
|
|
125
125
|
n.id,
|
|
126
126
|
n.kind,
|
|
127
127
|
n.saleDocumentNumber,
|
|
@@ -151,7 +151,7 @@ function ut({
|
|
|
151
151
|
let e = !1;
|
|
152
152
|
return (async () => {
|
|
153
153
|
if (d) {
|
|
154
|
-
|
|
154
|
+
V([]), O(!1);
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
157
|
O(!0), await new Promise((g) => setTimeout(g, 0));
|
|
@@ -172,11 +172,11 @@ function ut({
|
|
|
172
172
|
} catch (y) {
|
|
173
173
|
console.error("Thumbnail generation failed:", y);
|
|
174
174
|
}
|
|
175
|
-
e || (
|
|
175
|
+
e || (V(c), O(!1));
|
|
176
176
|
})(), () => {
|
|
177
177
|
e = !0;
|
|
178
178
|
};
|
|
179
|
-
}, [n, r, k, i, d,
|
|
179
|
+
}, [n, r, k, i, d, X]), p(() => {
|
|
180
180
|
if (d || $.length === 0)
|
|
181
181
|
return;
|
|
182
182
|
const e = v.current.slice(0, i).filter((c) => c != null);
|
|
@@ -203,11 +203,11 @@ function ut({
|
|
|
203
203
|
}, [$, i, d]), p(() => {
|
|
204
204
|
const e = W.current;
|
|
205
205
|
if (!C || !e) {
|
|
206
|
-
|
|
206
|
+
q(0);
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
209
|
const t = () => {
|
|
210
|
-
|
|
210
|
+
q(Math.ceil(e.getBoundingClientRect().height));
|
|
211
211
|
};
|
|
212
212
|
if (t(), typeof ResizeObserver > "u")
|
|
213
213
|
return;
|
|
@@ -285,7 +285,7 @@ function ut({
|
|
|
285
285
|
showTotalsSection: e.showTotalsSection,
|
|
286
286
|
showNotesSection: e.showNotesSection,
|
|
287
287
|
showAcceptanceSection: e.showAcceptanceSection,
|
|
288
|
-
documentQrCodeUrl: e.showInvoiceMeta ?
|
|
288
|
+
documentQrCodeUrl: e.showInvoiceMeta ? X : void 0,
|
|
289
289
|
documentLanguage: m
|
|
290
290
|
}
|
|
291
291
|
) : /* @__PURE__ */ a("main", { className: "flex-grow px-4 text-left md:px-8", children: /* @__PURE__ */ a(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvoiceDetails.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/InvoiceDetails.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,gCAAgC,CAAA;AAIvC,KAAK,mBAAmB,GAAG;IACzB,YAAY,EAAE,oBAAoB,CAAA;IAClC,KAAK,EAAE,4BAA4B,EAAE,CAAA;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,KAAK,MAAM,CAAA;IACpD,gBAAgB,EAAE,4BAA4B,CAAA;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAoBD,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,GAAG,EACH,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,eAAsB,EACtB,iBAAwB,EACxB,gBAAuB,EACvB,qBAA4B,EAC5B,iBAAiB,GAClB,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"InvoiceDetails.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/InvoiceDetails.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,gCAAgC,CAAA;AAIvC,KAAK,mBAAmB,GAAG;IACzB,YAAY,EAAE,oBAAoB,CAAA;IAClC,KAAK,EAAE,4BAA4B,EAAE,CAAA;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,KAAK,MAAM,CAAA;IACpD,gBAAgB,EAAE,4BAA4B,CAAA;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAoBD,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,GAAG,EACH,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,eAAsB,EACtB,iBAAwB,EACxB,gBAAuB,EACvB,qBAA4B,EAC5B,iBAAiB,GAClB,EAAE,mBAAmB,2CA2OrB"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as E } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as T } from "react-i18next";
|
|
3
3
|
import { formatContractSaleDocumentLabel as B, formatContractSaleDocumentLegalLabel as G } from "./language.js";
|
|
4
|
-
function I(
|
|
5
|
-
const l =
|
|
4
|
+
function I(t) {
|
|
5
|
+
const l = t?.trim() ?? "";
|
|
6
6
|
return !l || l === "-" ? "" : l;
|
|
7
7
|
}
|
|
8
|
-
function i(
|
|
8
|
+
function i(t, l, p) {
|
|
9
9
|
const o = l.trim().toUpperCase();
|
|
10
10
|
try {
|
|
11
11
|
return new Intl.NumberFormat(p, {
|
|
12
12
|
style: "currency",
|
|
13
13
|
currency: o
|
|
14
|
-
}).format(
|
|
14
|
+
}).format(t);
|
|
15
15
|
} catch {
|
|
16
|
-
return `${
|
|
16
|
+
return `${t.toFixed(2)} ${o}`;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
function M({
|
|
20
|
-
saleDocument:
|
|
20
|
+
saleDocument: t,
|
|
21
21
|
items: l,
|
|
22
22
|
subtotal: p,
|
|
23
23
|
tax: o,
|
|
@@ -32,26 +32,26 @@ function M({
|
|
|
32
32
|
}) {
|
|
33
33
|
const { t: x } = T(), r = (a, d = {}) => B(x, s, a, d), m = (a, d = {}) => G(x, s, a, d), f = (a, d = {}) => {
|
|
34
34
|
const h = r(a, d), C = " / ", g = h.indexOf(C);
|
|
35
|
-
return g === -1 ? /* @__PURE__ */ e("span", { children: h }) : /* @__PURE__ */
|
|
35
|
+
return g === -1 ? /* @__PURE__ */ e("span", { children: h }) : /* @__PURE__ */ c("span", { className: "inline-flex flex-col text-left leading-snug", children: [
|
|
36
36
|
/* @__PURE__ */ e("span", { children: h.slice(0, g) }),
|
|
37
37
|
/* @__PURE__ */ e("span", { className: "text-[0.9em] font-normal", children: h.slice(g + C.length) })
|
|
38
38
|
] });
|
|
39
|
-
},
|
|
40
|
-
u ? "docs_contract_sale_credit_note_title" : "docs_contract_sale_invoice_title"
|
|
39
|
+
}, q = !N && !v && !w, k = I(t.issuer.address), j = I(t.recipient.address), L = t.recipient.email?.trim() ?? "", n = t.acceptance?.mode === "signature" ? t.acceptance : null, b = t.acceptance?.mode === "acceptance" ? t.acceptance : null, z = t.acceptanceLevel === "signature" || n !== null, u = t.kind === "credit_note", O = r(
|
|
40
|
+
u ? "docs_contract_sale_credit_note_title" : t.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"
|
|
41
41
|
), S = r(
|
|
42
|
-
u ? "docs_contract_sale_credit_note_date_label" : "docs_contract_sale_invoice_date_label"
|
|
42
|
+
u ? "docs_contract_sale_credit_note_date_label" : t.kind === "quote" ? "docs_contract_sale_quote_date_label" : "docs_contract_sale_invoice_date_label"
|
|
43
43
|
), $ = r(
|
|
44
44
|
u ? "docs_contract_sale_credit_note_recipient_label" : "docs_contract_sale_invoice_recipient_label"
|
|
45
|
-
), A = u ? -1 : 1, F =
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
P && /* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
45
|
+
), A = u ? -1 : 1, F = t.taxRate != null ? 1 + t.taxRate : 1;
|
|
46
|
+
return /* @__PURE__ */ c("main", { className: "flex flex-grow flex-col px-4 md:px-8", children: [
|
|
47
|
+
P && /* @__PURE__ */ c("header", { className: "mb-8 grid gap-6", children: [
|
|
48
|
+
/* @__PURE__ */ c("div", { className: "grid gap-6 md:grid-cols-2 md:gap-8", children: [
|
|
49
|
+
/* @__PURE__ */ c("div", { children: [
|
|
50
|
+
/* @__PURE__ */ c("h1", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1 text-xl font-semibold text-foreground", children: [
|
|
51
51
|
/* @__PURE__ */ e("span", { children: O }),
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ c("span", { className: "font-normal text-muted-foreground", children: [
|
|
53
53
|
"#",
|
|
54
|
-
|
|
54
|
+
t.saleDocumentNumber
|
|
55
55
|
] })
|
|
56
56
|
] }),
|
|
57
57
|
y ? /* @__PURE__ */ e(
|
|
@@ -64,76 +64,76 @@ function M({
|
|
|
64
64
|
}
|
|
65
65
|
) : null
|
|
66
66
|
] }),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ c("div", { className: "md:text-right", children: [
|
|
68
|
+
/* @__PURE__ */ c("div", { className: "mb-2", children: [
|
|
69
69
|
/* @__PURE__ */ e("p", { className: "font-semibold text-foreground", children: S }),
|
|
70
|
-
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: _(
|
|
70
|
+
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: _(t.date) })
|
|
71
71
|
] }),
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ c("div", { children: [
|
|
73
73
|
/* @__PURE__ */ e("p", { className: "font-semibold text-foreground", children: r("docs_contract_sale_due_date_label") }),
|
|
74
|
-
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: _(
|
|
74
|
+
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: _(t.dueDate) })
|
|
75
75
|
] })
|
|
76
76
|
] })
|
|
77
77
|
] }),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */ e("h2", { className: "text-xl font-semibold text-primary", children:
|
|
78
|
+
/* @__PURE__ */ c("div", { className: "grid gap-6 md:grid-cols-2 md:gap-8", children: [
|
|
79
|
+
/* @__PURE__ */ c("div", { children: [
|
|
80
|
+
/* @__PURE__ */ e("h2", { className: "text-xl font-semibold text-primary", children: t.issuer.name }),
|
|
81
81
|
k ? /* @__PURE__ */ e("p", { className: "text-muted-foreground whitespace-pre-line", children: k }) : null
|
|
82
82
|
] }),
|
|
83
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ c("div", { className: "md:text-right", children: [
|
|
84
84
|
/* @__PURE__ */ e("h3", { className: "mb-2 font-semibold text-foreground", children: $ }),
|
|
85
|
-
/* @__PURE__ */ e("p", { className: "font-bold text-foreground", children:
|
|
86
|
-
|
|
85
|
+
/* @__PURE__ */ e("p", { className: "font-bold text-foreground", children: t.recipient.name }),
|
|
86
|
+
j ? /* @__PURE__ */ e("p", { className: "text-muted-foreground whitespace-pre-line", children: j }) : null,
|
|
87
87
|
L ? /* @__PURE__ */ e("p", { className: "text-muted-foreground", children: L }) : null
|
|
88
88
|
] })
|
|
89
89
|
] })
|
|
90
90
|
] }),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ c("section", { className: q ? "mb-0 flex flex-grow flex-col" : "mb-8", children: [
|
|
92
|
+
/* @__PURE__ */ c("div", { className: "flex bg-muted p-2 text-xs font-semibold text-muted-foreground md:p-3 md:text-base", children: [
|
|
93
93
|
/* @__PURE__ */ e("div", { className: "w-5/12 pr-2 md:w-1/2", children: /* @__PURE__ */ e("span", { children: m("docs_contract_sale_description_label") }) }),
|
|
94
94
|
/* @__PURE__ */ e("div", { className: "w-1/6 text-center", children: /* @__PURE__ */ e("span", { children: m("docs_contract_sale_quantity_label") }) }),
|
|
95
95
|
/* @__PURE__ */ e("div", { className: "w-3/12 text-right md:w-1/6", children: /* @__PURE__ */ e("span", { children: m("docs_contract_sale_unit_price_label") }) }),
|
|
96
96
|
/* @__PURE__ */ e("div", { className: "w-1/6 text-right", children: /* @__PURE__ */ e("span", { children: m("docs_contract_sale_line_total_label") }) })
|
|
97
97
|
] }),
|
|
98
|
-
/* @__PURE__ */ e("div", { className:
|
|
98
|
+
/* @__PURE__ */ e("div", { className: q ? "flex flex-1 flex-col" : "flex flex-col", children: l.map((a) => /* @__PURE__ */ c("div", { className: "flex items-center border-b border-border p-2 text-sm md:p-3 md:text-base", children: [
|
|
99
99
|
/* @__PURE__ */ e("div", { className: "w-5/12 pr-2 md:w-1/2", children: /* @__PURE__ */ e("span", { children: a.description }) }),
|
|
100
100
|
/* @__PURE__ */ e("div", { className: "w-1/6 text-center", children: /* @__PURE__ */ e("span", { children: a.quantity }) }),
|
|
101
|
-
/* @__PURE__ */ e("div", { className: "w-3/12 text-right md:w-1/6", children: /* @__PURE__ */ e("span", { children: i(a.unitPrice / F * A,
|
|
102
|
-
/* @__PURE__ */ e("div", { className: "w-1/6 text-right", children: /* @__PURE__ */ e("span", { children: i(a.quantity * a.unitPrice / F * A,
|
|
101
|
+
/* @__PURE__ */ e("div", { className: "w-3/12 text-right md:w-1/6", children: /* @__PURE__ */ e("span", { children: i(a.unitPrice / F * A, t.currency, s.customer) }) }),
|
|
102
|
+
/* @__PURE__ */ e("div", { className: "w-1/6 text-right", children: /* @__PURE__ */ e("span", { children: i(a.quantity * a.unitPrice / F * A, t.currency, s.customer) }) })
|
|
103
103
|
] }, a.id)) })
|
|
104
104
|
] }),
|
|
105
|
-
N && /* @__PURE__ */ e("section", { className: "mb-16 flex justify-end", children: /* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
105
|
+
N && /* @__PURE__ */ e("section", { className: "mb-16 flex justify-end", children: /* @__PURE__ */ c("div", { className: "w-full md:w-1/3", children: [
|
|
106
|
+
/* @__PURE__ */ c("div", { className: "mb-2 flex items-start justify-between gap-4", children: [
|
|
107
107
|
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: f("docs_contract_sale_subtotal_label") }),
|
|
108
|
-
/* @__PURE__ */ e("span", { className: "shrink-0 text-right font-semibold", children: i(p,
|
|
108
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-right font-semibold", children: i(p, t.currency, s.customer) })
|
|
109
109
|
] }),
|
|
110
|
-
|
|
111
|
-
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: f("docs_contract_sale_tax_label", { rate: (
|
|
112
|
-
/* @__PURE__ */ e("span", { className: "shrink-0 text-right font-semibold", children: i(o,
|
|
110
|
+
t.taxRate != null && /* @__PURE__ */ c("div", { className: "mb-2 flex items-start justify-between gap-4", children: [
|
|
111
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: f("docs_contract_sale_tax_label", { rate: (t.taxRate * 100).toFixed(0) }) }),
|
|
112
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-right font-semibold", children: i(o, t.currency, s.customer) })
|
|
113
113
|
] }),
|
|
114
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ c("div", { className: "mt-2 flex items-start justify-between gap-4 border-t border-border pt-2", children: [
|
|
115
115
|
/* @__PURE__ */ e("span", { className: "text-xl font-bold", children: f("docs_contract_sale_total_label") }),
|
|
116
|
-
/* @__PURE__ */ e("span", { className: "shrink-0 text-right text-xl font-bold", children: i(R,
|
|
116
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-right text-xl font-bold", children: i(R, t.currency, s.customer) })
|
|
117
117
|
] })
|
|
118
118
|
] }) }),
|
|
119
|
-
v &&
|
|
119
|
+
v && t.notes && /* @__PURE__ */ c("section", { className: "mb-16", children: [
|
|
120
120
|
/* @__PURE__ */ e("h3", { className: "mb-4 border-b border-border pb-2 font-semibold text-foreground", children: r("docs_contract_sale_notes_title") }),
|
|
121
|
-
/* @__PURE__ */ e("div", { className: "gap-8 text-sm text-muted-foreground md:columns-2", children: /* @__PURE__ */ e("p", { children:
|
|
121
|
+
/* @__PURE__ */ e("div", { className: "gap-8 text-sm text-muted-foreground md:columns-2", children: /* @__PURE__ */ e("p", { children: t.notes }) })
|
|
122
122
|
] }),
|
|
123
|
-
w && (
|
|
123
|
+
w && (t.acceptanceLevel !== "none" || t.acceptance) ? /* @__PURE__ */ e("section", { className: "mt-auto border-t border-border pt-8", children: z ? /* @__PURE__ */ c(E, { children: [
|
|
124
124
|
/* @__PURE__ */ e("p", { className: "mb-12 text-center text-sm text-muted-foreground", children: /* @__PURE__ */ e("span", { children: r("docs_contract_sale_signature_acknowledgement") }) }),
|
|
125
|
-
n ? /* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
125
|
+
n ? /* @__PURE__ */ c("div", { className: "flex flex-col justify-between md:flex-row", children: [
|
|
126
|
+
/* @__PURE__ */ c("div", { className: "mb-8 w-full md:mb-0 md:w-2/5", children: [
|
|
127
127
|
/* @__PURE__ */ e("p", { className: "font-semibold text-foreground", children: r("docs_contract_sale_signature_issuer_label") }),
|
|
128
|
-
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */ c("span", { children: [
|
|
129
129
|
r("docs_contract_sale_signature_date_label"),
|
|
130
130
|
": ___________________"
|
|
131
131
|
] }) }),
|
|
132
132
|
/* @__PURE__ */ e("div", { className: "h-24 rounded-lg bg-muted/40" })
|
|
133
133
|
] }),
|
|
134
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ c("div", { className: "w-full text-left md:w-2/5", children: [
|
|
135
135
|
/* @__PURE__ */ e("p", { className: "font-semibold text-foreground", children: r("docs_contract_sale_signature_customer_label") }),
|
|
136
|
-
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */ c("span", { children: [
|
|
137
137
|
r("docs_contract_sale_signature_date_label"),
|
|
138
138
|
": ",
|
|
139
139
|
_(n.date)
|
|
@@ -149,25 +149,25 @@ function M({
|
|
|
149
149
|
/* @__PURE__ */ e("p", { className: "mt-2 text-sm text-foreground", children: n.name }),
|
|
150
150
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: n.phone })
|
|
151
151
|
] })
|
|
152
|
-
] }) : /* @__PURE__ */
|
|
153
|
-
/* @__PURE__ */
|
|
152
|
+
] }) : /* @__PURE__ */ c("div", { className: "flex flex-col justify-between md:flex-row", children: [
|
|
153
|
+
/* @__PURE__ */ c("div", { className: "mb-8 w-full md:mb-0 md:w-2/5", children: [
|
|
154
154
|
/* @__PURE__ */ e("p", { className: "font-semibold text-foreground", children: r("docs_contract_sale_signature_issuer_label") }),
|
|
155
|
-
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */ c("span", { children: [
|
|
156
156
|
r("docs_contract_sale_signature_date_label"),
|
|
157
157
|
": ___________________"
|
|
158
158
|
] }) }),
|
|
159
159
|
/* @__PURE__ */ e("div", { className: "h-24 rounded-lg bg-muted/40" })
|
|
160
160
|
] }),
|
|
161
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ c("div", { className: "w-full md:w-2/5", children: [
|
|
162
162
|
/* @__PURE__ */ e("p", { className: "font-semibold text-foreground", children: r("docs_contract_sale_signature_customer_label") }),
|
|
163
|
-
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */ c("span", { children: [
|
|
164
164
|
r("docs_contract_sale_signature_date_label"),
|
|
165
165
|
": ___________________"
|
|
166
166
|
] }) }),
|
|
167
167
|
/* @__PURE__ */ e("div", { className: "h-24 rounded-lg bg-muted/40" })
|
|
168
168
|
] })
|
|
169
169
|
] })
|
|
170
|
-
] }) : /* @__PURE__ */
|
|
170
|
+
] }) : /* @__PURE__ */ c("div", { className: "rounded-lg border border-border bg-muted/30 p-4", children: [
|
|
171
171
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground", children: r(b ? "docs_contract_sale_acceptance_section_accepted_title" : "docs_contract_sale_acceptance_section_required_title") }),
|
|
172
172
|
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-muted-foreground", children: b ? r("docs_contract_sale_acceptance_section_accepted_date", {
|
|
173
173
|
date: _(b.date)
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -203,9 +203,11 @@ export declare const storefront: {
|
|
|
203
203
|
docs_contract_sale_download_pdf_error: string;
|
|
204
204
|
docs_contract_sale_qr_alt: string;
|
|
205
205
|
docs_contract_sale_invoice_title: string;
|
|
206
|
+
docs_contract_sale_quote_title: string;
|
|
206
207
|
docs_contract_sale_credit_note_title: string;
|
|
207
208
|
docs_contract_sale_page_counter: string;
|
|
208
209
|
docs_contract_sale_invoice_date_label: string;
|
|
210
|
+
docs_contract_sale_quote_date_label: string;
|
|
209
211
|
docs_contract_sale_credit_note_date_label: string;
|
|
210
212
|
docs_contract_sale_due_date_label: string;
|
|
211
213
|
docs_contract_sale_invoice_recipient_label: string;
|
package/dist/i18n/en.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuZtB,CAAA"}
|
package/dist/i18n/en.js
CHANGED
|
@@ -203,9 +203,11 @@ const e = {
|
|
|
203
203
|
docs_contract_sale_download_pdf_error: "Unable to download this document PDF.",
|
|
204
204
|
docs_contract_sale_qr_alt: "QR code for the online document link",
|
|
205
205
|
docs_contract_sale_invoice_title: "Invoice",
|
|
206
|
+
docs_contract_sale_quote_title: "Quote",
|
|
206
207
|
docs_contract_sale_credit_note_title: "Credit note",
|
|
207
208
|
docs_contract_sale_page_counter: "Page {{current_page}} of {{total_pages}}",
|
|
208
209
|
docs_contract_sale_invoice_date_label: "Invoice Date:",
|
|
210
|
+
docs_contract_sale_quote_date_label: "Quote Date:",
|
|
209
211
|
docs_contract_sale_credit_note_date_label: "Credit Note Date:",
|
|
210
212
|
docs_contract_sale_due_date_label: "Due Date:",
|
|
211
213
|
docs_contract_sale_invoice_recipient_label: "Bill To:",
|
package/dist/i18n/fr.d.ts
CHANGED
|
@@ -203,9 +203,11 @@ export declare const storefront: {
|
|
|
203
203
|
docs_contract_sale_download_pdf_error: string;
|
|
204
204
|
docs_contract_sale_qr_alt: string;
|
|
205
205
|
docs_contract_sale_invoice_title: string;
|
|
206
|
+
docs_contract_sale_quote_title: string;
|
|
206
207
|
docs_contract_sale_credit_note_title: string;
|
|
207
208
|
docs_contract_sale_page_counter: string;
|
|
208
209
|
docs_contract_sale_invoice_date_label: string;
|
|
210
|
+
docs_contract_sale_quote_date_label: string;
|
|
209
211
|
docs_contract_sale_credit_note_date_label: string;
|
|
210
212
|
docs_contract_sale_due_date_label: string;
|
|
211
213
|
docs_contract_sale_invoice_recipient_label: string;
|
package/dist/i18n/fr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuZtB,CAAA"}
|
package/dist/i18n/fr.js
CHANGED
|
@@ -203,9 +203,11 @@ const e = {
|
|
|
203
203
|
docs_contract_sale_download_pdf_error: "Impossible de télécharger le PDF de ce document.",
|
|
204
204
|
docs_contract_sale_qr_alt: "QR code du lien du document en ligne",
|
|
205
205
|
docs_contract_sale_invoice_title: "Facture",
|
|
206
|
+
docs_contract_sale_quote_title: "Devis",
|
|
206
207
|
docs_contract_sale_credit_note_title: "Avoir",
|
|
207
208
|
docs_contract_sale_page_counter: "Page {{current_page}} sur {{total_pages}}",
|
|
208
209
|
docs_contract_sale_invoice_date_label: "Date de facture :",
|
|
210
|
+
docs_contract_sale_quote_date_label: "Date du devis :",
|
|
209
211
|
docs_contract_sale_credit_note_date_label: "Date de l'avoir :",
|
|
210
212
|
docs_contract_sale_due_date_label: "Date d'échéance :",
|
|
211
213
|
docs_contract_sale_invoice_recipient_label: "Facturé à :",
|
package/dist/index.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export declare const acceptContractSaleDocumentResponseSchema: z.ZodObject<{
|
|
|
54
54
|
document: z.ZodOptional<z.ZodObject<{
|
|
55
55
|
id: z.ZodString;
|
|
56
56
|
kind: z.ZodEnum<{
|
|
57
|
+
quote: "quote";
|
|
57
58
|
invoice: "invoice";
|
|
58
59
|
credit_note: "credit_note";
|
|
59
60
|
}>;
|
|
@@ -948,6 +949,7 @@ export declare const contractSaleDocumentApiAcceptanceSchema: z.ZodObject<{
|
|
|
948
949
|
export declare const contractSaleDocumentApiSchema: z.ZodObject<{
|
|
949
950
|
id: z.ZodString;
|
|
950
951
|
kind: z.ZodEnum<{
|
|
952
|
+
quote: "quote";
|
|
951
953
|
invoice: "invoice";
|
|
952
954
|
credit_note: "credit_note";
|
|
953
955
|
}>;
|
|
@@ -1094,6 +1096,7 @@ export declare type ContractSaleDocumentData = z.infer<typeof contractSaleDocume
|
|
|
1094
1096
|
export declare type ContractSaleDocumentKind = z.infer<typeof contractSaleDocumentKindSchema>;
|
|
1095
1097
|
|
|
1096
1098
|
export declare const contractSaleDocumentKindSchema: z.ZodEnum<{
|
|
1099
|
+
quote: "quote";
|
|
1097
1100
|
invoice: "invoice";
|
|
1098
1101
|
credit_note: "credit_note";
|
|
1099
1102
|
}>;
|
|
@@ -1163,6 +1166,7 @@ export declare const contractSaleDocumentReferenceTypeSchema: z.ZodEnum<{
|
|
|
1163
1166
|
export declare const contractSaleDocumentSchema: z.ZodObject<{
|
|
1164
1167
|
id: z.ZodString;
|
|
1165
1168
|
kind: z.ZodEnum<{
|
|
1169
|
+
quote: "quote";
|
|
1166
1170
|
invoice: "invoice";
|
|
1167
1171
|
credit_note: "credit_note";
|
|
1168
1172
|
}>;
|
|
@@ -1604,6 +1608,7 @@ export declare const getContractSaleDocumentResponseSchema: z.ZodObject<{
|
|
|
1604
1608
|
document: z.ZodOptional<z.ZodObject<{
|
|
1605
1609
|
id: z.ZodString;
|
|
1606
1610
|
kind: z.ZodEnum<{
|
|
1611
|
+
quote: "quote";
|
|
1607
1612
|
invoice: "invoice";
|
|
1608
1613
|
credit_note: "credit_note";
|
|
1609
1614
|
}>;
|
|
@@ -3647,9 +3652,11 @@ export declare const storefrontEn: {
|
|
|
3647
3652
|
docs_contract_sale_download_pdf_error: string;
|
|
3648
3653
|
docs_contract_sale_qr_alt: string;
|
|
3649
3654
|
docs_contract_sale_invoice_title: string;
|
|
3655
|
+
docs_contract_sale_quote_title: string;
|
|
3650
3656
|
docs_contract_sale_credit_note_title: string;
|
|
3651
3657
|
docs_contract_sale_page_counter: string;
|
|
3652
3658
|
docs_contract_sale_invoice_date_label: string;
|
|
3659
|
+
docs_contract_sale_quote_date_label: string;
|
|
3653
3660
|
docs_contract_sale_credit_note_date_label: string;
|
|
3654
3661
|
docs_contract_sale_due_date_label: string;
|
|
3655
3662
|
docs_contract_sale_invoice_recipient_label: string;
|
|
@@ -4085,9 +4092,11 @@ export declare const storefrontFr: {
|
|
|
4085
4092
|
docs_contract_sale_download_pdf_error: string;
|
|
4086
4093
|
docs_contract_sale_qr_alt: string;
|
|
4087
4094
|
docs_contract_sale_invoice_title: string;
|
|
4095
|
+
docs_contract_sale_quote_title: string;
|
|
4088
4096
|
docs_contract_sale_credit_note_title: string;
|
|
4089
4097
|
docs_contract_sale_page_counter: string;
|
|
4090
4098
|
docs_contract_sale_invoice_date_label: string;
|
|
4099
|
+
docs_contract_sale_quote_date_label: string;
|
|
4091
4100
|
docs_contract_sale_credit_note_date_label: string;
|
|
4092
4101
|
docs_contract_sale_due_date_label: string;
|
|
4093
4102
|
docs_contract_sale_invoice_recipient_label: string;
|
|
@@ -74,6 +74,7 @@ export declare const contractSaleDocumentAcceptanceRecordSchema: z.ZodDiscrimina
|
|
|
74
74
|
date: z.ZodDate;
|
|
75
75
|
}, z.core.$strip>], "mode">;
|
|
76
76
|
export declare const contractSaleDocumentKindSchema: z.ZodEnum<{
|
|
77
|
+
quote: "quote";
|
|
77
78
|
invoice: "invoice";
|
|
78
79
|
credit_note: "credit_note";
|
|
79
80
|
}>;
|
|
@@ -98,6 +99,7 @@ export declare const contractSaleDocumentLanguageSchema: z.ZodObject<{
|
|
|
98
99
|
export declare const contractSaleDocumentSchema: z.ZodObject<{
|
|
99
100
|
id: z.ZodString;
|
|
100
101
|
kind: z.ZodEnum<{
|
|
102
|
+
quote: "quote";
|
|
101
103
|
invoice: "invoice";
|
|
102
104
|
credit_note: "credit_note";
|
|
103
105
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractSaleDocument.d.ts","sourceRoot":"","sources":["../../src/lib/contractSaleDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,i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
|
-
]), g = t.enum(["invoice", "credit_note"]), e = t.enum(["fr", "en"]), p = t.object({
|
|
35
|
+
]), g = t.enum(["quote", "invoice", "credit_note"]), e = t.enum(["fr", "en"]), p = t.object({
|
|
36
36
|
legal: e,
|
|
37
37
|
customer: e,
|
|
38
38
|
translation: e.optional()
|
|
@@ -41,6 +41,7 @@ export type ContractSaleDocumentApiAcceptanceRecord = z.infer<typeof contractSal
|
|
|
41
41
|
export declare const contractSaleDocumentApiSchema: z.ZodObject<{
|
|
42
42
|
id: z.ZodString;
|
|
43
43
|
kind: z.ZodEnum<{
|
|
44
|
+
quote: "quote";
|
|
44
45
|
invoice: "invoice";
|
|
45
46
|
credit_note: "credit_note";
|
|
46
47
|
}>;
|
|
@@ -194,6 +195,7 @@ export declare const getContractSaleDocumentResponseSchema: z.ZodObject<{
|
|
|
194
195
|
document: z.ZodOptional<z.ZodObject<{
|
|
195
196
|
id: z.ZodString;
|
|
196
197
|
kind: z.ZodEnum<{
|
|
198
|
+
quote: "quote";
|
|
197
199
|
invoice: "invoice";
|
|
198
200
|
credit_note: "credit_note";
|
|
199
201
|
}>;
|
|
@@ -332,6 +334,7 @@ export declare const acceptContractSaleDocumentResponseSchema: z.ZodObject<{
|
|
|
332
334
|
document: z.ZodOptional<z.ZodObject<{
|
|
333
335
|
id: z.ZodString;
|
|
334
336
|
kind: z.ZodEnum<{
|
|
337
|
+
quote: "quote";
|
|
335
338
|
invoice: "invoice";
|
|
336
339
|
credit_note: "credit_note";
|
|
337
340
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractSaleDocumentApi.d.ts","sourceRoot":"","sources":["../../src/lib/contractSaleDocumentApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAqBvB,eAAO,MAAM,uCAAuC;;;EAA8B,CAAA;AAClF,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKhD,CAAA;AACF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAA;AAEnG,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;iBAMlD,CAAA;AACF,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAA;AAEvG,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKnD,CAAA;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAA"}
|
|
@@ -15,7 +15,7 @@ export declare const loader: ({ ctx, params }: import('@rpcbase/client').LoaderA
|
|
|
15
15
|
documentLanguage: StorefrontI18nLanguage | null;
|
|
16
16
|
document: {
|
|
17
17
|
id: string;
|
|
18
|
-
kind: "invoice" | "credit_note";
|
|
18
|
+
kind: "quote" | "invoice" | "credit_note";
|
|
19
19
|
saleDocumentNumber: string;
|
|
20
20
|
currency: string;
|
|
21
21
|
issuer: {
|
|
@@ -2,11 +2,11 @@ import { jsx as t, jsxs as g } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as b, useEffect as T } from "react";
|
|
3
3
|
import { Menu as _ } from "@base-ui/react/menu";
|
|
4
4
|
import { toast as D } from "@rpcbase/client";
|
|
5
|
-
import { cn as
|
|
6
|
-
import { useLoaderData as
|
|
5
|
+
import { cn as B } from "@rpcbase/ui";
|
|
6
|
+
import { useLoaderData as K, useLocation as H, useNavigate as W, Link as I } from "@rpcbase/router";
|
|
7
7
|
import { Spinner as J } from "../chunks/ui/dist/Spinner/index-SbbUxcsT.js";
|
|
8
8
|
import { ArrowLeft as $, Download as Q, ChevronDown as V } from "lucide-react";
|
|
9
|
-
import { useTranslation as
|
|
9
|
+
import { useTranslation as z } from "react-i18next";
|
|
10
10
|
import { apiPost as X, apiGet as Y } from "../lib/apiCall.js";
|
|
11
11
|
import { ContractSaleDocument as M } from "../components/ContractSaleDocument/Invoice.js";
|
|
12
12
|
import { ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE as Z, acceptContractSaleDocumentResponseSchema as ee, contractSaleDocumentApiSchema as te, DOWNLOAD_CONTRACT_SALE_DOCUMENT_PDF_ROUTE as ne, GET_CONTRACT_SALE_DOCUMENT_ROUTE as oe, getContractSaleDocumentResponseSchema as re } from "../lib/contractSaleDocumentApi.js";
|
|
@@ -36,7 +36,7 @@ const S = (e) => new URLSearchParams(e).get("pdf") === "1", C = (e) => v(new URL
|
|
|
36
36
|
);
|
|
37
37
|
return s.searchParams.set("lang", a), s.toString();
|
|
38
38
|
}, le = (e, n, o) => {
|
|
39
|
-
const s = `${o === "credit_note" ? "credit-note" : "invoice"}-${n?.trim() || "document"}.pdf`;
|
|
39
|
+
const s = `${o === "credit_note" ? "credit-note" : o === "quote" ? "quote" : "invoice"}-${n?.trim() || "document"}.pdf`;
|
|
40
40
|
if (!e)
|
|
41
41
|
return s;
|
|
42
42
|
const c = e.match(/filename\*=UTF-8''([^;]+)/i)?.[1];
|
|
@@ -64,7 +64,7 @@ function me({
|
|
|
64
64
|
selectedLanguage: e,
|
|
65
65
|
onChange: n
|
|
66
66
|
}) {
|
|
67
|
-
const { t: o } =
|
|
67
|
+
const { t: o } = z(), [a, s] = b(!1), c = F.find((r) => r.code === e) ?? ue;
|
|
68
68
|
return /* @__PURE__ */ g(_.Root, { open: a, onOpenChange: s, children: [
|
|
69
69
|
/* @__PURE__ */ t(
|
|
70
70
|
_.Trigger,
|
|
@@ -115,7 +115,7 @@ function me({
|
|
|
115
115
|
d.defaultPrevented || (n(r.code), s(!1));
|
|
116
116
|
},
|
|
117
117
|
"data-testid": `contract-sale-document-language-option-${r.code}`,
|
|
118
|
-
className:
|
|
118
|
+
className: B(
|
|
119
119
|
"relative flex cursor-pointer select-none items-center justify-between gap-3 whitespace-nowrap rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
|
|
120
120
|
e === r.code && "bg-accent"
|
|
121
121
|
),
|
|
@@ -183,20 +183,20 @@ const Ce = (async ({ ctx: e, params: n }) => {
|
|
|
183
183
|
error: null
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
-
}),
|
|
186
|
+
}), q = (e) => {
|
|
187
187
|
const n = te.safeParse(e);
|
|
188
188
|
return n.success ? n.data : null;
|
|
189
189
|
};
|
|
190
190
|
function Ee() {
|
|
191
|
-
const { t: e, i18n: n } =
|
|
192
|
-
|
|
191
|
+
const { t: e, i18n: n } = z(), o = K(), a = H(), s = W(), { storeSlug: c, referenceId: r, saleDocumentId: d } = o, p = o.pdfMode || S(a.search), [w, N] = b(
|
|
192
|
+
q(o.document)
|
|
193
193
|
), [E, R] = b(null), [y, k] = b(!1), [L, x] = b(o.error), f = C(a.search) ?? v(w?.language?.customer) ?? o.documentLanguage ?? v(n.language) ?? "fr", U = c && r && d ? de(c, r, d, f) : null, O = c && r && d ? ie(c, r, d, f) : "";
|
|
194
194
|
T(() => {
|
|
195
|
-
N(
|
|
195
|
+
N(q(o.document)), x(o.error);
|
|
196
196
|
}, [o.document, o.error]), T(() => {
|
|
197
197
|
v(n.language) !== f && n.changeLanguage(f);
|
|
198
198
|
}, [n, f]);
|
|
199
|
-
const
|
|
199
|
+
const j = (u) => {
|
|
200
200
|
if (u === f)
|
|
201
201
|
return;
|
|
202
202
|
n.changeLanguage(u);
|
|
@@ -263,7 +263,7 @@ function Ee() {
|
|
|
263
263
|
me,
|
|
264
264
|
{
|
|
265
265
|
selectedLanguage: f,
|
|
266
|
-
onChange:
|
|
266
|
+
onChange: j
|
|
267
267
|
}
|
|
268
268
|
),
|
|
269
269
|
U ? /* @__PURE__ */ g(
|