@flowselections/floriday-verkoop-module 1.0.143 → 1.0.144

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 (25) hide show
  1. package/dist-lib/components/verkoop/CreateOrderPage.d.ts.map +1 -1
  2. package/dist-lib/components/verkoop/CreateOrderPage.js +50 -14
  3. package/dist-lib/components/verkoop/SalesOrderDetailPage.d.ts.map +1 -1
  4. package/dist-lib/components/verkoop/SalesOrderDetailPage.js +27 -2
  5. package/dist-lib/components/verkoop/SalesOrdersFilterPanel.d.ts.map +1 -1
  6. package/dist-lib/components/verkoop/SalesOrdersFilterPanel.js +1 -1
  7. package/dist-lib/components/verkoop/SearchableSelect.js +1 -1
  8. package/dist-lib/components/verkoop/VerkoopOrdersPage.d.ts.map +1 -1
  9. package/dist-lib/components/verkoop/VerkoopOrdersPage.js +4 -2
  10. package/dist-lib/components/verkoop/order-detail-shortcuts.check.d.ts +2 -0
  11. package/dist-lib/components/verkoop/order-detail-shortcuts.check.d.ts.map +1 -0
  12. package/dist-lib/components/verkoop/order-detail-shortcuts.check.js +38 -0
  13. package/dist-lib/components/verkoop/order-shortcuts.check.d.ts +2 -0
  14. package/dist-lib/components/verkoop/order-shortcuts.check.d.ts.map +1 -0
  15. package/dist-lib/components/verkoop/order-shortcuts.check.js +34 -0
  16. package/dist-lib/components/verkoop/v3/NavigationTooltip.d.ts +7 -0
  17. package/dist-lib/components/verkoop/v3/NavigationTooltip.d.ts.map +1 -0
  18. package/dist-lib/components/verkoop/v3/NavigationTooltip.js +6 -0
  19. package/dist-lib/integrations/supabase/types.d.ts +167 -0
  20. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  21. package/dist-lib/lib/create-order-form.check.js +8 -1
  22. package/dist-lib/lib/create-order-form.d.ts +27 -0
  23. package/dist-lib/lib/create-order-form.d.ts.map +1 -1
  24. package/dist-lib/lib/create-order-form.js +27 -0
  25. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  // Draai: bun src/lib/create-order-form.check.ts (ook met TZ=UTC)
2
- import { missingItems, lineCrates, lineTotal, dateWithWeekday } from "./create-order-form.js";
2
+ import { missingItems, lineCrates, lineTotal, dateWithWeekday, attentionItems, selectionKey, resetOnSelectionChange, applyFirstFeasible } from "./create-order-form.js";
3
3
  import { twinfieldOnlyRows } from "./create-order-customers.js";
4
4
  let failed = 0;
5
5
  function eq(n, g, w) { const ok = JSON.stringify(g) === JSON.stringify(w); if (!ok)
@@ -20,6 +20,13 @@ const tw = [
20
20
  { twinfield_code: "1015", name: "Coelho Import" },
21
21
  ];
22
22
  eq("inactieve klant niet terug + Coelho één keer", twinfieldOnlyRows(all, tw).map((t) => t.twinfield_code), ["1015"]);
23
+ eq("aandachtspunten", attentionItems({ linesWithoutPrice: 1, linesOverStock: 1 }), ["1 regel zonder prijs", "1 regel meer dan beschikbaar"]);
24
+ eq("geen aandachtspunten", attentionItems({ linesWithoutPrice: 0, linesOverStock: 0 }), []);
25
+ eq("klantwissel wist automatische datum", resetOnSelectionChange({ deliveryDate: "2026-11-03", dateSource: "auto" }), { deliveryDate: "", dateSource: "auto" });
26
+ eq("klantwissel houdt eigen datum", resetOnSelectionChange({ deliveryDate: "2026-11-10", dateSource: "user" }), { deliveryDate: "2026-11-10", dateSource: "user" });
27
+ eq("eigen datum haalbaar blijft", applyFirstFeasible({ deliveryDate: "2026-11-10", dateSource: "user", firstFeasible: "2026-11-03" }).deliveryDate, "2026-11-10");
28
+ eq("eigen datum te vroeg gewist", applyFirstFeasible({ deliveryDate: "2026-11-02", dateSource: "user", firstFeasible: "2026-11-03" }).cleared, true);
29
+ eq("selectiesleutel verschilt per klant", selectionKey("a", "l", "p") === selectionKey("b", "l", "p"), false);
23
30
  if (failed) {
24
31
  console.error(`${failed} fout(en)`);
25
32
  process.exit(1);
@@ -19,4 +19,31 @@ export declare function lineTotal(quantity: number | null, unitPrice: number | n
19
19
  /** "di 3 nov 2026" voor een kale datum (YYYY-MM-DD), zonder tijdzoneverschuiving. */
20
20
  export declare function dateWithWeekday(d: string | null | undefined): string | null;
21
21
  export declare const eur: (n: number) => string;
22
+ /** Sleutel van de keuze waarvoor een Engine-voorstel is opgevraagd. */
23
+ export declare function selectionKey(customerId: string | null, deliveryLocationId: string | null, pickupLocationId: string | null): string;
24
+ type DateSource = "auto" | "user";
25
+ /** Andere klant/locatie: automatische datum wissen, zelf gekozen datum laten staan (wordt daarna getoetst). */
26
+ export declare function resetOnSelectionChange(s: {
27
+ deliveryDate: string;
28
+ dateSource: DateSource;
29
+ }): {
30
+ deliveryDate: string;
31
+ dateSource: DateSource;
32
+ };
33
+ /** Eerste haalbare datum van de Engine verwerken (ISO-datums, stringvergelijking). */
34
+ export declare function applyFirstFeasible(s: {
35
+ deliveryDate: string;
36
+ dateSource: DateSource;
37
+ firstFeasible: string;
38
+ }): {
39
+ deliveryDate: string;
40
+ dateSource: DateSource;
41
+ cleared: boolean;
42
+ };
43
+ /** Punten die aanmaken niet blokkeren maar wel aandacht vragen. */
44
+ export declare function attentionItems(s: {
45
+ linesWithoutPrice: number;
46
+ linesOverStock: number;
47
+ }): string[];
48
+ export {};
22
49
  //# sourceMappingURL=create-order-form.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-order-form.d.ts","sourceRoot":"","sources":["../../src/lib/create-order-form.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,cAAc,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,oBAAoB,EAAE,MAAM,CAAC;IAC7B,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,oBAAoB,EAAE,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,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAInF;AAGD,qFAAqF;AACrF,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAQ3E;AAED,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,WAC6D,CAAC;AAE3F,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,EAAE,kBAAkB,EAAE,MAAM,GAAG,IAAI,EAAE,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAElI;AAED,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAClC,+GAA+G;AAC/G,wBAAgB,sBAAsB,CAAC,CAAC,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE,CAE5I;AAED,sFAAsF;AACtF,wBAAgB,kBAAkB,CAAC,CAAC,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAMjL;AAED,mEAAmE;AACnE,wBAAgB,cAAc,CAAC,CAAC,EAAE;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,EAAE,CAMjG"}
@@ -50,3 +50,30 @@ export function dateWithWeekday(d) {
50
50
  return `${get("weekday")} ${get("day")} ${get("month")} ${get("year")}`;
51
51
  }
52
52
  export const eur = (n) => `€ ${n.toLocaleString("nl-NL", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
53
+ /** Sleutel van de keuze waarvoor een Engine-voorstel is opgevraagd. */
54
+ export function selectionKey(customerId, deliveryLocationId, pickupLocationId) {
55
+ return [customerId ?? "", deliveryLocationId ?? "", pickupLocationId ?? ""].join("|");
56
+ }
57
+ /** Andere klant/locatie: automatische datum wissen, zelf gekozen datum laten staan (wordt daarna getoetst). */
58
+ export function resetOnSelectionChange(s) {
59
+ return s.dateSource === "user" ? s : { deliveryDate: "", dateSource: "auto" };
60
+ }
61
+ /** Eerste haalbare datum van de Engine verwerken (ISO-datums, stringvergelijking). */
62
+ export function applyFirstFeasible(s) {
63
+ if (s.dateSource === "user" && s.deliveryDate) {
64
+ if (s.deliveryDate.slice(0, 10) >= s.firstFeasible.slice(0, 10))
65
+ return { ...s, cleared: false };
66
+ return { deliveryDate: s.firstFeasible, dateSource: "auto", cleared: true };
67
+ }
68
+ return { deliveryDate: s.firstFeasible, dateSource: "auto", cleared: false };
69
+ }
70
+ /** Punten die aanmaken niet blokkeren maar wel aandacht vragen. */
71
+ export function attentionItems(s) {
72
+ const out = [];
73
+ const n = (k) => (k === 1 ? "1 regel" : `${k} regels`);
74
+ if (s.linesWithoutPrice > 0)
75
+ out.push(`${n(s.linesWithoutPrice)} zonder prijs`);
76
+ if (s.linesOverStock > 0)
77
+ out.push(`${n(s.linesOverStock)} meer dan beschikbaar`);
78
+ return out;
79
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowselections/floriday-verkoop-module",
3
- "version": "1.0.143",
3
+ "version": "1.0.144",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "type": "module",