@feedmepos/mf-inventory-portal 1.8.0-dev.1 → 1.8.0-dev.2
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-DVHgBTHP.js +1499 -0
- package/dist/{ApprovalView-C8_ax05b.js → ApprovalView-RaXuWWSu.js} +9 -9
- package/dist/{BindingsDialog-t0ZY9eh5.js → BindingsDialog-DomvXijP.js} +2 -2
- package/dist/{BindingsPicker-C0Qblmml.js → BindingsPicker-DGnzxEs7.js} +2 -2
- package/dist/{BindingsTable-CsqUBbRA.js → BindingsTable-DfG9kWrv.js} +4 -4
- package/dist/{BulkReceiveRequestView-DAG-TMox.js → BulkReceiveRequestView-DxHWrfbi.js} +21 -22
- package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CVekIoiN.js +151 -0
- package/dist/{ClosingDraftView-CdKp4Ny6.js → ClosingDraftView-C3n66bbh.js} +20 -20
- package/dist/{ClosingHistoryView-Blyq9-BS.js → ClosingHistoryView-kdpYGy1Y.js} +5 -5
- package/dist/{ClosingTemplateView-C326DL4q.js → ClosingTemplateView-DwGloYxn.js} +302 -291
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CXjubRbj.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-9eY_r8LF.js} +1 -1
- package/dist/{DefaultView-CsIMmQAY.js → DefaultView-JC_e4xgC.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-eTrMvJzA.js → DeliveryOrderPrintPreview-BBCvI67S.js} +2 -2
- package/dist/DeprecateSoonWarningDialog.vue_vue_type_script_setup_true_lang-5Cc08Svt.js +58 -0
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-B7nBbxMo.js → EmailDialog.vue_vue_type_script_setup_true_lang-H4FWc9ga.js} +1663 -1668
- package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-C1C8aDA6.js +61 -0
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CI2KTzDs.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Q8Mptiv3.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Db_FiSRe.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CE1_yyHe.js} +2 -2
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CGJi3f86.js +120 -0
- package/dist/{FmMultiselectDialog-CYUxtxnS.js → FmMultiselectDialog-DCaRlBIy.js} +2 -2
- package/dist/{FmMultiselectDialog-BAw-gp5K.js → FmMultiselectDialog-yVPY5aBV.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DOkV11NN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-ClaLVtpK.js} +6 -6
- package/dist/{ImportView-BmotFC-3.js → ImportView-DQrVMzxN.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVCCpvS4.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-7lT5UZc8.js} +1 -1
- package/dist/IngredientGroupView-BMUnEaY7.js +1000 -0
- package/dist/{IngredientsView-CZ6E7cXf.js → IngredientsView-DPj9lBTK.js} +303 -296
- package/dist/{IntegrationExplorerView-B15ND4Fg.js → IntegrationExplorerView-CO2wpUR_.js} +4 -4
- package/dist/{IntegrationView-hkNhsqx2.js → IntegrationView-DIeZoey0.js} +2403 -2408
- package/dist/{InventoryBindingForm-SfuUF0_O.js → InventoryBindingForm-Cj4_Chue.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Zq81p_MF.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CaBOK7NC.js} +5 -5
- package/dist/{InventoryBindingSummary-DUcukkyJ.js → InventoryBindingSummary-yzGzd7jJ.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BmfROiLM.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DzzTPdyF.js} +1 -1
- package/dist/{ProductionRunDetailView-BwgRX-14.js → ProductionRunDetailView-Cw-ecaey.js} +4 -4
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BbNXNhpr.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BYyiiAWb.js} +7 -7
- package/dist/{ProductionRunView-CZU7LY9-.js → ProductionRunView-C11eseXQ.js} +3 -3
- package/dist/{PublishView-DS2FZ66p.js → PublishView-CPK9NeVF.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-CZa0MVAs.js → PurchaseOrderPrintPreview-DosqWQeN.js} +2 -2
- package/dist/{ReceiveRequestView-Bk5b3nVB.js → ReceiveRequestView-BxSkpK2t.js} +15 -16
- package/dist/{RecipeView-DvI6X-uN.js → RecipeView-oHDWsT0P.js} +19 -20
- package/dist/SettingsView-QlUNwFhM.js +983 -0
- package/dist/{StockView-Z9wGihT7.js → StockView-a8LbVZ_7.js} +324 -322
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DdZg9T4n.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-GdGJCuc0.js} +1 -1
- package/dist/{SupplierView-D8q6siZW.js → SupplierView-BKxKoi_0.js} +451 -447
- package/dist/{SurchargeView-Db_5YFoR.js → SurchargeView-Db4cwhZv.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-WOVs4Fr1.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CpkF77Ow.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BtoP4XgE.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CCCj4WVF.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Bljc4Vuy.js → TransferDetails.vue_vue_type_script_setup_true_lang-CFNPXqt5.js} +39 -40
- package/dist/{TransferTemplateView-DtsJzmUr.js → TransferTemplateView-CzwxOBMQ.js} +22 -23
- package/dist/{UnitCostHistoryView-BqDiQ4IE.js → UnitCostHistoryView-CqcyjCCd.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BjSmg5LX.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DO80_8SZ.js} +4 -4
- package/dist/{UnitView-CM695-VI.js → UnitView-BqdK1AM_.js} +8 -8
- package/dist/{WarehouseView-BdidU4p6.js → WarehouseView-COJM9IXM.js} +193 -189
- package/dist/{WastageTemplateView-DdhwdXT6.js → WastageTemplateView-DW3viTHN.js} +15 -15
- package/dist/api/feature-flags.d.ts +10 -0
- package/dist/api/license.d.ts +9 -0
- package/dist/{app-Cb5s4jMu.js → app-yvK__CBL.js} +143 -106
- package/dist/app.d.ts +36 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-DnqnpXxn.js → closing-template-DezidSM0.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 +25 -0
- package/dist/components/{PreviewBadge.vue.d.ts → FeatureCapabilityGate.vue.d.ts} +10 -7
- 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-2XjepIqc.js} +1 -1
- package/dist/{dayjs.min-Zbd6-uVD.js → dayjs.min-CNp5DLBB.js} +1 -1
- package/dist/{decimal-Df6a50Ld.js → decimal-Z7oJdGk8.js} +2 -2
- package/dist/{defineDeepModel-Brbsikbi.js → defineDeepModel-CMxJn_H2.js} +1 -1
- package/dist/{duplicate-template-B9kuShaF.js → duplicate-template-BetV5oy_.js} +1 -1
- package/dist/{inventory-core-dart.default-DDRxXXnt.js → feature-CkWaZ-5K.js} +3046 -1837
- package/dist/feature-flags/core.d.ts +27 -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 +24 -0
- package/dist/feature-flags/vue.d.ts +14 -0
- package/dist/{format-time-from-id-DmUjUcVj.js → format-time-from-id-DatSI9uD.js} +1 -1
- package/dist/{format-unit-display-CsQA0SQd.js → format-unit-display-DM5We5cx.js} +13 -13
- package/dist/id-to-date-Dxw2jKhy.js +67 -0
- package/dist/{import-export.helper-DCQ6oX9s.js → import-export.helper-BOmADwUw.js} +6 -6
- package/dist/{index-C-mazZwS.js → index-7fz5sGDO.js} +3 -3
- package/dist/{index-UmM6gHJ1.js → index-CIH9NCvs.js} +1 -1
- package/dist/{index-BXaIMGnI.js → index-ClYgfwW7.js} +1 -1
- package/dist/{lz-string-Bibw5D_6.js → lz-string-CCsc2X7t.js} +1 -1
- package/dist/{netsuite-Bev0OtQT.js → netsuite-COumFXC2.js} +2 -2
- package/dist/{number-y_W4pn_d.js → number-gSLvxNqA.js} +3 -3
- package/dist/portal-feature-catalog-yGIESKTc.js +246 -0
- package/dist/{predefined-templates-BHvUnTk_.js → predefined-templates-Bw9A9LNA.js} +1 -1
- package/dist/{purchase-order-template-DgOKEzhS.js → purchase-order-template-BaZjdGq8.js} +1 -1
- package/dist/{recalculationUtils-Dv__DzZh.js → recalculationUtils-t32wAurN.js} +1 -1
- package/dist/{row-action.enum-ncgDYAjP.js → row-action.enum-BDeudY4d.js} +2 -2
- package/dist/{rules-CZTBvenw.js → rules-C1btu0Md.js} +2 -2
- package/dist/{stock-CxCRZo_D.js → stock-B59sfN28.js} +1 -1
- package/dist/{stock-XINW8JOM.js → stock-BF86TMW0.js} +3 -3
- package/dist/stores/feature.d.ts +12 -0
- package/dist/{supplier-CkZdeMcl.js → supplier-DnbLJ_cS.js} +2 -2
- package/dist/{surcharge-FRSFqjGl.js → surcharge-C1uE3uQa.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-Cm1styDr.js → uom-rules-DjfyrFHJ.js} +1 -1
- package/dist/{use-ingredient-select-dialog-ntAqHX04.js → use-ingredient-select-dialog-7A7fWyEH.js} +2 -2
- package/dist/{use-inventory-binding-dialog-DVIJO8Cl.js → use-inventory-binding-dialog-Cc1tjTfV.js} +2 -2
- package/dist/{use-template-enabled-locations-CIZqw-Z8.js → use-template-enabled-locations-C-Hqqgzt.js} +2 -2
- package/dist/{use-transfer-locations-CM5vNttA.js → use-transfer-locations-CqsXvOI2.js} +2 -2
- package/dist/{useHrmPermission-CslLuBoP.js → useHrmPermission-BzwD3Ctc.js} +1 -1
- package/dist/useNavigationMenu-PrZg9HS7.js +352 -0
- package/dist/{useSseClient-CCV4mPzD.js → useSseClient-FCyLWq8k.js} +1 -1
- package/dist/views/integration/components/IntegrationCard.vue.d.ts +38 -0
- package/dist/views/settings/FeatureFlagView.vue.d.ts +2 -0
- package/dist/{vue-i18n-C5j4EQhi.js → vue-i18n-C34f-Tph.js} +434 -434
- package/dist/{xlsx.util-B50OvX4z.js → xlsx.util-X4amwe_k.js} +2 -2
- package/package.json +6 -6
- package/dist/App-BXgpGzGR.js +0 -1476
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-zcEv1Swg.js +0 -243
- package/dist/IngredientGroupView-qrR9ksEn.js +0 -985
- 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/SettingsView-sThYErMz.js +0 -698
- package/dist/feature-Ckn5ra3z.js +0 -1136
- package/dist/useNavigationMenu-CSinmNCY.js +0 -172
- /package/dist/components/{FmFeatureFlagDialog.vue.d.ts → DeprecateSoonPill.vue.d.ts} +0 -0
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { defineComponent as te, resolveComponent as G, createElementBlock as T, openBlock as _, createElementVNode as r, createCommentVNode as H, normalizeClass as Z, createTextVNode as K, toDisplayString as D, unref as f, createVNode as A, withCtx as j, Fragment as Y, renderList as X, ref as V, computed as U, watch as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { useDialogChild as
|
|
5
|
-
import { defineStore as
|
|
1
|
+
import { defineComponent as te, resolveComponent as G, createElementBlock as T, openBlock as _, createElementVNode as r, createCommentVNode as H, normalizeClass as Z, createTextVNode as K, toDisplayString as D, unref as f, createVNode as A, withCtx as j, Fragment as Y, renderList as X, ref as V, computed as U, watch as Ce, createSlots as Qe, createBlock as W, h as Fe, createStaticVNode as Je, normalizeStyle as De, withDirectives as qe, isRef as Ue, vModelText as Xe, withModifiers as he, Teleport as Ze, normalizeProps as et, guardReactiveProps as tt, mergeProps as ot } from "vue";
|
|
2
|
+
import { u as nt, _ as st } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
|
|
3
|
+
import { useCoreStore as Se, useI18n as ne } from "@feedmepos/mf-common";
|
|
4
|
+
import { useDialogChild as at, useSnackbar as de, useDialog as Ie, FmButtonVariant as _e, components as rt, useProxiedModel as lt, useBreakpoints as it } from "@feedmepos/ui-library";
|
|
5
|
+
import { defineStore as Ve, storeToRefs as ze } from "pinia";
|
|
6
6
|
import { F as oe } from "./form-mode.enum-BKiNVH6A.js";
|
|
7
|
-
import { a as
|
|
8
|
-
import { a as
|
|
9
|
-
import { t as
|
|
10
|
-
import { F as
|
|
11
|
-
import { f as
|
|
12
|
-
import { u as
|
|
13
|
-
import { D as
|
|
14
|
-
import { c as
|
|
15
|
-
import { f as
|
|
16
|
-
import { _ as
|
|
17
|
-
import { u as
|
|
18
|
-
import { _ as
|
|
19
|
-
import { _ as
|
|
20
|
-
import { R as
|
|
21
|
-
import { u as
|
|
22
|
-
import { d as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { _ as
|
|
7
|
+
import { a as ue } from "./closing-template-DezidSM0.js";
|
|
8
|
+
import { a as Ae, m as ct, u as Re, c as Ge } from "./app-yvK__CBL.js";
|
|
9
|
+
import { t as $e, a as Pe, d as Me, s as Oe, r as mt } from "./xlsx.util-X4amwe_k.js";
|
|
10
|
+
import { F as dt } from "./FmDroppableField-J0tG_U3w.js";
|
|
11
|
+
import { f as He, b as we } from "./date2-2XjepIqc.js";
|
|
12
|
+
import { u as ut } from "./netsuite-COumFXC2.js";
|
|
13
|
+
import { D as xe, R as J } from "./row-action.enum-BDeudY4d.js";
|
|
14
|
+
import { c as pt } from "./component-BmLAdDiY.js";
|
|
15
|
+
import { f as ft } from "./format-time-from-id-DatSI9uD.js";
|
|
16
|
+
import { _ as yt } from "./TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CCCj4WVF.js";
|
|
17
|
+
import { u as vt } from "./duplicate-template-BetV5oy_.js";
|
|
18
|
+
import { _ as gt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CGJi3f86.js";
|
|
19
|
+
import { _ as bt } from "./CursorPaginatedTable.vue_vue_type_script_setup_true_lang-BCUhtL_B.js";
|
|
20
|
+
import { R as ht, A as _t } from "./rules-C1btu0Md.js";
|
|
21
|
+
import { u as je } from "./use-ingredient-select-dialog-7A7fWyEH.js";
|
|
22
|
+
import { d as xt } from "./defineDeepModel-CMxJn_H2.js";
|
|
23
|
+
import { a as kt } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-C1C8aDA6.js";
|
|
24
|
+
import { u as wt } from "./use-template-enabled-locations-C-Hqqgzt.js";
|
|
25
|
+
import { _ as $t } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-CpkF77Ow.js";
|
|
26
|
+
import { _ as Tt, F as ke } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
|
|
26
27
|
import { _ as Ct } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
27
|
-
var
|
|
28
|
-
function
|
|
28
|
+
var Ee = /* @__PURE__ */ ((m) => (m.Ingredients = "Ingredients", m))(Ee || {});
|
|
29
|
+
function Ye(m) {
|
|
29
30
|
const t = m.sku, e = new Set(m.disabledMeasurements);
|
|
30
31
|
return [
|
|
31
32
|
{
|
|
@@ -40,7 +41,7 @@ function Ke(m) {
|
|
|
40
41
|
}))
|
|
41
42
|
];
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
+
function Ke() {
|
|
44
45
|
return [
|
|
45
46
|
{
|
|
46
47
|
id: "code",
|
|
@@ -62,9 +63,9 @@ function We() {
|
|
|
62
63
|
}
|
|
63
64
|
function It(m) {
|
|
64
65
|
var h;
|
|
65
|
-
const e =
|
|
66
|
+
const e = Se().currentBusiness.value, a = (h = m.map((l) => {
|
|
66
67
|
var y;
|
|
67
|
-
const o = l.items.flatMap(
|
|
68
|
+
const o = l.items.flatMap(Ye), g = Ke(), i = [
|
|
68
69
|
["Template ID", l._id],
|
|
69
70
|
["Template name", l.name],
|
|
70
71
|
["Business name", e == null ? void 0 : e.name],
|
|
@@ -78,8 +79,8 @@ function It(m) {
|
|
|
78
79
|
[],
|
|
79
80
|
g.map((x) => x.name),
|
|
80
81
|
...o.map((x) => g.map((d) => x[d.id]))
|
|
81
|
-
],
|
|
82
|
-
return { name: l.name, sheet:
|
|
82
|
+
], F = g.map((x) => `system:${x.id}`), I = $e(i, F);
|
|
83
|
+
return { name: l.name, sheet: I };
|
|
83
84
|
}).reduce(
|
|
84
85
|
(l, o) => {
|
|
85
86
|
var i;
|
|
@@ -90,46 +91,46 @@ function It(m) {
|
|
|
90
91
|
sheets: {},
|
|
91
92
|
sheetOccurence: {}
|
|
92
93
|
}
|
|
93
|
-
)) == null ? void 0 : h.sheets, u = `${e == null ? void 0 : e.name} closing templates (${
|
|
94
|
-
return
|
|
94
|
+
)) == null ? void 0 : h.sheets, u = `${e == null ? void 0 : e.name} closing templates (${He(/* @__PURE__ */ new Date())}).xlsx`, b = Pe(a);
|
|
95
|
+
return Me(b, u), u;
|
|
95
96
|
}
|
|
96
97
|
function Ft(m) {
|
|
97
|
-
|
|
98
|
+
Se().currentBusiness.value;
|
|
98
99
|
const e = 3, k = (i) => {
|
|
99
|
-
const
|
|
100
|
-
y.has(
|
|
101
|
-
for (const x of
|
|
102
|
-
if (
|
|
103
|
-
y.has(x.id) ||
|
|
100
|
+
const F = [], I = i.sku, y = new Set(i.disabledMeasurements || []);
|
|
101
|
+
y.has(I.unit._id) || F.push(I.unit.abbrev);
|
|
102
|
+
for (const x of I.unit.measurements) {
|
|
103
|
+
if (F.length >= e) break;
|
|
104
|
+
y.has(x.id) || F.push(x.abbrev);
|
|
104
105
|
}
|
|
105
|
-
return
|
|
106
|
+
return F;
|
|
106
107
|
}, a = ["#", "Code", "Name", "UOM"], u = [
|
|
107
108
|
["Template:", m.name],
|
|
108
109
|
["Reference:", m.ref ?? ""],
|
|
109
110
|
[],
|
|
110
111
|
a,
|
|
111
|
-
...m.items.map((i,
|
|
112
|
-
const
|
|
112
|
+
...m.items.map((i, F) => {
|
|
113
|
+
const I = k(i);
|
|
113
114
|
return [
|
|
114
|
-
|
|
115
|
+
F + 1,
|
|
115
116
|
// Index starting from 1
|
|
116
117
|
i.sku.code,
|
|
117
118
|
i.sku.name,
|
|
118
119
|
// Add UOM columns (up to MAX_UOM_COLUMNS)
|
|
119
120
|
...Array(e).fill("").map(
|
|
120
|
-
(y, x) =>
|
|
121
|
+
(y, x) => I[x] ? `_____ ${I[x]}` : ""
|
|
121
122
|
)
|
|
122
123
|
];
|
|
123
124
|
})
|
|
124
|
-
], b =
|
|
125
|
+
], b = $e(u, a);
|
|
125
126
|
if (b["!ref"]) {
|
|
126
127
|
const i = {
|
|
127
128
|
top: { style: "thin", color: { rgb: "000000" } },
|
|
128
129
|
bottom: { style: "thin", color: { rgb: "000000" } },
|
|
129
130
|
left: { style: "thin", color: { rgb: "000000" } },
|
|
130
131
|
right: { style: "thin", color: { rgb: "000000" } }
|
|
131
|
-
},
|
|
132
|
-
for (let x =
|
|
132
|
+
}, F = 4, I = F + m.items.length, y = a.map((x, d) => String.fromCharCode(65 + d));
|
|
133
|
+
for (let x = F; x <= I; x++)
|
|
133
134
|
y.forEach((d) => {
|
|
134
135
|
const $ = `${d}${x}`;
|
|
135
136
|
b[$] || (b[$] = { t: "s", v: "" }), b[$].s = {
|
|
@@ -154,11 +155,11 @@ function Ft(m) {
|
|
|
154
155
|
header: 0.3,
|
|
155
156
|
footer: 0.3
|
|
156
157
|
};
|
|
157
|
-
const l = m.name.slice(0, 31), o =
|
|
158
|
-
return
|
|
158
|
+
const l = m.name.slice(0, 31), o = Pe({ [l]: b }), g = `${m.name} - Closing Template (${He(/* @__PURE__ */ new Date())}).xlsx`;
|
|
159
|
+
return Me(o, g), g;
|
|
159
160
|
}
|
|
160
161
|
function Dt() {
|
|
161
|
-
const m =
|
|
162
|
+
const m = Se(), t = Ae(), e = ut(), k = Ye({
|
|
162
163
|
sku: {
|
|
163
164
|
unit: {
|
|
164
165
|
_id: "",
|
|
@@ -171,7 +172,7 @@ function Dt() {
|
|
|
171
172
|
_id: "",
|
|
172
173
|
name: "Sugar"
|
|
173
174
|
}
|
|
174
|
-
})[0], a = m.currentBusiness.value, u =
|
|
175
|
+
})[0], a = m.currentBusiness.value, u = Ke(), b = [
|
|
175
176
|
["Template ID (leave empty to create new)", ""],
|
|
176
177
|
["Template Name", "New template"],
|
|
177
178
|
["Business name", a == null ? void 0 : a.name],
|
|
@@ -186,7 +187,7 @@ function Dt() {
|
|
|
186
187
|
[],
|
|
187
188
|
u.map((y) => y.name),
|
|
188
189
|
u.map((y) => k[y.id])
|
|
189
|
-
], h = u.map((y) => `system:${y.id}`), l =
|
|
190
|
+
], h = u.map((y) => `system:${y.id}`), l = $e(b, h), o = e.isEnabled ? e.state.setting.childItems ?? [] : [], g = o.reduce(
|
|
190
191
|
(y, x) => {
|
|
191
192
|
var S, P;
|
|
192
193
|
const d = (S = e.netSuiteItemIdToSkuId.get(x.parentNetSuiteId)) == null ? void 0 : S[0], $ = (P = e.netSuiteMeasurementIdToMeasurementId.get(
|
|
@@ -206,7 +207,7 @@ function Dt() {
|
|
|
206
207
|
), y);
|
|
207
208
|
},
|
|
208
209
|
{}
|
|
209
|
-
), i =
|
|
210
|
+
), i = $e(
|
|
210
211
|
[
|
|
211
212
|
...t.skus.flatMap((y) => [
|
|
212
213
|
[y.code, y.name, y.unit.abbrev, !0],
|
|
@@ -232,16 +233,16 @@ function Dt() {
|
|
|
232
233
|
"Enabled (true/false)",
|
|
233
234
|
...o.length ? ["Netsuite Parent"] : []
|
|
234
235
|
]
|
|
235
|
-
),
|
|
236
|
+
), F = Pe({
|
|
236
237
|
Template: l,
|
|
237
238
|
Ingredients: i
|
|
238
|
-
}),
|
|
239
|
-
return
|
|
239
|
+
}), I = `${a == null ? void 0 : a.name} transfer templates import.xlsx`;
|
|
240
|
+
return Me(F, I), I;
|
|
240
241
|
}
|
|
241
242
|
function St(m) {
|
|
242
243
|
if (!m.length || `${m[0]}`.toLocaleLowerCase() === "all")
|
|
243
244
|
return [];
|
|
244
|
-
const t = /(.*) \(((warehouse_|restaurant_).{24,})\)/, k =
|
|
245
|
+
const t = /(.*) \(((warehouse_|restaurant_).{24,})\)/, k = Re().locationByDbName;
|
|
245
246
|
return m.map((a) => {
|
|
246
247
|
const u = new Array(), b = a.trim(), h = t.exec(b);
|
|
247
248
|
if (!h)
|
|
@@ -269,7 +270,7 @@ function At(m) {
|
|
|
269
270
|
b,
|
|
270
271
|
h,
|
|
271
272
|
l
|
|
272
|
-
] =
|
|
273
|
+
] = Oe(m);
|
|
273
274
|
return {
|
|
274
275
|
id: `${e[1] ?? ""}`.trim(),
|
|
275
276
|
name: `${k[1] ?? ""}`.trim(),
|
|
@@ -290,18 +291,18 @@ function Rt(m) {
|
|
|
290
291
|
o,
|
|
291
292
|
g,
|
|
292
293
|
...i
|
|
293
|
-
] =
|
|
294
|
+
] = Oe(m);
|
|
294
295
|
if (!t || !t.length || t.some((d) => d.length && !d.startsWith("system:")))
|
|
295
296
|
throw new Error("Missing meta header. Excel file does not come from the template.");
|
|
296
|
-
const
|
|
297
|
+
const F = t.map((d) => d.split(":")[1]), y = ["code", "name", "unit", "enabled"].filter((d) => !F.includes(d));
|
|
297
298
|
if (y.length)
|
|
298
299
|
throw new Error(
|
|
299
300
|
`Missing meta headers (${y.join()}). Excel file does not come from the template.`
|
|
300
301
|
);
|
|
301
302
|
return i.map((d, $) => {
|
|
302
303
|
const n = {};
|
|
303
|
-
for (const w in
|
|
304
|
-
const S =
|
|
304
|
+
for (const w in F) {
|
|
305
|
+
const S = F[w];
|
|
305
306
|
Object.assign(n, { [S]: d[w] });
|
|
306
307
|
}
|
|
307
308
|
return {
|
|
@@ -321,7 +322,7 @@ function Pt(m) {
|
|
|
321
322
|
);
|
|
322
323
|
}
|
|
323
324
|
function Mt(m) {
|
|
324
|
-
const t = m.parent.data, e = new Array(), a =
|
|
325
|
+
const t = m.parent.data, e = new Array(), a = Ae().skuByCode[t.code ?? ""];
|
|
325
326
|
if (!a)
|
|
326
327
|
return e.push(`Cannot find ingredient of code ${t.code} ${t.name}`), { errors: e };
|
|
327
328
|
const u = {
|
|
@@ -331,7 +332,7 @@ function Mt(m) {
|
|
|
331
332
|
`Cannot find measurement unit of ${t.unit} for (${t.code}) ${t.name}.`
|
|
332
333
|
) : (t.enabled === !0 || `${t.enabled}`.toLocaleLowerCase() === "true") && b.delete(a.unit._id);
|
|
333
334
|
for (const l of m.children) {
|
|
334
|
-
const o = l.data, g = o.unit === a.unit.abbrev ? a.unit : void 0, i = a.unit.measurements.find((
|
|
335
|
+
const o = l.data, g = o.unit === a.unit.abbrev ? a.unit : void 0, i = a.unit.measurements.find((F) => F.abbrev === o.unit);
|
|
335
336
|
if (!i && !g) {
|
|
336
337
|
e.push(
|
|
337
338
|
`Cannot find measurement unit of ${o.unit} for (${t.code}) ${t.name}.`
|
|
@@ -344,18 +345,18 @@ function Mt(m) {
|
|
|
344
345
|
}
|
|
345
346
|
async function Et(m) {
|
|
346
347
|
const t = m.SheetNames.filter(
|
|
347
|
-
(u) => !Object.values(
|
|
348
|
-
), k = await
|
|
348
|
+
(u) => !Object.values(Ee).map(String).includes(u)
|
|
349
|
+
), k = await ue().readTemplates(), a = ct(k, "_id");
|
|
349
350
|
try {
|
|
350
351
|
return t.reduce(
|
|
351
352
|
(u, b) => {
|
|
352
353
|
const h = new Array(), l = m.Sheets[b], o = At(l), g = St(o.locations), i = g.filter((n) => n.location).map((n) => n.location);
|
|
353
354
|
h.push(...g.flatMap((n) => n.errors));
|
|
354
|
-
const
|
|
355
|
+
const F = Rt(l).filter(
|
|
355
356
|
(n) => n.data.code || n.data.unit
|
|
356
|
-
),
|
|
357
|
-
h.push(...
|
|
358
|
-
const y =
|
|
357
|
+
), I = Pt(F);
|
|
358
|
+
h.push(...I.errors);
|
|
359
|
+
const y = I.result.map(
|
|
359
360
|
(n) => Mt(n)
|
|
360
361
|
);
|
|
361
362
|
h.push(...y.flatMap((n) => n.errors));
|
|
@@ -423,7 +424,7 @@ async function Et(m) {
|
|
|
423
424
|
const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-col" }, Lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Ut = {
|
|
424
425
|
key: 0,
|
|
425
426
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
426
|
-
}, Vt = { key: 0 },
|
|
427
|
+
}, Vt = { key: 0 }, Le = /* @__PURE__ */ te({
|
|
427
428
|
__name: "ClosingTemplateImportItem",
|
|
428
429
|
props: {
|
|
429
430
|
type: {},
|
|
@@ -495,22 +496,22 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
495
496
|
}, qt = { class: "fm-typo-en-body-lg-600" }, Xt = /* @__PURE__ */ te({
|
|
496
497
|
__name: "ClosingTemplateImport",
|
|
497
498
|
setup(m) {
|
|
498
|
-
const t = V(null), e =
|
|
499
|
-
() => !!b.value.length || h.value.some((
|
|
499
|
+
const t = V(null), e = at(), k = de(), a = V(!1), u = V(!1), b = V(new Array()), h = V([]), l = V([]), o = U(
|
|
500
|
+
() => !!b.value.length || h.value.some((I) => I.errors.length) || l.value.some((I) => I.errors.length)
|
|
500
501
|
), g = U(
|
|
501
502
|
() => !!h.value.length || !!l.value.length
|
|
502
503
|
), { t: i } = ne();
|
|
503
|
-
async function I
|
|
504
|
+
async function F(I) {
|
|
504
505
|
b.value = [], h.value = [], l.value = [];
|
|
505
506
|
try {
|
|
506
507
|
a.value = !0;
|
|
507
508
|
const [y] = await Promise.all([
|
|
508
|
-
|
|
509
|
+
mt(I),
|
|
509
510
|
// fake buffer
|
|
510
511
|
new Promise((n) => setTimeout(n, 1e3))
|
|
511
512
|
]);
|
|
512
513
|
if (!y.SheetNames.filter(
|
|
513
|
-
(n) => !Object.values(
|
|
514
|
+
(n) => !Object.values(Ee).map(String).includes(n)
|
|
514
515
|
).find((n) => n)) {
|
|
515
516
|
b.value.push(i("inventory.ingredient.import.fileError.noSheet"));
|
|
516
517
|
return;
|
|
@@ -540,9 +541,9 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
540
541
|
}), a.value = !1;
|
|
541
542
|
}
|
|
542
543
|
}
|
|
543
|
-
return
|
|
544
|
-
|
|
545
|
-
}), (
|
|
544
|
+
return Ce(t, (I) => {
|
|
545
|
+
I && F(I);
|
|
546
|
+
}), (I, y) => {
|
|
546
547
|
const x = G("FmCircularProgress"), d = G("FmIcon"), $ = G("FmButton");
|
|
547
548
|
return _(), T("div", zt, [
|
|
548
549
|
r("div", Gt, D(f(i)("inventory.closing.template.import.message")), 1),
|
|
@@ -555,7 +556,7 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
555
556
|
]),
|
|
556
557
|
r("div", Ht, D(f(i)("inventory.formField.loading")), 1)
|
|
557
558
|
])) : (_(), T(Y, { key: 1 }, [
|
|
558
|
-
A(
|
|
559
|
+
A(dt, {
|
|
559
560
|
class: Z({
|
|
560
561
|
"w-full": !0,
|
|
561
562
|
"h-[200px]": !t.value
|
|
@@ -564,7 +565,7 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
564
565
|
onFileUpload: y[0] || (y[0] = (n) => t.value = n),
|
|
565
566
|
label: f(i)("inventory.ingredient.import.uploadTemplate"),
|
|
566
567
|
"button-label": f(i)("inventory.ingredient.import.selectFile")
|
|
567
|
-
},
|
|
568
|
+
}, Qe({ _: 2 }, [
|
|
568
569
|
t.value ? {
|
|
569
570
|
name: "default",
|
|
570
571
|
fn: j(({ openFileDialog: n }) => [
|
|
@@ -629,7 +630,7 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
629
630
|
]), 1032, ["class", "label", "button-label"]),
|
|
630
631
|
g.value ? (_(), T("div", Jt, [
|
|
631
632
|
r("div", qt, D(f(i)("inventory.ingredient.import.summary")), 1),
|
|
632
|
-
(_(!0), T(Y, null, X(h.value, (n, w) => (_(), W(
|
|
633
|
+
(_(!0), T(Y, null, X(h.value, (n, w) => (_(), W(Le, {
|
|
633
634
|
key: w,
|
|
634
635
|
name: n.template.name,
|
|
635
636
|
locations: n.template.locations,
|
|
@@ -637,7 +638,7 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
637
638
|
errors: n.errors,
|
|
638
639
|
type: "create"
|
|
639
640
|
}, null, 8, ["name", "locations", "items", "errors"]))), 128)),
|
|
640
|
-
(_(!0), T(Y, null, X(l.value, (n) => (_(), W(
|
|
641
|
+
(_(!0), T(Y, null, X(l.value, (n) => (_(), W(Le, {
|
|
641
642
|
key: n.template._id,
|
|
642
643
|
name: n.template.name,
|
|
643
644
|
locations: n.template.locations,
|
|
@@ -650,11 +651,11 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
650
651
|
]);
|
|
651
652
|
};
|
|
652
653
|
}
|
|
653
|
-
}),
|
|
654
|
+
}), Ne = Ve(
|
|
654
655
|
"closingTemplateTable",
|
|
655
656
|
function() {
|
|
656
657
|
var P;
|
|
657
|
-
const { t } = ne(), e =
|
|
658
|
+
const { t } = ne(), e = Ie(), k = de();
|
|
658
659
|
function a(s) {
|
|
659
660
|
console.error("Row action failed:", s), k.open({
|
|
660
661
|
title: t("inventory.common.somethingWentWrong"),
|
|
@@ -662,8 +663,8 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
662
663
|
type: "error"
|
|
663
664
|
});
|
|
664
665
|
}
|
|
665
|
-
const u = V({}), b =
|
|
666
|
-
function
|
|
666
|
+
const u = V({}), b = Te(), h = V({}), l = V(new Array()), o = V(!1), g = Re(), i = ue();
|
|
667
|
+
function F(s) {
|
|
667
668
|
const c = {
|
|
668
669
|
title: s.name,
|
|
669
670
|
doc: s,
|
|
@@ -699,7 +700,7 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
699
700
|
};
|
|
700
701
|
e.open({
|
|
701
702
|
title: "Publish template",
|
|
702
|
-
contentComponent:
|
|
703
|
+
contentComponent: yt,
|
|
703
704
|
contentComponentProps: c,
|
|
704
705
|
closeButton: !0,
|
|
705
706
|
minWidth: 700,
|
|
@@ -712,7 +713,7 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
712
713
|
}
|
|
713
714
|
});
|
|
714
715
|
}
|
|
715
|
-
const
|
|
716
|
+
const I = V(0);
|
|
716
717
|
let y = (P = g._currentLocation) == null ? void 0 : P.dbName;
|
|
717
718
|
async function x(s) {
|
|
718
719
|
if (!g._currentLocation) return { docs: [], nextStartkey: null, hasMore: !1 };
|
|
@@ -725,7 +726,7 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
725
726
|
return h.value = M, u.value = R.publishedRevByLocation || {}, c;
|
|
726
727
|
}
|
|
727
728
|
function d() {
|
|
728
|
-
l.value = [],
|
|
729
|
+
l.value = [], I.value++;
|
|
729
730
|
}
|
|
730
731
|
async function $() {
|
|
731
732
|
var c;
|
|
@@ -738,7 +739,7 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
738
739
|
const [c] = await Promise.all([
|
|
739
740
|
i.getTemplate(s),
|
|
740
741
|
new Promise((R) => setTimeout(R, 1e3))
|
|
741
|
-
]), { toClosingTemplateListItem: M } = await import("./index-
|
|
742
|
+
]), { toClosingTemplateListItem: M } = await import("./index-ClYgfwW7.js");
|
|
742
743
|
l.value = [
|
|
743
744
|
M(c)
|
|
744
745
|
];
|
|
@@ -750,7 +751,7 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
750
751
|
}
|
|
751
752
|
}
|
|
752
753
|
function w(s, c) {
|
|
753
|
-
switch (c =
|
|
754
|
+
switch (c = Ge(c), s) {
|
|
754
755
|
case J.Details:
|
|
755
756
|
return b.viewTemplate(c._id).catch(a);
|
|
756
757
|
case J.Edit:
|
|
@@ -758,7 +759,7 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
758
759
|
case J.Delete:
|
|
759
760
|
return b.deleteTemplate(c, o, d);
|
|
760
761
|
case J.Publish:
|
|
761
|
-
return
|
|
762
|
+
return F(c);
|
|
762
763
|
case J.Duplicate:
|
|
763
764
|
return b.duplicateTemplate(c, o, d);
|
|
764
765
|
}
|
|
@@ -770,7 +771,7 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
770
771
|
accessorKey: "_id",
|
|
771
772
|
header: () => t("inventory.closing.table.createdAt"),
|
|
772
773
|
cell(s) {
|
|
773
|
-
return
|
|
774
|
+
return ft(`${s.getValue()}`);
|
|
774
775
|
},
|
|
775
776
|
enableSorting: !0
|
|
776
777
|
},
|
|
@@ -821,12 +822,12 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
821
822
|
const c = s.row.original, R = (s.row.original.locations || g.locations).filter((O) => !!g.locationByDbName[O.dbName]), B = R.filter((O) => !!(u.value[O.dbName] || []).find(
|
|
822
823
|
(ee) => ee._id === c._id && (ee.updatedAt ? ee.updatedAt === c.updatedAt : ee._rev === c._rev)
|
|
823
824
|
)).length, z = R.length > 0 && B === R.length;
|
|
824
|
-
return
|
|
825
|
+
return Fe(
|
|
825
826
|
"div",
|
|
826
827
|
{
|
|
827
828
|
class: "flex items-center gap-8"
|
|
828
829
|
},
|
|
829
|
-
|
|
830
|
+
Fe(
|
|
830
831
|
"div",
|
|
831
832
|
{
|
|
832
833
|
class: [
|
|
@@ -843,12 +844,12 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
843
844
|
id: "action",
|
|
844
845
|
cell(s) {
|
|
845
846
|
const c = s.row.original, M = [
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
847
|
+
xe[J.Edit],
|
|
848
|
+
xe[J.Duplicate],
|
|
849
|
+
xe[J.Delete],
|
|
850
|
+
xe[J.Publish]
|
|
850
851
|
];
|
|
851
|
-
return
|
|
852
|
+
return pt(M, (R) => w(R, c));
|
|
852
853
|
},
|
|
853
854
|
enableSorting: !1,
|
|
854
855
|
size: 40,
|
|
@@ -861,15 +862,15 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
861
862
|
recentPublish: h,
|
|
862
863
|
templates: l,
|
|
863
864
|
loading: o,
|
|
864
|
-
tableKey:
|
|
865
|
+
tableKey: I,
|
|
865
866
|
fetchTemplatesPage: x,
|
|
866
867
|
refresh: d,
|
|
867
868
|
onLocationChanged: $,
|
|
868
869
|
loadTemplate: n
|
|
869
870
|
};
|
|
870
871
|
}
|
|
871
|
-
),
|
|
872
|
-
const { t: m } = ne(), t =
|
|
872
|
+
), Te = Ve("closingTemplateActions", () => {
|
|
873
|
+
const { t: m } = ne(), t = Ie(), e = de(), k = ue(), a = vt(), u = Ne(), { loading: b } = ze(u), h = V({});
|
|
873
874
|
function l() {
|
|
874
875
|
h.value = {
|
|
875
876
|
mode: oe.CREATE,
|
|
@@ -896,12 +897,12 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
896
897
|
message: "Deleted template can no longer be retrieved",
|
|
897
898
|
primaryActions: {
|
|
898
899
|
text: "Delete",
|
|
899
|
-
variant:
|
|
900
|
+
variant: _e.Destructive,
|
|
900
901
|
close: !0
|
|
901
902
|
},
|
|
902
903
|
secondaryActions: {
|
|
903
904
|
text: "Cancel",
|
|
904
|
-
variant:
|
|
905
|
+
variant: _e.Plain,
|
|
905
906
|
close: !0
|
|
906
907
|
}
|
|
907
908
|
}).onPrimary(async () => {
|
|
@@ -938,19 +939,19 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
938
939
|
message: "Duplicated template can be edited after creation",
|
|
939
940
|
primaryActions: {
|
|
940
941
|
text: "Duplicate",
|
|
941
|
-
variant:
|
|
942
|
+
variant: _e.Destructive,
|
|
942
943
|
close: !0
|
|
943
944
|
},
|
|
944
945
|
secondaryActions: {
|
|
945
946
|
text: "Cancel",
|
|
946
|
-
variant:
|
|
947
|
+
variant: _e.Plain,
|
|
947
948
|
close: !0
|
|
948
949
|
},
|
|
949
950
|
contentComponent: te({
|
|
950
951
|
props: ["modelValue"],
|
|
951
952
|
emits: ["update:modelValue"],
|
|
952
953
|
setup(s) {
|
|
953
|
-
return () =>
|
|
954
|
+
return () => Fe(rt.FmTextField, {
|
|
954
955
|
modelValue: s.modelValue,
|
|
955
956
|
"onUpdate:modelValue": (c) => P = c,
|
|
956
957
|
label: "New Template Name",
|
|
@@ -986,17 +987,17 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
986
987
|
}
|
|
987
988
|
});
|
|
988
989
|
}
|
|
989
|
-
const
|
|
990
|
-
async function
|
|
990
|
+
const F = V({});
|
|
991
|
+
async function I(n) {
|
|
991
992
|
const w = await k.getTemplate(n);
|
|
992
|
-
|
|
993
|
+
F.value = {
|
|
993
994
|
template: w,
|
|
994
995
|
show: !0,
|
|
995
996
|
"onUpdate:show"(S) {
|
|
996
|
-
|
|
997
|
+
F.value.show = S;
|
|
997
998
|
},
|
|
998
999
|
"onAction:edit"() {
|
|
999
|
-
|
|
1000
|
+
F.value.show = !1, o(Ge(w));
|
|
1000
1001
|
}
|
|
1001
1002
|
};
|
|
1002
1003
|
}
|
|
@@ -1115,7 +1116,7 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
1115
1116
|
}
|
|
1116
1117
|
return {
|
|
1117
1118
|
createTemplate: l,
|
|
1118
|
-
viewTemplate:
|
|
1119
|
+
viewTemplate: I,
|
|
1119
1120
|
updateTemplate: o,
|
|
1120
1121
|
deleteTemplate: g,
|
|
1121
1122
|
duplicateTemplate: i,
|
|
@@ -1123,13 +1124,13 @@ const Nt = { class: "flex items-center gap-12 pl-8" }, Bt = { class: "flex flex-
|
|
|
1123
1124
|
exportSingleTemplate: x,
|
|
1124
1125
|
importTemplates: d,
|
|
1125
1126
|
templateDialogProps: h,
|
|
1126
|
-
templateDetailsProps:
|
|
1127
|
+
templateDetailsProps: F
|
|
1127
1128
|
};
|
|
1128
1129
|
});
|
|
1129
1130
|
function Zt(m) {
|
|
1130
1131
|
return m ? Number(m.amount) / Math.pow(10, Number(m.precision) || 0) : 0;
|
|
1131
1132
|
}
|
|
1132
|
-
function
|
|
1133
|
+
function Be(m) {
|
|
1133
1134
|
const t = new Set(m.disabledMeasurements ?? []), e = [
|
|
1134
1135
|
{
|
|
1135
1136
|
id: m.sku.unit._id,
|
|
@@ -1150,10 +1151,10 @@ function Le(m) {
|
|
|
1150
1151
|
return e;
|
|
1151
1152
|
}
|
|
1152
1153
|
function eo(m) {
|
|
1153
|
-
return
|
|
1154
|
+
return Be(m).filter((t) => t.enabled).length;
|
|
1154
1155
|
}
|
|
1155
1156
|
function to(m) {
|
|
1156
|
-
return
|
|
1157
|
+
return Be(m).filter((t) => t.enabled).map((t) => !t.isBase && t.factor ? `${t.label} ×${t.factor}` : t.label);
|
|
1157
1158
|
}
|
|
1158
1159
|
function oo(m, t) {
|
|
1159
1160
|
const e = new Set(m.disabledMeasurements ?? []);
|
|
@@ -1196,7 +1197,7 @@ const no = { class: "flex items-center gap-12 py-12" }, so = {
|
|
|
1196
1197
|
},
|
|
1197
1198
|
emits: ["update", "delete"],
|
|
1198
1199
|
setup(m, { emit: t }) {
|
|
1199
|
-
const e = m, k = t, a = U(() =>
|
|
1200
|
+
const e = m, k = t, a = U(() => Be(e.item)), u = U(() => a.value.filter((o) => o.enabled)), b = U(() => u.value.length);
|
|
1200
1201
|
function h(o) {
|
|
1201
1202
|
if (e.disabled) return;
|
|
1202
1203
|
const g = oo(e.item, o);
|
|
@@ -1206,7 +1207,7 @@ const no = { class: "flex items-center gap-12 py-12" }, so = {
|
|
|
1206
1207
|
return o.isBase ? "Base unit" : o.factor ? `1 ${o.label} = ${o.factor} ${e.item.sku.unit.abbrev}` : "";
|
|
1207
1208
|
}
|
|
1208
1209
|
return (o, g) => {
|
|
1209
|
-
const i = G("FmButton"),
|
|
1210
|
+
const i = G("FmButton"), F = G("FmMenuItem"), I = G("FmMenu");
|
|
1210
1211
|
return _(), T("div", no, [
|
|
1211
1212
|
r("span", so, D(o.index + 1), 1),
|
|
1212
1213
|
r("div", ao, [
|
|
@@ -1229,7 +1230,7 @@ const no = { class: "flex items-center gap-12 py-12" }, so = {
|
|
|
1229
1230
|
], 2))), 128))
|
|
1230
1231
|
]),
|
|
1231
1232
|
r("div", uo, [
|
|
1232
|
-
A(
|
|
1233
|
+
A(I, { "close-on-click": !1 }, {
|
|
1233
1234
|
"menu-button": j(() => [
|
|
1234
1235
|
A(i, {
|
|
1235
1236
|
variant: "secondary",
|
|
@@ -1240,7 +1241,7 @@ const no = { class: "flex items-center gap-12 py-12" }, so = {
|
|
|
1240
1241
|
}, null, 8, ["disabled", "label"])
|
|
1241
1242
|
]),
|
|
1242
1243
|
default: j(() => [
|
|
1243
|
-
(_(!0), T(Y, null, X(a.value, (y) => (_(), W(
|
|
1244
|
+
(_(!0), T(Y, null, X(a.value, (y) => (_(), W(F, {
|
|
1244
1245
|
key: y.id,
|
|
1245
1246
|
"model-value": y.enabled,
|
|
1246
1247
|
"has-checkbox": "",
|
|
@@ -1266,7 +1267,7 @@ const no = { class: "flex items-center gap-12 py-12" }, so = {
|
|
|
1266
1267
|
});
|
|
1267
1268
|
function fo(m) {
|
|
1268
1269
|
const t = V("");
|
|
1269
|
-
|
|
1270
|
+
Ce(m, () => {
|
|
1270
1271
|
t.value = "";
|
|
1271
1272
|
});
|
|
1272
1273
|
const e = U(() => t.value.trim().length > 0);
|
|
@@ -1336,61 +1337,68 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1336
1337
|
},
|
|
1337
1338
|
emits: ["reorderDefault", "addItems"],
|
|
1338
1339
|
setup(m, { emit: t }) {
|
|
1339
|
-
const { promptSelectIngredients: e } =
|
|
1340
|
-
function
|
|
1340
|
+
const { promptSelectIngredients: e } = je(), k = Ie(), a = m, u = t, b = ["#EAB308", "#22C55E", "#3B82F6", "#A855F7", "#F97316", "#EC4899", "#14B8A6"], h = V("default"), { searchQuery: l, hasQuery: o, filterItems: g } = fo(h), i = U(() => a.groups ?? []);
|
|
1341
|
+
function F(p) {
|
|
1341
1342
|
a.updateGroups(p);
|
|
1342
1343
|
}
|
|
1343
|
-
function
|
|
1344
|
+
function I() {
|
|
1344
1345
|
return `tmplGroup_${Date.now()}_${Math.floor(Math.random() * 1e4)}`;
|
|
1345
1346
|
}
|
|
1346
1347
|
const y = V(null), x = V(null);
|
|
1347
|
-
function d(p, v,
|
|
1348
|
+
function d(p, v, C) {
|
|
1348
1349
|
var E;
|
|
1349
|
-
x.value = p, y.value = v, (E =
|
|
1350
|
+
x.value = p, y.value = v, (E = C.dataTransfer) == null || E.setData("text/plain", String(v)), C.dataTransfer && (C.dataTransfer.effectAllowed = "move");
|
|
1350
1351
|
}
|
|
1351
|
-
function $(p, v,
|
|
1352
|
-
const E = [...p], [
|
|
1353
|
-
return E.splice(
|
|
1352
|
+
function $(p, v, C) {
|
|
1353
|
+
const E = [...p], [L] = E.splice(v, 1);
|
|
1354
|
+
return E.splice(C, 0, L), E;
|
|
1354
1355
|
}
|
|
1355
1356
|
function n(p, v) {
|
|
1356
|
-
const
|
|
1357
|
-
if (y.value = null, x.value = null, !(
|
|
1357
|
+
const C = y.value, E = x.value;
|
|
1358
|
+
if (y.value = null, x.value = null, !(C === null || E !== p || C === v))
|
|
1358
1359
|
if (p === "default")
|
|
1359
1360
|
u(
|
|
1360
1361
|
"reorderDefault",
|
|
1361
1362
|
$(
|
|
1362
|
-
a.items.map((
|
|
1363
|
-
|
|
1363
|
+
a.items.map((L) => L.sku._id),
|
|
1364
|
+
C,
|
|
1364
1365
|
v
|
|
1365
1366
|
)
|
|
1366
1367
|
);
|
|
1367
1368
|
else {
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1369
|
+
const L = O(p);
|
|
1370
|
+
L && ae(
|
|
1371
|
+
p,
|
|
1372
|
+
$(
|
|
1373
|
+
L.items.map((N) => N.skuId),
|
|
1374
|
+
C,
|
|
1375
|
+
v
|
|
1376
|
+
)
|
|
1377
|
+
);
|
|
1370
1378
|
}
|
|
1371
1379
|
}
|
|
1372
1380
|
const w = U(
|
|
1373
1381
|
() => Object.fromEntries(a.items.map((p) => [p.sku._id, p]))
|
|
1374
1382
|
);
|
|
1375
|
-
|
|
1383
|
+
Ce(
|
|
1376
1384
|
() => a.items.map((p) => p.sku._id),
|
|
1377
1385
|
(p) => {
|
|
1378
1386
|
const v = new Set(p);
|
|
1379
|
-
let
|
|
1380
|
-
const E = i.value.map((
|
|
1381
|
-
const
|
|
1382
|
-
return
|
|
1387
|
+
let C = !1;
|
|
1388
|
+
const E = i.value.map((L) => {
|
|
1389
|
+
const N = L.items.filter((Q) => v.has(Q.skuId));
|
|
1390
|
+
return N.length !== L.items.length ? (C = !0, { ...L, items: N }) : L;
|
|
1383
1391
|
});
|
|
1384
|
-
|
|
1392
|
+
C && F(E);
|
|
1385
1393
|
}
|
|
1386
1394
|
);
|
|
1387
1395
|
const S = U(() => {
|
|
1388
1396
|
const p = /* @__PURE__ */ new Map();
|
|
1389
|
-
for (const
|
|
1390
|
-
for (const E of
|
|
1397
|
+
for (const C of i.value)
|
|
1398
|
+
for (const E of C.items) p.set(E.skuId, (p.get(E.skuId) ?? 0) + 1);
|
|
1391
1399
|
let v = 0;
|
|
1392
|
-
return p.forEach((
|
|
1393
|
-
|
|
1400
|
+
return p.forEach((C) => {
|
|
1401
|
+
C > 1 && v++;
|
|
1394
1402
|
}), v;
|
|
1395
1403
|
}), P = U(() => {
|
|
1396
1404
|
const p = i.value.length;
|
|
@@ -1407,20 +1415,20 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1407
1415
|
]), c = U(
|
|
1408
1416
|
() => s.value.find((p) => p.id === h.value) ?? s.value[0]
|
|
1409
1417
|
), M = U(() => c.value.isDefault), R = U(
|
|
1410
|
-
() => M.value ? [] :
|
|
1418
|
+
() => M.value ? [] : re(h.value)
|
|
1411
1419
|
);
|
|
1412
1420
|
function B(p) {
|
|
1413
1421
|
return h.value === p;
|
|
1414
1422
|
}
|
|
1415
1423
|
function z() {
|
|
1416
|
-
const p =
|
|
1417
|
-
|
|
1424
|
+
const p = I();
|
|
1425
|
+
F([...i.value, { id: p, name: `Group ${i.value.length + 1}`, items: [] }]), h.value = p;
|
|
1418
1426
|
}
|
|
1419
1427
|
function O(p) {
|
|
1420
1428
|
return i.value.find((v) => v.id === p) ?? null;
|
|
1421
1429
|
}
|
|
1422
|
-
function
|
|
1423
|
-
|
|
1430
|
+
function ce(p) {
|
|
1431
|
+
F(i.value.filter((v) => v.id !== p)), h.value === p && (h.value = "default");
|
|
1424
1432
|
}
|
|
1425
1433
|
function ee(p, v) {
|
|
1426
1434
|
k.open({
|
|
@@ -1429,74 +1437,77 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1429
1437
|
message: "This removes the group and its item selection. The items stay in Default and other groups.",
|
|
1430
1438
|
primaryActions: { text: "Delete", close: !0, variant: "destructive" },
|
|
1431
1439
|
secondaryActions: { text: "Cancel", close: !0 }
|
|
1432
|
-
}).onPrimary(() =>
|
|
1440
|
+
}).onPrimary(() => ce(p));
|
|
1433
1441
|
}
|
|
1434
|
-
function
|
|
1435
|
-
|
|
1442
|
+
function se(p, v) {
|
|
1443
|
+
F(i.value.map((C) => C.id === p ? { ...C, name: v } : C));
|
|
1436
1444
|
}
|
|
1437
|
-
function
|
|
1438
|
-
|
|
1445
|
+
function ae(p, v) {
|
|
1446
|
+
F(
|
|
1439
1447
|
i.value.map(
|
|
1440
|
-
(
|
|
1448
|
+
(C) => C.id === p ? { ...C, items: v.map((E, L) => ({ skuId: E, position: L })) } : C
|
|
1441
1449
|
)
|
|
1442
1450
|
);
|
|
1443
1451
|
}
|
|
1444
|
-
async function
|
|
1452
|
+
async function pe(p) {
|
|
1445
1453
|
if (a.disabled) return;
|
|
1446
1454
|
const v = O(p);
|
|
1447
1455
|
if (!v) return;
|
|
1448
|
-
const
|
|
1456
|
+
const C = await e(
|
|
1449
1457
|
v.items.map((E) => E.skuId),
|
|
1450
1458
|
(E) => E,
|
|
1451
1459
|
a.items.map((E) => E.sku)
|
|
1452
1460
|
);
|
|
1453
|
-
|
|
1461
|
+
C && ae(p, C);
|
|
1454
1462
|
}
|
|
1455
|
-
function
|
|
1456
|
-
M.value ? u("addItems") :
|
|
1463
|
+
function fe() {
|
|
1464
|
+
M.value ? u("addItems") : pe(h.value);
|
|
1457
1465
|
}
|
|
1458
|
-
function
|
|
1459
|
-
const
|
|
1460
|
-
if (!
|
|
1461
|
-
const E =
|
|
1462
|
-
|
|
1466
|
+
function ye(p, v) {
|
|
1467
|
+
const C = O(p);
|
|
1468
|
+
if (!C) return;
|
|
1469
|
+
const E = C.items.some((L) => L.skuId === v) ? C.items.filter((L) => L.skuId !== v).map((L) => L.skuId) : [...C.items.map((L) => L.skuId), v];
|
|
1470
|
+
ae(p, E);
|
|
1463
1471
|
}
|
|
1464
|
-
function
|
|
1472
|
+
function re(p) {
|
|
1465
1473
|
const v = O(p);
|
|
1466
|
-
return v ? v.items.map((
|
|
1474
|
+
return v ? v.items.map((C) => w.value[C.skuId]).filter(Boolean) : [];
|
|
1467
1475
|
}
|
|
1468
|
-
const
|
|
1476
|
+
const le = U(() => g(a.items)), ie = U(
|
|
1469
1477
|
() => g(R.value)
|
|
1470
|
-
),
|
|
1471
|
-
() => o.value ? M.value ?
|
|
1478
|
+
), ve = U(
|
|
1479
|
+
() => o.value ? M.value ? le.value.length : ie.value.length : c.value.itemCount
|
|
1472
1480
|
);
|
|
1473
|
-
function
|
|
1481
|
+
function ge(p) {
|
|
1474
1482
|
const v = B(p.id);
|
|
1475
1483
|
if (p.isDefault)
|
|
1476
1484
|
return v ? { background: "#1F2937", color: "#FFFFFF", border: "1px solid #1F2937" } : { background: "#FFFFFF", color: "#374151", border: "1px solid #E5E7EB" };
|
|
1477
|
-
const
|
|
1478
|
-
return v ? { background:
|
|
1485
|
+
const C = p.color || "#999999";
|
|
1486
|
+
return v ? { background: C, color: me(C), border: `1px solid ${C}` } : { background: `${C}1A`, color: "#374151", border: `1px solid ${C}` };
|
|
1479
1487
|
}
|
|
1480
|
-
function
|
|
1481
|
-
const v = p.replace("#", ""),
|
|
1482
|
-
return (0.299 *
|
|
1488
|
+
function me(p) {
|
|
1489
|
+
const v = p.replace("#", ""), C = parseInt(v.slice(0, 2), 16), E = parseInt(v.slice(2, 4), 16), L = parseInt(v.slice(4, 6), 16);
|
|
1490
|
+
return (0.299 * C + 0.587 * E + 0.114 * L) / 255 > 0.6 ? "#1F2937" : "#FFFFFF";
|
|
1483
1491
|
}
|
|
1484
|
-
function
|
|
1485
|
-
return B(p.id) ? (p.isDefault ? "#FFFFFF" :
|
|
1492
|
+
function be(p) {
|
|
1493
|
+
return B(p.id) ? (p.isDefault ? "#FFFFFF" : me(p.color || "#999999")) === "#FFFFFF" ? { background: "rgba(255,255,255,0.25)", color: "#FFFFFF" } : { background: "rgba(0,0,0,0.12)", color: "#1F2937" } : { background: "rgba(0,0,0,0.06)", color: "inherit" };
|
|
1486
1494
|
}
|
|
1487
1495
|
return (p, v) => {
|
|
1488
|
-
const
|
|
1496
|
+
const C = G("FmButton"), E = G("FmIcon"), L = G("FmTextField");
|
|
1489
1497
|
return _(), T("div", yo, [
|
|
1490
1498
|
r("div", vo, [
|
|
1491
1499
|
r("div", go, [
|
|
1492
1500
|
r("div", bo, [
|
|
1493
1501
|
v[6] || (v[6] = r("div", { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, "Groups & items", -1)),
|
|
1494
|
-
A(
|
|
1502
|
+
A(kt, {
|
|
1503
|
+
tier: "standard",
|
|
1504
|
+
category: "beta"
|
|
1505
|
+
})
|
|
1495
1506
|
]),
|
|
1496
1507
|
r("div", ho, D(P.value), 1)
|
|
1497
1508
|
]),
|
|
1498
1509
|
r("div", _o, [
|
|
1499
|
-
A(
|
|
1510
|
+
A(C, {
|
|
1500
1511
|
disabled: p.disabled,
|
|
1501
1512
|
label: "New Group",
|
|
1502
1513
|
"prepend-icon": "add",
|
|
@@ -1507,20 +1518,20 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1507
1518
|
}, null, 8, ["disabled"])
|
|
1508
1519
|
])
|
|
1509
1520
|
]),
|
|
1510
|
-
v[15] || (v[15] =
|
|
1521
|
+
v[15] || (v[15] = Je('<div class="flex items-start gap-8 p-12 fm-corner-radius-md border-1 border-yellow-500 bg-yellow-50 text-yellow-700"><div class="flex flex-col gap-2"><div class="fm-typo-en-body-md-600 text-fm-color-typo-primary">📦 Closing Groups</div><div class="fm-typo-en-body-sm-400"> Split a closing template into named groups (e.g. by section, fridge, or station) so several staff can stock take in parallel and you manage them in one place. Group stock take is currently only available in the Inventory mobile app — it's not yet available in POS. You can keep using the <span class="fm-typo-en-body-sm-600 text-fm-color-typo-primary">Default (master list)</span> group as usual. </div></div></div>', 1)),
|
|
1511
1522
|
r("div", xo, [
|
|
1512
|
-
(_(!0), T(Y, null, X(s.value, (
|
|
1513
|
-
key:
|
|
1523
|
+
(_(!0), T(Y, null, X(s.value, (N) => (_(), T("button", {
|
|
1524
|
+
key: N.id,
|
|
1514
1525
|
type: "button",
|
|
1515
1526
|
class: "flex items-center rounded-full",
|
|
1516
|
-
style:
|
|
1517
|
-
onClick: (
|
|
1527
|
+
style: De([{ gap: "8px", padding: "6px 14px" }, ge(N)]),
|
|
1528
|
+
onClick: (Q) => h.value = N.id
|
|
1518
1529
|
}, [
|
|
1519
|
-
r("span", wo, D(
|
|
1530
|
+
r("span", wo, D(N.name), 1),
|
|
1520
1531
|
r("span", {
|
|
1521
1532
|
class: "fm-typo-en-body-sm-600 rounded-full",
|
|
1522
|
-
style:
|
|
1523
|
-
}, D(
|
|
1533
|
+
style: De([{ padding: "0 8px" }, be(N)])
|
|
1534
|
+
}, D(N.itemCount), 5)
|
|
1524
1535
|
], 12, ko))), 128)),
|
|
1525
1536
|
r("button", {
|
|
1526
1537
|
type: "button",
|
|
@@ -1529,7 +1540,7 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1529
1540
|
style: { gap: "6px", padding: "6px 14px" },
|
|
1530
1541
|
onClick: z
|
|
1531
1542
|
}, [
|
|
1532
|
-
A(
|
|
1543
|
+
A(E, {
|
|
1533
1544
|
name: "add",
|
|
1534
1545
|
size: "sm"
|
|
1535
1546
|
}),
|
|
@@ -1542,22 +1553,22 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1542
1553
|
r("span", { class: "fm-typo-en-body-lg-600 italic text-fm-color-typo-primary" }, "Default", -1),
|
|
1543
1554
|
r("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary truncate" }, " master list · sets the item pool & units ", -1)
|
|
1544
1555
|
]))) : (_(), T("div", Fo, [
|
|
1545
|
-
A(
|
|
1556
|
+
A(L, {
|
|
1546
1557
|
"model-value": c.value.name,
|
|
1547
1558
|
disabled: p.disabled,
|
|
1548
1559
|
placeholder: "Group name",
|
|
1549
|
-
"onUpdate:modelValue": v[0] || (v[0] = (
|
|
1560
|
+
"onUpdate:modelValue": v[0] || (v[0] = (N) => se(h.value, N))
|
|
1550
1561
|
}, null, 8, ["model-value", "disabled"])
|
|
1551
1562
|
])),
|
|
1552
1563
|
r("span", Do, [
|
|
1553
1564
|
f(o) ? (_(), T(Y, { key: 0 }, [
|
|
1554
|
-
K(D(
|
|
1565
|
+
K(D(ve.value) + " of " + D(c.value.itemCount), 1)
|
|
1555
1566
|
], 64)) : (_(), T(Y, { key: 1 }, [
|
|
1556
1567
|
K(D(c.value.itemCount), 1)
|
|
1557
1568
|
], 64)),
|
|
1558
1569
|
v[9] || (v[9] = K(" items "))
|
|
1559
1570
|
]),
|
|
1560
|
-
M.value ? H("", !0) : (_(), W(
|
|
1571
|
+
M.value ? H("", !0) : (_(), W(C, {
|
|
1561
1572
|
key: 2,
|
|
1562
1573
|
disabled: p.disabled,
|
|
1563
1574
|
label: "Delete group",
|
|
@@ -1565,33 +1576,33 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1565
1576
|
variant: "secondary",
|
|
1566
1577
|
size: "md",
|
|
1567
1578
|
class: "rounded-lg shrink-0",
|
|
1568
|
-
onClick: v[1] || (v[1] = (
|
|
1579
|
+
onClick: v[1] || (v[1] = (N) => ee(h.value, c.value.name))
|
|
1569
1580
|
}, null, 8, ["disabled"])),
|
|
1570
|
-
A(
|
|
1581
|
+
A(C, {
|
|
1571
1582
|
disabled: p.disabled,
|
|
1572
1583
|
label: "Add items",
|
|
1573
1584
|
"prepend-icon": "add",
|
|
1574
1585
|
variant: "primary",
|
|
1575
1586
|
size: "md",
|
|
1576
1587
|
class: "rounded-lg shrink-0",
|
|
1577
|
-
onClick:
|
|
1588
|
+
onClick: fe
|
|
1578
1589
|
}, null, 8, ["disabled"])
|
|
1579
1590
|
]),
|
|
1580
1591
|
c.value.itemCount > 0 || f(o) ? (_(), T("div", So, [
|
|
1581
|
-
A(
|
|
1592
|
+
A(E, {
|
|
1582
1593
|
name: "search",
|
|
1583
1594
|
size: "sm",
|
|
1584
1595
|
color: "neutral-gray-400",
|
|
1585
1596
|
class: "shrink-0"
|
|
1586
1597
|
}),
|
|
1587
|
-
|
|
1588
|
-
"onUpdate:modelValue": v[2] || (v[2] = (
|
|
1598
|
+
qe(r("input", {
|
|
1599
|
+
"onUpdate:modelValue": v[2] || (v[2] = (N) => Ue(l) ? l.value = N : null),
|
|
1589
1600
|
type: "search",
|
|
1590
1601
|
"aria-label": "Search items by name or code",
|
|
1591
1602
|
placeholder: "Search items by name or code...",
|
|
1592
1603
|
class: "flex-1 bg-transparent outline-none fm-typo-en-body-md-400 text-fm-color-typo-primary placeholder:text-fm-color-typo-disabled"
|
|
1593
1604
|
}, null, 512), [
|
|
1594
|
-
[
|
|
1605
|
+
[Xe, f(l)]
|
|
1595
1606
|
]),
|
|
1596
1607
|
f(o) ? (_(), T("button", {
|
|
1597
1608
|
key: 0,
|
|
@@ -1599,16 +1610,16 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1599
1610
|
"aria-label": "Clear search",
|
|
1600
1611
|
title: "Clear search",
|
|
1601
1612
|
class: "flex items-center text-fm-color-typo-secondary hover:text-fm-color-typo-primary",
|
|
1602
|
-
onClick: v[3] || (v[3] = (
|
|
1613
|
+
onClick: v[3] || (v[3] = (N) => l.value = "")
|
|
1603
1614
|
}, [
|
|
1604
|
-
A(
|
|
1615
|
+
A(E, {
|
|
1605
1616
|
name: "close",
|
|
1606
1617
|
size: "sm"
|
|
1607
1618
|
})
|
|
1608
1619
|
])) : H("", !0)
|
|
1609
1620
|
])) : H("", !0),
|
|
1610
1621
|
!f(o) && c.value.itemCount > 1 ? (_(), T("div", Ao, [
|
|
1611
|
-
A(
|
|
1622
|
+
A(E, {
|
|
1612
1623
|
name: "drag_indicator",
|
|
1613
1624
|
size: "sm",
|
|
1614
1625
|
color: "neutral-gray-400",
|
|
@@ -1617,16 +1628,16 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1617
1628
|
v[10] || (v[10] = K(" Drag a row to reorder items. "))
|
|
1618
1629
|
])) : H("", !0),
|
|
1619
1630
|
M.value ? (_(), T("div", Ro, [
|
|
1620
|
-
(_(!0), T(Y, null, X(
|
|
1621
|
-
key:
|
|
1631
|
+
(_(!0), T(Y, null, X(le.value, (N, Q) => (_(), T("div", {
|
|
1632
|
+
key: N.sku._id,
|
|
1622
1633
|
draggable: !f(o),
|
|
1623
|
-
onDragstart: (q) => !f(o) && d("default",
|
|
1624
|
-
onDragover: v[4] || (v[4] =
|
|
1634
|
+
onDragstart: (q) => !f(o) && d("default", Q, q),
|
|
1635
|
+
onDragover: v[4] || (v[4] = he(() => {
|
|
1625
1636
|
}, ["prevent"])),
|
|
1626
|
-
onDrop:
|
|
1637
|
+
onDrop: he((q) => !f(o) && n("default", Q), ["prevent"]),
|
|
1627
1638
|
class: Z(["flex items-center gap-4 px-16 border-b border-fm-color-neutral-gray-200 hover:bg-fm-color-neutral-gray-100", f(o) ? "cursor-default" : "cursor-grab"])
|
|
1628
1639
|
}, [
|
|
1629
|
-
f(o) ? H("", !0) : (_(), W(
|
|
1640
|
+
f(o) ? H("", !0) : (_(), W(E, {
|
|
1630
1641
|
key: 0,
|
|
1631
1642
|
name: "drag_indicator",
|
|
1632
1643
|
size: "sm",
|
|
@@ -1635,14 +1646,14 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1635
1646
|
})),
|
|
1636
1647
|
A(po, {
|
|
1637
1648
|
class: "flex-1 min-w-0",
|
|
1638
|
-
item:
|
|
1639
|
-
index:
|
|
1649
|
+
item: N,
|
|
1650
|
+
index: Q,
|
|
1640
1651
|
disabled: p.disabled,
|
|
1641
1652
|
onUpdate: p.updateItem,
|
|
1642
|
-
onDelete: (q) => p.deleteItem(
|
|
1653
|
+
onDelete: (q) => p.deleteItem(N)
|
|
1643
1654
|
}, null, 8, ["item", "index", "disabled", "onUpdate", "onDelete"])
|
|
1644
1655
|
], 42, Po))), 128)),
|
|
1645
|
-
f(o) && p.items.length > 0 && !
|
|
1656
|
+
f(o) && p.items.length > 0 && !le.value.length ? (_(), T("div", Mo, [
|
|
1646
1657
|
v[11] || (v[11] = K(" No items match ")),
|
|
1647
1658
|
r("span", Eo, D(f(l)), 1)
|
|
1648
1659
|
])) : p.items.length ? H("", !0) : (_(), T("div", No, v[12] || (v[12] = [
|
|
@@ -1651,7 +1662,7 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1651
1662
|
K(" to add from your catalog. ")
|
|
1652
1663
|
])))
|
|
1653
1664
|
])) : (_(), T("div", Bo, [
|
|
1654
|
-
f(o) && R.value.length > 0 && !
|
|
1665
|
+
f(o) && R.value.length > 0 && !ie.value.length ? (_(), T("div", Lo, [
|
|
1655
1666
|
v[13] || (v[13] = K(" No items match ")),
|
|
1656
1667
|
r("span", Uo, D(f(l)), 1)
|
|
1657
1668
|
])) : R.value.length ? H("", !0) : (_(), T("div", Vo, v[14] || (v[14] = [
|
|
@@ -1659,39 +1670,39 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1659
1670
|
r("span", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary" }, "+ Add items", -1),
|
|
1660
1671
|
K(" on this group to assign items. ")
|
|
1661
1672
|
]))),
|
|
1662
|
-
(_(!0), T(Y, null, X(
|
|
1663
|
-
key:
|
|
1673
|
+
(_(!0), T(Y, null, X(ie.value, (N, Q) => (_(), T("div", {
|
|
1674
|
+
key: N.sku._id,
|
|
1664
1675
|
draggable: !f(o),
|
|
1665
|
-
onDragstart: (q) => !f(o) && d(h.value,
|
|
1666
|
-
onDragover: v[5] || (v[5] =
|
|
1676
|
+
onDragstart: (q) => !f(o) && d(h.value, Q, q),
|
|
1677
|
+
onDragover: v[5] || (v[5] = he(() => {
|
|
1667
1678
|
}, ["prevent"])),
|
|
1668
|
-
onDrop:
|
|
1679
|
+
onDrop: he((q) => !f(o) && n(h.value, Q), ["prevent"]),
|
|
1669
1680
|
class: Z(["flex items-center gap-12 px-16 py-12 border-b border-fm-color-neutral-gray-200 hover:bg-fm-color-neutral-gray-100", f(o) ? "cursor-default" : "cursor-grab"])
|
|
1670
1681
|
}, [
|
|
1671
|
-
f(o) ? H("", !0) : (_(), W(
|
|
1682
|
+
f(o) ? H("", !0) : (_(), W(E, {
|
|
1672
1683
|
key: 0,
|
|
1673
1684
|
name: "drag_indicator",
|
|
1674
1685
|
size: "sm",
|
|
1675
1686
|
color: "neutral-gray-400",
|
|
1676
1687
|
class: "shrink-0"
|
|
1677
1688
|
})),
|
|
1678
|
-
r("span", Go, D(R.value.findIndex((q) => q.sku._id ===
|
|
1689
|
+
r("span", Go, D(R.value.findIndex((q) => q.sku._id === N.sku._id) + 1), 1),
|
|
1679
1690
|
r("div", Oo, [
|
|
1680
|
-
r("div", Ho, D(
|
|
1681
|
-
r("div", jo, D(
|
|
1691
|
+
r("div", Ho, D(N.sku.code), 1),
|
|
1692
|
+
r("div", jo, D(N.sku.name), 1)
|
|
1682
1693
|
]),
|
|
1683
1694
|
r("div", Yo, [
|
|
1684
|
-
(_(!0), T(Y, null, X(f(to)(
|
|
1685
|
-
key:
|
|
1695
|
+
(_(!0), T(Y, null, X(f(to)(N), (q, We) => (_(), T("span", {
|
|
1696
|
+
key: We,
|
|
1686
1697
|
class: "px-8 py-2 rounded-full border border-fm-color-neutral-gray-200 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1687
1698
|
}, D(q), 1))), 128))
|
|
1688
1699
|
]),
|
|
1689
|
-
A(
|
|
1700
|
+
A(C, {
|
|
1690
1701
|
disabled: p.disabled,
|
|
1691
1702
|
icon: "delete",
|
|
1692
1703
|
variant: "tertiary",
|
|
1693
1704
|
size: "md",
|
|
1694
|
-
onClick: (q) =>
|
|
1705
|
+
onClick: (q) => ye(h.value, N.sku._id)
|
|
1695
1706
|
}, null, 8, ["disabled", "onClick"])
|
|
1696
1707
|
], 42, zo))), 128))
|
|
1697
1708
|
]))
|
|
@@ -1706,7 +1717,7 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1706
1717
|
disabled: { type: Boolean }
|
|
1707
1718
|
},
|
|
1708
1719
|
setup(m, { expose: t }) {
|
|
1709
|
-
const e =
|
|
1720
|
+
const e = xt(), { t: k } = ne(), a = Ae(), {
|
|
1710
1721
|
promptSelectLocations: u,
|
|
1711
1722
|
columnDefs: b,
|
|
1712
1723
|
rowData: h
|
|
@@ -1745,13 +1756,13 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1745
1756
|
function i(d) {
|
|
1746
1757
|
e.items = e.items.map(($) => $.sku._id === d.sku._id ? d : $);
|
|
1747
1758
|
}
|
|
1748
|
-
function
|
|
1759
|
+
function F(d) {
|
|
1749
1760
|
e.items = e.items.filter(($) => $.sku._id !== d.sku._id);
|
|
1750
1761
|
}
|
|
1751
|
-
function
|
|
1762
|
+
function I(d) {
|
|
1752
1763
|
e.groups = d;
|
|
1753
1764
|
}
|
|
1754
|
-
const { promptSelectIngredients: y } =
|
|
1765
|
+
const { promptSelectIngredients: y } = je();
|
|
1755
1766
|
async function x() {
|
|
1756
1767
|
const $ = a.skus.map((S) => ({
|
|
1757
1768
|
label: S.name,
|
|
@@ -1787,7 +1798,7 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1787
1798
|
"label-mark": "required",
|
|
1788
1799
|
modelValue: f(e).name,
|
|
1789
1800
|
"onUpdate:modelValue": $[0] || ($[0] = (c) => f(e).name = c),
|
|
1790
|
-
rules: [f(
|
|
1801
|
+
rules: [f(ht)()]
|
|
1791
1802
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
1792
1803
|
A(n, {
|
|
1793
1804
|
label: f(k)("inventory.closing.form.reference"),
|
|
@@ -1825,15 +1836,15 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1825
1836
|
items: o.value,
|
|
1826
1837
|
groups: f(e).groups,
|
|
1827
1838
|
"update-item": i,
|
|
1828
|
-
"delete-item":
|
|
1829
|
-
"update-groups":
|
|
1839
|
+
"delete-item": F,
|
|
1840
|
+
"update-groups": I,
|
|
1830
1841
|
disabled: d.disabled,
|
|
1831
1842
|
onReorderDefault: g,
|
|
1832
1843
|
onAddItems: x
|
|
1833
1844
|
}, null, 8, ["items", "groups", "disabled"]),
|
|
1834
1845
|
A(P, {
|
|
1835
1846
|
"model-value": f(e).items.length,
|
|
1836
|
-
rules: [f(
|
|
1847
|
+
rules: [f(_t)(1)]
|
|
1837
1848
|
}, null, 8, ["model-value", "rules"])
|
|
1838
1849
|
])
|
|
1839
1850
|
]),
|
|
@@ -1851,7 +1862,7 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1851
1862
|
emits: ["update:show", "submitted"],
|
|
1852
1863
|
setup(m, { expose: t, emit: e }) {
|
|
1853
1864
|
var P;
|
|
1854
|
-
const k = m, a = e, u =
|
|
1865
|
+
const k = m, a = e, u = ue(), b = Te(), h = de(), { t: l } = ne(), o = lt(k, "show");
|
|
1855
1866
|
function g() {
|
|
1856
1867
|
return {
|
|
1857
1868
|
_id: "",
|
|
@@ -1859,15 +1870,15 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1859
1870
|
items: []
|
|
1860
1871
|
};
|
|
1861
1872
|
}
|
|
1862
|
-
const i = V(k.modelValue ?? g()),
|
|
1863
|
-
|
|
1873
|
+
const i = V(k.modelValue ?? g()), F = V(((P = k.modelValue) == null ? void 0 : P._id) ?? `${Math.random()}`);
|
|
1874
|
+
Ce(
|
|
1864
1875
|
() => k.show,
|
|
1865
1876
|
(s) => {
|
|
1866
1877
|
var c;
|
|
1867
|
-
s && (i.value = k.modelValue ?? g(),
|
|
1878
|
+
s && (i.value = k.modelValue ?? g(), F.value = ((c = k.modelValue) == null ? void 0 : c._id) ?? `${Math.random()}`);
|
|
1868
1879
|
}
|
|
1869
1880
|
);
|
|
1870
|
-
const
|
|
1881
|
+
const I = V(!1), y = U(() => {
|
|
1871
1882
|
switch (k.mode) {
|
|
1872
1883
|
case oe.READ:
|
|
1873
1884
|
return "";
|
|
@@ -1895,7 +1906,7 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1895
1906
|
async function d() {
|
|
1896
1907
|
const s = i.value;
|
|
1897
1908
|
if (s) {
|
|
1898
|
-
|
|
1909
|
+
I.value = !0;
|
|
1899
1910
|
try {
|
|
1900
1911
|
await u.createTemplate(s), await new Promise((c) => setTimeout(c, 1e3)), h.open({
|
|
1901
1912
|
title: l("inventory.closing.template.create.success"),
|
|
@@ -1909,14 +1920,14 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1909
1920
|
type: "error"
|
|
1910
1921
|
}), console.error("Error in creating closing template", c);
|
|
1911
1922
|
} finally {
|
|
1912
|
-
|
|
1923
|
+
I.value = !1;
|
|
1913
1924
|
}
|
|
1914
1925
|
}
|
|
1915
1926
|
}
|
|
1916
1927
|
async function $() {
|
|
1917
1928
|
const s = i.value;
|
|
1918
1929
|
if (s) {
|
|
1919
|
-
|
|
1930
|
+
I.value = !0, delete s.updatedAt;
|
|
1920
1931
|
try {
|
|
1921
1932
|
await u.updateTemplate({
|
|
1922
1933
|
...s,
|
|
@@ -1933,7 +1944,7 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1933
1944
|
type: "error"
|
|
1934
1945
|
}), console.error("Error in updating closing template", c);
|
|
1935
1946
|
} finally {
|
|
1936
|
-
|
|
1947
|
+
I.value = !1;
|
|
1937
1948
|
}
|
|
1938
1949
|
}
|
|
1939
1950
|
}
|
|
@@ -1956,7 +1967,7 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1956
1967
|
const M = G("FmMenuDivider"), R = G("FmCard"), B = G("FmButton"), z = G("FmSideSheet");
|
|
1957
1968
|
return _(), W(z, {
|
|
1958
1969
|
modelValue: f(o),
|
|
1959
|
-
"onUpdate:modelValue": c[2] || (c[2] = (O) =>
|
|
1970
|
+
"onUpdate:modelValue": c[2] || (c[2] = (O) => Ue(o) ? o.value = O : null),
|
|
1960
1971
|
"dismiss-away": "",
|
|
1961
1972
|
"close-button": "",
|
|
1962
1973
|
"max-width": 9999
|
|
@@ -1984,7 +1995,7 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
1984
1995
|
r("div", mn, D(f(l)("inventory.transfer.receiveRequest.details.updatedAt")), 1),
|
|
1985
1996
|
r("div", dn, [
|
|
1986
1997
|
r("div", un, [
|
|
1987
|
-
K(D(f(
|
|
1998
|
+
K(D(f(we)(i.value.updatedAt)) + " ", 1),
|
|
1988
1999
|
(O = i.value.updatedBy) != null && O.name ? (_(), T(Y, { key: 0 }, [
|
|
1989
2000
|
K(" (" + D(i.value.updatedBy.name) + ") ", 1)
|
|
1990
2001
|
], 64)) : H("", !0)
|
|
@@ -2006,27 +2017,27 @@ const yo = { class: "flex flex-col gap-12" }, vo = { class: "flex items-start ju
|
|
|
2006
2017
|
onValidationSuccess: n,
|
|
2007
2018
|
"model-value": i.value,
|
|
2008
2019
|
"onUpdate:modelValue": c[0] || (c[0] = (O) => i.value = O),
|
|
2009
|
-
disabled:
|
|
2010
|
-
key:
|
|
2020
|
+
disabled: I.value,
|
|
2021
|
+
key: F.value
|
|
2011
2022
|
}, null, 8, ["model-value", "disabled"]))
|
|
2012
2023
|
]),
|
|
2013
2024
|
"side-sheet-footer": j(() => [
|
|
2014
2025
|
r("div", pn, [
|
|
2015
2026
|
A(B, {
|
|
2016
|
-
loading:
|
|
2027
|
+
loading: I.value,
|
|
2017
2028
|
label: f(l)("common.save"),
|
|
2018
2029
|
onClick: w
|
|
2019
2030
|
}, null, 8, ["loading", "label"]),
|
|
2020
2031
|
s.mode === f(oe).UPDATE ? (_(), W(B, {
|
|
2021
2032
|
key: 0,
|
|
2022
|
-
disabled:
|
|
2033
|
+
disabled: I.value,
|
|
2023
2034
|
variant: "secondary",
|
|
2024
2035
|
label: f(l)("inventory.common.export"),
|
|
2025
2036
|
"prepend-icon": "download",
|
|
2026
2037
|
onClick: S
|
|
2027
2038
|
}, null, 8, ["disabled", "label"])) : H("", !0),
|
|
2028
2039
|
A(B, {
|
|
2029
|
-
disabled:
|
|
2040
|
+
disabled: I.value,
|
|
2030
2041
|
variant: "tertiary",
|
|
2031
2042
|
label: f(l)("common.close"),
|
|
2032
2043
|
onClick: c[1] || (c[1] = (O) => a("update:show", !1))
|
|
@@ -2054,7 +2065,7 @@ const gn = /* @__PURE__ */ Ct(yn, [["render", vn]]), bn = { class: "flex flex-co
|
|
|
2054
2065
|
__name: "ClosingTemplatePublish",
|
|
2055
2066
|
emits: ["close"],
|
|
2056
2067
|
setup(m, { emit: t }) {
|
|
2057
|
-
const e = V(!1), k =
|
|
2068
|
+
const e = V(!1), k = de(), a = ue(), u = Ne(), { t: b } = ne(), h = t;
|
|
2058
2069
|
async function l() {
|
|
2059
2070
|
e.value = !0;
|
|
2060
2071
|
try {
|
|
@@ -2063,12 +2074,12 @@ const gn = /* @__PURE__ */ Ct(yn, [["render", vn]]), bn = { class: "flex flex-co
|
|
|
2063
2074
|
message: "You may refresh after a while to review publish status",
|
|
2064
2075
|
type: "success"
|
|
2065
2076
|
}), i();
|
|
2066
|
-
} catch (
|
|
2077
|
+
} catch (F) {
|
|
2067
2078
|
k.open({
|
|
2068
2079
|
title: "Something went wrong",
|
|
2069
2080
|
message: "Please try again",
|
|
2070
2081
|
type: "error"
|
|
2071
|
-
}), console.error("error on creating publish task",
|
|
2082
|
+
}), console.error("error on creating publish task", F);
|
|
2072
2083
|
} finally {
|
|
2073
2084
|
e.value = !1;
|
|
2074
2085
|
}
|
|
@@ -2079,7 +2090,7 @@ const gn = /* @__PURE__ */ Ct(yn, [["render", vn]]), bn = { class: "flex flex-co
|
|
|
2079
2090
|
function i() {
|
|
2080
2091
|
h("close");
|
|
2081
2092
|
}
|
|
2082
|
-
return (
|
|
2093
|
+
return (F, I) => {
|
|
2083
2094
|
const y = G("FmCircularProgress"), x = G("i18n-t"), d = G("FmButton");
|
|
2084
2095
|
return _(), T("div", bn, [
|
|
2085
2096
|
f(u).templates.length ? e.value ? (_(), T("div", _n, [
|
|
@@ -2098,10 +2109,10 @@ const gn = /* @__PURE__ */ Ct(yn, [["render", vn]]), bn = { class: "flex flex-co
|
|
|
2098
2109
|
tag: "p"
|
|
2099
2110
|
}, {
|
|
2100
2111
|
started: j(() => [
|
|
2101
|
-
r("span", $n, D(f(
|
|
2112
|
+
r("span", $n, D(f(we)(new Date(o.value.createdAt))), 1)
|
|
2102
2113
|
]),
|
|
2103
2114
|
finished: j(() => [
|
|
2104
|
-
r("span", Tn, D(f(
|
|
2115
|
+
r("span", Tn, D(f(we)(new Date(o.value.updatedAt))), 1)
|
|
2105
2116
|
]),
|
|
2106
2117
|
_: 1
|
|
2107
2118
|
}),
|
|
@@ -2112,7 +2123,7 @@ const gn = /* @__PURE__ */ Ct(yn, [["render", vn]]), bn = { class: "flex flex-co
|
|
|
2112
2123
|
tag: "p"
|
|
2113
2124
|
}, {
|
|
2114
2125
|
started: j(() => [
|
|
2115
|
-
r("span", In, D(f(
|
|
2126
|
+
r("span", In, D(f(we)(new Date(o.value.createdAt))), 1)
|
|
2116
2127
|
]),
|
|
2117
2128
|
progress: j(() => [
|
|
2118
2129
|
r("span", Fn, " (" + D(o.value.completed.length) + "/" + D(o.value.outlets.length) + " completed) ", 1)
|
|
@@ -2142,21 +2153,21 @@ const gn = /* @__PURE__ */ Ct(yn, [["render", vn]]), bn = { class: "flex flex-co
|
|
|
2142
2153
|
]);
|
|
2143
2154
|
};
|
|
2144
2155
|
}
|
|
2145
|
-
}), An = { class: "flex-1 flex flex-col gap-8" }, Rn = { class: "flex flex-col" }, Pn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, En = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Nn = { class: "fm-typo-en-body-lg-400 line-clamp-2" },
|
|
2156
|
+
}), An = { class: "flex-1 flex flex-col gap-8" }, Rn = { class: "flex flex-col" }, Pn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, En = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Nn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, ms = /* @__PURE__ */ te({
|
|
2146
2157
|
__name: "ClosingTemplateView",
|
|
2147
2158
|
setup(m) {
|
|
2148
|
-
const { t } = ne(), { createTemplate: e, updateTemplate: k, exportTemplates: a, importTemplates: u } =
|
|
2159
|
+
const { t } = ne(), { createTemplate: e, updateTemplate: k, exportTemplates: a, importTemplates: u } = Te(), { templateDialogProps: b, templateDetailsProps: h } = ze(Te()), l = Re(), o = Ie(), g = Ne(), i = nt(), { breakpoints: F } = it();
|
|
2149
2160
|
l.watchLocation(g.onLocationChanged);
|
|
2150
|
-
const
|
|
2161
|
+
const I = U(() => g.loading), y = V(""), x = V();
|
|
2151
2162
|
function d(M) {
|
|
2152
2163
|
var R;
|
|
2153
2164
|
(R = x.value) == null || R.openRowDetail(M);
|
|
2154
2165
|
}
|
|
2155
2166
|
async function $(M) {
|
|
2156
|
-
const { toClosingTemplateListItem: R } = await import("./index-
|
|
2167
|
+
const { toClosingTemplateListItem: R } = await import("./index-ClYgfwW7.js");
|
|
2157
2168
|
return { ...R(M), _rev: M._rev };
|
|
2158
2169
|
}
|
|
2159
|
-
const n = U(() =>
|
|
2170
|
+
const n = U(() => F.value.xs || F.value.sm), w = U(() => n.value ? 10 : 20);
|
|
2160
2171
|
function S(M) {
|
|
2161
2172
|
switch (M) {
|
|
2162
2173
|
case J.Add:
|
|
@@ -2241,7 +2252,7 @@ const gn = /* @__PURE__ */ Ct(yn, [["render", vn]]), bn = { class: "flex flex-co
|
|
|
2241
2252
|
}
|
|
2242
2253
|
]);
|
|
2243
2254
|
return (M, R) => (_(), T(Y, null, [
|
|
2244
|
-
A(
|
|
2255
|
+
A(st, {
|
|
2245
2256
|
title: f(t)("inventory.closing.template.title"),
|
|
2246
2257
|
actions: c.value,
|
|
2247
2258
|
"onClick:action": S
|
|
@@ -2256,13 +2267,13 @@ const gn = /* @__PURE__ */ Ct(yn, [["render", vn]]), bn = { class: "flex flex-co
|
|
|
2256
2267
|
}
|
|
2257
2268
|
])
|
|
2258
2269
|
}, [
|
|
2259
|
-
A(
|
|
2270
|
+
A(gt, {
|
|
2260
2271
|
searchable: "",
|
|
2261
2272
|
search: y.value,
|
|
2262
2273
|
"onUpdate:search": R[0] || (R[0] = (B) => y.value = B)
|
|
2263
2274
|
}, null, 8, ["search"]),
|
|
2264
|
-
A(
|
|
2265
|
-
style:
|
|
2275
|
+
A(bt, {
|
|
2276
|
+
style: De(f(i).tableHeight),
|
|
2266
2277
|
"column-defs": f(g).columnDefs,
|
|
2267
2278
|
rows: f(g).templates,
|
|
2268
2279
|
"onUpdate:rows": R[1] || (R[1] = (B) => f(g).templates = B),
|
|
@@ -2271,7 +2282,7 @@ const gn = /* @__PURE__ */ Ct(yn, [["render", vn]]), bn = { class: "flex flex-co
|
|
|
2271
2282
|
ref_key: "tableRef",
|
|
2272
2283
|
ref: x,
|
|
2273
2284
|
"search-value": y.value,
|
|
2274
|
-
loading:
|
|
2285
|
+
loading: I.value,
|
|
2275
2286
|
"fetch-detail": (B, z) => f(k)(B._id, z),
|
|
2276
2287
|
"detail-to-row": $,
|
|
2277
2288
|
"page-size": w.value
|
|
@@ -2282,24 +2293,24 @@ const gn = /* @__PURE__ */ Ct(yn, [["render", vn]]), bn = { class: "flex flex-co
|
|
|
2282
2293
|
onRowClick: (z) => d(z)
|
|
2283
2294
|
}, {
|
|
2284
2295
|
default: j((z) => {
|
|
2285
|
-
var O,
|
|
2296
|
+
var O, ce, ee, se, ae, pe, fe, ye, re, le, ie, ve, ge, me, be, p, v, C, E, L, N, Q;
|
|
2286
2297
|
return [
|
|
2287
2298
|
r("div", An, [
|
|
2288
2299
|
r("div", Rn, [
|
|
2289
2300
|
r("div", Pn, [
|
|
2290
|
-
A(f(
|
|
2291
|
-
render: (ee = (
|
|
2292
|
-
props: (
|
|
2301
|
+
A(f(ke), {
|
|
2302
|
+
render: (ee = (ce = (O = z._id) == null ? void 0 : O.column) == null ? void 0 : ce.columnDef) == null ? void 0 : ee.cell,
|
|
2303
|
+
props: (ae = (se = z._id) == null ? void 0 : se.getContext) == null ? void 0 : ae.call(se)
|
|
2293
2304
|
}, null, 8, ["render", "props"])
|
|
2294
2305
|
]),
|
|
2295
2306
|
r("div", Mn, [
|
|
2296
|
-
A(f(
|
|
2297
|
-
render: (
|
|
2298
|
-
props: (
|
|
2307
|
+
A(f(ke), {
|
|
2308
|
+
render: (ye = (fe = (pe = z.name) == null ? void 0 : pe.column) == null ? void 0 : fe.columnDef) == null ? void 0 : ye.cell,
|
|
2309
|
+
props: (le = (re = z.name) == null ? void 0 : re.getContext) == null ? void 0 : le.call(re)
|
|
2299
2310
|
}, null, 8, ["render", "props"])
|
|
2300
2311
|
]),
|
|
2301
|
-
r("div", null, D((
|
|
2302
|
-
count: ((
|
|
2312
|
+
r("div", null, D((ie = B.original.locations) != null && ie.length ? f(t)("inventory.closing.table.enabledForN", {
|
|
2313
|
+
count: ((ve = B.original.locations) == null ? void 0 : ve.length) ?? 0
|
|
2303
2314
|
}) : f(t)("inventory.closing.table.enabledForAll")), 1),
|
|
2304
2315
|
r("div", En, D([
|
|
2305
2316
|
...B.original.previewItemNames,
|
|
@@ -2308,16 +2319,16 @@ const gn = /* @__PURE__ */ Ct(yn, [["render", vn]]), bn = { class: "flex flex-co
|
|
|
2308
2319
|
] : []
|
|
2309
2320
|
].join(", ")), 1),
|
|
2310
2321
|
r("div", Nn, [
|
|
2311
|
-
A(f(
|
|
2312
|
-
render: (
|
|
2322
|
+
A(f(ke), {
|
|
2323
|
+
render: (be = (me = (ge = z.ref) == null ? void 0 : ge.column) == null ? void 0 : me.columnDef) == null ? void 0 : be.cell,
|
|
2313
2324
|
props: (v = (p = z.ref) == null ? void 0 : p.getContext) == null ? void 0 : v.call(p)
|
|
2314
2325
|
}, null, 8, ["render", "props"])
|
|
2315
2326
|
])
|
|
2316
2327
|
]),
|
|
2317
2328
|
r("div", null, [
|
|
2318
|
-
A(f(
|
|
2319
|
-
render: (
|
|
2320
|
-
props: (
|
|
2329
|
+
A(f(ke), {
|
|
2330
|
+
render: (L = (E = (C = z.status) == null ? void 0 : C.column) == null ? void 0 : E.columnDef) == null ? void 0 : L.cell,
|
|
2331
|
+
props: (Q = (N = z.status) == null ? void 0 : N.getContext) == null ? void 0 : Q.call(N)
|
|
2321
2332
|
}, null, 8, ["render", "props"])
|
|
2322
2333
|
])
|
|
2323
2334
|
])
|
|
@@ -2332,9 +2343,9 @@ const gn = /* @__PURE__ */ Ct(yn, [["render", vn]]), bn = { class: "flex flex-co
|
|
|
2332
2343
|
]),
|
|
2333
2344
|
_: 1
|
|
2334
2345
|
}, 8, ["title", "actions"]),
|
|
2335
|
-
(_(), W(
|
|
2336
|
-
A(gn, tt(
|
|
2337
|
-
A(fn,
|
|
2346
|
+
(_(), W(Ze, { to: "body" }, [
|
|
2347
|
+
A(gn, et(tt(f(h))), null, 16),
|
|
2348
|
+
A(fn, ot(f(b), {
|
|
2338
2349
|
onSubmitted: R[2] || (R[2] = (B) => f(g).refresh())
|
|
2339
2350
|
}), null, 16)
|
|
2340
2351
|
]))
|
|
@@ -2342,5 +2353,5 @@ const gn = /* @__PURE__ */ Ct(yn, [["render", vn]]), bn = { class: "flex flex-co
|
|
|
2342
2353
|
}
|
|
2343
2354
|
});
|
|
2344
2355
|
export {
|
|
2345
|
-
|
|
2356
|
+
ms as default
|
|
2346
2357
|
};
|