@argusoft/medplat-core 1.0.31 → 1.0.33
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-BC43Jhml.js +1093 -0
- package/dist/AccessRights-BC43Jhml.js.map +1 -0
- package/dist/{AddFeatures-D1sU8RjY.js → AddFeatures-COj4ZTIM.js} +2 -2
- package/dist/{AddFeatures-D1sU8RjY.js.map → AddFeatures-COj4ZTIM.js.map} +1 -1
- package/dist/AddMenuConfiguration-Creeib5X.js +11223 -0
- package/dist/AddMenuConfiguration-Creeib5X.js.map +1 -0
- package/dist/AddMenuConfiguration.css +1 -1
- package/dist/{BrandsPage-DMw2vT0u-BVhvhc6J.js → BrandsPage-CdcAvaml-CYT80CMH.js} +45 -45
- package/dist/{BrandsPage-DMw2vT0u-BVhvhc6J.js.map → BrandsPage-CdcAvaml-CYT80CMH.js.map} +1 -1
- package/dist/{CategoriesPage-D3ihx9Gi-CT58g0ry.js → CategoriesPage-BprQEYJw-BRAukJB1.js} +43 -43
- package/dist/{CategoriesPage-D3ihx9Gi-CT58g0ry.js.map → CategoriesPage-BprQEYJw-BRAukJB1.js.map} +1 -1
- package/dist/ChangePasswordModalCore-rypTxA2O.js +238 -0
- package/dist/ChangePasswordModalCore-rypTxA2O.js.map +1 -0
- package/dist/{ConditionConfig-BQBmBHaM.js → ConditionConfig-Bpm6OoV5.js} +3 -3
- package/dist/{ConditionConfig-BQBmBHaM.js.map → ConditionConfig-Bpm6OoV5.js.map} +1 -1
- package/dist/{DashboardPage-asr2XDRu-uOOlX9Vq.js → DashboardPage-CTiGSx71-DX-TzGOH.js} +29 -29
- package/dist/{DashboardPage-asr2XDRu-uOOlX9Vq.js.map → DashboardPage-CTiGSx71-DX-TzGOH.js.map} +1 -1
- package/dist/EntityManagement-BGwJGl9k.js +62 -0
- package/dist/EntityManagement-BGwJGl9k.js.map +1 -0
- package/dist/{EventConfigurations-CUPEN5BV.js → EventConfigurations-B-z7xHh_.js} +3 -3
- package/dist/{EventConfigurations-CUPEN5BV.js.map → EventConfigurations-B-z7xHh_.js.map} +1 -1
- package/dist/{EventsExceptionModal-BX-ArkBE.js → EventsExceptionModal-DafomIv6.js} +2 -2
- package/dist/{EventsExceptionModal-BX-ArkBE.js.map → EventsExceptionModal-DafomIv6.js.map} +1 -1
- package/dist/{EventsUi-D6O9S7BK.js → EventsUi-Dl_yckSA.js} +37 -32
- package/dist/EventsUi-Dl_yckSA.js.map +1 -0
- package/dist/FacilityPicker-BXa2VF7i-D0JUIqLv.js +112 -0
- package/dist/FacilityPicker-BXa2VF7i-D0JUIqLv.js.map +1 -0
- package/dist/FaqList-CeDEuhU_.js +237 -0
- package/dist/FaqList-CeDEuhU_.js.map +1 -0
- package/dist/FaqSkeletons-hLCEcRr-.js +19 -0
- package/dist/FaqSkeletons-hLCEcRr-.js.map +1 -0
- package/dist/FaqView-sDzBVyXV.js +617 -0
- package/dist/FaqView-sDzBVyXV.js.map +1 -0
- package/dist/{FeatureMenu-CHsBbw3W.js → FeatureMenu-CaI-ZhSZ.js} +2 -2
- package/dist/{FeatureMenu-CHsBbw3W.js.map → FeatureMenu-CaI-ZhSZ.js.map} +1 -1
- package/dist/{FhirServerList-iXBPkRVF.js → FhirServerList-CrIHMAxz.js} +19 -19
- package/dist/{FhirServerList-iXBPkRVF.js.map → FhirServerList-CrIHMAxz.js.map} +1 -1
- package/dist/{FhirServerProfile-CUOwC6Wb.js → FhirServerProfile-D3aYcpwY.js} +8 -8
- package/dist/{FhirServerProfile-CUOwC6Wb.js.map → FhirServerProfile-D3aYcpwY.js.map} +1 -1
- package/dist/{FhirServerWizard-DZI8Olku.js → FhirServerWizard-Db6Hm4bQ.js} +15 -15
- package/dist/{FhirServerWizard-DZI8Olku.js.map → FhirServerWizard-Db6Hm4bQ.js.map} +1 -1
- package/dist/{ImmunizationConfigurationBase-aUtx0JEe.js → ImmunizationConfigurationBase-Clkk0-n6.js} +2638 -2577
- package/dist/ImmunizationConfigurationBase-Clkk0-n6.js.map +1 -0
- package/dist/InventoryPage-JadYMCzU-CWcCauMI.js +1017 -0
- package/dist/InventoryPage-JadYMCzU-CWcCauMI.js.map +1 -0
- package/dist/LocationWiseExpectedTargetPage-CjKk1aTF.js +1344 -0
- package/dist/LocationWiseExpectedTargetPage-CjKk1aTF.js.map +1 -0
- package/dist/{ManageDynamicFeature-BU0I45dd.js → ManageDynamicFeature-CuyYfx_P.js} +104 -97
- package/dist/ManageDynamicFeature-CuyYfx_P.js.map +1 -0
- package/dist/{ManageEventConfiguration-DqW3krT6.js → ManageEventConfiguration-DqPbn3Oi.js} +5 -5
- package/dist/{ManageEventConfiguration-DqW3krT6.js.map → ManageEventConfiguration-DqPbn3Oi.js.map} +1 -1
- package/dist/ManageFaq-4cT6bntx.js +1583 -0
- package/dist/ManageFaq-4cT6bntx.js.map +1 -0
- package/dist/ManageFaq.css +1 -0
- package/dist/ManageRole-CyfpySt9.js +981 -0
- package/dist/ManageRole-CyfpySt9.js.map +1 -0
- package/dist/{ManageUser-DZltBina.js → ManageUser-DchUMAyC.js} +172 -172
- package/dist/{ManageUser-DZltBina.js.map → ManageUser-DchUMAyC.js.map} +1 -1
- package/dist/{MemberProfileCard-D5CgkTdJ-D2NgDJl3.js → MemberProfileCard-01d_jz3w-CQi_zu6x.js} +37 -37
- package/dist/{MemberProfileCard-D5CgkTdJ-D2NgDJl3.js.map → MemberProfileCard-01d_jz3w-CQi_zu6x.js.map} +1 -1
- package/dist/MobileAnalytics-C9oc2yAo.js +18399 -0
- package/dist/MobileAnalytics-C9oc2yAo.js.map +1 -0
- package/dist/MobileMenuManagement-BmzTPXy7.js +231 -0
- package/dist/MobileMenuManagement-BmzTPXy7.js.map +1 -0
- package/dist/{MobileTypeEventConfigModal-CMcj7Ozp.js → MobileTypeEventConfigModal-DodU3beR.js} +3 -3
- package/dist/{MobileTypeEventConfigModal-CMcj7Ozp.js.map → MobileTypeEventConfigModal-DodU3beR.js.map} +1 -1
- package/dist/{NewServerManagement-Cxe0dV0O.js → NewServerManagement-BdayO78D.js} +368 -352
- package/dist/NewServerManagement-BdayO78D.js.map +1 -0
- package/dist/OtherTypeEventConfigModal-D_9S50aI.js +1414 -0
- package/dist/OtherTypeEventConfigModal-D_9S50aI.js.map +1 -0
- package/dist/{PaymentCreatePage-DfvSZ-kB-CckogYoe.js → PaymentCreatePage-D6NZBUC3-_98S21Sa.js} +56 -56
- package/dist/{PaymentCreatePage-DfvSZ-kB-CckogYoe.js.map → PaymentCreatePage-D6NZBUC3-_98S21Sa.js.map} +1 -1
- package/dist/{PaymentsPage-DMNjYWAJ-ChO9IXmk.js → PaymentsPage-CHieGNrn-ChCXEyck.js} +38 -38
- package/dist/{PaymentsPage-DMNjYWAJ-ChO9IXmk.js.map → PaymentsPage-CHieGNrn-ChCXEyck.js.map} +1 -1
- package/dist/{PermissionsModal-CCYkcKlC.js → PermissionsModal-Dxbkkrqe.js} +18 -18
- package/dist/PermissionsModal-Dxbkkrqe.js.map +1 -0
- package/dist/{PickupBatchLinesEditor-CE2RuyJT-BPceiJr8.js → PickupBatchLinesEditor-QPaqFtUO-BEtI5mIU.js} +2 -2
- package/dist/{PickupBatchLinesEditor-CE2RuyJT-BPceiJr8.js.map → PickupBatchLinesEditor-QPaqFtUO-BEtI5mIU.js.map} +1 -1
- package/dist/PickupCreatePage-C7_67u_u-DbDIZ1WC.js +801 -0
- package/dist/PickupCreatePage-C7_67u_u-DbDIZ1WC.js.map +1 -0
- package/dist/{PickupsPage-D7zyioJB-bHKnARYw.js → PickupsPage-BWblMlic-KehDMebm.js} +122 -122
- package/dist/PickupsPage-BWblMlic-KehDMebm.js.map +1 -0
- package/dist/PmGuard-BvUUbU80-DJipZoSg.js +641 -0
- package/dist/PmGuard-BvUUbU80-DJipZoSg.js.map +1 -0
- package/dist/ProductEditPage-Dbq4vUAA-DusAdAvm.js +1523 -0
- package/dist/ProductEditPage-Dbq4vUAA-DusAdAvm.js.map +1 -0
- package/dist/{ProductsPage-DvNHIeZt-BoOOJJtk.js → ProductsPage-BI22nPb4-D3GnWz34.js} +29 -29
- package/dist/{ProductsPage-DvNHIeZt-BoOOJJtk.js.map → ProductsPage-BI22nPb4-D3GnWz34.js.map} +1 -1
- package/dist/PurchaseCreatePage-C0EK9z4w-D4PlZsOH.js +724 -0
- package/dist/PurchaseCreatePage-C0EK9z4w-D4PlZsOH.js.map +1 -0
- package/dist/{PurchaseRequestDetailPage-CA9KFOfE-CtjG4Gx6.js → PurchaseRequestDetailPage-DhBuOGHZ-CAmlL4fP.js} +446 -436
- package/dist/PurchaseRequestDetailPage-DhBuOGHZ-CAmlL4fP.js.map +1 -0
- package/dist/{PurchaseRequestsPage-DS9i4o0--TpoxA5Kd.js → PurchaseRequestsPage-Bj9HUMxb-BCAhEEkL.js} +55 -55
- package/dist/{PurchaseRequestsPage-DS9i4o0--TpoxA5Kd.js.map → PurchaseRequestsPage-Bj9HUMxb-BCAhEEkL.js.map} +1 -1
- package/dist/{PurchasesPage-DgL5T6BY-DePUuE9l.js → PurchasesPage-Djl1AqD_-DxBRFRDy.js} +61 -61
- package/dist/{PurchasesPage-DgL5T6BY-DePUuE9l.js.map → PurchasesPage-Djl1AqD_-DxBRFRDy.js.map} +1 -1
- package/dist/{RoleManagement-s8iNx2Mu.js → RoleManagement-DVYufwy-.js} +3 -3
- package/dist/{RoleManagement-s8iNx2Mu.js.map → RoleManagement-DVYufwy-.js.map} +1 -1
- package/dist/Roles-BoNGJhtR.js +19 -0
- package/dist/Roles-BoNGJhtR.js.map +1 -0
- package/dist/{SaleCreatePage-CZnIOydv-DKBw-qp7.js → SaleCreatePage-DHBLmlBr-aEGmvJQq.js} +33 -33
- package/dist/{SaleCreatePage-CZnIOydv-DKBw-qp7.js.map → SaleCreatePage-DHBLmlBr-aEGmvJQq.js.map} +1 -1
- package/dist/{SalesPage-DPIRrC_O-M8rqnK7z.js → SalesPage-eF9Yr42z-CvOr82vo.js} +34 -34
- package/dist/SalesPage-eF9Yr42z-CvOr82vo.js.map +1 -0
- package/dist/SettingsPage-Cre-UE3r-CGTVp5Zw.js +741 -0
- package/dist/SettingsPage-Cre-UE3r-CGTVp5Zw.js.map +1 -0
- package/dist/{StorageUnitsPage-BDRkdCjW-UF64rf7q.js → StorageUnitsPage-CTEVuemZ-C7zkwKMz.js} +213 -190
- package/dist/StorageUnitsPage-CTEVuemZ-C7zkwKMz.js.map +1 -0
- package/dist/{SubMenu-BdMTYtC1.js → SubMenu-DZIhur09.js} +2 -2
- package/dist/{SubMenu-BdMTYtC1.js.map → SubMenu-DZIhur09.js.map} +1 -1
- package/dist/{TableDetails-BtafRxXb.js → TableDetails-Cc40dEUs.js} +272 -267
- package/dist/TableDetails-Cc40dEUs.js.map +1 -0
- package/dist/{TableList-Dpo6dO7S.js → TableList-B5tX4wII.js} +316 -312
- package/dist/TableList-B5tX4wII.js.map +1 -0
- package/dist/{TransactionsPage-CqWTMNU8-Df6eGFDW.js → TransactionsPage-Zuu7sjID-BDmUK7s1.js} +185 -170
- package/dist/TransactionsPage-Zuu7sjID-BDmUK7s1.js.map +1 -0
- package/dist/TransferCreatePage-DlT0nCDj-evHPJc99.js +635 -0
- package/dist/TransferCreatePage-DlT0nCDj-evHPJc99.js.map +1 -0
- package/dist/TransfersPage-DqaSvHda-DAUn5SSr.js +600 -0
- package/dist/TransfersPage-DqaSvHda-DAUn5SSr.js.map +1 -0
- package/dist/{TypeConfiguration-JbRCN6GR.js → TypeConfiguration-EaFiOzRE.js} +3 -3
- package/dist/{TypeConfiguration-JbRCN6GR.js.map → TypeConfiguration-EaFiOzRE.js.map} +1 -1
- package/dist/UserList-Cf5B-o_1.js +1904 -0
- package/dist/UserList-Cf5B-o_1.js.map +1 -0
- package/dist/Users-MC7txo1V.js +43 -0
- package/dist/{Users-CsJ08Kjm.js.map → Users-MC7txo1V.js.map} +1 -1
- package/dist/VaccineEducation-DWkNNasF.js +231 -0
- package/dist/VaccineEducation-DWkNNasF.js.map +1 -0
- package/dist/VaccineEducation.css +1 -0
- package/dist/VaccineEducationConfigurator-BFCvu5Mw.js +1450 -0
- package/dist/VaccineEducationConfigurator-BFCvu5Mw.js.map +1 -0
- package/dist/VaccineEducationConfigurator.css +1 -0
- package/dist/VaccineEducationList-BxZHahCh.js +334 -0
- package/dist/VaccineEducationList-BxZHahCh.js.map +1 -0
- package/dist/VialsPage-LoDaUqVv-Dw00Zc06.js +457 -0
- package/dist/VialsPage-LoDaUqVv-Dw00Zc06.js.map +1 -0
- package/dist/ckeditor5-_x14lrzc.js +49590 -0
- package/dist/ckeditor5-_x14lrzc.js.map +1 -0
- package/dist/ckeditor5.css +4 -0
- package/dist/{constants-DpXnLsAB-D6lN5cjK.js → constants-BTpJFQe_-CYPZIqQF.js} +160 -61
- package/dist/constants-BTpJFQe_-CYPZIqQF.js.map +1 -0
- package/dist/dashboardLayoutUtils--xUnoKPa.js +615 -0
- package/dist/dashboardLayoutUtils--xUnoKPa.js.map +1 -0
- package/dist/faqMedia-FDpje7v0.js +234 -0
- package/dist/faqMedia-FDpje7v0.js.map +1 -0
- package/dist/index-mfoqII2U.js +524 -0
- package/dist/index-mfoqII2U.js.map +1 -0
- package/dist/{index-D9YNFPn9.js → index-o8Pyt1Bt.js} +445 -439
- package/dist/index-o8Pyt1Bt.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/{index.lib-ETRQOzvE.js → index.lib-QDEODnRT.js} +409 -327
- package/dist/index.lib-QDEODnRT.js.map +1 -0
- package/dist/listValueStore-5d4vNGQM-DB08drLf.js +43 -0
- package/dist/listValueStore-5d4vNGQM-DB08drLf.js.map +1 -0
- package/dist/proxy-C4gcRXzG.js +5265 -0
- package/dist/proxy-C4gcRXzG.js.map +1 -0
- package/package.json +7 -2
- package/dist/AccessRights-DUgY6ewy.js +0 -1031
- package/dist/AccessRights-DUgY6ewy.js.map +0 -1
- package/dist/AddMenuConfiguration-c6ZKiN0i.js +0 -8898
- package/dist/AddMenuConfiguration-c6ZKiN0i.js.map +0 -1
- package/dist/ChangePasswordModalCore-lQ9GamH1.js +0 -5494
- package/dist/ChangePasswordModalCore-lQ9GamH1.js.map +0 -1
- package/dist/EntityManagement-CPQL6qBj.js +0 -50
- package/dist/EntityManagement-CPQL6qBj.js.map +0 -1
- package/dist/EventsUi-D6O9S7BK.js.map +0 -1
- package/dist/FacilityPicker-DYl_PDyt-Cbwo2tAY.js +0 -79
- package/dist/FacilityPicker-DYl_PDyt-Cbwo2tAY.js.map +0 -1
- package/dist/ImmunizationConfigurationBase-aUtx0JEe.js.map +0 -1
- package/dist/InventoryPage-DOotGZrj-CoPjOJEI.js +0 -665
- package/dist/InventoryPage-DOotGZrj-CoPjOJEI.js.map +0 -1
- package/dist/ManageDynamicFeature-BU0I45dd.js.map +0 -1
- package/dist/ManageRole-CNZBRKGU.js +0 -776
- package/dist/ManageRole-CNZBRKGU.js.map +0 -1
- package/dist/MobileAnalytics-BLOionG_.js +0 -17301
- package/dist/MobileAnalytics-BLOionG_.js.map +0 -1
- package/dist/MobileMenuManagement-68Wijb0X.js +0 -220
- package/dist/MobileMenuManagement-68Wijb0X.js.map +0 -1
- package/dist/NewServerManagement-Cxe0dV0O.js.map +0 -1
- package/dist/OtherTypeEventConfigModal-stNmuSv_.js +0 -1812
- package/dist/OtherTypeEventConfigModal-stNmuSv_.js.map +0 -1
- package/dist/PermissionsModal-CCYkcKlC.js.map +0 -1
- package/dist/PickupCreatePage-B4O_-vE5-DoOo9nJO.js +0 -783
- package/dist/PickupCreatePage-B4O_-vE5-DoOo9nJO.js.map +0 -1
- package/dist/PickupsPage-D7zyioJB-bHKnARYw.js.map +0 -1
- package/dist/PmGuard-BZE-y4In-D_pUm5MP.js +0 -599
- package/dist/PmGuard-BZE-y4In-D_pUm5MP.js.map +0 -1
- package/dist/ProductEditPage-BVlVUCtD-BR-tJ5Wb.js +0 -1305
- package/dist/ProductEditPage-BVlVUCtD-BR-tJ5Wb.js.map +0 -1
- package/dist/PurchaseCreatePage-Cq_i9snz-DRtHHFWw.js +0 -675
- package/dist/PurchaseCreatePage-Cq_i9snz-DRtHHFWw.js.map +0 -1
- package/dist/PurchaseRequestDetailPage-CA9KFOfE-CtjG4Gx6.js.map +0 -1
- package/dist/Roles-BIyiic67.js +0 -14
- package/dist/Roles-BIyiic67.js.map +0 -1
- package/dist/SalesPage-DPIRrC_O-M8rqnK7z.js.map +0 -1
- package/dist/SettingsPage-BC_R6Z-Q-CKNt9zRu.js +0 -676
- package/dist/SettingsPage-BC_R6Z-Q-CKNt9zRu.js.map +0 -1
- package/dist/StorageUnitsPage-BDRkdCjW-UF64rf7q.js.map +0 -1
- package/dist/TableDetails-BtafRxXb.js.map +0 -1
- package/dist/TableList-Dpo6dO7S.js.map +0 -1
- package/dist/TransactionsPage-CqWTMNU8-Df6eGFDW.js.map +0 -1
- package/dist/TransferCreatePage-DF7FZaTJ-CL79V3aR.js +0 -315
- package/dist/TransferCreatePage-DF7FZaTJ-CL79V3aR.js.map +0 -1
- package/dist/TransfersPage-CGrRFaBF-cTwBUv0o.js +0 -476
- package/dist/TransfersPage-CGrRFaBF-cTwBUv0o.js.map +0 -1
- package/dist/UserList-L41Xw0Q6.js +0 -1129
- package/dist/UserList-L41Xw0Q6.js.map +0 -1
- package/dist/Users-CsJ08Kjm.js +0 -40
- package/dist/VialsPage-rvvXjgZG-Oqo1v6kQ.js +0 -321
- package/dist/VialsPage-rvvXjgZG-Oqo1v6kQ.js.map +0 -1
- package/dist/constants-DpXnLsAB-D6lN5cjK.js.map +0 -1
- package/dist/dashboardLayoutUtils-CJivzaU1.js +0 -408
- package/dist/dashboardLayoutUtils-CJivzaU1.js.map +0 -1
- package/dist/index-D9YNFPn9.js.map +0 -1
- package/dist/index.lib-ETRQOzvE.js.map +0 -1
- package/dist/listValueStore-BFQtDYIR-Bj0yX145.js +0 -36
- package/dist/listValueStore-BFQtDYIR-Bj0yX145.js.map +0 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { useState as b, useMemo as
|
|
6
|
-
import { jsxs as n, jsx as t, Fragment as
|
|
7
|
-
import { Box as
|
|
1
|
+
import { A as Xt, U as er, K as It, H as Ct, r as tr, a as H, t as kt, E as rr, F as ar, J as ir, Q as nr } from "./ImmunizationConfigurationBase-Clkk0-n6.js";
|
|
2
|
+
import { V as Nt, C as Ae, N as Rt } from "./constants-BTpJFQe_-CYPZIqQF.js";
|
|
3
|
+
import { t as Fe, n as Dt } from "./format-UOyOu75i-D0GyylyQ.js";
|
|
4
|
+
import { Q as lr, Z as or, $ as sr, e as cr, Y as ur } from "./PmGuard-BvUUbU80-DJipZoSg.js";
|
|
5
|
+
import { useState as b, useMemo as $, Fragment as dr } from "react";
|
|
6
|
+
import { jsxs as n, jsx as t, Fragment as E } from "react/jsx-runtime";
|
|
7
|
+
import { Box as k, Alert as Pe, Card as ue, CardContent as de, Stack as p, Chip as w, Typography as d, Divider as Ie, ToggleButtonGroup as Ce, ToggleButton as F, TextField as I, Button as D, Tooltip as qt, IconButton as hr, Table as pr, TableHead as mr, TableRow as ke, TableCell as C, TableBody as yr, Dialog as br, DialogTitle as fr, DialogContent as xr, DialogActions as gr } from "@mui/material";
|
|
8
8
|
import { alpha as J } from "@mui/material/styles";
|
|
9
9
|
import { v4 as Ne } from "uuid";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { useNavigate as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { useSelector as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
function
|
|
10
|
+
import vr from "@mui/icons-material/AddRounded";
|
|
11
|
+
import Ir from "@mui/icons-material/RefreshRounded";
|
|
12
|
+
import { useNavigate as Cr, useParams as kr } from "react-router-dom";
|
|
13
|
+
import Nr from "@mui/icons-material/Inventory2Rounded";
|
|
14
|
+
import Rr from "@mui/icons-material/LocalShippingRounded";
|
|
15
|
+
import { useSelector as Dr } from "react-redux";
|
|
16
|
+
import qr from "@mui/icons-material/DeleteOutlineRounded";
|
|
17
|
+
import wr from "@mui/icons-material/ArrowBackRounded";
|
|
18
|
+
import Oe from "@mui/icons-material/CheckCircleRounded";
|
|
19
|
+
import Re from "@mui/icons-material/DoNotDisturbRounded";
|
|
20
|
+
import De from "@mui/icons-material/ReportProblemRounded";
|
|
21
|
+
import Tr from "@mui/icons-material/BlockRounded";
|
|
22
|
+
import $r from "@mui/icons-material/HourglassEmptyRounded";
|
|
23
|
+
function Er(g) {
|
|
24
24
|
switch (g) {
|
|
25
25
|
case "PENDING":
|
|
26
26
|
return "info";
|
|
@@ -36,7 +36,7 @@ function Sr(g) {
|
|
|
36
36
|
return "default";
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Sr(g) {
|
|
40
40
|
switch (g) {
|
|
41
41
|
case "PENDING_SHIPMENT":
|
|
42
42
|
return "warning";
|
|
@@ -52,91 +52,91 @@ function Tr(g) {
|
|
|
52
52
|
return "default";
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
return g ? g.toLowerCase().split("_").map((
|
|
55
|
+
function wt(g) {
|
|
56
|
+
return g ? g.toLowerCase().split("_").map((P) => P.charAt(0).toUpperCase() + P.slice(1)).join(" ") : "";
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function qe(g) {
|
|
59
59
|
return g ? new Date(g).toISOString().substring(0, 10) : "";
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
var
|
|
63
|
-
let g =
|
|
64
|
-
var
|
|
65
|
-
return (r = (
|
|
66
|
-
}),
|
|
67
|
-
function
|
|
68
|
-
let
|
|
69
|
-
((e == null ? void 0 : e.items) ?? []).forEach((
|
|
70
|
-
let c = (
|
|
61
|
+
function ta() {
|
|
62
|
+
var lt;
|
|
63
|
+
let g = Cr(), { requestId: P } = kr(), Te = lr().has("approve.manage.productManagement.purchase"), Ue = Dr((e) => {
|
|
64
|
+
var a, r;
|
|
65
|
+
return (r = (a = e.Authenticate) == null ? void 0 : a.user) == null ? void 0 : r.id;
|
|
66
|
+
}), Z = ((lt = Xt()) == null ? void 0 : lt.managePurchaseAmounts) !== !1, [i, O] = b(null), [Tt, Be] = b(!0), [f, N] = b(!1), [ze, v] = b(""), [L, he] = b({}), [T, We] = b({}), [Q, je] = b({}), [X, Le] = b({}), [$e, Qe] = b(!1), [Ee, _e] = b(""), [ee, Ye] = b({}), [Se, Ge] = b({}), [Ke, Ve] = b(""), [$t, te] = b(!1), [re, He] = b({}), [pe, Je] = b({}), [Et, me] = b({}), [St, Ze] = b(!1);
|
|
67
|
+
function _(e) {
|
|
68
|
+
let a = {}, r = {}, l = {};
|
|
69
|
+
((e == null ? void 0 : e.items) ?? []).forEach((m) => {
|
|
70
|
+
let c = (m.batches ?? []).map((q) => ({
|
|
71
71
|
key: Ne(),
|
|
72
|
-
batchId:
|
|
73
|
-
receiptStatus:
|
|
74
|
-
quantity: String(
|
|
75
|
-
lotNumber:
|
|
76
|
-
expiryDate:
|
|
77
|
-
manufactureDate:
|
|
72
|
+
batchId: q.batchId ?? null,
|
|
73
|
+
receiptStatus: q.receiptStatus ?? null,
|
|
74
|
+
quantity: String(q.quantity ?? ""),
|
|
75
|
+
lotNumber: q.lotNumber ?? "",
|
|
76
|
+
expiryDate: qe(q.expiryDate),
|
|
77
|
+
manufactureDate: qe(q.manufactureDate)
|
|
78
78
|
}));
|
|
79
79
|
c.length === 0 && c.push({
|
|
80
80
|
key: Ne(),
|
|
81
81
|
batchId: null,
|
|
82
82
|
receiptStatus: null,
|
|
83
|
-
quantity: String(
|
|
83
|
+
quantity: String(m.requestedQuantity),
|
|
84
84
|
lotNumber: "",
|
|
85
85
|
expiryDate: "",
|
|
86
86
|
manufactureDate: ""
|
|
87
|
-
}),
|
|
88
|
-
}), he(
|
|
87
|
+
}), a[m.id] = c, r[m.id] = m.approvedQuantity == null ? !0 : m.approvedQuantity > 0, l[m.id] = !!m.isSplit || c.length > 1;
|
|
88
|
+
}), he(a), We(r), je(l), Le({}), Qe(!1);
|
|
89
89
|
let o = {}, u = {}, h = {};
|
|
90
|
-
((e == null ? void 0 : e.items) ?? []).forEach((
|
|
91
|
-
(
|
|
90
|
+
((e == null ? void 0 : e.items) ?? []).forEach((m) => {
|
|
91
|
+
(m.batches ?? []).forEach((c) => {
|
|
92
92
|
c.batchId && (c.receiptStatus ?? (o[c.batchId] = "OK"), c.receiptStatus === "DISCREPANCY" && (u[c.batchId] = "CORRECT", h[c.batchId] = {
|
|
93
93
|
lotNumber: c.lotNumber ?? "",
|
|
94
|
-
expiryDate:
|
|
95
|
-
manufactureDate:
|
|
94
|
+
expiryDate: qe(c.expiryDate),
|
|
95
|
+
manufactureDate: qe(c.manufactureDate)
|
|
96
96
|
}));
|
|
97
97
|
});
|
|
98
|
-
}),
|
|
98
|
+
}), Ye(o), Ge({}), Ve(""), He(u), Je(h), me({}), Ze(!1);
|
|
99
99
|
}
|
|
100
100
|
async function Xe() {
|
|
101
|
-
var e,
|
|
102
|
-
|
|
101
|
+
var e, a;
|
|
102
|
+
Be(!0), v("");
|
|
103
103
|
try {
|
|
104
|
-
let r = await
|
|
105
|
-
|
|
104
|
+
let r = await nr(P);
|
|
105
|
+
O(r), _(r), _e((r == null ? void 0 : r.decisionNotes) ?? "");
|
|
106
106
|
} catch (r) {
|
|
107
|
-
v(((
|
|
107
|
+
v(((a = (e = r == null ? void 0 : r.response) == null ? void 0 : e.data) == null ? void 0 : a.message) ?? (r == null ? void 0 : r.message) ?? "Failed to load purchase request");
|
|
108
108
|
} finally {
|
|
109
|
-
|
|
109
|
+
Be(!1);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
|
|
112
|
+
or(["view.manage.productManagement.purchase", "approve.manage.productManagement.purchase"], () => {
|
|
113
113
|
Xe();
|
|
114
|
-
}, [
|
|
115
|
-
let
|
|
116
|
-
function
|
|
117
|
-
return
|
|
114
|
+
}, [P]);
|
|
115
|
+
let et = (i == null ? void 0 : i.status) === "PENDING", R = (i == null ? void 0 : i.fulfillmentStatus) ?? null, tt = (i == null ? void 0 : i.requestedBy) != null && Ue != null && Number(i.requestedBy) === Number(Ue), Mt = et && Te, At = R === "DISCREPANCY" && Te, ae = Mt, Ft = R === "PENDING_SHIPMENT" && Te, Y = R === "IN_TRANSIT" && tt, Pt = R === "IN_TRANSIT" || R === "DISCREPANCY";
|
|
116
|
+
function rt(e) {
|
|
117
|
+
return L[e] ?? [];
|
|
118
118
|
}
|
|
119
119
|
function ye(e) {
|
|
120
|
-
let
|
|
121
|
-
return
|
|
120
|
+
let a = rt(e);
|
|
121
|
+
return Q[e] ? a : a.slice(0, 1);
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
|
|
125
|
-
...
|
|
123
|
+
function S(e) {
|
|
124
|
+
Le((a) => a[e] ? a : {
|
|
125
|
+
...a,
|
|
126
126
|
[e]: !0
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function M(e, a, r, l) {
|
|
130
130
|
he((o) => ({
|
|
131
131
|
...o,
|
|
132
|
-
[e]: (o[e] ?? []).map((u) => u.key ===
|
|
132
|
+
[e]: (o[e] ?? []).map((u) => u.key === a ? {
|
|
133
133
|
...u,
|
|
134
134
|
[r]: l
|
|
135
135
|
} : u)
|
|
136
|
-
})),
|
|
136
|
+
})), S(`${a}:${r}`);
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
let
|
|
138
|
+
function Ot(e) {
|
|
139
|
+
let a = ((i == null ? void 0 : i.items) ?? []).find((l) => l.id === e), r = a ? Math.max(a.requestedQuantity - be(e), 0) : 0;
|
|
140
140
|
he((l) => ({
|
|
141
141
|
...l,
|
|
142
142
|
[e]: [...l[e] ?? [], {
|
|
@@ -150,20 +150,20 @@ function Zr() {
|
|
|
150
150
|
}]
|
|
151
151
|
}));
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function at(e, a, r, l) {
|
|
154
154
|
if (r === "") {
|
|
155
|
-
|
|
155
|
+
M(e, a, "quantity", "");
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
158
|
let o = Math.floor(Number(r));
|
|
159
159
|
if (!Number.isFinite(o)) return;
|
|
160
160
|
o < 1 && (o = 1);
|
|
161
|
-
let u = ye(e).filter((
|
|
162
|
-
o > h && (o = h),
|
|
161
|
+
let u = ye(e).filter((m) => m.key !== a).reduce((m, c) => m + (Number(c.quantity) > 0 ? Number(c.quantity) : 0), 0), h = Math.max(l - u, 1);
|
|
162
|
+
o > h && (o = h), M(e, a, "quantity", String(o));
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function Ut(e, a) {
|
|
165
165
|
he((r) => {
|
|
166
|
-
let l = (r[e] ?? []).filter((o) => o.key !==
|
|
166
|
+
let l = (r[e] ?? []).filter((o) => o.key !== a);
|
|
167
167
|
return {
|
|
168
168
|
...r,
|
|
169
169
|
[e]: l.length ? l : [{
|
|
@@ -175,159 +175,159 @@ function Zr() {
|
|
|
175
175
|
};
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
|
|
178
|
+
function Bt(e, a) {
|
|
179
|
+
We((r) => ({
|
|
180
180
|
...r,
|
|
181
|
-
[e]:
|
|
181
|
+
[e]: a
|
|
182
182
|
}));
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
|
|
184
|
+
function zt(e, a) {
|
|
185
|
+
je((r) => ({
|
|
186
186
|
...r,
|
|
187
|
-
[e]:
|
|
187
|
+
[e]: a
|
|
188
188
|
}));
|
|
189
189
|
}
|
|
190
190
|
function be(e) {
|
|
191
|
-
return
|
|
191
|
+
return T[e] ? ye(e).reduce((a, r) => {
|
|
192
192
|
let l = Number(r.quantity);
|
|
193
|
-
return
|
|
193
|
+
return a + (Number.isFinite(l) && l > 0 ? l : 0);
|
|
194
194
|
}, 0) : 0;
|
|
195
195
|
}
|
|
196
|
-
let y =
|
|
197
|
-
if (!
|
|
198
|
-
let e = {},
|
|
199
|
-
return (
|
|
200
|
-
if (!
|
|
201
|
-
let l =
|
|
196
|
+
let y = $(() => {
|
|
197
|
+
if (!i || !ae) return {};
|
|
198
|
+
let e = {}, a = (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
|
|
199
|
+
return (i.items ?? []).forEach((r) => {
|
|
200
|
+
if (!T[r.id]) return;
|
|
201
|
+
let l = Q[r.id] ? L[r.id] ?? [] : (L[r.id] ?? []).slice(0, 1), o = 0;
|
|
202
202
|
l.forEach((u) => {
|
|
203
203
|
let h = Number(u.quantity);
|
|
204
|
-
!Number.isInteger(h) || h <= 0 ? e[`${u.key}:quantity`] = "Enter a quantity" : o += h, (!u.lotNumber || !u.lotNumber.trim()) && (e[`${u.key}:lotNumber`] = "Lot is required"), u.expiryDate ? u.expiryDate <
|
|
204
|
+
!Number.isInteger(h) || h <= 0 ? e[`${u.key}:quantity`] = "Enter a quantity" : o += h, (!u.lotNumber || !u.lotNumber.trim()) && (e[`${u.key}:lotNumber`] = "Lot is required"), r.expiryMode !== "FROM_MANUFACTURE" && (u.expiryDate ? u.expiryDate < a && (e[`${u.key}:expiryDate`] = "Must be today or later") : e[`${u.key}:expiryDate`] = "Expiry is required"), u.manufactureDate ? u.manufactureDate > a && (e[`${u.key}:manufactureDate`] = "Cannot be in the future") : r.hasManufactureDate && (e[`${u.key}:manufactureDate`] = "Manufactured date is required");
|
|
205
205
|
}), o > r.requestedQuantity && (e[`${r.id}:sum`] = `Total exceeds the requested ${r.requestedQuantity}`);
|
|
206
206
|
}), e;
|
|
207
207
|
}, [
|
|
208
|
-
|
|
208
|
+
i,
|
|
209
|
+
L,
|
|
210
|
+
T,
|
|
209
211
|
Q,
|
|
210
|
-
S,
|
|
211
|
-
Y,
|
|
212
212
|
ae
|
|
213
|
-
]),
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
213
|
+
]), Wt = Object.keys(y).length === 0;
|
|
214
|
+
$(() => ((i == null ? void 0 : i.items) ?? []).some((e) => T[e.id] && be(e.id) > 0), [
|
|
215
|
+
i,
|
|
216
|
+
L,
|
|
217
|
+
T,
|
|
218
|
+
Q
|
|
219
219
|
]);
|
|
220
|
-
let
|
|
220
|
+
let jt = $(() => ((i == null ? void 0 : i.items) ?? []).some((e) => T[e.id]), [i, T]), x = (e) => $e || X[e];
|
|
221
221
|
function Lt(e) {
|
|
222
|
-
return
|
|
222
|
+
return $e ? !0 : ye(e).some((a) => X[`${a.key}:quantity`] || X[`${a.key}:lotNumber`] || X[`${a.key}:expiryDate`] || X[`${a.key}:manufactureDate`]);
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
return (
|
|
224
|
+
function Qt() {
|
|
225
|
+
return (i.items ?? []).map((e) => ({
|
|
226
226
|
itemId: e.id,
|
|
227
|
-
batches:
|
|
228
|
-
quantity: Number(
|
|
229
|
-
lotNumber:
|
|
230
|
-
expiryDate:
|
|
231
|
-
manufactureDate:
|
|
227
|
+
batches: T[e.id] ? ye(e.id).map((a) => ({
|
|
228
|
+
quantity: Number(a.quantity),
|
|
229
|
+
lotNumber: a.lotNumber.trim(),
|
|
230
|
+
expiryDate: a.expiryDate,
|
|
231
|
+
manufactureDate: a.manufactureDate || null,
|
|
232
232
|
storageUnitId: e.storageUnitId ?? null
|
|
233
233
|
})) : []
|
|
234
234
|
}));
|
|
235
235
|
}
|
|
236
|
-
let
|
|
237
|
-
if (!
|
|
238
|
-
let e = 0,
|
|
239
|
-
return (
|
|
236
|
+
let it = $(() => {
|
|
237
|
+
if (!i || !Z || !ae) return null;
|
|
238
|
+
let e = 0, a = !1;
|
|
239
|
+
return (i.items ?? []).forEach((r) => {
|
|
240
240
|
let l = be(r.id);
|
|
241
|
-
l <= 0 || r.buyPrice == null || (e += Number(r.buyPrice) * l,
|
|
242
|
-
}),
|
|
241
|
+
l <= 0 || r.buyPrice == null || (e += Number(r.buyPrice) * l, a = !0);
|
|
242
|
+
}), a ? e : null;
|
|
243
243
|
}, [
|
|
244
|
-
|
|
244
|
+
i,
|
|
245
|
+
L,
|
|
246
|
+
T,
|
|
245
247
|
Q,
|
|
246
|
-
|
|
247
|
-
Y,
|
|
248
|
-
X,
|
|
248
|
+
Z,
|
|
249
249
|
ae
|
|
250
250
|
]);
|
|
251
|
-
async function
|
|
252
|
-
var e,
|
|
253
|
-
if (
|
|
254
|
-
if (!
|
|
251
|
+
async function _t() {
|
|
252
|
+
var e, a;
|
|
253
|
+
if (i) {
|
|
254
|
+
if (!Wt) {
|
|
255
255
|
Qe(!0);
|
|
256
256
|
return;
|
|
257
257
|
}
|
|
258
258
|
N(!0), v("");
|
|
259
259
|
try {
|
|
260
|
-
let r = await
|
|
261
|
-
decisionNotes:
|
|
262
|
-
items:
|
|
260
|
+
let r = await kt(i.id, {
|
|
261
|
+
decisionNotes: Ee || null,
|
|
262
|
+
items: Qt()
|
|
263
263
|
});
|
|
264
|
-
|
|
264
|
+
O(r), _(r), H({
|
|
265
265
|
message: "Decision saved. Mark it as sent once it's on the way.",
|
|
266
266
|
type: "success"
|
|
267
267
|
});
|
|
268
268
|
} catch (r) {
|
|
269
|
-
v(((
|
|
269
|
+
v(((a = (e = r == null ? void 0 : r.response) == null ? void 0 : e.data) == null ? void 0 : a.message) ?? (r == null ? void 0 : r.message) ?? "Failed to submit decision");
|
|
270
270
|
} finally {
|
|
271
271
|
N(!1);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
async function Yt() {
|
|
276
|
-
var e,
|
|
277
|
-
if (
|
|
276
|
+
var e, a;
|
|
277
|
+
if (i) {
|
|
278
278
|
N(!0), v("");
|
|
279
279
|
try {
|
|
280
|
-
let r = await
|
|
281
|
-
decisionNotes:
|
|
282
|
-
items: (
|
|
280
|
+
let r = await kt(i.id, {
|
|
281
|
+
decisionNotes: Ee || null,
|
|
282
|
+
items: (i.items ?? []).map((l) => ({
|
|
283
283
|
itemId: l.id,
|
|
284
284
|
batches: []
|
|
285
285
|
}))
|
|
286
286
|
});
|
|
287
|
-
|
|
287
|
+
O(r), _(r), te(!1), H({
|
|
288
288
|
message: "Request rejected.",
|
|
289
289
|
type: "success"
|
|
290
290
|
});
|
|
291
291
|
} catch (r) {
|
|
292
|
-
v(((
|
|
292
|
+
v(((a = (e = r == null ? void 0 : r.response) == null ? void 0 : e.data) == null ? void 0 : a.message) ?? (r == null ? void 0 : r.message) ?? "Failed to reject request");
|
|
293
293
|
} finally {
|
|
294
294
|
N(!1);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
|
-
async function
|
|
299
|
-
var e,
|
|
300
|
-
if (
|
|
298
|
+
async function Gt() {
|
|
299
|
+
var e, a;
|
|
300
|
+
if (i) {
|
|
301
301
|
N(!0), v("");
|
|
302
302
|
try {
|
|
303
|
-
let r = await
|
|
304
|
-
|
|
303
|
+
let r = await rr(i.id, {});
|
|
304
|
+
O(r), _(r), H({
|
|
305
305
|
message: "Marked as on the way. The requester can confirm it when it arrives.",
|
|
306
306
|
type: "success"
|
|
307
307
|
});
|
|
308
308
|
} catch (r) {
|
|
309
|
-
v(((
|
|
309
|
+
v(((a = (e = r == null ? void 0 : r.response) == null ? void 0 : e.data) == null ? void 0 : a.message) ?? (r == null ? void 0 : r.message) ?? "Failed to mark in transit");
|
|
310
310
|
} finally {
|
|
311
311
|
N(!1);
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
async function
|
|
316
|
-
var e,
|
|
317
|
-
if (
|
|
318
|
-
if (!
|
|
319
|
-
|
|
315
|
+
async function Kt() {
|
|
316
|
+
var e, a;
|
|
317
|
+
if (i) {
|
|
318
|
+
if (!Zt) {
|
|
319
|
+
Ze(!0);
|
|
320
320
|
return;
|
|
321
321
|
}
|
|
322
322
|
N(!0), v("");
|
|
323
323
|
try {
|
|
324
|
-
let r = await
|
|
324
|
+
let r = await tr(i.id, { corrections: A.map((l) => {
|
|
325
325
|
let o = re[l.batchId] ?? "CORRECT";
|
|
326
326
|
if (o === "CANNOT_SUPPLY") return {
|
|
327
327
|
batchId: l.batchId,
|
|
328
328
|
action: o
|
|
329
329
|
};
|
|
330
|
-
let u =
|
|
330
|
+
let u = pe[l.batchId] ?? {};
|
|
331
331
|
return {
|
|
332
332
|
batchId: l.batchId,
|
|
333
333
|
action: o,
|
|
@@ -336,117 +336,121 @@ function Zr() {
|
|
|
336
336
|
manufactureDate: u.manufactureDate || null
|
|
337
337
|
};
|
|
338
338
|
}) });
|
|
339
|
-
|
|
340
|
-
message:
|
|
339
|
+
O(r), _(r), H({
|
|
340
|
+
message: K > 0 ? `Sent back to ${i.requestedByName || "the requester"} to check again.` : "Closed. Those batches will not be supplied.",
|
|
341
341
|
type: "success"
|
|
342
342
|
});
|
|
343
343
|
} catch (r) {
|
|
344
|
-
v(((
|
|
344
|
+
v(((a = (e = r == null ? void 0 : r.response) == null ? void 0 : e.data) == null ? void 0 : a.message) ?? (r == null ? void 0 : r.message) ?? "Could not send the corrections.");
|
|
345
345
|
} finally {
|
|
346
346
|
N(!1);
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
async function
|
|
351
|
-
var e,
|
|
352
|
-
if (
|
|
350
|
+
async function Vt() {
|
|
351
|
+
var e, a;
|
|
352
|
+
if (i) {
|
|
353
353
|
N(!0), v("");
|
|
354
354
|
try {
|
|
355
355
|
let r = {};
|
|
356
|
-
|
|
357
|
-
r[o] = (
|
|
356
|
+
U.forEach((o) => {
|
|
357
|
+
r[o] = (Se[o] ?? "").trim();
|
|
358
358
|
});
|
|
359
|
-
let l = await
|
|
359
|
+
let l = await ar(i.id, {
|
|
360
360
|
verifiedBatchIds: xe,
|
|
361
|
-
flaggedBatchIds:
|
|
361
|
+
flaggedBatchIds: U,
|
|
362
362
|
discrepancyReasons: r,
|
|
363
363
|
notes: ie && Ke.trim() || null
|
|
364
364
|
});
|
|
365
|
-
|
|
366
|
-
message: ne ? "Sent back to the approver." : ie ? `Received the OK batches. ${
|
|
365
|
+
O(l), _(l), H({
|
|
366
|
+
message: ne ? "Sent back to the approver." : ie ? `Received the OK batches. ${U.length} flagged ${U.length === 1 ? "batch was" : "batches were"} sent to the approver.` : "Received. The stock is now in your inventory.",
|
|
367
367
|
type: "success"
|
|
368
368
|
});
|
|
369
369
|
} catch (r) {
|
|
370
|
-
v(((
|
|
370
|
+
v(((a = (e = r == null ? void 0 : r.response) == null ? void 0 : e.data) == null ? void 0 : a.message) ?? (r == null ? void 0 : r.message) ?? "Could not submit the receipt.");
|
|
371
371
|
} finally {
|
|
372
372
|
N(!1);
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
async function
|
|
377
|
-
var e,
|
|
378
|
-
if (
|
|
376
|
+
async function Ht() {
|
|
377
|
+
var e, a;
|
|
378
|
+
if (i) {
|
|
379
379
|
N(!0), v("");
|
|
380
380
|
try {
|
|
381
|
-
|
|
381
|
+
O(await ir(i.id)), H({
|
|
382
382
|
message: "Request cancelled.",
|
|
383
383
|
type: "success"
|
|
384
384
|
});
|
|
385
385
|
} catch (r) {
|
|
386
|
-
v(((
|
|
386
|
+
v(((a = (e = r == null ? void 0 : r.response) == null ? void 0 : e.data) == null ? void 0 : a.message) ?? (r == null ? void 0 : r.message) ?? "Failed to cancel request");
|
|
387
387
|
} finally {
|
|
388
388
|
N(!1);
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
let fe =
|
|
392
|
+
let fe = $(() => {
|
|
393
393
|
let e = [];
|
|
394
|
-
return ((
|
|
395
|
-
(
|
|
394
|
+
return ((i == null ? void 0 : i.items) ?? []).forEach((a) => {
|
|
395
|
+
(a.batches ?? []).forEach((r) => {
|
|
396
396
|
(r.quantity ?? 0) > 0 && (r.lotNumber || r.expiryDate) && e.push({
|
|
397
397
|
...r,
|
|
398
|
-
productName:
|
|
399
|
-
|
|
398
|
+
productName: a.productName,
|
|
399
|
+
hasManufactureDate: a.hasManufactureDate,
|
|
400
|
+
expiryMode: a.expiryMode,
|
|
401
|
+
expiryInterval: a.expiryInterval,
|
|
402
|
+
expiryIntervalUnit: a.expiryIntervalUnit,
|
|
403
|
+
itemId: a.id
|
|
400
404
|
});
|
|
401
405
|
});
|
|
402
406
|
}), e;
|
|
403
|
-
}, [
|
|
404
|
-
let e = {},
|
|
407
|
+
}, [i]), G = $(() => fe.filter((e) => e.batchId && e.receiptStatus == null), [fe]), xe = $(() => G.filter((e) => (ee[e.batchId] ?? "OK") === "OK").map((e) => e.batchId), [G, ee]), U = $(() => G.filter((e) => ee[e.batchId] === "ISSUE").map((e) => e.batchId), [G, ee]), ie = U.length > 0, ne = G.length > 0 && xe.length === 0, Jt = G.length > 0 && U.every((e) => (Se[e] ?? "").trim()), A = $(() => fe.filter((e) => e.batchId && e.receiptStatus === "DISCREPANCY"), [fe]), K = A.filter((e) => (re[e.batchId] ?? "CORRECT") === "CORRECT").length, nt = A.length - K, le = $(() => {
|
|
408
|
+
let e = {}, a = (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
|
|
405
409
|
return A.forEach((r) => {
|
|
406
410
|
if ((re[r.batchId] ?? "CORRECT") !== "CORRECT") return;
|
|
407
|
-
let l =
|
|
408
|
-
(!l.lotNumber || !l.lotNumber.trim()) && (e[`${r.batchId}:lotNumber`] = "Lot number is required"), l.expiryDate ? l.expiryDate <
|
|
411
|
+
let l = pe[r.batchId] ?? {};
|
|
412
|
+
(!l.lotNumber || !l.lotNumber.trim()) && (e[`${r.batchId}:lotNumber`] = "Lot number is required"), r.expiryMode !== "FROM_MANUFACTURE" && (l.expiryDate ? l.expiryDate < a && (e[`${r.batchId}:expiryDate`] = "Must be today or later") : e[`${r.batchId}:expiryDate`] = "Expiry is required"), l.manufactureDate ? l.manufactureDate > a && (e[`${r.batchId}:manufactureDate`] = "Cannot be in the future") : r.hasManufactureDate && (e[`${r.batchId}:manufactureDate`] = "Manufactured date is required");
|
|
409
413
|
}), e;
|
|
410
414
|
}, [
|
|
411
415
|
A,
|
|
412
416
|
re,
|
|
413
|
-
|
|
414
|
-
]),
|
|
415
|
-
function
|
|
416
|
-
|
|
417
|
+
pe
|
|
418
|
+
]), Zt = Object.keys(le).length === 0, V = (e) => (St || Et[e]) && !!le[e];
|
|
419
|
+
function Me(e, a, r) {
|
|
420
|
+
Je((l) => ({
|
|
417
421
|
...l,
|
|
418
422
|
[e]: {
|
|
419
423
|
...l[e] ?? {},
|
|
420
|
-
[
|
|
424
|
+
[a]: r
|
|
421
425
|
}
|
|
422
426
|
}));
|
|
423
427
|
}
|
|
424
|
-
return /* @__PURE__ */ n(
|
|
428
|
+
return /* @__PURE__ */ n(k, { children: [/* @__PURE__ */ t(sr, {}), /* @__PURE__ */ n(cr, {
|
|
425
429
|
anyOf: ["view.manage.productManagement.purchase", "approve.manage.productManagement.purchase"],
|
|
426
|
-
children: [/* @__PURE__ */ n(
|
|
427
|
-
title:
|
|
430
|
+
children: [/* @__PURE__ */ n(ur, {
|
|
431
|
+
title: i != null && i.serialId ? `Purchase Request #${i.serialId}` : "Purchase Request",
|
|
428
432
|
subtitle: "Track this request from approval through to the stock arriving.",
|
|
429
|
-
chips: [...
|
|
430
|
-
actions: /* @__PURE__ */ n(
|
|
433
|
+
chips: [...i != null && i.status ? [wt(i.status)] : [], ...R ? [Nt(Rt, R)] : []],
|
|
434
|
+
actions: /* @__PURE__ */ n(p, {
|
|
431
435
|
direction: "row",
|
|
432
436
|
spacing: 1,
|
|
433
|
-
children: [/* @__PURE__ */ t(
|
|
437
|
+
children: [/* @__PURE__ */ t(D, {
|
|
434
438
|
variant: "outlined",
|
|
435
|
-
startIcon: /* @__PURE__ */ t(
|
|
439
|
+
startIcon: /* @__PURE__ */ t(wr, {}),
|
|
436
440
|
onClick: () => g("/ui/medplat/manage/pm/purchase-requests"),
|
|
437
441
|
children: "Back"
|
|
438
|
-
}), /* @__PURE__ */ t(
|
|
442
|
+
}), /* @__PURE__ */ t(D, {
|
|
439
443
|
variant: "outlined",
|
|
440
|
-
startIcon: /* @__PURE__ */ t(
|
|
444
|
+
startIcon: /* @__PURE__ */ t(Ir, {}),
|
|
441
445
|
onClick: () => void Xe(),
|
|
442
446
|
children: "Refresh"
|
|
443
447
|
})]
|
|
444
448
|
}),
|
|
445
|
-
children: [
|
|
449
|
+
children: [ze ? /* @__PURE__ */ t(Pe, {
|
|
446
450
|
severity: "error",
|
|
447
451
|
sx: { mb: 2 },
|
|
448
|
-
children:
|
|
449
|
-
}) : null, !
|
|
452
|
+
children: ze
|
|
453
|
+
}) : null, !Tt && i ? /* @__PURE__ */ n(E, { children: [
|
|
450
454
|
/* @__PURE__ */ t(ue, {
|
|
451
455
|
sx: {
|
|
452
456
|
borderRadius: 1.5,
|
|
@@ -458,20 +462,20 @@ function Zr() {
|
|
|
458
462
|
children: /* @__PURE__ */ n(de, {
|
|
459
463
|
sx: { p: 2.5 },
|
|
460
464
|
children: [
|
|
461
|
-
/* @__PURE__ */ n(
|
|
465
|
+
/* @__PURE__ */ n(p, {
|
|
462
466
|
direction: {
|
|
463
467
|
xs: "column",
|
|
464
468
|
md: "row"
|
|
465
469
|
},
|
|
466
470
|
spacing: 2,
|
|
467
471
|
alignItems: { md: "flex-start" },
|
|
468
|
-
children: [/* @__PURE__ */ n(
|
|
472
|
+
children: [/* @__PURE__ */ n(k, {
|
|
469
473
|
sx: {
|
|
470
474
|
flexGrow: 1,
|
|
471
475
|
minWidth: 0
|
|
472
476
|
},
|
|
473
477
|
children: [
|
|
474
|
-
/* @__PURE__ */ n(
|
|
478
|
+
/* @__PURE__ */ n(p, {
|
|
475
479
|
direction: "row",
|
|
476
480
|
alignItems: "center",
|
|
477
481
|
spacing: 1,
|
|
@@ -479,119 +483,119 @@ function Zr() {
|
|
|
479
483
|
flexWrap: "wrap",
|
|
480
484
|
useFlexGap: !0,
|
|
481
485
|
children: [
|
|
482
|
-
/* @__PURE__ */ t(
|
|
483
|
-
/* @__PURE__ */ t(
|
|
486
|
+
/* @__PURE__ */ t(er, { id: i.serialId }),
|
|
487
|
+
/* @__PURE__ */ t(w, {
|
|
484
488
|
size: "small",
|
|
485
|
-
label:
|
|
486
|
-
color:
|
|
489
|
+
label: wt(i.status),
|
|
490
|
+
color: Er(i.status)
|
|
487
491
|
}),
|
|
488
|
-
|
|
492
|
+
R ? /* @__PURE__ */ t(w, {
|
|
489
493
|
size: "small",
|
|
490
|
-
label:
|
|
491
|
-
color:
|
|
494
|
+
label: Nt(Rt, R),
|
|
495
|
+
color: Sr(R)
|
|
492
496
|
}) : null,
|
|
493
497
|
/* @__PURE__ */ t(d, {
|
|
494
498
|
variant: "caption",
|
|
495
499
|
color: "text.secondary",
|
|
496
|
-
children:
|
|
500
|
+
children: i.ownerType
|
|
497
501
|
})
|
|
498
502
|
]
|
|
499
503
|
}),
|
|
500
504
|
/* @__PURE__ */ t(d, {
|
|
501
505
|
variant: "h6",
|
|
502
506
|
sx: { fontWeight: 800 },
|
|
503
|
-
children:
|
|
507
|
+
children: i.ownerName || (i.ownerType === "USER" ? "Personal" : "Facility")
|
|
504
508
|
}),
|
|
505
509
|
/* @__PURE__ */ n(d, {
|
|
506
510
|
variant: "caption",
|
|
507
511
|
color: "text.secondary",
|
|
508
512
|
sx: { display: "block" },
|
|
509
|
-
children: ["For purchase date ",
|
|
513
|
+
children: ["For purchase date ", Fe(i.purchaseDate)]
|
|
510
514
|
})
|
|
511
515
|
]
|
|
512
|
-
}), /* @__PURE__ */ n(
|
|
516
|
+
}), /* @__PURE__ */ n(p, {
|
|
513
517
|
spacing: 0.25,
|
|
514
518
|
sx: { minWidth: 260 },
|
|
515
519
|
children: [
|
|
516
|
-
/* @__PURE__ */ t(
|
|
520
|
+
/* @__PURE__ */ t(j, {
|
|
517
521
|
label: "Requested by",
|
|
518
|
-
children:
|
|
522
|
+
children: i.requestedByName || `#${i.requestedBy}`
|
|
519
523
|
}),
|
|
520
|
-
/* @__PURE__ */ t(
|
|
524
|
+
/* @__PURE__ */ t(j, {
|
|
521
525
|
label: "Requested on",
|
|
522
|
-
children:
|
|
526
|
+
children: Dt(i.requestedOn)
|
|
523
527
|
}),
|
|
524
|
-
|
|
528
|
+
i.decidedBy ? /* @__PURE__ */ n(E, { children: [/* @__PURE__ */ t(j, {
|
|
525
529
|
label: "Decided by",
|
|
526
|
-
children:
|
|
527
|
-
}), /* @__PURE__ */ t(
|
|
530
|
+
children: i.decidedByName || `#${i.decidedBy}`
|
|
531
|
+
}), /* @__PURE__ */ t(j, {
|
|
528
532
|
label: "Decided on",
|
|
529
|
-
children:
|
|
533
|
+
children: Dt(i.decidedOn)
|
|
530
534
|
})] }) : null,
|
|
531
|
-
|
|
535
|
+
i.shippedBy ? /* @__PURE__ */ t(j, {
|
|
532
536
|
label: "Shipped by",
|
|
533
|
-
children:
|
|
537
|
+
children: i.shippedByName || `#${i.shippedBy}`
|
|
534
538
|
}) : null,
|
|
535
|
-
|
|
539
|
+
i.receivedBy ? /* @__PURE__ */ t(j, {
|
|
536
540
|
label: "Received by",
|
|
537
|
-
children:
|
|
541
|
+
children: i.receivedByName || `#${i.receivedBy}`
|
|
538
542
|
}) : null,
|
|
539
|
-
|
|
543
|
+
Z && i.paymentMode ? /* @__PURE__ */ t(j, {
|
|
540
544
|
label: "Payment",
|
|
541
|
-
children:
|
|
545
|
+
children: i.paymentMode
|
|
542
546
|
}) : null
|
|
543
547
|
]
|
|
544
548
|
})]
|
|
545
549
|
}),
|
|
546
|
-
|
|
550
|
+
i.notes ? /* @__PURE__ */ n(E, { children: [
|
|
547
551
|
/* @__PURE__ */ t(Ie, { sx: { my: 1.5 } }),
|
|
548
|
-
/* @__PURE__ */ t(
|
|
552
|
+
/* @__PURE__ */ t(we, { children: "Requester notes" }),
|
|
549
553
|
/* @__PURE__ */ t(d, {
|
|
550
554
|
variant: "body2",
|
|
551
|
-
children:
|
|
555
|
+
children: i.notes
|
|
552
556
|
})
|
|
553
557
|
] }) : null,
|
|
554
|
-
|
|
558
|
+
i.decisionNotes ? /* @__PURE__ */ n(E, { children: [
|
|
555
559
|
/* @__PURE__ */ t(Ie, { sx: { my: 1.5 } }),
|
|
556
|
-
/* @__PURE__ */ t(
|
|
560
|
+
/* @__PURE__ */ t(we, { children: "Decision notes" }),
|
|
557
561
|
/* @__PURE__ */ t(d, {
|
|
558
562
|
variant: "body2",
|
|
559
|
-
children:
|
|
563
|
+
children: i.decisionNotes
|
|
560
564
|
})
|
|
561
565
|
] }) : null,
|
|
562
|
-
|
|
566
|
+
i.fulfillmentNotes ? /* @__PURE__ */ n(E, { children: [
|
|
563
567
|
/* @__PURE__ */ t(Ie, { sx: { my: 1.5 } }),
|
|
564
|
-
/* @__PURE__ */ t(
|
|
568
|
+
/* @__PURE__ */ t(we, { children: R === "DISCREPANCY" || R === "PARTIALLY_RECEIVED" ? "Reported discrepancy" : "Delivery note" }),
|
|
565
569
|
/* @__PURE__ */ t(d, {
|
|
566
570
|
variant: "body2",
|
|
567
|
-
children:
|
|
571
|
+
children: i.fulfillmentNotes
|
|
568
572
|
})
|
|
569
573
|
] }) : null
|
|
570
574
|
]
|
|
571
575
|
})
|
|
572
576
|
}),
|
|
573
|
-
|
|
577
|
+
At ? /* @__PURE__ */ t(ue, {
|
|
574
578
|
variant: "outlined",
|
|
575
579
|
sx: { mb: 2 },
|
|
576
580
|
children: /* @__PURE__ */ n(de, {
|
|
577
581
|
sx: { p: 2 },
|
|
578
582
|
children: [
|
|
579
|
-
/* @__PURE__ */ n(
|
|
583
|
+
/* @__PURE__ */ n(Pe, {
|
|
580
584
|
severity: "warning",
|
|
581
585
|
sx: { mb: 2 },
|
|
582
|
-
icon: /* @__PURE__ */ t(
|
|
586
|
+
icon: /* @__PURE__ */ t(De, {}),
|
|
583
587
|
children: [
|
|
584
|
-
|
|
588
|
+
i.requestedByName || "The requester",
|
|
585
589
|
" could not accept",
|
|
586
590
|
A.length === 1 ? " this batch" : ` these ${A.length} batches`,
|
|
587
591
|
". Fix the details so they can check again, or say it cannot be supplied."
|
|
588
592
|
]
|
|
589
593
|
}),
|
|
590
|
-
/* @__PURE__ */ t(
|
|
594
|
+
/* @__PURE__ */ t(p, {
|
|
591
595
|
spacing: 1.5,
|
|
592
596
|
children: A.map((e) => {
|
|
593
|
-
let
|
|
594
|
-
return /* @__PURE__ */ n(
|
|
597
|
+
let a = re[e.batchId] ?? "CORRECT", r = pe[e.batchId] ?? {};
|
|
598
|
+
return /* @__PURE__ */ n(k, {
|
|
595
599
|
sx: (l) => ({
|
|
596
600
|
p: 1.5,
|
|
597
601
|
borderRadius: 1.5,
|
|
@@ -599,7 +603,7 @@ function Zr() {
|
|
|
599
603
|
bgcolor: J(l.palette.warning.main, 0.04)
|
|
600
604
|
}),
|
|
601
605
|
children: [
|
|
602
|
-
/* @__PURE__ */ n(
|
|
606
|
+
/* @__PURE__ */ n(p, {
|
|
603
607
|
direction: {
|
|
604
608
|
xs: "column",
|
|
605
609
|
sm: "row"
|
|
@@ -607,7 +611,7 @@ function Zr() {
|
|
|
607
611
|
spacing: 1,
|
|
608
612
|
justifyContent: "space-between",
|
|
609
613
|
alignItems: { sm: "center" },
|
|
610
|
-
children: [/* @__PURE__ */ n(
|
|
614
|
+
children: [/* @__PURE__ */ n(k, { children: [/* @__PURE__ */ t(d, {
|
|
611
615
|
variant: "body2",
|
|
612
616
|
sx: { fontWeight: 700 },
|
|
613
617
|
children: e.productName
|
|
@@ -622,24 +626,24 @@ function Zr() {
|
|
|
622
626
|
" unit",
|
|
623
627
|
e.quantity === 1 ? "" : "s"
|
|
624
628
|
]
|
|
625
|
-
})] }), /* @__PURE__ */ n(
|
|
629
|
+
})] }), /* @__PURE__ */ n(Ce, {
|
|
626
630
|
size: "small",
|
|
627
631
|
exclusive: !0,
|
|
628
|
-
value:
|
|
632
|
+
value: a,
|
|
629
633
|
onChange: (l, o) => {
|
|
630
|
-
o &&
|
|
634
|
+
o && He((u) => ({
|
|
631
635
|
...u,
|
|
632
636
|
[e.batchId]: o
|
|
633
637
|
}));
|
|
634
638
|
},
|
|
635
|
-
children: [/* @__PURE__ */ t(
|
|
639
|
+
children: [/* @__PURE__ */ t(F, {
|
|
636
640
|
value: "CORRECT",
|
|
637
641
|
sx: {
|
|
638
642
|
textTransform: "none",
|
|
639
643
|
px: 1.25
|
|
640
644
|
},
|
|
641
645
|
children: "Fix details"
|
|
642
|
-
}), /* @__PURE__ */ t(
|
|
646
|
+
}), /* @__PURE__ */ t(F, {
|
|
643
647
|
value: "CANNOT_SUPPLY",
|
|
644
648
|
color: "error",
|
|
645
649
|
sx: {
|
|
@@ -662,7 +666,7 @@ function Zr() {
|
|
|
662
666
|
"”"
|
|
663
667
|
]
|
|
664
668
|
}) : null,
|
|
665
|
-
|
|
669
|
+
a === "CORRECT" ? /* @__PURE__ */ n(k, {
|
|
666
670
|
sx: {
|
|
667
671
|
mt: 1.5,
|
|
668
672
|
display: "grid",
|
|
@@ -678,8 +682,8 @@ function Zr() {
|
|
|
678
682
|
label: "Lot number",
|
|
679
683
|
required: !0,
|
|
680
684
|
value: r.lotNumber ?? "",
|
|
681
|
-
onChange: (l) =>
|
|
682
|
-
onBlur: () =>
|
|
685
|
+
onChange: (l) => Me(e.batchId, "lotNumber", l.target.value),
|
|
686
|
+
onBlur: () => me((l) => ({
|
|
683
687
|
...l,
|
|
684
688
|
[`${e.batchId}:lotNumber`]: !0
|
|
685
689
|
})),
|
|
@@ -690,30 +694,32 @@ function Zr() {
|
|
|
690
694
|
size: "small",
|
|
691
695
|
type: "date",
|
|
692
696
|
label: "Expiry",
|
|
693
|
-
required:
|
|
697
|
+
required: e.expiryMode !== "FROM_MANUFACTURE",
|
|
694
698
|
InputLabelProps: { shrink: !0 },
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
699
|
+
inputProps: e.expiryMode === "FROM_MANUFACTURE" ? { readOnly: !0 } : void 0,
|
|
700
|
+
value: e.expiryMode === "FROM_MANUFACTURE" ? Ae(r.manufactureDate, e.expiryInterval, e.expiryIntervalUnit) : r.expiryDate ?? "",
|
|
701
|
+
onChange: (l) => Me(e.batchId, "expiryDate", l.target.value),
|
|
702
|
+
onBlur: () => me((l) => ({
|
|
698
703
|
...l,
|
|
699
704
|
[`${e.batchId}:expiryDate`]: !0
|
|
700
705
|
})),
|
|
701
706
|
error: V(`${e.batchId}:expiryDate`),
|
|
702
|
-
helperText: V(`${e.batchId}:expiryDate`) ? le[`${e.batchId}:expiryDate`] : " "
|
|
707
|
+
helperText: e.expiryMode === "FROM_MANUFACTURE" ? `${e.expiryInterval} ${String(e.expiryIntervalUnit ?? "").toLowerCase()} after manufacture` : V(`${e.batchId}:expiryDate`) ? le[`${e.batchId}:expiryDate`] : " "
|
|
703
708
|
}),
|
|
704
709
|
/* @__PURE__ */ t(I, {
|
|
705
710
|
size: "small",
|
|
706
711
|
type: "date",
|
|
707
712
|
label: "Manufactured",
|
|
708
713
|
InputLabelProps: { shrink: !0 },
|
|
714
|
+
required: !!e.hasManufactureDate,
|
|
709
715
|
value: r.manufactureDate ?? "",
|
|
710
|
-
onChange: (l) =>
|
|
711
|
-
onBlur: () =>
|
|
716
|
+
onChange: (l) => Me(e.batchId, "manufactureDate", l.target.value),
|
|
717
|
+
onBlur: () => me((l) => ({
|
|
712
718
|
...l,
|
|
713
719
|
[`${e.batchId}:manufactureDate`]: !0
|
|
714
720
|
})),
|
|
715
721
|
error: V(`${e.batchId}:manufactureDate`),
|
|
716
|
-
helperText: V(`${e.batchId}:manufactureDate`) ? le[`${e.batchId}:manufactureDate`] : "Optional"
|
|
722
|
+
helperText: V(`${e.batchId}:manufactureDate`) ? le[`${e.batchId}:manufactureDate`] : e.hasManufactureDate ? "Required for this product" : "Optional"
|
|
717
723
|
})
|
|
718
724
|
]
|
|
719
725
|
}) : /* @__PURE__ */ t(d, {
|
|
@@ -737,39 +743,39 @@ function Zr() {
|
|
|
737
743
|
display: "block",
|
|
738
744
|
mt: 2
|
|
739
745
|
},
|
|
740
|
-
children: [
|
|
746
|
+
children: [K > 0 ? `${K} will go back for checking. ` : "", nt > 0 ? `${nt} will be closed.` : ""]
|
|
741
747
|
}),
|
|
742
|
-
/* @__PURE__ */ t(
|
|
748
|
+
/* @__PURE__ */ t(p, {
|
|
743
749
|
direction: "row",
|
|
744
750
|
spacing: 1,
|
|
745
751
|
justifyContent: "flex-end",
|
|
746
752
|
sx: { mt: 1 },
|
|
747
|
-
children: /* @__PURE__ */ t(
|
|
753
|
+
children: /* @__PURE__ */ t(D, {
|
|
748
754
|
variant: "contained",
|
|
749
|
-
color:
|
|
755
|
+
color: K === 0 ? "error" : "primary",
|
|
750
756
|
disabled: f,
|
|
751
|
-
onClick: () => void
|
|
752
|
-
children: f ? "Sending…" :
|
|
757
|
+
onClick: () => void Kt(),
|
|
758
|
+
children: f ? "Sending…" : K === 0 ? "Close These Batches" : "Send Corrections"
|
|
753
759
|
})
|
|
754
760
|
})
|
|
755
761
|
]
|
|
756
762
|
})
|
|
757
763
|
}) : null,
|
|
758
|
-
ae ? /* @__PURE__ */ n(
|
|
759
|
-
/* @__PURE__ */ t(
|
|
764
|
+
ae ? /* @__PURE__ */ n(E, { children: [
|
|
765
|
+
/* @__PURE__ */ t(It, {
|
|
760
766
|
eyebrow: "Decision",
|
|
761
767
|
title: "Requested items",
|
|
762
768
|
hint: "Approve or reject each item. For approved items, add the batch(es) coming in with their lot number and expiry."
|
|
763
769
|
}),
|
|
764
|
-
/* @__PURE__ */ t(
|
|
770
|
+
/* @__PURE__ */ t(p, {
|
|
765
771
|
spacing: 2,
|
|
766
772
|
sx: {
|
|
767
773
|
mt: 1.5,
|
|
768
774
|
mb: 2
|
|
769
775
|
},
|
|
770
|
-
children:
|
|
771
|
-
var
|
|
772
|
-
let
|
|
776
|
+
children: i.items.map((e) => {
|
|
777
|
+
var q, oe, se, ge, ce, B, ve, ot, st, ct, ut, dt, ht, pt, mt, yt, bt, ft, xt, gt, vt;
|
|
778
|
+
let a = !!T[e.id], r = !!Q[e.id], l = rt(e.id), o = r ? l : l.slice(0, 1), u = be(e.id), h = Math.max(e.requestedQuantity - u, 0), m = y[`${e.id}:sum`], c = a ? u === e.requestedQuantity ? {
|
|
773
779
|
label: "Full",
|
|
774
780
|
color: "success"
|
|
775
781
|
} : u > 0 ? {
|
|
@@ -786,12 +792,12 @@ function Zr() {
|
|
|
786
792
|
variant: "outlined",
|
|
787
793
|
sx: {
|
|
788
794
|
borderRadius: 1.5,
|
|
789
|
-
borderColor:
|
|
790
|
-
bgcolor:
|
|
795
|
+
borderColor: a ? "divider" : "action.disabledBackground",
|
|
796
|
+
bgcolor: a ? "background.paper" : (s) => J(s.palette.action.disabled, 0.03)
|
|
791
797
|
},
|
|
792
798
|
children: /* @__PURE__ */ n(de, {
|
|
793
799
|
sx: { p: 2 },
|
|
794
|
-
children: [/* @__PURE__ */ n(
|
|
800
|
+
children: [/* @__PURE__ */ n(p, {
|
|
795
801
|
direction: {
|
|
796
802
|
xs: "column",
|
|
797
803
|
sm: "row"
|
|
@@ -799,20 +805,20 @@ function Zr() {
|
|
|
799
805
|
justifyContent: "space-between",
|
|
800
806
|
alignItems: { sm: "center" },
|
|
801
807
|
spacing: 1,
|
|
802
|
-
children: [/* @__PURE__ */ n(
|
|
808
|
+
children: [/* @__PURE__ */ n(k, {
|
|
803
809
|
sx: { minWidth: 0 },
|
|
804
810
|
children: [/* @__PURE__ */ t(d, {
|
|
805
811
|
variant: "subtitle1",
|
|
806
812
|
sx: { fontWeight: 800 },
|
|
807
813
|
children: e.productName
|
|
808
|
-
}), /* @__PURE__ */ n(
|
|
814
|
+
}), /* @__PURE__ */ n(p, {
|
|
809
815
|
direction: "row",
|
|
810
816
|
spacing: 1,
|
|
811
817
|
alignItems: "center",
|
|
812
818
|
flexWrap: "wrap",
|
|
813
819
|
useFlexGap: !0,
|
|
814
820
|
children: [
|
|
815
|
-
/* @__PURE__ */ t(
|
|
821
|
+
/* @__PURE__ */ t(w, {
|
|
816
822
|
size: "small",
|
|
817
823
|
variant: "outlined",
|
|
818
824
|
label: `Requested ${e.requestedQuantity}`,
|
|
@@ -821,10 +827,10 @@ function Zr() {
|
|
|
821
827
|
height: 22
|
|
822
828
|
}
|
|
823
829
|
}),
|
|
824
|
-
|
|
830
|
+
Z && e.buyPrice != null ? /* @__PURE__ */ n(d, {
|
|
825
831
|
variant: "caption",
|
|
826
832
|
color: "text.secondary",
|
|
827
|
-
children: [/* @__PURE__ */ t(
|
|
833
|
+
children: [/* @__PURE__ */ t(Ct, {
|
|
828
834
|
value: e.buyPrice,
|
|
829
835
|
bold: !1
|
|
830
836
|
}), " each"]
|
|
@@ -836,14 +842,14 @@ function Zr() {
|
|
|
836
842
|
}) : null
|
|
837
843
|
]
|
|
838
844
|
})]
|
|
839
|
-
}), /* @__PURE__ */ n(
|
|
845
|
+
}), /* @__PURE__ */ n(Ce, {
|
|
840
846
|
size: "small",
|
|
841
847
|
exclusive: !0,
|
|
842
|
-
value:
|
|
843
|
-
onChange: (s,
|
|
844
|
-
|
|
848
|
+
value: a ? "approve" : "reject",
|
|
849
|
+
onChange: (s, z) => {
|
|
850
|
+
z && Bt(e.id, z === "approve");
|
|
845
851
|
},
|
|
846
|
-
children: [/* @__PURE__ */ t(
|
|
852
|
+
children: [/* @__PURE__ */ t(F, {
|
|
847
853
|
value: "approve",
|
|
848
854
|
color: "success",
|
|
849
855
|
sx: {
|
|
@@ -852,7 +858,7 @@ function Zr() {
|
|
|
852
858
|
fontWeight: 700
|
|
853
859
|
},
|
|
854
860
|
children: "Approve"
|
|
855
|
-
}), /* @__PURE__ */ t(
|
|
861
|
+
}), /* @__PURE__ */ t(F, {
|
|
856
862
|
value: "reject",
|
|
857
863
|
color: "error",
|
|
858
864
|
sx: {
|
|
@@ -863,9 +869,9 @@ function Zr() {
|
|
|
863
869
|
children: "Reject"
|
|
864
870
|
})]
|
|
865
871
|
})]
|
|
866
|
-
}),
|
|
872
|
+
}), a ? /* @__PURE__ */ n(E, { children: [
|
|
867
873
|
/* @__PURE__ */ t(Ie, { sx: { my: 1.5 } }),
|
|
868
|
-
/* @__PURE__ */ n(
|
|
874
|
+
/* @__PURE__ */ n(p, {
|
|
869
875
|
direction: {
|
|
870
876
|
xs: "column",
|
|
871
877
|
sm: "row"
|
|
@@ -874,21 +880,21 @@ function Zr() {
|
|
|
874
880
|
alignItems: { sm: "center" },
|
|
875
881
|
spacing: 1,
|
|
876
882
|
sx: { mb: 1.5 },
|
|
877
|
-
children: [/* @__PURE__ */ n(
|
|
883
|
+
children: [/* @__PURE__ */ n(Ce, {
|
|
878
884
|
size: "small",
|
|
879
885
|
exclusive: !0,
|
|
880
886
|
value: r ? "multi" : "single",
|
|
881
|
-
onChange: (s,
|
|
882
|
-
|
|
887
|
+
onChange: (s, z) => {
|
|
888
|
+
z && zt(e.id, z === "multi");
|
|
883
889
|
},
|
|
884
|
-
children: [/* @__PURE__ */ t(
|
|
890
|
+
children: [/* @__PURE__ */ t(F, {
|
|
885
891
|
value: "single",
|
|
886
892
|
sx: {
|
|
887
893
|
textTransform: "none",
|
|
888
894
|
px: 1.5
|
|
889
895
|
},
|
|
890
896
|
children: "Single batch"
|
|
891
|
-
}), /* @__PURE__ */ t(
|
|
897
|
+
}), /* @__PURE__ */ t(F, {
|
|
892
898
|
value: "multi",
|
|
893
899
|
sx: {
|
|
894
900
|
textTransform: "none",
|
|
@@ -896,15 +902,15 @@ function Zr() {
|
|
|
896
902
|
},
|
|
897
903
|
children: "Multiple batches"
|
|
898
904
|
})]
|
|
899
|
-
}), /* @__PURE__ */ t(
|
|
905
|
+
}), /* @__PURE__ */ t(w, {
|
|
900
906
|
size: "small",
|
|
901
907
|
color: c.color,
|
|
902
908
|
label: `${u} of ${e.requestedQuantity} · ${c.label}`,
|
|
903
909
|
sx: { fontWeight: 700 }
|
|
904
910
|
})]
|
|
905
911
|
}),
|
|
906
|
-
r ? /* @__PURE__ */ n(
|
|
907
|
-
/* @__PURE__ */ n(
|
|
912
|
+
r ? /* @__PURE__ */ n(E, { children: [
|
|
913
|
+
/* @__PURE__ */ n(k, {
|
|
908
914
|
sx: (s) => ({
|
|
909
915
|
display: "flex",
|
|
910
916
|
justifyContent: "space-between",
|
|
@@ -928,7 +934,7 @@ function Zr() {
|
|
|
928
934
|
e.requestedQuantity,
|
|
929
935
|
" allocated"
|
|
930
936
|
]
|
|
931
|
-
}), /* @__PURE__ */ t(
|
|
937
|
+
}), /* @__PURE__ */ t(w, {
|
|
932
938
|
size: "small",
|
|
933
939
|
color: h === 0 ? "success" : "default",
|
|
934
940
|
label: h === 0 ? "Fully allocated" : `${h} left`,
|
|
@@ -938,37 +944,37 @@ function Zr() {
|
|
|
938
944
|
}
|
|
939
945
|
})]
|
|
940
946
|
}),
|
|
941
|
-
/* @__PURE__ */ t(
|
|
947
|
+
/* @__PURE__ */ t(p, {
|
|
942
948
|
spacing: 1.5,
|
|
943
|
-
children: o.map((s,
|
|
949
|
+
children: o.map((s, z) => /* @__PURE__ */ n(k, {
|
|
944
950
|
sx: {
|
|
945
951
|
p: 1.5,
|
|
946
952
|
border: "1px solid",
|
|
947
953
|
borderColor: "divider",
|
|
948
954
|
borderRadius: 1.5
|
|
949
955
|
},
|
|
950
|
-
children: [/* @__PURE__ */ n(
|
|
956
|
+
children: [/* @__PURE__ */ n(p, {
|
|
951
957
|
direction: "row",
|
|
952
958
|
justifyContent: "space-between",
|
|
953
959
|
alignItems: "center",
|
|
954
960
|
sx: { mb: 1 },
|
|
955
|
-
children: [/* @__PURE__ */ t(
|
|
961
|
+
children: [/* @__PURE__ */ t(w, {
|
|
956
962
|
size: "small",
|
|
957
|
-
label: `Batch ${
|
|
963
|
+
label: `Batch ${z + 1}`,
|
|
958
964
|
sx: {
|
|
959
965
|
fontWeight: 700,
|
|
960
966
|
height: 22
|
|
961
967
|
}
|
|
962
|
-
}), /* @__PURE__ */ t(
|
|
968
|
+
}), /* @__PURE__ */ t(qt, {
|
|
963
969
|
title: "Remove batch",
|
|
964
|
-
children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
|
|
970
|
+
children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(hr, {
|
|
965
971
|
size: "small",
|
|
966
972
|
disabled: o.length <= 1,
|
|
967
|
-
onClick: () =>
|
|
968
|
-
children: /* @__PURE__ */ t(
|
|
973
|
+
onClick: () => Ut(e.id, s.key),
|
|
974
|
+
children: /* @__PURE__ */ t(qr, { fontSize: "small" })
|
|
969
975
|
}) })
|
|
970
976
|
})]
|
|
971
|
-
}), /* @__PURE__ */ n(
|
|
977
|
+
}), /* @__PURE__ */ n(k, {
|
|
972
978
|
sx: {
|
|
973
979
|
display: "grid",
|
|
974
980
|
gridTemplateColumns: {
|
|
@@ -988,8 +994,8 @@ function Zr() {
|
|
|
988
994
|
style: { textAlign: "right" }
|
|
989
995
|
},
|
|
990
996
|
value: s.quantity,
|
|
991
|
-
onChange: (
|
|
992
|
-
onBlur: () =>
|
|
997
|
+
onChange: (W) => at(e.id, s.key, W.target.value, e.requestedQuantity),
|
|
998
|
+
onBlur: () => S(`${s.key}:quantity`),
|
|
993
999
|
error: x(`${s.key}:quantity`) && !!y[`${s.key}:quantity`],
|
|
994
1000
|
helperText: x(`${s.key}:quantity`) && y[`${s.key}:quantity`] || ""
|
|
995
1001
|
}),
|
|
@@ -997,8 +1003,8 @@ function Zr() {
|
|
|
997
1003
|
size: "small",
|
|
998
1004
|
label: "Lot number",
|
|
999
1005
|
value: s.lotNumber,
|
|
1000
|
-
onChange: (
|
|
1001
|
-
onBlur: () =>
|
|
1006
|
+
onChange: (W) => M(e.id, s.key, "lotNumber", W.target.value),
|
|
1007
|
+
onBlur: () => S(`${s.key}:lotNumber`),
|
|
1002
1008
|
error: x(`${s.key}:lotNumber`) && !!y[`${s.key}:lotNumber`],
|
|
1003
1009
|
helperText: x(`${s.key}:lotNumber`) && y[`${s.key}:lotNumber`] || "",
|
|
1004
1010
|
inputProps: { style: {
|
|
@@ -1011,39 +1017,41 @@ function Zr() {
|
|
|
1011
1017
|
label: "Expiry",
|
|
1012
1018
|
type: "date",
|
|
1013
1019
|
InputLabelProps: { shrink: !0 },
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1020
|
+
inputProps: e.expiryMode === "FROM_MANUFACTURE" ? { readOnly: !0 } : void 0,
|
|
1021
|
+
value: e.expiryMode === "FROM_MANUFACTURE" ? Ae(s.manufactureDate, e.expiryInterval, e.expiryIntervalUnit) : s.expiryDate,
|
|
1022
|
+
onChange: (W) => M(e.id, s.key, "expiryDate", W.target.value),
|
|
1023
|
+
onBlur: () => S(`${s.key}:expiryDate`),
|
|
1017
1024
|
error: x(`${s.key}:expiryDate`) && !!y[`${s.key}:expiryDate`],
|
|
1018
|
-
helperText: x(`${s.key}:expiryDate`) && y[`${s.key}:expiryDate`] || ""
|
|
1025
|
+
helperText: e.expiryMode === "FROM_MANUFACTURE" ? `${e.expiryInterval} ${String(e.expiryIntervalUnit ?? "").toLowerCase()} after manufacture` : x(`${s.key}:expiryDate`) && y[`${s.key}:expiryDate`] || ""
|
|
1019
1026
|
}),
|
|
1020
1027
|
/* @__PURE__ */ t(I, {
|
|
1021
1028
|
size: "small",
|
|
1022
1029
|
label: "Manufactured",
|
|
1023
1030
|
type: "date",
|
|
1024
1031
|
InputLabelProps: { shrink: !0 },
|
|
1032
|
+
required: !!e.hasManufactureDate,
|
|
1025
1033
|
value: s.manufactureDate ?? "",
|
|
1026
|
-
onChange: (
|
|
1027
|
-
onBlur: () =>
|
|
1034
|
+
onChange: (W) => M(e.id, s.key, "manufactureDate", W.target.value),
|
|
1035
|
+
onBlur: () => S(`${s.key}:manufactureDate`),
|
|
1028
1036
|
error: x(`${s.key}:manufactureDate`) && !!y[`${s.key}:manufactureDate`],
|
|
1029
|
-
helperText: x(`${s.key}:manufactureDate`) ? y[`${s.key}:manufactureDate`] || "" : "Optional"
|
|
1037
|
+
helperText: x(`${s.key}:manufactureDate`) ? y[`${s.key}:manufactureDate`] || "" : e.hasManufactureDate ? "Required for this product" : "Optional"
|
|
1030
1038
|
})
|
|
1031
1039
|
]
|
|
1032
1040
|
})]
|
|
1033
1041
|
}, s.key))
|
|
1034
1042
|
}),
|
|
1035
|
-
/* @__PURE__ */ t(
|
|
1043
|
+
/* @__PURE__ */ t(qt, {
|
|
1036
1044
|
title: h === 0 ? "All requested quantity is already allocated" : "",
|
|
1037
|
-
children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
|
|
1045
|
+
children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(D, {
|
|
1038
1046
|
size: "small",
|
|
1039
|
-
startIcon: /* @__PURE__ */ t(
|
|
1047
|
+
startIcon: /* @__PURE__ */ t(vr, {}),
|
|
1040
1048
|
sx: { mt: 1 },
|
|
1041
1049
|
disabled: h <= 0,
|
|
1042
|
-
onClick: () =>
|
|
1050
|
+
onClick: () => Ot(e.id),
|
|
1043
1051
|
children: h > 0 ? `Add batch (${h} left)` : "Fully allocated"
|
|
1044
1052
|
}) })
|
|
1045
1053
|
})
|
|
1046
|
-
] }) : /* @__PURE__ */ n(
|
|
1054
|
+
] }) : /* @__PURE__ */ n(k, {
|
|
1047
1055
|
sx: {
|
|
1048
1056
|
display: "grid",
|
|
1049
1057
|
gridTemplateColumns: {
|
|
@@ -1062,11 +1070,11 @@ function Zr() {
|
|
|
1062
1070
|
max: e.requestedQuantity,
|
|
1063
1071
|
style: { textAlign: "right" }
|
|
1064
1072
|
},
|
|
1065
|
-
value: ((
|
|
1066
|
-
onChange: (s) =>
|
|
1073
|
+
value: ((q = o[0]) == null ? void 0 : q.quantity) ?? "",
|
|
1074
|
+
onChange: (s) => at(e.id, o[0].key, s.target.value, e.requestedQuantity),
|
|
1067
1075
|
onBlur: () => {
|
|
1068
1076
|
var s;
|
|
1069
|
-
return
|
|
1077
|
+
return S(`${(s = o[0]) == null ? void 0 : s.key}:quantity`);
|
|
1070
1078
|
},
|
|
1071
1079
|
error: x(`${(oe = o[0]) == null ? void 0 : oe.key}:quantity`) && !!y[`${(se = o[0]) == null ? void 0 : se.key}:quantity`],
|
|
1072
1080
|
helperText: x(`${(ge = o[0]) == null ? void 0 : ge.key}:quantity`) && y[`${(ce = o[0]) == null ? void 0 : ce.key}:quantity`] || ""
|
|
@@ -1074,14 +1082,14 @@ function Zr() {
|
|
|
1074
1082
|
/* @__PURE__ */ t(I, {
|
|
1075
1083
|
size: "small",
|
|
1076
1084
|
label: "Lot number",
|
|
1077
|
-
value: ((
|
|
1078
|
-
onChange: (s) =>
|
|
1085
|
+
value: ((B = o[0]) == null ? void 0 : B.lotNumber) ?? "",
|
|
1086
|
+
onChange: (s) => M(e.id, o[0].key, "lotNumber", s.target.value),
|
|
1079
1087
|
onBlur: () => {
|
|
1080
1088
|
var s;
|
|
1081
|
-
return
|
|
1089
|
+
return S(`${(s = o[0]) == null ? void 0 : s.key}:lotNumber`);
|
|
1082
1090
|
},
|
|
1083
|
-
error: x(`${(ve = o[0]) == null ? void 0 : ve.key}:lotNumber`) && !!y[`${(
|
|
1084
|
-
helperText: x(`${(
|
|
1091
|
+
error: x(`${(ve = o[0]) == null ? void 0 : ve.key}:lotNumber`) && !!y[`${(ot = o[0]) == null ? void 0 : ot.key}:lotNumber`],
|
|
1092
|
+
helperText: x(`${(st = o[0]) == null ? void 0 : st.key}:lotNumber`) && y[`${(ct = o[0]) == null ? void 0 : ct.key}:lotNumber`] || "",
|
|
1085
1093
|
inputProps: { style: {
|
|
1086
1094
|
fontFamily: "monospace",
|
|
1087
1095
|
fontSize: "0.8rem"
|
|
@@ -1092,39 +1100,41 @@ function Zr() {
|
|
|
1092
1100
|
label: "Expiry",
|
|
1093
1101
|
type: "date",
|
|
1094
1102
|
InputLabelProps: { shrink: !0 },
|
|
1095
|
-
|
|
1096
|
-
|
|
1103
|
+
inputProps: e.expiryMode === "FROM_MANUFACTURE" ? { readOnly: !0 } : void 0,
|
|
1104
|
+
value: e.expiryMode === "FROM_MANUFACTURE" ? Ae((ut = o[0]) == null ? void 0 : ut.manufactureDate, e.expiryInterval, e.expiryIntervalUnit) : ((dt = o[0]) == null ? void 0 : dt.expiryDate) ?? "",
|
|
1105
|
+
onChange: (s) => M(e.id, o[0].key, "expiryDate", s.target.value),
|
|
1097
1106
|
onBlur: () => {
|
|
1098
1107
|
var s;
|
|
1099
|
-
return
|
|
1108
|
+
return S(`${(s = o[0]) == null ? void 0 : s.key}:expiryDate`);
|
|
1100
1109
|
},
|
|
1101
|
-
error: x(`${(
|
|
1102
|
-
helperText: x(`${(
|
|
1110
|
+
error: x(`${(ht = o[0]) == null ? void 0 : ht.key}:expiryDate`) && !!y[`${(pt = o[0]) == null ? void 0 : pt.key}:expiryDate`],
|
|
1111
|
+
helperText: e.expiryMode === "FROM_MANUFACTURE" ? `${e.expiryInterval} ${String(e.expiryIntervalUnit ?? "").toLowerCase()} after manufacture` : x(`${(mt = o[0]) == null ? void 0 : mt.key}:expiryDate`) && y[`${(yt = o[0]) == null ? void 0 : yt.key}:expiryDate`] || ""
|
|
1103
1112
|
}),
|
|
1104
1113
|
/* @__PURE__ */ t(I, {
|
|
1105
1114
|
size: "small",
|
|
1106
1115
|
label: "Manufactured",
|
|
1107
1116
|
type: "date",
|
|
1108
1117
|
InputLabelProps: { shrink: !0 },
|
|
1109
|
-
|
|
1110
|
-
|
|
1118
|
+
required: !!e.hasManufactureDate,
|
|
1119
|
+
value: ((bt = o[0]) == null ? void 0 : bt.manufactureDate) ?? "",
|
|
1120
|
+
onChange: (s) => M(e.id, o[0].key, "manufactureDate", s.target.value),
|
|
1111
1121
|
onBlur: () => {
|
|
1112
1122
|
var s;
|
|
1113
|
-
return
|
|
1123
|
+
return S(`${(s = o[0]) == null ? void 0 : s.key}:manufactureDate`);
|
|
1114
1124
|
},
|
|
1115
|
-
error: x(`${(
|
|
1116
|
-
helperText: x(`${(
|
|
1125
|
+
error: x(`${(ft = o[0]) == null ? void 0 : ft.key}:manufactureDate`) && !!y[`${(xt = o[0]) == null ? void 0 : xt.key}:manufactureDate`],
|
|
1126
|
+
helperText: x(`${(gt = o[0]) == null ? void 0 : gt.key}:manufactureDate`) ? y[`${(vt = o[0]) == null ? void 0 : vt.key}:manufactureDate`] || "" : e.hasManufactureDate ? "Required for this product" : "Optional"
|
|
1117
1127
|
})
|
|
1118
1128
|
]
|
|
1119
1129
|
}),
|
|
1120
|
-
(
|
|
1130
|
+
($e || Lt(e.id)) && m ? /* @__PURE__ */ t(d, {
|
|
1121
1131
|
variant: "caption",
|
|
1122
1132
|
color: "error",
|
|
1123
1133
|
sx: {
|
|
1124
1134
|
display: "block",
|
|
1125
1135
|
mt: 1
|
|
1126
1136
|
},
|
|
1127
|
-
children:
|
|
1137
|
+
children: m
|
|
1128
1138
|
}) : null
|
|
1129
1139
|
] }) : /* @__PURE__ */ t(d, {
|
|
1130
1140
|
variant: "caption",
|
|
@@ -1148,7 +1158,7 @@ function Zr() {
|
|
|
1148
1158
|
},
|
|
1149
1159
|
children: /* @__PURE__ */ n(de, {
|
|
1150
1160
|
sx: { p: 2.5 },
|
|
1151
|
-
children: [/* @__PURE__ */ n(
|
|
1161
|
+
children: [/* @__PURE__ */ n(p, {
|
|
1152
1162
|
direction: {
|
|
1153
1163
|
xs: "column",
|
|
1154
1164
|
md: "row"
|
|
@@ -1162,9 +1172,9 @@ function Zr() {
|
|
|
1162
1172
|
minRows: 2,
|
|
1163
1173
|
label: "Decision notes (optional)",
|
|
1164
1174
|
placeholder: "Shown to the requester",
|
|
1165
|
-
value:
|
|
1166
|
-
onChange: (e) =>
|
|
1167
|
-
}),
|
|
1175
|
+
value: Ee,
|
|
1176
|
+
onChange: (e) => _e(e.target.value)
|
|
1177
|
+
}), Z && it != null ? /* @__PURE__ */ n(k, {
|
|
1168
1178
|
sx: (e) => ({
|
|
1169
1179
|
minWidth: 220,
|
|
1170
1180
|
p: 1.5,
|
|
@@ -1174,35 +1184,35 @@ function Zr() {
|
|
|
1174
1184
|
bgcolor: J(e.palette.primary.main, 0.04),
|
|
1175
1185
|
textAlign: "right"
|
|
1176
1186
|
}),
|
|
1177
|
-
children: [/* @__PURE__ */ t(
|
|
1178
|
-
value: Number(
|
|
1187
|
+
children: [/* @__PURE__ */ t(we, { children: "Total if approved" }), /* @__PURE__ */ t(Ct, {
|
|
1188
|
+
value: Number(it.toFixed(2)),
|
|
1179
1189
|
size: "big"
|
|
1180
1190
|
})]
|
|
1181
1191
|
}) : null]
|
|
1182
|
-
}), /* @__PURE__ */ t(
|
|
1192
|
+
}), /* @__PURE__ */ t(p, {
|
|
1183
1193
|
direction: "row",
|
|
1184
1194
|
spacing: 1,
|
|
1185
1195
|
justifyContent: "flex-end",
|
|
1186
1196
|
sx: { mt: 2 },
|
|
1187
1197
|
flexWrap: "wrap",
|
|
1188
1198
|
useFlexGap: !0,
|
|
1189
|
-
children:
|
|
1199
|
+
children: jt ? /* @__PURE__ */ n(E, { children: [/* @__PURE__ */ t(D, {
|
|
1190
1200
|
variant: "outlined",
|
|
1191
1201
|
color: "error",
|
|
1192
|
-
startIcon: /* @__PURE__ */ t(
|
|
1202
|
+
startIcon: /* @__PURE__ */ t(Re, {}),
|
|
1193
1203
|
disabled: f,
|
|
1194
1204
|
onClick: () => te(!0),
|
|
1195
1205
|
children: "Reject Request"
|
|
1196
|
-
}), /* @__PURE__ */ t(
|
|
1206
|
+
}), /* @__PURE__ */ t(D, {
|
|
1197
1207
|
variant: "contained",
|
|
1198
|
-
startIcon: /* @__PURE__ */ t(
|
|
1208
|
+
startIcon: /* @__PURE__ */ t(Oe, {}),
|
|
1199
1209
|
disabled: f,
|
|
1200
|
-
onClick: () => void
|
|
1210
|
+
onClick: () => void _t(),
|
|
1201
1211
|
children: f ? "Submitting…" : "Submit Decision"
|
|
1202
|
-
})] }) : /* @__PURE__ */ t(
|
|
1212
|
+
})] }) : /* @__PURE__ */ t(D, {
|
|
1203
1213
|
variant: "contained",
|
|
1204
1214
|
color: "error",
|
|
1205
|
-
startIcon: /* @__PURE__ */ t(
|
|
1215
|
+
startIcon: /* @__PURE__ */ t(Re, {}),
|
|
1206
1216
|
disabled: f,
|
|
1207
1217
|
onClick: () => te(!0),
|
|
1208
1218
|
children: "Reject Request"
|
|
@@ -1221,16 +1231,16 @@ function Zr() {
|
|
|
1221
1231
|
children: /* @__PURE__ */ n(de, {
|
|
1222
1232
|
sx: { p: 2.5 },
|
|
1223
1233
|
children: [
|
|
1224
|
-
/* @__PURE__ */ t(
|
|
1234
|
+
/* @__PURE__ */ t(It, {
|
|
1225
1235
|
eyebrow: "Items",
|
|
1226
|
-
title:
|
|
1227
|
-
hint:
|
|
1236
|
+
title: Y ? "Check what arrived" : "Items & outcome",
|
|
1237
|
+
hint: Y ? "Mark each batch OK if its lot and expiry match what you received, or flag it if something is off. Then submit." : "What was approved or rejected per item, the batches, and where each ended up."
|
|
1228
1238
|
}),
|
|
1229
|
-
/* @__PURE__ */ t(
|
|
1239
|
+
/* @__PURE__ */ t(p, {
|
|
1230
1240
|
spacing: 1.5,
|
|
1231
1241
|
sx: { mt: 1.5 },
|
|
1232
|
-
children:
|
|
1233
|
-
let
|
|
1242
|
+
children: i.items.map((e) => {
|
|
1243
|
+
let a = i.status !== "PENDING", r = e.approvedQuantity, l = a && !(r > 0), o = a ? l ? {
|
|
1234
1244
|
label: "Rejected",
|
|
1235
1245
|
color: "default"
|
|
1236
1246
|
} : r >= e.requestedQuantity ? {
|
|
@@ -1242,15 +1252,15 @@ function Zr() {
|
|
|
1242
1252
|
} : {
|
|
1243
1253
|
label: "Awaiting approval",
|
|
1244
1254
|
color: "info"
|
|
1245
|
-
}, u = (e.batches ?? []).filter((c) => (c.quantity ?? 0) > 0 && (c.lotNumber || c.expiryDate)), h =
|
|
1246
|
-
return /* @__PURE__ */ n(
|
|
1255
|
+
}, u = (e.batches ?? []).filter((c) => (c.quantity ?? 0) > 0 && (c.lotNumber || c.expiryDate)), h = Y || u.some((c) => c.receiptStatus != null), m = 4 + +(i.ownerType === "FACILITY") + +!!h;
|
|
1256
|
+
return /* @__PURE__ */ n(k, {
|
|
1247
1257
|
sx: {
|
|
1248
1258
|
p: 1.5,
|
|
1249
1259
|
border: "1px solid",
|
|
1250
1260
|
borderColor: "divider",
|
|
1251
1261
|
borderRadius: 1.5
|
|
1252
1262
|
},
|
|
1253
|
-
children: [/* @__PURE__ */ n(
|
|
1263
|
+
children: [/* @__PURE__ */ n(p, {
|
|
1254
1264
|
direction: {
|
|
1255
1265
|
xs: "column",
|
|
1256
1266
|
sm: "row"
|
|
@@ -1259,7 +1269,7 @@ function Zr() {
|
|
|
1259
1269
|
alignItems: { sm: "center" },
|
|
1260
1270
|
spacing: 1,
|
|
1261
1271
|
sx: { mb: +!!u.length },
|
|
1262
|
-
children: [/* @__PURE__ */ n(
|
|
1272
|
+
children: [/* @__PURE__ */ n(k, { children: [/* @__PURE__ */ t(d, {
|
|
1263
1273
|
variant: "subtitle2",
|
|
1264
1274
|
sx: { fontWeight: 800 },
|
|
1265
1275
|
children: e.productName
|
|
@@ -1271,41 +1281,41 @@ function Zr() {
|
|
|
1271
1281
|
e.requestedQuantity,
|
|
1272
1282
|
r == null ? "" : ` · Approved ${r}`
|
|
1273
1283
|
]
|
|
1274
|
-
})] }), /* @__PURE__ */ t(
|
|
1284
|
+
})] }), /* @__PURE__ */ t(w, {
|
|
1275
1285
|
size: "small",
|
|
1276
1286
|
color: o.color,
|
|
1277
1287
|
label: o.label,
|
|
1278
1288
|
sx: { fontWeight: 700 }
|
|
1279
1289
|
})]
|
|
1280
|
-
}), u.length > 0 ? /* @__PURE__ */ n(
|
|
1290
|
+
}), u.length > 0 ? /* @__PURE__ */ n(pr, {
|
|
1281
1291
|
size: "small",
|
|
1282
|
-
children: [/* @__PURE__ */ t(
|
|
1283
|
-
/* @__PURE__ */ t(
|
|
1284
|
-
/* @__PURE__ */ t(
|
|
1285
|
-
/* @__PURE__ */ t(
|
|
1286
|
-
/* @__PURE__ */ t(
|
|
1292
|
+
children: [/* @__PURE__ */ t(mr, { children: /* @__PURE__ */ n(ke, { children: [
|
|
1293
|
+
/* @__PURE__ */ t(C, { children: "Lot" }),
|
|
1294
|
+
/* @__PURE__ */ t(C, { children: "Expiry" }),
|
|
1295
|
+
/* @__PURE__ */ t(C, { children: "Manufactured" }),
|
|
1296
|
+
/* @__PURE__ */ t(C, {
|
|
1287
1297
|
align: "right",
|
|
1288
1298
|
children: "Qty"
|
|
1289
1299
|
}),
|
|
1290
|
-
|
|
1291
|
-
h ? /* @__PURE__ */ t(
|
|
1300
|
+
i.ownerType === "FACILITY" ? /* @__PURE__ */ t(C, { children: "Storage" }) : null,
|
|
1301
|
+
h ? /* @__PURE__ */ t(C, {
|
|
1292
1302
|
align: "center",
|
|
1293
1303
|
sx: { width: 200 },
|
|
1294
|
-
children:
|
|
1304
|
+
children: Y ? "Condition" : "Receipt"
|
|
1295
1305
|
}) : null
|
|
1296
|
-
] }) }), /* @__PURE__ */ t(
|
|
1297
|
-
let oe = ee[c.batchId] ?? "OK", se =
|
|
1298
|
-
return /* @__PURE__ */ n(
|
|
1299
|
-
/* @__PURE__ */ t(
|
|
1306
|
+
] }) }), /* @__PURE__ */ t(yr, { children: u.map((c, q) => {
|
|
1307
|
+
let oe = ee[c.batchId] ?? "OK", se = Y && c.batchId && c.receiptStatus == null, ge = se && oe === "ISSUE";
|
|
1308
|
+
return /* @__PURE__ */ n(dr, { children: [/* @__PURE__ */ n(ke, { children: [
|
|
1309
|
+
/* @__PURE__ */ t(C, {
|
|
1300
1310
|
sx: {
|
|
1301
1311
|
fontFamily: "monospace",
|
|
1302
1312
|
fontSize: "0.8rem"
|
|
1303
1313
|
},
|
|
1304
1314
|
children: c.lotNumber || "—"
|
|
1305
1315
|
}),
|
|
1306
|
-
/* @__PURE__ */ t(
|
|
1307
|
-
/* @__PURE__ */ t(
|
|
1308
|
-
/* @__PURE__ */ t(
|
|
1316
|
+
/* @__PURE__ */ t(C, { children: c.expiryDate ? Fe(c.expiryDate) : "—" }),
|
|
1317
|
+
/* @__PURE__ */ t(C, { children: c.manufactureDate ? Fe(c.manufactureDate) : "—" }),
|
|
1318
|
+
/* @__PURE__ */ t(C, {
|
|
1309
1319
|
align: "right",
|
|
1310
1320
|
sx: {
|
|
1311
1321
|
fontVariantNumeric: "tabular-nums",
|
|
@@ -1313,68 +1323,68 @@ function Zr() {
|
|
|
1313
1323
|
},
|
|
1314
1324
|
children: c.quantity
|
|
1315
1325
|
}),
|
|
1316
|
-
|
|
1317
|
-
h ? /* @__PURE__ */ t(
|
|
1326
|
+
i.ownerType === "FACILITY" ? /* @__PURE__ */ t(C, { children: c.storageUnitName || "—" }) : null,
|
|
1327
|
+
h ? /* @__PURE__ */ t(C, {
|
|
1318
1328
|
align: "center",
|
|
1319
|
-
children: se ? /* @__PURE__ */ n(
|
|
1329
|
+
children: se ? /* @__PURE__ */ n(Ce, {
|
|
1320
1330
|
size: "small",
|
|
1321
1331
|
exclusive: !0,
|
|
1322
1332
|
value: oe,
|
|
1323
|
-
onChange: (ce,
|
|
1324
|
-
|
|
1333
|
+
onChange: (ce, B) => {
|
|
1334
|
+
B && Ye((ve) => ({
|
|
1325
1335
|
...ve,
|
|
1326
|
-
[c.batchId]:
|
|
1336
|
+
[c.batchId]: B
|
|
1327
1337
|
}));
|
|
1328
1338
|
},
|
|
1329
|
-
children: [/* @__PURE__ */ n(
|
|
1339
|
+
children: [/* @__PURE__ */ n(F, {
|
|
1330
1340
|
value: "OK",
|
|
1331
1341
|
color: "success",
|
|
1332
1342
|
sx: {
|
|
1333
1343
|
textTransform: "none",
|
|
1334
1344
|
px: 1.25
|
|
1335
1345
|
},
|
|
1336
|
-
children: [/* @__PURE__ */ t(
|
|
1346
|
+
children: [/* @__PURE__ */ t(Oe, {
|
|
1337
1347
|
fontSize: "small",
|
|
1338
1348
|
sx: { mr: 0.5 }
|
|
1339
1349
|
}), " OK"]
|
|
1340
|
-
}), /* @__PURE__ */ n(
|
|
1350
|
+
}), /* @__PURE__ */ n(F, {
|
|
1341
1351
|
value: "ISSUE",
|
|
1342
1352
|
color: "error",
|
|
1343
1353
|
sx: {
|
|
1344
1354
|
textTransform: "none",
|
|
1345
1355
|
px: 1.25
|
|
1346
1356
|
},
|
|
1347
|
-
children: [/* @__PURE__ */ t(
|
|
1357
|
+
children: [/* @__PURE__ */ t(De, {
|
|
1348
1358
|
fontSize: "small",
|
|
1349
1359
|
sx: { mr: 0.5 }
|
|
1350
1360
|
}), " Issue"]
|
|
1351
1361
|
})]
|
|
1352
|
-
}) : c.receiptStatus === "RECEIVED" ? /* @__PURE__ */ t(
|
|
1362
|
+
}) : c.receiptStatus === "RECEIVED" ? /* @__PURE__ */ t(w, {
|
|
1353
1363
|
size: "small",
|
|
1354
1364
|
color: "success",
|
|
1355
1365
|
variant: "outlined",
|
|
1356
|
-
icon: /* @__PURE__ */ t(
|
|
1366
|
+
icon: /* @__PURE__ */ t(Oe, {}),
|
|
1357
1367
|
label: "Received",
|
|
1358
1368
|
sx: { fontWeight: 700 }
|
|
1359
|
-
}) : c.receiptStatus === "DISCREPANCY" ? /* @__PURE__ */ t(
|
|
1369
|
+
}) : c.receiptStatus === "DISCREPANCY" ? /* @__PURE__ */ t(w, {
|
|
1360
1370
|
size: "small",
|
|
1361
1371
|
color: "error",
|
|
1362
1372
|
variant: "outlined",
|
|
1363
|
-
icon: /* @__PURE__ */ t(
|
|
1373
|
+
icon: /* @__PURE__ */ t(De, {}),
|
|
1364
1374
|
label: "Discrepancy",
|
|
1365
1375
|
sx: { fontWeight: 700 }
|
|
1366
|
-
}) : c.receiptStatus === "REJECTED" ? /* @__PURE__ */ t(
|
|
1376
|
+
}) : c.receiptStatus === "REJECTED" ? /* @__PURE__ */ t(w, {
|
|
1367
1377
|
size: "small",
|
|
1368
1378
|
color: "error",
|
|
1369
1379
|
variant: "outlined",
|
|
1370
|
-
icon: /* @__PURE__ */ t(
|
|
1380
|
+
icon: /* @__PURE__ */ t(Tr, {}),
|
|
1371
1381
|
label: "Not supplied",
|
|
1372
1382
|
sx: { fontWeight: 700 }
|
|
1373
|
-
}) :
|
|
1383
|
+
}) : Pt ? /* @__PURE__ */ t(w, {
|
|
1374
1384
|
size: "small",
|
|
1375
1385
|
color: "info",
|
|
1376
1386
|
variant: "outlined",
|
|
1377
|
-
icon: /* @__PURE__ */ t(
|
|
1387
|
+
icon: /* @__PURE__ */ t($r, {}),
|
|
1378
1388
|
label: "Awaiting check",
|
|
1379
1389
|
sx: { fontWeight: 700 }
|
|
1380
1390
|
}) : /* @__PURE__ */ t(d, {
|
|
@@ -1383,8 +1393,8 @@ function Zr() {
|
|
|
1383
1393
|
children: "—"
|
|
1384
1394
|
})
|
|
1385
1395
|
}) : null
|
|
1386
|
-
] }), ge ? /* @__PURE__ */ t(
|
|
1387
|
-
colSpan:
|
|
1396
|
+
] }), ge ? /* @__PURE__ */ t(ke, { children: /* @__PURE__ */ t(C, {
|
|
1397
|
+
colSpan: m,
|
|
1388
1398
|
sx: { py: 1 },
|
|
1389
1399
|
children: /* @__PURE__ */ t(I, {
|
|
1390
1400
|
fullWidth: !0,
|
|
@@ -1392,14 +1402,14 @@ function Zr() {
|
|
|
1392
1402
|
required: !0,
|
|
1393
1403
|
label: "What is wrong with this batch?",
|
|
1394
1404
|
placeholder: "Say what did not match so the approver knows what to fix.",
|
|
1395
|
-
value:
|
|
1396
|
-
onChange: (ce) => Ge((
|
|
1397
|
-
...
|
|
1405
|
+
value: Se[c.batchId] ?? "",
|
|
1406
|
+
onChange: (ce) => Ge((B) => ({
|
|
1407
|
+
...B,
|
|
1398
1408
|
[c.batchId]: ce.target.value
|
|
1399
1409
|
}))
|
|
1400
1410
|
})
|
|
1401
|
-
}) }) : c.discrepancyReason ? /* @__PURE__ */ t(
|
|
1402
|
-
colSpan:
|
|
1411
|
+
}) }) : c.discrepancyReason ? /* @__PURE__ */ t(ke, { children: /* @__PURE__ */ t(C, {
|
|
1412
|
+
colSpan: m,
|
|
1403
1413
|
sx: {
|
|
1404
1414
|
py: 0.5,
|
|
1405
1415
|
borderBottom: "none"
|
|
@@ -1414,13 +1424,13 @@ function Zr() {
|
|
|
1414
1424
|
"”"
|
|
1415
1425
|
]
|
|
1416
1426
|
})
|
|
1417
|
-
}) }) : null] }, c.batchId || `${e.id}:${
|
|
1427
|
+
}) }) : null] }, c.batchId || `${e.id}:${q}`);
|
|
1418
1428
|
}) })]
|
|
1419
1429
|
}) : l ? /* @__PURE__ */ t(d, {
|
|
1420
1430
|
variant: "caption",
|
|
1421
1431
|
color: "text.disabled",
|
|
1422
1432
|
children: "No stock received for this item."
|
|
1423
|
-
}) :
|
|
1433
|
+
}) : a ? null : /* @__PURE__ */ t(d, {
|
|
1424
1434
|
variant: "caption",
|
|
1425
1435
|
color: "text.disabled",
|
|
1426
1436
|
children: "Waiting for the approver's decision."
|
|
@@ -1428,20 +1438,20 @@ function Zr() {
|
|
|
1428
1438
|
}, e.id);
|
|
1429
1439
|
})
|
|
1430
1440
|
}),
|
|
1431
|
-
|
|
1441
|
+
Ft ? /* @__PURE__ */ t(p, {
|
|
1432
1442
|
direction: "row",
|
|
1433
1443
|
spacing: 1,
|
|
1434
1444
|
justifyContent: "flex-end",
|
|
1435
1445
|
sx: { mt: 2 },
|
|
1436
|
-
children: /* @__PURE__ */ t(
|
|
1446
|
+
children: /* @__PURE__ */ t(D, {
|
|
1437
1447
|
variant: "contained",
|
|
1438
|
-
startIcon: /* @__PURE__ */ t(
|
|
1448
|
+
startIcon: /* @__PURE__ */ t(Rr, {}),
|
|
1439
1449
|
disabled: f,
|
|
1440
|
-
onClick: () => void
|
|
1450
|
+
onClick: () => void Gt(),
|
|
1441
1451
|
children: f ? "Updating…" : "Mark In Transit"
|
|
1442
1452
|
})
|
|
1443
1453
|
}) : null,
|
|
1444
|
-
|
|
1454
|
+
Y ? /* @__PURE__ */ n(E, { children: [ie ? /* @__PURE__ */ t(I, {
|
|
1445
1455
|
sx: { mt: 2 },
|
|
1446
1456
|
fullWidth: !0,
|
|
1447
1457
|
size: "small",
|
|
@@ -1450,8 +1460,8 @@ function Zr() {
|
|
|
1450
1460
|
label: "Anything else about this delivery? (optional)",
|
|
1451
1461
|
placeholder: "Only if something applies to the shipment as a whole.",
|
|
1452
1462
|
value: Ke,
|
|
1453
|
-
onChange: (e) =>
|
|
1454
|
-
}) : null, /* @__PURE__ */ n(
|
|
1463
|
+
onChange: (e) => Ve(e.target.value)
|
|
1464
|
+
}) : null, /* @__PURE__ */ n(p, {
|
|
1455
1465
|
direction: {
|
|
1456
1466
|
xs: "column",
|
|
1457
1467
|
sm: "row"
|
|
@@ -1464,36 +1474,36 @@ function Zr() {
|
|
|
1464
1474
|
variant: "caption",
|
|
1465
1475
|
color: "text.secondary",
|
|
1466
1476
|
sx: { mr: "auto" },
|
|
1467
|
-
children: ne ? "Every batch is flagged, so the whole shipment goes back to the approver." : `${xe.length} batch${xe.length === 1 ? "" : "es"} will come into inventory; the flagged ${
|
|
1468
|
-
}) : null, /* @__PURE__ */ t(
|
|
1477
|
+
children: ne ? "Every batch is flagged, so the whole shipment goes back to the approver." : `${xe.length} batch${xe.length === 1 ? "" : "es"} will come into inventory; the flagged ${U.length === 1 ? "one goes" : "ones go"} back to the approver.`
|
|
1478
|
+
}) : null, /* @__PURE__ */ t(D, {
|
|
1469
1479
|
variant: "contained",
|
|
1470
1480
|
color: ne ? "error" : "primary",
|
|
1471
|
-
startIcon: t(ne ?
|
|
1472
|
-
disabled: f || !
|
|
1473
|
-
onClick: () => void
|
|
1481
|
+
startIcon: t(ne ? De : Nr, {}),
|
|
1482
|
+
disabled: f || !Jt,
|
|
1483
|
+
onClick: () => void Vt(),
|
|
1474
1484
|
children: f ? "Submitting…" : ne ? "Send Back to Approver" : ie ? "Receive OK & Flag Issues" : "Receive into Inventory"
|
|
1475
1485
|
})]
|
|
1476
1486
|
})] }) : null,
|
|
1477
|
-
|
|
1487
|
+
et && tt ? /* @__PURE__ */ t(p, {
|
|
1478
1488
|
direction: "row",
|
|
1479
1489
|
spacing: 1,
|
|
1480
1490
|
justifyContent: "flex-end",
|
|
1481
1491
|
sx: { mt: 2 },
|
|
1482
|
-
children: /* @__PURE__ */ t(
|
|
1492
|
+
children: /* @__PURE__ */ t(D, {
|
|
1483
1493
|
variant: "outlined",
|
|
1484
1494
|
color: "error",
|
|
1485
|
-
startIcon: /* @__PURE__ */ t(
|
|
1495
|
+
startIcon: /* @__PURE__ */ t(Re, {}),
|
|
1486
1496
|
disabled: f,
|
|
1487
|
-
onClick: () => void
|
|
1497
|
+
onClick: () => void Ht(),
|
|
1488
1498
|
children: f ? "Cancelling…" : "Cancel Request"
|
|
1489
1499
|
})
|
|
1490
1500
|
}) : null,
|
|
1491
|
-
|
|
1501
|
+
i.approvedPurchaseId ? /* @__PURE__ */ n(Pe, {
|
|
1492
1502
|
severity: "success",
|
|
1493
1503
|
sx: { mt: 2 },
|
|
1494
1504
|
children: [
|
|
1495
1505
|
"Stock was added to inventory under purchase id ",
|
|
1496
|
-
/* @__PURE__ */ t("strong", { children:
|
|
1506
|
+
/* @__PURE__ */ t("strong", { children: i.approvedPurchaseId }),
|
|
1497
1507
|
"."
|
|
1498
1508
|
]
|
|
1499
1509
|
}) : null
|
|
@@ -1501,14 +1511,14 @@ function Zr() {
|
|
|
1501
1511
|
})
|
|
1502
1512
|
})
|
|
1503
1513
|
] }) : null]
|
|
1504
|
-
}), /* @__PURE__ */ n(
|
|
1505
|
-
open:
|
|
1514
|
+
}), /* @__PURE__ */ n(br, {
|
|
1515
|
+
open: $t,
|
|
1506
1516
|
onClose: () => f ? null : te(!1),
|
|
1507
1517
|
fullWidth: !0,
|
|
1508
1518
|
maxWidth: "xs",
|
|
1509
1519
|
children: [
|
|
1510
|
-
/* @__PURE__ */ t(
|
|
1511
|
-
/* @__PURE__ */ t(
|
|
1520
|
+
/* @__PURE__ */ t(fr, { children: "Reject this request?" }),
|
|
1521
|
+
/* @__PURE__ */ t(xr, {
|
|
1512
1522
|
dividers: !0,
|
|
1513
1523
|
children: /* @__PURE__ */ t(d, {
|
|
1514
1524
|
variant: "body2",
|
|
@@ -1516,14 +1526,14 @@ function Zr() {
|
|
|
1516
1526
|
children: "Every item will be rejected and no stock will be received. This closes the request."
|
|
1517
1527
|
})
|
|
1518
1528
|
}),
|
|
1519
|
-
/* @__PURE__ */ n(
|
|
1529
|
+
/* @__PURE__ */ n(gr, { children: [/* @__PURE__ */ t(D, {
|
|
1520
1530
|
onClick: () => te(!1),
|
|
1521
1531
|
disabled: f,
|
|
1522
1532
|
children: "Cancel"
|
|
1523
|
-
}), /* @__PURE__ */ t(
|
|
1533
|
+
}), /* @__PURE__ */ t(D, {
|
|
1524
1534
|
variant: "contained",
|
|
1525
1535
|
color: "error",
|
|
1526
|
-
startIcon: /* @__PURE__ */ t(
|
|
1536
|
+
startIcon: /* @__PURE__ */ t(Re, {}),
|
|
1527
1537
|
disabled: f,
|
|
1528
1538
|
onClick: () => void Yt(),
|
|
1529
1539
|
children: f ? "Rejecting…" : "Reject Request"
|
|
@@ -1532,7 +1542,7 @@ function Zr() {
|
|
|
1532
1542
|
})]
|
|
1533
1543
|
})] });
|
|
1534
1544
|
}
|
|
1535
|
-
function
|
|
1545
|
+
function we({ children: g }) {
|
|
1536
1546
|
return /* @__PURE__ */ t(d, {
|
|
1537
1547
|
variant: "caption",
|
|
1538
1548
|
color: "text.secondary",
|
|
@@ -1546,8 +1556,8 @@ function Re({ children: g }) {
|
|
|
1546
1556
|
children: g
|
|
1547
1557
|
});
|
|
1548
1558
|
}
|
|
1549
|
-
function
|
|
1550
|
-
return /* @__PURE__ */ n(
|
|
1559
|
+
function j({ label: g, children: P }) {
|
|
1560
|
+
return /* @__PURE__ */ n(p, {
|
|
1551
1561
|
direction: "row",
|
|
1552
1562
|
spacing: 1,
|
|
1553
1563
|
sx: { minWidth: 0 },
|
|
@@ -1567,11 +1577,11 @@ function M({ label: g, children: z }) {
|
|
|
1567
1577
|
minWidth: 0,
|
|
1568
1578
|
fontWeight: 700
|
|
1569
1579
|
},
|
|
1570
|
-
children:
|
|
1580
|
+
children: P
|
|
1571
1581
|
})]
|
|
1572
1582
|
});
|
|
1573
1583
|
}
|
|
1574
1584
|
export {
|
|
1575
|
-
|
|
1585
|
+
ta as default
|
|
1576
1586
|
};
|
|
1577
|
-
//# sourceMappingURL=PurchaseRequestDetailPage-
|
|
1587
|
+
//# sourceMappingURL=PurchaseRequestDetailPage-DhBuOGHZ-CAmlL4fP.js.map
|