@feedmepos/mf-inventory-portal 1.7.13-dev.4 → 1.7.13-dev.6
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-Cfp4CqzQ.js → App-JqoqVVdP.js} +354 -348
- package/dist/{ApprovalView-DO91AQ5f.js → ApprovalView-JiWbXkVU.js} +9 -9
- package/dist/{BindingsDialog-DUj0z6N7.js → BindingsDialog-BK4xofWu.js} +2 -2
- package/dist/{BindingsPicker-CD2J6-_Z.js → BindingsPicker-CLMsAseG.js} +2 -2
- package/dist/{BindingsTable-B2FEKZXU.js → BindingsTable-DKrBQTxN.js} +4 -4
- package/dist/{BulkReceiveRequestView-ejHyukEp.js → BulkReceiveRequestView-bttHw2ub.js} +19 -19
- package/dist/{ClosingDraftView-tIvrsfYH.js → ClosingDraftView-Bhdwo-n8.js} +19 -19
- package/dist/ClosingHistoryView-DrQPWnr6.js +761 -0
- package/dist/{ClosingTemplateView-C-hL9uPv.js → ClosingTemplateView-UkwXCrz_.js} +16 -16
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BffF8S_q.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DNtMdFVF.js} +1 -1
- package/dist/{DefaultView-BLbtx0Ho.js → DefaultView-sGrYeUGh.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-BLQHL7aB.js → DeliveryOrderPrintPreview-CVnqC9Jy.js} +10 -10
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BnTAuutB.js → EmailDialog.vue_vue_type_script_setup_true_lang-CYtHQ2Ru.js} +2250 -2250
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Mxhn0b6c.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DXTdvT0C.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-hrk0cTBX.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DtfiRgsD.js} +2 -2
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-yBIbCJYy.js +243 -0
- package/dist/{FmMultiselectDialog-Bpi5rI0h.js → FmMultiselectDialog-A9VIMLGn.js} +1 -1
- package/dist/{FmMultiselectDialog-Bi6XlAAU.js → FmMultiselectDialog-DL00XnUc.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-e55tnl4u.js → FmUnitInput.vue_vue_type_script_setup_true_lang-RJKOB-cm.js} +66 -63
- package/dist/{ImportView-xPTzBekx.js → ImportView-DPrLnJO8.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-tvmS42s_.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-IAQyFPmi.js} +1 -1
- package/dist/{IngredientGroupView-RFcqjF8T.js → IngredientGroupView-DyhC6lJ8.js} +5 -5
- package/dist/{IngredientsView-CvWOgquN.js → IngredientsView-P4AqPikD.js} +15 -15
- package/dist/{IntegrationExplorerView-CYNhsJSS.js → IntegrationExplorerView-CujhjHHV.js} +4 -4
- package/dist/{IntegrationView-ZtLokbu3.js → IntegrationView-CFqsZyzI.js} +3074 -2999
- package/dist/{InventoryBindingForm-DwiAIf5v.js → InventoryBindingForm-B0NJ8H51.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-njDaQe10.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-bbIpFo_4.js} +5 -5
- package/dist/{InventoryBindingSummary-zim_Bp5_.js → InventoryBindingSummary-CBgO_tCz.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CfTgt5xW.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DuuXzyKH.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-LLtd1VvM.js → PremiumBadge.vue_vue_type_script_setup_true_lang-C418f34P.js} +1 -1
- package/dist/ProductionRunDetailView-tSByC3nQ.js +5165 -0
- package/dist/ProductionRunPreparePrintView-zPAATL-n.js +31 -0
- package/dist/ProductionRunTabs.vue_vue_type_script_setup_true_lang-DgtZJgrs.js +3506 -0
- package/dist/ProductionRunView-BsP02jgC.js +815 -0
- package/dist/{PublishView-DFXOi7Hx.js → PublishView-Cf0Tn7xt.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-CG6kBQ26.js → PurchaseOrderPrintPreview-BTlSyQqZ.js} +6 -6
- package/dist/{ReceiveRequestView-DKMVMo7M.js → ReceiveRequestView-9LFOl2hJ.js} +14 -14
- package/dist/{RecipeView-cLLKlLmE.js → RecipeView-C4KxMCpQ.js} +17 -17
- package/dist/{SettingsView-Cmf2ZOUL.js → SettingsView-ShrefnTM.js} +4 -4
- package/dist/{StockView-DTai8l8U.js → StockView-BVd6f7Fr.js} +21 -21
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BlKm7GLw.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B-rB7p9o.js} +1 -1
- package/dist/{SupplierView-CRAHOOLm.js → SupplierView-DZSY6_eU.js} +12 -12
- package/dist/{SurchargeView-3XymEvcr.js → SurchargeView-UUYoT8MK.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DcXfQr_8.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-BLMxzi1C.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-qhJVHahS.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-z3qIVKP7.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CibsrZXw.js → TransferDetails.vue_vue_type_script_setup_true_lang-DEO8CP-X.js} +20 -20
- package/dist/{TransferTemplateView-ByhvK4Ua.js → TransferTemplateView-C21o2V_1.js} +20 -20
- package/dist/{UnitCostHistoryView-DHHWNJYA.js → UnitCostHistoryView-DPEGVLBP.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-bQu2KOI7.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BuGmmHBk.js} +4 -4
- package/dist/{UnitView-BZTS-Ahu.js → UnitView-Bx03E4uc.js} +7 -7
- package/dist/{WarehouseView-DVak1RPs.js → WarehouseView-BehHQ9Ao.js} +6 -6
- package/dist/{WastageTemplateView-CUDL3HUD.js → WastageTemplateView-gmr7doXL.js} +14 -14
- package/dist/api/netsuite.d.ts +13 -0
- package/dist/api/production-run-error.d.ts +36 -0
- package/dist/api/production-run-error.spec.d.ts +1 -0
- package/dist/api/production-run.d.ts +58 -0
- package/dist/api/stock.d.ts +0 -6
- package/dist/{app-BUQUpe4c.js → app-BT7hD4az.js} +16491 -12629
- package/dist/app.d.ts +2958 -14
- package/dist/app.js +1 -1
- package/dist/{closing-template-DzxDiEQB.js → closing-template-BNfr1RIX.js} +1 -1
- package/dist/components/FmInventoryBanner.vue.d.ts +39 -0
- package/dist/components/FmUnitInput.spec.d.ts +1 -0
- package/dist/components/FmUnitInputProps.d.ts +2 -0
- package/dist/composable/useModalA11y.d.ts +9 -0
- package/dist/composable/useModalA11y.spec.d.ts +1 -0
- package/dist/{date2-6jkfRNS_.js → date2-CAh7rsAp.js} +1 -1
- package/dist/{dayjs.min-ByRnXzrl.js → dayjs.min-BJk-edO7.js} +7 -7
- package/dist/{decimal-CqWBdj8E.js → decimal-DYlKNkVX.js} +2 -2
- package/dist/{defineDeepModel-CaT-4fiq.js → defineDeepModel-BPHl7mTD.js} +1 -1
- package/dist/{duplicate-template-Cyvx-WK7.js → duplicate-template-BWUUIdzG.js} +1 -1
- package/dist/{feature-FjXz4WXw.js → feature-CSvVyBN2.js} +2 -2
- package/dist/{format-time-from-id-cSri3OoO.js → format-time-from-id-Dh3lxXpc.js} +1 -1
- package/dist/{format-unit-display-DPbcT7Ff.js → format-unit-display-B1ft2wxm.js} +12 -12
- package/dist/{import-export.helper-_yqcePYs.js → import-export.helper-txDvkMf0.js} +6 -6
- package/dist/{index-CyJVMHQW.js → index-AmTodx3_.js} +1 -1
- package/dist/{index-CGvNoBid.js → index-B4wQijn6.js} +1 -1
- package/dist/{index-nSL5yxNn.js → index-TIX5DyQk.js} +3 -3
- package/dist/inventory-core-dart.default-BpMxAF-0.js +31060 -0
- package/dist/{lz-string-iyER1Klb.js → lz-string-CFDYH-K6.js} +1 -1
- package/dist/{netsuite-BD8LVxaA.js → netsuite-CdW9v92G.js} +477 -462
- package/dist/{number-C7CJ9ZfE.js → number-DRRlTYv7.js} +6 -6
- package/dist/{predefined-templates-o-_pKVSM.js → predefined-templates-C68U85pc.js} +1 -1
- package/dist/production-run-display-DmyfdjHR.js +239 -0
- package/dist/production-run-prepare-sheet-BvxMd19E.js +189 -0
- package/dist/{purchase-order-template-BHS8T1VA.js → purchase-order-template-BvED3CpO.js} +1 -1
- package/dist/{recalculationUtils-BCByr_CU.js → recalculationUtils-9rFepwwr.js} +1 -1
- package/dist/router/name.d.ts +2 -0
- package/dist/{rules-wZo-8FZ0.js → rules-C8RmopTe.js} +2 -2
- package/dist/{stock-DwqEvWM5.js → stock-BKkluaaM.js} +26 -36
- package/dist/{stock-CnAjxV7P.js → stock-CiCsT5JK.js} +3 -3
- package/dist/stores/integration/codemax.d.ts +1 -1
- package/dist/stores/integration/netsuite.d.ts +54 -0
- package/dist/style.css +1 -1
- package/dist/{supplier-DkqNwQmi.js → supplier--zZMQHPc.js} +2 -2
- package/dist/{surcharge-Csj1WYbH.js → surcharge-BLF3XV0G.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-BI1CdWeS.js → uom-rules-CjCCXiGL.js} +1 -1
- package/dist/{use-ingredient-select-dialog-5AqoZJDA.js → use-ingredient-select-dialog-DnUiY-Ic.js} +2 -2
- package/dist/{use-inventory-binding-dialog-ChiyhiuP.js → use-inventory-binding-dialog-BAU-P8kV.js} +2 -2
- package/dist/{use-template-enabled-locations-BqXxegct.js → use-template-enabled-locations-DZMzYCi-.js} +2 -2
- package/dist/{use-transfer-locations-Ckj_diGt.js → use-transfer-locations-DomGLsT2.js} +2 -2
- package/dist/{useHrmPermission-USG_KRoq.js → useHrmPermission-CrhsV_5z.js} +1 -1
- package/dist/{useNavigationMenu-BhYf87KI.js → useNavigationMenu-1h-G_-el.js} +2 -2
- package/dist/{useSseClient-BqoE-ir6.js → useSseClient-o_3wiqhX.js} +1 -1
- package/dist/views/changelog/composables/use-inventory-record-commits.d.ts +1 -1
- package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -1
- package/dist/views/integration/components/ApplyProductDialogCodemax.vue.d.ts +2 -2
- package/dist/views/integration/components/CodemaxDialog.vue.d.ts +2 -2
- package/dist/views/integration/components/netsuite/business/vendor-publish.d.ts +7 -0
- package/dist/views/integration/components/netsuite/business/vendor-publish.spec.d.ts +1 -0
- package/dist/views/production-run/ProductionRunDetailView.spec.d.ts +1 -0
- package/dist/views/production-run/ProductionRunDetailView.vue.d.ts +15 -0
- package/dist/views/production-run/ProductionRunPreparePrintView.spec.d.ts +1 -0
- package/dist/views/production-run/ProductionRunPreparePrintView.vue.d.ts +2 -0
- package/dist/views/production-run/ProductionRunView.spec.d.ts +1 -0
- package/dist/views/production-run/ProductionRunView.vue.d.ts +2 -0
- package/dist/views/production-run/components/CancelRunDialog.spec.d.ts +1 -0
- package/dist/views/production-run/components/CancelRunDialog.vue.d.ts +918 -0
- package/dist/views/production-run/components/CancelRunDialogProps.d.ts +9 -0
- package/dist/views/production-run/components/CloseRunDialog.spec.d.ts +1 -0
- package/dist/views/production-run/components/CloseRunDialog.vue.d.ts +918 -0
- package/dist/views/production-run/components/CloseRunDialogProps.d.ts +29 -0
- package/dist/views/production-run/components/PrepareRunConfirmationDialog.spec.d.ts +1 -0
- package/dist/views/production-run/components/PrepareRunConfirmationDialog.vue.d.ts +29 -0
- package/dist/views/production-run/components/PrepareRunDialog.spec.d.ts +1 -0
- package/dist/views/production-run/components/PrepareRunDialog.vue.d.ts +18 -0
- package/dist/views/production-run/components/PrepareRunDialogProps.d.ts +29 -0
- package/dist/views/production-run/components/PrepareSheetDialog.spec.d.ts +1 -0
- package/dist/views/production-run/components/PrepareSheetDialog.vue.d.ts +26 -0
- package/dist/views/{stock/components/dialog/SnapshotRecalculationDialog.vue.d.ts → production-run/components/ProductionRunActionMenuItem.vue.d.ts} +7 -10
- package/dist/views/production-run/components/ProductionRunActionsCell.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunActionsCell.vue.d.ts +20 -0
- package/dist/views/production-run/components/ProductionRunActivityTab.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunActivityTab.vue.d.ts +15 -0
- package/dist/views/production-run/components/ProductionRunBanner.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunBanner.vue.d.ts +42 -0
- package/dist/views/production-run/components/ProductionRunBatchCard.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunBatchCard.vue.d.ts +69 -0
- package/dist/views/production-run/components/ProductionRunBatchWastageDetails.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunBatchWastageDetails.vue.d.ts +33 -0
- package/dist/views/production-run/components/ProductionRunBindingsDisclosure.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunBindingsDisclosure.vue.d.ts +25 -0
- package/dist/views/production-run/components/ProductionRunBindingsList.vue.d.ts +51 -0
- package/dist/views/production-run/components/ProductionRunCompactDisclosure.vue.d.ts +25 -0
- package/dist/views/production-run/components/ProductionRunContributorBranch.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunContributorBranch.vue.d.ts +25 -0
- package/dist/views/production-run/components/ProductionRunCostRail.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunCostRail.vue.d.ts +77 -0
- package/dist/views/production-run/components/ProductionRunDialog.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunDialog.vue.d.ts +24 -0
- package/dist/views/production-run/components/ProductionRunDialogProps.d.ts +15 -0
- package/dist/views/production-run/components/ProductionRunDialogSurface.vue.d.ts +33 -0
- package/dist/views/production-run/components/ProductionRunDiscardDialog.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunDiscardDialog.vue.d.ts +21 -0
- package/dist/views/production-run/components/ProductionRunDuplicateDialog.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunDuplicateDialog.vue.d.ts +51 -0
- package/dist/views/production-run/components/ProductionRunFormDialog.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunFormDialog.vue.d.ts +918 -0
- package/dist/views/production-run/components/ProductionRunFormDialogProps.d.ts +22 -0
- package/dist/views/production-run/components/ProductionRunHeader.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunHeader.vue.d.ts +65 -0
- package/dist/views/production-run/components/ProductionRunHelpPopover.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunHelpPopover.vue.d.ts +52 -0
- package/dist/views/production-run/components/ProductionRunIngredientTree.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunIngredientTree.vue.d.ts +42 -0
- package/dist/views/production-run/components/ProductionRunIngredientsTab.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunIngredientsTab.vue.d.ts +63 -0
- package/dist/views/production-run/components/ProductionRunInstructionsCard.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunInstructionsCard.vue.d.ts +15 -0
- package/dist/views/production-run/components/ProductionRunItemPickerDialog.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunItemPickerDialog.vue.d.ts +30 -0
- package/dist/views/production-run/components/ProductionRunItemsCell.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunItemsCell.vue.d.ts +33 -0
- package/dist/views/production-run/components/ProductionRunItemsTable.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunItemsTable.vue.d.ts +73 -0
- package/dist/views/production-run/components/ProductionRunLoadBannerContract.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunNoBindingsHelp.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunNoBindingsHelp.vue.d.ts +15 -0
- package/dist/views/production-run/components/ProductionRunOutputTab.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunOutputTab.vue.d.ts +26 -0
- package/dist/views/production-run/components/ProductionRunOverviewTab.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunOverviewTab.vue.d.ts +999 -0
- package/dist/views/production-run/components/ProductionRunPlanCard.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunPlanCard.vue.d.ts +50 -0
- package/dist/views/production-run/components/ProductionRunPlanner.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunPlanner.vue.d.ts +61 -0
- package/dist/views/production-run/components/ProductionRunPrepareSheet.vue.d.ts +16 -0
- package/dist/views/production-run/components/ProductionRunProjectionFeedback.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunProjectionFeedback.vue.d.ts +41 -0
- package/dist/views/production-run/components/ProductionRunRecordOutputDetails.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunRecordOutputDetails.vue.d.ts +43 -0
- package/dist/views/production-run/components/ProductionRunRecordOutputWastageStatus.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunRecordOutputWastageStatus.vue.d.ts +31 -0
- package/dist/views/production-run/components/ProductionRunRequestedOverview.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunRequestedOverview.vue.d.ts +48 -0
- package/dist/views/production-run/components/ProductionRunResultTable.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunResultTable.vue.d.ts +31 -0
- package/dist/views/production-run/components/ProductionRunScrollHint.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunScrollHint.vue.d.ts +31 -0
- package/dist/views/production-run/components/ProductionRunSelectionCheckbox.vue.d.ts +31 -0
- package/dist/views/production-run/components/ProductionRunSelectionControls.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunSelectionRadio.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunSelectionRadio.vue.d.ts +37 -0
- package/dist/views/production-run/components/ProductionRunSideSheet.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunSideSheet.vue.d.ts +77 -0
- package/dist/views/production-run/components/ProductionRunSideSheetSurface.vue.d.ts +52 -0
- package/dist/views/production-run/components/ProductionRunSortHeader.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunSortHeader.vue.d.ts +25 -0
- package/dist/views/production-run/components/ProductionRunStatusBadge.vue.d.ts +15 -0
- package/dist/views/production-run/components/ProductionRunTabs.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunTabs.vue.d.ts +47 -0
- package/dist/views/production-run/components/ProductionRunTerminalNotice.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunTerminalNotice.vue.d.ts +15 -0
- package/dist/views/production-run/components/ProductionRunTextarea.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunTextarea.vue.d.ts +53 -0
- package/dist/views/production-run/components/ProductionRunUnitInput.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunUnitInput.vue.d.ts +34 -0
- package/dist/views/production-run/components/ProductionRunWastageDisclosure.spec.d.ts +1 -0
- package/dist/views/production-run/components/ProductionRunWastageDisclosure.vue.d.ts +23 -0
- package/dist/views/production-run/components/RecordOutputDialog.spec.d.ts +1 -0
- package/dist/views/production-run/components/RecordOutputDialog.vue.d.ts +20 -0
- package/dist/views/production-run/components/RecordOutputDialogProps.d.ts +28 -0
- package/dist/views/production-run/components/TargetReachedDialog.spec.d.ts +1 -0
- package/dist/views/production-run/components/TargetReachedDialog.vue.d.ts +927 -0
- package/dist/views/production-run/components/production-run-deduction-parity.spec.d.ts +1 -0
- package/dist/views/production-run/components/production-run-prepare-sheet.d.ts +17 -0
- package/dist/views/production-run/components/production-run-typography-contract.spec.d.ts +1 -0
- package/dist/views/production-run/components/production-run-unit-snapshot.d.ts +39 -0
- package/dist/views/production-run/composables/production-run-display.d.ts +272 -0
- package/dist/views/production-run/composables/production-run-display.spec.d.ts +1 -0
- package/dist/views/production-run/composables/production-run-list.d.ts +46 -0
- package/dist/views/production-run/composables/production-run-list.spec.d.ts +1 -0
- package/dist/views/production-run/composables/production-run-request-confirmation.d.ts +20 -0
- package/dist/views/production-run/composables/use-production-run-actions.d.ts +37 -0
- package/dist/views/production-run/composables/use-production-run-actions.spec.d.ts +1 -0
- package/dist/views/production-run/composables/use-production-run-cost.d.ts +672 -0
- package/dist/views/production-run/composables/use-production-run-cost.spec.d.ts +1 -0
- package/dist/views/production-run/composables/use-production-run-detail.d.ts +1894 -0
- package/dist/views/production-run/composables/use-production-run-detail.spec.d.ts +1 -0
- package/dist/views/production-run/composables/use-production-run-disclosure.d.ts +15 -0
- package/dist/views/production-run/composables/use-production-run-disclosure.spec.d.ts +1 -0
- package/dist/views/production-run/composables/use-production-run-duplicate-sources.d.ts +19 -0
- package/dist/views/production-run/composables/use-production-run-duplicate-sources.spec.d.ts +1 -0
- package/dist/views/production-run/composables/use-production-run-economics.d.ts +92 -0
- package/dist/views/production-run/composables/use-production-run-economics.spec.d.ts +1 -0
- package/dist/views/production-run/composables/use-production-run-form.d.ts +277 -0
- package/dist/views/production-run/composables/use-production-run-form.spec.d.ts +1 -0
- package/dist/views/production-run/composables/use-production-run-record-output.d.ts +261 -0
- package/dist/views/production-run/composables/use-production-run-record-output.spec.d.ts +1 -0
- package/dist/views/production-run/composables/use-production-run-scroll-hint.d.ts +9 -0
- package/dist/views/production-run/composables/use-production-run-table.d.ts +19 -0
- package/dist/views/production-run/composables/use-production-run-table.spec.d.ts +1 -0
- package/dist/views/production-run/helpers/production-run-precision.helper.d.ts +31 -0
- package/dist/views/production-run/helpers/production-run-quantity.helper.d.ts +55 -0
- package/dist/views/production-run/helpers/production-run-quantity.helper.spec.d.ts +1 -0
- package/dist/views/production-run/production-run.fixture.d.ts +70 -0
- package/dist/views/production-run/production-run.fixture.spec.d.ts +1 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +3 -3
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +3 -3
- package/dist/views/stock/components/dialog/RecalculationDialog.vue.d.ts +2 -17
- package/dist/{vue-i18n-DoKioQ81.js → vue-i18n-hE8n67Ig.js} +202 -202
- package/dist/{xlsx.util-BXjE2o-3.js → xlsx.util-Jv7EpwFc.js} +2 -2
- package/package.json +4 -4
- package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-ashHOuZt.js +0 -130
- package/dist/ClosingHistoryView-BYVZ01Ma.js +0 -1112
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-hTQmIyaf.js +0 -120
- package/dist/ProductionView-BWn7RBEg.js +0 -1441
- package/dist/inventory-core-dart.default-DSYRPQNZ.js +0 -25155
- package/dist/views/stock/components/StockRecalculateDialog.vue.d.ts +0 -9
|
@@ -1,1441 +0,0 @@
|
|
|
1
|
-
import { defineComponent as ce, ref as F, createElementBlock as c, openBlock as r, createElementVNode as t, createBlock as V, createTextVNode as G, toDisplayString as a, normalizeClass as ue, Teleport as Ce, createCommentVNode as P, Fragment as q, normalizeStyle as $e, renderList as U, computed as _, watch as ie, resolveComponent as j, withCtx as K, createVNode as M, onMounted as Se, h as E, reactive as Ie, withDirectives as Fe, vModelText as De, unref as Ne } from "vue";
|
|
2
|
-
import { _ as Te } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
|
|
3
|
-
import { useDialog as ve, useSnackbar as ge, components as se } from "@feedmepos/ui-library";
|
|
4
|
-
import { d as Be, u as be, a as xe } from "./app-BUQUpe4c.js";
|
|
5
|
-
import { _ as Ee } from "./ChangeLocationComponent.vue_vue_type_script_setup_true_lang-ashHOuZt.js";
|
|
6
|
-
import { useI18n as Ae } from "@feedmepos/mf-common";
|
|
7
|
-
import { c as ke } from "./inventory-core-dart.default-DSYRPQNZ.js";
|
|
8
|
-
import { u as Pe } from "./stock-CnAjxV7P.js";
|
|
9
|
-
import { a as Re } from "./FmMultiselectDialog-Bi6XlAAU.js";
|
|
10
|
-
import { e as qe, _ as Me } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-e55tnl4u.js";
|
|
11
|
-
import { u as Le } from "./stock-DwqEvWM5.js";
|
|
12
|
-
const he = Be((Q, w) => {
|
|
13
|
-
const y = be(), u = () => `${Q.inventoryBackendUrl}/${y.currentLocationDBName}/production`;
|
|
14
|
-
return {
|
|
15
|
-
async list(g) {
|
|
16
|
-
const b = g ? `?status=${g}` : "";
|
|
17
|
-
return await w.get(`${u()}${b}`);
|
|
18
|
-
},
|
|
19
|
-
async read(g) {
|
|
20
|
-
return await w.get(`${u()}/${g}`);
|
|
21
|
-
},
|
|
22
|
-
async create(g) {
|
|
23
|
-
return await w.post(u(), g);
|
|
24
|
-
},
|
|
25
|
-
async update(g, b) {
|
|
26
|
-
return await w.post(`${u()}/${g}`, b);
|
|
27
|
-
},
|
|
28
|
-
async request(g) {
|
|
29
|
-
return await w.post(`${u()}/${g}/request`);
|
|
30
|
-
},
|
|
31
|
-
// `items` are the per-item quantities produced in THIS completion record;
|
|
32
|
-
// omit to produce the remaining (requested − already-produced) of every item.
|
|
33
|
-
async complete(g, b) {
|
|
34
|
-
return await w.post(`${u()}/${g}/complete`, b ? { items: b } : void 0);
|
|
35
|
-
},
|
|
36
|
-
async cancel(g, b) {
|
|
37
|
-
return await w.post(`${u()}/${g}/cancel`, { reason: b });
|
|
38
|
-
},
|
|
39
|
-
async close(g) {
|
|
40
|
-
return await w.post(`${u()}/${g}/close`);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}), Ue = {
|
|
44
|
-
key: 0,
|
|
45
|
-
class: "w-fit whitespace-nowrap rounded-full bg-fm-color-neutral-gray-100 px-12 py-4 text-fm-color-typo-secondary",
|
|
46
|
-
title: "This item has no ingredient bindings — no stock will be deducted, but it can still be prepared."
|
|
47
|
-
}, Ve = {
|
|
48
|
-
key: 1,
|
|
49
|
-
class: "w-fit"
|
|
50
|
-
}, je = { class: "uppercase text-fm-color-typo-secondary" }, ze = { class: "text-fm-color-typo-secondary" }, Oe = /* @__PURE__ */ ce({
|
|
51
|
-
__name: "ProductionBindingsCell",
|
|
52
|
-
props: {
|
|
53
|
-
count: {},
|
|
54
|
-
unit: {},
|
|
55
|
-
lines: {}
|
|
56
|
-
},
|
|
57
|
-
setup(Q) {
|
|
58
|
-
const w = F(!1), y = F(null), u = F({ top: 0, left: 0 });
|
|
59
|
-
function g() {
|
|
60
|
-
if (!w.value && y.value) {
|
|
61
|
-
const I = y.value.getBoundingClientRect();
|
|
62
|
-
u.value = { top: I.bottom + 4, left: I.left };
|
|
63
|
-
}
|
|
64
|
-
w.value = !w.value;
|
|
65
|
-
}
|
|
66
|
-
function b(I) {
|
|
67
|
-
return `${parseFloat(I.toFixed(2))}`;
|
|
68
|
-
}
|
|
69
|
-
return (I, D) => I.count === 0 ? (r(), c("span", Ue, " No bindings ")) : (r(), c("div", Ve, [
|
|
70
|
-
t("button", {
|
|
71
|
-
ref_key: "btn",
|
|
72
|
-
ref: y,
|
|
73
|
-
type: "button",
|
|
74
|
-
class: "flex w-fit items-center gap-4 whitespace-nowrap rounded-full bg-fm-color-neutral-gray-100 px-12 py-4 text-fm-color-typo-secondary",
|
|
75
|
-
onClick: g
|
|
76
|
-
}, [
|
|
77
|
-
D[1] || (D[1] = t("span", { class: "text-orange-500" }, "•••", -1)),
|
|
78
|
-
G(" " + a(I.count) + " ingredients ", 1),
|
|
79
|
-
t("span", {
|
|
80
|
-
class: ue(["text-fm-color-typo-secondary", { "rotate-180": w.value }])
|
|
81
|
-
}, "⌄", 2)
|
|
82
|
-
], 512),
|
|
83
|
-
(r(), V(Ce, { to: "body" }, [
|
|
84
|
-
w.value ? (r(), c(q, { key: 0 }, [
|
|
85
|
-
t("div", {
|
|
86
|
-
class: "fixed inset-0",
|
|
87
|
-
style: { "z-index": "1000" },
|
|
88
|
-
onClick: D[0] || (D[0] = (B) => w.value = !1)
|
|
89
|
-
}),
|
|
90
|
-
t("div", {
|
|
91
|
-
class: "fixed rounded-8 border border-fm-color-line p-12",
|
|
92
|
-
style: $e({
|
|
93
|
-
top: `${u.value.top}px`,
|
|
94
|
-
left: `${u.value.left}px`,
|
|
95
|
-
background: "#fff",
|
|
96
|
-
minWidth: "240px",
|
|
97
|
-
zIndex: 1001,
|
|
98
|
-
boxShadow: "0 8px 24px rgba(0, 0, 0, 0.12)"
|
|
99
|
-
})
|
|
100
|
-
}, [
|
|
101
|
-
t("div", je, " Per 1 " + a(I.unit), 1),
|
|
102
|
-
(r(!0), c(q, null, U(I.lines, (B) => (r(), c("div", {
|
|
103
|
-
key: B.id,
|
|
104
|
-
class: "mt-4 flex items-center justify-between gap-16"
|
|
105
|
-
}, [
|
|
106
|
-
t("span", null, a(B.name), 1),
|
|
107
|
-
t("span", ze, a(b(B.amount)) + " " + a(B.unit), 1)
|
|
108
|
-
]))), 128))
|
|
109
|
-
], 4)
|
|
110
|
-
], 64)) : P("", !0)
|
|
111
|
-
]))
|
|
112
|
-
]));
|
|
113
|
-
}
|
|
114
|
-
}), Ge = { class: "flex flex-col gap-8" }, Qe = {
|
|
115
|
-
key: 0,
|
|
116
|
-
class: "py-12 text-fm-color-typo-secondary"
|
|
117
|
-
}, He = ["onClick"], We = { class: "flex min-w-0 flex-1 flex-col" }, Ke = { class: "truncate" }, Je = { class: "truncate text-fm-color-typo-secondary" }, Xe = { class: "whitespace-nowrap text-fm-color-typo-secondary" }, Ye = /* @__PURE__ */ ce({
|
|
118
|
-
__name: "ProductionDuplicateDialog",
|
|
119
|
-
props: {
|
|
120
|
-
batches: {}
|
|
121
|
-
},
|
|
122
|
-
emits: ["selected"],
|
|
123
|
-
setup(Q, { emit: w }) {
|
|
124
|
-
const y = Q, u = w, g = F(!1), b = F(null);
|
|
125
|
-
function I(f) {
|
|
126
|
-
if (!f) return "—";
|
|
127
|
-
const C = new Date(f);
|
|
128
|
-
return Number.isNaN(C.getTime()) ? "—" : C.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" });
|
|
129
|
-
}
|
|
130
|
-
function D(f) {
|
|
131
|
-
var C;
|
|
132
|
-
return (C = f.name) != null && C.trim() ? f.name.trim() : f.batchNo ? `Production #${f.batchNo}` : `Production · ${I(f.createdAt)}`;
|
|
133
|
-
}
|
|
134
|
-
const B = {
|
|
135
|
-
DRAFT: "Draft",
|
|
136
|
-
REQUESTING: "Requested",
|
|
137
|
-
COMPLETE: "Completed",
|
|
138
|
-
CANCEL: "Cancelled",
|
|
139
|
-
CLOSE: "Closed"
|
|
140
|
-
}, k = _(() => [...y.batches].sort((f, C) => C._id.localeCompare(f._id))), m = _(() => !!b.value);
|
|
141
|
-
ie(g, (f) => {
|
|
142
|
-
f && (b.value = null);
|
|
143
|
-
});
|
|
144
|
-
function N() {
|
|
145
|
-
const f = k.value.find((C) => C._id === b.value);
|
|
146
|
-
f && (g.value = !1, u("selected", f));
|
|
147
|
-
}
|
|
148
|
-
return (f, C) => {
|
|
149
|
-
const O = j("FmButton"), v = j("FmIcon"), x = j("FmDialog");
|
|
150
|
-
return r(), V(x, {
|
|
151
|
-
modelValue: g.value,
|
|
152
|
-
"onUpdate:modelValue": C[0] || (C[0] = ($) => g.value = $),
|
|
153
|
-
overlay: !0,
|
|
154
|
-
"min-width": 640
|
|
155
|
-
}, {
|
|
156
|
-
"dialog-button": K(() => [
|
|
157
|
-
M(O, {
|
|
158
|
-
label: "Duplicate from",
|
|
159
|
-
variant: "secondary",
|
|
160
|
-
"prepend-icon": "content_copy"
|
|
161
|
-
})
|
|
162
|
-
]),
|
|
163
|
-
"dialog-header": K(() => C[1] || (C[1] = [
|
|
164
|
-
t("div", null, "Duplicate from a batch", -1)
|
|
165
|
-
])),
|
|
166
|
-
"dialog-footer": K(() => [
|
|
167
|
-
M(O, {
|
|
168
|
-
class: "ml-auto",
|
|
169
|
-
label: "Duplicate",
|
|
170
|
-
disabled: !m.value,
|
|
171
|
-
onClick: N
|
|
172
|
-
}, null, 8, ["disabled"])
|
|
173
|
-
]),
|
|
174
|
-
default: K(() => [
|
|
175
|
-
t("div", Ge, [
|
|
176
|
-
C[2] || (C[2] = t("div", { class: "text-fm-color-typo-secondary" }, " Pick a batch to copy its items into this prepare. ", -1)),
|
|
177
|
-
k.value.length ? P("", !0) : (r(), c("div", Qe, " No previous batches to duplicate. ")),
|
|
178
|
-
(r(!0), c(q, null, U(k.value, ($) => (r(), c("button", {
|
|
179
|
-
key: $._id,
|
|
180
|
-
type: "button",
|
|
181
|
-
class: ue([
|
|
182
|
-
"flex items-center gap-8 fm-corner-radius-md border p-12 text-left",
|
|
183
|
-
b.value === $._id ? "border-orange-500 bg-orange-50" : "border-fm-color-line"
|
|
184
|
-
]),
|
|
185
|
-
onClick: (z) => b.value = $._id
|
|
186
|
-
}, [
|
|
187
|
-
t("div", We, [
|
|
188
|
-
t("span", Ke, a(D($)), 1),
|
|
189
|
-
t("span", Je, a($.items.length) + " item" + a($.items.length === 1 ? "" : "s") + " · " + a(B[$.status]), 1)
|
|
190
|
-
]),
|
|
191
|
-
t("span", Xe, a(I($.createdAt)), 1),
|
|
192
|
-
b.value === $._id ? (r(), V(v, {
|
|
193
|
-
key: 0,
|
|
194
|
-
name: "check",
|
|
195
|
-
class: "text-orange-500"
|
|
196
|
-
})) : P("", !0)
|
|
197
|
-
], 10, He))), 128))
|
|
198
|
-
])
|
|
199
|
-
]),
|
|
200
|
-
_: 1
|
|
201
|
-
}, 8, ["modelValue"]);
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
}), Ze = { class: "flex items-start gap-16" }, et = { class: "flex-1" }, tt = { class: "flex flex-col gap-4 p-12" }, ot = { class: "flex items-center gap-12 border-b border-fm-color-line p-12" }, nt = { class: "text-fm-color-typo-secondary" }, st = { class: "ml-auto flex items-center gap-12" }, at = { class: "flex items-center gap-16 p-16" }, lt = { class: "text-fm-color-typo-secondary" }, rt = { class: "ml-auto flex items-center gap-12" }, it = { class: "w-[360px] shrink-0 overflow-hidden rounded-lg border border-fm-color-line" }, ut = { class: "border-b border-fm-color-line p-16" }, ct = { class: "mt-12" }, dt = { class: "inline-flex items-center gap-4 rounded-full bg-fm-color-neutral-gray-100 px-12 py-4" }, mt = { class: "ml-4" }, pt = { class: "grid grid-cols-2 divide-x divide-fm-color-line border-b border-fm-color-line" }, ft = { class: "p-16" }, vt = { class: "mt-4 text-2xl font-semibold" }, yt = { class: "text-fm-color-typo-secondary" }, gt = { class: "p-16" }, bt = { class: "mt-4 text-2xl font-semibold text-fm-color-typo-secondary" }, xt = { class: "text-fm-color-typo-secondary" }, kt = {
|
|
205
|
-
key: 0,
|
|
206
|
-
class: "flex flex-col items-center gap-12 p-24 text-center"
|
|
207
|
-
}, ht = { class: "flex h-[56px] w-[56px] items-center justify-center rounded-full bg-fm-color-neutral-gray-100" }, _t = {
|
|
208
|
-
key: 1,
|
|
209
|
-
class: "p-16"
|
|
210
|
-
}, wt = { class: "flex items-center" }, Ct = { class: "mt-4 text-sm text-fm-color-typo-secondary" }, $t = {
|
|
211
|
-
key: 0,
|
|
212
|
-
class: "mt-4 flex flex-col gap-4 text-sm"
|
|
213
|
-
}, St = /* @__PURE__ */ ce({
|
|
214
|
-
__name: "ProductionPrepareBuilder",
|
|
215
|
-
props: {
|
|
216
|
-
batch: {}
|
|
217
|
-
},
|
|
218
|
-
emits: ["created"],
|
|
219
|
-
setup(Q, { emit: w }) {
|
|
220
|
-
const y = Q, u = w, g = he(), b = xe(), I = Pe(), D = ve(), { t: B } = Ae(), k = ge(), m = F([]), N = F([]), f = F(""), C = F(!1), O = F("");
|
|
221
|
-
function v() {
|
|
222
|
-
const o = /* @__PURE__ */ new Date();
|
|
223
|
-
return `${`${o.getHours()}`.padStart(2, "0")}:${`${o.getMinutes()}`.padStart(2, "0")}`;
|
|
224
|
-
}
|
|
225
|
-
async function x() {
|
|
226
|
-
await I.readStockBalance(), O.value = v();
|
|
227
|
-
}
|
|
228
|
-
Se(async () => {
|
|
229
|
-
await x(), N.value = await g.list(), y.batch && (f.value = y.batch.name ?? "", ne(y.batch));
|
|
230
|
-
});
|
|
231
|
-
const $ = _(() => b.skus);
|
|
232
|
-
function z(o) {
|
|
233
|
-
return o ? o.amount / Math.pow(10, o.precision) : 0;
|
|
234
|
-
}
|
|
235
|
-
function R(o) {
|
|
236
|
-
return `${parseFloat(o.toFixed(2))}`;
|
|
237
|
-
}
|
|
238
|
-
const A = _(
|
|
239
|
-
() => new Map((I.stockBalance.skus ?? []).map((o) => [o.id, o.balance]))
|
|
240
|
-
);
|
|
241
|
-
function J(o) {
|
|
242
|
-
return z(A.value.get(o));
|
|
243
|
-
}
|
|
244
|
-
function Y() {
|
|
245
|
-
return (b.skus ?? []).map((o) => ({
|
|
246
|
-
doc: o,
|
|
247
|
-
balance: A.value.get(o._id) ?? { amount: 0, precision: 0 },
|
|
248
|
-
abbrev: o.unit.abbrev,
|
|
249
|
-
uom: []
|
|
250
|
-
}));
|
|
251
|
-
}
|
|
252
|
-
const L = ke({
|
|
253
|
-
env: {
|
|
254
|
-
stocks: Y(),
|
|
255
|
-
recipes: b.recipes ?? []
|
|
256
|
-
}
|
|
257
|
-
}), H = F(0);
|
|
258
|
-
ie(
|
|
259
|
-
() => [b.skus, b.recipes],
|
|
260
|
-
() => {
|
|
261
|
-
L.updateEnv({
|
|
262
|
-
stocks: Y(),
|
|
263
|
-
recipes: b.recipes ?? []
|
|
264
|
-
}), H.value++;
|
|
265
|
-
}
|
|
266
|
-
), ie(A, () => {
|
|
267
|
-
L.updateBalances(Y()), H.value++;
|
|
268
|
-
}), ie(
|
|
269
|
-
m,
|
|
270
|
-
() => {
|
|
271
|
-
var o;
|
|
272
|
-
L.resetState(), L.addItems(
|
|
273
|
-
m.value.map((n) => ({
|
|
274
|
-
doc: n.sku,
|
|
275
|
-
balance: A.value.get(n.sku._id) ?? { amount: 0, precision: 0 },
|
|
276
|
-
abbrev: n.sku.unit.abbrev,
|
|
277
|
-
uom: []
|
|
278
|
-
}))
|
|
279
|
-
);
|
|
280
|
-
for (const n of m.value)
|
|
281
|
-
L.updateItem(n.sku._id, n.model.amount, (o = n.model.measurement) == null ? void 0 : o.id);
|
|
282
|
-
H.value++;
|
|
283
|
-
},
|
|
284
|
-
{ deep: !0, immediate: !0 }
|
|
285
|
-
);
|
|
286
|
-
const de = _(() => (H.value, new Map(L.getItemBreakdown().map((o) => [o.item.key, o]))));
|
|
287
|
-
function te(o) {
|
|
288
|
-
const n = de.value.get(o);
|
|
289
|
-
return ((n == null ? void 0 : n.lines) ?? []).map((h) => ({
|
|
290
|
-
id: h.skuId,
|
|
291
|
-
name: h.name,
|
|
292
|
-
amount: h.perUnit,
|
|
293
|
-
unit: h.unit
|
|
294
|
-
}));
|
|
295
|
-
}
|
|
296
|
-
function oe(o) {
|
|
297
|
-
return te(o).length;
|
|
298
|
-
}
|
|
299
|
-
function ae() {
|
|
300
|
-
const o = $.value.map((n) => ({
|
|
301
|
-
label: n.name,
|
|
302
|
-
sublabel: n.code,
|
|
303
|
-
value: n._id,
|
|
304
|
-
tags: L.itemHasBindings(n._id) ? void 0 : ["No bindings"]
|
|
305
|
-
}));
|
|
306
|
-
D.open({
|
|
307
|
-
title: B("inventory.transfer.form.items.selectItem"),
|
|
308
|
-
closeButton: !0,
|
|
309
|
-
contentComponent: Re,
|
|
310
|
-
contentComponentProps: {
|
|
311
|
-
modelValue: m.value.map((n) => n.sku._id),
|
|
312
|
-
items: o,
|
|
313
|
-
virtualScroll: !0
|
|
314
|
-
},
|
|
315
|
-
primaryActions: { text: B("common.confirm"), close: !0 },
|
|
316
|
-
secondaryActions: { text: B("common.close"), close: !0, variant: "tertiary" }
|
|
317
|
-
}).onPrimary((n) => {
|
|
318
|
-
const h = new Map(m.value.map((S) => [S.sku._id, S]));
|
|
319
|
-
m.value = n.map(
|
|
320
|
-
(S) => h.get(S) ?? {
|
|
321
|
-
sku: b.skuById[S],
|
|
322
|
-
model: qe()
|
|
323
|
-
}
|
|
324
|
-
).filter((S) => !!S.sku);
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
function re(o) {
|
|
328
|
-
m.value = m.value.filter((n) => n.sku._id !== o);
|
|
329
|
-
}
|
|
330
|
-
function me() {
|
|
331
|
-
m.value = [];
|
|
332
|
-
}
|
|
333
|
-
function ne(o) {
|
|
334
|
-
const n = [];
|
|
335
|
-
for (const h of o.items) {
|
|
336
|
-
const S = b.skuById[h.skuId];
|
|
337
|
-
S && n.push({
|
|
338
|
-
sku: S,
|
|
339
|
-
model: { amount: h.amount, measurement: h.measurement ?? null }
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
m.value = n;
|
|
343
|
-
}
|
|
344
|
-
const Z = _(() => (H.value, L.getIngredientImpacts().map((o) => ({ ...o, status: String(o.status) })))), ee = _(() => {
|
|
345
|
-
H.value;
|
|
346
|
-
const o = /* @__PURE__ */ new Map(), n = (h) => {
|
|
347
|
-
let S = o.get(h);
|
|
348
|
-
return S || (S = { producers: [], consumers: [] }, o.set(h, S)), S;
|
|
349
|
-
};
|
|
350
|
-
for (const h of L.getItemBreakdown()) {
|
|
351
|
-
if (h.qty <= 0) continue;
|
|
352
|
-
const S = h.item.inventoryStock.doc.name;
|
|
353
|
-
n(h.item.key).producers.push({ name: S, amount: h.qty });
|
|
354
|
-
for (const pe of h.lines)
|
|
355
|
-
pe.total > 0 && n(pe.skuId).consumers.push({ name: S, amount: pe.total });
|
|
356
|
-
}
|
|
357
|
-
return o;
|
|
358
|
-
});
|
|
359
|
-
function X(o) {
|
|
360
|
-
var n;
|
|
361
|
-
return ((n = ee.value.get(o)) == null ? void 0 : n.producers) ?? [];
|
|
362
|
-
}
|
|
363
|
-
function le(o) {
|
|
364
|
-
var n;
|
|
365
|
-
return ((n = ee.value.get(o)) == null ? void 0 : n.consumers) ?? [];
|
|
366
|
-
}
|
|
367
|
-
const W = _(() => m.value.filter((o) => z(o.model.amount) > 0)), l = _(
|
|
368
|
-
() => W.value.filter((o) => L.itemHasBindings(o.sku._id)).length
|
|
369
|
-
), e = _(() => Z.value.filter((o) => o.status !== "ok").length), s = _(() => W.value.length > 0);
|
|
370
|
-
function d() {
|
|
371
|
-
return W.value.map((o) => ({
|
|
372
|
-
skuId: o.sku._id,
|
|
373
|
-
sku: o.sku,
|
|
374
|
-
amount: o.model.amount,
|
|
375
|
-
measurement: o.model.measurement ?? void 0
|
|
376
|
-
}));
|
|
377
|
-
}
|
|
378
|
-
async function i() {
|
|
379
|
-
if (s.value) {
|
|
380
|
-
C.value = !0;
|
|
381
|
-
try {
|
|
382
|
-
const o = { name: f.value.trim() || void 0, items: d() };
|
|
383
|
-
y.batch ? (await g.update(y.batch._id, o), k == null || k.open({ title: "Draft updated", type: "success" })) : (await g.create(o), k == null || k.open({
|
|
384
|
-
title: `Saved ${W.value.length} item(s) as draft`,
|
|
385
|
-
type: "success"
|
|
386
|
-
})), m.value = [], f.value = "", u("created");
|
|
387
|
-
} catch (o) {
|
|
388
|
-
k == null || k.open({ title: "Failed to save draft", message: `${(o == null ? void 0 : o.message) ?? o}`, type: "error" });
|
|
389
|
-
} finally {
|
|
390
|
-
C.value = !1;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
const p = [
|
|
395
|
-
{
|
|
396
|
-
id: "item",
|
|
397
|
-
header: () => "Production item",
|
|
398
|
-
minSize: 220,
|
|
399
|
-
enableSorting: !1,
|
|
400
|
-
cell: (o) => {
|
|
401
|
-
var S;
|
|
402
|
-
const n = o.row.original.sku, h = [];
|
|
403
|
-
return n.operationalGroup && h.push(E("span", {}, n.operationalGroup)), (S = n.customAttributes) != null && S.perishable && h.push(
|
|
404
|
-
E(
|
|
405
|
-
"span",
|
|
406
|
-
{ class: "rounded-full bg-orange-100 px-8 py-4 text-orange-600" },
|
|
407
|
-
"Perishable"
|
|
408
|
-
)
|
|
409
|
-
), E("div", { class: "flex flex-col" }, [
|
|
410
|
-
E("span", { class: "" }, n.name),
|
|
411
|
-
E("span", { class: "flex items-center gap-8 text-fm-color-typo-secondary" }, h)
|
|
412
|
-
]);
|
|
413
|
-
}
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
id: "unit",
|
|
417
|
-
header: () => "Unit",
|
|
418
|
-
size: 70,
|
|
419
|
-
enableSorting: !1,
|
|
420
|
-
cell: (o) => E("span", { class: "" }, o.row.original.sku.unit.abbrev)
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
id: "balance",
|
|
424
|
-
header: () => "Current balance",
|
|
425
|
-
size: 130,
|
|
426
|
-
enableSorting: !1,
|
|
427
|
-
cell: (o) => {
|
|
428
|
-
const n = o.row.original.sku;
|
|
429
|
-
return E("div", { class: "flex flex-col items-end" }, [
|
|
430
|
-
E("span", { class: "" }, R(J(n._id))),
|
|
431
|
-
E("span", { class: "text-fm-color-typo-secondary" }, n.unit.abbrev)
|
|
432
|
-
]);
|
|
433
|
-
}
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
id: "bindings",
|
|
437
|
-
header: () => "Bindings",
|
|
438
|
-
minSize: 200,
|
|
439
|
-
enableSorting: !1,
|
|
440
|
-
cell: (o) => E(Oe, {
|
|
441
|
-
count: oe(o.row.original.sku._id),
|
|
442
|
-
unit: o.row.original.sku.unit.abbrev,
|
|
443
|
-
lines: te(o.row.original.sku._id)
|
|
444
|
-
})
|
|
445
|
-
},
|
|
446
|
-
{
|
|
447
|
-
id: "qty",
|
|
448
|
-
header: () => "Prepare qty",
|
|
449
|
-
minSize: 200,
|
|
450
|
-
enableSorting: !1,
|
|
451
|
-
cell: (o) => {
|
|
452
|
-
const n = o.row.original, h = o.row.index;
|
|
453
|
-
return E(Me, {
|
|
454
|
-
key: n.sku._id,
|
|
455
|
-
modelValue: n.model,
|
|
456
|
-
unit: n.sku.unit,
|
|
457
|
-
"onUpdate:modelValue": (S) => {
|
|
458
|
-
S && (m.value = [
|
|
459
|
-
...m.value.slice(0, h),
|
|
460
|
-
{ ...n, model: S },
|
|
461
|
-
...m.value.slice(h + 1)
|
|
462
|
-
]);
|
|
463
|
-
}
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
id: "remove",
|
|
469
|
-
header: () => "",
|
|
470
|
-
size: 48,
|
|
471
|
-
enableSorting: !1,
|
|
472
|
-
cell: (o) => E("div", { class: "flex justify-end" }, [
|
|
473
|
-
E(se.FmButton, {
|
|
474
|
-
icon: "close",
|
|
475
|
-
variant: "tertiary",
|
|
476
|
-
size: "md",
|
|
477
|
-
onClick: () => re(o.row.original.sku._id)
|
|
478
|
-
})
|
|
479
|
-
])
|
|
480
|
-
}
|
|
481
|
-
];
|
|
482
|
-
return (o, n) => {
|
|
483
|
-
const h = j("FmTextField"), S = j("FmButton"), pe = j("FmTable"), we = j("FmIcon");
|
|
484
|
-
return r(), c("div", Ze, [
|
|
485
|
-
t("div", et, [
|
|
486
|
-
t("div", tt, [
|
|
487
|
-
n[1] || (n[1] = t("span", { class: "text-fm-color-typo-secondary" }, "Batch name (optional)", -1)),
|
|
488
|
-
M(h, {
|
|
489
|
-
modelValue: f.value,
|
|
490
|
-
"onUpdate:modelValue": n[0] || (n[0] = (T) => f.value = T),
|
|
491
|
-
placeholder: "e.g. Afternoon top-up"
|
|
492
|
-
}, null, 8, ["modelValue"])
|
|
493
|
-
]),
|
|
494
|
-
t("div", ot, [
|
|
495
|
-
M(S, {
|
|
496
|
-
label: "Add items",
|
|
497
|
-
"prepend-icon": "add",
|
|
498
|
-
onClick: ae
|
|
499
|
-
}),
|
|
500
|
-
t("span", nt, a(m.value.length) + " selected ", 1),
|
|
501
|
-
t("div", st, [
|
|
502
|
-
M(Ye, {
|
|
503
|
-
batches: N.value,
|
|
504
|
-
onSelected: ne
|
|
505
|
-
}, null, 8, ["batches"]),
|
|
506
|
-
M(S, {
|
|
507
|
-
label: "Clear all",
|
|
508
|
-
variant: "tertiary",
|
|
509
|
-
onClick: me
|
|
510
|
-
})
|
|
511
|
-
])
|
|
512
|
-
]),
|
|
513
|
-
M(pe, {
|
|
514
|
-
"column-defs": p,
|
|
515
|
-
"row-data": m.value,
|
|
516
|
-
"row-key": (T) => T.sku._id,
|
|
517
|
-
"hide-footer": !0,
|
|
518
|
-
"empty-text": "No items queued. Use “Add items” to pick what to produce."
|
|
519
|
-
}, null, 8, ["row-data", "row-key"]),
|
|
520
|
-
t("div", at, [
|
|
521
|
-
t("span", lt, [
|
|
522
|
-
t("b", null, a(W.value.length), 1),
|
|
523
|
-
n[2] || (n[2] = G(" items queued · ")),
|
|
524
|
-
t("b", null, a(Z.value.length), 1),
|
|
525
|
-
n[3] || (n[3] = G(" ingredients impacted "))
|
|
526
|
-
]),
|
|
527
|
-
t("div", rt, [
|
|
528
|
-
M(S, {
|
|
529
|
-
label: `Save draft · ${W.value.length} item${W.value.length === 1 ? "" : "s"}`,
|
|
530
|
-
disabled: !s.value,
|
|
531
|
-
loading: C.value,
|
|
532
|
-
onClick: i
|
|
533
|
-
}, null, 8, ["label", "disabled", "loading"])
|
|
534
|
-
])
|
|
535
|
-
])
|
|
536
|
-
]),
|
|
537
|
-
t("div", it, [
|
|
538
|
-
t("div", ut, [
|
|
539
|
-
n[6] || (n[6] = t("div", { class: "text-lg font-semibold" }, "Ingredient impact", -1)),
|
|
540
|
-
n[7] || (n[7] = t("div", { class: "mt-4 text-fm-color-typo-secondary" }, " Live deductions across all queued rows. Shortages are flagged, not blocking. ", -1)),
|
|
541
|
-
t("div", ct, [
|
|
542
|
-
t("span", dt, [
|
|
543
|
-
n[4] || (n[4] = t("span", { class: "h-8 w-8 rounded-full bg-green-500" }, null, -1)),
|
|
544
|
-
n[5] || (n[5] = G(" Balances as of ")),
|
|
545
|
-
t("b", mt, a(O.value), 1)
|
|
546
|
-
])
|
|
547
|
-
])
|
|
548
|
-
]),
|
|
549
|
-
t("div", pt, [
|
|
550
|
-
t("div", ft, [
|
|
551
|
-
n[8] || (n[8] = t("div", { class: "text-xs uppercase text-fm-color-typo-secondary" }, "Ingredients used", -1)),
|
|
552
|
-
t("div", vt, a(Z.value.length), 1),
|
|
553
|
-
t("div", yt, "across " + a(l.value) + " items", 1)
|
|
554
|
-
]),
|
|
555
|
-
t("div", gt, [
|
|
556
|
-
n[9] || (n[9] = t("div", { class: "text-xs uppercase text-fm-color-typo-secondary" }, "Warnings", -1)),
|
|
557
|
-
t("div", bt, a(e.value), 1),
|
|
558
|
-
t("div", xt, a(e.value) + " low-stock", 1)
|
|
559
|
-
])
|
|
560
|
-
]),
|
|
561
|
-
Z.value.length === 0 ? (r(), c("div", kt, [
|
|
562
|
-
t("span", ht, [
|
|
563
|
-
M(we, {
|
|
564
|
-
name: "deployed_code",
|
|
565
|
-
size: "md",
|
|
566
|
-
class: "text-fm-color-typo-secondary"
|
|
567
|
-
})
|
|
568
|
-
]),
|
|
569
|
-
n[10] || (n[10] = t("span", { class: "text-fm-color-typo-secondary" }, " Enter a prepare quantity to preview ingredient deductions. ", -1))
|
|
570
|
-
])) : (r(), c("div", _t, [
|
|
571
|
-
(r(!0), c(q, null, U(Z.value, (T) => (r(), c("div", {
|
|
572
|
-
key: T.skuId,
|
|
573
|
-
class: "border-b border-dashed border-fm-color-line py-12"
|
|
574
|
-
}, [
|
|
575
|
-
t("div", wt, [
|
|
576
|
-
t("span", null, a(T.name), 1),
|
|
577
|
-
t("span", {
|
|
578
|
-
class: ue([
|
|
579
|
-
"ml-auto rounded-full px-8 py-4",
|
|
580
|
-
T.status === "ok" ? "bg-green-100 text-green-700" : "bg-red-100 text-red-700"
|
|
581
|
-
])
|
|
582
|
-
}, a(T.status === "ok" ? "✓ Ok" : T.status === "low" ? "Low" : "Short"), 3)
|
|
583
|
-
]),
|
|
584
|
-
t("div", Ct, [
|
|
585
|
-
t("b", {
|
|
586
|
-
class: ue(T.delta > 0 ? "text-green-600" : T.delta < 0 ? "text-red-600" : "")
|
|
587
|
-
}, a(T.delta > 0 ? "+" : "") + a(R(T.delta)) + " " + a(T.unit), 3),
|
|
588
|
-
G(" · stock " + a(R(T.current)) + " → ", 1),
|
|
589
|
-
t("b", null, a(R(T.after)), 1),
|
|
590
|
-
G(" " + a(T.unit), 1)
|
|
591
|
-
]),
|
|
592
|
-
X(T.skuId).length || le(T.skuId).length ? (r(), c("div", $t, [
|
|
593
|
-
(r(!0), c(q, null, U(X(T.skuId), (fe, ye) => (r(), c("div", {
|
|
594
|
-
key: `p${ye}`,
|
|
595
|
-
class: "text-green-600"
|
|
596
|
-
}, " +" + a(R(fe.amount)) + " " + a(T.unit) + " from " + a(fe.name), 1))), 128)),
|
|
597
|
-
(r(!0), c(q, null, U(le(T.skuId), (fe, ye) => (r(), c("div", {
|
|
598
|
-
key: `c${ye}`,
|
|
599
|
-
class: "text-red-600"
|
|
600
|
-
}, " −" + a(R(fe.amount)) + " " + a(T.unit) + " to " + a(fe.name), 1))), 128))
|
|
601
|
-
])) : P("", !0)
|
|
602
|
-
]))), 128))
|
|
603
|
-
]))
|
|
604
|
-
])
|
|
605
|
-
]);
|
|
606
|
-
};
|
|
607
|
-
}
|
|
608
|
-
}), It = { class: "flex flex-col gap-4" }, Ft = { class: "flex items-start justify-between gap-8 py-4" }, Dt = { class: "flex min-w-0 flex-1 flex-col" }, Nt = { class: "truncate" }, Tt = { class: "truncate text-fm-color-typo-secondary" }, Bt = { class: "flex w-[180px] shrink-0 flex-col items-end gap-4" }, Et = {
|
|
609
|
-
key: 0,
|
|
610
|
-
class: "text-fm-color-typo-secondary"
|
|
611
|
-
}, At = {
|
|
612
|
-
key: 0,
|
|
613
|
-
class: "border-b border-fm-color-line"
|
|
614
|
-
}, _e = /* @__PURE__ */ ce({
|
|
615
|
-
__name: "ProductionCompletionDialog",
|
|
616
|
-
props: {
|
|
617
|
-
batch: {},
|
|
618
|
-
open: { type: Boolean }
|
|
619
|
-
},
|
|
620
|
-
emits: ["submitted", "update:open"],
|
|
621
|
-
setup(Q, { emit: w }) {
|
|
622
|
-
const y = Q, u = w, g = ve(), b = F(!1), I = _({
|
|
623
|
-
get: () => y.open ?? b.value,
|
|
624
|
-
set: (v) => {
|
|
625
|
-
b.value = v, u("update:open", v);
|
|
626
|
-
}
|
|
627
|
-
});
|
|
628
|
-
function D(v) {
|
|
629
|
-
return v ? v.amount / Math.pow(10, v.precision) : 0;
|
|
630
|
-
}
|
|
631
|
-
function B(v, x) {
|
|
632
|
-
return { amount: Math.round(v * Math.pow(10, x)), precision: x };
|
|
633
|
-
}
|
|
634
|
-
function k(v) {
|
|
635
|
-
return `${parseFloat(v.toFixed(2))}`;
|
|
636
|
-
}
|
|
637
|
-
const m = _(() => {
|
|
638
|
-
const v = /* @__PURE__ */ new Map();
|
|
639
|
-
for (const x of y.batch.completions ?? [])
|
|
640
|
-
for (const $ of x.items)
|
|
641
|
-
v.set($.skuId, (v.get($.skuId) ?? 0) + D($.amount));
|
|
642
|
-
return v;
|
|
643
|
-
}), N = _(
|
|
644
|
-
() => y.batch.items.map((v) => {
|
|
645
|
-
var z;
|
|
646
|
-
const x = D(v.amount), $ = m.value.get(v.skuId) ?? 0;
|
|
647
|
-
return {
|
|
648
|
-
skuId: v.skuId,
|
|
649
|
-
name: v.sku.name,
|
|
650
|
-
code: v.sku.code,
|
|
651
|
-
unit: ((z = v.measurement) == null ? void 0 : z.abbrev) ?? v.sku.unit.abbrev,
|
|
652
|
-
requested: x,
|
|
653
|
-
produced: $,
|
|
654
|
-
remaining: Math.max(0, x - $),
|
|
655
|
-
precision: v.amount.precision
|
|
656
|
-
};
|
|
657
|
-
})
|
|
658
|
-
), f = Ie({});
|
|
659
|
-
ie(
|
|
660
|
-
I,
|
|
661
|
-
(v) => {
|
|
662
|
-
if (v) for (const x of N.value) f[x.skuId] = x.remaining;
|
|
663
|
-
},
|
|
664
|
-
{ immediate: !0 }
|
|
665
|
-
);
|
|
666
|
-
const C = _(() => N.value.some((v) => (f[v.skuId] ?? 0) > 0));
|
|
667
|
-
function O() {
|
|
668
|
-
const v = N.value.filter((x) => (f[x.skuId] ?? 0) > 0).map((x) => ({ skuId: x.skuId, amount: B(f[x.skuId], x.precision) }));
|
|
669
|
-
g.open({
|
|
670
|
-
title: "Complete production?",
|
|
671
|
-
message: "This will deduct ingredient stock for the quantities entered.",
|
|
672
|
-
primaryActions: { text: "Complete Production", close: !0 },
|
|
673
|
-
secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
|
|
674
|
-
}).onPrimary(() => {
|
|
675
|
-
I.value = !1, u("submitted", v);
|
|
676
|
-
});
|
|
677
|
-
}
|
|
678
|
-
return (v, x) => {
|
|
679
|
-
const $ = j("FmButton"), z = j("FmStepperField"), R = j("FmDialog");
|
|
680
|
-
return r(), V(R, {
|
|
681
|
-
modelValue: I.value,
|
|
682
|
-
"onUpdate:modelValue": x[0] || (x[0] = (A) => I.value = A),
|
|
683
|
-
overlay: !0,
|
|
684
|
-
"min-width": 640
|
|
685
|
-
}, {
|
|
686
|
-
"dialog-button": K(() => [
|
|
687
|
-
M($, {
|
|
688
|
-
label: "Complete Production",
|
|
689
|
-
"prepend-icon": "check"
|
|
690
|
-
})
|
|
691
|
-
]),
|
|
692
|
-
"dialog-header": K(() => x[1] || (x[1] = [
|
|
693
|
-
t("div", null, "Complete production · select items", -1)
|
|
694
|
-
])),
|
|
695
|
-
"dialog-footer": K(() => [
|
|
696
|
-
M($, {
|
|
697
|
-
class: "ml-auto",
|
|
698
|
-
label: "Confirm completion",
|
|
699
|
-
disabled: !C.value,
|
|
700
|
-
onClick: O
|
|
701
|
-
}, null, 8, ["disabled"])
|
|
702
|
-
]),
|
|
703
|
-
default: K(() => [
|
|
704
|
-
t("div", It, [
|
|
705
|
-
x[2] || (x[2] = t("div", { class: "text-fm-color-typo-secondary" }, "Quantity to produce now", -1)),
|
|
706
|
-
(r(!0), c(q, null, U(N.value, (A, J) => (r(), c(q, {
|
|
707
|
-
key: A.skuId
|
|
708
|
-
}, [
|
|
709
|
-
t("div", Ft, [
|
|
710
|
-
t("div", Dt, [
|
|
711
|
-
t("span", Nt, a(A.name), 1),
|
|
712
|
-
t("span", Tt, a(A.code), 1)
|
|
713
|
-
]),
|
|
714
|
-
t("div", Bt, [
|
|
715
|
-
M(z, {
|
|
716
|
-
modelValue: f[A.skuId],
|
|
717
|
-
"onUpdate:modelValue": (Y) => f[A.skuId] = Y,
|
|
718
|
-
label: "Quantity",
|
|
719
|
-
min: 0,
|
|
720
|
-
disabled: A.remaining <= 0,
|
|
721
|
-
"append-text": A.unit,
|
|
722
|
-
"helper-text": `Produced ${k(A.produced)} / ${k(A.requested)}`
|
|
723
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "append-text", "helper-text"]),
|
|
724
|
-
(f[A.skuId] ?? 0) <= 0 ? (r(), c("span", Et, " Skipped (zero quantity) ")) : P("", !0)
|
|
725
|
-
])
|
|
726
|
-
]),
|
|
727
|
-
J < N.value.length - 1 ? (r(), c("div", At)) : P("", !0)
|
|
728
|
-
], 64))), 128))
|
|
729
|
-
])
|
|
730
|
-
]),
|
|
731
|
-
_: 1
|
|
732
|
-
}, 8, ["modelValue"]);
|
|
733
|
-
};
|
|
734
|
-
}
|
|
735
|
-
}), Pt = { class: "flex h-full flex-col" }, Rt = { class: "px-16 pt-16" }, qt = { class: "flex flex-1 flex-col gap-16 overflow-y-auto p-16" }, Mt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Lt = { class: "flex items-center gap-8" }, Ut = { class: "mt-16 flex flex-col" }, Vt = { class: "flex flex-col gap-4 border-b border-fm-color-line pb-12" }, jt = { class: "flex flex-col gap-4 border-b border-fm-color-line py-12" }, zt = { class: "flex flex-col gap-4 border-b border-fm-color-line py-12" }, Ot = { class: "flex flex-col gap-4 pt-12" }, Gt = {
|
|
736
|
-
key: 0,
|
|
737
|
-
class: "fm-corner-radius-md bg-fm-color-neutral-gray-100 p-12"
|
|
738
|
-
}, Qt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Ht = { class: "mt-16 flex flex-col" }, Wt = { class: "flex items-start gap-8" }, Kt = { class: "flex flex-col" }, Jt = { class: "text-fm-color-typo-secondary" }, Xt = { class: "ml-auto flex flex-col items-end gap-4" }, Yt = { class: "text-fm-color-typo-secondary" }, Zt = {
|
|
739
|
-
key: 0,
|
|
740
|
-
class: "flex flex-col gap-4 fm-corner-radius-md bg-fm-color-neutral-gray-100 p-8"
|
|
741
|
-
}, eo = { class: "text-fm-color-typo-secondary" }, to = {
|
|
742
|
-
key: 1,
|
|
743
|
-
class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16"
|
|
744
|
-
}, oo = { class: "mt-16 flex flex-col gap-12" }, no = { class: "flex items-center gap-8" }, so = { class: "ml-auto text-fm-color-typo-secondary" }, ao = { class: "text-fm-color-typo-secondary" }, lo = { class: "flex flex-col gap-4" }, ro = { class: "text-fm-color-typo-secondary" }, io = {
|
|
745
|
-
key: 0,
|
|
746
|
-
class: "flex flex-col gap-4 fm-corner-radius-md bg-fm-color-neutral-gray-100 p-8"
|
|
747
|
-
}, uo = { class: "text-fm-color-typo-secondary" }, co = {
|
|
748
|
-
key: 2,
|
|
749
|
-
class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16"
|
|
750
|
-
}, mo = { class: "mt-12 flex flex-col gap-8" }, po = { class: "flex flex-wrap items-center gap-8" }, fo = { class: "whitespace-nowrap text-fm-color-typo-secondary" }, vo = {
|
|
751
|
-
key: 0,
|
|
752
|
-
class: "flex flex-col"
|
|
753
|
-
}, yo = { class: "flex flex-col" }, go = { class: "text-fm-color-typo-secondary" }, bo = { class: "text-fm-color-typo-secondary" }, xo = {
|
|
754
|
-
key: 1,
|
|
755
|
-
class: "text-fm-color-typo-secondary"
|
|
756
|
-
}, ko = { class: "border-t border-fm-color-line p-16" }, ho = {
|
|
757
|
-
key: 0,
|
|
758
|
-
class: "flex flex-col gap-8"
|
|
759
|
-
}, _o = { class: "flex justify-end gap-8" }, wo = {
|
|
760
|
-
key: 1,
|
|
761
|
-
class: "flex items-center gap-8"
|
|
762
|
-
}, Co = { class: "ml-auto flex gap-8" }, $o = /* @__PURE__ */ ce({
|
|
763
|
-
__name: "ProductionDetailSheet",
|
|
764
|
-
props: {
|
|
765
|
-
batch: {}
|
|
766
|
-
},
|
|
767
|
-
emits: ["request", "complete", "cancel", "close", "close-production", "edit"],
|
|
768
|
-
setup(Q, { emit: w }) {
|
|
769
|
-
const y = Q, u = w, g = xe(), b = Le(), I = ve(), D = F("overview"), B = [
|
|
770
|
-
{ label: "Overview", value: "overview" },
|
|
771
|
-
{ label: "Activity log", value: "activity" }
|
|
772
|
-
];
|
|
773
|
-
function k(l) {
|
|
774
|
-
return `${parseFloat(l.toFixed(2))}`;
|
|
775
|
-
}
|
|
776
|
-
function m(l) {
|
|
777
|
-
return l ? l.amount / Math.pow(10, l.precision) : 0;
|
|
778
|
-
}
|
|
779
|
-
const N = _(
|
|
780
|
-
() => ({
|
|
781
|
-
DRAFT: "Draft",
|
|
782
|
-
REQUESTING: "Requested",
|
|
783
|
-
COMPLETE: "Completed",
|
|
784
|
-
CANCEL: "Cancelled",
|
|
785
|
-
CLOSE: "Closed"
|
|
786
|
-
})[y.batch.status]
|
|
787
|
-
), f = _(
|
|
788
|
-
() => ({
|
|
789
|
-
DRAFT: "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary",
|
|
790
|
-
REQUESTING: "bg-amber-100 text-amber-700",
|
|
791
|
-
COMPLETE: "bg-green-100 text-green-700",
|
|
792
|
-
CANCEL: "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary",
|
|
793
|
-
CLOSE: "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary"
|
|
794
|
-
})[y.batch.status]
|
|
795
|
-
);
|
|
796
|
-
function C(l) {
|
|
797
|
-
return `${l}`.padStart(2, "0");
|
|
798
|
-
}
|
|
799
|
-
const O = _(() => {
|
|
800
|
-
const l = y.batch.createdAt;
|
|
801
|
-
if (!l) return "—";
|
|
802
|
-
const e = new Date(l);
|
|
803
|
-
return Number.isNaN(e.getTime()) ? "—" : e.toDateString() === (/* @__PURE__ */ new Date()).toDateString() ? `Today · ${C(e.getHours())}:${C(e.getMinutes())}` : e.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" });
|
|
804
|
-
}), v = _(() => {
|
|
805
|
-
var l;
|
|
806
|
-
return ((l = y.batch.createdBy) == null ? void 0 : l.name) || "—";
|
|
807
|
-
}), x = {
|
|
808
|
-
create: "Created",
|
|
809
|
-
update: "Edited",
|
|
810
|
-
request: "Requested",
|
|
811
|
-
complete: "Completed",
|
|
812
|
-
cancel: "Cancelled",
|
|
813
|
-
close: "Closed"
|
|
814
|
-
};
|
|
815
|
-
function $(l) {
|
|
816
|
-
if (!l) return "";
|
|
817
|
-
const e = new Date(l);
|
|
818
|
-
return Number.isNaN(e.getTime()) ? "" : e.toLocaleString();
|
|
819
|
-
}
|
|
820
|
-
const z = _(() => [...y.batch.activityLogs ?? []].reverse()), R = _(() => {
|
|
821
|
-
const l = y.batch.items.map((p) => p.sku), e = new Set(l.map((p) => p._id)), d = {
|
|
822
|
-
stocks: [
|
|
823
|
-
...l,
|
|
824
|
-
...(g.skus ?? []).filter((p) => !e.has(p._id))
|
|
825
|
-
].map((p) => ({
|
|
826
|
-
doc: p,
|
|
827
|
-
balance: { amount: 0, precision: 0 },
|
|
828
|
-
abbrev: p.unit.abbrev,
|
|
829
|
-
uom: []
|
|
830
|
-
})),
|
|
831
|
-
recipes: g.recipes ?? []
|
|
832
|
-
}, i = ke({ env: d });
|
|
833
|
-
return i.seedFromBatchItems(y.batch.items), i;
|
|
834
|
-
}), A = _(() => {
|
|
835
|
-
const l = /* @__PURE__ */ new Map();
|
|
836
|
-
for (const e of y.batch.completions ?? [])
|
|
837
|
-
for (const s of e.items)
|
|
838
|
-
l.set(s.skuId, (l.get(s.skuId) ?? 0) + m(s.amount));
|
|
839
|
-
return l;
|
|
840
|
-
}), J = _(
|
|
841
|
-
() => R.value.getItemBreakdown().map((l, e) => {
|
|
842
|
-
var d;
|
|
843
|
-
const s = ((d = y.batch.items[e]) == null ? void 0 : d.skuId) ?? "";
|
|
844
|
-
return {
|
|
845
|
-
key: l.item.key,
|
|
846
|
-
skuId: s,
|
|
847
|
-
name: l.item.inventoryStock.doc.name,
|
|
848
|
-
code: l.item.inventoryStock.doc.code,
|
|
849
|
-
unit: l.item.inventoryStock.doc.unit.abbrev,
|
|
850
|
-
qty: l.qty,
|
|
851
|
-
produced: A.value.get(s) ?? 0,
|
|
852
|
-
ingredients: l.lines.length,
|
|
853
|
-
lines: l.lines
|
|
854
|
-
};
|
|
855
|
-
})
|
|
856
|
-
), Y = _(() => R.value.getIngredientDeductions()), L = _(() => {
|
|
857
|
-
const l = /* @__PURE__ */ new Map();
|
|
858
|
-
for (const e of J.value)
|
|
859
|
-
for (const s of e.lines) {
|
|
860
|
-
const d = l.get(s.skuId) ?? [];
|
|
861
|
-
d.includes(e.name) || d.push(e.name), l.set(s.skuId, d);
|
|
862
|
-
}
|
|
863
|
-
return l;
|
|
864
|
-
});
|
|
865
|
-
function H(l) {
|
|
866
|
-
return L.value.get(l) ?? [];
|
|
867
|
-
}
|
|
868
|
-
const de = _(() => {
|
|
869
|
-
const l = /* @__PURE__ */ new Map();
|
|
870
|
-
for (const e of J.value) l.set(e.skuId, e.name);
|
|
871
|
-
return l;
|
|
872
|
-
});
|
|
873
|
-
function te(l) {
|
|
874
|
-
return de.value.get(l) ?? l;
|
|
875
|
-
}
|
|
876
|
-
const oe = F({});
|
|
877
|
-
ie(
|
|
878
|
-
() => y.batch.completions,
|
|
879
|
-
async (l) => {
|
|
880
|
-
for (const e of l ?? [])
|
|
881
|
-
e.adjustmentId && !(e.adjustmentId in oe.value) && (oe.value[e.adjustmentId] = await b.readSingleAdjustment(e.adjustmentId));
|
|
882
|
-
},
|
|
883
|
-
{ immediate: !0 }
|
|
884
|
-
);
|
|
885
|
-
const ae = _(() => [...y.batch.completions ?? []].reverse());
|
|
886
|
-
function re(l) {
|
|
887
|
-
const e = oe.value[l];
|
|
888
|
-
return e != null && e.skus ? e.skus.map((s) => {
|
|
889
|
-
const d = s.amounts.reduce((i, p) => i + m(p.amount), 0);
|
|
890
|
-
return { name: s.sku.name, amount: d, unit: s.sku.unit.abbrev };
|
|
891
|
-
}).filter((s) => s.amount < 0).map((s) => ({ ...s, amount: Math.abs(s.amount) })) : [];
|
|
892
|
-
}
|
|
893
|
-
const me = _(() => (y.batch.completions ?? []).length > 0), ne = _(() => {
|
|
894
|
-
if (!me.value)
|
|
895
|
-
return Y.value.map((e) => ({
|
|
896
|
-
skuId: e.skuId,
|
|
897
|
-
name: e.name,
|
|
898
|
-
unit: e.unit,
|
|
899
|
-
total: e.total,
|
|
900
|
-
sources: H(e.skuId)
|
|
901
|
-
}));
|
|
902
|
-
const l = /* @__PURE__ */ new Map();
|
|
903
|
-
for (const e of y.batch.completions ?? []) {
|
|
904
|
-
const s = oe.value[e.adjustmentId];
|
|
905
|
-
if (s != null && s.skus)
|
|
906
|
-
for (const d of s.skus) {
|
|
907
|
-
const i = d.amounts.reduce((n, h) => n + m(h.amount), 0);
|
|
908
|
-
if (i >= 0) continue;
|
|
909
|
-
const p = d.sku._id, o = l.get(p) ?? { skuId: p, name: d.sku.name, unit: d.sku.unit.abbrev, total: 0, sources: /* @__PURE__ */ new Set() };
|
|
910
|
-
o.total += i;
|
|
911
|
-
for (const n of d.amounts) n.ref && o.sources.add(te(n.ref));
|
|
912
|
-
l.set(p, o);
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
return [...l.values()].map((e) => ({ ...e, total: Math.abs(e.total), sources: [...e.sources] }));
|
|
916
|
-
}), Z = _(
|
|
917
|
-
() => y.batch.status === "DRAFT" || y.batch.status === "REQUESTING"
|
|
918
|
-
), ee = F(!1), X = F("");
|
|
919
|
-
function le() {
|
|
920
|
-
u("cancel", X.value.trim()), ee.value = !1, X.value = "";
|
|
921
|
-
}
|
|
922
|
-
function W() {
|
|
923
|
-
I.open({
|
|
924
|
-
title: "Close production?",
|
|
925
|
-
message: "The unproduced remainder will be abandoned and cannot be produced later. Records already completed (and their stock) are kept.",
|
|
926
|
-
primaryActions: { text: "Close Production", close: !0 },
|
|
927
|
-
secondaryActions: { text: "Back", close: !0, variant: "tertiary" }
|
|
928
|
-
}).onPrimary(() => u("close-production"));
|
|
929
|
-
}
|
|
930
|
-
return (l, e) => {
|
|
931
|
-
const s = j("FmTabs"), d = j("FmButton");
|
|
932
|
-
return r(), c("div", Pt, [
|
|
933
|
-
t("div", Rt, [
|
|
934
|
-
M(s, {
|
|
935
|
-
"model-value": D.value,
|
|
936
|
-
"onUpdate:modelValue": e[0] || (e[0] = (i) => D.value = i),
|
|
937
|
-
items: B
|
|
938
|
-
}, null, 8, ["model-value"])
|
|
939
|
-
]),
|
|
940
|
-
t("div", qt, [
|
|
941
|
-
D.value === "overview" ? (r(), c(q, { key: 0 }, [
|
|
942
|
-
t("section", Mt, [
|
|
943
|
-
t("div", Lt, [
|
|
944
|
-
e[8] || (e[8] = t("span", null, "Request summary", -1)),
|
|
945
|
-
t("span", {
|
|
946
|
-
class: ue(["ml-auto w-fit rounded-full px-12 py-4", f.value])
|
|
947
|
-
}, a(N.value), 3)
|
|
948
|
-
]),
|
|
949
|
-
t("div", Ut, [
|
|
950
|
-
t("div", Vt, [
|
|
951
|
-
e[9] || (e[9] = t("span", { class: "text-fm-color-typo-secondary" }, "Created at", -1)),
|
|
952
|
-
t("span", null, a(O.value), 1)
|
|
953
|
-
]),
|
|
954
|
-
t("div", jt, [
|
|
955
|
-
e[10] || (e[10] = t("span", { class: "text-fm-color-typo-secondary" }, "Created by", -1)),
|
|
956
|
-
t("span", null, a(v.value), 1)
|
|
957
|
-
]),
|
|
958
|
-
t("div", zt, [
|
|
959
|
-
e[11] || (e[11] = t("span", { class: "text-fm-color-typo-secondary" }, "Items requested", -1)),
|
|
960
|
-
t("span", null, a(l.batch.items.length), 1)
|
|
961
|
-
]),
|
|
962
|
-
t("div", Ot, [
|
|
963
|
-
e[12] || (e[12] = t("span", { class: "text-fm-color-typo-secondary" }, " Ingredient deductions ", -1)),
|
|
964
|
-
t("span", null, a(ne.value.length), 1)
|
|
965
|
-
])
|
|
966
|
-
])
|
|
967
|
-
]),
|
|
968
|
-
l.batch.status === "CANCEL" && l.batch.cancelReason ? (r(), c("div", Gt, [
|
|
969
|
-
e[13] || (e[13] = t("span", { class: "text-fm-color-typo-secondary" }, "Cancel reason:", -1)),
|
|
970
|
-
G(" " + a(l.batch.cancelReason), 1)
|
|
971
|
-
])) : P("", !0),
|
|
972
|
-
t("section", Qt, [
|
|
973
|
-
e[14] || (e[14] = t("div", { class: "flex items-center gap-8" }, [
|
|
974
|
-
t("span", null, "Production items")
|
|
975
|
-
], -1)),
|
|
976
|
-
t("div", Ht, [
|
|
977
|
-
(r(!0), c(q, null, U(J.value, (i, p) => (r(), c("div", {
|
|
978
|
-
key: i.key,
|
|
979
|
-
class: ue(["flex flex-col gap-8 py-12", {
|
|
980
|
-
"border-b border-fm-color-line": p < J.value.length - 1,
|
|
981
|
-
"pt-0": p === 0
|
|
982
|
-
}])
|
|
983
|
-
}, [
|
|
984
|
-
t("div", Wt, [
|
|
985
|
-
t("div", Kt, [
|
|
986
|
-
t("span", null, a(i.name), 1),
|
|
987
|
-
t("span", Jt, a(i.code) + " · " + a(i.ingredients) + " ingredient" + a(i.ingredients === 1 ? "" : "s"), 1)
|
|
988
|
-
]),
|
|
989
|
-
t("div", Xt, [
|
|
990
|
-
t("span", null, [
|
|
991
|
-
t("b", null, a(k(i.produced)), 1),
|
|
992
|
-
t("span", Yt, " / " + a(k(i.qty)) + " " + a(i.unit), 1)
|
|
993
|
-
])
|
|
994
|
-
])
|
|
995
|
-
]),
|
|
996
|
-
i.lines.length ? (r(), c("div", Zt, [
|
|
997
|
-
(r(!0), c(q, null, U(i.lines, (o) => (r(), c("div", {
|
|
998
|
-
key: o.skuId,
|
|
999
|
-
class: "flex items-center justify-between"
|
|
1000
|
-
}, [
|
|
1001
|
-
t("span", null, a(o.name), 1),
|
|
1002
|
-
t("span", eo, [
|
|
1003
|
-
G(a(k(o.perUnit)) + " × " + a(k(i.qty)) + " = ", 1),
|
|
1004
|
-
t("b", null, a(k(o.total)), 1),
|
|
1005
|
-
G(" " + a(o.unit), 1)
|
|
1006
|
-
])
|
|
1007
|
-
]))), 128))
|
|
1008
|
-
])) : P("", !0)
|
|
1009
|
-
], 2))), 128))
|
|
1010
|
-
])
|
|
1011
|
-
]),
|
|
1012
|
-
ae.value.length ? (r(), c("section", to, [
|
|
1013
|
-
e[16] || (e[16] = t("span", null, "Completions", -1)),
|
|
1014
|
-
t("div", oo, [
|
|
1015
|
-
(r(!0), c(q, null, U(ae.value, (i, p) => {
|
|
1016
|
-
var o;
|
|
1017
|
-
return r(), c("div", {
|
|
1018
|
-
key: i.adjustmentId,
|
|
1019
|
-
class: "flex flex-col gap-8 fm-corner-radius-md border border-fm-color-line p-12"
|
|
1020
|
-
}, [
|
|
1021
|
-
t("div", no, [
|
|
1022
|
-
t("span", null, "Record #" + a(ae.value.length - p), 1),
|
|
1023
|
-
t("span", so, a($(i.completedAt)), 1)
|
|
1024
|
-
]),
|
|
1025
|
-
t("span", ao, " by " + a(((o = i.completedBy) == null ? void 0 : o.name) || "Unknown"), 1),
|
|
1026
|
-
t("div", lo, [
|
|
1027
|
-
(r(!0), c(q, null, U(i.items, (n) => (r(), c("div", {
|
|
1028
|
-
key: n.skuId,
|
|
1029
|
-
class: "flex items-center justify-between"
|
|
1030
|
-
}, [
|
|
1031
|
-
t("span", null, a(te(n.skuId)), 1),
|
|
1032
|
-
t("span", ro, " +" + a(k(m(n.amount))), 1)
|
|
1033
|
-
]))), 128))
|
|
1034
|
-
]),
|
|
1035
|
-
re(i.adjustmentId).length ? (r(), c("div", io, [
|
|
1036
|
-
e[15] || (e[15] = t("span", { class: "text-fm-color-typo-secondary" }, "Deducted", -1)),
|
|
1037
|
-
(r(!0), c(q, null, U(re(i.adjustmentId), (n) => (r(), c("div", {
|
|
1038
|
-
key: n.name,
|
|
1039
|
-
class: "flex items-center justify-between"
|
|
1040
|
-
}, [
|
|
1041
|
-
t("span", null, a(n.name), 1),
|
|
1042
|
-
t("span", uo, "−" + a(k(n.amount)) + " " + a(n.unit), 1)
|
|
1043
|
-
]))), 128))
|
|
1044
|
-
])) : P("", !0)
|
|
1045
|
-
]);
|
|
1046
|
-
}), 128))
|
|
1047
|
-
])
|
|
1048
|
-
])) : P("", !0),
|
|
1049
|
-
ne.value.length ? (r(), c("section", co, [
|
|
1050
|
-
e[17] || (e[17] = t("span", null, "Total ingredient deduction", -1)),
|
|
1051
|
-
t("div", mo, [
|
|
1052
|
-
(r(!0), c(q, null, U(ne.value, (i) => (r(), c("div", {
|
|
1053
|
-
key: i.skuId,
|
|
1054
|
-
class: "flex items-center justify-between gap-8"
|
|
1055
|
-
}, [
|
|
1056
|
-
t("div", po, [
|
|
1057
|
-
t("span", null, a(i.name), 1),
|
|
1058
|
-
(r(!0), c(q, null, U(i.sources, (p) => (r(), c("span", {
|
|
1059
|
-
key: p,
|
|
1060
|
-
class: "w-fit rounded-full bg-fm-color-neutral-gray-100 px-8 py-4 text-fm-color-typo-secondary"
|
|
1061
|
-
}, a(p), 1))), 128))
|
|
1062
|
-
]),
|
|
1063
|
-
t("span", fo, " −" + a(k(i.total)) + " " + a(i.unit), 1)
|
|
1064
|
-
]))), 128))
|
|
1065
|
-
])
|
|
1066
|
-
])) : P("", !0)
|
|
1067
|
-
], 64)) : (r(), c(q, { key: 1 }, [
|
|
1068
|
-
z.value.length ? (r(), c("div", vo, [
|
|
1069
|
-
(r(!0), c(q, null, U(z.value, (i, p) => {
|
|
1070
|
-
var o;
|
|
1071
|
-
return r(), c("div", {
|
|
1072
|
-
key: p,
|
|
1073
|
-
class: "flex items-start gap-12 border-l-2 border-fm-color-line py-4 pl-12"
|
|
1074
|
-
}, [
|
|
1075
|
-
e[18] || (e[18] = t("span", { class: "mt-4 -ml-[13px] h-8 w-8 shrink-0 rounded-full bg-orange-500" }, null, -1)),
|
|
1076
|
-
t("div", yo, [
|
|
1077
|
-
t("span", null, [
|
|
1078
|
-
G(a(x[i.action]) + " ", 1),
|
|
1079
|
-
t("span", go, " by " + a(((o = i.performedBy) == null ? void 0 : o.name) || "Unknown"), 1)
|
|
1080
|
-
]),
|
|
1081
|
-
t("span", bo, [
|
|
1082
|
-
G(a($(i.performedAt)), 1),
|
|
1083
|
-
i.remark ? (r(), c(q, { key: 0 }, [
|
|
1084
|
-
G(" · " + a(i.remark), 1)
|
|
1085
|
-
], 64)) : P("", !0)
|
|
1086
|
-
])
|
|
1087
|
-
])
|
|
1088
|
-
]);
|
|
1089
|
-
}), 128))
|
|
1090
|
-
])) : (r(), c("div", xo, "No activity yet."))
|
|
1091
|
-
], 64))
|
|
1092
|
-
]),
|
|
1093
|
-
t("div", ko, [
|
|
1094
|
-
ee.value ? (r(), c("div", ho, [
|
|
1095
|
-
Fe(t("textarea", {
|
|
1096
|
-
"onUpdate:modelValue": e[1] || (e[1] = (i) => X.value = i),
|
|
1097
|
-
class: "w-full fm-corner-radius-md border border-fm-color-line p-8",
|
|
1098
|
-
rows: "2",
|
|
1099
|
-
placeholder: "Reason for cancelling (optional)"
|
|
1100
|
-
}, null, 512), [
|
|
1101
|
-
[De, X.value]
|
|
1102
|
-
]),
|
|
1103
|
-
t("div", _o, [
|
|
1104
|
-
M(d, {
|
|
1105
|
-
label: "Back",
|
|
1106
|
-
variant: "secondary",
|
|
1107
|
-
onClick: e[2] || (e[2] = (i) => ee.value = !1)
|
|
1108
|
-
}),
|
|
1109
|
-
M(d, {
|
|
1110
|
-
label: "Confirm cancel",
|
|
1111
|
-
variant: "primary",
|
|
1112
|
-
onClick: le
|
|
1113
|
-
})
|
|
1114
|
-
])
|
|
1115
|
-
])) : (r(), c("div", wo, [
|
|
1116
|
-
Z.value ? (r(), V(d, {
|
|
1117
|
-
key: 0,
|
|
1118
|
-
label: "Cancel",
|
|
1119
|
-
variant: "tertiary",
|
|
1120
|
-
onClick: e[3] || (e[3] = (i) => ee.value = !0)
|
|
1121
|
-
})) : P("", !0),
|
|
1122
|
-
t("div", Co, [
|
|
1123
|
-
M(d, {
|
|
1124
|
-
label: "Close",
|
|
1125
|
-
variant: "secondary",
|
|
1126
|
-
onClick: e[4] || (e[4] = (i) => u("close"))
|
|
1127
|
-
}),
|
|
1128
|
-
l.batch.status === "DRAFT" ? (r(), V(d, {
|
|
1129
|
-
key: 0,
|
|
1130
|
-
label: "Edit",
|
|
1131
|
-
variant: "secondary",
|
|
1132
|
-
onClick: e[5] || (e[5] = (i) => u("edit"))
|
|
1133
|
-
})) : P("", !0),
|
|
1134
|
-
l.batch.status === "DRAFT" ? (r(), V(d, {
|
|
1135
|
-
key: 1,
|
|
1136
|
-
label: "Submit request",
|
|
1137
|
-
onClick: e[6] || (e[6] = (i) => u("request"))
|
|
1138
|
-
})) : P("", !0),
|
|
1139
|
-
l.batch.status === "REQUESTING" ? (r(), V(d, {
|
|
1140
|
-
key: 2,
|
|
1141
|
-
label: "Close Production",
|
|
1142
|
-
variant: "secondary",
|
|
1143
|
-
onClick: W
|
|
1144
|
-
})) : P("", !0),
|
|
1145
|
-
l.batch.status === "REQUESTING" ? (r(), V(_e, {
|
|
1146
|
-
key: 3,
|
|
1147
|
-
batch: l.batch,
|
|
1148
|
-
onSubmitted: e[7] || (e[7] = (i) => u("complete", i))
|
|
1149
|
-
}, null, 8, ["batch"])) : P("", !0)
|
|
1150
|
-
])
|
|
1151
|
-
]))
|
|
1152
|
-
])
|
|
1153
|
-
]);
|
|
1154
|
-
};
|
|
1155
|
-
}
|
|
1156
|
-
}), So = { class: "flex flex-col gap-16 p-16" }, Io = { class: "flex items-center gap-8" }, Fo = { class: "p-16" }, Uo = /* @__PURE__ */ ce({
|
|
1157
|
-
__name: "ProductionView",
|
|
1158
|
-
setup(Q) {
|
|
1159
|
-
const w = he(), y = be(), u = ge(), g = ve(), b = F([]), I = F(!1), D = F(null), B = F(!1), k = F(null), m = F(null), N = F(!1), f = F(null), C = F(!1);
|
|
1160
|
-
function O(e) {
|
|
1161
|
-
m.value = e, N.value = !0;
|
|
1162
|
-
}
|
|
1163
|
-
function v() {
|
|
1164
|
-
k.value = null, B.value = !0;
|
|
1165
|
-
}
|
|
1166
|
-
function x(e) {
|
|
1167
|
-
k.value = e, N.value = !1, B.value = !0;
|
|
1168
|
-
}
|
|
1169
|
-
function $(e) {
|
|
1170
|
-
f.value = e, C.value = !0;
|
|
1171
|
-
}
|
|
1172
|
-
const z = [
|
|
1173
|
-
{ label: "Refresh", value: "refresh", prependIcon: "refresh" },
|
|
1174
|
-
{ label: "New production prepare", value: "new", prependIcon: "add" }
|
|
1175
|
-
];
|
|
1176
|
-
async function R() {
|
|
1177
|
-
I.value = !0;
|
|
1178
|
-
try {
|
|
1179
|
-
b.value = await w.list();
|
|
1180
|
-
} finally {
|
|
1181
|
-
I.value = !1;
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1184
|
-
y.watchLocation(R);
|
|
1185
|
-
function A(e) {
|
|
1186
|
-
e === "new" ? v() : e === "refresh" && R();
|
|
1187
|
-
}
|
|
1188
|
-
function J() {
|
|
1189
|
-
B.value = !1, k.value = null, R();
|
|
1190
|
-
}
|
|
1191
|
-
function Y(e) {
|
|
1192
|
-
return {
|
|
1193
|
-
DRAFT: "Draft",
|
|
1194
|
-
REQUESTING: "Requested",
|
|
1195
|
-
COMPLETE: "Completed",
|
|
1196
|
-
CANCEL: "Cancelled",
|
|
1197
|
-
CLOSE: "Closed"
|
|
1198
|
-
}[e];
|
|
1199
|
-
}
|
|
1200
|
-
async function L(e) {
|
|
1201
|
-
D.value = e._id;
|
|
1202
|
-
try {
|
|
1203
|
-
await w.request(e._id), await R();
|
|
1204
|
-
} catch (s) {
|
|
1205
|
-
u == null || u.open({ title: "Failed to request", message: `${(s == null ? void 0 : s.message) ?? s}`, type: "error" });
|
|
1206
|
-
} finally {
|
|
1207
|
-
D.value = null;
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
async function H(e, s) {
|
|
1211
|
-
D.value = e._id;
|
|
1212
|
-
try {
|
|
1213
|
-
const d = await w.complete(e._id, s);
|
|
1214
|
-
d.warnings.length > 0 ? u == null || u.open({
|
|
1215
|
-
title: "Completed with warnings",
|
|
1216
|
-
message: `${d.warnings.length} item(s) had no ingredient deduction.`,
|
|
1217
|
-
type: "warning"
|
|
1218
|
-
}) : u == null || u.open({ title: "Production completed", type: "success" }), await R();
|
|
1219
|
-
} catch (d) {
|
|
1220
|
-
u == null || u.open({ title: "Failed to complete", message: `${(d == null ? void 0 : d.message) ?? d}`, type: "error" });
|
|
1221
|
-
} finally {
|
|
1222
|
-
D.value = null;
|
|
1223
|
-
}
|
|
1224
|
-
}
|
|
1225
|
-
async function de(e, s) {
|
|
1226
|
-
D.value = e._id;
|
|
1227
|
-
try {
|
|
1228
|
-
await w.cancel(e._id, s), u == null || u.open({ title: "Production cancelled", type: "success" }), N.value = !1, await R();
|
|
1229
|
-
} catch (d) {
|
|
1230
|
-
u == null || u.open({ title: "Failed to cancel", message: `${(d == null ? void 0 : d.message) ?? d}`, type: "error" });
|
|
1231
|
-
} finally {
|
|
1232
|
-
D.value = null;
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
async function te(e) {
|
|
1236
|
-
D.value = e._id;
|
|
1237
|
-
try {
|
|
1238
|
-
await w.close(e._id), u == null || u.open({ title: "Production closed", type: "success" }), N.value = !1, await R();
|
|
1239
|
-
} catch (s) {
|
|
1240
|
-
u == null || u.open({ title: "Failed to close", message: `${(s == null ? void 0 : s.message) ?? s}`, type: "error" });
|
|
1241
|
-
} finally {
|
|
1242
|
-
D.value = null;
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
function oe(e) {
|
|
1246
|
-
g.open({
|
|
1247
|
-
title: "Close production?",
|
|
1248
|
-
message: "The unproduced remainder will be abandoned and cannot be produced later. Records already completed (and their stock) are kept.",
|
|
1249
|
-
primaryActions: { text: "Close Production", close: !0 },
|
|
1250
|
-
secondaryActions: { text: "Back", close: !0, variant: "tertiary" }
|
|
1251
|
-
}).onPrimary(() => te(e));
|
|
1252
|
-
}
|
|
1253
|
-
async function ae() {
|
|
1254
|
-
m.value && await L(m.value), N.value = !1;
|
|
1255
|
-
}
|
|
1256
|
-
async function re(e) {
|
|
1257
|
-
m.value && await H(m.value, e), N.value = !1;
|
|
1258
|
-
}
|
|
1259
|
-
async function me(e) {
|
|
1260
|
-
m.value && await de(m.value, e);
|
|
1261
|
-
}
|
|
1262
|
-
function ne() {
|
|
1263
|
-
m.value && x(m.value);
|
|
1264
|
-
}
|
|
1265
|
-
async function Z() {
|
|
1266
|
-
m.value && await te(m.value);
|
|
1267
|
-
}
|
|
1268
|
-
async function ee(e) {
|
|
1269
|
-
f.value && await H(f.value, e), f.value = null;
|
|
1270
|
-
}
|
|
1271
|
-
function X(e) {
|
|
1272
|
-
if (!e) return "—";
|
|
1273
|
-
const s = new Date(e);
|
|
1274
|
-
return Number.isNaN(s.getTime()) ? "—" : s.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" });
|
|
1275
|
-
}
|
|
1276
|
-
function le(e) {
|
|
1277
|
-
var s;
|
|
1278
|
-
return (s = e.name) != null && s.trim() ? e.name.trim() : e.batchNo ? `Production #${e.batchNo}` : `Production · ${X(e.createdAt)}`;
|
|
1279
|
-
}
|
|
1280
|
-
const W = {
|
|
1281
|
-
DRAFT: "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary",
|
|
1282
|
-
REQUESTING: "bg-amber-100 text-amber-700",
|
|
1283
|
-
COMPLETE: "bg-green-100 text-green-700",
|
|
1284
|
-
CANCEL: "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary",
|
|
1285
|
-
CLOSE: "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary"
|
|
1286
|
-
}, l = [
|
|
1287
|
-
{
|
|
1288
|
-
id: "createdAt",
|
|
1289
|
-
header: () => "Created",
|
|
1290
|
-
minSize: 170,
|
|
1291
|
-
enableSorting: !1,
|
|
1292
|
-
cell: (e) => X(e.row.original.createdAt)
|
|
1293
|
-
},
|
|
1294
|
-
{
|
|
1295
|
-
id: "name",
|
|
1296
|
-
header: () => "Name",
|
|
1297
|
-
minSize: 240,
|
|
1298
|
-
enableSorting: !1,
|
|
1299
|
-
cell: (e) => le(e.row.original)
|
|
1300
|
-
},
|
|
1301
|
-
{
|
|
1302
|
-
id: "items",
|
|
1303
|
-
header: () => "Total items",
|
|
1304
|
-
size: 110,
|
|
1305
|
-
enableSorting: !1,
|
|
1306
|
-
cell: (e) => `${e.row.original.items.length}`
|
|
1307
|
-
},
|
|
1308
|
-
{
|
|
1309
|
-
id: "status",
|
|
1310
|
-
header: () => "Status",
|
|
1311
|
-
size: 130,
|
|
1312
|
-
enableSorting: !1,
|
|
1313
|
-
cell: (e) => E(
|
|
1314
|
-
"span",
|
|
1315
|
-
{ class: `w-fit rounded-full px-12 py-4 ${W[e.row.original.status]}` },
|
|
1316
|
-
Y(e.row.original.status)
|
|
1317
|
-
)
|
|
1318
|
-
},
|
|
1319
|
-
{
|
|
1320
|
-
id: "actions",
|
|
1321
|
-
header: () => "",
|
|
1322
|
-
size: 64,
|
|
1323
|
-
enableSorting: !1,
|
|
1324
|
-
cell: (e) => {
|
|
1325
|
-
const s = e.row.original, d = (p) => (o) => {
|
|
1326
|
-
o.stopPropagation(), p();
|
|
1327
|
-
}, i = [];
|
|
1328
|
-
return s.status === "DRAFT" && i.push(
|
|
1329
|
-
E(se.FmMenuItem, {
|
|
1330
|
-
label: "Edit",
|
|
1331
|
-
onClick: d(() => x(s))
|
|
1332
|
-
}),
|
|
1333
|
-
E(se.FmMenuItem, {
|
|
1334
|
-
label: "Submit request",
|
|
1335
|
-
onClick: d(() => L(s))
|
|
1336
|
-
})
|
|
1337
|
-
), s.status === "REQUESTING" && i.push(
|
|
1338
|
-
E(se.FmMenuItem, {
|
|
1339
|
-
label: "Mark complete",
|
|
1340
|
-
onClick: d(() => $(s))
|
|
1341
|
-
}),
|
|
1342
|
-
E(se.FmMenuItem, {
|
|
1343
|
-
label: "Close production",
|
|
1344
|
-
onClick: d(() => oe(s))
|
|
1345
|
-
})
|
|
1346
|
-
), i.push(
|
|
1347
|
-
E(se.FmMenuItem, { label: "View details", onClick: d(() => O(s)) })
|
|
1348
|
-
), E(
|
|
1349
|
-
"div",
|
|
1350
|
-
{ class: "flex justify-end", onClick: (p) => p.stopPropagation() },
|
|
1351
|
-
[
|
|
1352
|
-
E(
|
|
1353
|
-
se.FmMenu,
|
|
1354
|
-
{ closeOnClick: !0 },
|
|
1355
|
-
{
|
|
1356
|
-
"menu-button": () => E(se.FmButton, { icon: "more_vert", variant: "tertiary" }),
|
|
1357
|
-
default: () => i
|
|
1358
|
-
}
|
|
1359
|
-
)
|
|
1360
|
-
]
|
|
1361
|
-
);
|
|
1362
|
-
}
|
|
1363
|
-
}
|
|
1364
|
-
];
|
|
1365
|
-
return (e, s) => {
|
|
1366
|
-
const d = j("FmTable"), i = j("FmSideSheet");
|
|
1367
|
-
return r(), V(Te, {
|
|
1368
|
-
title: "Production Item",
|
|
1369
|
-
actions: z,
|
|
1370
|
-
"onClick:action": A
|
|
1371
|
-
}, {
|
|
1372
|
-
default: K(() => [
|
|
1373
|
-
t("div", So, [
|
|
1374
|
-
t("div", Io, [
|
|
1375
|
-
Ne(y)._currentLocation ? (r(), V(Ee, { key: 0 })) : P("", !0)
|
|
1376
|
-
]),
|
|
1377
|
-
M(d, {
|
|
1378
|
-
"column-defs": l,
|
|
1379
|
-
"row-data": b.value,
|
|
1380
|
-
"row-key": (p) => p._id,
|
|
1381
|
-
loading: I.value,
|
|
1382
|
-
"hide-footer": !0,
|
|
1383
|
-
"empty-text": "No production batches yet. Start a new production prepare to add stock.",
|
|
1384
|
-
onRowClick: s[0] || (s[0] = (p) => O(p.original))
|
|
1385
|
-
}, null, 8, ["row-data", "row-key", "loading"])
|
|
1386
|
-
]),
|
|
1387
|
-
M(i, {
|
|
1388
|
-
"dismiss-away": "",
|
|
1389
|
-
"max-width": 9999,
|
|
1390
|
-
"model-value": B.value,
|
|
1391
|
-
"onUpdate:modelValue": s[1] || (s[1] = (p) => B.value = p),
|
|
1392
|
-
header: k.value ? "Edit production prepare" : "New production prepare"
|
|
1393
|
-
}, {
|
|
1394
|
-
default: K(() => [
|
|
1395
|
-
t("div", Fo, [
|
|
1396
|
-
B.value ? (r(), V(St, {
|
|
1397
|
-
key: 0,
|
|
1398
|
-
batch: k.value ?? void 0,
|
|
1399
|
-
onCreated: J
|
|
1400
|
-
}, null, 8, ["batch"])) : P("", !0)
|
|
1401
|
-
])
|
|
1402
|
-
]),
|
|
1403
|
-
_: 1
|
|
1404
|
-
}, 8, ["model-value", "header"]),
|
|
1405
|
-
f.value ? (r(), V(_e, {
|
|
1406
|
-
key: 0,
|
|
1407
|
-
batch: f.value,
|
|
1408
|
-
open: C.value,
|
|
1409
|
-
"onUpdate:open": s[2] || (s[2] = (p) => C.value = p),
|
|
1410
|
-
onSubmitted: ee
|
|
1411
|
-
}, null, 8, ["batch", "open"])) : P("", !0),
|
|
1412
|
-
M(i, {
|
|
1413
|
-
"dismiss-away": "",
|
|
1414
|
-
"max-width": 9999,
|
|
1415
|
-
"model-value": N.value,
|
|
1416
|
-
"onUpdate:modelValue": s[4] || (s[4] = (p) => N.value = p),
|
|
1417
|
-
header: m.value ? le(m.value) : "Production batch"
|
|
1418
|
-
}, {
|
|
1419
|
-
default: K(() => [
|
|
1420
|
-
N.value && m.value ? (r(), V($o, {
|
|
1421
|
-
key: 0,
|
|
1422
|
-
batch: m.value,
|
|
1423
|
-
onRequest: ae,
|
|
1424
|
-
onComplete: re,
|
|
1425
|
-
onCancel: me,
|
|
1426
|
-
onClose: s[3] || (s[3] = (p) => N.value = !1),
|
|
1427
|
-
onEdit: ne,
|
|
1428
|
-
onCloseProduction: Z
|
|
1429
|
-
}, null, 8, ["batch"])) : P("", !0)
|
|
1430
|
-
]),
|
|
1431
|
-
_: 1
|
|
1432
|
-
}, 8, ["model-value", "header"])
|
|
1433
|
-
]),
|
|
1434
|
-
_: 1
|
|
1435
|
-
});
|
|
1436
|
-
};
|
|
1437
|
-
}
|
|
1438
|
-
});
|
|
1439
|
-
export {
|
|
1440
|
-
Uo as default
|
|
1441
|
-
};
|