@feedmepos/mf-inventory-portal 0.0.21-dev.7 → 0.0.22-dev.1

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.
Files changed (50) hide show
  1. package/dist/{ApprovalView-BYJfdiYM.js → ApprovalView-CtH8I01g.js} +4 -4
  2. package/dist/{BindingsDialog-BryZK4Tg.js → BindingsDialog-DFrk_fyd.js} +1 -1
  3. package/dist/{BindingsPicker-IWAltg_U.js → BindingsPicker-400gISaV.js} +1 -1
  4. package/dist/{BindingsTable-DDwukKAy.js → BindingsTable-CnFKI6iP.js} +1 -1
  5. package/dist/ClosingTemplateView--8m8cua_.js +919 -0
  6. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CLBgszfX.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-B9RU_arW.js} +1 -1
  7. package/dist/{IngredientsView-DgSzNCNX.js → IngredientsView-CRTAgKJz.js} +3 -3
  8. package/dist/{IntegrationView-BtXzjG3j.js → IntegrationView-CNFTKqjk.js} +2 -2
  9. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-sPzZAvKH.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-VkiVLx1K.js} +1 -1
  10. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BYX1ubPe.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DkZrgqyr.js} +1 -1
  11. package/dist/{PurchaseOrderPrintPreview-Ke1-hYgN.js → PurchaseOrderPrintPreview-CJli-_Vn.js} +1 -1
  12. package/dist/{ReceiveRequestView-CE9BFQn3.js → ReceiveRequestView-DV_GDzJG.js} +6 -6
  13. package/dist/{RecipeView-K3f9W_AV.js → RecipeView-CTm_7oNG.js} +3 -3
  14. package/dist/{StockView-BH3wK8AT.js → StockView-DtHT2ulM.js} +6 -6
  15. package/dist/{SupplierView-DwVN-3IQ.js → SupplierView-B9A5R2Vm.js} +3 -3
  16. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B0Vdby5t.js → TransferDetails.vue_vue_type_script_setup_true_lang-mUNCQTNw.js} +40 -39
  17. package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-DijNNVgt.js → TransferDialog.vue_vue_type_script_setup_true_lang-BwkUuXqj.js} +493 -501
  18. package/dist/{TransferTemplateView-ikRXcgOO.js → TransferTemplateView-DnyenkGu.js} +454 -498
  19. package/dist/{UnitView-yexlK1KM.js → UnitView-BL-jtVuZ.js} +4 -4
  20. package/dist/{WarehouseView-BjBJrjbZ.js → WarehouseView-BkUv1792.js} +2 -2
  21. package/dist/api/closing-template.d.ts +7 -0
  22. package/dist/{app-BD7MP1Oe.js → app-C-z1MfF6.js} +3992 -3929
  23. package/dist/app.d.ts +35 -0
  24. package/dist/app.js +1 -1
  25. package/dist/{decimal-Ct-e_mRV.js → decimal-DZz-_lgE.js} +1 -1
  26. package/dist/defineDeepModel-7VQajdPt.js +13 -0
  27. package/dist/format-time-from-id-9XFszs1J.js +15 -0
  28. package/dist/{id-to-date-Chhy1kB3.js → id-to-date-Bkue77uI.js} +1 -1
  29. package/dist/layout/layout-routes.d.ts +0 -1
  30. package/dist/{purchase-order-transaction-type-Bqu6bNsx.js → purchase-order-transaction-type-DHzMBgFs.js} +90 -101
  31. package/dist/router/name.d.ts +1 -0
  32. package/dist/style.css +1 -1
  33. package/dist/{supplier-DErisCtS.js → supplier-C6YWXF2Y.js} +1 -1
  34. package/dist/tsconfig.app.tsbuildinfo +1 -1
  35. package/dist/use-template-enabled-locations-CFCfbaOd.js +57 -0
  36. package/dist/views/closing-template/ClosingTemplateView.vue.d.ts +2 -0
  37. package/dist/views/closing-template/components/closing-template-details/ClosingTemplateDetails.vue.d.ts +2 -0
  38. package/dist/views/closing-template/components/closing-template-details/ClosingTemplateDetailsProps.d.ts +8 -0
  39. package/dist/views/closing-template/components/closing-template-dialog/ClosingTemplateDialog.vue.d.ts +22 -0
  40. package/dist/views/closing-template/components/closing-template-dialog/ClosingTemplateDialogProps.d.ts +10 -0
  41. package/dist/views/closing-template/components/closing-template-form/ClosingTemplateForm.vue.d.ts +16 -0
  42. package/dist/views/closing-template/components/closing-template-form/ClosingTemplateFormProps.d.ts +7 -0
  43. package/dist/views/closing-template/components/closing-template-form/components/ClosingTemplateItem.vue.d.ts +18 -0
  44. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +79 -0
  45. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +2165 -0
  46. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +2084 -0
  47. package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetails.vue.d.ts +1 -1
  48. package/dist/{xlsx-DyScN5Bf.js → xlsx-Dl6dAHFx.js} +1 -1
  49. package/dist/{xlsx.util-DEyeAnEa.js → xlsx.util-C1tUhDb8.js} +2 -2
  50. package/package.json +3 -3
@@ -1,17 +1,20 @@
1
- import { defineComponent as X, onMounted as xe, computed as V, ref as U, watch as fe, inject as Ke, resolveComponent as S, openBlock as C, createElementBlock as P, createElementVNode as s, createVNode as d, withCtx as D, renderSlot as De, withDirectives as Ve, normalizeClass as me, vModelText as Ae, reactive as Ze, h as J, toDisplayString as $, unref as e, createBlock as E, createCommentVNode as H, isRef as he, Fragment as ce, renderList as be, onUnmounted as Je, normalizeStyle as Xe, Teleport as et, mergeProps as Re, normalizeProps as tt, guardReactiveProps as ot } from "vue";
2
- import { u as st, _ as nt, a as lt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CLBgszfX.js";
3
- import { useI18n as Z } from "@feedmepos/mf-common";
4
- import { P as pe, a as at, f as rt, b as it, c as Oe, d as ut } from "./purchase-order-transaction-type-Bqu6bNsx.js";
5
- import { F as ne, R as Pe } from "./row-action.enum-PMKMRrZR.js";
6
- import { $ as ve, t as Be, I as dt, a0 as mt, a1 as ct, a as G, D as qe, R as _e, a2 as pt, a3 as ft, r as de, a4 as yt, l as vt, A as Ue, M as bt, b as ge, j as ye, y as Ne, u as _t, a5 as ie, a6 as xt, G as ht, a7 as gt } from "./app-BD7MP1Oe.js";
7
- import { useBreakpoints as Ee, components as ue, useDialog as ze, useSnackbar as kt, useProxiedModel as je } from "@feedmepos/ui-library";
8
- import { storeToRefs as wt } from "pinia";
9
- import { d as Qe, c as He, _ as Ft } from "./TransferDialog.vue_vue_type_script_setup_true_lang-DijNNVgt.js";
10
- import { useRouter as Tt } from "vue-router";
11
- import { u as Ct } from "./supplier-DErisCtS.js";
12
- import { F as N, _ as Ge } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
13
- import { _ as $t } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BYX1ubPe.js";
14
- const St = { class: "flex flex-col" }, Lt = { class: "flex flex-col" }, Mt = { class: "flex-1" }, It = { class: "flex items-center" }, Dt = { class: "flex-1" }, Vt = { class: "flex-1" }, At = /* @__PURE__ */ X({
1
+ import { defineComponent as J, onMounted as _e, computed as O, ref as U, watch as fe, inject as Ke, resolveComponent as C, openBlock as w, createElementBlock as P, createElementVNode as s, createVNode as u, withCtx as D, renderSlot as Re, withDirectives as Ae, normalizeClass as me, vModelText as Oe, reactive as Ze, h as Z, toDisplayString as T, unref as e, createBlock as N, createCommentVNode as H, isRef as xe, Fragment as ce, renderList as ve, onUnmounted as Je, normalizeStyle as Xe, Teleport as et, mergeProps as Pe, normalizeProps as tt, guardReactiveProps as ot } from "vue";
2
+ import { u as st, _ as nt, a as lt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-B9RU_arW.js";
3
+ import { useI18n as X } from "@feedmepos/mf-common";
4
+ import { P as pe, a as at, f as rt, b as Be, c as it } from "./purchase-order-transaction-type-DHzMBgFs.js";
5
+ import { F as ne, R as qe } from "./row-action.enum-PMKMRrZR.js";
6
+ import { $ as ye, t as Ue, I as ut, a0 as dt, a1 as mt, a as G, D as Ee, R as be, a2 as ct, a3 as pt, r as de, a4 as ft, l as yt, A as Ne, M as vt, b as he, u as bt, j as ge, y as _t, a5 as ie, a6 as xt, G as ht, a7 as gt } from "./app-C-z1MfF6.js";
7
+ import { useBreakpoints as ze, components as ue, useDialog as kt, useSnackbar as wt, useProxiedModel as je } from "@feedmepos/ui-library";
8
+ import { storeToRefs as Ft } from "pinia";
9
+ import { d as Qe } from "./defineDeepModel-7VQajdPt.js";
10
+ import { c as He, _ as Tt } from "./TransferDialog.vue_vue_type_script_setup_true_lang-BwkUuXqj.js";
11
+ import { useRouter as Ct } from "vue-router";
12
+ import { u as $t } from "./supplier-C6YWXF2Y.js";
13
+ import { F as E, _ as Ge } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
14
+ import { _ as St } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DkZrgqyr.js";
15
+ import { u as Ye } from "./use-template-enabled-locations-CFCfbaOd.js";
16
+ import { f as Mt } from "./format-time-from-id-9XFszs1J.js";
17
+ const It = { class: "flex flex-col" }, Dt = { class: "flex flex-col" }, Lt = { class: "flex-1" }, Vt = { class: "flex items-center" }, Rt = { class: "flex-1" }, At = { class: "flex-1" }, Ot = /* @__PURE__ */ J({
15
18
  __name: "FmMinMaxInput",
16
19
  props: {
17
20
  rules: {},
@@ -48,142 +51,142 @@ const St = { class: "flex flex-col" }, Lt = { class: "flex flex-col" }, Mt = { c
48
51
  helperText: {},
49
52
  helperState: {}
50
53
  },
51
- setup(m) {
52
- const y = m, u = Qe("modelValue"), l = dt();
53
- xe(() => {
54
- const { min: f, max: o } = u ?? {};
55
- if (!(!f || !o) && f.precision !== o.precision) {
56
- const t = Math.max(f.precision, o.precision), r = ve(f, t), p = ve(o, t);
57
- u.min = r, u.max = p;
54
+ setup(f) {
55
+ const y = f, d = Qe("modelValue"), l = ut();
56
+ _e(() => {
57
+ const { min: p, max: o } = d ?? {};
58
+ if (!(!p || !o) && p.precision !== o.precision) {
59
+ const t = Math.max(p.precision, o.precision), r = ye(p, t), m = ye(o, t);
60
+ d.min = r, d.max = m;
58
61
  }
59
62
  });
60
- const _ = V(() => {
61
- const { min: f, max: o } = u ?? {};
62
- return Math.max((f == null ? void 0 : f.precision) ?? 0, (o == null ? void 0 : o.precision) ?? 0, y.precision ?? 0);
63
- }), c = V(() => ({
64
- ...u
65
- })), n = (f) => {
66
- if (!f) return "";
67
- const o = mt(f), t = _.value, r = ve(o, t);
68
- return ct(
63
+ const _ = O(() => {
64
+ const { min: p, max: o } = d ?? {};
65
+ return Math.max((p == null ? void 0 : p.precision) ?? 0, (o == null ? void 0 : o.precision) ?? 0, y.precision ?? 0);
66
+ }), c = O(() => ({
67
+ ...d
68
+ })), n = (p) => {
69
+ if (!p) return "";
70
+ const o = dt(p), t = _.value, r = ye(o, t);
71
+ return mt(
69
72
  +G(r),
70
73
  r.precision
71
74
  );
72
- }, a = U(n(u.min)), v = U(n(u.max));
73
- fe([a, v], ([f, o]) => {
74
- const t = u ?? {}, r = l(f), p = l(o), i = _.value;
75
- if (f !== "" && r === !0) {
76
- const h = Be(+f, i);
77
- t.min = h;
75
+ }, a = U(n(d.min)), F = U(n(d.max));
76
+ fe([a, F], ([p, o]) => {
77
+ const t = d ?? {}, r = l(p), m = l(o), i = _.value;
78
+ if (p !== "" && r === !0) {
79
+ const b = Ue(+p, i);
80
+ t.min = b;
78
81
  } else
79
82
  t.min = null;
80
- if (o !== "" && p === !0) {
81
- const h = Be(+o, i);
82
- t.max = h;
83
+ if (o !== "" && m === !0) {
84
+ const b = Ue(+o, i);
85
+ t.max = b;
83
86
  } else
84
87
  t.max = null;
85
- u.min = t.min, u.max = t.max;
88
+ d.min = t.min, d.max = t.max;
86
89
  });
87
- const b = Symbol.for("fm:form-state"), g = Ke(b, null), L = V(() => y.disabled ?? (g == null ? void 0 : g.getDisabled()) ?? !1), M = U(), w = U(), x = U(!1), F = U(!1), R = V(() => x.value || F.value), q = V(() => [...[
90
+ const L = Symbol.for("fm:form-state"), S = Ke(L, null), M = O(() => y.disabled ?? (S == null ? void 0 : S.getDisabled()) ?? !1), I = U(), h = U(), v = U(!1), g = U(!1), R = O(() => v.value || g.value), q = O(() => [...[
88
91
  function() {
89
- return typeof l(a.value) == "string" || typeof l(v.value) == "string" ? "Must be a number" : !0;
92
+ return typeof l(a.value) == "string" || typeof l(F.value) == "string" ? "Must be a number" : !0;
90
93
  },
91
94
  function(t) {
92
95
  return !t || !t.min || !t.max ? !0 : +G(t.min) > +G(t.max) ? "Min must be less than or equal to max" : !0;
93
96
  }
94
97
  ], ...y.rules ?? []]);
95
- return (f, o) => {
96
- const t = S("FmLabel"), r = S("FmField"), p = S("FmFormGroup");
97
- return C(), P("div", St, [
98
- s("div", Lt, [
99
- s("div", Mt, [
100
- d(t, {
101
- label: f.label,
102
- disabled: f.disabled,
103
- required: f.labelMark === "required",
104
- optional: f.labelMark === "optional"
98
+ return (p, o) => {
99
+ const t = C("FmLabel"), r = C("FmField"), m = C("FmFormGroup");
100
+ return w(), P("div", It, [
101
+ s("div", Dt, [
102
+ s("div", Lt, [
103
+ u(t, {
104
+ label: p.label,
105
+ disabled: p.disabled,
106
+ required: p.labelMark === "required",
107
+ optional: p.labelMark === "optional"
105
108
  }, null, 8, ["label", "disabled", "required", "optional"])
106
109
  ]),
107
- d(r, { focused: R.value }, {
110
+ u(r, { focused: R.value }, {
108
111
  default: D(() => [
109
- s("div", It, [
110
- De(f.$slots, "prepend"),
112
+ s("div", Vt, [
113
+ Re(p.$slots, "prepend"),
111
114
  o[6] || (o[6] = s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Min.", -1)),
112
- s("div", Dt, [
113
- Ve(s("input", {
115
+ s("div", Rt, [
116
+ Ae(s("input", {
114
117
  type: "text",
115
118
  ref_key: "minInputRef",
116
- ref: M,
117
- onFocus: o[0] || (o[0] = () => x.value = !0),
118
- onBlur: o[1] || (o[1] = () => x.value = !1),
119
+ ref: I,
120
+ onFocus: o[0] || (o[0] = () => v.value = !0),
121
+ onBlur: o[1] || (o[1] = () => v.value = !1),
119
122
  "onUpdate:modelValue": o[2] || (o[2] = (i) => a.value = i),
120
123
  class: me({
121
124
  "fm-text-field--input fm-typo-en-body-lg-400": !0,
122
- "text-fm-color-typo-primary": !L.value,
123
- "text-fm-color-typo-disabled": L.value
125
+ "text-fm-color-typo-primary": !M.value,
126
+ "text-fm-color-typo-disabled": M.value
124
127
  })
125
128
  }, null, 34), [
126
- [Ae, a.value]
129
+ [Oe, a.value]
127
130
  ])
128
131
  ]),
129
132
  o[7] || (o[7] = s("div", { class: "block h-32 mx-4 w-[1px] bg-fm-color-neutral-gray-200" }, null, -1)),
130
133
  o[8] || (o[8] = s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Max.", -1)),
131
- s("div", Vt, [
132
- Ve(s("input", {
134
+ s("div", At, [
135
+ Ae(s("input", {
133
136
  type: "text",
134
137
  ref_key: "maxInputRef",
135
- ref: w,
136
- onFocus: o[3] || (o[3] = () => F.value = !0),
137
- onBlur: o[4] || (o[4] = () => F.value = !1),
138
- "onUpdate:modelValue": o[5] || (o[5] = (i) => v.value = i),
138
+ ref: h,
139
+ onFocus: o[3] || (o[3] = () => g.value = !0),
140
+ onBlur: o[4] || (o[4] = () => g.value = !1),
141
+ "onUpdate:modelValue": o[5] || (o[5] = (i) => F.value = i),
139
142
  class: me({
140
143
  "fm-text-field--input fm-typo-en-body-lg-400": !0,
141
- "text-fm-color-typo-primary": !L.value,
142
- "text-fm-color-typo-disabled": L.value
144
+ "text-fm-color-typo-primary": !M.value,
145
+ "text-fm-color-typo-disabled": M.value
143
146
  })
144
147
  }, null, 34), [
145
- [Ae, v.value]
148
+ [Oe, F.value]
146
149
  ])
147
150
  ]),
148
- De(f.$slots, "append")
151
+ Re(p.$slots, "append")
149
152
  ])
150
153
  ]),
151
154
  _: 3
152
155
  }, 8, ["focused"])
153
156
  ]),
154
- d(p, {
157
+ u(m, {
155
158
  class: "flex-1",
156
159
  "model-value": c.value,
157
- info: f.labelInfo,
160
+ info: p.labelInfo,
158
161
  rules: q.value,
159
- "helper-text": f.helperText,
160
- "helper-state": f.helperState
162
+ "helper-text": p.helperText,
163
+ "helper-state": p.helperState
161
164
  }, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
162
165
  ]);
163
166
  };
164
167
  }
165
168
  });
166
- function Rt() {
169
+ function Pt() {
167
170
  return function(y) {
168
171
  return !y || !y.min || !y.max ? "Required" : !0;
169
172
  };
170
173
  }
171
- function Ot(m, y) {
174
+ function Bt(f, y) {
172
175
  return function(l) {
173
- return !l || !l.min || !l.max ? !0 : +G(l.min) < m ? `Must be between ${m} and ${y}` : +G(l.max) > y ? `Must be between ${m} and ${y}` : !0;
176
+ return !l || !l.min || !l.max ? !0 : +G(l.min) < f ? `Must be between ${f} and ${y}` : +G(l.max) > y ? `Must be between ${f} and ${y}` : !0;
174
177
  };
175
178
  }
176
- var A = /* @__PURE__ */ ((m) => (m.Code = "Code", m.Name = "Name", m.DefaultAmount = "DefaultAmount", m.Limit = "Limit", m.MinimumAmount = "MinimumAmount", m.Step = "Step", m.Cost = "Cost", m.Delete = "Delete", m))(A || {});
177
- function Pt(m) {
178
- const { t: y } = Z(), u = Ze({});
179
- Ee(), xe(() => {
180
- for (const c of m.items) {
179
+ var V = /* @__PURE__ */ ((f) => (f.Code = "Code", f.Name = "Name", f.DefaultAmount = "DefaultAmount", f.Limit = "Limit", f.MinimumAmount = "MinimumAmount", f.Step = "Step", f.Cost = "Cost", f.Delete = "Delete", f))(V || {});
180
+ function qt(f) {
181
+ const { t: y } = X(), d = Ze({});
182
+ ze(), _e(() => {
183
+ for (const c of f.items) {
181
184
  if (!c.totalCost)
182
185
  continue;
183
186
  const n = He(c.sku, c.quantity, c.measurement, {
184
- supplier: m.supplier
185
- }), a = c.totalCost ?? qe.reset();
186
- n ? u[c.sku._id] = n.amount !== a.amount || n.precision !== a.precision : u[c.sku._id] = !0;
187
+ supplier: f.supplier
188
+ }), a = c.totalCost ?? Ee.reset();
189
+ n ? d[c.sku._id] = n.amount !== a.amount || n.precision !== a.precision : d[c.sku._id] = !0;
187
190
  }
188
191
  });
189
192
  const l = [
@@ -194,16 +197,16 @@ function Pt(m) {
194
197
  size: 96,
195
198
  cell(c) {
196
199
  const n = c.row.original;
197
- return J(ue.FmTextField, {
200
+ return Z(ue.FmTextField, {
198
201
  modelValue: n.code,
199
202
  "onUpdate:modelValue": (a) => {
200
- m.updateItem({
203
+ f.updateItem({
201
204
  ...n,
202
205
  code: a
203
206
  });
204
207
  },
205
208
  key: n.sku._id,
206
- rules: [_e()],
209
+ rules: [be()],
207
210
  labelMark: "required"
208
211
  });
209
212
  },
@@ -215,16 +218,16 @@ function Pt(m) {
215
218
  minSize: 300,
216
219
  cell(c) {
217
220
  const n = c.row.original;
218
- return J(ue.FmTextField, {
221
+ return Z(ue.FmTextField, {
219
222
  modelValue: n.name,
220
223
  "onUpdate:modelValue": (a) => {
221
- m.updateItem({
224
+ f.updateItem({
222
225
  ...n,
223
226
  name: a
224
227
  });
225
228
  },
226
229
  key: n.sku._id,
227
- rules: [_e()],
230
+ rules: [be()],
228
231
  labelMark: "required"
229
232
  });
230
233
  },
@@ -236,7 +239,7 @@ function Pt(m) {
236
239
  minSize: 200,
237
240
  cell(c) {
238
241
  const n = c.row.original;
239
- return J(pt, {
242
+ return Z(ct, {
240
243
  style: {
241
244
  flex: "1 1 0%"
242
245
  },
@@ -244,18 +247,18 @@ function Pt(m) {
244
247
  amount: n.quantity ?? { amount: 1, precision: 0 },
245
248
  measurement: n.measurement ?? null
246
249
  },
247
- disabled: m.disabled,
250
+ disabled: f.disabled,
248
251
  key: n.sku._id,
249
252
  unit: n.sku.unit,
250
253
  "onUpdate:modelValue": (a) => {
251
- m.updateItem({
254
+ f.updateItem({
252
255
  ...n,
253
256
  quantity: a.amount,
254
257
  measurement: a.measurement
255
258
  });
256
259
  },
257
260
  rules: [
258
- ft(
261
+ pt(
259
262
  +G(
260
263
  n.minimumQuantity ?? {
261
264
  amount: 1,
@@ -263,7 +266,7 @@ function Pt(m) {
263
266
  }
264
267
  )
265
268
  ),
266
- yt(
269
+ ft(
267
270
  n.maximumQuantity ? +G(n.maximumQuantity) : 1 / 0
268
271
  )
269
272
  ],
@@ -279,7 +282,7 @@ function Pt(m) {
279
282
  minSize: 280,
280
283
  cell(c) {
281
284
  const n = c.row.original;
282
- return J(At, {
285
+ return Z(Ot, {
283
286
  style: {
284
287
  flex: "1 1 0%"
285
288
  },
@@ -287,16 +290,16 @@ function Pt(m) {
287
290
  min: n.minimumQuantity,
288
291
  max: n.maximumQuantity
289
292
  },
290
- disabled: m.disabled,
293
+ disabled: f.disabled,
291
294
  key: n.sku._id,
292
295
  unit: n.sku.unit,
293
296
  "onUpdate:modelValue": (a) => {
294
- const v = { ...n };
295
- a != null && a.min && (v.minimumQuantity = a.min), a != null && a.max && (v.maximumQuantity = a.max), m.updateItem(v);
297
+ const F = { ...n };
298
+ a != null && a.min && (F.minimumQuantity = a.min), a != null && a.max && (F.maximumQuantity = a.max), f.updateItem(F);
296
299
  },
297
300
  rules: [
298
- Rt(),
299
- Ot(
301
+ Pt(),
302
+ Bt(
300
303
  +G({
301
304
  amount: 1,
302
305
  precision: de(n.sku.unit, n.measurement)
@@ -315,21 +318,21 @@ function Pt(m) {
315
318
  minSize: 100,
316
319
  cell(c) {
317
320
  const n = c.row.original;
318
- return J(ue.FmTextField, {
319
- modelValue: G(n.quantityStep ?? qe.reset(), !1),
321
+ return Z(ue.FmTextField, {
322
+ modelValue: G(n.quantityStep ?? Ee.reset(), !1),
320
323
  key: n.sku._id,
321
324
  "onUpdate:modelValue": (a) => {
322
- m.updateItem({
325
+ f.updateItem({
323
326
  ...n,
324
- quantityStep: vt(+a)
327
+ quantityStep: yt(+a)
325
328
  });
326
329
  },
327
330
  rules: [
328
- Ue({
331
+ Ne({
329
332
  amount: 1,
330
333
  precision: de(n.sku.unit, n.measurement)
331
334
  }),
332
- bt(n.sku.unit, n.measurement)
335
+ vt(n.sku.unit, n.measurement)
333
336
  ]
334
337
  });
335
338
  },
@@ -460,16 +463,16 @@ function Pt(m) {
460
463
  header: "",
461
464
  cell(c) {
462
465
  const n = c.row.original;
463
- return J(ue.FmButton, {
466
+ return Z(ue.FmButton, {
464
467
  class: "delete-button",
465
468
  key: n.sku._id,
466
469
  type: "button",
467
470
  icon: "delete",
468
471
  variant: "tertiary",
469
472
  size: "md",
470
- disabled: m.disabled,
473
+ disabled: f.disabled,
471
474
  onClick: () => {
472
- m.deleteItem(n);
475
+ f.deleteItem(n);
473
476
  }
474
477
  });
475
478
  },
@@ -482,100 +485,100 @@ function Pt(m) {
482
485
  }
483
486
  ];
484
487
  return {
485
- columnDefs: V(() => ge().enableTotalCost && m.transferType === pe.PURCHASE ? l : l.filter((n) => n.id !== "Cost"))
488
+ columnDefs: O(() => he().enableTotalCost && f.transferType === pe.PURCHASE ? l : l.filter((n) => n.id !== "Cost"))
486
489
  };
487
490
  }
488
- const Bt = { class: "flex flex-col gap-8 py-16" }, qt = { class: "flex items-center" }, Ut = { class: "flex-1 flex gap-1 items-center" }, Nt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Et = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, zt = { class: "flex gap-8 w-full" }, jt = { class: "flex-1 flex flex-col gap-4" }, Qt = { class: "flex-1 flex flex-col gap-4" }, Ht = { class: "flex gap-8 w-full" }, Gt = { class: "flex-1 flex flex-col gap-4" }, Yt = { class: "flex-1 flex flex-col gap-4" }, Wt = { class: "flex gap-8 w-full" }, Kt = { class: "flex-1 flex flex-col gap-4" }, Zt = { class: "flex-1 flex flex-col gap-4" }, Jt = /* @__PURE__ */ X({
491
+ const Ut = { class: "flex flex-col gap-8 py-16" }, Et = { class: "flex items-center" }, Nt = { class: "flex-1 flex gap-1 items-center" }, zt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, jt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Qt = { class: "flex gap-8 w-full" }, Ht = { class: "flex-1 flex flex-col gap-4" }, Gt = { class: "flex-1 flex flex-col gap-4" }, Yt = { class: "flex gap-8 w-full" }, Wt = { class: "flex-1 flex flex-col gap-4" }, Kt = { class: "flex-1 flex flex-col gap-4" }, Zt = { class: "flex gap-8 w-full" }, Jt = { class: "flex-1 flex flex-col gap-4" }, Xt = { class: "flex-1 flex flex-col gap-4" }, eo = /* @__PURE__ */ J({
489
492
  __name: "TransferTemplateItem",
490
493
  props: {
491
494
  cellByColId: {},
492
495
  row: {}
493
496
  },
494
- setup(m) {
495
- const { t: y } = Z();
496
- return (u, l) => {
497
- var c, n, a, v, b, g, L, M, w, x, F, R, q, f, o, t, r, p, i, h, O, I, T, B, z, j, k, Q, Y, ee, te, W, oe, K, se;
498
- const _ = S("FmLabel");
499
- return C(), P("div", Bt, [
500
- s("div", qt, [
501
- s("div", Ut, [
502
- s("span", Nt, " (" + $(u.row.original.sku.code) + ") ", 1),
503
- s("span", Et, $(u.row.original.sku.name), 1)
497
+ setup(f) {
498
+ const { t: y } = X();
499
+ return (d, l) => {
500
+ var c, n, a, F, L, S, M, I, h, v, g, R, q, p, o, t, r, m, i, b, A, $, k, B, z, j, x, Q, Y, ee, te, W, oe, K, se;
501
+ const _ = C("FmLabel");
502
+ return w(), P("div", Ut, [
503
+ s("div", Et, [
504
+ s("div", Nt, [
505
+ s("span", zt, " (" + T(d.row.original.sku.code) + ") ", 1),
506
+ s("span", jt, T(d.row.original.sku.name), 1)
504
507
  ]),
505
508
  s("div", null, [
506
- d(e(N), {
507
- render: (a = (n = (c = u.cellByColId.Delete) == null ? void 0 : c.column) == null ? void 0 : n.columnDef) == null ? void 0 : a.cell,
508
- props: (b = (v = u.cellByColId.Delete) == null ? void 0 : v.getContext) == null ? void 0 : b.call(v)
509
+ u(e(E), {
510
+ render: (a = (n = (c = d.cellByColId.Delete) == null ? void 0 : c.column) == null ? void 0 : n.columnDef) == null ? void 0 : a.cell,
511
+ props: (L = (F = d.cellByColId.Delete) == null ? void 0 : F.getContext) == null ? void 0 : L.call(F)
509
512
  }, null, 8, ["render", "props"])
510
513
  ])
511
514
  ]),
512
- s("div", zt, [
513
- s("div", jt, [
514
- d(_, {
515
- label: e(y)(`inventory.transfer.form.items.table.${e(A).Code}`)
515
+ s("div", Qt, [
516
+ s("div", Ht, [
517
+ u(_, {
518
+ label: e(y)(`inventory.transfer.form.items.table.${e(V).Code}`)
516
519
  }, null, 8, ["label"]),
517
- d(e(N), {
518
- render: (M = (L = (g = u.cellByColId[e(A).Code]) == null ? void 0 : g.column) == null ? void 0 : L.columnDef) == null ? void 0 : M.cell,
519
- props: (x = (w = u.cellByColId[e(A).Code]) == null ? void 0 : w.getContext) == null ? void 0 : x.call(w)
520
+ u(e(E), {
521
+ render: (I = (M = (S = d.cellByColId[e(V).Code]) == null ? void 0 : S.column) == null ? void 0 : M.columnDef) == null ? void 0 : I.cell,
522
+ props: (v = (h = d.cellByColId[e(V).Code]) == null ? void 0 : h.getContext) == null ? void 0 : v.call(h)
520
523
  }, null, 8, ["render", "props"]),
521
524
  l[0] || (l[0] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
522
525
  ]),
523
- s("div", Qt, [
524
- d(_, {
525
- label: e(y)(`inventory.transfer.form.items.table.${e(A).Name}`)
526
+ s("div", Gt, [
527
+ u(_, {
528
+ label: e(y)(`inventory.transfer.form.items.table.${e(V).Name}`)
526
529
  }, null, 8, ["label"]),
527
- d(e(N), {
528
- render: (q = (R = (F = u.cellByColId[e(A).Name]) == null ? void 0 : F.column) == null ? void 0 : R.columnDef) == null ? void 0 : q.cell,
529
- props: (o = (f = u.cellByColId[e(A).Name]) == null ? void 0 : f.getContext) == null ? void 0 : o.call(f)
530
+ u(e(E), {
531
+ render: (q = (R = (g = d.cellByColId[e(V).Name]) == null ? void 0 : g.column) == null ? void 0 : R.columnDef) == null ? void 0 : q.cell,
532
+ props: (o = (p = d.cellByColId[e(V).Name]) == null ? void 0 : p.getContext) == null ? void 0 : o.call(p)
530
533
  }, null, 8, ["render", "props"]),
531
534
  l[1] || (l[1] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
532
535
  ])
533
536
  ]),
534
- s("div", Ht, [
535
- s("div", Gt, [
536
- d(_, {
537
- label: e(y)(`inventory.transfer.form.items.table.${e(A).Limit}`)
537
+ s("div", Yt, [
538
+ s("div", Wt, [
539
+ u(_, {
540
+ label: e(y)(`inventory.transfer.form.items.table.${e(V).Limit}`)
538
541
  }, null, 8, ["label"]),
539
- d(e(N), {
540
- render: (p = (r = (t = u.cellByColId[e(A).Limit]) == null ? void 0 : t.column) == null ? void 0 : r.columnDef) == null ? void 0 : p.cell,
541
- props: (h = (i = u.cellByColId[e(A).Limit]) == null ? void 0 : i.getContext) == null ? void 0 : h.call(i)
542
+ u(e(E), {
543
+ render: (m = (r = (t = d.cellByColId[e(V).Limit]) == null ? void 0 : t.column) == null ? void 0 : r.columnDef) == null ? void 0 : m.cell,
544
+ props: (b = (i = d.cellByColId[e(V).Limit]) == null ? void 0 : i.getContext) == null ? void 0 : b.call(i)
542
545
  }, null, 8, ["render", "props"]),
543
546
  l[2] || (l[2] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
544
547
  ]),
545
- s("div", Yt, [
546
- d(_, {
547
- label: e(y)(`inventory.transfer.form.items.table.${e(A).Step}`)
548
+ s("div", Kt, [
549
+ u(_, {
550
+ label: e(y)(`inventory.transfer.form.items.table.${e(V).Step}`)
548
551
  }, null, 8, ["label"]),
549
- d(e(N), {
550
- render: (T = (I = (O = u.cellByColId[e(A).Step]) == null ? void 0 : O.column) == null ? void 0 : I.columnDef) == null ? void 0 : T.cell,
551
- props: (z = (B = u.cellByColId[e(A).Step]) == null ? void 0 : B.getContext) == null ? void 0 : z.call(B)
552
+ u(e(E), {
553
+ render: (k = ($ = (A = d.cellByColId[e(V).Step]) == null ? void 0 : A.column) == null ? void 0 : $.columnDef) == null ? void 0 : k.cell,
554
+ props: (z = (B = d.cellByColId[e(V).Step]) == null ? void 0 : B.getContext) == null ? void 0 : z.call(B)
552
555
  }, null, 8, ["render", "props"]),
553
556
  l[3] || (l[3] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
554
557
  ])
555
558
  ]),
556
- s("div", Wt, [
557
- s("div", Kt, [
558
- d(_, {
559
- label: e(y)(`inventory.transfer.form.items.table.${e(A).DefaultAmount}`)
559
+ s("div", Zt, [
560
+ s("div", Jt, [
561
+ u(_, {
562
+ label: e(y)(`inventory.transfer.form.items.table.${e(V).DefaultAmount}`)
560
563
  }, null, 8, ["label"]),
561
- d(e(N), {
562
- render: (Q = (k = (j = u.cellByColId[e(A).DefaultAmount]) == null ? void 0 : j.column) == null ? void 0 : k.columnDef) == null ? void 0 : Q.cell,
563
- props: (ee = (Y = u.cellByColId[e(A).DefaultAmount]) == null ? void 0 : Y.getContext) == null ? void 0 : ee.call(Y)
564
+ u(e(E), {
565
+ render: (Q = (x = (j = d.cellByColId[e(V).DefaultAmount]) == null ? void 0 : j.column) == null ? void 0 : x.columnDef) == null ? void 0 : Q.cell,
566
+ props: (ee = (Y = d.cellByColId[e(V).DefaultAmount]) == null ? void 0 : Y.getContext) == null ? void 0 : ee.call(Y)
564
567
  }, null, 8, ["render", "props"]),
565
568
  l[4] || (l[4] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
566
569
  ]),
567
- s("div", Zt, [
568
- d($t, { "z-index": 50 }, {
570
+ s("div", Xt, [
571
+ u(St, { "z-index": 50 }, {
569
572
  default: D(() => [
570
- d(_, {
571
- label: e(y)(`inventory.transfer.form.items.table.${e(A).Cost}2`)
573
+ u(_, {
574
+ label: e(y)(`inventory.transfer.form.items.table.${e(V).Cost}2`)
572
575
  }, null, 8, ["label"])
573
576
  ]),
574
577
  _: 1
575
578
  }),
576
- d(e(N), {
577
- render: (oe = (W = (te = u.cellByColId[e(A).Cost]) == null ? void 0 : te.column) == null ? void 0 : W.columnDef) == null ? void 0 : oe.cell,
578
- props: (se = (K = u.cellByColId[e(A).Cost]) == null ? void 0 : K.getContext) == null ? void 0 : se.call(K)
579
+ u(e(E), {
580
+ render: (oe = (W = (te = d.cellByColId[e(V).Cost]) == null ? void 0 : te.column) == null ? void 0 : W.columnDef) == null ? void 0 : oe.cell,
581
+ props: (se = (K = d.cellByColId[e(V).Cost]) == null ? void 0 : K.getContext) == null ? void 0 : se.call(K)
579
582
  }, null, 8, ["render", "props"]),
580
583
  l[5] || (l[5] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
581
584
  ])
@@ -583,106 +586,55 @@ const Bt = { class: "flex flex-col gap-8 py-16" }, qt = { class: "flex items-cen
583
586
  ]);
584
587
  };
585
588
  }
586
- });
587
- function Ye(m) {
588
- const y = ze(), u = ye(), { t: l } = Z(), _ = V({
589
- get() {
590
- return Array.isArray(m.getLocations());
591
- },
592
- set(v) {
593
- v ? m.setLocations([]) : m.setLocations(null);
594
- }
595
- });
596
- function c() {
597
- var v;
598
- y.open({
599
- title: "Select at least one location",
600
- contentComponent: Ne,
601
- contentComponentProps: {
602
- modelValue: ((v = n.value) == null ? void 0 : v.map((b) => b.doc._id)) ?? [],
603
- items: u.locations.map((b) => ({
604
- label: b.name,
605
- sublabel: b.type,
606
- value: b.doc._id
607
- }))
608
- },
609
- primaryActions: {
610
- text: l("common.confirm"),
611
- close: !0
612
- },
613
- secondaryActions: {
614
- text: l("common.close"),
615
- close: !0
616
- }
617
- }).onPrimary((b) => {
618
- m.setLocations(u.locations.filter((g) => b.includes(g.doc._id)));
619
- });
620
- }
621
- const n = V(() => {
622
- var b;
623
- const v = /* @__PURE__ */ new Set([...u.locations.map((g) => g.doc._id)]);
624
- return (b = m.getLocations()) == null ? void 0 : b.filter((g) => v.has(g.doc._id));
625
- });
626
- function a(v) {
627
- var b;
628
- m.setLocations((b = m.getLocations()) == null ? void 0 : b.filter((g) => g.doc._id !== v));
629
- }
630
- return {
631
- enabledLocations: n,
632
- enabledLocationsSwitch: _,
633
- promptSelectLocations: c,
634
- removeLocation: a
635
- };
636
- }
637
- const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "flex flex-col gap-24" }, oo = {
589
+ }), to = { class: "flex flex-col gap-16" }, oo = { key: 0 }, so = { class: "flex flex-col gap-24" }, no = {
638
590
  key: 0,
639
591
  class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col gap-16"
640
- }, so = { key: 1 }, no = { class: "flex flex-col gap-16" }, lo = { class: "flex" }, ao = { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, ro = /* @__PURE__ */ X({
592
+ }, lo = { key: 1 }, ao = { class: "flex flex-col gap-16" }, ro = { class: "flex" }, io = { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, uo = /* @__PURE__ */ J({
641
593
  __name: "TransferTemplateForm",
642
594
  props: {
643
595
  modelValue: {},
644
596
  disabled: { type: Boolean }
645
597
  },
646
- setup(m, { expose: y }) {
647
- const u = m, l = Qe(), { t: _ } = Z(), c = ye(), n = _t(), a = Ct(), v = V(() => c.businessLevel);
598
+ setup(f, { expose: y }) {
599
+ const d = f, l = Qe(), { t: _ } = X(), c = ge(), n = bt(), a = $t(), F = O(() => c.businessLevel);
648
600
  fe(
649
- () => u.modelValue,
601
+ () => d.modelValue,
650
602
  (o) => {
651
603
  console.log("TransferTemplateForm.model", o);
652
604
  }
653
605
  ), c.watchLocation(async () => {
654
606
  location && (l.purchaseOrder.supplier || (l.purchaseOrder.supplier = a.suppliers.find((o) => o) ?? l.purchaseOrder.supplier));
655
607
  });
656
- const b = ze(), { enabledLocations: g, enabledLocationsSwitch: L, promptSelectLocations: M, removeLocation: w } = Ye({
608
+ const L = kt(), { enabledLocations: S, enabledLocationsSwitch: M, promptSelectLocations: I, removeLocation: h } = Ye({
657
609
  getLocations() {
658
610
  return l.locations;
659
611
  },
660
612
  setLocations(o) {
661
613
  l.locations = o;
662
614
  }
663
- }), x = V({
615
+ }), v = O({
664
616
  get() {
665
617
  return l.purchaseOrder.remark ?? void 0;
666
618
  },
667
619
  set(o) {
668
620
  l.purchaseOrder.remark = o;
669
621
  }
670
- }), F = U();
622
+ }), g = U();
671
623
  y({
672
624
  validateInputs: () => {
673
625
  var o, t;
674
- (t = (o = F.value) == null ? void 0 : o.validateInputs) == null || t.call(o);
626
+ (t = (o = g.value) == null ? void 0 : o.validateInputs) == null || t.call(o);
675
627
  },
676
628
  resetInputsValidation: () => {
677
629
  var o, t;
678
- (t = (o = F.value) == null ? void 0 : o.resetInputsValidation) == null || t.call(o);
630
+ (t = (o = g.value) == null ? void 0 : o.resetInputsValidation) == null || t.call(o);
679
631
  },
680
632
  resetInputs: () => {
681
633
  var o, t;
682
- (t = (o = F.value) == null ? void 0 : o.resetInputs) == null || t.call(o);
634
+ (t = (o = g.value) == null ? void 0 : o.resetInputs) == null || t.call(o);
683
635
  }
684
636
  });
685
- const R = Pt({
637
+ const R = qt({
686
638
  updateItem: (o) => {
687
639
  l.purchaseOrder.items = l.purchaseOrder.items.map((t) => t.sku._id !== o.sku._id ? t : o);
688
640
  },
@@ -701,22 +653,22 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
701
653
  return pe.PURCHASE;
702
654
  },
703
655
  get disabled() {
704
- return u.disabled;
656
+ return d.disabled;
705
657
  }
706
- }), q = V(() => R.columnDefs.value);
707
- function f() {
658
+ }), q = O(() => R.columnDefs.value);
659
+ function p() {
708
660
  const o = n.skus.map((r) => ({
709
661
  label: r.name,
710
662
  sublabel: r.code,
711
663
  value: r
712
664
  })), t = o.filter((r) => {
713
- var p;
714
- return (p = l.purchaseOrder.items) == null ? void 0 : p.find((i) => i.sku._id === r.value._id);
665
+ var m;
666
+ return (m = l.purchaseOrder.items) == null ? void 0 : m.find((i) => i.sku._id === r.value._id);
715
667
  }).map((r) => r.value);
716
- b.open({
668
+ L.open({
717
669
  title: _("inventory.transfer.form.items.selectItem"),
718
670
  closeButton: !0,
719
- contentComponent: Ne,
671
+ contentComponent: _t,
720
672
  contentComponentProps: {
721
673
  modelValue: t,
722
674
  items: o
@@ -731,100 +683,100 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
731
683
  variant: "tertiary"
732
684
  }
733
685
  }).onPrimary((r) => {
734
- const p = l.purchaseOrder.items ?? [], i = r.map((h) => {
735
- const O = p.find((B) => B.sku._id === h._id);
736
- if (O)
737
- return O;
738
- const I = { amount: 1, precision: de(h.unit) }, T = {
739
- sku: h,
740
- code: h.code,
741
- name: h.name,
742
- quantity: I,
743
- minimumQuantity: I,
744
- maximumQuantity: I,
745
- quantityStep: I
686
+ const m = l.purchaseOrder.items ?? [], i = r.map((b) => {
687
+ const A = m.find((B) => B.sku._id === b._id);
688
+ if (A)
689
+ return A;
690
+ const $ = { amount: 1, precision: de(b.unit) }, k = {
691
+ sku: b,
692
+ code: b.code,
693
+ name: b.name,
694
+ quantity: $,
695
+ minimumQuantity: $,
696
+ maximumQuantity: $,
697
+ quantityStep: $
746
698
  };
747
- return T.totalCost = He(
748
- T.sku,
749
- T.quantity,
750
- T.measurement,
699
+ return k.totalCost = He(
700
+ k.sku,
701
+ k.quantity,
702
+ k.measurement,
751
703
  {
752
704
  supplier: l.purchaseOrder.supplier
753
705
  }
754
- ), T;
706
+ ), k;
755
707
  });
756
- i.sort((h, O) => h.sku.code.localeCompare(O.sku.code)), l.purchaseOrder.items = i;
708
+ i.sort((b, A) => b.sku.code.localeCompare(A.sku.code)), l.purchaseOrder.items = i;
757
709
  });
758
710
  }
759
711
  return (o, t) => {
760
- const r = S("FmChip"), p = S("FmTextField"), i = S("FmTextarea"), h = S("FmSwitch"), O = S("FmButton"), I = S("FmListItem"), T = S("FmList"), B = S("FmFormGroup"), z = S("FmTable"), j = S("FmForm");
761
- return C(), E(j, {
712
+ const r = C("FmChip"), m = C("FmTextField"), i = C("FmTextarea"), b = C("FmSwitch"), A = C("FmButton"), $ = C("FmListItem"), k = C("FmList"), B = C("FmFormGroup"), z = C("FmTable"), j = C("FmForm");
713
+ return w(), N(j, {
762
714
  ref_key: "formRef",
763
- ref: F,
715
+ ref: g,
764
716
  class: "flex flex-col gap-32",
765
717
  disabled: o.disabled
766
718
  }, {
767
719
  default: D(() => [
768
- s("div", Xt, [
769
- v.value ? (C(), P("div", eo, [
770
- d(r, {
720
+ s("div", to, [
721
+ F.value ? (w(), P("div", oo, [
722
+ u(r, {
771
723
  label: "Business template",
772
724
  compact: ""
773
725
  })
774
726
  ])) : H("", !0),
775
- s("div", to, [
776
- d(p, {
727
+ s("div", so, [
728
+ u(m, {
777
729
  label: e(_)("inventory.transfer.form.name"),
778
730
  "label-mark": "required",
779
731
  modelValue: e(l).name,
780
- "onUpdate:modelValue": t[0] || (t[0] = (k) => e(l).name = k),
781
- rules: [e(_e)()]
732
+ "onUpdate:modelValue": t[0] || (t[0] = (x) => e(l).name = x),
733
+ rules: [e(be)()]
782
734
  }, null, 8, ["label", "modelValue", "rules"]),
783
- d(p, {
735
+ u(m, {
784
736
  label: e(_)("inventory.transfer.form.reference"),
785
737
  "label-mark": "optional",
786
738
  modelValue: e(l).purchaseOrder.ref,
787
- "onUpdate:modelValue": t[1] || (t[1] = (k) => e(l).purchaseOrder.ref = k)
739
+ "onUpdate:modelValue": t[1] || (t[1] = (x) => e(l).purchaseOrder.ref = x)
788
740
  }, null, 8, ["label", "modelValue"]),
789
- d(i, {
741
+ u(i, {
790
742
  label: e(_)("inventory.transfer.form.remark"),
791
743
  "label-mark": "optional",
792
744
  "max-length": 240,
793
- modelValue: x.value,
794
- "onUpdate:modelValue": t[2] || (t[2] = (k) => x.value = k),
745
+ modelValue: v.value,
746
+ "onUpdate:modelValue": t[2] || (t[2] = (x) => v.value = x),
795
747
  class: me({ "text-fm-color-typo-disabled": o.disabled })
796
748
  }, null, 8, ["label", "modelValue", "class"])
797
749
  ])
798
750
  ]),
799
- e(c).businessLevel ? (C(), P("div", oo, [
800
- d(h, {
801
- modelValue: e(L),
802
- "onUpdate:modelValue": t[3] || (t[3] = (k) => he(L) ? L.value = k : null),
751
+ e(c).businessLevel ? (w(), P("div", no, [
752
+ u(b, {
753
+ modelValue: e(M),
754
+ "onUpdate:modelValue": t[3] || (t[3] = (x) => xe(M) ? M.value = x : null),
803
755
  label: "Locations rule",
804
756
  sublabel: "Enable template for specific locations only",
805
757
  "label-placement": "right"
806
758
  }, null, 8, ["modelValue"]),
807
- e(L) ? (C(), E(B, {
759
+ e(M) ? (w(), N(B, {
808
760
  key: 0,
809
- modelValue: e(g),
810
- rules: [e(Ue)(1)],
761
+ modelValue: e(S),
762
+ rules: [e(Ne)(1)],
811
763
  class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
812
764
  }, {
813
765
  default: D(() => [
814
- d(T, null, {
766
+ u(k, null, {
815
767
  default: D(() => [
816
- (C(!0), P(ce, null, be(e(g), (k) => (C(), E(I, {
817
- key: k.doc._id,
818
- label: k.name,
819
- sublabel: k.type,
768
+ (w(!0), P(ce, null, ve(e(S), (x) => (w(), N($, {
769
+ key: x.doc._id,
770
+ label: x.name,
771
+ sublabel: x.type,
820
772
  disabled: o.disabled
821
773
  }, {
822
774
  append: D(() => [
823
- d(O, {
775
+ u(A, {
824
776
  "prepend-icon": "delete",
825
777
  variant: "tertiary",
826
778
  disabled: o.disabled,
827
- onClick: (Q) => e(w)(k.doc._id)
779
+ onClick: (Q) => e(h)(x.doc._id)
828
780
  }, null, 8, ["disabled", "onClick"])
829
781
  ]),
830
782
  _: 2
@@ -835,44 +787,44 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
835
787
  ]),
836
788
  _: 1
837
789
  }, 8, ["modelValue", "rules"])) : H("", !0),
838
- e(L) ? (C(), P("div", so, [
839
- d(O, {
790
+ e(M) ? (w(), P("div", lo, [
791
+ u(A, {
840
792
  disabled: o.disabled,
841
793
  label: e(_)("inventory.transfer.form.items.addItem"),
842
794
  "prepend-icon": "add",
843
795
  variant: "plain",
844
796
  class: "border-2 rounded-lg border-fm-color-primary",
845
- onClick: e(M)
797
+ onClick: e(I)
846
798
  }, null, 8, ["disabled", "label", "onClick"])
847
799
  ])) : H("", !0)
848
800
  ])) : H("", !0),
849
- s("div", no, [
850
- s("div", lo, [
851
- s("div", ao, $(e(_)("inventory.transfer.form.items.title")), 1),
852
- d(O, {
801
+ s("div", ao, [
802
+ s("div", ro, [
803
+ s("div", io, T(e(_)("inventory.transfer.form.items.title")), 1),
804
+ u(A, {
853
805
  disabled: o.disabled,
854
806
  label: e(_)("inventory.transfer.form.items.addItem"),
855
807
  "prepend-icon": "add",
856
808
  variant: "plain",
857
809
  class: "border-2 rounded-lg border-fm-color-primary",
858
- onClick: t[4] || (t[4] = (k) => f()),
810
+ onClick: t[4] || (t[4] = (x) => p()),
859
811
  size: "md"
860
812
  }, null, 8, ["disabled", "label"])
861
813
  ]),
862
- (C(), E(z, {
814
+ (w(), N(z, {
863
815
  "column-defs": q.value,
864
816
  "row-data": e(l).purchaseOrder.items,
865
- key: e(l).purchaseOrder.items.map((k) => k.sku._id).join("."),
817
+ key: e(l).purchaseOrder.items.map((x) => x.sku._id).join("."),
866
818
  "hide-footer": ""
867
819
  }, {
868
- "list-row": D((k) => [
869
- (C(), E(Ge, {
870
- row: k,
820
+ "list-row": D((x) => [
821
+ (w(), N(Ge, {
822
+ row: x,
871
823
  key: e(l).purchaseOrder.items.map((Q) => Q.sku._id).join(".")
872
824
  }, {
873
825
  default: D((Q) => [
874
- d(Jt, {
875
- row: k,
826
+ u(eo, {
827
+ row: x,
876
828
  "cell-by-col-id": Q
877
829
  }, null, 8, ["row", "cell-by-col-id"])
878
830
  ]),
@@ -887,7 +839,7 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
887
839
  }, 8, ["disabled"]);
888
840
  };
889
841
  }
890
- }), io = { class: "flex items-center" }, uo = { class: "fm-typo-en-title-md-800" }, mo = { class: "flex gap-4" }, co = /* @__PURE__ */ X({
842
+ }), mo = { class: "flex items-center" }, co = { class: "fm-typo-en-title-md-800" }, po = { class: "flex gap-4" }, fo = /* @__PURE__ */ J({
891
843
  __name: "TransferTemplateDialog",
892
844
  props: {
893
845
  mode: {},
@@ -895,10 +847,10 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
895
847
  show: { type: Boolean }
896
848
  },
897
849
  emits: ["update:show", "submitted"],
898
- setup(m, { expose: y, emit: u }) {
850
+ setup(f, { expose: y, emit: d }) {
899
851
  var o;
900
- const l = m, _ = u, c = at(), n = kt(), { t: a } = Z(), v = je(l, "show");
901
- function b() {
852
+ const l = f, _ = d, c = at(), n = wt(), { t: a } = X(), F = je(l, "show");
853
+ function L() {
902
854
  return {
903
855
  _id: "",
904
856
  name: "",
@@ -930,15 +882,15 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
930
882
  }
931
883
  };
932
884
  }
933
- const g = U(l.modelValue ?? b()), L = U(((o = l.modelValue) == null ? void 0 : o._id) ?? `${Math.random()}`);
885
+ const S = U(l.modelValue ?? L()), M = U(((o = l.modelValue) == null ? void 0 : o._id) ?? `${Math.random()}`);
934
886
  fe(
935
887
  () => l.show,
936
888
  (t) => {
937
889
  var r;
938
- t && (g.value = l.modelValue ?? b(), L.value = ((r = l.modelValue) == null ? void 0 : r._id) ?? `${Math.random()}`);
890
+ t && (S.value = l.modelValue ?? L(), M.value = ((r = l.modelValue) == null ? void 0 : r._id) ?? `${Math.random()}`);
939
891
  }
940
892
  );
941
- const M = U(!1), w = V(() => {
893
+ const I = U(!1), h = O(() => {
942
894
  switch (l.mode) {
943
895
  case ne.READ:
944
896
  return "";
@@ -948,27 +900,27 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
948
900
  return a("inventory.transfer.template.update.title");
949
901
  }
950
902
  return "";
951
- }), x = U();
903
+ }), v = U();
952
904
  y({
953
905
  validateInputs: () => {
954
906
  var t, r;
955
- (r = (t = x.value) == null ? void 0 : t.validateInputs) == null || r.call(t);
907
+ (r = (t = v.value) == null ? void 0 : t.validateInputs) == null || r.call(t);
956
908
  },
957
909
  resetInputsValidation: () => {
958
910
  var t, r;
959
- (r = (t = x.value) == null ? void 0 : t.resetInputsValidation) == null || r.call(t);
911
+ (r = (t = v.value) == null ? void 0 : t.resetInputsValidation) == null || r.call(t);
960
912
  },
961
913
  resetInputs: () => {
962
914
  var t, r;
963
- (r = (t = x.value) == null ? void 0 : t.resetInputs) == null || r.call(t);
915
+ (r = (t = v.value) == null ? void 0 : t.resetInputs) == null || r.call(t);
964
916
  }
965
917
  });
966
- async function F() {
967
- var r, p;
968
- const t = g.value;
918
+ async function g() {
919
+ var r, m;
920
+ const t = S.value;
969
921
  if (t) {
970
- M.value = !0, (((r = t.purchaseOrder.supplier) == null ? void 0 : r.internal) === ie.enum.warehouse || ((p = t.purchaseOrder.supplier) == null ? void 0 : p.internal) === ie.enum.restaurant) && (t.purchaseOrder.items = t.purchaseOrder.items.map(
971
- ({ totalCost: i, ...h }) => h
922
+ I.value = !0, (((r = t.purchaseOrder.supplier) == null ? void 0 : r.internal) === ie.enum.warehouse || ((m = t.purchaseOrder.supplier) == null ? void 0 : m.internal) === ie.enum.restaurant) && (t.purchaseOrder.items = t.purchaseOrder.items.map(
923
+ ({ totalCost: i, ...b }) => b
972
924
  ));
973
925
  try {
974
926
  await c.createTemplate(t), await new Promise((i) => setTimeout(i, 1e3)), n.open({
@@ -983,16 +935,16 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
983
935
  type: "error"
984
936
  }), console.error("Error in creating transfer template", i);
985
937
  } finally {
986
- M.value = !1;
938
+ I.value = !1;
987
939
  }
988
940
  }
989
941
  }
990
942
  async function R() {
991
- var r, p;
992
- const t = g.value;
943
+ var r, m;
944
+ const t = S.value;
993
945
  if (t) {
994
- M.value = !0, (((r = t.purchaseOrder.supplier) == null ? void 0 : r.internal) === ie.enum.warehouse || ((p = t.purchaseOrder.supplier) == null ? void 0 : p.internal) === ie.enum.restaurant) && (t.purchaseOrder.items = t.purchaseOrder.items.map(
995
- ({ totalCost: i, ...h }) => h
946
+ I.value = !0, (((r = t.purchaseOrder.supplier) == null ? void 0 : r.internal) === ie.enum.warehouse || ((m = t.purchaseOrder.supplier) == null ? void 0 : m.internal) === ie.enum.restaurant) && (t.purchaseOrder.items = t.purchaseOrder.items.map(
947
+ ({ totalCost: i, ...b }) => b
996
948
  ));
997
949
  try {
998
950
  await c.updateTemplate(t), await new Promise((i) => setTimeout(i, 1e3)), n.open({
@@ -1007,60 +959,60 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
1007
959
  type: "error"
1008
960
  }), console.error("Error in updating transfer template", i);
1009
961
  } finally {
1010
- M.value = !1;
962
+ I.value = !1;
1011
963
  }
1012
964
  }
1013
965
  }
1014
966
  function q() {
1015
967
  switch (l.mode) {
1016
968
  case ne.CREATE:
1017
- return F();
969
+ return g();
1018
970
  case ne.UPDATE:
1019
971
  return R();
1020
972
  }
1021
973
  }
1022
- function f() {
974
+ function p() {
1023
975
  var t, r;
1024
- (r = (t = x.value) == null ? void 0 : t.validateInputs) == null || r.call(t);
976
+ (r = (t = v.value) == null ? void 0 : t.validateInputs) == null || r.call(t);
1025
977
  }
1026
978
  return (t, r) => {
1027
- const p = S("FmButton"), i = S("FmSideSheet");
1028
- return C(), E(i, {
1029
- modelValue: e(v),
1030
- "onUpdate:modelValue": r[2] || (r[2] = (h) => he(v) ? v.value = h : null),
979
+ const m = C("FmButton"), i = C("FmSideSheet");
980
+ return w(), N(i, {
981
+ modelValue: e(F),
982
+ "onUpdate:modelValue": r[2] || (r[2] = (b) => xe(F) ? F.value = b : null),
1031
983
  "dismiss-away": "",
1032
984
  "close-button": "",
1033
985
  "max-width": 1200
1034
986
  }, {
1035
987
  "side-sheet-header": D(() => [
1036
- s("div", io, [
1037
- s("div", uo, $(w.value), 1)
988
+ s("div", mo, [
989
+ s("div", co, T(h.value), 1)
1038
990
  ])
1039
991
  ]),
1040
992
  default: D(() => [
1041
- (C(), E(ro, {
993
+ (w(), N(uo, {
1042
994
  class: "w-full",
1043
995
  ref_key: "formRef",
1044
- ref: x,
996
+ ref: v,
1045
997
  onValidationSuccess: q,
1046
- "model-value": g.value,
1047
- "onUpdate:modelValue": r[0] || (r[0] = (h) => g.value = h),
1048
- disabled: M.value,
1049
- key: L.value
998
+ "model-value": S.value,
999
+ "onUpdate:modelValue": r[0] || (r[0] = (b) => S.value = b),
1000
+ disabled: I.value,
1001
+ key: M.value
1050
1002
  }, null, 8, ["model-value", "disabled"]))
1051
1003
  ]),
1052
1004
  "side-sheet-footer": D(() => [
1053
- s("div", mo, [
1054
- d(p, {
1055
- loading: M.value,
1005
+ s("div", po, [
1006
+ u(m, {
1007
+ loading: I.value,
1056
1008
  label: e(a)("common.save"),
1057
- onClick: f
1009
+ onClick: p
1058
1010
  }, null, 8, ["loading", "label"]),
1059
- d(p, {
1060
- disabled: M.value,
1011
+ u(m, {
1012
+ disabled: I.value,
1061
1013
  variant: "tertiary",
1062
1014
  label: e(a)("common.close"),
1063
- onClick: r[1] || (r[1] = (h) => _("update:show", !1))
1015
+ onClick: r[1] || (r[1] = (b) => _("update:show", !1))
1064
1016
  }, null, 8, ["disabled", "label"])
1065
1017
  ])
1066
1018
  ]),
@@ -1068,105 +1020,105 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
1068
1020
  }, 8, ["modelValue"]);
1069
1021
  };
1070
1022
  }
1071
- }), po = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, fo = { class: "flex justify-between" }, yo = { class: "fm-typo-en-body-lg-600" }, vo = { class: "flex flex-col gap-8" }, bo = { class: "flex flex-col gap-4" }, _o = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xo = { class: "flex gap-1" }, ho = { class: "fm-typo-en-body-lg-600" }, go = {
1023
+ }), yo = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, vo = { class: "flex justify-between" }, bo = { class: "fm-typo-en-body-lg-600" }, _o = { class: "flex flex-col gap-8" }, xo = { class: "flex flex-col gap-4" }, ho = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, go = { class: "flex gap-1" }, ko = { class: "fm-typo-en-body-lg-600" }, wo = {
1072
1024
  key: 0,
1073
1025
  class: "flex flex-col gap-4"
1074
- }, ko = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wo = { class: "fm-typo-en-body-lg-600" }, Fo = { class: "flex flex-col gap-4" }, To = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Co = { class: "fm-typo-en-body-lg-600" }, $o = {
1026
+ }, Fo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, To = { class: "fm-typo-en-body-lg-600" }, Co = { class: "flex flex-col gap-4" }, $o = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, So = { class: "fm-typo-en-body-lg-600" }, Mo = {
1075
1027
  key: 1,
1076
1028
  class: "flex flex-col gap-4"
1077
- }, So = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Lo = { class: "fm-typo-en-body-lg-600" }, Mo = {
1029
+ }, Io = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Do = { class: "fm-typo-en-body-lg-600" }, Lo = {
1078
1030
  key: 2,
1079
1031
  class: "flex flex-col gap-4"
1080
- }, Io = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Do = { class: "fm-typo-en-body-lg-600" }, Vo = {
1032
+ }, Vo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ro = { class: "fm-typo-en-body-lg-600" }, Ao = {
1081
1033
  key: 3,
1082
1034
  class: "flex flex-col gap-4"
1083
- }, Ao = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ro = { class: "fm-typo-en-body-lg-600" }, Oo = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Po = { class: "flex flex-col gap-8" }, Bo = { class: "fm-typo-en-body-lg-600" }, qo = { class: "flex w-full gap-4" }, Uo = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, No = { class: "fm-typo-en-body-lg-600 shrink-0" }, Eo = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, zo = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, jo = {
1035
+ }, Oo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Po = { class: "fm-typo-en-body-lg-600" }, Bo = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, qo = { class: "flex flex-col gap-8" }, Uo = { class: "fm-typo-en-body-lg-600" }, Eo = { class: "flex w-full gap-4" }, No = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, zo = { class: "fm-typo-en-body-lg-600 shrink-0" }, jo = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Qo = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Ho = {
1084
1036
  key: 0,
1085
1037
  class: "shrink-0 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
1086
- }, Qo = { class: "flex gap-8 xs:flex-col" }, Ho = /* @__PURE__ */ X({
1038
+ }, Go = { class: "flex gap-8 xs:flex-col" }, Yo = /* @__PURE__ */ J({
1087
1039
  __name: "TransferTemplateDetails",
1088
1040
  props: {
1089
1041
  template: {},
1090
1042
  show: { type: Boolean }
1091
1043
  },
1092
1044
  emits: ["update:show", "action:use", "action:edit"],
1093
- setup(m, { emit: y }) {
1094
- const u = m, l = y, _ = ge(), c = ye(), { t: n } = Z(), a = V(() => {
1095
- var w;
1096
- return (w = u.template) == null ? void 0 : w.purchaseOrder;
1097
- }), { enabledLocations: v } = Ye({
1045
+ setup(f, { emit: y }) {
1046
+ const d = f, l = y, _ = he(), c = ge(), { t: n } = X(), a = O(() => {
1047
+ var h;
1048
+ return (h = d.template) == null ? void 0 : h.purchaseOrder;
1049
+ }), { enabledLocations: F } = Ye({
1098
1050
  getLocations() {
1099
- var w;
1100
- return (w = u.template) == null ? void 0 : w.locations;
1051
+ var h;
1052
+ return (h = d.template) == null ? void 0 : h.locations;
1101
1053
  },
1102
1054
  setLocations() {
1103
1055
  }
1104
- }), b = V(() => {
1056
+ }), L = O(() => {
1105
1057
  if (!c.businessLevel)
1106
1058
  return [c.currentLocation];
1107
- const w = Array.isArray(v.value) ? v.value : c.locations, x = /* @__PURE__ */ new Set([...w.map((F) => F.doc._id)]);
1108
- return c.locations.filter((F) => x.has(F.doc._id));
1109
- }), g = V(
1059
+ const h = Array.isArray(F.value) ? F.value : c.locations, v = /* @__PURE__ */ new Set([...h.map((g) => g.doc._id)]);
1060
+ return c.locations.filter((g) => v.has(g.doc._id));
1061
+ }), S = O(
1110
1062
  () => {
1111
- var w, x, F, R;
1112
- return ((x = (w = a.value) == null ? void 0 : w.supplier) == null ? void 0 : x.internal) === "restaurant" || ((R = (F = a.value) == null ? void 0 : F.supplier) == null ? void 0 : R.internal) === "warehouse" ? pe.TRANSFER : pe.PURCHASE;
1063
+ var h, v, g, R;
1064
+ return ((v = (h = a.value) == null ? void 0 : h.supplier) == null ? void 0 : v.internal) === "restaurant" || ((R = (g = a.value) == null ? void 0 : g.supplier) == null ? void 0 : R.internal) === "warehouse" ? pe.TRANSFER : pe.PURCHASE;
1113
1065
  }
1114
- ), L = U(!0), M = je(u, "show");
1115
- return (w, x) => {
1066
+ ), M = U(!0), I = je(d, "show");
1067
+ return (h, v) => {
1116
1068
  var r;
1117
- const F = S("FmMenuDivider"), R = S("FmCard"), q = S("FmButton"), f = S("FmListItem"), o = S("FmList"), t = S("FmSideSheet");
1118
- return C(), E(t, {
1119
- header: e(n)("inventory.transfer.template.details.view", { template: (r = w.template) == null ? void 0 : r.name }),
1120
- modelValue: e(M),
1121
- "onUpdate:modelValue": x[1] || (x[1] = (p) => he(M) ? M.value = p : null),
1122
- "dismiss-away": L.value,
1069
+ const g = C("FmMenuDivider"), R = C("FmCard"), q = C("FmButton"), p = C("FmListItem"), o = C("FmList"), t = C("FmSideSheet");
1070
+ return w(), N(t, {
1071
+ header: e(n)("inventory.transfer.template.details.view", { template: (r = h.template) == null ? void 0 : r.name }),
1072
+ modelValue: e(I),
1073
+ "onUpdate:modelValue": v[1] || (v[1] = (m) => xe(I) ? I.value = m : null),
1074
+ "dismiss-away": M.value,
1123
1075
  "close-button": "",
1124
1076
  "max-width": 500
1125
1077
  }, {
1126
1078
  default: D(() => {
1127
- var p;
1079
+ var m;
1128
1080
  return [
1129
- s("div", po, [
1081
+ s("div", yo, [
1130
1082
  s("div", null, [
1131
- d(R, {
1083
+ u(R, {
1132
1084
  variant: "outlined",
1133
1085
  class: "flex flex-col gap-8 px-12 py-16"
1134
1086
  }, {
1135
1087
  default: D(() => {
1136
- var i, h, O, I, T, B, z, j, k;
1088
+ var i, b, A, $, k, B, z, j, x;
1137
1089
  return [
1138
- s("div", fo, [
1139
- s("div", yo, $(e(n)("inventory.transfer.template.details.templateSummary")), 1)
1140
- ]),
1141
- d(F),
1142
1090
  s("div", vo, [
1143
- s("div", bo, [
1144
- s("div", _o, [
1145
- s("div", xo, $(e(n)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1091
+ s("div", bo, T(e(n)("inventory.transfer.template.details.templateSummary")), 1)
1092
+ ]),
1093
+ u(g),
1094
+ s("div", _o, [
1095
+ s("div", xo, [
1096
+ s("div", ho, [
1097
+ s("div", go, T(e(n)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1146
1098
  ]),
1147
- s("div", ho, $(e(rt)(((i = w.template) == null ? void 0 : i._id) ?? "")), 1)
1099
+ s("div", ko, T(e(Mt)(((i = h.template) == null ? void 0 : i._id) ?? "")), 1)
1148
1100
  ]),
1149
- (h = a.value) != null && h.effectiveAt ? (C(), P("div", go, [
1150
- s("div", ko, $(e(n)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
1151
- s("div", wo, $(e(xt)(new Date((O = a.value) == null ? void 0 : O.effectiveAt))), 1)
1101
+ (b = a.value) != null && b.effectiveAt ? (w(), P("div", wo, [
1102
+ s("div", Fo, T(e(n)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
1103
+ s("div", To, T(e(xt)(new Date((A = a.value) == null ? void 0 : A.effectiveAt))), 1)
1152
1104
  ])) : H("", !0),
1153
- s("div", Fo, [
1154
- s("div", To, $(e(n)("inventory.transfer.receiveRequest.details.type.title")), 1),
1155
- s("div", Co, $(e(n)(
1156
- `inventory.transfer.receiveRequest.details.type.${g.value.toLocaleLowerCase("en-US")}`
1105
+ s("div", Co, [
1106
+ s("div", $o, T(e(n)("inventory.transfer.receiveRequest.details.type.title")), 1),
1107
+ s("div", So, T(e(n)(
1108
+ `inventory.transfer.receiveRequest.details.type.${S.value.toLocaleLowerCase("en-US")}`
1157
1109
  )), 1)
1158
1110
  ]),
1159
- (T = (I = a.value) == null ? void 0 : I.supplier) != null && T.name ? (C(), P("div", $o, [
1160
- s("div", So, $(e(n)("inventory.transfer.receiveRequest.details.from")), 1),
1161
- s("div", Lo, $((z = (B = a.value) == null ? void 0 : B.supplier) == null ? void 0 : z.name), 1)
1111
+ (k = ($ = a.value) == null ? void 0 : $.supplier) != null && k.name ? (w(), P("div", Mo, [
1112
+ s("div", Io, T(e(n)("inventory.transfer.receiveRequest.details.from")), 1),
1113
+ s("div", Do, T((z = (B = a.value) == null ? void 0 : B.supplier) == null ? void 0 : z.name), 1)
1162
1114
  ])) : H("", !0),
1163
- (j = a.value) != null && j.ref ? (C(), P("div", Mo, [
1164
- s("div", Io, $(e(n)("inventory.transfer.receiveRequest.details.reference")), 1),
1165
- s("div", Do, $(a.value.ref), 1)
1115
+ (j = a.value) != null && j.ref ? (w(), P("div", Lo, [
1116
+ s("div", Vo, T(e(n)("inventory.transfer.receiveRequest.details.reference")), 1),
1117
+ s("div", Ro, T(a.value.ref), 1)
1166
1118
  ])) : H("", !0),
1167
- (k = a.value) != null && k.remark ? (C(), P("div", Vo, [
1168
- s("div", Ao, $(e(n)("inventory.transfer.receiveRequest.details.remark")), 1),
1169
- s("div", Ro, $(a.value.remark), 1)
1119
+ (x = a.value) != null && x.remark ? (w(), P("div", Ao, [
1120
+ s("div", Oo, T(e(n)("inventory.transfer.receiveRequest.details.remark")), 1),
1121
+ s("div", Po, T(a.value.remark), 1)
1170
1122
  ])) : H("", !0)
1171
1123
  ])
1172
1124
  ];
@@ -1174,45 +1126,45 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
1174
1126
  _: 1
1175
1127
  })
1176
1128
  ]),
1177
- s("div", Oo, [
1178
- s("div", Po, [
1179
- s("div", Bo, $(e(n)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
1180
- (C(!0), P(ce, null, be(((p = a.value) == null ? void 0 : p.items) ?? [], (i) => (C(), P("div", {
1129
+ s("div", Bo, [
1130
+ s("div", qo, [
1131
+ s("div", Uo, T(e(n)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
1132
+ (w(!0), P(ce, null, ve(((m = a.value) == null ? void 0 : m.items) ?? [], (i) => (w(), P("div", {
1181
1133
  key: i.code,
1182
1134
  class: "flex flex-col"
1183
1135
  }, [
1184
- s("div", qo, [
1185
- s("div", Uo, $(i.name), 1),
1186
- x[2] || (x[2] = s("div", { class: "flex-1 min-w-32" }, null, -1)),
1187
- s("div", No, $(e(it)(i.quantity, i.sku.unit, i.measurement)), 1)
1188
- ]),
1189
1136
  s("div", Eo, [
1190
- s("div", zo, $(i.code), 1),
1191
- i.totalCost && e(_).enableTotalCost ? (C(), P("div", jo, " (" + $(e(ht)(i.totalCost)) + ") ", 1)) : H("", !0)
1137
+ s("div", No, T(i.name), 1),
1138
+ v[2] || (v[2] = s("div", { class: "flex-1 min-w-32" }, null, -1)),
1139
+ s("div", zo, T(e(rt)(i.quantity, i.sku.unit, i.measurement)), 1)
1140
+ ]),
1141
+ s("div", jo, [
1142
+ s("div", Qo, T(i.code), 1),
1143
+ i.totalCost && e(_).enableTotalCost ? (w(), P("div", Ho, " (" + T(e(ht)(i.totalCost)) + ") ", 1)) : H("", !0)
1192
1144
  ])
1193
1145
  ]))), 128))
1194
1146
  ])
1195
1147
  ]),
1196
1148
  s("div", null, [
1197
- d(R, {
1149
+ u(R, {
1198
1150
  variant: "outlined",
1199
1151
  class: "flex flex-col"
1200
1152
  }, {
1201
1153
  default: D(() => [
1202
- x[3] || (x[3] = s("div", { class: "flex flex-col p-16" }, [
1154
+ v[3] || (v[3] = s("div", { class: "flex flex-col p-16" }, [
1203
1155
  s("div", { class: "fm-typo-en-body-lg-600" }, "Enabled locations"),
1204
1156
  s("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Click to use template on the location ")
1205
1157
  ], -1)),
1206
- d(o, null, {
1158
+ u(o, null, {
1207
1159
  default: D(() => [
1208
- (C(!0), P(ce, null, be(b.value, (i) => (C(), E(f, {
1160
+ (w(!0), P(ce, null, ve(L.value, (i) => (w(), N(p, {
1209
1161
  key: i.doc._id,
1210
1162
  label: i.name,
1211
1163
  sublabel: i.type,
1212
- onClick: (h) => l("action:use", i.doc._id)
1164
+ onClick: (b) => l("action:use", i.doc._id)
1213
1165
  }, {
1214
1166
  append: D(() => [
1215
- d(q, {
1167
+ u(q, {
1216
1168
  "prepend-icon": "chevron_right",
1217
1169
  variant: "tertiary"
1218
1170
  })
@@ -1230,10 +1182,10 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
1230
1182
  ];
1231
1183
  }),
1232
1184
  "side-sheet-footer": D(() => [
1233
- s("div", Qo, [
1234
- d(q, {
1185
+ s("div", Go, [
1186
+ u(q, {
1235
1187
  label: e(n)("common.edit"),
1236
- onClick: x[0] || (x[0] = (p) => l("action:edit")),
1188
+ onClick: v[0] || (v[0] = (m) => l("action:edit")),
1237
1189
  variant: "tertiary"
1238
1190
  }, null, 8, ["label"])
1239
1191
  ])
@@ -1242,58 +1194,61 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
1242
1194
  }, 8, ["header", "modelValue", "dismiss-away"]);
1243
1195
  };
1244
1196
  }
1245
- }), Go = { class: "flex-1 flex flex-col gap-8" }, Yo = { class: "flex flex-col" }, Wo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ko = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Zo = { class: "fm-typo-en-body-lg-400" }, Jo = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, Xo = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, ps = /* @__PURE__ */ X({
1197
+ }), Wo = { class: "flex-1 flex flex-col gap-8" }, Ko = { class: "flex flex-col" }, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Jo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Xo = { class: "fm-typo-en-body-lg-400" }, es = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, ts = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, _s = /* @__PURE__ */ J({
1246
1198
  __name: "TransferTemplateView",
1247
- setup(m) {
1248
- const { t: y } = Z(), { createTemplate: u, viewTemplate: l } = Oe(), { templateDialogProps: _, transferFormDialogProps: c, templateDetailsProps: n } = wt(
1249
- Oe()
1250
- ), a = ut(), v = st(), b = ye(), g = ge(), { breakpoints: L } = Ee();
1251
- b.watchLocation(a.fetchTemplates), xe(() => {
1252
- g.mustManageBusinessOnlyPoTemplate && (b.businessLevel = !0);
1253
- }), fe(() => {
1254
- var p;
1255
- return (p = c.value) == null ? void 0 : p.show;
1256
- }, (p) => {
1257
- p === !1 && g.mustManageBusinessOnlyPoTemplate && (b.businessLevel = !0);
1258
- }), Je(() => {
1259
- b.businessLevel = !1;
1199
+ setup(f) {
1200
+ const { t: y } = X(), { createTemplate: d, viewTemplate: l } = Be(), { templateDialogProps: _, transferFormDialogProps: c, templateDetailsProps: n } = Ft(
1201
+ Be()
1202
+ ), a = it(), F = st(), L = ge(), S = he(), { breakpoints: M } = ze();
1203
+ L.watchLocation(a.fetchTemplates), _e(() => {
1204
+ S.mustManageBusinessOnlyPoTemplate && (L.businessLevel = !0);
1205
+ }), fe(
1206
+ () => {
1207
+ var m;
1208
+ return (m = c.value) == null ? void 0 : m.show;
1209
+ },
1210
+ (m) => {
1211
+ m === !1 && S.mustManageBusinessOnlyPoTemplate && (L.businessLevel = !0);
1212
+ }
1213
+ ), Je(() => {
1214
+ L.businessLevel = !1;
1260
1215
  });
1261
- const M = V(() => b.businessLevel), w = V(
1262
- () => a.loading.value || !b._currentLocation
1263
- ), x = V(
1264
- () => M.value ? a.businessTemplates.value : a.locationTemplates.value
1265
- ), F = U(""), R = V(() => L.value.xs || L.value.sm), q = V(() => R.value ? 10 : 20);
1266
- function f(p) {
1267
- switch (p) {
1268
- case Pe.Add:
1269
- return u();
1216
+ const I = O(() => L.businessLevel), h = O(
1217
+ () => a.loading.value || !L._currentLocation
1218
+ ), v = O(
1219
+ () => I.value ? a.businessTemplates.value : a.locationTemplates.value
1220
+ ), g = U(""), R = O(() => M.value.xs || M.value.sm), q = O(() => R.value ? 10 : 20);
1221
+ function p(m) {
1222
+ switch (m) {
1223
+ case qe.Add:
1224
+ return d();
1270
1225
  }
1271
1226
  }
1272
- const o = Tt();
1227
+ const o = Ct();
1273
1228
  function t() {
1274
1229
  o.push({ name: gt.RECEIVE_REQUEST });
1275
1230
  }
1276
- function r(p) {
1277
- return p;
1231
+ function r(m) {
1232
+ return m;
1278
1233
  }
1279
- return (p, i) => {
1280
- const h = S("FmTable");
1281
- return C(), P(ce, null, [
1282
- d(nt, {
1234
+ return (m, i) => {
1235
+ const b = C("FmTable");
1236
+ return w(), P(ce, null, [
1237
+ u(nt, {
1283
1238
  title: e(y)("inventory.transfer.template.title2"),
1284
1239
  actions: [
1285
1240
  {
1286
1241
  label: e(y)("inventory.transfer.template.create.title"),
1287
- value: e(Pe).Add,
1242
+ value: e(qe).Add,
1288
1243
  isPrimary: !0,
1289
1244
  prependIcon: "add"
1290
1245
  }
1291
1246
  ],
1292
- "onClick:action": f,
1247
+ "onClick:action": p,
1293
1248
  "using-business-helper-text": "You are managing business-level template list. These templates will be made visible to all locations."
1294
1249
  }, {
1295
1250
  default: D(() => {
1296
- var O;
1251
+ var A;
1297
1252
  return [
1298
1253
  s("div", {
1299
1254
  class: me([
@@ -1304,64 +1259,65 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
1304
1259
  }
1305
1260
  ])
1306
1261
  }, [
1307
- d(lt, {
1262
+ u(lt, {
1308
1263
  searchable: "",
1309
- "change-location": !e(g).mustManageBusinessOnlyPoTemplate,
1310
- search: F.value,
1311
- "onUpdate:search": i[0] || (i[0] = (I) => F.value = I),
1264
+ "change-location": !e(S).mustManageBusinessOnlyPoTemplate,
1265
+ search: g.value,
1266
+ "onUpdate:search": i[0] || (i[0] = ($) => g.value = $),
1312
1267
  actions: [{ icon: "refresh", onClick: e(a).fetchTemplates }],
1313
1268
  "show-business": ""
1314
1269
  }, null, 8, ["change-location", "search", "actions"]),
1315
- (C(), E(h, {
1316
- style: Xe(e(v).tableHeight),
1270
+ (w(), N(b, {
1271
+ style: Xe(e(F).tableHeight),
1317
1272
  "column-defs": e(a).columnDefs,
1318
- "row-data": x.value,
1319
- "search-value": F.value,
1320
- loading: w.value,
1321
- key: (O = e(b)._currentLocation) == null ? void 0 : O.dbName,
1322
- onRowClick: i[1] || (i[1] = (I) => e(l)(I.original)),
1273
+ "row-data": v.value,
1274
+ "search-value": g.value,
1275
+ loading: h.value,
1276
+ key: (A = e(L)._currentLocation) == null ? void 0 : A.dbName,
1277
+ onRowClick: i[1] || (i[1] = ($) => e(l)($.original)),
1323
1278
  "page-size": q.value
1324
1279
  }, {
1325
- "list-row": D((I) => [
1326
- d(Ge, {
1327
- row: I,
1328
- onRowClick: (T) => e(l)(T)
1280
+ "list-row": D(($) => [
1281
+ u(Ge, {
1282
+ row: $,
1283
+ onRowClick: (k) => e(l)(k)
1329
1284
  }, {
1330
- default: D((T) => {
1331
- var B, z, j, k, Q, Y, ee, te, W, oe, K, se, ke, le, we, Fe, Te, Ce, ae, $e, Se, Le, Me, re, Ie;
1285
+ default: D((k) => {
1286
+ var B, z, j, x, Q, Y, ee, te, W, oe, K, se, ke, le, we, Fe, Te, Ce, $e, Se, ae, Me, Ie, De, Le, re, Ve;
1332
1287
  return [
1333
- s("div", Go, [
1334
- s("div", Yo, [
1335
- s("div", Wo, [
1336
- d(e(N), {
1337
- render: (j = (z = (B = T._id) == null ? void 0 : B.column) == null ? void 0 : z.columnDef) == null ? void 0 : j.cell,
1338
- props: (Q = (k = T._id) == null ? void 0 : k.getContext) == null ? void 0 : Q.call(k)
1288
+ s("div", Wo, [
1289
+ s("div", Ko, [
1290
+ s("div", Zo, [
1291
+ u(e(E), {
1292
+ render: (j = (z = (B = k._id) == null ? void 0 : B.column) == null ? void 0 : z.columnDef) == null ? void 0 : j.cell,
1293
+ props: (Q = (x = k._id) == null ? void 0 : x.getContext) == null ? void 0 : Q.call(x)
1339
1294
  }, null, 8, ["render", "props"])
1340
1295
  ]),
1341
- s("div", Ko, [
1342
- d(e(N), {
1343
- render: (te = (ee = (Y = T.name) == null ? void 0 : Y.column) == null ? void 0 : ee.columnDef) == null ? void 0 : te.cell,
1344
- props: (oe = (W = T.name) == null ? void 0 : W.getContext) == null ? void 0 : oe.call(W)
1296
+ s("div", Jo, [
1297
+ u(e(E), {
1298
+ render: (te = (ee = (Y = k.name) == null ? void 0 : Y.column) == null ? void 0 : ee.columnDef) == null ? void 0 : te.cell,
1299
+ props: (oe = (W = k.name) == null ? void 0 : W.getContext) == null ? void 0 : oe.call(W)
1345
1300
  }, null, 8, ["render", "props"])
1346
1301
  ]),
1347
- s("div", Zo, [
1348
- d(e(N), {
1349
- render: (ke = (se = (K = T.supplier) == null ? void 0 : K.column) == null ? void 0 : se.columnDef) == null ? void 0 : ke.cell,
1350
- props: (we = (le = T.supplier) == null ? void 0 : le.getContext) == null ? void 0 : we.call(le)
1302
+ s("div", Xo, [
1303
+ u(e(E), {
1304
+ render: (ke = (se = (K = k.supplier) == null ? void 0 : K.column) == null ? void 0 : se.columnDef) == null ? void 0 : ke.cell,
1305
+ props: (we = (le = k.supplier) == null ? void 0 : le.getContext) == null ? void 0 : we.call(le)
1351
1306
  }, null, 8, ["render", "props"])
1352
1307
  ]),
1353
- s("div", Jo, $(I.original.purchaseOrder.items.length ? I.original.purchaseOrder.items.map((We) => We.name).join(", ") : "No items"), 1),
1354
- s("div", Xo, [
1355
- d(e(N), {
1356
- render: (Ce = (Te = (Fe = T.ref) == null ? void 0 : Fe.column) == null ? void 0 : Te.columnDef) == null ? void 0 : Ce.cell,
1357
- props: ($e = (ae = T.ref) == null ? void 0 : ae.getContext) == null ? void 0 : $e.call(ae)
1308
+ s("div", null, T((Fe = $.original.locations) != null && Fe.length ? `Enabled for ${(Te = $.original.locations) == null ? void 0 : Te.length} outlets` : "Enabled for all outlets"), 1),
1309
+ s("div", es, T($.original.purchaseOrder.items.length ? $.original.purchaseOrder.items.map((We) => We.name).join(", ") : "No items"), 1),
1310
+ s("div", ts, [
1311
+ u(e(E), {
1312
+ render: (Se = ($e = (Ce = k.ref) == null ? void 0 : Ce.column) == null ? void 0 : $e.columnDef) == null ? void 0 : Se.cell,
1313
+ props: (Me = (ae = k.ref) == null ? void 0 : ae.getContext) == null ? void 0 : Me.call(ae)
1358
1314
  }, null, 8, ["render", "props"])
1359
1315
  ])
1360
1316
  ]),
1361
1317
  s("div", null, [
1362
- d(e(N), {
1363
- render: (Me = (Le = (Se = T.type) == null ? void 0 : Se.column) == null ? void 0 : Le.columnDef) == null ? void 0 : Me.cell,
1364
- props: (Ie = (re = T.type) == null ? void 0 : re.getContext) == null ? void 0 : Ie.call(re)
1318
+ u(e(E), {
1319
+ render: (Le = (De = (Ie = k.type) == null ? void 0 : Ie.column) == null ? void 0 : De.columnDef) == null ? void 0 : Le.cell,
1320
+ props: (Ve = (re = k.type) == null ? void 0 : re.getContext) == null ? void 0 : Ve.call(re)
1365
1321
  }, null, 8, ["render", "props"])
1366
1322
  ])
1367
1323
  ])
@@ -1377,11 +1333,11 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
1377
1333
  }),
1378
1334
  _: 1
1379
1335
  }, 8, ["title", "actions"]),
1380
- (C(), E(et, { to: "body" }, [
1381
- d(Ft, Re(e(c), { onSubmitted: t }), null, 16),
1382
- d(Ho, tt(ot(e(n))), null, 16),
1383
- d(co, Re(e(_), {
1384
- onSubmitted: i[2] || (i[2] = (O) => e(a).fetchTemplates())
1336
+ (w(), N(et, { to: "body" }, [
1337
+ u(Tt, Pe(e(c), { onSubmitted: t }), null, 16),
1338
+ u(Yo, tt(ot(e(n))), null, 16),
1339
+ u(fo, Pe(e(_), {
1340
+ onSubmitted: i[2] || (i[2] = (A) => e(a).fetchTemplates())
1385
1341
  }), null, 16)
1386
1342
  ]))
1387
1343
  ], 64);
@@ -1389,5 +1345,5 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
1389
1345
  }
1390
1346
  });
1391
1347
  export {
1392
- ps as default
1348
+ _s as default
1393
1349
  };