@flowselections/floriday-klanten-module 1.0.58 → 1.0.62
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/klanten/FloridayAutoPromoteCard.d.ts +1 -1
- package/dist-lib/components/klanten/FloridayAutoPromoteCard.d.ts.map +1 -1
- package/dist-lib/components/klanten/FloridayAutoPromoteCard.js +11 -31
- package/dist-lib/index.js +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +108 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/accounting/twinfield/sandbox-guard.server.d.ts +9 -0
- package/dist-lib/lib/accounting/twinfield/sandbox-guard.server.d.ts.map +1 -0
- package/dist-lib/lib/accounting/twinfield/sandbox-guard.server.js +38 -0
- package/dist-lib/lib/accounting/twinfield/sandbox-rmw.server.d.ts.map +1 -1
- package/dist-lib/lib/accounting/twinfield/sandbox-rmw.server.js +2 -0
- package/dist-lib/lib/accounting/twinfield/worker.functions.d.ts.map +1 -1
- package/dist-lib/lib/accounting/twinfield/worker.functions.js +2 -0
- package/dist-lib/lib/accounting/twinfield/worker.server.d.ts.map +1 -1
- package/dist-lib/lib/accounting/twinfield/worker.server.js +12 -0
- package/dist-lib/lib/accounting/twinfield/write-gate.d.ts +6 -0
- package/dist-lib/lib/accounting/twinfield/write-gate.d.ts.map +1 -0
- package/dist-lib/lib/accounting/twinfield/write-gate.js +7 -0
- package/dist-lib/lib/auto-promote.d.ts +1 -0
- package/dist-lib/lib/auto-promote.d.ts.map +1 -1
- package/dist-lib/lib/auto-promote.functions.d.ts +1 -13
- package/dist-lib/lib/auto-promote.functions.d.ts.map +1 -1
- package/dist-lib/lib/auto-promote.functions.js +0 -13
- package/dist-lib/lib/customers.functions.d.ts.map +1 -1
- package/dist-lib/lib/customers.functions.js +9 -6
- package/dist-lib/lib/external-customers.functions.d.ts.map +1 -1
- package/dist-lib/lib/external-customers.functions.js +7 -1
- package/dist-lib/lib/twinfield-enqueue-rule.d.ts +13 -0
- package/dist-lib/lib/twinfield-enqueue-rule.d.ts.map +1 -0
- package/dist-lib/lib/twinfield-enqueue-rule.js +16 -0
- package/package.json +4 -3
- package/schema/klanten.sql +1895 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/** Alleen voor beheerders:
|
|
1
|
+
/** Alleen voor beheerders: telling van het automatisch aanmaken van Floriday-klanten (geen schakelaars). */
|
|
2
2
|
export declare function FloridayAutoPromoteCard(): import("react").JSX.Element | null;
|
|
3
3
|
//# sourceMappingURL=FloridayAutoPromoteCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloridayAutoPromoteCard.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/FloridayAutoPromoteCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FloridayAutoPromoteCard.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/FloridayAutoPromoteCard.tsx"],"names":[],"mappings":"AAQA,4GAA4G;AAC5G,wBAAgB,uBAAuB,uCAItC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import { useQuery
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
4
4
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
|
-
import { Card, CardContent, Switch, toast, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "@flowselections/core";
|
|
6
5
|
import { useCustomerDefaults } from "./useCustomerDefaults.js";
|
|
7
|
-
import { getAutoPromoteStatus
|
|
6
|
+
import { getAutoPromoteStatus } from "../../lib/auto-promote.functions.js";
|
|
8
7
|
import { skipReasons, skippedTotal, roundSummary } from "../../lib/auto-promote.js";
|
|
9
8
|
import { friendlyError } from "../../lib/errors.js";
|
|
10
|
-
/** Alleen voor beheerders:
|
|
9
|
+
/** Alleen voor beheerders: telling van het automatisch aanmaken van Floriday-klanten (geen schakelaars). */
|
|
11
10
|
export function FloridayAutoPromoteCard() {
|
|
12
11
|
const { isAdmin } = useCustomerDefaults();
|
|
13
12
|
if (isAdmin !== true)
|
|
@@ -15,37 +14,18 @@ export function FloridayAutoPromoteCard() {
|
|
|
15
14
|
return _jsx(Inner, {});
|
|
16
15
|
}
|
|
17
16
|
function Inner() {
|
|
18
|
-
const
|
|
17
|
+
const [open, setOpen] = useState(false);
|
|
19
18
|
const getStatus = useServerFn(getAutoPromoteStatus);
|
|
20
|
-
const
|
|
21
|
-
const q = useQuery({ queryKey: ["klanten-auto-promote"], queryFn: () => getStatus() });
|
|
22
|
-
const [confirm, setConfirm] = useState(null);
|
|
23
|
-
const [result, setResult] = useState(null);
|
|
24
|
-
const [showDetails, setShowDetails] = useState(false);
|
|
25
|
-
const m = useMutation({
|
|
26
|
-
mutationFn: (v) => setFn({ data: v }),
|
|
27
|
-
onSuccess: (r, v) => {
|
|
28
|
-
if (v.on)
|
|
29
|
-
setResult({ kind: v.kind, r });
|
|
30
|
-
qc.invalidateQueries({ queryKey: ["klanten-auto-promote"] });
|
|
31
|
-
qc.invalidateQueries({ queryKey: ["customers"] });
|
|
32
|
-
},
|
|
33
|
-
onError: (e) => toast.error(friendlyError(e)),
|
|
34
|
-
});
|
|
19
|
+
const q = useQuery({ queryKey: ["klanten-auto-promote"], queryFn: () => getStatus(), enabled: open });
|
|
35
20
|
const s = q.data;
|
|
36
21
|
const rows = s
|
|
37
22
|
? [
|
|
38
|
-
{
|
|
39
|
-
{
|
|
23
|
+
{ label: "Uit inkooprelaties", c: s.inkooprelatie ?? {} },
|
|
24
|
+
{ label: "Uit Floriday-orders", c: s.order ?? {} },
|
|
40
25
|
]
|
|
41
26
|
: [];
|
|
42
|
-
|
|
43
|
-
return (_jsxs(Card, { children: [_jsxs(CardContent, { className: "p-4 space-y-3", children: [_jsxs("div", { children: [_jsx("h2", { className: "font-semibold", children: "Floriday-klanten automatisch aanmaken" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Kopers uit Floriday worden klant. Er gaat niets naar Floriday of naar de boekhouding." })] }), q.isLoading && _jsx("p", { className: "text-sm text-muted-foreground", children: "Telling ophalen\u2026" }), q.error && _jsx("p", { className: "text-sm text-destructive", children: friendlyError(q.error) }), rows.map((r) => {
|
|
27
|
+
return (_jsxs("div", { className: "text-xs text-muted-foreground", children: [_jsx("button", { type: "button", className: "underline", onClick: () => setOpen((v) => !v), children: "Details voor beheer: Floriday-klanten" }), open && (_jsxs("div", { className: "mt-2 space-y-2 rounded border p-3", children: [_jsx("p", { children: "Kopers uit Floriday worden elke 5 minuten vanzelf klant. Ze gaan niet vanzelf naar de boekhouding." }), q.isLoading && _jsx("p", { children: "Telling ophalen\u2026" }), q.error && _jsx("p", { className: "text-destructive", children: friendlyError(q.error) }), s?.laatste_ronde && _jsxs("p", { children: ["Laatste ronde: ", roundSummary(s.laatste_ronde)] }), rows.map((r) => {
|
|
44
28
|
const reasons = skipReasons(r.c);
|
|
45
|
-
return (_jsxs("div", {
|
|
46
|
-
}), s && (_jsxs(
|
|
47
|
-
if (pending)
|
|
48
|
-
m.mutate({ kind: pending.kind, on: true });
|
|
49
|
-
setConfirm(null);
|
|
50
|
-
}, children: "Aanzetten" })] })] }) })] }));
|
|
29
|
+
return (_jsxs("div", { children: [_jsxs("span", { className: "font-medium", children: [r.label, ":"] }), " nog ", r.c.nieuw ?? 0, " nieuw \u00B7", " ", r.c.koppelen_op_gln ?? 0, " koppelen op GLN \u00B7 ", skippedTotal(r.c), " overgeslagen", reasons.length > 0 && _jsxs("div", { children: ["Overgeslagen: ", reasons.join("; ")] })] }, r.label));
|
|
30
|
+
}), s && (_jsxs(_Fragment, { children: [_jsxs("p", { children: ["Kopers met een order \u00E9n een inkooprelatie: ", s.order_ook_inkooprelatie] }), _jsx("p", { children: "Steekproef van niet gevonden organisaties:" }), _jsx("pre", { className: "overflow-x-auto whitespace-pre-wrap break-all rounded bg-muted p-2", children: s.steekproef })] }))] }))] }));
|
|
51
31
|
}
|
package/dist-lib/index.js
CHANGED
|
@@ -14188,6 +14188,7 @@ export type Database = {
|
|
|
14188
14188
|
bron_id: string;
|
|
14189
14189
|
cart_id: string | null;
|
|
14190
14190
|
created_at: string;
|
|
14191
|
+
eigen_sticker_id: string | null;
|
|
14191
14192
|
fulfillment_order_id: string | null;
|
|
14192
14193
|
handled_at: string | null;
|
|
14193
14194
|
handled_error: string | null;
|
|
@@ -14214,6 +14215,7 @@ export type Database = {
|
|
|
14214
14215
|
bron_id: string;
|
|
14215
14216
|
cart_id?: string | null;
|
|
14216
14217
|
created_at?: string;
|
|
14218
|
+
eigen_sticker_id?: string | null;
|
|
14217
14219
|
fulfillment_order_id?: string | null;
|
|
14218
14220
|
handled_at?: string | null;
|
|
14219
14221
|
handled_error?: string | null;
|
|
@@ -14240,6 +14242,7 @@ export type Database = {
|
|
|
14240
14242
|
bron_id?: string;
|
|
14241
14243
|
cart_id?: string | null;
|
|
14242
14244
|
created_at?: string;
|
|
14245
|
+
eigen_sticker_id?: string | null;
|
|
14243
14246
|
fulfillment_order_id?: string | null;
|
|
14244
14247
|
handled_at?: string | null;
|
|
14245
14248
|
handled_error?: string | null;
|
|
@@ -24640,6 +24643,10 @@ export type Database = {
|
|
|
24640
24643
|
superseded_at: string | null;
|
|
24641
24644
|
updated_at: string;
|
|
24642
24645
|
user_id: string;
|
|
24646
|
+
write_enabled: boolean;
|
|
24647
|
+
write_enabled_at: string | null;
|
|
24648
|
+
write_enabled_by: string | null;
|
|
24649
|
+
write_enabled_reason: string | null;
|
|
24643
24650
|
};
|
|
24644
24651
|
Insert: {
|
|
24645
24652
|
account_key?: string | null;
|
|
@@ -24666,6 +24673,10 @@ export type Database = {
|
|
|
24666
24673
|
superseded_at?: string | null;
|
|
24667
24674
|
updated_at?: string;
|
|
24668
24675
|
user_id: string;
|
|
24676
|
+
write_enabled?: boolean;
|
|
24677
|
+
write_enabled_at?: string | null;
|
|
24678
|
+
write_enabled_by?: string | null;
|
|
24679
|
+
write_enabled_reason?: string | null;
|
|
24669
24680
|
};
|
|
24670
24681
|
Update: {
|
|
24671
24682
|
account_key?: string | null;
|
|
@@ -24692,6 +24703,10 @@ export type Database = {
|
|
|
24692
24703
|
superseded_at?: string | null;
|
|
24693
24704
|
updated_at?: string;
|
|
24694
24705
|
user_id?: string;
|
|
24706
|
+
write_enabled?: boolean;
|
|
24707
|
+
write_enabled_at?: string | null;
|
|
24708
|
+
write_enabled_by?: string | null;
|
|
24709
|
+
write_enabled_reason?: string | null;
|
|
24695
24710
|
};
|
|
24696
24711
|
Relationships: [];
|
|
24697
24712
|
};
|
|
@@ -25580,6 +25595,21 @@ export type Database = {
|
|
|
25580
25595
|
};
|
|
25581
25596
|
Relationships: [];
|
|
25582
25597
|
};
|
|
25598
|
+
twinfield_schema_upgrades: {
|
|
25599
|
+
Row: {
|
|
25600
|
+
applied_at: string;
|
|
25601
|
+
key: string;
|
|
25602
|
+
};
|
|
25603
|
+
Insert: {
|
|
25604
|
+
applied_at?: string;
|
|
25605
|
+
key: string;
|
|
25606
|
+
};
|
|
25607
|
+
Update: {
|
|
25608
|
+
applied_at?: string;
|
|
25609
|
+
key?: string;
|
|
25610
|
+
};
|
|
25611
|
+
Relationships: [];
|
|
25612
|
+
};
|
|
25583
25613
|
twinfield_session_cache: {
|
|
25584
25614
|
Row: {
|
|
25585
25615
|
cluster: string;
|
|
@@ -31883,6 +31913,10 @@ export type Database = {
|
|
|
31883
31913
|
Args: never;
|
|
31884
31914
|
Returns: Json;
|
|
31885
31915
|
};
|
|
31916
|
+
klanten_refresh_grouped_if_stale: {
|
|
31917
|
+
Args: never;
|
|
31918
|
+
Returns: boolean;
|
|
31919
|
+
};
|
|
31886
31920
|
klanten_set_auto_promote: {
|
|
31887
31921
|
Args: {
|
|
31888
31922
|
p_kind: string;
|
|
@@ -33035,6 +33069,13 @@ export type Database = {
|
|
|
33035
33069
|
};
|
|
33036
33070
|
Returns: Json;
|
|
33037
33071
|
};
|
|
33072
|
+
logistics_document_for_order: {
|
|
33073
|
+
Args: {
|
|
33074
|
+
p_documenttype: string;
|
|
33075
|
+
p_order_id: string;
|
|
33076
|
+
};
|
|
33077
|
+
Returns: Json;
|
|
33078
|
+
};
|
|
33038
33079
|
logistics_document_layout: {
|
|
33039
33080
|
Args: {
|
|
33040
33081
|
_document_code: string;
|
|
@@ -33048,6 +33089,10 @@ export type Database = {
|
|
|
33048
33089
|
};
|
|
33049
33090
|
Returns: Json;
|
|
33050
33091
|
};
|
|
33092
|
+
logistics_document_selection_status: {
|
|
33093
|
+
Args: never;
|
|
33094
|
+
Returns: Json;
|
|
33095
|
+
};
|
|
33051
33096
|
logistics_document_station: {
|
|
33052
33097
|
Args: {
|
|
33053
33098
|
_document_code: string;
|
|
@@ -33866,6 +33911,12 @@ export type Database = {
|
|
|
33866
33911
|
Args: never;
|
|
33867
33912
|
Returns: Json;
|
|
33868
33913
|
};
|
|
33914
|
+
logistics_own_sticker_sync: {
|
|
33915
|
+
Args: {
|
|
33916
|
+
p_limit?: number;
|
|
33917
|
+
};
|
|
33918
|
+
Returns: Json;
|
|
33919
|
+
};
|
|
33869
33920
|
logistics_own_transport_departure: {
|
|
33870
33921
|
Args: {
|
|
33871
33922
|
p_delivery_date: string;
|
|
@@ -37911,6 +37962,12 @@ export type Database = {
|
|
|
37911
37962
|
};
|
|
37912
37963
|
Returns: boolean;
|
|
37913
37964
|
};
|
|
37965
|
+
twinfield_cancel_queue_item: {
|
|
37966
|
+
Args: {
|
|
37967
|
+
p_id: string;
|
|
37968
|
+
};
|
|
37969
|
+
Returns: boolean;
|
|
37970
|
+
};
|
|
37914
37971
|
twinfield_connection_offices: {
|
|
37915
37972
|
Args: never;
|
|
37916
37973
|
Returns: {
|
|
@@ -37940,6 +37997,19 @@ export type Database = {
|
|
|
37940
37997
|
};
|
|
37941
37998
|
Returns: Json;
|
|
37942
37999
|
};
|
|
38000
|
+
twinfield_gated_queue: {
|
|
38001
|
+
Args: {
|
|
38002
|
+
p_connection_id: string;
|
|
38003
|
+
};
|
|
38004
|
+
Returns: {
|
|
38005
|
+
action: string;
|
|
38006
|
+
created_at: string;
|
|
38007
|
+
customer_id: string;
|
|
38008
|
+
id: string;
|
|
38009
|
+
payload: Json;
|
|
38010
|
+
status: string;
|
|
38011
|
+
}[];
|
|
38012
|
+
};
|
|
37943
38013
|
twinfield_handle_administration_change: {
|
|
37944
38014
|
Args: {
|
|
37945
38015
|
_administration_code: string;
|
|
@@ -37947,6 +38017,10 @@ export type Database = {
|
|
|
37947
38017
|
};
|
|
37948
38018
|
Returns: undefined;
|
|
37949
38019
|
};
|
|
38020
|
+
twinfield_is_admin: {
|
|
38021
|
+
Args: never;
|
|
38022
|
+
Returns: boolean;
|
|
38023
|
+
};
|
|
37950
38024
|
twinfield_prune_push_queue: {
|
|
37951
38025
|
Args: never;
|
|
37952
38026
|
Returns: number;
|
|
@@ -37958,6 +38032,13 @@ export type Database = {
|
|
|
37958
38032
|
};
|
|
37959
38033
|
Returns: Json;
|
|
37960
38034
|
};
|
|
38035
|
+
twinfield_set_write_enabled: {
|
|
38036
|
+
Args: {
|
|
38037
|
+
p_connection_id: string;
|
|
38038
|
+
p_enabled: boolean;
|
|
38039
|
+
};
|
|
38040
|
+
Returns: Json;
|
|
38041
|
+
};
|
|
37961
38042
|
twinfield_sync_apply: {
|
|
37962
38043
|
Args: {
|
|
37963
38044
|
_base: Json;
|
|
@@ -37994,6 +38075,12 @@ export type Database = {
|
|
|
37994
38075
|
};
|
|
37995
38076
|
Returns: Json;
|
|
37996
38077
|
};
|
|
38078
|
+
twinfield_write_allowed: {
|
|
38079
|
+
Args: {
|
|
38080
|
+
p_connection_id: string;
|
|
38081
|
+
};
|
|
38082
|
+
Returns: boolean;
|
|
38083
|
+
};
|
|
37997
38084
|
upsert_auto_fulfillment_log: {
|
|
37998
38085
|
Args: {
|
|
37999
38086
|
p_connection_id: string;
|
|
@@ -38539,6 +38626,15 @@ export type Database = {
|
|
|
38539
38626
|
};
|
|
38540
38627
|
Returns: Json;
|
|
38541
38628
|
};
|
|
38629
|
+
voorraad_alert_floriday_not_updated: {
|
|
38630
|
+
Args: {
|
|
38631
|
+
p_key: string;
|
|
38632
|
+
p_order_id: string;
|
|
38633
|
+
p_order_item_id: string;
|
|
38634
|
+
p_qty: number;
|
|
38635
|
+
};
|
|
38636
|
+
Returns: undefined;
|
|
38637
|
+
};
|
|
38542
38638
|
voorraad_can_write: {
|
|
38543
38639
|
Args: never;
|
|
38544
38640
|
Returns: boolean;
|
|
@@ -38561,6 +38657,12 @@ export type Database = {
|
|
|
38561
38657
|
};
|
|
38562
38658
|
Returns: string[];
|
|
38563
38659
|
};
|
|
38660
|
+
voorraad_floriday_leads_key: {
|
|
38661
|
+
Args: {
|
|
38662
|
+
p_key: string;
|
|
38663
|
+
};
|
|
38664
|
+
Returns: boolean;
|
|
38665
|
+
};
|
|
38564
38666
|
voorraad_hook_base_url: {
|
|
38565
38667
|
Args: never;
|
|
38566
38668
|
Returns: string;
|
|
@@ -38578,6 +38680,12 @@ export type Database = {
|
|
|
38578
38680
|
};
|
|
38579
38681
|
Returns: undefined;
|
|
38580
38682
|
};
|
|
38683
|
+
voorraad_mark_floriday_sold_before_switch: {
|
|
38684
|
+
Args: {
|
|
38685
|
+
p_product_id: string;
|
|
38686
|
+
};
|
|
38687
|
+
Returns: number;
|
|
38688
|
+
};
|
|
38581
38689
|
voorraad_production_enabled: {
|
|
38582
38690
|
Args: never;
|
|
38583
38691
|
Returns: boolean;
|