@flowselections/floriday-klanten-module 1.0.95 → 1.0.97
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/CustomerAssortmentTab.d.ts.map +1 -1
- package/dist-lib/components/klanten/CustomerAssortmentTab.js +7 -4
- package/dist-lib/integrations/supabase/types.d.ts +1442 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/customer-assortment.functions.d.ts +2 -0
- package/dist-lib/lib/customer-assortment.functions.d.ts.map +1 -1
- package/dist-lib/lib/customer-assortment.functions.js +108 -32
- package/dist-lib/lib/floriday-catalog-prices.d.ts.map +1 -1
- package/dist-lib/lib/floriday-catalog-prices.js +5 -12
- package/dist-lib/lib/tabel-ontbreekt.d.ts +7 -0
- package/dist-lib/lib/tabel-ontbreekt.d.ts.map +1 -0
- package/dist-lib/lib/tabel-ontbreekt.js +21 -0
- package/dist-lib/lib/voorraad-assortiment.d.ts +25 -0
- package/dist-lib/lib/voorraad-assortiment.d.ts.map +1 -0
- package/dist-lib/lib/voorraad-assortiment.js +84 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomerAssortmentTab.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/CustomerAssortmentTab.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,qBAAqB,CAAC,EACpC,WAAW,EACX,cAAc,GACf,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,+
|
|
1
|
+
{"version":3,"file":"CustomerAssortmentTab.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/CustomerAssortmentTab.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,qBAAqB,CAAC,EACpC,WAAW,EACX,cAAc,GACf,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,+BAyWA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useState } from "react";
|
|
3
3
|
import { formatDateTime } from "../../lib/format-date.js";
|
|
4
4
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
@@ -47,7 +47,8 @@ export function CustomerAssortmentTab({ customerKey, organizationId, }) {
|
|
|
47
47
|
m.set(s.trade_item_key, s);
|
|
48
48
|
return m;
|
|
49
49
|
}, [stickerData]);
|
|
50
|
-
const items = data?.items
|
|
50
|
+
const items = Array.isArray(data?.items) ? data.items : [];
|
|
51
|
+
const bronLabel = data?.bron === "voorraad" ? "Bron: voorraad" : "Bron: Floriday";
|
|
51
52
|
const ownCount = items.filter((i) => i.in_assortment).length;
|
|
52
53
|
const otherCount = items.length - ownCount;
|
|
53
54
|
const hasOwnAssortment = ownCount > 0;
|
|
@@ -94,9 +95,11 @@ export function CustomerAssortmentTab({ customerKey, organizationId, }) {
|
|
|
94
95
|
const currency = pg?.currency ?? "EUR";
|
|
95
96
|
const defaultFormat = stickerData?.format ?? null;
|
|
96
97
|
if (items.length === 0) {
|
|
97
|
-
return (_jsx(Card, { children: _jsxs(CardContent, { className: "py-10 text-center space-y-1", children: [_jsx("p", { className: "text-
|
|
98
|
+
return (_jsx(Card, { children: _jsxs(CardContent, { className: "py-10 text-center space-y-1", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: bronLabel }), data?.bron === "voorraad" ? (_jsx("p", { className: "text-sm font-medium", children: data?.melding === "geen_voorraadmodule"
|
|
99
|
+
? "Er is geen voorraad gevonden in deze omgeving."
|
|
100
|
+
: "Er staan nog geen artikelen in de voorraad." })) : (_jsxs(_Fragment, { children: [_jsx("p", { className: "text-sm font-medium", children: "Nog geen assortiment beschikbaar" }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Er staan nog geen handelsartikelen uit Floriday klaar voor deze klant." })] }))] }) }));
|
|
98
101
|
}
|
|
99
|
-
return (_jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground", children: [_jsxs("span", { children: [_jsx("strong", { className: "text-foreground", children: ownCount }), " geselecteerd assortiment"] }), _jsxs("span", { children: [_jsx("strong", { className: "text-foreground", children: data?.summary.total ?? 0 }), " artikelen in ons aanbod"] }), _jsxs("span", { children: [_jsx("strong", { className: "text-foreground", children: data?.summary.priced ?? 0 }), " met klantprijs"] }), pg ? (_jsxs("span", { children: ["Prijsgroep: ", _jsx("strong", { className: "text-foreground", children: pg.name }), pg.pricing_mode === "calculated" && pg.calc_value
|
|
102
|
+
return (_jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground", children: [_jsx("span", { className: "font-medium text-foreground", children: bronLabel }), _jsxs("span", { children: [_jsx("strong", { className: "text-foreground", children: ownCount }), " geselecteerd assortiment"] }), _jsxs("span", { children: [_jsx("strong", { className: "text-foreground", children: data?.summary.total ?? 0 }), " artikelen in ons aanbod"] }), _jsxs("span", { children: [_jsx("strong", { className: "text-foreground", children: data?.summary.priced ?? 0 }), " met klantprijs"] }), pg ? (_jsxs("span", { children: ["Prijsgroep: ", _jsx("strong", { className: "text-foreground", children: pg.name }), pg.pricing_mode === "calculated" && pg.calc_value
|
|
100
103
|
? ` (${pg.calc_type === "surcharge" ? "toeslag" : "korting"} ${pg.calc_value}${pg.calc_value_type === "percentage" ? "%" : ` ${currency}`})`
|
|
101
104
|
: ""] })) : (_jsx("span", { className: "text-warning-soft-foreground", children: "Geen prijsgroep ingesteld voor deze klant" })), data?.summary.last_synced_at && (_jsxs("span", { children: ["laatste sync: ", formatDateTime(data.summary.last_synced_at)] }))] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2 text-xs text-muted-foreground", children: [_jsxs("span", { children: ["Stickerformaat:", " ", _jsx("strong", { className: "text-foreground", children: defaultFormat
|
|
102
105
|
? `${defaultFormat.width_mm} × ${defaultFormat.height_mm} mm`
|