randmarcomps 1.269.0 → 1.271.0
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/randmarcomps.js +152 -191
- package/dist/randmarcomps.umd.cjs +9 -9
- package/package.json +1 -1
package/dist/randmarcomps.js
CHANGED
|
@@ -3937,6 +3937,10 @@ const fromTheme = (t) => {
|
|
|
3937
3937
|
function cn(...t) {
|
|
3938
3938
|
return twMerge(clsx(t));
|
|
3939
3939
|
}
|
|
3940
|
+
const formatNumber = (t) => new Intl.NumberFormat("en-CA").format(t), formatMoney = (t) => new Intl.NumberFormat("en-CA", {
|
|
3941
|
+
style: "currency",
|
|
3942
|
+
currency: "CAD"
|
|
3943
|
+
}).format(t);
|
|
3940
3944
|
function InputOTP({
|
|
3941
3945
|
className: t,
|
|
3942
3946
|
containerClassName: e,
|
|
@@ -8300,15 +8304,15 @@ function ProductInventoryGrid({ inventory: t, showBinLocation: e }) {
|
|
|
8300
8304
|
const n = (V, q, z = !1, Q = !0) => /* @__PURE__ */ jsxs("div", { className: `p-3 text-sm ${Q && q > 0 ? "border-t" : ""} ${z ? "border-r" : ""}`, children: [
|
|
8301
8305
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-between font-medium", children: [
|
|
8302
8306
|
/* @__PURE__ */ jsx("span", { children: V.Name }),
|
|
8303
|
-
/* @__PURE__ */ jsx("span", { children: V.AvailableQuantity })
|
|
8307
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(V.AvailableQuantity ?? 0) })
|
|
8304
8308
|
] }),
|
|
8305
8309
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-between mt-1 text-xs text-gray-600", children: [
|
|
8306
8310
|
/* @__PURE__ */ jsx("span", { children: "Expecting" }),
|
|
8307
|
-
/* @__PURE__ */ jsx("span", { children: V.PurchaseOrderQuantity
|
|
8311
|
+
/* @__PURE__ */ jsx("span", { children: V.PurchaseOrderQuantity ? formatNumber(V.PurchaseOrderQuantity) : "—" })
|
|
8308
8312
|
] }),
|
|
8309
8313
|
e && /* @__PURE__ */ jsxs("div", { className: "flex justify-between mt-1 text-xs text-gray-600", children: [
|
|
8310
8314
|
/* @__PURE__ */ jsx("span", { children: "Bin Location" }),
|
|
8311
|
-
/* @__PURE__ */ jsx("span", { children: V.BinLocation || "
|
|
8315
|
+
/* @__PURE__ */ jsx("span", { children: V.BinLocation || "—" })
|
|
8312
8316
|
] })
|
|
8313
8317
|
] }, `warehouse-${V.WarehouseId}`), o = ["MTL", "TOR"], l = ["VAN", "EDM"], d = [...t].sort((V, q) => (V.Name || "").localeCompare(q.Name || "")), f = d.filter((V) => V.Country === "US"), g = d.filter((V) => V.Country === "CA"), b = d.filter((V) => l.includes(V.WarehouseId || "")), S = d.filter((V) => o.includes(V.WarehouseId || "")), _ = g.filter(
|
|
8314
8318
|
(V) => !o.includes(V.WarehouseId || "") && !l.includes(V.WarehouseId || "")
|
|
@@ -8325,7 +8329,7 @@ function ProductInventoryGrid({ inventory: t, showBinLocation: e }) {
|
|
|
8325
8329
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 border-b bg-gray-50", children: [
|
|
8326
8330
|
/* @__PURE__ */ jsxs("div", { className: "p-3 font-semibold text-sm flex justify-between", children: [
|
|
8327
8331
|
/* @__PURE__ */ jsx("span", { children: "Canada" }),
|
|
8328
|
-
/* @__PURE__ */ jsx("span", { children: E })
|
|
8332
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(E) })
|
|
8329
8333
|
] }),
|
|
8330
8334
|
/* @__PURE__ */ jsx("div", { className: "p-3" })
|
|
8331
8335
|
] }),
|
|
@@ -8333,14 +8337,14 @@ function ProductInventoryGrid({ inventory: t, showBinLocation: e }) {
|
|
|
8333
8337
|
/* @__PURE__ */ jsxs("div", { className: "border-r", children: [
|
|
8334
8338
|
/* @__PURE__ */ jsxs("div", { className: "p-3 font-semibold text-sm flex justify-between", children: [
|
|
8335
8339
|
/* @__PURE__ */ jsx("span", { children: "West" }),
|
|
8336
|
-
/* @__PURE__ */ jsx("span", { children: A })
|
|
8340
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(A) })
|
|
8337
8341
|
] }),
|
|
8338
8342
|
b.map((V, q) => n(V, q))
|
|
8339
8343
|
] }),
|
|
8340
8344
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
8341
8345
|
/* @__PURE__ */ jsxs("div", { className: "p-3 font-semibold text-sm flex justify-between", children: [
|
|
8342
8346
|
/* @__PURE__ */ jsx("span", { children: "East" }),
|
|
8343
|
-
/* @__PURE__ */ jsx("span", { children: R })
|
|
8347
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(R) })
|
|
8344
8348
|
] }),
|
|
8345
8349
|
S.map((V, q) => n(V, q))
|
|
8346
8350
|
] })
|
|
@@ -8356,7 +8360,7 @@ function ProductInventoryGrid({ inventory: t, showBinLocation: e }) {
|
|
|
8356
8360
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 border-t bg-gray-50", children: [
|
|
8357
8361
|
/* @__PURE__ */ jsxs("div", { className: "p-3 font-semibold text-sm flex justify-between", children: [
|
|
8358
8362
|
/* @__PURE__ */ jsx("span", { children: "United States" }),
|
|
8359
|
-
/* @__PURE__ */ jsx("span", { children: I })
|
|
8363
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(I) })
|
|
8360
8364
|
] }),
|
|
8361
8365
|
/* @__PURE__ */ jsx("div", { className: "p-3" })
|
|
8362
8366
|
] }),
|
|
@@ -60303,7 +60307,7 @@ function ManufacturerCard({
|
|
|
60303
60307
|
mainAction: l,
|
|
60304
60308
|
loading: d = !1
|
|
60305
60309
|
}) {
|
|
60306
|
-
var R, A
|
|
60310
|
+
var E, R, A;
|
|
60307
60311
|
if (d || !t)
|
|
60308
60312
|
return /* @__PURE__ */ jsxs(Card, { className: "flex flex-col h-full", children: [
|
|
60309
60313
|
/* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-start justify-between space-y-0 pb-2 pt-4", children: [
|
|
@@ -60344,14 +60348,9 @@ function ManufacturerCard({
|
|
|
60344
60348
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-40" })
|
|
60345
60349
|
] })
|
|
60346
60350
|
] });
|
|
60347
|
-
const f = t.ManufacturerId || "N/A", g = [t.City, t.Province, t.Country].filter(Boolean), b = g.length > 0 ? g.join(", ") : "", S = ((
|
|
60348
|
-
|
|
60349
|
-
|
|
60350
|
-
minimumFractionDigits: 0,
|
|
60351
|
-
maximumFractionDigits: 0
|
|
60352
|
-
}).format(M), E = ((M) => !M || M.length === 0 ? [] : [...M].sort((V, q) => (V.Day || 0) - (q.Day || 0)).map((V) => ({
|
|
60353
|
-
date: V.Day || 0,
|
|
60354
|
-
amount: V.ExtendedPrice || 0
|
|
60351
|
+
const f = t.ManufacturerId || "N/A", g = [t.City, t.Province, t.Country].filter(Boolean), b = g.length > 0 ? g.join(", ") : "", S = ((E = t.Tags) == null ? void 0 : E.split(",").map((I) => I.trim()).filter(Boolean)) || [], C = ((I) => !I || I.length === 0 ? [] : [...I].sort((M, V) => (M.Day || 0) - (V.Day || 0)).map((M) => ({
|
|
60352
|
+
date: M.Day || 0,
|
|
60353
|
+
amount: M.ExtendedPrice || 0
|
|
60355
60354
|
})))(t.SalesStatistics);
|
|
60356
60355
|
return /* @__PURE__ */ jsxs(Card, { className: "manufacturer-theme flex flex-col h-full", children: [
|
|
60357
60356
|
/* @__PURE__ */ jsx(Link, { to: e ?? "#", target: e && n ? "_blank" : "_self", children: /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-start justify-between space-y-0 pb-2 pt-4", children: [
|
|
@@ -60368,18 +60367,18 @@ function ManufacturerCard({
|
|
|
60368
60367
|
b && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: b })
|
|
60369
60368
|
] })
|
|
60370
60369
|
] }),
|
|
60371
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-col items-end gap-2", children:
|
|
60370
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col items-end gap-2", children: C.length > 0 && /* @__PURE__ */ jsx("div", { className: "h-16 w-24", children: /* @__PURE__ */ jsx(AreaChart, { data: C, height: 60, size: "mini" }) }) })
|
|
60372
60371
|
] }) }),
|
|
60373
60372
|
/* @__PURE__ */ jsx(CardContent, { className: "pb-2 flex-grow", children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
|
|
60374
60373
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 space-y-2", children: [
|
|
60375
|
-
(!!((
|
|
60374
|
+
(!!((R = t.Qualification) != null && R.QualificationId) && ((A = t.Qualification) == null ? void 0 : A.QualificationId) !== "Suspended" || !!t.OpenToWork || S.length > 0) && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2", children: [
|
|
60376
60375
|
/* @__PURE__ */ jsx(QualificationBadge, { qualification: t.Qualification ?? {} }),
|
|
60377
60376
|
!!t.OpenToWork && /* @__PURE__ */ jsxs(Badge, { variant: "success", children: [
|
|
60378
60377
|
/* @__PURE__ */ jsx(HardHat, { className: "h-3 w-3 mr-1" }),
|
|
60379
60378
|
"Open To Work"
|
|
60380
60379
|
] }),
|
|
60381
60380
|
!!t.OnHold && t.OnHold !== 0 && /* @__PURE__ */ jsx(Badge, { variant: "warning", children: "On Hold" }),
|
|
60382
|
-
S.map((
|
|
60381
|
+
S.map((I, M) => /* @__PURE__ */ jsx(Badge, { variant: "outline", children: I }, M))
|
|
60383
60382
|
] }),
|
|
60384
60383
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1 pt-2", children: [
|
|
60385
60384
|
t.Phone && /* @__PURE__ */ jsxs(
|
|
@@ -60426,11 +60425,11 @@ function ManufacturerCard({
|
|
|
60426
60425
|
] }),
|
|
60427
60426
|
t.SalesData && /* @__PURE__ */ jsxs("div", { className: "border-l pl-2 ml-2 flex flex-col text-sm", children: [
|
|
60428
60427
|
/* @__PURE__ */ jsx("strong", { className: "", children: "YTD" }),
|
|
60429
|
-
/* @__PURE__ */ jsx("p", { children:
|
|
60428
|
+
/* @__PURE__ */ jsx("p", { children: t.SalesData.SalesYearToDay ? formatMoney(t.SalesData.SalesYearToDay) : "—" }),
|
|
60430
60429
|
/* @__PURE__ */ jsx("strong", { className: "mt-2", children: "3 mo." }),
|
|
60431
|
-
/* @__PURE__ */ jsx("p", { children:
|
|
60430
|
+
/* @__PURE__ */ jsx("p", { children: t.SalesData.SalesLast3Months ? formatMoney(t.SalesData.SalesLast3Months) : "—" }),
|
|
60432
60431
|
/* @__PURE__ */ jsx("strong", { className: "mt-2", children: "30 days" }),
|
|
60433
|
-
/* @__PURE__ */ jsx("p", { children:
|
|
60432
|
+
/* @__PURE__ */ jsx("p", { children: t.SalesData.SalesLast30Days ? formatMoney(t.SalesData.SalesLast30Days) : "—" })
|
|
60434
60433
|
] })
|
|
60435
60434
|
] }) }),
|
|
60436
60435
|
(o || l) && /* @__PURE__ */ jsxs(CardFooter, { className: "flex pt-2 gap-2 justify-between mt-auto", children: [
|
|
@@ -60445,13 +60444,7 @@ function ResellerCard({
|
|
|
60445
60444
|
actions: n,
|
|
60446
60445
|
loading: o = !1
|
|
60447
60446
|
}) {
|
|
60448
|
-
var
|
|
60449
|
-
const l = (_) => _ === void 0 ? "n/a" : new Intl.NumberFormat("en-CA", {
|
|
60450
|
-
style: "currency",
|
|
60451
|
-
currency: "CAD",
|
|
60452
|
-
minimumFractionDigits: 0,
|
|
60453
|
-
maximumFractionDigits: 0
|
|
60454
|
-
}).format(_);
|
|
60447
|
+
var g, b;
|
|
60455
60448
|
if (o || !t)
|
|
60456
60449
|
return /* @__PURE__ */ jsxs(Card, { className: "flex flex-col h-full", children: [
|
|
60457
60450
|
/* @__PURE__ */ jsx(CardHeader, { className: "flex flex-row items-start justify-between space-y-0 pb-2 pt-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
@@ -60489,7 +60482,7 @@ function ResellerCard({
|
|
|
60489
60482
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-40" })
|
|
60490
60483
|
] })
|
|
60491
60484
|
] });
|
|
60492
|
-
const
|
|
60485
|
+
const l = t.ResellerId || "N/A", d = [t.City, t.Province, t.Country].filter(Boolean), f = d.length > 0 ? d.join(", ") : "Location not provided";
|
|
60493
60486
|
return /* @__PURE__ */ jsxs(Card, { className: "reseller-theme flex flex-col h-full", children: [
|
|
60494
60487
|
/* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-start justify-between space-y-0 pb-2 pt-4", children: [
|
|
60495
60488
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
@@ -60498,18 +60491,18 @@ function ResellerCard({
|
|
|
60498
60491
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
60499
60492
|
/* @__PURE__ */ jsx("span", { className: "text-xs text-primary", children: "Reseller" }),
|
|
60500
60493
|
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "|" }),
|
|
60501
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children:
|
|
60494
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: l })
|
|
60502
60495
|
] }),
|
|
60503
60496
|
/* @__PURE__ */ jsx("h3", { className: "font-semibold", children: t.PublicName || "N/A" }),
|
|
60504
60497
|
t.Name && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t.Name }),
|
|
60505
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
60498
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: f })
|
|
60506
60499
|
] })
|
|
60507
60500
|
] }),
|
|
60508
60501
|
!!t.OnHold && t.OnHold !== 0 && /* @__PURE__ */ jsx(Badge, { variant: "warning", children: "On Hold" })
|
|
60509
60502
|
] }),
|
|
60510
60503
|
/* @__PURE__ */ jsx(CardContent, { className: "pb-2 flex-grow", children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
|
|
60511
60504
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 space-y-2", children: [
|
|
60512
|
-
!!((
|
|
60505
|
+
!!((g = t.Qualification) != null && g.QualificationId) && ((b = t.Qualification) == null ? void 0 : b.QualificationId) !== "Suspended" && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: /* @__PURE__ */ jsx(
|
|
60513
60506
|
QualificationBadge,
|
|
60514
60507
|
{
|
|
60515
60508
|
qualification: t.Qualification ?? {}
|
|
@@ -60560,11 +60553,11 @@ function ResellerCard({
|
|
|
60560
60553
|
] }),
|
|
60561
60554
|
(t == null ? void 0 : t.SalesData) && /* @__PURE__ */ jsxs("div", { className: "border-l pl-2 ml-2 flex flex-col text-sm", children: [
|
|
60562
60555
|
/* @__PURE__ */ jsx("strong", { className: "", children: "YTD" }),
|
|
60563
|
-
/* @__PURE__ */ jsx("p", { children:
|
|
60556
|
+
/* @__PURE__ */ jsx("p", { children: t != null && t.SalesData.SalesYearToDay ? formatMoney(t == null ? void 0 : t.SalesData.SalesYearToDay) : "—" }),
|
|
60564
60557
|
/* @__PURE__ */ jsx("strong", { className: "mt-2", children: "3 mo." }),
|
|
60565
|
-
/* @__PURE__ */ jsx("p", { children:
|
|
60558
|
+
/* @__PURE__ */ jsx("p", { children: t != null && t.SalesData.SalesLast3Months ? formatMoney(t == null ? void 0 : t.SalesData.SalesLast3Months) : "—" }),
|
|
60566
60559
|
/* @__PURE__ */ jsx("strong", { className: "mt-2", children: "30 days" }),
|
|
60567
|
-
/* @__PURE__ */ jsx("p", { children:
|
|
60560
|
+
/* @__PURE__ */ jsx("p", { children: t != null && t.SalesData.SalesLast30Days ? formatMoney(t == null ? void 0 : t.SalesData.SalesLast30Days) : "—" })
|
|
60568
60561
|
] })
|
|
60569
60562
|
] }) }),
|
|
60570
60563
|
(n || e) && /* @__PURE__ */ jsxs(CardFooter, { className: `flex pt-2 gap-2 mt-auto ${n ? "justify-between" : "justify-end"}`, children: [
|
|
@@ -60713,12 +60706,7 @@ const Topbar = forwardRef(
|
|
|
60713
60706
|
);
|
|
60714
60707
|
Topbar.displayName = "Topbar";
|
|
60715
60708
|
function ActiveOrdersCard({ orders: t, loading: e = !1 }) {
|
|
60716
|
-
const n = (
|
|
60717
|
-
style: "currency",
|
|
60718
|
-
currency: "CAD",
|
|
60719
|
-
minimumFractionDigits: 2,
|
|
60720
|
-
maximumFractionDigits: 2
|
|
60721
|
-
}).format(d), o = useMemo(() => {
|
|
60709
|
+
const n = useMemo(() => {
|
|
60722
60710
|
if (!t || t.length === 0)
|
|
60723
60711
|
return {
|
|
60724
60712
|
all: { orders: 0, amount: 0 },
|
|
@@ -60726,50 +60714,50 @@ function ActiveOrdersCard({ orders: t, loading: e = !1 }) {
|
|
|
60726
60714
|
shipped: { orders: 0, amount: 0 },
|
|
60727
60715
|
delayed: { orders: 0, amount: 0 }
|
|
60728
60716
|
};
|
|
60729
|
-
const
|
|
60717
|
+
const l = t.filter((M) => M.DocumentType === "Order"), d = t.filter((M) => M.DocumentType === "Shipment"), f = l.filter((M) => M.WarehouseCode !== "3PLE"), g = f.reduce((M, V) => M + (V.Quantity || 0), 0), b = f.reduce((M, V) => M + (V.ExtendedPrice || 0), 0), S = l.filter((M) => M.WarehouseCode === "3PLE"), _ = S.reduce((M, V) => M + (V.Quantity || 0), 0), C = S.reduce((M, V) => M + (V.ExtendedPrice || 0), 0), E = d.length, R = d.reduce((M, V) => M + (V.ExtendedPrice || 0), 0), A = g + _ + E, I = b + C + R;
|
|
60730
60718
|
return {
|
|
60731
|
-
all: { orders:
|
|
60732
|
-
processing: { orders:
|
|
60733
|
-
shipped: { orders:
|
|
60734
|
-
delayed: { orders:
|
|
60719
|
+
all: { orders: A, amount: I },
|
|
60720
|
+
processing: { orders: g, amount: b },
|
|
60721
|
+
shipped: { orders: E, amount: R },
|
|
60722
|
+
delayed: { orders: _, amount: C }
|
|
60735
60723
|
};
|
|
60736
|
-
}, [t]),
|
|
60724
|
+
}, [t]), o = [
|
|
60737
60725
|
{
|
|
60738
60726
|
name: "All",
|
|
60739
60727
|
icon: Package,
|
|
60740
60728
|
color: "bg-blue-500",
|
|
60741
60729
|
textColor: "text-blue-600",
|
|
60742
|
-
orders:
|
|
60743
|
-
amount:
|
|
60730
|
+
orders: n.all.orders,
|
|
60731
|
+
amount: n.all.amount
|
|
60744
60732
|
},
|
|
60745
60733
|
{
|
|
60746
60734
|
name: "Processing",
|
|
60747
60735
|
icon: RefreshCcw,
|
|
60748
60736
|
color: "bg-yellow-500",
|
|
60749
60737
|
textColor: "text-yellow-600",
|
|
60750
|
-
orders:
|
|
60751
|
-
amount:
|
|
60738
|
+
orders: n.processing.orders,
|
|
60739
|
+
amount: n.processing.amount
|
|
60752
60740
|
},
|
|
60753
60741
|
{
|
|
60754
60742
|
name: "Shipped",
|
|
60755
60743
|
icon: Truck,
|
|
60756
60744
|
color: "bg-green-500",
|
|
60757
60745
|
textColor: "text-green-600",
|
|
60758
|
-
orders:
|
|
60759
|
-
amount:
|
|
60746
|
+
orders: n.shipped.orders,
|
|
60747
|
+
amount: n.shipped.amount
|
|
60760
60748
|
},
|
|
60761
60749
|
{
|
|
60762
60750
|
name: "Delayed",
|
|
60763
60751
|
icon: CircleAlert,
|
|
60764
60752
|
color: "bg-red-500",
|
|
60765
60753
|
textColor: "text-red-600",
|
|
60766
|
-
orders:
|
|
60767
|
-
amount:
|
|
60754
|
+
orders: n.delayed.orders,
|
|
60755
|
+
amount: n.delayed.amount
|
|
60768
60756
|
}
|
|
60769
60757
|
];
|
|
60770
60758
|
return e ? /* @__PURE__ */ jsxs(Card, { children: [
|
|
60771
60759
|
/* @__PURE__ */ jsx(CardHeader, { className: "pb-0", children: /* @__PURE__ */ jsx(CardTitle, { className: "text-lg font-bold", children: "Active Orders" }) }),
|
|
60772
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 @sm:grid-cols-2 gap-4 p-4", children: [1, 2, 3, 4].map((
|
|
60760
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 @sm:grid-cols-2 gap-4 p-4", children: [1, 2, 3, 4].map((l) => /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-md border", children: [
|
|
60773
60761
|
/* @__PURE__ */ jsx("div", { className: "bg-slate-200 dark:bg-slate-700 h-[3px]" }),
|
|
60774
60762
|
/* @__PURE__ */ jsxs("div", { className: "p-6 border border-t-0", children: [
|
|
60775
60763
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center mb-4", children: [
|
|
@@ -60787,28 +60775,28 @@ function ActiveOrdersCard({ orders: t, loading: e = !1 }) {
|
|
|
60787
60775
|
] })
|
|
60788
60776
|
] })
|
|
60789
60777
|
] })
|
|
60790
|
-
] },
|
|
60778
|
+
] }, l)) })
|
|
60791
60779
|
] }) : /* @__PURE__ */ jsxs(Card, { children: [
|
|
60792
60780
|
/* @__PURE__ */ jsx(CardHeader, { className: "pb-0", children: /* @__PURE__ */ jsx(CardTitle, { className: "text-lg font-bold", children: "Active Orders" }) }),
|
|
60793
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 @sm:grid-cols-2 gap-4 p-4", children:
|
|
60794
|
-
/* @__PURE__ */ jsx("div", { className: `${
|
|
60781
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 @sm:grid-cols-2 gap-4 p-4", children: o.map((l) => /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-md border", children: [
|
|
60782
|
+
/* @__PURE__ */ jsx("div", { className: `${l.color} bg-opacity-60 h-[3px]` }),
|
|
60795
60783
|
/* @__PURE__ */ jsxs("div", { className: "p-6 border border-t-0", children: [
|
|
60796
60784
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center mb-4", children: [
|
|
60797
|
-
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-base", children:
|
|
60798
|
-
/* @__PURE__ */ jsx("div", { className: `${
|
|
60785
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-base", children: l.name }),
|
|
60786
|
+
/* @__PURE__ */ jsx("div", { className: `${l.color} bg-opacity-90 p-2 rounded-full`, children: /* @__PURE__ */ jsx(l.icon, { className: "size-4 shrink-0 text-white" }) })
|
|
60799
60787
|
] }),
|
|
60800
60788
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start", children: [
|
|
60801
60789
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
60802
60790
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Total Orders" }),
|
|
60803
|
-
/* @__PURE__ */ jsx("p", { className: "text-xl font-bold", children:
|
|
60791
|
+
/* @__PURE__ */ jsx("p", { className: "text-xl font-bold", children: l.orders })
|
|
60804
60792
|
] }),
|
|
60805
60793
|
/* @__PURE__ */ jsxs("div", { className: "text-end", children: [
|
|
60806
60794
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Total Amount" }),
|
|
60807
|
-
/* @__PURE__ */ jsx("p", { className: "text-base font-semibold", children:
|
|
60795
|
+
/* @__PURE__ */ jsx("p", { className: "text-base font-semibold", children: formatMoney(l.amount) })
|
|
60808
60796
|
] })
|
|
60809
60797
|
] })
|
|
60810
60798
|
] })
|
|
60811
|
-
] },
|
|
60799
|
+
] }, l.name)) })
|
|
60812
60800
|
] });
|
|
60813
60801
|
}
|
|
60814
60802
|
var __create = Object.create, __getProtoOf = Object.getPrototypeOf, __defProp = Object.defineProperty, __getOwnPropNames = Object.getOwnPropertyNames, __hasOwnProp = Object.prototype.hasOwnProperty, __toESM = (t, e, n) => {
|
|
@@ -67090,20 +67078,28 @@ function ProductCard({
|
|
|
67090
67078
|
] }),
|
|
67091
67079
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
67092
67080
|
/* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "Unit Weight" }),
|
|
67093
|
-
/* @__PURE__ */ jsx("div", { className: "font-medium", children: e.UnitWeight ? `${e.UnitWeight} lbs` : "N/A" })
|
|
67081
|
+
/* @__PURE__ */ jsx("div", { className: "font-medium", children: e.UnitWeight ? `${formatNumber(e.UnitWeight)} lbs` : "N/A" })
|
|
67094
67082
|
] }),
|
|
67095
67083
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
67096
|
-
/* @__PURE__ */
|
|
67097
|
-
|
|
67084
|
+
/* @__PURE__ */ jsxs("div", { className: "text-sm text-muted-foreground", children: [
|
|
67085
|
+
"MAP",
|
|
67086
|
+
/* @__PURE__ */ jsx("span", { className: "text-primary", children: " / " }),
|
|
67087
|
+
"MSRP"
|
|
67088
|
+
] }),
|
|
67089
|
+
/* @__PURE__ */ jsxs("div", { className: "font-medium", children: [
|
|
67090
|
+
e.MAP ? formatMoney(e.MAP) : "N/A",
|
|
67091
|
+
/* @__PURE__ */ jsx("span", { className: "text-primary", children: " / " }),
|
|
67092
|
+
e.MSRP ? formatMoney(e.MSRP) : "N/A"
|
|
67093
|
+
] })
|
|
67098
67094
|
] }),
|
|
67099
|
-
e.OverallPercentileRank && e.ManufacturerPercentileRank && /* @__PURE__ */ jsxs("div", { children: [
|
|
67095
|
+
!!e.OverallPercentileRank && !!e.ManufacturerPercentileRank && /* @__PURE__ */ jsxs("div", { children: [
|
|
67100
67096
|
/* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "Percentile" }),
|
|
67101
67097
|
/* @__PURE__ */ jsxs("div", { className: `font-medium flex products-center ${e.OverallPercentileRank >= 80 ? "text-green-700" : ""}`, children: [
|
|
67102
|
-
Math.round(e.OverallPercentileRank),
|
|
67098
|
+
formatNumber(Math.round(e.OverallPercentileRank)),
|
|
67103
67099
|
" Overall"
|
|
67104
67100
|
] }),
|
|
67105
67101
|
/* @__PURE__ */ jsxs("div", { className: "font-light flex products-center text-sm", children: [
|
|
67106
|
-
Math.round(e.ManufacturerPercentileRank),
|
|
67102
|
+
formatNumber(Math.round(e.ManufacturerPercentileRank)),
|
|
67107
67103
|
" with Manufacturer"
|
|
67108
67104
|
] })
|
|
67109
67105
|
] }),
|
|
@@ -67121,45 +67117,39 @@ function ProductCard({
|
|
|
67121
67117
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-6 mt-4", children: [
|
|
67122
67118
|
/* @__PURE__ */ jsx("div", { className: "flex flex-1", children: qe && e.Distribution && /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
67123
67119
|
/* @__PURE__ */ jsx("div", { className: "flex products-center", children: "You have " + Le.length + (Le.length > 1 ? " opportunities" : " opportunity") + " for this product:" }),
|
|
67124
|
-
/* @__PURE__ */ jsx("div", { className: "space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1", children: Le.map((Qe, dt) =>
|
|
67125
|
-
|
|
67126
|
-
|
|
67127
|
-
|
|
67128
|
-
{
|
|
67129
|
-
className: `flex justify-between products-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted
|
|
67120
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1", children: Le.map((Qe, dt) => /* @__PURE__ */ jsxs(
|
|
67121
|
+
"div",
|
|
67122
|
+
{
|
|
67123
|
+
className: `flex justify-between products-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted
|
|
67130
67124
|
${Qe.BidNumber == (R == null ? void 0 : R.BidNumber) ? "cursor-pointer border-2 border-purple-900" : Oe(Qe) ? "hover:bg-purple-200 cursor-pointer" : "!bg-neutral-50"}
|
|
67131
67125
|
`,
|
|
67132
|
-
|
|
67133
|
-
|
|
67134
|
-
},
|
|
67135
|
-
children: [
|
|
67136
|
-
/* @__PURE__ */ jsx("div", { className: "flex products-center", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
67137
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: Qe.Opportunity }),
|
|
67138
|
-
/* @__PURE__ */ jsxs("span", { className: "text-xs text-neutral-900", children: [
|
|
67139
|
-
Qe.BidNumber,
|
|
67140
|
-
" ",
|
|
67141
|
-
!Oe(Qe) && /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-xs mx-1 h-5 bg-gray-100", children: "Currently unavailable" })
|
|
67142
|
-
] })
|
|
67143
|
-
] }) }),
|
|
67144
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col products-end", children: [
|
|
67145
|
-
/* @__PURE__ */ jsxs("span", { className: "font-semibold", children: [
|
|
67146
|
-
"$",
|
|
67147
|
-
(pt = Qe.Price) == null ? void 0 : pt.toFixed(2)
|
|
67148
|
-
] }),
|
|
67149
|
-
Qe.Rebate && Qe.Rebate > 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-green-600", children: [
|
|
67150
|
-
"Rebate: $",
|
|
67151
|
-
Qe.Rebate.toFixed(2)
|
|
67152
|
-
] }),
|
|
67153
|
-
Qe.EndDate && /* @__PURE__ */ jsxs("span", { className: "text-xs text-neutral-600", children: [
|
|
67154
|
-
"Ends: ",
|
|
67155
|
-
Ze(Qe.EndDate)
|
|
67156
|
-
] })
|
|
67157
|
-
] })
|
|
67158
|
-
]
|
|
67126
|
+
onClick: () => {
|
|
67127
|
+
Oe(Qe) && A(Qe.BidNumber != (R == null ? void 0 : R.BidNumber) ? Qe : null);
|
|
67159
67128
|
},
|
|
67160
|
-
|
|
67161
|
-
|
|
67162
|
-
|
|
67129
|
+
children: [
|
|
67130
|
+
/* @__PURE__ */ jsx("div", { className: "flex products-center", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
67131
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: Qe.Opportunity }),
|
|
67132
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs text-neutral-900", children: [
|
|
67133
|
+
Qe.BidNumber,
|
|
67134
|
+
" ",
|
|
67135
|
+
!Oe(Qe) && /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-xs mx-1 h-5 bg-gray-100", children: "Currently unavailable" })
|
|
67136
|
+
] })
|
|
67137
|
+
] }) }),
|
|
67138
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col products-end", children: [
|
|
67139
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: formatMoney(Qe.Price ?? 0) }),
|
|
67140
|
+
Qe.Rebate && Qe.Rebate > 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-green-600", children: [
|
|
67141
|
+
"Rebate: ",
|
|
67142
|
+
formatMoney(Qe.Rebate)
|
|
67143
|
+
] }),
|
|
67144
|
+
Qe.EndDate && /* @__PURE__ */ jsxs("span", { className: "text-xs text-neutral-600", children: [
|
|
67145
|
+
"Ends: ",
|
|
67146
|
+
Ze(Qe.EndDate)
|
|
67147
|
+
] })
|
|
67148
|
+
] })
|
|
67149
|
+
]
|
|
67150
|
+
},
|
|
67151
|
+
dt
|
|
67152
|
+
)) })
|
|
67163
67153
|
] }) }),
|
|
67164
67154
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col products-center", children: [
|
|
67165
67155
|
n && /* @__PURE__ */ jsx(Link, { to: n, children: /* @__PURE__ */ jsxs(Button, { variant: "secondary", children: [
|
|
@@ -67193,7 +67183,7 @@ function ProductCard({
|
|
|
67193
67183
|
] }) : et <= 0 && ze > 0 ? /* @__PURE__ */ jsxs(Dialog, { open: V, onOpenChange: q, children: [
|
|
67194
67184
|
/* @__PURE__ */ jsx(DialogTrigger, { asChild: !0, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", className: "flex products-center text-sm manufacturer-theme text-primary", children: [
|
|
67195
67185
|
/* @__PURE__ */ jsx(Warehouse, { size: "16", className: "mr-2" }),
|
|
67196
|
-
ze,
|
|
67186
|
+
formatNumber(ze),
|
|
67197
67187
|
" Incoming"
|
|
67198
67188
|
] }) }),
|
|
67199
67189
|
/* @__PURE__ */ jsxs(DialogContent, { className: "max-w-4xl", children: [
|
|
@@ -67212,7 +67202,7 @@ function ProductCard({
|
|
|
67212
67202
|
children: [
|
|
67213
67203
|
/* @__PURE__ */ jsx(Warehouse, { size: "16", className: "mr-2" }),
|
|
67214
67204
|
et > 0 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
67215
|
-
et,
|
|
67205
|
+
formatNumber(et),
|
|
67216
67206
|
" in stock"
|
|
67217
67207
|
] }) : /* @__PURE__ */ jsx(Fragment$1, { children: "Out of stock" })
|
|
67218
67208
|
]
|
|
@@ -67230,20 +67220,12 @@ function ProductCard({
|
|
|
67230
67220
|
] }),
|
|
67231
67221
|
e.Distribution && /* @__PURE__ */ jsxs("div", { className: "flex justify-between products-end mt-4", children: [
|
|
67232
67222
|
/* @__PURE__ */ jsx("div", { className: "flex-shrink-1 flex flex-col products-start gap-1", children: Ae > 0 ? /* @__PURE__ */ jsx("div", { className: "flex products-center", children: /* @__PURE__ */ jsxs("span", { className: "text-2xl font-bold whitespace-nowrap", children: [
|
|
67233
|
-
|
|
67234
|
-
Ae
|
|
67235
|
-
/* @__PURE__ */ jsx("span", { children: " CAD" })
|
|
67223
|
+
"Cost: ",
|
|
67224
|
+
formatMoney(Ae)
|
|
67236
67225
|
] }) }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
67237
67226
|
/* @__PURE__ */ jsxs("div", { className: "flex products-center flex-wrap", children: [
|
|
67238
|
-
/* @__PURE__ */
|
|
67239
|
-
|
|
67240
|
-
R ? (We = (Vt = e.Opportunities) == null ? void 0 : Vt.find((Qe) => Qe.BidNumber == R.BidNumber)) == null ? void 0 : We.Price : je.toFixed(2),
|
|
67241
|
-
/* @__PURE__ */ jsx("span", { children: " CAD" })
|
|
67242
|
-
] }),
|
|
67243
|
-
I > 0 && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground line-through ml-2 whitespace-nowrap", children: [
|
|
67244
|
-
"$",
|
|
67245
|
-
Ve.toFixed(2)
|
|
67246
|
-
] })
|
|
67227
|
+
/* @__PURE__ */ jsx("span", { className: "text-2xl font-bold whitespace-nowrap", children: formatMoney((R ? (We = (Vt = e.Opportunities) == null ? void 0 : Vt.find((Qe) => Qe.BidNumber == R.BidNumber)) == null ? void 0 : We.Price : je) ?? 0) }),
|
|
67228
|
+
I > 0 && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground line-through ml-2 whitespace-nowrap", children: formatMoney(Ve) })
|
|
67247
67229
|
] }),
|
|
67248
67230
|
I > 0 && /* @__PURE__ */ jsx("div", { className: "flex products-center", children: /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "bg-red-50 text-red-700 rounded-full px-3 whitespace-nowrap", children: [
|
|
67249
67231
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
@@ -69971,34 +69953,29 @@ function ResellerBillingOverviewSkeleton() {
|
|
|
69971
69953
|
] });
|
|
69972
69954
|
}
|
|
69973
69955
|
function ResellerBillingOverviewData({ reseller: t, actions: e }) {
|
|
69974
|
-
const n =
|
|
69975
|
-
style: "currency",
|
|
69976
|
-
currency: "CAD",
|
|
69977
|
-
minimumFractionDigits: 2,
|
|
69978
|
-
maximumFractionDigits: 2
|
|
69979
|
-
}).format(f), o = t.Statement || {}, l = [
|
|
69956
|
+
const n = t.Statement || {}, o = [
|
|
69980
69957
|
{
|
|
69981
69958
|
title: "0 - 30 Days",
|
|
69982
|
-
amount:
|
|
69959
|
+
amount: n.Over0 || 0,
|
|
69983
69960
|
icon: /* @__PURE__ */ jsx(Calendar, { className: "h-5 w-5 text-white" }),
|
|
69984
69961
|
color: "bg-primary"
|
|
69985
69962
|
},
|
|
69986
69963
|
{
|
|
69987
69964
|
title: "31 - 45 Days",
|
|
69988
|
-
amount:
|
|
69965
|
+
amount: n.Over30 || 0,
|
|
69989
69966
|
icon: /* @__PURE__ */ jsx(Calendar, { className: "h-5 w-5 text-white" }),
|
|
69990
69967
|
color: "bg-primary"
|
|
69991
69968
|
},
|
|
69992
69969
|
{
|
|
69993
69970
|
title: "45+ Days",
|
|
69994
|
-
amount:
|
|
69971
|
+
amount: n.Over45 || 0,
|
|
69995
69972
|
icon: /* @__PURE__ */ jsx(Calendar, { className: "h-5 w-5 text-white" }),
|
|
69996
69973
|
color: "bg-primary"
|
|
69997
69974
|
}
|
|
69998
|
-
],
|
|
69975
|
+
], l = [
|
|
69999
69976
|
{
|
|
70000
69977
|
title: "Total",
|
|
70001
|
-
amount:
|
|
69978
|
+
amount: n.Total || 0,
|
|
70002
69979
|
icon: /* @__PURE__ */ jsx(DollarSign, { className: "h-5 w-5 text-white" }),
|
|
70003
69980
|
color: "bg-green-500"
|
|
70004
69981
|
},
|
|
@@ -70013,20 +69990,20 @@ function ResellerBillingOverviewData({ reseller: t, actions: e }) {
|
|
|
70013
69990
|
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Billing Overview" }) }),
|
|
70014
69991
|
/* @__PURE__ */ jsxs(CardContent, { children: [
|
|
70015
69992
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 @md:grid-cols-2 gap-4", children: [
|
|
70016
|
-
/* @__PURE__ */ jsx("div", { className: "space-y-4", children:
|
|
69993
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-4", children: o.map((d, f) => /* @__PURE__ */ jsxs("div", { className: "border rounded-lg p-4", children: [
|
|
70017
69994
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
|
|
70018
|
-
/* @__PURE__ */ jsx("h3", { className: "text-sm sm:text-base font-medium", children:
|
|
70019
|
-
/* @__PURE__ */ jsx("div", { className: `p-2 rounded-full ${
|
|
69995
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm sm:text-base font-medium", children: d.title }),
|
|
69996
|
+
/* @__PURE__ */ jsx("div", { className: `p-2 rounded-full ${d.color}`, children: d.icon })
|
|
70020
69997
|
] }),
|
|
70021
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("p", { className: "text-base sm:text-lg font-bold", children:
|
|
70022
|
-
] },
|
|
70023
|
-
/* @__PURE__ */ jsx("div", { className: "space-y-4", children:
|
|
69998
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("p", { className: "text-base sm:text-lg font-bold", children: formatMoney(d.amount) }) })
|
|
69999
|
+
] }, f)) }),
|
|
70000
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-4", children: l.map((d, f) => /* @__PURE__ */ jsxs("div", { className: "border rounded-lg p-4", children: [
|
|
70024
70001
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
|
|
70025
|
-
/* @__PURE__ */ jsx("h3", { className: "text-sm sm:text-base font-medium", children:
|
|
70026
|
-
/* @__PURE__ */ jsx("div", { className: `p-2 rounded-full ${
|
|
70002
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm sm:text-base font-medium", children: d.title }),
|
|
70003
|
+
/* @__PURE__ */ jsx("div", { className: `p-2 rounded-full ${d.color}`, children: d.icon })
|
|
70027
70004
|
] }),
|
|
70028
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("p", { className: "text-base sm:text-lg font-bold", children:
|
|
70029
|
-
] },
|
|
70005
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("p", { className: "text-base sm:text-lg font-bold", children: formatMoney(d.amount) }) })
|
|
70006
|
+
] }, f)) })
|
|
70030
70007
|
] }),
|
|
70031
70008
|
e && /* @__PURE__ */ jsx("div", { className: "flex justify-end mt-4", children: e })
|
|
70032
70009
|
] })
|
|
@@ -70085,12 +70062,7 @@ function SalesOverviewData({
|
|
|
70085
70062
|
salesData: t,
|
|
70086
70063
|
salesStatistics: e = []
|
|
70087
70064
|
}) {
|
|
70088
|
-
const n =
|
|
70089
|
-
style: "currency",
|
|
70090
|
-
currency: "CAD",
|
|
70091
|
-
minimumFractionDigits: 2,
|
|
70092
|
-
maximumFractionDigits: 2
|
|
70093
|
-
}).format(d), o = [
|
|
70065
|
+
const n = [
|
|
70094
70066
|
{
|
|
70095
70067
|
title: "Last 30 days",
|
|
70096
70068
|
amount: t.SalesLast30Days || 0,
|
|
@@ -70109,41 +70081,41 @@ function SalesOverviewData({
|
|
|
70109
70081
|
icon: /* @__PURE__ */ jsx(Calendar, { className: "h-5 w-5 text-white" }),
|
|
70110
70082
|
color: "bg-emerald-500"
|
|
70111
70083
|
}
|
|
70112
|
-
],
|
|
70113
|
-
const
|
|
70114
|
-
return e.forEach((
|
|
70115
|
-
var
|
|
70116
|
-
const
|
|
70117
|
-
if (
|
|
70118
|
-
const
|
|
70119
|
-
|
|
70120
|
-
const
|
|
70121
|
-
|
|
70122
|
-
}
|
|
70123
|
-
}), Array.from(
|
|
70124
|
-
date: `${
|
|
70125
|
-
amount:
|
|
70084
|
+
], o = useMemo(() => {
|
|
70085
|
+
const l = /* @__PURE__ */ new Map();
|
|
70086
|
+
return e.forEach((d) => {
|
|
70087
|
+
var g;
|
|
70088
|
+
const f = ((g = d.Day) == null ? void 0 : g.toString()) || "";
|
|
70089
|
+
if (f.length === 8) {
|
|
70090
|
+
const b = parseInt(f.substring(0, 4), 10), S = parseInt(f.substring(4, 6), 10) - 1, _ = parseInt(f.substring(6, 8), 10), C = new Date(b, S, _), E = new Date(C), R = C.getDay();
|
|
70091
|
+
E.setDate(C.getDate() - R);
|
|
70092
|
+
const A = `${E.getFullYear()}-${String(E.getMonth() + 1).padStart(2, "0")}-${String(E.getDate()).padStart(2, "0")}`, I = d.ExtendedPrice || 0;
|
|
70093
|
+
l.has(A) ? l.set(A, l.get(A) + I) : l.set(A, I);
|
|
70094
|
+
}
|
|
70095
|
+
}), Array.from(l).sort(([d], [f]) => d.localeCompare(f)).map(([d, f]) => ({
|
|
70096
|
+
date: `${d.substring(5, 7)}/${d.substring(8, 10)}`,
|
|
70097
|
+
amount: f
|
|
70126
70098
|
}));
|
|
70127
70099
|
}, [e]);
|
|
70128
70100
|
return /* @__PURE__ */ jsxs(Card, { children: [
|
|
70129
70101
|
/* @__PURE__ */ jsx(CardHeader, { className: "pb-0", children: /* @__PURE__ */ jsx(CardTitle, { className: "text-lg @sm:text-xl", children: "Sales Overview" }) }),
|
|
70130
70102
|
/* @__PURE__ */ jsxs(CardContent, { className: "pt-4 px-3 @sm:px-6", children: [
|
|
70131
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 @sm:grid-cols-2 @lg:grid-cols-3 gap-4", children:
|
|
70103
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 @sm:grid-cols-2 @lg:grid-cols-3 gap-4", children: n.map((l, d) => /* @__PURE__ */ jsxs("div", { className: "border rounded-lg p-4", children: [
|
|
70132
70104
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center mb-4", children: [
|
|
70133
|
-
/* @__PURE__ */ jsx("h3", { className: "text-sm @sm:text-base font-medium", children:
|
|
70134
|
-
/* @__PURE__ */ jsx("div", { className: `p-2 rounded-full ${
|
|
70105
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm @sm:text-base font-medium", children: l.title }),
|
|
70106
|
+
/* @__PURE__ */ jsx("div", { className: `p-2 rounded-full ${l.color}`, children: l.icon })
|
|
70135
70107
|
] }),
|
|
70136
70108
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
70137
70109
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Total Amount" }),
|
|
70138
|
-
/* @__PURE__ */ jsx("p", { className: "text-base @sm:text-lg font-bold", children:
|
|
70110
|
+
/* @__PURE__ */ jsx("p", { className: "text-base @sm:text-lg font-bold", children: formatMoney(l.amount) })
|
|
70139
70111
|
] })
|
|
70140
|
-
] },
|
|
70112
|
+
] }, d)) }),
|
|
70141
70113
|
/* @__PURE__ */ jsx("div", { className: "mt-6", children: e && e.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
70142
70114
|
/* @__PURE__ */ jsx("h3", { className: "text-sm font-medium mb-4", children: "Sales Trend" }),
|
|
70143
70115
|
/* @__PURE__ */ jsx("div", { className: "space-y-6", children: /* @__PURE__ */ jsx(
|
|
70144
70116
|
AreaChart,
|
|
70145
70117
|
{
|
|
70146
|
-
data:
|
|
70118
|
+
data: o,
|
|
70147
70119
|
units: "$",
|
|
70148
70120
|
unitsPosition: "left",
|
|
70149
70121
|
height: 200
|
|
@@ -74490,7 +74462,7 @@ function ManufacturerCategories({ categories: t, activeCategory: e, onSelectCate
|
|
|
74490
74462
|
variant: e === o.CategoryCode ? "default" : "outline",
|
|
74491
74463
|
size: "sm",
|
|
74492
74464
|
className: "px-3 py-1.5 text-xs whitespace-nowrap rounded-full",
|
|
74493
|
-
children: o.
|
|
74465
|
+
children: o.QualificationRequired && /* @__PURE__ */ jsx(ShieldCheck, { className: `ml-1 w-5 h-5 ${e !== o.CategoryCode ? "text-red-500" : ""}` })
|
|
74494
74466
|
},
|
|
74495
74467
|
o.CategoryCode
|
|
74496
74468
|
)) }) }) });
|
|
@@ -74584,7 +74556,7 @@ function ManufacturerProducts({
|
|
|
74584
74556
|
] })
|
|
74585
74557
|
] })
|
|
74586
74558
|
] }),
|
|
74587
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 @md:grid-cols-2
|
|
74559
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 @md:grid-cols-2 gap-4 mb-4", children: E || R ? Array.from({ length: 4 }).map((Q, j) => /* @__PURE__ */ jsx(ProductCard, {}, j)) : C != null && C.Products && (C == null ? void 0 : C.Products.length) > 0 ? (z = C == null ? void 0 : C.Products) == null ? void 0 : z.map((Q) => /* @__PURE__ */ jsx(
|
|
74588
74560
|
ProductCard,
|
|
74589
74561
|
{
|
|
74590
74562
|
applicationId: t,
|
|
@@ -74593,7 +74565,7 @@ function ManufacturerProducts({
|
|
|
74593
74565
|
shopifyHostname: n
|
|
74594
74566
|
},
|
|
74595
74567
|
Q.RandmarSKU
|
|
74596
|
-
)) : /* @__PURE__ */ jsxs(Alert, { variant: "warning", children: [
|
|
74568
|
+
)) : /* @__PURE__ */ jsxs(Alert, { variant: "warning", className: "col-span-1 @md:col-span-2", children: [
|
|
74597
74569
|
/* @__PURE__ */ jsx(CircleAlert, { className: "h-4 w-4" }),
|
|
74598
74570
|
/* @__PURE__ */ jsx(AlertTitle, { children: "Warning" }),
|
|
74599
74571
|
/* @__PURE__ */ jsx(AlertDescription, { children: "No products found for this manufacturer category." })
|
|
@@ -75625,11 +75597,7 @@ function ManufacturerInventoryFinanceCard({
|
|
|
75625
75597
|
routeManufacturerId: (t == null ? void 0 : t.ManufacturerId) ?? ""
|
|
75626
75598
|
}, {
|
|
75627
75599
|
skip: !(t != null && t.ManufacturerId)
|
|
75628
|
-
}), d = (t == null ? void 0 : t.DefaultMaxInventoryValue) ?? 0, f = (n || []).reduce((
|
|
75629
|
-
style: "currency",
|
|
75630
|
-
currency: "CAD",
|
|
75631
|
-
minimumFractionDigits: 2
|
|
75632
|
-
}).format(_);
|
|
75600
|
+
}), d = (t == null ? void 0 : t.DefaultMaxInventoryValue) ?? 0, f = (n || []).reduce((S, _) => S + (_.InventoryValue || 0), 0), g = d - f, b = Math.round(f / d * 100);
|
|
75633
75601
|
return e || o || l ? /* @__PURE__ */ jsxs(Card, { children: [
|
|
75634
75602
|
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
75635
75603
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-3/4" }),
|
|
@@ -75670,11 +75638,11 @@ function ManufacturerInventoryFinanceCard({
|
|
|
75670
75638
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
75671
75639
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
75672
75640
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Max Allowance" }),
|
|
75673
|
-
/* @__PURE__ */ jsx("span", { className: "font-bold", children:
|
|
75641
|
+
/* @__PURE__ */ jsx("span", { className: "font-bold", children: formatMoney(d) })
|
|
75674
75642
|
] }),
|
|
75675
75643
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
75676
75644
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Current Funds" }),
|
|
75677
|
-
/* @__PURE__ */ jsx("span", { className: "font-bold", children:
|
|
75645
|
+
/* @__PURE__ */ jsx("span", { className: "font-bold", children: formatMoney(f) })
|
|
75678
75646
|
] }),
|
|
75679
75647
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
75680
75648
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Available Funds" }),
|
|
@@ -75682,7 +75650,7 @@ function ManufacturerInventoryFinanceCard({
|
|
|
75682
75650
|
"span",
|
|
75683
75651
|
{
|
|
75684
75652
|
className: `font-bold ${g >= 0 ? "text-emerald-600 dark:text-emerald-500" : "text-red-600 dark:text-red-500"}`,
|
|
75685
|
-
children:
|
|
75653
|
+
children: formatMoney(g)
|
|
75686
75654
|
}
|
|
75687
75655
|
)
|
|
75688
75656
|
] })
|
|
@@ -75710,11 +75678,7 @@ function ManufacturerCreditFinanceCard({
|
|
|
75710
75678
|
manufacturer: t,
|
|
75711
75679
|
isLoading: e
|
|
75712
75680
|
}) {
|
|
75713
|
-
const n = (t == null ? void 0 : t.CreditLimit) ?? 0, o = (t == null ? void 0 : t.OutstandingBalance) ?? 0, l = n - o, d = Math.round(o / n * 100)
|
|
75714
|
-
style: "currency",
|
|
75715
|
-
currency: "USD",
|
|
75716
|
-
minimumFractionDigits: 2
|
|
75717
|
-
}).format(g);
|
|
75681
|
+
const n = (t == null ? void 0 : t.CreditLimit) ?? 0, o = (t == null ? void 0 : t.OutstandingBalance) ?? 0, l = n - o, d = Math.round(o / n * 100);
|
|
75718
75682
|
return e ? /* @__PURE__ */ jsxs(Card, { children: [
|
|
75719
75683
|
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
75720
75684
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-3/4" }),
|
|
@@ -75755,11 +75719,11 @@ function ManufacturerCreditFinanceCard({
|
|
|
75755
75719
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
75756
75720
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
75757
75721
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Credit Limit" }),
|
|
75758
|
-
/* @__PURE__ */ jsx("span", { className: "font-bold", children:
|
|
75722
|
+
/* @__PURE__ */ jsx("span", { className: "font-bold", children: formatMoney(n) })
|
|
75759
75723
|
] }),
|
|
75760
75724
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
75761
75725
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Outstanding Balance" }),
|
|
75762
|
-
/* @__PURE__ */ jsx("span", { className: "font-bold", children:
|
|
75726
|
+
/* @__PURE__ */ jsx("span", { className: "font-bold", children: formatMoney(o) })
|
|
75763
75727
|
] }),
|
|
75764
75728
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
75765
75729
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Available Credit" }),
|
|
@@ -75767,7 +75731,7 @@ function ManufacturerCreditFinanceCard({
|
|
|
75767
75731
|
"span",
|
|
75768
75732
|
{
|
|
75769
75733
|
className: `font-bold ${l >= 0 ? "text-emerald-600 dark:text-emerald-500" : "text-red-600 dark:text-red-500"}`,
|
|
75770
|
-
children:
|
|
75734
|
+
children: formatMoney(l)
|
|
75771
75735
|
}
|
|
75772
75736
|
)
|
|
75773
75737
|
] })
|
|
@@ -90852,9 +90816,6 @@ function formatYYYYMMDDIntToDateString$1(t) {
|
|
|
90852
90816
|
const e = t.toString();
|
|
90853
90817
|
return e.length === 8 ? `${e.substring(0, 4)}-${e.substring(4, 6)}-${e.substring(6, 8)}` : e;
|
|
90854
90818
|
}
|
|
90855
|
-
function formatCurrency(t) {
|
|
90856
|
-
return t === null || typeof t > "u" ? "N/A" : t.toLocaleString(void 0, { style: "currency", currency: "CAD" });
|
|
90857
|
-
}
|
|
90858
90819
|
function OrdersTable({
|
|
90859
90820
|
orders: t = null,
|
|
90860
90821
|
loading: e = !1,
|
|
@@ -90914,7 +90875,7 @@ function OrdersTable({
|
|
|
90914
90875
|
{
|
|
90915
90876
|
accessorKey: "UnitPrice",
|
|
90916
90877
|
header: "Unit Price",
|
|
90917
|
-
cell: ({ row: f }) =>
|
|
90878
|
+
cell: ({ row: f }) => f.original.UnitPrice ? formatMoney(f.original.UnitPrice) : "N/A",
|
|
90918
90879
|
enableSorting: !0,
|
|
90919
90880
|
enableFiltering: !1
|
|
90920
90881
|
// Currency filtering usually needs range
|