@flowselections/floriday-verkoop-module 1.0.19 → 1.0.21
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/verkoop/OrderControlStatusCard.d.ts +6 -0
- package/dist-lib/components/verkoop/OrderControlStatusCard.d.ts.map +1 -0
- package/dist-lib/components/verkoop/OrderControlStatusCard.js +41 -0
- package/dist-lib/components/verkoop/SalesOrderDetailPage.d.ts.map +1 -1
- package/dist-lib/components/verkoop/SalesOrderDetailPage.js +20 -5
- package/dist-lib/components/verkoop/SalesOrderDetailView.d.ts.map +1 -1
- package/dist-lib/components/verkoop/SalesOrderDetailView.js +2 -1
- package/dist-lib/components/verkoop/SalesOrdersTable.d.ts.map +1 -1
- package/dist-lib/components/verkoop/SalesOrdersTable.js +4 -1
- package/dist-lib/components/verkoop/VerkoopOrdersPage.js +1 -1
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +22 -0
- package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.d.ts +22 -0
- package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.server.d.ts +22 -0
- package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +22 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/cart-lock.functions.d.ts +22 -0
- package/dist-lib/lib/cart-lock.functions.d.ts.map +1 -1
- package/dist-lib/lib/cart-replan.functions.d.ts +44 -0
- package/dist-lib/lib/cart-replan.functions.d.ts.map +1 -1
- package/dist-lib/lib/create-order.functions.d.ts +264 -0
- package/dist-lib/lib/create-order.functions.d.ts.map +1 -1
- package/dist-lib/lib/create-order.functions.js +34 -25
- package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts +66 -0
- package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-logistic-labels.functions.d.ts +22 -0
- package/dist-lib/lib/floriday-logistic-labels.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-public.functions.d.ts +157 -0
- package/dist-lib/lib/floriday-public.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-public.functions.js +114 -38
- package/dist-lib/lib/floriday-writes.functions.d.ts +110 -0
- package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
- package/dist-lib/lib/order-shipments.functions.d.ts +88 -0
- package/dist-lib/lib/order-shipments.functions.d.ts.map +1 -1
- package/dist-lib/lib/salesorders-mapping.d.ts +2 -0
- package/dist-lib/lib/salesorders-mapping.d.ts.map +1 -1
- package/dist-lib/lib/salesorders-mapping.js +8 -1
- package/dist-lib/lib/salesorders.functions.d.ts +23785 -0
- package/dist-lib/lib/salesorders.functions.d.ts.map +1 -1
- package/dist-lib/lib/salesorders.functions.js +181 -0
- package/dist-lib/lib/tradeitems.functions.d.ts +22 -0
- package/dist-lib/lib/tradeitems.functions.d.ts.map +1 -1
- package/dist-lib/lib/useSalesOrderDetailQuery.d.ts +2 -0
- package/dist-lib/lib/useSalesOrderDetailQuery.d.ts.map +1 -0
- package/dist-lib/lib/useSalesOrderDetailQuery.js +50 -0
- package/dist-lib/lib/useSalesOrdersQuery.d.ts +2 -2
- package/dist-lib/lib/useSalesOrdersQuery.d.ts.map +1 -1
- package/dist-lib/lib/useSalesOrdersQuery.js +165 -12
- package/package.json +1 -1
|
@@ -49,7 +49,7 @@ export const listProductsForCreateOrder = createServerFn({ method: "GET" })
|
|
|
49
49
|
.range(0, 9999),
|
|
50
50
|
context.supabase
|
|
51
51
|
.from("products")
|
|
52
|
-
.select("id, product, unit, sale_price, plants_per_crate, crates_per_layer, layers_per_cart, quantity, custom_fields")
|
|
52
|
+
.select("id, product, unit, sale_price, plants_per_crate, crates_per_layer, layers_per_cart, quantity, custom_fields, trade_item_key")
|
|
53
53
|
.range(0, 4999),
|
|
54
54
|
]);
|
|
55
55
|
// Supabase geeft standaard max. 1000 rijen terug. Voor productgroepen kan de
|
|
@@ -242,6 +242,13 @@ export const listProductsForCreateOrder = createServerFn({ method: "GET" })
|
|
|
242
242
|
for (const p of Array.isArray(productsRes.data) ? productsRes.data : []) {
|
|
243
243
|
productsById.set(p.id, p);
|
|
244
244
|
}
|
|
245
|
+
const productsByGroupId = new Map();
|
|
246
|
+
for (const p of Array.isArray(productsRes.data) ? productsRes.data : []) {
|
|
247
|
+
const key = p.trade_item_key;
|
|
248
|
+
if (typeof key === "string" && key.startsWith("group:")) {
|
|
249
|
+
productsByGroupId.set(key.slice("group:".length), p);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
245
252
|
const packingFromProductRow = (p) => ({
|
|
246
253
|
plants_per_crate: Math.max(1, Number(p?.plants_per_crate ?? 1)),
|
|
247
254
|
crates_per_layer: Math.max(1, Number(p?.crates_per_layer ?? 1)),
|
|
@@ -277,32 +284,34 @@ export const listProductsForCreateOrder = createServerFn({ method: "GET" })
|
|
|
277
284
|
reserved = resSum;
|
|
278
285
|
available = Math.max(0, physical - reserved);
|
|
279
286
|
}
|
|
280
|
-
//
|
|
281
|
-
//
|
|
287
|
+
// Head eerst — belading van de groep = belading van het hoofdproduct.
|
|
288
|
+
// Volgorde: head_trade_item_floriday_id → head_product_id → group-mirror
|
|
289
|
+
// products-rij (`trade_item_key = 'group:<id>'`) → eerste member.
|
|
282
290
|
let packing = { plants_per_crate: 1, crates_per_layer: 1, layers_per_cart: 1 };
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
for (const cand of candidates) {
|
|
291
|
+
const headFloriday = r.head_trade_item_floriday_id;
|
|
292
|
+
const headProduct = r.head_product_id;
|
|
293
|
+
const groupMirror = productsByGroupId.get(id);
|
|
294
|
+
const firstMemberId = members[0]?.trade_item_id ?? null;
|
|
295
|
+
const tryFromById = (cand) => {
|
|
289
296
|
if (!cand)
|
|
290
|
-
|
|
291
|
-
const
|
|
292
|
-
if (
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
297
|
+
return null;
|
|
298
|
+
const hit = byId.get(cand);
|
|
299
|
+
if (!hit)
|
|
300
|
+
return null;
|
|
301
|
+
return {
|
|
302
|
+
plants_per_crate: hit.plants_per_crate,
|
|
303
|
+
crates_per_layer: hit.crates_per_layer,
|
|
304
|
+
layers_per_cart: hit.layers_per_cart,
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
const tryFromProductRow = (row) => (row ? packingFromProductRow(row) : null);
|
|
308
|
+
packing =
|
|
309
|
+
tryFromById(headFloriday) ??
|
|
310
|
+
tryFromProductRow(headProduct ? productsById.get(headProduct) : null) ??
|
|
311
|
+
tryFromProductRow(groupMirror) ??
|
|
312
|
+
tryFromById(firstMemberId) ??
|
|
313
|
+
tryFromProductRow(firstMemberId ? productsById.get(firstMemberId) : null) ??
|
|
314
|
+
packing;
|
|
306
315
|
byId.set(id, {
|
|
307
316
|
id,
|
|
308
317
|
product: displayName,
|
|
@@ -4700,6 +4700,8 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
|
|
|
4700
4700
|
Row: {
|
|
4701
4701
|
buyer_organization_id: string | null;
|
|
4702
4702
|
connection_id: string;
|
|
4703
|
+
controlled_at: string | null;
|
|
4704
|
+
controlled_by: string | null;
|
|
4703
4705
|
created_at: string;
|
|
4704
4706
|
data: import("../integrations/supabase/types").Json;
|
|
4705
4707
|
floriday_id: string;
|
|
@@ -4711,6 +4713,8 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
|
|
|
4711
4713
|
Insert: {
|
|
4712
4714
|
buyer_organization_id?: string | null;
|
|
4713
4715
|
connection_id: string;
|
|
4716
|
+
controlled_at?: string | null;
|
|
4717
|
+
controlled_by?: string | null;
|
|
4714
4718
|
created_at?: string;
|
|
4715
4719
|
data: import("../integrations/supabase/types").Json;
|
|
4716
4720
|
floriday_id: string;
|
|
@@ -4722,6 +4726,8 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
|
|
|
4722
4726
|
Update: {
|
|
4723
4727
|
buyer_organization_id?: string | null;
|
|
4724
4728
|
connection_id?: string;
|
|
4729
|
+
controlled_at?: string | null;
|
|
4730
|
+
controlled_by?: string | null;
|
|
4725
4731
|
created_at?: string;
|
|
4726
4732
|
data?: import("../integrations/supabase/types").Json;
|
|
4727
4733
|
floriday_id?: string;
|
|
@@ -7740,6 +7746,7 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
|
|
|
7740
7746
|
id: string;
|
|
7741
7747
|
image_url: string | null;
|
|
7742
7748
|
incoming_quantity: number;
|
|
7749
|
+
is_layer: boolean;
|
|
7743
7750
|
layers_per_cart: number;
|
|
7744
7751
|
location: string;
|
|
7745
7752
|
min_quantity: number;
|
|
@@ -7767,6 +7774,7 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
|
|
|
7767
7774
|
id?: string;
|
|
7768
7775
|
image_url?: string | null;
|
|
7769
7776
|
incoming_quantity?: number;
|
|
7777
|
+
is_layer?: boolean;
|
|
7770
7778
|
layers_per_cart?: number;
|
|
7771
7779
|
location: string;
|
|
7772
7780
|
min_quantity?: number;
|
|
@@ -7794,6 +7802,7 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
|
|
|
7794
7802
|
id?: string;
|
|
7795
7803
|
image_url?: string | null;
|
|
7796
7804
|
incoming_quantity?: number;
|
|
7805
|
+
is_layer?: boolean;
|
|
7797
7806
|
layers_per_cart?: number;
|
|
7798
7807
|
location?: string;
|
|
7799
7808
|
min_quantity?: number;
|
|
@@ -11308,6 +11317,13 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
|
|
|
11308
11317
|
};
|
|
11309
11318
|
Returns: undefined;
|
|
11310
11319
|
};
|
|
11320
|
+
mark_salesorder_controlled: {
|
|
11321
|
+
Args: {
|
|
11322
|
+
p_controlled: boolean;
|
|
11323
|
+
p_floriday_id: string;
|
|
11324
|
+
};
|
|
11325
|
+
Returns: undefined;
|
|
11326
|
+
};
|
|
11311
11327
|
mark_shipment_shipped: {
|
|
11312
11328
|
Args: {
|
|
11313
11329
|
p_shipment_id: string;
|
|
@@ -11786,6 +11802,12 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
|
|
|
11786
11802
|
};
|
|
11787
11803
|
Returns: undefined;
|
|
11788
11804
|
};
|
|
11805
|
+
sync_product_group_belading: {
|
|
11806
|
+
Args: {
|
|
11807
|
+
_group_id: string;
|
|
11808
|
+
};
|
|
11809
|
+
Returns: undefined;
|
|
11810
|
+
};
|
|
11789
11811
|
sync_product_packing_from_floriday_cache: {
|
|
11790
11812
|
Args: {
|
|
11791
11813
|
p_floriday_id: string;
|
|
@@ -16534,6 +16556,8 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
|
|
|
16534
16556
|
Row: {
|
|
16535
16557
|
buyer_organization_id: string | null;
|
|
16536
16558
|
connection_id: string;
|
|
16559
|
+
controlled_at: string | null;
|
|
16560
|
+
controlled_by: string | null;
|
|
16537
16561
|
created_at: string;
|
|
16538
16562
|
data: import("../integrations/supabase/types").Json;
|
|
16539
16563
|
floriday_id: string;
|
|
@@ -16545,6 +16569,8 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
|
|
|
16545
16569
|
Insert: {
|
|
16546
16570
|
buyer_organization_id?: string | null;
|
|
16547
16571
|
connection_id: string;
|
|
16572
|
+
controlled_at?: string | null;
|
|
16573
|
+
controlled_by?: string | null;
|
|
16548
16574
|
created_at?: string;
|
|
16549
16575
|
data: import("../integrations/supabase/types").Json;
|
|
16550
16576
|
floriday_id: string;
|
|
@@ -16556,6 +16582,8 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
|
|
|
16556
16582
|
Update: {
|
|
16557
16583
|
buyer_organization_id?: string | null;
|
|
16558
16584
|
connection_id?: string;
|
|
16585
|
+
controlled_at?: string | null;
|
|
16586
|
+
controlled_by?: string | null;
|
|
16559
16587
|
created_at?: string;
|
|
16560
16588
|
data?: import("../integrations/supabase/types").Json;
|
|
16561
16589
|
floriday_id?: string;
|
|
@@ -19574,6 +19602,7 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
|
|
|
19574
19602
|
id: string;
|
|
19575
19603
|
image_url: string | null;
|
|
19576
19604
|
incoming_quantity: number;
|
|
19605
|
+
is_layer: boolean;
|
|
19577
19606
|
layers_per_cart: number;
|
|
19578
19607
|
location: string;
|
|
19579
19608
|
min_quantity: number;
|
|
@@ -19601,6 +19630,7 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
|
|
|
19601
19630
|
id?: string;
|
|
19602
19631
|
image_url?: string | null;
|
|
19603
19632
|
incoming_quantity?: number;
|
|
19633
|
+
is_layer?: boolean;
|
|
19604
19634
|
layers_per_cart?: number;
|
|
19605
19635
|
location: string;
|
|
19606
19636
|
min_quantity?: number;
|
|
@@ -19628,6 +19658,7 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
|
|
|
19628
19658
|
id?: string;
|
|
19629
19659
|
image_url?: string | null;
|
|
19630
19660
|
incoming_quantity?: number;
|
|
19661
|
+
is_layer?: boolean;
|
|
19631
19662
|
layers_per_cart?: number;
|
|
19632
19663
|
location?: string;
|
|
19633
19664
|
min_quantity?: number;
|
|
@@ -23142,6 +23173,13 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
|
|
|
23142
23173
|
};
|
|
23143
23174
|
Returns: undefined;
|
|
23144
23175
|
};
|
|
23176
|
+
mark_salesorder_controlled: {
|
|
23177
|
+
Args: {
|
|
23178
|
+
p_controlled: boolean;
|
|
23179
|
+
p_floriday_id: string;
|
|
23180
|
+
};
|
|
23181
|
+
Returns: undefined;
|
|
23182
|
+
};
|
|
23145
23183
|
mark_shipment_shipped: {
|
|
23146
23184
|
Args: {
|
|
23147
23185
|
p_shipment_id: string;
|
|
@@ -23620,6 +23658,12 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
|
|
|
23620
23658
|
};
|
|
23621
23659
|
Returns: undefined;
|
|
23622
23660
|
};
|
|
23661
|
+
sync_product_group_belading: {
|
|
23662
|
+
Args: {
|
|
23663
|
+
_group_id: string;
|
|
23664
|
+
};
|
|
23665
|
+
Returns: undefined;
|
|
23666
|
+
};
|
|
23623
23667
|
sync_product_packing_from_floriday_cache: {
|
|
23624
23668
|
Args: {
|
|
23625
23669
|
p_floriday_id: string;
|
|
@@ -28377,6 +28421,8 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
|
|
|
28377
28421
|
Row: {
|
|
28378
28422
|
buyer_organization_id: string | null;
|
|
28379
28423
|
connection_id: string;
|
|
28424
|
+
controlled_at: string | null;
|
|
28425
|
+
controlled_by: string | null;
|
|
28380
28426
|
created_at: string;
|
|
28381
28427
|
data: import("../integrations/supabase/types").Json;
|
|
28382
28428
|
floriday_id: string;
|
|
@@ -28388,6 +28434,8 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
|
|
|
28388
28434
|
Insert: {
|
|
28389
28435
|
buyer_organization_id?: string | null;
|
|
28390
28436
|
connection_id: string;
|
|
28437
|
+
controlled_at?: string | null;
|
|
28438
|
+
controlled_by?: string | null;
|
|
28391
28439
|
created_at?: string;
|
|
28392
28440
|
data: import("../integrations/supabase/types").Json;
|
|
28393
28441
|
floriday_id: string;
|
|
@@ -28399,6 +28447,8 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
|
|
|
28399
28447
|
Update: {
|
|
28400
28448
|
buyer_organization_id?: string | null;
|
|
28401
28449
|
connection_id?: string;
|
|
28450
|
+
controlled_at?: string | null;
|
|
28451
|
+
controlled_by?: string | null;
|
|
28402
28452
|
created_at?: string;
|
|
28403
28453
|
data?: import("../integrations/supabase/types").Json;
|
|
28404
28454
|
floriday_id?: string;
|
|
@@ -31417,6 +31467,7 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
|
|
|
31417
31467
|
id: string;
|
|
31418
31468
|
image_url: string | null;
|
|
31419
31469
|
incoming_quantity: number;
|
|
31470
|
+
is_layer: boolean;
|
|
31420
31471
|
layers_per_cart: number;
|
|
31421
31472
|
location: string;
|
|
31422
31473
|
min_quantity: number;
|
|
@@ -31444,6 +31495,7 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
|
|
|
31444
31495
|
id?: string;
|
|
31445
31496
|
image_url?: string | null;
|
|
31446
31497
|
incoming_quantity?: number;
|
|
31498
|
+
is_layer?: boolean;
|
|
31447
31499
|
layers_per_cart?: number;
|
|
31448
31500
|
location: string;
|
|
31449
31501
|
min_quantity?: number;
|
|
@@ -31471,6 +31523,7 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
|
|
|
31471
31523
|
id?: string;
|
|
31472
31524
|
image_url?: string | null;
|
|
31473
31525
|
incoming_quantity?: number;
|
|
31526
|
+
is_layer?: boolean;
|
|
31474
31527
|
layers_per_cart?: number;
|
|
31475
31528
|
location?: string;
|
|
31476
31529
|
min_quantity?: number;
|
|
@@ -34985,6 +35038,13 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
|
|
|
34985
35038
|
};
|
|
34986
35039
|
Returns: undefined;
|
|
34987
35040
|
};
|
|
35041
|
+
mark_salesorder_controlled: {
|
|
35042
|
+
Args: {
|
|
35043
|
+
p_controlled: boolean;
|
|
35044
|
+
p_floriday_id: string;
|
|
35045
|
+
};
|
|
35046
|
+
Returns: undefined;
|
|
35047
|
+
};
|
|
34988
35048
|
mark_shipment_shipped: {
|
|
34989
35049
|
Args: {
|
|
34990
35050
|
p_shipment_id: string;
|
|
@@ -35463,6 +35523,12 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
|
|
|
35463
35523
|
};
|
|
35464
35524
|
Returns: undefined;
|
|
35465
35525
|
};
|
|
35526
|
+
sync_product_group_belading: {
|
|
35527
|
+
Args: {
|
|
35528
|
+
_group_id: string;
|
|
35529
|
+
};
|
|
35530
|
+
Returns: undefined;
|
|
35531
|
+
};
|
|
35466
35532
|
sync_product_packing_from_floriday_cache: {
|
|
35467
35533
|
Args: {
|
|
35468
35534
|
p_floriday_id: string;
|