@argusoft/medplat-core 1.0.29 → 1.0.31
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/AccessRights-DUgY6ewy.js +1031 -0
- package/dist/AccessRights-DUgY6ewy.js.map +1 -0
- package/dist/AddEditQueryBuilder-D-iQiVIe.js +365 -0
- package/dist/AddEditQueryBuilder-D-iQiVIe.js.map +1 -0
- package/dist/{AddFeatures-v3TmGQee.js → AddFeatures-D1sU8RjY.js} +2 -2
- package/dist/{AddFeatures-v3TmGQee.js.map → AddFeatures-D1sU8RjY.js.map} +1 -1
- package/dist/AddLabelModal-Bq-wRqv9.js +631 -0
- package/dist/AddLabelModal-Bq-wRqv9.js.map +1 -0
- package/dist/AddMenuConfiguration-c6ZKiN0i.js +8898 -0
- package/dist/AddMenuConfiguration-c6ZKiN0i.js.map +1 -0
- package/dist/AppModal-CCtrQ5Tr.js +394 -0
- package/dist/AppModal-CCtrQ5Tr.js.map +1 -0
- package/dist/BrandsPage-DMw2vT0u-BVhvhc6J.js +387 -0
- package/dist/BrandsPage-DMw2vT0u-BVhvhc6J.js.map +1 -0
- package/dist/CategoriesPage-D3ihx9Gi-CT58g0ry.js +398 -0
- package/dist/CategoriesPage-D3ihx9Gi-CT58g0ry.js.map +1 -0
- package/dist/{ChangePasswordModalCore-DutQAZOx.js → ChangePasswordModalCore-lQ9GamH1.js} +1605 -1610
- package/dist/ChangePasswordModalCore-lQ9GamH1.js.map +1 -0
- package/dist/ConditionConfig-BQBmBHaM.js +408 -0
- package/dist/ConditionConfig-BQBmBHaM.js.map +1 -0
- package/dist/DashboardPage-asr2XDRu-uOOlX9Vq.js +435 -0
- package/dist/DashboardPage-asr2XDRu-uOOlX9Vq.js.map +1 -0
- package/dist/EventConfig-BY2cgGyx.js +27 -0
- package/dist/EventConfig-BY2cgGyx.js.map +1 -0
- package/dist/EventConfigurations-CUPEN5BV.js +544 -0
- package/dist/EventConfigurations-CUPEN5BV.js.map +1 -0
- package/dist/EventConfigurations.css +1 -1
- package/dist/EventsExceptionModal-BX-ArkBE.js +188 -0
- package/dist/EventsExceptionModal-BX-ArkBE.js.map +1 -0
- package/dist/EventsUi-D6O9S7BK.js +258 -0
- package/dist/EventsUi-D6O9S7BK.js.map +1 -0
- package/dist/FacilityPicker-DYl_PDyt-Cbwo2tAY.js +79 -0
- package/dist/FacilityPicker-DYl_PDyt-Cbwo2tAY.js.map +1 -0
- package/dist/FeatureMenu-CHsBbw3W.js +525 -0
- package/dist/FeatureMenu-CHsBbw3W.js.map +1 -0
- package/dist/{FhirServerList-Dkq7Kbes.js → FhirServerList-iXBPkRVF.js} +22 -22
- package/dist/{FhirServerList-Dkq7Kbes.js.map → FhirServerList-iXBPkRVF.js.map} +1 -1
- package/dist/{FhirServerWizard-Db6Hm4bQ.js → FhirServerWizard-DZI8Olku.js} +15 -15
- package/dist/{FhirServerWizard-Db6Hm4bQ.js.map → FhirServerWizard-DZI8Olku.js.map} +1 -1
- package/dist/FlywayQuery-CQygj51V.js +179 -0
- package/dist/FlywayQuery-CQygj51V.js.map +1 -0
- package/dist/GrantPermissionModal-D7iNZd0M.js +239 -0
- package/dist/GrantPermissionModal-D7iNZd0M.js.map +1 -0
- package/dist/ImmunizationConfigurationBase-aUtx0JEe.js +8019 -0
- package/dist/ImmunizationConfigurationBase-aUtx0JEe.js.map +1 -0
- package/dist/ImmunizationConfigurationBase.css +1 -1
- package/dist/ImmunizationConfigurationsList-TZcLDEci.js +369 -0
- package/dist/ImmunizationConfigurationsList-TZcLDEci.js.map +1 -0
- package/dist/InventoryPage-DOotGZrj-CoPjOJEI.js +665 -0
- package/dist/InventoryPage-DOotGZrj-CoPjOJEI.js.map +1 -0
- package/dist/LanguagesModal-B3NTebYT.js +352 -0
- package/dist/LanguagesModal-B3NTebYT.js.map +1 -0
- package/dist/ManageDynamicFeature-BU0I45dd.js +4475 -0
- package/dist/ManageDynamicFeature-BU0I45dd.js.map +1 -0
- package/dist/ManageEventConfiguration-DqW3krT6.js +1216 -0
- package/dist/ManageEventConfiguration-DqW3krT6.js.map +1 -0
- package/dist/ManageEventConfiguration.css +1 -1
- package/dist/{ManageNotification-CfhHlfxA.js → ManageNotification-C5MhV77Q.js} +2 -2
- package/dist/{ManageNotification-CfhHlfxA.js.map → ManageNotification-C5MhV77Q.js.map} +1 -1
- package/dist/{ManageRole-4Y2PP4dQ.js → ManageRole-CNZBRKGU.js} +2 -2
- package/dist/{ManageRole-4Y2PP4dQ.js.map → ManageRole-CNZBRKGU.js.map} +1 -1
- package/dist/ManageTranslation-vRiptUAP.js +833 -0
- package/dist/ManageTranslation-vRiptUAP.js.map +1 -0
- package/dist/ManageTranslation.css +1 -1
- package/dist/{ManageUser-DDzyd9jm.js → ManageUser-DZltBina.js} +224 -224
- package/dist/{ManageUser-DDzyd9jm.js.map → ManageUser-DZltBina.js.map} +1 -1
- package/dist/MemberProfileCard-D5CgkTdJ-D2NgDJl3.js +272 -0
- package/dist/MemberProfileCard-D5CgkTdJ-D2NgDJl3.js.map +1 -0
- package/dist/MobileAnalytics-BLOionG_.js +17301 -0
- package/dist/MobileAnalytics-BLOionG_.js.map +1 -0
- package/dist/MobileMenuManagement-68Wijb0X.js +220 -0
- package/dist/MobileMenuManagement-68Wijb0X.js.map +1 -0
- package/dist/MobileTypeEventConfigModal-CMcj7Ozp.js +752 -0
- package/dist/MobileTypeEventConfigModal-CMcj7Ozp.js.map +1 -0
- package/dist/NotificationFlywayQuery-BAHVjf6N.js +247 -0
- package/dist/NotificationFlywayQuery-BAHVjf6N.js.map +1 -0
- package/dist/{NotificationList-BMFpNUJG.js → NotificationList-DEyRZEuM.js} +2 -2
- package/dist/{NotificationList-BMFpNUJG.js.map → NotificationList-DEyRZEuM.js.map} +1 -1
- package/dist/OtherTypeEventConfigModal-stNmuSv_.js +1812 -0
- package/dist/OtherTypeEventConfigModal-stNmuSv_.js.map +1 -0
- package/dist/PaymentCreatePage-DfvSZ-kB-CckogYoe.js +482 -0
- package/dist/PaymentCreatePage-DfvSZ-kB-CckogYoe.js.map +1 -0
- package/dist/PaymentsPage-DMNjYWAJ-ChO9IXmk.js +157 -0
- package/dist/PaymentsPage-DMNjYWAJ-ChO9IXmk.js.map +1 -0
- package/dist/PermissionsModal-CCYkcKlC.js +151 -0
- package/dist/PermissionsModal-CCYkcKlC.js.map +1 -0
- package/dist/PickupBatchLinesEditor-CE2RuyJT-BPceiJr8.js +119 -0
- package/dist/PickupBatchLinesEditor-CE2RuyJT-BPceiJr8.js.map +1 -0
- package/dist/PickupCreatePage-B4O_-vE5-DoOo9nJO.js +783 -0
- package/dist/PickupCreatePage-B4O_-vE5-DoOo9nJO.js.map +1 -0
- package/dist/PickupsPage-D7zyioJB-bHKnARYw.js +818 -0
- package/dist/PickupsPage-D7zyioJB-bHKnARYw.js.map +1 -0
- package/dist/PmGuard-BZE-y4In-D_pUm5MP.js +599 -0
- package/dist/PmGuard-BZE-y4In-D_pUm5MP.js.map +1 -0
- package/dist/ProductEditPage-BVlVUCtD-BR-tJ5Wb.js +1305 -0
- package/dist/ProductEditPage-BVlVUCtD-BR-tJ5Wb.js.map +1 -0
- package/dist/ProductsPage-DvNHIeZt-BoOOJJtk.js +253 -0
- package/dist/ProductsPage-DvNHIeZt-BoOOJJtk.js.map +1 -0
- package/dist/PurchaseCreatePage-Cq_i9snz-DRtHHFWw.js +675 -0
- package/dist/PurchaseCreatePage-Cq_i9snz-DRtHHFWw.js.map +1 -0
- package/dist/PurchaseRequestDetailPage-CA9KFOfE-CtjG4Gx6.js +1577 -0
- package/dist/PurchaseRequestDetailPage-CA9KFOfE-CtjG4Gx6.js.map +1 -0
- package/dist/PurchaseRequestsPage-DS9i4o0--TpoxA5Kd.js +279 -0
- package/dist/PurchaseRequestsPage-DS9i4o0--TpoxA5Kd.js.map +1 -0
- package/dist/PurchasesPage-DgL5T6BY-DePUuE9l.js +293 -0
- package/dist/PurchasesPage-DgL5T6BY-DePUuE9l.js.map +1 -0
- package/dist/QueryBuilder-CXaBe6sr.js +478 -0
- package/dist/QueryBuilder-CXaBe6sr.js.map +1 -0
- package/dist/{RoleManagement-DEiBNfT8.js → RoleManagement-s8iNx2Mu.js} +145 -155
- package/dist/RoleManagement-s8iNx2Mu.js.map +1 -0
- package/dist/Roles-BIyiic67.js +14 -0
- package/dist/Roles-BIyiic67.js.map +1 -0
- package/dist/SaleCreatePage-CZnIOydv-DKBw-qp7.js +544 -0
- package/dist/SaleCreatePage-CZnIOydv-DKBw-qp7.js.map +1 -0
- package/dist/SalesPage-DPIRrC_O-M8rqnK7z.js +315 -0
- package/dist/SalesPage-DPIRrC_O-M8rqnK7z.js.map +1 -0
- package/dist/SettingsPage-BC_R6Z-Q-CKNt9zRu.js +676 -0
- package/dist/SettingsPage-BC_R6Z-Q-CKNt9zRu.js.map +1 -0
- package/dist/ShowFlywayQuery-D10Olk5Z.js +154 -0
- package/dist/ShowFlywayQuery-D10Olk5Z.js.map +1 -0
- package/dist/{ShowFlywayQuery-DVRCd384.js → ShowFlywayQuery-DIOUdYfG.js} +170 -123
- package/dist/ShowFlywayQuery-DIOUdYfG.js.map +1 -0
- package/dist/ShowQueryHistory-DRBKYDKk.js +313 -0
- package/dist/ShowQueryHistory-DRBKYDKk.js.map +1 -0
- package/dist/StorageUnitsPage-BDRkdCjW-UF64rf7q.js +728 -0
- package/dist/StorageUnitsPage-BDRkdCjW-UF64rf7q.js.map +1 -0
- package/dist/SubMenu-BdMTYtC1.js +319 -0
- package/dist/SubMenu-BdMTYtC1.js.map +1 -0
- package/dist/TransactionsPage-CqWTMNU8-Df6eGFDW.js +746 -0
- package/dist/TransactionsPage-CqWTMNU8-Df6eGFDW.js.map +1 -0
- package/dist/TransferCreatePage-DF7FZaTJ-CL79V3aR.js +315 -0
- package/dist/TransferCreatePage-DF7FZaTJ-CL79V3aR.js.map +1 -0
- package/dist/TransfersPage-CGrRFaBF-cTwBUv0o.js +476 -0
- package/dist/TransfersPage-CGrRFaBF-cTwBUv0o.js.map +1 -0
- package/dist/TypeConfiguration-JbRCN6GR.js +114 -0
- package/dist/TypeConfiguration-JbRCN6GR.js.map +1 -0
- package/dist/{UserList-Bc8gYxRL.js → UserList-L41Xw0Q6.js} +253 -236
- package/dist/{UserList-Bc8gYxRL.js.map → UserList-L41Xw0Q6.js.map} +1 -1
- package/dist/Users-CsJ08Kjm.js.map +1 -1
- package/dist/VialsPage-rvvXjgZG-Oqo1v6kQ.js +321 -0
- package/dist/VialsPage-rvvXjgZG-Oqo1v6kQ.js.map +1 -0
- package/dist/constants-DpXnLsAB-D6lN5cjK.js +445 -0
- package/dist/constants-DpXnLsAB-D6lN5cjK.js.map +1 -0
- package/dist/{dashboardLayoutUtils-D1xCAxp3.js → dashboardLayoutUtils-CJivzaU1.js} +95 -92
- package/dist/dashboardLayoutUtils-CJivzaU1.js.map +1 -0
- package/dist/format-UOyOu75i-D0GyylyQ.js +63 -0
- package/dist/format-UOyOu75i-D0GyylyQ.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/index.lib-ETRQOzvE.js +894 -0
- package/dist/index.lib-ETRQOzvE.js.map +1 -0
- package/dist/listValueStore-BFQtDYIR-Bj0yX145.js +36 -0
- package/dist/listValueStore-BFQtDYIR-Bj0yX145.js.map +1 -0
- package/dist/useFieldErrors-hDG8ox_x-DbSAzrGo.js +28 -0
- package/dist/useFieldErrors-hDG8ox_x-DbSAzrGo.js.map +1 -0
- package/dist/validation-BzlHnL-r-CCJm2utQ.js +125 -0
- package/dist/validation-BzlHnL-r-CCJm2utQ.js.map +1 -0
- package/package.json +4 -3
- package/dist/AccessRights-Zm8Obm4N.js +0 -1284
- package/dist/AccessRights-Zm8Obm4N.js.map +0 -1
- package/dist/AddEditQueryBuilder-Brdnm6rQ.js +0 -313
- package/dist/AddEditQueryBuilder-Brdnm6rQ.js.map +0 -1
- package/dist/AddLabelModal-DFllBVcd.js +0 -734
- package/dist/AddLabelModal-DFllBVcd.js.map +0 -1
- package/dist/AddMenuConfiguration-Ce91MhnU.js +0 -8547
- package/dist/AddMenuConfiguration-Ce91MhnU.js.map +0 -1
- package/dist/AppModal-CtG2GjD_.js +0 -428
- package/dist/AppModal-CtG2GjD_.js.map +0 -1
- package/dist/ChangePasswordModalCore-DutQAZOx.js.map +0 -1
- package/dist/ConditionConfig-B4Ffpgj3.js +0 -395
- package/dist/ConditionConfig-B4Ffpgj3.js.map +0 -1
- package/dist/ConditionConfig.css +0 -1
- package/dist/EventConfigurations-BJcURufo.js +0 -449
- package/dist/EventConfigurations-BJcURufo.js.map +0 -1
- package/dist/EventsExceptionModal-BlZtBQoR.js +0 -200
- package/dist/EventsExceptionModal-BlZtBQoR.js.map +0 -1
- package/dist/EventsSkeleton-DK6JDKAK.js +0 -83
- package/dist/EventsSkeleton-DK6JDKAK.js.map +0 -1
- package/dist/FeatureMenu-C3503UIX.js +0 -265
- package/dist/FeatureMenu-C3503UIX.js.map +0 -1
- package/dist/FlywayQuery-Cx2sly6g.js +0 -169
- package/dist/FlywayQuery-Cx2sly6g.js.map +0 -1
- package/dist/ImmunizationConfigurationBase-DLQVSNnt.js +0 -5895
- package/dist/ImmunizationConfigurationBase-DLQVSNnt.js.map +0 -1
- package/dist/ImmunizationConfigurationsList-DdSZicTP.js +0 -344
- package/dist/ImmunizationConfigurationsList-DdSZicTP.js.map +0 -1
- package/dist/LanguagesModal-D6VfaGrl.js +0 -394
- package/dist/LanguagesModal-D6VfaGrl.js.map +0 -1
- package/dist/ManageDynamicFeature-dt096fyj.js +0 -4189
- package/dist/ManageDynamicFeature-dt096fyj.js.map +0 -1
- package/dist/ManageEventConfiguration-BpSJszSX.js +0 -1017
- package/dist/ManageEventConfiguration-BpSJszSX.js.map +0 -1
- package/dist/ManageTranslation-B4C9-lWD.js +0 -625
- package/dist/ManageTranslation-B4C9-lWD.js.map +0 -1
- package/dist/MobileMenuManagement-Cf8IZlla.js +0 -108
- package/dist/MobileMenuManagement-Cf8IZlla.js.map +0 -1
- package/dist/MobileTypeEventConfigModal-DUkUYACe.js +0 -783
- package/dist/MobileTypeEventConfigModal-DUkUYACe.js.map +0 -1
- package/dist/NotificationFlywayQuery-BY8Zzml_.js +0 -244
- package/dist/NotificationFlywayQuery-BY8Zzml_.js.map +0 -1
- package/dist/OtherTypeEventConfigModal-CYBfr2XE.js +0 -2046
- package/dist/OtherTypeEventConfigModal-CYBfr2XE.js.map +0 -1
- package/dist/QueryBuilder-z7eqfd7D.js +0 -383
- package/dist/QueryBuilder-z7eqfd7D.js.map +0 -1
- package/dist/RoleManagement-DEiBNfT8.js.map +0 -1
- package/dist/ShowFlywayQuery-DVRCd384.js.map +0 -1
- package/dist/ShowFlywayQuery-tj42YQAS.js +0 -130
- package/dist/ShowFlywayQuery-tj42YQAS.js.map +0 -1
- package/dist/ShowQueryHistory-BDN0tzHg.js +0 -190
- package/dist/ShowQueryHistory-BDN0tzHg.js.map +0 -1
- package/dist/SubMenu-B072oEGb.js +0 -191
- package/dist/SubMenu-B072oEGb.js.map +0 -1
- package/dist/TypeConfiguration-C3xoP2Nb.js +0 -117
- package/dist/TypeConfiguration-C3xoP2Nb.js.map +0 -1
- package/dist/dashboardLayoutUtils-D1xCAxp3.js.map +0 -1
- package/dist/index.lib-C3fwoM3y.js +0 -820
- package/dist/index.lib-C3fwoM3y.js.map +0 -1
|
@@ -0,0 +1,818 @@
|
|
|
1
|
+
import { B as Te, G as le, z as Ae, V as We, U as ze, Q as Oe, E as Pe, k as E, R as Ve, T as je } from "./ImmunizationConfigurationBase-aUtx0JEe.js";
|
|
2
|
+
import { y as se, x as De, O as Fe, g as Me } from "./constants-DpXnLsAB-D6lN5cjK.js";
|
|
3
|
+
import { n as ce, t as Ue, o as Ge } from "./format-UOyOu75i-D0GyylyQ.js";
|
|
4
|
+
import { X as He, Y as Ye, Z as Xe, Q as Ze, q as Je } from "./PmGuard-BZE-y4In-D_pUm5MP.js";
|
|
5
|
+
import { d as de, p as Ke, m as _e, f as et } from "./PickupBatchLinesEditor-CE2RuyJT-BPceiJr8.js";
|
|
6
|
+
import { useState as m, useMemo as $ } from "react";
|
|
7
|
+
import { jsxs as a, jsx as t, Fragment as ue } from "react/jsx-runtime";
|
|
8
|
+
import { Box as h, Alert as tt, Stack as p, TextField as S, InputAdornment as nt, TableHead as it, TableRow as U, TableCell as d, TableBody as rt, Skeleton as at, Button as y, Chip as G, Typography as s, Tooltip as ot, Dialog as pe, DialogTitle as me, DialogContent as he, Divider as lt, DialogActions as ye } from "@mui/material";
|
|
9
|
+
import { alpha as z } from "@mui/material/styles";
|
|
10
|
+
import { v4 as ge } from "uuid";
|
|
11
|
+
import O from "@mui/icons-material/AddRounded";
|
|
12
|
+
import st from "@mui/icons-material/RefreshRounded";
|
|
13
|
+
import { useNavigate as ct } from "react-router-dom";
|
|
14
|
+
import dt from "@mui/icons-material/MoveDownRounded";
|
|
15
|
+
import ut from "@mui/icons-material/SearchRounded";
|
|
16
|
+
import pt from "@mui/icons-material/GroupsRounded";
|
|
17
|
+
import mt from "@mui/icons-material/PersonRounded";
|
|
18
|
+
import ht from "@mui/icons-material/AssignmentReturnRounded";
|
|
19
|
+
import yt from "@mui/icons-material/ScienceRounded";
|
|
20
|
+
function gt(l) {
|
|
21
|
+
switch (l) {
|
|
22
|
+
case "OPEN":
|
|
23
|
+
return "info";
|
|
24
|
+
case "RETURNED":
|
|
25
|
+
return "success";
|
|
26
|
+
case "CANCELLED":
|
|
27
|
+
return "default";
|
|
28
|
+
default:
|
|
29
|
+
return "default";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function g(l) {
|
|
33
|
+
return l != null && l.lines && l.lines.length > 0 ? l.lines : [{
|
|
34
|
+
id: l.id,
|
|
35
|
+
productName: l.productName,
|
|
36
|
+
lotNumber: l.lotNumber,
|
|
37
|
+
expiryDate: l.expiryDate,
|
|
38
|
+
pickedQty: l.pickedQty,
|
|
39
|
+
sourceBatchQtyRemaining: l.sourceBatchQtyRemaining,
|
|
40
|
+
expectedRemainingQty: l.expectedRemainingQty,
|
|
41
|
+
openVials: l.openVials ?? []
|
|
42
|
+
}];
|
|
43
|
+
}
|
|
44
|
+
function fe(l, f) {
|
|
45
|
+
if (l <= 0) return "";
|
|
46
|
+
let x = `${l} open vial${l === 1 ? "" : "s"}`;
|
|
47
|
+
return f > 0 ? `${x} with ${Ge(f, 1)} ml left` : x;
|
|
48
|
+
}
|
|
49
|
+
function ft(l, f, x) {
|
|
50
|
+
let N = l != null && l > 0 ? `${l} sealed unit${l === 1 ? "" : "s"} will be wasted` : "", v = f > 0 ? `${fe(f, x)} will be closed as wastage` : "";
|
|
51
|
+
return N && v ? `${N}, and ${v}.` : N ? `${N}.` : v ? `All sealed units are coming back, but ${v}.` : "";
|
|
52
|
+
}
|
|
53
|
+
function zt() {
|
|
54
|
+
var re, ae;
|
|
55
|
+
let l = ct(), f = He().has("update.manage.productManagement.pickup"), [x, N] = m([]), [v, H] = m(!0), [Y, X] = m(""), [I, be] = m(""), [R, we] = m("OPEN"), [b, Z] = m({
|
|
56
|
+
open: !1,
|
|
57
|
+
pickup: null
|
|
58
|
+
}), [B, P] = m({
|
|
59
|
+
lines: {},
|
|
60
|
+
notes: ""
|
|
61
|
+
}), [c, J] = m({
|
|
62
|
+
open: !1,
|
|
63
|
+
pickup: null
|
|
64
|
+
}), [u, Q] = m({
|
|
65
|
+
qty: {},
|
|
66
|
+
newLines: [],
|
|
67
|
+
notes: ""
|
|
68
|
+
}), [V, ke] = m([]), [w, q] = m(!1);
|
|
69
|
+
async function T() {
|
|
70
|
+
var e, n;
|
|
71
|
+
H(!0), X("");
|
|
72
|
+
try {
|
|
73
|
+
let [i, r] = await Promise.all([Oe(), Pe().catch(() => [])]);
|
|
74
|
+
N(i), ke(r);
|
|
75
|
+
} catch (i) {
|
|
76
|
+
let r = ((n = (e = i == null ? void 0 : i.response) == null ? void 0 : e.data) == null ? void 0 : n.message) ?? (i == null ? void 0 : i.message) ?? "Failed to load pickups";
|
|
77
|
+
X(r), E({
|
|
78
|
+
message: r,
|
|
79
|
+
type: "error"
|
|
80
|
+
});
|
|
81
|
+
} finally {
|
|
82
|
+
H(!1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
Ye("view.manage.productManagement.pickup", () => {
|
|
86
|
+
T();
|
|
87
|
+
}, []);
|
|
88
|
+
let A = $(() => {
|
|
89
|
+
let e = I.trim().toLowerCase();
|
|
90
|
+
return x.filter((n) => {
|
|
91
|
+
if (R !== "ALL" && n.status !== R) return !1;
|
|
92
|
+
if (!e) return !0;
|
|
93
|
+
let i = g(n).map((o) => o.productName ?? "").join(" "), r = (n.members ?? []).map((o) => o.name ?? "").join(" ");
|
|
94
|
+
return `${n.sessionName ?? ""} ${n.sessionSite ?? ""} ${i} ${n.facilityName ?? ""} ${n.userName ?? ""} ${r} ${n.notes ?? ""}`.toLowerCase().includes(e);
|
|
95
|
+
});
|
|
96
|
+
}, [
|
|
97
|
+
x,
|
|
98
|
+
I,
|
|
99
|
+
R
|
|
100
|
+
]);
|
|
101
|
+
function xe(e) {
|
|
102
|
+
let n = {};
|
|
103
|
+
g(e).forEach((i) => {
|
|
104
|
+
n[i.id] = {
|
|
105
|
+
returnedQty: String(i.expectedRemainingQty ?? 0),
|
|
106
|
+
wastageReason: ""
|
|
107
|
+
};
|
|
108
|
+
}), P({
|
|
109
|
+
lines: n,
|
|
110
|
+
notes: ""
|
|
111
|
+
}), Z({
|
|
112
|
+
open: !0,
|
|
113
|
+
pickup: e
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function j() {
|
|
117
|
+
w || Z({
|
|
118
|
+
open: !1,
|
|
119
|
+
pickup: null
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
let L = $(() => b.pickup ? g(b.pickup).map((e) => {
|
|
123
|
+
let n = Number(e.expectedRemainingQty ?? 0), i = B.lines[e.id] || {
|
|
124
|
+
returnedQty: "",
|
|
125
|
+
wastageReason: ""
|
|
126
|
+
}, r = Number(i.returnedQty), o = e.openVials ?? [], k = Number.isInteger(r) && r >= 0 && r <= n, W = k ? n - r : null, oe = W != null && W > 0 || o.length > 0, Ee = k ? "" : n === 0 ? "Nothing is due back, so this must stay 0." : `Enter 0 to ${n}.`, Se = oe && !i.wastageReason ? "Reason required." : "", M = o.reduce((Be, qe) => Be + Number(qe.volumeRemainingMl ?? 0), 0);
|
|
127
|
+
return {
|
|
128
|
+
line: e,
|
|
129
|
+
expected: n,
|
|
130
|
+
entry: i,
|
|
131
|
+
returnedQty: r,
|
|
132
|
+
wastedQty: W,
|
|
133
|
+
openVials: o,
|
|
134
|
+
openVialVolumeMl: M,
|
|
135
|
+
openVialLabel: fe(o.length, M),
|
|
136
|
+
reasonRequired: oe,
|
|
137
|
+
reasonBecause: ft(W, o.length, M),
|
|
138
|
+
qtyError: Ee,
|
|
139
|
+
reasonError: Se
|
|
140
|
+
};
|
|
141
|
+
}) : [], [b.pickup, B]), K = L.length > 0 && L.every((e) => !e.qtyError && !e.reasonError);
|
|
142
|
+
function _(e, n, i) {
|
|
143
|
+
P((r) => ({
|
|
144
|
+
...r,
|
|
145
|
+
lines: {
|
|
146
|
+
...r.lines,
|
|
147
|
+
[e]: {
|
|
148
|
+
...r.lines[e],
|
|
149
|
+
[n]: i
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
async function ve() {
|
|
155
|
+
var e, n;
|
|
156
|
+
if (!(!K || !b.pickup)) {
|
|
157
|
+
q(!0);
|
|
158
|
+
try {
|
|
159
|
+
await Ve(b.pickup.id, {
|
|
160
|
+
lines: L.map((o) => ({
|
|
161
|
+
lineId: o.line.id,
|
|
162
|
+
returnedQty: o.returnedQty,
|
|
163
|
+
wastageReason: o.reasonRequired ? o.entry.wastageReason : null
|
|
164
|
+
})),
|
|
165
|
+
notes: B.notes || null
|
|
166
|
+
});
|
|
167
|
+
let i = L.reduce((o, k) => o + k.returnedQty, 0), r = L.reduce((o, k) => o + (k.wastedQty ?? 0), 0);
|
|
168
|
+
E({
|
|
169
|
+
message: r > 0 ? `Returned ${i}, wasted ${r}.` : `Returned ${i} unit${i === 1 ? "" : "s"}.`,
|
|
170
|
+
type: "success"
|
|
171
|
+
}), j(), await T();
|
|
172
|
+
} catch (i) {
|
|
173
|
+
E({
|
|
174
|
+
message: ((n = (e = i == null ? void 0 : i.response) == null ? void 0 : e.data) == null ? void 0 : n.message) ?? (i == null ? void 0 : i.message) ?? "Failed to record return",
|
|
175
|
+
type: "error"
|
|
176
|
+
});
|
|
177
|
+
} finally {
|
|
178
|
+
q(!1);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function $e(e) {
|
|
183
|
+
let n = {};
|
|
184
|
+
g(e).forEach((i) => {
|
|
185
|
+
n[i.id] = "";
|
|
186
|
+
}), Q({
|
|
187
|
+
qty: n,
|
|
188
|
+
newLines: [],
|
|
189
|
+
notes: ""
|
|
190
|
+
}), J({
|
|
191
|
+
open: !0,
|
|
192
|
+
pickup: e
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function D() {
|
|
196
|
+
w || J({
|
|
197
|
+
open: !1,
|
|
198
|
+
pickup: null
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
function Ne(e, n) {
|
|
202
|
+
Q((i) => ({
|
|
203
|
+
...i,
|
|
204
|
+
qty: {
|
|
205
|
+
...i.qty,
|
|
206
|
+
[e]: n
|
|
207
|
+
}
|
|
208
|
+
}));
|
|
209
|
+
}
|
|
210
|
+
function Re(e, n, i) {
|
|
211
|
+
Q((r) => {
|
|
212
|
+
let o = r.newLines.slice();
|
|
213
|
+
return o[e] = {
|
|
214
|
+
...o[e],
|
|
215
|
+
[n]: i
|
|
216
|
+
}, {
|
|
217
|
+
...r,
|
|
218
|
+
newLines: o
|
|
219
|
+
};
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
function Qe() {
|
|
223
|
+
Q((e) => ({
|
|
224
|
+
...e,
|
|
225
|
+
newLines: [...e.newLines, et(ge)]
|
|
226
|
+
}));
|
|
227
|
+
}
|
|
228
|
+
function Le(e) {
|
|
229
|
+
Q((n) => ({
|
|
230
|
+
...n,
|
|
231
|
+
newLines: n.newLines.filter((i, r) => r !== e)
|
|
232
|
+
}));
|
|
233
|
+
}
|
|
234
|
+
let F = $(() => c.pickup ? V.filter(de).filter((e) => e.ownerId === c.pickup.facilityId) : [], [V, c.pickup]), Ce = $(() => c.pickup ? new Set(g(c.pickup).map((e) => e.sourceBatchId).filter(Boolean)) : /* @__PURE__ */ new Set(), [c.pickup]), ee = $(() => {
|
|
235
|
+
if (!c.pickup) return {};
|
|
236
|
+
let e = {};
|
|
237
|
+
return g(c.pickup).forEach((n) => {
|
|
238
|
+
let i = u.qty[n.id];
|
|
239
|
+
if (i === "" || i == null) return;
|
|
240
|
+
let r = Number(i), o = n.sourceBatchQtyRemaining ?? 0;
|
|
241
|
+
!Number.isInteger(r) || r <= 0 ? e[n.id] = "Enter a whole number greater than 0." : r > o && (e[n.id] = `Only ${o} left at the source.`);
|
|
242
|
+
}), e;
|
|
243
|
+
}, [c.pickup, u.qty]), te = $(() => Ke(u.newLines, F), [u.newLines, F]), C = $(() => c.pickup ? {
|
|
244
|
+
topups: g(c.pickup).map((e) => ({
|
|
245
|
+
lineId: e.id,
|
|
246
|
+
additionalQty: Number(u.qty[e.id])
|
|
247
|
+
})).filter((e) => Number.isInteger(e.additionalQty) && e.additionalQty > 0),
|
|
248
|
+
newLines: u.newLines.map((e) => ({
|
|
249
|
+
sourceBatchId: e.sourceBatchId,
|
|
250
|
+
personalBatchId: e.personalBatchId,
|
|
251
|
+
pickedQty: Number(e.pickedQty)
|
|
252
|
+
}))
|
|
253
|
+
} : {
|
|
254
|
+
topups: [],
|
|
255
|
+
newLines: []
|
|
256
|
+
}, [c.pickup, u]), ne = Object.keys(ee).length === 0 && te.every((e) => Object.keys(e).length === 0) && (C.topups.length > 0 || C.newLines.length > 0);
|
|
257
|
+
async function Ie() {
|
|
258
|
+
var e, n;
|
|
259
|
+
if (!(!ne || !c.pickup)) {
|
|
260
|
+
q(!0);
|
|
261
|
+
try {
|
|
262
|
+
await je(c.pickup.id, {
|
|
263
|
+
id: ge(),
|
|
264
|
+
topups: C.topups,
|
|
265
|
+
newLines: C.newLines,
|
|
266
|
+
notes: u.notes || null
|
|
267
|
+
});
|
|
268
|
+
let i = C.topups.reduce((r, o) => r + o.additionalQty, 0) + C.newLines.reduce((r, o) => r + o.pickedQty, 0);
|
|
269
|
+
E({
|
|
270
|
+
message: `Added ${i} unit${i === 1 ? "" : "s"} to the session.`,
|
|
271
|
+
type: "success"
|
|
272
|
+
}), D(), await T();
|
|
273
|
+
} catch (i) {
|
|
274
|
+
E({
|
|
275
|
+
message: ((n = (e = i == null ? void 0 : i.response) == null ? void 0 : e.data) == null ? void 0 : n.message) ?? (i == null ? void 0 : i.message) ?? "Failed to top up",
|
|
276
|
+
type: "error"
|
|
277
|
+
});
|
|
278
|
+
} finally {
|
|
279
|
+
q(!1);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
function ie(e) {
|
|
284
|
+
return g(e).some((n) => (n.sourceBatchQtyRemaining ?? 0) > 0) ? !0 : V.some((n) => de(n) && n.ownerId === e.facilityId);
|
|
285
|
+
}
|
|
286
|
+
return /* @__PURE__ */ a(h, { children: [
|
|
287
|
+
/* @__PURE__ */ t(Xe, {}),
|
|
288
|
+
/* @__PURE__ */ t(Ze, {
|
|
289
|
+
perm: "view.manage.productManagement.pickup",
|
|
290
|
+
children: /* @__PURE__ */ a(Je, {
|
|
291
|
+
title: "Stock Pickups",
|
|
292
|
+
subtitle: "Sessions where stock is out in the field. Record returns and any items lost or used.",
|
|
293
|
+
actions: /* @__PURE__ */ a(p, {
|
|
294
|
+
direction: "row",
|
|
295
|
+
spacing: 1,
|
|
296
|
+
children: [/* @__PURE__ */ t(y, {
|
|
297
|
+
variant: "outlined",
|
|
298
|
+
startIcon: /* @__PURE__ */ t(st, {}),
|
|
299
|
+
onClick: () => void T(),
|
|
300
|
+
children: "Refresh"
|
|
301
|
+
}), f ? /* @__PURE__ */ t(y, {
|
|
302
|
+
variant: "contained",
|
|
303
|
+
startIcon: /* @__PURE__ */ t(O, {}),
|
|
304
|
+
onClick: () => l("/ui/medplat/manage/pm/pickups/new"),
|
|
305
|
+
children: "New Session"
|
|
306
|
+
}) : null]
|
|
307
|
+
}),
|
|
308
|
+
children: [Y ? /* @__PURE__ */ t(tt, {
|
|
309
|
+
severity: "error",
|
|
310
|
+
sx: { mb: 2 },
|
|
311
|
+
children: Y
|
|
312
|
+
}) : null, /* @__PURE__ */ a(Te, {
|
|
313
|
+
eyebrow: "Operations",
|
|
314
|
+
title: "Sessions",
|
|
315
|
+
subtitle: v ? "Loading…" : `${A.length} ${A.length === 1 ? "session" : "sessions"}`,
|
|
316
|
+
children: [/* @__PURE__ */ a(p, {
|
|
317
|
+
direction: {
|
|
318
|
+
xs: "column",
|
|
319
|
+
md: "row"
|
|
320
|
+
},
|
|
321
|
+
spacing: 1.5,
|
|
322
|
+
sx: { mb: 2 },
|
|
323
|
+
alignItems: { md: "center" },
|
|
324
|
+
children: [/* @__PURE__ */ t(S, {
|
|
325
|
+
size: "small",
|
|
326
|
+
fullWidth: !0,
|
|
327
|
+
placeholder: "Search by session, product, facility, user, member, notes…",
|
|
328
|
+
value: I,
|
|
329
|
+
onChange: (e) => be(e.target.value),
|
|
330
|
+
InputProps: { startAdornment: /* @__PURE__ */ t(nt, {
|
|
331
|
+
position: "start",
|
|
332
|
+
children: /* @__PURE__ */ t(ut, { fontSize: "small" })
|
|
333
|
+
}) }
|
|
334
|
+
}), /* @__PURE__ */ t(h, {
|
|
335
|
+
sx: {
|
|
336
|
+
minWidth: { md: 200 },
|
|
337
|
+
width: {
|
|
338
|
+
xs: "100%",
|
|
339
|
+
md: "auto"
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
children: /* @__PURE__ */ t(le, {
|
|
343
|
+
label: "Status",
|
|
344
|
+
value: R,
|
|
345
|
+
onChange: we,
|
|
346
|
+
options: [{
|
|
347
|
+
value: "ALL",
|
|
348
|
+
label: "All statuses"
|
|
349
|
+
}, ...se]
|
|
350
|
+
})
|
|
351
|
+
})]
|
|
352
|
+
}), /* @__PURE__ */ a(Ae, {
|
|
353
|
+
dense: !0,
|
|
354
|
+
children: [/* @__PURE__ */ t(it, { children: /* @__PURE__ */ a(U, { children: [
|
|
355
|
+
/* @__PURE__ */ t(d, { children: "Ref" }),
|
|
356
|
+
/* @__PURE__ */ t(d, { children: "Session" }),
|
|
357
|
+
/* @__PURE__ */ t(d, { children: "Batches" }),
|
|
358
|
+
/* @__PURE__ */ t(d, { children: "Facility" }),
|
|
359
|
+
/* @__PURE__ */ t(d, { children: "Creator" }),
|
|
360
|
+
/* @__PURE__ */ t(d, {
|
|
361
|
+
align: "right",
|
|
362
|
+
children: "Qty"
|
|
363
|
+
}),
|
|
364
|
+
/* @__PURE__ */ t(d, { children: "Picked" }),
|
|
365
|
+
/* @__PURE__ */ t(d, { children: "Status" }),
|
|
366
|
+
/* @__PURE__ */ t(d, {
|
|
367
|
+
align: "right",
|
|
368
|
+
children: "Action"
|
|
369
|
+
})
|
|
370
|
+
] }) }), /* @__PURE__ */ t(rt, { children: v ? Array.from({ length: 4 }).map((e, n) => /* @__PURE__ */ t(U, { children: Array.from({ length: 9 }).map((i, r) => /* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(at, { height: 22 }) }, r)) }, n)) : A.length === 0 ? /* @__PURE__ */ t(We, {
|
|
371
|
+
colSpan: 9,
|
|
372
|
+
icon: dt,
|
|
373
|
+
title: I.trim() !== "" || R !== "ALL" ? "No sessions match your filters" : "No sessions yet",
|
|
374
|
+
hint: R === "OPEN" && I.trim() === "" ? "No active sessions. Switch Status to see returned or cancelled ones." : "Check out stock from a facility to use in the field.",
|
|
375
|
+
action: f ? /* @__PURE__ */ t(y, {
|
|
376
|
+
variant: "contained",
|
|
377
|
+
size: "small",
|
|
378
|
+
startIcon: /* @__PURE__ */ t(O, {}),
|
|
379
|
+
onClick: () => l("/ui/medplat/manage/pm/pickups/new"),
|
|
380
|
+
children: "Start first session"
|
|
381
|
+
}) : null
|
|
382
|
+
}) : A.map((e) => {
|
|
383
|
+
let n = g(e), i = n.reduce((o, k) => o + Number(k.expectedRemainingQty ?? 0), 0), r = e.sessionType === "GROUP";
|
|
384
|
+
return /* @__PURE__ */ a(U, {
|
|
385
|
+
hover: !0,
|
|
386
|
+
children: [
|
|
387
|
+
/* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(ze, { id: e.serialId }) }),
|
|
388
|
+
/* @__PURE__ */ a(d, {
|
|
389
|
+
sx: { maxWidth: 240 },
|
|
390
|
+
children: [
|
|
391
|
+
/* @__PURE__ */ t(p, {
|
|
392
|
+
direction: "row",
|
|
393
|
+
spacing: 0.5,
|
|
394
|
+
alignItems: "center",
|
|
395
|
+
sx: { mb: 0.25 },
|
|
396
|
+
children: /* @__PURE__ */ t(G, {
|
|
397
|
+
size: "small",
|
|
398
|
+
variant: "outlined",
|
|
399
|
+
icon: t(r ? pt : mt, {}),
|
|
400
|
+
label: r ? `Group · ${(e.members ?? []).length}` : "Individual",
|
|
401
|
+
color: r ? "secondary" : "default"
|
|
402
|
+
})
|
|
403
|
+
}),
|
|
404
|
+
/* @__PURE__ */ t(s, {
|
|
405
|
+
variant: "body2",
|
|
406
|
+
sx: {
|
|
407
|
+
fontWeight: 700,
|
|
408
|
+
wordBreak: "break-word"
|
|
409
|
+
},
|
|
410
|
+
children: e.sessionName ?? "—"
|
|
411
|
+
}),
|
|
412
|
+
e.sessionSite ? /* @__PURE__ */ t(s, {
|
|
413
|
+
variant: "caption",
|
|
414
|
+
color: "text.secondary",
|
|
415
|
+
sx: {
|
|
416
|
+
display: "block",
|
|
417
|
+
wordBreak: "break-word"
|
|
418
|
+
},
|
|
419
|
+
children: e.sessionSite
|
|
420
|
+
}) : null,
|
|
421
|
+
e.sessionStartTime ? /* @__PURE__ */ a(s, {
|
|
422
|
+
variant: "caption",
|
|
423
|
+
color: "text.secondary",
|
|
424
|
+
sx: {
|
|
425
|
+
display: "block",
|
|
426
|
+
fontVariantNumeric: "tabular-nums"
|
|
427
|
+
},
|
|
428
|
+
children: [ce(e.sessionStartTime), e.sessionExpectedEndTime ? ` → ${ce(e.sessionExpectedEndTime)}` : ""]
|
|
429
|
+
}) : null
|
|
430
|
+
]
|
|
431
|
+
}),
|
|
432
|
+
/* @__PURE__ */ t(d, {
|
|
433
|
+
sx: { maxWidth: 220 },
|
|
434
|
+
children: n.length === 1 ? /* @__PURE__ */ a(ue, { children: [/* @__PURE__ */ t(s, {
|
|
435
|
+
variant: "body2",
|
|
436
|
+
sx: { fontWeight: 700 },
|
|
437
|
+
children: n[0].productName ?? "—"
|
|
438
|
+
}), n[0].lotNumber ? /* @__PURE__ */ t(s, {
|
|
439
|
+
variant: "caption",
|
|
440
|
+
sx: {
|
|
441
|
+
fontFamily: "monospace",
|
|
442
|
+
color: "text.secondary"
|
|
443
|
+
},
|
|
444
|
+
children: n[0].lotNumber
|
|
445
|
+
}) : null] }) : /* @__PURE__ */ a(ue, { children: [/* @__PURE__ */ a(s, {
|
|
446
|
+
variant: "body2",
|
|
447
|
+
sx: { fontWeight: 700 },
|
|
448
|
+
children: [n.length, " batches"]
|
|
449
|
+
}), /* @__PURE__ */ a(s, {
|
|
450
|
+
variant: "caption",
|
|
451
|
+
color: "text.secondary",
|
|
452
|
+
sx: {
|
|
453
|
+
display: "block",
|
|
454
|
+
wordBreak: "break-word"
|
|
455
|
+
},
|
|
456
|
+
children: [n.map((o) => o.productName).filter(Boolean).slice(0, 3).join(", "), n.length > 3 ? "…" : ""]
|
|
457
|
+
})] })
|
|
458
|
+
}),
|
|
459
|
+
/* @__PURE__ */ t(d, { children: e.facilityName ?? "—" }),
|
|
460
|
+
/* @__PURE__ */ t(d, { children: e.userName ?? "—" }),
|
|
461
|
+
/* @__PURE__ */ a(d, {
|
|
462
|
+
align: "right",
|
|
463
|
+
children: [/* @__PURE__ */ t(s, {
|
|
464
|
+
sx: {
|
|
465
|
+
fontWeight: 700,
|
|
466
|
+
fontVariantNumeric: "tabular-nums"
|
|
467
|
+
},
|
|
468
|
+
children: e.pickedQty
|
|
469
|
+
}), e.status === "OPEN" ? /* @__PURE__ */ a(s, {
|
|
470
|
+
variant: "caption",
|
|
471
|
+
color: "text.secondary",
|
|
472
|
+
children: [i, " left"]
|
|
473
|
+
}) : e.status === "RETURNED" ? /* @__PURE__ */ a(s, {
|
|
474
|
+
variant: "caption",
|
|
475
|
+
color: "text.secondary",
|
|
476
|
+
children: [
|
|
477
|
+
e.returnedQty,
|
|
478
|
+
" returned",
|
|
479
|
+
e.wastedQty > 0 ? ` · ${e.wastedQty} wasted` : ""
|
|
480
|
+
]
|
|
481
|
+
}) : null]
|
|
482
|
+
}),
|
|
483
|
+
/* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(s, {
|
|
484
|
+
variant: "body2",
|
|
485
|
+
children: Ue(e.pickedOn)
|
|
486
|
+
}) }),
|
|
487
|
+
/* @__PURE__ */ t(d, { children: De(e) ? /* @__PURE__ */ t(G, {
|
|
488
|
+
size: "small",
|
|
489
|
+
label: "Overdue",
|
|
490
|
+
color: "error"
|
|
491
|
+
}) : /* @__PURE__ */ t(G, {
|
|
492
|
+
size: "small",
|
|
493
|
+
label: Fe(se, e.status),
|
|
494
|
+
color: gt(e.status)
|
|
495
|
+
}) }),
|
|
496
|
+
/* @__PURE__ */ t(d, {
|
|
497
|
+
align: "right",
|
|
498
|
+
children: e.status === "OPEN" && f && e.isCreator ? /* @__PURE__ */ a(p, {
|
|
499
|
+
direction: "row",
|
|
500
|
+
spacing: 1,
|
|
501
|
+
justifyContent: "flex-end",
|
|
502
|
+
children: [/* @__PURE__ */ t(ot, {
|
|
503
|
+
title: ie(e) ? "" : "No stock left in the source lots to top up from",
|
|
504
|
+
children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(y, {
|
|
505
|
+
size: "small",
|
|
506
|
+
variant: "outlined",
|
|
507
|
+
startIcon: /* @__PURE__ */ t(O, {}),
|
|
508
|
+
disabled: !ie(e),
|
|
509
|
+
onClick: () => $e(e),
|
|
510
|
+
children: "Top Up"
|
|
511
|
+
}) })
|
|
512
|
+
}), /* @__PURE__ */ t(y, {
|
|
513
|
+
size: "small",
|
|
514
|
+
variant: "outlined",
|
|
515
|
+
startIcon: /* @__PURE__ */ t(ht, {}),
|
|
516
|
+
onClick: () => xe(e),
|
|
517
|
+
children: "End Session"
|
|
518
|
+
})]
|
|
519
|
+
}) : e.status === "OPEN" && !e.isCreator ? /* @__PURE__ */ t(s, {
|
|
520
|
+
variant: "caption",
|
|
521
|
+
color: "text.disabled",
|
|
522
|
+
children: "Creator only"
|
|
523
|
+
}) : /* @__PURE__ */ t(s, {
|
|
524
|
+
variant: "caption",
|
|
525
|
+
color: "text.disabled",
|
|
526
|
+
children: "—"
|
|
527
|
+
})
|
|
528
|
+
})
|
|
529
|
+
]
|
|
530
|
+
}, e.id);
|
|
531
|
+
}) })]
|
|
532
|
+
})]
|
|
533
|
+
})]
|
|
534
|
+
})
|
|
535
|
+
}),
|
|
536
|
+
/* @__PURE__ */ a(pe, {
|
|
537
|
+
open: b.open,
|
|
538
|
+
onClose: j,
|
|
539
|
+
maxWidth: "md",
|
|
540
|
+
fullWidth: !0,
|
|
541
|
+
children: [
|
|
542
|
+
/* @__PURE__ */ a(me, { children: ["End session #", (re = b.pickup) == null ? void 0 : re.serialId] }),
|
|
543
|
+
/* @__PURE__ */ t(he, { children: b.pickup ? /* @__PURE__ */ a(p, {
|
|
544
|
+
spacing: 2,
|
|
545
|
+
sx: { mt: 1 },
|
|
546
|
+
children: [
|
|
547
|
+
/* @__PURE__ */ a(s, {
|
|
548
|
+
variant: "body2",
|
|
549
|
+
color: "text.secondary",
|
|
550
|
+
children: [
|
|
551
|
+
"For each batch, enter how many sealed units come back. Anything short is recorded as wastage, and any open vials are closed as wastage too. Returned units go back to ",
|
|
552
|
+
b.pickup.facilityName,
|
|
553
|
+
"."
|
|
554
|
+
]
|
|
555
|
+
}),
|
|
556
|
+
/* @__PURE__ */ t(h, {
|
|
557
|
+
sx: {
|
|
558
|
+
maxHeight: 380,
|
|
559
|
+
overflowY: "auto",
|
|
560
|
+
pr: 0.5
|
|
561
|
+
},
|
|
562
|
+
children: /* @__PURE__ */ t(p, {
|
|
563
|
+
spacing: 1.5,
|
|
564
|
+
children: L.map((e) => /* @__PURE__ */ a(h, {
|
|
565
|
+
sx: (n) => ({
|
|
566
|
+
p: 1.5,
|
|
567
|
+
borderRadius: 1.5,
|
|
568
|
+
bgcolor: z(n.palette.primary.main, 0.03),
|
|
569
|
+
border: `1px solid ${z(n.palette.primary.main, 0.12)}`
|
|
570
|
+
}),
|
|
571
|
+
children: [
|
|
572
|
+
/* @__PURE__ */ a(s, {
|
|
573
|
+
variant: "body2",
|
|
574
|
+
sx: { fontWeight: 700 },
|
|
575
|
+
children: [e.line.productName, e.line.lotNumber ? /* @__PURE__ */ t(s, {
|
|
576
|
+
component: "span",
|
|
577
|
+
variant: "caption",
|
|
578
|
+
sx: {
|
|
579
|
+
fontFamily: "monospace",
|
|
580
|
+
ml: 1,
|
|
581
|
+
color: "text.secondary"
|
|
582
|
+
},
|
|
583
|
+
children: e.line.lotNumber
|
|
584
|
+
}) : null]
|
|
585
|
+
}),
|
|
586
|
+
/* @__PURE__ */ a(s, {
|
|
587
|
+
variant: "caption",
|
|
588
|
+
color: "text.secondary",
|
|
589
|
+
sx: { display: "block" },
|
|
590
|
+
children: ["Sealed units expected back: ", /* @__PURE__ */ t("strong", { children: e.expected })]
|
|
591
|
+
}),
|
|
592
|
+
e.openVials.length > 0 ? /* @__PURE__ */ a(p, {
|
|
593
|
+
direction: "row",
|
|
594
|
+
spacing: 0.75,
|
|
595
|
+
alignItems: "center",
|
|
596
|
+
sx: { mt: 0.25 },
|
|
597
|
+
children: [/* @__PURE__ */ t(yt, { sx: {
|
|
598
|
+
fontSize: 16,
|
|
599
|
+
color: "warning.main"
|
|
600
|
+
} }), /* @__PURE__ */ a(s, {
|
|
601
|
+
variant: "caption",
|
|
602
|
+
sx: {
|
|
603
|
+
color: "warning.main",
|
|
604
|
+
fontWeight: 600
|
|
605
|
+
},
|
|
606
|
+
children: [e.openVialLabel, " · will be closed as wastage"]
|
|
607
|
+
})]
|
|
608
|
+
}) : null,
|
|
609
|
+
/* @__PURE__ */ a(p, {
|
|
610
|
+
direction: {
|
|
611
|
+
xs: "column",
|
|
612
|
+
sm: "row"
|
|
613
|
+
},
|
|
614
|
+
spacing: 1.5,
|
|
615
|
+
alignItems: { sm: "flex-start" },
|
|
616
|
+
sx: { mt: 1 },
|
|
617
|
+
children: [/* @__PURE__ */ t(S, {
|
|
618
|
+
required: !0,
|
|
619
|
+
size: "small",
|
|
620
|
+
type: "number",
|
|
621
|
+
sx: { width: { sm: 160 } },
|
|
622
|
+
label: "Returned",
|
|
623
|
+
disabled: e.expected === 0,
|
|
624
|
+
inputProps: {
|
|
625
|
+
min: 0,
|
|
626
|
+
max: e.expected
|
|
627
|
+
},
|
|
628
|
+
value: e.entry.returnedQty,
|
|
629
|
+
onChange: (n) => _(e.line.id, "returnedQty", n.target.value),
|
|
630
|
+
error: !!e.qtyError,
|
|
631
|
+
helperText: e.qtyError || (e.expected === 0 ? "No sealed units left to return." : "") || (e.wastedQty > 0 ? `${e.wastedQty} will be wasted` : " ")
|
|
632
|
+
}), /* @__PURE__ */ t(h, {
|
|
633
|
+
sx: {
|
|
634
|
+
flex: 1,
|
|
635
|
+
minWidth: 180
|
|
636
|
+
},
|
|
637
|
+
children: /* @__PURE__ */ t(le, {
|
|
638
|
+
label: `Wastage reason${e.reasonRequired ? " *" : ""}`,
|
|
639
|
+
disabled: !e.reasonRequired,
|
|
640
|
+
error: !!e.reasonError,
|
|
641
|
+
value: e.entry.wastageReason,
|
|
642
|
+
onChange: (n) => _(e.line.id, "wastageReason", n),
|
|
643
|
+
options: Me,
|
|
644
|
+
helperText: e.reasonRequired ? [e.reasonError, e.reasonBecause].filter(Boolean).join(" ") : "Not needed."
|
|
645
|
+
})
|
|
646
|
+
})]
|
|
647
|
+
})
|
|
648
|
+
]
|
|
649
|
+
}, e.line.id))
|
|
650
|
+
})
|
|
651
|
+
}),
|
|
652
|
+
/* @__PURE__ */ t(lt, {}),
|
|
653
|
+
/* @__PURE__ */ t(S, {
|
|
654
|
+
size: "small",
|
|
655
|
+
multiline: !0,
|
|
656
|
+
minRows: 2,
|
|
657
|
+
label: "Notes (optional)",
|
|
658
|
+
value: B.notes,
|
|
659
|
+
onChange: (e) => P((n) => ({
|
|
660
|
+
...n,
|
|
661
|
+
notes: e.target.value
|
|
662
|
+
}))
|
|
663
|
+
})
|
|
664
|
+
]
|
|
665
|
+
}) : null }),
|
|
666
|
+
/* @__PURE__ */ a(ye, { children: [/* @__PURE__ */ t(y, {
|
|
667
|
+
onClick: j,
|
|
668
|
+
disabled: w,
|
|
669
|
+
children: "Cancel"
|
|
670
|
+
}), /* @__PURE__ */ t(y, {
|
|
671
|
+
variant: "contained",
|
|
672
|
+
onClick: () => void ve(),
|
|
673
|
+
disabled: !K || w,
|
|
674
|
+
children: w ? "Submitting…" : "End Session"
|
|
675
|
+
})] })
|
|
676
|
+
]
|
|
677
|
+
}),
|
|
678
|
+
/* @__PURE__ */ a(pe, {
|
|
679
|
+
open: c.open,
|
|
680
|
+
onClose: D,
|
|
681
|
+
maxWidth: "md",
|
|
682
|
+
fullWidth: !0,
|
|
683
|
+
children: [
|
|
684
|
+
/* @__PURE__ */ a(me, { children: ["Top up session #", (ae = c.pickup) == null ? void 0 : ae.serialId] }),
|
|
685
|
+
/* @__PURE__ */ t(he, { children: c.pickup ? /* @__PURE__ */ a(p, {
|
|
686
|
+
spacing: 2.5,
|
|
687
|
+
sx: { mt: 1 },
|
|
688
|
+
children: [
|
|
689
|
+
/* @__PURE__ */ a(s, {
|
|
690
|
+
variant: "body2",
|
|
691
|
+
color: "text.secondary",
|
|
692
|
+
children: [
|
|
693
|
+
"Add more of what is already out, or take a different batch from ",
|
|
694
|
+
c.pickup.facilityName,
|
|
695
|
+
". Leave a quantity blank to skip that batch."
|
|
696
|
+
]
|
|
697
|
+
}),
|
|
698
|
+
/* @__PURE__ */ a(h, { children: [/* @__PURE__ */ t(s, {
|
|
699
|
+
variant: "overline",
|
|
700
|
+
color: "text.secondary",
|
|
701
|
+
children: "Batches already out"
|
|
702
|
+
}), /* @__PURE__ */ t(p, {
|
|
703
|
+
spacing: 1.5,
|
|
704
|
+
sx: { mt: 1 },
|
|
705
|
+
children: g(c.pickup).map((e) => {
|
|
706
|
+
let n = e.sourceBatchQtyRemaining ?? 0, i = ee[e.id];
|
|
707
|
+
return /* @__PURE__ */ t(h, {
|
|
708
|
+
sx: (r) => ({
|
|
709
|
+
p: 1.5,
|
|
710
|
+
borderRadius: 1.5,
|
|
711
|
+
bgcolor: z(r.palette.primary.main, 0.03),
|
|
712
|
+
border: `1px solid ${z(r.palette.primary.main, 0.12)}`
|
|
713
|
+
}),
|
|
714
|
+
children: /* @__PURE__ */ a(p, {
|
|
715
|
+
direction: {
|
|
716
|
+
xs: "column",
|
|
717
|
+
sm: "row"
|
|
718
|
+
},
|
|
719
|
+
spacing: 1.5,
|
|
720
|
+
justifyContent: "space-between",
|
|
721
|
+
alignItems: { sm: "center" },
|
|
722
|
+
children: [/* @__PURE__ */ a(h, { children: [/* @__PURE__ */ t(s, {
|
|
723
|
+
variant: "body2",
|
|
724
|
+
sx: { fontWeight: 700 },
|
|
725
|
+
children: e.productName
|
|
726
|
+
}), /* @__PURE__ */ a(s, {
|
|
727
|
+
variant: "caption",
|
|
728
|
+
color: "text.secondary",
|
|
729
|
+
children: [
|
|
730
|
+
e.lotNumber ? `Lot ${e.lotNumber} · ` : "",
|
|
731
|
+
n,
|
|
732
|
+
" left at the source"
|
|
733
|
+
]
|
|
734
|
+
})] }), /* @__PURE__ */ t(S, {
|
|
735
|
+
size: "small",
|
|
736
|
+
type: "number",
|
|
737
|
+
sx: { width: { sm: 170 } },
|
|
738
|
+
label: "Add",
|
|
739
|
+
disabled: n <= 0,
|
|
740
|
+
inputProps: {
|
|
741
|
+
min: 1,
|
|
742
|
+
max: n || void 0
|
|
743
|
+
},
|
|
744
|
+
value: u.qty[e.id] ?? "",
|
|
745
|
+
onChange: (r) => Ne(e.id, r.target.value),
|
|
746
|
+
error: !!i,
|
|
747
|
+
helperText: i || (n <= 0 ? "None left at the source" : " ")
|
|
748
|
+
})]
|
|
749
|
+
})
|
|
750
|
+
}, e.id);
|
|
751
|
+
})
|
|
752
|
+
})] }),
|
|
753
|
+
/* @__PURE__ */ a(h, { children: [/* @__PURE__ */ a(p, {
|
|
754
|
+
direction: "row",
|
|
755
|
+
justifyContent: "space-between",
|
|
756
|
+
alignItems: "center",
|
|
757
|
+
children: [/* @__PURE__ */ t(s, {
|
|
758
|
+
variant: "overline",
|
|
759
|
+
color: "text.secondary",
|
|
760
|
+
children: "Add another batch"
|
|
761
|
+
}), /* @__PURE__ */ t(y, {
|
|
762
|
+
size: "small",
|
|
763
|
+
variant: "outlined",
|
|
764
|
+
startIcon: /* @__PURE__ */ t(O, {}),
|
|
765
|
+
onClick: Qe,
|
|
766
|
+
children: "Add Batch"
|
|
767
|
+
})]
|
|
768
|
+
}), u.newLines.length === 0 ? /* @__PURE__ */ t(s, {
|
|
769
|
+
variant: "caption",
|
|
770
|
+
color: "text.secondary",
|
|
771
|
+
sx: {
|
|
772
|
+
display: "block",
|
|
773
|
+
mt: 1
|
|
774
|
+
},
|
|
775
|
+
children: "Takes a different lot or vaccine from the same facility onto this session."
|
|
776
|
+
}) : /* @__PURE__ */ t(h, {
|
|
777
|
+
sx: { mt: 1.5 },
|
|
778
|
+
children: /* @__PURE__ */ t(_e, {
|
|
779
|
+
lines: u.newLines,
|
|
780
|
+
batches: F,
|
|
781
|
+
errors: te,
|
|
782
|
+
excludeBatchIds: Ce,
|
|
783
|
+
onPatch: Re,
|
|
784
|
+
onRemove: Le,
|
|
785
|
+
allowRemoveLast: !0
|
|
786
|
+
})
|
|
787
|
+
})] }),
|
|
788
|
+
/* @__PURE__ */ t(S, {
|
|
789
|
+
size: "small",
|
|
790
|
+
multiline: !0,
|
|
791
|
+
minRows: 2,
|
|
792
|
+
label: "Notes (optional)",
|
|
793
|
+
value: u.notes,
|
|
794
|
+
onChange: (e) => Q((n) => ({
|
|
795
|
+
...n,
|
|
796
|
+
notes: e.target.value
|
|
797
|
+
}))
|
|
798
|
+
})
|
|
799
|
+
]
|
|
800
|
+
}) : null }),
|
|
801
|
+
/* @__PURE__ */ a(ye, { children: [/* @__PURE__ */ t(y, {
|
|
802
|
+
onClick: D,
|
|
803
|
+
disabled: w,
|
|
804
|
+
children: "Cancel"
|
|
805
|
+
}), /* @__PURE__ */ t(y, {
|
|
806
|
+
variant: "contained",
|
|
807
|
+
onClick: () => void Ie(),
|
|
808
|
+
disabled: !ne || w,
|
|
809
|
+
children: w ? "Submitting…" : "Top Up"
|
|
810
|
+
})] })
|
|
811
|
+
]
|
|
812
|
+
})
|
|
813
|
+
] });
|
|
814
|
+
}
|
|
815
|
+
export {
|
|
816
|
+
zt as default
|
|
817
|
+
};
|
|
818
|
+
//# sourceMappingURL=PickupsPage-D7zyioJB-bHKnARYw.js.map
|