@flowselections/floriday-klanten-module 1.0.25 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist-lib/components/klanten/BewerkKlantRoute.d.ts +4 -1
  2. package/dist-lib/components/klanten/BewerkKlantRoute.d.ts.map +1 -1
  3. package/dist-lib/components/klanten/BewerkKlantRoute.js +7 -4
  4. package/dist-lib/components/klanten/ChannelBadges.d.ts +11 -0
  5. package/dist-lib/components/klanten/ChannelBadges.d.ts.map +1 -0
  6. package/dist-lib/components/klanten/ChannelBadges.js +21 -0
  7. package/dist-lib/components/klanten/DeliveryLocationsTab.d.ts.map +1 -1
  8. package/dist-lib/components/klanten/DeliveryLocationsTab.js +9 -1
  9. package/dist-lib/components/klanten/GroupedKlantDetail.d.ts.map +1 -1
  10. package/dist-lib/components/klanten/GroupedKlantDetail.js +30 -5
  11. package/dist-lib/components/klanten/GroupedKlantDetailRoute.d.ts +4 -1
  12. package/dist-lib/components/klanten/GroupedKlantDetailRoute.d.ts.map +1 -1
  13. package/dist-lib/components/klanten/GroupedKlantDetailRoute.js +7 -4
  14. package/dist-lib/components/klanten/KlantDetail.d.ts.map +1 -1
  15. package/dist-lib/components/klanten/KlantDetail.js +26 -3
  16. package/dist-lib/components/klanten/KlantDetailLayout.d.ts +4 -2
  17. package/dist-lib/components/klanten/KlantDetailLayout.d.ts.map +1 -1
  18. package/dist-lib/components/klanten/KlantDetailLayout.js +23 -21
  19. package/dist-lib/components/klanten/KlantDetailRoute.d.ts +4 -1
  20. package/dist-lib/components/klanten/KlantDetailRoute.d.ts.map +1 -1
  21. package/dist-lib/components/klanten/KlantDetailRoute.js +7 -4
  22. package/dist-lib/components/klanten/KlantFormulier.d.ts +1 -1
  23. package/dist-lib/components/klanten/KlantFormulier.d.ts.map +1 -1
  24. package/dist-lib/components/klanten/KlantFormulier.js +14 -4
  25. package/dist-lib/components/klanten/KlantenOverzicht.d.ts.map +1 -1
  26. package/dist-lib/components/klanten/KlantenOverzicht.js +103 -16
  27. package/dist-lib/components/klanten/MultiSearchableSelect.d.ts +21 -0
  28. package/dist-lib/components/klanten/MultiSearchableSelect.d.ts.map +1 -0
  29. package/dist-lib/components/klanten/MultiSearchableSelect.js +86 -0
  30. package/dist-lib/components/klanten/NetwerkPagina.d.ts.map +1 -1
  31. package/dist-lib/components/klanten/NetwerkPagina.js +2 -1
  32. package/dist-lib/components/klanten/OvernemenTwinfieldKlant.d.ts.map +1 -1
  33. package/dist-lib/components/klanten/OvernemenTwinfieldKlant.js +1 -3
  34. package/dist-lib/components/klanten/OvernemenTwinfieldKlantRoute.d.ts +4 -1
  35. package/dist-lib/components/klanten/OvernemenTwinfieldKlantRoute.d.ts.map +1 -1
  36. package/dist-lib/components/klanten/OvernemenTwinfieldKlantRoute.js +7 -4
  37. package/dist-lib/components/klanten/SearchableSelect.d.ts +17 -0
  38. package/dist-lib/components/klanten/SearchableSelect.d.ts.map +1 -0
  39. package/dist-lib/components/klanten/SearchableSelect.js +57 -0
  40. package/dist-lib/components/klanten/pricegroups/CustomerPickerDialog.d.ts.map +1 -1
  41. package/dist-lib/components/klanten/pricegroups/CustomerPickerDialog.js +3 -2
  42. package/dist-lib/components/klanten/pricegroups/PriceGroupFormPage.d.ts.map +1 -1
  43. package/dist-lib/components/klanten/pricegroups/PriceGroupFormPage.js +2 -1
  44. package/dist-lib/integrations/supabase/auth-middleware.d.ts +33 -0
  45. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  46. package/dist-lib/integrations/supabase/client.d.ts +33 -0
  47. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  48. package/dist-lib/integrations/supabase/client.server.d.ts +33 -0
  49. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  50. package/dist-lib/integrations/supabase/types.d.ts +35 -0
  51. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  52. package/dist-lib/lib/accounting/twinfield/worker.functions.d.ts +99 -0
  53. package/dist-lib/lib/accounting/twinfield/worker.functions.d.ts.map +1 -1
  54. package/dist-lib/lib/accounting.functions.d.ts +99 -0
  55. package/dist-lib/lib/accounting.functions.d.ts.map +1 -1
  56. package/dist-lib/lib/countries.d.ts +31 -0
  57. package/dist-lib/lib/countries.d.ts.map +1 -0
  58. package/dist-lib/lib/countries.js +194 -0
  59. package/dist-lib/lib/customer-analytics.functions.d.ts +33 -0
  60. package/dist-lib/lib/customer-analytics.functions.d.ts.map +1 -1
  61. package/dist-lib/lib/customer-notes.functions.d.ts +39638 -0
  62. package/dist-lib/lib/customer-notes.functions.d.ts.map +1 -0
  63. package/dist-lib/lib/customer-notes.functions.js +59 -0
  64. package/dist-lib/lib/customers.functions.d.ts +297 -0
  65. package/dist-lib/lib/customers.functions.d.ts.map +1 -1
  66. package/dist-lib/lib/delivery-locations.functions.d.ts +132 -0
  67. package/dist-lib/lib/delivery-locations.functions.d.ts.map +1 -1
  68. package/dist-lib/lib/external-customers.functions.d.ts +132 -0
  69. package/dist-lib/lib/external-customers.functions.d.ts.map +1 -1
  70. package/dist-lib/lib/floriday-assortment.functions.d.ts +33 -0
  71. package/dist-lib/lib/floriday-assortment.functions.d.ts.map +1 -1
  72. package/dist-lib/lib/floriday-discounts.functions.d.ts +66 -0
  73. package/dist-lib/lib/floriday-discounts.functions.d.ts.map +1 -1
  74. package/dist-lib/lib/floriday-trade-items.functions.d.ts +33 -0
  75. package/dist-lib/lib/floriday-trade-items.functions.d.ts.map +1 -1
  76. package/dist-lib/lib/local-discounts.functions.d.ts +231 -0
  77. package/dist-lib/lib/local-discounts.functions.d.ts.map +1 -1
  78. package/dist-lib/lib/logistics-events.functions.d.ts +33 -0
  79. package/dist-lib/lib/logistics-events.functions.d.ts.map +1 -1
  80. package/dist-lib/lib/logistics-strategy.functions.d.ts +132 -0
  81. package/dist-lib/lib/logistics-strategy.functions.d.ts.map +1 -1
  82. package/dist-lib/lib/overdue-invoices.functions.d.ts +33 -0
  83. package/dist-lib/lib/overdue-invoices.functions.d.ts.map +1 -1
  84. package/dist-lib/lib/payment-method.d.ts +22 -0
  85. package/dist-lib/lib/payment-method.d.ts.map +1 -0
  86. package/dist-lib/lib/payment-method.js +74 -0
  87. package/dist-lib/lib/price-groups-local.functions.d.ts +231 -0
  88. package/dist-lib/lib/price-groups-local.functions.d.ts.map +1 -1
  89. package/dist-lib/lib/price-groups.functions.d.ts +33 -0
  90. package/dist-lib/lib/price-groups.functions.d.ts.map +1 -1
  91. package/dist-lib/lib/twinfield-adopt.functions.d.ts +66 -0
  92. package/dist-lib/lib/twinfield-adopt.functions.d.ts.map +1 -1
  93. package/dist-lib/lib/twinfield-ledger.functions.d.ts +33 -0
  94. package/dist-lib/lib/twinfield-ledger.functions.d.ts.map +1 -1
  95. package/package.json +1 -1
  96. package/public/flowselections-assets/Klanten/twinfield-logo.svg +218 -0
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Afleiden van de betaalvorm van een klant uit de brongegevens.
3
+ *
4
+ * Volgorde: Twinfield (financials.meansofpayment) → Floriday (paymentProviders)
5
+ * → lokale klant (payment_methods). Zonder aanwijzingen geldt de
6
+ * Twinfield-standaard: op factuur.
7
+ */
8
+ const CASH_VALUES = new Set(["cash", "contant", "kas", "kasboek", "cashbook"]);
9
+ function normalize(v) {
10
+ return String(v ?? "").trim().toLowerCase();
11
+ }
12
+ function fromTwinfield(raw) {
13
+ const fin = raw?.financials ?? raw?.data?.financials;
14
+ if (!fin)
15
+ return null;
16
+ const mop = normalize(fin.meansofpayment ?? fin.meansOfPayment);
17
+ if (!mop)
18
+ return null;
19
+ if (CASH_VALUES.has(mop))
20
+ return { label: "Contant", tone: "cash" };
21
+ return { label: "Factuur", tone: "invoice" };
22
+ }
23
+ function fromFloriday(raw) {
24
+ const providers = raw?.paymentProviders ?? raw?.data?.paymentProviders ?? null;
25
+ if (!Array.isArray(providers) || providers.length === 0)
26
+ return null;
27
+ const first = String(providers[0] ?? "").trim();
28
+ if (!first)
29
+ return null;
30
+ const label = first.charAt(0).toUpperCase() + first.slice(1).toLowerCase();
31
+ return { label, tone: "provider" };
32
+ }
33
+ function fromLocal(raw) {
34
+ const methods = raw?.payment_methods;
35
+ if (!Array.isArray(methods) || methods.length === 0)
36
+ return null;
37
+ const first = String(methods[0] ?? "").trim();
38
+ if (!first)
39
+ return null;
40
+ if (CASH_VALUES.has(first.toLowerCase()))
41
+ return { label: "Contant", tone: "cash" };
42
+ return { label: first.charAt(0).toUpperCase() + first.slice(1), tone: "invoice" };
43
+ }
44
+ /** Bepaal de betaalvorm op basis van alle bronrijen van een (samengevoegde) klant. */
45
+ export function derivePaymentMethod(sources, localRow) {
46
+ const list = sources ?? [];
47
+ const tw = list.find((s) => s.provider === "twinfield");
48
+ if (tw) {
49
+ const hit = fromTwinfield(tw.raw);
50
+ if (hit)
51
+ return hit;
52
+ }
53
+ const fd = list.find((s) => s.provider === "floriday");
54
+ if (fd) {
55
+ const hit = fromFloriday(fd.raw);
56
+ if (hit)
57
+ return hit;
58
+ }
59
+ const loc = list.find((s) => s.provider === "local");
60
+ const hitLocal = fromLocal(loc?.raw) ?? fromLocal(localRow);
61
+ if (hitLocal)
62
+ return hitLocal;
63
+ return { label: "Factuur", tone: "invoice" };
64
+ }
65
+ export function paymentToneClasses(tone) {
66
+ switch (tone) {
67
+ case "cash":
68
+ return "bg-warning/10 text-warning border-warning/20";
69
+ case "provider":
70
+ return "bg-accent text-accent-foreground border-border";
71
+ default:
72
+ return "bg-primary/10 text-primary border-primary/20";
73
+ }
74
+ }
@@ -1908,6 +1908,39 @@ export declare const listCustomerPriceGroups: import("@tanstack/start-client-cor
1908
1908
  referencedColumns: ["id"];
1909
1909
  }];
1910
1910
  };
1911
+ customer_notes: {
1912
+ Row: {
1913
+ created_at: string;
1914
+ customer_id: string | null;
1915
+ group_key: string | null;
1916
+ id: string;
1917
+ notes: string | null;
1918
+ updated_at: string;
1919
+ };
1920
+ Insert: {
1921
+ created_at?: string;
1922
+ customer_id?: string | null;
1923
+ group_key?: string | null;
1924
+ id?: string;
1925
+ notes?: string | null;
1926
+ updated_at?: string;
1927
+ };
1928
+ Update: {
1929
+ created_at?: string;
1930
+ customer_id?: string | null;
1931
+ group_key?: string | null;
1932
+ id?: string;
1933
+ notes?: string | null;
1934
+ updated_at?: string;
1935
+ };
1936
+ Relationships: [{
1937
+ foreignKeyName: "customer_notes_customer_id_fkey";
1938
+ columns: ["customer_id"];
1939
+ isOneToOne: true;
1940
+ referencedRelation: "customers";
1941
+ referencedColumns: ["id"];
1942
+ }];
1943
+ };
1911
1944
  customer_price_group_members: {
1912
1945
  Row: {
1913
1946
  created_at: string;
@@ -21687,6 +21720,39 @@ export declare const getCustomerPriceGroup: import("@tanstack/start-client-core"
21687
21720
  referencedColumns: ["id"];
21688
21721
  }];
21689
21722
  };
21723
+ customer_notes: {
21724
+ Row: {
21725
+ created_at: string;
21726
+ customer_id: string | null;
21727
+ group_key: string | null;
21728
+ id: string;
21729
+ notes: string | null;
21730
+ updated_at: string;
21731
+ };
21732
+ Insert: {
21733
+ created_at?: string;
21734
+ customer_id?: string | null;
21735
+ group_key?: string | null;
21736
+ id?: string;
21737
+ notes?: string | null;
21738
+ updated_at?: string;
21739
+ };
21740
+ Update: {
21741
+ created_at?: string;
21742
+ customer_id?: string | null;
21743
+ group_key?: string | null;
21744
+ id?: string;
21745
+ notes?: string | null;
21746
+ updated_at?: string;
21747
+ };
21748
+ Relationships: [{
21749
+ foreignKeyName: "customer_notes_customer_id_fkey";
21750
+ columns: ["customer_id"];
21751
+ isOneToOne: true;
21752
+ referencedRelation: "customers";
21753
+ referencedColumns: ["id"];
21754
+ }];
21755
+ };
21690
21756
  customer_price_group_members: {
21691
21757
  Row: {
21692
21758
  created_at: string;
@@ -41492,6 +41558,39 @@ export declare const createCustomerPriceGroup: import("@tanstack/start-client-co
41492
41558
  referencedColumns: ["id"];
41493
41559
  }];
41494
41560
  };
41561
+ customer_notes: {
41562
+ Row: {
41563
+ created_at: string;
41564
+ customer_id: string | null;
41565
+ group_key: string | null;
41566
+ id: string;
41567
+ notes: string | null;
41568
+ updated_at: string;
41569
+ };
41570
+ Insert: {
41571
+ created_at?: string;
41572
+ customer_id?: string | null;
41573
+ group_key?: string | null;
41574
+ id?: string;
41575
+ notes?: string | null;
41576
+ updated_at?: string;
41577
+ };
41578
+ Update: {
41579
+ created_at?: string;
41580
+ customer_id?: string | null;
41581
+ group_key?: string | null;
41582
+ id?: string;
41583
+ notes?: string | null;
41584
+ updated_at?: string;
41585
+ };
41586
+ Relationships: [{
41587
+ foreignKeyName: "customer_notes_customer_id_fkey";
41588
+ columns: ["customer_id"];
41589
+ isOneToOne: true;
41590
+ referencedRelation: "customers";
41591
+ referencedColumns: ["id"];
41592
+ }];
41593
+ };
41495
41594
  customer_price_group_members: {
41496
41595
  Row: {
41497
41596
  created_at: string;
@@ -61308,6 +61407,39 @@ export declare const updateCustomerPriceGroup: import("@tanstack/start-client-co
61308
61407
  referencedColumns: ["id"];
61309
61408
  }];
61310
61409
  };
61410
+ customer_notes: {
61411
+ Row: {
61412
+ created_at: string;
61413
+ customer_id: string | null;
61414
+ group_key: string | null;
61415
+ id: string;
61416
+ notes: string | null;
61417
+ updated_at: string;
61418
+ };
61419
+ Insert: {
61420
+ created_at?: string;
61421
+ customer_id?: string | null;
61422
+ group_key?: string | null;
61423
+ id?: string;
61424
+ notes?: string | null;
61425
+ updated_at?: string;
61426
+ };
61427
+ Update: {
61428
+ created_at?: string;
61429
+ customer_id?: string | null;
61430
+ group_key?: string | null;
61431
+ id?: string;
61432
+ notes?: string | null;
61433
+ updated_at?: string;
61434
+ };
61435
+ Relationships: [{
61436
+ foreignKeyName: "customer_notes_customer_id_fkey";
61437
+ columns: ["customer_id"];
61438
+ isOneToOne: true;
61439
+ referencedRelation: "customers";
61440
+ referencedColumns: ["id"];
61441
+ }];
61442
+ };
61311
61443
  customer_price_group_members: {
61312
61444
  Row: {
61313
61445
  created_at: string;
@@ -81127,6 +81259,39 @@ export declare const deleteCustomerPriceGroup: import("@tanstack/start-client-co
81127
81259
  referencedColumns: ["id"];
81128
81260
  }];
81129
81261
  };
81262
+ customer_notes: {
81263
+ Row: {
81264
+ created_at: string;
81265
+ customer_id: string | null;
81266
+ group_key: string | null;
81267
+ id: string;
81268
+ notes: string | null;
81269
+ updated_at: string;
81270
+ };
81271
+ Insert: {
81272
+ created_at?: string;
81273
+ customer_id?: string | null;
81274
+ group_key?: string | null;
81275
+ id?: string;
81276
+ notes?: string | null;
81277
+ updated_at?: string;
81278
+ };
81279
+ Update: {
81280
+ created_at?: string;
81281
+ customer_id?: string | null;
81282
+ group_key?: string | null;
81283
+ id?: string;
81284
+ notes?: string | null;
81285
+ updated_at?: string;
81286
+ };
81287
+ Relationships: [{
81288
+ foreignKeyName: "customer_notes_customer_id_fkey";
81289
+ columns: ["customer_id"];
81290
+ isOneToOne: true;
81291
+ referencedRelation: "customers";
81292
+ referencedColumns: ["id"];
81293
+ }];
81294
+ };
81130
81295
  customer_price_group_members: {
81131
81296
  Row: {
81132
81297
  created_at: string;
@@ -100910,6 +101075,39 @@ export declare const reorderCustomerPriceGroups: import("@tanstack/start-client-
100910
101075
  referencedColumns: ["id"];
100911
101076
  }];
100912
101077
  };
101078
+ customer_notes: {
101079
+ Row: {
101080
+ created_at: string;
101081
+ customer_id: string | null;
101082
+ group_key: string | null;
101083
+ id: string;
101084
+ notes: string | null;
101085
+ updated_at: string;
101086
+ };
101087
+ Insert: {
101088
+ created_at?: string;
101089
+ customer_id?: string | null;
101090
+ group_key?: string | null;
101091
+ id?: string;
101092
+ notes?: string | null;
101093
+ updated_at?: string;
101094
+ };
101095
+ Update: {
101096
+ created_at?: string;
101097
+ customer_id?: string | null;
101098
+ group_key?: string | null;
101099
+ id?: string;
101100
+ notes?: string | null;
101101
+ updated_at?: string;
101102
+ };
101103
+ Relationships: [{
101104
+ foreignKeyName: "customer_notes_customer_id_fkey";
101105
+ columns: ["customer_id"];
101106
+ isOneToOne: true;
101107
+ referencedRelation: "customers";
101108
+ referencedColumns: ["id"];
101109
+ }];
101110
+ };
100913
101111
  customer_price_group_members: {
100914
101112
  Row: {
100915
101113
  created_at: string;
@@ -120693,6 +120891,39 @@ export declare const setPriceGroupMembers: import("@tanstack/start-client-core")
120693
120891
  referencedColumns: ["id"];
120694
120892
  }];
120695
120893
  };
120894
+ customer_notes: {
120895
+ Row: {
120896
+ created_at: string;
120897
+ customer_id: string | null;
120898
+ group_key: string | null;
120899
+ id: string;
120900
+ notes: string | null;
120901
+ updated_at: string;
120902
+ };
120903
+ Insert: {
120904
+ created_at?: string;
120905
+ customer_id?: string | null;
120906
+ group_key?: string | null;
120907
+ id?: string;
120908
+ notes?: string | null;
120909
+ updated_at?: string;
120910
+ };
120911
+ Update: {
120912
+ created_at?: string;
120913
+ customer_id?: string | null;
120914
+ group_key?: string | null;
120915
+ id?: string;
120916
+ notes?: string | null;
120917
+ updated_at?: string;
120918
+ };
120919
+ Relationships: [{
120920
+ foreignKeyName: "customer_notes_customer_id_fkey";
120921
+ columns: ["customer_id"];
120922
+ isOneToOne: true;
120923
+ referencedRelation: "customers";
120924
+ referencedColumns: ["id"];
120925
+ }];
120926
+ };
120696
120927
  customer_price_group_members: {
120697
120928
  Row: {
120698
120929
  created_at: string;