@flowselections/floriday-klanten-module 1.0.107 → 1.0.110
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/BewerkKlant.js +3 -3
- package/dist-lib/components/klanten/CarrierAdminCard.d.ts +3 -0
- package/dist-lib/components/klanten/CarrierAdminCard.d.ts.map +1 -0
- package/dist-lib/components/klanten/CarrierAdminCard.js +23 -0
- package/dist-lib/components/klanten/CarrierPicker.d.ts +19 -43
- package/dist-lib/components/klanten/CarrierPicker.d.ts.map +1 -1
- package/dist-lib/components/klanten/DeliveryLocationsTab.js +1 -1
- package/dist-lib/components/klanten/FloridayAutoPromoteCard.d.ts +3 -0
- package/dist-lib/components/klanten/FloridayAutoPromoteCard.d.ts.map +1 -0
- package/dist-lib/components/klanten/FloridayAutoPromoteCard.js +31 -0
- package/dist-lib/components/klanten/GroupedKlantDetail.js +13 -13
- package/dist-lib/components/klanten/ImportKlanten.js +1 -1
- package/dist-lib/components/klanten/KlantDetail.js +18 -18
- package/dist-lib/components/klanten/KlantFormulier.js +2 -2
- package/dist-lib/components/klanten/LocationGlns.d.ts +2 -2
- package/dist-lib/components/klanten/LocationGlns.d.ts.map +1 -1
- package/dist-lib/components/klanten/NetwerkPagina.js +1 -1
- package/dist-lib/components/klanten/NieuweKlant.js +3 -3
- package/dist-lib/components/klanten/OvernemenTwinfieldKlant.js +2 -2
- package/dist-lib/components/klanten/StickerFormaatKeuze.d.ts +1 -1
- package/dist-lib/components/klanten/StickerFormaatKeuze.d.ts.map +1 -1
- package/dist-lib/components/klanten/StickerSizePreviewCard.d.ts +3 -0
- package/dist-lib/components/klanten/StickerSizePreviewCard.d.ts.map +1 -0
- package/dist-lib/components/klanten/StickerSizePreviewCard.js +27 -0
- package/dist-lib/components/klanten/TwinfieldQueueAdminCard.d.ts +3 -0
- package/dist-lib/components/klanten/TwinfieldQueueAdminCard.d.ts.map +1 -0
- package/dist-lib/components/klanten/TwinfieldQueueAdminCard.js +36 -0
- package/dist-lib/integrations/supabase/client.js +1 -1
- package/dist-lib/integrations/supabase/client.server.js +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +186 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/accounting/twinfield/field-coverage.test.d.ts +2 -0
- package/dist-lib/lib/accounting/twinfield/field-coverage.test.d.ts.map +1 -0
- package/dist-lib/lib/accounting/twinfield/field-coverage.test.js +179 -0
- package/dist-lib/lib/accounting/twinfield/sandbox-rmw.server.d.ts +2 -2
- package/dist-lib/lib/accounting/twinfield/sandbox-rmw.server.js +2 -2
- package/dist-lib/lib/accounting/twinfield/worker.server.d.ts +8 -0
- package/dist-lib/lib/accounting/twinfield/worker.server.d.ts.map +1 -1
- package/dist-lib/lib/accounting/twinfield/worker.server.js +45 -0
- package/dist-lib/lib/accounting/vertaalmodule/customer-payload.d.ts +72 -0
- package/dist-lib/lib/accounting/vertaalmodule/customer-payload.d.ts.map +1 -0
- package/dist-lib/lib/accounting/vertaalmodule/customer-payload.js +80 -0
- package/dist-lib/lib/accounting/vertaalmodule/push.server.d.ts +12 -0
- package/dist-lib/lib/accounting/vertaalmodule/push.server.d.ts.map +1 -0
- package/dist-lib/lib/accounting/vertaalmodule/push.server.js +42 -0
- package/dist-lib/lib/countries.test.d.ts +2 -0
- package/dist-lib/lib/countries.test.d.ts.map +1 -0
- package/dist-lib/lib/countries.test.js +13 -0
- package/dist-lib/lib/customer-defaults.test.d.ts +2 -0
- package/dist-lib/lib/customer-defaults.test.d.ts.map +1 -0
- package/dist-lib/lib/customer-defaults.test.js +26 -0
- package/dist-lib/lib/customer-schemas.test.d.ts +2 -0
- package/dist-lib/lib/customer-schemas.test.d.ts.map +1 -0
- package/dist-lib/lib/customer-schemas.test.js +22 -0
- package/package.json +1 -1
- package/dist-lib/assets/floriday-logo.png.asset.json +0 -11
- package/dist-lib/components/klanten/LogisticsStrategyCard.d.ts +0 -7
- package/dist-lib/components/klanten/LogisticsStrategyCard.d.ts.map +0 -1
- package/dist-lib/components/klanten/LogisticsStrategyCard.js +0 -35
- package/dist-lib/lib/floriday.server.d.ts +0 -55
- package/dist-lib/lib/floriday.server.d.ts.map +0 -1
- package/dist-lib/lib/floriday.server.js +0 -765
|
@@ -9,11 +9,11 @@ import { useServerFn } from "@tanstack/react-start";
|
|
|
9
9
|
import { toast } from "@flowselections/core";
|
|
10
10
|
import { getCustomer, updateCustomer } from "../../lib/customers.functions.js";
|
|
11
11
|
import { decodeDeep } from "../../lib/decode-html.js";
|
|
12
|
-
import { BackLink } from "
|
|
13
|
-
import { KlantFormulier, emptyKlantFormValues, } from "
|
|
12
|
+
import { BackLink } from "./BackLink.js";
|
|
13
|
+
import { KlantFormulier, emptyKlantFormValues, } from "./KlantFormulier.js";
|
|
14
14
|
import { resolveCustomerKeyForLocalCustomer } from "../../lib/price-groups-local.functions.js";
|
|
15
15
|
import { getCustomerStickerSettings } from "../../lib/customer-stickers.functions.js";
|
|
16
|
-
import { CustomerStickerFormatDialog } from "
|
|
16
|
+
import { CustomerStickerFormatDialog } from "./CustomerStickerFormatDialog.js";
|
|
17
17
|
function StickerFormatSection({ customerId }) {
|
|
18
18
|
const resolveKey = useServerFn(resolveCustomerKeyForLocalCustomer);
|
|
19
19
|
const getFormat = useServerFn(getCustomerStickerSettings);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarrierAdminCard.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/CarrierAdminCard.tsx"],"names":[],"mappings":"AAQA,mHAAmH;AACnH,wBAAgB,gBAAgB,uCAI/B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
4
|
+
import { useServerFn } from "@tanstack/react-start";
|
|
5
|
+
import { useCustomerDefaults } from "./useCustomerDefaults.js";
|
|
6
|
+
import { previewCountryFixes, reviewAutoCarrierLocations } from "../../lib/carriers.functions.js";
|
|
7
|
+
import { ENGINE_MISSING_TEXT, proposalText } from "../../lib/carrier-choice.js";
|
|
8
|
+
import { friendlyError } from "../../lib/errors.js";
|
|
9
|
+
/** Alleen voor beheerders, alleen lezen: landen en automatisch opgeslagen vervoerders. Wijzigen pas na akkoord. */
|
|
10
|
+
export function CarrierAdminCard() {
|
|
11
|
+
const { isAdmin } = useCustomerDefaults();
|
|
12
|
+
if (isAdmin !== true)
|
|
13
|
+
return null;
|
|
14
|
+
return _jsx(Inner, {});
|
|
15
|
+
}
|
|
16
|
+
function Inner() {
|
|
17
|
+
const [open, setOpen] = useState(false);
|
|
18
|
+
const countryFn = useServerFn(previewCountryFixes);
|
|
19
|
+
const reviewFn = useServerFn(reviewAutoCarrierLocations);
|
|
20
|
+
const countries = useQuery({ queryKey: ["admin-country-fixes"], queryFn: () => countryFn(), enabled: open });
|
|
21
|
+
const review = useQuery({ queryKey: ["admin-auto-carriers"], queryFn: () => reviewFn(), enabled: open });
|
|
22
|
+
return (_jsxs("div", { className: "text-xs text-muted-foreground", children: [_jsx("button", { type: "button", className: "underline", onClick: () => setOpen((v) => !v), children: "Details voor beheer: vervoerders en landen" }), open && (_jsxs("div", { className: "mt-2 space-y-3 rounded border p-3", children: [_jsx("p", { children: "Alleen een overzicht. Er wordt niets aangepast." }), _jsxs("div", { children: [_jsx("div", { className: "font-medium text-foreground", children: "Afleverlocaties met een land dat geen landcode is" }), countries.isLoading && _jsx("p", { children: "Ophalen\u2026" }), countries.error && _jsx("p", { className: "text-destructive", children: friendlyError(countries.error) }), countries.data && countries.data.rows.length === 0 && _jsx("p", { children: "Geen." }), countries.data?.rows.map((r) => (_jsxs("div", { children: [r.name ?? "Afleverlocatie", " (", r.id, "): \"", r.huidig, "\" \u2192 ", r.voorstel ?? "onbekend, niet omzetten"] }, r.id)))] }), _jsxs("div", { children: [_jsx("div", { className: "font-medium text-foreground", children: "Klanten met een land dat geen landcode is" }), countries.data && countries.data.customerRows.length === 0 && _jsx("p", { children: "Geen." }), countries.data?.customerRows.map((r) => (_jsxs("div", { children: [r.name ?? "Klant", " (", r.id, ") \u2013 ", r.veld, ": \"", r.huidig, "\" \u2192 ", r.voorstel ?? "onbekend, niet omzetten"] }, `${r.id}-${r.veld}`)))] }), _jsxs("div", { children: [_jsx("div", { className: "font-medium text-foreground", children: "Locaties met een opgeslagen vervoerder op \"Automatisch\"" }), review.isLoading && _jsx("p", { children: "Ophalen\u2026" }), review.error && _jsx("p", { className: "text-destructive", children: friendlyError(review.error) }), review.data && review.data.rows.length === 0 && _jsx("p", { children: "Geen." }), review.data?.rows.map((r) => (_jsxs("div", { children: [r.name ?? "Afleverlocatie", " (", r.id, "): nu ", r.huidig ?? "—", " \u00B7 voorstel", " ", r.voorstel?.status === "ok" ? proposalText(r.voorstel.proposal) : ENGINE_MISSING_TEXT] }, r.id)))] })] }))] }));
|
|
23
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type LocationCarrierChoice, type ProposalResult } from "../../lib/carrier-choice.js";
|
|
2
2
|
export declare function useCarrierOptions(): {
|
|
3
3
|
ordered: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
4
|
-
data:
|
|
4
|
+
data: {
|
|
5
5
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
6
6
|
usage: Record<string, number>;
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
8
|
error: Error;
|
|
9
9
|
isError: true;
|
|
10
10
|
isPending: false;
|
|
@@ -27,21 +27,17 @@ export declare function useCarrierOptions(): {
|
|
|
27
27
|
isRefetching: boolean;
|
|
28
28
|
isStale: boolean;
|
|
29
29
|
isEnabled: boolean;
|
|
30
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
30
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
31
31
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
32
32
|
usage: Record<string, number>;
|
|
33
|
-
}
|
|
33
|
+
}, Error>>;
|
|
34
34
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
35
|
-
promise: Promise<NoInfer<{
|
|
36
|
-
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
37
|
-
usage: Record<string, number>;
|
|
38
|
-
}>>;
|
|
39
35
|
} | {
|
|
40
36
|
ordered: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
41
|
-
data:
|
|
37
|
+
data: {
|
|
42
38
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
43
39
|
usage: Record<string, number>;
|
|
44
|
-
}
|
|
40
|
+
};
|
|
45
41
|
error: null;
|
|
46
42
|
isError: false;
|
|
47
43
|
isPending: false;
|
|
@@ -64,15 +60,11 @@ export declare function useCarrierOptions(): {
|
|
|
64
60
|
isRefetching: boolean;
|
|
65
61
|
isStale: boolean;
|
|
66
62
|
isEnabled: boolean;
|
|
67
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
63
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
68
64
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
69
65
|
usage: Record<string, number>;
|
|
70
|
-
}
|
|
66
|
+
}, Error>>;
|
|
71
67
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
72
|
-
promise: Promise<NoInfer<{
|
|
73
|
-
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
74
|
-
usage: Record<string, number>;
|
|
75
|
-
}>>;
|
|
76
68
|
} | {
|
|
77
69
|
ordered: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
78
70
|
data: undefined;
|
|
@@ -98,15 +90,11 @@ export declare function useCarrierOptions(): {
|
|
|
98
90
|
isRefetching: boolean;
|
|
99
91
|
isStale: boolean;
|
|
100
92
|
isEnabled: boolean;
|
|
101
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
93
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
102
94
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
103
95
|
usage: Record<string, number>;
|
|
104
|
-
}
|
|
96
|
+
}, Error>>;
|
|
105
97
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
106
|
-
promise: Promise<NoInfer<{
|
|
107
|
-
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
108
|
-
usage: Record<string, number>;
|
|
109
|
-
}>>;
|
|
110
98
|
} | {
|
|
111
99
|
ordered: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
112
100
|
data: undefined;
|
|
@@ -132,15 +120,11 @@ export declare function useCarrierOptions(): {
|
|
|
132
120
|
isRefetching: boolean;
|
|
133
121
|
isStale: boolean;
|
|
134
122
|
isEnabled: boolean;
|
|
135
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
123
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
136
124
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
137
125
|
usage: Record<string, number>;
|
|
138
|
-
}
|
|
126
|
+
}, Error>>;
|
|
139
127
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
140
|
-
promise: Promise<NoInfer<{
|
|
141
|
-
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
142
|
-
usage: Record<string, number>;
|
|
143
|
-
}>>;
|
|
144
128
|
} | {
|
|
145
129
|
ordered: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
146
130
|
data: undefined;
|
|
@@ -166,21 +150,17 @@ export declare function useCarrierOptions(): {
|
|
|
166
150
|
isRefetching: boolean;
|
|
167
151
|
isStale: boolean;
|
|
168
152
|
isEnabled: boolean;
|
|
169
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
153
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
170
154
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
171
155
|
usage: Record<string, number>;
|
|
172
|
-
}
|
|
156
|
+
}, Error>>;
|
|
173
157
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
174
|
-
promise: Promise<NoInfer<{
|
|
175
|
-
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
176
|
-
usage: Record<string, number>;
|
|
177
|
-
}>>;
|
|
178
158
|
} | {
|
|
179
159
|
ordered: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
180
|
-
data:
|
|
160
|
+
data: {
|
|
181
161
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
182
162
|
usage: Record<string, number>;
|
|
183
|
-
}
|
|
163
|
+
};
|
|
184
164
|
isError: false;
|
|
185
165
|
error: null;
|
|
186
166
|
isPending: false;
|
|
@@ -203,15 +183,11 @@ export declare function useCarrierOptions(): {
|
|
|
203
183
|
isRefetching: boolean;
|
|
204
184
|
isStale: boolean;
|
|
205
185
|
isEnabled: boolean;
|
|
206
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
186
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
207
187
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
208
188
|
usage: Record<string, number>;
|
|
209
|
-
}
|
|
189
|
+
}, Error>>;
|
|
210
190
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
211
|
-
promise: Promise<NoInfer<{
|
|
212
|
-
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
213
|
-
usage: Record<string, number>;
|
|
214
|
-
}>>;
|
|
215
191
|
};
|
|
216
192
|
export type ProposalItem = {
|
|
217
193
|
key: string;
|
|
@@ -219,7 +195,7 @@ export type ProposalItem = {
|
|
|
219
195
|
customer_id: string | null;
|
|
220
196
|
};
|
|
221
197
|
/** Live voorstel van de Logistieke Engine; wordt nooit opgeslagen. */
|
|
222
|
-
export declare function useCarrierProposals(items: ProposalItem[], enabled?: boolean): import("@tanstack/react-query").UseQueryResult<
|
|
198
|
+
export declare function useCarrierProposals(items: ProposalItem[], enabled?: boolean): import("@tanstack/react-query").UseQueryResult<Record<string, ProposalResult>, Error>;
|
|
223
199
|
/** Eén regel: welke vervoerder het wordt en waarom, plus de waarschuwing van de Engine. */
|
|
224
200
|
export declare function ProposalLine({ result, loading, error, onRetry, compact, }: {
|
|
225
201
|
result: ProposalResult | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarrierPicker.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/CarrierPicker.tsx"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAC;AAGlC,wBAAgB,iBAAiB
|
|
1
|
+
{"version":3,"file":"CarrierPicker.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/CarrierPicker.tsx"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAC;AAGlC,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQhC;AAED,MAAM,MAAM,YAAY,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAEnG,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,OAAO,UAAO,yFAQxE;AAED,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,OAAO,EACP,KAAK,EACL,OAAO,EACP,OAAO,GACR,EAAE;IACD,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,+BAmCA;AAMD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EACD;IACE,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,CAAC,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC7C,SAAS,EAAE,MAAM,CAAC;CACnB,GACD;IACE,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACtC,+BA+CN"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { friendlyError } from "../../lib/errors.js";
|
|
3
|
-
import { useCustomerDefaults } from "
|
|
3
|
+
import { useCustomerDefaults } from "./useCustomerDefaults.js";
|
|
4
4
|
import { useMemo, useRef, useState } from "react";
|
|
5
5
|
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
6
6
|
import { useServerFn } from "@tanstack/react-start";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloridayAutoPromoteCard.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/FloridayAutoPromoteCard.tsx"],"names":[],"mappings":"AAQA,4GAA4G;AAC5G,wBAAgB,uBAAuB,uCAItC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
4
|
+
import { useServerFn } from "@tanstack/react-start";
|
|
5
|
+
import { useCustomerDefaults } from "./useCustomerDefaults.js";
|
|
6
|
+
import { getAutoPromoteStatus } from "../../lib/auto-promote.functions.js";
|
|
7
|
+
import { skipReasons, skippedTotal, roundSummary } from "../../lib/auto-promote.js";
|
|
8
|
+
import { friendlyError } from "../../lib/errors.js";
|
|
9
|
+
/** Alleen voor beheerders: telling van het automatisch aanmaken van Floriday-klanten (geen schakelaars). */
|
|
10
|
+
export function FloridayAutoPromoteCard() {
|
|
11
|
+
const { isAdmin } = useCustomerDefaults();
|
|
12
|
+
if (isAdmin !== true)
|
|
13
|
+
return null;
|
|
14
|
+
return _jsx(Inner, {});
|
|
15
|
+
}
|
|
16
|
+
function Inner() {
|
|
17
|
+
const [open, setOpen] = useState(false);
|
|
18
|
+
const getStatus = useServerFn(getAutoPromoteStatus);
|
|
19
|
+
const q = useQuery({ queryKey: ["klanten-auto-promote"], queryFn: () => getStatus(), enabled: open });
|
|
20
|
+
const s = q.data;
|
|
21
|
+
const rows = s
|
|
22
|
+
? [
|
|
23
|
+
{ label: "Uit inkooprelaties", c: s.inkooprelatie ?? {} },
|
|
24
|
+
{ label: "Uit Floriday-orders", c: s.order ?? {} },
|
|
25
|
+
]
|
|
26
|
+
: [];
|
|
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) => {
|
|
28
|
+
const reasons = skipReasons(r.c);
|
|
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 })] }))] }))] }));
|
|
31
|
+
}
|
|
@@ -9,28 +9,28 @@ import { useEffect, useState } from "react";
|
|
|
9
9
|
import { Card, CardContent, Badge, Button, toast, Tabs, TabsList, TabsTrigger, TabsContent, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@flowselections/core";
|
|
10
10
|
import { Mail, MapPin, Phone, Pencil, UserX } from "lucide-react";
|
|
11
11
|
import { TableSkeleton, InlineAlert, EmptyState as FsEmptyState } from "../fs-ui/index.js";
|
|
12
|
-
import { BackLink } from "
|
|
12
|
+
import { BackLink } from "./BackLink.js";
|
|
13
13
|
import { komtVanLijst, vanLijstState } from "../../lib/lijst-herstel.js";
|
|
14
14
|
import { getGroupedCustomerDetail, } from "../../lib/external-customers.functions.js";
|
|
15
|
-
import { ProfileCard, KpiStrip, BadgeList, EmptyState, adaptGroupedToProfile, } from "
|
|
15
|
+
import { ProfileCard, KpiStrip, BadgeList, EmptyState, adaptGroupedToProfile, } from "./KlantDetailLayout.js";
|
|
16
16
|
import { countryNameToFlag } from "../../lib/countries.js";
|
|
17
|
-
import { DiscountsTab } from "
|
|
18
|
-
import { PriceGroupBadges } from "
|
|
19
|
-
import { CustomerPriceGroupSelect } from "
|
|
17
|
+
import { DiscountsTab } from "./DiscountsTab.js";
|
|
18
|
+
import { PriceGroupBadges } from "./PriceGroupBadges.js";
|
|
19
|
+
import { CustomerPriceGroupSelect } from "./pricegroups/CustomerPriceGroupSelect.js";
|
|
20
20
|
import { listPriceGroupsForOrganizations } from "../../lib/price-groups.functions.js";
|
|
21
|
-
import { FloridayDeeplinkButton } from "
|
|
22
|
-
import { CustomerAssortmentTab } from "
|
|
23
|
-
import { FloridayAssortmentTab } from "
|
|
21
|
+
import { FloridayDeeplinkButton } from "./FloridayDeeplinkButton.js";
|
|
22
|
+
import { CustomerAssortmentTab } from "./CustomerAssortmentTab.js";
|
|
23
|
+
import { FloridayAssortmentTab } from "./FloridayAssortmentTab.js";
|
|
24
24
|
import { decodeDeep } from "../../lib/decode-html.js";
|
|
25
|
-
import { DeliveryLocationsTab } from "
|
|
26
|
-
import { KlantBewerkenDialog } from "
|
|
27
|
-
import { FactureringKredietCard, hasBillingInfo, useLocalCustomer } from "
|
|
25
|
+
import { DeliveryLocationsTab } from "./DeliveryLocationsTab.js";
|
|
26
|
+
import { KlantBewerkenDialog } from "./KlantBewerkenDialog.js";
|
|
27
|
+
import { FactureringKredietCard, hasBillingInfo, useLocalCustomer } from "./FactureringKredietCard.js";
|
|
28
28
|
import { getCustomerNote, upsertCustomerNote } from "../../lib/customer-notes.functions.js";
|
|
29
29
|
import { supabase } from "../../integrations/supabase/client.js";
|
|
30
30
|
import { formatPaymentMethodLabel } from "../../lib/payment-method.js";
|
|
31
|
-
import { CustomerOrdersTab } from "
|
|
31
|
+
import { CustomerOrdersTab } from "./CustomerOrdersTab.js";
|
|
32
32
|
import { listCustomerOrders } from "../../lib/customer-orders.functions.js";
|
|
33
|
-
import { FloridayTradeSettingsCard } from "
|
|
33
|
+
import { FloridayTradeSettingsCard } from "./FloridayTradeSettingsCard.js";
|
|
34
34
|
export function GroupedKlantDetail({ groupKey }) {
|
|
35
35
|
const navigate = useNavigate();
|
|
36
36
|
const qc = useQueryClient();
|
|
@@ -7,7 +7,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
|
7
7
|
import { useServerFn } from "@tanstack/react-start";
|
|
8
8
|
import { Button, Card, CardContent, CardHeader, CardTitle, Input, Label, toast, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Badge, Checkbox, } from "@flowselections/core";
|
|
9
9
|
import { Upload, Download, FileText, CheckCircle2, AlertTriangle, XCircle } from "lucide-react";
|
|
10
|
-
import { BackLink } from "
|
|
10
|
+
import { BackLink } from "./BackLink.js";
|
|
11
11
|
import * as XLSX from "xlsx";
|
|
12
12
|
import { bulkImportCustomers } from "../../lib/customers.functions.js";
|
|
13
13
|
import { customerImportRowSchema } from "../../lib/customer-schemas.js";
|
|
@@ -8,35 +8,35 @@ import { Card, CardContent, CardHeader, CardTitle, Badge, Button, toast, Tabs, T
|
|
|
8
8
|
import { Trash2, Mail, Phone, Power, Pencil, MoreHorizontal, Archive, ArchiveRestore, } from "lucide-react";
|
|
9
9
|
import { archiveerKlant, herstelKlant, listGearchiveerdeKlantIds } from "../../lib/customer-archief.functions.js";
|
|
10
10
|
import { getCustomer, deleteCustomer, updateCustomer } from "../../lib/customers.functions.js";
|
|
11
|
-
import { ProfileCard, BadgeList, EmptyState, ActivityItem, adaptLocalToProfile, } from "
|
|
12
|
-
import { DeliveryLocationsTab } from "
|
|
13
|
-
import { CustomerCarrierCard } from "
|
|
14
|
-
import { CustomerLogisticsCard } from "
|
|
15
|
-
import { BackLink } from "
|
|
11
|
+
import { ProfileCard, BadgeList, EmptyState, ActivityItem, adaptLocalToProfile, } from "./KlantDetailLayout.js";
|
|
12
|
+
import { DeliveryLocationsTab } from "./DeliveryLocationsTab.js";
|
|
13
|
+
import { CustomerCarrierCard } from "./CustomerCarrierCard.js";
|
|
14
|
+
import { CustomerLogisticsCard } from "./CustomerLogisticsCard.js";
|
|
15
|
+
import { BackLink } from "./BackLink.js";
|
|
16
16
|
import { NoticeBar, TableSkeleton, EmptyState as FsEmptyState } from "../fs-ui/index.js";
|
|
17
17
|
import { UserX } from "lucide-react";
|
|
18
|
-
import { CustomerAnalyticsTab } from "
|
|
19
|
-
import { LocalDiscountsTab } from "
|
|
20
|
-
import { PriceGroupBadges } from "
|
|
21
|
-
import { CustomerPriceGroupSelect } from "
|
|
18
|
+
import { CustomerAnalyticsTab } from "./CustomerAnalyticsTab.js";
|
|
19
|
+
import { LocalDiscountsTab } from "./LocalDiscountsTab.js";
|
|
20
|
+
import { PriceGroupBadges } from "./PriceGroupBadges.js";
|
|
21
|
+
import { CustomerPriceGroupSelect } from "./pricegroups/CustomerPriceGroupSelect.js";
|
|
22
22
|
import { resolveCustomerKeyForLocalCustomer } from "../../lib/price-groups-local.functions.js";
|
|
23
|
-
import { FloridayDeeplinkButton } from "
|
|
24
|
-
import { FloridayAssortmentTab } from "
|
|
25
|
-
import { CustomerAssortmentTab } from "
|
|
26
|
-
import { SyncStatusChip } from "
|
|
23
|
+
import { FloridayDeeplinkButton } from "./FloridayDeeplinkButton.js";
|
|
24
|
+
import { FloridayAssortmentTab } from "./FloridayAssortmentTab.js";
|
|
25
|
+
import { CustomerAssortmentTab } from "./CustomerAssortmentTab.js";
|
|
26
|
+
import { SyncStatusChip } from "./SyncStatusChip.js";
|
|
27
27
|
import { KlantExtraVeldenCard } from "./KlantExtraVeldenCard.js";
|
|
28
28
|
import { decodeDeep } from "../../lib/decode-html.js";
|
|
29
29
|
import { getMissingTwinfieldFields } from "../../lib/twinfield-required-fields.js";
|
|
30
30
|
import { missingInvoiceAddressFields } from "../../lib/invoice-address.js";
|
|
31
|
-
import { FactureringKredietCard, hasBillingInfo, BlockedBadge } from "
|
|
31
|
+
import { FactureringKredietCard, hasBillingInfo, BlockedBadge } from "./FactureringKredietCard.js";
|
|
32
32
|
import { getCustomerNote, upsertCustomerNote } from "../../lib/customer-notes.functions.js";
|
|
33
33
|
import { supabase } from "../../integrations/supabase/client.js";
|
|
34
|
-
import { KlantBewerkenDialog } from "
|
|
35
|
-
import { CustomerOrdersTab } from "
|
|
34
|
+
import { KlantBewerkenDialog } from "./KlantBewerkenDialog.js";
|
|
35
|
+
import { CustomerOrdersTab } from "./CustomerOrdersTab.js";
|
|
36
36
|
import { formatDateTime } from "../../lib/format-date.js";
|
|
37
37
|
import { listCustomerOrders } from "../../lib/customer-orders.functions.js";
|
|
38
|
-
import { CustomerKpis } from "
|
|
39
|
-
import { FloridayTradeSettingsCard } from "
|
|
38
|
+
import { CustomerKpis } from "./CustomerKpis.js";
|
|
39
|
+
import { FloridayTradeSettingsCard } from "./FloridayTradeSettingsCard.js";
|
|
40
40
|
export function KlantDetail({ id }) {
|
|
41
41
|
const navigate = useNavigate();
|
|
42
42
|
const qc = useQueryClient();
|
|
@@ -7,14 +7,14 @@ import { useServerFn } from "@tanstack/react-start";
|
|
|
7
7
|
import { Button, Card, CardContent, Input, Label, Textarea, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@flowselections/core";
|
|
8
8
|
import { MapPin, Landmark, ReceiptText, ChevronDown, Check, AlertCircle, Users, BookOpen, } from "lucide-react";
|
|
9
9
|
import { PageHeader, NoticeBar } from "../fs-ui/index.js";
|
|
10
|
-
import { BackLink } from "
|
|
10
|
+
import { BackLink } from "./BackLink.js";
|
|
11
11
|
import { listCustomerClasses } from "../../lib/customers.functions.js";
|
|
12
12
|
import { listTwinfieldLedgerAccounts } from "../../lib/twinfield-ledger.functions.js";
|
|
13
13
|
import { customerCreateSchema } from "../../lib/customer-schemas.js";
|
|
14
14
|
import { requiresVatNumber } from "../../lib/twinfield-required-fields.js";
|
|
15
15
|
import { TWINFIELD_FIELD_MAX, TWINFIELD_READONLY_FIELDS, TWINFIELD_READONLY_HINT } from "../../lib/twinfield-limits.js";
|
|
16
16
|
import { countryNameToFlag, COUNTRY_NAMES, toIsoCountry } from "../../lib/countries.js";
|
|
17
|
-
import { SearchableSelect } from "
|
|
17
|
+
import { SearchableSelect } from "./SearchableSelect.js";
|
|
18
18
|
import { checkVatFormat, isTwinfieldVatError } from "../../lib/vat-format.js";
|
|
19
19
|
import { creditManagerDisplay } from "../../lib/credit-management.js";
|
|
20
20
|
import { TWINFIELD_DEFAULTS, VAT_DISPLAY_OPTIONS, PAYMENT_SPEC_METHOD_OPTIONS, INVOICE_SEND_AS_OPTIONS, SEND_REMINDER_OPTIONS, DISCOUNT_SURCHARGE_OPTIONS, } from "../../lib/twinfield-defaults.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type LocationGln } from "../../lib/delivery-locations.functions.js";
|
|
2
2
|
import { type DupLocation, type GlnAdd, type LinkedGln, type PendingGlns } from "../../lib/delivery-gln.js";
|
|
3
|
-
export declare function useLocationGlns(locationIds: string[]): import("@tanstack/react-query").UseQueryResult<
|
|
3
|
+
export declare function useLocationGlns(locationIds: string[]): import("@tanstack/react-query").UseQueryResult<{
|
|
4
4
|
glns: LocationGln[];
|
|
5
5
|
mergeEnabled: boolean;
|
|
6
|
-
}
|
|
6
|
+
}, Error>;
|
|
7
7
|
/** Zoekbare keuzelijst "GLN koppelen…": vrije GLN's van deze klant + "Andere GLN invoeren…". */
|
|
8
8
|
export declare function GlnPicker({ customerId, locationId, exclude, onPick, busy }: {
|
|
9
9
|
customerId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationGlns.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/LocationGlns.tsx"],"names":[],"mappings":"AAUA,OAAO,EAEoD,KAAK,WAAW,EAC1E,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAGL,KAAK,WAAW,EAAqB,KAAK,MAAM,EAAe,KAAK,SAAS,EAAE,KAAK,WAAW,EAChG,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE;;;
|
|
1
|
+
{"version":3,"file":"LocationGlns.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/LocationGlns.tsx"],"names":[],"mappings":"AAUA,OAAO,EAEoD,KAAK,WAAW,EAC1E,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAGL,KAAK,WAAW,EAAqB,KAAK,MAAM,EAAe,KAAK,SAAS,EAAE,KAAK,WAAW,EAChG,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE;;;UAOpD;AAID,gGAAgG;AAChG,wBAAgB,SAAS,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IAC3E,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACjF,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7B,+BAiFA;AAoCD,mGAAmG;AACnG,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IACxF,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,WAAW,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,IAAI,CAAC;CAChH,+BAmCA;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;IACxF,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,SAAS,EAAE,CAAC;IAAC,OAAO,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;CAC/H,+BAiBA;AAED,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE;IAC/F,KAAK,EAAE,CAAC,EAAE,CAAC;IAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC;IAAC,YAAY,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;CAClF,+BA+DA"}
|
|
@@ -6,7 +6,7 @@ import { useServerFn } from "@tanstack/react-start";
|
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { Button, Card, CardContent, Badge, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Switch, Label, } from "@flowselections/core";
|
|
8
8
|
import { MapPin, Globe } from "lucide-react";
|
|
9
|
-
import { BackLink } from "
|
|
9
|
+
import { BackLink } from "./BackLink.js";
|
|
10
10
|
import { countryNameToFlag } from "../../lib/countries.js";
|
|
11
11
|
import { listFloridayNetwork } from "../../lib/customers.functions.js";
|
|
12
12
|
import { CustomerAvatar } from "../CustomerAvatar.js";
|
|
@@ -8,9 +8,9 @@ import { useServerFn } from "@tanstack/react-start";
|
|
|
8
8
|
import { toast, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "@flowselections/core";
|
|
9
9
|
import { createCustomer, getActiveTwinfieldAdministration } from "../../lib/customers.functions.js";
|
|
10
10
|
import { upsertDeliveryLocation } from "../../lib/delivery-locations.functions.js";
|
|
11
|
-
import { KlantFormulier, emptyKlantFormValues, } from "
|
|
12
|
-
import { useCustomerDefaults, MISSING_DEFAULT_MESSAGE } from "
|
|
13
|
-
import { NieuweKlantLocaties, } from "
|
|
11
|
+
import { KlantFormulier, emptyKlantFormValues, } from "./KlantFormulier.js";
|
|
12
|
+
import { useCustomerDefaults, MISSING_DEFAULT_MESSAGE } from "./useCustomerDefaults.js";
|
|
13
|
+
import { NieuweKlantLocaties, } from "./NieuweKlantLocaties.js";
|
|
14
14
|
export function NieuweKlant() {
|
|
15
15
|
const navigate = useNavigate();
|
|
16
16
|
const qc = useQueryClient();
|
|
@@ -8,8 +8,8 @@ import { useServerFn } from "@tanstack/react-start";
|
|
|
8
8
|
import { toast } from "@flowselections/core";
|
|
9
9
|
import { prepareTwinfieldAdoption, adoptTwinfieldCustomer, } from "../../lib/twinfield-adopt.functions.js";
|
|
10
10
|
import { decodeDeep } from "../../lib/decode-html.js";
|
|
11
|
-
import { BackLink } from "
|
|
12
|
-
import { KlantFormulier, emptyKlantFormValues, } from "
|
|
11
|
+
import { BackLink } from "./BackLink.js";
|
|
12
|
+
import { KlantFormulier, emptyKlantFormValues, } from "./KlantFormulier.js";
|
|
13
13
|
/** Zet een tekstwaarde uit de Twinfield-cache om naar een getal (of undefined). */
|
|
14
14
|
function num(v) {
|
|
15
15
|
const s = (v ?? "").trim().replace(",", ".");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type StickerFormaat } from "../../lib/sticker-formaten.js";
|
|
2
|
-
export declare function useStickerFormaten(): import("@tanstack/react-query").UseQueryResult<
|
|
2
|
+
export declare function useStickerFormaten(): import("@tanstack/react-query").UseQueryResult<import("../../index.js").StickerFormatenResultaat, Error>;
|
|
3
3
|
/**
|
|
4
4
|
* Keuzelijst voor een stickerformaat (geen vrije invoer). Een huidige maat buiten
|
|
5
5
|
* de lijst blijft staan en wordt als "niet in de lijst" getoond tot er gekozen wordt.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickerFormaatKeuze.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/StickerFormaatKeuze.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5F,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"StickerFormaatKeuze.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/StickerFormaatKeuze.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5F,wBAAgB,kBAAkB,oGAGjC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,EAAE,EACF,OAAO,EACP,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,+BA0BA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StickerSizePreviewCard.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/StickerSizePreviewCard.tsx"],"names":[],"mappings":"AAeA,iGAAiG;AACjG,wBAAgB,sBAAsB,uCAIrC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
4
|
+
import { useServerFn } from "@tanstack/react-start";
|
|
5
|
+
import { useCustomerDefaults } from "./useCustomerDefaults.js";
|
|
6
|
+
import { previewStickerSizes } from "../../lib/customer-stickers.functions.js";
|
|
7
|
+
import { friendlyError } from "../../lib/errors.js";
|
|
8
|
+
const METHOD = {
|
|
9
|
+
pdf: "uit de PDF",
|
|
10
|
+
dpi: "uit de resolutie",
|
|
11
|
+
svg: "uit het bestand",
|
|
12
|
+
verhouding: "voorstel via etiket",
|
|
13
|
+
onbekend: "niet te bepalen",
|
|
14
|
+
};
|
|
15
|
+
/** Alleen beheerders, alleen lezen: welke maat bestaande stickers zonder maat zouden krijgen. */
|
|
16
|
+
export function StickerSizePreviewCard() {
|
|
17
|
+
const { isAdmin } = useCustomerDefaults();
|
|
18
|
+
if (isAdmin !== true)
|
|
19
|
+
return null;
|
|
20
|
+
return _jsx(Inner, {});
|
|
21
|
+
}
|
|
22
|
+
function Inner() {
|
|
23
|
+
const [open, setOpen] = useState(false);
|
|
24
|
+
const run = useServerFn(previewStickerSizes);
|
|
25
|
+
const q = useQuery({ queryKey: ["sticker-size-preview"], queryFn: () => run(), enabled: open });
|
|
26
|
+
return (_jsxs("div", { className: "text-xs text-muted-foreground", children: [_jsx("button", { type: "button", className: "underline", onClick: () => setOpen((v) => !v), children: "Details voor beheer: stickers zonder formaat" }), open && (_jsxs("div", { className: "mt-2 rounded border p-3 space-y-2", children: [_jsx("p", { children: "Overzicht, er wordt nog niets opgeslagen." }), q.isLoading && _jsx("p", { children: "Bestanden bekijken\u2026" }), q.error && _jsx("p", { className: "text-destructive", children: friendlyError(q.error) }), q.data && q.data.length === 0 && _jsx("p", { children: "Alle stickers hebben een formaat." }), q.data && q.data.length > 0 && (_jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "text-left", children: [_jsx("th", { children: "Klant" }), _jsx("th", { children: "Artikel" }), _jsx("th", { children: "Bestand" }), _jsx("th", { children: "Formaat" }), _jsx("th", { children: "Hoe" })] }) }), _jsx("tbody", { children: q.data.map((r) => (_jsxs("tr", { children: [_jsx("td", { children: r.customer_key }), _jsx("td", { children: r.trade_item_key }), _jsx("td", { className: "max-w-[160px] truncate", children: r.file_name }), _jsx("td", { children: r.width_mm != null ? `${r.width_mm} × ${r.height_mm} mm` : "–" }), _jsxs("td", { children: [METHOD[r.method] ?? r.method, r.printer ? ` (${r.printer})` : ""] })] }, `${r.customer_key}|${r.trade_item_key}`))) })] }))] }))] }));
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TwinfieldQueueAdminCard.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/TwinfieldQueueAdminCard.tsx"],"names":[],"mappings":"AAeA,iHAAiH;AACjH,wBAAgB,uBAAuB,uCAItC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
4
|
+
import { useServerFn } from "@tanstack/react-start";
|
|
5
|
+
import { useCustomerDefaults } from "./useCustomerDefaults.js";
|
|
6
|
+
import { ensureTwinfieldQueueJob, setTwinfieldQueueBatch } from "../../lib/twinfield-queue-admin.functions.js";
|
|
7
|
+
import { friendlyError } from "../../lib/errors.js";
|
|
8
|
+
const STATUS_TEXT = {
|
|
9
|
+
gelijk: "In orde: de taak loopt via deze omgeving.",
|
|
10
|
+
bijgewerkt: "Bijgewerkt: de taak loopt nu via deze omgeving.",
|
|
11
|
+
ingepland: "Ingepland: de taak was er nog niet en is nu aangemaakt.",
|
|
12
|
+
geen_pg_cron: "Geplande taken zijn in deze omgeving niet beschikbaar.",
|
|
13
|
+
core_helper_ontbreekt: "De basisvoorziening voor geplande taken ontbreekt nog.",
|
|
14
|
+
};
|
|
15
|
+
/** Alleen voor beheerders. Bij openen wordt de wachtrijtaak voor Twinfield vastgelegd (alleen bij afwijking). */
|
|
16
|
+
export function TwinfieldQueueAdminCard() {
|
|
17
|
+
const { isAdmin } = useCustomerDefaults();
|
|
18
|
+
if (isAdmin !== true)
|
|
19
|
+
return null;
|
|
20
|
+
return _jsx(Inner, {});
|
|
21
|
+
}
|
|
22
|
+
function Inner() {
|
|
23
|
+
const [open, setOpen] = useState(false);
|
|
24
|
+
const [value, setValue] = useState("");
|
|
25
|
+
const qc = useQueryClient();
|
|
26
|
+
const ensureFn = useServerFn(ensureTwinfieldQueueJob);
|
|
27
|
+
const setFn = useServerFn(setTwinfieldQueueBatch);
|
|
28
|
+
const q = useQuery({ queryKey: ["admin-twinfield-queue"], queryFn: () => ensureFn(), enabled: open });
|
|
29
|
+
const save = useMutation({
|
|
30
|
+
mutationFn: (limiet) => setFn({ data: { limiet } }),
|
|
31
|
+
onSuccess: () => qc.invalidateQueries({ queryKey: ["admin-twinfield-queue"] }),
|
|
32
|
+
});
|
|
33
|
+
const n = Number(value);
|
|
34
|
+
const valid = Number.isInteger(n) && n >= 1 && n <= 200;
|
|
35
|
+
return (_jsxs("div", { className: "text-xs text-muted-foreground", children: [_jsx("button", { type: "button", className: "underline", onClick: () => setOpen((v) => !v), children: "Details voor beheer: Twinfield-wachtrij" }), open && (_jsxs("div", { className: "mt-2 space-y-2 rounded border p-3", children: [q.isLoading && _jsx("p", { children: "Controleren\u2026" }), q.error && _jsx("p", { className: "text-destructive", children: friendlyError(q.error) }), q.data && (_jsxs(_Fragment, { children: [_jsx("p", { children: STATUS_TEXT[q.data.status] ?? `Status: ${q.data.status}` }), _jsxs("p", { children: ["Klanten per ronde (elke 5 minuten): ", q.data.limiet, q.data.limiet === q.data.standaard ? " (standaard)" : ""] }), q.data.melding && _jsxs("p", { className: "text-destructive", children: ["De ingestelde waarde is ongeldig; ", q.data.standaard, " wordt gebruikt."] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("input", { type: "number", min: 1, max: 200, value: value, placeholder: String(q.data.limiet), onChange: (e) => setValue(e.target.value), className: "w-20 rounded border bg-background px-2 py-1 text-foreground", "aria-label": "Klanten per ronde" }), _jsx("button", { type: "button", className: "underline disabled:opacity-50", disabled: !valid || save.isPending, onClick: () => save.mutate(n), children: "Opslaan" }), _jsx("span", { children: "1 tot 200" })] }), save.error && _jsx("p", { className: "text-destructive", children: friendlyError(save.error) })] }))] }))] }));
|
|
36
|
+
}
|
|
@@ -19,7 +19,7 @@ function createSupabaseClient() {
|
|
|
19
19
|
}
|
|
20
20
|
let _supabase;
|
|
21
21
|
// Import the supabase client like this:
|
|
22
|
-
// import { supabase } from "
|
|
22
|
+
// import { supabase } from "./client.js";
|
|
23
23
|
export const supabase = new Proxy({}, {
|
|
24
24
|
get(_, prop, receiver) {
|
|
25
25
|
if (!_supabase)
|
|
@@ -40,7 +40,7 @@ function createSupabaseAdminClient() {
|
|
|
40
40
|
let _supabaseAdmin;
|
|
41
41
|
// Server-side Supabase client with service role - bypasses RLS
|
|
42
42
|
// SECURITY: Only use this for trusted server-side operations, never expose to client code
|
|
43
|
-
// Import like: import { supabaseAdmin } from "
|
|
43
|
+
// Import like: import { supabaseAdmin } from "./client.server.js";
|
|
44
44
|
export const supabaseAdmin = new Proxy({}, {
|
|
45
45
|
get(_, prop, receiver) {
|
|
46
46
|
if (!_supabaseAdmin)
|