@argusoft/medplat-product-management 1.0.4 → 1.0.6
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/{BrandsPage-BE3kn-8b.js → BrandsPage-DM5ZRz8L.js} +7 -6
- package/dist/{BrandsPage-BE3kn-8b.js.map → BrandsPage-DM5ZRz8L.js.map} +1 -1
- package/dist/{CategoriesPage-COqi3pMi.js → CategoriesPage-v7vz_i2N.js} +7 -6
- package/dist/{CategoriesPage-COqi3pMi.js.map → CategoriesPage-v7vz_i2N.js.map} +1 -1
- package/dist/{DashboardPage-C_H1Jrey.js → DashboardPage-CW77OzUg.js} +3 -3
- package/dist/{DashboardPage-C_H1Jrey.js.map → DashboardPage-CW77OzUg.js.map} +1 -1
- package/dist/{FacilityPicker-Diq2hnYg.js → FacilityPicker-C2drWyqo.js} +2 -2
- package/dist/{FacilityPicker-Diq2hnYg.js.map → FacilityPicker-C2drWyqo.js.map} +1 -1
- package/dist/InventoryPage-_VWlqD2e.js +686 -0
- package/dist/InventoryPage-_VWlqD2e.js.map +1 -0
- package/dist/{MemberProfileCard-BLUVRILO.js → MemberProfileCard-D9jepThR.js} +3 -3
- package/dist/{MemberProfileCard-BLUVRILO.js.map → MemberProfileCard-D9jepThR.js.map} +1 -1
- package/dist/{PaymentCreatePage-B5VOgTx9.js → PaymentCreatePage-DAUWv5RO.js} +7 -7
- package/dist/{PaymentCreatePage-B5VOgTx9.js.map → PaymentCreatePage-DAUWv5RO.js.map} +1 -1
- package/dist/{PaymentsPage-DY6BclkN.js → PaymentsPage-B6Fs2xey.js} +4 -4
- package/dist/{PaymentsPage-DY6BclkN.js.map → PaymentsPage-B6Fs2xey.js.map} +1 -1
- package/dist/{PickupCreatePage-CCSiyFQF.js → PickupCreatePage-4ffB1_yq.js} +4 -4
- package/dist/{PickupCreatePage-CCSiyFQF.js.map → PickupCreatePage-4ffB1_yq.js.map} +1 -1
- package/dist/{PickupsPage-DGi6T5Of.js → PickupsPage-C-21LwTf.js} +7 -7
- package/dist/{PickupsPage-DGi6T5Of.js.map → PickupsPage-C-21LwTf.js.map} +1 -1
- package/dist/{PmGuard-C90yhpsN.js → PmGuard-DrbbysnW.js} +3 -3
- package/dist/{PmGuard-C90yhpsN.js.map → PmGuard-DrbbysnW.js.map} +1 -1
- package/dist/{PmTable-BkK65bJQ.js → PmTable-BMFiuHdG.js} +2 -2
- package/dist/{PmTable-BkK65bJQ.js.map → PmTable-BMFiuHdG.js.map} +1 -1
- package/dist/{ProductEditPage-CQj9egzW.js → ProductEditPage-BinNxjlB.js} +174 -116
- package/dist/ProductEditPage-BinNxjlB.js.map +1 -0
- package/dist/{ProductsPage-i8QVw_Jm.js → ProductsPage-DFgK9-13.js} +5 -5
- package/dist/{ProductsPage-i8QVw_Jm.js.map → ProductsPage-DFgK9-13.js.map} +1 -1
- package/dist/{PurchaseCreatePage-Bp6bl9n8.js → PurchaseCreatePage-B1eV15aS.js} +9 -9
- package/dist/{PurchaseCreatePage-Bp6bl9n8.js.map → PurchaseCreatePage-B1eV15aS.js.map} +1 -1
- package/dist/{PurchaseRequestDetailPage-CNAqIFef.js → PurchaseRequestDetailPage-52S6Nf7a.js} +6 -5
- package/dist/{PurchaseRequestDetailPage-CNAqIFef.js.map → PurchaseRequestDetailPage-52S6Nf7a.js.map} +1 -1
- package/dist/{PurchaseRequestsPage-BJqDlNrc.js → PurchaseRequestsPage-DNNUnXy4.js} +4 -4
- package/dist/{PurchaseRequestsPage-BJqDlNrc.js.map → PurchaseRequestsPage-DNNUnXy4.js.map} +1 -1
- package/dist/{PurchasesPage-BQEToymQ.js → PurchasesPage-Bsrqxvb1.js} +4 -4
- package/dist/{PurchasesPage-BQEToymQ.js.map → PurchasesPage-Bsrqxvb1.js.map} +1 -1
- package/dist/SaleCreatePage-CPyVj3Dh.js +544 -0
- package/dist/SaleCreatePage-CPyVj3Dh.js.map +1 -0
- package/dist/{SalesPage-CTBJMxZe.js → SalesPage-BWpgPKz_.js} +4 -4
- package/dist/{SalesPage-CTBJMxZe.js.map → SalesPage-BWpgPKz_.js.map} +1 -1
- package/dist/{SettingsPage-CiwVmzM3.js → SettingsPage-Ch-37E5R.js} +4 -4
- package/dist/{SettingsPage-CiwVmzM3.js.map → SettingsPage-Ch-37E5R.js.map} +1 -1
- package/dist/{StorageUnitsPage-BV7nK_iE.js → StorageUnitsPage-DF0MC356.js} +7 -7
- package/dist/{StorageUnitsPage-BV7nK_iE.js.map → StorageUnitsPage-DF0MC356.js.map} +1 -1
- package/dist/{TransactionsPage-Cocn4901.js → TransactionsPage-DQBjCHoN.js} +18 -18
- package/dist/{TransactionsPage-Cocn4901.js.map → TransactionsPage-DQBjCHoN.js.map} +1 -1
- package/dist/{TransferCreatePage-DbjcjuOg.js → TransferCreatePage-DdVExUif.js} +4 -4
- package/dist/{TransferCreatePage-DbjcjuOg.js.map → TransferCreatePage-DdVExUif.js.map} +1 -1
- package/dist/{TransfersPage-BFVF7Xvc.js → TransfersPage-C1qS9kNL.js} +5 -5
- package/dist/{TransfersPage-BFVF7Xvc.js.map → TransfersPage-C1qS9kNL.js.map} +1 -1
- package/dist/{VialsPage-BNzYTLVd.js → VialsPage-rTAYlXGZ.js} +8 -8
- package/dist/{VialsPage-BNzYTLVd.js.map → VialsPage-rTAYlXGZ.js.map} +1 -1
- package/dist/{constants-5ZCZo-Zm.js → constants-CdzV0PxZ.js} +25 -12
- package/dist/constants-CdzV0PxZ.js.map +1 -0
- package/dist/format-UOyOu75i.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/{settingsStore-KW217unV.js → settingsStore-GLCtI-tv.js} +17 -14
- package/dist/{settingsStore-KW217unV.js.map → settingsStore-GLCtI-tv.js.map} +1 -1
- package/dist/{validation-Ba7puFIO.js → validation-BkUPqrdA.js} +11 -12
- package/dist/{validation-Ba7puFIO.js.map → validation-BkUPqrdA.js.map} +1 -1
- package/package.json +1 -1
- package/dist/InventoryPage-Bjpw6vTz.js +0 -508
- package/dist/InventoryPage-Bjpw6vTz.js.map +0 -1
- package/dist/ProductEditPage-CQj9egzW.js.map +0 -1
- package/dist/SaleCreatePage-DbfBK4PH.js +0 -523
- package/dist/SaleCreatePage-DbfBK4PH.js.map +0 -1
- package/dist/constants-5ZCZo-Zm.js.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { $ as e, g as t, m as n, p as ee, r, x as i } from "./settingsStore-
|
|
2
|
-
import { n as a, o } from "./PmTable-
|
|
3
|
-
import { i as te,
|
|
4
|
-
import { c as
|
|
1
|
+
import { $ as e, g as t, m as n, p as ee, r, x as i } from "./settingsStore-GLCtI-tv.js";
|
|
2
|
+
import { n as a, o } from "./PmTable-BMFiuHdG.js";
|
|
3
|
+
import { d as s, i as te, o as ne, u as re } from "./constants-CdzV0PxZ.js";
|
|
4
|
+
import { c as ie, g as ae, h as oe, m as c, p as l, r as u, s as se, t as ce } from "./validation-BkUPqrdA.js";
|
|
5
5
|
import { t as d } from "./useFieldErrors-hDG8ox_x.js";
|
|
6
|
-
import { a as f, n as
|
|
7
|
-
import { useEffect as le, useMemo as
|
|
8
|
-
import { jsx as
|
|
9
|
-
import { Alert as
|
|
10
|
-
import { showToast as
|
|
11
|
-
import { useNavigate as
|
|
12
|
-
import
|
|
6
|
+
import { a as f, n as p, r as m, t as h } from "./PmGuard-DrbbysnW.js";
|
|
7
|
+
import { useEffect as le, useMemo as g, useState as _ } from "react";
|
|
8
|
+
import { Fragment as ue, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
9
|
+
import { Alert as b, Box as x, Button as S, Card as C, CardContent as w, Checkbox as T, Divider as de, FormControlLabel as E, Grid as D, Stack as O, TextField as k, Typography as A } from "@mui/material";
|
|
10
|
+
import { showToast as j } from "@/common/toaster/toaster";
|
|
11
|
+
import { useNavigate as M, useParams as N } from "react-router-dom";
|
|
12
|
+
import P from "@mui/icons-material/SaveRounded";
|
|
13
13
|
//#region src/views/ProductEditPage.jsx
|
|
14
|
-
var
|
|
14
|
+
var F = {
|
|
15
15
|
vaccineCode: "",
|
|
16
16
|
vialVolumeMl: "",
|
|
17
17
|
adultDoseMl: "",
|
|
@@ -25,9 +25,9 @@ var P = {
|
|
|
25
25
|
storageTempMaxCelsius: "",
|
|
26
26
|
comments: ""
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
let { productId:
|
|
30
|
-
id:
|
|
28
|
+
function I() {
|
|
29
|
+
let { productId: I } = N(), L = M(), [R, z] = _(!0), [B, V] = _(""), [fe, H] = _(!1), [U, pe] = _([]), [me, he] = _([]), [ge, _e] = _([]), W = d(), G = r()?.manageSales !== !1, [K, q] = _({
|
|
30
|
+
id: I,
|
|
31
31
|
name: "",
|
|
32
32
|
categoryId: "",
|
|
33
33
|
brandId: "",
|
|
@@ -37,22 +37,25 @@ function F() {
|
|
|
37
37
|
hasExpiry: !0,
|
|
38
38
|
needsStorageUnit: !1,
|
|
39
39
|
notForSale: !1,
|
|
40
|
+
canBeQuarantined: !0,
|
|
41
|
+
salePriceMode: "FREE",
|
|
42
|
+
salePrice: "",
|
|
40
43
|
isActive: !0,
|
|
41
44
|
imageUuids: [],
|
|
42
45
|
vaccineConfig: null
|
|
43
|
-
}), J =
|
|
44
|
-
|
|
46
|
+
}), J = g(() => U.find((e) => e.id === K.categoryId), [U, K.categoryId]), Y = J?.code?.toUpperCase() === re;
|
|
47
|
+
m("update.manage.productManagement.product", () => {
|
|
45
48
|
async function e() {
|
|
46
|
-
|
|
49
|
+
z(!0);
|
|
47
50
|
try {
|
|
48
51
|
let [e, r, a] = await Promise.all([
|
|
49
52
|
n(),
|
|
50
53
|
ee(),
|
|
51
54
|
t().catch(() => [])
|
|
52
55
|
]);
|
|
53
|
-
|
|
56
|
+
pe(e), he(r), _e(a);
|
|
54
57
|
try {
|
|
55
|
-
let e = await i(
|
|
58
|
+
let e = await i(I);
|
|
56
59
|
H(!1), q({
|
|
57
60
|
id: e.id,
|
|
58
61
|
name: e.name ?? "",
|
|
@@ -64,6 +67,9 @@ function F() {
|
|
|
64
67
|
hasExpiry: e.hasExpiry ?? !1,
|
|
65
68
|
needsStorageUnit: e.needsStorageUnit ?? !1,
|
|
66
69
|
notForSale: e.notForSale ?? !1,
|
|
70
|
+
canBeQuarantined: e.canBeQuarantined ?? !0,
|
|
71
|
+
salePriceMode: e.salePriceMode ?? "FREE",
|
|
72
|
+
salePrice: e.salePrice ?? "",
|
|
67
73
|
isActive: e.isActive ?? !0,
|
|
68
74
|
imageUuids: e.imageUuids ?? [],
|
|
69
75
|
vaccineConfig: e.vaccineConfig ? {
|
|
@@ -85,18 +91,18 @@ function F() {
|
|
|
85
91
|
H(!0);
|
|
86
92
|
}
|
|
87
93
|
} catch (e) {
|
|
88
|
-
|
|
94
|
+
V(e?.response?.data?.message ?? e?.message ?? "Failed to load product");
|
|
89
95
|
} finally {
|
|
90
|
-
|
|
96
|
+
z(!1);
|
|
91
97
|
}
|
|
92
98
|
}
|
|
93
99
|
e();
|
|
94
|
-
}, [
|
|
100
|
+
}, [I]), le(() => {
|
|
95
101
|
q(Y ? (e) => ({
|
|
96
102
|
...e,
|
|
97
103
|
unit: "VIAL",
|
|
98
104
|
needsStorageUnit: !0,
|
|
99
|
-
vaccineConfig: e.vaccineConfig ?? { ...
|
|
105
|
+
vaccineConfig: e.vaccineConfig ?? { ...F }
|
|
100
106
|
}) : (e) => e.vaccineConfig ? {
|
|
101
107
|
...e,
|
|
102
108
|
vaccineConfig: null
|
|
@@ -112,38 +118,43 @@ function F() {
|
|
|
112
118
|
q((n) => ({
|
|
113
119
|
...n,
|
|
114
120
|
vaccineConfig: {
|
|
115
|
-
...n.vaccineConfig ??
|
|
121
|
+
...n.vaccineConfig ?? F,
|
|
116
122
|
[e]: t
|
|
117
123
|
}
|
|
118
124
|
}));
|
|
119
125
|
}
|
|
120
|
-
let Q =
|
|
126
|
+
let Q = g(() => {
|
|
121
127
|
let e = {
|
|
122
128
|
name: c(K.name, "Product name"),
|
|
123
129
|
categoryId: c(K.categoryId, "Category"),
|
|
124
130
|
brandId: c(K.brandId, "Brand"),
|
|
125
131
|
unit: c(K.unit, "Unit"),
|
|
126
|
-
unitOther: K.unit === "OTHER" ? c(K.unitOther, "Custom unit") : ""
|
|
132
|
+
unitOther: K.unit === "OTHER" ? c(K.unitOther, "Custom unit") : "",
|
|
133
|
+
salePrice: G && !K.notForSale && K.salePriceMode !== "FREE" ? c(K.salePrice, "Sale price") || (Number(K.salePrice) > 0 ? "" : "Sale price must be greater than 0.") : ""
|
|
127
134
|
};
|
|
128
135
|
if (Y && K.vaccineConfig) {
|
|
129
|
-
let t = K.vaccineConfig, n =
|
|
136
|
+
let t = K.vaccineConfig, n = oe(t.storageTempMinCelsius, t.storageTempMaxCelsius);
|
|
130
137
|
Object.assign(e, {
|
|
131
138
|
vaccineCode: c(t.vaccineCode, "Vaccine"),
|
|
132
|
-
vialVolumeMl:
|
|
133
|
-
adultDoseMl:
|
|
134
|
-
childDoseMl:
|
|
135
|
-
openVialValidityHours:
|
|
139
|
+
vialVolumeMl: ae(t.vialVolumeMl),
|
|
140
|
+
adultDoseMl: u(t.adultDoseMl, "Adult dose", t.vialVolumeMl),
|
|
141
|
+
childDoseMl: u(t.childDoseMl, "Child dose", t.vialVolumeMl),
|
|
142
|
+
openVialValidityHours: ie(t.openVialValidityHours),
|
|
136
143
|
maxConcurrentOpenVials: se(t.maxConcurrentOpenVials),
|
|
137
|
-
reconstitutedValidityHours:
|
|
144
|
+
reconstitutedValidityHours: l(t.reconstitutedValidityHours, t.requiresReconstitution),
|
|
138
145
|
storageTempMinCelsius: n.min,
|
|
139
146
|
storageTempMaxCelsius: n.max
|
|
140
147
|
}), !t.adultDoseMl && !t.childDoseMl && (e.adultDoseMl = e.adultDoseMl || "Provide at least one dose (adult or child)", e.childDoseMl = e.childDoseMl || "Provide at least one dose (adult or child)");
|
|
141
148
|
}
|
|
142
149
|
return e;
|
|
143
|
-
}, [
|
|
144
|
-
|
|
150
|
+
}, [
|
|
151
|
+
K,
|
|
152
|
+
Y,
|
|
153
|
+
G
|
|
154
|
+
]), $ = ce(Q);
|
|
155
|
+
async function ve() {
|
|
145
156
|
if (!$) {
|
|
146
|
-
W.markAllTouched(),
|
|
157
|
+
W.markAllTouched(), V("Please fix the highlighted fields and try again.");
|
|
147
158
|
return;
|
|
148
159
|
}
|
|
149
160
|
try {
|
|
@@ -158,6 +169,9 @@ function F() {
|
|
|
158
169
|
hasExpiry: !!K.hasExpiry,
|
|
159
170
|
needsStorageUnit: !!K.needsStorageUnit,
|
|
160
171
|
notForSale: G ? !!K.notForSale : !1,
|
|
172
|
+
canBeQuarantined: !!K.canBeQuarantined,
|
|
173
|
+
salePriceMode: G && !K.notForSale ? K.salePriceMode : "FREE",
|
|
174
|
+
salePrice: G && !K.notForSale && K.salePriceMode !== "FREE" && K.salePrice !== "" ? Number(K.salePrice) : null,
|
|
161
175
|
isActive: !!K.isActive,
|
|
162
176
|
imageUuids: K.imageUuids ?? [],
|
|
163
177
|
vaccineConfig: K.vaccineConfig ? {
|
|
@@ -174,66 +188,66 @@ function F() {
|
|
|
174
188
|
storageTempMaxCelsius: K.vaccineConfig.storageTempMaxCelsius === "" ? null : Number(K.vaccineConfig.storageTempMaxCelsius),
|
|
175
189
|
comments: K.vaccineConfig.comments || null
|
|
176
190
|
} : null
|
|
177
|
-
}),
|
|
191
|
+
}), j({
|
|
178
192
|
message: "Product saved.",
|
|
179
193
|
type: "success"
|
|
180
|
-
}),
|
|
194
|
+
}), L("/ui/medplat/manage/pm/products");
|
|
181
195
|
} catch (e) {
|
|
182
|
-
|
|
196
|
+
V(e?.response?.data?.message ?? e?.message ?? "Failed to save product");
|
|
183
197
|
}
|
|
184
198
|
}
|
|
185
|
-
return /* @__PURE__ */
|
|
199
|
+
return /* @__PURE__ */ y(x, { children: [/* @__PURE__ */ v(p, {}), /* @__PURE__ */ v(h, {
|
|
186
200
|
perm: "update.manage.productManagement.product",
|
|
187
201
|
title: "You don’t have permission to create or edit products",
|
|
188
|
-
children: /* @__PURE__ */
|
|
189
|
-
title:
|
|
202
|
+
children: /* @__PURE__ */ y(f, {
|
|
203
|
+
title: fe ? "Add Product" : "Edit Product",
|
|
190
204
|
subtitle: `Category: ${J?.code ?? "—"}`,
|
|
191
|
-
actions: /* @__PURE__ */
|
|
205
|
+
actions: /* @__PURE__ */ y(O, {
|
|
192
206
|
direction: "row",
|
|
193
207
|
spacing: 1,
|
|
194
|
-
children: [/* @__PURE__ */
|
|
208
|
+
children: [/* @__PURE__ */ v(S, {
|
|
195
209
|
variant: "outlined",
|
|
196
|
-
onClick: () =>
|
|
210
|
+
onClick: () => L("/ui/medplat/manage/pm/products"),
|
|
197
211
|
children: "Cancel"
|
|
198
|
-
}), /* @__PURE__ */
|
|
212
|
+
}), /* @__PURE__ */ v(S, {
|
|
199
213
|
variant: "contained",
|
|
200
|
-
startIcon: /* @__PURE__ */
|
|
214
|
+
startIcon: /* @__PURE__ */ v(P, {}),
|
|
201
215
|
disabled: !$,
|
|
202
|
-
onClick: () => void
|
|
216
|
+
onClick: () => void ve(),
|
|
203
217
|
children: "Save"
|
|
204
218
|
})]
|
|
205
219
|
}),
|
|
206
220
|
children: [
|
|
207
|
-
|
|
221
|
+
R ? /* @__PURE__ */ v(b, {
|
|
208
222
|
severity: "info",
|
|
209
223
|
children: "Loading…"
|
|
210
224
|
}) : null,
|
|
211
|
-
|
|
225
|
+
B ? /* @__PURE__ */ v(b, {
|
|
212
226
|
severity: "error",
|
|
213
227
|
sx: { mb: 2 },
|
|
214
|
-
children:
|
|
228
|
+
children: B
|
|
215
229
|
}) : null,
|
|
216
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ v(C, {
|
|
217
231
|
sx: {
|
|
218
232
|
borderRadius: 1.5,
|
|
219
233
|
mb: 2
|
|
220
234
|
},
|
|
221
|
-
children: /* @__PURE__ */
|
|
235
|
+
children: /* @__PURE__ */ y(w, { children: [/* @__PURE__ */ v(A, {
|
|
222
236
|
variant: "h6",
|
|
223
237
|
sx: {
|
|
224
238
|
fontWeight: 800,
|
|
225
239
|
mb: 2
|
|
226
240
|
},
|
|
227
241
|
children: "Basic Details"
|
|
228
|
-
}), /* @__PURE__ */
|
|
242
|
+
}), /* @__PURE__ */ y(D, {
|
|
229
243
|
container: !0,
|
|
230
244
|
spacing: 2,
|
|
231
245
|
children: [
|
|
232
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ v(D, {
|
|
233
247
|
item: !0,
|
|
234
248
|
xs: 12,
|
|
235
249
|
md: 6,
|
|
236
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ v(k, {
|
|
237
251
|
required: !0,
|
|
238
252
|
fullWidth: !0,
|
|
239
253
|
size: "small",
|
|
@@ -244,18 +258,18 @@ function F() {
|
|
|
244
258
|
onBlur: W.onBlur("name"),
|
|
245
259
|
error: W.show("name") && !!Q.name,
|
|
246
260
|
FormHelperTextProps: { component: "div" },
|
|
247
|
-
helperText: /* @__PURE__ */
|
|
261
|
+
helperText: /* @__PURE__ */ v(a, {
|
|
248
262
|
message: W.show("name") ? Q.name : "",
|
|
249
263
|
value: K.name,
|
|
250
264
|
max: 255
|
|
251
265
|
})
|
|
252
266
|
})
|
|
253
267
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ v(D, {
|
|
255
269
|
item: !0,
|
|
256
270
|
xs: 12,
|
|
257
271
|
md: 3,
|
|
258
|
-
children: /* @__PURE__ */
|
|
272
|
+
children: /* @__PURE__ */ v(o, {
|
|
259
273
|
label: "Category",
|
|
260
274
|
required: !0,
|
|
261
275
|
value: K.categoryId,
|
|
@@ -269,11 +283,11 @@ function F() {
|
|
|
269
283
|
}))
|
|
270
284
|
})
|
|
271
285
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ v(D, {
|
|
273
287
|
item: !0,
|
|
274
288
|
xs: 12,
|
|
275
289
|
md: 3,
|
|
276
|
-
children: /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ v(o, {
|
|
277
291
|
label: "Brand",
|
|
278
292
|
required: !0,
|
|
279
293
|
value: K.brandId,
|
|
@@ -281,17 +295,17 @@ function F() {
|
|
|
281
295
|
onBlur: W.onBlur("brandId"),
|
|
282
296
|
error: W.show("brandId") && !!Q.brandId,
|
|
283
297
|
helperText: W.show("brandId") ? Q.brandId : "",
|
|
284
|
-
options:
|
|
298
|
+
options: me.map((e) => ({
|
|
285
299
|
value: e.id,
|
|
286
300
|
label: e.name
|
|
287
301
|
}))
|
|
288
302
|
})
|
|
289
303
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ v(D, {
|
|
291
305
|
item: !0,
|
|
292
306
|
xs: 12,
|
|
293
307
|
md: 3,
|
|
294
|
-
children: /* @__PURE__ */
|
|
308
|
+
children: /* @__PURE__ */ v(o, {
|
|
295
309
|
label: "Unit",
|
|
296
310
|
required: !0,
|
|
297
311
|
disabled: Y,
|
|
@@ -303,11 +317,11 @@ function F() {
|
|
|
303
317
|
options: te
|
|
304
318
|
})
|
|
305
319
|
}),
|
|
306
|
-
K.unit === "OTHER" ? /* @__PURE__ */
|
|
320
|
+
K.unit === "OTHER" ? /* @__PURE__ */ v(D, {
|
|
307
321
|
item: !0,
|
|
308
322
|
xs: 12,
|
|
309
323
|
md: 3,
|
|
310
|
-
children: /* @__PURE__ */
|
|
324
|
+
children: /* @__PURE__ */ v(k, {
|
|
311
325
|
required: !0,
|
|
312
326
|
fullWidth: !0,
|
|
313
327
|
size: "small",
|
|
@@ -318,19 +332,19 @@ function F() {
|
|
|
318
332
|
onBlur: W.onBlur("unitOther"),
|
|
319
333
|
error: W.show("unitOther") && !!Q.unitOther,
|
|
320
334
|
FormHelperTextProps: { component: "div" },
|
|
321
|
-
helperText: /* @__PURE__ */
|
|
335
|
+
helperText: /* @__PURE__ */ v(a, {
|
|
322
336
|
message: W.show("unitOther") && Q.unitOther ? Q.unitOther : "e.g. Strip, Ampoule, Sachet",
|
|
323
337
|
value: K.unitOther,
|
|
324
338
|
max: 50
|
|
325
339
|
})
|
|
326
340
|
})
|
|
327
341
|
}) : null,
|
|
328
|
-
/* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ v(D, {
|
|
329
343
|
item: !0,
|
|
330
344
|
xs: 6,
|
|
331
345
|
md: 3,
|
|
332
|
-
children: /* @__PURE__ */
|
|
333
|
-
control: /* @__PURE__ */
|
|
346
|
+
children: /* @__PURE__ */ v(E, {
|
|
347
|
+
control: /* @__PURE__ */ v(T, {
|
|
334
348
|
checked: !!K.hasExpiry,
|
|
335
349
|
disabled: Y,
|
|
336
350
|
onChange: (e) => X("hasExpiry", e.target.checked)
|
|
@@ -338,12 +352,12 @@ function F() {
|
|
|
338
352
|
label: Y ? "Has expiry (vaccine)" : "Has expiry"
|
|
339
353
|
})
|
|
340
354
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ v(D, {
|
|
342
356
|
item: !0,
|
|
343
357
|
xs: 6,
|
|
344
358
|
md: 3,
|
|
345
|
-
children: /* @__PURE__ */
|
|
346
|
-
control: /* @__PURE__ */
|
|
359
|
+
children: /* @__PURE__ */ v(E, {
|
|
360
|
+
control: /* @__PURE__ */ v(T, {
|
|
347
361
|
checked: !!K.needsStorageUnit,
|
|
348
362
|
disabled: Y,
|
|
349
363
|
onChange: (e) => X("needsStorageUnit", e.target.checked)
|
|
@@ -351,34 +365,78 @@ function F() {
|
|
|
351
365
|
label: Y ? "Needs storage unit (vaccine)" : "Needs storage unit"
|
|
352
366
|
})
|
|
353
367
|
}),
|
|
354
|
-
G ? /* @__PURE__ */
|
|
368
|
+
G ? /* @__PURE__ */ v(D, {
|
|
355
369
|
item: !0,
|
|
356
370
|
xs: 6,
|
|
357
371
|
md: 3,
|
|
358
|
-
children: /* @__PURE__ */
|
|
359
|
-
control: /* @__PURE__ */
|
|
372
|
+
children: /* @__PURE__ */ v(E, {
|
|
373
|
+
control: /* @__PURE__ */ v(T, {
|
|
360
374
|
checked: !!K.notForSale,
|
|
361
375
|
onChange: (e) => X("notForSale", e.target.checked)
|
|
362
376
|
}),
|
|
363
377
|
label: "Not for sale"
|
|
364
378
|
})
|
|
365
379
|
}) : null,
|
|
366
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ v(D, {
|
|
367
381
|
item: !0,
|
|
368
382
|
xs: 6,
|
|
369
383
|
md: 3,
|
|
370
|
-
children: /* @__PURE__ */
|
|
371
|
-
control: /* @__PURE__ */
|
|
384
|
+
children: /* @__PURE__ */ v(E, {
|
|
385
|
+
control: /* @__PURE__ */ v(T, {
|
|
386
|
+
checked: !!K.canBeQuarantined,
|
|
387
|
+
onChange: (e) => X("canBeQuarantined", e.target.checked)
|
|
388
|
+
}),
|
|
389
|
+
label: "Can be quarantined"
|
|
390
|
+
})
|
|
391
|
+
}),
|
|
392
|
+
/* @__PURE__ */ v(D, {
|
|
393
|
+
item: !0,
|
|
394
|
+
xs: 6,
|
|
395
|
+
md: 3,
|
|
396
|
+
children: /* @__PURE__ */ v(E, {
|
|
397
|
+
control: /* @__PURE__ */ v(T, {
|
|
372
398
|
checked: !!K.isActive,
|
|
373
399
|
onChange: (e) => X("isActive", e.target.checked)
|
|
374
400
|
}),
|
|
375
401
|
label: "Active"
|
|
376
402
|
})
|
|
377
403
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
404
|
+
G && !K.notForSale ? /* @__PURE__ */ y(ue, { children: [/* @__PURE__ */ v(D, {
|
|
405
|
+
item: !0,
|
|
406
|
+
xs: 12,
|
|
407
|
+
md: 4,
|
|
408
|
+
children: /* @__PURE__ */ v(o, {
|
|
409
|
+
label: "Sale price mode",
|
|
410
|
+
value: K.salePriceMode,
|
|
411
|
+
onChange: (e) => X("salePriceMode", e),
|
|
412
|
+
options: ne,
|
|
413
|
+
helperText: "Fixed shows a locked price at sale time; MRP caps the entered price."
|
|
414
|
+
})
|
|
415
|
+
}), K.salePriceMode === "FREE" ? null : /* @__PURE__ */ v(D, {
|
|
416
|
+
item: !0,
|
|
417
|
+
xs: 12,
|
|
418
|
+
md: 4,
|
|
419
|
+
children: /* @__PURE__ */ v(k, {
|
|
420
|
+
required: !0,
|
|
421
|
+
fullWidth: !0,
|
|
422
|
+
size: "small",
|
|
423
|
+
type: "number",
|
|
424
|
+
inputProps: {
|
|
425
|
+
step: "0.01",
|
|
426
|
+
min: 0
|
|
427
|
+
},
|
|
428
|
+
label: K.salePriceMode === "FIXED" ? "Fixed sale price" : "Price cap (MRP)",
|
|
429
|
+
value: K.salePrice,
|
|
430
|
+
onChange: (e) => X("salePrice", e.target.value),
|
|
431
|
+
onBlur: W.onBlur("salePrice"),
|
|
432
|
+
error: W.show("salePrice") && !!Q.salePrice,
|
|
433
|
+
helperText: W.show("salePrice") ? Q.salePrice : ""
|
|
434
|
+
})
|
|
435
|
+
})] }) : null,
|
|
436
|
+
/* @__PURE__ */ v(D, {
|
|
379
437
|
item: !0,
|
|
380
438
|
xs: 12,
|
|
381
|
-
children: /* @__PURE__ */
|
|
439
|
+
children: /* @__PURE__ */ v(k, {
|
|
382
440
|
fullWidth: !0,
|
|
383
441
|
size: "small",
|
|
384
442
|
multiline: !0,
|
|
@@ -391,34 +449,34 @@ function F() {
|
|
|
391
449
|
]
|
|
392
450
|
})] })
|
|
393
451
|
}),
|
|
394
|
-
Y ? /* @__PURE__ */
|
|
452
|
+
Y ? /* @__PURE__ */ v(C, {
|
|
395
453
|
sx: { borderRadius: 1.5 },
|
|
396
|
-
children: /* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
454
|
+
children: /* @__PURE__ */ y(w, { children: [
|
|
455
|
+
/* @__PURE__ */ y(O, {
|
|
398
456
|
direction: "row",
|
|
399
457
|
justifyContent: "space-between",
|
|
400
458
|
alignItems: "center",
|
|
401
459
|
sx: { mb: 2 },
|
|
402
|
-
children: [/* @__PURE__ */
|
|
460
|
+
children: [/* @__PURE__ */ v(A, {
|
|
403
461
|
variant: "h6",
|
|
404
462
|
sx: { fontWeight: 800 },
|
|
405
463
|
children: "Vaccine Configuration"
|
|
406
|
-
}), /* @__PURE__ */
|
|
464
|
+
}), /* @__PURE__ */ v(A, {
|
|
407
465
|
variant: "caption",
|
|
408
466
|
color: "text.secondary",
|
|
409
467
|
children: "Required for vaccine products. Controls vial size, dosing, and shelf life rules."
|
|
410
468
|
})]
|
|
411
469
|
}),
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ v(de, { sx: { mb: 2 } }),
|
|
471
|
+
/* @__PURE__ */ y(D, {
|
|
414
472
|
container: !0,
|
|
415
473
|
spacing: 2,
|
|
416
474
|
children: [
|
|
417
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ v(D, {
|
|
418
476
|
item: !0,
|
|
419
477
|
xs: 12,
|
|
420
478
|
md: 3,
|
|
421
|
-
children: /* @__PURE__ */
|
|
479
|
+
children: /* @__PURE__ */ v(o, {
|
|
422
480
|
label: "Vaccine",
|
|
423
481
|
required: !0,
|
|
424
482
|
value: K.vaccineConfig?.vaccineCode || "",
|
|
@@ -427,17 +485,17 @@ function F() {
|
|
|
427
485
|
error: W.show("vaccineCode") && !!Q.vaccineCode,
|
|
428
486
|
helperText: W.show("vaccineCode") && Q.vaccineCode ? Q.vaccineCode : "Sourced from medplat_immunization_master",
|
|
429
487
|
noOptionsText: "No vaccines configured in immunization master",
|
|
430
|
-
options:
|
|
488
|
+
options: ge.map((e) => ({
|
|
431
489
|
value: e.vaccineCode,
|
|
432
490
|
label: `${e.vaccineName} (${e.vaccineCode})`
|
|
433
491
|
}))
|
|
434
492
|
})
|
|
435
493
|
}),
|
|
436
|
-
/* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ v(D, {
|
|
437
495
|
item: !0,
|
|
438
496
|
xs: 12,
|
|
439
497
|
md: 3,
|
|
440
|
-
children: /* @__PURE__ */
|
|
498
|
+
children: /* @__PURE__ */ v(k, {
|
|
441
499
|
required: !0,
|
|
442
500
|
fullWidth: !0,
|
|
443
501
|
size: "small",
|
|
@@ -454,11 +512,11 @@ function F() {
|
|
|
454
512
|
helperText: W.show("vialVolumeMl") ? Q.vialVolumeMl : ""
|
|
455
513
|
})
|
|
456
514
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ v(D, {
|
|
458
516
|
item: !0,
|
|
459
517
|
xs: 12,
|
|
460
518
|
md: 3,
|
|
461
|
-
children: /* @__PURE__ */
|
|
519
|
+
children: /* @__PURE__ */ v(k, {
|
|
462
520
|
fullWidth: !0,
|
|
463
521
|
size: "small",
|
|
464
522
|
type: "number",
|
|
@@ -474,11 +532,11 @@ function F() {
|
|
|
474
532
|
helperText: W.show("adultDoseMl") ? Q.adultDoseMl : ""
|
|
475
533
|
})
|
|
476
534
|
}),
|
|
477
|
-
/* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ v(D, {
|
|
478
536
|
item: !0,
|
|
479
537
|
xs: 12,
|
|
480
538
|
md: 3,
|
|
481
|
-
children: /* @__PURE__ */
|
|
539
|
+
children: /* @__PURE__ */ v(k, {
|
|
482
540
|
fullWidth: !0,
|
|
483
541
|
size: "small",
|
|
484
542
|
type: "number",
|
|
@@ -494,11 +552,11 @@ function F() {
|
|
|
494
552
|
helperText: W.show("childDoseMl") ? Q.childDoseMl : ""
|
|
495
553
|
})
|
|
496
554
|
}),
|
|
497
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ v(D, {
|
|
498
556
|
item: !0,
|
|
499
557
|
xs: 12,
|
|
500
558
|
md: 3,
|
|
501
|
-
children: /* @__PURE__ */
|
|
559
|
+
children: /* @__PURE__ */ v(k, {
|
|
502
560
|
required: !0,
|
|
503
561
|
fullWidth: !0,
|
|
504
562
|
size: "small",
|
|
@@ -515,11 +573,11 @@ function F() {
|
|
|
515
573
|
helperText: W.show("openVialValidityHours") && Q.openVialValidityHours ? Q.openVialValidityHours : "0 = single-use; max 720 (~30 days)"
|
|
516
574
|
})
|
|
517
575
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ v(D, {
|
|
519
577
|
item: !0,
|
|
520
578
|
xs: 12,
|
|
521
579
|
md: 3,
|
|
522
|
-
children: /* @__PURE__ */
|
|
580
|
+
children: /* @__PURE__ */ v(k, {
|
|
523
581
|
required: !0,
|
|
524
582
|
fullWidth: !0,
|
|
525
583
|
size: "small",
|
|
@@ -536,23 +594,23 @@ function F() {
|
|
|
536
594
|
helperText: W.show("maxConcurrentOpenVials") ? Q.maxConcurrentOpenVials : ""
|
|
537
595
|
})
|
|
538
596
|
}),
|
|
539
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ v(D, {
|
|
540
598
|
item: !0,
|
|
541
599
|
xs: 12,
|
|
542
600
|
md: 3,
|
|
543
|
-
children: /* @__PURE__ */
|
|
544
|
-
control: /* @__PURE__ */
|
|
601
|
+
children: /* @__PURE__ */ v(E, {
|
|
602
|
+
control: /* @__PURE__ */ v(T, {
|
|
545
603
|
checked: !!K.vaccineConfig?.requiresReconstitution,
|
|
546
604
|
onChange: (e) => Z("requiresReconstitution", e.target.checked)
|
|
547
605
|
}),
|
|
548
606
|
label: "Requires reconstitution"
|
|
549
607
|
})
|
|
550
608
|
}),
|
|
551
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ v(D, {
|
|
552
610
|
item: !0,
|
|
553
611
|
xs: 12,
|
|
554
612
|
md: 3,
|
|
555
|
-
children: /* @__PURE__ */
|
|
613
|
+
children: /* @__PURE__ */ v(k, {
|
|
556
614
|
fullWidth: !0,
|
|
557
615
|
size: "small",
|
|
558
616
|
type: "number",
|
|
@@ -570,22 +628,22 @@ function F() {
|
|
|
570
628
|
helperText: W.show("reconstitutedValidityHours") ? Q.reconstitutedValidityHours : ""
|
|
571
629
|
})
|
|
572
630
|
}),
|
|
573
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ v(D, {
|
|
574
632
|
item: !0,
|
|
575
633
|
xs: 12,
|
|
576
634
|
md: 3,
|
|
577
|
-
children: /* @__PURE__ */
|
|
635
|
+
children: /* @__PURE__ */ v(o, {
|
|
578
636
|
label: "Route of Administration",
|
|
579
637
|
value: K.vaccineConfig?.route || "",
|
|
580
638
|
onChange: (e) => Z("route", e),
|
|
581
639
|
options: s
|
|
582
640
|
})
|
|
583
641
|
}),
|
|
584
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ v(D, {
|
|
585
643
|
item: !0,
|
|
586
644
|
xs: 12,
|
|
587
645
|
md: 3,
|
|
588
|
-
children: /* @__PURE__ */
|
|
646
|
+
children: /* @__PURE__ */ v(k, {
|
|
589
647
|
fullWidth: !0,
|
|
590
648
|
size: "small",
|
|
591
649
|
type: "number",
|
|
@@ -602,11 +660,11 @@ function F() {
|
|
|
602
660
|
helperText: W.show("storageTempMinCelsius") && Q.storageTempMinCelsius ? Q.storageTempMinCelsius : "Allowed range: −90°C to +30°C"
|
|
603
661
|
})
|
|
604
662
|
}),
|
|
605
|
-
/* @__PURE__ */
|
|
663
|
+
/* @__PURE__ */ v(D, {
|
|
606
664
|
item: !0,
|
|
607
665
|
xs: 12,
|
|
608
666
|
md: 3,
|
|
609
|
-
children: /* @__PURE__ */
|
|
667
|
+
children: /* @__PURE__ */ v(k, {
|
|
610
668
|
fullWidth: !0,
|
|
611
669
|
size: "small",
|
|
612
670
|
type: "number",
|
|
@@ -623,10 +681,10 @@ function F() {
|
|
|
623
681
|
helperText: W.show("storageTempMaxCelsius") && Q.storageTempMaxCelsius ? Q.storageTempMaxCelsius : "Allowed range: −90°C to +30°C"
|
|
624
682
|
})
|
|
625
683
|
}),
|
|
626
|
-
/* @__PURE__ */
|
|
684
|
+
/* @__PURE__ */ v(D, {
|
|
627
685
|
item: !0,
|
|
628
686
|
xs: 12,
|
|
629
|
-
children: /* @__PURE__ */
|
|
687
|
+
children: /* @__PURE__ */ v(k, {
|
|
630
688
|
fullWidth: !0,
|
|
631
689
|
size: "small",
|
|
632
690
|
multiline: !0,
|
|
@@ -645,6 +703,6 @@ function F() {
|
|
|
645
703
|
})] });
|
|
646
704
|
}
|
|
647
705
|
//#endregion
|
|
648
|
-
export {
|
|
706
|
+
export { I as default };
|
|
649
707
|
|
|
650
|
-
//# sourceMappingURL=ProductEditPage-
|
|
708
|
+
//# sourceMappingURL=ProductEditPage-BinNxjlB.js.map
|