@feedmepos/mf-inventory-portal 1.8.0-dev.0 → 1.8.0-dev.10
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-BjFIh5km.js +1466 -0
- package/dist/{ApprovalView-BK6E_3Cw.js → ApprovalView-CauRuf64.js} +26 -25
- package/dist/{BindingsDialog-BAVPQ_Eq.js → BindingsDialog-U-tzIfGX.js} +2 -2
- package/dist/{BindingsPicker-bAuDX7Af.js → BindingsPicker-CV_oghtz.js} +2 -2
- package/dist/{BindingsTable-LGlvV0lt.js → BindingsTable-TKSQxAxV.js} +4 -4
- package/dist/{BulkReceiveRequestView-CQf7FYos.js → BulkReceiveRequestView-Cyeq26qc.js} +21 -21
- package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BpJhboKU.js +151 -0
- package/dist/{ClosingDraftView-DH7iYiE9.js → ClosingDraftView-UqeHsxyJ.js} +748 -746
- package/dist/ClosingHistoryView-Cr6cQq6j.js +769 -0
- package/dist/{ClosingTemplateView-D532GNTn.js → ClosingTemplateView-DZ0Mdc87.js} +303 -291
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CvqZGcvX.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-C-OsCTxZ.js} +1 -1
- package/dist/{DefaultView-DqqXJVba.js → DefaultView-DQKHG5Jl.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-DkHNDEKP.js → DeliveryOrderPrintPreview-Z_kBbMMO.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-Cyj3ka37.js → EmailDialog.vue_vue_type_script_setup_true_lang-Ce6Ly9pT.js} +6228 -6216
- package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BUYI8koH.js +47 -0
- package/dist/FeatureCapabilityGate-DOn2IVJb.js +74 -0
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BCuhx2cN.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BJuo4lEh.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CDNqm_9N.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DZxz5hbo.js} +2 -2
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CiBhz5sq.js +120 -0
- package/dist/FmMultiselectDialog-Bx9cLdYs.js +123 -0
- package/dist/{FmMultiselectDialog-eH3nO3P3.js → FmMultiselectDialog-DvaWLGY5.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BCIkEl75.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D6f1M96D.js} +72 -73
- package/dist/ImportView-1-cjN7ay.js +1290 -0
- package/dist/{IngredientsView-DtDtzaMt.js → IngredientsView-JfKlUU2E.js} +656 -649
- package/dist/{IntegrationExplorerView-C4lYc_LH.js → IntegrationExplorerView-uElgWH8i.js} +602 -614
- package/dist/IntegrationPlatformView-g2dU5SG6.js +13061 -0
- package/dist/{IntegrationView-Bx5VdV5l.js → IntegrationView-B9g888K4.js} +2956 -2922
- package/dist/{InventoryBindingForm-DKa1DwYs.js → InventoryBindingForm-DfGOKZWg.js} +1 -1
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CNjTdNL7.js +472 -0
- package/dist/{InventoryBindingSummary-CNqwcsrX.js → InventoryBindingSummary-CSii8B2X.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-D_Xk4SOH.js +79 -0
- package/dist/PlanTierBadge.vue_vue_type_script_setup_true_lang-DJvfMOND.js +274 -0
- package/dist/PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-Bdjm0Y4w.js +79 -0
- package/dist/ProductionRunDetailView-HgH2Wp99.js +2312 -0
- package/dist/{production-run-prepare-sheet-aQOcxgaC.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-C88pjV2s.js} +11039 -3661
- package/dist/ProductionRunView-BkvQHeCP.js +931 -0
- package/dist/{PublishView-D0oSoJ5a.js → PublishView-CIei_T5e.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-CE-l4mvB.js → PurchaseOrderPrintPreview-Wmv7676h.js} +2 -2
- package/dist/{ReceiveRequestView-B2z8Ji0e.js → ReceiveRequestView-MqOIpIDB.js} +15 -15
- package/dist/RecipeView-WzXJX4JU.js +3440 -0
- package/dist/SettingsView-1YlgjyzB.js +1032 -0
- package/dist/StockView-C-dIRXPv.js +2651 -0
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BTh5E4Tt.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CewKTZzy.js} +1 -1
- package/dist/{SupplierView-qqhUQ-SY.js → SupplierView-53rHhQ63.js} +577 -571
- package/dist/{SurchargeView-B0TYUfqY.js → SurchargeView-DuJb5EUn.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-tfMHi9Yv.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-C_YmC-ZX.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-Dxc-jNte.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CyQujMzv.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BX36zWMb.js → TransferDetails.vue_vue_type_script_setup_true_lang-CMwqjlb0.js} +1722 -1672
- package/dist/TransferTemplateView-B6OGfKQr.js +2343 -0
- package/dist/{UnitCostHistoryView-xdRSkjD7.js → UnitCostHistoryView-BVlq4BNG.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BT2v1gZv.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-CULJEeCU.js} +4 -4
- package/dist/{UnitView-p-V_TMMo.js → UnitView-AuIJokVF.js} +84 -84
- package/dist/{WarehouseView-BOGYcUHH.js → WarehouseView-Cjv8S1ov.js} +194 -189
- package/dist/{WastageTemplateView-CiifZMq6.js → WastageTemplateView-mxSTzVSZ.js} +19 -18
- package/dist/api/bill.d.ts +144 -88
- package/dist/api/feature-flags.d.ts +12 -0
- package/dist/api/food-market-hub.d.ts +2 -2
- package/dist/api/integration-sync-log.d.ts +0 -13
- package/dist/api/inventory.d.ts +9 -9
- package/dist/api/license.d.ts +8 -0
- package/dist/{app-CGcDbrt8.js → app-OztWApio.js} +27841 -28064
- package/dist/app.d.ts +36 -150
- package/dist/app.js +1 -1
- package/dist/{closing-template-B4lQetjU.js → closing-template-DIxXDgZQ.js} +1 -1
- package/dist/components/ChangeLocationComponent.vue.d.ts +21 -14
- package/dist/components/DeprecateSoonWarningDialog.vue.d.ts +22 -0
- package/dist/components/FeatureCapabilityBadge.vue.d.ts +29 -0
- package/dist/components/FeatureCapabilityGate.vue.d.ts +29 -0
- package/dist/components/FmUnitInputRules.d.ts +1 -1
- package/dist/components/MultiLocationSelector.vue.d.ts +6 -6
- package/dist/components/{PreviewBadge.vue.d.ts → PlanTierBadge.vue.d.ts} +5 -13
- package/dist/components/PlanUpgradeDialog.vue.d.ts +30 -0
- package/dist/composable/useNavigationMenu.d.ts +2 -1
- package/dist/{date2-CHOcS7LX.js → date2-BTzYzk-x.js} +1 -1
- package/dist/{dayjs.min-DrqpmBJQ.js → dayjs.min-BIg6CfC4.js} +1 -1
- package/dist/{decimal-BJ-B2ZXz.js → decimal-B34w3X7O.js} +2 -2
- package/dist/{defineDeepModel-DLlTW3xL.js → defineDeepModel-CrZAv12u.js} +1 -1
- package/dist/{duplicate-template-Dyz7iXqd.js → duplicate-template-BKVPhi40.js} +1 -1
- package/dist/{inventory-core-dart.default-DGI40oFz.js → feature-BUVZ_ab3.js} +766 -398
- package/dist/feature-flags/core.d.ts +28 -0
- package/dist/feature-flags/navigation-capabilities.d.ts +23 -0
- package/dist/feature-flags/navigation-capabilities.spec.d.ts +1 -0
- package/dist/feature-flags/plan-tier.d.ts +6 -0
- package/dist/feature-flags/plan-tier.spec.d.ts +1 -0
- package/dist/feature-flags/portal-feature-catalog.d.ts +19 -0
- package/dist/feature-flags/portal-feature-catalog.spec.d.ts +1 -0
- package/dist/feature-flags/vue.d.ts +16 -0
- package/dist/feature-flags/vue.spec.d.ts +1 -0
- package/dist/{format-time-from-id-DBFdt14U.js → format-time-from-id-DGLxhRFH.js} +1 -1
- package/dist/{format-unit-display-BXCWhtXb.js → format-unit-display-BhudItCc.js} +118 -119
- package/dist/helper/menu-usage-module.d.ts +1 -1
- package/dist/helper/number.d.ts +5 -1
- package/dist/helper/rules.d.ts +1 -1
- package/dist/id-to-date-BfwadWDS.js +67 -0
- package/dist/{import-export.helper-BgaADwYQ.js → import-export.helper-BdQ_d-fT.js} +16 -17
- package/dist/{index-BT-a2SOP.js → index-BTNI4XZ2.js} +1 -1
- package/dist/{index-BS5wlvV_.js → index-B_hoeQNL.js} +3 -3
- package/dist/{JsonViewer.vue_vue_type_script_setup_true_lang-ig2zSXAB.js → index-C25C1Dg7.js} +1074 -1066
- package/dist/{index-CqgYx0tx.js → index-CCvxPS3E.js} +1 -1
- package/dist/index-eGvSlWMU.js +1892 -0
- package/dist/{lz-string-CRDgHWib.js → lz-string-CVEGZpSC.js} +1 -1
- package/dist/{netsuite-CaILEA4R.js → netsuite-DEhdSyBn.js} +9 -3
- package/dist/{predefined-templates-CTLn4dgR.js → predefined-templates-BTdQl7jj.js} +1 -1
- package/dist/{purchase-order-template-CE4_gQyK.js → purchase-order-template-DfMmpsrJ.js} +1 -1
- package/dist/{recalculationUtils-DoBJhZjA.js → recalculationUtils-Ds9Jcg0l.js} +1 -1
- package/dist/router/name.d.ts +2 -3
- package/dist/{row-action.enum-ncgDYAjP.js → row-action.enum-B2Y5YFbc.js} +2 -2
- package/dist/rules-D01xYhgI.js +238 -0
- package/dist/{stock-WxsPiRKa.js → stock-D3kBNq3e.js} +1 -1
- package/dist/stock-DyTC4Teu.js +74 -0
- package/dist/stores/feature.d.ts +20 -2
- package/dist/stores/integration/codemax.d.ts +2 -2
- package/dist/stores/integration/foodmarkethub.d.ts +2 -2
- package/dist/stores/integration/netsuite.d.ts +2 -2
- package/dist/stores/inventory.d.ts +0 -47
- 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 +49 -49
- package/dist/stores/warehouse.d.ts +3 -2
- package/dist/style.css +1 -1
- package/dist/{supplier-DbdPWPj7.js → supplier-DaidezrO.js} +2 -2
- package/dist/{surcharge-BsvY29nN.js → surcharge-C-PFvvlU.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-dxyRNetA.js → uom-rules-Un5bhcrm.js} +1 -1
- package/dist/{use-ingredient-select-dialog-eYM-6q4s.js → use-ingredient-select-dialog-DV_hkAt9.js} +2 -2
- package/dist/use-inventory-binding-dialog-CTceyFrg.js +113 -0
- package/dist/{use-template-enabled-locations-C0o5r4_0.js → use-template-enabled-locations-DGqw8tvz.js} +2 -2
- package/dist/{use-transfer-locations-CC35SlyA.js → use-transfer-locations-DgtKajec.js} +2 -2
- package/dist/{useHrmPermission-DxzYJX4n.js → useHrmPermission-BMpZlah6.js} +1 -1
- package/dist/useNavigationMenu-D0NtXAnB.js +346 -0
- package/dist/{useSseClient-ml-_A-4u.js → useSseClient-CHZZxy7Z.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/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 +18 -18
- 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/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +0 -1
- package/dist/views/ingredients/components/inventory-binding/composables/use-inventory-binding-dialog.d.ts +0 -1
- package/dist/views/ingredients/components/inventory-binding/recipe-amount-validation.spec.d.ts +1 -0
- package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +0 -1
- package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +0 -1
- package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +1 -1
- package/dist/{components/PremiumBadge.vue.d.ts → views/integration/IntegrationPlatformView.vue.d.ts} +11 -13
- package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +4 -4
- package/dist/views/integration/components/ApplyProductDialogCodemax.vue.d.ts +4 -4
- package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +4 -4
- package/dist/views/integration/components/CodemaxDialog.vue.d.ts +4 -4
- package/dist/views/integration/components/IntegrationCard.vue.d.ts +38 -0
- 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/features/detail/ProductionRunDetailTabs.spec.d.ts +1 -0
- package/dist/views/production-run/features/detail/{ProductionRunTabs.vue.d.ts → ProductionRunDetailTabs.vue.d.ts} +4 -8
- package/dist/views/production-run/features/detail/ProductionRunOverviewTab.vue.d.ts +2 -2
- package/dist/views/production-run/features/detail/use-production-run-detail.d.ts +4 -4
- package/dist/views/production-run/features/lifecycle/CancelRunDialog.vue.d.ts +2 -2
- package/dist/views/production-run/features/lifecycle/CloseRunDialog.vue.d.ts +2 -2
- package/dist/views/production-run/features/lifecycle/ProductionRunLifecycleDialogs.vue.d.ts +11 -11
- package/dist/views/production-run/features/lifecycle/TargetReachedDialog.vue.d.ts +2 -2
- package/dist/views/production-run/features/planning/ProductionRunFormDialog.vue.d.ts +2 -2
- package/dist/views/production-run/features/planning/use-production-run-duplicate-sources.d.ts +3 -3
- package/dist/views/production-run/features/prepare/production-run-prepare-sheet.d.ts +0 -9
- package/dist/views/production-run/shared/helpers/production-run-navigation.d.ts +0 -2
- package/dist/views/production-run/shared/model/production-run-list.d.ts +0 -1
- package/dist/views/production-run/shared/ui/ProductionRunScrollHint.vue.d.ts +10 -0
- 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-table.d.ts +42 -42
- package/dist/views/receive-request/import/export.spec.d.ts +1 -0
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +42 -42
- 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/bulk-edit-simulation.helper.d.ts +0 -1
- package/dist/views/recipe/helper/import-recipe.d.ts +2 -2
- 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/{integration/components/IntegrationSyncLogTab.vue.d.ts → settings/PlanLicenseDisplay.vue.d.ts} +2 -2
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +72 -44
- package/dist/views/stock/components/dialog/AmendAdjustmentForm.spec.d.ts +1 -0
- package/dist/views/stock/components/dialog/ConvertSkuDialog.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/warehouse/components/WarehouseForm.vue.d.ts +6 -4
- package/dist/{vue-i18n-DYapak10.js → vue-i18n-mXrQUZTi.js} +235 -235
- package/dist/{xlsx.util-DrElrKDx.js → xlsx.util-CKx0NYTq.js} +2 -2
- package/package.json +72 -67
- package/dist/App-CBS1Tqpl.js +0 -1476
- package/dist/ClosingHistoryView-3z17ZJzK.js +0 -761
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CB50Gqot.js +0 -243
- package/dist/FmMultiselectDialog-7xh6h5AX.js +0 -77
- package/dist/ImportView-C3Fc0e_X.js +0 -1302
- package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-6naVJEke.js +0 -51
- package/dist/IngredientGroupView-DA1buE1C.js +0 -985
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-tEKGPtHZ.js +0 -563
- package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cbg0j7Jz.js +0 -72
- package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-Btrg9HNc.js +0 -93
- package/dist/PreviewBadge.vue_vue_type_script_setup_true_lang-DX2MJqL4.js +0 -29
- package/dist/ProductionRunDetailView-DYeSPsIY.js +0 -2284
- package/dist/ProductionRunPreparePrintView-DJOejqOC.js +0 -34
- package/dist/ProductionRunTabs.vue_vue_type_script_setup_true_lang-JKMI-vVw.js +0 -7543
- package/dist/ProductionRunView-Cg3aYOg9.js +0 -911
- package/dist/RecipeView-DC0p9RKL.js +0 -3625
- package/dist/SettingsView-DaKfCVY5.js +0 -698
- package/dist/StockView-DdweBRFv.js +0 -2612
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js +0 -84
- package/dist/TransferTemplateView-CSXcAB3-.js +0 -2327
- package/dist/feature-DtpSrELx.js +0 -1136
- package/dist/number-DE6ovaTs.js +0 -138
- package/dist/random-CSbEbElR.js +0 -10
- package/dist/rules-CkaU7yFU.js +0 -98
- package/dist/stock-B3Q9e174.js +0 -75
- package/dist/use-inventory-binding-dialog-CCV1iieA.js +0 -152
- package/dist/useNavigationMenu-IKam6CEf.js +0 -172
- package/dist/usePromise-CbVUCxhj.js +0 -29
- package/dist/views/ingredient-group/IngredientGroupView.vue.d.ts +0 -3
- package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +0 -31
- package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +0 -10
- package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +0 -21
- package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +0 -12
- package/dist/views/ingredient-group/components/ingredient-group-rule-field/IngredientGroupRuleField.vue.d.ts +0 -37
- package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +0 -24
- package/dist/views/ingredient-group/composables/use-ingredient-group-rule-item.d.ts +0 -31
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +0 -77
- package/dist/views/integration/composables/use-integration-sync-log.d.ts +0 -45
- /package/dist/components/{FmFeatureFlagDialog.vue.d.ts → DeprecateSoonPill.vue.d.ts} +0 -0
- /package/dist/{views/production-run/ProductionRunPreparePrintView.spec.d.ts → components/FeatureCapabilityGate.spec.d.ts} +0 -0
- /package/dist/{views/production-run/features/detail/ProductionRunTabs.spec.d.ts → components/NumberPrecisionInput.spec.d.ts} +0 -0
- /package/dist/{views/production-run/features/prepare/production-run-prepare-sheet-cleanup.spec.d.ts → feature-flags/core.spec.d.ts} +0 -0
- /package/dist/views/{production-run/ProductionRunPreparePrintView.vue.d.ts → settings/FeatureFlagView.vue.d.ts} +0 -0
|
@@ -1,74 +1,73 @@
|
|
|
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
|
|
1
|
+
import { ref as P, defineComponent as xe, computed as g, resolveComponent as S, createElementBlock as V, openBlock as p, Fragment as ee, createCommentVNode as L, createVNode as s, 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 Ot, watch as _t, useModel as Bt, createTextVNode as xt, isRef as rt, createSlots as kt, normalizeStyle as Dt, 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-OztWApio.js";
|
|
3
3
|
import { useDialog as Ke, useSnackbar as Ae, components as ze, useProxiedModel as ft, useDialogChild as Ht, useBreakpoints as Yt } from "@feedmepos/ui-library";
|
|
4
4
|
import { i as Kt, _ as Gt, m as Jt } from "./menu-usage-module-BdjYEk3s.js";
|
|
5
|
-
import { F as
|
|
5
|
+
import { F as j } from "./form-mode.enum-BKiNVH6A.js";
|
|
6
6
|
import { useI18n as pe, useCoreStore as Ge } from "@feedmepos/mf-common";
|
|
7
7
|
import { defineStore as Qt, storeToRefs as Xt } from "pinia";
|
|
8
|
-
import { D as yt, R as Pe } from "./row-action.enum-
|
|
8
|
+
import { D as yt, R as Pe } from "./row-action.enum-B2Y5YFbc.js";
|
|
9
9
|
import { c as Zt } from "./component-BmLAdDiY.js";
|
|
10
|
-
import { u as Ee, _ as en } from "./netsuite-
|
|
10
|
+
import { u as Ee, _ as en } from "./netsuite-DEhdSyBn.js";
|
|
11
11
|
import { F as Be } from "./FmAdminBadge-DlplQOHb.js";
|
|
12
12
|
import { u as tn, _ as nn } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
|
|
13
|
-
import { A as Oe, R as Le, U as
|
|
14
|
-
import { g as
|
|
15
|
-
import { _ as
|
|
16
|
-
import { _ as qe } from "./
|
|
17
|
-
import { u as Tt } from "./feature-
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { _ as fn } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-CG1m-B2p.js";
|
|
13
|
+
import { A as Oe, t as on, a as ln, R as Le, U as an, M as sn, g as rn } from "./rules-D01xYhgI.js";
|
|
14
|
+
import { g as dn, _ as je, S as We, a as un } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CewKTZzy.js";
|
|
15
|
+
import { _ as cn } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CNjTdNL7.js";
|
|
16
|
+
import { _ as qe, u as mn } from "./FmMultiselectDialog-Bx9cLdYs.js";
|
|
17
|
+
import { u as Tt } from "./feature-BUVZ_ab3.js";
|
|
18
|
+
import { _ as ke } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BUYI8koH.js";
|
|
19
|
+
import { d as Re, g as pn, e as vn, a as fn } from "./import-export.helper-BdQ_d-fT.js";
|
|
20
|
+
import { _ as yn } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-CG1m-B2p.js";
|
|
22
21
|
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 {
|
|
22
|
+
import { F as gn, a as He } from "./FmMultiselectDialog-DvaWLGY5.js";
|
|
23
|
+
import { u as Vt } from "./purchase-order-template-DfMmpsrJ.js";
|
|
24
|
+
import { u as It, a as St } from "./closing-template-DIxXDgZQ.js";
|
|
25
|
+
import { _ as bn } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
|
|
26
|
+
import { F as gt } from "./index-eGvSlWMU.js";
|
|
27
|
+
import { r as hn } from "./xlsx.util-CKx0NYTq.js";
|
|
28
|
+
import { F as _n } from "./FmDroppableField-J0tG_U3w.js";
|
|
29
|
+
import { _ as xn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CiBhz5sq.js";
|
|
31
30
|
import { P as kn, J as wn } from "./app-C39bYJmq.js";
|
|
32
31
|
const Ye = Qt("ingredientForm", function() {
|
|
33
|
-
const
|
|
32
|
+
const h = Ke(), k = Ae(), d = Fe(), _ = P(!1), { t: C } = pe(), A = P();
|
|
34
33
|
function U() {
|
|
35
34
|
const a = {
|
|
36
35
|
sku: {},
|
|
37
|
-
mode:
|
|
36
|
+
mode: j.CREATE,
|
|
38
37
|
show: !0,
|
|
39
|
-
"onUpdate:show"(
|
|
40
|
-
A.value.show =
|
|
38
|
+
"onUpdate:show"(c) {
|
|
39
|
+
A.value.show = c;
|
|
41
40
|
}
|
|
42
41
|
};
|
|
43
42
|
A.value = a;
|
|
44
43
|
}
|
|
45
44
|
async function l(a) {
|
|
46
|
-
const
|
|
45
|
+
const c = {
|
|
47
46
|
sku: wt(a),
|
|
48
|
-
mode:
|
|
47
|
+
mode: j.UPDATE,
|
|
49
48
|
show: !0,
|
|
50
49
|
"onUpdate:show"(r) {
|
|
51
50
|
A.value.show = r;
|
|
52
51
|
}
|
|
53
52
|
};
|
|
54
|
-
A.value =
|
|
53
|
+
A.value = c;
|
|
55
54
|
}
|
|
56
55
|
async function i(a) {
|
|
57
|
-
|
|
56
|
+
_.value = !0;
|
|
58
57
|
try {
|
|
59
|
-
await
|
|
58
|
+
await d.deleteSku(a), k.open({
|
|
60
59
|
title: "Success",
|
|
61
60
|
message: `Deleted ${a.name}`,
|
|
62
61
|
type: "success"
|
|
63
62
|
});
|
|
64
|
-
} catch (
|
|
65
|
-
if (
|
|
66
|
-
|
|
63
|
+
} catch (c) {
|
|
64
|
+
if (c instanceof Lt && Kt(c)) {
|
|
65
|
+
h.open({
|
|
67
66
|
title: "Cannot delete ingredient",
|
|
68
67
|
contentComponent: Gt,
|
|
69
68
|
contentComponentProps: {
|
|
70
69
|
subject: (a == null ? void 0 : a.name) ?? "",
|
|
71
|
-
items:
|
|
70
|
+
items: c.errorResponse.errors.map((r) => {
|
|
72
71
|
var f;
|
|
73
72
|
return {
|
|
74
73
|
chain: [
|
|
@@ -91,13 +90,13 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
91
90
|
title: `Cannot delete ${a.name}`,
|
|
92
91
|
message: "Please try again.",
|
|
93
92
|
type: "error"
|
|
94
|
-
}), console.error("failed to delete ingredient",
|
|
93
|
+
}), console.error("failed to delete ingredient", c);
|
|
95
94
|
} finally {
|
|
96
|
-
|
|
95
|
+
_.value = !1;
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
98
|
+
function u(a) {
|
|
99
|
+
h.open({
|
|
101
100
|
title: C("inventory.ingredient.delete.title", [(a == null ? void 0 : a.name) ?? ""]),
|
|
102
101
|
closeButton: !1,
|
|
103
102
|
message: C("inventory.ingredient.delete.message"),
|
|
@@ -115,9 +114,9 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
115
114
|
return {
|
|
116
115
|
createIngredient: U,
|
|
117
116
|
updateIngredient: l,
|
|
118
|
-
deleteIngredient:
|
|
117
|
+
deleteIngredient: u,
|
|
119
118
|
ingredientDialogProps: A,
|
|
120
|
-
ingredientViewLoading:
|
|
119
|
+
ingredientViewLoading: _
|
|
121
120
|
};
|
|
122
121
|
}), Tn = {
|
|
123
122
|
key: 0,
|
|
@@ -128,58 +127,58 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
128
127
|
}, An = {
|
|
129
128
|
key: 1,
|
|
130
129
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
131
|
-
}, En = { class: "flex flex-col gap-2 mt-4" }, $n = { class: "flex items-center gap-2 fm-typo-en-body-md-400" }, Mn = { class: "flex flex-wrap gap-2" }, Un = { class: "flex flex-col" }, Pn = { class: "flex flex-col bg-fm-color-bg-secondary font-mono p-4 rounded-md" }, Rn = { 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" }, Dn = /* @__PURE__ */
|
|
130
|
+
}, En = { class: "flex flex-col gap-2 mt-4" }, $n = { class: "flex items-center gap-2 fm-typo-en-body-md-400" }, Mn = { class: "flex flex-wrap gap-2" }, Un = { class: "flex flex-col" }, Pn = { class: "flex flex-col bg-fm-color-bg-secondary font-mono p-4 rounded-md" }, Rn = { 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" }, Dn = /* @__PURE__ */ xe({
|
|
132
131
|
__name: "ItemSubsidiaryTreeDialog",
|
|
133
132
|
props: {
|
|
134
133
|
skuId: {},
|
|
135
134
|
itemName: {},
|
|
136
135
|
itemCode: {}
|
|
137
136
|
},
|
|
138
|
-
setup(
|
|
139
|
-
const
|
|
137
|
+
setup(W) {
|
|
138
|
+
const h = W, { t: k } = pe(), d = Ge(), _ = Ee(), C = P(!1), A = g(() => {
|
|
140
139
|
var r;
|
|
141
|
-
return ((r =
|
|
142
|
-
}), U = g(() =>
|
|
140
|
+
return ((r = d.sessionUser.value) == null ? void 0 : r.role.isAdmin) ?? !1;
|
|
141
|
+
}), U = g(() => _.getSkuSubsidiaries(h.skuId)), l = g(() => {
|
|
143
142
|
const r = /* @__PURE__ */ new Set();
|
|
144
143
|
function f(F) {
|
|
145
|
-
for (const
|
|
146
|
-
|
|
144
|
+
for (const m of F)
|
|
145
|
+
m.isAssigned && (r.add(m.id), U.value.includeChildren && w(m)), m.children && m.children.length > 0 && f(m.children);
|
|
147
146
|
}
|
|
148
147
|
function w(F) {
|
|
149
148
|
if (F.children)
|
|
150
|
-
for (const
|
|
151
|
-
r.add(
|
|
149
|
+
for (const m of F.children)
|
|
150
|
+
r.add(m.id), w(m);
|
|
152
151
|
}
|
|
153
152
|
return f(U.value.subsidiaryTree), r;
|
|
154
153
|
});
|
|
155
154
|
function i(r, f = [], w = !1) {
|
|
156
155
|
const F = [];
|
|
157
|
-
return r.forEach((
|
|
156
|
+
return r.forEach((m, B) => {
|
|
158
157
|
const R = B === r.length - 1, ve = [...f, R];
|
|
159
158
|
let ne = "";
|
|
160
159
|
for (let te = 0; te < f.length; te++)
|
|
161
160
|
ne += f[te] ? " " : "│ ";
|
|
162
161
|
ne += R ? "└── " : "├── ";
|
|
163
|
-
const ue = l.value.has(
|
|
162
|
+
const ue = l.value.has(m.id), oe = m.isAssigned === !0, le = w && !oe;
|
|
164
163
|
if (F.push({
|
|
165
|
-
id:
|
|
166
|
-
name:
|
|
164
|
+
id: m.id,
|
|
165
|
+
name: m.name,
|
|
167
166
|
prefix: f.length === 0 ? "" : ne,
|
|
168
167
|
isHighlighted: ue,
|
|
169
168
|
isDirectlyBound: oe,
|
|
170
169
|
isParentIncludedChild: le,
|
|
171
170
|
isRoot: f.length === 0
|
|
172
|
-
}),
|
|
171
|
+
}), m.children && m.children.length > 0) {
|
|
173
172
|
const te = w || oe && U.value.includeChildren;
|
|
174
|
-
F.push(...i(
|
|
173
|
+
F.push(...i(m.children, ve, te));
|
|
175
174
|
}
|
|
176
175
|
}), F;
|
|
177
176
|
}
|
|
178
|
-
function
|
|
177
|
+
function u(r, f = []) {
|
|
179
178
|
const w = /* @__PURE__ */ new Set();
|
|
180
179
|
for (const F of r) {
|
|
181
|
-
const
|
|
182
|
-
F.isAssigned === !0 &&
|
|
180
|
+
const m = [...f, F.id];
|
|
181
|
+
F.isAssigned === !0 && m.forEach((B) => w.add(B)), F.children && F.children.length > 0 && u(F.children, m).forEach((R) => w.add(R));
|
|
183
182
|
}
|
|
184
183
|
return w;
|
|
185
184
|
}
|
|
@@ -190,36 +189,36 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
190
189
|
children: w.children ? a(w.children, f) : []
|
|
191
190
|
} : null).filter(Boolean);
|
|
192
191
|
}
|
|
193
|
-
const
|
|
192
|
+
const c = g(() => {
|
|
194
193
|
let r = U.value.subsidiaryTree;
|
|
195
|
-
if ((!r || r.length === 0) && (r =
|
|
196
|
-
const f =
|
|
194
|
+
if ((!r || r.length === 0) && (r = _.getBusinessSubsidiaryTree()), !A.value) {
|
|
195
|
+
const f = u(r);
|
|
197
196
|
r = a(r, f);
|
|
198
197
|
}
|
|
199
198
|
return i(r, []);
|
|
200
199
|
});
|
|
201
200
|
return (r, f) => {
|
|
202
201
|
const w = S("FmButton"), F = S("FmDialog");
|
|
203
|
-
return
|
|
204
|
-
o(
|
|
202
|
+
return p(), V(ee, null, [
|
|
203
|
+
o(_).isEnabled ? (p(), V("div", Tn, [
|
|
205
204
|
s(w, {
|
|
206
205
|
"prepend-icon": "info",
|
|
207
206
|
variant: "tertiary",
|
|
208
|
-
onClick: f[0] || (f[0] = Rt((
|
|
207
|
+
onClick: f[0] || (f[0] = Rt((m) => C.value = !0, ["stop"]))
|
|
209
208
|
})
|
|
210
|
-
])) :
|
|
209
|
+
])) : L("", !0),
|
|
211
210
|
s(F, {
|
|
212
211
|
modelValue: C.value,
|
|
213
|
-
"onUpdate:modelValue": f[1] || (f[1] = (
|
|
212
|
+
"onUpdate:modelValue": f[1] || (f[1] = (m) => C.value = m),
|
|
214
213
|
"close-button": "",
|
|
215
214
|
dismissAway: ""
|
|
216
215
|
}, {
|
|
217
|
-
"dialog-header":
|
|
216
|
+
"dialog-header": x(() => [
|
|
218
217
|
n("div", Vn, [
|
|
219
218
|
n("div", In, $(o(k)("inventory.integration.netsuite.subsidiaryHierarchy.title")), 1),
|
|
220
|
-
n("p", Sn, " Name: " + $(
|
|
221
|
-
n("p", Cn, " Code: " + $(
|
|
222
|
-
A.value ? (
|
|
219
|
+
n("p", Sn, " Name: " + $(h.itemName), 1),
|
|
220
|
+
n("p", Cn, " Code: " + $(h.itemCode), 1),
|
|
221
|
+
A.value ? (p(), V("p", Fn, " All subsidiaries are shown since you are an admin. ")) : (p(), V("p", An, " Only showing subsidiaries in your business path and bound subsidiaries. ")),
|
|
223
222
|
n("div", En, [
|
|
224
223
|
n("div", $n, [
|
|
225
224
|
f[2] || (f[2] = n("span", { class: "font-semibold" }, "Include Children Subsidiaries:", -1)),
|
|
@@ -235,7 +234,7 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
235
234
|
n("span", { class: "fm-typo-en-body-sm-400" }, "Directly Bound")
|
|
236
235
|
], -1)),
|
|
237
236
|
s(Be, null, {
|
|
238
|
-
default:
|
|
237
|
+
default: x(() => f[3] || (f[3] = [
|
|
239
238
|
n("div", { class: "flex items-center gap-2 px-2 py-1 rounded-md" }, [
|
|
240
239
|
n("span", { class: "w-3 h-3 rounded-sm bg-blue-400" }),
|
|
241
240
|
n("span", { class: "fm-typo-en-body-sm-400" }, "Included as Child")
|
|
@@ -247,36 +246,36 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
247
246
|
])
|
|
248
247
|
])
|
|
249
248
|
]),
|
|
250
|
-
default:
|
|
249
|
+
default: x(() => [
|
|
251
250
|
n("div", Un, [
|
|
252
251
|
n("div", Pn, [
|
|
253
|
-
(
|
|
254
|
-
key:
|
|
252
|
+
(p(!0), V(ee, null, de(c.value, (m) => (p(), V("div", {
|
|
253
|
+
key: m.id,
|
|
255
254
|
class: "flex items-stretch"
|
|
256
255
|
}, [
|
|
257
|
-
n("span", Rn, $(
|
|
258
|
-
|
|
256
|
+
n("span", Rn, $(m.prefix), 1),
|
|
257
|
+
m.isParentIncludedChild ? (p(), Y(Be, {
|
|
259
258
|
key: 0,
|
|
260
259
|
class: "flex-1"
|
|
261
260
|
}, {
|
|
262
|
-
default:
|
|
261
|
+
default: x(() => [
|
|
263
262
|
n("div", On, [
|
|
264
|
-
n("span", Bn, $(
|
|
263
|
+
n("span", Bn, $(m.name), 1)
|
|
265
264
|
])
|
|
266
265
|
]),
|
|
267
266
|
_: 2
|
|
268
|
-
}, 1024)) : (
|
|
267
|
+
}, 1024)) : (p(), V("div", {
|
|
269
268
|
key: 1,
|
|
270
269
|
class: ie([
|
|
271
270
|
"px-2 py-1 rounded-md flex-1",
|
|
272
|
-
|
|
271
|
+
m.isDirectlyBound ? "border-2 bg-green-200 border-green-400" : "bg-fm-color-bg-primary border border-fm-color-border-secondary"
|
|
273
272
|
])
|
|
274
273
|
}, [
|
|
275
274
|
n("span", {
|
|
276
275
|
class: ie([
|
|
277
|
-
|
|
276
|
+
m.isHighlighted ? "fm-typo-en-body-md-600 text-fm-color-typo-primary" : "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
278
277
|
])
|
|
279
|
-
}, $(
|
|
278
|
+
}, $(m.name), 3)
|
|
280
279
|
], 2))
|
|
281
280
|
]))), 128))
|
|
282
281
|
])
|
|
@@ -290,15 +289,15 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
290
289
|
});
|
|
291
290
|
function Nn() {
|
|
292
291
|
var l;
|
|
293
|
-
const { updateIngredient:
|
|
294
|
-
async function A(i,
|
|
295
|
-
const a = wt(
|
|
292
|
+
const { updateIngredient: W, deleteIngredient: h } = Ye(), k = Fe(), d = Ee(), { t: _ } = pe(), C = Ge();
|
|
293
|
+
async function A(i, u) {
|
|
294
|
+
const a = wt(u);
|
|
296
295
|
if (i === Pe.Edit) {
|
|
297
|
-
await
|
|
296
|
+
await W(a);
|
|
298
297
|
return;
|
|
299
298
|
}
|
|
300
299
|
if (i === Pe.Delete) {
|
|
301
|
-
await
|
|
300
|
+
await h(a);
|
|
302
301
|
return;
|
|
303
302
|
}
|
|
304
303
|
}
|
|
@@ -312,21 +311,21 @@ function Nn() {
|
|
|
312
311
|
] : [],
|
|
313
312
|
{
|
|
314
313
|
accessorKey: "code",
|
|
315
|
-
header: () =>
|
|
314
|
+
header: () => _("inventory.ingredient.code"),
|
|
316
315
|
enableSorting: !0,
|
|
317
316
|
size: 200
|
|
318
317
|
},
|
|
319
318
|
{
|
|
320
319
|
accessorKey: "name",
|
|
321
|
-
header: () =>
|
|
320
|
+
header: () => _("inventory.ingredient.name"),
|
|
322
321
|
enableSorting: !0,
|
|
323
322
|
size: 300,
|
|
324
323
|
cell(i) {
|
|
325
|
-
const
|
|
324
|
+
const u = i.row.original, a = k.skuBindingFlattenCache[u._id], c = a == null ? void 0 : a.inventoryBindings.some(
|
|
326
325
|
(r) => "error" in r && r.reason === "circularDependency"
|
|
327
326
|
);
|
|
328
327
|
return Z("div", { class: "flex items-center w-full gap-4" }, [
|
|
329
|
-
|
|
328
|
+
c ? Z(
|
|
330
329
|
ze.FmTooltip,
|
|
331
330
|
{ class: "text-left" },
|
|
332
331
|
{
|
|
@@ -338,20 +337,20 @@ function Nn() {
|
|
|
338
337
|
});
|
|
339
338
|
},
|
|
340
339
|
content() {
|
|
341
|
-
return
|
|
340
|
+
return _("inventory.inventoryBindings.circularError");
|
|
342
341
|
}
|
|
343
342
|
}
|
|
344
343
|
) : null,
|
|
345
|
-
|
|
344
|
+
u.name
|
|
346
345
|
]);
|
|
347
346
|
}
|
|
348
347
|
},
|
|
349
348
|
{
|
|
350
349
|
id: "unit",
|
|
351
|
-
header: () =>
|
|
350
|
+
header: () => _("inventory.ingredient.unit"),
|
|
352
351
|
accessorFn: (i) => bt(i),
|
|
353
352
|
cell(i) {
|
|
354
|
-
const
|
|
353
|
+
const u = i.row.original, a = bt(u);
|
|
355
354
|
return Z(
|
|
356
355
|
ze.FmTooltip,
|
|
357
356
|
{ zIndex: 51, content: a },
|
|
@@ -369,28 +368,28 @@ function Nn() {
|
|
|
369
368
|
},
|
|
370
369
|
{
|
|
371
370
|
accessorKey: "isInactive",
|
|
372
|
-
header: () =>
|
|
371
|
+
header: () => _("inventory.ingredient.status.title"),
|
|
373
372
|
cell(i) {
|
|
374
|
-
const
|
|
373
|
+
const u = i.row.original.isInactive;
|
|
375
374
|
return Z(
|
|
376
375
|
"span",
|
|
377
376
|
{
|
|
378
377
|
class: [
|
|
379
378
|
"inline-block px-3 py-1 rounded-full text-xs font-semibold",
|
|
380
|
-
|
|
379
|
+
u ? "bg-red-100 text-red-700" : "bg-green-100 text-green-700"
|
|
381
380
|
].join(" ")
|
|
382
381
|
},
|
|
383
|
-
|
|
382
|
+
_(u ? "inventory.ingredient.status.inactive" : "inventory.ingredient.status.active")
|
|
384
383
|
);
|
|
385
384
|
},
|
|
386
385
|
enableSorting: !0
|
|
387
386
|
},
|
|
388
387
|
{
|
|
389
388
|
id: "netsuiteSubsidiary",
|
|
390
|
-
accessorFn: (i) =>
|
|
389
|
+
accessorFn: (i) => d.getSkuSubsidiaries(i._id),
|
|
391
390
|
header: () => "NetSuite Subsidiary",
|
|
392
391
|
cell(i) {
|
|
393
|
-
const
|
|
392
|
+
const u = i.row.original, { flattenedSubsidiaryNames: a } = d.getSkuSubsidiaries(u._id);
|
|
394
393
|
return Z("div", { class: "flex gap-2 items-start" }, [
|
|
395
394
|
Z(
|
|
396
395
|
"span",
|
|
@@ -399,7 +398,7 @@ function Nn() {
|
|
|
399
398
|
},
|
|
400
399
|
a.join(", ")
|
|
401
400
|
),
|
|
402
|
-
Z(Dn, { skuId:
|
|
401
|
+
Z(Dn, { skuId: u._id, itemName: u.name, itemCode: u.code })
|
|
403
402
|
]);
|
|
404
403
|
},
|
|
405
404
|
enableSorting: !1,
|
|
@@ -411,8 +410,8 @@ function Nn() {
|
|
|
411
410
|
cell(i) {
|
|
412
411
|
return Zt(
|
|
413
412
|
[yt[Pe.Edit], yt[Pe.Delete]],
|
|
414
|
-
(
|
|
415
|
-
A(
|
|
413
|
+
(u) => {
|
|
414
|
+
A(u, i.row.original);
|
|
416
415
|
}
|
|
417
416
|
);
|
|
418
417
|
},
|
|
@@ -425,16 +424,16 @@ function Nn() {
|
|
|
425
424
|
}
|
|
426
425
|
] };
|
|
427
426
|
}
|
|
428
|
-
function bt(
|
|
429
|
-
var
|
|
430
|
-
if (
|
|
431
|
-
const k = (
|
|
427
|
+
function bt(W) {
|
|
428
|
+
var h;
|
|
429
|
+
if (W.trackingMeasurement) {
|
|
430
|
+
const k = (h = W.unit.measurements) == null ? void 0 : h.find((d) => d.id === W.trackingMeasurement);
|
|
432
431
|
if (k)
|
|
433
432
|
return `${k.name} (${k.abbrev})`;
|
|
434
433
|
}
|
|
435
|
-
return `${
|
|
434
|
+
return `${W.unit.name} (${W.unit.abbrev})`;
|
|
436
435
|
}
|
|
437
|
-
const zn = /* @__PURE__ */
|
|
436
|
+
const zn = /* @__PURE__ */ xe({
|
|
438
437
|
__name: "ConvertForm",
|
|
439
438
|
props: {
|
|
440
439
|
modelValue: {},
|
|
@@ -443,45 +442,45 @@ const zn = /* @__PURE__ */ ke({
|
|
|
443
442
|
readonly: { type: Boolean }
|
|
444
443
|
},
|
|
445
444
|
emits: ["update:modelValue"],
|
|
446
|
-
setup(
|
|
447
|
-
const k =
|
|
448
|
-
var
|
|
449
|
-
return (
|
|
450
|
-
}),
|
|
451
|
-
var
|
|
452
|
-
return (
|
|
453
|
-
}), C =
|
|
445
|
+
setup(W, { emit: h }) {
|
|
446
|
+
const k = W, d = g(() => {
|
|
447
|
+
var c;
|
|
448
|
+
return (c = k.rootValue) == null ? void 0 : c.unit;
|
|
449
|
+
}), _ = g(() => {
|
|
450
|
+
var c;
|
|
451
|
+
return (c = k.rootValue) == null ? void 0 : c._id;
|
|
452
|
+
}), C = h, { t: A } = pe(), U = g({
|
|
454
453
|
get() {
|
|
455
454
|
return !!k.modelValue;
|
|
456
455
|
},
|
|
457
|
-
set(
|
|
458
|
-
|
|
456
|
+
set(c) {
|
|
457
|
+
c ? C("update:modelValue", {
|
|
459
458
|
measurement: null,
|
|
460
459
|
inventoryBindings: []
|
|
461
460
|
}) : C("update:modelValue", null);
|
|
462
461
|
}
|
|
463
|
-
}), l = g(() =>
|
|
464
|
-
function i(
|
|
462
|
+
}), l = g(() => dn(d.value));
|
|
463
|
+
function i(c) {
|
|
465
464
|
const r = k.modelValue ?? {};
|
|
466
|
-
r.measurement =
|
|
465
|
+
r.measurement = c ? `${c}` : null, C("update:modelValue", r);
|
|
467
466
|
}
|
|
468
|
-
function
|
|
467
|
+
function u(c) {
|
|
469
468
|
const r = k.modelValue ?? {};
|
|
470
|
-
r.inventoryBindings =
|
|
469
|
+
r.inventoryBindings = c, C("update:modelValue", r);
|
|
471
470
|
}
|
|
472
471
|
const a = g(() => {
|
|
473
472
|
if (!k.modelValue) return null;
|
|
474
|
-
const
|
|
475
|
-
return
|
|
473
|
+
const c = k.modelValue;
|
|
474
|
+
return c.measurement ? l.value.find((r) => r.value === c.measurement) ?? null : l.value.find((r) => r.value === null) ?? null;
|
|
476
475
|
});
|
|
477
|
-
return (
|
|
476
|
+
return (c, r) => {
|
|
478
477
|
const f = S("FmSwitch"), w = S("FmSelect"), F = S("FmCard");
|
|
479
|
-
return
|
|
478
|
+
return p(), Y(F, {
|
|
480
479
|
variant: "outlined",
|
|
481
480
|
class: "p-16 flex flex-col gap-16"
|
|
482
481
|
}, {
|
|
483
|
-
default:
|
|
484
|
-
var
|
|
482
|
+
default: x(() => {
|
|
483
|
+
var m, B;
|
|
485
484
|
return [
|
|
486
485
|
s(f, {
|
|
487
486
|
value: "",
|
|
@@ -490,59 +489,59 @@ const zn = /* @__PURE__ */ ke({
|
|
|
490
489
|
label: o(A)("inventory.ingredient.convertible.title"),
|
|
491
490
|
sublabel: o(A)("inventory.ingredient.convertible.subtitle"),
|
|
492
491
|
labelPlacement: "right",
|
|
493
|
-
disabled:
|
|
492
|
+
disabled: c.readonly
|
|
494
493
|
}, null, 8, ["model-value", "label", "sublabel", "disabled"]),
|
|
495
|
-
U.value ? (
|
|
494
|
+
U.value ? (p(), V(ee, { key: 0 }, [
|
|
496
495
|
n("div", null, [
|
|
497
496
|
s(w, {
|
|
498
497
|
label: o(A)("inventory.ingredient.convertible.convertTo"),
|
|
499
|
-
modelValue: (
|
|
498
|
+
modelValue: (m = a.value) == null ? void 0 : m.value,
|
|
500
499
|
"onUpdate:modelValue": i,
|
|
501
500
|
items: l.value,
|
|
502
|
-
disabled:
|
|
501
|
+
disabled: c.readonly
|
|
503
502
|
}, null, 8, ["label", "modelValue", "items", "disabled"])
|
|
504
503
|
]),
|
|
505
|
-
s(
|
|
506
|
-
id:
|
|
507
|
-
"model-value": ((B =
|
|
508
|
-
"onUpdate:modelValue":
|
|
509
|
-
"exclude-binding-id":
|
|
504
|
+
s(cn, {
|
|
505
|
+
id: _.value,
|
|
506
|
+
"model-value": ((B = c.modelValue) == null ? void 0 : B.inventoryBindings) ?? [],
|
|
507
|
+
"onUpdate:modelValue": u,
|
|
508
|
+
"exclude-binding-id": _.value,
|
|
510
509
|
rules: [o(Oe)(1)],
|
|
511
|
-
readonly:
|
|
510
|
+
readonly: c.readonly,
|
|
512
511
|
"allow-recipe-decimal": ""
|
|
513
512
|
}, null, 8, ["id", "model-value", "exclude-binding-id", "rules", "readonly"])
|
|
514
|
-
], 64)) :
|
|
513
|
+
], 64)) : L("", !0)
|
|
515
514
|
];
|
|
516
515
|
}),
|
|
517
516
|
_: 1
|
|
518
517
|
});
|
|
519
518
|
};
|
|
520
519
|
}
|
|
521
|
-
}), Ln = { class: "flex gap-8" }, jn = { class: "flex-1" }, Wn = { class: "flex-1" }, qn = { class: "flex flex-col gap-5" }, Hn = { class: "text-fm-color-typo-secondary" },
|
|
522
|
-
key:
|
|
520
|
+
}), Ln = { class: "flex gap-8" }, jn = { class: "flex-1" }, Wn = { class: "flex-1" }, qn = { class: "flex flex-col gap-5" }, Hn = { class: "flex flex-col gap-32" }, Yn = { class: "flex items-center gap-8" }, Kn = { class: "flex items-center gap-8" }, Gn = { class: "flex items-center gap-8" }, Jn = { class: "text-fm-color-typo-secondary" }, Qn = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Xn = {
|
|
521
|
+
key: 1,
|
|
523
522
|
class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
524
|
-
},
|
|
525
|
-
key:
|
|
523
|
+
}, Zn = { class: "flex flex-col" }, eo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, to = {
|
|
524
|
+
key: 2,
|
|
526
525
|
class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
527
|
-
},
|
|
528
|
-
key:
|
|
526
|
+
}, no = { class: "flex flex-col gap-12" }, oo = { class: "flex flex-col gap-4" }, lo = { class: "flex items-center gap-8" }, ao = { class: "fm-typo-en-title-sm-600" }, so = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ro = { class: "flex flex-col gap-4" }, io = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, uo = { class: "flex-1 p-12 flex flex-col gap-8" }, co = { class: "mx-auto" }, mo = { class: "flex flex-col" }, po = { class: "fm-typo-en-body-sm-600 translate-y-4" }, vo = { class: "flex-1 p-12 flex flex-col gap-8" }, fo = { class: "mx-auto" }, yo = { class: "flex flex-col" }, go = { class: "fm-typo-en-body-sm-600 translate-y-4" }, bo = { class: "flex-1 p-12 flex flex-col gap-8" }, ho = { class: "mx-auto" }, _o = { class: "flex flex-col" }, xo = { class: "fm-typo-en-body-sm-600 translate-y-4" }, ko = {
|
|
527
|
+
key: 3,
|
|
529
528
|
class: "flex flex-col gap-12"
|
|
530
|
-
},
|
|
529
|
+
}, wo = { class: "flex flex-col" }, To = { class: "flex items-center justify-between" }, Vo = { class: "flex items-center gap-8" }, Io = { class: "fm-typo-en-title-sm-600" }, So = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Co = {
|
|
531
530
|
key: 0,
|
|
532
531
|
class: "flex flex-col gap-8"
|
|
533
|
-
},
|
|
534
|
-
key:
|
|
532
|
+
}, Fo = { class: "flex flex-wrap gap-8" }, Ao = {
|
|
533
|
+
key: 4,
|
|
535
534
|
class: "flex flex-col gap-12"
|
|
536
|
-
},
|
|
535
|
+
}, Eo = { class: "flex flex-col" }, $o = { class: "flex items-center justify-between" }, Mo = { class: "flex items-center gap-8" }, Uo = { class: "fm-typo-en-title-sm-600" }, Po = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ro = {
|
|
537
536
|
key: 0,
|
|
538
537
|
class: "flex flex-col gap-8"
|
|
539
|
-
},
|
|
540
|
-
key:
|
|
538
|
+
}, Oo = { class: "flex flex-wrap gap-8" }, Bo = {
|
|
539
|
+
key: 5,
|
|
541
540
|
class: "flex flex-col gap-12"
|
|
542
|
-
},
|
|
541
|
+
}, Do = { class: "flex flex-col" }, No = { class: "flex items-center justify-between" }, zo = { class: "flex items-center gap-8" }, Lo = { class: "fm-typo-en-title-sm-600" }, jo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Wo = {
|
|
543
542
|
key: 0,
|
|
544
543
|
class: "flex flex-col gap-8"
|
|
545
|
-
},
|
|
544
|
+
}, qo = { class: "flex flex-wrap gap-8" }, Ho = /* @__PURE__ */ xe({
|
|
546
545
|
__name: "IngredientForm",
|
|
547
546
|
props: /* @__PURE__ */ st({
|
|
548
547
|
mode: {},
|
|
@@ -556,23 +555,23 @@ const zn = /* @__PURE__ */ ke({
|
|
|
556
555
|
searchModifiers: {}
|
|
557
556
|
}),
|
|
558
557
|
emits: /* @__PURE__ */ st(["update:modelValue", "click:submit", "update:purchaseOrderTemplateIds", "update:wastageTemplateIds", "update:closingTemplateIds"], ["update:search"]),
|
|
559
|
-
setup(
|
|
558
|
+
setup(W, { expose: h, emit: k }) {
|
|
560
559
|
var Xe;
|
|
561
|
-
const { t:
|
|
560
|
+
const { t: d } = pe(), _ = Ke();
|
|
562
561
|
Ae();
|
|
563
|
-
const C = Vt(), A = It(), U = St(), l =
|
|
562
|
+
const C = Vt(), A = It(), U = St(), l = W, i = k, u = Fe(), a = Ge(), c = Tt(), r = Ee(), f = g(() => r.isEnabled);
|
|
564
563
|
P(void 0);
|
|
565
|
-
const w = P([]), F = P([]),
|
|
564
|
+
const w = P([]), F = P([]), m = P([]), B = P(!1);
|
|
566
565
|
function R(e) {
|
|
567
566
|
if (e.length === 0) return;
|
|
568
|
-
const t = e[0],
|
|
569
|
-
unit:
|
|
567
|
+
const t = e[0], b = l.modelValue ?? {
|
|
568
|
+
unit: u.units.find((I) => I)
|
|
570
569
|
};
|
|
571
|
-
|
|
570
|
+
b.unit || (b.unit = t, i("update:modelValue", b));
|
|
572
571
|
}
|
|
573
572
|
Ot(() => {
|
|
574
|
-
R(
|
|
575
|
-
}), _t([() =>
|
|
573
|
+
R(u.units), l.mode === j.CREATE && (c.mustUsePoTemplate && ne(), c.enableWastageTemplate && ue(), c.enableClosingTemplate && oe());
|
|
574
|
+
}), _t([() => u.units], ([e]) => {
|
|
576
575
|
R(e);
|
|
577
576
|
});
|
|
578
577
|
function ve() {
|
|
@@ -603,12 +602,12 @@ const zn = /* @__PURE__ */ ke({
|
|
|
603
602
|
}
|
|
604
603
|
}
|
|
605
604
|
async function oe() {
|
|
606
|
-
|
|
605
|
+
m.value = [], B.value = !0;
|
|
607
606
|
try {
|
|
608
607
|
const [e] = await Promise.all([U.listTemplates()]).delayed(
|
|
609
608
|
1e3
|
|
610
609
|
);
|
|
611
|
-
|
|
610
|
+
m.value = e;
|
|
612
611
|
} catch (e) {
|
|
613
612
|
console.log("Something went wrong when fetching closing templates:", e);
|
|
614
613
|
} finally {
|
|
@@ -650,12 +649,12 @@ const zn = /* @__PURE__ */ ke({
|
|
|
650
649
|
}
|
|
651
650
|
}), fe = g({
|
|
652
651
|
get() {
|
|
653
|
-
var t,
|
|
654
|
-
const e = (
|
|
655
|
-
return e ? +
|
|
652
|
+
var t, b;
|
|
653
|
+
const e = (b = (t = l.modelValue) == null ? void 0 : t.defaultCost) == null ? void 0 : b.costPerUnit;
|
|
654
|
+
return e ? +ln(e) : 0;
|
|
656
655
|
},
|
|
657
656
|
set(e) {
|
|
658
|
-
var
|
|
657
|
+
var b, I, H, D;
|
|
659
658
|
const t = l.modelValue ? {
|
|
660
659
|
...l.modelValue
|
|
661
660
|
} : {};
|
|
@@ -663,9 +662,9 @@ const zn = /* @__PURE__ */ ke({
|
|
|
663
662
|
costPerUnit: {
|
|
664
663
|
amount: 0,
|
|
665
664
|
precision: 2,
|
|
666
|
-
currency: ((
|
|
665
|
+
currency: ((b = dt(a.currentCountry.value)) == null ? void 0 : b.currency) ?? "MYR"
|
|
667
666
|
},
|
|
668
|
-
measurement: (D = (
|
|
667
|
+
measurement: (D = (H = (I = l.modelValue) == null ? void 0 : I.unit) == null ? void 0 : H.measurements) == null ? void 0 : D.find(
|
|
669
668
|
(se) => {
|
|
670
669
|
var re;
|
|
671
670
|
return se.id === ((re = l.modelValue) == null ? void 0 : re.trackingMeasurement);
|
|
@@ -673,57 +672,57 @@ const zn = /* @__PURE__ */ ke({
|
|
|
673
672
|
)
|
|
674
673
|
}), t.defaultCost.costPerUnit = {
|
|
675
674
|
...t.defaultCost.costPerUnit,
|
|
676
|
-
...
|
|
675
|
+
...on(+e, 4)
|
|
677
676
|
}, i("update:modelValue", t);
|
|
678
677
|
}
|
|
679
678
|
}), ye = g(() => {
|
|
680
|
-
var t,
|
|
681
|
-
const e = ((t = l.modelValue) == null ? void 0 : t.unit) ??
|
|
679
|
+
var t, b, I;
|
|
680
|
+
const e = ((t = l.modelValue) == null ? void 0 : t.unit) ?? u.units.find((H) => H);
|
|
682
681
|
return e ? {
|
|
683
682
|
_id: e._id,
|
|
684
|
-
measurement: (
|
|
685
|
-
name: ((I = e.measurements.find((
|
|
683
|
+
measurement: (b = l.modelValue) == null ? void 0 : b.trackingMeasurement,
|
|
684
|
+
name: ((I = e.measurements.find((H) => {
|
|
686
685
|
var D;
|
|
687
|
-
return
|
|
686
|
+
return H.id === ((D = l.modelValue) == null ? void 0 : D.trackingMeasurement);
|
|
688
687
|
})) == null ? void 0 : I.name) ?? e.name
|
|
689
688
|
} : null;
|
|
690
689
|
}), we = g(
|
|
691
|
-
() =>
|
|
690
|
+
() => u.units.flatMap(({ name: e, _id: t, abbrev: b, measurements: I }) => [
|
|
692
691
|
{
|
|
693
692
|
label: `${e}`,
|
|
694
693
|
value: null,
|
|
695
694
|
displayAsSection: !0
|
|
696
695
|
},
|
|
697
696
|
{
|
|
698
|
-
label: `${e} (${
|
|
697
|
+
label: `${e} (${b})`,
|
|
699
698
|
value: { _id: t },
|
|
700
699
|
displayAsSection: !1
|
|
701
700
|
},
|
|
702
|
-
...I.map(({ id:
|
|
701
|
+
...I.map(({ id: H, name: D, abbrev: se }) => ({
|
|
703
702
|
label: `${D} (${se})`,
|
|
704
|
-
value: { _id: t, measurement:
|
|
703
|
+
value: { _id: t, measurement: H },
|
|
705
704
|
displayAsSection: !1
|
|
706
705
|
}))
|
|
707
706
|
])
|
|
708
|
-
), y = Bt(
|
|
709
|
-
() => new
|
|
707
|
+
), y = Bt(W, "search"), M = g(
|
|
708
|
+
() => new gn(we.value, ["label", "value"], {
|
|
710
709
|
caseSensitive: !1,
|
|
711
710
|
sort: !0
|
|
712
711
|
})
|
|
713
712
|
), G = g(() => M.value.search(y.value));
|
|
714
713
|
function E(e) {
|
|
715
|
-
var t,
|
|
716
|
-
return ((
|
|
714
|
+
var t, b, I, H, D;
|
|
715
|
+
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) === ((D = e.value) == null ? void 0 : D.measurement);
|
|
717
716
|
}
|
|
718
717
|
function v(e) {
|
|
719
718
|
var se, re;
|
|
720
719
|
if (!e) return;
|
|
721
|
-
const { _id: t, measurement:
|
|
722
|
-
if (!
|
|
720
|
+
const { _id: t, measurement: b } = e, I = b || void 0, H = u.units.find((Se) => Se._id === t);
|
|
721
|
+
if (!H)
|
|
723
722
|
return;
|
|
724
723
|
const D = l.modelValue ?? {};
|
|
725
|
-
D.unit =
|
|
726
|
-
measurement:
|
|
724
|
+
D.unit = H, D.trackingMeasurement = I, D.convert && (D.convert.measurement = I || null), D.defaultCost = {
|
|
725
|
+
measurement: H.measurements.find((Se) => Se.id === I),
|
|
727
726
|
costPerUnit: {
|
|
728
727
|
...((se = D.defaultCost) == null ? void 0 : se.costPerUnit) ?? {
|
|
729
728
|
amount: 0,
|
|
@@ -731,9 +730,9 @@ const zn = /* @__PURE__ */ ke({
|
|
|
731
730
|
currency: ((re = dt(a.currentCountry.value)) == null ? void 0 : re.currency) ?? "MYR"
|
|
732
731
|
}
|
|
733
732
|
}
|
|
734
|
-
}
|
|
733
|
+
}, i("update:modelValue", D);
|
|
735
734
|
}
|
|
736
|
-
const
|
|
735
|
+
const N = g({
|
|
737
736
|
get() {
|
|
738
737
|
var e;
|
|
739
738
|
return ((e = l.modelValue) == null ? void 0 : e.convert) ?? null;
|
|
@@ -750,9 +749,9 @@ const zn = /* @__PURE__ */ ke({
|
|
|
750
749
|
e === ut.enum.WAVG
|
|
751
750
|
)
|
|
752
751
|
).map((e) => ({
|
|
753
|
-
label:
|
|
752
|
+
label: d(`inventory.ingredient.valuationMethod.${e}`),
|
|
754
753
|
value: e
|
|
755
|
-
}))),
|
|
754
|
+
}))), ce = g({
|
|
756
755
|
get() {
|
|
757
756
|
var e;
|
|
758
757
|
return ((e = l.modelValue) == null ? void 0 : e.valuation) ?? "WAVG";
|
|
@@ -774,57 +773,57 @@ const zn = /* @__PURE__ */ ke({
|
|
|
774
773
|
} : {};
|
|
775
774
|
t.customAttributes = e, i("update:modelValue", t);
|
|
776
775
|
}
|
|
777
|
-
}),
|
|
778
|
-
|
|
776
|
+
}), q = P();
|
|
777
|
+
h({
|
|
779
778
|
validateInputs: () => {
|
|
780
779
|
var e, t;
|
|
781
|
-
(t = (e =
|
|
780
|
+
(t = (e = q.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
|
|
782
781
|
},
|
|
783
782
|
resetInputsValidation: () => {
|
|
784
783
|
var e, t;
|
|
785
|
-
(t = (e =
|
|
784
|
+
(t = (e = q.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
|
|
786
785
|
},
|
|
787
786
|
resetInputs: () => {
|
|
788
787
|
var e, t;
|
|
789
|
-
(t = (e =
|
|
788
|
+
(t = (e = q.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
|
|
790
789
|
}
|
|
791
790
|
});
|
|
792
791
|
const O = P(!1), K = g(
|
|
793
792
|
() => {
|
|
794
|
-
var e, t,
|
|
795
|
-
return (e = l.modelValue) != null && e._id ? ((
|
|
793
|
+
var e, t, b;
|
|
794
|
+
return (e = l.modelValue) != null && e._id ? ((b = u.menu.bindedBySkuId[(t = l.modelValue) == null ? void 0 : t._id]) == null ? void 0 : b.filter(
|
|
796
795
|
(I) => I.from === "INGREDIENT"
|
|
797
796
|
)) ?? [] : [];
|
|
798
797
|
}
|
|
799
|
-
),
|
|
798
|
+
), z = g(
|
|
800
799
|
() => {
|
|
801
|
-
var e, t,
|
|
802
|
-
return (e = l.modelValue) != null && e._id ? ((
|
|
800
|
+
var e, t, b;
|
|
801
|
+
return (e = l.modelValue) != null && e._id ? ((b = u.menu.bindedBySkuId[(t = l.modelValue) == null ? void 0 : t._id]) == null ? void 0 : b.filter(
|
|
803
802
|
(I) => I.from === "RECIPE"
|
|
804
803
|
)) ?? [] : [];
|
|
805
804
|
}
|
|
806
805
|
), ge = g(
|
|
807
806
|
() => {
|
|
808
|
-
var e, t,
|
|
809
|
-
return (e = l.modelValue) != null && e._id ? ((
|
|
807
|
+
var e, t, b;
|
|
808
|
+
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")) ?? [] : [];
|
|
810
809
|
}
|
|
811
810
|
), $e = g(
|
|
812
|
-
() =>
|
|
811
|
+
() => u.skus.map((e) => ({ label: e.name, value: e.code }))
|
|
813
812
|
), Me = P((Xe = l.modelValue) == null ? void 0 : Xe.code);
|
|
814
813
|
function Ue(e) {
|
|
815
|
-
var
|
|
814
|
+
var b;
|
|
816
815
|
const t = e.el;
|
|
817
|
-
t && ((
|
|
816
|
+
t && ((b = t.querySelector("[x-should-scroll-into=true]")) == null || b.scrollIntoView());
|
|
818
817
|
}
|
|
819
818
|
const be = g(
|
|
820
819
|
() => {
|
|
821
|
-
var e, t,
|
|
822
|
-
return ((I = (
|
|
820
|
+
var e, t, b, I, H, D;
|
|
821
|
+
return ((I = (b = (t = (e = l.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : b.find(
|
|
823
822
|
(se) => {
|
|
824
823
|
var re;
|
|
825
824
|
return se.id === ((re = l.modelValue) == null ? void 0 : re.trackingMeasurement);
|
|
826
825
|
}
|
|
827
|
-
)) == null ? void 0 : I.abbrev) ?? ((D = (
|
|
826
|
+
)) == null ? void 0 : I.abbrev) ?? ((D = (H = l.modelValue) == null ? void 0 : H.unit) == null ? void 0 : D.abbrev);
|
|
828
827
|
}
|
|
829
828
|
), he = g({
|
|
830
829
|
get() {
|
|
@@ -835,12 +834,12 @@ const zn = /* @__PURE__ */ ke({
|
|
|
835
834
|
var I;
|
|
836
835
|
const t = ((I = l.modelValue) == null ? void 0 : I.thresholds) ?? Re();
|
|
837
836
|
t.low = e;
|
|
838
|
-
const
|
|
837
|
+
const b = l.modelValue ? {
|
|
839
838
|
...l.modelValue
|
|
840
839
|
} : {};
|
|
841
|
-
|
|
840
|
+
b.thresholds = t, i("update:modelValue", b);
|
|
842
841
|
}
|
|
843
|
-
}),
|
|
842
|
+
}), me = g({
|
|
844
843
|
get() {
|
|
845
844
|
var e, t;
|
|
846
845
|
return ((t = (e = l.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ?? Re().mid;
|
|
@@ -849,30 +848,30 @@ const zn = /* @__PURE__ */ ke({
|
|
|
849
848
|
var I;
|
|
850
849
|
const t = ((I = l.modelValue) == null ? void 0 : I.thresholds) ?? Re();
|
|
851
850
|
t.mid = e;
|
|
852
|
-
const
|
|
851
|
+
const b = l.modelValue ? {
|
|
853
852
|
...l.modelValue
|
|
854
853
|
} : {};
|
|
855
|
-
|
|
854
|
+
b.thresholds = t, i("update:modelValue", b);
|
|
856
855
|
}
|
|
857
|
-
}), Te = g(() =>
|
|
856
|
+
}), Te = g(() => c.mustUsePoTemplate && l.mode === j.CREATE && w.value.length > 0 ? w.value.map((e) => ({
|
|
858
857
|
label: e.name || "Template",
|
|
859
858
|
value: e._id || "template_" + e.name
|
|
860
859
|
})) : []), Ve = g(() => Te.value.filter(
|
|
861
860
|
(e) => (l.purchaseOrderTemplateIds ?? []).includes(e.value)
|
|
862
|
-
)), _e = g(() =>
|
|
861
|
+
)), _e = g(() => c.enableWastageTemplate && l.mode === j.CREATE && F.value.length > 0 ? F.value.map((e) => ({
|
|
863
862
|
label: e.name || "Template",
|
|
864
863
|
value: e._id || "template_" + e.name
|
|
865
864
|
})) : []), Ie = g(() => _e.value.filter(
|
|
866
865
|
(e) => (l.wastageTemplateIds ?? []).includes(e.value)
|
|
867
|
-
)), Je = g(() =>
|
|
866
|
+
)), Je = g(() => c.enableClosingTemplate && l.mode === j.CREATE && m.value.length > 0 ? m.value.map((e) => ({
|
|
868
867
|
label: e.name || "Template",
|
|
869
868
|
value: e._id || "template_" + e.name
|
|
870
869
|
})) : []), Qe = g(() => Je.value.filter(
|
|
871
870
|
(e) => (l.closingTemplateIds ?? []).includes(e.value)
|
|
872
871
|
));
|
|
873
872
|
function Ct() {
|
|
874
|
-
|
|
875
|
-
title:
|
|
873
|
+
_.open({
|
|
874
|
+
title: d("inventory.ingredient.purchaseOrderTemplates.selectTitle"),
|
|
876
875
|
closeButton: !0,
|
|
877
876
|
contentComponent: He,
|
|
878
877
|
contentComponentProps: {
|
|
@@ -880,11 +879,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
880
879
|
items: Te.value
|
|
881
880
|
},
|
|
882
881
|
primaryActions: {
|
|
883
|
-
text:
|
|
882
|
+
text: d("common.confirm"),
|
|
884
883
|
close: !0
|
|
885
884
|
},
|
|
886
885
|
secondaryActions: {
|
|
887
|
-
text:
|
|
886
|
+
text: d("common.cancel"),
|
|
888
887
|
close: !0,
|
|
889
888
|
variant: "tertiary"
|
|
890
889
|
}
|
|
@@ -893,8 +892,8 @@ const zn = /* @__PURE__ */ ke({
|
|
|
893
892
|
});
|
|
894
893
|
}
|
|
895
894
|
function Ft() {
|
|
896
|
-
|
|
897
|
-
title:
|
|
895
|
+
_.open({
|
|
896
|
+
title: d("inventory.ingredient.wastageTemplates.selectTitle"),
|
|
898
897
|
closeButton: !0,
|
|
899
898
|
contentComponent: He,
|
|
900
899
|
contentComponentProps: {
|
|
@@ -902,11 +901,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
902
901
|
items: _e.value
|
|
903
902
|
},
|
|
904
903
|
primaryActions: {
|
|
905
|
-
text:
|
|
904
|
+
text: d("common.confirm"),
|
|
906
905
|
close: !0
|
|
907
906
|
},
|
|
908
907
|
secondaryActions: {
|
|
909
|
-
text:
|
|
908
|
+
text: d("common.cancel"),
|
|
910
909
|
close: !0,
|
|
911
910
|
variant: "tertiary"
|
|
912
911
|
}
|
|
@@ -915,8 +914,8 @@ const zn = /* @__PURE__ */ ke({
|
|
|
915
914
|
});
|
|
916
915
|
}
|
|
917
916
|
function At() {
|
|
918
|
-
|
|
919
|
-
title:
|
|
917
|
+
_.open({
|
|
918
|
+
title: d("inventory.ingredient.closingTemplates.selectTitle"),
|
|
920
919
|
closeButton: !0,
|
|
921
920
|
contentComponent: He,
|
|
922
921
|
contentComponentProps: {
|
|
@@ -924,11 +923,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
924
923
|
items: Je.value
|
|
925
924
|
},
|
|
926
925
|
primaryActions: {
|
|
927
|
-
text:
|
|
926
|
+
text: d("common.confirm"),
|
|
928
927
|
close: !0
|
|
929
928
|
},
|
|
930
929
|
secondaryActions: {
|
|
931
|
-
text:
|
|
930
|
+
text: d("common.cancel"),
|
|
932
931
|
close: !0,
|
|
933
932
|
variant: "tertiary"
|
|
934
933
|
}
|
|
@@ -942,15 +941,15 @@ const zn = /* @__PURE__ */ ke({
|
|
|
942
941
|
};
|
|
943
942
|
}
|
|
944
943
|
return (e, t) => {
|
|
945
|
-
const
|
|
946
|
-
return
|
|
944
|
+
const b = S("FmTextField"), I = S("FmLabel"), H = S("FmField"), D = S("FmIcon"), se = S("FmMenuHeader"), re = S("FmMenuDivider"), Se = S("FmMenuItem"), $t = S("FmMenu"), Ze = S("FmFormGroup"), Mt = S("FmSelect"), et = S("FmSwitch"), tt = S("FmStepperField"), De = S("FmButton"), Ne = S("FmChip"), Ut = S("FmForm");
|
|
945
|
+
return p(), Y(Ut, {
|
|
947
946
|
disabled: e.disabled,
|
|
948
947
|
ref_key: "formRef",
|
|
949
|
-
ref:
|
|
948
|
+
ref: q,
|
|
950
949
|
class: "flex flex-col gap-32",
|
|
951
950
|
onValidationSuccess: ve
|
|
952
951
|
}, {
|
|
953
|
-
default:
|
|
952
|
+
default: x(() => {
|
|
954
953
|
var nt, ot, lt, at;
|
|
955
954
|
return [
|
|
956
955
|
n("div", Ln, [
|
|
@@ -958,18 +957,18 @@ const zn = /* @__PURE__ */ ke({
|
|
|
958
957
|
s(Ce, {
|
|
959
958
|
"tooltip-message": "This field is managed by NetSuite",
|
|
960
959
|
"tooltip-z-index": 50,
|
|
961
|
-
label: o(
|
|
960
|
+
label: o(d)("inventory.ingredient.code"),
|
|
962
961
|
"model-value": le.value,
|
|
963
962
|
"onUpdate:modelValue": t[1] || (t[1] = (T) => le.value = T),
|
|
964
963
|
locked: f.value,
|
|
965
964
|
disabled: e.disabled
|
|
966
965
|
}, {
|
|
967
|
-
default:
|
|
968
|
-
s(
|
|
969
|
-
label: o(
|
|
966
|
+
default: x(() => [
|
|
967
|
+
s(b, {
|
|
968
|
+
label: o(d)("inventory.ingredient.code"),
|
|
970
969
|
"model-value": le.value,
|
|
971
970
|
"onUpdate:modelValue": t[0] || (t[0] = (T) => le.value = T),
|
|
972
|
-
rules: [o(Le)(), o(
|
|
971
|
+
rules: [o(Le)(), o(an)($e.value, Me.value)],
|
|
973
972
|
"label-mark": "required"
|
|
974
973
|
}, null, 8, ["label", "model-value", "rules"])
|
|
975
974
|
]),
|
|
@@ -980,15 +979,15 @@ const zn = /* @__PURE__ */ ke({
|
|
|
980
979
|
s(Ce, {
|
|
981
980
|
"tooltip-message": "This field is managed by NetSuite",
|
|
982
981
|
"tooltip-z-index": 50,
|
|
983
|
-
label: o(
|
|
982
|
+
label: o(d)("inventory.ingredient.name"),
|
|
984
983
|
"model-value": ae.value,
|
|
985
984
|
"onUpdate:modelValue": t[3] || (t[3] = (T) => ae.value = T),
|
|
986
985
|
locked: f.value,
|
|
987
986
|
disabled: e.disabled
|
|
988
987
|
}, {
|
|
989
|
-
default:
|
|
990
|
-
s(
|
|
991
|
-
label: o(
|
|
988
|
+
default: x(() => [
|
|
989
|
+
s(b, {
|
|
990
|
+
label: o(d)("inventory.ingredient.name"),
|
|
992
991
|
"model-value": ae.value,
|
|
993
992
|
"onUpdate:modelValue": t[2] || (t[2] = (T) => ae.value = T),
|
|
994
993
|
rules: [o(Le)()],
|
|
@@ -1002,27 +1001,27 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1002
1001
|
s(Ce, {
|
|
1003
1002
|
"tooltip-message": "This field is managed by NetSuite",
|
|
1004
1003
|
"tooltip-z-index": 50,
|
|
1005
|
-
label: o(
|
|
1004
|
+
label: o(d)("inventory.ingredient.unit"),
|
|
1006
1005
|
"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,
|
|
1007
1006
|
"model-value": (at = ye.value) == null ? void 0 : at.name,
|
|
1008
1007
|
locked: f.value,
|
|
1009
1008
|
disabled: e.disabled
|
|
1010
1009
|
}, {
|
|
1011
|
-
default:
|
|
1010
|
+
default: x(() => [
|
|
1012
1011
|
s(Ze, {
|
|
1013
1012
|
"model-value": ye.value,
|
|
1014
1013
|
rules: [o(Le)()],
|
|
1015
1014
|
"label-mark": "required"
|
|
1016
1015
|
}, {
|
|
1017
|
-
label:
|
|
1016
|
+
label: x(() => [
|
|
1018
1017
|
s(I, {
|
|
1019
|
-
label: o(
|
|
1018
|
+
label: o(d)("inventory.ingredient.unit")
|
|
1020
1019
|
}, null, 8, ["label"])
|
|
1021
1020
|
]),
|
|
1022
|
-
default:
|
|
1021
|
+
default: x(({ invalid: T }) => [
|
|
1023
1022
|
s($t, null, {
|
|
1024
|
-
"menu-button":
|
|
1025
|
-
s(
|
|
1023
|
+
"menu-button": x(() => [
|
|
1024
|
+
s(H, {
|
|
1026
1025
|
class: ie([
|
|
1027
1026
|
"fm-typo-en-body-lg-400",
|
|
1028
1027
|
{
|
|
@@ -1033,7 +1032,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1033
1032
|
invalid: T,
|
|
1034
1033
|
"append-icon": "expand_more"
|
|
1035
1034
|
}, {
|
|
1036
|
-
default:
|
|
1035
|
+
default: x(() => {
|
|
1037
1036
|
var X;
|
|
1038
1037
|
return [
|
|
1039
1038
|
xt($((X = ye.value) == null ? void 0 : X.name), 1)
|
|
@@ -1042,14 +1041,14 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1042
1041
|
_: 2
|
|
1043
1042
|
}, 1032, ["class", "invalid"])
|
|
1044
1043
|
]),
|
|
1045
|
-
default:
|
|
1044
|
+
default: x(() => [
|
|
1046
1045
|
n("div", qn, [
|
|
1047
|
-
s(
|
|
1046
|
+
s(b, {
|
|
1048
1047
|
modelValue: y.value,
|
|
1049
1048
|
"onUpdate:modelValue": t[4] || (t[4] = (X) => y.value = X),
|
|
1050
1049
|
placeholder: "Filter options"
|
|
1051
1050
|
}, {
|
|
1052
|
-
prepend:
|
|
1051
|
+
prepend: x(() => [
|
|
1053
1052
|
s(D, { name: "search" })
|
|
1054
1053
|
]),
|
|
1055
1054
|
_: 1
|
|
@@ -1058,17 +1057,17 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1058
1057
|
class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
|
|
1059
1058
|
onVnodeMounted: Ue
|
|
1060
1059
|
}, [
|
|
1061
|
-
(
|
|
1062
|
-
X.displayAsSection ? (
|
|
1060
|
+
(p(!0), V(ee, null, de(G.value, (X, Pt) => (p(), V(ee, { key: Pt }, [
|
|
1061
|
+
X.displayAsSection ? (p(), V(ee, { key: 0 }, [
|
|
1063
1062
|
s(se, {
|
|
1064
1063
|
label: X.label
|
|
1065
1064
|
}, null, 8, ["label"]),
|
|
1066
1065
|
s(re)
|
|
1067
|
-
], 64)) : (
|
|
1066
|
+
], 64)) : (p(), Y(Se, {
|
|
1068
1067
|
key: 1,
|
|
1069
1068
|
label: X.label,
|
|
1070
1069
|
"model-value": E(X),
|
|
1071
|
-
onClick: (
|
|
1070
|
+
onClick: (gl) => v(X.value),
|
|
1072
1071
|
"x-should-scroll-into": `${E(X)}`
|
|
1073
1072
|
}, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
|
|
1074
1073
|
], 64))), 128))
|
|
@@ -1083,160 +1082,162 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1083
1082
|
]),
|
|
1084
1083
|
_: 1
|
|
1085
1084
|
}, 8, ["label", "helper-text", "model-value", "locked", "disabled"]),
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
default: b(() => [
|
|
1085
|
+
n("div", Hn, [
|
|
1086
|
+
s(Ce, {
|
|
1087
|
+
"tooltip-message": "This field is managed by NetSuite",
|
|
1088
|
+
"tooltip-z-index": 50,
|
|
1089
|
+
label: o(d)("inventory.ingredient.valuationMethod.title"),
|
|
1090
|
+
"model-value": o(d)("inventory.ingredient.valuationMethod." + ce.value),
|
|
1091
|
+
locked: f.value,
|
|
1092
|
+
disabled: e.disabled
|
|
1093
|
+
}, {
|
|
1094
|
+
label: x(() => [
|
|
1095
|
+
n("div", Yn, [
|
|
1098
1096
|
s(I, {
|
|
1099
|
-
label: o(
|
|
1100
|
-
}, null, 8, ["label"])
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
"
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1097
|
+
label: o(d)("inventory.ingredient.valuationMethod.title")
|
|
1098
|
+
}, null, 8, ["label"]),
|
|
1099
|
+
s(ke, {
|
|
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(d)("inventory.ingredient.valuationMethod.title"),
|
|
1110
|
+
"model-value": ce.value,
|
|
1111
|
+
"onUpdate:modelValue": t[5] || (t[5] = (T) => ce.value = T),
|
|
1112
|
+
items: J.value
|
|
1113
|
+
}, null, 8, ["label", "model-value", "items"])
|
|
1114
|
+
]),
|
|
1115
|
+
_: 1
|
|
1116
|
+
}, 8, ["label", "model-value", "locked", "disabled"]),
|
|
1117
|
+
s(Ce, {
|
|
1118
|
+
"tooltip-message": "This field is managed by NetSuite",
|
|
1119
|
+
"tooltip-z-index": 50,
|
|
1120
|
+
"model-value": `${o(jt)()} ${fe.value}`,
|
|
1121
|
+
locked: f.value,
|
|
1122
|
+
"append-text": `/ ${be.value}`,
|
|
1123
|
+
disabled: e.disabled
|
|
1124
|
+
}, {
|
|
1125
|
+
label: x(() => [
|
|
1126
|
+
n("div", Kn, [
|
|
1128
1127
|
s(I, {
|
|
1129
|
-
label: o(
|
|
1130
|
-
}, null, 8, ["label"])
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1128
|
+
label: o(d)("inventory.ingredient.pricePerUnit")
|
|
1129
|
+
}, null, 8, ["label"]),
|
|
1130
|
+
s(ke, {
|
|
1131
|
+
tier: "premium",
|
|
1132
|
+
category: "premium",
|
|
1133
|
+
"feature-key": "total-cost"
|
|
1134
|
+
})
|
|
1135
|
+
])
|
|
1136
|
+
]),
|
|
1137
|
+
default: x(() => [
|
|
1138
|
+
s(b, {
|
|
1139
|
+
"model-value": fe.value,
|
|
1140
|
+
"onUpdate:modelValue": t[6] || (t[6] = (T) => fe.value = T),
|
|
1141
|
+
rules: [o(Oe)(0), o(sn)(4)]
|
|
1142
|
+
}, {
|
|
1143
|
+
label: x(() => [
|
|
1144
|
+
n("div", Gn, [
|
|
1144
1145
|
s(I, {
|
|
1145
|
-
label: o(
|
|
1146
|
+
label: o(d)("inventory.ingredient.pricePerUnit")
|
|
1146
1147
|
}, null, 8, ["label"])
|
|
1147
|
-
])
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
])
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
])
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
"
|
|
1168
|
-
"onUpdate:modelValue": t[7] || (t[7] = (T) => z.value = T),
|
|
1148
|
+
])
|
|
1149
|
+
]),
|
|
1150
|
+
prepend: x(() => {
|
|
1151
|
+
var T, X;
|
|
1152
|
+
return [
|
|
1153
|
+
n("div", Jn, $(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)
|
|
1154
|
+
];
|
|
1155
|
+
}),
|
|
1156
|
+
append: x(() => [
|
|
1157
|
+
n("div", Qn, " / " + $(be.value), 1)
|
|
1158
|
+
]),
|
|
1159
|
+
_: 1
|
|
1160
|
+
}, 8, ["model-value", "rules"])
|
|
1161
|
+
]),
|
|
1162
|
+
_: 1
|
|
1163
|
+
}, 8, ["model-value", "locked", "append-text", "disabled"])
|
|
1164
|
+
]),
|
|
1165
|
+
!f.value || N.value ? (p(), Y(zn, {
|
|
1166
|
+
key: 0,
|
|
1167
|
+
"model-value": N.value,
|
|
1168
|
+
"onUpdate:modelValue": t[7] || (t[7] = (T) => N.value = T),
|
|
1169
1169
|
"root-value": e.modelValue,
|
|
1170
1170
|
readonly: f.value
|
|
1171
|
-
}, null, 8, ["model-value", "root-value", "readonly"])) :
|
|
1172
|
-
e.mode !== o(
|
|
1171
|
+
}, null, 8, ["model-value", "root-value", "readonly"])) : L("", !0),
|
|
1172
|
+
e.mode !== o(j).CREATE ? (p(), V("div", Xn, [
|
|
1173
1173
|
s(et, {
|
|
1174
|
-
label: o(
|
|
1174
|
+
label: o(d)("inventory.ingredient.status.inactive"),
|
|
1175
1175
|
"model-value": te.value,
|
|
1176
1176
|
"onUpdate:modelValue": t[8] || (t[8] = (T) => te.value = T),
|
|
1177
1177
|
"label-placement": "right",
|
|
1178
1178
|
disabled: f.value
|
|
1179
1179
|
}, null, 8, ["label", "model-value", "disabled"]),
|
|
1180
|
-
n("div",
|
|
1181
|
-
n("div",
|
|
1180
|
+
n("div", Zn, [
|
|
1181
|
+
n("div", eo, $(o(d)("inventory.ingredient.status.preventFromOrder")), 1)
|
|
1182
1182
|
])
|
|
1183
|
-
])) :
|
|
1184
|
-
e.mode !== o(
|
|
1183
|
+
])) : L("", !0),
|
|
1184
|
+
e.mode !== o(j).CREATE ? (p(), V("div", to, [
|
|
1185
1185
|
n("div", null, [
|
|
1186
1186
|
s(et, {
|
|
1187
|
-
label: o(
|
|
1187
|
+
label: o(d)("inventory.ingredient.bindedItems.title"),
|
|
1188
1188
|
modelValue: O.value,
|
|
1189
1189
|
"onUpdate:modelValue": t[9] || (t[9] = (T) => O.value = T),
|
|
1190
1190
|
"label-placement": "right"
|
|
1191
1191
|
}, null, 8, ["label", "modelValue"])
|
|
1192
1192
|
]),
|
|
1193
|
-
O.value && K.value.length ? (
|
|
1193
|
+
O.value && K.value.length ? (p(), Y(qe, {
|
|
1194
1194
|
key: 0,
|
|
1195
|
-
name: o(
|
|
1195
|
+
name: o(d)("inventory.ingredient.bindedItems.ingredient"),
|
|
1196
1196
|
bindings: K.value
|
|
1197
|
-
}, null, 8, ["name", "bindings"])) :
|
|
1198
|
-
O.value &&
|
|
1197
|
+
}, null, 8, ["name", "bindings"])) : L("", !0),
|
|
1198
|
+
O.value && z.value.length ? (p(), Y(qe, {
|
|
1199
1199
|
key: 1,
|
|
1200
|
-
name: o(
|
|
1201
|
-
bindings:
|
|
1202
|
-
}, null, 8, ["name", "bindings"])) :
|
|
1203
|
-
O.value && ge.value.length ? (
|
|
1200
|
+
name: o(d)("inventory.ingredient.bindedItems.recipe"),
|
|
1201
|
+
bindings: z.value
|
|
1202
|
+
}, null, 8, ["name", "bindings"])) : L("", !0),
|
|
1203
|
+
O.value && ge.value.length ? (p(), Y(qe, {
|
|
1204
1204
|
key: 2,
|
|
1205
|
-
name: o(
|
|
1205
|
+
name: o(d)("inventory.ingredient.bindedItems.menu"),
|
|
1206
1206
|
bindings: ge.value
|
|
1207
|
-
}, null, 8, ["name", "bindings"])) :
|
|
1208
|
-
])) :
|
|
1209
|
-
n("div",
|
|
1210
|
-
n("div",
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1207
|
+
}, null, 8, ["name", "bindings"])) : L("", !0)
|
|
1208
|
+
])) : L("", !0),
|
|
1209
|
+
n("div", no, [
|
|
1210
|
+
n("div", oo, [
|
|
1211
|
+
n("div", lo, [
|
|
1212
|
+
n("div", ao, $(o(d)("inventory.ingredient.threshold.title")), 1),
|
|
1213
|
+
s(ke, {
|
|
1214
|
+
tier: "standard",
|
|
1215
|
+
category: "beta"
|
|
1216
|
+
})
|
|
1217
|
+
]),
|
|
1218
|
+
n("div", so, $(o(d)("inventory.ingredient.threshold.subtitle")), 1)
|
|
1218
1219
|
]),
|
|
1219
|
-
n("div",
|
|
1220
|
+
n("div", ro, [
|
|
1220
1221
|
s(Ze, {
|
|
1221
|
-
"model-value": { low: he.value, mid:
|
|
1222
|
+
"model-value": { low: he.value, mid: me.value },
|
|
1222
1223
|
rules: [Et()]
|
|
1223
1224
|
}, null, 8, ["model-value", "rules"]),
|
|
1224
|
-
n("div",
|
|
1225
|
-
n("div",
|
|
1226
|
-
n("div",
|
|
1225
|
+
n("div", io, [
|
|
1226
|
+
n("div", uo, [
|
|
1227
|
+
n("div", co, [
|
|
1227
1228
|
s(je, {
|
|
1228
1229
|
days: he.value,
|
|
1229
1230
|
level: o(We).low
|
|
1230
1231
|
}, null, 8, ["days", "level"])
|
|
1231
1232
|
]),
|
|
1232
|
-
n("div",
|
|
1233
|
-
n("div",
|
|
1233
|
+
n("div", mo, [
|
|
1234
|
+
n("div", po, $(o(d)("inventory.ingredient.threshold.whenRemaining")), 1),
|
|
1234
1235
|
s(tt, {
|
|
1235
1236
|
modelValue: he.value,
|
|
1236
1237
|
"onUpdate:modelValue": t[10] || (t[10] = (T) => he.value = T),
|
|
1237
1238
|
rules: [o(Oe)(0)]
|
|
1238
1239
|
}, {
|
|
1239
|
-
append:
|
|
1240
|
+
append: x(() => t[13] || (t[13] = [
|
|
1240
1241
|
n("div", {
|
|
1241
1242
|
class: "text-fm-color-typo-secondary",
|
|
1242
1243
|
style: { "padding-right": "32px" }
|
|
@@ -1255,21 +1256,21 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1255
1256
|
style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
|
|
1256
1257
|
}, " < ")
|
|
1257
1258
|
], -1)),
|
|
1258
|
-
n("div",
|
|
1259
|
-
n("div",
|
|
1259
|
+
n("div", vo, [
|
|
1260
|
+
n("div", fo, [
|
|
1260
1261
|
s(je, {
|
|
1261
|
-
days:
|
|
1262
|
+
days: me.value,
|
|
1262
1263
|
level: o(We).mid
|
|
1263
1264
|
}, null, 8, ["days", "level"])
|
|
1264
1265
|
]),
|
|
1265
|
-
n("div",
|
|
1266
|
-
n("div",
|
|
1266
|
+
n("div", yo, [
|
|
1267
|
+
n("div", go, $(o(d)("inventory.ingredient.threshold.whenRemaining")), 1),
|
|
1267
1268
|
s(tt, {
|
|
1268
|
-
modelValue:
|
|
1269
|
-
"onUpdate:modelValue": t[11] || (t[11] = (T) =>
|
|
1269
|
+
modelValue: me.value,
|
|
1270
|
+
"onUpdate:modelValue": t[11] || (t[11] = (T) => me.value = T),
|
|
1270
1271
|
rules: [o(Oe)(0)]
|
|
1271
1272
|
}, {
|
|
1272
|
-
append:
|
|
1273
|
+
append: x(() => t[14] || (t[14] = [
|
|
1273
1274
|
n("div", {
|
|
1274
1275
|
class: "text-fm-color-typo-secondary",
|
|
1275
1276
|
style: { "padding-right": "32px" }
|
|
@@ -1288,29 +1289,31 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1288
1289
|
style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
|
|
1289
1290
|
}, " < ")
|
|
1290
1291
|
], -1)),
|
|
1291
|
-
n("div",
|
|
1292
|
-
n("div",
|
|
1292
|
+
n("div", bo, [
|
|
1293
|
+
n("div", ho, [
|
|
1293
1294
|
s(je, {
|
|
1294
|
-
days:
|
|
1295
|
+
days: me.value + 1,
|
|
1295
1296
|
level: o(We).high
|
|
1296
1297
|
}, null, 8, ["days", "level"])
|
|
1297
1298
|
]),
|
|
1298
|
-
n("div",
|
|
1299
|
-
n("div",
|
|
1299
|
+
n("div", _o, [
|
|
1300
|
+
n("div", xo, $(o(d)("inventory.ingredient.threshold.stockIsStaple")), 1)
|
|
1300
1301
|
])
|
|
1301
1302
|
])
|
|
1302
1303
|
])
|
|
1303
1304
|
])
|
|
1304
1305
|
]),
|
|
1305
|
-
o(
|
|
1306
|
-
n("div",
|
|
1307
|
-
n("div",
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1306
|
+
o(c).mustUsePoTemplate && e.mode === o(j).CREATE ? (p(), V("div", ko, [
|
|
1307
|
+
n("div", wo, [
|
|
1308
|
+
n("div", To, [
|
|
1309
|
+
n("div", Vo, [
|
|
1310
|
+
n("div", Io, $(o(d)("inventory.ingredient.purchaseOrderTemplates.title")), 1),
|
|
1311
|
+
s(ke, {
|
|
1312
|
+
tier: "premium",
|
|
1313
|
+
category: "premium",
|
|
1314
|
+
"feature-key": "purchase-order-template"
|
|
1315
|
+
})
|
|
1316
|
+
]),
|
|
1314
1317
|
s(De, {
|
|
1315
1318
|
variant: "secondary",
|
|
1316
1319
|
"text-color": "primary",
|
|
@@ -1319,28 +1322,30 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1319
1322
|
onClick: Ct
|
|
1320
1323
|
})
|
|
1321
1324
|
]),
|
|
1322
|
-
n("div",
|
|
1325
|
+
n("div", So, $(o(d)("inventory.ingredient.purchaseOrderTemplates.description")), 1)
|
|
1323
1326
|
]),
|
|
1324
|
-
Ve.value.length > 0 ? (
|
|
1325
|
-
n("div",
|
|
1326
|
-
(
|
|
1327
|
+
Ve.value.length > 0 ? (p(), V("div", Co, [
|
|
1328
|
+
n("div", Fo, [
|
|
1329
|
+
(p(!0), V(ee, null, de(Ve.value, (T) => (p(), Y(Ne, {
|
|
1327
1330
|
key: T.value,
|
|
1328
1331
|
label: T.label,
|
|
1329
1332
|
variant: "info",
|
|
1330
1333
|
compact: ""
|
|
1331
1334
|
}, null, 8, ["label"]))), 128))
|
|
1332
1335
|
])
|
|
1333
|
-
])) :
|
|
1334
|
-
])) :
|
|
1335
|
-
o(
|
|
1336
|
-
n("div",
|
|
1337
|
-
n("div",
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1336
|
+
])) : L("", !0)
|
|
1337
|
+
])) : L("", !0),
|
|
1338
|
+
o(c).enableWastageTemplate && e.mode === o(j).CREATE ? (p(), V("div", Ao, [
|
|
1339
|
+
n("div", Eo, [
|
|
1340
|
+
n("div", $o, [
|
|
1341
|
+
n("div", Mo, [
|
|
1342
|
+
n("div", Uo, $(o(d)("inventory.ingredient.wastageTemplates.title")), 1),
|
|
1343
|
+
s(ke, {
|
|
1344
|
+
tier: "premium",
|
|
1345
|
+
category: "premium",
|
|
1346
|
+
"feature-key": "wastage-template"
|
|
1347
|
+
})
|
|
1348
|
+
]),
|
|
1344
1349
|
s(De, {
|
|
1345
1350
|
variant: "secondary",
|
|
1346
1351
|
"text-color": "primary",
|
|
@@ -1349,28 +1354,30 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1349
1354
|
onClick: Ft
|
|
1350
1355
|
})
|
|
1351
1356
|
]),
|
|
1352
|
-
n("div",
|
|
1357
|
+
n("div", Po, $(o(d)("inventory.ingredient.wastageTemplates.description")), 1)
|
|
1353
1358
|
]),
|
|
1354
|
-
Ie.value.length > 0 ? (
|
|
1355
|
-
n("div",
|
|
1356
|
-
(
|
|
1359
|
+
Ie.value.length > 0 ? (p(), V("div", Ro, [
|
|
1360
|
+
n("div", Oo, [
|
|
1361
|
+
(p(!0), V(ee, null, de(Ie.value, (T) => (p(), Y(Ne, {
|
|
1357
1362
|
key: T.value,
|
|
1358
1363
|
label: T.label,
|
|
1359
1364
|
variant: "info",
|
|
1360
1365
|
compact: ""
|
|
1361
1366
|
}, null, 8, ["label"]))), 128))
|
|
1362
1367
|
])
|
|
1363
|
-
])) :
|
|
1364
|
-
])) :
|
|
1365
|
-
o(
|
|
1366
|
-
n("div",
|
|
1367
|
-
n("div",
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1368
|
+
])) : L("", !0)
|
|
1369
|
+
])) : L("", !0),
|
|
1370
|
+
o(c).enableClosingTemplate && e.mode === o(j).CREATE ? (p(), V("div", Bo, [
|
|
1371
|
+
n("div", Do, [
|
|
1372
|
+
n("div", No, [
|
|
1373
|
+
n("div", zo, [
|
|
1374
|
+
n("div", Lo, $(o(d)("inventory.ingredient.closingTemplates.title")), 1),
|
|
1375
|
+
s(ke, {
|
|
1376
|
+
tier: "premium",
|
|
1377
|
+
category: "premium",
|
|
1378
|
+
"feature-key": "closing-template"
|
|
1379
|
+
})
|
|
1380
|
+
]),
|
|
1374
1381
|
s(De, {
|
|
1375
1382
|
variant: "secondary",
|
|
1376
1383
|
"text-color": "primary",
|
|
@@ -1379,21 +1386,21 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1379
1386
|
onClick: At
|
|
1380
1387
|
})
|
|
1381
1388
|
]),
|
|
1382
|
-
n("div",
|
|
1389
|
+
n("div", jo, $(o(d)("inventory.ingredient.closingTemplates.description")), 1)
|
|
1383
1390
|
]),
|
|
1384
|
-
Qe.value.length > 0 ? (
|
|
1385
|
-
n("div",
|
|
1386
|
-
(
|
|
1391
|
+
Qe.value.length > 0 ? (p(), V("div", Wo, [
|
|
1392
|
+
n("div", qo, [
|
|
1393
|
+
(p(!0), V(ee, null, de(Qe.value, (T) => (p(), Y(Ne, {
|
|
1387
1394
|
key: T.value,
|
|
1388
1395
|
label: T.label,
|
|
1389
1396
|
variant: "info",
|
|
1390
1397
|
compact: ""
|
|
1391
1398
|
}, null, 8, ["label"]))), 128))
|
|
1392
1399
|
])
|
|
1393
|
-
])) :
|
|
1394
|
-
])) :
|
|
1400
|
+
])) : L("", !0)
|
|
1401
|
+
])) : L("", !0),
|
|
1395
1402
|
n("div", null, [
|
|
1396
|
-
s(
|
|
1403
|
+
s(yn, {
|
|
1397
1404
|
entity: "inventorySku",
|
|
1398
1405
|
modelValue: Q.value,
|
|
1399
1406
|
"onUpdate:modelValue": t[12] || (t[12] = (T) => Q.value = T)
|
|
@@ -1405,40 +1412,40 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1405
1412
|
}, 8, ["disabled"]);
|
|
1406
1413
|
};
|
|
1407
1414
|
}
|
|
1408
|
-
}),
|
|
1415
|
+
}), Yo = { class: "flex flex-col gap-32" }, Ko = {
|
|
1409
1416
|
key: 0,
|
|
1410
1417
|
class: "flex justify-between items-center"
|
|
1411
|
-
},
|
|
1418
|
+
}, Go = { class: "flex gap-4" }, Jo = /* @__PURE__ */ xe({
|
|
1412
1419
|
__name: "IngredientDialog",
|
|
1413
1420
|
props: {
|
|
1414
1421
|
show: { type: Boolean },
|
|
1415
1422
|
sku: {},
|
|
1416
|
-
mode: { default:
|
|
1423
|
+
mode: { default: j.READ }
|
|
1417
1424
|
},
|
|
1418
1425
|
emits: ["update:show"],
|
|
1419
|
-
setup(
|
|
1420
|
-
const
|
|
1426
|
+
setup(W) {
|
|
1427
|
+
const h = W, k = Fe(), d = Tt(), _ = Ee(), C = Vt(), A = It(), U = St(), l = Ae(), { t: i } = pe(), u = ft(h, "show"), a = ft(h, "sku"), c = P([]), r = P([]), f = P([]), w = g(
|
|
1421
1428
|
() => {
|
|
1422
1429
|
var y;
|
|
1423
|
-
return
|
|
1430
|
+
return _.isEnabled && _.netSuiteItemBySkuId.has((y = h.sku) == null ? void 0 : y._id);
|
|
1424
1431
|
}
|
|
1425
1432
|
), F = g(() => {
|
|
1426
|
-
switch (
|
|
1427
|
-
case
|
|
1433
|
+
switch (h.mode) {
|
|
1434
|
+
case j.READ:
|
|
1428
1435
|
return "";
|
|
1429
|
-
case
|
|
1436
|
+
case j.UPDATE:
|
|
1430
1437
|
return i("inventory.ingredient.update.title");
|
|
1431
|
-
case
|
|
1438
|
+
case j.CREATE:
|
|
1432
1439
|
return i("inventory.ingredient.create.title");
|
|
1433
1440
|
}
|
|
1434
1441
|
return "";
|
|
1435
|
-
}),
|
|
1436
|
-
switch (
|
|
1437
|
-
case
|
|
1442
|
+
}), m = g(() => {
|
|
1443
|
+
switch (h.mode) {
|
|
1444
|
+
case j.READ:
|
|
1438
1445
|
return "";
|
|
1439
|
-
case
|
|
1446
|
+
case j.UPDATE:
|
|
1440
1447
|
return i("common.save");
|
|
1441
|
-
case
|
|
1448
|
+
case j.CREATE:
|
|
1442
1449
|
return i("common.add");
|
|
1443
1450
|
}
|
|
1444
1451
|
return "";
|
|
@@ -1448,7 +1455,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1448
1455
|
try {
|
|
1449
1456
|
await k.createSku(a.value);
|
|
1450
1457
|
const y = k.skuByCode[a.value.code];
|
|
1451
|
-
|
|
1458
|
+
d.enablePoTemplate && c.value.length > 0 && await ue(y), d.enableWastageTemplate && r.value.length > 0 && await oe(y), d.enableClosingTemplate && f.value.length > 0 && await le(y), u.value = !1, l.open({
|
|
1452
1459
|
title: i("inventory.common.success"),
|
|
1453
1460
|
message: i("inventory.ingredient.create.success", { name: a.value.name }),
|
|
1454
1461
|
type: "success"
|
|
@@ -1466,7 +1473,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1466
1473
|
async function ne() {
|
|
1467
1474
|
R.value = !0;
|
|
1468
1475
|
try {
|
|
1469
|
-
await k.updateSku(a.value), R.value = !1,
|
|
1476
|
+
await k.updateSku(a.value), R.value = !1, u.value = !1, l.open({
|
|
1470
1477
|
title: i("inventory.common.success"),
|
|
1471
1478
|
message: i("inventory.ingredient.update.success", { name: a.value.name }),
|
|
1472
1479
|
type: "success"
|
|
@@ -1484,16 +1491,16 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1484
1491
|
async function ue(y) {
|
|
1485
1492
|
var M, G, E, v;
|
|
1486
1493
|
try {
|
|
1487
|
-
for (const
|
|
1488
|
-
const J = await C.getTemplate(
|
|
1494
|
+
for (const N of c.value) {
|
|
1495
|
+
const J = await C.getTemplate(N);
|
|
1489
1496
|
if (!J) {
|
|
1490
|
-
console.warn(`Template with ID ${
|
|
1497
|
+
console.warn(`Template with ID ${N} not found`);
|
|
1491
1498
|
continue;
|
|
1492
1499
|
}
|
|
1493
1500
|
if (!J.purchaseOrder.items.find(
|
|
1494
1501
|
(Q) => Q.sku._id === y._id
|
|
1495
1502
|
)) {
|
|
1496
|
-
const Q = { amount: 1, precision:
|
|
1503
|
+
const Q = { amount: 1, precision: rn(y.unit) }, q = {
|
|
1497
1504
|
sku: y,
|
|
1498
1505
|
name: y.name,
|
|
1499
1506
|
code: y.code,
|
|
@@ -1505,20 +1512,20 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1505
1512
|
...J,
|
|
1506
1513
|
purchaseOrder: {
|
|
1507
1514
|
...J.purchaseOrder,
|
|
1508
|
-
items: [...J.purchaseOrder.items,
|
|
1515
|
+
items: [...J.purchaseOrder.items, q]
|
|
1509
1516
|
}
|
|
1510
1517
|
};
|
|
1511
1518
|
(((E = O.purchaseOrder.supplier) == null ? void 0 : E.internal) === vt.enum.warehouse || ((v = O.purchaseOrder.supplier) == null ? void 0 : v.internal) === vt.enum.restaurant) && (O.purchaseOrder.items = O.purchaseOrder.items.map(
|
|
1512
|
-
({ totalCost: K, ...
|
|
1519
|
+
({ totalCost: K, ...z }) => z
|
|
1513
1520
|
)), await C.updateTemplate(O), await new Promise((K) => setTimeout(K, 1e3));
|
|
1514
1521
|
}
|
|
1515
1522
|
}
|
|
1516
|
-
} catch (
|
|
1523
|
+
} catch (N) {
|
|
1517
1524
|
l.open({
|
|
1518
1525
|
title: i("inventory.transfer.template.update.error"),
|
|
1519
1526
|
message: i("inventory.transfer.template.update.errorMessage"),
|
|
1520
1527
|
type: "error"
|
|
1521
|
-
}), console.error("Error in updating transfer template",
|
|
1528
|
+
}), console.error("Error in updating transfer template", N);
|
|
1522
1529
|
}
|
|
1523
1530
|
}
|
|
1524
1531
|
async function oe(y) {
|
|
@@ -1536,11 +1543,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1536
1543
|
code: y.code,
|
|
1537
1544
|
type: "sku",
|
|
1538
1545
|
disabledMeasurements: []
|
|
1539
|
-
},
|
|
1546
|
+
}, N = {
|
|
1540
1547
|
...G,
|
|
1541
1548
|
items: [...G.items, v]
|
|
1542
1549
|
};
|
|
1543
|
-
await A.updateTemplate(
|
|
1550
|
+
await A.updateTemplate(N), await new Promise((J) => setTimeout(J, 1e3));
|
|
1544
1551
|
}
|
|
1545
1552
|
}
|
|
1546
1553
|
} catch (M) {
|
|
@@ -1562,11 +1569,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1562
1569
|
if (!G.items.find((v) => v.sku._id === y._id)) {
|
|
1563
1570
|
const v = {
|
|
1564
1571
|
sku: y
|
|
1565
|
-
},
|
|
1572
|
+
}, N = {
|
|
1566
1573
|
...G,
|
|
1567
1574
|
items: [...G.items, v]
|
|
1568
1575
|
};
|
|
1569
|
-
await U.updateTemplate(
|
|
1576
|
+
await U.updateTemplate(N), await new Promise((J) => setTimeout(J, 1e3));
|
|
1570
1577
|
}
|
|
1571
1578
|
}
|
|
1572
1579
|
} catch (M) {
|
|
@@ -1582,17 +1589,17 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1582
1589
|
(M = (y = B.value) == null ? void 0 : y.validateInputs) == null || M.call(y);
|
|
1583
1590
|
}
|
|
1584
1591
|
function ae() {
|
|
1585
|
-
switch (
|
|
1586
|
-
case
|
|
1592
|
+
switch (h.mode) {
|
|
1593
|
+
case j.READ:
|
|
1587
1594
|
return;
|
|
1588
|
-
case
|
|
1595
|
+
case j.UPDATE:
|
|
1589
1596
|
return ne();
|
|
1590
|
-
case
|
|
1597
|
+
case j.CREATE:
|
|
1591
1598
|
return ve();
|
|
1592
1599
|
}
|
|
1593
1600
|
}
|
|
1594
1601
|
function fe(y) {
|
|
1595
|
-
|
|
1602
|
+
c.value = y;
|
|
1596
1603
|
}
|
|
1597
1604
|
function ye(y) {
|
|
1598
1605
|
r.value = y;
|
|
@@ -1602,32 +1609,32 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1602
1609
|
}
|
|
1603
1610
|
return (y, M) => {
|
|
1604
1611
|
const G = S("FmChip"), E = S("FmButton"), v = S("FmSideSheet");
|
|
1605
|
-
return
|
|
1606
|
-
"model-value": o(
|
|
1607
|
-
"onUpdate:modelValue": M[3] || (M[3] = (
|
|
1612
|
+
return p(), Y(v, {
|
|
1613
|
+
"model-value": o(u),
|
|
1614
|
+
"onUpdate:modelValue": M[3] || (M[3] = (N) => rt(u) ? u.value = N : null),
|
|
1608
1615
|
header: F.value,
|
|
1609
1616
|
"close-button": "",
|
|
1610
1617
|
"dismiss-away": "",
|
|
1611
1618
|
"max-width": 500
|
|
1612
1619
|
}, {
|
|
1613
|
-
"side-sheet-footer":
|
|
1614
|
-
n("div",
|
|
1620
|
+
"side-sheet-footer": x(() => [
|
|
1621
|
+
n("div", Go, [
|
|
1615
1622
|
s(E, {
|
|
1616
1623
|
loading: R.value,
|
|
1617
|
-
label:
|
|
1624
|
+
label: m.value,
|
|
1618
1625
|
onClick: te
|
|
1619
1626
|
}, null, 8, ["loading", "label"]),
|
|
1620
1627
|
s(E, {
|
|
1621
1628
|
disabled: R.value,
|
|
1622
1629
|
label: o(i)("common.close"),
|
|
1623
1630
|
variant: "tertiary",
|
|
1624
|
-
onClick: M[2] || (M[2] = (
|
|
1631
|
+
onClick: M[2] || (M[2] = (N) => u.value = !1)
|
|
1625
1632
|
}, null, 8, ["disabled", "label"])
|
|
1626
1633
|
])
|
|
1627
1634
|
]),
|
|
1628
|
-
default:
|
|
1629
|
-
n("div",
|
|
1630
|
-
w.value ? (
|
|
1635
|
+
default: x(() => [
|
|
1636
|
+
n("div", Yo, [
|
|
1637
|
+
w.value ? (p(), V("div", Ko, [
|
|
1631
1638
|
s(G, {
|
|
1632
1639
|
label: "Managed by Netsuite",
|
|
1633
1640
|
compact: ""
|
|
@@ -1635,21 +1642,21 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1635
1642
|
s(en, {
|
|
1636
1643
|
readonly: "",
|
|
1637
1644
|
sku: y.sku,
|
|
1638
|
-
settingOptions: o(
|
|
1645
|
+
settingOptions: o(_).skuSettingOptions
|
|
1639
1646
|
}, null, 8, ["sku", "settingOptions"])
|
|
1640
|
-
])) :
|
|
1641
|
-
s(
|
|
1647
|
+
])) : L("", !0),
|
|
1648
|
+
s(Ho, {
|
|
1642
1649
|
class: "w-full",
|
|
1643
1650
|
ref_key: "hasValidationExpose",
|
|
1644
1651
|
ref: B,
|
|
1645
1652
|
modelValue: o(a),
|
|
1646
|
-
"onUpdate:modelValue": M[0] || (M[0] = (
|
|
1653
|
+
"onUpdate:modelValue": M[0] || (M[0] = (N) => rt(a) ? a.value = N : null),
|
|
1647
1654
|
mode: y.mode,
|
|
1648
1655
|
disabled: R.value,
|
|
1649
|
-
purchaseOrderTemplateIds:
|
|
1656
|
+
purchaseOrderTemplateIds: c.value,
|
|
1650
1657
|
wastageTemplateIds: r.value,
|
|
1651
1658
|
closingTemplateIds: f.value,
|
|
1652
|
-
"onClick:submit": M[1] || (M[1] = (
|
|
1659
|
+
"onClick:submit": M[1] || (M[1] = (N) => ae()),
|
|
1653
1660
|
"onUpdate:purchaseOrderTemplateIds": fe,
|
|
1654
1661
|
"onUpdate:wastageTemplateIds": ye,
|
|
1655
1662
|
"onUpdate:closingTemplateIds": we
|
|
@@ -1660,10 +1667,10 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1660
1667
|
}, 8, ["model-value", "header"]);
|
|
1661
1668
|
};
|
|
1662
1669
|
}
|
|
1663
|
-
}),
|
|
1670
|
+
}), Qo = { class: "flex items-center gap-12 pl-8" }, Xo = { class: "flex flex-col" }, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, el = {
|
|
1664
1671
|
key: 0,
|
|
1665
1672
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
1666
|
-
},
|
|
1673
|
+
}, tl = { key: 0 }, ht = /* @__PURE__ */ xe({
|
|
1667
1674
|
__name: "ImportIngredientItem",
|
|
1668
1675
|
props: {
|
|
1669
1676
|
type: {},
|
|
@@ -1671,30 +1678,30 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1671
1678
|
name: {},
|
|
1672
1679
|
errors: {}
|
|
1673
1680
|
},
|
|
1674
|
-
setup(
|
|
1675
|
-
return (
|
|
1676
|
-
const
|
|
1677
|
-
return
|
|
1681
|
+
setup(W) {
|
|
1682
|
+
return (h, k) => {
|
|
1683
|
+
const d = S("FmIcon"), _ = S("FmTooltip");
|
|
1684
|
+
return p(), V("div", Qo, [
|
|
1678
1685
|
k[0] || (k[0] = n("div", null, "•", -1)),
|
|
1679
|
-
n("div",
|
|
1680
|
-
n("div",
|
|
1686
|
+
n("div", Xo, [
|
|
1687
|
+
n("div", Zo, [
|
|
1681
1688
|
n("div", {
|
|
1682
1689
|
class: ie({
|
|
1683
|
-
"text-fm-color-system-error-300":
|
|
1690
|
+
"text-fm-color-system-error-300": h.errors.length
|
|
1684
1691
|
})
|
|
1685
1692
|
}, [
|
|
1686
|
-
xt($(
|
|
1687
|
-
|
|
1693
|
+
xt($(h.name) + " ", 1),
|
|
1694
|
+
h.type === "create" ? (p(), V("span", el, "(new)")) : L("", !0)
|
|
1688
1695
|
], 2),
|
|
1689
|
-
|
|
1690
|
-
s(
|
|
1691
|
-
content:
|
|
1696
|
+
h.errors.length ? (p(), V("div", tl, [
|
|
1697
|
+
s(_, { "z-index": 50 }, {
|
|
1698
|
+
content: x(() => [
|
|
1692
1699
|
n("ol", null, [
|
|
1693
|
-
(
|
|
1700
|
+
(p(!0), V(ee, null, de(h.errors, (C, A) => (p(), V("li", { key: A }, $(C), 1))), 128))
|
|
1694
1701
|
])
|
|
1695
1702
|
]),
|
|
1696
|
-
default:
|
|
1697
|
-
s(
|
|
1703
|
+
default: x(() => [
|
|
1704
|
+
s(d, {
|
|
1698
1705
|
name: "error",
|
|
1699
1706
|
size: "sm",
|
|
1700
1707
|
color: "system-error-300"
|
|
@@ -1702,109 +1709,109 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1702
1709
|
]),
|
|
1703
1710
|
_: 1
|
|
1704
1711
|
})
|
|
1705
|
-
])) :
|
|
1712
|
+
])) : L("", !0)
|
|
1706
1713
|
]),
|
|
1707
1714
|
n("div", {
|
|
1708
1715
|
class: ie([
|
|
1709
1716
|
"fm-typo-en-body-sm-400",
|
|
1710
1717
|
{
|
|
1711
|
-
"text-fm-color-system-error-200":
|
|
1712
|
-
"text-fm-color-typo-secondary": !
|
|
1718
|
+
"text-fm-color-system-error-200": h.errors.length,
|
|
1719
|
+
"text-fm-color-typo-secondary": !h.errors.length
|
|
1713
1720
|
}
|
|
1714
1721
|
])
|
|
1715
|
-
}, $(
|
|
1722
|
+
}, $(h.code), 3)
|
|
1716
1723
|
])
|
|
1717
1724
|
]);
|
|
1718
1725
|
};
|
|
1719
1726
|
}
|
|
1720
|
-
}),
|
|
1727
|
+
}), nl = { class: "flex flex-col gap-24" }, ol = { class: "fm-typo-en-body-md-400" }, ll = { class: "flex flex-col gap-8" }, al = { class: "line-clamp-2 text-ellipsis break-all" }, sl = {
|
|
1721
1728
|
key: 2,
|
|
1722
1729
|
class: "shrink-0"
|
|
1723
|
-
},
|
|
1730
|
+
}, rl = {
|
|
1724
1731
|
key: 0,
|
|
1725
1732
|
class: "flex flex-col"
|
|
1726
|
-
},
|
|
1733
|
+
}, il = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, dl = {
|
|
1727
1734
|
key: 0,
|
|
1728
1735
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
1729
|
-
},
|
|
1736
|
+
}, ul = { class: "fm-typo-en-body-lg-600" }, cl = /* @__PURE__ */ xe({
|
|
1730
1737
|
__name: "ImportIngredients",
|
|
1731
|
-
setup(
|
|
1732
|
-
const
|
|
1733
|
-
() => !!C.value.length || A.value.some((
|
|
1738
|
+
setup(W) {
|
|
1739
|
+
const h = P(null), k = Ht(), d = Ae(), _ = P(!1), C = P(new Array()), A = P([]), U = P([]), l = g(
|
|
1740
|
+
() => !!C.value.length || A.value.some((c) => c.errors.length) || U.value.some((c) => c.errors.length)
|
|
1734
1741
|
), i = g(
|
|
1735
1742
|
() => !!A.value.length || !!U.value.length
|
|
1736
|
-
), { t:
|
|
1737
|
-
async function a(
|
|
1743
|
+
), { t: u } = pe();
|
|
1744
|
+
async function a(c) {
|
|
1738
1745
|
C.value = [], A.value = [], U.value = [];
|
|
1739
1746
|
try {
|
|
1740
|
-
|
|
1747
|
+
_.value = !0;
|
|
1741
1748
|
const [r] = await Promise.all([
|
|
1742
|
-
|
|
1749
|
+
hn(c),
|
|
1743
1750
|
// fake buffer
|
|
1744
1751
|
new Promise((F) => setTimeout(F, 1e3))
|
|
1745
1752
|
]), f = r.SheetNames.find((F) => F);
|
|
1746
1753
|
if (!f) {
|
|
1747
|
-
C.value.push(
|
|
1754
|
+
C.value.push(u("inventory.ingredient.import.fileError.noSheet"));
|
|
1748
1755
|
return;
|
|
1749
1756
|
}
|
|
1750
|
-
const w =
|
|
1757
|
+
const w = pn(r.Sheets[f]);
|
|
1751
1758
|
if (w.invalidExcel) {
|
|
1752
|
-
C.value.push(w.invalidExcelMessage ??
|
|
1759
|
+
C.value.push(w.invalidExcelMessage ?? u("inventory.ingredient.import.fileError.invalidExcel"));
|
|
1753
1760
|
return;
|
|
1754
1761
|
}
|
|
1755
1762
|
if (A.value = w.importCreateResult, U.value = w.importUpdateResult, !A.value.length && !U.value.length) {
|
|
1756
|
-
C.value.push(
|
|
1763
|
+
C.value.push(u("inventory.ingredient.import.fileError.noData"));
|
|
1757
1764
|
return;
|
|
1758
1765
|
}
|
|
1759
1766
|
k.emitData(w);
|
|
1760
1767
|
} catch (r) {
|
|
1761
|
-
|
|
1762
|
-
title:
|
|
1768
|
+
d.open({
|
|
1769
|
+
title: u("inventory.ingredient.import.fileError.unableToRead"),
|
|
1763
1770
|
message: r == null ? void 0 : r.message,
|
|
1764
1771
|
type: "error"
|
|
1765
1772
|
}), console.error("Error in reading file", r);
|
|
1766
1773
|
} finally {
|
|
1767
|
-
C.value.length &&
|
|
1768
|
-
title:
|
|
1774
|
+
C.value.length && d.open({
|
|
1775
|
+
title: u("inventory.ingredient.import.fileError.invalidExcel"),
|
|
1769
1776
|
type: "error"
|
|
1770
|
-
}),
|
|
1777
|
+
}), _.value = !1;
|
|
1771
1778
|
}
|
|
1772
1779
|
}
|
|
1773
|
-
return _t(
|
|
1774
|
-
|
|
1775
|
-
}), (
|
|
1780
|
+
return _t(h, (c) => {
|
|
1781
|
+
c && a(c);
|
|
1782
|
+
}), (c, r) => {
|
|
1776
1783
|
const f = S("FmCircularProgress"), w = S("FmIcon"), F = S("FmButton");
|
|
1777
|
-
return
|
|
1778
|
-
n("div",
|
|
1779
|
-
s(
|
|
1784
|
+
return p(), V("div", nl, [
|
|
1785
|
+
n("div", ol, $(o(u)("inventory.ingredient.import.uploadDescription")), 1),
|
|
1786
|
+
s(_n, {
|
|
1780
1787
|
class: ie({
|
|
1781
1788
|
"w-full": !0,
|
|
1782
|
-
"h-[200px]": !
|
|
1789
|
+
"h-[200px]": !h.value
|
|
1783
1790
|
}),
|
|
1784
1791
|
accept: ".xlsx",
|
|
1785
|
-
onFileUpload: r[0] || (r[0] = (
|
|
1786
|
-
label: o(
|
|
1787
|
-
"button-label": o(
|
|
1792
|
+
onFileUpload: r[0] || (r[0] = (m) => h.value = m),
|
|
1793
|
+
label: o(u)("inventory.ingredient.import.uploadTemplate"),
|
|
1794
|
+
"button-label": o(u)("inventory.ingredient.import.selectFile")
|
|
1788
1795
|
}, kt({ _: 2 }, [
|
|
1789
|
-
|
|
1796
|
+
h.value ? {
|
|
1790
1797
|
name: "default",
|
|
1791
|
-
fn:
|
|
1792
|
-
n("div",
|
|
1798
|
+
fn: x(({ openFileDialog: m }) => [
|
|
1799
|
+
n("div", ll, [
|
|
1793
1800
|
n("div", {
|
|
1794
1801
|
class: ie([
|
|
1795
1802
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
1796
1803
|
{
|
|
1797
|
-
"border border-fm-color-neutral-gray-100":
|
|
1798
|
-
"border border-fm-color-neutral-gray-200": !
|
|
1804
|
+
"border border-fm-color-neutral-gray-100": _.value,
|
|
1805
|
+
"border border-fm-color-neutral-gray-200": !_.value && !l.value,
|
|
1799
1806
|
"border border-fm-color-system-error-200": l.value
|
|
1800
1807
|
}
|
|
1801
1808
|
])
|
|
1802
1809
|
}, [
|
|
1803
|
-
|
|
1810
|
+
_.value ? (p(), Y(f, {
|
|
1804
1811
|
key: 0,
|
|
1805
1812
|
size: "md",
|
|
1806
1813
|
color: "neutral-gray-200"
|
|
1807
|
-
})) : (
|
|
1814
|
+
})) : (p(), Y(w, {
|
|
1808
1815
|
key: 1,
|
|
1809
1816
|
name: l.value ? "error" : "attach_file",
|
|
1810
1817
|
outline: "",
|
|
@@ -1814,24 +1821,24 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1814
1821
|
class: ie([
|
|
1815
1822
|
"fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
|
|
1816
1823
|
{
|
|
1817
|
-
"text-fm-color-typo-disabled":
|
|
1818
|
-
"text-fm-color-typo-primary": !
|
|
1824
|
+
"text-fm-color-typo-disabled": _.value,
|
|
1825
|
+
"text-fm-color-typo-primary": !_.value
|
|
1819
1826
|
}
|
|
1820
1827
|
])
|
|
1821
1828
|
}, [
|
|
1822
|
-
n("div",
|
|
1829
|
+
n("div", al, $(h.value.name), 1)
|
|
1823
1830
|
], 2),
|
|
1824
|
-
|
|
1831
|
+
_.value ? L("", !0) : (p(), V("div", sl, [
|
|
1825
1832
|
s(F, {
|
|
1826
|
-
label: o(
|
|
1833
|
+
label: o(u)("inventory.ingredient.import.replaceFile"),
|
|
1827
1834
|
variant: l.value ? "destructive" : "secondary",
|
|
1828
1835
|
"prepend-icon": l.value ? void 0 : "autorenew",
|
|
1829
|
-
onClick:
|
|
1836
|
+
onClick: m
|
|
1830
1837
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
1831
1838
|
]))
|
|
1832
1839
|
], 2),
|
|
1833
|
-
C.value.length ? (
|
|
1834
|
-
(
|
|
1840
|
+
C.value.length ? (p(), V("div", rl, [
|
|
1841
|
+
(p(!0), V(ee, null, de(C.value, (B, R) => (p(), V("div", {
|
|
1835
1842
|
key: R,
|
|
1836
1843
|
class: "flex gap-8 items-center"
|
|
1837
1844
|
}, [
|
|
@@ -1840,52 +1847,52 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1840
1847
|
size: "sm",
|
|
1841
1848
|
color: "system-error-300"
|
|
1842
1849
|
}),
|
|
1843
|
-
n("div",
|
|
1850
|
+
n("div", il, $(B), 1)
|
|
1844
1851
|
]))), 128))
|
|
1845
|
-
])) :
|
|
1852
|
+
])) : L("", !0)
|
|
1846
1853
|
])
|
|
1847
1854
|
]),
|
|
1848
1855
|
key: "0"
|
|
1849
1856
|
} : void 0
|
|
1850
1857
|
]), 1032, ["class", "label", "button-label"]),
|
|
1851
|
-
i.value ? (
|
|
1852
|
-
n("div",
|
|
1853
|
-
(
|
|
1854
|
-
key:
|
|
1855
|
-
code:
|
|
1856
|
-
name:
|
|
1857
|
-
errors:
|
|
1858
|
+
i.value ? (p(), V("div", dl, [
|
|
1859
|
+
n("div", ul, $(o(u)("inventory.ingredient.import.summary")), 1),
|
|
1860
|
+
(p(!0), V(ee, null, de(A.value, (m) => (p(), Y(ht, {
|
|
1861
|
+
key: m.sku._id,
|
|
1862
|
+
code: m.sku.code,
|
|
1863
|
+
name: m.sku.name,
|
|
1864
|
+
errors: m.errors,
|
|
1858
1865
|
type: "create"
|
|
1859
1866
|
}, null, 8, ["code", "name", "errors"]))), 128)),
|
|
1860
|
-
(
|
|
1861
|
-
key:
|
|
1862
|
-
code:
|
|
1863
|
-
name:
|
|
1864
|
-
errors:
|
|
1867
|
+
(p(!0), V(ee, null, de(U.value, (m) => (p(), Y(ht, {
|
|
1868
|
+
key: m.sku._id,
|
|
1869
|
+
code: m.sku.code,
|
|
1870
|
+
name: m.sku.name,
|
|
1871
|
+
errors: m.errors,
|
|
1865
1872
|
type: "update"
|
|
1866
1873
|
}, null, 8, ["code", "name", "errors"]))), 128))
|
|
1867
|
-
])) :
|
|
1874
|
+
])) : L("", !0)
|
|
1868
1875
|
]);
|
|
1869
1876
|
};
|
|
1870
1877
|
}
|
|
1871
|
-
}),
|
|
1878
|
+
}), ml = {
|
|
1872
1879
|
key: 0,
|
|
1873
1880
|
class: "flex items-center gap-1"
|
|
1874
|
-
},
|
|
1881
|
+
}, pl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vl = { class: "flex flex-col py-8" }, fl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, yl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Kl = /* @__PURE__ */ xe({
|
|
1875
1882
|
__name: "IngredientsView",
|
|
1876
|
-
setup(
|
|
1877
|
-
const
|
|
1883
|
+
setup(W) {
|
|
1884
|
+
const h = Fe(), k = Ee(), d = g(() => [
|
|
1878
1885
|
{
|
|
1879
1886
|
type: "string",
|
|
1880
1887
|
key: "skuCode",
|
|
1881
1888
|
entity: "sku",
|
|
1882
|
-
values:
|
|
1889
|
+
values: h.skus.map((v) => v.code)
|
|
1883
1890
|
},
|
|
1884
1891
|
{
|
|
1885
1892
|
type: "string",
|
|
1886
1893
|
key: "skuUnitAbbrev",
|
|
1887
1894
|
entity: "sku",
|
|
1888
|
-
values:
|
|
1895
|
+
values: h.units.map((v) => v.abbrev)
|
|
1889
1896
|
},
|
|
1890
1897
|
{
|
|
1891
1898
|
type: "string",
|
|
@@ -1893,7 +1900,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1893
1900
|
entity: "sku",
|
|
1894
1901
|
values: ["Active", "Inactive"]
|
|
1895
1902
|
}
|
|
1896
|
-
]),
|
|
1903
|
+
]), _ = P({
|
|
1897
1904
|
logic: "AND",
|
|
1898
1905
|
rules: [
|
|
1899
1906
|
{
|
|
@@ -1906,10 +1913,10 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1906
1913
|
}), C = g(
|
|
1907
1914
|
() => new Set(k.getAvailableItems(k.businessSubsidiaryId))
|
|
1908
1915
|
), A = g(() => {
|
|
1909
|
-
if (!
|
|
1910
|
-
return
|
|
1911
|
-
const E = kn.build(
|
|
1912
|
-
return
|
|
1916
|
+
if (!_.value)
|
|
1917
|
+
return h.skus;
|
|
1918
|
+
const E = kn.build(_.value);
|
|
1919
|
+
return h.skus.filter((v) => k.isEnabled && ne.value && C.value && !C.value.has(v._id) ? !1 : wn(
|
|
1913
1920
|
{
|
|
1914
1921
|
skuCode: v.code,
|
|
1915
1922
|
skuUnitAbbrev: v.unit.abbrev,
|
|
@@ -1917,11 +1924,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1917
1924
|
},
|
|
1918
1925
|
E
|
|
1919
1926
|
));
|
|
1920
|
-
}), U = Wt(), l = Ke(), i =
|
|
1921
|
-
function
|
|
1927
|
+
}), U = Wt(), l = Ke(), i = mn(), u = Ae(), { t: a } = pe(), { createIngredient: c, updateIngredient: r } = Ye(), { ingredientDialogProps: f, ingredientViewLoading: w } = Xt(Ye()), { columnDefs: F } = Nn();
|
|
1928
|
+
function m(E) {
|
|
1922
1929
|
switch (E) {
|
|
1923
1930
|
case "add":
|
|
1924
|
-
return k.isEnabled ? void 0 :
|
|
1931
|
+
return k.isEnabled ? void 0 : c();
|
|
1925
1932
|
case "import":
|
|
1926
1933
|
return M();
|
|
1927
1934
|
case "export-all":
|
|
@@ -1968,8 +1975,8 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1968
1975
|
{ label: a("inventory.ingredient.export.exportFiltered"), value: "export-filtered", mobileOnly: !0 }
|
|
1969
1976
|
]);
|
|
1970
1977
|
function y(E) {
|
|
1971
|
-
const v =
|
|
1972
|
-
|
|
1978
|
+
const v = vn(E);
|
|
1979
|
+
u.open({
|
|
1973
1980
|
title: a("inventory.ingredient.export.success"),
|
|
1974
1981
|
message: a("inventory.ingredient.export.filename", [v]),
|
|
1975
1982
|
type: "success"
|
|
@@ -1978,7 +1985,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1978
1985
|
function M() {
|
|
1979
1986
|
l.open({
|
|
1980
1987
|
title: a("inventory.ingredient.import.title"),
|
|
1981
|
-
contentComponent:
|
|
1988
|
+
contentComponent: cl,
|
|
1982
1989
|
overlay: !0,
|
|
1983
1990
|
closeButton: !0,
|
|
1984
1991
|
primaryActions: {
|
|
@@ -1996,14 +2003,14 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1996
2003
|
}
|
|
1997
2004
|
}).onPrimary((E) => {
|
|
1998
2005
|
if (!E) {
|
|
1999
|
-
|
|
2006
|
+
u.open({
|
|
2000
2007
|
title: a("inventory.ingredient.import.error.noData"),
|
|
2001
2008
|
type: "error"
|
|
2002
2009
|
});
|
|
2003
2010
|
return;
|
|
2004
2011
|
}
|
|
2005
2012
|
if (!E.importCreateResult.length && !E.importUpdateResult.length) {
|
|
2006
|
-
|
|
2013
|
+
u.open({
|
|
2007
2014
|
title: a("inventory.ingredient.import.error.invalidContent"),
|
|
2008
2015
|
message: a("inventory.ingredient.import.error.noImportData"),
|
|
2009
2016
|
type: "error"
|
|
@@ -2011,7 +2018,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2011
2018
|
return;
|
|
2012
2019
|
}
|
|
2013
2020
|
if (E.importCreateResult.some((v) => v.errors.length) || E.importUpdateResult.some((v) => v.errors.length)) {
|
|
2014
|
-
|
|
2021
|
+
u.open({
|
|
2015
2022
|
title: a("inventory.ingredient.import.error.invalidContent"),
|
|
2016
2023
|
message: a("inventory.ingredient.import.error.hasErrors"),
|
|
2017
2024
|
type: "error"
|
|
@@ -2019,36 +2026,36 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2019
2026
|
return;
|
|
2020
2027
|
}
|
|
2021
2028
|
l.close(), G(E);
|
|
2022
|
-
}).onTertiary(
|
|
2029
|
+
}).onTertiary(fn);
|
|
2023
2030
|
}
|
|
2024
2031
|
async function G(E) {
|
|
2025
2032
|
R.value = !0;
|
|
2026
2033
|
try {
|
|
2027
2034
|
const v = [
|
|
2028
|
-
...E.importCreateResult.map(({ sku:
|
|
2029
|
-
...E.importUpdateResult.map(({ sku:
|
|
2030
|
-
],
|
|
2035
|
+
...E.importCreateResult.map(({ sku: q }) => ({ type: "create", sku: q })),
|
|
2036
|
+
...E.importUpdateResult.map(({ sku: q }) => ({ type: "update", sku: q }))
|
|
2037
|
+
], N = 100;
|
|
2031
2038
|
let J = 0;
|
|
2032
|
-
const
|
|
2033
|
-
J +=
|
|
2039
|
+
const ce = () => {
|
|
2040
|
+
J += N, u.open({
|
|
2034
2041
|
title: a("inventory.ingredient.import.progress", [
|
|
2035
2042
|
Math.min(J, v.length),
|
|
2036
2043
|
v.length
|
|
2037
2044
|
])
|
|
2038
2045
|
});
|
|
2039
2046
|
}, Q = new Array();
|
|
2040
|
-
for (const
|
|
2041
|
-
|
|
2047
|
+
for (const q of v.chunk(100)) {
|
|
2048
|
+
ce();
|
|
2042
2049
|
try {
|
|
2043
|
-
const O = await
|
|
2044
|
-
create:
|
|
2045
|
-
update:
|
|
2050
|
+
const O = await h.importSkus({
|
|
2051
|
+
create: q.filter((K) => K.type === "create").map((K) => K.sku),
|
|
2052
|
+
update: q.filter((K) => K.type === "update").map((K) => K.sku)
|
|
2046
2053
|
});
|
|
2047
2054
|
Q.push(...O.errors);
|
|
2048
2055
|
} catch (O) {
|
|
2049
2056
|
Q.push(
|
|
2050
|
-
...
|
|
2051
|
-
const
|
|
2057
|
+
...q.map((K) => {
|
|
2058
|
+
const z = {
|
|
2052
2059
|
module: qt.enum.sku,
|
|
2053
2060
|
_id: K.sku._id,
|
|
2054
2061
|
name: K.sku.name,
|
|
@@ -2056,13 +2063,13 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2056
2063
|
};
|
|
2057
2064
|
return {
|
|
2058
2065
|
data: K.sku,
|
|
2059
|
-
error: [
|
|
2066
|
+
error: [z]
|
|
2060
2067
|
};
|
|
2061
2068
|
})
|
|
2062
2069
|
);
|
|
2063
2070
|
}
|
|
2064
2071
|
}
|
|
2065
|
-
|
|
2072
|
+
u.open({
|
|
2066
2073
|
title: a("inventory.ingredient.import.success"),
|
|
2067
2074
|
type: "success"
|
|
2068
2075
|
}), Q.length && i.alert(
|
|
@@ -2071,19 +2078,19 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2071
2078
|
"div",
|
|
2072
2079
|
{ class: "flex flex-col gap-8" },
|
|
2073
2080
|
Q.map(
|
|
2074
|
-
(
|
|
2075
|
-
Z("div", { class: "fm-typo-en-body-lg-600" }, `(${
|
|
2081
|
+
(q) => Z("div", { class: "flex flex-col" }, [
|
|
2082
|
+
Z("div", { class: "fm-typo-en-body-lg-600" }, `(${q.data.code}) ${q.data.name}`),
|
|
2076
2083
|
Z(
|
|
2077
2084
|
"div",
|
|
2078
2085
|
{ class: "fm-typo-en-body-lg-400" },
|
|
2079
|
-
`${
|
|
2086
|
+
`${q.error.map((O) => (O == null ? void 0 : O.message) ?? "Unknown error").join(", ")}`
|
|
2080
2087
|
)
|
|
2081
2088
|
])
|
|
2082
2089
|
)
|
|
2083
2090
|
)
|
|
2084
2091
|
);
|
|
2085
2092
|
} catch (v) {
|
|
2086
|
-
|
|
2093
|
+
u.open({
|
|
2087
2094
|
title: a("inventory.ingredient.import.error.failed"),
|
|
2088
2095
|
message: a("inventory.ingredient.import.error.systemMessage", [v == null ? void 0 : v.message]),
|
|
2089
2096
|
type: "error"
|
|
@@ -2093,35 +2100,35 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2093
2100
|
}
|
|
2094
2101
|
}
|
|
2095
2102
|
return (E, v) => {
|
|
2096
|
-
const
|
|
2097
|
-
return
|
|
2103
|
+
const N = S("FmButton"), J = S("FmMenuItem"), ce = S("FmMenu"), Q = S("FmSwitch"), q = S("FmTable"), O = S("FmCollapsibleTabs"), K = S("FmBottomSheet");
|
|
2104
|
+
return p(), Y(nn, {
|
|
2098
2105
|
title: o(a)("inventory.ingredient.title"),
|
|
2099
2106
|
actions: we.value,
|
|
2100
|
-
"onClick:action":
|
|
2107
|
+
"onClick:action": m
|
|
2101
2108
|
}, {
|
|
2102
|
-
"header-end":
|
|
2103
|
-
s(
|
|
2104
|
-
"menu-button":
|
|
2105
|
-
s(
|
|
2109
|
+
"header-end": x(() => [
|
|
2110
|
+
s(ce, { "close-on-click": !0 }, {
|
|
2111
|
+
"menu-button": x(() => [
|
|
2112
|
+
s(N, {
|
|
2106
2113
|
label: o(a)("common.export"),
|
|
2107
2114
|
"bg-color": "neutral-gray-100",
|
|
2108
2115
|
"text-color": "neutral-gray-400"
|
|
2109
2116
|
}, null, 8, ["label"])
|
|
2110
2117
|
]),
|
|
2111
|
-
default:
|
|
2118
|
+
default: x(() => [
|
|
2112
2119
|
s(J, {
|
|
2113
2120
|
label: o(a)("inventory.ingredient.export.exportAll"),
|
|
2114
|
-
onClick: v[0] || (v[0] = (
|
|
2121
|
+
onClick: v[0] || (v[0] = (z) => y())
|
|
2115
2122
|
}, null, 8, ["label"]),
|
|
2116
2123
|
s(J, {
|
|
2117
2124
|
label: o(a)("inventory.ingredient.export.exportFiltered"),
|
|
2118
|
-
onClick: v[1] || (v[1] = (
|
|
2125
|
+
onClick: v[1] || (v[1] = (z) => y(A.value))
|
|
2119
2126
|
}, null, 8, ["label"])
|
|
2120
2127
|
]),
|
|
2121
2128
|
_: 1
|
|
2122
2129
|
})
|
|
2123
2130
|
]),
|
|
2124
|
-
default:
|
|
2131
|
+
default: x(() => [
|
|
2125
2132
|
n("div", {
|
|
2126
2133
|
class: ie([
|
|
2127
2134
|
"relative flex flex-col gap-8 max-h-full",
|
|
@@ -2131,34 +2138,34 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2131
2138
|
}
|
|
2132
2139
|
])
|
|
2133
2140
|
}, [
|
|
2134
|
-
s(
|
|
2141
|
+
s(xn, {
|
|
2135
2142
|
searchable: "",
|
|
2136
2143
|
search: B.value,
|
|
2137
|
-
"onUpdate:search": v[3] || (v[3] = (
|
|
2144
|
+
"onUpdate:search": v[3] || (v[3] = (z) => B.value = z),
|
|
2138
2145
|
filterable: "",
|
|
2139
|
-
"filter-attributes":
|
|
2140
|
-
filter:
|
|
2141
|
-
"onUpdate:filter": v[4] || (v[4] = (
|
|
2146
|
+
"filter-attributes": d.value,
|
|
2147
|
+
filter: _.value,
|
|
2148
|
+
"onUpdate:filter": v[4] || (v[4] = (z) => _.value = z)
|
|
2142
2149
|
}, {
|
|
2143
|
-
default:
|
|
2144
|
-
o(k).isEnabled ? (
|
|
2145
|
-
n("span",
|
|
2146
|
-
s(
|
|
2150
|
+
default: x(() => [
|
|
2151
|
+
o(k).isEnabled ? (p(), V("div", ml, [
|
|
2152
|
+
n("span", pl, $(o(a)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
|
|
2153
|
+
s(un),
|
|
2147
2154
|
s(Be, null, {
|
|
2148
|
-
default:
|
|
2155
|
+
default: x(() => [
|
|
2149
2156
|
s(Q, {
|
|
2150
2157
|
modelValue: ne.value,
|
|
2151
|
-
"onUpdate:modelValue": v[2] || (v[2] = (
|
|
2158
|
+
"onUpdate:modelValue": v[2] || (v[2] = (z) => ne.value = z)
|
|
2152
2159
|
}, null, 8, ["modelValue"])
|
|
2153
2160
|
]),
|
|
2154
2161
|
_: 1
|
|
2155
2162
|
})
|
|
2156
|
-
])) :
|
|
2163
|
+
])) : L("", !0)
|
|
2157
2164
|
]),
|
|
2158
2165
|
_: 1
|
|
2159
2166
|
}, 8, ["search", "filter-attributes", "filter"]),
|
|
2160
|
-
(
|
|
2161
|
-
key: JSON.stringify(
|
|
2167
|
+
(p(), Y(q, {
|
|
2168
|
+
key: JSON.stringify(_.value),
|
|
2162
2169
|
style: Dt(o(te).tableHeight),
|
|
2163
2170
|
"column-defs": o(F),
|
|
2164
2171
|
"row-data": A.value,
|
|
@@ -2168,27 +2175,27 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2168
2175
|
},
|
|
2169
2176
|
loading: (!o(U)._currentLocation || ve.value) && o(k).isReady,
|
|
2170
2177
|
"loading-text": o(a)("inventory.common.loading"),
|
|
2171
|
-
onRowClick: v[5] || (v[5] = (
|
|
2178
|
+
onRowClick: v[5] || (v[5] = (z) => o(r)(z.original)),
|
|
2172
2179
|
"page-size": le.value
|
|
2173
2180
|
}, {
|
|
2174
|
-
"list-row":
|
|
2175
|
-
s(
|
|
2176
|
-
row:
|
|
2181
|
+
"list-row": x((z) => [
|
|
2182
|
+
s(bn, {
|
|
2183
|
+
row: z,
|
|
2177
2184
|
onRowClick: o(r)
|
|
2178
2185
|
}, kt({
|
|
2179
|
-
default:
|
|
2180
|
-
var $e, Me, Ue, be, he,
|
|
2186
|
+
default: x((ge) => {
|
|
2187
|
+
var $e, Me, Ue, be, he, me, Te, Ve, _e, Ie;
|
|
2181
2188
|
return [
|
|
2182
|
-
n("div",
|
|
2183
|
-
n("div",
|
|
2189
|
+
n("div", vl, [
|
|
2190
|
+
n("div", fl, [
|
|
2184
2191
|
s(o(gt), {
|
|
2185
2192
|
render: (Ue = (Me = ($e = ge.code) == null ? void 0 : $e.column) == null ? void 0 : Me.columnDef) == null ? void 0 : Ue.cell,
|
|
2186
2193
|
props: (he = (be = ge.code) == null ? void 0 : be.getContext) == null ? void 0 : he.call(be)
|
|
2187
2194
|
}, null, 8, ["render", "props"])
|
|
2188
2195
|
]),
|
|
2189
|
-
n("div",
|
|
2196
|
+
n("div", yl, [
|
|
2190
2197
|
s(o(gt), {
|
|
2191
|
-
render: (Ve = (Te = (
|
|
2198
|
+
render: (Ve = (Te = (me = ge.name) == null ? void 0 : me.column) == null ? void 0 : Te.columnDef) == null ? void 0 : Ve.cell,
|
|
2192
2199
|
props: (Ie = (_e = ge.name) == null ? void 0 : _e.getContext) == null ? void 0 : Ie.call(_e)
|
|
2193
2200
|
}, null, 8, ["render", "props"])
|
|
2194
2201
|
])
|
|
@@ -2199,7 +2206,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2199
2206
|
}, [
|
|
2200
2207
|
R.value ? {
|
|
2201
2208
|
name: "loading-text",
|
|
2202
|
-
fn:
|
|
2209
|
+
fn: x(() => [
|
|
2203
2210
|
n("div", null, $(o(a)("inventory.ingredient.table.importing")), 1)
|
|
2204
2211
|
]),
|
|
2205
2212
|
key: "0"
|
|
@@ -2209,20 +2216,20 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2209
2216
|
_: 1
|
|
2210
2217
|
}, 8, ["style", "column-defs", "row-data", "search-value", "columnVisibility", "loading", "loading-text", "page-size"]))
|
|
2211
2218
|
], 2),
|
|
2212
|
-
(
|
|
2213
|
-
s(
|
|
2219
|
+
(p(), Y(it, { to: "body" }, [
|
|
2220
|
+
s(Jo, Nt(zt(o(f))), null, 16)
|
|
2214
2221
|
])),
|
|
2215
|
-
(
|
|
2222
|
+
(p(), Y(it, { to: "body" }, [
|
|
2216
2223
|
s(K, {
|
|
2217
2224
|
"dismiss-away": "",
|
|
2218
2225
|
modelValue: ae.value,
|
|
2219
|
-
"onUpdate:modelValue": v[7] || (v[7] = (
|
|
2226
|
+
"onUpdate:modelValue": v[7] || (v[7] = (z) => ae.value = z)
|
|
2220
2227
|
}, {
|
|
2221
|
-
default:
|
|
2228
|
+
default: x(() => [
|
|
2222
2229
|
s(O, {
|
|
2223
2230
|
class: "pb-8",
|
|
2224
2231
|
items: fe,
|
|
2225
|
-
"onUpdate:modelValue": v[6] || (v[6] = (
|
|
2232
|
+
"onUpdate:modelValue": v[6] || (v[6] = (z) => ye(z))
|
|
2226
2233
|
})
|
|
2227
2234
|
]),
|
|
2228
2235
|
_: 1
|
|
@@ -2235,5 +2242,5 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2235
2242
|
}
|
|
2236
2243
|
});
|
|
2237
2244
|
export {
|
|
2238
|
-
|
|
2245
|
+
Kl as default
|
|
2239
2246
|
};
|