@feedmepos/mf-inventory-portal 1.8.0-dev.7 → 1.8.0
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/App-BPdZMhM8.js +1445 -0
- package/dist/{ApprovalView-1Y_jh_UJ.js → ApprovalView-UzjSuZ2L.js} +26 -25
- package/dist/{BindingsDialog-VMvTLguN.js → BindingsDialog-Cb6WRlKq.js} +2 -2
- package/dist/{BindingsPicker-KNRM5rMU.js → BindingsPicker-CtD4U4lv.js} +2 -2
- package/dist/{BindingsTable-CSyNlNCL.js → BindingsTable-CX-3403K.js} +10 -10
- package/dist/BulkReceiveRequestPage-CUq1Lmww.js +2839 -0
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DQuI04Yj.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-C5cA-lGH.js} +1 -1
- package/dist/{ClosingDraftView-A2pJuhIb.js → ClosingDraftView-Ca_SvdWQ.js} +748 -746
- package/dist/ClosingHistoryView-DzkeJYoe.js +769 -0
- package/dist/{ClosingTemplateView-DpkNCyoB.js → ClosingTemplateView-DSrelbso.js} +22 -21
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DOpIDvsy.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BuOuXPy1.js} +1 -1
- package/dist/{DefaultView-B4UuAqYu.js → DefaultView-Dw-7Y8vD.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-w0YcNH3F.js → DeliveryOrderPrintPreview-C5qJsv_O.js} +15 -15
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BimIEHsW.js → EmailDialog.vue_vue_type_script_setup_true_lang-D8od7aKT.js} +10075 -9949
- package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-ChekXW32.js +48 -0
- package/dist/FeatureCapabilityGate-C-IM5_7n.js +82 -0
- package/dist/FeaturePageGate.vue_vue_type_script_setup_true_lang-DEDU1XUC.js +189 -0
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang--54VR4oB.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B861gqIJ.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B7j4ZSOe.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Ckli_nZx.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D_y8VcCI.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BEjFoMJJ.js} +2 -2
- package/dist/{FmMultiselectDialog-DMA5eR0C.js → FmMultiselectDialog-CShFKSIW.js} +2 -2
- package/dist/{FmMultiselectDialog-BnZInvgp.js → FmMultiselectDialog-Ci-6NMsV.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BXTUsnwN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Dkx5vVap.js} +105 -99
- package/dist/ImportView-7ij7RUHI.js +1540 -0
- package/dist/{IngredientsView-C4-8qNGD.js → IngredientsView-fIPtTyFD.js} +685 -688
- package/dist/{IntegrationExplorerView-D3leld2Z.js → IntegrationExplorerView-DLYT4T-I.js} +1537 -1620
- package/dist/IntegrationPlatformView-CwywuK_y.js +13385 -0
- package/dist/{IntegrationView-BhRzry3g.js → IntegrationView-DnyVHXge.js} +2380 -2340
- package/dist/{InventoryBindingForm-ewAgZ6e-.js → InventoryBindingForm-BBs8v7CL.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bpo7Yv9A.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang--pI5wz_M.js} +134 -134
- package/dist/{InventoryBindingSummary-e67GzHYr.js → InventoryBindingSummary-CwIrQ8lG.js} +1 -1
- package/dist/JsonViewer.vue_vue_type_script_setup_true_lang-C_hg75l0.js +25 -0
- package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DJSbskyn.js +79 -0
- package/dist/PlanTierBadge.vue_vue_type_script_setup_true_lang-CM3gtYZo.js +19 -0
- package/dist/PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-0F-yOcPC.js +79 -0
- package/dist/PremiumUpgradePage.vue_vue_type_script_setup_true_lang-DGAxPOEh.js +58 -0
- package/dist/ProductionRunDetailPage-C_WC4qfP.js +2317 -0
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-7u0HQH67.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BIkoMOM2.js} +3051 -3161
- package/dist/ProductionRunPage-DuzVrjbZ.js +954 -0
- package/dist/{PublishView-BXA3k8Cp.js → PublishView-BVg44yke.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-DRugr4BU.js → PurchaseOrderPrintPreview-CNx6unyj.js} +17 -17
- package/dist/{ReceiveRequestView-CeJs9NTD.js → ReceiveRequestView-DeNrYOUt.js} +17 -16
- package/dist/RecipeView-De3pLsPR.js +3272 -0
- package/dist/SettingsView-B5ud0KtI.js +1005 -0
- package/dist/StockView-4N3NRjY8.js +3003 -0
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Ckw1_xIc.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DvlRRKdt.js} +1 -1
- package/dist/{SupplierView-DH9u6e2M.js → SupplierView-fC9oe5nu.js} +304 -301
- package/dist/{SurchargeView-BPVEpc0f.js → SurchargeView-H6rv7u8A.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-BRwxKmwb.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DFdrmR2Z.js} +2 -2
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js +71 -0
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BivHE94R.js +332 -0
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-Df01LqHp.js +4953 -0
- package/dist/TransferTemplateView-CVUnofkI.js +2347 -0
- package/dist/{UnitCostHistoryView-06rIaX_M.js → UnitCostHistoryView-DjD2WAFI.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-C2zidBrl.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-CE0zHU6c.js} +4 -4
- package/dist/{UnitView-Xk_F9SYG.js → UnitView-DCfsbE8e.js} +111 -106
- package/dist/{WarehouseView-bmpLmpcX.js → WarehouseView-BCebmbcj.js} +12 -11
- package/dist/{WastageTemplateView-CWV1pFxM.js → WastageTemplateView-BXYNMBun.js} +19 -18
- package/dist/api/bill.d.ts +4 -2
- package/dist/api/bill.spec.d.ts +1 -0
- package/dist/api/closing.d.ts +1 -0
- package/dist/api/feature-flags.d.ts +2 -0
- package/dist/api/integration-sync-log.d.ts +0 -13
- package/dist/api/inventory.d.ts +9 -9
- package/dist/api/netsuite-explorer.d.ts +1 -0
- package/dist/api/stock.d.ts +1 -1
- package/dist/{app-CURawLhs.js → app-VtVYHCDF.js} +9785 -9546
- package/dist/app.d.ts +151 -14
- package/dist/app.js +1 -1
- package/dist/bulk-edit-simulation.helper-Nd6CtWGf.js +178 -0
- package/dist/{closing-template-q_KGB4jO.js → closing-template-LCe0U9w9.js} +4 -4
- package/dist/components/FeatureCapabilityGate.spec.d.ts +1 -0
- package/dist/components/FeatureCapabilityGate.vue.d.ts +5 -0
- package/dist/components/FeatureGateLayout.vue.d.ts +11 -0
- package/dist/components/FeaturePageGate.spec.d.ts +1 -0
- package/dist/components/FeaturePageGate.vue.d.ts +34 -0
- package/dist/components/FmAdminCollapsiblePanel.vue.d.ts +1 -1
- package/dist/components/FmDroppableField.vue.d.ts +1 -1
- package/dist/components/FmInventoryTableToolbar.vue.d.ts +2 -2
- package/dist/components/FmUnitInputProps.d.ts +1 -0
- package/dist/components/FmUnitInputRules.d.ts +1 -1
- package/dist/components/HrmPermissionGuard.vue.d.ts +1 -1
- package/dist/components/MultiLocationSelector.vue.d.ts +6 -6
- package/dist/components/NumberPrecisionInput.spec.d.ts +1 -0
- package/dist/components/PremiumUpgradePage.vue.d.ts +2 -0
- package/dist/components/TemplatePublishDialog.d.ts +2 -0
- package/dist/components/TemplatePublishDialog.spec.d.ts +1 -0
- package/dist/composable/defineApi.d.ts +1 -1
- package/dist/{date2-3kdweNLp.js → date2-Cfb6DXM4.js} +1 -1
- package/dist/{dayjs.min-DHE73-wM.js → dayjs.min-BOndKK7B.js} +1 -1
- package/dist/{decimal-CAnQe2Ib.js → decimal-nbuisP61.js} +2 -2
- package/dist/{defineDeepModel-CctS67Do.js → defineDeepModel-DKySrdwp.js} +5 -5
- package/dist/{duplicate-template-Jk2V2Ezg.js → duplicate-template-BxcKb3Jp.js} +1 -1
- package/dist/{feature-D9n0IC0c.js → feature-VDUlSvM1.js} +452 -354
- package/dist/feature-flags/core.d.ts +1 -0
- package/dist/feature-flags/vue.d.ts +22 -1
- package/dist/feature-flags/vue.spec.d.ts +1 -0
- package/dist/{format-time-from-id-Bmzpbg-8.js → format-time-from-id-CfVH4LZ_.js} +1 -1
- package/dist/{format-unit-display-CVg4Bl5L.js → format-unit-display-BjTeAtgS.js} +209 -208
- package/dist/helper/country.spec.d.ts +1 -0
- package/dist/helper/menu-usage-module.d.ts +2 -1
- package/dist/helper/number.d.ts +5 -1
- package/dist/helper/rules.d.ts +1 -1
- package/dist/{id-to-date-DPCcxufP.js → id-to-date-Jr9SlHLO.js} +1 -1
- package/dist/{import-export.helper-bmGZwUBB.js → import-export.helper-FT9Wbigh.js} +17 -17
- package/dist/{index-zCBA-X6R.js → index-BV9b3Ulp.js} +2234 -2163
- package/dist/{index-yt6MlAFG.js → index-By5-VjVg.js} +1 -1
- package/dist/{JsonViewer.vue_vue_type_script_setup_true_lang-ig2zSXAB.js → index-C25C1Dg7.js} +1074 -1066
- package/dist/{index-CFNNQo-7.js → index-DXHVgUHU.js} +3 -3
- package/dist/index-eGvSlWMU.js +1892 -0
- package/dist/layout/SingleColumnLayout.vue.d.ts +1 -1
- package/dist/{lz-string-CqlY9MC2.js → lz-string-BAzqO9xf.js} +1 -1
- package/dist/menu-usage-module-Bq_KLsO4.js +74 -0
- package/dist/{netsuite-DudeltN_.js → netsuite-BhGuduqd.js} +254 -263
- package/dist/netsuite-explorer-9Qj7qAum.js +79 -0
- package/dist/{predefined-templates-DT32p04n.js → predefined-templates-BlRafgnc.js} +1 -1
- package/dist/production-run-list-DR1WsaBR.js +61 -0
- package/dist/{purchase-order-template-LaRpWA04.js → purchase-order-template-By_Zxu1b.js} +1 -1
- package/dist/{recalculationUtils-BYN393eE.js → recalculationUtils-VsBar7jB.js} +1 -1
- package/dist/router/name.d.ts +2 -1
- package/dist/{row-action.enum-BiP5wkT6.js → row-action.enum-76yLYmPA.js} +1 -1
- package/dist/rules-fOcvgt4t.js +243 -0
- package/dist/{stock-B9XerL9c.js → stock-C-dQaxY2.js} +1 -1
- package/dist/stock-Dh0KXA1P.js +78 -0
- package/dist/stores/feature.d.ts +31 -2
- package/dist/stores/feature.load-state.spec.d.ts +1 -0
- package/dist/stores/integration/netsuite.d.ts +2 -2
- package/dist/stores/inventory.no-location.spec.d.ts +1 -0
- package/dist/stores/location.d.ts +42 -42
- package/dist/stores/supplier.d.ts +48 -48
- package/dist/stores/warehouse.d.ts +2 -2
- package/dist/style.css +1 -1
- package/dist/{supplier-dpHijd2E.js → supplier-XHHHN8vZ.js} +2 -2
- package/dist/{surcharge-BZ4STY5J.js → surcharge-0-oBiYoF.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-Da5Lngvp.js → uom-rules-DrRuSFgM.js} +1 -1
- package/dist/{use-ingredient-select-dialog-C3YsT5l-.js → use-ingredient-select-dialog-mQ7aQChK.js} +2 -2
- package/dist/{use-inventory-binding-dialog-BSsyrcGe.js → use-inventory-binding-dialog-5Wu0ItnH.js} +2 -2
- package/dist/{use-template-enabled-locations-BmJUzSUm.js → use-template-enabled-locations-CgpPMl8g.js} +2 -2
- package/dist/{use-transfer-locations-frEk_aBH.js → use-transfer-locations-DZ6B7eMT.js} +14 -14
- package/dist/{useHrmPermission-Cyjm0y9a.js → useHrmPermission-BaGxz4EV.js} +1 -1
- package/dist/{useNavigationMenu-CnTsOF9T.js → useNavigationMenu-CyP39v3U.js} +50 -49
- package/dist/{useSseClient-D_7o9nuf.js → useSseClient-CaD4MVg0.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +36 -36
- package/dist/views/adjustment-template/wastage-template/table.d.ts +36 -36
- package/dist/views/changelog/composables/use-snapshot-diff.d.ts +2 -2
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +6 -6
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +12 -12
- package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +6 -6
- package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +3 -3
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +19 -19
- package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +45 -45
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -36
- package/dist/views/import/helper/submit-rows.d.ts +1 -1
- package/dist/views/ingredients/components/inventory-binding/recipe-amount-validation.spec.d.ts +1 -0
- package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +3 -1
- package/dist/views/integration/IntegrationPlatformView.vue.d.ts +24 -0
- package/dist/views/integration/components/IntegrationCard.vue.d.ts +3 -3
- package/dist/views/integration/components/Synergy/importFn.spec.d.ts +1 -0
- package/dist/views/integration/components/Xilnex/importFn.spec.d.ts +1 -0
- package/dist/views/integration/components/netsuite/business/AddLocationDialog.vue.d.ts +36 -36
- package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +24 -24
- package/dist/views/integration/helper/opening-balance.d.ts +22 -0
- package/dist/views/integration/helper/opening-balance.spec.d.ts +1 -0
- package/dist/views/production-run/ProductionRunDetailPage.spec.d.ts +1 -0
- package/dist/views/{integration/components/IntegrationSyncLogTab.vue.d.ts → production-run/ProductionRunDetailPage.vue.d.ts} +2 -2
- package/dist/views/production-run/ProductionRunPage.vue.d.ts +2 -0
- package/dist/views/production-run/features/detail/ProductionRunItemsTable.vue.d.ts +2 -2
- package/dist/views/production-run/features/detail/ProductionRunOverviewTab.vue.d.ts +4 -4
- package/dist/views/production-run/features/detail/use-production-run-detail.d.ts +19 -9
- package/dist/views/production-run/features/lifecycle/CancelRunDialog.vue.d.ts +4 -4
- package/dist/views/production-run/features/lifecycle/CloseRunDialog.vue.d.ts +4 -4
- package/dist/views/production-run/features/lifecycle/ProductionRunLifecycleDialogs.vue.d.ts +14 -14
- package/dist/views/production-run/features/lifecycle/TargetReachedDialog.vue.d.ts +4 -4
- package/dist/views/production-run/features/planning/ProductionRunFormDialog.vue.d.ts +4 -4
- package/dist/views/production-run/features/planning/ProductionRunPlanner.vue.d.ts +1 -1
- package/dist/views/production-run/features/planning/use-production-run-duplicate-sources.d.ts +6 -6
- package/dist/views/production-run/shared/helpers/production-run-navigation.d.ts +0 -1
- package/dist/views/production-run/shared/model/production-run-list.d.ts +1 -1
- package/dist/views/production-run/shared/ui/ProductionRunInfoBadge.vue.d.ts +1 -1
- package/dist/views/production-run/shared/ui/ProductionRunInfoText.vue.d.ts +1 -1
- package/dist/views/production-run/shared/ui/ProductionRunScrollHint.vue.d.ts +2 -2
- package/dist/views/production-run/shared/ui/ProductionRunTextarea.vue.d.ts +3 -3
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +5 -5
- package/dist/views/receive-request/composables/netsuite-order-label.d.ts +11 -0
- package/dist/views/receive-request/composables/netsuite-order-label.spec.d.ts +1 -0
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +6 -6
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +48 -48
- package/dist/views/receive-request/composables/use-receive-request-form.spec.d.ts +1 -0
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +42 -42
- package/dist/views/receive-request/import/export.spec.d.ts +1 -0
- package/dist/views/receive-request-bulk/BulkReceiveRequestPage.vue.d.ts +2 -0
- package/dist/views/receive-request-bulk/components/CreateTransferWizard.spec.d.ts +1 -0
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +54 -54
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.readiness.spec.d.ts +1 -0
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +8 -8
- package/dist/views/recipe/components/recipe-bulk-editor/components/ModificationCard.spec.d.ts +1 -0
- package/dist/views/recipe/helper/import-recipe.d.ts +30 -0
- package/dist/views/recipe/helper/import-recipe.spec.d.ts +1 -0
- package/dist/views/settings/PlanLicenseDisplay.spec.d.ts +1 -0
- package/dist/views/settings/PlanLicenseDisplay.vue.d.ts +2 -0
- package/dist/views/stock/components/StockRecordCard.spec.d.ts +1 -0
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +19 -865
- package/dist/views/stock/components/dialog/AmendAdjustmentForm.spec.d.ts +1 -0
- package/dist/views/stock/components/dialog/BillInventoryInfoDialog.spec.d.ts +1 -0
- package/dist/views/stock/components/dialog/BillInventoryInfoDialog.vue.d.ts +36 -0
- package/dist/views/stock/components/dialog/ConvertSkuDialog.spec.d.ts +1 -0
- package/dist/views/stock/composables/use-last-closing-summary.d.ts +4 -0
- package/dist/views/stock/composables/use-last-closing-summary.spec.d.ts +1 -0
- package/dist/views/supplier/components/SupplierForm.vue.d.ts +4 -4
- package/dist/views/supplier/composables/use-supplier-table.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +8 -8
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.spec.d.ts +1 -0
- package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +24 -24
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +48 -48
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +48 -48
- package/dist/views/transfer-template/helpers/template-item.error.helper.spec.d.ts +1 -0
- package/dist/views/unit/composables/use-unit-form.spec.d.ts +1 -0
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +4 -4
- package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BBkF9lOE.js → vue-KHCpiw_e.js} +106 -108
- package/dist/{vue-i18n-DwAcG7yc.js → vue-i18n-D6btLtve.js} +422 -422
- package/dist/{xlsx.util-C7S-uyqm.js → xlsx.util-Dr5i_LBa.js} +2 -2
- package/package.json +71 -66
- package/dist/App-Bo29Nwt0.js +0 -1537
- package/dist/BulkReceiveRequestView-vOeHbWM_.js +0 -2656
- package/dist/ClosingHistoryView-woRmvmYT.js +0 -761
- package/dist/ImportView-C7Hah7MM.js +0 -1291
- package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CKEzy2Uo.js +0 -72
- package/dist/ProductionRunDetailView-Ct7kr5Ht.js +0 -2312
- package/dist/ProductionRunView-odWyBZGx.js +0 -930
- package/dist/RecipeView-BH0REMB3.js +0 -3428
- package/dist/SettingsView-Dc27wyk-.js +0 -977
- package/dist/StockView-DrHLzosW.js +0 -2616
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js +0 -84
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BpiePSmo.js +0 -299
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DOQGPKiv.js +0 -4820
- package/dist/TransferTemplateView-CEVRsKL7.js +0 -2326
- package/dist/menu-usage-module-BdjYEk3s.js +0 -57
- package/dist/number-BoePMDs8.js +0 -138
- package/dist/rules-CQT0uAAo.js +0 -98
- package/dist/stock-CVybjhUm.js +0 -75
- package/dist/views/integration/composables/use-integration-sync-log.d.ts +0 -45
|
@@ -1,79 +1,81 @@
|
|
|
1
|
-
import { ref as P, defineComponent as
|
|
2
|
-
import { a as Fe, c as wt, S as Lt, g as dt, e as ut, f as jt, h as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { ref as P, defineComponent as xe, computed as g, resolveComponent as C, createElementBlock as V, openBlock as p, Fragment as ee, createCommentVNode as L, createVNode as r, unref as o, withModifiers as Rt, withCtx as x, createElementVNode as n, renderList as de, createBlock as Y, toDisplayString as $, normalizeClass as ie, h as Z, mergeModels as st, onMounted as Dt, watch as _t, useModel as Ot, createTextVNode as xt, isRef as rt, createSlots as kt, normalizeStyle as Bt, Teleport as it, normalizeProps as Nt, guardReactiveProps as zt } from "vue";
|
|
2
|
+
import { a as Fe, c as wt, S as Lt, g as dt, e as ut, f as jt, h as ct, i as mt, j as pt, k as vt, u as Wt, l as qt } from "./app-VtVYHCDF.js";
|
|
3
|
+
import { p as Ht } from "./production-run-list-DR1WsaBR.js";
|
|
4
|
+
import { useDialog as Ke, useSnackbar as Ae, components as ze, useProxiedModel as ft, useDialogChild as Yt, useBreakpoints as Kt } from "@feedmepos/ui-library";
|
|
5
|
+
import { i as Gt, _ as Jt, m as Qt } from "./menu-usage-module-Bq_KLsO4.js";
|
|
6
|
+
import { F as j } from "./form-mode.enum-BKiNVH6A.js";
|
|
6
7
|
import { useI18n as pe, useCoreStore as Ge } from "@feedmepos/mf-common";
|
|
7
|
-
import { defineStore as
|
|
8
|
-
import { D as yt, R as Pe } from "./row-action.enum-
|
|
9
|
-
import { c as
|
|
10
|
-
import { u as Ee, _ as
|
|
11
|
-
import { F as
|
|
12
|
-
import { u as
|
|
13
|
-
import { A as
|
|
14
|
-
import { g as
|
|
15
|
-
import { _ as
|
|
16
|
-
import { _ as qe, u as
|
|
17
|
-
import { u as Tt } from "./feature-
|
|
18
|
-
import {
|
|
19
|
-
import { a as
|
|
20
|
-
import {
|
|
21
|
-
import { _ as yn } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-CG1m-B2p.js";
|
|
8
|
+
import { defineStore as Xt, storeToRefs as Zt } from "pinia";
|
|
9
|
+
import { D as yt, R as Pe } from "./row-action.enum-76yLYmPA.js";
|
|
10
|
+
import { c as en } from "./component-BmLAdDiY.js";
|
|
11
|
+
import { u as Ee, _ as tn } from "./netsuite-BhGuduqd.js";
|
|
12
|
+
import { F as Oe } from "./FmAdminBadge-DlplQOHb.js";
|
|
13
|
+
import { u as nn, _ as on } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
|
|
14
|
+
import { A as De, t as ln, a as an, R as Le, U as sn, M as rn, g as dn } from "./rules-fOcvgt4t.js";
|
|
15
|
+
import { g as un, _ as je, S as We, a as cn } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DvlRRKdt.js";
|
|
16
|
+
import { _ as mn } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang--pI5wz_M.js";
|
|
17
|
+
import { _ as qe, u as pn } from "./FmMultiselectDialog-CShFKSIW.js";
|
|
18
|
+
import { u as Tt } from "./feature-VDUlSvM1.js";
|
|
19
|
+
import { _ as ke } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-ChekXW32.js";
|
|
20
|
+
import { d as Re, g as vn, e as fn, a as yn } from "./import-export.helper-FT9Wbigh.js";
|
|
21
|
+
import { _ as gn } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-CG1m-B2p.js";
|
|
22
22
|
import { _ as Ce } from "./FmLockableField.vue_vue_type_script_setup_true_lang-FCg4K7y8.js";
|
|
23
|
-
import { F as
|
|
24
|
-
import { u as Vt } from "./purchase-order-template-
|
|
25
|
-
import { u as It, a as St } from "./closing-template-
|
|
26
|
-
import { _ as
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
import { F as bn, a as He } from "./FmMultiselectDialog-Ci-6NMsV.js";
|
|
24
|
+
import { u as Vt } from "./purchase-order-template-By_Zxu1b.js";
|
|
25
|
+
import { u as It, a as St } from "./closing-template-LCe0U9w9.js";
|
|
26
|
+
import { _ as hn } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
|
|
27
|
+
import { F as gt } from "./index-eGvSlWMU.js";
|
|
28
|
+
import { r as _n } from "./xlsx.util-Dr5i_LBa.js";
|
|
29
|
+
import { F as xn } from "./FmDroppableField-J0tG_U3w.js";
|
|
30
|
+
import { _ as kn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BEjFoMJJ.js";
|
|
31
|
+
import { P as wn, J as Tn } from "./app-C39bYJmq.js";
|
|
32
|
+
const Ye = Xt("ingredientForm", function() {
|
|
33
|
+
const h = Ke(), k = Ae(), d = Fe(), _ = P(!1), { t: S } = pe(), A = P();
|
|
33
34
|
function U() {
|
|
34
35
|
const a = {
|
|
35
36
|
sku: {},
|
|
36
|
-
mode:
|
|
37
|
+
mode: j.CREATE,
|
|
37
38
|
show: !0,
|
|
38
|
-
"onUpdate:show"(
|
|
39
|
-
A.value.show =
|
|
39
|
+
"onUpdate:show"(c) {
|
|
40
|
+
A.value.show = c;
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
43
|
A.value = a;
|
|
43
44
|
}
|
|
44
45
|
async function l(a) {
|
|
45
|
-
const
|
|
46
|
+
const c = {
|
|
46
47
|
sku: wt(a),
|
|
47
|
-
mode:
|
|
48
|
+
mode: j.UPDATE,
|
|
48
49
|
show: !0,
|
|
49
|
-
"onUpdate:show"(
|
|
50
|
-
A.value.show =
|
|
50
|
+
"onUpdate:show"(s) {
|
|
51
|
+
A.value.show = s;
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
|
-
A.value =
|
|
54
|
+
A.value = c;
|
|
54
55
|
}
|
|
55
56
|
async function i(a) {
|
|
56
57
|
_.value = !0;
|
|
57
58
|
try {
|
|
58
|
-
await
|
|
59
|
+
await d.deleteSku(a), k.open({
|
|
59
60
|
title: "Success",
|
|
60
61
|
message: `Deleted ${a.name}`,
|
|
61
62
|
type: "success"
|
|
62
63
|
});
|
|
63
|
-
} catch (
|
|
64
|
-
if (
|
|
64
|
+
} catch (c) {
|
|
65
|
+
if (c instanceof Lt && Gt(c)) {
|
|
65
66
|
h.open({
|
|
66
67
|
title: "Cannot delete ingredient",
|
|
67
|
-
contentComponent:
|
|
68
|
+
contentComponent: Jt,
|
|
68
69
|
contentComponentProps: {
|
|
69
70
|
subject: (a == null ? void 0 : a.name) ?? "",
|
|
70
|
-
items:
|
|
71
|
+
items: c.errorResponse.errors.map((s) => {
|
|
71
72
|
var f;
|
|
72
73
|
return {
|
|
73
74
|
chain: [
|
|
74
75
|
{
|
|
75
|
-
itemName:
|
|
76
|
-
|
|
76
|
+
itemName: s.module === "productionRun" && s.runNo != null ? Ht({ runName: s.name, runNo: s.runNo }, S("inventory.production.run.list.untitled")) : s.name,
|
|
77
|
+
locationName: s.locationName,
|
|
78
|
+
moduleKey: (f = s.message) != null && f.startsWith("modules.") ? Qt(s.message) : s.module
|
|
77
79
|
}
|
|
78
80
|
]
|
|
79
81
|
};
|
|
@@ -90,23 +92,23 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
90
92
|
title: `Cannot delete ${a.name}`,
|
|
91
93
|
message: "Please try again.",
|
|
92
94
|
type: "error"
|
|
93
|
-
}), console.error("failed to delete ingredient",
|
|
95
|
+
}), console.error("failed to delete ingredient", c);
|
|
94
96
|
} finally {
|
|
95
97
|
_.value = !1;
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
|
-
function
|
|
100
|
+
function u(a) {
|
|
99
101
|
h.open({
|
|
100
|
-
title:
|
|
102
|
+
title: S("inventory.ingredient.delete.title", [(a == null ? void 0 : a.name) ?? ""]),
|
|
101
103
|
closeButton: !1,
|
|
102
|
-
message:
|
|
104
|
+
message: S("inventory.ingredient.delete.message"),
|
|
103
105
|
primaryActions: {
|
|
104
|
-
text:
|
|
106
|
+
text: S("common.delete"),
|
|
105
107
|
close: !0,
|
|
106
108
|
variant: "destructive"
|
|
107
109
|
},
|
|
108
110
|
secondaryActions: {
|
|
109
|
-
text:
|
|
111
|
+
text: S("common.cancel"),
|
|
110
112
|
close: !0
|
|
111
113
|
}
|
|
112
114
|
}).onPrimary(() => i(a));
|
|
@@ -114,113 +116,113 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
114
116
|
return {
|
|
115
117
|
createIngredient: U,
|
|
116
118
|
updateIngredient: l,
|
|
117
|
-
deleteIngredient:
|
|
119
|
+
deleteIngredient: u,
|
|
118
120
|
ingredientDialogProps: A,
|
|
119
121
|
ingredientViewLoading: _
|
|
120
122
|
};
|
|
121
|
-
}),
|
|
123
|
+
}), Vn = {
|
|
122
124
|
key: 0,
|
|
123
125
|
class: "flex items-center gap-8"
|
|
124
|
-
},
|
|
126
|
+
}, In = { class: "flex flex-col gap-1" }, Sn = { class: "fm-typo-en-heading-lg-600" }, Cn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, An = {
|
|
125
127
|
key: 0,
|
|
126
128
|
class: "fm-typo-en-body-md-400 text-fm-color-system-warning-300"
|
|
127
|
-
},
|
|
129
|
+
}, En = {
|
|
128
130
|
key: 1,
|
|
129
131
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
130
|
-
},
|
|
132
|
+
}, $n = { class: "flex flex-col gap-2 mt-4" }, Mn = { class: "flex items-center gap-2 fm-typo-en-body-md-400" }, Un = { class: "flex flex-wrap gap-2" }, Pn = { class: "flex flex-col" }, Rn = { class: "flex flex-col bg-fm-color-bg-secondary font-mono p-4 rounded-md" }, Dn = { class: "text-fm-color-typo-tertiary flex-shrink-0 fm-typo-en-body-md-400 whitespace-pre flex items-center" }, On = { class: "px-2 py-1 rounded-md bg-blue-200 border-2 border-blue-400" }, Bn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, Nn = /* @__PURE__ */ xe({
|
|
131
133
|
__name: "ItemSubsidiaryTreeDialog",
|
|
132
134
|
props: {
|
|
133
135
|
skuId: {},
|
|
134
136
|
itemName: {},
|
|
135
137
|
itemCode: {}
|
|
136
138
|
},
|
|
137
|
-
setup(
|
|
138
|
-
const h =
|
|
139
|
-
var
|
|
140
|
-
return ((
|
|
139
|
+
setup(W) {
|
|
140
|
+
const h = W, { t: k } = pe(), d = Ge(), _ = Ee(), S = P(!1), A = g(() => {
|
|
141
|
+
var s;
|
|
142
|
+
return ((s = d.sessionUser.value) == null ? void 0 : s.role.isAdmin) ?? !1;
|
|
141
143
|
}), U = g(() => _.getSkuSubsidiaries(h.skuId)), l = g(() => {
|
|
142
|
-
const
|
|
144
|
+
const s = /* @__PURE__ */ new Set();
|
|
143
145
|
function f(F) {
|
|
144
|
-
for (const
|
|
145
|
-
|
|
146
|
+
for (const m of F)
|
|
147
|
+
m.isAssigned && (s.add(m.id), U.value.includeChildren && w(m)), m.children && m.children.length > 0 && f(m.children);
|
|
146
148
|
}
|
|
147
149
|
function w(F) {
|
|
148
150
|
if (F.children)
|
|
149
|
-
for (const
|
|
150
|
-
|
|
151
|
+
for (const m of F.children)
|
|
152
|
+
s.add(m.id), w(m);
|
|
151
153
|
}
|
|
152
|
-
return f(U.value.subsidiaryTree),
|
|
154
|
+
return f(U.value.subsidiaryTree), s;
|
|
153
155
|
});
|
|
154
|
-
function i(
|
|
156
|
+
function i(s, f = [], w = !1) {
|
|
155
157
|
const F = [];
|
|
156
|
-
return
|
|
157
|
-
const R =
|
|
158
|
+
return s.forEach((m, O) => {
|
|
159
|
+
const R = O === s.length - 1, ve = [...f, R];
|
|
158
160
|
let ne = "";
|
|
159
161
|
for (let te = 0; te < f.length; te++)
|
|
160
162
|
ne += f[te] ? " " : "│ ";
|
|
161
163
|
ne += R ? "└── " : "├── ";
|
|
162
|
-
const ue = l.value.has(
|
|
164
|
+
const ue = l.value.has(m.id), oe = m.isAssigned === !0, le = w && !oe;
|
|
163
165
|
if (F.push({
|
|
164
|
-
id:
|
|
165
|
-
name:
|
|
166
|
+
id: m.id,
|
|
167
|
+
name: m.name,
|
|
166
168
|
prefix: f.length === 0 ? "" : ne,
|
|
167
169
|
isHighlighted: ue,
|
|
168
170
|
isDirectlyBound: oe,
|
|
169
171
|
isParentIncludedChild: le,
|
|
170
172
|
isRoot: f.length === 0
|
|
171
|
-
}),
|
|
173
|
+
}), m.children && m.children.length > 0) {
|
|
172
174
|
const te = w || oe && U.value.includeChildren;
|
|
173
|
-
F.push(...i(
|
|
175
|
+
F.push(...i(m.children, ve, te));
|
|
174
176
|
}
|
|
175
177
|
}), F;
|
|
176
178
|
}
|
|
177
|
-
function
|
|
179
|
+
function u(s, f = []) {
|
|
178
180
|
const w = /* @__PURE__ */ new Set();
|
|
179
|
-
for (const F of
|
|
180
|
-
const
|
|
181
|
-
F.isAssigned === !0 &&
|
|
181
|
+
for (const F of s) {
|
|
182
|
+
const m = [...f, F.id];
|
|
183
|
+
F.isAssigned === !0 && m.forEach((O) => w.add(O)), F.children && F.children.length > 0 && u(F.children, m).forEach((R) => w.add(R));
|
|
182
184
|
}
|
|
183
185
|
return w;
|
|
184
186
|
}
|
|
185
|
-
function a(
|
|
186
|
-
return
|
|
187
|
+
function a(s, f) {
|
|
188
|
+
return s.map((w) => f.has(w.id) || w.isAssigned === !0 ? {
|
|
187
189
|
...w,
|
|
188
190
|
// Recursively filter children
|
|
189
191
|
children: w.children ? a(w.children, f) : []
|
|
190
192
|
} : null).filter(Boolean);
|
|
191
193
|
}
|
|
192
|
-
const
|
|
193
|
-
let
|
|
194
|
-
if ((!
|
|
195
|
-
const f =
|
|
196
|
-
|
|
194
|
+
const c = g(() => {
|
|
195
|
+
let s = U.value.subsidiaryTree;
|
|
196
|
+
if ((!s || s.length === 0) && (s = _.getBusinessSubsidiaryTree()), !A.value) {
|
|
197
|
+
const f = u(s);
|
|
198
|
+
s = a(s, f);
|
|
197
199
|
}
|
|
198
|
-
return i(
|
|
200
|
+
return i(s, []);
|
|
199
201
|
});
|
|
200
|
-
return (
|
|
201
|
-
const w =
|
|
202
|
-
return
|
|
203
|
-
o(_).isEnabled ? (
|
|
204
|
-
|
|
202
|
+
return (s, f) => {
|
|
203
|
+
const w = C("FmButton"), F = C("FmDialog");
|
|
204
|
+
return p(), V(ee, null, [
|
|
205
|
+
o(_).isEnabled ? (p(), V("div", Vn, [
|
|
206
|
+
r(w, {
|
|
205
207
|
"prepend-icon": "info",
|
|
206
208
|
variant: "tertiary",
|
|
207
|
-
onClick: f[0] || (f[0] = Rt((
|
|
209
|
+
onClick: f[0] || (f[0] = Rt((m) => S.value = !0, ["stop"]))
|
|
208
210
|
})
|
|
209
|
-
])) :
|
|
210
|
-
|
|
211
|
-
modelValue:
|
|
212
|
-
"onUpdate:modelValue": f[1] || (f[1] = (
|
|
211
|
+
])) : L("", !0),
|
|
212
|
+
r(F, {
|
|
213
|
+
modelValue: S.value,
|
|
214
|
+
"onUpdate:modelValue": f[1] || (f[1] = (m) => S.value = m),
|
|
213
215
|
"close-button": "",
|
|
214
216
|
dismissAway: ""
|
|
215
217
|
}, {
|
|
216
218
|
"dialog-header": x(() => [
|
|
217
|
-
n("div",
|
|
218
|
-
n("div",
|
|
219
|
-
n("p",
|
|
220
|
-
n("p",
|
|
221
|
-
A.value ? (
|
|
222
|
-
n("div",
|
|
223
|
-
n("div",
|
|
219
|
+
n("div", In, [
|
|
220
|
+
n("div", Sn, $(o(k)("inventory.integration.netsuite.subsidiaryHierarchy.title")), 1),
|
|
221
|
+
n("p", Cn, " Name: " + $(h.itemName), 1),
|
|
222
|
+
n("p", Fn, " Code: " + $(h.itemCode), 1),
|
|
223
|
+
A.value ? (p(), V("p", An, " All subsidiaries are shown since you are an admin. ")) : (p(), V("p", En, " Only showing subsidiaries in your business path and bound subsidiaries. ")),
|
|
224
|
+
n("div", $n, [
|
|
225
|
+
n("div", Mn, [
|
|
224
226
|
f[2] || (f[2] = n("span", { class: "font-semibold" }, "Include Children Subsidiaries:", -1)),
|
|
225
227
|
n("span", {
|
|
226
228
|
class: ie(
|
|
@@ -228,12 +230,12 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
228
230
|
)
|
|
229
231
|
}, $(U.value.includeChildren ? "Yes" : "No"), 3)
|
|
230
232
|
]),
|
|
231
|
-
n("div",
|
|
233
|
+
n("div", Un, [
|
|
232
234
|
f[4] || (f[4] = n("div", { class: "flex items-center gap-2 px-2 py-1 bg-fm-color-bg-brand-secondary rounded-md" }, [
|
|
233
235
|
n("span", { class: "w-3 h-3 rounded-sm bg-green-400" }),
|
|
234
236
|
n("span", { class: "fm-typo-en-body-sm-400" }, "Directly Bound")
|
|
235
237
|
], -1)),
|
|
236
|
-
|
|
238
|
+
r(Oe, null, {
|
|
237
239
|
default: x(() => f[3] || (f[3] = [
|
|
238
240
|
n("div", { class: "flex items-center gap-2 px-2 py-1 rounded-md" }, [
|
|
239
241
|
n("span", { class: "w-3 h-3 rounded-sm bg-blue-400" }),
|
|
@@ -247,35 +249,35 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
247
249
|
])
|
|
248
250
|
]),
|
|
249
251
|
default: x(() => [
|
|
250
|
-
n("div",
|
|
251
|
-
n("div",
|
|
252
|
-
(
|
|
253
|
-
key:
|
|
252
|
+
n("div", Pn, [
|
|
253
|
+
n("div", Rn, [
|
|
254
|
+
(p(!0), V(ee, null, de(c.value, (m) => (p(), V("div", {
|
|
255
|
+
key: m.id,
|
|
254
256
|
class: "flex items-stretch"
|
|
255
257
|
}, [
|
|
256
|
-
n("span",
|
|
257
|
-
|
|
258
|
+
n("span", Dn, $(m.prefix), 1),
|
|
259
|
+
m.isParentIncludedChild ? (p(), Y(Oe, {
|
|
258
260
|
key: 0,
|
|
259
261
|
class: "flex-1"
|
|
260
262
|
}, {
|
|
261
263
|
default: x(() => [
|
|
262
264
|
n("div", On, [
|
|
263
|
-
n("span", Bn, $(
|
|
265
|
+
n("span", Bn, $(m.name), 1)
|
|
264
266
|
])
|
|
265
267
|
]),
|
|
266
268
|
_: 2
|
|
267
|
-
}, 1024)) : (
|
|
269
|
+
}, 1024)) : (p(), V("div", {
|
|
268
270
|
key: 1,
|
|
269
271
|
class: ie([
|
|
270
272
|
"px-2 py-1 rounded-md flex-1",
|
|
271
|
-
|
|
273
|
+
m.isDirectlyBound ? "border-2 bg-green-200 border-green-400" : "bg-fm-color-bg-primary border border-fm-color-border-secondary"
|
|
272
274
|
])
|
|
273
275
|
}, [
|
|
274
276
|
n("span", {
|
|
275
277
|
class: ie([
|
|
276
|
-
|
|
278
|
+
m.isHighlighted ? "fm-typo-en-body-md-600 text-fm-color-typo-primary" : "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
277
279
|
])
|
|
278
|
-
}, $(
|
|
280
|
+
}, $(m.name), 3)
|
|
279
281
|
], 2))
|
|
280
282
|
]))), 128))
|
|
281
283
|
])
|
|
@@ -287,13 +289,13 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
287
289
|
};
|
|
288
290
|
}
|
|
289
291
|
});
|
|
290
|
-
function
|
|
292
|
+
function zn() {
|
|
291
293
|
var l;
|
|
292
|
-
const { updateIngredient:
|
|
293
|
-
async function A(i,
|
|
294
|
-
const a = wt(
|
|
294
|
+
const { updateIngredient: W, deleteIngredient: h } = Ye(), k = Fe(), d = Ee(), { t: _ } = pe(), S = Ge();
|
|
295
|
+
async function A(i, u) {
|
|
296
|
+
const a = wt(u);
|
|
295
297
|
if (i === Pe.Edit) {
|
|
296
|
-
await
|
|
298
|
+
await W(a);
|
|
297
299
|
return;
|
|
298
300
|
}
|
|
299
301
|
if (i === Pe.Delete) {
|
|
@@ -302,10 +304,10 @@ function Nn() {
|
|
|
302
304
|
}
|
|
303
305
|
}
|
|
304
306
|
return { columnDefs: [
|
|
305
|
-
...(l =
|
|
307
|
+
...(l = S.sessionUser.value) != null && l.role.isAdmin ? [
|
|
306
308
|
{
|
|
307
309
|
accessorKey: "_id",
|
|
308
|
-
header: () => Z(
|
|
310
|
+
header: () => Z(Oe, {}, () => "ID"),
|
|
309
311
|
size: 200
|
|
310
312
|
}
|
|
311
313
|
] : [],
|
|
@@ -321,11 +323,11 @@ function Nn() {
|
|
|
321
323
|
enableSorting: !0,
|
|
322
324
|
size: 300,
|
|
323
325
|
cell(i) {
|
|
324
|
-
const
|
|
325
|
-
(
|
|
326
|
+
const u = i.row.original, a = k.skuBindingFlattenCache[u._id], c = a == null ? void 0 : a.inventoryBindings.some(
|
|
327
|
+
(s) => "error" in s && s.reason === "circularDependency"
|
|
326
328
|
);
|
|
327
329
|
return Z("div", { class: "flex items-center w-full gap-4" }, [
|
|
328
|
-
|
|
330
|
+
c ? Z(
|
|
329
331
|
ze.FmTooltip,
|
|
330
332
|
{ class: "text-left" },
|
|
331
333
|
{
|
|
@@ -341,7 +343,7 @@ function Nn() {
|
|
|
341
343
|
}
|
|
342
344
|
}
|
|
343
345
|
) : null,
|
|
344
|
-
|
|
346
|
+
u.name
|
|
345
347
|
]);
|
|
346
348
|
}
|
|
347
349
|
},
|
|
@@ -350,7 +352,7 @@ function Nn() {
|
|
|
350
352
|
header: () => _("inventory.ingredient.unit"),
|
|
351
353
|
accessorFn: (i) => bt(i),
|
|
352
354
|
cell(i) {
|
|
353
|
-
const
|
|
355
|
+
const u = i.row.original, a = bt(u);
|
|
354
356
|
return Z(
|
|
355
357
|
ze.FmTooltip,
|
|
356
358
|
{ zIndex: 51, content: a },
|
|
@@ -370,26 +372,26 @@ function Nn() {
|
|
|
370
372
|
accessorKey: "isInactive",
|
|
371
373
|
header: () => _("inventory.ingredient.status.title"),
|
|
372
374
|
cell(i) {
|
|
373
|
-
const
|
|
375
|
+
const u = i.row.original.isInactive;
|
|
374
376
|
return Z(
|
|
375
377
|
"span",
|
|
376
378
|
{
|
|
377
379
|
class: [
|
|
378
380
|
"inline-block px-3 py-1 rounded-full text-xs font-semibold",
|
|
379
|
-
|
|
381
|
+
u ? "bg-red-100 text-red-700" : "bg-green-100 text-green-700"
|
|
380
382
|
].join(" ")
|
|
381
383
|
},
|
|
382
|
-
_(
|
|
384
|
+
_(u ? "inventory.ingredient.status.inactive" : "inventory.ingredient.status.active")
|
|
383
385
|
);
|
|
384
386
|
},
|
|
385
387
|
enableSorting: !0
|
|
386
388
|
},
|
|
387
389
|
{
|
|
388
390
|
id: "netsuiteSubsidiary",
|
|
389
|
-
accessorFn: (i) =>
|
|
391
|
+
accessorFn: (i) => d.getSkuSubsidiaries(i._id),
|
|
390
392
|
header: () => "NetSuite Subsidiary",
|
|
391
393
|
cell(i) {
|
|
392
|
-
const
|
|
394
|
+
const u = i.row.original, { flattenedSubsidiaryNames: a } = d.getSkuSubsidiaries(u._id);
|
|
393
395
|
return Z("div", { class: "flex gap-2 items-start" }, [
|
|
394
396
|
Z(
|
|
395
397
|
"span",
|
|
@@ -398,7 +400,7 @@ function Nn() {
|
|
|
398
400
|
},
|
|
399
401
|
a.join(", ")
|
|
400
402
|
),
|
|
401
|
-
Z(
|
|
403
|
+
Z(Nn, { skuId: u._id, itemName: u.name, itemCode: u.code })
|
|
402
404
|
]);
|
|
403
405
|
},
|
|
404
406
|
enableSorting: !1,
|
|
@@ -408,10 +410,10 @@ function Nn() {
|
|
|
408
410
|
id: "action",
|
|
409
411
|
header: "",
|
|
410
412
|
cell(i) {
|
|
411
|
-
return
|
|
413
|
+
return en(
|
|
412
414
|
[yt[Pe.Edit], yt[Pe.Delete]],
|
|
413
|
-
(
|
|
414
|
-
A(
|
|
415
|
+
(u) => {
|
|
416
|
+
A(u, i.row.original);
|
|
415
417
|
}
|
|
416
418
|
);
|
|
417
419
|
},
|
|
@@ -424,16 +426,16 @@ function Nn() {
|
|
|
424
426
|
}
|
|
425
427
|
] };
|
|
426
428
|
}
|
|
427
|
-
function bt(
|
|
429
|
+
function bt(W) {
|
|
428
430
|
var h;
|
|
429
|
-
if (
|
|
430
|
-
const k = (h =
|
|
431
|
+
if (W.trackingMeasurement) {
|
|
432
|
+
const k = (h = W.unit.measurements) == null ? void 0 : h.find((d) => d.id === W.trackingMeasurement);
|
|
431
433
|
if (k)
|
|
432
434
|
return `${k.name} (${k.abbrev})`;
|
|
433
435
|
}
|
|
434
|
-
return `${
|
|
436
|
+
return `${W.unit.name} (${W.unit.abbrev})`;
|
|
435
437
|
}
|
|
436
|
-
const
|
|
438
|
+
const Ln = /* @__PURE__ */ xe({
|
|
437
439
|
__name: "ConvertForm",
|
|
438
440
|
props: {
|
|
439
441
|
modelValue: {},
|
|
@@ -442,106 +444,106 @@ const zn = /* @__PURE__ */ ke({
|
|
|
442
444
|
readonly: { type: Boolean }
|
|
443
445
|
},
|
|
444
446
|
emits: ["update:modelValue"],
|
|
445
|
-
setup(
|
|
446
|
-
const k =
|
|
447
|
-
var
|
|
448
|
-
return (
|
|
447
|
+
setup(W, { emit: h }) {
|
|
448
|
+
const k = W, d = g(() => {
|
|
449
|
+
var c;
|
|
450
|
+
return (c = k.rootValue) == null ? void 0 : c.unit;
|
|
449
451
|
}), _ = g(() => {
|
|
450
|
-
var
|
|
451
|
-
return (
|
|
452
|
-
}),
|
|
452
|
+
var c;
|
|
453
|
+
return (c = k.rootValue) == null ? void 0 : c._id;
|
|
454
|
+
}), S = h, { t: A } = pe(), U = g({
|
|
453
455
|
get() {
|
|
454
456
|
return !!k.modelValue;
|
|
455
457
|
},
|
|
456
|
-
set(
|
|
457
|
-
|
|
458
|
+
set(c) {
|
|
459
|
+
c ? S("update:modelValue", {
|
|
458
460
|
measurement: null,
|
|
459
461
|
inventoryBindings: []
|
|
460
|
-
}) :
|
|
462
|
+
}) : S("update:modelValue", null);
|
|
461
463
|
}
|
|
462
|
-
}), l = g(() =>
|
|
463
|
-
function i(
|
|
464
|
-
const
|
|
465
|
-
|
|
464
|
+
}), l = g(() => un(d.value));
|
|
465
|
+
function i(c) {
|
|
466
|
+
const s = k.modelValue ?? {};
|
|
467
|
+
s.measurement = c ? `${c}` : null, S("update:modelValue", s);
|
|
466
468
|
}
|
|
467
|
-
function
|
|
468
|
-
const
|
|
469
|
-
|
|
469
|
+
function u(c) {
|
|
470
|
+
const s = k.modelValue ?? {};
|
|
471
|
+
s.inventoryBindings = c, S("update:modelValue", s);
|
|
470
472
|
}
|
|
471
473
|
const a = g(() => {
|
|
472
474
|
if (!k.modelValue) return null;
|
|
473
|
-
const
|
|
474
|
-
return
|
|
475
|
+
const c = k.modelValue;
|
|
476
|
+
return c.measurement ? l.value.find((s) => s.value === c.measurement) ?? null : l.value.find((s) => s.value === null) ?? null;
|
|
475
477
|
});
|
|
476
|
-
return (
|
|
477
|
-
const f =
|
|
478
|
-
return
|
|
478
|
+
return (c, s) => {
|
|
479
|
+
const f = C("FmSwitch"), w = C("FmSelect"), F = C("FmCard");
|
|
480
|
+
return p(), Y(F, {
|
|
479
481
|
variant: "outlined",
|
|
480
482
|
class: "p-16 flex flex-col gap-16"
|
|
481
483
|
}, {
|
|
482
484
|
default: x(() => {
|
|
483
|
-
var
|
|
485
|
+
var m, O;
|
|
484
486
|
return [
|
|
485
|
-
|
|
487
|
+
r(f, {
|
|
486
488
|
value: "",
|
|
487
489
|
"model-value": U.value,
|
|
488
|
-
"onUpdate:modelValue":
|
|
490
|
+
"onUpdate:modelValue": s[0] || (s[0] = (R) => U.value = R),
|
|
489
491
|
label: o(A)("inventory.ingredient.convertible.title"),
|
|
490
492
|
sublabel: o(A)("inventory.ingredient.convertible.subtitle"),
|
|
491
493
|
labelPlacement: "right",
|
|
492
|
-
disabled:
|
|
494
|
+
disabled: c.readonly
|
|
493
495
|
}, null, 8, ["model-value", "label", "sublabel", "disabled"]),
|
|
494
|
-
U.value ? (
|
|
496
|
+
U.value ? (p(), V(ee, { key: 0 }, [
|
|
495
497
|
n("div", null, [
|
|
496
|
-
|
|
498
|
+
r(w, {
|
|
497
499
|
label: o(A)("inventory.ingredient.convertible.convertTo"),
|
|
498
|
-
modelValue: (
|
|
500
|
+
modelValue: (m = a.value) == null ? void 0 : m.value,
|
|
499
501
|
"onUpdate:modelValue": i,
|
|
500
502
|
items: l.value,
|
|
501
|
-
disabled:
|
|
503
|
+
disabled: c.readonly
|
|
502
504
|
}, null, 8, ["label", "modelValue", "items", "disabled"])
|
|
503
505
|
]),
|
|
504
|
-
|
|
506
|
+
r(mn, {
|
|
505
507
|
id: _.value,
|
|
506
|
-
"model-value": ((
|
|
507
|
-
"onUpdate:modelValue":
|
|
508
|
+
"model-value": ((O = c.modelValue) == null ? void 0 : O.inventoryBindings) ?? [],
|
|
509
|
+
"onUpdate:modelValue": u,
|
|
508
510
|
"exclude-binding-id": _.value,
|
|
509
|
-
rules: [o(
|
|
510
|
-
readonly:
|
|
511
|
+
rules: [o(De)(1)],
|
|
512
|
+
readonly: c.readonly,
|
|
511
513
|
"allow-recipe-decimal": ""
|
|
512
514
|
}, null, 8, ["id", "model-value", "exclude-binding-id", "rules", "readonly"])
|
|
513
|
-
], 64)) :
|
|
515
|
+
], 64)) : L("", !0)
|
|
514
516
|
];
|
|
515
517
|
}),
|
|
516
518
|
_: 1
|
|
517
519
|
});
|
|
518
520
|
};
|
|
519
521
|
}
|
|
520
|
-
}),
|
|
521
|
-
key:
|
|
522
|
+
}), jn = { class: "flex gap-8" }, Wn = { class: "flex-1" }, qn = { class: "flex-1" }, Hn = { class: "flex flex-col gap-5" }, Yn = { class: "flex flex-col gap-32" }, Kn = { class: "flex items-center gap-8" }, Gn = { class: "flex items-center gap-8" }, Jn = { class: "flex items-center gap-8" }, Qn = { class: "text-fm-color-typo-secondary" }, Xn = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Zn = {
|
|
523
|
+
key: 1,
|
|
522
524
|
class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
523
|
-
},
|
|
524
|
-
key:
|
|
525
|
+
}, eo = { class: "flex flex-col" }, to = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, no = {
|
|
526
|
+
key: 2,
|
|
525
527
|
class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
526
|
-
},
|
|
527
|
-
key:
|
|
528
|
+
}, oo = { class: "flex flex-col gap-12" }, lo = { class: "flex flex-col gap-4" }, ao = { class: "flex items-center gap-8" }, so = { class: "fm-typo-en-title-sm-600" }, ro = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, io = { class: "flex flex-col gap-4" }, uo = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, co = { class: "flex-1 p-12 flex flex-col gap-8" }, mo = { class: "mx-auto" }, po = { class: "flex flex-col" }, vo = { class: "fm-typo-en-body-sm-600 translate-y-4" }, fo = { class: "flex-1 p-12 flex flex-col gap-8" }, yo = { class: "mx-auto" }, go = { class: "flex flex-col" }, bo = { class: "fm-typo-en-body-sm-600 translate-y-4" }, ho = { class: "flex-1 p-12 flex flex-col gap-8" }, _o = { class: "mx-auto" }, xo = { class: "flex flex-col" }, ko = { class: "fm-typo-en-body-sm-600 translate-y-4" }, wo = {
|
|
529
|
+
key: 3,
|
|
528
530
|
class: "flex flex-col gap-12"
|
|
529
|
-
},
|
|
531
|
+
}, To = { class: "flex flex-col" }, Vo = { class: "flex items-center justify-between" }, Io = { class: "flex items-center gap-8" }, So = { class: "fm-typo-en-title-sm-600" }, Co = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Fo = {
|
|
530
532
|
key: 0,
|
|
531
533
|
class: "flex flex-col gap-8"
|
|
532
|
-
},
|
|
533
|
-
key:
|
|
534
|
+
}, Ao = { class: "flex flex-wrap gap-8" }, Eo = {
|
|
535
|
+
key: 4,
|
|
534
536
|
class: "flex flex-col gap-12"
|
|
535
|
-
},
|
|
537
|
+
}, $o = { class: "flex flex-col" }, Mo = { class: "flex items-center justify-between" }, Uo = { class: "flex items-center gap-8" }, Po = { class: "fm-typo-en-title-sm-600" }, Ro = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Do = {
|
|
536
538
|
key: 0,
|
|
537
539
|
class: "flex flex-col gap-8"
|
|
538
|
-
},
|
|
539
|
-
key:
|
|
540
|
+
}, Oo = { class: "flex flex-wrap gap-8" }, Bo = {
|
|
541
|
+
key: 5,
|
|
540
542
|
class: "flex flex-col gap-12"
|
|
541
|
-
},
|
|
543
|
+
}, No = { class: "flex flex-col" }, zo = { class: "flex items-center justify-between" }, Lo = { class: "flex items-center gap-8" }, jo = { class: "fm-typo-en-title-sm-600" }, Wo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, qo = {
|
|
542
544
|
key: 0,
|
|
543
545
|
class: "flex flex-col gap-8"
|
|
544
|
-
},
|
|
546
|
+
}, Ho = { class: "flex flex-wrap gap-8" }, Yo = /* @__PURE__ */ xe({
|
|
545
547
|
__name: "IngredientForm",
|
|
546
548
|
props: /* @__PURE__ */ st({
|
|
547
549
|
mode: {},
|
|
@@ -555,41 +557,41 @@ const zn = /* @__PURE__ */ ke({
|
|
|
555
557
|
searchModifiers: {}
|
|
556
558
|
}),
|
|
557
559
|
emits: /* @__PURE__ */ st(["update:modelValue", "click:submit", "update:purchaseOrderTemplateIds", "update:wastageTemplateIds", "update:closingTemplateIds"], ["update:search"]),
|
|
558
|
-
setup(
|
|
560
|
+
setup(W, { expose: h, emit: k }) {
|
|
559
561
|
var Xe;
|
|
560
|
-
const { t:
|
|
562
|
+
const { t: d } = pe(), _ = Ke();
|
|
561
563
|
Ae();
|
|
562
|
-
const
|
|
564
|
+
const S = Vt(), A = It(), U = St(), l = W, i = k, u = Fe(), a = Ge(), c = Tt(), s = Ee(), f = g(() => s.isEnabled);
|
|
563
565
|
P(void 0);
|
|
564
|
-
const w = P([]), F = P([]),
|
|
566
|
+
const w = P([]), F = P([]), m = P([]), O = P(!1);
|
|
565
567
|
function R(e) {
|
|
566
568
|
if (e.length === 0) return;
|
|
567
569
|
const t = e[0], b = l.modelValue ?? {
|
|
568
|
-
unit:
|
|
570
|
+
unit: u.units.find((I) => I)
|
|
569
571
|
};
|
|
570
572
|
b.unit || (b.unit = t, i("update:modelValue", b));
|
|
571
573
|
}
|
|
572
|
-
|
|
573
|
-
R(
|
|
574
|
-
}), _t([() =>
|
|
574
|
+
Dt(() => {
|
|
575
|
+
R(u.units), l.mode === j.CREATE && (c.mustUsePoTemplate && ne(), c.enableWastageTemplate && ue(), c.enableClosingTemplate && oe());
|
|
576
|
+
}), _t([() => u.units], ([e]) => {
|
|
575
577
|
R(e);
|
|
576
578
|
});
|
|
577
579
|
function ve() {
|
|
578
580
|
i("click:submit");
|
|
579
581
|
}
|
|
580
582
|
async function ne() {
|
|
581
|
-
w.value = [],
|
|
583
|
+
w.value = [], O.value = !0;
|
|
582
584
|
try {
|
|
583
|
-
const [e] = await Promise.all([
|
|
585
|
+
const [e] = await Promise.all([S.readTemplates()]).delayed(1e3);
|
|
584
586
|
w.value = e;
|
|
585
587
|
} catch (e) {
|
|
586
588
|
console.log("Something went wrong when fetching templates:", e);
|
|
587
589
|
} finally {
|
|
588
|
-
|
|
590
|
+
O.value = !1;
|
|
589
591
|
}
|
|
590
592
|
}
|
|
591
593
|
async function ue() {
|
|
592
|
-
F.value = [],
|
|
594
|
+
F.value = [], O.value = !0;
|
|
593
595
|
try {
|
|
594
596
|
const [e] = await Promise.all([A.readTemplates()]).delayed(
|
|
595
597
|
1e3
|
|
@@ -598,20 +600,20 @@ const zn = /* @__PURE__ */ ke({
|
|
|
598
600
|
} catch (e) {
|
|
599
601
|
console.log("Something went wrong when fetching wastage templates:", e);
|
|
600
602
|
} finally {
|
|
601
|
-
|
|
603
|
+
O.value = !1;
|
|
602
604
|
}
|
|
603
605
|
}
|
|
604
606
|
async function oe() {
|
|
605
|
-
|
|
607
|
+
m.value = [], O.value = !0;
|
|
606
608
|
try {
|
|
607
609
|
const [e] = await Promise.all([U.listTemplates()]).delayed(
|
|
608
610
|
1e3
|
|
609
611
|
);
|
|
610
|
-
|
|
612
|
+
m.value = e;
|
|
611
613
|
} catch (e) {
|
|
612
614
|
console.log("Something went wrong when fetching closing templates:", e);
|
|
613
615
|
} finally {
|
|
614
|
-
|
|
616
|
+
O.value = !1;
|
|
615
617
|
}
|
|
616
618
|
}
|
|
617
619
|
const le = g({
|
|
@@ -651,10 +653,10 @@ const zn = /* @__PURE__ */ ke({
|
|
|
651
653
|
get() {
|
|
652
654
|
var t, b;
|
|
653
655
|
const e = (b = (t = l.modelValue) == null ? void 0 : t.defaultCost) == null ? void 0 : b.costPerUnit;
|
|
654
|
-
return e ? +
|
|
656
|
+
return e ? +an(e) : 0;
|
|
655
657
|
},
|
|
656
658
|
set(e) {
|
|
657
|
-
var b, I,
|
|
659
|
+
var b, I, H, B;
|
|
658
660
|
const t = l.modelValue ? {
|
|
659
661
|
...l.modelValue
|
|
660
662
|
} : {};
|
|
@@ -664,7 +666,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
664
666
|
precision: 2,
|
|
665
667
|
currency: ((b = dt(a.currentCountry.value)) == null ? void 0 : b.currency) ?? "MYR"
|
|
666
668
|
},
|
|
667
|
-
measurement: (
|
|
669
|
+
measurement: (B = (H = (I = l.modelValue) == null ? void 0 : I.unit) == null ? void 0 : H.measurements) == null ? void 0 : B.find(
|
|
668
670
|
(se) => {
|
|
669
671
|
var re;
|
|
670
672
|
return se.id === ((re = l.modelValue) == null ? void 0 : re.trackingMeasurement);
|
|
@@ -672,22 +674,22 @@ const zn = /* @__PURE__ */ ke({
|
|
|
672
674
|
)
|
|
673
675
|
}), t.defaultCost.costPerUnit = {
|
|
674
676
|
...t.defaultCost.costPerUnit,
|
|
675
|
-
...
|
|
677
|
+
...ln(+e, 4)
|
|
676
678
|
}, i("update:modelValue", t);
|
|
677
679
|
}
|
|
678
680
|
}), ye = g(() => {
|
|
679
681
|
var t, b, I;
|
|
680
|
-
const e = ((t = l.modelValue) == null ? void 0 : t.unit) ??
|
|
682
|
+
const e = ((t = l.modelValue) == null ? void 0 : t.unit) ?? u.units.find((H) => H);
|
|
681
683
|
return e ? {
|
|
682
684
|
_id: e._id,
|
|
683
685
|
measurement: (b = l.modelValue) == null ? void 0 : b.trackingMeasurement,
|
|
684
|
-
name: ((I = e.measurements.find((
|
|
685
|
-
var
|
|
686
|
-
return
|
|
686
|
+
name: ((I = e.measurements.find((H) => {
|
|
687
|
+
var B;
|
|
688
|
+
return H.id === ((B = l.modelValue) == null ? void 0 : B.trackingMeasurement);
|
|
687
689
|
})) == null ? void 0 : I.name) ?? e.name
|
|
688
690
|
} : null;
|
|
689
691
|
}), we = g(
|
|
690
|
-
() =>
|
|
692
|
+
() => u.units.flatMap(({ name: e, _id: t, abbrev: b, measurements: I }) => [
|
|
691
693
|
{
|
|
692
694
|
label: `${e}`,
|
|
693
695
|
value: null,
|
|
@@ -698,41 +700,41 @@ const zn = /* @__PURE__ */ ke({
|
|
|
698
700
|
value: { _id: t },
|
|
699
701
|
displayAsSection: !1
|
|
700
702
|
},
|
|
701
|
-
...I.map(({ id:
|
|
702
|
-
label: `${
|
|
703
|
-
value: { _id: t, measurement:
|
|
703
|
+
...I.map(({ id: H, name: B, abbrev: se }) => ({
|
|
704
|
+
label: `${B} (${se})`,
|
|
705
|
+
value: { _id: t, measurement: H },
|
|
704
706
|
displayAsSection: !1
|
|
705
707
|
}))
|
|
706
708
|
])
|
|
707
|
-
), y =
|
|
708
|
-
() => new
|
|
709
|
+
), y = Ot(W, "search"), M = g(
|
|
710
|
+
() => new bn(we.value, ["label", "value"], {
|
|
709
711
|
caseSensitive: !1,
|
|
710
712
|
sort: !0
|
|
711
713
|
})
|
|
712
714
|
), G = g(() => M.value.search(y.value));
|
|
713
715
|
function E(e) {
|
|
714
|
-
var t, b, I,
|
|
715
|
-
return ((b = (t = l.modelValue) == null ? void 0 : t.unit) == null ? void 0 : b._id) === ((I = e.value) == null ? void 0 : I._id) && ((
|
|
716
|
+
var t, b, I, H, B;
|
|
717
|
+
return ((b = (t = l.modelValue) == null ? void 0 : t.unit) == null ? void 0 : b._id) === ((I = e.value) == null ? void 0 : I._id) && ((H = l.modelValue) == null ? void 0 : H.trackingMeasurement) === ((B = e.value) == null ? void 0 : B.measurement);
|
|
716
718
|
}
|
|
717
719
|
function v(e) {
|
|
718
720
|
var se, re;
|
|
719
721
|
if (!e) return;
|
|
720
|
-
const { _id: t, measurement: b } = e, I = b || void 0,
|
|
721
|
-
if (!
|
|
722
|
+
const { _id: t, measurement: b } = e, I = b || void 0, H = u.units.find((Se) => Se._id === t);
|
|
723
|
+
if (!H)
|
|
722
724
|
return;
|
|
723
|
-
const
|
|
724
|
-
|
|
725
|
-
measurement:
|
|
725
|
+
const B = l.modelValue ?? {};
|
|
726
|
+
B.unit = H, B.trackingMeasurement = I, B.convert && (B.convert.measurement = I || null), B.defaultCost = {
|
|
727
|
+
measurement: H.measurements.find((Se) => Se.id === I),
|
|
726
728
|
costPerUnit: {
|
|
727
|
-
...((se =
|
|
729
|
+
...((se = B.defaultCost) == null ? void 0 : se.costPerUnit) ?? {
|
|
728
730
|
amount: 0,
|
|
729
731
|
precision: 2,
|
|
730
732
|
currency: ((re = dt(a.currentCountry.value)) == null ? void 0 : re.currency) ?? "MYR"
|
|
731
733
|
}
|
|
732
734
|
}
|
|
733
|
-
}
|
|
735
|
+
}, i("update:modelValue", B);
|
|
734
736
|
}
|
|
735
|
-
const
|
|
737
|
+
const N = g({
|
|
736
738
|
get() {
|
|
737
739
|
var e;
|
|
738
740
|
return ((e = l.modelValue) == null ? void 0 : e.convert) ?? null;
|
|
@@ -749,9 +751,9 @@ const zn = /* @__PURE__ */ ke({
|
|
|
749
751
|
e === ut.enum.WAVG
|
|
750
752
|
)
|
|
751
753
|
).map((e) => ({
|
|
752
|
-
label:
|
|
754
|
+
label: d(`inventory.ingredient.valuationMethod.${e}`),
|
|
753
755
|
value: e
|
|
754
|
-
}))),
|
|
756
|
+
}))), ce = g({
|
|
755
757
|
get() {
|
|
756
758
|
var e;
|
|
757
759
|
return ((e = l.modelValue) == null ? void 0 : e.valuation) ?? "WAVG";
|
|
@@ -773,42 +775,42 @@ const zn = /* @__PURE__ */ ke({
|
|
|
773
775
|
} : {};
|
|
774
776
|
t.customAttributes = e, i("update:modelValue", t);
|
|
775
777
|
}
|
|
776
|
-
}),
|
|
778
|
+
}), q = P();
|
|
777
779
|
h({
|
|
778
780
|
validateInputs: () => {
|
|
779
781
|
var e, t;
|
|
780
|
-
(t = (e =
|
|
782
|
+
(t = (e = q.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
|
|
781
783
|
},
|
|
782
784
|
resetInputsValidation: () => {
|
|
783
785
|
var e, t;
|
|
784
|
-
(t = (e =
|
|
786
|
+
(t = (e = q.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
|
|
785
787
|
},
|
|
786
788
|
resetInputs: () => {
|
|
787
789
|
var e, t;
|
|
788
|
-
(t = (e =
|
|
790
|
+
(t = (e = q.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
|
|
789
791
|
}
|
|
790
792
|
});
|
|
791
|
-
const
|
|
793
|
+
const D = P(!1), K = g(
|
|
792
794
|
() => {
|
|
793
795
|
var e, t, b;
|
|
794
|
-
return (e = l.modelValue) != null && e._id ? ((b =
|
|
796
|
+
return (e = l.modelValue) != null && e._id ? ((b = u.menu.bindedBySkuId[(t = l.modelValue) == null ? void 0 : t._id]) == null ? void 0 : b.filter(
|
|
795
797
|
(I) => I.from === "INGREDIENT"
|
|
796
798
|
)) ?? [] : [];
|
|
797
799
|
}
|
|
798
|
-
),
|
|
800
|
+
), z = g(
|
|
799
801
|
() => {
|
|
800
802
|
var e, t, b;
|
|
801
|
-
return (e = l.modelValue) != null && e._id ? ((b =
|
|
803
|
+
return (e = l.modelValue) != null && e._id ? ((b = u.menu.bindedBySkuId[(t = l.modelValue) == null ? void 0 : t._id]) == null ? void 0 : b.filter(
|
|
802
804
|
(I) => I.from === "RECIPE"
|
|
803
805
|
)) ?? [] : [];
|
|
804
806
|
}
|
|
805
807
|
), ge = g(
|
|
806
808
|
() => {
|
|
807
809
|
var e, t, b;
|
|
808
|
-
return (e = l.modelValue) != null && e._id ? ((b =
|
|
810
|
+
return (e = l.modelValue) != null && e._id ? ((b = u.menu.bindedBySkuId[(t = l.modelValue) == null ? void 0 : t._id]) == null ? void 0 : b.filter((I) => I.from === "MENU")) ?? [] : [];
|
|
809
811
|
}
|
|
810
812
|
), $e = g(
|
|
811
|
-
() =>
|
|
813
|
+
() => u.skus.map((e) => ({ label: e.name, value: e.code }))
|
|
812
814
|
), Me = P((Xe = l.modelValue) == null ? void 0 : Xe.code);
|
|
813
815
|
function Ue(e) {
|
|
814
816
|
var b;
|
|
@@ -817,13 +819,13 @@ const zn = /* @__PURE__ */ ke({
|
|
|
817
819
|
}
|
|
818
820
|
const be = g(
|
|
819
821
|
() => {
|
|
820
|
-
var e, t, b, I,
|
|
822
|
+
var e, t, b, I, H, B;
|
|
821
823
|
return ((I = (b = (t = (e = l.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : b.find(
|
|
822
824
|
(se) => {
|
|
823
825
|
var re;
|
|
824
826
|
return se.id === ((re = l.modelValue) == null ? void 0 : re.trackingMeasurement);
|
|
825
827
|
}
|
|
826
|
-
)) == null ? void 0 : I.abbrev) ?? ((
|
|
828
|
+
)) == null ? void 0 : I.abbrev) ?? ((B = (H = l.modelValue) == null ? void 0 : H.unit) == null ? void 0 : B.abbrev);
|
|
827
829
|
}
|
|
828
830
|
), he = g({
|
|
829
831
|
get() {
|
|
@@ -839,7 +841,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
839
841
|
} : {};
|
|
840
842
|
b.thresholds = t, i("update:modelValue", b);
|
|
841
843
|
}
|
|
842
|
-
}),
|
|
844
|
+
}), me = g({
|
|
843
845
|
get() {
|
|
844
846
|
var e, t;
|
|
845
847
|
return ((t = (e = l.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ?? Re().mid;
|
|
@@ -853,17 +855,17 @@ const zn = /* @__PURE__ */ ke({
|
|
|
853
855
|
} : {};
|
|
854
856
|
b.thresholds = t, i("update:modelValue", b);
|
|
855
857
|
}
|
|
856
|
-
}), Te = g(() =>
|
|
858
|
+
}), Te = g(() => c.mustUsePoTemplate && l.mode === j.CREATE && w.value.length > 0 ? w.value.map((e) => ({
|
|
857
859
|
label: e.name || "Template",
|
|
858
860
|
value: e._id || "template_" + e.name
|
|
859
861
|
})) : []), Ve = g(() => Te.value.filter(
|
|
860
862
|
(e) => (l.purchaseOrderTemplateIds ?? []).includes(e.value)
|
|
861
|
-
)), _e = g(() =>
|
|
863
|
+
)), _e = g(() => c.enableWastageTemplate && l.mode === j.CREATE && F.value.length > 0 ? F.value.map((e) => ({
|
|
862
864
|
label: e.name || "Template",
|
|
863
865
|
value: e._id || "template_" + e.name
|
|
864
866
|
})) : []), Ie = g(() => _e.value.filter(
|
|
865
867
|
(e) => (l.wastageTemplateIds ?? []).includes(e.value)
|
|
866
|
-
)), Je = g(() =>
|
|
868
|
+
)), Je = g(() => c.enableClosingTemplate && l.mode === j.CREATE && m.value.length > 0 ? m.value.map((e) => ({
|
|
867
869
|
label: e.name || "Template",
|
|
868
870
|
value: e._id || "template_" + e.name
|
|
869
871
|
})) : []), Qe = g(() => Je.value.filter(
|
|
@@ -871,7 +873,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
871
873
|
));
|
|
872
874
|
function Ct() {
|
|
873
875
|
_.open({
|
|
874
|
-
title:
|
|
876
|
+
title: d("inventory.ingredient.purchaseOrderTemplates.selectTitle"),
|
|
875
877
|
closeButton: !0,
|
|
876
878
|
contentComponent: He,
|
|
877
879
|
contentComponentProps: {
|
|
@@ -879,11 +881,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
879
881
|
items: Te.value
|
|
880
882
|
},
|
|
881
883
|
primaryActions: {
|
|
882
|
-
text:
|
|
884
|
+
text: d("common.confirm"),
|
|
883
885
|
close: !0
|
|
884
886
|
},
|
|
885
887
|
secondaryActions: {
|
|
886
|
-
text:
|
|
888
|
+
text: d("common.cancel"),
|
|
887
889
|
close: !0,
|
|
888
890
|
variant: "tertiary"
|
|
889
891
|
}
|
|
@@ -893,7 +895,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
893
895
|
}
|
|
894
896
|
function Ft() {
|
|
895
897
|
_.open({
|
|
896
|
-
title:
|
|
898
|
+
title: d("inventory.ingredient.wastageTemplates.selectTitle"),
|
|
897
899
|
closeButton: !0,
|
|
898
900
|
contentComponent: He,
|
|
899
901
|
contentComponentProps: {
|
|
@@ -901,11 +903,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
901
903
|
items: _e.value
|
|
902
904
|
},
|
|
903
905
|
primaryActions: {
|
|
904
|
-
text:
|
|
906
|
+
text: d("common.confirm"),
|
|
905
907
|
close: !0
|
|
906
908
|
},
|
|
907
909
|
secondaryActions: {
|
|
908
|
-
text:
|
|
910
|
+
text: d("common.cancel"),
|
|
909
911
|
close: !0,
|
|
910
912
|
variant: "tertiary"
|
|
911
913
|
}
|
|
@@ -915,7 +917,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
915
917
|
}
|
|
916
918
|
function At() {
|
|
917
919
|
_.open({
|
|
918
|
-
title:
|
|
920
|
+
title: d("inventory.ingredient.closingTemplates.selectTitle"),
|
|
919
921
|
closeButton: !0,
|
|
920
922
|
contentComponent: He,
|
|
921
923
|
contentComponentProps: {
|
|
@@ -923,11 +925,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
923
925
|
items: Je.value
|
|
924
926
|
},
|
|
925
927
|
primaryActions: {
|
|
926
|
-
text:
|
|
928
|
+
text: d("common.confirm"),
|
|
927
929
|
close: !0
|
|
928
930
|
},
|
|
929
931
|
secondaryActions: {
|
|
930
|
-
text:
|
|
932
|
+
text: d("common.cancel"),
|
|
931
933
|
close: !0,
|
|
932
934
|
variant: "tertiary"
|
|
933
935
|
}
|
|
@@ -941,53 +943,53 @@ const zn = /* @__PURE__ */ ke({
|
|
|
941
943
|
};
|
|
942
944
|
}
|
|
943
945
|
return (e, t) => {
|
|
944
|
-
const b =
|
|
945
|
-
return
|
|
946
|
+
const b = C("FmTextField"), I = C("FmLabel"), H = C("FmField"), B = C("FmIcon"), se = C("FmMenuHeader"), re = C("FmMenuDivider"), Se = C("FmMenuItem"), $t = C("FmMenu"), Ze = C("FmFormGroup"), Mt = C("FmSelect"), et = C("FmSwitch"), tt = C("FmStepperField"), Be = C("FmButton"), Ne = C("FmChip"), Ut = C("FmForm");
|
|
947
|
+
return p(), Y(Ut, {
|
|
946
948
|
disabled: e.disabled,
|
|
947
949
|
ref_key: "formRef",
|
|
948
|
-
ref:
|
|
950
|
+
ref: q,
|
|
949
951
|
class: "flex flex-col gap-32",
|
|
950
952
|
onValidationSuccess: ve
|
|
951
953
|
}, {
|
|
952
954
|
default: x(() => {
|
|
953
955
|
var nt, ot, lt, at;
|
|
954
956
|
return [
|
|
955
|
-
n("div",
|
|
956
|
-
n("div",
|
|
957
|
-
|
|
957
|
+
n("div", jn, [
|
|
958
|
+
n("div", Wn, [
|
|
959
|
+
r(Ce, {
|
|
958
960
|
"tooltip-message": "This field is managed by NetSuite",
|
|
959
961
|
"tooltip-z-index": 50,
|
|
960
|
-
label: o(
|
|
962
|
+
label: o(d)("inventory.ingredient.code"),
|
|
961
963
|
"model-value": le.value,
|
|
962
964
|
"onUpdate:modelValue": t[1] || (t[1] = (T) => le.value = T),
|
|
963
965
|
locked: f.value,
|
|
964
966
|
disabled: e.disabled
|
|
965
967
|
}, {
|
|
966
968
|
default: x(() => [
|
|
967
|
-
|
|
968
|
-
label: o(
|
|
969
|
+
r(b, {
|
|
970
|
+
label: o(d)("inventory.ingredient.code"),
|
|
969
971
|
"model-value": le.value,
|
|
970
972
|
"onUpdate:modelValue": t[0] || (t[0] = (T) => le.value = T),
|
|
971
|
-
rules: [o(Le)(), o(
|
|
973
|
+
rules: [o(Le)(), o(sn)($e.value, Me.value)],
|
|
972
974
|
"label-mark": "required"
|
|
973
975
|
}, null, 8, ["label", "model-value", "rules"])
|
|
974
976
|
]),
|
|
975
977
|
_: 1
|
|
976
978
|
}, 8, ["label", "model-value", "locked", "disabled"])
|
|
977
979
|
]),
|
|
978
|
-
n("div",
|
|
979
|
-
|
|
980
|
+
n("div", qn, [
|
|
981
|
+
r(Ce, {
|
|
980
982
|
"tooltip-message": "This field is managed by NetSuite",
|
|
981
983
|
"tooltip-z-index": 50,
|
|
982
|
-
label: o(
|
|
984
|
+
label: o(d)("inventory.ingredient.name"),
|
|
983
985
|
"model-value": ae.value,
|
|
984
986
|
"onUpdate:modelValue": t[3] || (t[3] = (T) => ae.value = T),
|
|
985
987
|
locked: f.value,
|
|
986
988
|
disabled: e.disabled
|
|
987
989
|
}, {
|
|
988
990
|
default: x(() => [
|
|
989
|
-
|
|
990
|
-
label: o(
|
|
991
|
+
r(b, {
|
|
992
|
+
label: o(d)("inventory.ingredient.name"),
|
|
991
993
|
"model-value": ae.value,
|
|
992
994
|
"onUpdate:modelValue": t[2] || (t[2] = (T) => ae.value = T),
|
|
993
995
|
rules: [o(Le)()],
|
|
@@ -998,30 +1000,30 @@ const zn = /* @__PURE__ */ ke({
|
|
|
998
1000
|
}, 8, ["label", "model-value", "locked", "disabled"])
|
|
999
1001
|
])
|
|
1000
1002
|
]),
|
|
1001
|
-
|
|
1003
|
+
r(Ce, {
|
|
1002
1004
|
"tooltip-message": "This field is managed by NetSuite",
|
|
1003
1005
|
"tooltip-z-index": 50,
|
|
1004
|
-
label: o(
|
|
1006
|
+
label: o(d)("inventory.ingredient.unit"),
|
|
1005
1007
|
"helper-text": (nt = e.modelValue) != null && nt.trackingMeasurement ? `Base unit: ${(lt = (ot = e.modelValue) == null ? void 0 : ot.unit) == null ? void 0 : lt.name}` : void 0,
|
|
1006
1008
|
"model-value": (at = ye.value) == null ? void 0 : at.name,
|
|
1007
1009
|
locked: f.value,
|
|
1008
1010
|
disabled: e.disabled
|
|
1009
1011
|
}, {
|
|
1010
1012
|
default: x(() => [
|
|
1011
|
-
|
|
1013
|
+
r(Ze, {
|
|
1012
1014
|
"model-value": ye.value,
|
|
1013
1015
|
rules: [o(Le)()],
|
|
1014
1016
|
"label-mark": "required"
|
|
1015
1017
|
}, {
|
|
1016
1018
|
label: x(() => [
|
|
1017
|
-
|
|
1018
|
-
label: o(
|
|
1019
|
+
r(I, {
|
|
1020
|
+
label: o(d)("inventory.ingredient.unit")
|
|
1019
1021
|
}, null, 8, ["label"])
|
|
1020
1022
|
]),
|
|
1021
1023
|
default: x(({ invalid: T }) => [
|
|
1022
|
-
|
|
1024
|
+
r($t, null, {
|
|
1023
1025
|
"menu-button": x(() => [
|
|
1024
|
-
|
|
1026
|
+
r(H, {
|
|
1025
1027
|
class: ie([
|
|
1026
1028
|
"fm-typo-en-body-lg-400",
|
|
1027
1029
|
{
|
|
@@ -1042,14 +1044,14 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1042
1044
|
}, 1032, ["class", "invalid"])
|
|
1043
1045
|
]),
|
|
1044
1046
|
default: x(() => [
|
|
1045
|
-
n("div",
|
|
1046
|
-
|
|
1047
|
+
n("div", Hn, [
|
|
1048
|
+
r(b, {
|
|
1047
1049
|
modelValue: y.value,
|
|
1048
1050
|
"onUpdate:modelValue": t[4] || (t[4] = (X) => y.value = X),
|
|
1049
1051
|
placeholder: "Filter options"
|
|
1050
1052
|
}, {
|
|
1051
1053
|
prepend: x(() => [
|
|
1052
|
-
|
|
1054
|
+
r(B, { name: "search" })
|
|
1053
1055
|
]),
|
|
1054
1056
|
_: 1
|
|
1055
1057
|
}, 8, ["modelValue"]),
|
|
@@ -1057,17 +1059,17 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1057
1059
|
class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
|
|
1058
1060
|
onVnodeMounted: Ue
|
|
1059
1061
|
}, [
|
|
1060
|
-
(
|
|
1061
|
-
X.displayAsSection ? (
|
|
1062
|
-
|
|
1062
|
+
(p(!0), V(ee, null, de(G.value, (X, Pt) => (p(), V(ee, { key: Pt }, [
|
|
1063
|
+
X.displayAsSection ? (p(), V(ee, { key: 0 }, [
|
|
1064
|
+
r(se, {
|
|
1063
1065
|
label: X.label
|
|
1064
1066
|
}, null, 8, ["label"]),
|
|
1065
|
-
|
|
1066
|
-
], 64)) : (
|
|
1067
|
+
r(re)
|
|
1068
|
+
], 64)) : (p(), Y(Se, {
|
|
1067
1069
|
key: 1,
|
|
1068
1070
|
label: X.label,
|
|
1069
1071
|
"model-value": E(X),
|
|
1070
|
-
onClick: (
|
|
1072
|
+
onClick: (bl) => v(X.value),
|
|
1071
1073
|
"x-should-scroll-into": `${E(X)}`
|
|
1072
1074
|
}, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
|
|
1073
1075
|
], 64))), 128))
|
|
@@ -1082,165 +1084,160 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1082
1084
|
]),
|
|
1083
1085
|
_: 1
|
|
1084
1086
|
}, 8, ["label", "helper-text", "model-value", "locked", "disabled"]),
|
|
1085
|
-
|
|
1087
|
+
n("div", Yn, [
|
|
1088
|
+
r(Ce, {
|
|
1089
|
+
"tooltip-message": "This field is managed by NetSuite",
|
|
1090
|
+
"tooltip-z-index": 50,
|
|
1091
|
+
label: o(d)("inventory.ingredient.valuationMethod.title"),
|
|
1092
|
+
"model-value": o(d)("inventory.ingredient.valuationMethod." + ce.value),
|
|
1093
|
+
locked: f.value,
|
|
1094
|
+
disabled: e.disabled
|
|
1095
|
+
}, {
|
|
1096
|
+
label: x(() => [
|
|
1097
|
+
n("div", Kn, [
|
|
1098
|
+
r(I, {
|
|
1099
|
+
label: o(d)("inventory.ingredient.valuationMethod.title")
|
|
1100
|
+
}, null, 8, ["label"]),
|
|
1101
|
+
r(ke, {
|
|
1102
|
+
tier: "premium",
|
|
1103
|
+
category: "premium",
|
|
1104
|
+
"feature-key": "total-cost"
|
|
1105
|
+
})
|
|
1106
|
+
])
|
|
1107
|
+
]),
|
|
1108
|
+
default: x(() => [
|
|
1109
|
+
r(Mt, {
|
|
1110
|
+
class: "col-span-2",
|
|
1111
|
+
label: o(d)("inventory.ingredient.valuationMethod.title"),
|
|
1112
|
+
"model-value": ce.value,
|
|
1113
|
+
"onUpdate:modelValue": t[5] || (t[5] = (T) => ce.value = T),
|
|
1114
|
+
items: J.value
|
|
1115
|
+
}, null, 8, ["label", "model-value", "items"])
|
|
1116
|
+
]),
|
|
1117
|
+
_: 1
|
|
1118
|
+
}, 8, ["label", "model-value", "locked", "disabled"]),
|
|
1119
|
+
r(Ce, {
|
|
1120
|
+
"tooltip-message": "This field is managed by NetSuite",
|
|
1121
|
+
"tooltip-z-index": 50,
|
|
1122
|
+
"model-value": `${o(jt)()} ${fe.value}`,
|
|
1123
|
+
locked: f.value,
|
|
1124
|
+
"append-text": `/ ${be.value}`,
|
|
1125
|
+
disabled: e.disabled
|
|
1126
|
+
}, {
|
|
1127
|
+
label: x(() => [
|
|
1128
|
+
n("div", Gn, [
|
|
1129
|
+
r(I, {
|
|
1130
|
+
label: o(d)("inventory.ingredient.pricePerUnit")
|
|
1131
|
+
}, null, 8, ["label"]),
|
|
1132
|
+
r(ke, {
|
|
1133
|
+
tier: "premium",
|
|
1134
|
+
category: "premium",
|
|
1135
|
+
"feature-key": "total-cost"
|
|
1136
|
+
})
|
|
1137
|
+
])
|
|
1138
|
+
]),
|
|
1139
|
+
default: x(() => [
|
|
1140
|
+
r(b, {
|
|
1141
|
+
"model-value": fe.value,
|
|
1142
|
+
"onUpdate:modelValue": t[6] || (t[6] = (T) => fe.value = T),
|
|
1143
|
+
rules: [o(De)(0), o(rn)(4)]
|
|
1144
|
+
}, {
|
|
1145
|
+
label: x(() => [
|
|
1146
|
+
n("div", Jn, [
|
|
1147
|
+
r(I, {
|
|
1148
|
+
label: o(d)("inventory.ingredient.pricePerUnit")
|
|
1149
|
+
}, null, 8, ["label"])
|
|
1150
|
+
])
|
|
1151
|
+
]),
|
|
1152
|
+
prepend: x(() => {
|
|
1153
|
+
var T, X;
|
|
1154
|
+
return [
|
|
1155
|
+
n("div", Qn, $(o(ct)(((T = o(a).currentCountry) == null ? void 0 : T.value) ?? o(mt)) === "MYR" ? "RM" : o(ct)(((X = o(a).currentCountry) == null ? void 0 : X.value) ?? o(mt))), 1)
|
|
1156
|
+
];
|
|
1157
|
+
}),
|
|
1158
|
+
append: x(() => [
|
|
1159
|
+
n("div", Xn, " / " + $(be.value), 1)
|
|
1160
|
+
]),
|
|
1161
|
+
_: 1
|
|
1162
|
+
}, 8, ["model-value", "rules"])
|
|
1163
|
+
]),
|
|
1164
|
+
_: 1
|
|
1165
|
+
}, 8, ["model-value", "locked", "append-text", "disabled"])
|
|
1166
|
+
]),
|
|
1167
|
+
!f.value || N.value ? (p(), Y(Ln, {
|
|
1086
1168
|
key: 0,
|
|
1087
|
-
"
|
|
1088
|
-
"
|
|
1089
|
-
label: o(u)("inventory.ingredient.valuationMethod.title"),
|
|
1090
|
-
"model-value": o(u)("inventory.ingredient.valuationMethod." + me.value),
|
|
1091
|
-
locked: f.value,
|
|
1092
|
-
disabled: e.disabled
|
|
1093
|
-
}, {
|
|
1094
|
-
label: x(() => [
|
|
1095
|
-
n("div", Hn, [
|
|
1096
|
-
s(I, {
|
|
1097
|
-
label: o(u)("inventory.ingredient.valuationMethod.title")
|
|
1098
|
-
}, null, 8, ["label"]),
|
|
1099
|
-
s(xe, {
|
|
1100
|
-
tier: "premium",
|
|
1101
|
-
category: "premium",
|
|
1102
|
-
"feature-key": "total-cost"
|
|
1103
|
-
})
|
|
1104
|
-
])
|
|
1105
|
-
]),
|
|
1106
|
-
default: x(() => [
|
|
1107
|
-
s(Mt, {
|
|
1108
|
-
class: "col-span-2",
|
|
1109
|
-
label: o(u)("inventory.ingredient.valuationMethod.title"),
|
|
1110
|
-
"model-value": me.value,
|
|
1111
|
-
"onUpdate:modelValue": t[5] || (t[5] = (T) => me.value = T),
|
|
1112
|
-
items: J.value
|
|
1113
|
-
}, null, 8, ["label", "model-value", "items"])
|
|
1114
|
-
]),
|
|
1115
|
-
_: 1
|
|
1116
|
-
}, 8, ["label", "model-value", "locked", "disabled"])) : N("", !0),
|
|
1117
|
-
o(d).enableTotalCost ? (c(), j(Ce, {
|
|
1118
|
-
key: 1,
|
|
1119
|
-
"tooltip-message": "This field is managed by NetSuite",
|
|
1120
|
-
"tooltip-z-index": 50,
|
|
1121
|
-
"model-value": `${o(jt)()} ${fe.value}`,
|
|
1122
|
-
locked: f.value,
|
|
1123
|
-
"append-text": `/ ${be.value}`,
|
|
1124
|
-
disabled: e.disabled
|
|
1125
|
-
}, {
|
|
1126
|
-
label: x(() => [
|
|
1127
|
-
n("div", Yn, [
|
|
1128
|
-
s(I, {
|
|
1129
|
-
label: o(u)("inventory.ingredient.pricePerUnit")
|
|
1130
|
-
}, null, 8, ["label"]),
|
|
1131
|
-
s(xe, {
|
|
1132
|
-
tier: "premium",
|
|
1133
|
-
category: "premium",
|
|
1134
|
-
"feature-key": "total-cost"
|
|
1135
|
-
})
|
|
1136
|
-
])
|
|
1137
|
-
]),
|
|
1138
|
-
default: x(() => [
|
|
1139
|
-
s(b, {
|
|
1140
|
-
"model-value": fe.value,
|
|
1141
|
-
"onUpdate:modelValue": t[6] || (t[6] = (T) => fe.value = T),
|
|
1142
|
-
rules: [o(Oe)(0), o(ln)(4)]
|
|
1143
|
-
}, {
|
|
1144
|
-
label: x(() => [
|
|
1145
|
-
n("div", Kn, [
|
|
1146
|
-
s(I, {
|
|
1147
|
-
label: o(u)("inventory.ingredient.pricePerUnit")
|
|
1148
|
-
}, null, 8, ["label"]),
|
|
1149
|
-
s(xe, {
|
|
1150
|
-
tier: "premium",
|
|
1151
|
-
category: "premium",
|
|
1152
|
-
"feature-key": "total-cost"
|
|
1153
|
-
})
|
|
1154
|
-
])
|
|
1155
|
-
]),
|
|
1156
|
-
prepend: x(() => {
|
|
1157
|
-
var T, X;
|
|
1158
|
-
return [
|
|
1159
|
-
n("div", Gn, $(o(mt)(((T = o(a).currentCountry) == null ? void 0 : T.value) ?? o(ct)) === "MYR" ? "RM" : o(mt)(((X = o(a).currentCountry) == null ? void 0 : X.value) ?? o(ct))), 1)
|
|
1160
|
-
];
|
|
1161
|
-
}),
|
|
1162
|
-
append: x(() => [
|
|
1163
|
-
n("div", Jn, " / " + $(be.value), 1)
|
|
1164
|
-
]),
|
|
1165
|
-
_: 1
|
|
1166
|
-
}, 8, ["model-value", "rules"])
|
|
1167
|
-
]),
|
|
1168
|
-
_: 1
|
|
1169
|
-
}, 8, ["model-value", "locked", "append-text", "disabled"])) : N("", !0),
|
|
1170
|
-
!f.value || z.value ? (c(), j(zn, {
|
|
1171
|
-
key: 2,
|
|
1172
|
-
"model-value": z.value,
|
|
1173
|
-
"onUpdate:modelValue": t[7] || (t[7] = (T) => z.value = T),
|
|
1169
|
+
"model-value": N.value,
|
|
1170
|
+
"onUpdate:modelValue": t[7] || (t[7] = (T) => N.value = T),
|
|
1174
1171
|
"root-value": e.modelValue,
|
|
1175
1172
|
readonly: f.value
|
|
1176
|
-
}, null, 8, ["model-value", "root-value", "readonly"])) :
|
|
1177
|
-
e.mode !== o(
|
|
1178
|
-
|
|
1179
|
-
label: o(
|
|
1173
|
+
}, null, 8, ["model-value", "root-value", "readonly"])) : L("", !0),
|
|
1174
|
+
e.mode !== o(j).CREATE ? (p(), V("div", Zn, [
|
|
1175
|
+
r(et, {
|
|
1176
|
+
label: o(d)("inventory.ingredient.status.inactive"),
|
|
1180
1177
|
"model-value": te.value,
|
|
1181
1178
|
"onUpdate:modelValue": t[8] || (t[8] = (T) => te.value = T),
|
|
1182
1179
|
"label-placement": "right",
|
|
1183
1180
|
disabled: f.value
|
|
1184
1181
|
}, null, 8, ["label", "model-value", "disabled"]),
|
|
1185
|
-
n("div",
|
|
1186
|
-
n("div",
|
|
1182
|
+
n("div", eo, [
|
|
1183
|
+
n("div", to, $(o(d)("inventory.ingredient.status.preventFromOrder")), 1)
|
|
1187
1184
|
])
|
|
1188
|
-
])) :
|
|
1189
|
-
e.mode !== o(
|
|
1185
|
+
])) : L("", !0),
|
|
1186
|
+
e.mode !== o(j).CREATE ? (p(), V("div", no, [
|
|
1190
1187
|
n("div", null, [
|
|
1191
|
-
|
|
1192
|
-
label: o(
|
|
1193
|
-
modelValue:
|
|
1194
|
-
"onUpdate:modelValue": t[9] || (t[9] = (T) =>
|
|
1188
|
+
r(et, {
|
|
1189
|
+
label: o(d)("inventory.ingredient.bindedItems.title"),
|
|
1190
|
+
modelValue: D.value,
|
|
1191
|
+
"onUpdate:modelValue": t[9] || (t[9] = (T) => D.value = T),
|
|
1195
1192
|
"label-placement": "right"
|
|
1196
1193
|
}, null, 8, ["label", "modelValue"])
|
|
1197
1194
|
]),
|
|
1198
|
-
|
|
1195
|
+
D.value && K.value.length ? (p(), Y(qe, {
|
|
1199
1196
|
key: 0,
|
|
1200
|
-
name: o(
|
|
1197
|
+
name: o(d)("inventory.ingredient.bindedItems.ingredient"),
|
|
1201
1198
|
bindings: K.value
|
|
1202
|
-
}, null, 8, ["name", "bindings"])) :
|
|
1203
|
-
|
|
1199
|
+
}, null, 8, ["name", "bindings"])) : L("", !0),
|
|
1200
|
+
D.value && z.value.length ? (p(), Y(qe, {
|
|
1204
1201
|
key: 1,
|
|
1205
|
-
name: o(
|
|
1206
|
-
bindings:
|
|
1207
|
-
}, null, 8, ["name", "bindings"])) :
|
|
1208
|
-
|
|
1202
|
+
name: o(d)("inventory.ingredient.bindedItems.recipe"),
|
|
1203
|
+
bindings: z.value
|
|
1204
|
+
}, null, 8, ["name", "bindings"])) : L("", !0),
|
|
1205
|
+
D.value && ge.value.length ? (p(), Y(qe, {
|
|
1209
1206
|
key: 2,
|
|
1210
|
-
name: o(
|
|
1207
|
+
name: o(d)("inventory.ingredient.bindedItems.menu"),
|
|
1211
1208
|
bindings: ge.value
|
|
1212
|
-
}, null, 8, ["name", "bindings"])) :
|
|
1213
|
-
])) :
|
|
1214
|
-
n("div",
|
|
1215
|
-
n("div",
|
|
1216
|
-
n("div",
|
|
1217
|
-
n("div",
|
|
1218
|
-
|
|
1209
|
+
}, null, 8, ["name", "bindings"])) : L("", !0)
|
|
1210
|
+
])) : L("", !0),
|
|
1211
|
+
n("div", oo, [
|
|
1212
|
+
n("div", lo, [
|
|
1213
|
+
n("div", ao, [
|
|
1214
|
+
n("div", so, $(o(d)("inventory.ingredient.threshold.title")), 1),
|
|
1215
|
+
r(ke, {
|
|
1219
1216
|
tier: "standard",
|
|
1220
1217
|
category: "beta"
|
|
1221
1218
|
})
|
|
1222
1219
|
]),
|
|
1223
|
-
n("div",
|
|
1220
|
+
n("div", ro, $(o(d)("inventory.ingredient.threshold.subtitle")), 1)
|
|
1224
1221
|
]),
|
|
1225
|
-
n("div",
|
|
1226
|
-
|
|
1227
|
-
"model-value": { low: he.value, mid:
|
|
1222
|
+
n("div", io, [
|
|
1223
|
+
r(Ze, {
|
|
1224
|
+
"model-value": { low: he.value, mid: me.value },
|
|
1228
1225
|
rules: [Et()]
|
|
1229
1226
|
}, null, 8, ["model-value", "rules"]),
|
|
1230
|
-
n("div",
|
|
1231
|
-
n("div",
|
|
1232
|
-
n("div",
|
|
1233
|
-
|
|
1227
|
+
n("div", uo, [
|
|
1228
|
+
n("div", co, [
|
|
1229
|
+
n("div", mo, [
|
|
1230
|
+
r(je, {
|
|
1234
1231
|
days: he.value,
|
|
1235
1232
|
level: o(We).low
|
|
1236
1233
|
}, null, 8, ["days", "level"])
|
|
1237
1234
|
]),
|
|
1238
|
-
n("div",
|
|
1239
|
-
n("div",
|
|
1240
|
-
|
|
1235
|
+
n("div", po, [
|
|
1236
|
+
n("div", vo, $(o(d)("inventory.ingredient.threshold.whenRemaining")), 1),
|
|
1237
|
+
r(tt, {
|
|
1241
1238
|
modelValue: he.value,
|
|
1242
1239
|
"onUpdate:modelValue": t[10] || (t[10] = (T) => he.value = T),
|
|
1243
|
-
rules: [o(
|
|
1240
|
+
rules: [o(De)(0)]
|
|
1244
1241
|
}, {
|
|
1245
1242
|
append: x(() => t[13] || (t[13] = [
|
|
1246
1243
|
n("div", {
|
|
@@ -1261,19 +1258,19 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1261
1258
|
style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
|
|
1262
1259
|
}, " < ")
|
|
1263
1260
|
], -1)),
|
|
1264
|
-
n("div",
|
|
1265
|
-
n("div",
|
|
1266
|
-
|
|
1267
|
-
days:
|
|
1261
|
+
n("div", fo, [
|
|
1262
|
+
n("div", yo, [
|
|
1263
|
+
r(je, {
|
|
1264
|
+
days: me.value,
|
|
1268
1265
|
level: o(We).mid
|
|
1269
1266
|
}, null, 8, ["days", "level"])
|
|
1270
1267
|
]),
|
|
1271
|
-
n("div",
|
|
1272
|
-
n("div",
|
|
1273
|
-
|
|
1274
|
-
modelValue:
|
|
1275
|
-
"onUpdate:modelValue": t[11] || (t[11] = (T) =>
|
|
1276
|
-
rules: [o(
|
|
1268
|
+
n("div", go, [
|
|
1269
|
+
n("div", bo, $(o(d)("inventory.ingredient.threshold.whenRemaining")), 1),
|
|
1270
|
+
r(tt, {
|
|
1271
|
+
modelValue: me.value,
|
|
1272
|
+
"onUpdate:modelValue": t[11] || (t[11] = (T) => me.value = T),
|
|
1273
|
+
rules: [o(De)(0)]
|
|
1277
1274
|
}, {
|
|
1278
1275
|
append: x(() => t[14] || (t[14] = [
|
|
1279
1276
|
n("div", {
|
|
@@ -1294,32 +1291,32 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1294
1291
|
style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
|
|
1295
1292
|
}, " < ")
|
|
1296
1293
|
], -1)),
|
|
1297
|
-
n("div",
|
|
1298
|
-
n("div",
|
|
1299
|
-
|
|
1300
|
-
days:
|
|
1294
|
+
n("div", ho, [
|
|
1295
|
+
n("div", _o, [
|
|
1296
|
+
r(je, {
|
|
1297
|
+
days: me.value + 1,
|
|
1301
1298
|
level: o(We).high
|
|
1302
1299
|
}, null, 8, ["days", "level"])
|
|
1303
1300
|
]),
|
|
1304
|
-
n("div",
|
|
1305
|
-
n("div",
|
|
1301
|
+
n("div", xo, [
|
|
1302
|
+
n("div", ko, $(o(d)("inventory.ingredient.threshold.stockIsStaple")), 1)
|
|
1306
1303
|
])
|
|
1307
1304
|
])
|
|
1308
1305
|
])
|
|
1309
1306
|
])
|
|
1310
1307
|
]),
|
|
1311
|
-
o(
|
|
1312
|
-
n("div",
|
|
1313
|
-
n("div",
|
|
1314
|
-
n("div",
|
|
1315
|
-
n("div",
|
|
1316
|
-
|
|
1308
|
+
o(c).mustUsePoTemplate && e.mode === o(j).CREATE ? (p(), V("div", wo, [
|
|
1309
|
+
n("div", To, [
|
|
1310
|
+
n("div", Vo, [
|
|
1311
|
+
n("div", Io, [
|
|
1312
|
+
n("div", So, $(o(d)("inventory.ingredient.purchaseOrderTemplates.title")), 1),
|
|
1313
|
+
r(ke, {
|
|
1317
1314
|
tier: "premium",
|
|
1318
1315
|
category: "premium",
|
|
1319
1316
|
"feature-key": "purchase-order-template"
|
|
1320
1317
|
})
|
|
1321
1318
|
]),
|
|
1322
|
-
|
|
1319
|
+
r(Be, {
|
|
1323
1320
|
variant: "secondary",
|
|
1324
1321
|
"text-color": "primary",
|
|
1325
1322
|
"border-color": "primary",
|
|
@@ -1327,31 +1324,31 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1327
1324
|
onClick: Ct
|
|
1328
1325
|
})
|
|
1329
1326
|
]),
|
|
1330
|
-
n("div",
|
|
1327
|
+
n("div", Co, $(o(d)("inventory.ingredient.purchaseOrderTemplates.description")), 1)
|
|
1331
1328
|
]),
|
|
1332
|
-
Ve.value.length > 0 ? (
|
|
1333
|
-
n("div",
|
|
1334
|
-
(
|
|
1329
|
+
Ve.value.length > 0 ? (p(), V("div", Fo, [
|
|
1330
|
+
n("div", Ao, [
|
|
1331
|
+
(p(!0), V(ee, null, de(Ve.value, (T) => (p(), Y(Ne, {
|
|
1335
1332
|
key: T.value,
|
|
1336
1333
|
label: T.label,
|
|
1337
1334
|
variant: "info",
|
|
1338
1335
|
compact: ""
|
|
1339
1336
|
}, null, 8, ["label"]))), 128))
|
|
1340
1337
|
])
|
|
1341
|
-
])) :
|
|
1342
|
-
])) :
|
|
1343
|
-
o(
|
|
1344
|
-
n("div",
|
|
1345
|
-
n("div",
|
|
1346
|
-
n("div",
|
|
1347
|
-
n("div",
|
|
1348
|
-
|
|
1338
|
+
])) : L("", !0)
|
|
1339
|
+
])) : L("", !0),
|
|
1340
|
+
o(c).enableWastageTemplate && e.mode === o(j).CREATE ? (p(), V("div", Eo, [
|
|
1341
|
+
n("div", $o, [
|
|
1342
|
+
n("div", Mo, [
|
|
1343
|
+
n("div", Uo, [
|
|
1344
|
+
n("div", Po, $(o(d)("inventory.ingredient.wastageTemplates.title")), 1),
|
|
1345
|
+
r(ke, {
|
|
1349
1346
|
tier: "premium",
|
|
1350
1347
|
category: "premium",
|
|
1351
1348
|
"feature-key": "wastage-template"
|
|
1352
1349
|
})
|
|
1353
1350
|
]),
|
|
1354
|
-
|
|
1351
|
+
r(Be, {
|
|
1355
1352
|
variant: "secondary",
|
|
1356
1353
|
"text-color": "primary",
|
|
1357
1354
|
"border-color": "primary",
|
|
@@ -1359,31 +1356,31 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1359
1356
|
onClick: Ft
|
|
1360
1357
|
})
|
|
1361
1358
|
]),
|
|
1362
|
-
n("div",
|
|
1359
|
+
n("div", Ro, $(o(d)("inventory.ingredient.wastageTemplates.description")), 1)
|
|
1363
1360
|
]),
|
|
1364
|
-
Ie.value.length > 0 ? (
|
|
1365
|
-
n("div",
|
|
1366
|
-
(
|
|
1361
|
+
Ie.value.length > 0 ? (p(), V("div", Do, [
|
|
1362
|
+
n("div", Oo, [
|
|
1363
|
+
(p(!0), V(ee, null, de(Ie.value, (T) => (p(), Y(Ne, {
|
|
1367
1364
|
key: T.value,
|
|
1368
1365
|
label: T.label,
|
|
1369
1366
|
variant: "info",
|
|
1370
1367
|
compact: ""
|
|
1371
1368
|
}, null, 8, ["label"]))), 128))
|
|
1372
1369
|
])
|
|
1373
|
-
])) :
|
|
1374
|
-
])) :
|
|
1375
|
-
o(
|
|
1376
|
-
n("div",
|
|
1377
|
-
n("div",
|
|
1378
|
-
n("div",
|
|
1379
|
-
n("div",
|
|
1380
|
-
|
|
1370
|
+
])) : L("", !0)
|
|
1371
|
+
])) : L("", !0),
|
|
1372
|
+
o(c).enableClosingTemplate && e.mode === o(j).CREATE ? (p(), V("div", Bo, [
|
|
1373
|
+
n("div", No, [
|
|
1374
|
+
n("div", zo, [
|
|
1375
|
+
n("div", Lo, [
|
|
1376
|
+
n("div", jo, $(o(d)("inventory.ingredient.closingTemplates.title")), 1),
|
|
1377
|
+
r(ke, {
|
|
1381
1378
|
tier: "premium",
|
|
1382
1379
|
category: "premium",
|
|
1383
1380
|
"feature-key": "closing-template"
|
|
1384
1381
|
})
|
|
1385
1382
|
]),
|
|
1386
|
-
|
|
1383
|
+
r(Be, {
|
|
1387
1384
|
variant: "secondary",
|
|
1388
1385
|
"text-color": "primary",
|
|
1389
1386
|
"border-color": "primary",
|
|
@@ -1391,21 +1388,21 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1391
1388
|
onClick: At
|
|
1392
1389
|
})
|
|
1393
1390
|
]),
|
|
1394
|
-
n("div",
|
|
1391
|
+
n("div", Wo, $(o(d)("inventory.ingredient.closingTemplates.description")), 1)
|
|
1395
1392
|
]),
|
|
1396
|
-
Qe.value.length > 0 ? (
|
|
1397
|
-
n("div",
|
|
1398
|
-
(
|
|
1393
|
+
Qe.value.length > 0 ? (p(), V("div", qo, [
|
|
1394
|
+
n("div", Ho, [
|
|
1395
|
+
(p(!0), V(ee, null, de(Qe.value, (T) => (p(), Y(Ne, {
|
|
1399
1396
|
key: T.value,
|
|
1400
1397
|
label: T.label,
|
|
1401
1398
|
variant: "info",
|
|
1402
1399
|
compact: ""
|
|
1403
1400
|
}, null, 8, ["label"]))), 128))
|
|
1404
1401
|
])
|
|
1405
|
-
])) :
|
|
1406
|
-
])) :
|
|
1402
|
+
])) : L("", !0)
|
|
1403
|
+
])) : L("", !0),
|
|
1407
1404
|
n("div", null, [
|
|
1408
|
-
|
|
1405
|
+
r(gn, {
|
|
1409
1406
|
entity: "inventorySku",
|
|
1410
1407
|
modelValue: Q.value,
|
|
1411
1408
|
"onUpdate:modelValue": t[12] || (t[12] = (T) => Q.value = T)
|
|
@@ -1417,50 +1414,50 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1417
1414
|
}, 8, ["disabled"]);
|
|
1418
1415
|
};
|
|
1419
1416
|
}
|
|
1420
|
-
}),
|
|
1417
|
+
}), Ko = { class: "flex flex-col gap-32" }, Go = {
|
|
1421
1418
|
key: 0,
|
|
1422
1419
|
class: "flex justify-between items-center"
|
|
1423
|
-
},
|
|
1420
|
+
}, Jo = { class: "flex gap-4" }, Qo = /* @__PURE__ */ xe({
|
|
1424
1421
|
__name: "IngredientDialog",
|
|
1425
1422
|
props: {
|
|
1426
1423
|
show: { type: Boolean },
|
|
1427
1424
|
sku: {},
|
|
1428
|
-
mode: { default:
|
|
1425
|
+
mode: { default: j.READ }
|
|
1429
1426
|
},
|
|
1430
1427
|
emits: ["update:show"],
|
|
1431
|
-
setup(
|
|
1432
|
-
const h =
|
|
1428
|
+
setup(W) {
|
|
1429
|
+
const h = W, k = Fe(), d = Tt(), _ = Ee(), S = Vt(), A = It(), U = St(), l = Ae(), { t: i } = pe(), u = ft(h, "show"), a = ft(h, "sku"), c = P([]), s = P([]), f = P([]), w = g(
|
|
1433
1430
|
() => {
|
|
1434
1431
|
var y;
|
|
1435
1432
|
return _.isEnabled && _.netSuiteItemBySkuId.has((y = h.sku) == null ? void 0 : y._id);
|
|
1436
1433
|
}
|
|
1437
1434
|
), F = g(() => {
|
|
1438
1435
|
switch (h.mode) {
|
|
1439
|
-
case
|
|
1436
|
+
case j.READ:
|
|
1440
1437
|
return "";
|
|
1441
|
-
case
|
|
1438
|
+
case j.UPDATE:
|
|
1442
1439
|
return i("inventory.ingredient.update.title");
|
|
1443
|
-
case
|
|
1440
|
+
case j.CREATE:
|
|
1444
1441
|
return i("inventory.ingredient.create.title");
|
|
1445
1442
|
}
|
|
1446
1443
|
return "";
|
|
1447
|
-
}),
|
|
1444
|
+
}), m = g(() => {
|
|
1448
1445
|
switch (h.mode) {
|
|
1449
|
-
case
|
|
1446
|
+
case j.READ:
|
|
1450
1447
|
return "";
|
|
1451
|
-
case
|
|
1448
|
+
case j.UPDATE:
|
|
1452
1449
|
return i("common.save");
|
|
1453
|
-
case
|
|
1450
|
+
case j.CREATE:
|
|
1454
1451
|
return i("common.add");
|
|
1455
1452
|
}
|
|
1456
1453
|
return "";
|
|
1457
|
-
}),
|
|
1454
|
+
}), O = P(), R = P(!1);
|
|
1458
1455
|
async function ve() {
|
|
1459
1456
|
R.value = !0;
|
|
1460
1457
|
try {
|
|
1461
1458
|
await k.createSku(a.value);
|
|
1462
1459
|
const y = k.skuByCode[a.value.code];
|
|
1463
|
-
|
|
1460
|
+
d.enablePoTemplate && c.value.length > 0 && await ue(y), d.enableWastageTemplate && s.value.length > 0 && await oe(y), d.enableClosingTemplate && f.value.length > 0 && await le(y), u.value = !1, l.open({
|
|
1464
1461
|
title: i("inventory.common.success"),
|
|
1465
1462
|
message: i("inventory.ingredient.create.success", { name: a.value.name }),
|
|
1466
1463
|
type: "success"
|
|
@@ -1478,7 +1475,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1478
1475
|
async function ne() {
|
|
1479
1476
|
R.value = !0;
|
|
1480
1477
|
try {
|
|
1481
|
-
await k.updateSku(a.value), R.value = !1,
|
|
1478
|
+
await k.updateSku(a.value), R.value = !1, u.value = !1, l.open({
|
|
1482
1479
|
title: i("inventory.common.success"),
|
|
1483
1480
|
message: i("inventory.ingredient.update.success", { name: a.value.name }),
|
|
1484
1481
|
type: "success"
|
|
@@ -1496,16 +1493,16 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1496
1493
|
async function ue(y) {
|
|
1497
1494
|
var M, G, E, v;
|
|
1498
1495
|
try {
|
|
1499
|
-
for (const
|
|
1500
|
-
const J = await
|
|
1496
|
+
for (const N of c.value) {
|
|
1497
|
+
const J = await S.getTemplate(N);
|
|
1501
1498
|
if (!J) {
|
|
1502
|
-
console.warn(`Template with ID ${
|
|
1499
|
+
console.warn(`Template with ID ${N} not found`);
|
|
1503
1500
|
continue;
|
|
1504
1501
|
}
|
|
1505
1502
|
if (!J.purchaseOrder.items.find(
|
|
1506
1503
|
(Q) => Q.sku._id === y._id
|
|
1507
1504
|
)) {
|
|
1508
|
-
const Q = { amount: 1, precision:
|
|
1505
|
+
const Q = { amount: 1, precision: dn(y.unit) }, q = {
|
|
1509
1506
|
sku: y,
|
|
1510
1507
|
name: y.name,
|
|
1511
1508
|
code: y.code,
|
|
@@ -1513,29 +1510,29 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1513
1510
|
minimumQuantity: Q,
|
|
1514
1511
|
quantityStep: Q,
|
|
1515
1512
|
measurement: ((G = (M = y.unit) == null ? void 0 : M.measurements) == null ? void 0 : G[0]) || null
|
|
1516
|
-
},
|
|
1513
|
+
}, D = {
|
|
1517
1514
|
...J,
|
|
1518
1515
|
purchaseOrder: {
|
|
1519
1516
|
...J.purchaseOrder,
|
|
1520
|
-
items: [...J.purchaseOrder.items,
|
|
1517
|
+
items: [...J.purchaseOrder.items, q]
|
|
1521
1518
|
}
|
|
1522
1519
|
};
|
|
1523
|
-
(((E =
|
|
1524
|
-
({ totalCost: K, ...
|
|
1525
|
-
)), await
|
|
1520
|
+
(((E = D.purchaseOrder.supplier) == null ? void 0 : E.internal) === vt.enum.warehouse || ((v = D.purchaseOrder.supplier) == null ? void 0 : v.internal) === vt.enum.restaurant) && (D.purchaseOrder.items = D.purchaseOrder.items.map(
|
|
1521
|
+
({ totalCost: K, ...z }) => z
|
|
1522
|
+
)), await S.updateTemplate(D), await new Promise((K) => setTimeout(K, 1e3));
|
|
1526
1523
|
}
|
|
1527
1524
|
}
|
|
1528
|
-
} catch (
|
|
1525
|
+
} catch (N) {
|
|
1529
1526
|
l.open({
|
|
1530
1527
|
title: i("inventory.transfer.template.update.error"),
|
|
1531
1528
|
message: i("inventory.transfer.template.update.errorMessage"),
|
|
1532
1529
|
type: "error"
|
|
1533
|
-
}), console.error("Error in updating transfer template",
|
|
1530
|
+
}), console.error("Error in updating transfer template", N);
|
|
1534
1531
|
}
|
|
1535
1532
|
}
|
|
1536
1533
|
async function oe(y) {
|
|
1537
1534
|
try {
|
|
1538
|
-
for (const M of
|
|
1535
|
+
for (const M of s.value) {
|
|
1539
1536
|
const G = await A.getTemplate(M);
|
|
1540
1537
|
if (!G) {
|
|
1541
1538
|
console.warn(`Wastage Template with ID ${M} not found`);
|
|
@@ -1548,11 +1545,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1548
1545
|
code: y.code,
|
|
1549
1546
|
type: "sku",
|
|
1550
1547
|
disabledMeasurements: []
|
|
1551
|
-
},
|
|
1548
|
+
}, N = {
|
|
1552
1549
|
...G,
|
|
1553
1550
|
items: [...G.items, v]
|
|
1554
1551
|
};
|
|
1555
|
-
await A.updateTemplate(
|
|
1552
|
+
await A.updateTemplate(N), await new Promise((J) => setTimeout(J, 1e3));
|
|
1556
1553
|
}
|
|
1557
1554
|
}
|
|
1558
1555
|
} catch (M) {
|
|
@@ -1574,11 +1571,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1574
1571
|
if (!G.items.find((v) => v.sku._id === y._id)) {
|
|
1575
1572
|
const v = {
|
|
1576
1573
|
sku: y
|
|
1577
|
-
},
|
|
1574
|
+
}, N = {
|
|
1578
1575
|
...G,
|
|
1579
1576
|
items: [...G.items, v]
|
|
1580
1577
|
};
|
|
1581
|
-
await U.updateTemplate(
|
|
1578
|
+
await U.updateTemplate(N), await new Promise((J) => setTimeout(J, 1e3));
|
|
1582
1579
|
}
|
|
1583
1580
|
}
|
|
1584
1581
|
} catch (M) {
|
|
@@ -1591,77 +1588,77 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1591
1588
|
}
|
|
1592
1589
|
function te() {
|
|
1593
1590
|
var y, M;
|
|
1594
|
-
(M = (y =
|
|
1591
|
+
(M = (y = O.value) == null ? void 0 : y.validateInputs) == null || M.call(y);
|
|
1595
1592
|
}
|
|
1596
1593
|
function ae() {
|
|
1597
1594
|
switch (h.mode) {
|
|
1598
|
-
case
|
|
1595
|
+
case j.READ:
|
|
1599
1596
|
return;
|
|
1600
|
-
case
|
|
1597
|
+
case j.UPDATE:
|
|
1601
1598
|
return ne();
|
|
1602
|
-
case
|
|
1599
|
+
case j.CREATE:
|
|
1603
1600
|
return ve();
|
|
1604
1601
|
}
|
|
1605
1602
|
}
|
|
1606
1603
|
function fe(y) {
|
|
1607
|
-
|
|
1604
|
+
c.value = y;
|
|
1608
1605
|
}
|
|
1609
1606
|
function ye(y) {
|
|
1610
|
-
|
|
1607
|
+
s.value = y;
|
|
1611
1608
|
}
|
|
1612
1609
|
function we(y) {
|
|
1613
1610
|
f.value = y;
|
|
1614
1611
|
}
|
|
1615
1612
|
return (y, M) => {
|
|
1616
|
-
const G =
|
|
1617
|
-
return
|
|
1618
|
-
"model-value": o(
|
|
1619
|
-
"onUpdate:modelValue": M[3] || (M[3] = (
|
|
1613
|
+
const G = C("FmChip"), E = C("FmButton"), v = C("FmSideSheet");
|
|
1614
|
+
return p(), Y(v, {
|
|
1615
|
+
"model-value": o(u),
|
|
1616
|
+
"onUpdate:modelValue": M[3] || (M[3] = (N) => rt(u) ? u.value = N : null),
|
|
1620
1617
|
header: F.value,
|
|
1621
1618
|
"close-button": "",
|
|
1622
1619
|
"dismiss-away": "",
|
|
1623
1620
|
"max-width": 500
|
|
1624
1621
|
}, {
|
|
1625
1622
|
"side-sheet-footer": x(() => [
|
|
1626
|
-
n("div",
|
|
1627
|
-
|
|
1623
|
+
n("div", Jo, [
|
|
1624
|
+
r(E, {
|
|
1628
1625
|
loading: R.value,
|
|
1629
|
-
label:
|
|
1626
|
+
label: m.value,
|
|
1630
1627
|
onClick: te
|
|
1631
1628
|
}, null, 8, ["loading", "label"]),
|
|
1632
|
-
|
|
1629
|
+
r(E, {
|
|
1633
1630
|
disabled: R.value,
|
|
1634
1631
|
label: o(i)("common.close"),
|
|
1635
1632
|
variant: "tertiary",
|
|
1636
|
-
onClick: M[2] || (M[2] = (
|
|
1633
|
+
onClick: M[2] || (M[2] = (N) => u.value = !1)
|
|
1637
1634
|
}, null, 8, ["disabled", "label"])
|
|
1638
1635
|
])
|
|
1639
1636
|
]),
|
|
1640
1637
|
default: x(() => [
|
|
1641
|
-
n("div",
|
|
1642
|
-
w.value ? (
|
|
1643
|
-
|
|
1638
|
+
n("div", Ko, [
|
|
1639
|
+
w.value ? (p(), V("div", Go, [
|
|
1640
|
+
r(G, {
|
|
1644
1641
|
label: "Managed by Netsuite",
|
|
1645
1642
|
compact: ""
|
|
1646
1643
|
}),
|
|
1647
|
-
|
|
1644
|
+
r(tn, {
|
|
1648
1645
|
readonly: "",
|
|
1649
1646
|
sku: y.sku,
|
|
1650
1647
|
settingOptions: o(_).skuSettingOptions
|
|
1651
1648
|
}, null, 8, ["sku", "settingOptions"])
|
|
1652
|
-
])) :
|
|
1653
|
-
|
|
1649
|
+
])) : L("", !0),
|
|
1650
|
+
r(Yo, {
|
|
1654
1651
|
class: "w-full",
|
|
1655
1652
|
ref_key: "hasValidationExpose",
|
|
1656
|
-
ref:
|
|
1653
|
+
ref: O,
|
|
1657
1654
|
modelValue: o(a),
|
|
1658
|
-
"onUpdate:modelValue": M[0] || (M[0] = (
|
|
1655
|
+
"onUpdate:modelValue": M[0] || (M[0] = (N) => rt(a) ? a.value = N : null),
|
|
1659
1656
|
mode: y.mode,
|
|
1660
1657
|
disabled: R.value,
|
|
1661
|
-
purchaseOrderTemplateIds:
|
|
1662
|
-
wastageTemplateIds:
|
|
1658
|
+
purchaseOrderTemplateIds: c.value,
|
|
1659
|
+
wastageTemplateIds: s.value,
|
|
1663
1660
|
closingTemplateIds: f.value,
|
|
1664
|
-
"onClick:submit": M[1] || (M[1] = (
|
|
1661
|
+
"onClick:submit": M[1] || (M[1] = (N) => ae()),
|
|
1665
1662
|
"onUpdate:purchaseOrderTemplateIds": fe,
|
|
1666
1663
|
"onUpdate:wastageTemplateIds": ye,
|
|
1667
1664
|
"onUpdate:closingTemplateIds": we
|
|
@@ -1672,10 +1669,10 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1672
1669
|
}, 8, ["model-value", "header"]);
|
|
1673
1670
|
};
|
|
1674
1671
|
}
|
|
1675
|
-
}),
|
|
1672
|
+
}), Xo = { class: "flex items-center gap-12 pl-8" }, Zo = { class: "flex flex-col" }, el = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, tl = {
|
|
1676
1673
|
key: 0,
|
|
1677
1674
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
1678
|
-
},
|
|
1675
|
+
}, nl = { key: 0 }, ht = /* @__PURE__ */ xe({
|
|
1679
1676
|
__name: "ImportIngredientItem",
|
|
1680
1677
|
props: {
|
|
1681
1678
|
type: {},
|
|
@@ -1683,30 +1680,30 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1683
1680
|
name: {},
|
|
1684
1681
|
errors: {}
|
|
1685
1682
|
},
|
|
1686
|
-
setup(
|
|
1683
|
+
setup(W) {
|
|
1687
1684
|
return (h, k) => {
|
|
1688
|
-
const
|
|
1689
|
-
return
|
|
1685
|
+
const d = C("FmIcon"), _ = C("FmTooltip");
|
|
1686
|
+
return p(), V("div", Xo, [
|
|
1690
1687
|
k[0] || (k[0] = n("div", null, "•", -1)),
|
|
1691
|
-
n("div",
|
|
1692
|
-
n("div",
|
|
1688
|
+
n("div", Zo, [
|
|
1689
|
+
n("div", el, [
|
|
1693
1690
|
n("div", {
|
|
1694
1691
|
class: ie({
|
|
1695
1692
|
"text-fm-color-system-error-300": h.errors.length
|
|
1696
1693
|
})
|
|
1697
1694
|
}, [
|
|
1698
1695
|
xt($(h.name) + " ", 1),
|
|
1699
|
-
h.type === "create" ? (
|
|
1696
|
+
h.type === "create" ? (p(), V("span", tl, "(new)")) : L("", !0)
|
|
1700
1697
|
], 2),
|
|
1701
|
-
h.errors.length ? (
|
|
1702
|
-
|
|
1698
|
+
h.errors.length ? (p(), V("div", nl, [
|
|
1699
|
+
r(_, { "z-index": 50 }, {
|
|
1703
1700
|
content: x(() => [
|
|
1704
1701
|
n("ol", null, [
|
|
1705
|
-
(
|
|
1702
|
+
(p(!0), V(ee, null, de(h.errors, (S, A) => (p(), V("li", { key: A }, $(S), 1))), 128))
|
|
1706
1703
|
])
|
|
1707
1704
|
]),
|
|
1708
1705
|
default: x(() => [
|
|
1709
|
-
|
|
1706
|
+
r(d, {
|
|
1710
1707
|
name: "error",
|
|
1711
1708
|
size: "sm",
|
|
1712
1709
|
color: "system-error-300"
|
|
@@ -1714,7 +1711,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1714
1711
|
]),
|
|
1715
1712
|
_: 1
|
|
1716
1713
|
})
|
|
1717
|
-
])) :
|
|
1714
|
+
])) : L("", !0)
|
|
1718
1715
|
]),
|
|
1719
1716
|
n("div", {
|
|
1720
1717
|
class: ie([
|
|
@@ -1729,79 +1726,79 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1729
1726
|
]);
|
|
1730
1727
|
};
|
|
1731
1728
|
}
|
|
1732
|
-
}),
|
|
1729
|
+
}), ol = { class: "flex flex-col gap-24" }, ll = { class: "fm-typo-en-body-md-400" }, al = { class: "flex flex-col gap-8" }, sl = { class: "line-clamp-2 text-ellipsis break-all" }, rl = {
|
|
1733
1730
|
key: 2,
|
|
1734
1731
|
class: "shrink-0"
|
|
1735
|
-
},
|
|
1732
|
+
}, il = {
|
|
1736
1733
|
key: 0,
|
|
1737
1734
|
class: "flex flex-col"
|
|
1738
|
-
},
|
|
1735
|
+
}, dl = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, ul = {
|
|
1739
1736
|
key: 0,
|
|
1740
1737
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
1741
|
-
},
|
|
1738
|
+
}, cl = { class: "fm-typo-en-body-lg-600" }, ml = /* @__PURE__ */ xe({
|
|
1742
1739
|
__name: "ImportIngredients",
|
|
1743
|
-
setup(
|
|
1744
|
-
const h = P(null), k =
|
|
1745
|
-
() => !!
|
|
1740
|
+
setup(W) {
|
|
1741
|
+
const h = P(null), k = Yt(), d = Ae(), _ = P(!1), S = P(new Array()), A = P([]), U = P([]), l = g(
|
|
1742
|
+
() => !!S.value.length || A.value.some((c) => c.errors.length) || U.value.some((c) => c.errors.length)
|
|
1746
1743
|
), i = g(
|
|
1747
1744
|
() => !!A.value.length || !!U.value.length
|
|
1748
|
-
), { t:
|
|
1749
|
-
async function a(
|
|
1750
|
-
|
|
1745
|
+
), { t: u } = pe();
|
|
1746
|
+
async function a(c) {
|
|
1747
|
+
S.value = [], A.value = [], U.value = [];
|
|
1751
1748
|
try {
|
|
1752
1749
|
_.value = !0;
|
|
1753
|
-
const [
|
|
1754
|
-
|
|
1750
|
+
const [s] = await Promise.all([
|
|
1751
|
+
_n(c),
|
|
1755
1752
|
// fake buffer
|
|
1756
1753
|
new Promise((F) => setTimeout(F, 1e3))
|
|
1757
|
-
]), f =
|
|
1754
|
+
]), f = s.SheetNames.find((F) => F);
|
|
1758
1755
|
if (!f) {
|
|
1759
|
-
|
|
1756
|
+
S.value.push(u("inventory.ingredient.import.fileError.noSheet"));
|
|
1760
1757
|
return;
|
|
1761
1758
|
}
|
|
1762
|
-
const w =
|
|
1759
|
+
const w = vn(s.Sheets[f]);
|
|
1763
1760
|
if (w.invalidExcel) {
|
|
1764
|
-
|
|
1761
|
+
S.value.push(w.invalidExcelMessage ?? u("inventory.ingredient.import.fileError.invalidExcel"));
|
|
1765
1762
|
return;
|
|
1766
1763
|
}
|
|
1767
1764
|
if (A.value = w.importCreateResult, U.value = w.importUpdateResult, !A.value.length && !U.value.length) {
|
|
1768
|
-
|
|
1765
|
+
S.value.push(u("inventory.ingredient.import.fileError.noData"));
|
|
1769
1766
|
return;
|
|
1770
1767
|
}
|
|
1771
1768
|
k.emitData(w);
|
|
1772
|
-
} catch (
|
|
1773
|
-
|
|
1774
|
-
title:
|
|
1775
|
-
message:
|
|
1769
|
+
} catch (s) {
|
|
1770
|
+
d.open({
|
|
1771
|
+
title: u("inventory.ingredient.import.fileError.unableToRead"),
|
|
1772
|
+
message: s == null ? void 0 : s.message,
|
|
1776
1773
|
type: "error"
|
|
1777
|
-
}), console.error("Error in reading file",
|
|
1774
|
+
}), console.error("Error in reading file", s);
|
|
1778
1775
|
} finally {
|
|
1779
|
-
|
|
1780
|
-
title:
|
|
1776
|
+
S.value.length && d.open({
|
|
1777
|
+
title: u("inventory.ingredient.import.fileError.invalidExcel"),
|
|
1781
1778
|
type: "error"
|
|
1782
1779
|
}), _.value = !1;
|
|
1783
1780
|
}
|
|
1784
1781
|
}
|
|
1785
|
-
return _t(h, (
|
|
1786
|
-
|
|
1787
|
-
}), (
|
|
1788
|
-
const f =
|
|
1789
|
-
return
|
|
1790
|
-
n("div",
|
|
1791
|
-
|
|
1782
|
+
return _t(h, (c) => {
|
|
1783
|
+
c && a(c);
|
|
1784
|
+
}), (c, s) => {
|
|
1785
|
+
const f = C("FmCircularProgress"), w = C("FmIcon"), F = C("FmButton");
|
|
1786
|
+
return p(), V("div", ol, [
|
|
1787
|
+
n("div", ll, $(o(u)("inventory.ingredient.import.uploadDescription")), 1),
|
|
1788
|
+
r(xn, {
|
|
1792
1789
|
class: ie({
|
|
1793
1790
|
"w-full": !0,
|
|
1794
1791
|
"h-[200px]": !h.value
|
|
1795
1792
|
}),
|
|
1796
1793
|
accept: ".xlsx",
|
|
1797
|
-
onFileUpload:
|
|
1798
|
-
label: o(
|
|
1799
|
-
"button-label": o(
|
|
1794
|
+
onFileUpload: s[0] || (s[0] = (m) => h.value = m),
|
|
1795
|
+
label: o(u)("inventory.ingredient.import.uploadTemplate"),
|
|
1796
|
+
"button-label": o(u)("inventory.ingredient.import.selectFile")
|
|
1800
1797
|
}, kt({ _: 2 }, [
|
|
1801
1798
|
h.value ? {
|
|
1802
1799
|
name: "default",
|
|
1803
|
-
fn: x(({ openFileDialog:
|
|
1804
|
-
n("div",
|
|
1800
|
+
fn: x(({ openFileDialog: m }) => [
|
|
1801
|
+
n("div", al, [
|
|
1805
1802
|
n("div", {
|
|
1806
1803
|
class: ie([
|
|
1807
1804
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
@@ -1812,11 +1809,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1812
1809
|
}
|
|
1813
1810
|
])
|
|
1814
1811
|
}, [
|
|
1815
|
-
_.value ? (
|
|
1812
|
+
_.value ? (p(), Y(f, {
|
|
1816
1813
|
key: 0,
|
|
1817
1814
|
size: "md",
|
|
1818
1815
|
color: "neutral-gray-200"
|
|
1819
|
-
})) : (
|
|
1816
|
+
})) : (p(), Y(w, {
|
|
1820
1817
|
key: 1,
|
|
1821
1818
|
name: l.value ? "error" : "attach_file",
|
|
1822
1819
|
outline: "",
|
|
@@ -1831,62 +1828,62 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1831
1828
|
}
|
|
1832
1829
|
])
|
|
1833
1830
|
}, [
|
|
1834
|
-
n("div",
|
|
1831
|
+
n("div", sl, $(h.value.name), 1)
|
|
1835
1832
|
], 2),
|
|
1836
|
-
_.value ?
|
|
1837
|
-
|
|
1838
|
-
label: o(
|
|
1833
|
+
_.value ? L("", !0) : (p(), V("div", rl, [
|
|
1834
|
+
r(F, {
|
|
1835
|
+
label: o(u)("inventory.ingredient.import.replaceFile"),
|
|
1839
1836
|
variant: l.value ? "destructive" : "secondary",
|
|
1840
1837
|
"prepend-icon": l.value ? void 0 : "autorenew",
|
|
1841
|
-
onClick:
|
|
1838
|
+
onClick: m
|
|
1842
1839
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
1843
1840
|
]))
|
|
1844
1841
|
], 2),
|
|
1845
|
-
|
|
1846
|
-
(
|
|
1842
|
+
S.value.length ? (p(), V("div", il, [
|
|
1843
|
+
(p(!0), V(ee, null, de(S.value, (O, R) => (p(), V("div", {
|
|
1847
1844
|
key: R,
|
|
1848
1845
|
class: "flex gap-8 items-center"
|
|
1849
1846
|
}, [
|
|
1850
|
-
|
|
1847
|
+
r(w, {
|
|
1851
1848
|
name: "error",
|
|
1852
1849
|
size: "sm",
|
|
1853
1850
|
color: "system-error-300"
|
|
1854
1851
|
}),
|
|
1855
|
-
n("div",
|
|
1852
|
+
n("div", dl, $(O), 1)
|
|
1856
1853
|
]))), 128))
|
|
1857
|
-
])) :
|
|
1854
|
+
])) : L("", !0)
|
|
1858
1855
|
])
|
|
1859
1856
|
]),
|
|
1860
1857
|
key: "0"
|
|
1861
1858
|
} : void 0
|
|
1862
1859
|
]), 1032, ["class", "label", "button-label"]),
|
|
1863
|
-
i.value ? (
|
|
1864
|
-
n("div",
|
|
1865
|
-
(
|
|
1866
|
-
key:
|
|
1867
|
-
code:
|
|
1868
|
-
name:
|
|
1869
|
-
errors:
|
|
1860
|
+
i.value ? (p(), V("div", ul, [
|
|
1861
|
+
n("div", cl, $(o(u)("inventory.ingredient.import.summary")), 1),
|
|
1862
|
+
(p(!0), V(ee, null, de(A.value, (m) => (p(), Y(ht, {
|
|
1863
|
+
key: m.sku._id,
|
|
1864
|
+
code: m.sku.code,
|
|
1865
|
+
name: m.sku.name,
|
|
1866
|
+
errors: m.errors,
|
|
1870
1867
|
type: "create"
|
|
1871
1868
|
}, null, 8, ["code", "name", "errors"]))), 128)),
|
|
1872
|
-
(
|
|
1873
|
-
key:
|
|
1874
|
-
code:
|
|
1875
|
-
name:
|
|
1876
|
-
errors:
|
|
1869
|
+
(p(!0), V(ee, null, de(U.value, (m) => (p(), Y(ht, {
|
|
1870
|
+
key: m.sku._id,
|
|
1871
|
+
code: m.sku.code,
|
|
1872
|
+
name: m.sku.name,
|
|
1873
|
+
errors: m.errors,
|
|
1877
1874
|
type: "update"
|
|
1878
1875
|
}, null, 8, ["code", "name", "errors"]))), 128))
|
|
1879
|
-
])) :
|
|
1876
|
+
])) : L("", !0)
|
|
1880
1877
|
]);
|
|
1881
1878
|
};
|
|
1882
1879
|
}
|
|
1883
|
-
}),
|
|
1880
|
+
}), pl = {
|
|
1884
1881
|
key: 0,
|
|
1885
1882
|
class: "flex items-center gap-1"
|
|
1886
|
-
},
|
|
1883
|
+
}, vl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fl = { class: "flex flex-col py-8" }, yl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Jl = /* @__PURE__ */ xe({
|
|
1887
1884
|
__name: "IngredientsView",
|
|
1888
|
-
setup(
|
|
1889
|
-
const h = Fe(), k = Ee(),
|
|
1885
|
+
setup(W) {
|
|
1886
|
+
const h = Fe(), k = Ee(), d = g(() => [
|
|
1890
1887
|
{
|
|
1891
1888
|
type: "string",
|
|
1892
1889
|
key: "skuCode",
|
|
@@ -1915,13 +1912,13 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1915
1912
|
type: "string"
|
|
1916
1913
|
}
|
|
1917
1914
|
]
|
|
1918
|
-
}),
|
|
1915
|
+
}), S = g(
|
|
1919
1916
|
() => new Set(k.getAvailableItems(k.businessSubsidiaryId))
|
|
1920
1917
|
), A = g(() => {
|
|
1921
1918
|
if (!_.value)
|
|
1922
1919
|
return h.skus;
|
|
1923
|
-
const E =
|
|
1924
|
-
return h.skus.filter((v) => k.isEnabled && ne.value &&
|
|
1920
|
+
const E = wn.build(_.value);
|
|
1921
|
+
return h.skus.filter((v) => k.isEnabled && ne.value && S.value && !S.value.has(v._id) ? !1 : Tn(
|
|
1925
1922
|
{
|
|
1926
1923
|
skuCode: v.code,
|
|
1927
1924
|
skuUnitAbbrev: v.unit.abbrev,
|
|
@@ -1929,11 +1926,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1929
1926
|
},
|
|
1930
1927
|
E
|
|
1931
1928
|
));
|
|
1932
|
-
}), U = Wt(), l = Ke(), i =
|
|
1933
|
-
function
|
|
1929
|
+
}), U = Wt(), l = Ke(), i = pn(), u = Ae(), { t: a } = pe(), { createIngredient: c, updateIngredient: s } = Ye(), { ingredientDialogProps: f, ingredientViewLoading: w } = Zt(Ye()), { columnDefs: F } = zn();
|
|
1930
|
+
function m(E) {
|
|
1934
1931
|
switch (E) {
|
|
1935
1932
|
case "add":
|
|
1936
|
-
return k.isEnabled ? void 0 :
|
|
1933
|
+
return k.isEnabled ? void 0 : c();
|
|
1937
1934
|
case "import":
|
|
1938
1935
|
return M();
|
|
1939
1936
|
case "export-all":
|
|
@@ -1942,7 +1939,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1942
1939
|
return y(A.value);
|
|
1943
1940
|
}
|
|
1944
1941
|
}
|
|
1945
|
-
const
|
|
1942
|
+
const O = P(""), R = P(!1), ve = g(() => R.value || w.value), ne = P(!0), { breakpoints: ue } = Kt(), oe = g(() => ue.value.xs || ue.value.sm), le = g(() => oe.value ? 10 : 20), te = nn(), ae = P(!1), fe = [
|
|
1946
1943
|
{
|
|
1947
1944
|
value: "import",
|
|
1948
1945
|
label: a("common.import")
|
|
@@ -1980,8 +1977,8 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1980
1977
|
{ label: a("inventory.ingredient.export.exportFiltered"), value: "export-filtered", mobileOnly: !0 }
|
|
1981
1978
|
]);
|
|
1982
1979
|
function y(E) {
|
|
1983
|
-
const v =
|
|
1984
|
-
|
|
1980
|
+
const v = fn(E);
|
|
1981
|
+
u.open({
|
|
1985
1982
|
title: a("inventory.ingredient.export.success"),
|
|
1986
1983
|
message: a("inventory.ingredient.export.filename", [v]),
|
|
1987
1984
|
type: "success"
|
|
@@ -1990,7 +1987,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1990
1987
|
function M() {
|
|
1991
1988
|
l.open({
|
|
1992
1989
|
title: a("inventory.ingredient.import.title"),
|
|
1993
|
-
contentComponent:
|
|
1990
|
+
contentComponent: ml,
|
|
1994
1991
|
overlay: !0,
|
|
1995
1992
|
closeButton: !0,
|
|
1996
1993
|
primaryActions: {
|
|
@@ -2008,14 +2005,14 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2008
2005
|
}
|
|
2009
2006
|
}).onPrimary((E) => {
|
|
2010
2007
|
if (!E) {
|
|
2011
|
-
|
|
2008
|
+
u.open({
|
|
2012
2009
|
title: a("inventory.ingredient.import.error.noData"),
|
|
2013
2010
|
type: "error"
|
|
2014
2011
|
});
|
|
2015
2012
|
return;
|
|
2016
2013
|
}
|
|
2017
2014
|
if (!E.importCreateResult.length && !E.importUpdateResult.length) {
|
|
2018
|
-
|
|
2015
|
+
u.open({
|
|
2019
2016
|
title: a("inventory.ingredient.import.error.invalidContent"),
|
|
2020
2017
|
message: a("inventory.ingredient.import.error.noImportData"),
|
|
2021
2018
|
type: "error"
|
|
@@ -2023,7 +2020,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2023
2020
|
return;
|
|
2024
2021
|
}
|
|
2025
2022
|
if (E.importCreateResult.some((v) => v.errors.length) || E.importUpdateResult.some((v) => v.errors.length)) {
|
|
2026
|
-
|
|
2023
|
+
u.open({
|
|
2027
2024
|
title: a("inventory.ingredient.import.error.invalidContent"),
|
|
2028
2025
|
message: a("inventory.ingredient.import.error.hasErrors"),
|
|
2029
2026
|
type: "error"
|
|
@@ -2031,50 +2028,50 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2031
2028
|
return;
|
|
2032
2029
|
}
|
|
2033
2030
|
l.close(), G(E);
|
|
2034
|
-
}).onTertiary(
|
|
2031
|
+
}).onTertiary(yn);
|
|
2035
2032
|
}
|
|
2036
2033
|
async function G(E) {
|
|
2037
2034
|
R.value = !0;
|
|
2038
2035
|
try {
|
|
2039
2036
|
const v = [
|
|
2040
|
-
...E.importCreateResult.map(({ sku:
|
|
2041
|
-
...E.importUpdateResult.map(({ sku:
|
|
2042
|
-
],
|
|
2037
|
+
...E.importCreateResult.map(({ sku: q }) => ({ type: "create", sku: q })),
|
|
2038
|
+
...E.importUpdateResult.map(({ sku: q }) => ({ type: "update", sku: q }))
|
|
2039
|
+
], N = 100;
|
|
2043
2040
|
let J = 0;
|
|
2044
|
-
const
|
|
2045
|
-
J +=
|
|
2041
|
+
const ce = () => {
|
|
2042
|
+
J += N, u.open({
|
|
2046
2043
|
title: a("inventory.ingredient.import.progress", [
|
|
2047
2044
|
Math.min(J, v.length),
|
|
2048
2045
|
v.length
|
|
2049
2046
|
])
|
|
2050
2047
|
});
|
|
2051
2048
|
}, Q = new Array();
|
|
2052
|
-
for (const
|
|
2053
|
-
|
|
2049
|
+
for (const q of v.chunk(100)) {
|
|
2050
|
+
ce();
|
|
2054
2051
|
try {
|
|
2055
|
-
const
|
|
2056
|
-
create:
|
|
2057
|
-
update:
|
|
2052
|
+
const D = await h.importSkus({
|
|
2053
|
+
create: q.filter((K) => K.type === "create").map((K) => K.sku),
|
|
2054
|
+
update: q.filter((K) => K.type === "update").map((K) => K.sku)
|
|
2058
2055
|
});
|
|
2059
|
-
Q.push(...
|
|
2060
|
-
} catch (
|
|
2056
|
+
Q.push(...D.errors);
|
|
2057
|
+
} catch (D) {
|
|
2061
2058
|
Q.push(
|
|
2062
|
-
...
|
|
2063
|
-
const
|
|
2059
|
+
...q.map((K) => {
|
|
2060
|
+
const z = {
|
|
2064
2061
|
module: qt.enum.sku,
|
|
2065
2062
|
_id: K.sku._id,
|
|
2066
2063
|
name: K.sku.name,
|
|
2067
|
-
message: (
|
|
2064
|
+
message: (D == null ? void 0 : D.stack) ?? D
|
|
2068
2065
|
};
|
|
2069
2066
|
return {
|
|
2070
2067
|
data: K.sku,
|
|
2071
|
-
error: [
|
|
2068
|
+
error: [z]
|
|
2072
2069
|
};
|
|
2073
2070
|
})
|
|
2074
2071
|
);
|
|
2075
2072
|
}
|
|
2076
2073
|
}
|
|
2077
|
-
|
|
2074
|
+
u.open({
|
|
2078
2075
|
title: a("inventory.ingredient.import.success"),
|
|
2079
2076
|
type: "success"
|
|
2080
2077
|
}), Q.length && i.alert(
|
|
@@ -2083,19 +2080,19 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2083
2080
|
"div",
|
|
2084
2081
|
{ class: "flex flex-col gap-8" },
|
|
2085
2082
|
Q.map(
|
|
2086
|
-
(
|
|
2087
|
-
Z("div", { class: "fm-typo-en-body-lg-600" }, `(${
|
|
2083
|
+
(q) => Z("div", { class: "flex flex-col" }, [
|
|
2084
|
+
Z("div", { class: "fm-typo-en-body-lg-600" }, `(${q.data.code}) ${q.data.name}`),
|
|
2088
2085
|
Z(
|
|
2089
2086
|
"div",
|
|
2090
2087
|
{ class: "fm-typo-en-body-lg-400" },
|
|
2091
|
-
`${
|
|
2088
|
+
`${q.error.map((D) => (D == null ? void 0 : D.message) ?? "Unknown error").join(", ")}`
|
|
2092
2089
|
)
|
|
2093
2090
|
])
|
|
2094
2091
|
)
|
|
2095
2092
|
)
|
|
2096
2093
|
);
|
|
2097
2094
|
} catch (v) {
|
|
2098
|
-
|
|
2095
|
+
u.open({
|
|
2099
2096
|
title: a("inventory.ingredient.import.error.failed"),
|
|
2100
2097
|
message: a("inventory.ingredient.import.error.systemMessage", [v == null ? void 0 : v.message]),
|
|
2101
2098
|
type: "error"
|
|
@@ -2105,29 +2102,29 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2105
2102
|
}
|
|
2106
2103
|
}
|
|
2107
2104
|
return (E, v) => {
|
|
2108
|
-
const
|
|
2109
|
-
return
|
|
2105
|
+
const N = C("FmButton"), J = C("FmMenuItem"), ce = C("FmMenu"), Q = C("FmSwitch"), q = C("FmTable"), D = C("FmCollapsibleTabs"), K = C("FmBottomSheet");
|
|
2106
|
+
return p(), Y(on, {
|
|
2110
2107
|
title: o(a)("inventory.ingredient.title"),
|
|
2111
2108
|
actions: we.value,
|
|
2112
|
-
"onClick:action":
|
|
2109
|
+
"onClick:action": m
|
|
2113
2110
|
}, {
|
|
2114
2111
|
"header-end": x(() => [
|
|
2115
|
-
|
|
2112
|
+
r(ce, { "close-on-click": !0 }, {
|
|
2116
2113
|
"menu-button": x(() => [
|
|
2117
|
-
|
|
2114
|
+
r(N, {
|
|
2118
2115
|
label: o(a)("common.export"),
|
|
2119
2116
|
"bg-color": "neutral-gray-100",
|
|
2120
2117
|
"text-color": "neutral-gray-400"
|
|
2121
2118
|
}, null, 8, ["label"])
|
|
2122
2119
|
]),
|
|
2123
2120
|
default: x(() => [
|
|
2124
|
-
|
|
2121
|
+
r(J, {
|
|
2125
2122
|
label: o(a)("inventory.ingredient.export.exportAll"),
|
|
2126
|
-
onClick: v[0] || (v[0] = (
|
|
2123
|
+
onClick: v[0] || (v[0] = (z) => y())
|
|
2127
2124
|
}, null, 8, ["label"]),
|
|
2128
|
-
|
|
2125
|
+
r(J, {
|
|
2129
2126
|
label: o(a)("inventory.ingredient.export.exportFiltered"),
|
|
2130
|
-
onClick: v[1] || (v[1] = (
|
|
2127
|
+
onClick: v[1] || (v[1] = (z) => y(A.value))
|
|
2131
2128
|
}, null, 8, ["label"])
|
|
2132
2129
|
]),
|
|
2133
2130
|
_: 1
|
|
@@ -2143,64 +2140,64 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2143
2140
|
}
|
|
2144
2141
|
])
|
|
2145
2142
|
}, [
|
|
2146
|
-
|
|
2143
|
+
r(kn, {
|
|
2147
2144
|
searchable: "",
|
|
2148
|
-
search:
|
|
2149
|
-
"onUpdate:search": v[3] || (v[3] = (
|
|
2145
|
+
search: O.value,
|
|
2146
|
+
"onUpdate:search": v[3] || (v[3] = (z) => O.value = z),
|
|
2150
2147
|
filterable: "",
|
|
2151
|
-
"filter-attributes":
|
|
2148
|
+
"filter-attributes": d.value,
|
|
2152
2149
|
filter: _.value,
|
|
2153
|
-
"onUpdate:filter": v[4] || (v[4] = (
|
|
2150
|
+
"onUpdate:filter": v[4] || (v[4] = (z) => _.value = z)
|
|
2154
2151
|
}, {
|
|
2155
2152
|
default: x(() => [
|
|
2156
|
-
o(k).isEnabled ? (
|
|
2157
|
-
n("span",
|
|
2158
|
-
|
|
2159
|
-
|
|
2153
|
+
o(k).isEnabled ? (p(), V("div", pl, [
|
|
2154
|
+
n("span", vl, $(o(a)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
|
|
2155
|
+
r(cn),
|
|
2156
|
+
r(Oe, null, {
|
|
2160
2157
|
default: x(() => [
|
|
2161
|
-
|
|
2158
|
+
r(Q, {
|
|
2162
2159
|
modelValue: ne.value,
|
|
2163
|
-
"onUpdate:modelValue": v[2] || (v[2] = (
|
|
2160
|
+
"onUpdate:modelValue": v[2] || (v[2] = (z) => ne.value = z)
|
|
2164
2161
|
}, null, 8, ["modelValue"])
|
|
2165
2162
|
]),
|
|
2166
2163
|
_: 1
|
|
2167
2164
|
})
|
|
2168
|
-
])) :
|
|
2165
|
+
])) : L("", !0)
|
|
2169
2166
|
]),
|
|
2170
2167
|
_: 1
|
|
2171
2168
|
}, 8, ["search", "filter-attributes", "filter"]),
|
|
2172
|
-
(
|
|
2169
|
+
(p(), Y(q, {
|
|
2173
2170
|
key: JSON.stringify(_.value),
|
|
2174
|
-
style:
|
|
2171
|
+
style: Bt(o(te).tableHeight),
|
|
2175
2172
|
"column-defs": o(F),
|
|
2176
2173
|
"row-data": A.value,
|
|
2177
|
-
"search-value":
|
|
2174
|
+
"search-value": O.value,
|
|
2178
2175
|
columnVisibility: {
|
|
2179
2176
|
netsuiteSubsidiary: o(k).isEnabled
|
|
2180
2177
|
},
|
|
2181
2178
|
loading: (!o(U)._currentLocation || ve.value) && o(k).isReady,
|
|
2182
2179
|
"loading-text": o(a)("inventory.common.loading"),
|
|
2183
|
-
onRowClick: v[5] || (v[5] = (
|
|
2180
|
+
onRowClick: v[5] || (v[5] = (z) => o(s)(z.original)),
|
|
2184
2181
|
"page-size": le.value
|
|
2185
2182
|
}, {
|
|
2186
|
-
"list-row": x((
|
|
2187
|
-
|
|
2188
|
-
row:
|
|
2189
|
-
onRowClick: o(
|
|
2183
|
+
"list-row": x((z) => [
|
|
2184
|
+
r(hn, {
|
|
2185
|
+
row: z,
|
|
2186
|
+
onRowClick: o(s)
|
|
2190
2187
|
}, kt({
|
|
2191
2188
|
default: x((ge) => {
|
|
2192
|
-
var $e, Me, Ue, be, he,
|
|
2189
|
+
var $e, Me, Ue, be, he, me, Te, Ve, _e, Ie;
|
|
2193
2190
|
return [
|
|
2194
|
-
n("div",
|
|
2195
|
-
n("div",
|
|
2196
|
-
|
|
2191
|
+
n("div", fl, [
|
|
2192
|
+
n("div", yl, [
|
|
2193
|
+
r(o(gt), {
|
|
2197
2194
|
render: (Ue = (Me = ($e = ge.code) == null ? void 0 : $e.column) == null ? void 0 : Me.columnDef) == null ? void 0 : Ue.cell,
|
|
2198
2195
|
props: (he = (be = ge.code) == null ? void 0 : be.getContext) == null ? void 0 : he.call(be)
|
|
2199
2196
|
}, null, 8, ["render", "props"])
|
|
2200
2197
|
]),
|
|
2201
|
-
n("div",
|
|
2202
|
-
|
|
2203
|
-
render: (Ve = (Te = (
|
|
2198
|
+
n("div", gl, [
|
|
2199
|
+
r(o(gt), {
|
|
2200
|
+
render: (Ve = (Te = (me = ge.name) == null ? void 0 : me.column) == null ? void 0 : Te.columnDef) == null ? void 0 : Ve.cell,
|
|
2204
2201
|
props: (Ie = (_e = ge.name) == null ? void 0 : _e.getContext) == null ? void 0 : Ie.call(_e)
|
|
2205
2202
|
}, null, 8, ["render", "props"])
|
|
2206
2203
|
])
|
|
@@ -2221,20 +2218,20 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2221
2218
|
_: 1
|
|
2222
2219
|
}, 8, ["style", "column-defs", "row-data", "search-value", "columnVisibility", "loading", "loading-text", "page-size"]))
|
|
2223
2220
|
], 2),
|
|
2224
|
-
(
|
|
2225
|
-
|
|
2221
|
+
(p(), Y(it, { to: "body" }, [
|
|
2222
|
+
r(Qo, Nt(zt(o(f))), null, 16)
|
|
2226
2223
|
])),
|
|
2227
|
-
(
|
|
2228
|
-
|
|
2224
|
+
(p(), Y(it, { to: "body" }, [
|
|
2225
|
+
r(K, {
|
|
2229
2226
|
"dismiss-away": "",
|
|
2230
2227
|
modelValue: ae.value,
|
|
2231
|
-
"onUpdate:modelValue": v[7] || (v[7] = (
|
|
2228
|
+
"onUpdate:modelValue": v[7] || (v[7] = (z) => ae.value = z)
|
|
2232
2229
|
}, {
|
|
2233
2230
|
default: x(() => [
|
|
2234
|
-
|
|
2231
|
+
r(D, {
|
|
2235
2232
|
class: "pb-8",
|
|
2236
2233
|
items: fe,
|
|
2237
|
-
"onUpdate:modelValue": v[6] || (v[6] = (
|
|
2234
|
+
"onUpdate:modelValue": v[6] || (v[6] = (z) => ye(z))
|
|
2238
2235
|
})
|
|
2239
2236
|
]),
|
|
2240
2237
|
_: 1
|
|
@@ -2247,5 +2244,5 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2247
2244
|
}
|
|
2248
2245
|
});
|
|
2249
2246
|
export {
|
|
2250
|
-
|
|
2247
|
+
Jl as default
|
|
2251
2248
|
};
|