@flowselections/floriday-afhandeling-module 1.0.38 → 1.0.40
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-lib/components/afhandeling/ControleLijstPrint.js +54 -54
- package/dist-lib/components/afhandeling/ControlePage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/ControlePage.js +1 -3
- package/dist-lib/components/afhandeling/DagDetailDialog.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/DagDetailDialog.js +5 -38
- package/dist-lib/components/afhandeling/LeveringenPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/LeveringenPage.js +1 -1
- package/dist-lib/components/afhandeling/WeekAgendaView.d.ts +1 -3
- package/dist-lib/components/afhandeling/WeekAgendaView.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/WeekAgendaView.js +6 -57
- package/dist-lib/components/pickstation/PakbonTemplate.js +70 -70
- package/dist-lib/components/settings/AfhandelingSettingsCard.d.ts.map +1 -1
- package/dist-lib/components/settings/AfhandelingSettingsCard.js +4 -55
- package/dist-lib/hooks/useOrderPlanning.d.ts.map +1 -1
- package/dist-lib/hooks/useOrderPlanning.js +6 -27
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +471 -1
- package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.server.d.ts +471 -1
- package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/moduleClient.d.ts +471 -1
- package/dist-lib/integrations/supabase/moduleClient.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +477 -1
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/afhandelingSettings.functions.d.ts +952 -4
- package/dist-lib/lib/afhandelingSettings.functions.d.ts.map +1 -1
- package/dist-lib/lib/carrierSignupMail.server.js +26 -26
- package/dist-lib/lib/carriers.functions.d.ts +2355 -5
- package/dist-lib/lib/carriers.functions.d.ts.map +1 -1
- package/dist-lib/lib/cartAssignments.functions.d.ts +2355 -5
- package/dist-lib/lib/cartAssignments.functions.d.ts.map +1 -1
- package/dist-lib/lib/cartControl.functions.d.ts +4740 -20
- package/dist-lib/lib/cartControl.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday.functions.d.ts +472 -2
- package/dist-lib/lib/floriday.functions.d.ts.map +1 -1
- package/dist-lib/lib/printing.d.ts +2 -11
- package/dist-lib/lib/printing.d.ts.map +1 -1
- package/dist-lib/lib/printing.js +8 -64
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printing.d.ts","sourceRoot":"","sources":["../../src/lib/printing.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"printing.d.ts","sourceRoot":"","sources":["../../src/lib/printing.ts"],"names":[],"mappings":"AAIA,gDAAgD;AAChD,MAAM,MAAM,uBAAuB,GAC/B,QAAQ,GACR,eAAe,GACf,cAAc,GACd,cAAc,CAAC;AAEnB,qBAAa,eAAgB,SAAQ,KAAK;aACZ,YAAY,EAAE,MAAM;gBAApB,YAAY,EAAE,MAAM;CAMjD;AAED,qBAAa,2BAA4B,SAAQ,KAAK;gBACxC,EAAE,EAAE,MAAM;CAMvB;AAqBD,8EAA8E;AAC9E,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC,CAS5D;AAMD,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,mFAAmF;AACnF,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyC7D;AAWD,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,uBAAuB,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,0EAA0E;AAC1E,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,WAAW,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAC1C,OAAO,CAAC,MAAM,CAAC,CAajB;AAED,kEAAkE;AAClE,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GACrC,OAAO,CAAC,MAAM,CAAC,CAajB;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE;IAChD,YAAY,EAAE,uBAAuB,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,OAAO,CAAC,MAAM,CAAC,CAYlB;AAMD,8CAA8C;AAC9C,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CASrD"}
|
package/dist-lib/lib/printing.js
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
// Centrale printlaag: alle printacties van deze module lopen via de
|
|
2
2
|
// print-API van @flowselections/layout-maker. Geen verborgen iframes,
|
|
3
3
|
// geen browser-printdialoog, geen directe writes naar print_jobs.
|
|
4
|
-
export const WERKPLEK_STORAGE_KEY = "afhandeling.werkplek";
|
|
5
|
-
export class GeenWerkplekFout extends Error {
|
|
6
|
-
constructor() {
|
|
7
|
-
super("Geen werkplek ingesteld — stel de werkplek in bij Instellingen.");
|
|
8
|
-
this.name = "GeenWerkplekFout";
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
4
|
export class GeenPrinterFout extends Error {
|
|
12
|
-
constructor(
|
|
13
|
-
super(`Geen printer
|
|
14
|
-
this.
|
|
15
|
-
this.papierformaat = papierformaat;
|
|
5
|
+
constructor(documenttype) {
|
|
6
|
+
super(`Geen printer voor ${documenttype} — stel dit in bij Layouts en printers → Routering`);
|
|
7
|
+
this.documenttype = documenttype;
|
|
16
8
|
this.name = "GeenPrinterFout";
|
|
17
9
|
}
|
|
18
10
|
}
|
|
@@ -22,34 +14,6 @@ export class PrintApiNietBeschikbaarFout extends Error {
|
|
|
22
14
|
this.name = "PrintApiNietBeschikbaarFout";
|
|
23
15
|
}
|
|
24
16
|
}
|
|
25
|
-
// --------------------------------------------------------------------------
|
|
26
|
-
// Werkplek
|
|
27
|
-
// --------------------------------------------------------------------------
|
|
28
|
-
export function getWerkplek() {
|
|
29
|
-
if (typeof window === "undefined")
|
|
30
|
-
return null;
|
|
31
|
-
try {
|
|
32
|
-
const v = window.localStorage.getItem(WERKPLEK_STORAGE_KEY);
|
|
33
|
-
return v && v.trim() ? v.trim() : null;
|
|
34
|
-
}
|
|
35
|
-
catch {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
export function setWerkplek(werkplek) {
|
|
40
|
-
if (typeof window === "undefined")
|
|
41
|
-
return;
|
|
42
|
-
try {
|
|
43
|
-
const v = werkplek.trim();
|
|
44
|
-
if (v)
|
|
45
|
-
window.localStorage.setItem(WERKPLEK_STORAGE_KEY, v);
|
|
46
|
-
else
|
|
47
|
-
window.localStorage.removeItem(WERKPLEK_STORAGE_KEY);
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
// negeren: printen faalt dan met een duidelijke melding
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
17
|
let apiPromise = null;
|
|
54
18
|
async function loadPrintApi() {
|
|
55
19
|
apiPromise ?? (apiPromise = import("@flowselections/layout-maker"));
|
|
@@ -66,26 +30,12 @@ async function apiFn(naam) {
|
|
|
66
30
|
export async function printApiBeschikbaar() {
|
|
67
31
|
try {
|
|
68
32
|
const api = await loadPrintApi();
|
|
69
|
-
return ["printPdf", "printHtml"
|
|
33
|
+
return ["printPdf", "printHtml"].every((n) => typeof api[n] === "function");
|
|
70
34
|
}
|
|
71
35
|
catch {
|
|
72
36
|
return false;
|
|
73
37
|
}
|
|
74
38
|
}
|
|
75
|
-
// --------------------------------------------------------------------------
|
|
76
|
-
// Printer bepalen
|
|
77
|
-
// --------------------------------------------------------------------------
|
|
78
|
-
/** Zoekt de printer die bij de ingestelde werkplek en het papierformaat hoort. */
|
|
79
|
-
export async function resolvePrinter(papierformaat = "A4") {
|
|
80
|
-
const werkplek = getWerkplek();
|
|
81
|
-
if (!werkplek)
|
|
82
|
-
throw new GeenWerkplekFout();
|
|
83
|
-
const printerVoorWerkplek = await apiFn("printerVoorWerkplek");
|
|
84
|
-
const printerId = await printerVoorWerkplek(werkplek, papierformaat);
|
|
85
|
-
if (!printerId)
|
|
86
|
-
throw new GeenPrinterFout(werkplek, papierformaat);
|
|
87
|
-
return printerId;
|
|
88
|
-
}
|
|
89
39
|
/** Volgt een printopdracht tot voltooid; gooit met de wachtrijfout bij mislukt. */
|
|
90
40
|
export async function wachtOpJob(jobId) {
|
|
91
41
|
let volg = null;
|
|
@@ -142,13 +92,12 @@ function stripDataPrefix(base64) {
|
|
|
142
92
|
}
|
|
143
93
|
/** Print een externe PDF (afleverbrief, veilingbrief) via de wachtrij. */
|
|
144
94
|
export async function printPdfDocument(opties) {
|
|
145
|
-
const printerId = await resolvePrinter(opties.papierformaat ?? "A4");
|
|
146
95
|
const printPdf = await apiFn("printPdf");
|
|
147
96
|
const res = await printPdf({
|
|
148
97
|
documenttype: opties.documenttype,
|
|
149
98
|
documentnaam: opties.documentnaam,
|
|
150
99
|
pdfBase64: stripDataPrefix(opties.pdfBase64),
|
|
151
|
-
|
|
100
|
+
papierformaat: opties.papierformaat ?? "A4",
|
|
152
101
|
isHerprint: opties.isHerprint ?? false,
|
|
153
102
|
});
|
|
154
103
|
if (opties.volgStatus !== false)
|
|
@@ -157,13 +106,12 @@ export async function printPdfDocument(opties) {
|
|
|
157
106
|
}
|
|
158
107
|
/** Print zelf opgemaakte HTML (controlelijst) via de wachtrij. */
|
|
159
108
|
export async function printHtmlDocument(opties) {
|
|
160
|
-
const printerId = await resolvePrinter(opties.papierformaat ?? "A4");
|
|
161
109
|
const printHtml = await apiFn("printHtml");
|
|
162
110
|
const res = await printHtml({
|
|
163
111
|
documenttype: opties.documenttype,
|
|
164
112
|
documentnaam: opties.documentnaam,
|
|
165
113
|
html: opties.html,
|
|
166
|
-
|
|
114
|
+
papierformaat: opties.papierformaat ?? "A4",
|
|
167
115
|
isHerprint: opties.isHerprint ?? false,
|
|
168
116
|
});
|
|
169
117
|
if (opties.volgStatus !== false)
|
|
@@ -191,12 +139,8 @@ export async function printLayoutDocument(opties) {
|
|
|
191
139
|
// --------------------------------------------------------------------------
|
|
192
140
|
/** Nederlandse melding voor een printfout. */
|
|
193
141
|
export function printFoutMelding(err) {
|
|
194
|
-
if (err instanceof
|
|
195
|
-
return
|
|
196
|
-
}
|
|
197
|
-
if (err instanceof GeenPrinterFout) {
|
|
198
|
-
return `Geen printer gekoppeld aan deze werkplek (${err.werkplek}).`;
|
|
199
|
-
}
|
|
142
|
+
if (err instanceof GeenPrinterFout)
|
|
143
|
+
return err.message;
|
|
200
144
|
if (err instanceof PrintApiNietBeschikbaarFout)
|
|
201
145
|
return err.message;
|
|
202
146
|
const naam = err?.name ?? "";
|