@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
|
@@ -0,0 +1,724 @@
|
|
|
1
|
+
import { A as Se, K as W, G as Q, n as $e, a as le, I as De, f as Ne, _ as Ee, O as Ae } from "./ImmunizationConfigurationBase-Clkk0-n6.js";
|
|
2
|
+
import { a as ee, C as Re, V as Me, k as qe, T as Ue } from "./constants-BTpJFQe_-CYPZIqQF.js";
|
|
3
|
+
import { o as F, t as Fe, s as Be } from "./format-UOyOu75i-D0GyylyQ.js";
|
|
4
|
+
import { r as g, b as Z, y as Le, S as ue, x as ke, C as se } from "./validation-BzlHnL-r-CCJm2utQ.js";
|
|
5
|
+
import { n as Ye } from "./useFieldErrors-hDG8ox_x-DbSAzrGo.js";
|
|
6
|
+
import { Z as ze, $ as We, e as Qe, Y as Oe } from "./PmGuard-BvUUbU80-DJipZoSg.js";
|
|
7
|
+
import { f as Xe } from "./FacilityPicker-BXa2VF7i-D0JUIqLv.js";
|
|
8
|
+
import { useMemo as B, useState as L, useEffect as de, useCallback as ce } from "react";
|
|
9
|
+
import { jsxs as d, jsx as a, Fragment as Ge } from "react/jsx-runtime";
|
|
10
|
+
import { Box as He, Alert as je, Card as k, CardContent as O, Grid as m, Stack as Y, Typography as X, Table as Ve, TableHead as _e, TableRow as me, TableCell as b, TableBody as Ke, Chip as Ze, Button as J, Divider as pe, TextField as E, InputAdornment as Je, Tooltip as er, IconButton as he } from "@mui/material";
|
|
11
|
+
import { v4 as re } from "uuid";
|
|
12
|
+
import rr from "@mui/icons-material/AddRounded";
|
|
13
|
+
import { useNavigate as tr } from "react-router-dom";
|
|
14
|
+
import ar from "@mui/icons-material/Inventory2Rounded";
|
|
15
|
+
import ir from "@mui/icons-material/SaveRounded";
|
|
16
|
+
import nr from "@mui/icons-material/DeleteOutlineRounded";
|
|
17
|
+
import or from "@mui/icons-material/AutorenewRounded";
|
|
18
|
+
var lr = [{
|
|
19
|
+
value: "USER",
|
|
20
|
+
label: "Personal Use"
|
|
21
|
+
}, {
|
|
22
|
+
value: "FACILITY",
|
|
23
|
+
label: "Facility Use"
|
|
24
|
+
}];
|
|
25
|
+
function ye(A = !1) {
|
|
26
|
+
return {
|
|
27
|
+
key: re(),
|
|
28
|
+
batchId: re(),
|
|
29
|
+
productId: "",
|
|
30
|
+
quantity: 1,
|
|
31
|
+
buyPrice: "",
|
|
32
|
+
expectedSalePrice: "",
|
|
33
|
+
expiryDate: "",
|
|
34
|
+
lotNumber: A ? ee() : "",
|
|
35
|
+
manufactureDate: "",
|
|
36
|
+
storageUnitId: ""
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function vr() {
|
|
40
|
+
let A = tr(), s = Se(), x = (s == null ? void 0 : s.managePurchaseAmounts) !== !1, G = (s == null ? void 0 : s.manageSales) !== !1, R = (s == null ? void 0 : s.allowPersonalPurchase) !== !1, z = (s == null ? void 0 : s.allowFacilityPurchase) !== !1, p = (s == null ? void 0 : s.requirePurchaseConfirmation) === !0, T = !p && (s == null ? void 0 : s.autoGenerateLotNumber) === !0, be = B(() => lr.filter((r) => (r.value !== "USER" || R) && (r.value !== "FACILITY" || z)), [R, z]), xe = R ? "USER" : "FACILITY", [w, fe] = L([]), [H, Ie] = L([]), [M, ge] = L([]), [te, j] = L(""), l = Ye(), V = (/* @__PURE__ */ new Date()).toISOString().substring(0, 10), [i, f] = L({
|
|
41
|
+
id: re(),
|
|
42
|
+
ownerType: xe,
|
|
43
|
+
ownerId: "",
|
|
44
|
+
purchaseDate: V,
|
|
45
|
+
paymentMode: "CASH",
|
|
46
|
+
notes: "",
|
|
47
|
+
items: [ye()]
|
|
48
|
+
});
|
|
49
|
+
de(() => {
|
|
50
|
+
!R && i.ownerType === "USER" ? f((r) => ({
|
|
51
|
+
...r,
|
|
52
|
+
ownerType: "FACILITY",
|
|
53
|
+
ownerId: ""
|
|
54
|
+
})) : !z && i.ownerType === "FACILITY" && f((r) => ({
|
|
55
|
+
...r,
|
|
56
|
+
ownerType: "USER",
|
|
57
|
+
ownerId: ""
|
|
58
|
+
}));
|
|
59
|
+
}, [
|
|
60
|
+
R,
|
|
61
|
+
z,
|
|
62
|
+
i.ownerType
|
|
63
|
+
]), de(() => {
|
|
64
|
+
T && f((r) => r.items.some((e) => !e.lotNumber) ? {
|
|
65
|
+
...r,
|
|
66
|
+
items: r.items.map((e) => e.lotNumber ? e : {
|
|
67
|
+
...e,
|
|
68
|
+
lotNumber: ee()
|
|
69
|
+
})
|
|
70
|
+
} : r);
|
|
71
|
+
}, [T]), ze("update.manage.productManagement.purchase", () => {
|
|
72
|
+
async function r() {
|
|
73
|
+
var e, n;
|
|
74
|
+
try {
|
|
75
|
+
let [t, u, h] = await Promise.all([
|
|
76
|
+
Ne(),
|
|
77
|
+
Ee({ activeOnly: !0 }),
|
|
78
|
+
Ae().catch(() => [])
|
|
79
|
+
]);
|
|
80
|
+
fe(t), Ie(u), ge(h);
|
|
81
|
+
} catch (t) {
|
|
82
|
+
j(((n = (e = t == null ? void 0 : t.response) == null ? void 0 : e.data) == null ? void 0 : n.message) ?? (t == null ? void 0 : t.message) ?? "Failed to load reference data");
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
r();
|
|
86
|
+
}, []);
|
|
87
|
+
let ae = B(() => i.ownerType === "USER" ? M.filter((r) => r.ownerType === "USER" && Number(r.qtyRemaining ?? 0) > 0 && r.status !== "EXPIRED" && r.status !== "EXHAUSTED") : i.ownerType === "FACILITY" && i.ownerId ? M.filter((r) => r.ownerType === "FACILITY" && r.ownerId === i.ownerId && Number(r.qtyRemaining ?? 0) > 0 && r.status !== "EXPIRED" && r.status !== "EXHAUSTED") : [], [
|
|
88
|
+
M,
|
|
89
|
+
i.ownerType,
|
|
90
|
+
i.ownerId
|
|
91
|
+
]), we = B(() => M.filter((r) => r.isQuarantined ? !1 : i.ownerType === "USER" ? r.ownerType === "USER" : r.ownerType === "FACILITY" && r.ownerId === i.ownerId).reduce((r, e) => (r[e.productId] = (r[e.productId] ?? 0) + Number(e.qtyRemaining ?? 0), r), {}), [
|
|
92
|
+
M,
|
|
93
|
+
i.ownerType,
|
|
94
|
+
i.ownerId
|
|
95
|
+
]), Pe = B(() => i.ownerType !== "FACILITY" || !i.ownerId ? [] : H.filter((r) => r.ownerId === i.ownerId), [
|
|
96
|
+
H,
|
|
97
|
+
i.ownerType,
|
|
98
|
+
i.ownerId
|
|
99
|
+
]);
|
|
100
|
+
function I(r, e, n) {
|
|
101
|
+
f((t) => {
|
|
102
|
+
let u = t.items.slice();
|
|
103
|
+
return u[r] = {
|
|
104
|
+
...u[r],
|
|
105
|
+
[e]: n
|
|
106
|
+
}, {
|
|
107
|
+
...t,
|
|
108
|
+
items: u
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function Te(r) {
|
|
113
|
+
f((e) => ({
|
|
114
|
+
...e,
|
|
115
|
+
items: e.items.filter((n, t) => t !== r)
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
function Ce() {
|
|
119
|
+
f((r) => ({
|
|
120
|
+
...r,
|
|
121
|
+
items: [...r.items, ye(T)]
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
let _ = ce((r) => {
|
|
125
|
+
let e = w.find((n) => n.id === r.productId);
|
|
126
|
+
return (e == null ? void 0 : e.basePriceMode) === "FIXED" ? e.basePrice ?? "" : r.buyPrice;
|
|
127
|
+
}, [w]), ie = ce((r) => {
|
|
128
|
+
let e = w.find((n) => n.id === r.productId);
|
|
129
|
+
return (e == null ? void 0 : e.expiryMode) === "FROM_MANUFACTURE" ? Re(r.manufactureDate, e.expiryInterval, e.expiryIntervalUnit) : "";
|
|
130
|
+
}, [w]), q = B(() => {
|
|
131
|
+
let r = !1;
|
|
132
|
+
return {
|
|
133
|
+
sum: i.items.reduce((e, n) => {
|
|
134
|
+
let t = _(n);
|
|
135
|
+
if (t === "" || t == null || n.quantity === "" || n.quantity == null) return e;
|
|
136
|
+
let u = Number(n.quantity), h = Number(t);
|
|
137
|
+
return Number.isNaN(u) || Number.isNaN(h) ? e : (r = !0, e + u * h);
|
|
138
|
+
}, 0),
|
|
139
|
+
priced: r
|
|
140
|
+
};
|
|
141
|
+
}, [i.items, _]), C = {
|
|
142
|
+
ownerType: g(i.ownerType, "Purchase type"),
|
|
143
|
+
ownerId: i.ownerType === "FACILITY" ? g(i.ownerId, "Facility") : "",
|
|
144
|
+
purchaseDate: g(i.purchaseDate, "Purchase date")
|
|
145
|
+
}, ne = i.items.map((r) => {
|
|
146
|
+
var P;
|
|
147
|
+
let e = w.find((c) => c.id === r.productId), n = (e == null ? void 0 : e.hasExpiry) === !0, t = (e == null ? void 0 : e.hasManufactureDate) === !0, u = (e == null ? void 0 : e.expiryMode) === "FROM_MANUFACTURE", h = (e == null ? void 0 : e.needsStorageUnit) === !0 && i.ownerType === "FACILITY" ? g(r.storageUnitId, "Storage unit") : "";
|
|
148
|
+
if (!h && r.storageUnitId && (e != null && e.vaccineConfig)) {
|
|
149
|
+
let c = e.vaccineConfig, D = H.find((N) => N.id === r.storageUnitId);
|
|
150
|
+
if (c.storageTempMinCelsius != null && c.storageTempMaxCelsius != null && D) {
|
|
151
|
+
let N = D.operatingTempMinCelsius, K = D.operatingTempMaxCelsius;
|
|
152
|
+
(N == null || K == null || Number(N) > Number(c.storageTempMinCelsius) || Number(K) < Number(c.storageTempMaxCelsius)) && (h = `Unit operates ${N ?? "?"}°C → ${K ?? "?"}°C, which cannot cover this product's required ${c.storageTempMinCelsius}°C → ${c.storageTempMaxCelsius}°C.`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
let v = (e == null ? void 0 : e.salePriceMode) || "FREE", S = "";
|
|
156
|
+
G && e && !e.notForSale && v !== "FIXED" && r.expectedSalePrice !== "" && r.expectedSalePrice != null && (S = Z(r.expectedSalePrice), !S && v === "CAPPED" && e.salePrice != null && Number(r.expectedSalePrice) > Number(e.salePrice) && (S = `Cannot exceed the MRP (${F(e.salePrice)}).`));
|
|
157
|
+
let U = (e == null ? void 0 : e.basePriceMode) || "FREE", $;
|
|
158
|
+
U === "FIXED" ? $ = "" : ($ = x ? g(r.buyPrice, "Buy price") || Z(r.buyPrice) || (Number(r.buyPrice) > 0 ? "" : "Buy price must be greater than 0.") : Z(r.buyPrice), !$ && U === "CAPPED" && (e == null ? void 0 : e.basePrice) != null && r.buyPrice !== "" && r.buyPrice != null && Number(r.buyPrice) > Number(e.basePrice) && ($ = `Cannot exceed ${F(e.basePrice)}.`));
|
|
159
|
+
let o = Le(r.quantity), y = Number(r.quantity);
|
|
160
|
+
if (!o && e && Number.isFinite(y)) {
|
|
161
|
+
if (e.maxPurchaseQuantity != null && y > e.maxPurchaseQuantity) o = `At most ${e.maxPurchaseQuantity} can be bought at a time.`;
|
|
162
|
+
else if (e.maxInventoryQuantity != null) {
|
|
163
|
+
let c = we[e.id] ?? 0;
|
|
164
|
+
if (c + y > e.maxInventoryQuantity) {
|
|
165
|
+
let D = Math.max(0, e.maxInventoryQuantity - c);
|
|
166
|
+
o = `Limited to ${e.maxInventoryQuantity} in stock. ${c} on hand, so at most ${D} more can be taken in.`;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
productId: g(r.productId, "Product"),
|
|
172
|
+
quantity: o,
|
|
173
|
+
buyPrice: $,
|
|
174
|
+
expectedSalePrice: S,
|
|
175
|
+
expiryDate: p || u ? "" : n && g(r.expiryDate, "Expiry date") || ke(r.expiryDate, { label: "Expiry" }),
|
|
176
|
+
manufactureDate: p ? ue(r.manufactureDate, { label: "Manufacture date" }) : t && g(r.manufactureDate, "Manufacture date") || ue(r.manufactureDate, { label: "Manufacture date" }),
|
|
177
|
+
storageUnitId: h,
|
|
178
|
+
lotNumber: !p && !T ? g((P = r.lotNumber) == null ? void 0 : P.trim(), "Lot number") : ""
|
|
179
|
+
};
|
|
180
|
+
}), oe = se(C) && ne.every(se) && i.items.length > 0;
|
|
181
|
+
async function ve() {
|
|
182
|
+
var e, n;
|
|
183
|
+
if (!oe) {
|
|
184
|
+
l.markAllTouched(), j("Please fix the highlighted fields and try again.");
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
let r = {
|
|
188
|
+
id: i.id,
|
|
189
|
+
ownerType: i.ownerType,
|
|
190
|
+
ownerId: i.ownerType === "FACILITY" ? i.ownerId : null,
|
|
191
|
+
purchaseDate: i.purchaseDate,
|
|
192
|
+
paymentMode: x && i.paymentMode || null,
|
|
193
|
+
totalAmount: x && q.priced ? Number(q.sum.toFixed(2)) : null,
|
|
194
|
+
notes: i.notes || null,
|
|
195
|
+
items: i.items.map((t) => ({
|
|
196
|
+
batchId: t.batchId,
|
|
197
|
+
productId: t.productId,
|
|
198
|
+
quantity: Number(t.quantity),
|
|
199
|
+
buyPrice: (() => {
|
|
200
|
+
if (!x) return null;
|
|
201
|
+
let u = _(t);
|
|
202
|
+
return u !== "" && u != null ? Number(u) : null;
|
|
203
|
+
})(),
|
|
204
|
+
expectedSalePrice: (() => {
|
|
205
|
+
if (!G) return null;
|
|
206
|
+
let u = w.find((h) => h.id === t.productId);
|
|
207
|
+
return !u || u.notForSale || u.salePriceMode === "FIXED" || t.expectedSalePrice === "" ? null : Number(t.expectedSalePrice);
|
|
208
|
+
})(),
|
|
209
|
+
expiryDate: ie(t) || t.expiryDate || null,
|
|
210
|
+
lotNumber: t.lotNumber || null,
|
|
211
|
+
manufactureDate: t.manufactureDate || null,
|
|
212
|
+
storageUnitId: t.storageUnitId || null
|
|
213
|
+
}))
|
|
214
|
+
};
|
|
215
|
+
try {
|
|
216
|
+
if (p) {
|
|
217
|
+
let t = await $e(r);
|
|
218
|
+
le({
|
|
219
|
+
message: "Purchase request submitted for approval.",
|
|
220
|
+
type: "success"
|
|
221
|
+
}), A(`/ui/medplat/manage/pm/purchase-requests/${(t == null ? void 0 : t.id) ?? i.id}`);
|
|
222
|
+
} else await De(r), le({
|
|
223
|
+
message: "Purchase recorded.",
|
|
224
|
+
type: "success"
|
|
225
|
+
}), A("/ui/medplat/manage/pm/purchases");
|
|
226
|
+
} catch (t) {
|
|
227
|
+
j(((n = (e = t == null ? void 0 : t.response) == null ? void 0 : e.data) == null ? void 0 : n.message) ?? (t == null ? void 0 : t.message) ?? (p ? "Failed to submit purchase request" : "Failed to record purchase"));
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return /* @__PURE__ */ d(He, { children: [/* @__PURE__ */ a(We, {}), /* @__PURE__ */ a(Qe, {
|
|
231
|
+
perm: "update.manage.productManagement.purchase",
|
|
232
|
+
title: p ? "You don’t have permission to submit purchase requests" : "You don’t have permission to record purchases",
|
|
233
|
+
children: /* @__PURE__ */ d(Oe, {
|
|
234
|
+
title: p ? "Submit Purchase Request" : "Record Purchase",
|
|
235
|
+
subtitle: p ? "Purchases need approval before stock is added. Submit the request and wait for a manager to confirm." : "Each item creates a batch that you can track and a record in your ledger.",
|
|
236
|
+
actions: /* @__PURE__ */ d(Y, {
|
|
237
|
+
direction: "row",
|
|
238
|
+
spacing: 1,
|
|
239
|
+
children: [/* @__PURE__ */ a(J, {
|
|
240
|
+
variant: "outlined",
|
|
241
|
+
onClick: () => A(p ? "/ui/medplat/manage/pm/purchase-requests" : "/ui/medplat/manage/pm/purchases"),
|
|
242
|
+
children: "Cancel"
|
|
243
|
+
}), /* @__PURE__ */ a(J, {
|
|
244
|
+
variant: "contained",
|
|
245
|
+
startIcon: /* @__PURE__ */ a(ir, {}),
|
|
246
|
+
disabled: !oe,
|
|
247
|
+
onClick: () => void ve(),
|
|
248
|
+
children: p ? "Submit Request" : "Save"
|
|
249
|
+
})]
|
|
250
|
+
}),
|
|
251
|
+
children: [
|
|
252
|
+
te ? /* @__PURE__ */ a(je, {
|
|
253
|
+
severity: "error",
|
|
254
|
+
sx: { mb: 2 },
|
|
255
|
+
children: te
|
|
256
|
+
}) : null,
|
|
257
|
+
/* @__PURE__ */ a(k, {
|
|
258
|
+
sx: {
|
|
259
|
+
borderRadius: 1.5,
|
|
260
|
+
mb: 2,
|
|
261
|
+
border: "1px solid",
|
|
262
|
+
borderColor: "divider",
|
|
263
|
+
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
|
|
264
|
+
},
|
|
265
|
+
children: /* @__PURE__ */ d(O, {
|
|
266
|
+
sx: { p: 2.5 },
|
|
267
|
+
children: [/* @__PURE__ */ a(W, {
|
|
268
|
+
eyebrow: "Step 1",
|
|
269
|
+
title: "Purchase for",
|
|
270
|
+
hint: "Choose who will own this stock: yourself or a facility.",
|
|
271
|
+
sx: { mb: 2 }
|
|
272
|
+
}), /* @__PURE__ */ d(m, {
|
|
273
|
+
container: !0,
|
|
274
|
+
spacing: 2,
|
|
275
|
+
children: [/* @__PURE__ */ a(m, {
|
|
276
|
+
item: !0,
|
|
277
|
+
xs: 12,
|
|
278
|
+
md: 4,
|
|
279
|
+
children: /* @__PURE__ */ a(Q, {
|
|
280
|
+
label: "Purchase Type",
|
|
281
|
+
required: !0,
|
|
282
|
+
value: i.ownerType,
|
|
283
|
+
onChange: (r) => f({
|
|
284
|
+
...i,
|
|
285
|
+
ownerType: r,
|
|
286
|
+
ownerId: ""
|
|
287
|
+
}),
|
|
288
|
+
onBlur: l.onBlur("ownerType"),
|
|
289
|
+
error: l.show("ownerType") && !!C.ownerType,
|
|
290
|
+
options: be,
|
|
291
|
+
helperText: l.show("ownerType") && C.ownerType ? C.ownerType : "Personal stock vs. facility stock"
|
|
292
|
+
})
|
|
293
|
+
}), i.ownerType === "FACILITY" ? /* @__PURE__ */ a(m, {
|
|
294
|
+
item: !0,
|
|
295
|
+
xs: 12,
|
|
296
|
+
md: 4,
|
|
297
|
+
children: /* @__PURE__ */ a(Xe, {
|
|
298
|
+
required: !0,
|
|
299
|
+
value: i.ownerId,
|
|
300
|
+
onChange: (r) => f({
|
|
301
|
+
...i,
|
|
302
|
+
ownerId: r
|
|
303
|
+
}),
|
|
304
|
+
onBlur: l.onBlur("ownerId"),
|
|
305
|
+
error: l.show("ownerId") && !!C.ownerId,
|
|
306
|
+
helperText: l.show("ownerId") && C.ownerId ? C.ownerId : "Search for the facility."
|
|
307
|
+
})
|
|
308
|
+
}) : null]
|
|
309
|
+
})]
|
|
310
|
+
})
|
|
311
|
+
}),
|
|
312
|
+
i.ownerType === "USER" || i.ownerType === "FACILITY" && i.ownerId ? /* @__PURE__ */ a(k, {
|
|
313
|
+
sx: {
|
|
314
|
+
borderRadius: 1.5,
|
|
315
|
+
mb: 2,
|
|
316
|
+
border: "1px solid",
|
|
317
|
+
borderColor: "divider",
|
|
318
|
+
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
|
|
319
|
+
},
|
|
320
|
+
children: /* @__PURE__ */ d(O, {
|
|
321
|
+
sx: { p: 2.5 },
|
|
322
|
+
children: [/* @__PURE__ */ a(W, {
|
|
323
|
+
eyebrow: "Context",
|
|
324
|
+
title: "Existing inventory",
|
|
325
|
+
hint: i.ownerType === "USER" ? "Your current stock." : "What this facility already has, including where it is stored.",
|
|
326
|
+
sx: { mb: 1.5 }
|
|
327
|
+
}), ae.length === 0 ? /* @__PURE__ */ d(Y, {
|
|
328
|
+
direction: "row",
|
|
329
|
+
spacing: 1.25,
|
|
330
|
+
alignItems: "center",
|
|
331
|
+
sx: {
|
|
332
|
+
py: 1.5,
|
|
333
|
+
color: "text.secondary"
|
|
334
|
+
},
|
|
335
|
+
children: [/* @__PURE__ */ a(ar, { fontSize: "small" }), /* @__PURE__ */ a(X, {
|
|
336
|
+
variant: "body2",
|
|
337
|
+
children: "No active stock yet for this owner."
|
|
338
|
+
})]
|
|
339
|
+
}) : /* @__PURE__ */ d(Ve, {
|
|
340
|
+
size: "small",
|
|
341
|
+
children: [/* @__PURE__ */ a(_e, { children: /* @__PURE__ */ d(me, { children: [
|
|
342
|
+
/* @__PURE__ */ a(b, { children: "Product" }),
|
|
343
|
+
/* @__PURE__ */ a(b, { children: "Lot" }),
|
|
344
|
+
/* @__PURE__ */ a(b, {
|
|
345
|
+
align: "right",
|
|
346
|
+
children: "Remaining"
|
|
347
|
+
}),
|
|
348
|
+
/* @__PURE__ */ a(b, { children: "Expiry" }),
|
|
349
|
+
i.ownerType === "FACILITY" ? /* @__PURE__ */ a(b, { children: "Storage" }) : null,
|
|
350
|
+
/* @__PURE__ */ a(b, { children: "Status" })
|
|
351
|
+
] }) }), /* @__PURE__ */ a(Ke, { children: ae.map((r) => /* @__PURE__ */ d(me, { children: [
|
|
352
|
+
/* @__PURE__ */ a(b, {
|
|
353
|
+
sx: { fontWeight: 700 },
|
|
354
|
+
children: r.productName
|
|
355
|
+
}),
|
|
356
|
+
/* @__PURE__ */ a(b, {
|
|
357
|
+
sx: {
|
|
358
|
+
fontFamily: "monospace",
|
|
359
|
+
fontSize: "0.78rem"
|
|
360
|
+
},
|
|
361
|
+
children: r.lotNumber || "—"
|
|
362
|
+
}),
|
|
363
|
+
/* @__PURE__ */ a(b, {
|
|
364
|
+
align: "right",
|
|
365
|
+
sx: {
|
|
366
|
+
fontVariantNumeric: "tabular-nums",
|
|
367
|
+
fontWeight: 700
|
|
368
|
+
},
|
|
369
|
+
children: r.qtyRemaining
|
|
370
|
+
}),
|
|
371
|
+
/* @__PURE__ */ a(b, { children: r.expiryDate ? Fe(r.expiryDate) : "—" }),
|
|
372
|
+
i.ownerType === "FACILITY" ? /* @__PURE__ */ a(b, { children: r.storageUnitName || "—" }) : null,
|
|
373
|
+
/* @__PURE__ */ a(b, { children: /* @__PURE__ */ a(Ze, {
|
|
374
|
+
size: "small",
|
|
375
|
+
label: Me(qe, r.status),
|
|
376
|
+
color: Be(r.status)
|
|
377
|
+
}) })
|
|
378
|
+
] }, r.id)) })]
|
|
379
|
+
})]
|
|
380
|
+
})
|
|
381
|
+
}) : null,
|
|
382
|
+
/* @__PURE__ */ a(k, {
|
|
383
|
+
sx: {
|
|
384
|
+
borderRadius: 1.5,
|
|
385
|
+
mb: 2,
|
|
386
|
+
border: "1px solid",
|
|
387
|
+
borderColor: "divider",
|
|
388
|
+
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
|
|
389
|
+
},
|
|
390
|
+
children: /* @__PURE__ */ d(O, {
|
|
391
|
+
sx: { p: 2.5 },
|
|
392
|
+
children: [
|
|
393
|
+
/* @__PURE__ */ d(Y, {
|
|
394
|
+
direction: "row",
|
|
395
|
+
justifyContent: "space-between",
|
|
396
|
+
alignItems: "flex-start",
|
|
397
|
+
sx: { mb: 2 },
|
|
398
|
+
children: [/* @__PURE__ */ a(W, {
|
|
399
|
+
eyebrow: "Step 2",
|
|
400
|
+
title: "Line items",
|
|
401
|
+
hint: "Each item creates one batch in your inventory and a receipt record."
|
|
402
|
+
}), /* @__PURE__ */ a(J, {
|
|
403
|
+
variant: "outlined",
|
|
404
|
+
startIcon: /* @__PURE__ */ a(rr, {}),
|
|
405
|
+
onClick: Ce,
|
|
406
|
+
children: "Add Line"
|
|
407
|
+
})]
|
|
408
|
+
}),
|
|
409
|
+
/* @__PURE__ */ a(pe, { sx: { mb: 2 } }),
|
|
410
|
+
/* @__PURE__ */ a(Y, {
|
|
411
|
+
spacing: 2,
|
|
412
|
+
children: i.items.map((r, e) => {
|
|
413
|
+
let n = ne[e] || {}, t = w.find((o) => o.id === r.productId), u = (t == null ? void 0 : t.hasExpiry) === !0, h = (t == null ? void 0 : t.hasManufactureDate) === !0, v = (t == null ? void 0 : t.expiryMode) === "FROM_MANUFACTURE", S = ie(r), U = (t == null ? void 0 : t.needsStorageUnit) === !0 && i.ownerType === "FACILITY", $ = new Set(i.items.filter((o, y) => y !== e).map((o) => o.productId).filter(Boolean));
|
|
414
|
+
return /* @__PURE__ */ a(k, {
|
|
415
|
+
variant: "outlined",
|
|
416
|
+
sx: {
|
|
417
|
+
p: 2,
|
|
418
|
+
borderRadius: 1.5
|
|
419
|
+
},
|
|
420
|
+
children: /* @__PURE__ */ d(m, {
|
|
421
|
+
container: !0,
|
|
422
|
+
spacing: 2,
|
|
423
|
+
children: [
|
|
424
|
+
/* @__PURE__ */ a(m, {
|
|
425
|
+
item: !0,
|
|
426
|
+
xs: 12,
|
|
427
|
+
md: 3,
|
|
428
|
+
children: /* @__PURE__ */ a(Q, {
|
|
429
|
+
label: "Product",
|
|
430
|
+
required: !0,
|
|
431
|
+
value: r.productId,
|
|
432
|
+
onChange: (o) => I(e, "productId", o),
|
|
433
|
+
onBlur: l.onBlur(`items.${e}.productId`),
|
|
434
|
+
error: l.show(`items.${e}.productId`) && !!n.productId,
|
|
435
|
+
helperText: l.show(`items.${e}.productId`) ? n.productId : "",
|
|
436
|
+
options: w.filter((o) => o.id === r.productId || !$.has(o.id)).map((o) => ({
|
|
437
|
+
value: o.id,
|
|
438
|
+
label: o.name
|
|
439
|
+
}))
|
|
440
|
+
})
|
|
441
|
+
}),
|
|
442
|
+
/* @__PURE__ */ a(m, {
|
|
443
|
+
item: !0,
|
|
444
|
+
xs: 6,
|
|
445
|
+
md: 1,
|
|
446
|
+
children: /* @__PURE__ */ a(E, {
|
|
447
|
+
required: !0,
|
|
448
|
+
fullWidth: !0,
|
|
449
|
+
size: "small",
|
|
450
|
+
type: "number",
|
|
451
|
+
label: "Qty",
|
|
452
|
+
inputProps: {
|
|
453
|
+
min: 1,
|
|
454
|
+
max: (t == null ? void 0 : t.maxPurchaseQuantity) ?? void 0
|
|
455
|
+
},
|
|
456
|
+
value: r.quantity,
|
|
457
|
+
onChange: (o) => I(e, "quantity", o.target.value),
|
|
458
|
+
onBlur: l.onBlur(`items.${e}.quantity`),
|
|
459
|
+
error: l.show(`items.${e}.quantity`) && !!n.quantity,
|
|
460
|
+
helperText: l.show(`items.${e}.quantity`) && n.quantity ? n.quantity : (t == null ? void 0 : t.maxPurchaseQuantity) == null ? "" : `Max ${t.maxPurchaseQuantity}`
|
|
461
|
+
})
|
|
462
|
+
}),
|
|
463
|
+
x ? (() => {
|
|
464
|
+
let o = (t == null ? void 0 : t.basePriceMode) || "FREE", y = o === "FIXED", P = l.show(`items.${e}.buyPrice`) && n.buyPrice ? n.buyPrice : y ? "Fixed price" : o === "CAPPED" && (t == null ? void 0 : t.basePrice) != null ? `Max ${F(t.basePrice)}` : "";
|
|
465
|
+
return /* @__PURE__ */ a(m, {
|
|
466
|
+
item: !0,
|
|
467
|
+
xs: 6,
|
|
468
|
+
md: 2,
|
|
469
|
+
children: /* @__PURE__ */ a(E, {
|
|
470
|
+
required: !y,
|
|
471
|
+
fullWidth: !0,
|
|
472
|
+
size: "small",
|
|
473
|
+
type: "number",
|
|
474
|
+
inputProps: {
|
|
475
|
+
step: "0.01",
|
|
476
|
+
min: 0
|
|
477
|
+
},
|
|
478
|
+
label: "Buy Price",
|
|
479
|
+
disabled: y,
|
|
480
|
+
value: y ? (t == null ? void 0 : t.basePrice) ?? "" : r.buyPrice,
|
|
481
|
+
onChange: (c) => I(e, "buyPrice", c.target.value),
|
|
482
|
+
onBlur: l.onBlur(`items.${e}.buyPrice`),
|
|
483
|
+
error: l.show(`items.${e}.buyPrice`) && !!n.buyPrice,
|
|
484
|
+
helperText: P
|
|
485
|
+
})
|
|
486
|
+
});
|
|
487
|
+
})() : null,
|
|
488
|
+
G ? (() => {
|
|
489
|
+
let o = (t == null ? void 0 : t.salePriceMode) || "FREE", y = !!(t != null && t.notForSale), P = o === "FIXED", c = !t || y || P, D = l.show(`items.${e}.expectedSalePrice`) && n.expectedSalePrice ? n.expectedSalePrice : t ? y ? "Not for sale" : P ? "Fixed price" : o === "CAPPED" && t.salePrice != null ? `Max (MRP) ${F(t.salePrice)}` : "Optional estimate" : "Pick a product first";
|
|
490
|
+
return /* @__PURE__ */ a(m, {
|
|
491
|
+
item: !0,
|
|
492
|
+
xs: 6,
|
|
493
|
+
md: 2,
|
|
494
|
+
children: /* @__PURE__ */ a(E, {
|
|
495
|
+
fullWidth: !0,
|
|
496
|
+
size: "small",
|
|
497
|
+
type: "number",
|
|
498
|
+
inputProps: {
|
|
499
|
+
step: "0.01",
|
|
500
|
+
min: 0
|
|
501
|
+
},
|
|
502
|
+
label: "Approx. Sale Price",
|
|
503
|
+
disabled: c,
|
|
504
|
+
value: P ? (t == null ? void 0 : t.salePrice) ?? "" : r.expectedSalePrice,
|
|
505
|
+
onChange: (N) => I(e, "expectedSalePrice", N.target.value),
|
|
506
|
+
onBlur: l.onBlur(`items.${e}.expectedSalePrice`),
|
|
507
|
+
error: l.show(`items.${e}.expectedSalePrice`) && !!n.expectedSalePrice,
|
|
508
|
+
helperText: D
|
|
509
|
+
})
|
|
510
|
+
});
|
|
511
|
+
})() : null,
|
|
512
|
+
p ? null : /* @__PURE__ */ a(m, {
|
|
513
|
+
item: !0,
|
|
514
|
+
xs: 6,
|
|
515
|
+
md: 2,
|
|
516
|
+
children: /* @__PURE__ */ a(E, {
|
|
517
|
+
required: u && !v,
|
|
518
|
+
fullWidth: !0,
|
|
519
|
+
size: "small",
|
|
520
|
+
type: "date",
|
|
521
|
+
label: "Expiry",
|
|
522
|
+
InputLabelProps: { shrink: !0 },
|
|
523
|
+
inputProps: v ? { readOnly: !0 } : { min: V },
|
|
524
|
+
value: v ? S : r.expiryDate,
|
|
525
|
+
onChange: (o) => I(e, "expiryDate", o.target.value),
|
|
526
|
+
onBlur: l.onBlur(`items.${e}.expiryDate`),
|
|
527
|
+
error: l.show(`items.${e}.expiryDate`) && !!n.expiryDate,
|
|
528
|
+
helperText: v ? S ? `${t.expiryInterval} ${String(t.expiryIntervalUnit ?? "").toLowerCase()} after manufacture` : "Fill in the manufacture date" : l.show(`items.${e}.expiryDate`) && n.expiryDate ? n.expiryDate : u ? "Required for this product" : ""
|
|
529
|
+
})
|
|
530
|
+
}),
|
|
531
|
+
p ? null : /* @__PURE__ */ a(m, {
|
|
532
|
+
item: !0,
|
|
533
|
+
xs: 6,
|
|
534
|
+
md: 2,
|
|
535
|
+
children: /* @__PURE__ */ a(E, {
|
|
536
|
+
required: h,
|
|
537
|
+
fullWidth: !0,
|
|
538
|
+
size: "small",
|
|
539
|
+
type: "date",
|
|
540
|
+
label: "Manufactured",
|
|
541
|
+
InputLabelProps: { shrink: !0 },
|
|
542
|
+
inputProps: { max: V },
|
|
543
|
+
value: r.manufactureDate,
|
|
544
|
+
onChange: (o) => I(e, "manufactureDate", o.target.value),
|
|
545
|
+
onBlur: l.onBlur(`items.${e}.manufactureDate`),
|
|
546
|
+
error: l.show(`items.${e}.manufactureDate`) && !!n.manufactureDate,
|
|
547
|
+
helperText: l.show(`items.${e}.manufactureDate`) && n.manufactureDate ? n.manufactureDate : h ? "Required for this product" : "Optional"
|
|
548
|
+
})
|
|
549
|
+
}),
|
|
550
|
+
p ? null : /* @__PURE__ */ a(m, {
|
|
551
|
+
item: !0,
|
|
552
|
+
xs: 6,
|
|
553
|
+
md: 2,
|
|
554
|
+
children: /* @__PURE__ */ a(E, {
|
|
555
|
+
fullWidth: !0,
|
|
556
|
+
size: "small",
|
|
557
|
+
label: "Lot #",
|
|
558
|
+
required: !T,
|
|
559
|
+
value: r.lotNumber,
|
|
560
|
+
onChange: (o) => I(e, "lotNumber", o.target.value),
|
|
561
|
+
onBlur: l.onBlur(`items.${e}.lotNumber`),
|
|
562
|
+
error: l.show(`items.${e}.lotNumber`) && !!n.lotNumber,
|
|
563
|
+
helperText: T ? "Generated automatically." : l.show(`items.${e}.lotNumber`) ? n.lotNumber : "",
|
|
564
|
+
InputProps: T ? {
|
|
565
|
+
readOnly: !0,
|
|
566
|
+
sx: { fontFamily: "monospace" },
|
|
567
|
+
endAdornment: /* @__PURE__ */ a(Je, {
|
|
568
|
+
position: "end",
|
|
569
|
+
children: /* @__PURE__ */ a(er, {
|
|
570
|
+
title: "Generate a different lot number",
|
|
571
|
+
children: /* @__PURE__ */ a(he, {
|
|
572
|
+
size: "small",
|
|
573
|
+
edge: "end",
|
|
574
|
+
"aria-label": "Generate a different lot number",
|
|
575
|
+
onClick: () => I(e, "lotNumber", ee()),
|
|
576
|
+
children: /* @__PURE__ */ a(or, { fontSize: "small" })
|
|
577
|
+
})
|
|
578
|
+
})
|
|
579
|
+
})
|
|
580
|
+
} : void 0
|
|
581
|
+
})
|
|
582
|
+
}),
|
|
583
|
+
/* @__PURE__ */ a(m, {
|
|
584
|
+
item: !0,
|
|
585
|
+
xs: 10,
|
|
586
|
+
md: 2,
|
|
587
|
+
children: /* @__PURE__ */ a(Q, {
|
|
588
|
+
label: "Storage",
|
|
589
|
+
required: U,
|
|
590
|
+
disabled: i.ownerType !== "FACILITY" || !i.ownerId,
|
|
591
|
+
value: r.storageUnitId || "",
|
|
592
|
+
onChange: (o) => I(e, "storageUnitId", o),
|
|
593
|
+
onBlur: l.onBlur(`items.${e}.storageUnitId`),
|
|
594
|
+
error: l.show(`items.${e}.storageUnitId`) && !!n.storageUnitId,
|
|
595
|
+
options: Pe.map((o) => ({
|
|
596
|
+
value: o.id,
|
|
597
|
+
label: o.unitName
|
|
598
|
+
})),
|
|
599
|
+
slotProps: { popper: { style: {
|
|
600
|
+
width: "auto",
|
|
601
|
+
minWidth: 240
|
|
602
|
+
} } },
|
|
603
|
+
helperText: l.show(`items.${e}.storageUnitId`) && n.storageUnitId ? n.storageUnitId : U ? "Required for this product" : ""
|
|
604
|
+
})
|
|
605
|
+
}),
|
|
606
|
+
/* @__PURE__ */ a(m, {
|
|
607
|
+
item: !0,
|
|
608
|
+
xs: 2,
|
|
609
|
+
md: 1,
|
|
610
|
+
sx: {
|
|
611
|
+
textAlign: "right",
|
|
612
|
+
ml: "auto"
|
|
613
|
+
},
|
|
614
|
+
children: /* @__PURE__ */ a(he, {
|
|
615
|
+
color: "error",
|
|
616
|
+
onClick: () => Te(e),
|
|
617
|
+
disabled: i.items.length === 1,
|
|
618
|
+
children: /* @__PURE__ */ a(nr, {})
|
|
619
|
+
})
|
|
620
|
+
})
|
|
621
|
+
]
|
|
622
|
+
})
|
|
623
|
+
}, r.key);
|
|
624
|
+
})
|
|
625
|
+
})
|
|
626
|
+
]
|
|
627
|
+
})
|
|
628
|
+
}),
|
|
629
|
+
/* @__PURE__ */ a(k, {
|
|
630
|
+
sx: {
|
|
631
|
+
borderRadius: 1.5,
|
|
632
|
+
bgcolor: "grey.50",
|
|
633
|
+
border: "1px solid",
|
|
634
|
+
borderColor: "divider",
|
|
635
|
+
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
|
|
636
|
+
},
|
|
637
|
+
children: /* @__PURE__ */ d(O, {
|
|
638
|
+
sx: { p: 2.5 },
|
|
639
|
+
children: [
|
|
640
|
+
/* @__PURE__ */ a(W, {
|
|
641
|
+
eyebrow: "Step 3",
|
|
642
|
+
title: x ? "Bill summary" : "Receipt details",
|
|
643
|
+
hint: x ? "The total is calculated from items. Add payment mode and notes. The date is set automatically." : "Add notes about this receipt. The date is set automatically.",
|
|
644
|
+
sx: { mb: 2 }
|
|
645
|
+
}),
|
|
646
|
+
/* @__PURE__ */ d(m, {
|
|
647
|
+
container: !0,
|
|
648
|
+
spacing: 2,
|
|
649
|
+
children: [x ? /* @__PURE__ */ a(m, {
|
|
650
|
+
item: !0,
|
|
651
|
+
xs: 12,
|
|
652
|
+
md: 6,
|
|
653
|
+
children: /* @__PURE__ */ a(Q, {
|
|
654
|
+
label: "Payment Mode",
|
|
655
|
+
value: i.paymentMode || "",
|
|
656
|
+
onChange: (r) => f({
|
|
657
|
+
...i,
|
|
658
|
+
paymentMode: r
|
|
659
|
+
}),
|
|
660
|
+
options: Ue
|
|
661
|
+
})
|
|
662
|
+
}) : null, /* @__PURE__ */ a(m, {
|
|
663
|
+
item: !0,
|
|
664
|
+
xs: 12,
|
|
665
|
+
md: x ? 6 : 12,
|
|
666
|
+
children: /* @__PURE__ */ a(E, {
|
|
667
|
+
fullWidth: !0,
|
|
668
|
+
size: "small",
|
|
669
|
+
label: "Notes",
|
|
670
|
+
value: i.notes,
|
|
671
|
+
onChange: (r) => f({
|
|
672
|
+
...i,
|
|
673
|
+
notes: r.target.value
|
|
674
|
+
})
|
|
675
|
+
})
|
|
676
|
+
})]
|
|
677
|
+
}),
|
|
678
|
+
x ? /* @__PURE__ */ d(Ge, { children: [
|
|
679
|
+
/* @__PURE__ */ a(pe, { sx: { my: 2 } }),
|
|
680
|
+
/* @__PURE__ */ d(Y, {
|
|
681
|
+
direction: "row",
|
|
682
|
+
justifyContent: "flex-end",
|
|
683
|
+
alignItems: "baseline",
|
|
684
|
+
spacing: 2,
|
|
685
|
+
children: [/* @__PURE__ */ d(X, {
|
|
686
|
+
variant: "body2",
|
|
687
|
+
color: "text.secondary",
|
|
688
|
+
children: [
|
|
689
|
+
"Total (",
|
|
690
|
+
i.items.length,
|
|
691
|
+
" ",
|
|
692
|
+
i.items.length === 1 ? "line" : "lines",
|
|
693
|
+
")"
|
|
694
|
+
]
|
|
695
|
+
}), /* @__PURE__ */ a(X, {
|
|
696
|
+
variant: "h4",
|
|
697
|
+
sx: {
|
|
698
|
+
fontWeight: 800,
|
|
699
|
+
fontVariantNumeric: "tabular-nums"
|
|
700
|
+
},
|
|
701
|
+
children: q.priced ? F(q.sum) : "—"
|
|
702
|
+
})]
|
|
703
|
+
}),
|
|
704
|
+
q.priced ? null : /* @__PURE__ */ a(X, {
|
|
705
|
+
variant: "caption",
|
|
706
|
+
color: "text.secondary",
|
|
707
|
+
sx: {
|
|
708
|
+
display: "block",
|
|
709
|
+
textAlign: "right"
|
|
710
|
+
},
|
|
711
|
+
children: "Add a Buy Price on at least one line to compute the total."
|
|
712
|
+
})
|
|
713
|
+
] }) : null
|
|
714
|
+
]
|
|
715
|
+
})
|
|
716
|
+
})
|
|
717
|
+
]
|
|
718
|
+
})
|
|
719
|
+
})] });
|
|
720
|
+
}
|
|
721
|
+
export {
|
|
722
|
+
vr as default
|
|
723
|
+
};
|
|
724
|
+
//# sourceMappingURL=PurchaseCreatePage-C0EK9z4w-D4PlZsOH.js.map
|