@flowselections/floriday-afhandeling-module 1.0.28 → 1.0.30

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.
@@ -72,27 +72,27 @@ export function ControleLijstPrint({ carts, onClose, lang = "nl", }) {
72
72
  const bn = b.cart.cartNumber ?? "\uFFFF";
73
73
  return an.localeCompare(bn);
74
74
  });
75
- const content = (_jsxs("div", { id: "controle-print-root", className: "fixed inset-0 z-[100] bg-white overflow-auto", lang: lang, children: [_jsxs("div", { className: "print:hidden sticky top-0 flex items-center justify-between p-3 border-b bg-white", children: [_jsx("div", { className: "font-semibold", children: t.checklistPrintView }), _jsxs("div", { className: "flex gap-2", children: [_jsxs(Button, { size: "sm", variant: "outline", onClick: () => window.print(), children: [_jsx(Printer, { className: "h-4 w-4 mr-2" }), t.reprint] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: onClose, children: [_jsx(X, { className: "h-4 w-4 mr-2" }), t.close] })] })] }), _jsxs("div", { className: "print-sheet p-8 print:p-0 max-w-[210mm] mx-auto text-black", children: [_jsxs("div", { className: "flex items-baseline justify-between border-b border-black pb-2 mb-4", children: [_jsx("h1", { className: "text-2xl font-bold", children: t.checklistTitle }), _jsx("div", { className: "text-sm", children: today })] }), _jsxs("div", { className: "text-sm mb-3", children: [t.totalCarts, ": ", _jsx("strong", { children: carts.length })] }), _jsxs("table", { className: "w-full text-[11px] border-collapse", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-b border-black", children: [_jsx("th", { className: "text-left py-1 pr-2", children: t.colKarnr }), _jsx("th", { className: "text-right py-1 pr-2", children: t.colFusten }), _jsx("th", { className: "text-left py-1 pr-2", children: t.colLand }), _jsx("th", { className: "text-left py-1 pr-2", children: t.colKlaarzetten }), _jsx("th", { className: "text-left py-1 pr-2", children: t.colStatus })] }) }), _jsxs("tbody", { children: [sortedCarts.map(({ cart: c, klaarzet }) => (_jsxs("tr", { className: "border-b border-gray-300", children: [_jsx("td", { className: "py-2 pr-2 font-mono font-bold whitespace-nowrap", children: c.cartNumber ?? "—" }), _jsx("td", { className: "py-2 pr-2 text-right whitespace-nowrap", children: c.cratesOnCart ?? "—" }), _jsx("td", { className: "py-2 pr-2 whitespace-nowrap font-semibold", children: countryCode(c.country) ?? c.country ?? "—" }), _jsx("td", { className: "py-2 pr-2 whitespace-nowrap font-semibold", children: klaarzet.label }), _jsx("td", { className: "py-2 pr-2 whitespace-nowrap", children: statusLabel(c.status, c.printedCount) })] }, `${c.orderSource}#${c.orderId}#${c.cartIndex}`))), sortedCarts.length === 0 && (_jsx("tr", { children: _jsx("td", { colSpan: 5, className: "py-6 text-center text-gray-500", children: t.noCartsToday }) }))] })] }), _jsxs("div", { className: "mt-6 text-[11px]", children: [_jsxs("div", { children: [t.checkedBy, ": ", _jsx("span", { className: "inline-block border-b border-black w-64" })] }), _jsxs("div", { className: "mt-2", children: [t.dateTime, ": ", _jsx("span", { className: "inline-block border-b border-black w-64" })] }), _jsxs("div", { className: "mt-2", children: [t.signature, ": ", _jsx("span", { className: "inline-block border-b border-black w-64" })] })] })] }), _jsx("style", { children: `
76
- @media print {
77
- @page { size: A4 portrait; margin: 12mm; }
78
- html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
79
- body > *:not(#controle-print-portal) { display: none !important; }
80
- #controle-print-portal, #controle-print-root {
81
- position: static !important;
82
- overflow: visible !important;
83
- height: auto !important;
84
- width: auto !important;
85
- background: #fff !important;
86
- }
87
- .print-sheet {
88
- max-width: none !important;
89
- padding: 0 !important;
90
- margin: 0 !important;
91
- }
92
- table { page-break-inside: auto; }
93
- tr { page-break-inside: avoid; page-break-after: auto; }
94
- thead { display: table-header-group; }
95
- }
75
+ const content = (_jsxs("div", { id: "controle-print-root", className: "fixed inset-0 z-[100] bg-white overflow-auto", lang: lang, children: [_jsxs("div", { className: "print:hidden sticky top-0 flex items-center justify-between p-3 border-b bg-white", children: [_jsx("div", { className: "font-semibold", children: t.checklistPrintView }), _jsxs("div", { className: "flex gap-2", children: [_jsxs(Button, { size: "sm", variant: "outline", onClick: () => window.print(), children: [_jsx(Printer, { className: "h-4 w-4 mr-2" }), t.reprint] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: onClose, children: [_jsx(X, { className: "h-4 w-4 mr-2" }), t.close] })] })] }), _jsxs("div", { className: "print-sheet p-8 print:p-0 max-w-[210mm] mx-auto text-black", children: [_jsxs("div", { className: "flex items-baseline justify-between border-b border-black pb-2 mb-4", children: [_jsx("h1", { className: "text-2xl font-bold", children: t.checklistTitle }), _jsx("div", { className: "text-sm", children: today })] }), _jsxs("div", { className: "text-sm mb-3", children: [t.totalCarts, ": ", _jsx("strong", { children: carts.length })] }), _jsxs("table", { className: "w-full text-[11px] border-collapse", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-b border-black", children: [_jsx("th", { className: "text-left py-1 pr-2", children: t.colKarnr }), _jsx("th", { className: "text-right py-1 pr-2", children: t.colFusten }), _jsx("th", { className: "text-left py-1 pr-2", children: t.colLand }), _jsx("th", { className: "text-left py-1 pr-2", children: t.colKlaarzetten }), _jsx("th", { className: "text-left py-1 pr-2", children: t.colStatus })] }) }), _jsxs("tbody", { children: [sortedCarts.map(({ cart: c, klaarzet }) => (_jsxs("tr", { className: "border-b border-gray-300", children: [_jsx("td", { className: "py-2 pr-2 font-mono font-bold whitespace-nowrap", children: c.cartNumber ?? "—" }), _jsx("td", { className: "py-2 pr-2 text-right whitespace-nowrap", children: c.cratesOnCart ?? "—" }), _jsx("td", { className: "py-2 pr-2 whitespace-nowrap font-semibold", children: countryCode(c.country) ?? c.country ?? "—" }), _jsx("td", { className: "py-2 pr-2 whitespace-nowrap font-semibold", children: klaarzet.label }), _jsx("td", { className: "py-2 pr-2 whitespace-nowrap", children: statusLabel(c.status, c.printedCount) })] }, `${c.orderSource}#${c.orderId}#${c.cartIndex}`))), sortedCarts.length === 0 && (_jsx("tr", { children: _jsx("td", { colSpan: 5, className: "py-6 text-center text-gray-500", children: t.noCartsToday }) }))] })] }), _jsxs("div", { className: "mt-6 text-[11px]", children: [_jsxs("div", { children: [t.checkedBy, ": ", _jsx("span", { className: "inline-block border-b border-black w-64" })] }), _jsxs("div", { className: "mt-2", children: [t.dateTime, ": ", _jsx("span", { className: "inline-block border-b border-black w-64" })] }), _jsxs("div", { className: "mt-2", children: [t.signature, ": ", _jsx("span", { className: "inline-block border-b border-black w-64" })] })] })] }), _jsx("style", { children: `
76
+ @media print {
77
+ @page { size: A4 portrait; margin: 12mm; }
78
+ html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
79
+ body > *:not(#controle-print-portal) { display: none !important; }
80
+ #controle-print-portal, #controle-print-root {
81
+ position: static !important;
82
+ overflow: visible !important;
83
+ height: auto !important;
84
+ width: auto !important;
85
+ background: #fff !important;
86
+ }
87
+ .print-sheet {
88
+ max-width: none !important;
89
+ padding: 0 !important;
90
+ margin: 0 !important;
91
+ }
92
+ table { page-break-inside: auto; }
93
+ tr { page-break-inside: avoid; page-break-after: auto; }
94
+ thead { display: table-header-group; }
95
+ }
96
96
  ` })] }));
97
97
  if (typeof document === "undefined")
98
98
  return null;
@@ -14,82 +14,82 @@ export function renderPakbonHtml(order, lang = "nl") {
14
14
  };
15
15
  const rows = order.lines.length
16
16
  ? order.lines
17
- .map((l) => `
18
- <tr>
19
- <td>${escapeHtml(l.description)}</td>
20
- <td style="text-align:right">${l.crates ?? ""}</td>
21
- <td>${escapeHtml(l.unit ?? "")}</td>
17
+ .map((l) => `
18
+ <tr>
19
+ <td>${escapeHtml(l.description)}</td>
20
+ <td style="text-align:right">${l.crates ?? ""}</td>
21
+ <td>${escapeHtml(l.unit ?? "")}</td>
22
22
  </tr>`)
23
23
  .join("")
24
24
  : `<tr><td colspan="3" style="text-align:center;color:#666">${escapeHtml(t.noLines)}</td></tr>`;
25
25
  const cartLabel = t.cartOf(order.cartIndex, order.cartTotal);
26
26
  const fustenLabel = order.cratesOnCart != null ? `${order.cratesOnCart}` : "—";
27
27
  const cartNumber = order.cartNumber ?? `${order.orderNumber}-${order.cartIndex}`;
28
- return `<!doctype html>
29
- <html lang="${escapeHtml(htmlLang)}">
30
- <head>
31
- <meta charset="utf-8">
32
- <title>${escapeHtml(t.packingSlip)} ${escapeHtml(order.orderNumber)} · ${escapeHtml(cartNumber)}</title>
33
- <style>
34
- @page {
35
- size: A4;
36
- margin: 16mm;
37
- @top-center { content: element(cartno); }
38
- }
39
- body { font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; color:#111; }
40
- h1 { margin: 0 0 4px; font-size: 26px; }
41
- .sub { color:#444; margin-bottom: 8px; }
42
-
43
- .cart-number-hero {
44
- position: running(cartno);
45
- font-size: 88px;
46
- font-weight: 900;
47
- letter-spacing: 4px;
48
- line-height: 1;
49
- color: #000;
50
- background: #fff;
51
- border: 4px solid #000;
52
- padding: 12px 20px;
53
- display: inline-block;
54
- margin: 6px 0 20px;
55
- font-family: "Arial Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
56
- }
57
-
58
- .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin: 8px 0 22px; }
59
- .grid div { font-size: 14px; }
60
- .label { color:#666; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
61
- .value { font-size: 16px; font-weight: 600; }
62
- table { width:100%; border-collapse: collapse; font-size: 14px; }
63
- th, td { padding: 8px 6px; border-bottom: 1px solid #ddd; vertical-align: top; }
64
- th { text-align: left; background:#f5f5f5; }
65
- .barcode-fallback { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; letter-spacing: 4px; padding: 8px 12px; border: 2px solid #111; display: inline-block; margin-top: 18px; }
66
- .footer { margin-top: 28px; font-size: 11px; color:#666; }
67
- </style>
68
- </head>
69
- <body>
70
- <h1>${escapeHtml(t.packingSlip)}</h1>
71
- <div class="sub">${escapeHtml(t.order)} ${escapeHtml(order.orderNumber)} · ${escapeHtml(cartLabel)}</div>
72
-
73
- <div class="cart-number-hero">${escapeHtml(cartNumber)}</div>
74
-
75
- <div class="grid">
76
- <div><div class="label">${escapeHtml(t.customer)}</div><div class="value">${escapeHtml(order.customerName)}</div></div>
77
- <div><div class="label">${escapeHtml(t.country)}</div><div class="value">${escapeHtml(order.country ?? "—")}</div></div>
78
- <div><div class="label">${escapeHtml(t.deliveryDate)}</div><div class="value">${fmt(order.deliveryDate)}</div></div>
79
- <div><div class="label">${escapeHtml(t.pickDate)}</div><div class="value">${fmt(order.pickDate)}</div></div>
80
- <div><div class="label">${escapeHtml(t.cart)}</div><div class="value">${escapeHtml(cartLabel)}</div></div>
81
- <div><div class="label">${escapeHtml(t.cratesOnThisCart)}</div><div class="value">${escapeHtml(fustenLabel)}</div></div>
82
- </div>
83
-
84
- <table>
85
- <thead><tr><th>${escapeHtml(t.description)}</th><th style="text-align:right;width:90px">${escapeHtml(t.crates)}</th><th style="width:90px">${escapeHtml(t.unit)}</th></tr></thead>
86
- <tbody>${rows}</tbody>
87
- </table>
88
-
89
- <div class="barcode-fallback">*${escapeHtml(order.orderNumber)}*</div>
90
-
91
- <div class="footer">${escapeHtml(t.printedVia)} · ${new Date().toLocaleString(locale)}</div>
92
- </body>
28
+ return `<!doctype html>
29
+ <html lang="${escapeHtml(htmlLang)}">
30
+ <head>
31
+ <meta charset="utf-8">
32
+ <title>${escapeHtml(t.packingSlip)} ${escapeHtml(order.orderNumber)} · ${escapeHtml(cartNumber)}</title>
33
+ <style>
34
+ @page {
35
+ size: A4;
36
+ margin: 16mm;
37
+ @top-center { content: element(cartno); }
38
+ }
39
+ body { font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; color:#111; }
40
+ h1 { margin: 0 0 4px; font-size: 26px; }
41
+ .sub { color:#444; margin-bottom: 8px; }
42
+
43
+ .cart-number-hero {
44
+ position: running(cartno);
45
+ font-size: 88px;
46
+ font-weight: 900;
47
+ letter-spacing: 4px;
48
+ line-height: 1;
49
+ color: #000;
50
+ background: #fff;
51
+ border: 4px solid #000;
52
+ padding: 12px 20px;
53
+ display: inline-block;
54
+ margin: 6px 0 20px;
55
+ font-family: "Arial Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
56
+ }
57
+
58
+ .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin: 8px 0 22px; }
59
+ .grid div { font-size: 14px; }
60
+ .label { color:#666; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
61
+ .value { font-size: 16px; font-weight: 600; }
62
+ table { width:100%; border-collapse: collapse; font-size: 14px; }
63
+ th, td { padding: 8px 6px; border-bottom: 1px solid #ddd; vertical-align: top; }
64
+ th { text-align: left; background:#f5f5f5; }
65
+ .barcode-fallback { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; letter-spacing: 4px; padding: 8px 12px; border: 2px solid #111; display: inline-block; margin-top: 18px; }
66
+ .footer { margin-top: 28px; font-size: 11px; color:#666; }
67
+ </style>
68
+ </head>
69
+ <body>
70
+ <h1>${escapeHtml(t.packingSlip)}</h1>
71
+ <div class="sub">${escapeHtml(t.order)} ${escapeHtml(order.orderNumber)} · ${escapeHtml(cartLabel)}</div>
72
+
73
+ <div class="cart-number-hero">${escapeHtml(cartNumber)}</div>
74
+
75
+ <div class="grid">
76
+ <div><div class="label">${escapeHtml(t.customer)}</div><div class="value">${escapeHtml(order.customerName)}</div></div>
77
+ <div><div class="label">${escapeHtml(t.country)}</div><div class="value">${escapeHtml(order.country ?? "—")}</div></div>
78
+ <div><div class="label">${escapeHtml(t.deliveryDate)}</div><div class="value">${fmt(order.deliveryDate)}</div></div>
79
+ <div><div class="label">${escapeHtml(t.pickDate)}</div><div class="value">${fmt(order.pickDate)}</div></div>
80
+ <div><div class="label">${escapeHtml(t.cart)}</div><div class="value">${escapeHtml(cartLabel)}</div></div>
81
+ <div><div class="label">${escapeHtml(t.cratesOnThisCart)}</div><div class="value">${escapeHtml(fustenLabel)}</div></div>
82
+ </div>
83
+
84
+ <table>
85
+ <thead><tr><th>${escapeHtml(t.description)}</th><th style="text-align:right;width:90px">${escapeHtml(t.crates)}</th><th style="width:90px">${escapeHtml(t.unit)}</th></tr></thead>
86
+ <tbody>${rows}</tbody>
87
+ </table>
88
+
89
+ <div class="barcode-fallback">*${escapeHtml(order.orderNumber)}*</div>
90
+
91
+ <div class="footer">${escapeHtml(t.printedVia)} · ${new Date().toLocaleString(locale)}</div>
92
+ </body>
93
93
  </html>`;
94
94
  }
95
95
  function escapeHtml(s) {