@loczer/storefront-sdk 0.224.0 → 0.226.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/DocumentAcceptanceSection.d.ts +2 -1
- package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.js +27 -27
- package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/Invoice.js +6 -3
- package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts +2 -1
- package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/InvoiceDetails.js +111 -106
- package/dist/components/ContractSaleDocument/PageFooter.d.ts +2 -1
- package/dist/components/ContractSaleDocument/PageFooter.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/PageFooter.js +10 -9
- package/dist/components/ContractSaleDocument/PageHeader.d.ts +2 -1
- package/dist/components/ContractSaleDocument/PageHeader.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/PageHeader.js +10 -9
- package/dist/i18n/fr.js +2 -2
- package/dist/storefront.css +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,8 @@ type DocumentAcceptanceSectionProps = {
|
|
|
4
4
|
documentLanguage: ContractSaleDocumentLanguage;
|
|
5
5
|
formatDate: (date: Date | string | number) => string;
|
|
6
6
|
className?: string;
|
|
7
|
+
compact?: boolean;
|
|
7
8
|
};
|
|
8
|
-
export declare function DocumentAcceptanceSection({ saleDocument, documentLanguage, formatDate, className, }: DocumentAcceptanceSectionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export declare function DocumentAcceptanceSection({ saleDocument, documentLanguage, formatDate, className, compact, }: DocumentAcceptanceSectionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=DocumentAcceptanceSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentAcceptanceSection.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/DocumentAcceptanceSection.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,gCAAgC,CAAA;AAIvC,KAAK,8BAA8B,GAAG;IACpC,YAAY,EAAE,oBAAoB,CAAA;IAClC,gBAAgB,EAAE,4BAA4B,CAAA;IAC9C,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,KAAK,MAAM,CAAA;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"DocumentAcceptanceSection.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/DocumentAcceptanceSection.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,gCAAgC,CAAA;AAIvC,KAAK,8BAA8B,GAAG;IACpC,YAAY,EAAE,oBAAoB,CAAA;IAClC,gBAAgB,EAAE,4BAA4B,CAAA;IAC9C,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,KAAK,MAAM,CAAA;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,wBAAgB,yBAAyB,CAAC,EACxC,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,OAAe,GAChB,EAAE,8BAA8B,kDAgHhC"}
|
|
@@ -3,59 +3,59 @@ import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
|
3
3
|
import { useTranslation as i } from "react-i18next";
|
|
4
4
|
import { cn as a } from "@rpcbase/ui";
|
|
5
5
|
//#region src/components/ContractSaleDocument/DocumentAcceptanceSection.tsx
|
|
6
|
-
function o({ saleDocument: o, documentLanguage: s, formatDate: c, className: l }) {
|
|
7
|
-
let { t:
|
|
6
|
+
function o({ saleDocument: o, documentLanguage: s, formatDate: c, className: l, compact: u = !1 }) {
|
|
7
|
+
let { t: d } = i(), f = (t, n = {}) => e(d, s, t, n), p = o.acceptance?.mode === "signature" ? o.acceptance : null, m = o.acceptance?.mode === "acceptance" ? o.acceptance : null, h = o.acceptanceLevel === "signature" || p !== null;
|
|
8
8
|
return o.acceptanceLevel === "none" && !o.acceptance ? null : /* @__PURE__ */ n("section", {
|
|
9
|
-
className: a("mt-auto border-t border-border pt-8", l),
|
|
9
|
+
className: a("mt-auto border-t border-border", u ? "pt-3" : "pt-8", l),
|
|
10
10
|
"data-testid": "contract-sale-document-acceptance-section",
|
|
11
|
-
children:
|
|
12
|
-
className: "
|
|
13
|
-
children: /* @__PURE__ */ n("span", { children:
|
|
14
|
-
}),
|
|
11
|
+
children: h ? /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("p", {
|
|
12
|
+
className: a("text-center text-sm text-muted-foreground", u ? "mb-4" : "mb-12"),
|
|
13
|
+
children: /* @__PURE__ */ n("span", { children: f("docs_contract_sale_signature_acknowledgement") })
|
|
14
|
+
}), p ? /* @__PURE__ */ r("div", {
|
|
15
15
|
className: "flex flex-col justify-between md:flex-row",
|
|
16
16
|
children: [/* @__PURE__ */ r("div", {
|
|
17
17
|
className: "mb-8 w-full md:mb-0 md:w-2/5",
|
|
18
18
|
children: [
|
|
19
19
|
/* @__PURE__ */ n("p", {
|
|
20
20
|
className: "font-semibold text-foreground",
|
|
21
|
-
children: /* @__PURE__ */ n("span", { children:
|
|
21
|
+
children: /* @__PURE__ */ n("span", { children: f("docs_contract_sale_signature_issuer_label") })
|
|
22
22
|
}),
|
|
23
23
|
/* @__PURE__ */ n("p", {
|
|
24
24
|
className: "mb-2 mt-2 text-sm text-muted-foreground",
|
|
25
|
-
children: /* @__PURE__ */ r("span", { children: [
|
|
25
|
+
children: /* @__PURE__ */ r("span", { children: [f("docs_contract_sale_signature_date_label"), ": ___________________"] })
|
|
26
26
|
}),
|
|
27
|
-
/* @__PURE__ */ n("div", { className: "
|
|
27
|
+
/* @__PURE__ */ n("div", { className: a("rounded-lg bg-muted/40", u ? "h-20" : "h-24") })
|
|
28
28
|
]
|
|
29
29
|
}), /* @__PURE__ */ r("div", {
|
|
30
30
|
className: "w-full text-left md:w-2/5",
|
|
31
31
|
children: [
|
|
32
32
|
/* @__PURE__ */ n("p", {
|
|
33
33
|
className: "font-semibold text-foreground",
|
|
34
|
-
children: /* @__PURE__ */ n("span", { children:
|
|
34
|
+
children: /* @__PURE__ */ n("span", { children: f("docs_contract_sale_signature_customer_label") })
|
|
35
35
|
}),
|
|
36
36
|
/* @__PURE__ */ n("p", {
|
|
37
37
|
className: "mb-2 mt-2 text-sm text-muted-foreground",
|
|
38
38
|
children: /* @__PURE__ */ r("span", { children: [
|
|
39
|
-
|
|
39
|
+
f("docs_contract_sale_signature_date_label"),
|
|
40
40
|
": ",
|
|
41
|
-
c(
|
|
41
|
+
c(p.date)
|
|
42
42
|
] })
|
|
43
43
|
}),
|
|
44
44
|
/* @__PURE__ */ n("div", {
|
|
45
|
-
className: "flex
|
|
45
|
+
className: a("flex items-center justify-center rounded-lg bg-muted/40 p-2", u ? "h-20" : "h-24"),
|
|
46
46
|
children: /* @__PURE__ */ n("img", {
|
|
47
|
-
src:
|
|
48
|
-
alt:
|
|
47
|
+
src: p.signature,
|
|
48
|
+
alt: f("docs_contract_sale_signature_image_alt"),
|
|
49
49
|
className: "max-h-full max-w-full"
|
|
50
50
|
})
|
|
51
51
|
}),
|
|
52
52
|
/* @__PURE__ */ n("p", {
|
|
53
|
-
className: "
|
|
54
|
-
children: /* @__PURE__ */ n("span", { children:
|
|
53
|
+
className: a("text-sm text-foreground", u ? "mt-1" : "mt-2"),
|
|
54
|
+
children: /* @__PURE__ */ n("span", { children: p.name })
|
|
55
55
|
}),
|
|
56
56
|
/* @__PURE__ */ n("p", {
|
|
57
57
|
className: "text-sm text-muted-foreground",
|
|
58
|
-
children: /* @__PURE__ */ n("span", { children:
|
|
58
|
+
children: /* @__PURE__ */ n("span", { children: p.phone })
|
|
59
59
|
})
|
|
60
60
|
]
|
|
61
61
|
})]
|
|
@@ -66,36 +66,36 @@ function o({ saleDocument: o, documentLanguage: s, formatDate: c, className: l }
|
|
|
66
66
|
children: [
|
|
67
67
|
/* @__PURE__ */ n("p", {
|
|
68
68
|
className: "font-semibold text-foreground",
|
|
69
|
-
children: /* @__PURE__ */ n("span", { children:
|
|
69
|
+
children: /* @__PURE__ */ n("span", { children: f("docs_contract_sale_signature_issuer_label") })
|
|
70
70
|
}),
|
|
71
71
|
/* @__PURE__ */ n("p", {
|
|
72
72
|
className: "mb-2 mt-2 text-sm text-muted-foreground",
|
|
73
|
-
children: /* @__PURE__ */ r("span", { children: [
|
|
73
|
+
children: /* @__PURE__ */ r("span", { children: [f("docs_contract_sale_signature_date_label"), ": ___________________"] })
|
|
74
74
|
}),
|
|
75
|
-
/* @__PURE__ */ n("div", { className: "
|
|
75
|
+
/* @__PURE__ */ n("div", { className: a("rounded-lg bg-muted/40", u ? "h-20" : "h-24") })
|
|
76
76
|
]
|
|
77
77
|
}), /* @__PURE__ */ r("div", {
|
|
78
78
|
className: "w-full md:w-2/5",
|
|
79
79
|
children: [
|
|
80
80
|
/* @__PURE__ */ n("p", {
|
|
81
81
|
className: "font-semibold text-foreground",
|
|
82
|
-
children: /* @__PURE__ */ n("span", { children:
|
|
82
|
+
children: /* @__PURE__ */ n("span", { children: f("docs_contract_sale_signature_customer_label") })
|
|
83
83
|
}),
|
|
84
84
|
/* @__PURE__ */ n("p", {
|
|
85
85
|
className: "mb-2 mt-2 text-sm text-muted-foreground",
|
|
86
|
-
children: /* @__PURE__ */ r("span", { children: [
|
|
86
|
+
children: /* @__PURE__ */ r("span", { children: [f("docs_contract_sale_signature_date_label"), ": ___________________"] })
|
|
87
87
|
}),
|
|
88
|
-
/* @__PURE__ */ n("div", { className: "
|
|
88
|
+
/* @__PURE__ */ n("div", { className: a("rounded-lg bg-muted/40", u ? "h-20" : "h-24") })
|
|
89
89
|
]
|
|
90
90
|
})]
|
|
91
91
|
})] }) : /* @__PURE__ */ r("div", {
|
|
92
92
|
className: "rounded-lg border border-border bg-muted/30 p-4",
|
|
93
93
|
children: [/* @__PURE__ */ n("p", {
|
|
94
94
|
className: "text-sm font-medium text-foreground",
|
|
95
|
-
children: /* @__PURE__ */ n("span", { children:
|
|
95
|
+
children: /* @__PURE__ */ n("span", { children: f(m ? "docs_contract_sale_acceptance_section_accepted_title" : "docs_contract_sale_acceptance_section_required_title") })
|
|
96
96
|
}), /* @__PURE__ */ n("p", {
|
|
97
97
|
className: "mt-1 text-sm text-muted-foreground",
|
|
98
|
-
children: /* @__PURE__ */ n("span", { children:
|
|
98
|
+
children: /* @__PURE__ */ n("span", { children: m ? f("docs_contract_sale_acceptance_section_accepted_date", { date: c(m.date) }) : f("docs_contract_sale_acceptance_section_required_description") })
|
|
99
99
|
})]
|
|
100
100
|
})
|
|
101
101
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Invoice.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/Invoice.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,oBAAoB,IAAI,wBAAwB,EAChD,oCAAoC,EAKrC,MAAM,gCAAgC,CAAA;AAUvC,OAAO,eAAe,CAAA;AAOtB,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,wBAAwB,CAAA;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,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;AAsKD,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EAAE,WAAW,EACjB,cAAqB,EACrB,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":"AAOA,OAAO,KAAK,EACV,oBAAoB,IAAI,wBAAwB,EAChD,oCAAoC,EAKrC,MAAM,gCAAgC,CAAA;AAUvC,OAAO,eAAe,CAAA;AAOtB,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,wBAAwB,CAAA;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,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;AAsKD,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EAAE,WAAW,EACjB,cAAqB,EACrB,sBAA6B,EAC7B,UAAuB,EACvB,UAA0B,EAC1B,iBAAiB,EACjB,QAAQ,GACT,EAAE,yBAAyB,2CAsiB3B;AAED,YAAY,EAAE,yBAAyB,EAAE,CAAA"}
|
|
@@ -306,7 +306,8 @@ function x({ data: c, showAppendices: h = !0, withEnglishTranslation: g = !0, he
|
|
|
306
306
|
saleDocumentNumber: w.saleDocumentNumber,
|
|
307
307
|
currentPage: t + 1,
|
|
308
308
|
totalPages: Y,
|
|
309
|
-
documentLanguage: U
|
|
309
|
+
documentLanguage: U,
|
|
310
|
+
compact: C
|
|
310
311
|
}),
|
|
311
312
|
e.kind === "invoice" ? /* @__PURE__ */ f(i, {
|
|
312
313
|
saleDocument: w,
|
|
@@ -320,7 +321,8 @@ function x({ data: c, showAppendices: h = !0, withEnglishTranslation: g = !0, he
|
|
|
320
321
|
showNotesSection: e.showNotesSection,
|
|
321
322
|
showAcceptanceSection: e.showAcceptanceSection,
|
|
322
323
|
documentQrCodeUrl: e.showInvoiceMeta && me ? F : void 0,
|
|
323
|
-
documentLanguage: U
|
|
324
|
+
documentLanguage: U,
|
|
325
|
+
compact: C
|
|
324
326
|
}) : /* @__PURE__ */ f("main", {
|
|
325
327
|
className: "flex flex-grow flex-col px-4 text-left md:px-8",
|
|
326
328
|
children: /* @__PURE__ */ f(ee, {
|
|
@@ -335,7 +337,8 @@ function x({ data: c, showAppendices: h = !0, withEnglishTranslation: g = !0, he
|
|
|
335
337
|
saleDocumentNumber: w.saleDocumentNumber,
|
|
336
338
|
currentPage: t + 1,
|
|
337
339
|
totalPages: Y,
|
|
338
|
-
documentLanguage: U
|
|
340
|
+
documentLanguage: U,
|
|
341
|
+
compact: C
|
|
339
342
|
})
|
|
340
343
|
]
|
|
341
344
|
}, e.key);
|
|
@@ -12,7 +12,8 @@ type InvoiceDetailsProps = {
|
|
|
12
12
|
showNotesSection?: boolean;
|
|
13
13
|
showAcceptanceSection?: boolean;
|
|
14
14
|
documentQrCodeUrl?: string;
|
|
15
|
+
compact?: boolean;
|
|
15
16
|
};
|
|
16
|
-
export declare function InvoiceDetails({ saleDocument, items, subtotal, tax, total, formatDate, documentLanguage, showInvoiceMeta, showTotalsSection, showNotesSection, showAcceptanceSection, documentQrCodeUrl, }: InvoiceDetailsProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function InvoiceDetails({ saleDocument, items, subtotal, tax, total, formatDate, documentLanguage, showInvoiceMeta, showTotalsSection, showNotesSection, showAcceptanceSection, documentQrCodeUrl, compact, }: InvoiceDetailsProps): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export {};
|
|
18
19
|
//# sourceMappingURL=InvoiceDetails.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvoiceDetails.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/InvoiceDetails.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InvoiceDetails.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/InvoiceDetails.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,gCAAgC,CAAA;AAKvC,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;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AA0CD,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,EACjB,OAAe,GAChB,EAAE,mBAAmB,2CAyQrB"}
|
|
@@ -2,12 +2,13 @@ import { formatContractSaleDocumentLabel as e, formatContractSaleDocumentLegalLa
|
|
|
2
2
|
import { DocumentAcceptanceSection as n } from "./DocumentAcceptanceSection.js";
|
|
3
3
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
import { useTranslation as a } from "react-i18next";
|
|
5
|
+
import { cn as o } from "@rpcbase/ui";
|
|
5
6
|
//#region src/components/ContractSaleDocument/InvoiceDetails.tsx
|
|
6
|
-
function
|
|
7
|
+
function s(e) {
|
|
7
8
|
let t = e?.trim() ?? "";
|
|
8
9
|
return !t || t === "-" ? "" : t;
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
+
function c(e, t, n) {
|
|
11
12
|
let r = t.trim().toUpperCase();
|
|
12
13
|
try {
|
|
13
14
|
return new Intl.NumberFormat(n, {
|
|
@@ -18,7 +19,7 @@ function s(e, t, n) {
|
|
|
18
19
|
return `${e.toFixed(2)} ${r}`;
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
+
function l(e, t, n) {
|
|
22
23
|
let r = e instanceof Date ? e : new Date(e);
|
|
23
24
|
if (Number.isNaN(r.getTime())) return "-";
|
|
24
25
|
try {
|
|
@@ -34,9 +35,9 @@ function c(e, t, n) {
|
|
|
34
35
|
}).format(r);
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
-
let { t:
|
|
39
|
-
let n =
|
|
38
|
+
function u({ saleDocument: u, items: d, subtotal: f, tax: p, total: m, formatDate: h, documentLanguage: g, showInvoiceMeta: _ = !0, showTotalsSection: v = !0, showNotesSection: y = !0, showAcceptanceSection: b = !0, documentQrCodeUrl: x, compact: S = !1 }) {
|
|
39
|
+
let { t: C } = a(), w = (t, n = {}) => e(C, g, t, n), T = (e, n = {}) => t(C, g, e, n), E = (e, t = {}) => {
|
|
40
|
+
let n = w(e, t), a = n.indexOf(" / ");
|
|
40
41
|
return a === -1 ? /* @__PURE__ */ r("span", { children: n }) : /* @__PURE__ */ i("span", {
|
|
41
42
|
className: "inline-flex flex-col text-left leading-snug",
|
|
42
43
|
children: [/* @__PURE__ */ r("span", { children: n.slice(0, a) }), /* @__PURE__ */ r("span", {
|
|
@@ -44,146 +45,146 @@ function l({ saleDocument: l, items: u, subtotal: d, tax: f, total: p, formatDat
|
|
|
44
45
|
children: n.slice(a + 3)
|
|
45
46
|
})]
|
|
46
47
|
});
|
|
47
|
-
},
|
|
48
|
+
}, D = !v && !y && !b, O = s(u.issuer.address), k = s(u.recipient.address), A = u.recipient.email?.trim() ?? "", j = u.kind === "credit_note", M = w(j ? "docs_contract_sale_credit_note_title" : u.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"), N = w(j ? "docs_contract_sale_credit_note_date_label" : u.kind === "quote" ? "docs_contract_sale_quote_date_label" : "docs_contract_sale_invoice_date_label"), P = w(j ? "docs_contract_sale_credit_note_recipient_label" : "docs_contract_sale_invoice_recipient_label"), F = j ? -1 : 1;
|
|
48
49
|
return /* @__PURE__ */ i("main", {
|
|
49
50
|
className: "flex flex-grow flex-col px-4 md:px-8",
|
|
50
51
|
children: [
|
|
51
|
-
|
|
52
|
-
className: "mb-8
|
|
52
|
+
_ && /* @__PURE__ */ i("header", {
|
|
53
|
+
className: o("grid", S ? "mb-4 gap-3" : "mb-8 gap-6"),
|
|
53
54
|
children: [/* @__PURE__ */ i("div", {
|
|
54
|
-
className: "grid
|
|
55
|
+
className: o("grid md:grid-cols-2", S ? "gap-3 md:gap-4" : "gap-6 md:gap-8"),
|
|
55
56
|
children: [/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ i("h1", {
|
|
56
|
-
className: "flex flex-wrap items-baseline gap-x-2 gap-y-1
|
|
57
|
-
children: [/* @__PURE__ */ r("span", { children:
|
|
57
|
+
className: o("flex flex-wrap items-baseline gap-x-2 gap-y-1 font-semibold text-foreground", S ? "text-lg" : "text-xl"),
|
|
58
|
+
children: [/* @__PURE__ */ r("span", { children: M }), /* @__PURE__ */ i("span", {
|
|
58
59
|
className: "font-normal text-muted-foreground",
|
|
59
|
-
children: ["#",
|
|
60
|
+
children: ["#", u.saleDocumentNumber]
|
|
60
61
|
})]
|
|
61
|
-
}),
|
|
62
|
-
className: "mt-4 h-24 w-24",
|
|
62
|
+
}), x === void 0 ? null : /* @__PURE__ */ r("div", {
|
|
63
|
+
className: o(S ? "mt-2 h-16 w-16" : "mt-4 h-24 w-24"),
|
|
63
64
|
"data-testid": "contract-sale-document-public-url-qr-container",
|
|
64
|
-
children:
|
|
65
|
-
src:
|
|
66
|
-
alt:
|
|
65
|
+
children: x ? /* @__PURE__ */ r("img", {
|
|
66
|
+
src: x,
|
|
67
|
+
alt: C("docs_contract_sale_qr_alt"),
|
|
67
68
|
className: "block h-full w-full",
|
|
68
69
|
"data-testid": "contract-sale-document-public-url-qr"
|
|
69
70
|
}) : null
|
|
70
71
|
})] }), /* @__PURE__ */ i("div", {
|
|
71
|
-
className: "md:text-right",
|
|
72
|
+
className: o("md:text-right", S && "text-sm leading-5"),
|
|
72
73
|
children: [/* @__PURE__ */ i("div", {
|
|
73
74
|
className: "mb-2",
|
|
74
75
|
children: [/* @__PURE__ */ r("p", {
|
|
75
76
|
className: "font-semibold text-foreground",
|
|
76
|
-
children:
|
|
77
|
+
children: N
|
|
77
78
|
}), /* @__PURE__ */ r("p", {
|
|
78
79
|
className: "text-muted-foreground",
|
|
79
|
-
children:
|
|
80
|
+
children: h(u.date)
|
|
80
81
|
})]
|
|
81
82
|
}), /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("p", {
|
|
82
83
|
className: "font-semibold text-foreground",
|
|
83
|
-
children:
|
|
84
|
+
children: w("docs_contract_sale_due_date_label")
|
|
84
85
|
}), /* @__PURE__ */ r("p", {
|
|
85
86
|
className: "text-muted-foreground",
|
|
86
|
-
children:
|
|
87
|
+
children: h(u.dueDate)
|
|
87
88
|
})] })]
|
|
88
89
|
})]
|
|
89
90
|
}), /* @__PURE__ */ i("div", {
|
|
90
|
-
className: "grid
|
|
91
|
+
className: o("grid md:grid-cols-2", S ? "gap-3 md:gap-4" : "gap-6 md:gap-8"),
|
|
91
92
|
children: [/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("h2", {
|
|
92
|
-
className: "
|
|
93
|
-
children:
|
|
94
|
-
}),
|
|
93
|
+
className: o("font-semibold text-primary", S ? "text-lg" : "text-xl"),
|
|
94
|
+
children: u.issuer.name
|
|
95
|
+
}), O ? /* @__PURE__ */ r("p", {
|
|
95
96
|
className: "text-muted-foreground whitespace-pre-line",
|
|
96
|
-
children:
|
|
97
|
+
children: O
|
|
97
98
|
}) : null] }), /* @__PURE__ */ i("div", {
|
|
98
|
-
className: "md:text-right",
|
|
99
|
+
className: o("md:text-right", S && "text-sm leading-5"),
|
|
99
100
|
children: [
|
|
100
101
|
/* @__PURE__ */ r("h3", {
|
|
101
102
|
className: "mb-2 font-semibold text-foreground",
|
|
102
|
-
children:
|
|
103
|
+
children: P
|
|
103
104
|
}),
|
|
104
105
|
/* @__PURE__ */ r("p", {
|
|
105
106
|
className: "font-bold text-foreground",
|
|
106
|
-
children:
|
|
107
|
+
children: u.recipient.name
|
|
107
108
|
}),
|
|
108
|
-
|
|
109
|
+
k ? /* @__PURE__ */ r("p", {
|
|
109
110
|
className: "text-muted-foreground whitespace-pre-line",
|
|
110
|
-
children:
|
|
111
|
+
children: k
|
|
111
112
|
}) : null,
|
|
112
|
-
|
|
113
|
+
A ? /* @__PURE__ */ r("p", {
|
|
113
114
|
className: "text-muted-foreground",
|
|
114
|
-
children:
|
|
115
|
+
children: A
|
|
115
116
|
}) : null
|
|
116
117
|
]
|
|
117
118
|
})]
|
|
118
119
|
})]
|
|
119
120
|
}),
|
|
120
|
-
|
|
121
|
-
className: "
|
|
121
|
+
_ && u.rental ? /* @__PURE__ */ r("section", {
|
|
122
|
+
className: o("border-y border-border", S ? "mb-3 py-2" : "mb-6 py-3"),
|
|
122
123
|
"data-testid": "contract-sale-document-rental-details",
|
|
123
|
-
children:
|
|
124
|
-
className: "
|
|
125
|
-
children: [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
})
|
|
156
|
-
|
|
157
|
-
})
|
|
124
|
+
children: /* @__PURE__ */ i("dl", {
|
|
125
|
+
className: o("grid", S ? "gap-0.5 text-[13px] leading-[18px]" : "gap-1 text-sm"),
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ i("div", {
|
|
128
|
+
className: "flex items-baseline gap-1 whitespace-nowrap",
|
|
129
|
+
children: [/* @__PURE__ */ r("dt", {
|
|
130
|
+
className: "font-medium text-foreground",
|
|
131
|
+
children: /* @__PURE__ */ i("span", { children: [w("docs_contract_sale_booking_number_label"), ":"] })
|
|
132
|
+
}), /* @__PURE__ */ r("dd", {
|
|
133
|
+
className: "text-muted-foreground",
|
|
134
|
+
children: /* @__PURE__ */ r("span", { children: u.rental.bookingNumber })
|
|
135
|
+
})]
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ i("div", {
|
|
138
|
+
className: "flex items-baseline gap-1 whitespace-nowrap",
|
|
139
|
+
children: [/* @__PURE__ */ r("dt", {
|
|
140
|
+
className: "font-medium text-foreground",
|
|
141
|
+
children: /* @__PURE__ */ i("span", { children: [w("docs_contract_sale_rental_start_label"), ":"] })
|
|
142
|
+
}), /* @__PURE__ */ r("dd", {
|
|
143
|
+
className: "text-muted-foreground",
|
|
144
|
+
children: /* @__PURE__ */ r("span", { children: l(u.rental.start, g.legal, u.rental.timeZone) })
|
|
145
|
+
})]
|
|
146
|
+
}),
|
|
147
|
+
/* @__PURE__ */ i("div", {
|
|
148
|
+
className: "flex items-baseline gap-1 whitespace-nowrap",
|
|
149
|
+
children: [/* @__PURE__ */ r("dt", {
|
|
150
|
+
className: "font-medium text-foreground",
|
|
151
|
+
children: /* @__PURE__ */ i("span", { children: [w("docs_contract_sale_rental_end_label"), ":"] })
|
|
152
|
+
}), /* @__PURE__ */ r("dd", {
|
|
153
|
+
className: "text-muted-foreground",
|
|
154
|
+
children: /* @__PURE__ */ r("span", { children: l(u.rental.end, g.legal, u.rental.timeZone) })
|
|
155
|
+
})]
|
|
156
|
+
})
|
|
157
|
+
]
|
|
158
|
+
})
|
|
158
159
|
}) : null,
|
|
159
160
|
/* @__PURE__ */ i("section", {
|
|
160
|
-
className:
|
|
161
|
+
className: o(D ? "mb-0 flex flex-grow flex-col" : S ? "mb-4" : "mb-8"),
|
|
161
162
|
children: [/* @__PURE__ */ i("div", {
|
|
162
|
-
className: "flex bg-muted p-2 text-
|
|
163
|
+
className: o("flex bg-muted font-semibold text-muted-foreground", S ? "p-2 text-sm leading-5" : "p-2 text-xs md:p-3 md:text-base"),
|
|
163
164
|
children: [
|
|
164
165
|
/* @__PURE__ */ r("div", {
|
|
165
166
|
className: "w-5/12 pr-2 md:w-1/2",
|
|
166
|
-
children: /* @__PURE__ */ r("span", { children:
|
|
167
|
+
children: /* @__PURE__ */ r("span", { children: T("docs_contract_sale_description_label") })
|
|
167
168
|
}),
|
|
168
169
|
/* @__PURE__ */ r("div", {
|
|
169
170
|
className: "w-1/6 text-center",
|
|
170
|
-
children: /* @__PURE__ */ r("span", { children:
|
|
171
|
+
children: /* @__PURE__ */ r("span", { children: T("docs_contract_sale_quantity_label") })
|
|
171
172
|
}),
|
|
172
173
|
/* @__PURE__ */ r("div", {
|
|
173
174
|
className: "w-3/12 text-right md:w-1/6",
|
|
174
|
-
children: /* @__PURE__ */ r("span", { children:
|
|
175
|
+
children: /* @__PURE__ */ r("span", { children: T("docs_contract_sale_unit_price_label") })
|
|
175
176
|
}),
|
|
176
177
|
/* @__PURE__ */ r("div", {
|
|
177
178
|
className: "w-1/6 text-right",
|
|
178
|
-
children: /* @__PURE__ */ r("span", { children:
|
|
179
|
+
children: /* @__PURE__ */ r("span", { children: T("docs_contract_sale_line_total_label") })
|
|
179
180
|
})
|
|
180
181
|
]
|
|
181
182
|
}), /* @__PURE__ */ r("div", {
|
|
182
|
-
className:
|
|
183
|
-
children:
|
|
184
|
-
let t = 1 + (e.taxRate ??
|
|
183
|
+
className: D ? "flex flex-1 flex-col" : "flex flex-col",
|
|
184
|
+
children: d.map((e) => {
|
|
185
|
+
let t = 1 + (e.taxRate ?? u.taxRate ?? 0);
|
|
185
186
|
return /* @__PURE__ */ i("div", {
|
|
186
|
-
className: "flex items-center border-b border-border p-2 text-sm md:p-3 md:text-base",
|
|
187
|
+
className: o("flex items-center border-b border-border", S ? "p-2 text-sm leading-5" : "p-2 text-sm md:p-3 md:text-base"),
|
|
187
188
|
children: [
|
|
188
189
|
/* @__PURE__ */ r("div", {
|
|
189
190
|
className: "w-5/12 pr-2 md:w-1/2",
|
|
@@ -201,19 +202,19 @@ function l({ saleDocument: l, items: u, subtotal: d, tax: f, total: p, formatDat
|
|
|
201
202
|
}),
|
|
202
203
|
/* @__PURE__ */ r("div", {
|
|
203
204
|
className: "w-3/12 text-right md:w-1/6",
|
|
204
|
-
children: /* @__PURE__ */ r("span", { children:
|
|
205
|
+
children: /* @__PURE__ */ r("span", { children: c(e.unitPrice / t * F, u.currency, g.customer) })
|
|
205
206
|
}),
|
|
206
207
|
/* @__PURE__ */ r("div", {
|
|
207
208
|
className: "w-1/6 text-right",
|
|
208
|
-
children: /* @__PURE__ */ r("span", { children:
|
|
209
|
+
children: /* @__PURE__ */ r("span", { children: c(e.quantity * e.unitPrice / t * F, u.currency, g.customer) })
|
|
209
210
|
})
|
|
210
211
|
]
|
|
211
212
|
}, e.id);
|
|
212
213
|
})
|
|
213
214
|
})]
|
|
214
215
|
}),
|
|
215
|
-
|
|
216
|
-
className: "
|
|
216
|
+
v && /* @__PURE__ */ r("section", {
|
|
217
|
+
className: o("flex justify-end", S ? "mb-6 text-sm leading-5" : "mb-16"),
|
|
217
218
|
children: /* @__PURE__ */ i("div", {
|
|
218
219
|
className: "w-full md:w-1/3",
|
|
219
220
|
children: [
|
|
@@ -221,52 +222,56 @@ function l({ saleDocument: l, items: u, subtotal: d, tax: f, total: p, formatDat
|
|
|
221
222
|
className: "mb-2 flex items-start justify-between gap-4",
|
|
222
223
|
children: [/* @__PURE__ */ r("span", {
|
|
223
224
|
className: "text-muted-foreground",
|
|
224
|
-
children:
|
|
225
|
+
children: E("docs_contract_sale_subtotal_label")
|
|
225
226
|
}), /* @__PURE__ */ r("span", {
|
|
226
227
|
className: "shrink-0 text-right font-semibold",
|
|
227
|
-
children:
|
|
228
|
+
children: c(f, u.currency, g.customer)
|
|
228
229
|
})]
|
|
229
230
|
}),
|
|
230
|
-
|
|
231
|
+
p !== 0 && /* @__PURE__ */ i("div", {
|
|
231
232
|
className: "mb-2 flex items-start justify-between gap-4",
|
|
232
233
|
children: [/* @__PURE__ */ r("span", {
|
|
233
234
|
className: "text-muted-foreground",
|
|
234
|
-
children:
|
|
235
|
+
children: E("docs_contract_sale_tax_label", { rate: ((u.taxRate ?? 0) * 100).toFixed(0) })
|
|
235
236
|
}), /* @__PURE__ */ r("span", {
|
|
236
237
|
className: "shrink-0 text-right font-semibold",
|
|
237
|
-
children:
|
|
238
|
+
children: c(p, u.currency, g.customer)
|
|
238
239
|
})]
|
|
239
240
|
}),
|
|
240
241
|
/* @__PURE__ */ i("div", {
|
|
241
242
|
className: "mt-2 flex items-start justify-between gap-4 border-t border-border pt-2",
|
|
242
243
|
children: [/* @__PURE__ */ r("span", {
|
|
243
|
-
className: "text-
|
|
244
|
-
children:
|
|
244
|
+
className: o("font-bold", S ? "text-lg" : "text-xl"),
|
|
245
|
+
children: E("docs_contract_sale_total_label")
|
|
245
246
|
}), /* @__PURE__ */ r("span", {
|
|
246
|
-
className: "shrink-0 text-right text-
|
|
247
|
-
children:
|
|
247
|
+
className: o("shrink-0 text-right font-bold", S ? "text-lg" : "text-xl"),
|
|
248
|
+
children: c(m, u.currency, g.customer)
|
|
248
249
|
})]
|
|
249
250
|
})
|
|
250
251
|
]
|
|
251
252
|
})
|
|
252
253
|
}),
|
|
253
|
-
|
|
254
|
-
className: "mb-16",
|
|
254
|
+
y && u.notes && /* @__PURE__ */ i("section", {
|
|
255
|
+
className: o(S ? "mb-6" : "mb-16"),
|
|
255
256
|
children: [/* @__PURE__ */ r("h3", {
|
|
256
|
-
className: "
|
|
257
|
-
children:
|
|
257
|
+
className: o("border-b border-border font-semibold text-foreground", S ? "mb-2 pb-1" : "mb-4 pb-2"),
|
|
258
|
+
children: w("docs_contract_sale_notes_title")
|
|
258
259
|
}), /* @__PURE__ */ r("div", {
|
|
259
|
-
className: "
|
|
260
|
-
children: /* @__PURE__ */ r("p", {
|
|
260
|
+
className: "text-sm text-muted-foreground",
|
|
261
|
+
children: /* @__PURE__ */ r("p", {
|
|
262
|
+
className: "whitespace-pre-wrap break-words",
|
|
263
|
+
children: u.notes
|
|
264
|
+
})
|
|
261
265
|
})]
|
|
262
266
|
}),
|
|
263
|
-
|
|
264
|
-
saleDocument:
|
|
265
|
-
documentLanguage:
|
|
266
|
-
formatDate:
|
|
267
|
+
b ? /* @__PURE__ */ r(n, {
|
|
268
|
+
saleDocument: u,
|
|
269
|
+
documentLanguage: g,
|
|
270
|
+
formatDate: h,
|
|
271
|
+
compact: S
|
|
267
272
|
}) : null
|
|
268
273
|
]
|
|
269
274
|
});
|
|
270
275
|
}
|
|
271
276
|
//#endregion
|
|
272
|
-
export {
|
|
277
|
+
export { u as InvoiceDetails };
|
|
@@ -5,7 +5,8 @@ type PageFooterProps = {
|
|
|
5
5
|
currentPage: number;
|
|
6
6
|
totalPages: number;
|
|
7
7
|
documentLanguage: ContractSaleDocumentLanguage;
|
|
8
|
+
compact?: boolean;
|
|
8
9
|
};
|
|
9
|
-
export declare function PageFooter({ documentTitle, saleDocumentNumber, currentPage, totalPages, documentLanguage, }: PageFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function PageFooter({ documentTitle, saleDocumentNumber, currentPage, totalPages, documentLanguage, compact, }: PageFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
11
12
|
//# sourceMappingURL=PageFooter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageFooter.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/PageFooter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PageFooter.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/PageFooter.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAIlF,KAAK,eAAe,GAAG;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,4BAA4B,CAAA;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,wBAAgB,UAAU,CAAC,EACzB,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,OAAe,GAChB,EAAE,eAAe,2CAsBjB"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { formatContractSaleDocumentLegalLabel as e } from "./language.js";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import { useTranslation as r } from "react-i18next";
|
|
4
|
+
import { cn as i } from "@rpcbase/ui";
|
|
4
5
|
//#region src/components/ContractSaleDocument/PageFooter.tsx
|
|
5
|
-
function
|
|
6
|
-
let { t:
|
|
7
|
-
current_page:
|
|
8
|
-
total_pages:
|
|
6
|
+
function a({ documentTitle: a, saleDocumentNumber: o, currentPage: s, totalPages: c, documentLanguage: l, compact: u = !1 }) {
|
|
7
|
+
let { t: d } = r(), f = e(d, l, "docs_contract_sale_page_counter", {
|
|
8
|
+
current_page: s,
|
|
9
|
+
total_pages: c
|
|
9
10
|
});
|
|
10
11
|
return /* @__PURE__ */ n("footer", {
|
|
11
|
-
className: "
|
|
12
|
+
className: i("hidden items-center justify-between border-t border-border px-4 text-sm text-muted-foreground md:flex md:px-8", u ? "mt-3 py-2" : "mt-12 pb-4 pt-4"),
|
|
12
13
|
children: [/* @__PURE__ */ n("span", { children: [
|
|
13
|
-
|
|
14
|
+
a,
|
|
14
15
|
" #",
|
|
15
|
-
|
|
16
|
-
] }),
|
|
16
|
+
o
|
|
17
|
+
] }), c > 1 && /* @__PURE__ */ t("span", { children: f })]
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
20
|
//#endregion
|
|
20
|
-
export {
|
|
21
|
+
export { a as PageFooter };
|