@feedmepos/mf-inventory-portal 1.8.0-dev.1 → 1.8.0-dev.11
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-BTUjyQbn.js +1466 -0
- package/dist/{ApprovalView-C8_ax05b.js → ApprovalView-CTOTedxc.js} +26 -25
- package/dist/{BindingsDialog-t0ZY9eh5.js → BindingsDialog-C9v4TTzJ.js} +2 -2
- package/dist/{BindingsPicker-C0Qblmml.js → BindingsPicker-B5b0lavg.js} +8 -8
- package/dist/{BindingsTable-CsqUBbRA.js → BindingsTable-CQPan4pU.js} +4 -4
- package/dist/{BulkReceiveRequestView-DAG-TMox.js → BulkReceiveRequestView-BVrrjoYW.js} +21 -21
- package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-D4Z56y7h.js +151 -0
- package/dist/{ClosingDraftView-CdKp4Ny6.js → ClosingDraftView-5ETKikfT.js} +748 -746
- package/dist/ClosingHistoryView-GM0DRWhq.js +769 -0
- package/dist/{ClosingTemplateView-C326DL4q.js → ClosingTemplateView-Czz--dWq.js} +303 -291
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CXjubRbj.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-Bjs8hW_q.js} +1 -1
- package/dist/{DefaultView-CsIMmQAY.js → DefaultView-Baksd_Lk.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-eTrMvJzA.js → DeliveryOrderPrintPreview-CUdMQmLf.js} +9 -9
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-B7nBbxMo.js → EmailDialog.vue_vue_type_script_setup_true_lang-CDta65pB.js} +6228 -6216
- package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-CrCdJfOf.js +47 -0
- package/dist/FeatureCapabilityGate-C34Z4k5D.js +74 -0
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CI2KTzDs.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-C43lHbmc.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Db_FiSRe.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CIMCZnY9.js} +2 -2
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-UbMV3dKh.js +120 -0
- package/dist/{FmMultiselectDialog-CYUxtxnS.js → FmMultiselectDialog-DYM4qyMH.js} +2 -2
- package/dist/FmMultiselectDialog-tbS01AI7.js +123 -0
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DOkV11NN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DaOKC6RQ.js} +72 -73
- package/dist/ImportView-CPf8zj0t.js +1290 -0
- package/dist/{IngredientsView-CZ6E7cXf.js → IngredientsView-N4CH6zdo.js} +656 -649
- package/dist/{IntegrationExplorerView-B15ND4Fg.js → IntegrationExplorerView-Ds5fTNi3.js} +602 -614
- package/dist/IntegrationPlatformView-wuOLFIQR.js +13073 -0
- package/dist/{IntegrationView-hkNhsqx2.js → IntegrationView-Bhxwz6Ha.js} +2956 -2922
- package/dist/{InventoryBindingForm-SfuUF0_O.js → InventoryBindingForm-DWm9pOH_.js} +1 -1
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-TvwD5HcR.js +472 -0
- package/dist/{InventoryBindingSummary-DUcukkyJ.js → InventoryBindingSummary-DI6H0ehi.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-ngeYJhtg.js +79 -0
- package/dist/PlanTierBadge.vue_vue_type_script_setup_true_lang-Cr1LFRUd.js +274 -0
- package/dist/PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-CtoPkGo2.js +79 -0
- package/dist/{ProductionRunDetailView-BwgRX-14.js → ProductionRunDetailView-rGGuDANE.js} +4 -4
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BbNXNhpr.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-CTseB9Sn.js} +9 -9
- package/dist/{ProductionRunView-CZU7LY9-.js → ProductionRunView-BLBIYhKd.js} +16 -15
- package/dist/{PublishView-DS2FZ66p.js → PublishView-D_H_LAq2.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-CZa0MVAs.js → PurchaseOrderPrintPreview-DZy57dQ6.js} +7 -7
- package/dist/{ReceiveRequestView-Bk5b3nVB.js → ReceiveRequestView-qFQPah64.js} +15 -15
- package/dist/RecipeView-BPQ_MlxJ.js +3440 -0
- package/dist/SettingsView-DF_HGtkr.js +1032 -0
- package/dist/StockView-De_R8pxv.js +2651 -0
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DdZg9T4n.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B3tBgcH7.js} +1 -1
- package/dist/{SupplierView-D8q6siZW.js → SupplierView-DvvB_Nn0.js} +577 -571
- package/dist/{SurchargeView-Db_5YFoR.js → SurchargeView-6gQPyGqi.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-WOVs4Fr1.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-D6gnQpe-.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-BtoP4XgE.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CiuRBHBL.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Bljc4Vuy.js → TransferDetails.vue_vue_type_script_setup_true_lang-B-1-jtmF.js} +1707 -1657
- package/dist/TransferTemplateView-Dcc9K-AJ.js +2343 -0
- package/dist/{UnitCostHistoryView-BqDiQ4IE.js → UnitCostHistoryView-e1MYu0_N.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BjSmg5LX.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DQWOi2ol.js} +4 -4
- package/dist/{UnitView-CM695-VI.js → UnitView-BaLqtGk3.js} +84 -84
- package/dist/{WarehouseView-BdidU4p6.js → WarehouseView-CKYdpZoP.js} +194 -189
- package/dist/{WastageTemplateView-DdhwdXT6.js → WastageTemplateView-DazO6lu1.js} +19 -18
- package/dist/api/feature-flags.d.ts +12 -0
- 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-Cb5s4jMu.js → app-ZyQBMnlh.js} +6102 -6066
- package/dist/app.d.ts +36 -150
- package/dist/app.js +1 -1
- package/dist/{closing-template-DnqnpXxn.js → closing-template-BZfYcHAK.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.spec.d.ts +1 -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/NumberPrecisionInput.spec.d.ts +1 -0
- package/dist/components/{PremiumBadge.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-BPhD_1Of.js → date2-CtVXF-Pl.js} +1 -1
- package/dist/{dayjs.min-Zbd6-uVD.js → dayjs.min-BG2xA9Zk.js} +1 -1
- package/dist/{decimal-Df6a50Ld.js → decimal-C0ERI9wc.js} +2 -2
- package/dist/{defineDeepModel-Brbsikbi.js → defineDeepModel-CAK0Fghp.js} +6 -6
- package/dist/{duplicate-template-B9kuShaF.js → duplicate-template-DwAQVTH7.js} +1 -1
- package/dist/{inventory-core-dart.default-DDRxXXnt.js → feature-1IL43YWw.js} +766 -398
- package/dist/feature-flags/core.d.ts +28 -0
- package/dist/feature-flags/core.spec.d.ts +1 -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-DmUjUcVj.js → format-time-from-id-QIs7t8ML.js} +1 -1
- package/dist/{format-unit-display-CsQA0SQd.js → format-unit-display-DiTPPgut.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-DcuC_yKQ.js +67 -0
- package/dist/{import-export.helper-DCQ6oX9s.js → import-export.helper-grsZqa63.js} +16 -17
- package/dist/{JsonViewer.vue_vue_type_script_setup_true_lang-ig2zSXAB.js → index-C25C1Dg7.js} +1074 -1066
- package/dist/{index-UmM6gHJ1.js → index-DN5mjbXr.js} +1 -1
- package/dist/{index-C-mazZwS.js → index-DdSQrnuw.js} +3 -3
- package/dist/index-eGvSlWMU.js +1892 -0
- package/dist/{index-BXaIMGnI.js → index-twVxfWIB.js} +190 -190
- package/dist/{lz-string-Bibw5D_6.js → lz-string-DrKhkO_Q.js} +1 -1
- package/dist/{netsuite-Bev0OtQT.js → netsuite-C_EH9MVy.js} +9 -3
- package/dist/{predefined-templates-BHvUnTk_.js → predefined-templates-mWX1M2Dn.js} +1 -1
- package/dist/{purchase-order-template-DgOKEzhS.js → purchase-order-template-DZ3DsIUr.js} +1 -1
- package/dist/{recalculationUtils-Dv__DzZh.js → recalculationUtils-BZ5ccSeX.js} +1 -1
- package/dist/router/name.d.ts +2 -2
- package/dist/{row-action.enum-ncgDYAjP.js → row-action.enum-B2z1DXD9.js} +2 -2
- package/dist/rules-BpTWt_Y_.js +238 -0
- package/dist/stock-BO2mbTLO.js +74 -0
- package/dist/{stock-CxCRZo_D.js → stock-D9dhzEKk.js} +1 -1
- package/dist/stores/feature.d.ts +20 -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 +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-CkZdeMcl.js → supplier-C-Ra1omj.js} +2 -2
- package/dist/{surcharge-FRSFqjGl.js → surcharge-BFDrFP1T.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-Cm1styDr.js → uom-rules-B8pou4DQ.js} +1 -1
- package/dist/{use-ingredient-select-dialog-ntAqHX04.js → use-ingredient-select-dialog-DJvcL3EP.js} +2 -2
- package/dist/use-inventory-binding-dialog-DQBcnw0G.js +113 -0
- package/dist/{use-template-enabled-locations-CIZqw-Z8.js → use-template-enabled-locations-CSgJma2Z.js} +2 -2
- package/dist/{use-transfer-locations-CM5vNttA.js → use-transfer-locations-CkeJ5Nng.js} +14 -14
- package/dist/{useHrmPermission-CslLuBoP.js → useHrmPermission-BDc1xULx.js} +1 -1
- package/dist/useNavigationMenu-B7jkRkTi.js +346 -0
- package/dist/{useSseClient-CCV4mPzD.js → useSseClient-Bxl6D4Xs.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/PreviewBadge.vue.d.ts → views/integration/IntegrationPlatformView.vue.d.ts} +11 -13
- 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/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 +5 -5
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +39 -39
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +35 -35
- 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 +34 -34
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +6 -6
- 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/{ingredient-group/IngredientGroupView.vue.d.ts → settings/FeatureFlagView.vue.d.ts} +0 -1
- 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/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 +2 -2
- package/dist/{vue-i18n-C5j4EQhi.js → vue-i18n-gaCwgS41.js} +355 -355
- package/dist/{xlsx.util-B50OvX4z.js → xlsx.util-lW-27xp-.js} +2 -2
- package/package.json +71 -66
- package/dist/App-BXgpGzGR.js +0 -1476
- package/dist/ClosingHistoryView-Blyq9-BS.js +0 -761
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-zcEv1Swg.js +0 -243
- package/dist/FmMultiselectDialog-BAw-gp5K.js +0 -77
- package/dist/ImportView-BmotFC-3.js +0 -1302
- package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVCCpvS4.js +0 -51
- package/dist/IngredientGroupView-qrR9ksEn.js +0 -985
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-Zq81p_MF.js +0 -563
- package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BmfROiLM.js +0 -72
- package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-3e3kDsbN.js +0 -93
- package/dist/PreviewBadge.vue_vue_type_script_setup_true_lang-DX2MJqL4.js +0 -29
- package/dist/RecipeView-DvI6X-uN.js +0 -3625
- package/dist/SettingsView-sThYErMz.js +0 -698
- package/dist/StockView-Z9wGihT7.js +0 -2612
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js +0 -84
- package/dist/TransferTemplateView-DtsJzmUr.js +0 -2327
- package/dist/feature-Ckn5ra3z.js +0 -1136
- package/dist/number-y_W4pn_d.js +0 -138
- package/dist/random-CSbEbElR.js +0 -10
- package/dist/rules-CZTBvenw.js +0 -98
- package/dist/stock-XINW8JOM.js +0 -75
- package/dist/use-inventory-binding-dialog-DVIJO8Cl.js +0 -152
- package/dist/useNavigationMenu-CSinmNCY.js +0 -172
- package/dist/usePromise-CbVUCxhj.js +0 -29
- 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
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { defineComponent as De, ref as q, computed as C, onMounted as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { useSnackbar as
|
|
5
|
-
import { d as
|
|
6
|
-
import { defineStore as
|
|
7
|
-
import { c as Ke, e as
|
|
8
|
-
import { R as bo } from "./rules-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { u as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { _ as Dn } from "./
|
|
20
|
-
import { _ as
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { _ as Bn } from "./
|
|
29
|
-
import {
|
|
30
|
-
const Oe =
|
|
1
|
+
import { defineComponent as De, ref as q, computed as C, onMounted as uo, resolveComponent as te, createElementBlock as A, createBlock as ae, openBlock as p, Fragment as le, createTextVNode as ge, withCtx as ee, createElementVNode as a, createCommentVNode as H, toDisplayString as R, unref as d, createVNode as h, h as D, watch as je, renderList as he, onUnmounted as Jo, withModifiers as Zo, normalizeStyle as gt, normalizeClass as we, isRef as bt, reactive as lo, createSlots as Xo, Teleport as en, mergeProps as tn } from "vue";
|
|
2
|
+
import { u as on, _ as nn } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
|
|
3
|
+
import { useCoreStore as mo, useI18n as et } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as Ue, useDialog as po, components as be, useProxiedModel as Rt, useBreakpoints as an } from "@feedmepos/ui-library";
|
|
5
|
+
import { d as sn, u as qe, W as fe, s as ne, q as fo, t as Ie, X as xe, B as Le, c as rn, a as Nt, Y as ln, k as cn } from "./app-ZyQBMnlh.js";
|
|
6
|
+
import { defineStore as vo, storeToRefs as un } from "pinia";
|
|
7
|
+
import { c as Ke, e as go, f as dn, b as Fe } from "./date2-CtVXF-Pl.js";
|
|
8
|
+
import { R as yo, h as ht, l as Xe, p as bo, q as ho, a as mn, m as _o, o as me, t as pn } from "./rules-BpTWt_Y_.js";
|
|
9
|
+
import { b as fn, d as vn, u as vt, w as gn, c as yn } from "./xlsx.util-lW-27xp-.js";
|
|
10
|
+
import { i as Mt, u as Ut } from "./uom-rules-B8pou4DQ.js";
|
|
11
|
+
import { u as bn } from "./stock-BO2mbTLO.js";
|
|
12
|
+
import { u as _t } from "./stock-D9dhzEKk.js";
|
|
13
|
+
import { D as io, R as He } from "./row-action.enum-B2z1DXD9.js";
|
|
14
|
+
import { c as hn } from "./component-BmLAdDiY.js";
|
|
15
|
+
import { f as _n } from "./format-time-from-id-QIs7t8ML.js";
|
|
16
|
+
import { i as kn } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-C43lHbmc.js";
|
|
17
|
+
import { f as wn } from "./recalculationUtils-BZ5ccSeX.js";
|
|
18
|
+
import { _ as xn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-UbMV3dKh.js";
|
|
19
|
+
import { _ as Dn } from "./CursorPaginatedTable.vue_vue_type_script_setup_true_lang-BCUhtL_B.js";
|
|
20
|
+
import { _ as ko } from "./empty-placeholder-B0QU467o.js";
|
|
21
|
+
import { F as Bt } from "./FmAdminBadge-DlplQOHb.js";
|
|
22
|
+
import { u as An } from "./vue-i18n-gaCwgS41.js";
|
|
23
|
+
import { F as $n } from "./decimal-C0ERI9wc.js";
|
|
24
|
+
import { u as Cn } from "./useSseClient-Bxl6D4Xs.js";
|
|
25
|
+
import { d as Sn } from "./dayjs.min-BG2xA9Zk.js";
|
|
26
|
+
import { F as Fn } from "./FmDroppableField-J0tG_U3w.js";
|
|
27
|
+
import { _ as In } from "./FmConfirmationButton.vue_vue_type_script_setup_true_lang-Vg8U7WMZ.js";
|
|
28
|
+
import { _ as Bn } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
|
|
29
|
+
import { F as Je } from "./index-eGvSlWMU.js";
|
|
30
|
+
const Oe = sn((t, o) => {
|
|
31
31
|
function e() {
|
|
32
32
|
return qe().currentLocation.dbName;
|
|
33
33
|
}
|
|
@@ -107,13 +107,13 @@ const Oe = rn((t, o) => {
|
|
|
107
107
|
return o.get(s);
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
-
}),
|
|
110
|
+
}), Tn = { class: "fm-typo-en-body-lg-400" }, jn = { class: "fm-typo-en-body-lg-600" }, Rn = {
|
|
111
111
|
key: 0,
|
|
112
112
|
class: "flex flex-col"
|
|
113
|
-
},
|
|
113
|
+
}, Nn = {
|
|
114
114
|
key: 0,
|
|
115
115
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-error mt-4"
|
|
116
|
-
},
|
|
116
|
+
}, Mn = { "data-testid": "closing-draft-action-remark" }, Un = { class: "flex gap-12 py-8 justify-end w-full" }, Tt = /* @__PURE__ */ De({
|
|
117
117
|
__name: "ClosingDraftAction",
|
|
118
118
|
props: {
|
|
119
119
|
draft: {},
|
|
@@ -122,7 +122,7 @@ const Oe = rn((t, o) => {
|
|
|
122
122
|
onFinished: { type: Function }
|
|
123
123
|
},
|
|
124
124
|
setup(t) {
|
|
125
|
-
const o = t, e = q(), n = Oe(), l =
|
|
125
|
+
const o = t, e = q(), n = Oe(), l = Ue(), r = q(!1), s = q(null), u = q(!1), c = C(() => {
|
|
126
126
|
switch (o.action) {
|
|
127
127
|
case fe.enum.approveDraft:
|
|
128
128
|
return "Approve";
|
|
@@ -143,7 +143,7 @@ const Oe = rn((t, o) => {
|
|
|
143
143
|
}
|
|
144
144
|
throw new Error(`Unknown action: ${o.action}`);
|
|
145
145
|
});
|
|
146
|
-
|
|
146
|
+
uo(() => {
|
|
147
147
|
if (o.draft.effectiveAt)
|
|
148
148
|
s.value = new Date(o.draft.effectiveAt);
|
|
149
149
|
else {
|
|
@@ -165,7 +165,7 @@ const Oe = rn((t, o) => {
|
|
|
165
165
|
}
|
|
166
166
|
}), S = C({
|
|
167
167
|
get() {
|
|
168
|
-
return s.value === null ? "" :
|
|
168
|
+
return s.value === null ? "" : go(s.value);
|
|
169
169
|
},
|
|
170
170
|
set(B) {
|
|
171
171
|
if (B) {
|
|
@@ -211,19 +211,19 @@ const Oe = rn((t, o) => {
|
|
|
211
211
|
}
|
|
212
212
|
return (B, I) => {
|
|
213
213
|
const P = te("FmLabel"), Z = te("FmDatePicker"), X = te("FmTimePicker"), z = te("FmTextField"), F = te("FmButton"), T = te("FmForm");
|
|
214
|
-
return u.value ? (p(),
|
|
214
|
+
return u.value ? (p(), ae(T, {
|
|
215
215
|
key: 1,
|
|
216
216
|
onValidationSuccess: E,
|
|
217
217
|
class: "flex flex-col gap-32",
|
|
218
218
|
disabled: r.value
|
|
219
219
|
}, {
|
|
220
220
|
default: ee(() => [
|
|
221
|
-
a("div",
|
|
221
|
+
a("div", Tn, [
|
|
222
222
|
I[4] || (I[4] = ge(" You are about to ")),
|
|
223
|
-
a("span",
|
|
223
|
+
a("span", jn, R(c.value), 1),
|
|
224
224
|
I[5] || (I[5] = ge(" this draft. Please provide a remark to justify this action. "))
|
|
225
225
|
]),
|
|
226
|
-
B.action === d(fe).enum.approveDraft ? (p(), A("div",
|
|
226
|
+
B.action === d(fe).enum.approveDraft ? (p(), A("div", Rn, [
|
|
227
227
|
h(P, { class: "fm-typo-en-body-lg-600" }, {
|
|
228
228
|
default: ee(() => I[6] || (I[6] = [
|
|
229
229
|
ge("Closing Date")
|
|
@@ -245,18 +245,18 @@ const Oe = rn((t, o) => {
|
|
|
245
245
|
modelValue: S.value,
|
|
246
246
|
"onUpdate:modelValue": I[1] || (I[1] = (k) => S.value = k)
|
|
247
247
|
}, null, 8, ["modelValue"]),
|
|
248
|
-
J.value ? (p(), A("div",
|
|
248
|
+
J.value ? (p(), A("div", Nn, " Cannot select future date ")) : H("", !0)
|
|
249
249
|
])) : H("", !0),
|
|
250
|
-
a("div",
|
|
250
|
+
a("div", Mn, [
|
|
251
251
|
h(z, {
|
|
252
252
|
modelValue: e.value,
|
|
253
253
|
"onUpdate:modelValue": I[2] || (I[2] = (k) => e.value = k),
|
|
254
254
|
label: "Remark",
|
|
255
255
|
"label-mark": "required",
|
|
256
|
-
rules: [d(
|
|
256
|
+
rules: [d(yo)()]
|
|
257
257
|
}, null, 8, ["modelValue", "rules"])
|
|
258
258
|
]),
|
|
259
|
-
a("div",
|
|
259
|
+
a("div", Un, [
|
|
260
260
|
h(F, {
|
|
261
261
|
label: "Cancel",
|
|
262
262
|
variant: "tertiary",
|
|
@@ -277,53 +277,53 @@ const Oe = rn((t, o) => {
|
|
|
277
277
|
], 64));
|
|
278
278
|
};
|
|
279
279
|
}
|
|
280
|
-
}),
|
|
281
|
-
function
|
|
280
|
+
}), Pn = ne.fromNumber(0);
|
|
281
|
+
function kt(t) {
|
|
282
282
|
const o = t.measurementsAmounts.groupBy((e) => e.measurement.id);
|
|
283
283
|
return t.sku.unit.measurements.reduce((e, n) => {
|
|
284
284
|
var s, u;
|
|
285
|
-
const l = ((u = (s = o.get(n.id)) == null ? void 0 : s[0]) == null ? void 0 : u.amount) ??
|
|
286
|
-
return
|
|
285
|
+
const l = ((u = (s = o.get(n.id)) == null ? void 0 : s[0]) == null ? void 0 : u.amount) ?? Pn, r = ht(n.conversion, l);
|
|
286
|
+
return Xe(e, r);
|
|
287
287
|
}, t.baseAmount);
|
|
288
288
|
}
|
|
289
|
-
const
|
|
290
|
-
function
|
|
291
|
-
var _, $, L,
|
|
292
|
-
const c =
|
|
289
|
+
const Vn = ne.fromNumber(0), En = ne.fromNumber(100);
|
|
290
|
+
function Ln(t, o, e, n, l, r, s, u) {
|
|
291
|
+
var _, $, L, N, ve;
|
|
292
|
+
const c = kt(t), b = n ?? c, g = bo(b, o), S = o.amount === 0 ? null : ho(g, {
|
|
293
293
|
...o,
|
|
294
294
|
amount: Math.abs(o.amount)
|
|
295
|
-
}), J = S ?
|
|
295
|
+
}), J = S ? ht(S, En) : null, E = ((_ = t.sku.defaultCost) == null ? void 0 : _.costPerUnit) ?? { amount: 0, precision: 0 }, B = Number(ne.toFormatString({ value: E })), I = ((L = ($ = t.sku.defaultCost) == null ? void 0 : $.measurement) == null ? void 0 : L.conversion) ?? {
|
|
296
296
|
amount: 1,
|
|
297
297
|
precision: 0
|
|
298
298
|
}, P = Number(
|
|
299
|
-
|
|
300
|
-
), Z = l ? Number(
|
|
299
|
+
ne.toFormatString({ value: I })
|
|
300
|
+
), Z = l ? Number(ne.toFormatString({ value: l })) : 0, X = Number(ne.toFormatString({ value: o })), z = Number(ne.toFormatString({ value: b })), F = z - X, T = F * B / P, k = z * B / P, x = X * B / P, w = {};
|
|
301
301
|
return s && r && s.forEach((oe) => {
|
|
302
|
-
const
|
|
302
|
+
const M = { amount: 0, precision: 0 }, f = r[oe];
|
|
303
303
|
if (f) {
|
|
304
|
-
const y =
|
|
305
|
-
w[`adjustment_${oe}`] =
|
|
304
|
+
const y = Xe(M, f);
|
|
305
|
+
w[`adjustment_${oe}`] = mn(y);
|
|
306
306
|
} else
|
|
307
307
|
w[`adjustment_${oe}`] = "0";
|
|
308
308
|
}), {
|
|
309
309
|
code: t.sku.code,
|
|
310
310
|
name: t.sku.name,
|
|
311
311
|
baseUnit: t.sku.unit.abbrev,
|
|
312
|
-
costUnit: ((ve = (
|
|
313
|
-
baseUnitAmount: Number(
|
|
312
|
+
costUnit: ((ve = (N = t.sku.defaultCost) == null ? void 0 : N.measurement) == null ? void 0 : ve.abbrev) ?? null,
|
|
313
|
+
baseUnitAmount: Number(ne.toFormatString({ value: t.baseAmount })),
|
|
314
314
|
...e.reduce(
|
|
315
|
-
(oe,
|
|
316
|
-
const y =
|
|
317
|
-
return oe[`measurementAbbrev${f}`] = `(${
|
|
315
|
+
(oe, M, f) => {
|
|
316
|
+
const y = ne.toFormatString({ value: M.conversion }), U = M.orphan ? " [invalid UOM]" : M.inactive ? " [NetSuite-inactive]" : "";
|
|
317
|
+
return oe[`measurementAbbrev${f}`] = `(${M.abbrev}) × ${y}${U}`, oe[`measurementAmount${f}`] = Number(ne.toFormatString({ value: M.amount })), oe;
|
|
318
318
|
},
|
|
319
319
|
{}
|
|
320
320
|
),
|
|
321
321
|
systemBalance: X,
|
|
322
322
|
physicalBalance: z,
|
|
323
|
-
adjustedAmount: Number(
|
|
323
|
+
adjustedAmount: Number(ne.toFormatString({ value: g })),
|
|
324
324
|
adjustedDiffPercentage: J ? Number(
|
|
325
|
-
|
|
326
|
-
value:
|
|
325
|
+
ne.toFormatString({
|
|
326
|
+
value: _o(J, 2)
|
|
327
327
|
})
|
|
328
328
|
) : null,
|
|
329
329
|
costPerUnit: B,
|
|
@@ -335,22 +335,22 @@ function On(t, o, e, n, l, r, s, u) {
|
|
|
335
335
|
systemValue: x,
|
|
336
336
|
// Include custom attribute values
|
|
337
337
|
...(u ?? []).reduce(
|
|
338
|
-
(oe,
|
|
338
|
+
(oe, M) => {
|
|
339
339
|
var y;
|
|
340
|
-
const f = (y = t.sku.customAttributes) == null ? void 0 : y[
|
|
341
|
-
return oe[`customAttr_${
|
|
340
|
+
const f = (y = t.sku.customAttributes) == null ? void 0 : y[M];
|
|
341
|
+
return oe[`customAttr_${M}`] = f != null ? String(f) : null, oe;
|
|
342
342
|
},
|
|
343
343
|
{}
|
|
344
344
|
)
|
|
345
345
|
};
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function On(t) {
|
|
348
348
|
let o = 0;
|
|
349
349
|
for (const e of t.values())
|
|
350
350
|
e.length > o && (o = e.length);
|
|
351
351
|
return o;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function Gn(t, o) {
|
|
354
354
|
const e = /* @__PURE__ */ new Map();
|
|
355
355
|
for (const n of t) {
|
|
356
356
|
if (e.has(n.sku._id)) continue;
|
|
@@ -364,7 +364,7 @@ function zn(t, o) {
|
|
|
364
364
|
abbrev: u.abbrev,
|
|
365
365
|
conversion: u.conversion,
|
|
366
366
|
amount: c,
|
|
367
|
-
inactive:
|
|
367
|
+
inactive: Mt(u, o),
|
|
368
368
|
orphan: !1
|
|
369
369
|
});
|
|
370
370
|
}
|
|
@@ -381,8 +381,8 @@ function zn(t, o) {
|
|
|
381
381
|
}
|
|
382
382
|
return e;
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
const n =
|
|
384
|
+
function zn(t, o = [], e = []) {
|
|
385
|
+
const n = fo(), l = n === "MYR" ? "RM" : n;
|
|
386
386
|
return [
|
|
387
387
|
{
|
|
388
388
|
id: "code",
|
|
@@ -462,40 +462,40 @@ function Hn(t, o = [], e = []) {
|
|
|
462
462
|
}))
|
|
463
463
|
];
|
|
464
464
|
}
|
|
465
|
-
function
|
|
466
|
-
var re, _, $, L,
|
|
465
|
+
function Hn(t, o, e, n = [], l) {
|
|
466
|
+
var re, _, $, L, N, ve, oe;
|
|
467
467
|
const r = o.groupBy(
|
|
468
|
-
(
|
|
469
|
-
(
|
|
468
|
+
(M) => M.id,
|
|
469
|
+
(M) => M.balance
|
|
470
470
|
), s = e.groupBy(
|
|
471
|
-
(
|
|
472
|
-
(
|
|
471
|
+
(M) => M.id,
|
|
472
|
+
(M) => M.balance
|
|
473
473
|
), u = /* @__PURE__ */ new Map();
|
|
474
474
|
if (t.opening)
|
|
475
|
-
for (const
|
|
476
|
-
u.set(
|
|
475
|
+
for (const M of t.opening)
|
|
476
|
+
u.set(M.skuId, M.balance);
|
|
477
477
|
const c = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Map();
|
|
478
478
|
if (t.adjustmentSnapshot)
|
|
479
|
-
for (const
|
|
480
|
-
|
|
479
|
+
for (const M of t.adjustmentSnapshot)
|
|
480
|
+
M.adjustmentsByType && (Object.keys(M.adjustmentsByType).forEach((f) => c.add(f)), b.set(M.skuId, M.adjustmentsByType));
|
|
481
481
|
const g = ["receive", "sales", "wastage"], S = [];
|
|
482
|
-
g.forEach((
|
|
483
|
-
c.has(
|
|
482
|
+
g.forEach((M) => {
|
|
483
|
+
c.has(M) && (S.push(M), c.delete(M));
|
|
484
484
|
});
|
|
485
|
-
const J = Array.from(c).sort(), E = [...S, ...J], B = [...t.items, ...t.negativeStockItems ?? []], P =
|
|
485
|
+
const J = Array.from(c).sort(), E = [...S, ...J], B = [...t.items, ...t.negativeStockItems ?? []], P = mo().currentBusiness.value, Z = Gn(B, l), X = B.map((M) => {
|
|
486
486
|
var de, j;
|
|
487
|
-
const f = ((de = r.get(
|
|
488
|
-
return
|
|
489
|
-
|
|
487
|
+
const f = ((de = r.get(M.sku._id)) == null ? void 0 : de[0]) ?? Vn, y = Z.get(M.sku._id) ?? [], U = u.get(M.sku._id), Y = b.get(M.sku._id);
|
|
488
|
+
return Ln(
|
|
489
|
+
M,
|
|
490
490
|
f,
|
|
491
491
|
y,
|
|
492
|
-
(j = s.get(
|
|
493
|
-
|
|
492
|
+
(j = s.get(M.sku._id)) == null ? void 0 : j[0],
|
|
493
|
+
U,
|
|
494
494
|
Y,
|
|
495
495
|
E,
|
|
496
496
|
n
|
|
497
497
|
);
|
|
498
|
-
}), z =
|
|
498
|
+
}), z = On(Z), F = zn(z, E, n), T = [
|
|
499
499
|
["Business name:", P == null ? void 0 : P.name],
|
|
500
500
|
["Business ID:", P == null ? void 0 : P._id],
|
|
501
501
|
["Menu version", P == null ? void 0 : P.menuVersion],
|
|
@@ -506,7 +506,7 @@ function Yn(t, o, e, n = [], l) {
|
|
|
506
506
|
["Recent action", t.approvedAt ? "Approve" : t.rejectionHistory ? "Reject" : ""],
|
|
507
507
|
[
|
|
508
508
|
"Action by",
|
|
509
|
-
t.approvedAt ? ($ = t.approvedBy) == null ? void 0 : $.name : t.rejectionHistory ? (
|
|
509
|
+
t.approvedAt ? ($ = t.approvedBy) == null ? void 0 : $.name : t.rejectionHistory ? (N = (L = t.rejectionHistory[0]) == null ? void 0 : L.rejectedBy) == null ? void 0 : N.name : ""
|
|
510
510
|
],
|
|
511
511
|
[
|
|
512
512
|
"Action at",
|
|
@@ -517,15 +517,15 @@ function Yn(t, o, e, n = [], l) {
|
|
|
517
517
|
t.approvedAt ? t.approveRemark : t.rejectionHistory ? new Date((oe = t.rejectionHistory[0]) == null ? void 0 : oe.rejectRemark) : ""
|
|
518
518
|
],
|
|
519
519
|
[],
|
|
520
|
-
F.map((
|
|
521
|
-
...X.map((
|
|
522
|
-
], k = F.map((
|
|
523
|
-
return
|
|
520
|
+
F.map((M) => M.name),
|
|
521
|
+
...X.map((M) => F.map((f) => M[f.id]))
|
|
522
|
+
], k = F.map((M) => `system:${M.id}`), x = fn(T, k), w = `[${P == null ? void 0 : P.name}] closing draft (${dn(new Date(t.updatedAt))}).xlsx`;
|
|
523
|
+
return vn(x, w), w;
|
|
524
524
|
}
|
|
525
|
-
const
|
|
525
|
+
const Yn = { class: "flex flex-col" }, Wn = {
|
|
526
526
|
key: 0,
|
|
527
527
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-error mt-4"
|
|
528
|
-
},
|
|
528
|
+
}, Kn = { class: "flex gap-12 py-8 justify-end w-full" }, qn = /* @__PURE__ */ De({
|
|
529
529
|
__name: "RefreshBalanceAction",
|
|
530
530
|
props: {
|
|
531
531
|
draft: {},
|
|
@@ -534,9 +534,9 @@ const Wn = { class: "flex flex-col" }, Kn = {
|
|
|
534
534
|
},
|
|
535
535
|
setup(t) {
|
|
536
536
|
const o = t;
|
|
537
|
-
|
|
537
|
+
_t();
|
|
538
538
|
const e = q(!1), n = q(null), l = q(!1);
|
|
539
|
-
|
|
539
|
+
uo(() => {
|
|
540
540
|
if (o.draft.effectiveAt)
|
|
541
541
|
n.value = new Date(o.draft.effectiveAt);
|
|
542
542
|
else {
|
|
@@ -558,7 +558,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
|
|
|
558
558
|
}
|
|
559
559
|
}), s = C({
|
|
560
560
|
get() {
|
|
561
|
-
return n.value === null ? "" :
|
|
561
|
+
return n.value === null ? "" : go(n.value);
|
|
562
562
|
},
|
|
563
563
|
set(b) {
|
|
564
564
|
if (b) {
|
|
@@ -573,7 +573,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
|
|
|
573
573
|
}
|
|
574
574
|
return (b, g) => {
|
|
575
575
|
const S = te("FmLabel"), J = te("FmDatePicker"), E = te("FmTimePicker"), B = te("FmButton"), I = te("FmForm");
|
|
576
|
-
return l.value ? (p(),
|
|
576
|
+
return l.value ? (p(), ae(I, {
|
|
577
577
|
key: 1,
|
|
578
578
|
onValidationSuccess: c,
|
|
579
579
|
class: "flex flex-col gap-32",
|
|
@@ -592,7 +592,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
|
|
|
592
592
|
ge(" the effective date and time. ")
|
|
593
593
|
])
|
|
594
594
|
], -1)),
|
|
595
|
-
a("div",
|
|
595
|
+
a("div", Yn, [
|
|
596
596
|
h(S, { class: "fm-typo-en-body-lg-600" }, {
|
|
597
597
|
default: ee(() => g[3] || (g[3] = [
|
|
598
598
|
ge("Closing Date")
|
|
@@ -614,9 +614,9 @@ const Wn = { class: "flex flex-col" }, Kn = {
|
|
|
614
614
|
modelValue: s.value,
|
|
615
615
|
"onUpdate:modelValue": g[1] || (g[1] = (P) => s.value = P)
|
|
616
616
|
}, null, 8, ["modelValue"]),
|
|
617
|
-
u.value ? (p(), A("div",
|
|
617
|
+
u.value ? (p(), A("div", Wn, " Cannot select future date ")) : H("", !0)
|
|
618
618
|
]),
|
|
619
|
-
a("div",
|
|
619
|
+
a("div", Kn, [
|
|
620
620
|
h(B, {
|
|
621
621
|
label: "Cancel",
|
|
622
622
|
variant: "tertiary",
|
|
@@ -638,10 +638,10 @@ const Wn = { class: "flex flex-col" }, Kn = {
|
|
|
638
638
|
], 64));
|
|
639
639
|
};
|
|
640
640
|
}
|
|
641
|
-
}),
|
|
641
|
+
}), yt = vo(
|
|
642
642
|
"closingDraftActions",
|
|
643
643
|
function() {
|
|
644
|
-
const o =
|
|
644
|
+
const o = po(), e = Ue(), n = _t(), l = Oe(), r = bn(), s = Ut(), u = q(!1), c = q();
|
|
645
645
|
async function b(F, T) {
|
|
646
646
|
const k = await l.getDraftDetail(F, T), x = {
|
|
647
647
|
draft: k
|
|
@@ -673,7 +673,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
|
|
|
673
673
|
T || (e.open({
|
|
674
674
|
title: "Exporting",
|
|
675
675
|
message: "Fetching data..."
|
|
676
|
-
}), T = await g(F)),
|
|
676
|
+
}), T = await g(F)), Hn(
|
|
677
677
|
F,
|
|
678
678
|
T,
|
|
679
679
|
k ?? [],
|
|
@@ -684,7 +684,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
|
|
|
684
684
|
function J(F, T, k) {
|
|
685
685
|
o.open({
|
|
686
686
|
title: "Approve draft",
|
|
687
|
-
contentComponent:
|
|
687
|
+
contentComponent: Tt,
|
|
688
688
|
contentComponentProps: {
|
|
689
689
|
draft: F,
|
|
690
690
|
action: fe.enum.approveDraft,
|
|
@@ -702,7 +702,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
|
|
|
702
702
|
function E(F, T) {
|
|
703
703
|
o.open({
|
|
704
704
|
title: "Reject draft",
|
|
705
|
-
contentComponent:
|
|
705
|
+
contentComponent: Tt,
|
|
706
706
|
contentComponentProps: {
|
|
707
707
|
draft: F,
|
|
708
708
|
action: fe.enum.rejectDraft,
|
|
@@ -716,7 +716,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
|
|
|
716
716
|
function B(F, T) {
|
|
717
717
|
o.open({
|
|
718
718
|
title: "Mark draft as failed",
|
|
719
|
-
contentComponent:
|
|
719
|
+
contentComponent: Tt,
|
|
720
720
|
contentComponentProps: {
|
|
721
721
|
draft: F,
|
|
722
722
|
action: fe.enum.markAsFailed,
|
|
@@ -747,7 +747,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
|
|
|
747
747
|
async function Z(F, T, k) {
|
|
748
748
|
await o.open({
|
|
749
749
|
title: "Refresh balance",
|
|
750
|
-
contentComponent:
|
|
750
|
+
contentComponent: qn,
|
|
751
751
|
contentComponentProps: {
|
|
752
752
|
draft: F,
|
|
753
753
|
onFinished: (x) => {
|
|
@@ -807,7 +807,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
|
|
|
807
807
|
};
|
|
808
808
|
}
|
|
809
809
|
);
|
|
810
|
-
function
|
|
810
|
+
function Me(t) {
|
|
811
811
|
switch (t) {
|
|
812
812
|
case "DRAFT":
|
|
813
813
|
return "fm-status-badge-draft";
|
|
@@ -821,7 +821,7 @@ function Ue(t) {
|
|
|
821
821
|
return "fm-status-badge-processing";
|
|
822
822
|
}
|
|
823
823
|
}
|
|
824
|
-
function
|
|
824
|
+
function Pt(t) {
|
|
825
825
|
var n, l;
|
|
826
826
|
if (t.status !== "DRAFT") return t.status;
|
|
827
827
|
const o = (l = (n = t.rejectionHistory) == null ? void 0 : n[0]) == null ? void 0 : l.rejectedAt;
|
|
@@ -829,38 +829,38 @@ function Vt(t) {
|
|
|
829
829
|
const e = t.updatedAt ? new Date(t.updatedAt) : null;
|
|
830
830
|
return !e || new Date(o).getTime() > e.getTime() ? "REJECTED" : "UPDATED";
|
|
831
831
|
}
|
|
832
|
-
function
|
|
832
|
+
function Qn(t) {
|
|
833
833
|
return t.baseAmount.amount > 0 ? !0 : t.measurementsAmounts.some((o) => o.amount.amount !== 0);
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function Jn(t) {
|
|
836
836
|
var l, r, s;
|
|
837
|
-
const o = Number(
|
|
838
|
-
|
|
837
|
+
const o = Number(ne.toFormatString({ value: kt(t) })), e = Number(
|
|
838
|
+
ne.toFormatString({
|
|
839
839
|
value: ((l = t.sku.defaultCost) == null ? void 0 : l.costPerUnit) ?? { amount: 0, precision: 0 }
|
|
840
840
|
})
|
|
841
841
|
), n = Number(
|
|
842
|
-
|
|
842
|
+
ne.toFormatString({
|
|
843
843
|
value: ((s = (r = t.sku.defaultCost) == null ? void 0 : r.measurement) == null ? void 0 : s.conversion) ?? { amount: 1, precision: 0 }
|
|
844
844
|
})
|
|
845
845
|
);
|
|
846
846
|
return o * e / n;
|
|
847
847
|
}
|
|
848
|
-
function
|
|
848
|
+
function wt(t) {
|
|
849
849
|
var o, e;
|
|
850
850
|
return ((e = (o = t.usingTemplates) == null ? void 0 : o[0]) == null ? void 0 : e.name) || "Group";
|
|
851
851
|
}
|
|
852
|
-
function
|
|
852
|
+
function Zn(t) {
|
|
853
853
|
var e;
|
|
854
854
|
const o = (e = t.usingTemplates) == null ? void 0 : e[0];
|
|
855
|
-
return o != null && o.ref ? o.ref :
|
|
855
|
+
return o != null && o.ref ? o.ref : wt(t).replace(/[^a-z0-9]/gi, "").slice(0, 6).toUpperCase() || "GROUP";
|
|
856
856
|
}
|
|
857
|
-
function
|
|
857
|
+
function jt(t) {
|
|
858
858
|
var r, s, u;
|
|
859
|
-
const o = [...t.items, ...t.negativeStockItems ?? []], e = o.filter(
|
|
859
|
+
const o = [...t.items, ...t.negativeStockItems ?? []], e = o.filter(Qn).length, n = o.reduce((c, b) => c + Jn(b), 0), l = ((r = t.updatedBy) == null ? void 0 : r.name) || ((s = t.createdBy) == null ? void 0 : s.name) || void 0;
|
|
860
860
|
return {
|
|
861
861
|
id: t._id,
|
|
862
|
-
name:
|
|
863
|
-
code:
|
|
862
|
+
name: wt(t),
|
|
863
|
+
code: Zn(t),
|
|
864
864
|
status: t.status,
|
|
865
865
|
rejectionHistory: t.rejectionHistory,
|
|
866
866
|
itemCount: o.length,
|
|
@@ -872,11 +872,11 @@ function Rt(t) {
|
|
|
872
872
|
updatedAt: t.updatedAt || t.createdAt
|
|
873
873
|
};
|
|
874
874
|
}
|
|
875
|
-
function
|
|
875
|
+
function Xn(t) {
|
|
876
876
|
return t.reduce(
|
|
877
877
|
(o, e) => {
|
|
878
878
|
o.totalItems += e.itemCount, o.totalAmount += e.totalAmount;
|
|
879
|
-
const n =
|
|
879
|
+
const n = Pt(e);
|
|
880
880
|
return n === "COMPLETED" ? o.completed++ : n === "REJECTED" ? o.rejected++ : o.draft++, o;
|
|
881
881
|
},
|
|
882
882
|
{
|
|
@@ -889,11 +889,11 @@ function ea(t) {
|
|
|
889
889
|
}
|
|
890
890
|
);
|
|
891
891
|
}
|
|
892
|
-
const
|
|
892
|
+
const wo = vo(
|
|
893
893
|
"closingDraftTable",
|
|
894
894
|
function() {
|
|
895
|
-
var
|
|
896
|
-
const { t: o } =
|
|
895
|
+
var M;
|
|
896
|
+
const { t: o } = et(), e = mo(), n = yt(), l = q(new Array()), r = q(0), s = q(!1), u = qe(), c = Oe(), b = Ue();
|
|
897
897
|
function g(f) {
|
|
898
898
|
console.error("Row action failed:", f), b.open({
|
|
899
899
|
title: o("inventory.common.somethingWentWrong"),
|
|
@@ -901,8 +901,8 @@ const xo = go(
|
|
|
901
901
|
type: "error"
|
|
902
902
|
});
|
|
903
903
|
}
|
|
904
|
-
let S = {}, J = (
|
|
905
|
-
const E = 6, B = q(
|
|
904
|
+
let S = {}, J = (M = u._currentLocation) == null ? void 0 : M.dbName;
|
|
905
|
+
const E = 6, B = q(kn());
|
|
906
906
|
function I(f) {
|
|
907
907
|
const y = new Date(f.endDate);
|
|
908
908
|
return y.setMonth(y.getMonth() - E), new Date(f.startDate) < y ? { startDate: Ke(y), endDate: f.endDate } : f;
|
|
@@ -934,9 +934,9 @@ const xo = go(
|
|
|
934
934
|
const [y] = await Promise.all([
|
|
935
935
|
c.getDraft(f),
|
|
936
936
|
new Promise((Y) => setTimeout(Y, 1e3))
|
|
937
|
-
]), { toClosingDraftListItem:
|
|
937
|
+
]), { toClosingDraftListItem: U } = await import("./index-twVxfWIB.js");
|
|
938
938
|
l.value = k([
|
|
939
|
-
|
|
939
|
+
U(y)
|
|
940
940
|
]), x(f);
|
|
941
941
|
} catch (y) {
|
|
942
942
|
console.log("Something went wrong when fetching drafts:", y);
|
|
@@ -947,50 +947,50 @@ const xo = go(
|
|
|
947
947
|
}
|
|
948
948
|
function k(f) {
|
|
949
949
|
for (const Y of f) S[Y._id] = Y;
|
|
950
|
-
const y = Object.values(S),
|
|
950
|
+
const y = Object.values(S), U = wn(
|
|
951
951
|
y.filter((Y) => !!Y.closingId).map((Y) => ({ closingId: Y.closingId, draftCreatedAt: new Date(Le(Y._id)) }))
|
|
952
952
|
);
|
|
953
953
|
return f.map((Y) => ({
|
|
954
954
|
...Y,
|
|
955
|
-
closingIdDisplay: Y.closingId ?
|
|
955
|
+
closingIdDisplay: Y.closingId ? U.get(Y.closingId) ?? null : null
|
|
956
956
|
}));
|
|
957
957
|
}
|
|
958
958
|
async function x(f) {
|
|
959
959
|
try {
|
|
960
|
-
const
|
|
961
|
-
l.value = l.value.map((Y) => Y._id === f ? { ...Y, groups:
|
|
960
|
+
const U = (await c.getClosingGroups(f)).map(jt);
|
|
961
|
+
l.value = l.value.map((Y) => Y._id === f ? { ...Y, groups: U } : Y);
|
|
962
962
|
} catch (y) {
|
|
963
963
|
console.log(`Something went wrong when refreshing groups for ${f}:`, y);
|
|
964
964
|
}
|
|
965
965
|
}
|
|
966
966
|
async function w(f, y) {
|
|
967
|
-
const { toClosingDraftListItem:
|
|
967
|
+
const { toClosingDraftListItem: U } = await import("./index-twVxfWIB.js");
|
|
968
968
|
return {
|
|
969
|
-
...
|
|
969
|
+
...U(
|
|
970
970
|
f
|
|
971
971
|
),
|
|
972
972
|
_rev: f._rev,
|
|
973
973
|
closingIdDisplay: y.closingIdDisplay,
|
|
974
974
|
groups: (f.groups ?? []).map(
|
|
975
|
-
(Y) =>
|
|
975
|
+
(Y) => jt(Y)
|
|
976
976
|
)
|
|
977
977
|
};
|
|
978
978
|
}
|
|
979
979
|
async function re(f) {
|
|
980
|
-
const { toClosingDraftListItem: y } = await import("./index-
|
|
981
|
-
l.value = l.value.map((
|
|
980
|
+
const { toClosingDraftListItem: y } = await import("./index-twVxfWIB.js");
|
|
981
|
+
l.value = l.value.map((U) => U._id === f._id ? {
|
|
982
982
|
...y(f),
|
|
983
983
|
_rev: f._rev,
|
|
984
|
-
closingIdDisplay:
|
|
984
|
+
closingIdDisplay: U.closingIdDisplay,
|
|
985
985
|
// The full doc carries no groups; keep the row's embedded
|
|
986
986
|
// summaries until refreshDraftGroups below replaces them.
|
|
987
|
-
groups:
|
|
988
|
-
} :
|
|
987
|
+
groups: U.groups
|
|
988
|
+
} : U), x(f._id);
|
|
989
989
|
}
|
|
990
990
|
function _(f) {
|
|
991
991
|
var Y;
|
|
992
|
-
const y = f.itemCount + f.negativeStockItemCount,
|
|
993
|
-
return { count: y, remark:
|
|
992
|
+
const y = f.itemCount + f.negativeStockItemCount, U = (f == null ? void 0 : f.approveRemark) ?? ((Y = f == null ? void 0 : f.rejectionHistory) == null ? void 0 : Y.computeFirst((de) => de.rejectRemark)) ?? f.remark ?? "";
|
|
993
|
+
return { count: y, remark: U };
|
|
994
994
|
}
|
|
995
995
|
function $(f, y = "") {
|
|
996
996
|
return D(
|
|
@@ -1007,9 +1007,9 @@ const xo = go(
|
|
|
1007
1007
|
function L(f) {
|
|
1008
1008
|
if (!f.length) return null;
|
|
1009
1009
|
const y = f.reduce(
|
|
1010
|
-
(
|
|
1011
|
-
const de =
|
|
1012
|
-
return de === "COMPLETED" ?
|
|
1010
|
+
(U, Y) => {
|
|
1011
|
+
const de = Pt(Y);
|
|
1012
|
+
return de === "COMPLETED" ? U.completed++ : de === "REJECTED" ? U.rejected++ : U.draft++, U;
|
|
1013
1013
|
},
|
|
1014
1014
|
{ completed: 0, draft: 0, rejected: 0 }
|
|
1015
1015
|
);
|
|
@@ -1020,11 +1020,11 @@ const xo = go(
|
|
|
1020
1020
|
y.rejected ? $(`${y.rejected} rejected`, "text-fm-color-typo-error") : null
|
|
1021
1021
|
]);
|
|
1022
1022
|
}
|
|
1023
|
-
function
|
|
1023
|
+
function N() {
|
|
1024
1024
|
n.closeDraftDialog(), z();
|
|
1025
1025
|
}
|
|
1026
1026
|
async function ve(f, y) {
|
|
1027
|
-
switch (y =
|
|
1027
|
+
switch (y = rn(y), f) {
|
|
1028
1028
|
case He.Details:
|
|
1029
1029
|
return n.viewDraft(y._id).then(
|
|
1030
1030
|
() => {
|
|
@@ -1032,15 +1032,15 @@ const xo = go(
|
|
|
1032
1032
|
g
|
|
1033
1033
|
);
|
|
1034
1034
|
case He.Export:
|
|
1035
|
-
return c.getDraft(y._id).then((
|
|
1035
|
+
return c.getDraft(y._id).then((U) => n.exportDraft(U)).catch(g);
|
|
1036
1036
|
case fe.enum.approveDraft:
|
|
1037
|
-
return n.approveDraft(y,
|
|
1037
|
+
return n.approveDraft(y, N);
|
|
1038
1038
|
case fe.enum.rejectDraft:
|
|
1039
|
-
return n.rejectDraft(y,
|
|
1039
|
+
return n.rejectDraft(y, N);
|
|
1040
1040
|
case fe.enum.markAsFailed:
|
|
1041
|
-
return n.markAsFailed(y,
|
|
1041
|
+
return n.markAsFailed(y, N);
|
|
1042
1042
|
case He.Duplicate:
|
|
1043
|
-
return n.cloneDraft(y,
|
|
1043
|
+
return n.cloneDraft(y, N);
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
1046
|
return {
|
|
@@ -1050,7 +1050,7 @@ const xo = go(
|
|
|
1050
1050
|
accessorKey: "_id",
|
|
1051
1051
|
header: () => o("inventory.closing.table.createdAt"),
|
|
1052
1052
|
cell(f) {
|
|
1053
|
-
return
|
|
1053
|
+
return _n(`${f.getValue()}`);
|
|
1054
1054
|
},
|
|
1055
1055
|
sortingFn: (f, y) => new Date(Le(f.original._id)).getTime() - new Date(Le(y.original._id)).getTime(),
|
|
1056
1056
|
enableSorting: !0
|
|
@@ -1070,8 +1070,8 @@ const xo = go(
|
|
|
1070
1070
|
header: () => o("inventory.closing.draft.table.effectiveAt"),
|
|
1071
1071
|
cell(f) {
|
|
1072
1072
|
const y = f.row.original;
|
|
1073
|
-
let
|
|
1074
|
-
return
|
|
1073
|
+
let U = f.getValue();
|
|
1074
|
+
return U || (U = Le(y._id)), Fe(U);
|
|
1075
1075
|
},
|
|
1076
1076
|
enableSorting: !0,
|
|
1077
1077
|
size: 230
|
|
@@ -1079,14 +1079,14 @@ const xo = go(
|
|
|
1079
1079
|
{
|
|
1080
1080
|
id: "description",
|
|
1081
1081
|
accessorFn: (f) => {
|
|
1082
|
-
const { count: y, remark:
|
|
1083
|
-
return `${y} ${
|
|
1082
|
+
const { count: y, remark: U } = _(f);
|
|
1083
|
+
return `${y} ${U}`;
|
|
1084
1084
|
},
|
|
1085
1085
|
header: () => o("inventory.closing.draft.table.description"),
|
|
1086
1086
|
enableSorting: !0,
|
|
1087
1087
|
size: 350,
|
|
1088
1088
|
cell(f) {
|
|
1089
|
-
const { count: y, remark:
|
|
1089
|
+
const { count: y, remark: U } = _(f.row.original), Y = f.row.original.groups ?? [], de = (j, G) => D("div", { class: "flex gap-4" }, [
|
|
1090
1090
|
D(
|
|
1091
1091
|
"span",
|
|
1092
1092
|
{ class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary" },
|
|
@@ -1103,7 +1103,7 @@ const xo = go(
|
|
|
1103
1103
|
]);
|
|
1104
1104
|
return D("div", { class: "flex flex-col gap-2", style: "width: 300px;" }, [
|
|
1105
1105
|
de(o("inventory.closing.draft.table.items"), y),
|
|
1106
|
-
|
|
1106
|
+
U ? de(o("inventory.closing.draft.table.remark"), U) : null,
|
|
1107
1107
|
L(Y)
|
|
1108
1108
|
]);
|
|
1109
1109
|
}
|
|
@@ -1115,8 +1115,8 @@ const xo = go(
|
|
|
1115
1115
|
enableSorting: !1,
|
|
1116
1116
|
cell(f) {
|
|
1117
1117
|
var G;
|
|
1118
|
-
const y = f.row.original,
|
|
1119
|
-
return
|
|
1118
|
+
const y = f.row.original, U = y.status, Y = new Date(y.updatedAt), de = (G = y == null ? void 0 : y.rejectionHistory) == null ? void 0 : G.computeFirst((ie) => ie.rejectedAt), j = de ? new Date(de) : null;
|
|
1119
|
+
return U === "DRAFT" && j ? j.getTime() > Y.getTime() ? D(
|
|
1120
1120
|
"div",
|
|
1121
1121
|
{
|
|
1122
1122
|
class: "flex"
|
|
@@ -1124,7 +1124,7 @@ const xo = go(
|
|
|
1124
1124
|
D(
|
|
1125
1125
|
"div",
|
|
1126
1126
|
{
|
|
1127
|
-
class: ["fm-status-badge",
|
|
1127
|
+
class: ["fm-status-badge", Me("FAILED")]
|
|
1128
1128
|
},
|
|
1129
1129
|
"Rejected"
|
|
1130
1130
|
)
|
|
@@ -1136,7 +1136,7 @@ const xo = go(
|
|
|
1136
1136
|
D(
|
|
1137
1137
|
"div",
|
|
1138
1138
|
{
|
|
1139
|
-
class: ["fm-status-badge",
|
|
1139
|
+
class: ["fm-status-badge", Me("PROCESSING")]
|
|
1140
1140
|
},
|
|
1141
1141
|
"Updated"
|
|
1142
1142
|
)
|
|
@@ -1148,9 +1148,9 @@ const xo = go(
|
|
|
1148
1148
|
D(
|
|
1149
1149
|
"div",
|
|
1150
1150
|
{
|
|
1151
|
-
class: ["fm-status-badge",
|
|
1151
|
+
class: ["fm-status-badge", Me(U)]
|
|
1152
1152
|
},
|
|
1153
|
-
Ie(
|
|
1153
|
+
Ie(U)
|
|
1154
1154
|
)
|
|
1155
1155
|
);
|
|
1156
1156
|
}
|
|
@@ -1162,13 +1162,13 @@ const xo = go(
|
|
|
1162
1162
|
enableSorting: !0,
|
|
1163
1163
|
size: 200,
|
|
1164
1164
|
cell(f) {
|
|
1165
|
-
var
|
|
1165
|
+
var U;
|
|
1166
1166
|
const y = f.row.original;
|
|
1167
1167
|
return D("div", { class: "flex flex-col" }, [
|
|
1168
1168
|
D(
|
|
1169
1169
|
"div",
|
|
1170
1170
|
{ class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" },
|
|
1171
|
-
((
|
|
1171
|
+
((U = y.updatedBy) == null ? void 0 : U.name) ?? ""
|
|
1172
1172
|
),
|
|
1173
1173
|
D(
|
|
1174
1174
|
"div",
|
|
@@ -1182,9 +1182,9 @@ const xo = go(
|
|
|
1182
1182
|
id: "action",
|
|
1183
1183
|
cell(f) {
|
|
1184
1184
|
var G;
|
|
1185
|
-
const y = f.row.original,
|
|
1186
|
-
|
|
1187
|
-
|
|
1185
|
+
const y = f.row.original, U = ((G = e.sessionUser.value) == null ? void 0 : G.role.isAdmin) ?? !1, Y = [
|
|
1186
|
+
io[He.Details],
|
|
1187
|
+
io[He.Export]
|
|
1188
1188
|
], de = [
|
|
1189
1189
|
{
|
|
1190
1190
|
translationKey: "inventory.closing.draft.approveDraft",
|
|
@@ -1201,14 +1201,14 @@ const xo = go(
|
|
|
1201
1201
|
color: "text-fm-color-typo-error",
|
|
1202
1202
|
value: fe.enum.markAsFailed
|
|
1203
1203
|
}
|
|
1204
|
-
], j =
|
|
1204
|
+
], j = U && y.status !== xe.enum.DRAFT ? [
|
|
1205
1205
|
{
|
|
1206
1206
|
translationKey: "inventory.closing.draft.cloneDraft",
|
|
1207
1207
|
color: "text-fm-color-typo-primary",
|
|
1208
1208
|
value: He.Duplicate
|
|
1209
1209
|
}
|
|
1210
1210
|
] : [];
|
|
1211
|
-
return
|
|
1211
|
+
return hn(
|
|
1212
1212
|
[
|
|
1213
1213
|
...Y,
|
|
1214
1214
|
...y.status === xe.enum.DRAFT ? de : []
|
|
@@ -1241,7 +1241,7 @@ const xo = go(
|
|
|
1241
1241
|
};
|
|
1242
1242
|
}
|
|
1243
1243
|
);
|
|
1244
|
-
function
|
|
1244
|
+
function ea(t) {
|
|
1245
1245
|
const o = /* @__PURE__ */ new Map();
|
|
1246
1246
|
for (const e of t)
|
|
1247
1247
|
for (const n of e) {
|
|
@@ -1257,12 +1257,12 @@ function ta(t) {
|
|
|
1257
1257
|
});
|
|
1258
1258
|
continue;
|
|
1259
1259
|
}
|
|
1260
|
-
l.baseAmount =
|
|
1260
|
+
l.baseAmount = Xe(l.baseAmount, n.baseAmount);
|
|
1261
1261
|
for (const r of n.measurementsAmounts) {
|
|
1262
1262
|
const s = l.measurementsAmounts.findIndex(
|
|
1263
1263
|
(u) => u.measurement.id === r.measurement.id
|
|
1264
1264
|
);
|
|
1265
|
-
s > -1 ? l.measurementsAmounts[s].amount =
|
|
1265
|
+
s > -1 ? l.measurementsAmounts[s].amount = Xe(
|
|
1266
1266
|
l.measurementsAmounts[s].amount,
|
|
1267
1267
|
r.amount
|
|
1268
1268
|
) : l.measurementsAmounts.push({ ...r, amount: { ...r.amount } });
|
|
@@ -1270,25 +1270,25 @@ function ta(t) {
|
|
|
1270
1270
|
}
|
|
1271
1271
|
return [...o.values()];
|
|
1272
1272
|
}
|
|
1273
|
-
const
|
|
1273
|
+
const ta = { class: "fm-typo-en-heading-lg-600" }, oa = { class: "py-4" }, na = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, aa = { key: 0 }, sa = { class: "flex flex-col gap-1 max-h-200 overflow-auto w-full mb-4" }, ra = {
|
|
1274
1274
|
key: 0,
|
|
1275
1275
|
class: "text-fm-color-system-success-300"
|
|
1276
|
-
},
|
|
1276
|
+
}, la = {
|
|
1277
1277
|
key: 1,
|
|
1278
1278
|
class: "text-fm-color-system-error-300"
|
|
1279
|
-
},
|
|
1279
|
+
}, ia = { class: "fm-typo-en-body-md-400" }, ca = { class: "mt-4 flex gap-4" }, ua = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, da = { key: 0 }, ma = { class: "mt-4 flex gap-4" }, pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, fa = { key: 0 }, va = {
|
|
1280
1280
|
key: 0,
|
|
1281
1281
|
class: "mb-4"
|
|
1282
|
-
},
|
|
1282
|
+
}, ga = { class: "flex flex-col gap-1 max-h-200 overflow-auto w-full" }, ya = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ba = {
|
|
1283
1283
|
key: 0,
|
|
1284
1284
|
class: "text-fm-color-system-success-300 mr-1"
|
|
1285
|
-
},
|
|
1285
|
+
}, ha = {
|
|
1286
1286
|
key: 1,
|
|
1287
1287
|
class: "text-fm-color-system-error-300 mr-1"
|
|
1288
|
-
},
|
|
1288
|
+
}, _a = { class: "fm-typo-en-body-md-400" }, ka = { class: "mt-4 flex gap-4" }, wa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, xa = {
|
|
1289
1289
|
key: 0,
|
|
1290
1290
|
class: "flex gap-4"
|
|
1291
|
-
},
|
|
1291
|
+
}, Da = { class: "fm-typo-en-heading-lg-600" }, Aa = { class: "py-4 flex flex-col gap-4" }, $a = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ca = { class: "flex gap-4 justify-end" }, Ze = 1, Ye = 2, We = 3, Ee = 4, Sa = /* @__PURE__ */ De({
|
|
1292
1292
|
__name: "ClosingDraftApprovalDialog",
|
|
1293
1293
|
props: {
|
|
1294
1294
|
show: { type: Boolean },
|
|
@@ -1300,7 +1300,7 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1300
1300
|
},
|
|
1301
1301
|
emits: ["update:show", "refresh", "approve", "approve-all-groups"],
|
|
1302
1302
|
setup(t, { emit: o }) {
|
|
1303
|
-
const { FmStepper: e, FmStep: n, FmDialog: l, FmButton: r } = be, { t: s } =
|
|
1303
|
+
const { FmStepper: e, FmStep: n, FmDialog: l, FmButton: r } = be, { t: s } = An(), u = Nt(), c = t, b = o, g = q(!1);
|
|
1304
1304
|
function S() {
|
|
1305
1305
|
g.value = !0;
|
|
1306
1306
|
}
|
|
@@ -1313,12 +1313,12 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1313
1313
|
return ((j = c.draft) == null ? void 0 : j.stockSnapshot) && ((G = c.draft) == null ? void 0 : G.stockSnapshot) !== void 0;
|
|
1314
1314
|
}
|
|
1315
1315
|
), B = C(() => {
|
|
1316
|
-
var ie,
|
|
1316
|
+
var ie, se, Ae;
|
|
1317
1317
|
const j = ((ie = c.draft) == null ? void 0 : ie.items.map((_e) => ({
|
|
1318
1318
|
id: _e.sku._id,
|
|
1319
1319
|
code: _e.sku.code,
|
|
1320
1320
|
name: _e.sku.name
|
|
1321
|
-
}))) ?? [], G = ((Ae = (
|
|
1321
|
+
}))) ?? [], G = ((Ae = (se = c.draft) == null ? void 0 : se.negativeStockItems) == null ? void 0 : Ae.map((_e) => ({
|
|
1322
1322
|
id: _e.sku._id,
|
|
1323
1323
|
code: _e.sku.code,
|
|
1324
1324
|
name: _e.sku.name
|
|
@@ -1330,14 +1330,14 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1330
1330
|
}), I = C(
|
|
1331
1331
|
() => {
|
|
1332
1332
|
var j, G, ie;
|
|
1333
|
-
return (((ie = (G = (j = c.draft) == null ? void 0 : j.stockSnapshot) == null ? void 0 : G.filter((
|
|
1334
|
-
const Ae = u.skuById[
|
|
1333
|
+
return (((ie = (G = (j = c.draft) == null ? void 0 : j.stockSnapshot) == null ? void 0 : G.filter((se) => se.balance.amount < 0)) == null ? void 0 : ie.map((se) => {
|
|
1334
|
+
const Ae = u.skuById[se.id];
|
|
1335
1335
|
return Ae ? {
|
|
1336
1336
|
id: Ae._id,
|
|
1337
1337
|
code: Ae.code,
|
|
1338
1338
|
name: Ae.name
|
|
1339
1339
|
} : null;
|
|
1340
|
-
})) ?? []).filter((
|
|
1340
|
+
})) ?? []).filter((se) => se !== null);
|
|
1341
1341
|
}
|
|
1342
1342
|
), P = C(() => {
|
|
1343
1343
|
var j;
|
|
@@ -1365,25 +1365,25 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1365
1365
|
return j === Ze ? !X.value : j === Ye ? E.value : j === We ? P.value.length == 0 : !1;
|
|
1366
1366
|
}
|
|
1367
1367
|
const L = C(() => !E.value || P.value.length > 0 || X.value && !F.value);
|
|
1368
|
-
function
|
|
1368
|
+
function N() {
|
|
1369
1369
|
let j = 1;
|
|
1370
1370
|
for (; j < Ee && $(j); ) j++;
|
|
1371
1371
|
return j;
|
|
1372
1372
|
}
|
|
1373
|
-
const ve = C(() => k.value >
|
|
1373
|
+
const ve = C(() => k.value > N());
|
|
1374
1374
|
function oe(j) {
|
|
1375
1375
|
let G = j + 1;
|
|
1376
1376
|
for (; G <= Ee && $(G); ) G++;
|
|
1377
1377
|
return G > Ee ? Ee : G;
|
|
1378
1378
|
}
|
|
1379
|
-
function
|
|
1379
|
+
function M(j) {
|
|
1380
1380
|
let G = j - 1;
|
|
1381
1381
|
for (; G >= 1 && $(G); ) G--;
|
|
1382
|
-
const ie =
|
|
1382
|
+
const ie = N();
|
|
1383
1383
|
return G < ie ? ie : G;
|
|
1384
1384
|
}
|
|
1385
1385
|
function f() {
|
|
1386
|
-
return
|
|
1386
|
+
return N();
|
|
1387
1387
|
}
|
|
1388
1388
|
je(
|
|
1389
1389
|
() => c.show,
|
|
@@ -1404,11 +1404,11 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1404
1404
|
function y() {
|
|
1405
1405
|
b("refresh");
|
|
1406
1406
|
}
|
|
1407
|
-
function
|
|
1407
|
+
function U() {
|
|
1408
1408
|
k.value < Ee && (k.value = oe(k.value));
|
|
1409
1409
|
}
|
|
1410
1410
|
function Y() {
|
|
1411
|
-
k.value > 1 && (k.value =
|
|
1411
|
+
k.value > 1 && (k.value = M(k.value));
|
|
1412
1412
|
}
|
|
1413
1413
|
function de() {
|
|
1414
1414
|
b("approve");
|
|
@@ -1418,50 +1418,50 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1418
1418
|
return p(), A(le, null, [
|
|
1419
1419
|
h(d(l), {
|
|
1420
1420
|
modelValue: Z.value,
|
|
1421
|
-
"onUpdate:modelValue": G[1] || (G[1] = (
|
|
1421
|
+
"onUpdate:modelValue": G[1] || (G[1] = (se) => Z.value = se),
|
|
1422
1422
|
"max-width": 600
|
|
1423
1423
|
}, {
|
|
1424
1424
|
"dialog-header": ee(() => [
|
|
1425
|
-
a("div",
|
|
1425
|
+
a("div", ta, R(d(s)("inventory.closing.approval.title")), 1)
|
|
1426
1426
|
]),
|
|
1427
1427
|
default: ee(() => [
|
|
1428
|
-
a("div",
|
|
1428
|
+
a("div", oa, [
|
|
1429
1429
|
h(d(e), {
|
|
1430
1430
|
modelValue: k.value,
|
|
1431
|
-
"onUpdate:modelValue": G[0] || (G[0] = (
|
|
1431
|
+
"onUpdate:modelValue": G[0] || (G[0] = (se) => k.value = se),
|
|
1432
1432
|
orientation: "vertical"
|
|
1433
1433
|
}, {
|
|
1434
1434
|
default: ee(() => [
|
|
1435
|
-
X.value ? (p(),
|
|
1435
|
+
X.value ? (p(), ae(d(n), {
|
|
1436
1436
|
key: 0,
|
|
1437
1437
|
value: Ze,
|
|
1438
1438
|
title: d(s)("inventory.closing.approval.step.groups.title"),
|
|
1439
1439
|
complete: x
|
|
1440
1440
|
}, {
|
|
1441
1441
|
default: ee(() => [
|
|
1442
|
-
a("div",
|
|
1443
|
-
k.value === Ze ? (p(), A("div",
|
|
1444
|
-
a("div",
|
|
1445
|
-
(p(!0), A(le, null, he(j.groups ?? [], (
|
|
1446
|
-
key:
|
|
1442
|
+
a("div", na, R(F.value ? d(s)("inventory.closing.approval.step.groups.completedMessage") : d(s)("inventory.closing.approval.step.groups.pendingMessage")), 1),
|
|
1443
|
+
k.value === Ze ? (p(), A("div", aa, [
|
|
1444
|
+
a("div", sa, [
|
|
1445
|
+
(p(!0), A(le, null, he(j.groups ?? [], (se) => (p(), A("div", {
|
|
1446
|
+
key: se._id,
|
|
1447
1447
|
class: "flex gap-8 items-center"
|
|
1448
1448
|
}, [
|
|
1449
|
-
|
|
1449
|
+
se.status === d(xe).enum.COMPLETED ? (p(), A("span", ra, [
|
|
1450
1450
|
h(ie, {
|
|
1451
1451
|
name: "check_circle",
|
|
1452
1452
|
size: "sm"
|
|
1453
1453
|
})
|
|
1454
|
-
])) : (p(), A("span",
|
|
1454
|
+
])) : (p(), A("span", la, [
|
|
1455
1455
|
h(ie, {
|
|
1456
1456
|
name: "error",
|
|
1457
1457
|
size: "sm"
|
|
1458
1458
|
})
|
|
1459
1459
|
])),
|
|
1460
|
-
a("div",
|
|
1460
|
+
a("div", ia, R(d(wt)(se)), 1)
|
|
1461
1461
|
]))), 128))
|
|
1462
1462
|
]),
|
|
1463
|
-
a("div",
|
|
1464
|
-
T.value ? (p(),
|
|
1463
|
+
a("div", ca, [
|
|
1464
|
+
T.value ? (p(), ae(d(r), {
|
|
1465
1465
|
key: 0,
|
|
1466
1466
|
label: d(s)("inventory.closing.approval.step.groups.approveAll"),
|
|
1467
1467
|
variant: "secondary",
|
|
@@ -1474,7 +1474,7 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1474
1474
|
label: d(s)("inventory.common.continue"),
|
|
1475
1475
|
disabled: !F.value,
|
|
1476
1476
|
"data-testid": "closing-draft-approve-continue",
|
|
1477
|
-
onClick:
|
|
1477
|
+
onClick: U
|
|
1478
1478
|
}, null, 8, ["label", "disabled"])
|
|
1479
1479
|
])
|
|
1480
1480
|
])) : H("", !0)
|
|
@@ -1488,8 +1488,8 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1488
1488
|
complete: w
|
|
1489
1489
|
}, {
|
|
1490
1490
|
default: ee(() => [
|
|
1491
|
-
a("div",
|
|
1492
|
-
k.value === Ye ? (p(), A("div",
|
|
1491
|
+
a("div", ua, R(d(s)("inventory.closing.approval.step.generateReport.description")), 1),
|
|
1492
|
+
k.value === Ye ? (p(), A("div", da, [
|
|
1493
1493
|
h(d(r), {
|
|
1494
1494
|
label: d(s)("inventory.stock.stock_balance.refreshBalance"),
|
|
1495
1495
|
"prepend-icon": "refresh",
|
|
@@ -1499,8 +1499,8 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1499
1499
|
"data-testid": "closing-draft-refresh-balance",
|
|
1500
1500
|
onClick: y
|
|
1501
1501
|
}, null, 8, ["label", "loading", "disabled"]),
|
|
1502
|
-
a("div",
|
|
1503
|
-
ve.value ? (p(),
|
|
1502
|
+
a("div", ma, [
|
|
1503
|
+
ve.value ? (p(), ae(d(r), {
|
|
1504
1504
|
key: 0,
|
|
1505
1505
|
label: d(s)("inventory.common.back"),
|
|
1506
1506
|
variant: "secondary",
|
|
@@ -1510,7 +1510,7 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1510
1510
|
label: d(s)("inventory.common.continue"),
|
|
1511
1511
|
disabled: !E.value,
|
|
1512
1512
|
"data-testid": "closing-draft-approve-continue",
|
|
1513
|
-
onClick:
|
|
1513
|
+
onClick: U
|
|
1514
1514
|
}, null, 8, ["label", "disabled"])
|
|
1515
1515
|
])
|
|
1516
1516
|
])) : H("", !0)
|
|
@@ -1524,35 +1524,35 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1524
1524
|
complete: re
|
|
1525
1525
|
}, {
|
|
1526
1526
|
default: ee(() => [
|
|
1527
|
-
a("div",
|
|
1528
|
-
k.value === We ? (p(), A("div",
|
|
1529
|
-
I.value.length > 0 ? (p(), A("div",
|
|
1527
|
+
a("div", pa, R(I.value.length > 0 ? `${d(s)("inventory.closing.approval.step.negativeItems.resolveMessage")} [${d(s)("inventory.closing.approval.step.negativeItems.itemsHeader")} (${P.value.length})]` : d(s)("inventory.closing.approval.step.negativeItems.noItemsMessage")), 1),
|
|
1528
|
+
k.value === We ? (p(), A("div", fa, [
|
|
1529
|
+
I.value.length > 0 ? (p(), A("div", va, [
|
|
1530
1530
|
G[4] || (G[4] = a("div", { class: "fm-typo-en-body-md-600 mb-2" }, null, -1)),
|
|
1531
|
-
a("div",
|
|
1532
|
-
(p(!0), A(le, null, he(I.value, (
|
|
1533
|
-
key:
|
|
1531
|
+
a("div", ga, [
|
|
1532
|
+
(p(!0), A(le, null, he(I.value, (se) => (p(), A("div", {
|
|
1533
|
+
key: se.id,
|
|
1534
1534
|
class: "flex gap-8"
|
|
1535
1535
|
}, [
|
|
1536
|
-
a("div",
|
|
1537
|
-
B.value[
|
|
1536
|
+
a("div", ya, [
|
|
1537
|
+
B.value[se.id] ? (p(), A("span", ba, [
|
|
1538
1538
|
h(ie, {
|
|
1539
1539
|
name: "check_circle",
|
|
1540
1540
|
size: "sm"
|
|
1541
1541
|
})
|
|
1542
|
-
])) : (p(), A("span",
|
|
1542
|
+
])) : (p(), A("span", ha, [
|
|
1543
1543
|
h(ie, {
|
|
1544
1544
|
name: "error",
|
|
1545
1545
|
size: "sm"
|
|
1546
1546
|
})
|
|
1547
1547
|
])),
|
|
1548
|
-
ge(" " + R(
|
|
1548
|
+
ge(" " + R(se.code), 1)
|
|
1549
1549
|
]),
|
|
1550
|
-
a("div",
|
|
1550
|
+
a("div", _a, R(se.name), 1)
|
|
1551
1551
|
]))), 128))
|
|
1552
1552
|
])
|
|
1553
1553
|
])) : H("", !0),
|
|
1554
|
-
a("div",
|
|
1555
|
-
ve.value ? (p(),
|
|
1554
|
+
a("div", ka, [
|
|
1555
|
+
ve.value ? (p(), ae(d(r), {
|
|
1556
1556
|
key: 0,
|
|
1557
1557
|
label: d(s)("inventory.common.back"),
|
|
1558
1558
|
variant: "secondary",
|
|
@@ -1562,7 +1562,7 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1562
1562
|
label: d(s)("inventory.common.continue"),
|
|
1563
1563
|
disabled: L.value,
|
|
1564
1564
|
"data-testid": "closing-draft-approve-continue",
|
|
1565
|
-
onClick:
|
|
1565
|
+
onClick: U
|
|
1566
1566
|
}, null, 8, ["label", "disabled"])
|
|
1567
1567
|
])
|
|
1568
1568
|
])) : H("", !0)
|
|
@@ -1576,9 +1576,9 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1576
1576
|
complete: _
|
|
1577
1577
|
}, {
|
|
1578
1578
|
default: ee(() => [
|
|
1579
|
-
a("div",
|
|
1580
|
-
k.value === Ee ? (p(), A("div",
|
|
1581
|
-
ve.value ? (p(),
|
|
1579
|
+
a("div", wa, R(d(s)("inventory.closing.approval.step.approval.warning")), 1),
|
|
1580
|
+
k.value === Ee ? (p(), A("div", xa, [
|
|
1581
|
+
ve.value ? (p(), ae(d(r), {
|
|
1582
1582
|
key: 0,
|
|
1583
1583
|
label: d(s)("inventory.common.back"),
|
|
1584
1584
|
variant: "secondary",
|
|
@@ -1605,20 +1605,20 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1605
1605
|
}, 8, ["modelValue"]),
|
|
1606
1606
|
h(d(l), {
|
|
1607
1607
|
modelValue: g.value,
|
|
1608
|
-
"onUpdate:modelValue": G[3] || (G[3] = (
|
|
1608
|
+
"onUpdate:modelValue": G[3] || (G[3] = (se) => g.value = se),
|
|
1609
1609
|
"max-width": 480
|
|
1610
1610
|
}, {
|
|
1611
1611
|
"dialog-header": ee(() => [
|
|
1612
|
-
a("div",
|
|
1612
|
+
a("div", Da, R(d(s)("inventory.closing.approval.step.groups.approveAllConfirm.title")), 1)
|
|
1613
1613
|
]),
|
|
1614
1614
|
default: ee(() => [
|
|
1615
|
-
a("div",
|
|
1616
|
-
a("div",
|
|
1617
|
-
a("div",
|
|
1615
|
+
a("div", Aa, [
|
|
1616
|
+
a("div", $a, R(d(s)("inventory.closing.approval.step.groups.approveAllConfirm.warning")), 1),
|
|
1617
|
+
a("div", Ca, [
|
|
1618
1618
|
h(d(r), {
|
|
1619
1619
|
label: d(s)("inventory.common.cancel"),
|
|
1620
1620
|
variant: "secondary",
|
|
1621
|
-
onClick: G[2] || (G[2] = (
|
|
1621
|
+
onClick: G[2] || (G[2] = (se) => g.value = !1)
|
|
1622
1622
|
}, null, 8, ["label"]),
|
|
1623
1623
|
h(d(r), {
|
|
1624
1624
|
label: d(s)("inventory.closing.approval.step.groups.approveAllConfirm.confirm"),
|
|
@@ -1635,8 +1635,8 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
|
|
|
1635
1635
|
};
|
|
1636
1636
|
}
|
|
1637
1637
|
});
|
|
1638
|
-
function
|
|
1639
|
-
const o = Oe(), e =
|
|
1638
|
+
function Fa(t) {
|
|
1639
|
+
const o = Oe(), e = Cn(), n = Ue(), { t: l } = et(), r = q(!1), s = q(null);
|
|
1640
1640
|
let u = !1, c = null, b = !1, g = !1;
|
|
1641
1641
|
function S() {
|
|
1642
1642
|
P();
|
|
@@ -1743,7 +1743,7 @@ function Ia(t) {
|
|
|
1743
1743
|
([z, F], [T, k]) => {
|
|
1744
1744
|
g && (z === T && F === k || S());
|
|
1745
1745
|
}
|
|
1746
|
-
),
|
|
1746
|
+
), Jo(() => {
|
|
1747
1747
|
X();
|
|
1748
1748
|
}), {
|
|
1749
1749
|
refreshing: r,
|
|
@@ -1753,18 +1753,18 @@ function Ia(t) {
|
|
|
1753
1753
|
cleanup: X
|
|
1754
1754
|
};
|
|
1755
1755
|
}
|
|
1756
|
-
function
|
|
1757
|
-
const o =
|
|
1758
|
-
return o === "REJECTED" ? { label: "Rejected", className:
|
|
1756
|
+
function Ia(t) {
|
|
1757
|
+
const o = Pt(t);
|
|
1758
|
+
return o === "REJECTED" ? { label: "Rejected", className: Me("FAILED") } : o === "UPDATED" ? { label: "Updated", className: Me("PROCESSING") } : { label: Ie(o), className: Me(o) };
|
|
1759
1759
|
}
|
|
1760
|
-
const
|
|
1760
|
+
const Ba = { class: "flex items-start justify-between gap-8" }, Ta = { class: "flex items-center gap-8 min-w-0" }, ja = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary truncate" }, Ra = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary" }, Na = { class: "fm-typo-en-body-md-600" }, Ma = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, Ua = /* @__PURE__ */ De({
|
|
1761
1761
|
__name: "ClosingGroupCard",
|
|
1762
1762
|
props: {
|
|
1763
1763
|
group: {}
|
|
1764
1764
|
},
|
|
1765
1765
|
emits: ["select"],
|
|
1766
1766
|
setup(t, { emit: o }) {
|
|
1767
|
-
const e = t, n = o, l = C(() =>
|
|
1767
|
+
const e = t, n = o, l = C(() => Ia(e.group)), r = C(
|
|
1768
1768
|
() => `RM ${e.group.totalAmount.toLocaleString("en-MY", {
|
|
1769
1769
|
minimumFractionDigits: 2,
|
|
1770
1770
|
maximumFractionDigits: 2
|
|
@@ -1775,36 +1775,36 @@ const Ta = { class: "flex items-start justify-between gap-8" }, ja = { class: "f
|
|
|
1775
1775
|
});
|
|
1776
1776
|
return (u, c) => (p(), A("div", {
|
|
1777
1777
|
class: "flex flex-col gap-8 rounded-lg border border-fm-color-neutral-gray-200 bg-white p-16 cursor-pointer hover:border-fm-color-primary",
|
|
1778
|
-
onClick: c[0] || (c[0] =
|
|
1778
|
+
onClick: c[0] || (c[0] = Zo((b) => n("select", u.group.id), ["stop"]))
|
|
1779
1779
|
}, [
|
|
1780
|
-
a("div",
|
|
1781
|
-
a("div",
|
|
1780
|
+
a("div", Ba, [
|
|
1781
|
+
a("div", Ta, [
|
|
1782
1782
|
u.group.color ? (p(), A("span", {
|
|
1783
1783
|
key: 0,
|
|
1784
1784
|
class: "w-8 h-8 rounded-full shrink-0",
|
|
1785
|
-
style:
|
|
1785
|
+
style: gt({ backgroundColor: u.group.color })
|
|
1786
1786
|
}, null, 4)) : H("", !0),
|
|
1787
|
-
a("span",
|
|
1787
|
+
a("span", ja, R(u.group.name), 1)
|
|
1788
1788
|
]),
|
|
1789
1789
|
a("div", {
|
|
1790
|
-
class:
|
|
1790
|
+
class: we(["fm-status-badge shrink-0", l.value.className])
|
|
1791
1791
|
}, R(l.value.label), 3)
|
|
1792
1792
|
]),
|
|
1793
|
-
a("div",
|
|
1794
|
-
a("span",
|
|
1793
|
+
a("div", Ra, [
|
|
1794
|
+
a("span", Na, R(u.group.itemCount), 1),
|
|
1795
1795
|
ge(" items · " + R(r.value), 1)
|
|
1796
1796
|
]),
|
|
1797
1797
|
c[1] || (c[1] = a("div", { class: "border-t border-dashed border-fm-color-neutral-gray-200" }, null, -1)),
|
|
1798
|
-
a("div",
|
|
1798
|
+
a("div", Ma, R(s.value), 1)
|
|
1799
1799
|
]));
|
|
1800
1800
|
}
|
|
1801
|
-
}),
|
|
1801
|
+
}), Pa = {
|
|
1802
1802
|
key: 0,
|
|
1803
1803
|
class: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-16"
|
|
1804
|
-
},
|
|
1804
|
+
}, Va = {
|
|
1805
1805
|
key: 1,
|
|
1806
1806
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1807
|
-
},
|
|
1807
|
+
}, Ea = /* @__PURE__ */ De({
|
|
1808
1808
|
__name: "ClosingGroupGrid",
|
|
1809
1809
|
props: {
|
|
1810
1810
|
groups: {}
|
|
@@ -1812,17 +1812,17 @@ const Ta = { class: "flex items-start justify-between gap-8" }, ja = { class: "f
|
|
|
1812
1812
|
emits: ["select"],
|
|
1813
1813
|
setup(t, { emit: o }) {
|
|
1814
1814
|
const e = o;
|
|
1815
|
-
return (n, l) => n.groups.length ? (p(), A("div",
|
|
1816
|
-
(p(!0), A(le, null, he(n.groups, (r) => (p(),
|
|
1815
|
+
return (n, l) => n.groups.length ? (p(), A("div", Pa, [
|
|
1816
|
+
(p(!0), A(le, null, he(n.groups, (r) => (p(), ae(Ua, {
|
|
1817
1817
|
key: r.id,
|
|
1818
1818
|
group: r,
|
|
1819
1819
|
onSelect: l[0] || (l[0] = (s) => e("select", s))
|
|
1820
1820
|
}, null, 8, ["group"]))), 128))
|
|
1821
|
-
])) : (p(), A("div",
|
|
1821
|
+
])) : (p(), A("div", Va, "No closing groups"));
|
|
1822
1822
|
}
|
|
1823
1823
|
});
|
|
1824
|
-
function
|
|
1825
|
-
const e = t.sku, n = [], l = Number(
|
|
1824
|
+
function xo(t, o) {
|
|
1825
|
+
const e = t.sku, n = [], l = Number(ne.toFormatString({ value: t.baseAmount }));
|
|
1826
1826
|
l && n.push({
|
|
1827
1827
|
label: "Base",
|
|
1828
1828
|
amount: l,
|
|
@@ -1835,11 +1835,11 @@ function Do(t, o) {
|
|
|
1835
1835
|
const r = new Map(
|
|
1836
1836
|
t.measurementsAmounts.map((c) => [c.measurement.id, c.amount])
|
|
1837
1837
|
), s = new Set(e.unit.measurements.map((c) => c.id)), u = (c, b, g, S, J) => {
|
|
1838
|
-
const E = Number(
|
|
1838
|
+
const E = Number(ne.toFormatString({ value: g }));
|
|
1839
1839
|
if (!E) return;
|
|
1840
|
-
const B =
|
|
1841
|
-
|
|
1842
|
-
value:
|
|
1840
|
+
const B = ne.toFormatString({ value: b }), I = Number(
|
|
1841
|
+
ne.toFormatString({
|
|
1842
|
+
value: ht(g, b)
|
|
1843
1843
|
})
|
|
1844
1844
|
);
|
|
1845
1845
|
n.push({
|
|
@@ -1854,20 +1854,20 @@ function Do(t, o) {
|
|
|
1854
1854
|
};
|
|
1855
1855
|
for (const c of e.unit.measurements) {
|
|
1856
1856
|
const b = r.get(c.id);
|
|
1857
|
-
b && u(c.abbrev, c.conversion, b,
|
|
1857
|
+
b && u(c.abbrev, c.conversion, b, Mt(c, o), !1);
|
|
1858
1858
|
}
|
|
1859
1859
|
for (const c of t.measurementsAmounts)
|
|
1860
1860
|
s.has(c.measurement.id) || u(c.measurement.abbrev, c.measurement.conversion, c.amount, !1, !0);
|
|
1861
1861
|
return n;
|
|
1862
1862
|
}
|
|
1863
|
-
const
|
|
1864
|
-
function
|
|
1863
|
+
const ft = (t) => me(t, { minPrecision: 0, maxPrecision: 3 });
|
|
1864
|
+
function La(t, o) {
|
|
1865
1865
|
return o ? "text-fm-color-system-error-300" : t ? "text-purple-500" : "";
|
|
1866
1866
|
}
|
|
1867
|
-
function
|
|
1867
|
+
function Oa(t, o) {
|
|
1868
1868
|
return o ? D(be.FmIcon, { name: "warning", size: "sm", color: "system-error-300" }) : t ? D(be.FmIcon, { name: "rule", size: "sm" }) : null;
|
|
1869
1869
|
}
|
|
1870
|
-
function
|
|
1870
|
+
function Do(t, o, e) {
|
|
1871
1871
|
return D(
|
|
1872
1872
|
"div",
|
|
1873
1873
|
{
|
|
@@ -1879,29 +1879,29 @@ function Ao(t, o, e) {
|
|
|
1879
1879
|
(n) => D("div", { class: "flex justify-between gap-12" }, [
|
|
1880
1880
|
D(
|
|
1881
1881
|
"div",
|
|
1882
|
-
{ class: ["flex items-center gap-4",
|
|
1883
|
-
[
|
|
1882
|
+
{ class: ["flex items-center gap-4", La(n.inactive, n.orphan)] },
|
|
1883
|
+
[Oa(n.inactive, n.orphan), D("span", n.label)]
|
|
1884
1884
|
),
|
|
1885
1885
|
D(
|
|
1886
1886
|
"div",
|
|
1887
1887
|
{ class: n.counted ? "" : "line-through text-fm-color-typo-tertiary" },
|
|
1888
|
-
n.orphan ? `${
|
|
1888
|
+
n.orphan ? `${ft(n.amount)} ${n.abbrev} (no valid conversion)` : n.counted ? `${ft(n.subtotal)} ${e}` : `${ft(n.subtotal)} ${e} (ignored)`
|
|
1889
1889
|
)
|
|
1890
1890
|
])
|
|
1891
1891
|
),
|
|
1892
1892
|
D("hr", { class: "border-fm-color-typo-secondary my-4" }),
|
|
1893
1893
|
D("div", { class: "flex justify-between fm-typo-en-body-lg-600" }, [
|
|
1894
1894
|
D("span", "Total"),
|
|
1895
|
-
D("span", `${
|
|
1895
|
+
D("span", `${ft(o)} ${e}`)
|
|
1896
1896
|
])
|
|
1897
1897
|
]
|
|
1898
1898
|
);
|
|
1899
1899
|
}
|
|
1900
|
-
function
|
|
1901
|
-
const e = t.sku, n = Number(
|
|
1900
|
+
function Vt(t, o) {
|
|
1901
|
+
const e = t.sku, n = Number(ne.toFormatString({ value: t.baseAmount })), l = new Map(
|
|
1902
1902
|
t.measurementsAmounts.map((c) => [c.measurement.id, c.amount])
|
|
1903
1903
|
), r = new Set(e.unit.measurements.map((c) => c.id)), s = [], u = (c, b, g, S, J) => {
|
|
1904
|
-
const E = Number(
|
|
1904
|
+
const E = Number(ne.toFormatString({ value: g })), B = ne.toFormatString({ value: b });
|
|
1905
1905
|
s.push({
|
|
1906
1906
|
abbrev: `(${c}) × ${B}`,
|
|
1907
1907
|
amount: E,
|
|
@@ -1910,14 +1910,14 @@ function Et(t, o) {
|
|
|
1910
1910
|
};
|
|
1911
1911
|
for (const c of e.unit.measurements) {
|
|
1912
1912
|
const b = l.get(c.id);
|
|
1913
|
-
b && u(c.abbrev, c.conversion, b,
|
|
1913
|
+
b && u(c.abbrev, c.conversion, b, Mt(c, o), !1);
|
|
1914
1914
|
}
|
|
1915
1915
|
for (const c of t.measurementsAmounts)
|
|
1916
1916
|
r.has(c.measurement.id) || u(c.measurement.abbrev, c.measurement.conversion, c.amount, !1, !0);
|
|
1917
1917
|
return { baseUnitAmount: n, measurements: s };
|
|
1918
1918
|
}
|
|
1919
|
-
function
|
|
1920
|
-
const n = t.sku, { baseUnitAmount: l, measurements: r } =
|
|
1919
|
+
function co(t, o, e) {
|
|
1920
|
+
const n = t.sku, { baseUnitAmount: l, measurements: r } = Vt(t, e);
|
|
1921
1921
|
return {
|
|
1922
1922
|
id: n._id,
|
|
1923
1923
|
code: n.code,
|
|
@@ -1926,18 +1926,18 @@ function uo(t, o, e) {
|
|
|
1926
1926
|
baseUnitAmount: l,
|
|
1927
1927
|
isTemplateItem: o,
|
|
1928
1928
|
measurements: r,
|
|
1929
|
-
physicalBalance: Number(
|
|
1930
|
-
breakdown:
|
|
1929
|
+
physicalBalance: Number(ne.toFormatString({ value: kt(t) })),
|
|
1930
|
+
breakdown: xo(t, e)
|
|
1931
1931
|
};
|
|
1932
1932
|
}
|
|
1933
|
-
function
|
|
1933
|
+
function Ga(t, o) {
|
|
1934
1934
|
const e = [
|
|
1935
|
-
...t.items.map((n) =>
|
|
1936
|
-
...(t.negativeStockItems ?? []).map((n) =>
|
|
1935
|
+
...t.items.map((n) => co(n, !0, o)),
|
|
1936
|
+
...(t.negativeStockItems ?? []).map((n) => co(n, !1, o))
|
|
1937
1937
|
];
|
|
1938
1938
|
return e.sort((n, l) => n.code.localeCompare(l.code)), e;
|
|
1939
1939
|
}
|
|
1940
|
-
function
|
|
1940
|
+
function Et(t, o, e) {
|
|
1941
1941
|
const n = (s, u, c = "normal") => D(
|
|
1942
1942
|
be.FmTooltip,
|
|
1943
1943
|
{ zIndex: 50 },
|
|
@@ -1972,17 +1972,17 @@ function Lt(t, o, e) {
|
|
|
1972
1972
|
r
|
|
1973
1973
|
);
|
|
1974
1974
|
}
|
|
1975
|
-
function
|
|
1975
|
+
function za(t, o, e) {
|
|
1976
1976
|
const n = [];
|
|
1977
1977
|
for (const l of o) {
|
|
1978
1978
|
const r = l.items.find((b) => b.sku._id === t);
|
|
1979
1979
|
if (!r) continue;
|
|
1980
|
-
const { baseUnitAmount: s, measurements: u } =
|
|
1980
|
+
const { baseUnitAmount: s, measurements: u } = Vt(r, e);
|
|
1981
1981
|
(s !== 0 || u.some((b) => b.amount !== 0)) && n.push({ label: l.label, isSub: l.isSub, baseUnitAmount: s, measurements: u });
|
|
1982
1982
|
}
|
|
1983
1983
|
return n;
|
|
1984
1984
|
}
|
|
1985
|
-
function
|
|
1985
|
+
function Ha(t, o) {
|
|
1986
1986
|
return D(
|
|
1987
1987
|
"div",
|
|
1988
1988
|
{ class: "flex flex-col gap-8" },
|
|
@@ -1993,13 +1993,13 @@ function Ya(t, o) {
|
|
|
1993
1993
|
{ class: "fm-typo-en-body-sm-600 text-fm-color-typo-tertiary uppercase" },
|
|
1994
1994
|
e.label
|
|
1995
1995
|
),
|
|
1996
|
-
|
|
1996
|
+
Et(e.baseUnitAmount, o, e.measurements)
|
|
1997
1997
|
])
|
|
1998
1998
|
)
|
|
1999
1999
|
);
|
|
2000
2000
|
}
|
|
2001
|
-
const
|
|
2002
|
-
function
|
|
2001
|
+
const Ya = "N/A";
|
|
2002
|
+
function Ao(t, o) {
|
|
2003
2003
|
var n, l;
|
|
2004
2004
|
const e = t.approvedAt ? {
|
|
2005
2005
|
action: `Approve at ${Fe(t.approvedAt)}`,
|
|
@@ -2014,7 +2014,7 @@ function $o(t, o) {
|
|
|
2014
2014
|
o.idDisplay ? { label: "ID", value: o.idDisplay } : null,
|
|
2015
2015
|
{
|
|
2016
2016
|
label: "Location",
|
|
2017
|
-
value: o.locationName ??
|
|
2017
|
+
value: o.locationName ?? Ya
|
|
2018
2018
|
},
|
|
2019
2019
|
{
|
|
2020
2020
|
label: "Created at",
|
|
@@ -2046,7 +2046,7 @@ function $o(t, o) {
|
|
|
2046
2046
|
e && e.remark ? { label: "Action remark", value: e.remark } : null
|
|
2047
2047
|
].filter((r) => !!r);
|
|
2048
2048
|
}
|
|
2049
|
-
const
|
|
2049
|
+
const Wa = { class: "fm-typo-en-body-lg-400" }, Ka = { class: "fm-typo-en-body-lg-600" }, qa = { class: "flex gap-12 py-8 justify-end w-full" }, Qa = /* @__PURE__ */ De({
|
|
2050
2050
|
__name: "ClosingGroupAction",
|
|
2051
2051
|
props: {
|
|
2052
2052
|
group: {},
|
|
@@ -2055,7 +2055,7 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2055
2055
|
onFinished: { type: Function }
|
|
2056
2056
|
},
|
|
2057
2057
|
setup(t) {
|
|
2058
|
-
const o = t, e = Oe(), n =
|
|
2058
|
+
const o = t, e = Oe(), n = Ue(), l = q(), r = q(!1), s = C(
|
|
2059
2059
|
() => ({ approve: "Approve", reject: "Reject", submit: "Submit for approval" })[o.action]
|
|
2060
2060
|
), u = C(
|
|
2061
2061
|
() => ({ approve: "Approve", reject: "Reject", submit: "Submit" })[o.action]
|
|
@@ -2076,15 +2076,15 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2076
2076
|
}
|
|
2077
2077
|
return (g, S) => {
|
|
2078
2078
|
const J = te("FmTextField"), E = te("FmButton"), B = te("FmForm");
|
|
2079
|
-
return p(),
|
|
2079
|
+
return p(), ae(B, {
|
|
2080
2080
|
onValidationSuccess: b,
|
|
2081
2081
|
class: "flex flex-col gap-32",
|
|
2082
2082
|
disabled: r.value
|
|
2083
2083
|
}, {
|
|
2084
2084
|
default: ee(() => [
|
|
2085
|
-
a("div",
|
|
2085
|
+
a("div", Wa, [
|
|
2086
2086
|
S[2] || (S[2] = ge(" You are about to ")),
|
|
2087
|
-
a("span",
|
|
2087
|
+
a("span", Ka, R(u.value), 1),
|
|
2088
2088
|
S[3] || (S[3] = ge(" this group. Please provide a remark to justify this action. "))
|
|
2089
2089
|
]),
|
|
2090
2090
|
h(J, {
|
|
@@ -2092,9 +2092,9 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2092
2092
|
"onUpdate:modelValue": S[0] || (S[0] = (I) => l.value = I),
|
|
2093
2093
|
label: "Remark",
|
|
2094
2094
|
"label-mark": "required",
|
|
2095
|
-
rules: [d(
|
|
2095
|
+
rules: [d(yo)()]
|
|
2096
2096
|
}, null, 8, ["modelValue", "rules"]),
|
|
2097
|
-
a("div",
|
|
2097
|
+
a("div", qa, [
|
|
2098
2098
|
h(E, {
|
|
2099
2099
|
label: "Cancel",
|
|
2100
2100
|
variant: "tertiary",
|
|
@@ -2112,31 +2112,31 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2112
2112
|
}, 8, ["disabled"]);
|
|
2113
2113
|
};
|
|
2114
2114
|
}
|
|
2115
|
-
}),
|
|
2115
|
+
}), Ja = { class: "w-full flex flex-col gap-32" }, Za = { class: "fm-typo-en-title-md-600" }, Xa = { class: "text-fm-color-typo-secondary" }, es = { class: "text-fm-color-primary" }, ts = { class: "flex justify-between" }, os = { class: "flex" }, ns = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, as = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ss = { class: "flex gap-1" }, rs = {
|
|
2116
2116
|
class: "fm-typo-en-body-lg-600",
|
|
2117
2117
|
style: { "white-space": "pre-wrap", "word-break": "break-word" }
|
|
2118
|
-
},
|
|
2118
|
+
}, ls = { class: "fm-typo-en-body-lg-600" }, is = { class: "flex gap-8" }, cs = { class: "overflow-x-auto" }, us = {
|
|
2119
2119
|
key: 1,
|
|
2120
2120
|
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
2121
|
-
},
|
|
2121
|
+
}, ds = {
|
|
2122
2122
|
key: 0,
|
|
2123
2123
|
class: "flex flex-col items-center gap-8 h-full"
|
|
2124
|
-
},
|
|
2124
|
+
}, ms = ["src"], ps = {
|
|
2125
2125
|
key: 1,
|
|
2126
2126
|
class: "px-4 flex flex-col"
|
|
2127
|
-
},
|
|
2127
|
+
}, fs = { class: "flex gap-12 content-stretch" }, vs = {
|
|
2128
2128
|
class: "flex flex-col w-24",
|
|
2129
2129
|
name: "circles"
|
|
2130
|
-
},
|
|
2130
|
+
}, gs = { class: "flex-1 flex flex-col items-center" }, ys = { class: "flex-1 flex flex-col items-center" }, bs = {
|
|
2131
2131
|
class: "py-12 flex flex-col gap-4",
|
|
2132
2132
|
name: "received-at header"
|
|
2133
|
-
},
|
|
2133
|
+
}, hs = { class: "fm-typo-en-body-lg-400" }, _s = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ks = { class: "flex gap-12 content-stretch" }, ws = {
|
|
2134
2134
|
class: "flex flex-col w-24",
|
|
2135
2135
|
name: "circles"
|
|
2136
|
-
},
|
|
2136
|
+
}, xs = { class: "flex-1 flex flex-col items-center" }, Ds = {
|
|
2137
2137
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
2138
2138
|
name: "delivery details"
|
|
2139
|
-
},
|
|
2139
|
+
}, As = { class: "flex flex-col gap-8" }, $s = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Cs = { class: "flex flex-col gap-4" }, Ss = { class: "flex items-center gap-8 w-full" }, Fs = /* @__PURE__ */ De({
|
|
2140
2140
|
__name: "ClosingGroupDetailSideSheet",
|
|
2141
2141
|
props: {
|
|
2142
2142
|
show: { type: Boolean },
|
|
@@ -2145,7 +2145,7 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2145
2145
|
},
|
|
2146
2146
|
emits: ["update:show", "updated"],
|
|
2147
2147
|
setup(t, { emit: o }) {
|
|
2148
|
-
const e = t, n = o, l =
|
|
2148
|
+
const e = t, n = o, l = Rt(e, "show"), r = Ut(), s = qe(), u = po(), c = C(() => {
|
|
2149
2149
|
var x, w, re;
|
|
2150
2150
|
return ((re = (w = (x = e.group) == null ? void 0 : x.usingTemplates) == null ? void 0 : w.find((_) => _)) == null ? void 0 : re.name) ?? "Group";
|
|
2151
2151
|
}), b = C(() => {
|
|
@@ -2160,7 +2160,7 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2160
2160
|
function S(x) {
|
|
2161
2161
|
e.group && u.open({
|
|
2162
2162
|
title: { approve: "Approve group", reject: "Reject group", submit: "Submit group for approval" }[x],
|
|
2163
|
-
contentComponent:
|
|
2163
|
+
contentComponent: Qa,
|
|
2164
2164
|
contentComponentProps: {
|
|
2165
2165
|
group: e.group,
|
|
2166
2166
|
action: x,
|
|
@@ -2173,7 +2173,7 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2173
2173
|
}
|
|
2174
2174
|
const J = C(() => {
|
|
2175
2175
|
var x;
|
|
2176
|
-
return e.group ?
|
|
2176
|
+
return e.group ? Ao(e.group, {
|
|
2177
2177
|
locationName: (x = s._currentLocation) == null ? void 0 : x.name
|
|
2178
2178
|
}) : [];
|
|
2179
2179
|
}), E = [
|
|
@@ -2190,7 +2190,7 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2190
2190
|
}
|
|
2191
2191
|
);
|
|
2192
2192
|
const z = C(
|
|
2193
|
-
() => e.group ?
|
|
2193
|
+
() => e.group ? Ga(e.group, r.value) : []
|
|
2194
2194
|
), F = C(
|
|
2195
2195
|
() => z.value.filter((x) => !!(x.isTemplateItem && P.value.templateItem || !x.isTemplateItem && P.value.nonTemplateItem))
|
|
2196
2196
|
), T = C(() => [
|
|
@@ -2256,7 +2256,7 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2256
2256
|
},
|
|
2257
2257
|
[re, D(be.FmIcon, { name: "info", size: "sm", outline: !0 })]
|
|
2258
2258
|
),
|
|
2259
|
-
default: () =>
|
|
2259
|
+
default: () => Do(w.breakdown, w.physicalBalance, w.baseUnit)
|
|
2260
2260
|
}
|
|
2261
2261
|
) : re;
|
|
2262
2262
|
},
|
|
@@ -2268,7 +2268,7 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2268
2268
|
enableSorting: !1,
|
|
2269
2269
|
cell(x) {
|
|
2270
2270
|
const w = x.row.original;
|
|
2271
|
-
return
|
|
2271
|
+
return Et(w.baseUnitAmount, w.baseUnit, w.measurements);
|
|
2272
2272
|
}
|
|
2273
2273
|
}
|
|
2274
2274
|
]), k = C(() => {
|
|
@@ -2301,34 +2301,34 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2301
2301
|
}));
|
|
2302
2302
|
});
|
|
2303
2303
|
return (x, w) => {
|
|
2304
|
-
const re = te("FmButtonGroup"), _ = te("FmMenuDivider"), $ = te("FmCard"), L = te("FmChip"),
|
|
2305
|
-
return p(),
|
|
2304
|
+
const re = te("FmButtonGroup"), _ = te("FmMenuDivider"), $ = te("FmCard"), L = te("FmChip"), N = te("FmTextField"), ve = te("FmTable"), oe = te("FmSpacer"), M = te("FmButton"), f = te("FmSideSheet");
|
|
2305
|
+
return p(), ae(f, {
|
|
2306
2306
|
"dismiss-away": "",
|
|
2307
2307
|
"max-width": 9999,
|
|
2308
2308
|
"model-value": d(l),
|
|
2309
|
-
"onUpdate:modelValue": w[8] || (w[8] = (y) =>
|
|
2309
|
+
"onUpdate:modelValue": w[8] || (w[8] = (y) => bt(l) ? l.value = y : null),
|
|
2310
2310
|
header: "Group details"
|
|
2311
2311
|
}, {
|
|
2312
2312
|
"side-sheet-footer": ee(() => [
|
|
2313
|
-
a("div",
|
|
2314
|
-
b.value ? (p(),
|
|
2313
|
+
a("div", Ss, [
|
|
2314
|
+
b.value ? (p(), ae(M, {
|
|
2315
2315
|
key: 0,
|
|
2316
2316
|
label: "Submit for approval",
|
|
2317
2317
|
variant: "secondary",
|
|
2318
2318
|
onClick: w[4] || (w[4] = (y) => S("submit"))
|
|
2319
2319
|
})) : H("", !0),
|
|
2320
|
-
g.value ? (p(),
|
|
2320
|
+
g.value ? (p(), ae(M, {
|
|
2321
2321
|
key: 1,
|
|
2322
2322
|
label: "Approve",
|
|
2323
2323
|
onClick: w[5] || (w[5] = (y) => S("approve"))
|
|
2324
2324
|
})) : H("", !0),
|
|
2325
|
-
g.value ? (p(),
|
|
2325
|
+
g.value ? (p(), ae(M, {
|
|
2326
2326
|
key: 2,
|
|
2327
2327
|
label: "Reject",
|
|
2328
2328
|
variant: "destructive",
|
|
2329
2329
|
onClick: w[6] || (w[6] = (y) => S("reject"))
|
|
2330
2330
|
})) : H("", !0),
|
|
2331
|
-
h(
|
|
2331
|
+
h(M, {
|
|
2332
2332
|
label: "Close",
|
|
2333
2333
|
variant: "tertiary",
|
|
2334
2334
|
onClick: w[7] || (w[7] = (y) => l.value = !1)
|
|
@@ -2336,14 +2336,14 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2336
2336
|
])
|
|
2337
2337
|
]),
|
|
2338
2338
|
default: ee(() => [
|
|
2339
|
-
a("div",
|
|
2340
|
-
a("div",
|
|
2339
|
+
a("div", Ja, [
|
|
2340
|
+
a("div", Za, [
|
|
2341
2341
|
x.parentName ? (p(), A(le, { key: 0 }, [
|
|
2342
|
-
a("span",
|
|
2342
|
+
a("span", Xa, R(x.parentName), 1),
|
|
2343
2343
|
w[9] || (w[9] = ge(" · "))
|
|
2344
2344
|
], 64)) : H("", !0),
|
|
2345
2345
|
w[10] || (w[10] = ge(" Group · ")),
|
|
2346
|
-
a("span",
|
|
2346
|
+
a("span", es, R(c.value), 1)
|
|
2347
2347
|
]),
|
|
2348
2348
|
a("div", null, [
|
|
2349
2349
|
h(re, {
|
|
@@ -2358,26 +2358,26 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2358
2358
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
2359
2359
|
}, {
|
|
2360
2360
|
default: ee(() => {
|
|
2361
|
-
var y,
|
|
2361
|
+
var y, U;
|
|
2362
2362
|
return [
|
|
2363
|
-
a("div",
|
|
2363
|
+
a("div", ts, [
|
|
2364
2364
|
w[11] || (w[11] = a("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
|
|
2365
|
-
a("div",
|
|
2365
|
+
a("div", os, [
|
|
2366
2366
|
a("div", {
|
|
2367
|
-
class:
|
|
2368
|
-
}, R(d(Ie)(((
|
|
2367
|
+
class: we(["fm-status-badge", d(Me)(((y = x.group) == null ? void 0 : y.status) ?? "DRAFT")])
|
|
2368
|
+
}, R(d(Ie)(((U = x.group) == null ? void 0 : U.status) ?? "")), 3)
|
|
2369
2369
|
])
|
|
2370
2370
|
]),
|
|
2371
2371
|
h(_),
|
|
2372
|
-
a("div",
|
|
2372
|
+
a("div", ns, [
|
|
2373
2373
|
(p(!0), A(le, null, he(J.value, (Y, de) => (p(), A("div", {
|
|
2374
2374
|
class: "flex flex-col gap-4",
|
|
2375
2375
|
key: de
|
|
2376
2376
|
}, [
|
|
2377
|
-
a("div",
|
|
2378
|
-
a("div",
|
|
2377
|
+
a("div", as, [
|
|
2378
|
+
a("div", ss, R(Y.label), 1)
|
|
2379
2379
|
]),
|
|
2380
|
-
a("div",
|
|
2380
|
+
a("div", rs, R(Y.value), 1)
|
|
2381
2381
|
]))), 128))
|
|
2382
2382
|
])
|
|
2383
2383
|
];
|
|
@@ -2389,8 +2389,8 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2389
2389
|
class: "flex flex-col gap-16 px-12 py-16"
|
|
2390
2390
|
}, {
|
|
2391
2391
|
default: ee(() => [
|
|
2392
|
-
a("div",
|
|
2393
|
-
a("div",
|
|
2392
|
+
a("div", ls, R(c.value) + " items", 1),
|
|
2393
|
+
a("div", is, [
|
|
2394
2394
|
h(L, {
|
|
2395
2395
|
label: "Template Item(s)",
|
|
2396
2396
|
selected: P.value.templateItem,
|
|
@@ -2402,12 +2402,12 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2402
2402
|
onClick: w[2] || (w[2] = (y) => P.value.nonTemplateItem = !P.value.nonTemplateItem)
|
|
2403
2403
|
}, null, 8, ["selected"])
|
|
2404
2404
|
]),
|
|
2405
|
-
h(
|
|
2405
|
+
h(N, {
|
|
2406
2406
|
modelValue: I.value,
|
|
2407
2407
|
"onUpdate:modelValue": w[3] || (w[3] = (y) => I.value = y),
|
|
2408
2408
|
placeholder: "Filter items"
|
|
2409
2409
|
}, null, 8, ["modelValue"]),
|
|
2410
|
-
a("div",
|
|
2410
|
+
a("div", cs, [
|
|
2411
2411
|
h(ve, {
|
|
2412
2412
|
"column-defs": T.value,
|
|
2413
2413
|
"row-data": F.value,
|
|
@@ -2419,64 +2419,64 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2419
2419
|
_: 1
|
|
2420
2420
|
})
|
|
2421
2421
|
], 64)) : H("", !0),
|
|
2422
|
-
B.value.value === "history" ? (p(), A("div",
|
|
2423
|
-
k.value.length ? (p(), A("div",
|
|
2424
|
-
(p(!0), A(le, null, he(k.value, (y,
|
|
2425
|
-
a("div",
|
|
2426
|
-
a("div",
|
|
2427
|
-
a("div",
|
|
2422
|
+
B.value.value === "history" ? (p(), A("div", us, [
|
|
2423
|
+
k.value.length ? (p(), A("div", ps, [
|
|
2424
|
+
(p(!0), A(le, null, he(k.value, (y, U) => (p(), A(le, { key: U }, [
|
|
2425
|
+
a("div", fs, [
|
|
2426
|
+
a("div", vs, [
|
|
2427
|
+
a("div", gs, [
|
|
2428
2428
|
a("div", {
|
|
2429
|
-
class:
|
|
2430
|
-
{ "bg-fm-color-primary":
|
|
2429
|
+
class: we([
|
|
2430
|
+
{ "bg-fm-color-primary": U !== 0, "bg-white": U === 0 },
|
|
2431
2431
|
"w-[2px] h-full"
|
|
2432
2432
|
])
|
|
2433
2433
|
}, null, 2)
|
|
2434
2434
|
]),
|
|
2435
2435
|
w[14] || (w[14] = a("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
2436
|
-
a("div",
|
|
2436
|
+
a("div", ys, [
|
|
2437
2437
|
a("div", {
|
|
2438
|
-
class:
|
|
2438
|
+
class: we([
|
|
2439
2439
|
{
|
|
2440
|
-
"bg-fm-color-primary":
|
|
2441
|
-
"bg-white":
|
|
2440
|
+
"bg-fm-color-primary": U < k.value.length - 1,
|
|
2441
|
+
"bg-white": U >= k.value.length - 1
|
|
2442
2442
|
},
|
|
2443
2443
|
"w-[2px] h-full"
|
|
2444
2444
|
])
|
|
2445
2445
|
}, null, 2)
|
|
2446
2446
|
])
|
|
2447
2447
|
]),
|
|
2448
|
-
a("div",
|
|
2449
|
-
a("div",
|
|
2450
|
-
a("div",
|
|
2448
|
+
a("div", bs, [
|
|
2449
|
+
a("div", hs, R(y.header), 1),
|
|
2450
|
+
a("div", _s, R(y.date), 1)
|
|
2451
2451
|
])
|
|
2452
2452
|
]),
|
|
2453
|
-
a("div",
|
|
2454
|
-
a("div",
|
|
2455
|
-
a("div",
|
|
2453
|
+
a("div", ks, [
|
|
2454
|
+
a("div", ws, [
|
|
2455
|
+
a("div", xs, [
|
|
2456
2456
|
a("div", {
|
|
2457
|
-
class:
|
|
2457
|
+
class: we([
|
|
2458
2458
|
{
|
|
2459
|
-
"bg-fm-color-primary":
|
|
2460
|
-
"bg-white":
|
|
2459
|
+
"bg-fm-color-primary": U < k.value.length - 1,
|
|
2460
|
+
"bg-white": U >= k.value.length - 1
|
|
2461
2461
|
},
|
|
2462
2462
|
"w-[2px] h-full"
|
|
2463
2463
|
])
|
|
2464
2464
|
}, null, 2)
|
|
2465
2465
|
])
|
|
2466
2466
|
]),
|
|
2467
|
-
a("div",
|
|
2467
|
+
a("div", Ds, [
|
|
2468
2468
|
h($, {
|
|
2469
2469
|
variant: "outlined",
|
|
2470
2470
|
class: "py-12 px-16"
|
|
2471
2471
|
}, {
|
|
2472
2472
|
default: ee(() => [
|
|
2473
|
-
a("div",
|
|
2473
|
+
a("div", As, [
|
|
2474
2474
|
(p(!0), A(le, null, he(y.info, (Y, de) => (p(), A("div", {
|
|
2475
2475
|
key: de,
|
|
2476
2476
|
class: "flex flex-col gap-4"
|
|
2477
2477
|
}, [
|
|
2478
|
-
a("div",
|
|
2479
|
-
a("div",
|
|
2478
|
+
a("div", $s, R(Y.label), 1),
|
|
2479
|
+
a("div", Cs, [
|
|
2480
2480
|
(p(!0), A(le, null, he(Y.values, (j, G) => (p(), A("div", {
|
|
2481
2481
|
key: G,
|
|
2482
2482
|
class: "fm-typo-en-body-lg-600"
|
|
@@ -2490,13 +2490,13 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2490
2490
|
])
|
|
2491
2491
|
])
|
|
2492
2492
|
], 64))), 128))
|
|
2493
|
-
])) : (p(), A("div",
|
|
2493
|
+
])) : (p(), A("div", ds, [
|
|
2494
2494
|
h(oe),
|
|
2495
2495
|
a("div", null, [
|
|
2496
2496
|
a("img", {
|
|
2497
|
-
src: d(
|
|
2497
|
+
src: d(ko),
|
|
2498
2498
|
alt: "List is empty"
|
|
2499
|
-
}, null, 8,
|
|
2499
|
+
}, null, 8, ms)
|
|
2500
2500
|
]),
|
|
2501
2501
|
w[12] || (w[12] = a("div", { class: "fm-typo-en-body-lg-600" }, "No records found", -1)),
|
|
2502
2502
|
w[13] || (w[13] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, " You can track approval and rejection history here ", -1)),
|
|
@@ -2511,10 +2511,10 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
|
|
|
2511
2511
|
};
|
|
2512
2512
|
}
|
|
2513
2513
|
});
|
|
2514
|
-
function
|
|
2515
|
-
return
|
|
2514
|
+
function Is(t) {
|
|
2515
|
+
return ln.isDraftItemAmendBlocked(t).blocked;
|
|
2516
2516
|
}
|
|
2517
|
-
function
|
|
2517
|
+
function Bs(t, o, e) {
|
|
2518
2518
|
const n = C(() => {
|
|
2519
2519
|
if (e && !e.value) return [];
|
|
2520
2520
|
const r = [], s = /* @__PURE__ */ new Set();
|
|
@@ -2522,7 +2522,7 @@ function Ts(t, o, e) {
|
|
|
2522
2522
|
const c = u.sku._id;
|
|
2523
2523
|
if (!s.has(c))
|
|
2524
2524
|
try {
|
|
2525
|
-
if (!
|
|
2525
|
+
if (!Is({
|
|
2526
2526
|
item: u,
|
|
2527
2527
|
master: o.value[c] ?? null
|
|
2528
2528
|
})) continue;
|
|
@@ -2535,10 +2535,10 @@ function Ts(t, o, e) {
|
|
|
2535
2535
|
});
|
|
2536
2536
|
return { blockedSkuIds: C(() => new Set(n.value.map((r) => r.id))), blockedItems: n };
|
|
2537
2537
|
}
|
|
2538
|
-
const
|
|
2538
|
+
const Ts = { class: "flex items-center gap-4 justify-start w-full" }, js = { class: "flex flex-col gap-4" }, Rs = { class: "flex items-center gap-4 min-w-0" }, Ns = {
|
|
2539
2539
|
key: 0,
|
|
2540
2540
|
class: "flex items-center gap-4 w-fit px-8 py-2 fm-corner-radius-md bg-orange-50 text-fm-color-primary fm-typo-en-body-md-600"
|
|
2541
|
-
},
|
|
2541
|
+
}, Ms = /* @__PURE__ */ De({
|
|
2542
2542
|
__name: "ClosingDraftSkuCell",
|
|
2543
2543
|
props: {
|
|
2544
2544
|
code: {},
|
|
@@ -2551,33 +2551,33 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2551
2551
|
const { FmTooltip: o, FmPill: e, FmIcon: n } = be, l = t, r = C(
|
|
2552
2552
|
() => l.hasError ? "Adjustment difference is more than 10%." : `${l.code} - ${l.name}`
|
|
2553
2553
|
);
|
|
2554
|
-
return (s, u) => (p(),
|
|
2554
|
+
return (s, u) => (p(), ae(d(o), { "z-index": 51 }, {
|
|
2555
2555
|
content: ee(() => [
|
|
2556
2556
|
ge(R(r.value), 1)
|
|
2557
2557
|
]),
|
|
2558
2558
|
default: ee(() => [
|
|
2559
|
-
a("div",
|
|
2560
|
-
a("div",
|
|
2561
|
-
a("div",
|
|
2559
|
+
a("div", Ts, [
|
|
2560
|
+
a("div", js, [
|
|
2561
|
+
a("div", Rs, [
|
|
2562
2562
|
a("span", {
|
|
2563
|
-
class:
|
|
2563
|
+
class: we([
|
|
2564
2564
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
2565
2565
|
s.hasError ? "text-fm-color-system-error-300" : "text-fm-color-typo-primary"
|
|
2566
2566
|
])
|
|
2567
2567
|
}, R(s.name), 3),
|
|
2568
|
-
s.isOutdated ? (p(),
|
|
2568
|
+
s.isOutdated ? (p(), ae(d(e), {
|
|
2569
2569
|
key: 0,
|
|
2570
2570
|
variant: "beta",
|
|
2571
2571
|
label: "Outdated"
|
|
2572
2572
|
})) : H("", !0)
|
|
2573
2573
|
]),
|
|
2574
2574
|
a("div", {
|
|
2575
|
-
class:
|
|
2575
|
+
class: we([
|
|
2576
2576
|
"line-clamp-1 fm-typo-en-body-md-400",
|
|
2577
2577
|
s.hasError ? "text-fm-color-system-error-300" : "text-fm-color-typo-secondary"
|
|
2578
2578
|
])
|
|
2579
2579
|
}, R(s.code), 3),
|
|
2580
|
-
s.subSources.length >= 2 ? (p(), A("div",
|
|
2580
|
+
s.subSources.length >= 2 ? (p(), A("div", Ns, [
|
|
2581
2581
|
h(d(n), {
|
|
2582
2582
|
name: "refresh",
|
|
2583
2583
|
size: "sm"
|
|
@@ -2590,7 +2590,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2590
2590
|
_: 1
|
|
2591
2591
|
}));
|
|
2592
2592
|
}
|
|
2593
|
-
}),
|
|
2593
|
+
}), Us = { class: "py-4 flex flex-col gap-8" }, Ps = { class: "flex flex-col gap-4 max-h-[180px] overflow-y-auto" }, Vs = { class: "flex gap-4 justify-end" }, Es = /* @__PURE__ */ De({
|
|
2594
2594
|
__name: "ClosingDraftOutdatedApproveWarning",
|
|
2595
2595
|
props: {
|
|
2596
2596
|
show: { type: Boolean },
|
|
@@ -2608,7 +2608,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2608
2608
|
function u(c) {
|
|
2609
2609
|
l("update:show", c);
|
|
2610
2610
|
}
|
|
2611
|
-
return (c, b) => (p(),
|
|
2611
|
+
return (c, b) => (p(), ae(d(e), {
|
|
2612
2612
|
"model-value": c.show,
|
|
2613
2613
|
"max-width": 520,
|
|
2614
2614
|
"z-index": 60,
|
|
@@ -2618,15 +2618,15 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2618
2618
|
a("div", { class: "fm-typo-en-heading-lg-600" }, "Approve with outdated measurements?", -1)
|
|
2619
2619
|
])),
|
|
2620
2620
|
default: ee(() => [
|
|
2621
|
-
a("div",
|
|
2621
|
+
a("div", Us, [
|
|
2622
2622
|
b[1] || (b[1] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " These items were counted against outdated measurements. You can continue, but review them before approving if the count should use the latest inventory setup. ", -1)),
|
|
2623
|
-
a("div",
|
|
2623
|
+
a("div", Ps, [
|
|
2624
2624
|
(p(!0), A(le, null, he(c.items, (g) => (p(), A("div", {
|
|
2625
2625
|
key: g.id,
|
|
2626
2626
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-primary"
|
|
2627
2627
|
}, R(g.code) + " - " + R(g.name), 1))), 128))
|
|
2628
2628
|
]),
|
|
2629
|
-
a("div",
|
|
2629
|
+
a("div", Vs, [
|
|
2630
2630
|
h(d(n), {
|
|
2631
2631
|
label: "Cancel",
|
|
2632
2632
|
variant: "secondary",
|
|
@@ -2644,46 +2644,46 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2644
2644
|
_: 1
|
|
2645
2645
|
}, 8, ["model-value"]));
|
|
2646
2646
|
}
|
|
2647
|
-
}),
|
|
2647
|
+
}), Ls = { class: "w-full flex flex-col gap-32" }, Os = { class: "flex flex-col gap-4" }, Gs = { class: "flex justify-between" }, zs = { class: "flex" }, Hs = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, Ys = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ws = { class: "flex gap-1" }, Ks = {
|
|
2648
2648
|
class: "fm-typo-en-body-lg-600",
|
|
2649
2649
|
style: { "white-space": "pre-wrap", "word-break": "break-word" }
|
|
2650
|
-
},
|
|
2650
|
+
}, qs = { class: "flex items-center justify-between" }, Qs = { class: "fm-typo-en-body-lg-600" }, Js = {
|
|
2651
2651
|
key: 1,
|
|
2652
2652
|
class: "flex items-start gap-8 p-12 fm-corner-radius-md border-1 border-yellow-500 bg-yellow-50 text-yellow-700"
|
|
2653
|
-
},
|
|
2653
|
+
}, Zs = { class: "flex flex-col gap-2" }, Xs = { class: "fm-typo-en-body-sm-400 list-disc pl-16" }, er = { key: 0 }, tr = { key: 1 }, or = { class: "flex flex-col gap-16" }, nr = { class: "flex items-center" }, ar = {
|
|
2654
2654
|
key: 0,
|
|
2655
2655
|
class: "flex gap-8"
|
|
2656
|
-
},
|
|
2656
|
+
}, sr = {
|
|
2657
2657
|
key: 0,
|
|
2658
2658
|
class: "w-full flex flex-col items-center"
|
|
2659
|
-
},
|
|
2659
|
+
}, rr = { class: "flex items-center gap-8" }, lr = { class: "flex flex-col gap-8" }, ir = { class: "flex gap-8" }, cr = {
|
|
2660
2660
|
key: 0,
|
|
2661
2661
|
class: "flex gap-8"
|
|
2662
|
-
},
|
|
2662
|
+
}, ur = {
|
|
2663
2663
|
key: 1,
|
|
2664
2664
|
class: "flex gap-8 flex-wrap"
|
|
2665
|
-
},
|
|
2665
|
+
}, dr = { class: "overflow-x-auto" }, mr = {
|
|
2666
2666
|
key: 1,
|
|
2667
2667
|
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
2668
|
-
},
|
|
2668
|
+
}, pr = {
|
|
2669
2669
|
key: 0,
|
|
2670
2670
|
class: "flex flex-col items-center gap-8 h-full"
|
|
2671
|
-
},
|
|
2671
|
+
}, fr = ["src"], vr = {
|
|
2672
2672
|
key: 1,
|
|
2673
2673
|
class: "px-4 flex flex-col"
|
|
2674
|
-
},
|
|
2674
|
+
}, gr = { class: "flex gap-12 content-stretch" }, yr = {
|
|
2675
2675
|
class: "flex flex-col w-24",
|
|
2676
2676
|
name: "circles"
|
|
2677
|
-
},
|
|
2677
|
+
}, br = { class: "flex-1 flex flex-col items-center" }, hr = { class: "flex-1 flex flex-col items-center" }, _r = {
|
|
2678
2678
|
class: "py-12 flex flex-col gap-4",
|
|
2679
2679
|
name: "received-at header"
|
|
2680
|
-
},
|
|
2680
|
+
}, kr = { class: "fm-typo-en-body-lg-400" }, wr = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, xr = { class: "flex gap-12 content-stretch" }, Dr = {
|
|
2681
2681
|
class: "flex flex-col w-24",
|
|
2682
2682
|
name: "circles"
|
|
2683
|
-
},
|
|
2683
|
+
}, Ar = { class: "flex-1 flex flex-col items-center" }, $r = {
|
|
2684
2684
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
2685
2685
|
name: "delivery details"
|
|
2686
|
-
},
|
|
2686
|
+
}, Cr = { class: "flex flex-col gap-8" }, Sr = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Fr = { class: "flex flex-col gap-4" }, Ir = { class: "flex items-center justify-between gap-8 w-full" }, Br = { class: "flex items-center gap-8" }, Tr = { class: "flex flex-col items-end" }, jr = { class: "text-2xl font-semibold" }, Rr = "N/A", Nr = /* @__PURE__ */ De({
|
|
2687
2687
|
__name: "ClosingDraftDialog",
|
|
2688
2688
|
props: {
|
|
2689
2689
|
show: { type: Boolean },
|
|
@@ -2692,12 +2692,12 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2692
2692
|
emits: ["submitted", "refresh"],
|
|
2693
2693
|
setup(t, { emit: o }) {
|
|
2694
2694
|
const e = t, n = C(() => {
|
|
2695
|
-
const m =
|
|
2695
|
+
const m = fo();
|
|
2696
2696
|
return m === "MYR" ? "RM" : m;
|
|
2697
|
-
}), l =
|
|
2697
|
+
}), l = wo(), r = C(() => {
|
|
2698
2698
|
var m, i;
|
|
2699
2699
|
return (m = e.draft) != null && m.closingId ? ((i = l.drafts.find((v) => v._id === e.draft._id)) == null ? void 0 : i.closingIdDisplay) ?? null : null;
|
|
2700
|
-
}), s =
|
|
2700
|
+
}), s = yt(), u = Oe(), c = Rt(e, "show"), b = q(!1), g = q(!1), S = q([]), J = C(
|
|
2701
2701
|
() => e.draft
|
|
2702
2702
|
);
|
|
2703
2703
|
let E = 0, B;
|
|
@@ -2720,7 +2720,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2720
2720
|
console.error("Failed to fetch closing groups", V);
|
|
2721
2721
|
}
|
|
2722
2722
|
}
|
|
2723
|
-
const P = C(() => S.value.map(
|
|
2723
|
+
const P = C(() => S.value.map(jt)), Z = C(() => {
|
|
2724
2724
|
var m, i, v;
|
|
2725
2725
|
return (v = (i = (m = e.draft) == null ? void 0 : m.usingTemplates) == null ? void 0 : i.find((O) => O)) == null ? void 0 : v.name;
|
|
2726
2726
|
}), X = q(null), z = q(!1);
|
|
@@ -2747,15 +2747,15 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2747
2747
|
K.adjustmentsByType && Object.keys(K.adjustmentsByType).forEach((V) => m.add(V));
|
|
2748
2748
|
const v = ["receive", "sales", "wastage"].filter((K) => m.has(K));
|
|
2749
2749
|
return v.forEach((K) => m.delete(K)), [...v, ...Array.from(m).sort()];
|
|
2750
|
-
}), $ =
|
|
2751
|
-
|
|
2750
|
+
}), $ = _t(), L = Ue(), N = Nt(), ve = qe(), oe = lo({}), M = C(() => new Set(
|
|
2751
|
+
N.skus.filter((m) => {
|
|
2752
2752
|
var i;
|
|
2753
2753
|
return oe[(i = m.customAttributes) == null ? void 0 : i.tag];
|
|
2754
2754
|
}).map((m) => m._id)
|
|
2755
2755
|
)), f = o, y = C(() => {
|
|
2756
2756
|
var m;
|
|
2757
2757
|
return (m = e.draft) == null ? void 0 : m._id;
|
|
2758
|
-
}),
|
|
2758
|
+
}), U = C(() => {
|
|
2759
2759
|
var m;
|
|
2760
2760
|
return (m = e.draft) == null ? void 0 : m._rev;
|
|
2761
2761
|
}), {
|
|
@@ -2763,18 +2763,18 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2763
2763
|
startListening: de,
|
|
2764
2764
|
startRefresh: j,
|
|
2765
2765
|
cleanup: G
|
|
2766
|
-
} =
|
|
2766
|
+
} = Fa({
|
|
2767
2767
|
closingDraftId: y,
|
|
2768
|
-
currentRev:
|
|
2768
|
+
currentRev: U,
|
|
2769
2769
|
onCompleted: (m) => {
|
|
2770
2770
|
f("refresh", m), c.value = !1;
|
|
2771
2771
|
}
|
|
2772
2772
|
}), ie = q({
|
|
2773
2773
|
templateItem: !0,
|
|
2774
2774
|
nonTemplateItem: !0
|
|
2775
|
-
}),
|
|
2775
|
+
}), se = q(null);
|
|
2776
2776
|
function Ae(m, i) {
|
|
2777
|
-
|
|
2777
|
+
se.value = i ? m : se.value === m ? null : se.value;
|
|
2778
2778
|
}
|
|
2779
2779
|
const _e = C(() => {
|
|
2780
2780
|
var m, i;
|
|
@@ -2785,7 +2785,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2785
2785
|
items: [...((m = e.draft) == null ? void 0 : m.items) ?? [], ...((i = e.draft) == null ? void 0 : i.negativeStockItems) ?? []]
|
|
2786
2786
|
},
|
|
2787
2787
|
...S.value.map((v) => ({
|
|
2788
|
-
label:
|
|
2788
|
+
label: wt(v),
|
|
2789
2789
|
isSub: !0,
|
|
2790
2790
|
items: [...v.items ?? [], ...v.negativeStockItems ?? []]
|
|
2791
2791
|
}))
|
|
@@ -2795,14 +2795,14 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2795
2795
|
const m = [...((O = e.draft) == null ? void 0 : O.items) ?? [], ...((K = e.draft) == null ? void 0 : K.negativeStockItems) ?? []], i = S.value.map((V) => [
|
|
2796
2796
|
...V.items ?? [],
|
|
2797
2797
|
...V.negativeStockItems ?? []
|
|
2798
|
-
]), v =
|
|
2799
|
-
return
|
|
2800
|
-
}),
|
|
2801
|
-
() =>
|
|
2802
|
-
),
|
|
2798
|
+
]), v = ea([m, ...i]);
|
|
2799
|
+
return M.value.size ? v.filter((V) => M.value.has(V.sku._id)) : v;
|
|
2800
|
+
}), tt = C(
|
|
2801
|
+
() => N.isInventoryLoaded || N.inventoryFetchedAt != null
|
|
2802
|
+
), ot = C(() => N.skuById), { blockedSkuIds: nt, blockedItems: Pe } = Bs(Be, ot, tt), Re = C(() => {
|
|
2803
2803
|
const m = Be.value.map((i) => i.sku);
|
|
2804
2804
|
return m.sort((i, v) => i.code.localeCompare(v.code)), m;
|
|
2805
|
-
}),
|
|
2805
|
+
}), xt = Ut(), Dt = [
|
|
2806
2806
|
{
|
|
2807
2807
|
label: "Overview",
|
|
2808
2808
|
value: "overview"
|
|
@@ -2811,7 +2811,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2811
2811
|
label: "Action history",
|
|
2812
2812
|
value: "history"
|
|
2813
2813
|
}
|
|
2814
|
-
], Qe = q(
|
|
2814
|
+
], Qe = q(Dt[0]);
|
|
2815
2815
|
je(
|
|
2816
2816
|
() => e.show,
|
|
2817
2817
|
async (m) => {
|
|
@@ -2819,26 +2819,26 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2819
2819
|
G();
|
|
2820
2820
|
return;
|
|
2821
2821
|
}
|
|
2822
|
-
Qe.value =
|
|
2822
|
+
Qe.value = Dt[0], ie.value = {
|
|
2823
2823
|
templateItem: !0,
|
|
2824
2824
|
nonTemplateItem: !0
|
|
2825
|
-
},
|
|
2825
|
+
}, se.value = null, de();
|
|
2826
2826
|
},
|
|
2827
2827
|
{ immediate: !0 }
|
|
2828
2828
|
), je(
|
|
2829
2829
|
[() => e.show, y],
|
|
2830
2830
|
([m]) => {
|
|
2831
|
-
m && (I(),
|
|
2831
|
+
m && (I(), So());
|
|
2832
2832
|
},
|
|
2833
2833
|
{ immediate: !0 }
|
|
2834
2834
|
);
|
|
2835
|
-
const
|
|
2836
|
-
async function
|
|
2835
|
+
const $o = C(() => at.value.reduce((m, i) => m + Number(i.stockTakeValue), 0)), Lt = ne.fromNumber(0), Co = ne.fromNumber(100);
|
|
2836
|
+
async function So() {
|
|
2837
2837
|
var m, i, v;
|
|
2838
2838
|
if (ve._currentLocation) {
|
|
2839
2839
|
b.value = !0, T.value = [], k.value = [];
|
|
2840
2840
|
try {
|
|
2841
|
-
if (await
|
|
2841
|
+
if (await N.init(), !x.value) return;
|
|
2842
2842
|
const O = (m = e.draft) == null ? void 0 : m.closingAdjustmentId;
|
|
2843
2843
|
if (!O) {
|
|
2844
2844
|
L.open({
|
|
@@ -2872,7 +2872,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2872
2872
|
}
|
|
2873
2873
|
}
|
|
2874
2874
|
}
|
|
2875
|
-
async function
|
|
2875
|
+
async function Ot() {
|
|
2876
2876
|
var i, v;
|
|
2877
2877
|
if (Y.value)
|
|
2878
2878
|
return;
|
|
@@ -2893,7 +2893,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2893
2893
|
}
|
|
2894
2894
|
);
|
|
2895
2895
|
}
|
|
2896
|
-
async function
|
|
2896
|
+
async function Fo() {
|
|
2897
2897
|
var i, v;
|
|
2898
2898
|
if (!(((i = e.draft) == null ? void 0 : i.effectiveAt) ?? (e.draft ? Le((v = e.draft) == null ? void 0 : v._id) : null))) {
|
|
2899
2899
|
L.open({
|
|
@@ -2905,15 +2905,15 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2905
2905
|
}
|
|
2906
2906
|
await s.invalidateDraftCache(e.draft);
|
|
2907
2907
|
}
|
|
2908
|
-
const
|
|
2908
|
+
const Io = C(
|
|
2909
2909
|
() => w.value.groupBy(
|
|
2910
2910
|
(m) => m.id,
|
|
2911
2911
|
(m) => m.balance
|
|
2912
2912
|
)
|
|
2913
|
-
),
|
|
2913
|
+
), Bo = C(() => Be.value.groupBy((m) => m.sku._id)), To = C(() => {
|
|
2914
2914
|
var m;
|
|
2915
2915
|
return (m = e.draft) != null && m.adjustmentSnapshot ? new Map(e.draft.adjustmentSnapshot.map((i) => [i.skuId, i.adjustmentsByType])) : /* @__PURE__ */ new Map();
|
|
2916
|
-
}),
|
|
2916
|
+
}), jo = C(() => {
|
|
2917
2917
|
var m;
|
|
2918
2918
|
return (m = e.draft) != null && m.opening ? new Map(e.draft.opening.map((i) => [i.skuId, i.balance])) : /* @__PURE__ */ new Map();
|
|
2919
2919
|
});
|
|
@@ -2931,15 +2931,15 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2931
2931
|
}
|
|
2932
2932
|
);
|
|
2933
2933
|
}
|
|
2934
|
-
const
|
|
2934
|
+
const Gt = C(() => [
|
|
2935
2935
|
{
|
|
2936
2936
|
id: "sku",
|
|
2937
2937
|
accessorFn: (i) => `${i.code} ${i.name}`,
|
|
2938
2938
|
header: () => "Name",
|
|
2939
2939
|
size: 350,
|
|
2940
2940
|
cell(i) {
|
|
2941
|
-
const v = i.row.original, O = v.adjustedDiffPercentage, K = typeof O == "number" && Math.abs(O) > 10, V =
|
|
2942
|
-
return D(
|
|
2941
|
+
const v = i.row.original, O = v.adjustedDiffPercentage, K = typeof O == "number" && Math.abs(O) > 10, V = nt.value.has(v.id);
|
|
2942
|
+
return D(Ms, {
|
|
2943
2943
|
code: v.code,
|
|
2944
2944
|
name: v.name,
|
|
2945
2945
|
hasError: K,
|
|
@@ -2949,7 +2949,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
2949
2949
|
}
|
|
2950
2950
|
},
|
|
2951
2951
|
// Dynamic custom attribute columns (toggled by user)
|
|
2952
|
-
...
|
|
2952
|
+
...Yt.value.map(
|
|
2953
2953
|
(i) => ({
|
|
2954
2954
|
id: `customAttr_${i}`,
|
|
2955
2955
|
accessorFn: (v) => v.customAttributeValues[i],
|
|
@@ -3053,16 +3053,16 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3053
3053
|
accessorFn: (i) => {
|
|
3054
3054
|
var O;
|
|
3055
3055
|
const v = (O = re.value.find((K) => K.id === i.id)) == null ? void 0 : O.balance;
|
|
3056
|
-
return v ?
|
|
3056
|
+
return v ? $n.toDouble(v) : i.physicalBalance;
|
|
3057
3057
|
},
|
|
3058
3058
|
header: () => Se("Stock Take balance", "The physical balance recorded during stock take."),
|
|
3059
3059
|
cell(i) {
|
|
3060
3060
|
var pe;
|
|
3061
|
-
const v = i.row.original, O =
|
|
3061
|
+
const v = i.row.original, O = v.physicalBalanceDecimal;
|
|
3062
3062
|
let K = !0;
|
|
3063
3063
|
const V = (pe = re.value.find((ce) => ce.id === v.id)) == null ? void 0 : pe.balance;
|
|
3064
3064
|
let W;
|
|
3065
|
-
V && !
|
|
3065
|
+
V && !ne.equals({ a: O, b: V }) ? (K = !1, W = me(V)) : W = me(v.physicalBalance);
|
|
3066
3066
|
const ue = D("div", { class: "flex flex-col items-end" }, [
|
|
3067
3067
|
D(
|
|
3068
3068
|
"span",
|
|
@@ -3078,7 +3078,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3078
3078
|
return v.breakdown.length ? D(
|
|
3079
3079
|
be.FmPopover,
|
|
3080
3080
|
{
|
|
3081
|
-
showPopover:
|
|
3081
|
+
showPopover: se.value === v.id,
|
|
3082
3082
|
placement: "bottom-end",
|
|
3083
3083
|
zIndex: 9999,
|
|
3084
3084
|
"onPopover-changed": (ce) => Ae(v.id, ce)
|
|
@@ -3092,7 +3092,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3092
3092
|
},
|
|
3093
3093
|
[ue, D(be.FmIcon, { name: "info", size: "sm", outline: !0 })]
|
|
3094
3094
|
),
|
|
3095
|
-
default: () =>
|
|
3095
|
+
default: () => Do(v.breakdown, v.physicalBalance, v.baseUnit)
|
|
3096
3096
|
}
|
|
3097
3097
|
) : ue;
|
|
3098
3098
|
},
|
|
@@ -3141,7 +3141,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3141
3141
|
return D(
|
|
3142
3142
|
"div",
|
|
3143
3143
|
{ class: "flex items-center gap-4 justify-end fm-typo-en-body-lg-400" },
|
|
3144
|
-
|
|
3144
|
+
Rr
|
|
3145
3145
|
);
|
|
3146
3146
|
const O = me(v);
|
|
3147
3147
|
if (v === 0)
|
|
@@ -3171,7 +3171,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3171
3171
|
var pe;
|
|
3172
3172
|
const v = i.row.original, O = v.stockTakeValue, K = Re.value.find((ce) => ce._id === v.id), V = (pe = K == null ? void 0 : K.defaultCost) == null ? void 0 : pe.measurement, W = v.physicalBalance, ue = v.costPerUnit;
|
|
3173
3173
|
if (V) {
|
|
3174
|
-
const ce =
|
|
3174
|
+
const ce = ne.toFormatString({ value: V.conversion }), Ve = `${me(W, { minPrecision: 2, maxPrecision: 4 })} ${v.baseUnit} ÷ ${ce} × ${ue} ${n.value}`;
|
|
3175
3175
|
return D(
|
|
3176
3176
|
be.FmTooltip,
|
|
3177
3177
|
{ zIndex: 51 },
|
|
@@ -3221,7 +3221,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3221
3221
|
var pe;
|
|
3222
3222
|
const v = i.row.original, O = v.systemValue, K = Re.value.find((ce) => ce._id === v.id), V = (pe = K == null ? void 0 : K.defaultCost) == null ? void 0 : pe.measurement, W = v.systemBalance, ue = v.costPerUnit;
|
|
3223
3223
|
if (V) {
|
|
3224
|
-
const ce =
|
|
3224
|
+
const ce = ne.toFormatString({ value: V.conversion }), Ve = `${me(W, { minPrecision: 2, maxPrecision: 4 })} ${v.baseUnit} ÷ ${ce} × ${ue} ${n.value}`;
|
|
3225
3225
|
return D(
|
|
3226
3226
|
be.FmTooltip,
|
|
3227
3227
|
{ zIndex: 51 },
|
|
@@ -3268,46 +3268,47 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3268
3268
|
enableSorting: !1,
|
|
3269
3269
|
cell(i) {
|
|
3270
3270
|
const v = i.row.original;
|
|
3271
|
-
return S.value.length && v.sourceBuckets.length ?
|
|
3271
|
+
return S.value.length && v.sourceBuckets.length ? Ha(v.sourceBuckets, v.baseUnit) : Et(v.baseUnitAmount, v.baseUnit, v.measurements);
|
|
3272
3272
|
}
|
|
3273
3273
|
}
|
|
3274
|
-
]),
|
|
3274
|
+
]), Ro = C(() => Gt.value.map((m) => m.size ?? 0).reduce((m, i) => m + i)), At = q(""), No = C(() => {
|
|
3275
3275
|
var O, K;
|
|
3276
3276
|
const m = ((K = (O = e.draft) == null ? void 0 : O.negativeStockItems) == null ? void 0 : K.reduce(
|
|
3277
3277
|
(V, W) => (V[W.sku._id] = W, V),
|
|
3278
3278
|
{}
|
|
3279
3279
|
)) ?? {}, i = new Map(re.value.map((V) => [V.id, V.balance]));
|
|
3280
3280
|
return Re.value.map((V) => {
|
|
3281
|
-
var Xt, eo, to, oo, no, ao, so, ro
|
|
3282
|
-
const W = (
|
|
3281
|
+
var Zt, Xt, eo, to, oo, no, ao, so, ro;
|
|
3282
|
+
const W = (Zt = Bo.value.get(V._id)) == null ? void 0 : Zt[0], ue = ((Xt = Io.value.get(V._id)) == null ? void 0 : Xt[0]) ?? Lt, pe = ((eo = V.defaultCost) == null ? void 0 : eo.costPerUnit) ?? Lt, ce = Number(ne.toFormatString({ value: pe })), Ve = ((oo = (to = V.defaultCost) == null ? void 0 : to.measurement) == null ? void 0 : oo.conversion) ?? {
|
|
3283
3283
|
amount: 1,
|
|
3284
3284
|
precision: 0
|
|
3285
3285
|
}, Te = Number(
|
|
3286
|
-
|
|
3287
|
-
),
|
|
3286
|
+
ne.toFormatString({ value: Ve })
|
|
3287
|
+
), ct = jo.value.get(V._id), ut = ct ? Number(ne.toFormatString({ value: ct })) : 0, Q = To.value.get(V._id), ye = {};
|
|
3288
3288
|
if (_.value.forEach(($e) => {
|
|
3289
|
-
const
|
|
3290
|
-
|
|
3289
|
+
const mt = ye[$e] ?? { amount: 0, precision: 0 }, pt = Q == null ? void 0 : Q[$e];
|
|
3290
|
+
pt && (ye[$e] = Xe(mt, pt));
|
|
3291
3291
|
}), !W) {
|
|
3292
|
-
const $e = Number(
|
|
3292
|
+
const $e = Number(ne.toFormatString({ value: ue })), mt = 0 - $e, pt = mt * ce / Te, qo = 0, Qo = $e * ce / Te;
|
|
3293
3293
|
return {
|
|
3294
3294
|
id: V._id,
|
|
3295
3295
|
code: V.code,
|
|
3296
3296
|
name: V.name,
|
|
3297
|
-
costUnit: ((
|
|
3297
|
+
costUnit: ((ao = (no = V.defaultCost) == null ? void 0 : no.measurement) == null ? void 0 : ao.abbrev) ?? null,
|
|
3298
3298
|
baseUnit: V.unit.abbrev,
|
|
3299
3299
|
baseUnitAmount: 0,
|
|
3300
3300
|
systemBalance: $e,
|
|
3301
3301
|
physicalBalance: 0,
|
|
3302
|
+
physicalBalanceDecimal: ne.reset(),
|
|
3302
3303
|
adjustedAmount: -$e,
|
|
3303
3304
|
adjustedDiffPercentage: -100,
|
|
3304
3305
|
isTemplateItem: !m[V._id],
|
|
3305
3306
|
costPerUnit: ce,
|
|
3306
|
-
opening:
|
|
3307
|
-
varianceQty:
|
|
3308
|
-
varianceInCost:
|
|
3309
|
-
stockTakeValue:
|
|
3310
|
-
systemValue:
|
|
3307
|
+
opening: ut,
|
|
3308
|
+
varianceQty: mt,
|
|
3309
|
+
varianceInCost: pt,
|
|
3310
|
+
stockTakeValue: qo,
|
|
3311
|
+
systemValue: Qo,
|
|
3311
3312
|
adjustmentAmounts: ye,
|
|
3312
3313
|
customAttributeValues: V.customAttributes ?? {},
|
|
3313
3314
|
measurements: [],
|
|
@@ -3316,61 +3317,62 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3316
3317
|
subSources: []
|
|
3317
3318
|
};
|
|
3318
3319
|
}
|
|
3319
|
-
const
|
|
3320
|
-
|
|
3320
|
+
const ke = kt(W), Ne = i.get(V._id), ze = bo(
|
|
3321
|
+
Ne ?? ke,
|
|
3321
3322
|
ue
|
|
3322
|
-
),
|
|
3323
|
+
), dt = ue.amount === 0 ? null : ho(ze, {
|
|
3323
3324
|
...ue,
|
|
3324
3325
|
amount: Math.abs(ue.amount)
|
|
3325
|
-
}),
|
|
3326
|
+
}), qt = dt ? ht(dt, Co) : null, Ft = Number(ne.toFormatString({ value: ue })), It = Number(ne.toFormatString({ value: ke })), Qt = It - Ft, Go = Qt * ce / Te, zo = It * ce / Te, Ho = Ft * ce / Te, { baseUnitAmount: Yo, measurements: Wo } = Vt(W, xt.value), Ko = xo(W, xt.value), Jt = za(V._id, _e.value, xt.value);
|
|
3326
3327
|
return {
|
|
3327
3328
|
id: V._id,
|
|
3328
3329
|
code: V.code,
|
|
3329
3330
|
name: V.name,
|
|
3330
|
-
costUnit: ((
|
|
3331
|
+
costUnit: ((ro = (so = V.defaultCost) == null ? void 0 : so.measurement) == null ? void 0 : ro.abbrev) ?? null,
|
|
3331
3332
|
baseUnit: V.unit.abbrev,
|
|
3332
|
-
baseUnitAmount:
|
|
3333
|
-
measurements:
|
|
3334
|
-
breakdown:
|
|
3335
|
-
systemBalance:
|
|
3336
|
-
physicalBalance:
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3333
|
+
baseUnitAmount: Yo,
|
|
3334
|
+
measurements: Wo,
|
|
3335
|
+
breakdown: Ko,
|
|
3336
|
+
systemBalance: Ft,
|
|
3337
|
+
physicalBalance: It,
|
|
3338
|
+
physicalBalanceDecimal: ke,
|
|
3339
|
+
adjustedAmount: Number(ne.toFormatString({ value: ze })),
|
|
3340
|
+
adjustedDiffPercentage: qt ? Number(
|
|
3341
|
+
ne.toFormatString({
|
|
3342
|
+
value: _o(qt, 2)
|
|
3341
3343
|
})
|
|
3342
3344
|
) : null,
|
|
3343
3345
|
isTemplateItem: !m[V._id],
|
|
3344
3346
|
costPerUnit: ce,
|
|
3345
|
-
opening:
|
|
3346
|
-
varianceQty:
|
|
3347
|
-
varianceInCost:
|
|
3348
|
-
stockTakeValue:
|
|
3349
|
-
systemValue:
|
|
3347
|
+
opening: ut,
|
|
3348
|
+
varianceQty: Qt,
|
|
3349
|
+
varianceInCost: Go,
|
|
3350
|
+
stockTakeValue: zo,
|
|
3351
|
+
systemValue: Ho,
|
|
3350
3352
|
adjustmentAmounts: ye,
|
|
3351
3353
|
customAttributeValues: V.customAttributes ?? {},
|
|
3352
|
-
sourceBuckets:
|
|
3353
|
-
subSources:
|
|
3354
|
+
sourceBuckets: Jt,
|
|
3355
|
+
subSources: Jt.filter(($e) => $e.isSub).map(($e) => $e.label)
|
|
3354
3356
|
};
|
|
3355
3357
|
});
|
|
3356
|
-
}),
|
|
3357
|
-
() =>
|
|
3358
|
-
),
|
|
3359
|
-
() =>
|
|
3360
|
-
),
|
|
3361
|
-
() =>
|
|
3362
|
-
),
|
|
3358
|
+
}), at = C(() => No.value.filter((m) => !!(m.isTemplateItem && ie.value.templateItem || !m.isTemplateItem && ie.value.nonTemplateItem))), zt = C(
|
|
3359
|
+
() => at.value.some((m) => m.measurements.some((i) => i.variant === "inactive"))
|
|
3360
|
+
), Ht = C(
|
|
3361
|
+
() => at.value.some((m) => m.measurements.some((i) => i.variant === "orphan"))
|
|
3362
|
+
), Mo = C(
|
|
3363
|
+
() => zt.value || Ht.value
|
|
3364
|
+
), $t = C(() => {
|
|
3363
3365
|
const m = /* @__PURE__ */ new Set();
|
|
3364
3366
|
for (const i of Re.value)
|
|
3365
3367
|
if (i.customAttributes)
|
|
3366
3368
|
for (const v of Object.keys(i.customAttributes))
|
|
3367
3369
|
v !== "tag" && m.add(v);
|
|
3368
3370
|
return Array.from(m).sort();
|
|
3369
|
-
}),
|
|
3370
|
-
() =>
|
|
3371
|
-
),
|
|
3371
|
+
}), st = lo({}), Yt = C(
|
|
3372
|
+
() => $t.value.filter((m) => st[m])
|
|
3373
|
+
), Uo = C(() => {
|
|
3372
3374
|
var m;
|
|
3373
|
-
return e.draft ?
|
|
3375
|
+
return e.draft ? Ao(e.draft, {
|
|
3374
3376
|
idDisplay: r.value,
|
|
3375
3377
|
locationName: (m = ve._currentLocation) == null ? void 0 : m.name
|
|
3376
3378
|
}) : [];
|
|
@@ -3412,13 +3414,13 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3412
3414
|
]
|
|
3413
3415
|
})
|
|
3414
3416
|
);
|
|
3415
|
-
}),
|
|
3417
|
+
}), rt = q(!1), lt = q(!1), Ct = q(!1), it = q(!1), Wt = C(() => {
|
|
3416
3418
|
var m;
|
|
3417
3419
|
return ((m = e.draft) == null ? void 0 : m.status) !== xe.enum.DRAFT ? "Status is not draft." : null;
|
|
3418
3420
|
});
|
|
3419
|
-
async function
|
|
3421
|
+
async function Po(m) {
|
|
3420
3422
|
if (e.draft) {
|
|
3421
|
-
|
|
3423
|
+
Ct.value = !0;
|
|
3422
3424
|
try {
|
|
3423
3425
|
const i = await u.approveAllClosingGroups(e.draft._id, m);
|
|
3424
3426
|
S.value = i;
|
|
@@ -3429,62 +3431,62 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3429
3431
|
type: "error"
|
|
3430
3432
|
});
|
|
3431
3433
|
} finally {
|
|
3432
|
-
|
|
3434
|
+
Ct.value = !1;
|
|
3433
3435
|
}
|
|
3434
3436
|
}
|
|
3435
3437
|
}
|
|
3436
|
-
function
|
|
3437
|
-
|
|
3438
|
+
function Vo(m) {
|
|
3439
|
+
Kt(() => Po(m));
|
|
3438
3440
|
}
|
|
3439
|
-
function
|
|
3440
|
-
e.draft && (
|
|
3441
|
+
function Eo() {
|
|
3442
|
+
e.draft && (lt.value = !0, s.approveDraft(
|
|
3441
3443
|
e.draft,
|
|
3442
3444
|
() => {
|
|
3443
|
-
|
|
3445
|
+
lt.value = !1, rt.value = !1, f("submitted");
|
|
3444
3446
|
},
|
|
3445
3447
|
() => {
|
|
3446
|
-
|
|
3448
|
+
lt.value = !1;
|
|
3447
3449
|
}
|
|
3448
3450
|
));
|
|
3449
3451
|
}
|
|
3450
|
-
let
|
|
3451
|
-
function
|
|
3452
|
+
let St = null;
|
|
3453
|
+
function Kt(m) {
|
|
3452
3454
|
if (Pe.value.length) {
|
|
3453
|
-
|
|
3455
|
+
St = m, it.value = !0;
|
|
3454
3456
|
return;
|
|
3455
3457
|
}
|
|
3456
3458
|
m();
|
|
3457
3459
|
}
|
|
3458
|
-
function
|
|
3459
|
-
e.draft &&
|
|
3460
|
+
function Lo() {
|
|
3461
|
+
e.draft && Kt(Eo);
|
|
3460
3462
|
}
|
|
3461
|
-
function
|
|
3462
|
-
const m =
|
|
3463
|
-
|
|
3463
|
+
function Oo() {
|
|
3464
|
+
const m = St;
|
|
3465
|
+
St = null, it.value = !1, m == null || m();
|
|
3464
3466
|
}
|
|
3465
3467
|
return (m, i) => {
|
|
3466
|
-
const v = te("FmButtonGroup"), O = te("FmMenuDivider"), K = te("FmCard"), V = te("FmIcon"), W = te("FmButton"), ue = te("FmCircularProgress"), pe = te("FmChip"), ce = te("FmTextField"), Ve = te("FmTable"), Te = te("FmSpacer"),
|
|
3468
|
+
const v = te("FmButtonGroup"), O = te("FmMenuDivider"), K = te("FmCard"), V = te("FmIcon"), W = te("FmButton"), ue = te("FmCircularProgress"), pe = te("FmChip"), ce = te("FmTextField"), Ve = te("FmTable"), Te = te("FmSpacer"), ct = te("FmTooltip"), ut = te("FmSideSheet");
|
|
3467
3469
|
return p(), A(le, null, [
|
|
3468
|
-
h(
|
|
3470
|
+
h(ut, {
|
|
3469
3471
|
"dismiss-away": "",
|
|
3470
3472
|
"max-width": 9999,
|
|
3471
3473
|
"model-value": d(c),
|
|
3472
|
-
"onUpdate:modelValue": i[9] || (i[9] = (Q) =>
|
|
3474
|
+
"onUpdate:modelValue": i[9] || (i[9] = (Q) => bt(c) ? c.value = Q : null),
|
|
3473
3475
|
header: "Closing details"
|
|
3474
3476
|
}, {
|
|
3475
3477
|
"side-sheet-footer": ee(() => {
|
|
3476
|
-
var Q, ye,
|
|
3478
|
+
var Q, ye, ke, Ne;
|
|
3477
3479
|
return [
|
|
3478
|
-
a("div",
|
|
3479
|
-
a("div",
|
|
3480
|
+
a("div", Ir, [
|
|
3481
|
+
a("div", Br, [
|
|
3480
3482
|
((Q = e.draft) == null ? void 0 : Q.status) === d(xe).enum.DRAFT ? (p(), A(le, { key: 0 }, [
|
|
3481
|
-
|
|
3483
|
+
Wt.value ? (p(), ae(ct, {
|
|
3482
3484
|
key: 0,
|
|
3483
3485
|
"z-index": 51,
|
|
3484
3486
|
placement: "right"
|
|
3485
3487
|
}, {
|
|
3486
3488
|
content: ee(() => [
|
|
3487
|
-
ge(R(
|
|
3489
|
+
ge(R(Wt.value), 1)
|
|
3488
3490
|
]),
|
|
3489
3491
|
default: ee(() => [
|
|
3490
3492
|
h(W, {
|
|
@@ -3495,14 +3497,14 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3495
3497
|
})
|
|
3496
3498
|
]),
|
|
3497
3499
|
_: 1
|
|
3498
|
-
})) : (p(),
|
|
3500
|
+
})) : (p(), ae(W, {
|
|
3499
3501
|
key: "approve key",
|
|
3500
3502
|
label: "Approve",
|
|
3501
3503
|
"data-testid": "closing-draft-approve",
|
|
3502
|
-
onClick: i[5] || (i[5] = (ze) =>
|
|
3504
|
+
onClick: i[5] || (i[5] = (ze) => rt.value = !0)
|
|
3503
3505
|
}))
|
|
3504
3506
|
], 64)) : H("", !0),
|
|
3505
|
-
((ye = e.draft) == null ? void 0 : ye.status) === d(xe).enum.DRAFT ? (p(),
|
|
3507
|
+
((ye = e.draft) == null ? void 0 : ye.status) === d(xe).enum.DRAFT ? (p(), ae(W, {
|
|
3506
3508
|
key: 1,
|
|
3507
3509
|
label: "Reject",
|
|
3508
3510
|
variant: "destructive",
|
|
@@ -3513,7 +3515,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3513
3515
|
variant: "tertiary",
|
|
3514
3516
|
onClick: i[7] || (i[7] = (ze) => c.value = !1)
|
|
3515
3517
|
}),
|
|
3516
|
-
(
|
|
3518
|
+
(ke = e.draft) != null && ke.approvedAt && ((Ne = e.draft) == null ? void 0 : Ne.status) !== d(xe).enum.COMPLETED ? (p(), ae(Bt, { key: 2 }, {
|
|
3517
3519
|
default: ee(() => [
|
|
3518
3520
|
h(W, {
|
|
3519
3521
|
label: "Sync",
|
|
@@ -3528,28 +3530,28 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3528
3530
|
_: 1
|
|
3529
3531
|
})) : H("", !0)
|
|
3530
3532
|
]),
|
|
3531
|
-
a("div",
|
|
3533
|
+
a("div", Tr, [
|
|
3532
3534
|
i[26] || (i[26] = a("div", { class: "text-xs text-gray-500 uppercase tracking-wide" }, "Total stock take value", -1)),
|
|
3533
|
-
a("div",
|
|
3535
|
+
a("div", jr, R(n.value) + " " + R($o.value.toFixed(2)), 1)
|
|
3534
3536
|
])
|
|
3535
3537
|
])
|
|
3536
3538
|
];
|
|
3537
3539
|
}),
|
|
3538
3540
|
default: ee(() => [
|
|
3539
|
-
a("div",
|
|
3541
|
+
a("div", Ls, [
|
|
3540
3542
|
a("div", null, [
|
|
3541
3543
|
h(v, {
|
|
3542
|
-
items:
|
|
3544
|
+
items: Dt,
|
|
3543
3545
|
modelValue: Qe.value,
|
|
3544
3546
|
"onUpdate:modelValue": i[0] || (i[0] = (Q) => Qe.value = Q)
|
|
3545
3547
|
}, null, 8, ["modelValue"])
|
|
3546
3548
|
]),
|
|
3547
3549
|
Qe.value.value === "overview" ? (p(), A(le, { key: 0 }, [
|
|
3548
|
-
h(
|
|
3550
|
+
h(Bt, { selectable: "" }, {
|
|
3549
3551
|
default: ee(() => {
|
|
3550
3552
|
var Q;
|
|
3551
3553
|
return [
|
|
3552
|
-
a("div",
|
|
3554
|
+
a("div", Os, [
|
|
3553
3555
|
i[13] || (i[13] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, [
|
|
3554
3556
|
a("div", { class: "flex gap-1" }, "Draft ID")
|
|
3555
3557
|
], -1)),
|
|
@@ -3566,70 +3568,70 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3566
3568
|
default: ee(() => {
|
|
3567
3569
|
var Q, ye;
|
|
3568
3570
|
return [
|
|
3569
|
-
a("div",
|
|
3571
|
+
a("div", Gs, [
|
|
3570
3572
|
i[14] || (i[14] = a("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
|
|
3571
|
-
a("div",
|
|
3573
|
+
a("div", zs, [
|
|
3572
3574
|
a("div", {
|
|
3573
|
-
class:
|
|
3575
|
+
class: we(["fm-status-badge", d(Me)(((Q = m.draft) == null ? void 0 : Q.status) ?? "DRAFT")])
|
|
3574
3576
|
}, R(d(Ie)(((ye = m.draft) == null ? void 0 : ye.status) ?? "")), 3)
|
|
3575
3577
|
])
|
|
3576
3578
|
]),
|
|
3577
3579
|
h(O),
|
|
3578
|
-
a("div",
|
|
3579
|
-
(p(!0), A(le, null, he(
|
|
3580
|
+
a("div", Hs, [
|
|
3581
|
+
(p(!0), A(le, null, he(Uo.value, (ke, Ne) => (p(), A("div", {
|
|
3580
3582
|
class: "flex flex-col gap-4",
|
|
3581
|
-
key:
|
|
3583
|
+
key: Ne
|
|
3582
3584
|
}, [
|
|
3583
|
-
a("div",
|
|
3584
|
-
a("div",
|
|
3585
|
+
a("div", Ys, [
|
|
3586
|
+
a("div", Ws, R(ke.label), 1)
|
|
3585
3587
|
]),
|
|
3586
|
-
a("div",
|
|
3588
|
+
a("div", Ks, R(ke.value), 1)
|
|
3587
3589
|
]))), 128))
|
|
3588
3590
|
])
|
|
3589
3591
|
];
|
|
3590
3592
|
}),
|
|
3591
3593
|
_: 1
|
|
3592
3594
|
}),
|
|
3593
|
-
P.value.length ? (p(),
|
|
3595
|
+
P.value.length ? (p(), ae(K, {
|
|
3594
3596
|
key: 0,
|
|
3595
3597
|
variant: "outlined",
|
|
3596
3598
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
3597
3599
|
}, {
|
|
3598
3600
|
default: ee(() => [
|
|
3599
|
-
a("div",
|
|
3600
|
-
a("div",
|
|
3601
|
+
a("div", qs, [
|
|
3602
|
+
a("div", Qs, "Groups " + R(P.value.length), 1),
|
|
3601
3603
|
i[15] || (i[15] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Parent totals = sum of all groups ", -1))
|
|
3602
3604
|
]),
|
|
3603
3605
|
h(O),
|
|
3604
|
-
h(
|
|
3606
|
+
h(Ea, {
|
|
3605
3607
|
groups: P.value,
|
|
3606
3608
|
onSelect: F
|
|
3607
3609
|
}, null, 8, ["groups"])
|
|
3608
3610
|
]),
|
|
3609
3611
|
_: 1
|
|
3610
3612
|
})) : H("", !0),
|
|
3611
|
-
|
|
3613
|
+
Mo.value ? (p(), A("div", Js, [
|
|
3612
3614
|
h(V, {
|
|
3613
3615
|
name: "rule",
|
|
3614
3616
|
size: "sm"
|
|
3615
3617
|
}),
|
|
3616
|
-
a("div",
|
|
3618
|
+
a("div", Zs, [
|
|
3617
3619
|
i[17] || (i[17] = a("div", { class: "fm-typo-en-body-md-600" }, "UOM notes", -1)),
|
|
3618
|
-
a("ul",
|
|
3619
|
-
|
|
3620
|
+
a("ul", Xs, [
|
|
3621
|
+
zt.value ? (p(), A("li", er, i[16] || (i[16] = [
|
|
3620
3622
|
ge(" Measurements highlighted in "),
|
|
3621
3623
|
a("span", { class: "font-bold" }, "purple", -1),
|
|
3622
3624
|
ge(" are NetSuite-inactive UOMs (surfaced for audit; their amounts are part of the base total). ")
|
|
3623
3625
|
]))) : H("", !0),
|
|
3624
|
-
|
|
3626
|
+
Ht.value ? (p(), A("li", tr, " Red highlights are UOMs not on the SKU (ignored). ")) : H("", !0)
|
|
3625
3627
|
])
|
|
3626
3628
|
])
|
|
3627
3629
|
])) : H("", !0),
|
|
3628
|
-
a("div",
|
|
3629
|
-
a("div",
|
|
3630
|
+
a("div", or, [
|
|
3631
|
+
a("div", nr, [
|
|
3630
3632
|
i[18] || (i[18] = a("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
|
|
3631
|
-
b.value ? H("", !0) : (p(), A("div",
|
|
3632
|
-
m.draft && m.draft.status !== d(xe).enum.COMPLETED ? (p(),
|
|
3633
|
+
b.value ? H("", !0) : (p(), A("div", ar, [
|
|
3634
|
+
m.draft && m.draft.status !== d(xe).enum.COMPLETED ? (p(), ae(W, {
|
|
3633
3635
|
key: 0,
|
|
3634
3636
|
label: "Refresh balance",
|
|
3635
3637
|
"prepend-icon": "refresh",
|
|
@@ -3639,9 +3641,9 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3639
3641
|
"border-color": "primary",
|
|
3640
3642
|
loading: d(Y),
|
|
3641
3643
|
disabled: d(Y),
|
|
3642
|
-
onClick:
|
|
3644
|
+
onClick: Ot
|
|
3643
3645
|
}, null, 8, ["loading", "disabled"])) : H("", !0),
|
|
3644
|
-
h(
|
|
3646
|
+
h(Bt, null, {
|
|
3645
3647
|
default: ee(() => [
|
|
3646
3648
|
h(W, {
|
|
3647
3649
|
label: "Invalidate Draft Cache",
|
|
@@ -3651,7 +3653,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3651
3653
|
"bg-color": "transparent",
|
|
3652
3654
|
"border-color": "primary",
|
|
3653
3655
|
loading: d(Y),
|
|
3654
|
-
onClick:
|
|
3656
|
+
onClick: Fo
|
|
3655
3657
|
}, null, 8, ["loading"])
|
|
3656
3658
|
]),
|
|
3657
3659
|
_: 1
|
|
@@ -3667,14 +3669,14 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3667
3669
|
m.draft,
|
|
3668
3670
|
w.value,
|
|
3669
3671
|
re.value,
|
|
3670
|
-
|
|
3672
|
+
Yt.value
|
|
3671
3673
|
) : null)
|
|
3672
3674
|
})
|
|
3673
3675
|
]))
|
|
3674
3676
|
]),
|
|
3675
|
-
b.value ? (p(), A("div",
|
|
3677
|
+
b.value ? (p(), A("div", sr, [
|
|
3676
3678
|
i[20] || (i[20] = a("div", { class: "h-80" }, null, -1)),
|
|
3677
|
-
a("div",
|
|
3679
|
+
a("div", rr, [
|
|
3678
3680
|
a("div", null, [
|
|
3679
3681
|
h(ue, { size: "md" })
|
|
3680
3682
|
]),
|
|
@@ -3682,8 +3684,8 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3682
3684
|
]),
|
|
3683
3685
|
i[21] || (i[21] = a("div", { class: "h-80" }, null, -1))
|
|
3684
3686
|
])) : (p(), A(le, { key: 1 }, [
|
|
3685
|
-
a("div",
|
|
3686
|
-
a("div",
|
|
3687
|
+
a("div", lr, [
|
|
3688
|
+
a("div", ir, [
|
|
3687
3689
|
h(pe, {
|
|
3688
3690
|
label: "Template Item(s)",
|
|
3689
3691
|
selected: ie.value.templateItem,
|
|
@@ -3696,13 +3698,13 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3696
3698
|
}, null, 8, ["selected"])
|
|
3697
3699
|
]),
|
|
3698
3700
|
h(ce, {
|
|
3699
|
-
modelValue:
|
|
3700
|
-
"onUpdate:modelValue": i[4] || (i[4] = (Q) =>
|
|
3701
|
+
modelValue: At.value,
|
|
3702
|
+
"onUpdate:modelValue": i[4] || (i[4] = (Q) => At.value = Q),
|
|
3701
3703
|
placeholder: "Filter items"
|
|
3702
3704
|
}, null, 8, ["modelValue"])
|
|
3703
3705
|
]),
|
|
3704
|
-
d(
|
|
3705
|
-
(p(!0), A(le, null, he(d(
|
|
3706
|
+
d(N).skuTags.size ? (p(), A("div", cr, [
|
|
3707
|
+
(p(!0), A(le, null, he(d(N).skuTags.keys(), (Q) => (p(), ae(pe, {
|
|
3706
3708
|
key: `${Q}`,
|
|
3707
3709
|
label: `${Q}`,
|
|
3708
3710
|
selectable: "",
|
|
@@ -3710,14 +3712,14 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3710
3712
|
onClick: (ye) => oe[`${Q}`] = !oe[`${Q}`]
|
|
3711
3713
|
}, {
|
|
3712
3714
|
default: ee(() => [
|
|
3713
|
-
oe[`${Q}`] ? (p(),
|
|
3715
|
+
oe[`${Q}`] ? (p(), ae(V, {
|
|
3714
3716
|
key: 0,
|
|
3715
3717
|
name: "check",
|
|
3716
3718
|
class: "text-white",
|
|
3717
3719
|
size: "sm"
|
|
3718
3720
|
})) : H("", !0),
|
|
3719
3721
|
a("span", {
|
|
3720
|
-
class:
|
|
3722
|
+
class: we([
|
|
3721
3723
|
"",
|
|
3722
3724
|
{
|
|
3723
3725
|
"text-white fm-typo-en-body-md-600": oe[`${Q}`],
|
|
@@ -3729,38 +3731,38 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3729
3731
|
_: 2
|
|
3730
3732
|
}, 1032, ["label", "selected", "onClick"]))), 128))
|
|
3731
3733
|
])) : H("", !0),
|
|
3732
|
-
|
|
3734
|
+
$t.value.length ? (p(), A("div", ur, [
|
|
3733
3735
|
i[22] || (i[22] = a("span", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary self-center" }, "Extra columns:", -1)),
|
|
3734
|
-
(p(!0), A(le, null, he(
|
|
3736
|
+
(p(!0), A(le, null, he($t.value, (Q) => (p(), ae(pe, {
|
|
3735
3737
|
key: Q,
|
|
3736
3738
|
label: Q,
|
|
3737
3739
|
selectable: "",
|
|
3738
|
-
selected:
|
|
3739
|
-
onClick: (ye) =>
|
|
3740
|
+
selected: st[Q],
|
|
3741
|
+
onClick: (ye) => st[Q] = !st[Q]
|
|
3740
3742
|
}, null, 8, ["label", "selected", "onClick"]))), 128))
|
|
3741
3743
|
])) : H("", !0),
|
|
3742
|
-
a("div",
|
|
3744
|
+
a("div", dr, [
|
|
3743
3745
|
a("div", {
|
|
3744
|
-
style:
|
|
3746
|
+
style: gt({ height: "600px", minWidth: `${Ro.value}px` })
|
|
3745
3747
|
}, [
|
|
3746
3748
|
h(Ve, {
|
|
3747
|
-
"column-defs":
|
|
3748
|
-
"row-data":
|
|
3749
|
-
"search-value":
|
|
3749
|
+
"column-defs": Gt.value,
|
|
3750
|
+
"row-data": at.value,
|
|
3751
|
+
"search-value": At.value
|
|
3750
3752
|
}, null, 8, ["column-defs", "row-data", "search-value"])
|
|
3751
3753
|
], 4)
|
|
3752
3754
|
])
|
|
3753
3755
|
], 64))
|
|
3754
3756
|
])
|
|
3755
3757
|
], 64)) : H("", !0),
|
|
3756
|
-
Qe.value.value === "history" ? (p(), A("div",
|
|
3757
|
-
Ge.value.length ? (p(), A("div",
|
|
3758
|
+
Qe.value.value === "history" ? (p(), A("div", mr, [
|
|
3759
|
+
Ge.value.length ? (p(), A("div", vr, [
|
|
3758
3760
|
(p(!0), A(le, null, he(Ge.value, (Q, ye) => (p(), A(le, { key: ye }, [
|
|
3759
|
-
a("div",
|
|
3760
|
-
a("div",
|
|
3761
|
-
a("div",
|
|
3761
|
+
a("div", gr, [
|
|
3762
|
+
a("div", yr, [
|
|
3763
|
+
a("div", br, [
|
|
3762
3764
|
a("div", {
|
|
3763
|
-
class:
|
|
3765
|
+
class: we([
|
|
3764
3766
|
{
|
|
3765
3767
|
"bg-fm-color-primary": ye !== 0,
|
|
3766
3768
|
"bg-white": ye === 0
|
|
@@ -3770,9 +3772,9 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3770
3772
|
}, null, 2)
|
|
3771
3773
|
]),
|
|
3772
3774
|
i[25] || (i[25] = a("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
3773
|
-
a("div",
|
|
3775
|
+
a("div", hr, [
|
|
3774
3776
|
a("div", {
|
|
3775
|
-
class:
|
|
3777
|
+
class: we([
|
|
3776
3778
|
{
|
|
3777
3779
|
"bg-fm-color-primary": ye < Ge.value.length - 1,
|
|
3778
3780
|
"bg-white": ye >= Ge.value.length - 1
|
|
@@ -3782,16 +3784,16 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3782
3784
|
}, null, 2)
|
|
3783
3785
|
])
|
|
3784
3786
|
]),
|
|
3785
|
-
a("div",
|
|
3786
|
-
a("div",
|
|
3787
|
-
a("div",
|
|
3787
|
+
a("div", _r, [
|
|
3788
|
+
a("div", kr, R(Q.header), 1),
|
|
3789
|
+
a("div", wr, R(Q.date), 1)
|
|
3788
3790
|
])
|
|
3789
3791
|
]),
|
|
3790
|
-
a("div",
|
|
3791
|
-
a("div",
|
|
3792
|
-
a("div",
|
|
3792
|
+
a("div", xr, [
|
|
3793
|
+
a("div", Dr, [
|
|
3794
|
+
a("div", Ar, [
|
|
3793
3795
|
a("div", {
|
|
3794
|
-
class:
|
|
3796
|
+
class: we([
|
|
3795
3797
|
{
|
|
3796
3798
|
"bg-fm-color-primary": ye < Ge.value.length - 1,
|
|
3797
3799
|
"bg-white": ye >= Ge.value.length - 1
|
|
@@ -3801,21 +3803,21 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3801
3803
|
}, null, 2)
|
|
3802
3804
|
])
|
|
3803
3805
|
]),
|
|
3804
|
-
a("div",
|
|
3806
|
+
a("div", $r, [
|
|
3805
3807
|
h(K, {
|
|
3806
3808
|
variant: "outlined",
|
|
3807
3809
|
class: "py-12 px-16"
|
|
3808
3810
|
}, {
|
|
3809
3811
|
default: ee(() => [
|
|
3810
|
-
a("div",
|
|
3811
|
-
(p(!0), A(le, null, he(Q.info, (
|
|
3812
|
-
key:
|
|
3812
|
+
a("div", Cr, [
|
|
3813
|
+
(p(!0), A(le, null, he(Q.info, (ke, Ne) => (p(), A("div", {
|
|
3814
|
+
key: Ne,
|
|
3813
3815
|
class: "flex flex-col gap-4"
|
|
3814
3816
|
}, [
|
|
3815
|
-
a("div",
|
|
3816
|
-
a("div",
|
|
3817
|
-
(p(!0), A(le, null, he(
|
|
3818
|
-
key:
|
|
3817
|
+
a("div", Sr, R(ke == null ? void 0 : ke.label), 1),
|
|
3818
|
+
a("div", Fr, [
|
|
3819
|
+
(p(!0), A(le, null, he(ke == null ? void 0 : ke.values, (ze, dt) => (p(), A("div", {
|
|
3820
|
+
key: dt,
|
|
3819
3821
|
class: "fm-typo-en-body-lg-600"
|
|
3820
3822
|
}, R(ze), 1))), 128))
|
|
3821
3823
|
])
|
|
@@ -3827,13 +3829,13 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3827
3829
|
])
|
|
3828
3830
|
])
|
|
3829
3831
|
], 64))), 128))
|
|
3830
|
-
])) : (p(), A("div",
|
|
3832
|
+
])) : (p(), A("div", pr, [
|
|
3831
3833
|
h(Te),
|
|
3832
3834
|
a("div", null, [
|
|
3833
3835
|
a("img", {
|
|
3834
|
-
src: d(
|
|
3836
|
+
src: d(ko),
|
|
3835
3837
|
alt: "List is empty"
|
|
3836
|
-
}, null, 8,
|
|
3838
|
+
}, null, 8, fr)
|
|
3837
3839
|
]),
|
|
3838
3840
|
i[23] || (i[23] = a("div", { class: "fm-typo-en-body-lg-600" }, R("No records found"), -1)),
|
|
3839
3841
|
i[24] || (i[24] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, R("You can track approval and rejection history here"), -1)),
|
|
@@ -3845,26 +3847,26 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3845
3847
|
]),
|
|
3846
3848
|
_: 1
|
|
3847
3849
|
}, 8, ["model-value"]),
|
|
3848
|
-
d(c) && e.draft ? (p(),
|
|
3850
|
+
d(c) && e.draft ? (p(), ae(Sa, {
|
|
3849
3851
|
key: 0,
|
|
3850
|
-
show:
|
|
3851
|
-
"onUpdate:show": i[10] || (i[10] = (Q) =>
|
|
3852
|
+
show: rt.value,
|
|
3853
|
+
"onUpdate:show": i[10] || (i[10] = (Q) => rt.value = Q),
|
|
3852
3854
|
refreshing: d(Y),
|
|
3853
|
-
approving:
|
|
3854
|
-
"approving-all-groups":
|
|
3855
|
+
approving: lt.value,
|
|
3856
|
+
"approving-all-groups": Ct.value,
|
|
3855
3857
|
draft: e.draft,
|
|
3856
3858
|
groups: S.value,
|
|
3857
|
-
onRefresh:
|
|
3858
|
-
onApprove:
|
|
3859
|
-
onApproveAllGroups:
|
|
3859
|
+
onRefresh: Ot,
|
|
3860
|
+
onApprove: Lo,
|
|
3861
|
+
onApproveAllGroups: Vo
|
|
3860
3862
|
}, null, 8, ["show", "refreshing", "approving", "approving-all-groups", "draft", "groups"])) : H("", !0),
|
|
3861
|
-
h(
|
|
3862
|
-
show:
|
|
3863
|
-
"onUpdate:show": i[11] || (i[11] = (Q) =>
|
|
3863
|
+
h(Es, {
|
|
3864
|
+
show: it.value,
|
|
3865
|
+
"onUpdate:show": i[11] || (i[11] = (Q) => it.value = Q),
|
|
3864
3866
|
items: d(Pe),
|
|
3865
|
-
onContinue:
|
|
3867
|
+
onContinue: Oo
|
|
3866
3868
|
}, null, 8, ["show", "items"]),
|
|
3867
|
-
h(
|
|
3869
|
+
h(Fs, {
|
|
3868
3870
|
show: z.value,
|
|
3869
3871
|
"onUpdate:show": i[12] || (i[12] = (Q) => z.value = Q),
|
|
3870
3872
|
group: X.value ?? void 0,
|
|
@@ -3876,13 +3878,13 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
|
|
|
3876
3878
|
}
|
|
3877
3879
|
});
|
|
3878
3880
|
var Ce = /* @__PURE__ */ ((t) => (t.ready = "ready", t.negative = "negative", t.systemNegative = "systemNegative", t))(Ce || {});
|
|
3879
|
-
async function
|
|
3881
|
+
async function Mr(t) {
|
|
3880
3882
|
return new Promise((o, e) => {
|
|
3881
3883
|
const n = new FileReader();
|
|
3882
3884
|
n.onload = (l) => {
|
|
3883
3885
|
var r;
|
|
3884
3886
|
try {
|
|
3885
|
-
const s = (r = l.target) == null ? void 0 : r.result, u =
|
|
3887
|
+
const s = (r = l.target) == null ? void 0 : r.result, u = yn(s, { type: "array" }), c = u.SheetNames[0], b = u.Sheets[c], g = vt.sheet_to_json(b, {
|
|
3886
3888
|
header: 1,
|
|
3887
3889
|
defval: ""
|
|
3888
3890
|
}), S = (X) => String(X).trim().toLowerCase().replace(/^\uFEFF/, ""), J = g.findIndex(
|
|
@@ -3912,14 +3914,14 @@ async function Nr(t) {
|
|
|
3912
3914
|
}, n.onerror = e, n.readAsArrayBuffer(t);
|
|
3913
3915
|
});
|
|
3914
3916
|
}
|
|
3915
|
-
function
|
|
3917
|
+
function Ur(t) {
|
|
3916
3918
|
const o = /* @__PURE__ */ new Map();
|
|
3917
3919
|
return t.forEach((e) => {
|
|
3918
3920
|
const n = o.get(e.itemCode) || 0;
|
|
3919
3921
|
o.set(e.itemCode, n + e.quantity);
|
|
3920
3922
|
}), o;
|
|
3921
3923
|
}
|
|
3922
|
-
function
|
|
3924
|
+
function Pr(t, o) {
|
|
3923
3925
|
const e = [], n = [];
|
|
3924
3926
|
for (const [l, r] of o.entries()) {
|
|
3925
3927
|
const s = t[l];
|
|
@@ -3939,21 +3941,21 @@ function Vr(t, o) {
|
|
|
3939
3941
|
}
|
|
3940
3942
|
return { mergedItems: e, unrecognisedItemCodes: n };
|
|
3941
3943
|
}
|
|
3942
|
-
function
|
|
3943
|
-
const e = t.filter((c) => !c.isInactive), n =
|
|
3944
|
+
function Vr(t, o) {
|
|
3945
|
+
const e = t.filter((c) => !c.isInactive), n = Sn().format("YYYY-MM-DD"), l = `${o} - ${n}.csv`, r = [
|
|
3944
3946
|
["Code", "Name", "Balance"],
|
|
3945
3947
|
...e.map((c) => [c.code, c.name, ""])
|
|
3946
|
-
], s =
|
|
3947
|
-
|
|
3948
|
+
], s = vt.aoa_to_sheet(r), u = vt.book_new();
|
|
3949
|
+
vt.book_append_sheet(u, s, "Template"), gn(u, l, { bookType: "csv" });
|
|
3948
3950
|
}
|
|
3949
|
-
function
|
|
3950
|
-
const t = q([]), o = q([]), e = q(!1), n =
|
|
3951
|
+
function Er() {
|
|
3952
|
+
const t = q([]), o = q([]), e = q(!1), n = Nt(), l = qe(), r = _t(), s = C(
|
|
3951
3953
|
() => t.value.some((g) => g.status === Ce.negative)
|
|
3952
3954
|
);
|
|
3953
3955
|
async function u(g) {
|
|
3954
3956
|
t.value = [], o.value = [], e.value = !0;
|
|
3955
3957
|
try {
|
|
3956
|
-
const S = await
|
|
3958
|
+
const S = await Mr(g), J = Ur(S), E = n.skuByCode, { mergedItems: B, unrecognisedItemCodes: I } = Pr(
|
|
3957
3959
|
E,
|
|
3958
3960
|
J
|
|
3959
3961
|
), P = await r.readStockBalance(), Z = P.skus ?? [];
|
|
@@ -4000,7 +4002,7 @@ function Lr() {
|
|
|
4000
4002
|
name: Z.sku.name,
|
|
4001
4003
|
unit: Z.sku.unit
|
|
4002
4004
|
},
|
|
4003
|
-
baseAmount:
|
|
4005
|
+
baseAmount: pn(Z.physicalCount, Z.sku.unit.precision),
|
|
4004
4006
|
measurementsAmounts: []
|
|
4005
4007
|
}), B = S.map(E), I = J.map(E), P = {
|
|
4006
4008
|
effectiveAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4012,21 +4014,21 @@ function Lr() {
|
|
|
4012
4014
|
function b() {
|
|
4013
4015
|
var S;
|
|
4014
4016
|
const g = ((S = l.currentLocation) == null ? void 0 : S.name) ?? "template";
|
|
4015
|
-
|
|
4017
|
+
Vr(n.skus, g);
|
|
4016
4018
|
}
|
|
4017
4019
|
return { mergedItems: t, unrecognisedItemCodes: o, hasBlockingErrors: s, isLoading: e, onFileUpload: u, submit: c, downloadTemplate: b };
|
|
4018
4020
|
}
|
|
4019
|
-
const
|
|
4021
|
+
const Lr = { class: "flex flex-col gap-16" }, Or = {
|
|
4020
4022
|
key: 0,
|
|
4021
4023
|
class: "px-16 py-12 rounded-8 bg-fm-color-danger-weak text-fm-color-danger-default"
|
|
4022
|
-
},
|
|
4024
|
+
}, Gr = { key: 1 }, zr = { class: "fm-typo-en-label-md-400 cursor-pointer" }, Hr = { class: "mt-8 flex flex-col gap-4" }, Yr = { key: 2 }, Wr = { class: "fm-typo-en-label-md-400 cursor-pointer" }, Kr = { class: "mt-8 flex flex-col gap-4" }, qr = /* @__PURE__ */ De({
|
|
4023
4025
|
__name: "ClosingDraftCreatePreviewTable",
|
|
4024
4026
|
props: {
|
|
4025
4027
|
items: {},
|
|
4026
4028
|
unrecognisedItemCodes: {}
|
|
4027
4029
|
},
|
|
4028
4030
|
setup(t) {
|
|
4029
|
-
const o = t, { t: e } =
|
|
4031
|
+
const o = t, { t: e } = et(), n = C(
|
|
4030
4032
|
() => o.items.filter((u) => u.status === Ce.negative)
|
|
4031
4033
|
), l = C(
|
|
4032
4034
|
() => o.items.filter((u) => u.status === Ce.systemNegative)
|
|
@@ -4130,23 +4132,23 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4130
4132
|
];
|
|
4131
4133
|
return (u, c) => {
|
|
4132
4134
|
const b = te("FmTable");
|
|
4133
|
-
return p(), A("div",
|
|
4134
|
-
n.value.length > 0 ? (p(), A("div",
|
|
4135
|
+
return p(), A("div", Lr, [
|
|
4136
|
+
n.value.length > 0 ? (p(), A("div", Or, [
|
|
4135
4137
|
ge(R(d(e)("inventory.closing.draft.createDraft.previewTable.cannotSubmitNegative")) + " ", 1),
|
|
4136
4138
|
a("strong", null, R(n.value.map((g) => g.sku.code).join(", ")), 1)
|
|
4137
4139
|
])) : H("", !0),
|
|
4138
|
-
l.value.length > 0 ? (p(), A("details",
|
|
4139
|
-
a("summary",
|
|
4140
|
-
a("ul",
|
|
4140
|
+
l.value.length > 0 ? (p(), A("details", Gr, [
|
|
4141
|
+
a("summary", zr, R(d(e)("inventory.closing.draft.createDraft.previewTable.systemNegativeNote", [l.value.length])), 1),
|
|
4142
|
+
a("ul", Hr, [
|
|
4141
4143
|
(p(!0), A(le, null, he(l.value, (g) => (p(), A("li", {
|
|
4142
4144
|
key: g.sku._id,
|
|
4143
4145
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
4144
4146
|
}, R(g.sku.code), 1))), 128))
|
|
4145
4147
|
])
|
|
4146
4148
|
])) : H("", !0),
|
|
4147
|
-
u.unrecognisedItemCodes.length > 0 ? (p(), A("details",
|
|
4148
|
-
a("summary",
|
|
4149
|
-
a("ul",
|
|
4149
|
+
u.unrecognisedItemCodes.length > 0 ? (p(), A("details", Yr, [
|
|
4150
|
+
a("summary", Wr, R(d(e)("inventory.closing.draft.createDraft.previewTable.unrecognisedNote", [u.unrecognisedItemCodes.length])), 1),
|
|
4151
|
+
a("ul", Kr, [
|
|
4150
4152
|
(p(!0), A(le, null, he(u.unrecognisedItemCodes, (g) => (p(), A("li", {
|
|
4151
4153
|
key: g,
|
|
4152
4154
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
@@ -4161,20 +4163,20 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4161
4163
|
]);
|
|
4162
4164
|
};
|
|
4163
4165
|
}
|
|
4164
|
-
}),
|
|
4166
|
+
}), Qr = { class: "flex flex-col gap-16" }, Jr = { class: "flex flex-col gap-8" }, Zr = { class: "fm-typo-en-body-lg-600" }, Xr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, el = { class: "fm-corner-radius-md p-16 flex items-center gap-16 border border-fm-color-border-default" }, tl = { class: "flex flex-col flex-1 gap-4" }, ol = { class: "fm-typo-en-body-md-600" }, nl = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, al = {
|
|
4165
4167
|
key: 0,
|
|
4166
4168
|
class: "flex flex-col gap-8"
|
|
4167
|
-
},
|
|
4169
|
+
}, sl = { class: "fm-typo-en-body-lg-600" }, rl = {
|
|
4168
4170
|
key: 0,
|
|
4169
4171
|
class: "fm-typo-en-body-sm-400 text-fm-color-system-error-300 flex items-center gap-8"
|
|
4170
|
-
},
|
|
4172
|
+
}, ll = { class: "grid grid-cols-[repeat(3,1fr)] gap-12" }, il = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center gap-4" }, cl = { class: "flex items-center gap-8 w-full" }, ul = /* @__PURE__ */ De({
|
|
4171
4173
|
__name: "ClosingDraftCreateSideSheet",
|
|
4172
4174
|
props: {
|
|
4173
4175
|
show: { type: Boolean }
|
|
4174
4176
|
},
|
|
4175
4177
|
emits: ["update:show", "submitted"],
|
|
4176
4178
|
setup(t, { emit: o }) {
|
|
4177
|
-
const e = t, n = o, l =
|
|
4179
|
+
const e = t, n = o, l = Rt(e, "show"), { t: r } = et(), s = Ue(), u = q("upload"), c = q(null), b = q(!1), { mergedItems: g, unrecognisedItemCodes: S, hasBlockingErrors: J, isLoading: E, onFileUpload: B, submit: I, downloadTemplate: P } = Er(), Z = C(
|
|
4178
4180
|
() => c.value && !E.value && g.value.length > 0
|
|
4179
4181
|
), X = C(() => {
|
|
4180
4182
|
const k = g.value.filter(
|
|
@@ -4230,49 +4232,49 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4230
4232
|
}
|
|
4231
4233
|
return (k, x) => {
|
|
4232
4234
|
const w = te("FmCircularProgress"), re = te("FmIcon"), _ = te("FmButton"), $ = te("FmCard"), L = te("FmSideSheet");
|
|
4233
|
-
return p(),
|
|
4235
|
+
return p(), ae(L, {
|
|
4234
4236
|
"dismiss-away": "",
|
|
4235
4237
|
"max-width": 9999,
|
|
4236
4238
|
"model-value": d(l),
|
|
4237
|
-
"onUpdate:modelValue": x[2] || (x[2] = (
|
|
4239
|
+
"onUpdate:modelValue": x[2] || (x[2] = (N) => bt(l) ? l.value = N : null),
|
|
4238
4240
|
header: d(r)("inventory.closing.draft.createDraft.title")
|
|
4239
4241
|
}, {
|
|
4240
4242
|
default: ee(() => [
|
|
4241
|
-
a("div",
|
|
4243
|
+
a("div", Qr, [
|
|
4242
4244
|
u.value === "upload" ? (p(), A(le, { key: 0 }, [
|
|
4243
|
-
a("div",
|
|
4244
|
-
a("div",
|
|
4245
|
-
a("div",
|
|
4246
|
-
h(
|
|
4247
|
-
class:
|
|
4245
|
+
a("div", Jr, [
|
|
4246
|
+
a("div", Zr, R(d(r)("inventory.closing.draft.createDraft.importCsv")), 1),
|
|
4247
|
+
a("div", Xr, R(d(r)("inventory.closing.draft.createDraft.uploadDescription")), 1),
|
|
4248
|
+
h(Fn, {
|
|
4249
|
+
class: we({ "h-[200px]": !c.value }),
|
|
4248
4250
|
accept: ".csv",
|
|
4249
4251
|
disabled: d(E),
|
|
4250
4252
|
onFileUpload: z
|
|
4251
|
-
},
|
|
4253
|
+
}, Xo({ _: 2 }, [
|
|
4252
4254
|
c.value ? {
|
|
4253
4255
|
name: "default",
|
|
4254
|
-
fn: ee(({ openFileDialog:
|
|
4255
|
-
a("div",
|
|
4256
|
-
d(E) ? (p(),
|
|
4256
|
+
fn: ee(({ openFileDialog: N }) => [
|
|
4257
|
+
a("div", el, [
|
|
4258
|
+
d(E) ? (p(), ae(w, {
|
|
4257
4259
|
key: 0,
|
|
4258
4260
|
size: "md",
|
|
4259
4261
|
color: "neutral-gray-200"
|
|
4260
|
-
})) : (p(),
|
|
4262
|
+
})) : (p(), ae(re, {
|
|
4261
4263
|
key: 1,
|
|
4262
4264
|
name: "check_circle",
|
|
4263
4265
|
color: "system-success-400",
|
|
4264
4266
|
size: "lg"
|
|
4265
4267
|
})),
|
|
4266
|
-
a("div",
|
|
4267
|
-
a("div",
|
|
4268
|
-
a("div",
|
|
4268
|
+
a("div", tl, [
|
|
4269
|
+
a("div", ol, R(c.value.name), 1),
|
|
4270
|
+
a("div", nl, R(d(E) ? d(r)("inventory.closing.draft.createDraft.processing") : d(r)("inventory.closing.draft.createDraft.itemsLoaded", [d(g).length])), 1)
|
|
4269
4271
|
]),
|
|
4270
|
-
d(E) ? H("", !0) : (p(),
|
|
4272
|
+
d(E) ? H("", !0) : (p(), ae(_, {
|
|
4271
4273
|
key: 2,
|
|
4272
4274
|
label: d(r)("inventory.closing.draft.createDraft.replaceFile"),
|
|
4273
4275
|
variant: "secondary",
|
|
4274
4276
|
"prepend-icon": "autorenew",
|
|
4275
|
-
onClick:
|
|
4277
|
+
onClick: N
|
|
4276
4278
|
}, null, 8, ["label", "onClick"]))
|
|
4277
4279
|
])
|
|
4278
4280
|
]),
|
|
@@ -4280,9 +4282,9 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4280
4282
|
} : void 0
|
|
4281
4283
|
]), 1032, ["class", "disabled"])
|
|
4282
4284
|
]),
|
|
4283
|
-
Z.value ? (p(), A("div",
|
|
4284
|
-
a("div",
|
|
4285
|
-
d(J) ? (p(), A("div",
|
|
4285
|
+
Z.value ? (p(), A("div", al, [
|
|
4286
|
+
a("div", sl, R(d(r)("inventory.closing.draft.createDraft.importSummary")), 1),
|
|
4287
|
+
d(J) ? (p(), A("div", rl, [
|
|
4286
4288
|
h(re, {
|
|
4287
4289
|
name: "error",
|
|
4288
4290
|
size: "sm",
|
|
@@ -4295,35 +4297,35 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4295
4297
|
class: "flex flex-col gap-12 px-16 py-12"
|
|
4296
4298
|
}, {
|
|
4297
4299
|
default: ee(() => [
|
|
4298
|
-
a("div",
|
|
4299
|
-
(p(!0), A(le, null, he(X.value, (
|
|
4300
|
-
key:
|
|
4300
|
+
a("div", ll, [
|
|
4301
|
+
(p(!0), A(le, null, he(X.value, (N) => (p(), A("div", {
|
|
4302
|
+
key: N.label,
|
|
4301
4303
|
class: "flex flex-col gap-4"
|
|
4302
4304
|
}, [
|
|
4303
|
-
a("div",
|
|
4304
|
-
|
|
4305
|
+
a("div", il, [
|
|
4306
|
+
N.isError ? (p(), ae(re, {
|
|
4305
4307
|
key: 0,
|
|
4306
4308
|
name: "error",
|
|
4307
4309
|
size: "sm",
|
|
4308
4310
|
color: "system-error-300"
|
|
4309
4311
|
})) : H("", !0),
|
|
4310
|
-
|
|
4312
|
+
N.isWarning && !N.isError ? (p(), ae(re, {
|
|
4311
4313
|
key: 1,
|
|
4312
4314
|
name: "warning",
|
|
4313
4315
|
size: "sm",
|
|
4314
4316
|
color: "system-warning-300"
|
|
4315
4317
|
})) : H("", !0),
|
|
4316
|
-
a("span", null, R(
|
|
4318
|
+
a("span", null, R(N.label), 1)
|
|
4317
4319
|
]),
|
|
4318
4320
|
a("div", {
|
|
4319
|
-
class:
|
|
4321
|
+
class: we([
|
|
4320
4322
|
"fm-typo-en-body-lg-600",
|
|
4321
4323
|
{
|
|
4322
|
-
"text-fm-color-system-error-300":
|
|
4323
|
-
"text-fm-color-system-warning-300":
|
|
4324
|
+
"text-fm-color-system-error-300": N.isError,
|
|
4325
|
+
"text-fm-color-system-warning-300": N.isWarning && !N.isError
|
|
4324
4326
|
}
|
|
4325
4327
|
])
|
|
4326
|
-
}, R(
|
|
4328
|
+
}, R(N.value), 3)
|
|
4327
4329
|
]))), 128))
|
|
4328
4330
|
])
|
|
4329
4331
|
]),
|
|
@@ -4331,7 +4333,7 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4331
4333
|
})
|
|
4332
4334
|
])) : H("", !0)
|
|
4333
4335
|
], 64)) : H("", !0),
|
|
4334
|
-
u.value === "preview" ? (p(),
|
|
4336
|
+
u.value === "preview" ? (p(), ae(qr, {
|
|
4335
4337
|
key: 1,
|
|
4336
4338
|
items: d(g),
|
|
4337
4339
|
"unrecognised-item-codes": d(S)
|
|
@@ -4339,22 +4341,22 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4339
4341
|
])
|
|
4340
4342
|
]),
|
|
4341
4343
|
"side-sheet-footer": ee(() => [
|
|
4342
|
-
a("div",
|
|
4343
|
-
u.value === "preview" ? (p(),
|
|
4344
|
+
a("div", cl, [
|
|
4345
|
+
u.value === "preview" ? (p(), ae(_, {
|
|
4344
4346
|
key: 0,
|
|
4345
4347
|
variant: "secondary",
|
|
4346
4348
|
label: d(r)("inventory.common.back"),
|
|
4347
4349
|
"prepend-icon": "arrow_back",
|
|
4348
|
-
onClick: x[0] || (x[0] = (
|
|
4350
|
+
onClick: x[0] || (x[0] = (N) => u.value = "upload")
|
|
4349
4351
|
}, null, 8, ["label"])) : H("", !0),
|
|
4350
|
-
u.value === "upload" ? (p(),
|
|
4352
|
+
u.value === "upload" ? (p(), ae(_, {
|
|
4351
4353
|
key: 1,
|
|
4352
4354
|
variant: "primary",
|
|
4353
4355
|
label: d(r)("inventory.common.next"),
|
|
4354
4356
|
disabled: !c.value || d(E),
|
|
4355
|
-
onClick: x[1] || (x[1] = (
|
|
4357
|
+
onClick: x[1] || (x[1] = (N) => u.value = "preview")
|
|
4356
4358
|
}, null, 8, ["label", "disabled"])) : H("", !0),
|
|
4357
|
-
u.value === "preview" ? (p(),
|
|
4359
|
+
u.value === "preview" ? (p(), ae(In, {
|
|
4358
4360
|
key: 2,
|
|
4359
4361
|
label: d(r)("inventory.closing.draft.createDraft.submit"),
|
|
4360
4362
|
disabled: d(J) || d(g).length === 0 || b.value,
|
|
@@ -4368,7 +4370,7 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4368
4370
|
label: d(r)("inventory.common.close"),
|
|
4369
4371
|
onClick: T
|
|
4370
4372
|
}, null, 8, ["label"]),
|
|
4371
|
-
u.value === "upload" ? (p(),
|
|
4373
|
+
u.value === "upload" ? (p(), ae(_, {
|
|
4372
4374
|
key: 3,
|
|
4373
4375
|
class: "ml-auto",
|
|
4374
4376
|
variant: "secondary",
|
|
@@ -4382,28 +4384,28 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4382
4384
|
}, 8, ["model-value", "header"]);
|
|
4383
4385
|
};
|
|
4384
4386
|
}
|
|
4385
|
-
}),
|
|
4387
|
+
}), dl = ["onClick"], ml = { class: "flex items-start gap-8" }, pl = { class: "fm-typo-body-md-400 line-clamp-3 w-full" }, fl = { class: "flex flex-col gap-8" }, vl = { class: "flex items-start gap-4" }, gl = { class: "flex-1 flex flex-col gap-8" }, yl = { class: "flex flex-col" }, bl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, hl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, _l = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, kl = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, wl = {
|
|
4386
4388
|
key: 0,
|
|
4387
4389
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
4388
|
-
},
|
|
4390
|
+
}, ei = /* @__PURE__ */ De({
|
|
4389
4391
|
__name: "ClosingDraftView",
|
|
4390
4392
|
setup(t) {
|
|
4391
|
-
const { t: o } =
|
|
4393
|
+
const { t: o } = et(), { viewDraft: e } = yt(), { viewClosingDraftProps: n, viewClosingDraftShow: l } = un(yt()), r = qe(), s = wo(), u = on(), { breakpoints: c } = an();
|
|
4392
4394
|
r.watchLocation(s.onLocationChanged);
|
|
4393
|
-
const b = q(""), g =
|
|
4395
|
+
const b = q(""), g = Ue();
|
|
4394
4396
|
function S(_) {
|
|
4395
4397
|
const $ = /* @__PURE__ */ new Date();
|
|
4396
4398
|
return $.setDate($.getDate() - _), $;
|
|
4397
4399
|
}
|
|
4398
4400
|
const J = (() => {
|
|
4399
|
-
const _ = Ke, $ = /* @__PURE__ */ new Date(), L = S($.getDay()),
|
|
4401
|
+
const _ = Ke, $ = /* @__PURE__ */ new Date(), L = S($.getDay()), N = S($.getDay() + 1), ve = S($.getDay() + 7), oe = new Date($.getFullYear(), $.getMonth(), 1), M = new Date($.getFullYear(), $.getMonth() + 1, 0), f = new Date($.getFullYear(), $.getMonth() - 1, 1), y = new Date($.getFullYear(), $.getMonth(), 0);
|
|
4400
4402
|
return [
|
|
4401
4403
|
{ label: "Today", value: { startDate: _($), endDate: _($) } },
|
|
4402
4404
|
{ label: "Yesterday", value: { startDate: _(S(1)), endDate: _(S(1)) } },
|
|
4403
4405
|
{ label: "This week", value: { startDate: _(L), endDate: _($) } },
|
|
4404
|
-
{ label: "Last week", value: { startDate: _(ve), endDate: _(
|
|
4406
|
+
{ label: "Last week", value: { startDate: _(ve), endDate: _(N) } },
|
|
4405
4407
|
{ label: "Last 7 days", value: { startDate: _(S(7)), endDate: _(S(1)) } },
|
|
4406
|
-
{ label: "This month", value: { startDate: _(oe), endDate: _(
|
|
4408
|
+
{ label: "This month", value: { startDate: _(oe), endDate: _(M) } },
|
|
4407
4409
|
{ label: "Last month", value: { startDate: _(f), endDate: _(y) } }
|
|
4408
4410
|
];
|
|
4409
4411
|
})(), E = q();
|
|
@@ -4419,7 +4421,7 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4419
4421
|
const P = q(!1), Z = C(() => c.value.xs || c.value.sm), X = C(() => Z.value ? 10 : 20), z = C(
|
|
4420
4422
|
() => {
|
|
4421
4423
|
var _;
|
|
4422
|
-
return ((_ = r._currentLocation) == null ? void 0 : _.type) ===
|
|
4424
|
+
return ((_ = r._currentLocation) == null ? void 0 : _.type) === cn.enum.warehouse;
|
|
4423
4425
|
}
|
|
4424
4426
|
);
|
|
4425
4427
|
function F(_) {
|
|
@@ -4440,7 +4442,7 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4440
4442
|
return _.column.columnDef.meta;
|
|
4441
4443
|
}
|
|
4442
4444
|
function w(_) {
|
|
4443
|
-
const $ =
|
|
4445
|
+
const $ = Xn(k(_)), L = $.totalAmount.toLocaleString("en-MY", {
|
|
4444
4446
|
minimumFractionDigits: 2,
|
|
4445
4447
|
maximumFractionDigits: 2
|
|
4446
4448
|
});
|
|
@@ -4468,14 +4470,14 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4468
4470
|
return [...z.value ? [_] : [], $];
|
|
4469
4471
|
});
|
|
4470
4472
|
return (_, $) => (p(), A(le, null, [
|
|
4471
|
-
h(
|
|
4473
|
+
h(nn, {
|
|
4472
4474
|
title: d(o)("inventory.closing.draft.title"),
|
|
4473
4475
|
actions: re.value,
|
|
4474
4476
|
"onClick:action": F
|
|
4475
4477
|
}, {
|
|
4476
4478
|
default: ee(() => [
|
|
4477
4479
|
a("div", {
|
|
4478
|
-
class:
|
|
4480
|
+
class: we([
|
|
4479
4481
|
"flex flex-col gap-8 max-h-full",
|
|
4480
4482
|
{
|
|
4481
4483
|
"p-0": Z.value,
|
|
@@ -4483,7 +4485,7 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4483
4485
|
}
|
|
4484
4486
|
])
|
|
4485
4487
|
}, [
|
|
4486
|
-
h(
|
|
4488
|
+
h(xn, {
|
|
4487
4489
|
"change-location": "",
|
|
4488
4490
|
searchable: "",
|
|
4489
4491
|
"date-range-query": "",
|
|
@@ -4493,8 +4495,8 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4493
4495
|
"date-range": I.value,
|
|
4494
4496
|
"onUpdate:dateRange": $[1] || ($[1] = (L) => I.value = L)
|
|
4495
4497
|
}, null, 8, ["predefined-date-ranges", "search", "date-range"]),
|
|
4496
|
-
h(
|
|
4497
|
-
style:
|
|
4498
|
+
h(Dn, {
|
|
4499
|
+
style: gt(d(u).tableHeight),
|
|
4498
4500
|
"column-defs": d(s).columnDefs,
|
|
4499
4501
|
rows: d(s).drafts,
|
|
4500
4502
|
"onUpdate:rows": $[2] || ($[2] = (L) => d(s).drafts = L),
|
|
@@ -4505,7 +4507,7 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4505
4507
|
ref: E,
|
|
4506
4508
|
"search-value": b.value,
|
|
4507
4509
|
loading: d(s).loading,
|
|
4508
|
-
"fetch-detail": (L,
|
|
4510
|
+
"fetch-detail": (L, N) => d(e)(L._id, N),
|
|
4509
4511
|
"detail-to-row": d(s).detailToRow,
|
|
4510
4512
|
"page-size": X.value
|
|
4511
4513
|
}, {
|
|
@@ -4513,78 +4515,78 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4513
4515
|
a("tr", {
|
|
4514
4516
|
class: "border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm cursor-pointer",
|
|
4515
4517
|
"data-testid": "closing-draft-row",
|
|
4516
|
-
onClick: (
|
|
4518
|
+
onClick: (N) => B(L.original)
|
|
4517
4519
|
}, [
|
|
4518
|
-
(p(!0), A(le, null, he(L.getVisibleCells(), (
|
|
4519
|
-
var ve, oe,
|
|
4520
|
+
(p(!0), A(le, null, he(L.getVisibleCells(), (N) => {
|
|
4521
|
+
var ve, oe, M, f;
|
|
4520
4522
|
return p(), A("td", {
|
|
4521
|
-
key:
|
|
4522
|
-
class:
|
|
4523
|
+
key: N.id,
|
|
4524
|
+
class: we([
|
|
4523
4525
|
"h-[56px] text-fm-color-typo-primary align-top",
|
|
4524
|
-
((ve = x(
|
|
4526
|
+
((ve = x(N)) == null ? void 0 : ve.cellClass) ?? "px-16 py-12"
|
|
4525
4527
|
]),
|
|
4526
|
-
style:
|
|
4527
|
-
width: (oe = x(
|
|
4528
|
-
maxWidth: (
|
|
4529
|
-
textAlign: ((f = x(
|
|
4528
|
+
style: gt({
|
|
4529
|
+
width: (oe = x(N)) == null ? void 0 : oe.width,
|
|
4530
|
+
maxWidth: (M = x(N)) == null ? void 0 : M.maxWidth,
|
|
4531
|
+
textAlign: ((f = x(N)) == null ? void 0 : f.textAlign) ?? "left"
|
|
4530
4532
|
})
|
|
4531
4533
|
}, [
|
|
4532
|
-
a("div",
|
|
4533
|
-
a("span",
|
|
4534
|
+
a("div", ml, [
|
|
4535
|
+
a("span", pl, [
|
|
4534
4536
|
h(d(Je), {
|
|
4535
|
-
render:
|
|
4536
|
-
props:
|
|
4537
|
+
render: N.column.columnDef.cell,
|
|
4538
|
+
props: N.getContext()
|
|
4537
4539
|
}, null, 8, ["render", "props"])
|
|
4538
4540
|
])
|
|
4539
4541
|
])
|
|
4540
4542
|
], 6);
|
|
4541
4543
|
}), 128))
|
|
4542
|
-
], 8,
|
|
4544
|
+
], 8, dl)
|
|
4543
4545
|
]),
|
|
4544
4546
|
"list-row": ee((L) => [
|
|
4545
|
-
a("div",
|
|
4546
|
-
a("div",
|
|
4547
|
-
h(
|
|
4547
|
+
a("div", fl, [
|
|
4548
|
+
a("div", vl, [
|
|
4549
|
+
h(Bn, {
|
|
4548
4550
|
class: "flex-1",
|
|
4549
4551
|
"data-testid": "closing-draft-row",
|
|
4550
4552
|
row: L,
|
|
4551
|
-
onRowClick: (
|
|
4553
|
+
onRowClick: (N) => B(N)
|
|
4552
4554
|
}, {
|
|
4553
|
-
default: ee((
|
|
4554
|
-
var ve, oe,
|
|
4555
|
+
default: ee((N) => {
|
|
4556
|
+
var ve, oe, M, f, y, U, Y, de, j, G, ie, se, Ae, _e, Be, tt, ot, nt, Pe, Re;
|
|
4555
4557
|
return [
|
|
4556
|
-
a("div",
|
|
4557
|
-
a("div",
|
|
4558
|
-
a("div",
|
|
4558
|
+
a("div", gl, [
|
|
4559
|
+
a("div", yl, [
|
|
4560
|
+
a("div", bl, [
|
|
4559
4561
|
h(d(Je), {
|
|
4560
|
-
render: (
|
|
4561
|
-
props: (y = (f =
|
|
4562
|
+
render: (M = (oe = (ve = N._id) == null ? void 0 : ve.column) == null ? void 0 : oe.columnDef) == null ? void 0 : M.cell,
|
|
4563
|
+
props: (y = (f = N._id) == null ? void 0 : f.getContext) == null ? void 0 : y.call(f)
|
|
4562
4564
|
}, null, 8, ["render", "props"])
|
|
4563
4565
|
]),
|
|
4564
|
-
a("div",
|
|
4566
|
+
a("div", hl, [
|
|
4565
4567
|
h(d(Je), {
|
|
4566
|
-
render: (de = (Y = (
|
|
4567
|
-
props: (G = (j =
|
|
4568
|
+
render: (de = (Y = (U = N.name) == null ? void 0 : U.column) == null ? void 0 : Y.columnDef) == null ? void 0 : de.cell,
|
|
4569
|
+
props: (G = (j = N.name) == null ? void 0 : j.getContext) == null ? void 0 : G.call(j)
|
|
4568
4570
|
}, null, 8, ["render", "props"])
|
|
4569
4571
|
]),
|
|
4570
|
-
a("div",
|
|
4572
|
+
a("div", _l, R([
|
|
4571
4573
|
...L.original.previewItemNames,
|
|
4572
4574
|
...L.original.itemCount - L.original.previewItemNames.length > 0 ? [
|
|
4573
4575
|
`and ${L.original.itemCount - L.original.previewItemNames.length} more items`
|
|
4574
4576
|
] : []
|
|
4575
4577
|
].join(", ")), 1),
|
|
4576
|
-
a("div",
|
|
4578
|
+
a("div", kl, [
|
|
4577
4579
|
h(d(Je), {
|
|
4578
|
-
render: (Ae = (
|
|
4579
|
-
props: (Be = (_e =
|
|
4580
|
+
render: (Ae = (se = (ie = N.ref) == null ? void 0 : ie.column) == null ? void 0 : se.columnDef) == null ? void 0 : Ae.cell,
|
|
4581
|
+
props: (Be = (_e = N.ref) == null ? void 0 : _e.getContext) == null ? void 0 : Be.call(_e)
|
|
4580
4582
|
}, null, 8, ["render", "props"])
|
|
4581
4583
|
])
|
|
4582
4584
|
]),
|
|
4583
|
-
k(L).length ? (p(), A("div",
|
|
4585
|
+
k(L).length ? (p(), A("div", wl, R(w(L)), 1)) : H("", !0),
|
|
4584
4586
|
a("div", null, [
|
|
4585
4587
|
h(d(Je), {
|
|
4586
|
-
render: (
|
|
4587
|
-
props: (Re = (Pe =
|
|
4588
|
+
render: (nt = (ot = (tt = N.status) == null ? void 0 : tt.column) == null ? void 0 : ot.columnDef) == null ? void 0 : nt.cell,
|
|
4589
|
+
props: (Re = (Pe = N.status) == null ? void 0 : Pe.getContext) == null ? void 0 : Re.call(Pe)
|
|
4588
4590
|
}, null, 8, ["render", "props"])
|
|
4589
4591
|
])
|
|
4590
4592
|
])
|
|
@@ -4601,15 +4603,15 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4601
4603
|
]),
|
|
4602
4604
|
_: 1
|
|
4603
4605
|
}, 8, ["title", "actions"]),
|
|
4604
|
-
h(
|
|
4606
|
+
h(ul, {
|
|
4605
4607
|
show: P.value,
|
|
4606
4608
|
"onUpdate:show": $[3] || ($[3] = (L) => P.value = L),
|
|
4607
4609
|
onSubmitted: d(s).refresh
|
|
4608
4610
|
}, null, 8, ["show", "onSubmitted"]),
|
|
4609
|
-
(p(),
|
|
4610
|
-
h(
|
|
4611
|
+
(p(), ae(en, { to: "body" }, [
|
|
4612
|
+
h(Nr, tn(d(n), {
|
|
4611
4613
|
show: d(l),
|
|
4612
|
-
"onUpdate:show": $[4] || ($[4] = (L) =>
|
|
4614
|
+
"onUpdate:show": $[4] || ($[4] = (L) => bt(l) ? l.value = L : null),
|
|
4613
4615
|
onSubmitted: $[5] || ($[5] = () => (l.value = !1, d(s).refresh())),
|
|
4614
4616
|
onRefresh: $[6] || ($[6] = (L) => d(s).updateDraftRef(L))
|
|
4615
4617
|
}), null, 16, ["show"])
|
|
@@ -4618,5 +4620,5 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
|
|
|
4618
4620
|
}
|
|
4619
4621
|
});
|
|
4620
4622
|
export {
|
|
4621
|
-
|
|
4623
|
+
ei as default
|
|
4622
4624
|
};
|