@flowselections/logistiek-engine 1.0.240 → 1.0.241

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.
@@ -1 +1 @@
1
- {"version":3,"file":"StandaardgegevensCard.d.ts","sourceRoot":"","sources":["../../src/components/StandaardgegevensCard.tsx"],"names":[],"mappings":"AAcA,wBAAgB,qBAAqB,gCAkDpC"}
1
+ {"version":3,"file":"StandaardgegevensCard.d.ts","sourceRoot":"","sources":["../../src/components/StandaardgegevensCard.tsx"],"names":[],"mappings":"AAeA,wBAAgB,qBAAqB,gCAmDpC"}
@@ -7,7 +7,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
7
7
  // GEEN <Header /> hier — die levert de shell.
8
8
  // ============================================================================
9
9
  import { useEffect, useState } from "react";
10
- import { Badge, Card, CardContent, CardDescription, CardHeader, CardTitle, formatDatumTijd, supabase } from "@flowselections/core";
10
+ import { Badge, Card, CardContent, CardDescription, CardHeader, CardTitle, formatDatum, formatDatumTijd, supabase } from "@flowselections/core";
11
+ import { ophaalmomentMeldingen } from "../lib/ophaalmomentTeksten.js";
11
12
  import { Database } from "lucide-react";
12
13
  import { meldingGewoneTaal, schemaVersieOud, VERWACHTE_SCHEMA_VERSIE } from "../lib/engineStatusTeksten.js";
13
14
  import { aangevuldeOnderdelen, useEngineZelfherstel } from "../hooks/useEngineZelfherstel.js";
@@ -25,7 +26,7 @@ export function StandaardgegevensCard() {
25
26
  const eerder = aangevuldeOnderdelen(laatste);
26
27
  const meldingen = Array.isArray(resultaat?.meldingen) ? resultaat.meldingen : [];
27
28
  return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [_jsx(Database, { className: "h-4 w-4" }), " Standaardgegevens", fout ? _jsx(Badge, { variant: "destructive", children: "Controle mislukt" })
28
- : resultaat ? _jsx(Badge, { variant: "secondary", children: nu.length ? "Aangevuld" : "Compleet" }) : null] }), _jsx(CardDescription, { children: "Ladingdragers, Floriday-vertalingen, planinstellingen, tijdinstelling en strategie." })] }), _jsxs(CardContent, { className: "space-y-2 text-sm", children: [fout && _jsxs("p", { className: "text-destructive", children: ["Kon niet controleren: ", fout] }), nu.length > 0 && (_jsxs("div", { children: [_jsx("p", { className: "font-medium", children: "Zojuist aangevuld:" }), _jsx("ul", { className: "list-disc pl-5", children: nu.map((t) => _jsx("li", { children: t }, t)) })] })), nu.length === 0 && eerder.length > 0 && laatste?.op && (_jsxs("div", { children: [_jsxs("p", { className: "text-muted-foreground", children: ["Laatst aangevuld op ", new Date(laatste.op).toLocaleString("nl-NL"), ":"] }), _jsx("ul", { className: "list-disc pl-5 text-muted-foreground", children: eerder.map((t) => _jsx("li", { children: t }, t)) })] })), resultaat && nu.length === 0 && eerder.length === 0 && _jsx("p", { className: "text-muted-foreground", children: "Alle standaardgegevens zijn aanwezig." }), meldingen.map((m) => _jsx("p", { className: "text-destructive", children: meldingGewoneTaal(m) }, m)), _jsx(SchemaVersieStatus, {}), _jsx(OnderhoudStatus, {}), _jsx(ProductiebonStatus, {}), _jsx(SamenvoeggroepenStatus, {}), _jsx(StickerSyncStatus, {}), _jsx(SamenvoegenStatus, {})] })] }));
29
+ : resultaat ? _jsx(Badge, { variant: "secondary", children: nu.length ? "Aangevuld" : "Compleet" }) : null] }), _jsx(CardDescription, { children: "Ladingdragers, Floriday-vertalingen, planinstellingen, tijdinstelling en strategie." })] }), _jsxs(CardContent, { className: "space-y-2 text-sm", children: [fout && _jsxs("p", { className: "text-destructive", children: ["Kon niet controleren: ", fout] }), nu.length > 0 && (_jsxs("div", { children: [_jsx("p", { className: "font-medium", children: "Zojuist aangevuld:" }), _jsx("ul", { className: "list-disc pl-5", children: nu.map((t) => _jsx("li", { children: t }, t)) })] })), nu.length === 0 && eerder.length > 0 && laatste?.op && (_jsxs("div", { children: [_jsxs("p", { className: "text-muted-foreground", children: ["Laatst aangevuld op ", new Date(laatste.op).toLocaleString("nl-NL"), ":"] }), _jsx("ul", { className: "list-disc pl-5 text-muted-foreground", children: eerder.map((t) => _jsx("li", { children: t }, t)) })] })), resultaat && nu.length === 0 && eerder.length === 0 && _jsx("p", { className: "text-muted-foreground", children: "Alle standaardgegevens zijn aanwezig." }), meldingen.map((m) => _jsx("p", { className: "text-destructive", children: meldingGewoneTaal(m) }, m)), _jsx(SchemaVersieStatus, {}), _jsx(OnderhoudStatus, {}), _jsx(ProductiebonStatus, {}), _jsx(SamenvoeggroepenStatus, {}), _jsx(StickerSyncStatus, {}), _jsx(SamenvoegenStatus, {}), _jsx(OphaalmomentStatus, {})] })] }));
29
30
  }
30
31
  // 1.0.228: wachtrij per status, oudste trace-regel en laatste opruimronde.
31
32
  function OnderhoudStatus() {
@@ -133,6 +134,28 @@ function SamenvoegenStatus() {
133
134
  const fouten = Number(info.fouten ?? 0);
134
135
  return (_jsxs("div", { className: "border-t pt-2", children: [_jsx("p", { className: "font-medium", children: "Orders combineren" }), teGroot === 0 && verwijderd === 0 && fouten === 0 && _jsx("p", { className: "text-muted-foreground", children: "Geen meldingen." }), teGroot > 0 && _jsxs("p", { className: "text-destructive", children: [teGroot, " orders zijn samengevoegd in een groep van meer dan 20."] }), verwijderd > 0 && (_jsxs("p", { className: "text-destructive", children: [verwijderd, " nieuwe orders zijn als verwijderd binnengekomen; ze krijgen geen karindeling."] })), fouten > 0 && (_jsxs("p", { className: "text-destructive", children: ["Combineren lukte ", fouten, " keer niet", info.laatsteFout?.melding ? `; laatste: ${info.laatsteFout.melding}` : "", ". De order wordt dan los ingedeeld."] }))] }));
135
136
  }
137
+ // Ophaalmomenten: orders zonder moment en of de momenten ver genoeg vooruit bekend zijn (alleen meldingen).
138
+ function OphaalmomentStatus() {
139
+ const [info, setInfo] = useState(null);
140
+ const [fout, setFout] = useState(null);
141
+ useEffect(() => {
142
+ supabase.rpc("logistics_pickup_status").then(({ data, error }) => {
143
+ if (error) {
144
+ console.error("logistics_pickup_status", error);
145
+ if (error.code !== "42501")
146
+ setFout(error.message);
147
+ return;
148
+ }
149
+ setInfo(data && typeof data === "object" ? data : null);
150
+ });
151
+ }, []);
152
+ if (fout)
153
+ return _jsx("p", { className: "border-t pt-2 text-destructive", children: "Ophaalmomenten: status kon niet worden gelezen." });
154
+ if (!info)
155
+ return null;
156
+ const regels = ophaalmomentMeldingen(info, (d) => formatDatum(d));
157
+ return (_jsxs("div", { className: "border-t pt-2", children: [_jsx("p", { className: "font-medium", children: "Ophaalmomenten" }), regels.length === 0 && _jsx("p", { className: "text-muted-foreground", children: "Geen meldingen." }), regels.map((t, i) => (_jsx("p", { className: "text-destructive", children: t }, i)))] }));
158
+ }
136
159
  // Punt 8: is de database van deze shell bijgewerkt voor deze moduleversie?
137
160
  function SchemaVersieStatus() {
138
161
  const [oud, setOud] = useState(null);
@@ -15665,35 +15665,47 @@ export type Database = {
15665
15665
  };
15666
15666
  logistics_pickup_moments: {
15667
15667
  Row: {
15668
+ carrier_id: string | null;
15668
15669
  carrier_ref: string | null;
15669
15670
  created_at: string;
15670
15671
  id: string;
15671
15672
  label: string | null;
15672
15673
  moment_date: string;
15674
+ pickup_days: number | null;
15673
15675
  pickup_time: string;
15674
15676
  sequence: number;
15677
+ signup_days: number | null;
15678
+ signup_time: string | null;
15675
15679
  updated_at: string;
15676
15680
  user_id: string;
15677
15681
  };
15678
15682
  Insert: {
15683
+ carrier_id?: string | null;
15679
15684
  carrier_ref?: string | null;
15680
15685
  created_at?: string;
15681
15686
  id?: string;
15682
15687
  label?: string | null;
15683
15688
  moment_date: string;
15689
+ pickup_days?: number | null;
15684
15690
  pickup_time: string;
15685
15691
  sequence?: number;
15692
+ signup_days?: number | null;
15693
+ signup_time?: string | null;
15686
15694
  updated_at?: string;
15687
15695
  user_id?: string;
15688
15696
  };
15689
15697
  Update: {
15698
+ carrier_id?: string | null;
15690
15699
  carrier_ref?: string | null;
15691
15700
  created_at?: string;
15692
15701
  id?: string;
15693
15702
  label?: string | null;
15694
15703
  moment_date?: string;
15704
+ pickup_days?: number | null;
15695
15705
  pickup_time?: string;
15696
15706
  sequence?: number;
15707
+ signup_days?: number | null;
15708
+ signup_time?: string | null;
15697
15709
  updated_at?: string;
15698
15710
  user_id?: string;
15699
15711
  };
@@ -32764,6 +32776,7 @@ export type Database = {
32764
32776
  body: string;
32765
32777
  created_at: string;
32766
32778
  id: string;
32779
+ is_important: boolean;
32767
32780
  updated_at: string;
32768
32781
  user_id: string;
32769
32782
  werkbon_id: string;
@@ -32772,6 +32785,7 @@ export type Database = {
32772
32785
  body: string;
32773
32786
  created_at?: string;
32774
32787
  id?: string;
32788
+ is_important?: boolean;
32775
32789
  updated_at?: string;
32776
32790
  user_id?: string;
32777
32791
  werkbon_id: string;
@@ -32780,6 +32794,7 @@ export type Database = {
32780
32794
  body?: string;
32781
32795
  created_at?: string;
32782
32796
  id?: string;
32797
+ is_important?: boolean;
32783
32798
  updated_at?: string;
32784
32799
  user_id?: string;
32785
32800
  werkbon_id?: string;
@@ -37179,6 +37194,14 @@ export type Database = {
37179
37194
  };
37180
37195
  Returns: undefined;
37181
37196
  };
37197
+ facturatie_auto_invoice_skip_reason: {
37198
+ Args: {
37199
+ p_custom_fields: Json;
37200
+ p_delivery_date: string;
37201
+ p_start: string;
37202
+ };
37203
+ Returns: string;
37204
+ };
37182
37205
  facturatie_ensure_cron: {
37183
37206
  Args: never;
37184
37207
  Returns: string;
@@ -41620,6 +41643,12 @@ export type Database = {
41620
41643
  };
41621
41644
  Returns: boolean;
41622
41645
  };
41646
+ logistics_order_buffer_ref: {
41647
+ Args: {
41648
+ p_order_id: string;
41649
+ };
41650
+ Returns: string;
41651
+ };
41623
41652
  logistics_order_carrier_id: {
41624
41653
  Args: {
41625
41654
  p_order_id: string;
@@ -42346,14 +42375,61 @@ export type Database = {
42346
42375
  };
42347
42376
  Returns: Json;
42348
42377
  };
42378
+ logistics_pickup_carrier_uit_naam: {
42379
+ Args: {
42380
+ p_naam: string;
42381
+ };
42382
+ Returns: string;
42383
+ };
42384
+ logistics_pickup_cf_nieuw: {
42385
+ Args: {
42386
+ p_cancelled_at: string;
42387
+ p_carrier_id: string;
42388
+ p_cf: Json;
42389
+ p_deleted_at: string;
42390
+ p_delivery_date: string;
42391
+ p_plan_locked_at: string;
42392
+ p_regel?: Json;
42393
+ };
42394
+ Returns: Json;
42395
+ };
42349
42396
  logistics_pickup_herbereken: {
42350
42397
  Args: never;
42351
42398
  Returns: Json;
42352
42399
  };
42400
+ logistics_pickup_herwijs: {
42401
+ Args: {
42402
+ p_carrier_ids: string[];
42403
+ p_max?: number;
42404
+ };
42405
+ Returns: Json;
42406
+ };
42407
+ logistics_pickup_moment_kies: {
42408
+ Args: {
42409
+ p_carrier_id: string;
42410
+ p_leverdag: string;
42411
+ p_levertijd: string;
42412
+ p_marge_uren: number;
42413
+ p_regel: string;
42414
+ };
42415
+ Returns: Json;
42416
+ };
42417
+ logistics_pickup_moments_koppel: {
42418
+ Args: never;
42419
+ Returns: number;
42420
+ };
42353
42421
  logistics_pickup_moments_today: {
42354
42422
  Args: never;
42355
42423
  Returns: Json;
42356
42424
  };
42425
+ logistics_pickup_regel: {
42426
+ Args: never;
42427
+ Returns: Json;
42428
+ };
42429
+ logistics_pickup_status: {
42430
+ Args: never;
42431
+ Returns: Json;
42432
+ };
42357
42433
  logistics_pickup_ts: {
42358
42434
  Args: {
42359
42435
  p_delivery_date: string;
@@ -42361,6 +42437,16 @@ export type Database = {
42361
42437
  };
42362
42438
  Returns: string;
42363
42439
  };
42440
+ logistics_pickup_vul_uitvoeren: {
42441
+ Args: {
42442
+ p_max?: number;
42443
+ };
42444
+ Returns: Json;
42445
+ };
42446
+ logistics_pickup_vul_voorbeeld: {
42447
+ Args: never;
42448
+ Returns: Json;
42449
+ };
42364
42450
  logistics_plan_all: {
42365
42451
  Args: {
42366
42452
  p_user_id?: string;
@@ -49706,6 +49792,12 @@ export type Database = {
49706
49792
  };
49707
49793
  Returns: undefined;
49708
49794
  };
49795
+ verkoop_latest_delivery_aanvullen: {
49796
+ Args: {
49797
+ p_max?: number;
49798
+ };
49799
+ Returns: Json;
49800
+ };
49709
49801
  verkoop_packing_drift_apply: {
49710
49802
  Args: {
49711
49803
  p_order_ids: string[];