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