@flowselections/floriday-klanten-module 1.0.46 → 1.0.48
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.d.ts.map +1 -1
- package/dist-lib/components/klanten/BewerkKlant.js +1 -1
- package/dist-lib/components/klanten/CustomerAnalyticsTab.d.ts.map +1 -1
- package/dist-lib/components/klanten/CustomerAnalyticsTab.js +2 -2
- package/dist-lib/components/klanten/FloridayNetworkStatus.d.ts +5 -0
- package/dist-lib/components/klanten/FloridayNetworkStatus.d.ts.map +1 -0
- package/dist-lib/components/klanten/FloridayNetworkStatus.js +18 -0
- package/dist-lib/components/klanten/KlantDetailLayout.d.ts +2 -0
- package/dist-lib/components/klanten/KlantDetailLayout.d.ts.map +1 -1
- package/dist-lib/components/klanten/KlantDetailLayout.js +6 -1
- package/dist-lib/components/klanten/KlantFormulier.d.ts +3 -1
- package/dist-lib/components/klanten/KlantFormulier.d.ts.map +1 -1
- package/dist-lib/components/klanten/KlantFormulier.js +16 -4
- package/dist-lib/components/klanten/NetwerkPagina.d.ts.map +1 -1
- package/dist-lib/components/klanten/NetwerkPagina.js +9 -5
- package/dist-lib/components/klanten/pricegroups/CustomerPickerDialog.d.ts.map +1 -1
- package/dist-lib/components/klanten/pricegroups/CustomerPickerDialog.js +10 -2
- package/dist-lib/components/klanten/pricegroups/PriceGroupsPage.d.ts.map +1 -1
- package/dist-lib/components/klanten/pricegroups/PriceGroupsPage.js +4 -7
- package/dist-lib/components/klanten/pricegroups/UnknownFloridayMembers.d.ts +11 -0
- package/dist-lib/components/klanten/pricegroups/UnknownFloridayMembers.d.ts.map +1 -0
- package/dist-lib/components/klanten/pricegroups/UnknownFloridayMembers.js +43 -0
- package/dist-lib/index.js +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +126 -2
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.js +1 -0
- package/dist-lib/lib/customers.functions.d.ts +3 -0
- package/dist-lib/lib/customers.functions.d.ts.map +1 -1
- package/dist-lib/lib/customers.functions.js +6 -2
- package/dist-lib/lib/floriday-network-status.functions.d.ts +18 -0
- package/dist-lib/lib/floriday-network-status.functions.d.ts.map +1 -0
- package/dist-lib/lib/floriday-network-status.functions.js +41 -0
- package/dist-lib/lib/price-groups-local.functions.d.ts +42 -0
- package/dist-lib/lib/price-groups-local.functions.d.ts.map +1 -1
- package/dist-lib/lib/price-groups-local.functions.js +120 -1
- package/dist-lib/lib/vat-format.d.ts +17 -0
- package/dist-lib/lib/vat-format.d.ts.map +1 -0
- package/dist-lib/lib/vat-format.js +64 -0
- package/package.json +4 -4
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
4
|
+
import { useServerFn } from "@tanstack/react-start";
|
|
5
|
+
import { Button, Badge } from "@flowselections/core";
|
|
6
|
+
import { toast } from "sonner";
|
|
7
|
+
import { addFloridayMemberToPriceGroup, } from "../../../lib/price-groups-local.functions";
|
|
8
|
+
import { friendlyError } from "../../../lib/errors";
|
|
9
|
+
/**
|
|
10
|
+
* Floriday-leden van een prijsgroep die nog geen ERP-klant zijn. Er wordt niets vastgelegd
|
|
11
|
+
* tot iemand op "Toevoegen" klikt; dan ontstaat een klant zonder Twinfield-debiteur.
|
|
12
|
+
*/
|
|
13
|
+
export function UnknownFloridayMembers({ members, priceGroupIdFor, }) {
|
|
14
|
+
const qc = useQueryClient();
|
|
15
|
+
const addFn = useServerFn(addFloridayMemberToPriceGroup);
|
|
16
|
+
const [done, setDone] = useState(new Set());
|
|
17
|
+
const addMut = useMutation({
|
|
18
|
+
mutationFn: async (m) => {
|
|
19
|
+
for (const g of m.groups) {
|
|
20
|
+
const id = priceGroupIdFor(g.external_id);
|
|
21
|
+
if (id)
|
|
22
|
+
await addFn({ data: { organizationId: m.organization_id, priceGroupId: id } });
|
|
23
|
+
}
|
|
24
|
+
return m;
|
|
25
|
+
},
|
|
26
|
+
onSuccess: (m) => {
|
|
27
|
+
setDone((prev) => new Set(prev).add(m.organization_id));
|
|
28
|
+
qc.invalidateQueries({ queryKey: ["customer-price-groups"] });
|
|
29
|
+
qc.invalidateQueries({ queryKey: ["unknown-floriday-members"] });
|
|
30
|
+
qc.invalidateQueries({ queryKey: ["customer-price-group"] });
|
|
31
|
+
qc.invalidateQueries({ queryKey: ["external-customers-picker"] });
|
|
32
|
+
toast.success(`${m.commercial_name ?? m.name} is toegevoegd als klant (zonder debiteur in Twinfield).`);
|
|
33
|
+
},
|
|
34
|
+
onError: (e) => toast.error(friendlyError(e)),
|
|
35
|
+
});
|
|
36
|
+
if (members.length === 0)
|
|
37
|
+
return null;
|
|
38
|
+
return (_jsxs("div", { className: "space-y-1.5", children: [_jsxs("p", { className: "text-xs font-medium", children: ["Onbekend in ERP (", members.length, ")"] }), _jsx("div", { className: "max-h-56 overflow-y-auto rounded-md border divide-y", children: members.map((m) => {
|
|
39
|
+
const added = done.has(m.organization_id);
|
|
40
|
+
const canAdd = m.groups.some((g) => priceGroupIdFor(g.external_id));
|
|
41
|
+
return (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 px-3 py-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "text-sm font-medium truncate", children: m.commercial_name ?? m.name }), _jsxs("div", { className: "text-xs text-muted-foreground truncate", children: [m.commercial_name ? `${m.name} · ` : "", m.city ?? "—", " \u00B7 ", m.reason] }), m.groups.length > 0 && (_jsxs("div", { className: "text-xs text-muted-foreground truncate", children: ["In Floriday: ", m.groups.map((g) => g.name).join(", ")] }))] }), added ? (_jsx(Badge, { variant: "secondary", children: "Toegevoegd" })) : (_jsx(Button, { size: "sm", variant: "outline", disabled: !canAdd || addMut.isPending, title: canAdd ? undefined : "Importeer eerst de prijsgroep", onClick: () => addMut.mutate(m), children: "Toevoegen" }))] }, m.organization_id));
|
|
42
|
+
}) }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Toevoegen maakt een klant aan op organisatie-id, zonder debiteur in Twinfield, en deelt die in bij de prijsgroep." })] }));
|
|
43
|
+
}
|
package/dist-lib/index.js
CHANGED
|
@@ -18514,6 +18514,7 @@ export type Database = {
|
|
|
18514
18514
|
created_at: string;
|
|
18515
18515
|
default_end: string;
|
|
18516
18516
|
default_start: string;
|
|
18517
|
+
eigen_vervoer: boolean;
|
|
18517
18518
|
end_address: string | null;
|
|
18518
18519
|
home_address: string | null;
|
|
18519
18520
|
id: string;
|
|
@@ -18525,6 +18526,7 @@ export type Database = {
|
|
|
18525
18526
|
created_at?: string;
|
|
18526
18527
|
default_end?: string;
|
|
18527
18528
|
default_start?: string;
|
|
18529
|
+
eigen_vervoer?: boolean;
|
|
18528
18530
|
end_address?: string | null;
|
|
18529
18531
|
home_address?: string | null;
|
|
18530
18532
|
id?: string;
|
|
@@ -18536,6 +18538,7 @@ export type Database = {
|
|
|
18536
18538
|
created_at?: string;
|
|
18537
18539
|
default_end?: string;
|
|
18538
18540
|
default_start?: string;
|
|
18541
|
+
eigen_vervoer?: boolean;
|
|
18539
18542
|
end_address?: string | null;
|
|
18540
18543
|
home_address?: string | null;
|
|
18541
18544
|
id?: string;
|
|
@@ -26938,9 +26941,59 @@ export type Database = {
|
|
|
26938
26941
|
};
|
|
26939
26942
|
Relationships: [];
|
|
26940
26943
|
};
|
|
26944
|
+
werkbon_standby_tijdvakken: {
|
|
26945
|
+
Row: {
|
|
26946
|
+
created_at: string;
|
|
26947
|
+
datum: string;
|
|
26948
|
+
eind_tijd: string;
|
|
26949
|
+
id: string;
|
|
26950
|
+
monteur_id: string;
|
|
26951
|
+
start_tijd: string;
|
|
26952
|
+
updated_at: string;
|
|
26953
|
+
werkbon_id: string;
|
|
26954
|
+
};
|
|
26955
|
+
Insert: {
|
|
26956
|
+
created_at?: string;
|
|
26957
|
+
datum: string;
|
|
26958
|
+
eind_tijd: string;
|
|
26959
|
+
id?: string;
|
|
26960
|
+
monteur_id: string;
|
|
26961
|
+
start_tijd: string;
|
|
26962
|
+
updated_at?: string;
|
|
26963
|
+
werkbon_id: string;
|
|
26964
|
+
};
|
|
26965
|
+
Update: {
|
|
26966
|
+
created_at?: string;
|
|
26967
|
+
datum?: string;
|
|
26968
|
+
eind_tijd?: string;
|
|
26969
|
+
id?: string;
|
|
26970
|
+
monteur_id?: string;
|
|
26971
|
+
start_tijd?: string;
|
|
26972
|
+
updated_at?: string;
|
|
26973
|
+
werkbon_id?: string;
|
|
26974
|
+
};
|
|
26975
|
+
Relationships: [
|
|
26976
|
+
{
|
|
26977
|
+
foreignKeyName: "werkbon_standby_tijdvakken_werkbon_id_fkey";
|
|
26978
|
+
columns: ["werkbon_id"];
|
|
26979
|
+
isOneToOne: false;
|
|
26980
|
+
referencedRelation: "werkbonnen";
|
|
26981
|
+
referencedColumns: ["id"];
|
|
26982
|
+
},
|
|
26983
|
+
{
|
|
26984
|
+
foreignKeyName: "werkbon_standby_tijdvakken_werkbon_id_fkey";
|
|
26985
|
+
columns: ["werkbon_id"];
|
|
26986
|
+
isOneToOne: false;
|
|
26987
|
+
referencedRelation: "wo_overview";
|
|
26988
|
+
referencedColumns: ["id"];
|
|
26989
|
+
}
|
|
26990
|
+
];
|
|
26991
|
+
};
|
|
26941
26992
|
werkbon_time_logs: {
|
|
26942
26993
|
Row: {
|
|
26943
26994
|
activity: string;
|
|
26995
|
+
auto_stop_reason: string | null;
|
|
26996
|
+
auto_stopped: boolean;
|
|
26944
26997
|
created_at: string;
|
|
26945
26998
|
ended_at: string | null;
|
|
26946
26999
|
id: string;
|
|
@@ -26951,6 +27004,8 @@ export type Database = {
|
|
|
26951
27004
|
};
|
|
26952
27005
|
Insert: {
|
|
26953
27006
|
activity: string;
|
|
27007
|
+
auto_stop_reason?: string | null;
|
|
27008
|
+
auto_stopped?: boolean;
|
|
26954
27009
|
created_at?: string;
|
|
26955
27010
|
ended_at?: string | null;
|
|
26956
27011
|
id?: string;
|
|
@@ -26961,6 +27016,8 @@ export type Database = {
|
|
|
26961
27016
|
};
|
|
26962
27017
|
Update: {
|
|
26963
27018
|
activity?: string;
|
|
27019
|
+
auto_stop_reason?: string | null;
|
|
27020
|
+
auto_stopped?: boolean;
|
|
26964
27021
|
created_at?: string;
|
|
26965
27022
|
ended_at?: string | null;
|
|
26966
27023
|
id?: string;
|
|
@@ -31942,6 +31999,10 @@ export type Database = {
|
|
|
31942
31999
|
};
|
|
31943
32000
|
Returns: Json;
|
|
31944
32001
|
};
|
|
32002
|
+
logistics_orphan_carts_summary: {
|
|
32003
|
+
Args: never;
|
|
32004
|
+
Returns: Json;
|
|
32005
|
+
};
|
|
31945
32006
|
logistics_packing_autofix: {
|
|
31946
32007
|
Args: {
|
|
31947
32008
|
p_limit?: number;
|
|
@@ -31999,6 +32060,16 @@ export type Database = {
|
|
|
31999
32060
|
};
|
|
32000
32061
|
Returns: boolean;
|
|
32001
32062
|
};
|
|
32063
|
+
logistics_pakbon_old_order_row: {
|
|
32064
|
+
Args: {
|
|
32065
|
+
p_ids: string[];
|
|
32066
|
+
};
|
|
32067
|
+
Returns: boolean;
|
|
32068
|
+
};
|
|
32069
|
+
logistics_pakbon_oude_orderregels: {
|
|
32070
|
+
Args: never;
|
|
32071
|
+
Returns: Json;
|
|
32072
|
+
};
|
|
32002
32073
|
logistics_parse_pickup: {
|
|
32003
32074
|
Args: {
|
|
32004
32075
|
p_value: string;
|
|
@@ -34246,6 +34317,10 @@ export type Database = {
|
|
|
34246
34317
|
isSetofReturn: true;
|
|
34247
34318
|
};
|
|
34248
34319
|
};
|
|
34320
|
+
planning_mijn_eigen_vervoer: {
|
|
34321
|
+
Args: never;
|
|
34322
|
+
Returns: boolean;
|
|
34323
|
+
};
|
|
34249
34324
|
planning_set_assistants: {
|
|
34250
34325
|
Args: {
|
|
34251
34326
|
_monteur_ids: string[];
|
|
@@ -34278,6 +34353,18 @@ export type Database = {
|
|
|
34278
34353
|
};
|
|
34279
34354
|
Returns: string;
|
|
34280
34355
|
};
|
|
34356
|
+
print_is_etiketsoort: {
|
|
34357
|
+
Args: {
|
|
34358
|
+
_t: string;
|
|
34359
|
+
};
|
|
34360
|
+
Returns: boolean;
|
|
34361
|
+
};
|
|
34362
|
+
print_is_labelprinter: {
|
|
34363
|
+
Args: {
|
|
34364
|
+
_printer_id: string;
|
|
34365
|
+
};
|
|
34366
|
+
Returns: boolean;
|
|
34367
|
+
};
|
|
34281
34368
|
print_job_status_uitgebreid: {
|
|
34282
34369
|
Args: {
|
|
34283
34370
|
_job_id: string;
|
|
@@ -35830,6 +35917,12 @@ export type Database = {
|
|
|
35830
35917
|
};
|
|
35831
35918
|
Returns: undefined;
|
|
35832
35919
|
};
|
|
35920
|
+
uren_overuren_intrekken: {
|
|
35921
|
+
Args: {
|
|
35922
|
+
_datum: string;
|
|
35923
|
+
};
|
|
35924
|
+
Returns: undefined;
|
|
35925
|
+
};
|
|
35833
35926
|
uren_pagina_toegang_instellen: {
|
|
35834
35927
|
Args: {
|
|
35835
35928
|
_toegang: boolean;
|
|
@@ -36233,6 +36326,13 @@ export type Database = {
|
|
|
36233
36326
|
Args: never;
|
|
36234
36327
|
Returns: Json;
|
|
36235
36328
|
};
|
|
36329
|
+
wo_boek_standby_tijdvakken: {
|
|
36330
|
+
Args: {
|
|
36331
|
+
_tijdvakken: Json;
|
|
36332
|
+
_werkbon_id: string;
|
|
36333
|
+
};
|
|
36334
|
+
Returns: Json;
|
|
36335
|
+
};
|
|
36236
36336
|
wo_boek_standby_uren: {
|
|
36237
36337
|
Args: {
|
|
36238
36338
|
_datum: string;
|
|
@@ -36348,11 +36448,35 @@ export type Database = {
|
|
|
36348
36448
|
};
|
|
36349
36449
|
Returns: Json;
|
|
36350
36450
|
};
|
|
36451
|
+
wo_standby_dag_herberekenen: {
|
|
36452
|
+
Args: {
|
|
36453
|
+
_datum: string;
|
|
36454
|
+
_monteur: string;
|
|
36455
|
+
};
|
|
36456
|
+
Returns: Json;
|
|
36457
|
+
};
|
|
36458
|
+
wo_standby_ov_dag: {
|
|
36459
|
+
Args: {
|
|
36460
|
+
_dienst: Json;
|
|
36461
|
+
_dow: number;
|
|
36462
|
+
_feest: boolean;
|
|
36463
|
+
_vakken: Json;
|
|
36464
|
+
};
|
|
36465
|
+
Returns: Json;
|
|
36466
|
+
};
|
|
36467
|
+
wo_standby_tijdzone: {
|
|
36468
|
+
Args: never;
|
|
36469
|
+
Returns: string;
|
|
36470
|
+
};
|
|
36471
|
+
wo_timer_stop_0400: {
|
|
36472
|
+
Args: never;
|
|
36473
|
+
Returns: number;
|
|
36474
|
+
};
|
|
36351
36475
|
};
|
|
36352
36476
|
Enums: {
|
|
36353
36477
|
ai_import_status: "nieuw" | "verwerken" | "bevestigen" | "klaar" | "mislukt";
|
|
36354
36478
|
app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie" | "superadmin";
|
|
36355
|
-
doc_layout_type: "pakbon" | "factuur" | "offerte" | "orderbevestiging" | "etiket" | "verzendlabel" | "productlabel" | "barcode_label" | "magazijnlijst" | "controlelijst" | "transportdocument" | "vrij" | "sticker" | "productiebon" | "veilingbon" | "afleverbrief" | "veilingbrief";
|
|
36479
|
+
doc_layout_type: "pakbon" | "factuur" | "offerte" | "orderbevestiging" | "etiket" | "verzendlabel" | "productlabel" | "barcode_label" | "magazijnlijst" | "controlelijst" | "transportdocument" | "vrij" | "sticker" | "productiebon" | "veilingbon" | "afleverbrief" | "veilingbrief" | "traysticker";
|
|
36356
36480
|
doc_orientation: "portrait" | "landscape";
|
|
36357
36481
|
exact_env: "staging" | "live";
|
|
36358
36482
|
exact_push_status: "pending" | "sent" | "error";
|
|
@@ -36423,7 +36547,7 @@ export declare const Constants: {
|
|
|
36423
36547
|
readonly Enums: {
|
|
36424
36548
|
readonly ai_import_status: readonly ["nieuw", "verwerken", "bevestigen", "klaar", "mislukt"];
|
|
36425
36549
|
readonly app_role: readonly ["admin", "planner", "monteur", "administratie", "ai_admin", "manager", "warehouse", "sales", "developer", "receptie", "superadmin"];
|
|
36426
|
-
readonly doc_layout_type: readonly ["pakbon", "factuur", "offerte", "orderbevestiging", "etiket", "verzendlabel", "productlabel", "barcode_label", "magazijnlijst", "controlelijst", "transportdocument", "vrij", "sticker", "productiebon", "veilingbon", "afleverbrief", "veilingbrief"];
|
|
36550
|
+
readonly doc_layout_type: readonly ["pakbon", "factuur", "offerte", "orderbevestiging", "etiket", "verzendlabel", "productlabel", "barcode_label", "magazijnlijst", "controlelijst", "transportdocument", "vrij", "sticker", "productiebon", "veilingbon", "afleverbrief", "veilingbrief", "traysticker"];
|
|
36427
36551
|
readonly doc_orientation: readonly ["portrait", "landscape"];
|
|
36428
36552
|
readonly exact_env: readonly ["staging", "live"];
|
|
36429
36553
|
readonly exact_push_status: readonly ["pending", "sent", "error"];
|