@flowselections/layout-maker 1.69.43 → 1.69.45

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.
Files changed (31) hide show
  1. package/dist-lib/components/PakbonPreview.d.ts.map +1 -1
  2. package/dist-lib/components/PakbonPreview.js +7 -1
  3. package/dist-lib/components/PrintplekDetailPage.d.ts.map +1 -1
  4. package/dist-lib/components/PrintplekDetailPage.js +21 -1
  5. package/dist-lib/integrations/supabase/types.d.ts +5409 -91
  6. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  7. package/dist-lib/lib/levering.d.ts +35 -0
  8. package/dist-lib/lib/levering.d.ts.map +1 -0
  9. package/dist-lib/lib/levering.js +68 -0
  10. package/dist-lib/lib/orderData.server.d.ts +11 -0
  11. package/dist-lib/lib/orderData.server.d.ts.map +1 -1
  12. package/dist-lib/lib/orderData.server.js +76 -0
  13. package/dist-lib/lib/pakbonContent.d.ts.map +1 -1
  14. package/dist-lib/lib/pakbonContent.js +12 -0
  15. package/dist-lib/lib/pakbonHtml.d.ts +8 -0
  16. package/dist-lib/lib/pakbonHtml.d.ts.map +1 -1
  17. package/dist-lib/lib/pakbonHtml.js +22 -1
  18. package/dist-lib/lib/printQueue.server.d.ts.map +1 -1
  19. package/dist-lib/lib/printQueue.server.js +34 -2
  20. package/dist-lib/lib/productiebonPrinter.d.ts +11 -0
  21. package/dist-lib/lib/productiebonPrinter.d.ts.map +1 -0
  22. package/dist-lib/lib/productiebonPrinter.js +16 -0
  23. package/dist-lib/lib/profielHtml.d.ts.map +1 -1
  24. package/dist-lib/lib/profielHtml.js +35 -1
  25. package/dist-lib/lib/standaardLayouts.server.d.ts.map +1 -1
  26. package/dist-lib/lib/standaardLayouts.server.js +14 -1
  27. package/dist-lib/lib/versie.generated.d.ts +1 -1
  28. package/dist-lib/lib/versie.generated.js +1 -1
  29. package/package.json +5 -1
  30. package/sql/print-schema.sql +192 -63
  31. package/sql/print-schema.verslag.md +7 -2
@@ -1 +1 @@
1
- {"version":3,"file":"PakbonPreview.d.ts","sourceRoot":"","sources":["../../src/components/PakbonPreview.tsx"],"names":[],"mappings":"AAKA,OAAO,EA8BL,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAC;AA6B9B,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,SAAe,EACf,QAAc,EACd,OAAc,GACf,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oFAAoF;IACpF,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;CACtC,+BAiJA;AAiLD,oEAAoE;AACpE,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAmCA"}
1
+ {"version":3,"file":"PakbonPreview.d.ts","sourceRoot":"","sources":["../../src/components/PakbonPreview.tsx"],"names":[],"mappings":"AAMA,OAAO,EA8BL,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAC;AA6B9B,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,SAAe,EACf,QAAc,EACd,OAAc,GACf,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oFAAoF;IACpF,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;CACtC,+BAiJA;AAiLD,oEAAoE;AACpE,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAmCA"}
@@ -4,6 +4,7 @@ import { PaginaDocument } from "./PaginaDocument.js";
4
4
  import { useLogos } from "../lib/logoLibrary.js";
5
5
  import { code128Bars } from "../lib/code128.js";
6
6
  import { karMetadata } from "../lib/pakbonPresentation.js";
7
+ import { ADRES_KLANT_TEKST, adresRegels, afhaalBlok } from "../lib/levering.js";
7
8
  import { DEMO_ORDER, deelkarVoorbeeldOrder, conditieContext, groepeerIdentiekeKarren, groepeerIdentiekeLagen, karBundelTekst, fustVerzamellijst, fustRegels, FUSTREGEL_LABELS, FUSTREGEL_RECHTS, pickMethode, pakbonLayoutVariant, productVeldBreedtes, onderdeelCellen, onderdeelVelden, samenstellingTonen, voegProductSamen, sectieOnderdruktVoorVariant, karKopNummer, kolomLabel, laagBundelTekst, sectieZichtbaar, sorteerProducten, totalen, vulVeldcodes, } from "../lib/pakbonBuilder.js";
8
9
  /** Voorbeeldbarcode: alleen bedoeld om de plek en hoogte te tonen. */
9
10
  function BarcodeStrepen({ waarde, hoogteMm = 15 }) {
@@ -201,7 +202,12 @@ function SectieView({ sectie, order, zoek, }) {
201
202
  case "afleveradres":
202
203
  case "factuuradres": {
203
204
  const a = s.type === "afleveradres" ? order.afleveradres : order.factuuradres;
204
- return (_jsxs(Blok, { titel: s.titel, children: [_jsx("div", { className: "font-semibold", children: a.naam }), _jsx("div", { children: a.adres }), _jsx("div", { children: a.plaats }), opt(s, "toonLand", true) && _jsx("div", { children: a.land })] }));
205
+ const afhalen = s.type === "afleveradres" ? afhaalBlok(order, a, opt(s, "toonLand", true)) : null;
206
+ if (afhalen) {
207
+ return (_jsxs(Blok, { titel: s.titel, children: [_jsx("div", { className: "font-semibold", children: afhalen.kop }), afhalen.ophaalmoment && _jsx("div", { children: afhalen.ophaalmoment }), afhalen.adresKlant.length > 0 && (_jsxs("div", { className: "pt-1 text-[0.85em] text-muted-foreground", children: [_jsx("div", { children: ADRES_KLANT_TEKST }), afhalen.adresKlant.map((r, i) => (_jsx("div", { children: r }, i)))] }))] }));
208
+ }
209
+ const regels = adresRegels({ naam: a.naam, adres: a.adres, plaats: a.plaats, land: a.land }, opt(s, "toonLand", true));
210
+ return (_jsx(Blok, { titel: s.titel, children: regels.map((r, i) => (_jsx("div", { className: i === 0 && r === String(a.naam ?? "").trim() ? "font-semibold" : undefined, children: r }, i))) }));
205
211
  }
206
212
  case "orderinformatie":
207
213
  return (_jsx(Blok, { titel: s.titel, children: _jsxs("div", { className: "grid grid-cols-2 gap-x-4", children: [opt(s, "toonOrdernummer", true) && _jsx(Rij, { label: "Ordernummer", waarde: order.order.nummer }), opt(s, "toonDatum", true) && _jsx(Rij, { label: "Orderdatum", waarde: order.order.datum }), opt(s, "toonLeverdatum", true) && _jsx(Rij, { label: "Leverdatum", waarde: order.order.leverdatum }), opt(s, "toonReferentie", true) && _jsx(Rij, { label: "Referentie", waarde: order.order.referentie })] }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"PrintplekDetailPage.d.ts","sourceRoot":"","sources":["../../src/components/PrintplekDetailPage.tsx"],"names":[],"mappings":"AA2EA,wBAAgB,mBAAmB,gCA+uBlC"}
1
+ {"version":3,"file":"PrintplekDetailPage.d.ts","sourceRoot":"","sources":["../../src/components/PrintplekDetailPage.tsx"],"names":[],"mappings":"AA4EA,wBAAgB,mBAAmB,gCAqwBlC"}
@@ -28,6 +28,7 @@ import { useRouteringOverzicht } from "../lib/printRoutering.js";
28
28
  import { routeringMeldingTekst } from "../lib/waaromPrinter.js";
29
29
  import { STATUS_ONBEKEND_TEKST, toestandVanComputer, zelfdeNaamTekst } from "../lib/computerKoppeling.js";
30
30
  import { koppelComputerOpId } from "../lib/printService.functions.js";
31
+ import { productiebonStandaardTekst } from "../lib/productiebonPrinter.js";
31
32
  const BRON_LABEL = {
32
33
  werkplek_formaat: "Werkplek (papierformaat)",
33
34
  werkplek_afwijking: "Werkplek (afwijking)",
@@ -161,6 +162,25 @@ export function PrintplekDetailPage() {
161
162
  };
162
163
  const computerId = (n) => computers.find((k) => k.naam === n)?.id ?? null;
163
164
  const eigenRegel = (t) => regels.find((r) => r.print_plek_id === plekId && r.documenttype === t) ?? null;
165
+ // 1.69.44: productiebon zonder eigen printer → printer van deze plek met hetzelfde formaat.
166
+ const [pbKeuze, setPbKeuze] = useState(null);
167
+ useEffect(() => {
168
+ let actief = true;
169
+ void (async () => {
170
+ const { data, error } = await supabase.rpc("printplek_productiebon_printer", { _plek: plekId });
171
+ if (!actief)
172
+ return;
173
+ if (error) {
174
+ console.error("[printplek] productiebon-printer bepalen mislukt", error.message);
175
+ setPbKeuze(null);
176
+ return;
177
+ }
178
+ setPbKeuze((data ?? null));
179
+ })();
180
+ return () => {
181
+ actief = false;
182
+ };
183
+ }, [plekId, regels, toegewezen]);
164
184
  const vernieuw = async () => {
165
185
  await reload(true);
166
186
  await reloadRoutering();
@@ -301,7 +321,7 @@ export function PrintplekDetailPage() {
301
321
  .filter((x) => x.u && (x.u.bron !== hoofd?.bron || x.u.printer_id !== hoofd?.printer_id));
302
322
  const regel = eigenRegel(d.value);
303
323
  return [
304
- _jsxs("tr", { className: "border-b align-top", children: [_jsxs("td", { className: "py-2 pr-3 font-medium", children: [documentTypeLabel(d.value), pcNamen.length > 1 ? (_jsxs("div", { className: "text-muted-foreground text-xs font-normal", children: ["op ", rijen[0]] })) : null] }), _jsx(RouteringCellen, { u: hoofd }), _jsx("td", { className: "py-2", children: _jsxs("select", { className: selectKlasse, "aria-label": `Printer voor ${documentTypeLabel(d.value)}`, value: regel?.printer_id ?? "standaard", onChange: (e) => void zetRegel(d.value, e.target.value), children: [_jsx("option", { value: "standaard", children: "Standaard gebruiken" }), eigenPrinters.filter((p) => p.actief).map((p) => (_jsx("option", { value: p.id, children: p.naam }, p.id)))] }) })] }, d.value),
324
+ _jsxs("tr", { className: "border-b align-top", children: [_jsxs("td", { className: "py-2 pr-3 font-medium", children: [documentTypeLabel(d.value), pcNamen.length > 1 ? (_jsxs("div", { className: "text-muted-foreground text-xs font-normal", children: ["op ", rijen[0]] })) : null] }), _jsx(RouteringCellen, { u: hoofd }), _jsxs("td", { className: "py-2", children: [_jsxs("select", { className: selectKlasse, "aria-label": `Printer voor ${documentTypeLabel(d.value)}`, value: regel?.printer_id ?? "standaard", onChange: (e) => void zetRegel(d.value, e.target.value), children: [_jsx("option", { value: "standaard", children: "Standaard gebruiken" }), eigenPrinters.filter((p) => p.actief).map((p) => (_jsx("option", { value: p.id, children: p.naam }, p.id)))] }), d.value === "productiebon" && !regel ? (_jsx("p", { className: "text-muted-foreground mt-1 text-xs", children: productiebonStandaardTekst(pbKeuze) })) : null] })] }, d.value),
305
325
  ...afwijkend.map((x) => (_jsxs("tr", { className: "border-b align-top", children: [_jsxs("td", { className: "text-muted-foreground py-2 pr-3 pl-4 text-xs", children: ["op ", x.pc] }), _jsx(RouteringCellen, { u: x.u }), _jsx("td", {})] }, `${d.value}-${x.pc}`))),
306
326
  ];
307
327
  }) })] }) })) : null] })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [_jsx(Link2, { className: "h-4 w-4" }), " Gekoppeld aan"] }), _jsx(CardDescription, { children: "Andere modules (bijvoorbeeld pickstations) kunnen zich aan deze printplek koppelen." })] }), _jsxs(CardContent, { className: "space-y-4", children: [bronnen.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-sm", children: "Nog niets gekoppeld. Kies deze printplek in de andere module (bijvoorbeeld bij een pickstation); de koppeling verschijnt hier vanzelf." })) : (_jsx("div", { className: "space-y-2", children: bronnen.map((b) => (_jsxs("div", { className: "flex flex-wrap items-center gap-3 rounded-lg border px-3 py-2 text-sm", children: [_jsx(Badge, { variant: "secondary", children: b.bron }), _jsxs("span", { className: "min-w-0 flex-1 truncate", children: [b.label ?? b.bron_id, _jsx("span", { className: "text-muted-foreground ml-2 text-xs", children: b.bron_id })] }), _jsxs(Button, { variant: "ghost", size: "sm", onClick: () => void ontkoppel(b.bron, b.bron_id), children: [_jsx(X, { className: "mr-1 h-3.5 w-3.5" }), " Ontkoppelen"] })] }, b.id))) })), weeskoppelingen.length > 0 ? (_jsxs("div", { className: "space-y-2 rounded-lg border border-dashed p-3", children: [_jsxs("p", { className: "text-muted-foreground flex items-center gap-2 text-xs", children: [_jsx(AlertTriangle, { className: "h-3.5 w-3.5" }), " Koppelingen zonder bestaande printplek:"] }), weeskoppelingen.map((b) => (_jsxs("div", { className: "flex flex-wrap items-center gap-3 text-sm", children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: b.label ?? `${b.bron} ${b.bron_id}` }), _jsxs(Button, { variant: "ghost", size: "sm", onClick: () => void ontkoppel(b.bron, b.bron_id), children: [_jsx(Trash2, { className: "mr-1 h-3.5 w-3.5" }), " Opruimen"] })] }, b.id)))] })) : null] })] })] }));