@argusoft/medplat-product-management 1.0.2 → 1.0.4

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 (83) hide show
  1. package/dist/{BrandsPage-CSA3meke.js → BrandsPage-BE3kn-8b.js} +77 -75
  2. package/dist/BrandsPage-BE3kn-8b.js.map +1 -0
  3. package/dist/{CategoriesPage-BrspzkJL.js → CategoriesPage-COqi3pMi.js} +71 -70
  4. package/dist/{CategoriesPage-BrspzkJL.js.map → CategoriesPage-COqi3pMi.js.map} +1 -1
  5. package/dist/{DashboardPage-CqaquOs2.js → DashboardPage-C_H1Jrey.js} +90 -89
  6. package/dist/DashboardPage-C_H1Jrey.js.map +1 -0
  7. package/dist/{FacilityPicker-Dv_H95WW.js → FacilityPicker-Diq2hnYg.js} +2 -2
  8. package/dist/{FacilityPicker-Dv_H95WW.js.map → FacilityPicker-Diq2hnYg.js.map} +1 -1
  9. package/dist/{InventoryPage-CPbzfDMR.js → InventoryPage-Bjpw6vTz.js} +106 -115
  10. package/dist/InventoryPage-Bjpw6vTz.js.map +1 -0
  11. package/dist/{MemberProfileCard-0vjO3Gzd.js → MemberProfileCard-BLUVRILO.js} +10 -9
  12. package/dist/MemberProfileCard-BLUVRILO.js.map +1 -0
  13. package/dist/{PaymentCreatePage-BYmDZAIB.js → PaymentCreatePage-B5VOgTx9.js} +173 -177
  14. package/dist/PaymentCreatePage-B5VOgTx9.js.map +1 -0
  15. package/dist/{PaymentsPage-BXPvKon-.js → PaymentsPage-DY6BclkN.js} +24 -23
  16. package/dist/{PaymentsPage-BXPvKon-.js.map → PaymentsPage-DY6BclkN.js.map} +1 -1
  17. package/dist/PickupCreatePage-CCSiyFQF.js +706 -0
  18. package/dist/PickupCreatePage-CCSiyFQF.js.map +1 -0
  19. package/dist/{PickupsPage-D66_Wta4.js → PickupsPage-DGi6T5Of.js} +83 -90
  20. package/dist/PickupsPage-DGi6T5Of.js.map +1 -0
  21. package/dist/PmGuard-C90yhpsN.js +592 -0
  22. package/dist/PmGuard-C90yhpsN.js.map +1 -0
  23. package/dist/{PmTable-B9970kPY.js → PmTable-BkK65bJQ.js} +98 -98
  24. package/dist/PmTable-BkK65bJQ.js.map +1 -0
  25. package/dist/{ProductEditPage-B8qFTCW9.js → ProductEditPage-CQj9egzW.js} +138 -137
  26. package/dist/ProductEditPage-CQj9egzW.js.map +1 -0
  27. package/dist/{ProductsPage-C7_r9cKn.js → ProductsPage-i8QVw_Jm.js} +65 -64
  28. package/dist/{ProductsPage-C7_r9cKn.js.map → ProductsPage-i8QVw_Jm.js.map} +1 -1
  29. package/dist/PurchaseCreatePage-Bp6bl9n8.js +591 -0
  30. package/dist/PurchaseCreatePage-Bp6bl9n8.js.map +1 -0
  31. package/dist/{PurchaseRequestDetailPage-C7aAwEqw.js → PurchaseRequestDetailPage-CNAqIFef.js} +216 -215
  32. package/dist/PurchaseRequestDetailPage-CNAqIFef.js.map +1 -0
  33. package/dist/{PurchaseRequestsPage-BwCkbpaX.js → PurchaseRequestsPage-BJqDlNrc.js} +57 -56
  34. package/dist/{PurchaseRequestsPage-BwCkbpaX.js.map → PurchaseRequestsPage-BJqDlNrc.js.map} +1 -1
  35. package/dist/{PurchasesPage-CvaZouVy.js → PurchasesPage-BQEToymQ.js} +76 -75
  36. package/dist/{PurchasesPage-CvaZouVy.js.map → PurchasesPage-BQEToymQ.js.map} +1 -1
  37. package/dist/{SaleCreatePage-DP1Qmltu.js → SaleCreatePage-DbfBK4PH.js} +149 -173
  38. package/dist/SaleCreatePage-DbfBK4PH.js.map +1 -0
  39. package/dist/{SalesPage-CO3cdYX5.js → SalesPage-CTBJMxZe.js} +50 -49
  40. package/dist/SalesPage-CTBJMxZe.js.map +1 -0
  41. package/dist/SettingsPage-CiwVmzM3.js +663 -0
  42. package/dist/SettingsPage-CiwVmzM3.js.map +1 -0
  43. package/dist/{StorageUnitsPage-B9Hr_RkW.js → StorageUnitsPage-BV7nK_iE.js} +57 -56
  44. package/dist/{StorageUnitsPage-B9Hr_RkW.js.map → StorageUnitsPage-BV7nK_iE.js.map} +1 -1
  45. package/dist/{TransactionsPage-HKIGwEZN.js → TransactionsPage-Cocn4901.js} +55 -54
  46. package/dist/TransactionsPage-Cocn4901.js.map +1 -0
  47. package/dist/TransferCreatePage-DbjcjuOg.js +316 -0
  48. package/dist/TransferCreatePage-DbjcjuOg.js.map +1 -0
  49. package/dist/TransfersPage-BFVF7Xvc.js +471 -0
  50. package/dist/TransfersPage-BFVF7Xvc.js.map +1 -0
  51. package/dist/VialsPage-BNzYTLVd.js +321 -0
  52. package/dist/VialsPage-BNzYTLVd.js.map +1 -0
  53. package/dist/index.js +652 -34
  54. package/dist/index.js.map +1 -1
  55. package/dist/settingsStore-KW217unV.js +417 -0
  56. package/dist/settingsStore-KW217unV.js.map +1 -0
  57. package/package.json +1 -1
  58. package/dist/BrandsPage-CSA3meke.js.map +0 -1
  59. package/dist/DashboardPage-CqaquOs2.js.map +0 -1
  60. package/dist/InventoryPage-CPbzfDMR.js.map +0 -1
  61. package/dist/MemberProfileCard-0vjO3Gzd.js.map +0 -1
  62. package/dist/PaymentCreatePage-BYmDZAIB.js.map +0 -1
  63. package/dist/PickupCreatePage-CMGwoAXj.js +0 -426
  64. package/dist/PickupCreatePage-CMGwoAXj.js.map +0 -1
  65. package/dist/PickupsPage-D66_Wta4.js.map +0 -1
  66. package/dist/PmTable-B9970kPY.js.map +0 -1
  67. package/dist/ProductEditPage-B8qFTCW9.js.map +0 -1
  68. package/dist/PurchaseCreatePage-CDfNDcKG.js +0 -627
  69. package/dist/PurchaseCreatePage-CDfNDcKG.js.map +0 -1
  70. package/dist/PurchaseRequestDetailPage-C7aAwEqw.js.map +0 -1
  71. package/dist/SaleCreatePage-DP1Qmltu.js.map +0 -1
  72. package/dist/SalesPage-CO3cdYX5.js.map +0 -1
  73. package/dist/SettingsPage-DvVRwSFw.js +0 -711
  74. package/dist/SettingsPage-DvVRwSFw.js.map +0 -1
  75. package/dist/TransactionsPage-HKIGwEZN.js.map +0 -1
  76. package/dist/TransferCreatePage-DMuZqQ3c.js +0 -363
  77. package/dist/TransferCreatePage-DMuZqQ3c.js.map +0 -1
  78. package/dist/TransfersPage-COIyouL4.js +0 -480
  79. package/dist/TransfersPage-COIyouL4.js.map +0 -1
  80. package/dist/VialsPage-BNPUwGCU.js +0 -922
  81. package/dist/VialsPage-BNPUwGCU.js.map +0 -1
  82. package/dist/currency-ClRLIEg2.js +0 -1372
  83. package/dist/currency-ClRLIEg2.js.map +0 -1
@@ -1,19 +1,20 @@
1
- import { M as e, a as t, i as n, l as r, m as i, n as a, o as ee, r as te, x as ne } from "./currency-ClRLIEg2.js";
2
- import { a as re, i as o, r as ie } from "./PmTable-B9970kPY.js";
3
- import { n as s, t as c } from "./format-UOyOu75i.js";
4
- import { useMemo as l, useState as u } from "react";
5
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
6
- import { Alert as m, Box as h, Button as g, Card as _, CardContent as v, Chip as ae, Divider as y, Stack as b, Table as oe, TableBody as se, TableCell as x, TableHead as ce, TableRow as S, TextField as C, Typography as w } from "@mui/material";
7
- import le from "@mui/icons-material/RefreshRounded";
8
- import { showToast as T } from "@/common/toaster/toaster";
9
- import { useNavigate as ue, useParams as de } from "react-router-dom";
10
- import { alpha as fe } from "@mui/material/styles";
11
- import pe from "@mui/icons-material/ArrowBackRounded";
12
- import me from "@mui/icons-material/CheckCircleRounded";
13
- import he from "@mui/icons-material/CancelRounded";
14
- import ge from "@mui/icons-material/DoNotDisturbRounded";
1
+ import { C as e, a as t, f as n, r } from "./settingsStore-KW217unV.js";
2
+ import { a as i, i as a, r as o } from "./PmTable-BkK65bJQ.js";
3
+ import { n as s, t as ee } from "./format-UOyOu75i.js";
4
+ import { a as te, i as ne, n as re, r as ie, t as ae } from "./PmGuard-C90yhpsN.js";
5
+ import { useMemo as c, useState as l } from "react";
6
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
7
+ import { Alert as p, Box as m, Button as h, Card as g, CardContent as _, Chip as oe, Divider as v, Stack as y, Table as se, TableBody as ce, TableCell as b, TableHead as le, TableRow as x, TextField as S, Typography as C } from "@mui/material";
8
+ import { showToast as w } from "@/common/toaster/toaster";
9
+ import { alpha as ue } from "@mui/material/styles";
10
+ import de from "@mui/icons-material/RefreshRounded";
11
+ import { useNavigate as fe, useParams as pe } from "react-router-dom";
12
+ import me from "@mui/icons-material/ArrowBackRounded";
13
+ import he from "@mui/icons-material/CheckCircleRounded";
14
+ import ge from "@mui/icons-material/CancelRounded";
15
+ import _e from "@mui/icons-material/DoNotDisturbRounded";
15
16
  //#region src/views/PurchaseRequestDetailPage.jsx
16
- function _e(e) {
17
+ function ve(e) {
17
18
  switch (e) {
18
19
  case "PENDING": return "info";
19
20
  case "APPROVED": return "success";
@@ -23,78 +24,78 @@ function _e(e) {
23
24
  default: return "default";
24
25
  }
25
26
  }
26
- function E(e) {
27
+ function T(e) {
27
28
  return e ? e.toLowerCase().split("_").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ") : "";
28
29
  }
29
- function D() {
30
- let D = ue(), { requestId: k } = de(), A = t().has("approve.manage.productManagement.purchase"), j = r()?.managePurchaseAmounts !== !1, [M, N] = u(null), [ve, P] = u(!0), [F, I] = u(!1), [L, R] = u(""), [z, B] = u({}), [V, H] = u({}), [U, W] = u({}), [G, K] = u("");
31
- async function q() {
32
- P(!0), R("");
30
+ function E() {
31
+ let E = fe(), { requestId: O } = pe(), k = ne().has("approve.manage.productManagement.purchase"), A = r()?.managePurchaseAmounts !== !1, [j, M] = l(null), [ye, N] = l(!0), [P, F] = l(!1), [I, L] = l(""), [R, z] = l({}), [B, V] = l({}), [H, U] = l({}), [W, G] = l("");
32
+ async function K() {
33
+ N(!0), L("");
33
34
  try {
34
- let t = await e(k);
35
- N(t);
35
+ let t = await e(O);
36
+ M(t);
36
37
  let n = {}, r = {}, i = {};
37
38
  (t?.items ?? []).forEach((e) => {
38
39
  n[e.id] = String(e.approvedQuantity == null ? e.requestedQuantity : e.approvedQuantity), r[e.id] = e.lotNumber ?? "", i[e.id] = e.expiryDate ? new Date(e.expiryDate).toISOString().substring(0, 10) : "";
39
- }), B(n), H(r), W(i), K(t?.decisionNotes ?? "");
40
+ }), z(n), V(r), U(i), G(t?.decisionNotes ?? "");
40
41
  } catch (e) {
41
- R(e?.response?.data?.message ?? e?.message ?? "Failed to load purchase request");
42
+ L(e?.response?.data?.message ?? e?.message ?? "Failed to load purchase request");
42
43
  } finally {
43
- P(!1);
44
+ N(!1);
44
45
  }
45
46
  }
46
- n(["view.manage.productManagement.purchase", "approve.manage.productManagement.purchase"], () => {
47
- q();
48
- }, [k]);
49
- let J = M?.status === "PENDING", Y = l(() => {
50
- if (!M || !j) return null;
47
+ ie(["view.manage.productManagement.purchase", "approve.manage.productManagement.purchase"], () => {
48
+ K();
49
+ }, [O]);
50
+ let q = j?.status === "PENDING", J = c(() => {
51
+ if (!j || !A) return null;
51
52
  let e = 0, t = !1;
52
- return (M.items ?? []).forEach((n) => {
53
- let r = Number(z[n.id] ?? 0);
53
+ return (j.items ?? []).forEach((n) => {
54
+ let r = Number(R[n.id] ?? 0);
54
55
  !Number.isFinite(r) || r <= 0 || n.buyPrice != null && (e += Number(n.buyPrice) * r, t = !0);
55
56
  }), t ? e : null;
56
57
  }, [
57
- M,
58
- z,
59
- j
58
+ j,
59
+ R,
60
+ A
60
61
  ]);
61
- function ye(e, t) {
62
- B((n) => ({
62
+ function be(e, t) {
63
+ z((n) => ({
63
64
  ...n,
64
65
  [e]: t
65
66
  }));
66
67
  }
67
- function be(e, t) {
68
- H((n) => ({
68
+ function xe(e, t) {
69
+ V((n) => ({
69
70
  ...n,
70
71
  [e]: t
71
72
  }));
72
73
  }
73
- function xe(e, t) {
74
- W((n) => ({
74
+ function Se(e, t) {
75
+ U((n) => ({
75
76
  ...n,
76
77
  [e]: t
77
78
  }));
78
79
  }
79
- function Se() {
80
- if (!M) return;
80
+ function Ce() {
81
+ if (!j) return;
81
82
  let e = {};
82
- M.items.forEach((t) => {
83
+ j.items.forEach((t) => {
83
84
  e[t.id] = String(t.requestedQuantity);
84
- }), B(e);
85
+ }), z(e);
85
86
  }
86
- function X() {
87
- if (!M) return;
87
+ function Y() {
88
+ if (!j) return;
88
89
  let e = {};
89
- M.items.forEach((t) => {
90
+ j.items.forEach((t) => {
90
91
  e[t.id] = "0";
91
- }), B(e);
92
+ }), z(e);
92
93
  }
93
- let Z = l(() => {
94
- if (!M) return {};
94
+ let X = c(() => {
95
+ if (!j) return {};
95
96
  let e = {};
96
- return (M.items ?? []).forEach((t) => {
97
- let n = z[t.id];
97
+ return (j.items ?? []).forEach((t) => {
98
+ let n = R[t.id];
98
99
  if (n == null || n === "") {
99
100
  e[t.id] = "Required";
100
101
  return;
@@ -102,183 +103,183 @@ function D() {
102
103
  let r = Number(n);
103
104
  !Number.isInteger(r) || r < 0 ? e[t.id] = "Must be 0 or a positive whole number" : r > t.requestedQuantity && (e[t.id] = `At most ${t.requestedQuantity}`);
104
105
  }), e;
105
- }, [M, z]), Q = l(() => {
106
- if (!M) return {};
106
+ }, [j, R]), Z = c(() => {
107
+ if (!j) return {};
107
108
  let e = {};
108
- return (M.items ?? []).forEach((t) => {
109
- let n = Number(z[t.id] ?? 0);
110
- !Number.isFinite(n) || n <= 0 || (V[t.id] ?? "").trim() || (e[t.id] = "Lot is required when approving this line");
109
+ return (j.items ?? []).forEach((t) => {
110
+ let n = Number(R[t.id] ?? 0);
111
+ !Number.isFinite(n) || n <= 0 || (B[t.id] ?? "").trim() || (e[t.id] = "Lot is required when approving this line");
111
112
  }), e;
112
113
  }, [
113
- M,
114
- z,
115
- V
116
- ]), Ce = l(() => {
117
- if (!M) return {};
114
+ j,
115
+ R,
116
+ B
117
+ ]), Q = c(() => {
118
+ if (!j) return {};
118
119
  let e = {}, t = (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
119
- return (M.items ?? []).forEach((n) => {
120
- let r = Number(z[n.id] ?? 0);
120
+ return (j.items ?? []).forEach((n) => {
121
+ let r = Number(R[n.id] ?? 0);
121
122
  if (!Number.isFinite(r) || r <= 0) return;
122
- let i = (U[n.id] ?? "").trim();
123
+ let i = (H[n.id] ?? "").trim();
123
124
  i ? i < t && (e[n.id] = "Expiry must be today or later") : e[n.id] = "Expiry is required when approving this line";
124
125
  }), e;
125
126
  }, [
126
- M,
127
- z,
128
- U
129
- ]), we = Object.keys(Z).length === 0 && Object.keys(Q).length === 0 && Object.keys(Ce).length === 0;
127
+ j,
128
+ R,
129
+ H
130
+ ]), we = Object.keys(X).length === 0 && Object.keys(Z).length === 0 && Object.keys(Q).length === 0;
130
131
  async function Te() {
131
- if (!(!we || !M)) {
132
- I(!0), R("");
132
+ if (!(!we || !j)) {
133
+ F(!0), L("");
133
134
  try {
134
- let e = await ne(M.id, {
135
- decisionNotes: G || null,
136
- items: M.items.map((e) => {
137
- let t = (V[e.id] ?? "").trim(), n = (U[e.id] ?? "").trim();
135
+ let e = await n(j.id, {
136
+ decisionNotes: W || null,
137
+ items: j.items.map((e) => {
138
+ let t = (B[e.id] ?? "").trim(), n = (H[e.id] ?? "").trim();
138
139
  return {
139
140
  itemId: e.id,
140
- approvedQuantity: Number(z[e.id]),
141
+ approvedQuantity: Number(R[e.id]),
141
142
  lotNumber: t || null,
142
143
  expiryDate: n || null
143
144
  };
144
145
  })
145
146
  });
146
- N(e), T({
147
- message: `Request ${E(e.status).toLowerCase()}.`,
147
+ M(e), w({
148
+ message: `Request ${T(e.status).toLowerCase()}.`,
148
149
  type: "success"
149
150
  });
150
151
  } catch (e) {
151
- R(e?.response?.data?.message ?? e?.message ?? "Failed to submit decision");
152
+ L(e?.response?.data?.message ?? e?.message ?? "Failed to submit decision");
152
153
  } finally {
153
- I(!1);
154
+ F(!1);
154
155
  }
155
156
  }
156
157
  }
157
158
  async function Ee() {
158
- if (M) {
159
- I(!0), R("");
159
+ if (j) {
160
+ F(!0), L("");
160
161
  try {
161
- N(await i(M.id)), T({
162
+ M(await t(j.id)), w({
162
163
  message: "Request cancelled.",
163
164
  type: "success"
164
165
  });
165
166
  } catch (e) {
166
- R(e?.response?.data?.message ?? e?.message ?? "Failed to cancel request");
167
+ L(e?.response?.data?.message ?? e?.message ?? "Failed to cancel request");
167
168
  } finally {
168
- I(!1);
169
+ F(!1);
169
170
  }
170
171
  }
171
172
  }
172
- let $ = J && A;
173
- return /* @__PURE__ */ p(h, { children: [/* @__PURE__ */ f(te, {}), /* @__PURE__ */ f(a, {
173
+ let $ = q && k;
174
+ return /* @__PURE__ */ f(m, { children: [/* @__PURE__ */ d(re, {}), /* @__PURE__ */ d(ae, {
174
175
  anyOf: ["view.manage.productManagement.purchase", "approve.manage.productManagement.purchase"],
175
- children: /* @__PURE__ */ p(ee, {
176
- title: M?.serialId ? `Purchase Request #${M.serialId}` : "Purchase Request",
176
+ children: /* @__PURE__ */ f(te, {
177
+ title: j?.serialId ? `Purchase Request #${j.serialId}` : "Purchase Request",
177
178
  subtitle: "Approve or reject each item. Your decision closes the entire request.",
178
- chips: M?.status ? [E(M.status)] : [],
179
- actions: /* @__PURE__ */ p(b, {
179
+ chips: j?.status ? [T(j.status)] : [],
180
+ actions: /* @__PURE__ */ f(y, {
180
181
  direction: "row",
181
182
  spacing: 1,
182
- children: [/* @__PURE__ */ f(g, {
183
+ children: [/* @__PURE__ */ d(h, {
183
184
  variant: "outlined",
184
- startIcon: /* @__PURE__ */ f(pe, {}),
185
- onClick: () => D("/ui/medplat/manage/pm/purchase-requests"),
185
+ startIcon: /* @__PURE__ */ d(me, {}),
186
+ onClick: () => E("/ui/medplat/manage/pm/purchase-requests"),
186
187
  children: "Back"
187
- }), /* @__PURE__ */ f(g, {
188
+ }), /* @__PURE__ */ d(h, {
188
189
  variant: "outlined",
189
- startIcon: /* @__PURE__ */ f(le, {}),
190
- onClick: () => void q(),
190
+ startIcon: /* @__PURE__ */ d(de, {}),
191
+ onClick: () => void K(),
191
192
  children: "Refresh"
192
193
  })]
193
194
  }),
194
- children: [L ? /* @__PURE__ */ f(m, {
195
+ children: [I ? /* @__PURE__ */ d(p, {
195
196
  severity: "error",
196
197
  sx: { mb: 2 },
197
- children: L
198
- }) : null, !ve && M ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(_, {
198
+ children: I
199
+ }) : null, !ye && j ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(g, {
199
200
  sx: {
200
- borderRadius: 4,
201
+ borderRadius: 1.5,
201
202
  mb: 2,
202
203
  border: "1px solid",
203
204
  borderColor: "divider",
204
205
  boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
205
206
  },
206
- children: /* @__PURE__ */ p(v, {
207
+ children: /* @__PURE__ */ f(_, {
207
208
  sx: { p: 2.5 },
208
209
  children: [
209
- /* @__PURE__ */ p(b, {
210
+ /* @__PURE__ */ f(y, {
210
211
  direction: {
211
212
  xs: "column",
212
213
  md: "row"
213
214
  },
214
215
  spacing: 2,
215
216
  alignItems: { md: "flex-start" },
216
- children: [/* @__PURE__ */ p(h, {
217
+ children: [/* @__PURE__ */ f(m, {
217
218
  sx: {
218
219
  flexGrow: 1,
219
220
  minWidth: 0
220
221
  },
221
222
  children: [
222
- /* @__PURE__ */ p(b, {
223
+ /* @__PURE__ */ f(y, {
223
224
  direction: "row",
224
225
  alignItems: "center",
225
226
  spacing: 1.5,
226
227
  sx: { mb: .5 },
227
228
  children: [
228
- /* @__PURE__ */ f(re, { id: M.serialId }),
229
- /* @__PURE__ */ f(ae, {
229
+ /* @__PURE__ */ d(i, { id: j.serialId }),
230
+ /* @__PURE__ */ d(oe, {
230
231
  size: "small",
231
- label: E(M.status),
232
- color: _e(M.status)
232
+ label: T(j.status),
233
+ color: ve(j.status)
233
234
  }),
234
- /* @__PURE__ */ f(w, {
235
+ /* @__PURE__ */ d(C, {
235
236
  variant: "caption",
236
237
  color: "text.secondary",
237
- children: M.ownerType
238
+ children: j.ownerType
238
239
  })
239
240
  ]
240
241
  }),
241
- /* @__PURE__ */ f(w, {
242
+ /* @__PURE__ */ d(C, {
242
243
  variant: "h6",
243
244
  sx: { fontWeight: 800 },
244
- children: M.ownerName || (M.ownerType === "USER" ? "Personal" : "Facility")
245
+ children: j.ownerName || (j.ownerType === "USER" ? "Personal" : "Facility")
245
246
  }),
246
- /* @__PURE__ */ p(w, {
247
+ /* @__PURE__ */ f(C, {
247
248
  variant: "caption",
248
249
  color: "text.secondary",
249
250
  sx: { display: "block" },
250
- children: ["For purchase date ", c(M.purchaseDate)]
251
+ children: ["For purchase date ", ee(j.purchaseDate)]
251
252
  })
252
253
  ]
253
- }), /* @__PURE__ */ p(b, {
254
+ }), /* @__PURE__ */ f(y, {
254
255
  spacing: .25,
255
256
  sx: { minWidth: 260 },
256
257
  children: [
257
- /* @__PURE__ */ f(O, {
258
+ /* @__PURE__ */ d(D, {
258
259
  label: "Requested by",
259
- children: M.requestedByName || `#${M.requestedBy}`
260
+ children: j.requestedByName || `#${j.requestedBy}`
260
261
  }),
261
- /* @__PURE__ */ f(O, {
262
+ /* @__PURE__ */ d(D, {
262
263
  label: "Requested on",
263
- children: s(M.requestedOn)
264
+ children: s(j.requestedOn)
264
265
  }),
265
- M.decidedBy ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(O, {
266
+ j.decidedBy ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(D, {
266
267
  label: "Decided by",
267
- children: M.decidedByName || `#${M.decidedBy}`
268
- }), /* @__PURE__ */ f(O, {
268
+ children: j.decidedByName || `#${j.decidedBy}`
269
+ }), /* @__PURE__ */ d(D, {
269
270
  label: "Decided on",
270
- children: s(M.decidedOn)
271
+ children: s(j.decidedOn)
271
272
  })] }) : null,
272
- M.paymentMode ? /* @__PURE__ */ f(O, {
273
+ j.paymentMode ? /* @__PURE__ */ d(D, {
273
274
  label: "Payment",
274
- children: M.paymentMode
275
+ children: j.paymentMode
275
276
  }) : null
276
277
  ]
277
278
  })]
278
279
  }),
279
- M.notes ? /* @__PURE__ */ p(d, { children: [
280
- /* @__PURE__ */ f(y, { sx: { my: 1.5 } }),
281
- /* @__PURE__ */ f(w, {
280
+ j.notes ? /* @__PURE__ */ f(u, { children: [
281
+ /* @__PURE__ */ d(v, { sx: { my: 1.5 } }),
282
+ /* @__PURE__ */ d(C, {
282
283
  variant: "caption",
283
284
  color: "text.secondary",
284
285
  sx: {
@@ -290,14 +291,14 @@ function D() {
290
291
  },
291
292
  children: "Requester notes"
292
293
  }),
293
- /* @__PURE__ */ f(w, {
294
+ /* @__PURE__ */ d(C, {
294
295
  variant: "body2",
295
- children: M.notes
296
+ children: j.notes
296
297
  })
297
298
  ] }) : null,
298
- M.decisionNotes ? /* @__PURE__ */ p(d, { children: [
299
- /* @__PURE__ */ f(y, { sx: { my: 1.5 } }),
300
- /* @__PURE__ */ f(w, {
299
+ j.decisionNotes ? /* @__PURE__ */ f(u, { children: [
300
+ /* @__PURE__ */ d(v, { sx: { my: 1.5 } }),
301
+ /* @__PURE__ */ d(C, {
301
302
  variant: "caption",
302
303
  color: "text.secondary",
303
304
  sx: {
@@ -309,25 +310,25 @@ function D() {
309
310
  },
310
311
  children: "Decision notes"
311
312
  }),
312
- /* @__PURE__ */ f(w, {
313
+ /* @__PURE__ */ d(C, {
313
314
  variant: "body2",
314
- children: M.decisionNotes
315
+ children: j.decisionNotes
315
316
  })
316
317
  ] }) : null
317
318
  ]
318
319
  })
319
- }), /* @__PURE__ */ f(_, {
320
+ }), /* @__PURE__ */ d(g, {
320
321
  sx: {
321
- borderRadius: 4,
322
+ borderRadius: 1.5,
322
323
  mb: 2,
323
324
  border: "1px solid",
324
325
  borderColor: "divider",
325
326
  boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
326
327
  },
327
- children: /* @__PURE__ */ p(v, {
328
+ children: /* @__PURE__ */ f(_, {
328
329
  sx: { p: 2.5 },
329
330
  children: [
330
- /* @__PURE__ */ p(b, {
331
+ /* @__PURE__ */ f(y, {
331
332
  direction: {
332
333
  xs: "column",
333
334
  md: "row"
@@ -335,66 +336,66 @@ function D() {
335
336
  alignItems: { md: "flex-end" },
336
337
  justifyContent: "space-between",
337
338
  sx: { mb: 1.5 },
338
- children: [/* @__PURE__ */ f(ie, {
339
+ children: [/* @__PURE__ */ d(o, {
339
340
  eyebrow: "Lines",
340
341
  title: $ ? "Decide per-line quantities" : "Requested items",
341
342
  hint: $ ? "Enter 0 to reject an item, or less than requested to partially approve." : null
342
- }), $ ? /* @__PURE__ */ p(b, {
343
+ }), $ ? /* @__PURE__ */ f(y, {
343
344
  direction: "row",
344
345
  spacing: 1,
345
- children: [/* @__PURE__ */ f(g, {
346
+ children: [/* @__PURE__ */ d(h, {
346
347
  size: "small",
347
348
  variant: "outlined",
348
- onClick: Se,
349
+ onClick: Ce,
349
350
  children: "Approve all"
350
- }), /* @__PURE__ */ f(g, {
351
+ }), /* @__PURE__ */ d(h, {
351
352
  size: "small",
352
353
  variant: "outlined",
353
354
  color: "error",
354
- onClick: X,
355
+ onClick: Y,
355
356
  children: "Reject all"
356
357
  })]
357
358
  }) : null]
358
359
  }),
359
- /* @__PURE__ */ p(oe, {
360
+ /* @__PURE__ */ f(se, {
360
361
  size: "small",
361
- children: [/* @__PURE__ */ f(ce, { children: /* @__PURE__ */ p(S, { children: [
362
- /* @__PURE__ */ f(x, { children: "Product" }),
363
- /* @__PURE__ */ f(x, { children: "Lot" }),
364
- /* @__PURE__ */ f(x, { children: "Expiry" }),
365
- j ? /* @__PURE__ */ f(x, {
362
+ children: [/* @__PURE__ */ d(le, { children: /* @__PURE__ */ f(x, { children: [
363
+ /* @__PURE__ */ d(b, { children: "Product" }),
364
+ /* @__PURE__ */ d(b, { children: "Lot" }),
365
+ /* @__PURE__ */ d(b, { children: "Expiry" }),
366
+ A ? /* @__PURE__ */ d(b, {
366
367
  align: "right",
367
368
  children: "Buy Price"
368
369
  }) : null,
369
- /* @__PURE__ */ f(x, {
370
+ /* @__PURE__ */ d(b, {
370
371
  align: "right",
371
372
  children: "Requested"
372
373
  }),
373
- /* @__PURE__ */ f(x, {
374
+ /* @__PURE__ */ d(b, {
374
375
  align: "right",
375
376
  children: $ ? "Approve" : "Approved"
376
377
  }),
377
- M.ownerType === "FACILITY" ? /* @__PURE__ */ f(x, { children: "Storage" }) : null
378
- ] }) }), /* @__PURE__ */ f(se, { children: M.items.map((e) => {
379
- let t = Z[e.id], n = Q[e.id], r = Ce[e.id], i = Number(z[e.id] ?? 0), a = $ && Number.isFinite(i) && i > 0;
380
- return /* @__PURE__ */ p(S, { children: [
381
- /* @__PURE__ */ f(x, {
378
+ j.ownerType === "FACILITY" ? /* @__PURE__ */ d(b, { children: "Storage" }) : null
379
+ ] }) }), /* @__PURE__ */ d(ce, { children: j.items.map((e) => {
380
+ let t = X[e.id], n = Z[e.id], r = Q[e.id], i = Number(R[e.id] ?? 0), o = $ && Number.isFinite(i) && i > 0;
381
+ return /* @__PURE__ */ f(x, { children: [
382
+ /* @__PURE__ */ d(b, {
382
383
  sx: { fontWeight: 700 },
383
384
  children: e.productName
384
385
  }),
385
- /* @__PURE__ */ f(x, {
386
+ /* @__PURE__ */ d(b, {
386
387
  sx: {
387
388
  fontFamily: "monospace",
388
389
  fontSize: "0.78rem"
389
390
  },
390
- children: $ ? /* @__PURE__ */ f(C, {
391
+ children: $ ? /* @__PURE__ */ d(S, {
391
392
  size: "small",
392
393
  placeholder: "Enter lot",
393
- value: V[e.id] ?? "",
394
- onChange: (t) => be(e.id, t.target.value),
395
- disabled: !a,
394
+ value: B[e.id] ?? "",
395
+ onChange: (t) => xe(e.id, t.target.value),
396
+ disabled: !o,
396
397
  error: !!n,
397
- helperText: n || (a ? "" : "Approve qty > 0 to enter lot"),
398
+ helperText: n || (o ? "" : "Approve qty > 0 to enter lot"),
398
399
  inputProps: { style: {
399
400
  fontFamily: "monospace",
400
401
  fontSize: "0.78rem"
@@ -402,29 +403,29 @@ function D() {
402
403
  sx: { minWidth: 140 }
403
404
  }) : e.lotNumber || "—"
404
405
  }),
405
- /* @__PURE__ */ f(x, { children: $ ? /* @__PURE__ */ f(C, {
406
+ /* @__PURE__ */ d(b, { children: $ ? /* @__PURE__ */ d(S, {
406
407
  size: "small",
407
408
  type: "date",
408
409
  InputLabelProps: { shrink: !0 },
409
- value: U[e.id] ?? "",
410
- onChange: (t) => xe(e.id, t.target.value),
411
- disabled: !a,
410
+ value: H[e.id] ?? "",
411
+ onChange: (t) => Se(e.id, t.target.value),
412
+ disabled: !o,
412
413
  error: !!r,
413
414
  helperText: r || "",
414
415
  sx: { minWidth: 150 }
415
- }) : e.expiryDate ? c(e.expiryDate) : "—" }),
416
- j ? /* @__PURE__ */ f(x, {
416
+ }) : e.expiryDate ? ee(e.expiryDate) : "—" }),
417
+ A ? /* @__PURE__ */ d(b, {
417
418
  align: "right",
418
- children: e.buyPrice == null ? /* @__PURE__ */ f(w, {
419
+ children: e.buyPrice == null ? /* @__PURE__ */ d(C, {
419
420
  variant: "caption",
420
421
  color: "text.disabled",
421
422
  children: "—"
422
- }) : /* @__PURE__ */ f(o, {
423
+ }) : /* @__PURE__ */ d(a, {
423
424
  value: e.buyPrice,
424
425
  bold: !1
425
426
  })
426
427
  }) : null,
427
- /* @__PURE__ */ f(x, {
428
+ /* @__PURE__ */ d(b, {
428
429
  align: "right",
429
430
  sx: {
430
431
  fontVariantNumeric: "tabular-nums",
@@ -432,9 +433,9 @@ function D() {
432
433
  },
433
434
  children: e.requestedQuantity
434
435
  }),
435
- /* @__PURE__ */ f(x, {
436
+ /* @__PURE__ */ d(b, {
436
437
  align: "right",
437
- children: $ ? /* @__PURE__ */ f(C, {
438
+ children: $ ? /* @__PURE__ */ d(S, {
438
439
  size: "small",
439
440
  type: "number",
440
441
  inputProps: {
@@ -442,12 +443,12 @@ function D() {
442
443
  max: e.requestedQuantity,
443
444
  style: { textAlign: "right" }
444
445
  },
445
- value: z[e.id] ?? "",
446
- onChange: (t) => ye(e.id, t.target.value),
446
+ value: R[e.id] ?? "",
447
+ onChange: (t) => be(e.id, t.target.value),
447
448
  error: !!t,
448
449
  helperText: t || "",
449
450
  sx: { maxWidth: 110 }
450
- }) : /* @__PURE__ */ f(w, {
451
+ }) : /* @__PURE__ */ d(C, {
451
452
  sx: {
452
453
  fontVariantNumeric: "tabular-nums",
453
454
  fontWeight: 700
@@ -455,39 +456,39 @@ function D() {
455
456
  children: e.approvedQuantity == null ? "—" : e.approvedQuantity
456
457
  })
457
458
  }),
458
- M.ownerType === "FACILITY" ? /* @__PURE__ */ f(x, { children: e.storageUnitName || "—" }) : null
459
+ j.ownerType === "FACILITY" ? /* @__PURE__ */ d(b, { children: e.storageUnitName || "—" }) : null
459
460
  ] }, e.id);
460
461
  }) })]
461
462
  }),
462
- $ ? /* @__PURE__ */ p(d, { children: [
463
- /* @__PURE__ */ f(y, { sx: { my: 2 } }),
464
- /* @__PURE__ */ p(b, {
463
+ $ ? /* @__PURE__ */ f(u, { children: [
464
+ /* @__PURE__ */ d(v, { sx: { my: 2 } }),
465
+ /* @__PURE__ */ f(y, {
465
466
  direction: {
466
467
  xs: "column",
467
468
  md: "row"
468
469
  },
469
470
  spacing: 2,
470
471
  alignItems: { md: "flex-start" },
471
- children: [/* @__PURE__ */ f(C, {
472
+ children: [/* @__PURE__ */ d(S, {
472
473
  fullWidth: !0,
473
474
  size: "small",
474
475
  label: "Decision notes (optional)",
475
476
  placeholder: "Rationale shown to the requester",
476
- value: G,
477
- onChange: (e) => K(e.target.value),
477
+ value: W,
478
+ onChange: (e) => G(e.target.value),
478
479
  multiline: !0,
479
480
  minRows: 2
480
- }), j && Y != null ? /* @__PURE__ */ p(h, {
481
+ }), A && J != null ? /* @__PURE__ */ f(m, {
481
482
  sx: (e) => ({
482
483
  minWidth: 220,
483
484
  p: 1.5,
484
- borderRadius: 3,
485
+ borderRadius: 1.5,
485
486
  border: "1px solid",
486
487
  borderColor: "divider",
487
- bgcolor: fe(e.palette.primary.main, .04),
488
+ bgcolor: ue(e.palette.primary.main, .04),
488
489
  textAlign: "right"
489
490
  }),
490
- children: [/* @__PURE__ */ f(w, {
491
+ children: [/* @__PURE__ */ d(C, {
491
492
  variant: "caption",
492
493
  color: "text.secondary",
493
494
  sx: {
@@ -497,55 +498,55 @@ function D() {
497
498
  letterSpacing: .6
498
499
  },
499
500
  children: "Total if approved"
500
- }), /* @__PURE__ */ f(o, {
501
- value: Number(Y.toFixed(2)),
501
+ }), /* @__PURE__ */ d(a, {
502
+ value: Number(J.toFixed(2)),
502
503
  size: "big"
503
504
  })]
504
505
  }) : null]
505
506
  }),
506
- /* @__PURE__ */ p(b, {
507
+ /* @__PURE__ */ f(y, {
507
508
  direction: "row",
508
509
  spacing: 1,
509
510
  justifyContent: "flex-end",
510
511
  sx: { mt: 2 },
511
- children: [/* @__PURE__ */ f(g, {
512
+ children: [/* @__PURE__ */ d(h, {
512
513
  variant: "outlined",
513
514
  color: "error",
514
- startIcon: /* @__PURE__ */ f(he, {}),
515
- disabled: F,
515
+ startIcon: /* @__PURE__ */ d(ge, {}),
516
+ disabled: P,
516
517
  onClick: () => {
517
- X();
518
+ Y();
518
519
  },
519
520
  children: "Set all to 0"
520
- }), /* @__PURE__ */ f(g, {
521
+ }), /* @__PURE__ */ d(h, {
521
522
  variant: "contained",
522
- startIcon: /* @__PURE__ */ f(me, {}),
523
- disabled: F || !we,
523
+ startIcon: /* @__PURE__ */ d(he, {}),
524
+ disabled: P || !we,
524
525
  onClick: () => void Te(),
525
- children: F ? "Submitting…" : "Submit Decision"
526
+ children: P ? "Submitting…" : "Submit Decision"
526
527
  })]
527
528
  })
528
529
  ] }) : null,
529
- J && !A ? /* @__PURE__ */ f(b, {
530
+ q && !k ? /* @__PURE__ */ d(y, {
530
531
  direction: "row",
531
532
  spacing: 1,
532
533
  justifyContent: "flex-end",
533
534
  sx: { mt: 2 },
534
- children: /* @__PURE__ */ f(g, {
535
+ children: /* @__PURE__ */ d(h, {
535
536
  variant: "outlined",
536
537
  color: "error",
537
- startIcon: /* @__PURE__ */ f(ge, {}),
538
- disabled: F,
538
+ startIcon: /* @__PURE__ */ d(_e, {}),
539
+ disabled: P,
539
540
  onClick: () => void Ee(),
540
- children: F ? "Cancelling…" : "Cancel Request"
541
+ children: P ? "Cancelling…" : "Cancel Request"
541
542
  })
542
543
  }) : null,
543
- M.approvedPurchaseId ? /* @__PURE__ */ p(m, {
544
+ j.approvedPurchaseId ? /* @__PURE__ */ f(p, {
544
545
  severity: "success",
545
546
  sx: { mt: 2 },
546
547
  children: [
547
548
  "Stock was added to inventory under purchase id ",
548
- /* @__PURE__ */ f("strong", { children: M.approvedPurchaseId }),
549
+ /* @__PURE__ */ d("strong", { children: j.approvedPurchaseId }),
549
550
  "."
550
551
  ]
551
552
  }) : null
@@ -555,12 +556,12 @@ function D() {
555
556
  })
556
557
  })] });
557
558
  }
558
- function O({ label: e, children: t }) {
559
- return /* @__PURE__ */ p(b, {
559
+ function D({ label: e, children: t }) {
560
+ return /* @__PURE__ */ f(y, {
560
561
  direction: "row",
561
562
  spacing: 1,
562
563
  sx: { minWidth: 0 },
563
- children: [/* @__PURE__ */ f(w, {
564
+ children: [/* @__PURE__ */ d(C, {
564
565
  variant: "caption",
565
566
  color: "text.secondary",
566
567
  sx: {
@@ -570,7 +571,7 @@ function O({ label: e, children: t }) {
570
571
  letterSpacing: .5
571
572
  },
572
573
  children: e
573
- }), /* @__PURE__ */ f(w, {
574
+ }), /* @__PURE__ */ d(C, {
574
575
  variant: "caption",
575
576
  sx: {
576
577
  minWidth: 0,
@@ -581,6 +582,6 @@ function O({ label: e, children: t }) {
581
582
  });
582
583
  }
583
584
  //#endregion
584
- export { D as default };
585
+ export { E as default };
585
586
 
586
- //# sourceMappingURL=PurchaseRequestDetailPage-C7aAwEqw.js.map
587
+ //# sourceMappingURL=PurchaseRequestDetailPage-CNAqIFef.js.map