@flowselections/floriday-verkoop-module 1.0.168 → 1.0.169

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 (30) hide show
  1. package/dist-lib/components/verkoop/CreateOrderPage.d.ts.map +1 -1
  2. package/dist-lib/components/verkoop/CreateOrderPage.js +33 -10
  3. package/dist-lib/components/verkoop/EditLocalOrderDialog.d.ts.map +1 -1
  4. package/dist-lib/components/verkoop/EditLocalOrderDialog.js +21 -8
  5. package/dist-lib/components/verkoop/SalesOrderDetailView.js +1 -1
  6. package/dist-lib/components/verkoop/regel/OrderLineExtrasCard.d.ts +3 -1
  7. package/dist-lib/components/verkoop/regel/OrderLineExtrasCard.d.ts.map +1 -1
  8. package/dist-lib/components/verkoop/regel/OrderLineExtrasCard.js +34 -15
  9. package/dist-lib/components/verkoop/regel/RegelGegevensVelden.d.ts +12 -2
  10. package/dist-lib/components/verkoop/regel/RegelGegevensVelden.d.ts.map +1 -1
  11. package/dist-lib/components/verkoop/regel/RegelGegevensVelden.js +14 -7
  12. package/dist-lib/components/verkoop/regel/StickerKeuzeRegels.d.ts +19 -0
  13. package/dist-lib/components/verkoop/regel/StickerKeuzeRegels.d.ts.map +1 -0
  14. package/dist-lib/components/verkoop/regel/StickerKeuzeRegels.js +30 -0
  15. package/dist-lib/integrations/supabase/types.d.ts +186 -0
  16. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  17. package/dist-lib/lib/create-order.functions.d.ts +3 -0
  18. package/dist-lib/lib/create-order.functions.d.ts.map +1 -1
  19. package/dist-lib/lib/create-order.functions.js +12 -1
  20. package/dist-lib/lib/order-item-packing.functions.d.ts +3 -0
  21. package/dist-lib/lib/order-item-packing.functions.d.ts.map +1 -1
  22. package/dist-lib/lib/order-item-packing.functions.js +9 -1
  23. package/dist-lib/lib/order-line-extras.d.ts +31 -0
  24. package/dist-lib/lib/order-line-extras.d.ts.map +1 -1
  25. package/dist-lib/lib/order-line-extras.functions.d.ts +20 -1
  26. package/dist-lib/lib/order-line-extras.functions.d.ts.map +1 -1
  27. package/dist-lib/lib/order-line-extras.functions.js +47 -1
  28. package/dist-lib/lib/order-line-extras.js +67 -0
  29. package/package.json +2 -2
  30. package/schema/verkoop.sql +85 -150
@@ -0,0 +1,30 @@
1
+ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // Pot- en fuststicker bij één orderregel: wat de Engine kiest (bron in gewone
3
+ // woorden, aantal) met [wijzigen] en [niet printen]. Verkoop slaat alleen de
4
+ // keuze op; de Engine leest die zelf (pot/fust_sticker_modus, reden, ids).
5
+ import { useState } from "react";
6
+ import { Button, Input, Label } from "@flowselections/core";
7
+ import { Link } from "@tanstack/react-router";
8
+ import { AlertTriangle, Upload } from "lucide-react";
9
+ import { SearchableSelect } from "../SearchableSelect.js";
10
+ import { FLORIDAY_NIET_PRINTEN, STICKER_REDEN_MAX, STICKER_ZONDER_BESTAND, stickerHint, stickerRegelTekst, stickerZonderBestand, } from "../../../lib/order-line-extras.js";
11
+ function Rij({ soort, label, modus, gekozenId, lijst, standaardId, engine, reden, uploadPad, disabled, idPrefix, onChange, }) {
12
+ const [open, setOpen] = useState(null);
13
+ const [concept, setConcept] = useState(reden);
14
+ const naam = (id) => lijst.find((o) => o.id === id)?.naam ?? null;
15
+ const tekst = stickerRegelTekst(engine, modus, naam(gekozenId), naam(standaardId));
16
+ const floriday = engine?.bron === "floriday";
17
+ const zonderBestand = stickerZonderBestand(engine, modus);
18
+ return (_jsxs("div", { className: "space-y-1.5", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-sm", children: [_jsxs("span", { className: "font-medium text-foreground", children: [label, ":"] }), _jsx("span", { className: modus === "uit" ? "text-muted-foreground line-through" : "text-foreground", children: tekst }), !disabled && modus !== "uit" && (_jsxs(_Fragment, { children: [_jsx(Button, { type: "button", size: "sm", variant: "link", className: "h-auto p-0", onClick: () => setOpen(open === "wijzigen" ? null : "wijzigen"), children: "wijzigen" }), (engine ? engine.status !== "geen" : true) && (_jsx(Button, { type: "button", size: "sm", variant: "link", className: "h-auto p-0", onClick: () => { setConcept(reden); setOpen(open === "uit" ? null : "uit"); }, children: "niet printen" }))] })), !disabled && modus === "uit" && (_jsx(Button, { type: "button", size: "sm", variant: "link", className: "h-auto p-0", onClick: () => onChange({ modus: "auto" }), children: "toch printen" }))] }), modus === "uit" && reden.trim() && _jsxs("p", { className: "text-xs text-muted-foreground", children: ["Reden: ", reden] }), zonderBestand && (_jsxs("div", { role: "alert", className: "flex flex-wrap items-center gap-2 rounded-md bg-warning-soft px-2 py-1.5 text-xs text-warning-soft-foreground", children: [_jsx(AlertTriangle, { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": true }), _jsx("span", { children: STICKER_ZONDER_BESTAND }), uploadPad && _jsxs(Link, { to: uploadPad, className: "inline-flex items-center gap-1 font-medium text-primary hover:underline", children: [_jsx(Upload, { className: "h-3.5 w-3.5", "aria-hidden": true }), " Uploaden"] })] })), open === "wijzigen" && (_jsxs("div", { className: "space-y-1.5 rounded-md border border-border p-2", children: [_jsx(SearchableSelect, { id: `${idPrefix}-${soort}`, value: modus === "handmatig" ? gekozenId : null, options: lijst.map((o) => ({ value: o.id, label: o.naam, hint: stickerHint(o), badge: o.id === standaardId ? "Klantstandaard" : null })), placeholder: "Automatisch", clearLabel: "\u2014 Automatisch (Floriday, klantassortiment of eigen sticker van het artikel) \u2014", emptyLabel: soort === "pot" ? "Geen potsticker voor deze klant en dit artikel" : "Geen fuststicker voor deze klant en dit artikel", onChange: (v) => { onChange(v ? { modus: "handmatig", id: v } : { modus: "auto", id: null }); setOpen(null); }, className: "h-9" }), uploadPad ? (_jsxs(Link, { to: uploadPad, className: "inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline", children: [_jsx(Upload, { className: "h-3.5 w-3.5", "aria-hidden": true }), " Nieuw bestand uploaden bij de klant"] })) : (_jsx("p", { className: "text-xs text-muted-foreground", children: "Een nieuw bestand voeg je toe bij de klant in de module Klanten." }))] })), open === "uit" && (_jsxs("div", { className: "space-y-1.5 rounded-md border border-border p-2", children: [floriday && (_jsxs("div", { role: "alert", className: "flex items-start gap-2 rounded-md bg-warning-soft px-2 py-1.5 text-xs text-warning-soft-foreground", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-3.5 w-3.5 shrink-0", "aria-hidden": true }), " ", _jsx("span", { children: FLORIDAY_NIET_PRINTEN })] })), _jsx(Label, { htmlFor: `${idPrefix}-${soort}-reden`, required: true, className: "text-xs text-muted-foreground", children: "Reden" }), _jsx(Input, { id: `${idPrefix}-${soort}-reden`, value: concept, maxLength: STICKER_REDEN_MAX, className: "h-9", onChange: (e) => setConcept(e.target.value) }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { type: "button", size: "sm", disabled: !concept.trim(), onClick: () => { onChange({ modus: "uit", reden: concept.trim() }); setOpen(null); }, children: "Niet printen" }), _jsx(Button, { type: "button", size: "sm", variant: "outline", onClick: () => setOpen(null), children: "Annuleren" })] })] }))] }));
19
+ }
20
+ export function StickerKeuzeRegels({ value, onChange, keuze, opties, uploadPad, disabled, idPrefix, }) {
21
+ return (_jsxs("div", { className: "space-y-2 sm:col-span-2 xl:col-span-4", children: [_jsx(Rij, { soort: "pot", label: "Potsticker", modus: value.potModus, gekozenId: value.productStickerId, lijst: opties?.product ?? [], standaardId: opties?.standaardProduct ?? null, engine: keuze?.pot ?? null, reden: value.reden, uploadPad: uploadPad, disabled: disabled, idPrefix: idPrefix, onChange: (p) => onChange({
22
+ ...(p.modus ? { potModus: p.modus } : {}),
23
+ ...(p.id !== undefined ? { productStickerId: p.id } : p.modus && p.modus !== "handmatig" ? { productStickerId: null } : {}),
24
+ ...(p.reden !== undefined ? { reden: p.reden } : {}),
25
+ }) }), _jsx(Rij, { soort: "fust", label: "Fuststicker", modus: value.fustModus, gekozenId: value.fustStickerId, lijst: opties?.fust ?? [], standaardId: opties?.standaardFust ?? null, engine: keuze?.fust ?? null, reden: value.reden, uploadPad: uploadPad, disabled: disabled, idPrefix: idPrefix, onChange: (p) => onChange({
26
+ ...(p.modus ? { fustModus: p.modus } : {}),
27
+ ...(p.id !== undefined ? { fustStickerId: p.id } : p.modus && p.modus !== "handmatig" ? { fustStickerId: null } : {}),
28
+ ...(p.reden !== undefined ? { reden: p.reden } : {}),
29
+ }) })] }));
30
+ }
@@ -3603,6 +3603,45 @@ export type Database = {
3603
3603
  }
3604
3604
  ];
3605
3605
  };
3606
+ customer_sticker_beleid: {
3607
+ Row: {
3608
+ beleid: string;
3609
+ created_at: string;
3610
+ customer_id: string;
3611
+ gewijzigd_door: string | null;
3612
+ updated_at: string;
3613
+ };
3614
+ Insert: {
3615
+ beleid?: string;
3616
+ created_at?: string;
3617
+ customer_id: string;
3618
+ gewijzigd_door?: string | null;
3619
+ updated_at?: string;
3620
+ };
3621
+ Update: {
3622
+ beleid?: string;
3623
+ created_at?: string;
3624
+ customer_id?: string;
3625
+ gewijzigd_door?: string | null;
3626
+ updated_at?: string;
3627
+ };
3628
+ Relationships: [
3629
+ {
3630
+ foreignKeyName: "customer_sticker_beleid_customer_id_fkey";
3631
+ columns: ["customer_id"];
3632
+ isOneToOne: true;
3633
+ referencedRelation: "customers";
3634
+ referencedColumns: ["id"];
3635
+ },
3636
+ {
3637
+ foreignKeyName: "customer_sticker_beleid_customer_id_fkey";
3638
+ columns: ["customer_id"];
3639
+ isOneToOne: true;
3640
+ referencedRelation: "klanten_selecteerbaar";
3641
+ referencedColumns: ["id"];
3642
+ }
3643
+ ];
3644
+ };
3606
3645
  customer_sticker_settings: {
3607
3646
  Row: {
3608
3647
  created_at: string;
@@ -9209,8 +9248,10 @@ export type Database = {
9209
9248
  connection_id: string;
9210
9249
  created_at: string;
9211
9250
  data: Json;
9251
+ deliver_separately: boolean | null;
9212
9252
  delivery_date_time: string | null;
9213
9253
  fetched_at: string;
9254
+ file_received_at: string | null;
9214
9255
  floriday_id: string;
9215
9256
  has_file: boolean | null;
9216
9257
  id: string;
@@ -9234,8 +9275,10 @@ export type Database = {
9234
9275
  connection_id: string;
9235
9276
  created_at?: string;
9236
9277
  data?: Json;
9278
+ deliver_separately?: boolean | null;
9237
9279
  delivery_date_time?: string | null;
9238
9280
  fetched_at?: string;
9281
+ file_received_at?: string | null;
9239
9282
  floriday_id: string;
9240
9283
  has_file?: boolean | null;
9241
9284
  id?: string;
@@ -9259,8 +9302,10 @@ export type Database = {
9259
9302
  connection_id?: string;
9260
9303
  created_at?: string;
9261
9304
  data?: Json;
9305
+ deliver_separately?: boolean | null;
9262
9306
  delivery_date_time?: string | null;
9263
9307
  fetched_at?: string;
9308
+ file_received_at?: string | null;
9264
9309
  floriday_id?: string;
9265
9310
  has_file?: boolean | null;
9266
9311
  id?: string;
@@ -20371,6 +20416,7 @@ export type Database = {
20371
20416
  print_job_id: string | null;
20372
20417
  print_plek_id: string | null;
20373
20418
  reden: string | null;
20419
+ samengevoegd_in: string | null;
20374
20420
  soort: string;
20375
20421
  status: string;
20376
20422
  sticker_type: string | null;
@@ -20399,6 +20445,7 @@ export type Database = {
20399
20445
  print_job_id?: string | null;
20400
20446
  print_plek_id?: string | null;
20401
20447
  reden?: string | null;
20448
+ samengevoegd_in?: string | null;
20402
20449
  soort: string;
20403
20450
  status?: string;
20404
20451
  sticker_type?: string | null;
@@ -20427,6 +20474,7 @@ export type Database = {
20427
20474
  print_job_id?: string | null;
20428
20475
  print_plek_id?: string | null;
20429
20476
  reden?: string | null;
20477
+ samengevoegd_in?: string | null;
20430
20478
  soort?: string;
20431
20479
  status?: string;
20432
20480
  sticker_type?: string | null;
@@ -35258,33 +35306,42 @@ export type Database = {
35258
35306
  Row: {
35259
35307
  created_at: string;
35260
35308
  fust_sticker_id: string | null;
35309
+ fust_sticker_modus: string;
35261
35310
  line_fields: Json;
35262
35311
  line_note: string | null;
35263
35312
  order_id: string;
35264
35313
  order_item_id: string;
35314
+ pot_sticker_modus: string;
35265
35315
  product_sticker_id: string | null;
35316
+ sticker_reden: string | null;
35266
35317
  updated_at: string;
35267
35318
  updated_by: string | null;
35268
35319
  };
35269
35320
  Insert: {
35270
35321
  created_at?: string;
35271
35322
  fust_sticker_id?: string | null;
35323
+ fust_sticker_modus?: string;
35272
35324
  line_fields?: Json;
35273
35325
  line_note?: string | null;
35274
35326
  order_id: string;
35275
35327
  order_item_id: string;
35328
+ pot_sticker_modus?: string;
35276
35329
  product_sticker_id?: string | null;
35330
+ sticker_reden?: string | null;
35277
35331
  updated_at?: string;
35278
35332
  updated_by?: string | null;
35279
35333
  };
35280
35334
  Update: {
35281
35335
  created_at?: string;
35282
35336
  fust_sticker_id?: string | null;
35337
+ fust_sticker_modus?: string;
35283
35338
  line_fields?: Json;
35284
35339
  line_note?: string | null;
35285
35340
  order_id?: string;
35286
35341
  order_item_id?: string;
35342
+ pot_sticker_modus?: string;
35287
35343
  product_sticker_id?: string | null;
35344
+ sticker_reden?: string | null;
35288
35345
  updated_at?: string;
35289
35346
  updated_by?: string | null;
35290
35347
  };
@@ -35431,6 +35488,56 @@ export type Database = {
35431
35488
  };
35432
35489
  Relationships: [];
35433
35490
  };
35491
+ voorraad_artikel_stickers: {
35492
+ Row: {
35493
+ bijgewerkt_op: string;
35494
+ breedte_mm: number;
35495
+ created_at: string;
35496
+ file_name: string | null;
35497
+ file_path: string;
35498
+ hoogte_mm: number;
35499
+ id: string;
35500
+ mime_type: string | null;
35501
+ product_id: string;
35502
+ soort: string;
35503
+ uploaded_by: string | null;
35504
+ };
35505
+ Insert: {
35506
+ bijgewerkt_op?: string;
35507
+ breedte_mm: number;
35508
+ created_at?: string;
35509
+ file_name?: string | null;
35510
+ file_path: string;
35511
+ hoogte_mm: number;
35512
+ id?: string;
35513
+ mime_type?: string | null;
35514
+ product_id: string;
35515
+ soort: string;
35516
+ uploaded_by?: string | null;
35517
+ };
35518
+ Update: {
35519
+ bijgewerkt_op?: string;
35520
+ breedte_mm?: number;
35521
+ created_at?: string;
35522
+ file_name?: string | null;
35523
+ file_path?: string;
35524
+ hoogte_mm?: number;
35525
+ id?: string;
35526
+ mime_type?: string | null;
35527
+ product_id?: string;
35528
+ soort?: string;
35529
+ uploaded_by?: string | null;
35530
+ };
35531
+ Relationships: [
35532
+ {
35533
+ foreignKeyName: "voorraad_artikel_stickers_product_id_fkey";
35534
+ columns: ["product_id"];
35535
+ isOneToOne: false;
35536
+ referencedRelation: "products";
35537
+ referencedColumns: ["id"];
35538
+ }
35539
+ ];
35540
+ };
35434
35541
  voorraad_buffer_state: {
35435
35542
  Row: {
35436
35543
  buffer_id: string;
@@ -39840,6 +39947,12 @@ export type Database = {
39840
39947
  };
39841
39948
  Returns: string;
39842
39949
  };
39950
+ _pick_verify_rows_kern: {
39951
+ Args: {
39952
+ _rows: Json;
39953
+ };
39954
+ Returns: Json;
39955
+ };
39843
39956
  _print_job_herstart: {
39844
39957
  Args: {
39845
39958
  p_bron: string;
@@ -41068,6 +41181,14 @@ export type Database = {
41068
41181
  };
41069
41182
  Returns: undefined;
41070
41183
  };
41184
+ boekhoud_vertaal_status_lezen: {
41185
+ Args: {
41186
+ p_action?: string;
41187
+ p_entity_id: string;
41188
+ p_entity_type: string;
41189
+ };
41190
+ Returns: Json;
41191
+ };
41071
41192
  boekhoud_vertaal_toegang: {
41072
41193
  Args: {
41073
41194
  p_niveau: string;
@@ -44247,6 +44368,12 @@ export type Database = {
44247
44368
  };
44248
44369
  Returns: Json;
44249
44370
  };
44371
+ klanten_sticker_beleid: {
44372
+ Args: {
44373
+ p_customer_id: string;
44374
+ };
44375
+ Returns: string;
44376
+ };
44250
44377
  klanten_sticker_voor: {
44251
44378
  Args: {
44252
44379
  p_customer_id: string;
@@ -44360,6 +44487,14 @@ export type Database = {
44360
44487
  rijen: number;
44361
44488
  }[];
44362
44489
  };
44490
+ layouts_afleverbrief_bron: {
44491
+ Args: {
44492
+ p_job_id: string;
44493
+ p_payload: Json;
44494
+ p_sleutel: string;
44495
+ };
44496
+ Returns: string;
44497
+ };
44363
44498
  layouts_controleplek: {
44364
44499
  Args: never;
44365
44500
  Returns: Json;
@@ -47431,6 +47566,12 @@ export type Database = {
47431
47566
  };
47432
47567
  Returns: Json;
47433
47568
  };
47569
+ logistics_kar_orderlijst_herstel: {
47570
+ Args: {
47571
+ p_limit?: number;
47572
+ };
47573
+ Returns: Json;
47574
+ };
47434
47575
  logistics_kar_svg: {
47435
47576
  Args: {
47436
47577
  p: Json;
@@ -47452,6 +47593,13 @@ export type Database = {
47452
47593
  };
47453
47594
  Returns: Json;
47454
47595
  };
47596
+ logistics_kar_tekening_kar: {
47597
+ Args: {
47598
+ p_cart_id: string;
47599
+ p_variant?: string;
47600
+ };
47601
+ Returns: Json;
47602
+ };
47455
47603
  logistics_kar_tekening_v2: {
47456
47604
  Args: {
47457
47605
  p_opties?: Json;
@@ -47468,6 +47616,12 @@ export type Database = {
47468
47616
  };
47469
47617
  Returns: string;
47470
47618
  };
47619
+ logistics_kar_telling: {
47620
+ Args: {
47621
+ p_cart_id: string;
47622
+ };
47623
+ Returns: Json;
47624
+ };
47471
47625
  logistics_kargroep_soort: {
47472
47626
  Args: {
47473
47627
  p_order_id: string;
@@ -50206,6 +50360,12 @@ export type Database = {
50206
50360
  };
50207
50361
  Returns: boolean;
50208
50362
  };
50363
+ logistics_slip_kar_telling: {
50364
+ Args: {
50365
+ p_cart: Json;
50366
+ };
50367
+ Returns: Json;
50368
+ };
50209
50369
  logistics_slip_note_claim: {
50210
50370
  Args: {
50211
50371
  _lease_seconds?: number;
@@ -57175,6 +57335,15 @@ export type Database = {
57175
57335
  unit: string;
57176
57336
  }[];
57177
57337
  };
57338
+ voorraad_artikel_sticker_opslaan: {
57339
+ Args: {
57340
+ p_nieuw: Json;
57341
+ p_oud_pad: string;
57342
+ p_product_id: string;
57343
+ p_soort: string;
57344
+ };
57345
+ Returns: Json;
57346
+ };
57178
57347
  voorraad_beschikbaar_v2: {
57179
57348
  Args: {
57180
57349
  p_exclude_order_id?: string;
@@ -57946,6 +58115,23 @@ export type Database = {
57946
58115
  };
57947
58116
  Returns: string[];
57948
58117
  };
58118
+ voorraad_sticker_vlaggen: {
58119
+ Args: {
58120
+ p_product_ids: string[];
58121
+ };
58122
+ Returns: {
58123
+ fust: boolean;
58124
+ pot: boolean;
58125
+ product_id: string;
58126
+ }[];
58127
+ };
58128
+ voorraad_sticker_voor: {
58129
+ Args: {
58130
+ p_product_id: string;
58131
+ p_soort: string;
58132
+ };
58133
+ Returns: Json;
58134
+ };
57949
58135
  voorraad_stock_context_status: {
57950
58136
  Args: never;
57951
58137
  Returns: Json;