@feedmepos/mf-inventory-portal 0.0.21-dev.4 → 0.0.21-dev.5

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 (32) hide show
  1. package/dist/ApprovalView-BHoJzHuo.js +129 -0
  2. package/dist/{BindingsDialog-BFLeun5L.js → BindingsDialog-sUZjZtSl.js} +1 -1
  3. package/dist/{BindingsPicker-CnjJZH9t.js → BindingsPicker-CqzSUVc_.js} +1 -1
  4. package/dist/{BindingsTable-C3VTa0YL.js → BindingsTable-C1o5EgLy.js} +1 -1
  5. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DYBTXD_J.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CpN5Kn8b.js} +1 -1
  6. package/dist/{IngredientsView-CQYJfAze.js → IngredientsView-CrXPIQme.js} +99 -91
  7. package/dist/IntegrationView-BJT-KMVp.js +1141 -0
  8. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Wv8RvXJL.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DH0CcGmX.js} +1 -1
  9. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DsOGlAb7.js → PremiumBadge.vue_vue_type_script_setup_true_lang-kJKVCH40.js} +1 -1
  10. package/dist/{PurchaseOrderPrintPreview-B0hDduXB.js → PurchaseOrderPrintPreview-k26o__vy.js} +1 -1
  11. package/dist/ReceiveRequestView-ysOzzBTW.js +216 -0
  12. package/dist/{RecipeView-DYKhSgtw.js → RecipeView-DAH8YIzY.js} +182 -174
  13. package/dist/{StockView-BIGGG87A.js → StockView-BlCpuSLe.js} +547 -539
  14. package/dist/{SupplierView-DQzopnzt.js → SupplierView-Bwknjcke.js} +263 -255
  15. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D8-sMRGm.js → TransferDetails.vue_vue_type_script_setup_true_lang-LCNiBfi7.js} +3 -3
  16. package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-CSUnXAyq.js → TransferDialog.vue_vue_type_script_setup_true_lang-BDvtif2q.js} +4 -4
  17. package/dist/{TransferTemplateView-DWF54okN.js → TransferTemplateView-DcMdNiH6.js} +372 -364
  18. package/dist/{UnitView-Cdw8xxzV.js → UnitView-BVMr4KlR.js} +186 -178
  19. package/dist/{WarehouseView-DOelxuIh.js → WarehouseView-Dd-e-IlG.js} +388 -380
  20. package/dist/{app-SBnQEeEV.js → app-S6iG6Hux.js} +4 -4
  21. package/dist/app.js +1 -1
  22. package/dist/{decimal-BlEB2PrM.js → decimal-nOOdFIFP.js} +1 -1
  23. package/dist/{id-to-date-Y6berpHs.js → id-to-date-CKQ0n3Qi.js} +1 -1
  24. package/dist/{purchase-order-transaction-type-Dp0wsGal.js → purchase-order-transaction-type-CQ-RpJ0h.js} +2 -2
  25. package/dist/{supplier-I_rYvljH.js → supplier-DQsAfn3q.js} +1 -1
  26. package/dist/tsconfig.app.tsbuildinfo +1 -1
  27. package/dist/{xlsx-DGwG2ekM.js → xlsx-Dgjf-KvE.js} +1 -1
  28. package/dist/{xlsx.util-Dsf-EgrG.js → xlsx.util-CODYzgF8.js} +2 -2
  29. package/package.json +3 -3
  30. package/dist/ApprovalView-BS4jzhAR.js +0 -121
  31. package/dist/IntegrationView-9V2OcyP_.js +0 -1172
  32. package/dist/ReceiveRequestView-3boFHkOO.js +0 -208
@@ -1,17 +1,17 @@
1
- import { defineComponent as X, onMounted as xe, computed as A, ref as U, watch as pe, inject as We, resolveComponent as S, openBlock as T, createElementBlock as P, createElementVNode as s, createVNode as d, withCtx as D, renderSlot as Me, withDirectives as De, normalizeClass as ve, vModelText as Ve, reactive as Ke, h as J, toDisplayString as $, unref as e, createBlock as z, createCommentVNode as H, isRef as he, Fragment as me, renderList as be, onUnmounted as Ze, normalizeStyle as Je, Teleport as Xe, mergeProps as Ae, normalizeProps as et, guardReactiveProps as tt } from "vue";
2
- import { u as ot, _ as st, a as nt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DYBTXD_J.js";
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-CpN5Kn8b.js";
3
3
  import { useI18n as Z } from "@feedmepos/mf-common";
4
- import { P as ce, a as lt, f as at, b as rt, c as Re, d as it } from "./purchase-order-transaction-type-Dp0wsGal.js";
5
- import { F as ne, R as Oe } from "./row-action.enum-PMKMRrZR.js";
6
- import { $ as ye, t as Pe, I as ut, a0 as dt, a1 as mt, a as G, D as Be, R as _e, a2 as ct, a3 as pt, r as de, a4 as ft, l as yt, A as qe, M as vt, b as ge, j as fe, y as Ue, u as bt, a5 as ie, a6 as _t, G as xt, a7 as ht } from "./app-SBnQEeEV.js";
7
- import { useBreakpoints as Ne, components as ue, useDialog as Ee, useSnackbar as gt, useProxiedModel as ze } from "@feedmepos/ui-library";
8
- import { storeToRefs as kt } from "pinia";
9
- import { d as je, c as Qe, _ as wt } from "./TransferDialog.vue_vue_type_script_setup_true_lang-CSUnXAyq.js";
10
- import { useRouter as Ft } from "vue-router";
11
- import { u as Tt } from "./supplier-I_rYvljH.js";
12
- import { F as E, _ as He } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
13
- import { _ as Ct } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DsOGlAb7.js";
14
- const $t = { class: "flex flex-col" }, St = { class: "flex flex-col" }, Lt = { class: "flex-1" }, It = { class: "flex items-center" }, Mt = { class: "flex-1" }, Dt = { class: "flex-1" }, Vt = /* @__PURE__ */ X({
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-CQ-RpJ0h.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-S6iG6Hux.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-BDvtif2q.js";
10
+ import { useRouter as Tt } from "vue-router";
11
+ import { u as Ct } from "./supplier-DQsAfn3q.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-kJKVCH40.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({
15
15
  __name: "FmMinMaxInput",
16
16
  props: {
17
17
  rules: {},
@@ -49,42 +49,42 @@ const $t = { class: "flex flex-col" }, St = { class: "flex flex-col" }, Lt = { c
49
49
  helperState: {}
50
50
  },
51
51
  setup(m) {
52
- const y = m, u = je("modelValue"), l = ut();
52
+ const y = m, u = Qe("modelValue"), l = dt();
53
53
  xe(() => {
54
- const { min: p, max: o } = u ?? {};
55
- if (!(!p || !o) && p.precision !== o.precision) {
56
- const t = Math.max(p.precision, o.precision), r = ye(p, t), f = ye(o, t);
57
- u.min = r, u.max = f;
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;
58
58
  }
59
59
  });
60
- const x = A(() => {
61
- const { min: p, max: o } = u ?? {};
62
- return Math.max((p == null ? void 0 : p.precision) ?? 0, (o == null ? void 0 : o.precision) ?? 0, y.precision ?? 0);
63
- }), c = A(() => ({
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
64
  ...u
65
- })), n = (p) => {
66
- if (!p) return "";
67
- const o = dt(p), t = x.value, r = ye(o, t);
68
- return mt(
65
+ })), n = (f) => {
66
+ if (!f) return "";
67
+ const o = mt(f), t = _.value, r = ve(o, t);
68
+ return ct(
69
69
  +G(r),
70
70
  r.precision
71
71
  );
72
72
  }, a = U(n(u.min)), v = U(n(u.max));
73
- pe([a, v], ([p, o]) => {
74
- const t = u ?? {}, r = l(p), f = l(o), i = x.value;
75
- if (p !== "" && r === !0) {
76
- const _ = Pe(+p, i);
77
- t.min = _;
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;
78
78
  } else
79
79
  t.min = null;
80
- if (o !== "" && f === !0) {
81
- const _ = Pe(+o, i);
82
- t.max = _;
80
+ if (o !== "" && p === !0) {
81
+ const h = Be(+o, i);
82
+ t.max = h;
83
83
  } else
84
84
  t.max = null;
85
85
  u.min = t.min, u.max = t.max;
86
86
  });
87
- const b = Symbol.for("fm:form-state"), g = We(b, null), I = A(() => y.disabled ?? (g == null ? void 0 : g.getDisabled()) ?? !1), M = U(), w = U(), h = U(!1), F = U(!1), R = A(() => h.value || F.value), q = A(() => [...[
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(() => [...[
88
88
  function() {
89
89
  return typeof l(a.value) == "string" || typeof l(v.value) == "string" ? "Must be a number" : !0;
90
90
  },
@@ -92,97 +92,97 @@ const $t = { class: "flex flex-col" }, St = { class: "flex flex-col" }, Lt = { c
92
92
  return !t || !t.min || !t.max ? !0 : +G(t.min) > +G(t.max) ? "Min must be less than or equal to max" : !0;
93
93
  }
94
94
  ], ...y.rules ?? []]);
95
- return (p, o) => {
96
- const t = S("FmLabel"), r = S("FmField"), f = S("FmFormGroup");
97
- return T(), P("div", $t, [
98
- s("div", St, [
99
- s("div", Lt, [
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
100
  d(t, {
101
- label: p.label,
102
- disabled: p.disabled,
103
- required: p.labelMark === "required",
104
- optional: p.labelMark === "optional"
101
+ label: f.label,
102
+ disabled: f.disabled,
103
+ required: f.labelMark === "required",
104
+ optional: f.labelMark === "optional"
105
105
  }, null, 8, ["label", "disabled", "required", "optional"])
106
106
  ]),
107
107
  d(r, { focused: R.value }, {
108
108
  default: D(() => [
109
109
  s("div", It, [
110
- Me(p.$slots, "prepend"),
110
+ De(f.$slots, "prepend"),
111
111
  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", Mt, [
113
- De(s("input", {
112
+ s("div", Dt, [
113
+ Ve(s("input", {
114
114
  type: "text",
115
115
  ref_key: "minInputRef",
116
116
  ref: M,
117
- onFocus: o[0] || (o[0] = () => h.value = !0),
118
- onBlur: o[1] || (o[1] = () => h.value = !1),
117
+ onFocus: o[0] || (o[0] = () => x.value = !0),
118
+ onBlur: o[1] || (o[1] = () => x.value = !1),
119
119
  "onUpdate:modelValue": o[2] || (o[2] = (i) => a.value = i),
120
- class: ve({
120
+ class: me({
121
121
  "fm-text-field--input fm-typo-en-body-lg-400": !0,
122
- "text-fm-color-typo-primary": !I.value,
123
- "text-fm-color-typo-disabled": I.value
122
+ "text-fm-color-typo-primary": !L.value,
123
+ "text-fm-color-typo-disabled": L.value
124
124
  })
125
125
  }, null, 34), [
126
- [Ve, a.value]
126
+ [Ae, a.value]
127
127
  ])
128
128
  ]),
129
129
  o[7] || (o[7] = s("div", { class: "block h-32 mx-4 w-[1px] bg-fm-color-neutral-gray-200" }, null, -1)),
130
130
  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", Dt, [
132
- De(s("input", {
131
+ s("div", Vt, [
132
+ Ve(s("input", {
133
133
  type: "text",
134
134
  ref_key: "maxInputRef",
135
135
  ref: w,
136
136
  onFocus: o[3] || (o[3] = () => F.value = !0),
137
137
  onBlur: o[4] || (o[4] = () => F.value = !1),
138
138
  "onUpdate:modelValue": o[5] || (o[5] = (i) => v.value = i),
139
- class: ve({
139
+ class: me({
140
140
  "fm-text-field--input fm-typo-en-body-lg-400": !0,
141
- "text-fm-color-typo-primary": !I.value,
142
- "text-fm-color-typo-disabled": I.value
141
+ "text-fm-color-typo-primary": !L.value,
142
+ "text-fm-color-typo-disabled": L.value
143
143
  })
144
144
  }, null, 34), [
145
- [Ve, v.value]
145
+ [Ae, v.value]
146
146
  ])
147
147
  ]),
148
- Me(p.$slots, "append")
148
+ De(f.$slots, "append")
149
149
  ])
150
150
  ]),
151
151
  _: 3
152
152
  }, 8, ["focused"])
153
153
  ]),
154
- d(f, {
154
+ d(p, {
155
155
  class: "flex-1",
156
156
  "model-value": c.value,
157
- info: p.labelInfo,
157
+ info: f.labelInfo,
158
158
  rules: q.value,
159
- "helper-text": p.helperText,
160
- "helper-state": p.helperState
159
+ "helper-text": f.helperText,
160
+ "helper-state": f.helperState
161
161
  }, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
162
162
  ]);
163
163
  };
164
164
  }
165
165
  });
166
- function At() {
166
+ function Rt() {
167
167
  return function(y) {
168
168
  return !y || !y.min || !y.max ? "Required" : !0;
169
169
  };
170
170
  }
171
- function Rt(m, y) {
171
+ function Ot(m, y) {
172
172
  return function(l) {
173
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;
174
174
  };
175
175
  }
176
- var V = /* @__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))(V || {});
177
- function Ot(m) {
178
- const { t: y } = Z(), u = Ke({});
179
- Ne(), xe(() => {
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
180
  for (const c of m.items) {
181
181
  if (!c.totalCost)
182
182
  continue;
183
- const n = Qe(c.sku, c.quantity, c.measurement, {
183
+ const n = He(c.sku, c.quantity, c.measurement, {
184
184
  supplier: m.supplier
185
- }), a = c.totalCost ?? Be.reset();
185
+ }), a = c.totalCost ?? qe.reset();
186
186
  n ? u[c.sku._id] = n.amount !== a.amount || n.precision !== a.precision : u[c.sku._id] = !0;
187
187
  }
188
188
  });
@@ -236,7 +236,7 @@ function Ot(m) {
236
236
  minSize: 200,
237
237
  cell(c) {
238
238
  const n = c.row.original;
239
- return J(ct, {
239
+ return J(pt, {
240
240
  style: {
241
241
  flex: "1 1 0%"
242
242
  },
@@ -255,7 +255,7 @@ function Ot(m) {
255
255
  });
256
256
  },
257
257
  rules: [
258
- pt(
258
+ ft(
259
259
  +G(
260
260
  n.minimumQuantity ?? {
261
261
  amount: 1,
@@ -263,7 +263,7 @@ function Ot(m) {
263
263
  }
264
264
  )
265
265
  ),
266
- ft(
266
+ yt(
267
267
  n.maximumQuantity ? +G(n.maximumQuantity) : 1 / 0
268
268
  )
269
269
  ],
@@ -279,7 +279,7 @@ function Ot(m) {
279
279
  minSize: 280,
280
280
  cell(c) {
281
281
  const n = c.row.original;
282
- return J(Vt, {
282
+ return J(At, {
283
283
  style: {
284
284
  flex: "1 1 0%"
285
285
  },
@@ -295,8 +295,8 @@ function Ot(m) {
295
295
  a != null && a.min && (v.minimumQuantity = a.min), a != null && a.max && (v.maximumQuantity = a.max), m.updateItem(v);
296
296
  },
297
297
  rules: [
298
- At(),
299
- Rt(
298
+ Rt(),
299
+ Ot(
300
300
  +G({
301
301
  amount: 1,
302
302
  precision: de(n.sku.unit, n.measurement)
@@ -316,20 +316,20 @@ function Ot(m) {
316
316
  cell(c) {
317
317
  const n = c.row.original;
318
318
  return J(ue.FmTextField, {
319
- modelValue: G(n.quantityStep ?? Be.reset(), !1),
319
+ modelValue: G(n.quantityStep ?? qe.reset(), !1),
320
320
  key: n.sku._id,
321
321
  "onUpdate:modelValue": (a) => {
322
322
  m.updateItem({
323
323
  ...n,
324
- quantityStep: yt(+a)
324
+ quantityStep: vt(+a)
325
325
  });
326
326
  },
327
327
  rules: [
328
- qe({
328
+ Ue({
329
329
  amount: 1,
330
330
  precision: de(n.sku.unit, n.measurement)
331
331
  }),
332
- vt(n.sku.unit, n.measurement)
332
+ bt(n.sku.unit, n.measurement)
333
333
  ]
334
334
  });
335
335
  },
@@ -482,10 +482,10 @@ function Ot(m) {
482
482
  }
483
483
  ];
484
484
  return {
485
- columnDefs: A(() => ge().enableTotalCost && m.transferType === ce.PURCHASE ? l : l.filter((n) => n.id !== "Cost"))
485
+ columnDefs: V(() => ge().enableTotalCost && m.transferType === pe.PURCHASE ? l : l.filter((n) => n.id !== "Cost"))
486
486
  };
487
487
  }
488
- const Pt = { class: "flex flex-col gap-8 py-16" }, Bt = { class: "flex items-center" }, qt = { class: "flex-1 flex gap-1 items-center" }, Ut = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Nt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Et = { class: "flex gap-8 w-full" }, zt = { class: "flex-1 flex flex-col gap-4" }, jt = { class: "flex-1 flex flex-col gap-4" }, 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 = /* @__PURE__ */ X({
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({
489
489
  __name: "TransferTemplateItem",
490
490
  props: {
491
491
  cellByColId: {},
@@ -494,88 +494,88 @@ const Pt = { class: "flex flex-col gap-8 py-16" }, Bt = { class: "flex items-cen
494
494
  setup(m) {
495
495
  const { t: y } = Z();
496
496
  return (u, l) => {
497
- var c, n, a, v, b, g, I, M, w, h, F, R, q, p, o, t, r, f, i, _, L, C, O, B, j, N, k, Q, Y, ee, W, te, oe, K, se;
498
- const x = S("FmLabel");
499
- return T(), P("div", Pt, [
500
- s("div", Bt, [
501
- s("div", qt, [
502
- s("span", Ut, " (" + $(u.row.original.sku.code) + ") ", 1),
503
- s("span", Nt, $(u.row.original.sku.name), 1)
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)
504
504
  ]),
505
505
  s("div", null, [
506
- d(e(E), {
506
+ d(e(N), {
507
507
  render: (a = (n = (c = u.cellByColId.Delete) == null ? void 0 : c.column) == null ? void 0 : n.columnDef) == null ? void 0 : a.cell,
508
508
  props: (b = (v = u.cellByColId.Delete) == null ? void 0 : v.getContext) == null ? void 0 : b.call(v)
509
509
  }, null, 8, ["render", "props"])
510
510
  ])
511
511
  ]),
512
- s("div", Et, [
513
- s("div", zt, [
514
- d(x, {
515
- label: e(y)(`inventory.transfer.form.items.table.${e(V).Code}`)
512
+ s("div", zt, [
513
+ s("div", jt, [
514
+ d(_, {
515
+ label: e(y)(`inventory.transfer.form.items.table.${e(A).Code}`)
516
516
  }, null, 8, ["label"]),
517
- d(e(E), {
518
- render: (M = (I = (g = u.cellByColId[e(V).Code]) == null ? void 0 : g.column) == null ? void 0 : I.columnDef) == null ? void 0 : M.cell,
519
- props: (h = (w = u.cellByColId[e(V).Code]) == null ? void 0 : w.getContext) == null ? void 0 : h.call(w)
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
520
  }, null, 8, ["render", "props"]),
521
521
  l[0] || (l[0] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
522
522
  ]),
523
- s("div", jt, [
524
- d(x, {
525
- label: e(y)(`inventory.transfer.form.items.table.${e(V).Name}`)
523
+ s("div", Qt, [
524
+ d(_, {
525
+ label: e(y)(`inventory.transfer.form.items.table.${e(A).Name}`)
526
526
  }, null, 8, ["label"]),
527
- d(e(E), {
528
- render: (q = (R = (F = u.cellByColId[e(V).Name]) == null ? void 0 : F.column) == null ? void 0 : R.columnDef) == null ? void 0 : q.cell,
529
- props: (o = (p = u.cellByColId[e(V).Name]) == null ? void 0 : p.getContext) == null ? void 0 : o.call(p)
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
530
  }, null, 8, ["render", "props"]),
531
531
  l[1] || (l[1] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
532
532
  ])
533
533
  ]),
534
- s("div", Qt, [
535
- s("div", Ht, [
536
- d(x, {
537
- label: e(y)(`inventory.transfer.form.items.table.${e(V).Limit}`)
534
+ s("div", Ht, [
535
+ s("div", Gt, [
536
+ d(_, {
537
+ label: e(y)(`inventory.transfer.form.items.table.${e(A).Limit}`)
538
538
  }, null, 8, ["label"]),
539
- d(e(E), {
540
- render: (f = (r = (t = u.cellByColId[e(V).Limit]) == null ? void 0 : t.column) == null ? void 0 : r.columnDef) == null ? void 0 : f.cell,
541
- props: (_ = (i = u.cellByColId[e(V).Limit]) == null ? void 0 : i.getContext) == null ? void 0 : _.call(i)
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
542
  }, null, 8, ["render", "props"]),
543
543
  l[2] || (l[2] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
544
544
  ]),
545
- s("div", Gt, [
546
- d(x, {
547
- label: e(y)(`inventory.transfer.form.items.table.${e(V).Step}`)
545
+ s("div", Yt, [
546
+ d(_, {
547
+ label: e(y)(`inventory.transfer.form.items.table.${e(A).Step}`)
548
548
  }, null, 8, ["label"]),
549
- d(e(E), {
550
- render: (O = (C = (L = u.cellByColId[e(V).Step]) == null ? void 0 : L.column) == null ? void 0 : C.columnDef) == null ? void 0 : O.cell,
551
- props: (j = (B = u.cellByColId[e(V).Step]) == null ? void 0 : B.getContext) == null ? void 0 : j.call(B)
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
552
  }, null, 8, ["render", "props"]),
553
553
  l[3] || (l[3] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
554
554
  ])
555
555
  ]),
556
- s("div", Yt, [
557
- s("div", Wt, [
558
- d(x, {
559
- label: e(y)(`inventory.transfer.form.items.table.${e(V).DefaultAmount}`)
556
+ s("div", Wt, [
557
+ s("div", Kt, [
558
+ d(_, {
559
+ label: e(y)(`inventory.transfer.form.items.table.${e(A).DefaultAmount}`)
560
560
  }, null, 8, ["label"]),
561
- d(e(E), {
562
- render: (Q = (k = (N = u.cellByColId[e(V).DefaultAmount]) == null ? void 0 : N.column) == null ? void 0 : k.columnDef) == null ? void 0 : Q.cell,
563
- props: (ee = (Y = u.cellByColId[e(V).DefaultAmount]) == null ? void 0 : Y.getContext) == null ? void 0 : ee.call(Y)
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
564
  }, null, 8, ["render", "props"]),
565
565
  l[4] || (l[4] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
566
566
  ]),
567
- s("div", Kt, [
568
- d(Ct, { "z-index": 50 }, {
567
+ s("div", Zt, [
568
+ d($t, { "z-index": 50 }, {
569
569
  default: D(() => [
570
- d(x, {
571
- label: e(y)(`inventory.transfer.form.items.table.${e(V).Cost}2`)
570
+ d(_, {
571
+ label: e(y)(`inventory.transfer.form.items.table.${e(A).Cost}2`)
572
572
  }, null, 8, ["label"])
573
573
  ]),
574
574
  _: 1
575
575
  }),
576
- d(e(E), {
577
- render: (oe = (te = (W = u.cellByColId[e(V).Cost]) == null ? void 0 : W.column) == null ? void 0 : te.columnDef) == null ? void 0 : oe.cell,
578
- props: (se = (K = u.cellByColId[e(V).Cost]) == null ? void 0 : K.getContext) == null ? void 0 : se.call(K)
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
579
  }, null, 8, ["render", "props"]),
580
580
  l[5] || (l[5] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
581
581
  ])
@@ -584,8 +584,8 @@ const Pt = { class: "flex flex-col gap-8 py-16" }, Bt = { class: "flex items-cen
584
584
  };
585
585
  }
586
586
  });
587
- function Ge(m) {
588
- const y = Ee(), u = fe(), { t: l } = Z(), x = A({
587
+ function Ye(m) {
588
+ const y = ze(), u = ye(), { t: l } = Z(), _ = V({
589
589
  get() {
590
590
  return Array.isArray(m.getLocations());
591
591
  },
@@ -597,7 +597,7 @@ function Ge(m) {
597
597
  var v;
598
598
  y.open({
599
599
  title: "Select at least one location",
600
- contentComponent: Ue,
600
+ contentComponent: Ne,
601
601
  contentComponentProps: {
602
602
  modelValue: ((v = n.value) == null ? void 0 : v.map((b) => b.doc._id)) ?? [],
603
603
  items: u.locations.map((b) => ({
@@ -618,7 +618,7 @@ function Ge(m) {
618
618
  m.setLocations(u.locations.filter((g) => b.includes(g.doc._id)));
619
619
  });
620
620
  }
621
- const n = A(() => {
621
+ const n = V(() => {
622
622
  var b;
623
623
  const v = /* @__PURE__ */ new Set([...u.locations.map((g) => g.doc._id)]);
624
624
  return (b = m.getLocations()) == null ? void 0 : b.filter((g) => v.has(g.doc._id));
@@ -629,23 +629,23 @@ function Ge(m) {
629
629
  }
630
630
  return {
631
631
  enabledLocations: n,
632
- enabledLocationsSwitch: x,
632
+ enabledLocationsSwitch: _,
633
633
  promptSelectLocations: c,
634
634
  removeLocation: a
635
635
  };
636
636
  }
637
- const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "flex flex-col gap-24" }, to = {
637
+ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "flex flex-col gap-24" }, oo = {
638
638
  key: 0,
639
639
  class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col gap-16"
640
- }, oo = { key: 1 }, so = { class: "flex flex-col gap-16" }, no = { class: "flex" }, lo = { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, ao = /* @__PURE__ */ X({
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({
641
641
  __name: "TransferTemplateForm",
642
642
  props: {
643
643
  modelValue: {},
644
644
  disabled: { type: Boolean }
645
645
  },
646
646
  setup(m, { expose: y }) {
647
- const u = m, l = je(), { t: x } = Z(), c = fe(), n = bt(), a = Tt(), v = A(() => c.businessLevel);
648
- pe(
647
+ const u = m, l = Qe(), { t: _ } = Z(), c = ye(), n = _t(), a = Ct(), v = V(() => c.businessLevel);
648
+ fe(
649
649
  () => u.modelValue,
650
650
  (o) => {
651
651
  console.log("TransferTemplateForm.model", o);
@@ -653,14 +653,14 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
653
653
  ), c.watchLocation(async () => {
654
654
  location && (l.purchaseOrder.supplier || (l.purchaseOrder.supplier = a.suppliers.find((o) => o) ?? l.purchaseOrder.supplier));
655
655
  });
656
- const b = Ee(), { enabledLocations: g, enabledLocationsSwitch: I, promptSelectLocations: M, removeLocation: w } = Ge({
656
+ const b = ze(), { enabledLocations: g, enabledLocationsSwitch: L, promptSelectLocations: M, removeLocation: w } = Ye({
657
657
  getLocations() {
658
658
  return l.locations;
659
659
  },
660
660
  setLocations(o) {
661
661
  l.locations = o;
662
662
  }
663
- }), h = A({
663
+ }), x = V({
664
664
  get() {
665
665
  return l.purchaseOrder.remark ?? void 0;
666
666
  },
@@ -682,7 +682,7 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
682
682
  (t = (o = F.value) == null ? void 0 : o.resetInputs) == null || t.call(o);
683
683
  }
684
684
  });
685
- const R = Ot({
685
+ const R = Pt({
686
686
  updateItem: (o) => {
687
687
  l.purchaseOrder.items = l.purchaseOrder.items.map((t) => t.sku._id !== o.sku._id ? t : o);
688
688
  },
@@ -698,129 +698,129 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
698
698
  return l.purchaseOrder.items;
699
699
  },
700
700
  get transferType() {
701
- return ce.PURCHASE;
701
+ return pe.PURCHASE;
702
702
  },
703
703
  get disabled() {
704
704
  return u.disabled;
705
705
  }
706
- }), q = A(() => R.columnDefs.value);
707
- function p() {
706
+ }), q = V(() => R.columnDefs.value);
707
+ function f() {
708
708
  const o = n.skus.map((r) => ({
709
709
  label: r.name,
710
710
  sublabel: r.code,
711
711
  value: r
712
712
  })), t = o.filter((r) => {
713
- var f;
714
- return (f = l.purchaseOrder.items) == null ? void 0 : f.find((i) => i.sku._id === r.value._id);
713
+ var p;
714
+ return (p = l.purchaseOrder.items) == null ? void 0 : p.find((i) => i.sku._id === r.value._id);
715
715
  }).map((r) => r.value);
716
716
  b.open({
717
- title: x("inventory.transfer.form.items.selectItem"),
717
+ title: _("inventory.transfer.form.items.selectItem"),
718
718
  closeButton: !0,
719
- contentComponent: Ue,
719
+ contentComponent: Ne,
720
720
  contentComponentProps: {
721
721
  modelValue: t,
722
722
  items: o
723
723
  },
724
724
  primaryActions: {
725
- text: x("common.confirm"),
725
+ text: _("common.confirm"),
726
726
  close: !0
727
727
  },
728
728
  secondaryActions: {
729
- text: x("common.close"),
729
+ text: _("common.close"),
730
730
  close: !0,
731
731
  variant: "tertiary"
732
732
  }
733
733
  }).onPrimary((r) => {
734
- const f = l.purchaseOrder.items ?? [], i = r.map((_) => {
735
- const L = f.find((B) => B.sku._id === _._id);
736
- if (L)
737
- return L;
738
- const C = { amount: 1, precision: de(_.unit) }, O = {
739
- sku: _,
740
- code: _.code,
741
- name: _.name,
742
- quantity: C,
743
- minimumQuantity: C,
744
- maximumQuantity: C,
745
- quantityStep: C
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
746
746
  };
747
- return O.totalCost = Qe(
748
- O.sku,
749
- O.quantity,
750
- O.measurement,
747
+ return T.totalCost = He(
748
+ T.sku,
749
+ T.quantity,
750
+ T.measurement,
751
751
  {
752
752
  supplier: l.purchaseOrder.supplier
753
753
  }
754
- ), O;
754
+ ), T;
755
755
  });
756
- i.sort((_, L) => _.sku.code.localeCompare(L.sku.code)), l.purchaseOrder.items = i;
756
+ i.sort((h, O) => h.sku.code.localeCompare(O.sku.code)), l.purchaseOrder.items = i;
757
757
  });
758
758
  }
759
759
  return (o, t) => {
760
- const r = S("FmChip"), f = S("FmTextField"), i = S("FmTextarea"), _ = S("FmSwitch"), L = S("FmButton"), C = S("FmListItem"), O = S("FmList"), B = S("FmFormGroup"), j = S("FmTable"), N = S("FmForm");
761
- return T(), z(N, {
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, {
762
762
  ref_key: "formRef",
763
763
  ref: F,
764
764
  class: "flex flex-col gap-32",
765
765
  disabled: o.disabled
766
766
  }, {
767
767
  default: D(() => [
768
- s("div", Jt, [
769
- v.value ? (T(), P("div", Xt, [
768
+ s("div", Xt, [
769
+ v.value ? (C(), P("div", eo, [
770
770
  d(r, {
771
771
  label: "Business template",
772
772
  compact: ""
773
773
  })
774
774
  ])) : H("", !0),
775
- s("div", eo, [
776
- d(f, {
777
- label: e(x)("inventory.transfer.form.name"),
775
+ s("div", to, [
776
+ d(p, {
777
+ label: e(_)("inventory.transfer.form.name"),
778
778
  "label-mark": "required",
779
779
  modelValue: e(l).name,
780
780
  "onUpdate:modelValue": t[0] || (t[0] = (k) => e(l).name = k),
781
781
  rules: [e(_e)()]
782
782
  }, null, 8, ["label", "modelValue", "rules"]),
783
- d(f, {
784
- label: e(x)("inventory.transfer.form.reference"),
783
+ d(p, {
784
+ label: e(_)("inventory.transfer.form.reference"),
785
785
  "label-mark": "optional",
786
786
  modelValue: e(l).purchaseOrder.ref,
787
787
  "onUpdate:modelValue": t[1] || (t[1] = (k) => e(l).purchaseOrder.ref = k)
788
788
  }, null, 8, ["label", "modelValue"]),
789
789
  d(i, {
790
- label: e(x)("inventory.transfer.form.remark"),
790
+ label: e(_)("inventory.transfer.form.remark"),
791
791
  "label-mark": "optional",
792
792
  "max-length": 240,
793
- modelValue: h.value,
794
- "onUpdate:modelValue": t[2] || (t[2] = (k) => h.value = k),
795
- class: ve({ "text-fm-color-typo-disabled": o.disabled })
793
+ modelValue: x.value,
794
+ "onUpdate:modelValue": t[2] || (t[2] = (k) => x.value = k),
795
+ class: me({ "text-fm-color-typo-disabled": o.disabled })
796
796
  }, null, 8, ["label", "modelValue", "class"])
797
797
  ])
798
798
  ]),
799
- e(c).businessLevel ? (T(), P("div", to, [
800
- d(_, {
801
- modelValue: e(I),
802
- "onUpdate:modelValue": t[3] || (t[3] = (k) => he(I) ? I.value = k : null),
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),
803
803
  label: "Locations rule",
804
804
  sublabel: "Enable template for specific locations only",
805
805
  "label-placement": "right"
806
806
  }, null, 8, ["modelValue"]),
807
- e(I) ? (T(), z(B, {
807
+ e(L) ? (C(), E(B, {
808
808
  key: 0,
809
809
  modelValue: e(g),
810
- rules: [e(qe)(1)],
810
+ rules: [e(Ue)(1)],
811
811
  class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
812
812
  }, {
813
813
  default: D(() => [
814
- d(O, null, {
814
+ d(T, null, {
815
815
  default: D(() => [
816
- (T(!0), P(me, null, be(e(g), (k) => (T(), z(C, {
816
+ (C(!0), P(ce, null, be(e(g), (k) => (C(), E(I, {
817
817
  key: k.doc._id,
818
818
  label: k.name,
819
819
  sublabel: k.type,
820
820
  disabled: o.disabled
821
821
  }, {
822
822
  append: D(() => [
823
- d(L, {
823
+ d(O, {
824
824
  "prepend-icon": "delete",
825
825
  variant: "tertiary",
826
826
  disabled: o.disabled,
@@ -835,10 +835,10 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
835
835
  ]),
836
836
  _: 1
837
837
  }, 8, ["modelValue", "rules"])) : H("", !0),
838
- e(I) ? (T(), P("div", oo, [
839
- d(L, {
838
+ e(L) ? (C(), P("div", so, [
839
+ d(O, {
840
840
  disabled: o.disabled,
841
- label: e(x)("inventory.transfer.form.items.addItem"),
841
+ label: e(_)("inventory.transfer.form.items.addItem"),
842
842
  "prepend-icon": "add",
843
843
  variant: "plain",
844
844
  class: "border-2 rounded-lg border-fm-color-primary",
@@ -846,32 +846,32 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
846
846
  }, null, 8, ["disabled", "label", "onClick"])
847
847
  ])) : H("", !0)
848
848
  ])) : H("", !0),
849
- s("div", so, [
850
- s("div", no, [
851
- s("div", lo, $(e(x)("inventory.transfer.form.items.title")), 1),
852
- d(L, {
849
+ s("div", no, [
850
+ s("div", lo, [
851
+ s("div", ao, $(e(_)("inventory.transfer.form.items.title")), 1),
852
+ d(O, {
853
853
  disabled: o.disabled,
854
- label: e(x)("inventory.transfer.form.items.addItem"),
854
+ label: e(_)("inventory.transfer.form.items.addItem"),
855
855
  "prepend-icon": "add",
856
856
  variant: "plain",
857
857
  class: "border-2 rounded-lg border-fm-color-primary",
858
- onClick: t[4] || (t[4] = (k) => p()),
858
+ onClick: t[4] || (t[4] = (k) => f()),
859
859
  size: "md"
860
860
  }, null, 8, ["disabled", "label"])
861
861
  ]),
862
- (T(), z(j, {
862
+ (C(), E(z, {
863
863
  "column-defs": q.value,
864
864
  "row-data": e(l).purchaseOrder.items,
865
865
  key: e(l).purchaseOrder.items.map((k) => k.sku._id).join("."),
866
866
  "hide-footer": ""
867
867
  }, {
868
868
  "list-row": D((k) => [
869
- (T(), z(He, {
869
+ (C(), E(Ge, {
870
870
  row: k,
871
871
  key: e(l).purchaseOrder.items.map((Q) => Q.sku._id).join(".")
872
872
  }, {
873
873
  default: D((Q) => [
874
- d(Zt, {
874
+ d(Jt, {
875
875
  row: k,
876
876
  "cell-by-col-id": Q
877
877
  }, null, 8, ["row", "cell-by-col-id"])
@@ -887,7 +887,7 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
887
887
  }, 8, ["disabled"]);
888
888
  };
889
889
  }
890
- }), ro = { class: "flex items-center" }, io = { class: "fm-typo-en-title-md-800" }, uo = { class: "flex gap-4" }, mo = /* @__PURE__ */ X({
890
+ }), io = { class: "flex items-center" }, uo = { class: "fm-typo-en-title-md-800" }, mo = { class: "flex gap-4" }, co = /* @__PURE__ */ X({
891
891
  __name: "TransferTemplateDialog",
892
892
  props: {
893
893
  mode: {},
@@ -897,7 +897,7 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
897
897
  emits: ["update:show", "submitted"],
898
898
  setup(m, { expose: y, emit: u }) {
899
899
  var o;
900
- const l = m, x = u, c = lt(), n = gt(), { t: a } = Z(), v = ze(l, "show");
900
+ const l = m, _ = u, c = at(), n = kt(), { t: a } = Z(), v = je(l, "show");
901
901
  function b() {
902
902
  return {
903
903
  _id: "",
@@ -930,15 +930,15 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
930
930
  }
931
931
  };
932
932
  }
933
- const g = U(l.modelValue ?? b()), I = U(((o = l.modelValue) == null ? void 0 : o._id) ?? `${Math.random()}`);
934
- pe(
933
+ const g = U(l.modelValue ?? b()), L = U(((o = l.modelValue) == null ? void 0 : o._id) ?? `${Math.random()}`);
934
+ fe(
935
935
  () => l.show,
936
936
  (t) => {
937
937
  var r;
938
- t && (g.value = l.modelValue ?? b(), I.value = ((r = l.modelValue) == null ? void 0 : r._id) ?? `${Math.random()}`);
938
+ t && (g.value = l.modelValue ?? b(), L.value = ((r = l.modelValue) == null ? void 0 : r._id) ?? `${Math.random()}`);
939
939
  }
940
940
  );
941
- const M = U(!1), w = A(() => {
941
+ const M = U(!1), w = V(() => {
942
942
  switch (l.mode) {
943
943
  case ne.READ:
944
944
  return "";
@@ -948,34 +948,34 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
948
948
  return a("inventory.transfer.template.update.title");
949
949
  }
950
950
  return "";
951
- }), h = U();
951
+ }), x = U();
952
952
  y({
953
953
  validateInputs: () => {
954
954
  var t, r;
955
- (r = (t = h.value) == null ? void 0 : t.validateInputs) == null || r.call(t);
955
+ (r = (t = x.value) == null ? void 0 : t.validateInputs) == null || r.call(t);
956
956
  },
957
957
  resetInputsValidation: () => {
958
958
  var t, r;
959
- (r = (t = h.value) == null ? void 0 : t.resetInputsValidation) == null || r.call(t);
959
+ (r = (t = x.value) == null ? void 0 : t.resetInputsValidation) == null || r.call(t);
960
960
  },
961
961
  resetInputs: () => {
962
962
  var t, r;
963
- (r = (t = h.value) == null ? void 0 : t.resetInputs) == null || r.call(t);
963
+ (r = (t = x.value) == null ? void 0 : t.resetInputs) == null || r.call(t);
964
964
  }
965
965
  });
966
966
  async function F() {
967
- var r, f;
967
+ var r, p;
968
968
  const t = g.value;
969
969
  if (t) {
970
- M.value = !0, (((r = t.purchaseOrder.supplier) == null ? void 0 : r.internal) === ie.enum.warehouse || ((f = t.purchaseOrder.supplier) == null ? void 0 : f.internal) === ie.enum.restaurant) && (t.purchaseOrder.items = t.purchaseOrder.items.map(
971
- ({ totalCost: i, ..._ }) => _
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
972
972
  ));
973
973
  try {
974
974
  await c.createTemplate(t), await new Promise((i) => setTimeout(i, 1e3)), n.open({
975
975
  title: a("inventory.transfer.template.create.success"),
976
976
  message: a("inventory.transfer.template.create.successMessage"),
977
977
  type: "success"
978
- }), x("update:show", !1), x("submitted");
978
+ }), _("update:show", !1), _("submitted");
979
979
  } catch (i) {
980
980
  n.open({
981
981
  title: a("inventory.transfer.template.create.error"),
@@ -988,18 +988,18 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
988
988
  }
989
989
  }
990
990
  async function R() {
991
- var r, f;
991
+ var r, p;
992
992
  const t = g.value;
993
993
  if (t) {
994
- M.value = !0, (((r = t.purchaseOrder.supplier) == null ? void 0 : r.internal) === ie.enum.warehouse || ((f = t.purchaseOrder.supplier) == null ? void 0 : f.internal) === ie.enum.restaurant) && (t.purchaseOrder.items = t.purchaseOrder.items.map(
995
- ({ totalCost: i, ..._ }) => _
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
996
996
  ));
997
997
  try {
998
998
  await c.updateTemplate(t), await new Promise((i) => setTimeout(i, 1e3)), n.open({
999
999
  title: a("inventory.transfer.template.update.success"),
1000
1000
  message: a("inventory.transfer.template.update.successMessage"),
1001
1001
  type: "success"
1002
- }), x("update:show", !1), x("submitted");
1002
+ }), _("update:show", !1), _("submitted");
1003
1003
  } catch (i) {
1004
1004
  n.open({
1005
1005
  title: a("inventory.transfer.template.update.error"),
@@ -1019,48 +1019,48 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
1019
1019
  return R();
1020
1020
  }
1021
1021
  }
1022
- function p() {
1022
+ function f() {
1023
1023
  var t, r;
1024
- (r = (t = h.value) == null ? void 0 : t.validateInputs) == null || r.call(t);
1024
+ (r = (t = x.value) == null ? void 0 : t.validateInputs) == null || r.call(t);
1025
1025
  }
1026
1026
  return (t, r) => {
1027
- const f = S("FmButton"), i = S("FmSideSheet");
1028
- return T(), z(i, {
1027
+ const p = S("FmButton"), i = S("FmSideSheet");
1028
+ return C(), E(i, {
1029
1029
  modelValue: e(v),
1030
- "onUpdate:modelValue": r[2] || (r[2] = (_) => he(v) ? v.value = _ : null),
1030
+ "onUpdate:modelValue": r[2] || (r[2] = (h) => he(v) ? v.value = h : null),
1031
1031
  "dismiss-away": "",
1032
1032
  "close-button": "",
1033
1033
  "max-width": 1200
1034
1034
  }, {
1035
1035
  "side-sheet-header": D(() => [
1036
- s("div", ro, [
1037
- s("div", io, $(w.value), 1)
1036
+ s("div", io, [
1037
+ s("div", uo, $(w.value), 1)
1038
1038
  ])
1039
1039
  ]),
1040
1040
  default: D(() => [
1041
- (T(), z(ao, {
1041
+ (C(), E(ro, {
1042
1042
  class: "w-full",
1043
1043
  ref_key: "formRef",
1044
- ref: h,
1044
+ ref: x,
1045
1045
  onValidationSuccess: q,
1046
1046
  "model-value": g.value,
1047
- "onUpdate:modelValue": r[0] || (r[0] = (_) => g.value = _),
1047
+ "onUpdate:modelValue": r[0] || (r[0] = (h) => g.value = h),
1048
1048
  disabled: M.value,
1049
- key: I.value
1049
+ key: L.value
1050
1050
  }, null, 8, ["model-value", "disabled"]))
1051
1051
  ]),
1052
1052
  "side-sheet-footer": D(() => [
1053
- s("div", uo, [
1054
- d(f, {
1053
+ s("div", mo, [
1054
+ d(p, {
1055
1055
  loading: M.value,
1056
1056
  label: e(a)("common.save"),
1057
- onClick: p
1057
+ onClick: f
1058
1058
  }, null, 8, ["loading", "label"]),
1059
- d(f, {
1059
+ d(p, {
1060
1060
  disabled: M.value,
1061
1061
  variant: "tertiary",
1062
1062
  label: e(a)("common.close"),
1063
- onClick: r[1] || (r[1] = (_) => x("update:show", !1))
1063
+ onClick: r[1] || (r[1] = (h) => _("update:show", !1))
1064
1064
  }, null, 8, ["disabled", "label"])
1065
1065
  ])
1066
1066
  ]),
@@ -1068,22 +1068,22 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
1068
1068
  }, 8, ["modelValue"]);
1069
1069
  };
1070
1070
  }
1071
- }), co = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, po = { class: "flex justify-between" }, fo = { class: "fm-typo-en-body-lg-600" }, yo = { class: "flex flex-col gap-8" }, vo = { class: "flex flex-col gap-4" }, bo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _o = { class: "flex gap-1" }, xo = { class: "fm-typo-en-body-lg-600" }, ho = {
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 = {
1072
1072
  key: 0,
1073
1073
  class: "flex flex-col gap-4"
1074
- }, go = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ko = { class: "fm-typo-en-body-lg-600" }, wo = { class: "flex flex-col gap-4" }, Fo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, To = { class: "fm-typo-en-body-lg-600" }, Co = {
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 = {
1075
1075
  key: 1,
1076
1076
  class: "flex flex-col gap-4"
1077
- }, $o = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, So = { class: "fm-typo-en-body-lg-600" }, Lo = {
1077
+ }, So = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Lo = { class: "fm-typo-en-body-lg-600" }, Mo = {
1078
1078
  key: 2,
1079
1079
  class: "flex flex-col gap-4"
1080
- }, Io = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mo = { class: "fm-typo-en-body-lg-600" }, Do = {
1080
+ }, Io = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Do = { class: "fm-typo-en-body-lg-600" }, Vo = {
1081
1081
  key: 3,
1082
1082
  class: "flex flex-col gap-4"
1083
- }, Vo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ao = { class: "fm-typo-en-body-lg-600" }, Ro = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Oo = { class: "flex flex-col gap-8" }, Po = { class: "fm-typo-en-body-lg-600" }, Bo = { class: "flex w-full gap-4" }, qo = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, Uo = { class: "fm-typo-en-body-lg-600 shrink-0" }, No = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Eo = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, zo = {
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 = {
1084
1084
  key: 0,
1085
1085
  class: "shrink-0 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
1086
- }, jo = { class: "flex gap-8 xs:flex-col" }, Qo = /* @__PURE__ */ X({
1086
+ }, Qo = { class: "flex gap-8 xs:flex-col" }, Ho = /* @__PURE__ */ X({
1087
1087
  __name: "TransferTemplateDetails",
1088
1088
  props: {
1089
1089
  template: {},
@@ -1091,82 +1091,82 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
1091
1091
  },
1092
1092
  emits: ["update:show", "action:use", "action:edit"],
1093
1093
  setup(m, { emit: y }) {
1094
- const u = m, l = y, x = ge(), c = fe(), { t: n } = Z(), a = A(() => {
1094
+ const u = m, l = y, _ = ge(), c = ye(), { t: n } = Z(), a = V(() => {
1095
1095
  var w;
1096
1096
  return (w = u.template) == null ? void 0 : w.purchaseOrder;
1097
- }), { enabledLocations: v } = Ge({
1097
+ }), { enabledLocations: v } = Ye({
1098
1098
  getLocations() {
1099
1099
  var w;
1100
1100
  return (w = u.template) == null ? void 0 : w.locations;
1101
1101
  },
1102
1102
  setLocations() {
1103
1103
  }
1104
- }), b = A(() => {
1104
+ }), b = V(() => {
1105
1105
  if (!c.businessLevel)
1106
1106
  return [c.currentLocation];
1107
- const w = Array.isArray(v.value) ? v.value : c.locations, h = /* @__PURE__ */ new Set([...w.map((F) => F.doc._id)]);
1108
- return c.locations.filter((F) => h.has(F.doc._id));
1109
- }), g = A(
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(
1110
1110
  () => {
1111
- var w, h, F, R;
1112
- return ((h = (w = a.value) == null ? void 0 : w.supplier) == null ? void 0 : h.internal) === "restaurant" || ((R = (F = a.value) == null ? void 0 : F.supplier) == null ? void 0 : R.internal) === "warehouse" ? ce.TRANSFER : ce.PURCHASE;
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;
1113
1113
  }
1114
- ), I = U(!0), M = ze(u, "show");
1115
- return (w, h) => {
1114
+ ), L = U(!0), M = je(u, "show");
1115
+ return (w, x) => {
1116
1116
  var r;
1117
- const F = S("FmMenuDivider"), R = S("FmCard"), q = S("FmButton"), p = S("FmListItem"), o = S("FmList"), t = S("FmSideSheet");
1118
- return T(), z(t, {
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
1119
  header: e(n)("inventory.transfer.template.details.view", { template: (r = w.template) == null ? void 0 : r.name }),
1120
1120
  modelValue: e(M),
1121
- "onUpdate:modelValue": h[1] || (h[1] = (f) => he(M) ? M.value = f : null),
1122
- "dismiss-away": I.value,
1121
+ "onUpdate:modelValue": x[1] || (x[1] = (p) => he(M) ? M.value = p : null),
1122
+ "dismiss-away": L.value,
1123
1123
  "close-button": "",
1124
1124
  "max-width": 500
1125
1125
  }, {
1126
1126
  default: D(() => {
1127
- var f;
1127
+ var p;
1128
1128
  return [
1129
- s("div", co, [
1129
+ s("div", po, [
1130
1130
  s("div", null, [
1131
1131
  d(R, {
1132
1132
  variant: "outlined",
1133
1133
  class: "flex flex-col gap-8 px-12 py-16"
1134
1134
  }, {
1135
1135
  default: D(() => {
1136
- var i, _, L, C, O, B, j, N, k;
1136
+ var i, h, O, I, T, B, z, j, k;
1137
1137
  return [
1138
- s("div", po, [
1139
- s("div", fo, $(e(n)("inventory.transfer.template.details.templateSummary")), 1)
1138
+ s("div", fo, [
1139
+ s("div", yo, $(e(n)("inventory.transfer.template.details.templateSummary")), 1)
1140
1140
  ]),
1141
1141
  d(F),
1142
- s("div", yo, [
1143
- s("div", vo, [
1144
- s("div", bo, [
1145
- s("div", _o, $(e(n)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1142
+ s("div", vo, [
1143
+ s("div", bo, [
1144
+ s("div", _o, [
1145
+ s("div", xo, $(e(n)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1146
1146
  ]),
1147
- s("div", xo, $(e(at)(((i = w.template) == null ? void 0 : i._id) ?? "")), 1)
1147
+ s("div", ho, $(e(rt)(((i = w.template) == null ? void 0 : i._id) ?? "")), 1)
1148
1148
  ]),
1149
- (_ = a.value) != null && _.effectiveAt ? (T(), P("div", ho, [
1150
- s("div", go, $(e(n)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
1151
- s("div", ko, $(e(_t)(new Date((L = a.value) == null ? void 0 : L.effectiveAt))), 1)
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)
1152
1152
  ])) : H("", !0),
1153
- s("div", wo, [
1154
- s("div", Fo, $(e(n)("inventory.transfer.receiveRequest.details.type.title")), 1),
1155
- s("div", To, $(e(n)(
1153
+ s("div", Fo, [
1154
+ s("div", To, $(e(n)("inventory.transfer.receiveRequest.details.type.title")), 1),
1155
+ s("div", Co, $(e(n)(
1156
1156
  `inventory.transfer.receiveRequest.details.type.${g.value.toLocaleLowerCase("en-US")}`
1157
1157
  )), 1)
1158
1158
  ]),
1159
- (O = (C = a.value) == null ? void 0 : C.supplier) != null && O.name ? (T(), P("div", Co, [
1160
- s("div", $o, $(e(n)("inventory.transfer.receiveRequest.details.from")), 1),
1161
- s("div", So, $((j = (B = a.value) == null ? void 0 : B.supplier) == null ? void 0 : j.name), 1)
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)
1162
1162
  ])) : H("", !0),
1163
- (N = a.value) != null && N.ref ? (T(), P("div", Lo, [
1163
+ (j = a.value) != null && j.ref ? (C(), P("div", Mo, [
1164
1164
  s("div", Io, $(e(n)("inventory.transfer.receiveRequest.details.reference")), 1),
1165
- s("div", Mo, $(a.value.ref), 1)
1165
+ s("div", Do, $(a.value.ref), 1)
1166
1166
  ])) : H("", !0),
1167
- (k = a.value) != null && k.remark ? (T(), P("div", Do, [
1168
- s("div", Vo, $(e(n)("inventory.transfer.receiveRequest.details.remark")), 1),
1169
- s("div", Ao, $(a.value.remark), 1)
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)
1170
1170
  ])) : H("", !0)
1171
1171
  ])
1172
1172
  ];
@@ -1174,21 +1174,21 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
1174
1174
  _: 1
1175
1175
  })
1176
1176
  ]),
1177
- s("div", Ro, [
1178
- s("div", Oo, [
1179
- s("div", Po, $(e(n)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
1180
- (T(!0), P(me, null, be(((f = a.value) == null ? void 0 : f.items) ?? [], (i) => (T(), P("div", {
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", {
1181
1181
  key: i.code,
1182
1182
  class: "flex flex-col"
1183
1183
  }, [
1184
- s("div", Bo, [
1185
- s("div", qo, $(i.name), 1),
1186
- h[2] || (h[2] = s("div", { class: "flex-1 min-w-32" }, null, -1)),
1187
- s("div", Uo, $(e(rt)(i.quantity, i.sku.unit, i.measurement)), 1)
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
1188
  ]),
1189
- s("div", No, [
1190
- s("div", Eo, $(i.code), 1),
1191
- i.totalCost && e(x).enableTotalCost ? (T(), P("div", zo, " (" + $(e(xt)(i.totalCost)) + ") ", 1)) : H("", !0)
1189
+ 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)
1192
1192
  ])
1193
1193
  ]))), 128))
1194
1194
  ])
@@ -1199,17 +1199,17 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
1199
1199
  class: "flex flex-col"
1200
1200
  }, {
1201
1201
  default: D(() => [
1202
- h[3] || (h[3] = s("div", { class: "flex flex-col p-16" }, [
1202
+ x[3] || (x[3] = s("div", { class: "flex flex-col p-16" }, [
1203
1203
  s("div", { class: "fm-typo-en-body-lg-600" }, "Enabled locations"),
1204
1204
  s("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Click to use template on the location ")
1205
1205
  ], -1)),
1206
1206
  d(o, null, {
1207
1207
  default: D(() => [
1208
- (T(!0), P(me, null, be(b.value, (i) => (T(), z(p, {
1208
+ (C(!0), P(ce, null, be(b.value, (i) => (C(), E(f, {
1209
1209
  key: i.doc._id,
1210
1210
  label: i.name,
1211
1211
  sublabel: i.type,
1212
- onClick: (_) => l("action:use", i.doc._id)
1212
+ onClick: (h) => l("action:use", i.doc._id)
1213
1213
  }, {
1214
1214
  append: D(() => [
1215
1215
  d(q, {
@@ -1230,10 +1230,10 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
1230
1230
  ];
1231
1231
  }),
1232
1232
  "side-sheet-footer": D(() => [
1233
- s("div", jo, [
1233
+ s("div", Qo, [
1234
1234
  d(q, {
1235
1235
  label: e(n)("common.edit"),
1236
- onClick: h[0] || (h[0] = (f) => l("action:edit")),
1236
+ onClick: x[0] || (x[0] = (p) => l("action:edit")),
1237
1237
  variant: "tertiary"
1238
1238
  }, null, 8, ["label"])
1239
1239
  ])
@@ -1242,118 +1242,126 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
1242
1242
  }, 8, ["header", "modelValue", "dismiss-away"]);
1243
1243
  };
1244
1244
  }
1245
- }), Ho = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 h-full" }, 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({
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({
1246
1246
  __name: "TransferTemplateView",
1247
1247
  setup(m) {
1248
- const { t: y } = Z(), { createTemplate: u, viewTemplate: l } = Re(), { templateDialogProps: x, transferFormDialogProps: c, templateDetailsProps: n } = kt(
1249
- Re()
1250
- ), a = it(), v = ot(), b = fe(), g = ge(), { breakpoints: I } = Ne();
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
1251
  b.watchLocation(a.fetchTemplates), xe(() => {
1252
1252
  g.mustManageBusinessOnlyPoTemplate && (b.businessLevel = !0);
1253
- }), pe(() => {
1254
- var r;
1255
- return (r = c.value) == null ? void 0 : r.show;
1256
- }, (r) => {
1257
- r === !1 && g.mustManageBusinessOnlyPoTemplate && (b.businessLevel = !0);
1258
- }), Ze(() => {
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
1259
  b.businessLevel = !1;
1260
1260
  });
1261
- const M = A(() => b.businessLevel), w = A(
1261
+ const M = V(() => b.businessLevel), w = V(
1262
1262
  () => a.loading.value || !b._currentLocation
1263
- ), h = A(
1263
+ ), x = V(
1264
1264
  () => M.value ? a.businessTemplates.value : a.locationTemplates.value
1265
- ), F = U(""), R = A(() => I.value.xs || I.value.sm ? 10 : 20);
1266
- function q(r) {
1267
- switch (r) {
1268
- case Oe.Add:
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
1269
  return u();
1270
1270
  }
1271
1271
  }
1272
- const p = Ft();
1273
- function o() {
1274
- p.push({ name: ht.RECEIVE_REQUEST });
1272
+ const o = Tt();
1273
+ function t() {
1274
+ o.push({ name: gt.RECEIVE_REQUEST });
1275
1275
  }
1276
- function t(r) {
1277
- return r;
1276
+ function r(p) {
1277
+ return p;
1278
1278
  }
1279
- return (r, f) => {
1280
- const i = S("FmTable");
1281
- return T(), P(me, null, [
1282
- d(st, {
1279
+ return (p, i) => {
1280
+ const h = S("FmTable");
1281
+ return C(), P(ce, null, [
1282
+ d(nt, {
1283
1283
  title: e(y)("inventory.transfer.template.title2"),
1284
1284
  actions: [
1285
1285
  {
1286
1286
  label: e(y)("inventory.transfer.template.create.title"),
1287
- value: e(Oe).Add,
1287
+ value: e(Pe).Add,
1288
1288
  isPrimary: !0,
1289
1289
  prependIcon: "add"
1290
1290
  }
1291
1291
  ],
1292
- "onClick:action": q,
1292
+ "onClick:action": f,
1293
1293
  "using-business-helper-text": "You are managing business-level template list. These templates will be made visible to all locations."
1294
1294
  }, {
1295
1295
  default: D(() => {
1296
- var _;
1296
+ var O;
1297
1297
  return [
1298
- s("div", Ho, [
1299
- d(nt, {
1298
+ s("div", {
1299
+ class: me([
1300
+ "flex flex-col gap-8 max-h-full",
1301
+ {
1302
+ "p-0": R.value,
1303
+ "px-24 ": !R.value
1304
+ }
1305
+ ])
1306
+ }, [
1307
+ d(lt, {
1300
1308
  searchable: "",
1301
1309
  "change-location": !e(g).mustManageBusinessOnlyPoTemplate,
1302
1310
  search: F.value,
1303
- "onUpdate:search": f[0] || (f[0] = (L) => F.value = L),
1311
+ "onUpdate:search": i[0] || (i[0] = (I) => F.value = I),
1304
1312
  actions: [{ icon: "refresh", onClick: e(a).fetchTemplates }],
1305
1313
  "show-business": ""
1306
1314
  }, null, 8, ["change-location", "search", "actions"]),
1307
- (T(), z(i, {
1308
- style: Je(e(v).tableHeight),
1315
+ (C(), E(h, {
1316
+ style: Xe(e(v).tableHeight),
1309
1317
  "column-defs": e(a).columnDefs,
1310
- "row-data": h.value,
1318
+ "row-data": x.value,
1311
1319
  "search-value": F.value,
1312
1320
  loading: w.value,
1313
- key: (_ = e(b)._currentLocation) == null ? void 0 : _.dbName,
1314
- onRowClick: f[1] || (f[1] = (L) => e(l)(L.original)),
1315
- "page-size": R.value
1321
+ key: (O = e(b)._currentLocation) == null ? void 0 : O.dbName,
1322
+ onRowClick: i[1] || (i[1] = (I) => e(l)(I.original)),
1323
+ "page-size": q.value
1316
1324
  }, {
1317
- "list-row": D((L) => [
1318
- d(He, {
1319
- row: L,
1320
- onRowClick: (C) => e(l)(C)
1325
+ "list-row": D((I) => [
1326
+ d(Ge, {
1327
+ row: I,
1328
+ onRowClick: (T) => e(l)(T)
1321
1329
  }, {
1322
- default: D((C) => {
1323
- var O, B, j, N, k, Q, Y, ee, W, te, oe, K, se, le, ke, we, Fe, Te, ae, Ce, $e, Se, Le, re, Ie;
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;
1324
1332
  return [
1325
1333
  s("div", Go, [
1326
1334
  s("div", Yo, [
1327
1335
  s("div", Wo, [
1328
- d(e(E), {
1329
- render: (j = (B = (O = C._id) == null ? void 0 : O.column) == null ? void 0 : B.columnDef) == null ? void 0 : j.cell,
1330
- props: (k = (N = C._id) == null ? void 0 : N.getContext) == null ? void 0 : k.call(N)
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)
1331
1339
  }, null, 8, ["render", "props"])
1332
1340
  ]),
1333
1341
  s("div", Ko, [
1334
- d(e(E), {
1335
- render: (ee = (Y = (Q = C.name) == null ? void 0 : Q.column) == null ? void 0 : Y.columnDef) == null ? void 0 : ee.cell,
1336
- props: (te = (W = C.name) == null ? void 0 : W.getContext) == null ? void 0 : te.call(W)
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)
1337
1345
  }, null, 8, ["render", "props"])
1338
1346
  ]),
1339
1347
  s("div", Zo, [
1340
- d(e(E), {
1341
- render: (se = (K = (oe = C.supplier) == null ? void 0 : oe.column) == null ? void 0 : K.columnDef) == null ? void 0 : se.cell,
1342
- props: (ke = (le = C.supplier) == null ? void 0 : le.getContext) == null ? void 0 : ke.call(le)
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)
1343
1351
  }, null, 8, ["render", "props"])
1344
1352
  ]),
1345
- s("div", Jo, $(L.original.purchaseOrder.items.length ? L.original.purchaseOrder.items.map((Ye) => Ye.name).join(", ") : "No items"), 1),
1353
+ s("div", Jo, $(I.original.purchaseOrder.items.length ? I.original.purchaseOrder.items.map((We) => We.name).join(", ") : "No items"), 1),
1346
1354
  s("div", Xo, [
1347
- d(e(E), {
1348
- render: (Te = (Fe = (we = C.ref) == null ? void 0 : we.column) == null ? void 0 : Fe.columnDef) == null ? void 0 : Te.cell,
1349
- props: (Ce = (ae = C.ref) == null ? void 0 : ae.getContext) == null ? void 0 : Ce.call(ae)
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)
1350
1358
  }, null, 8, ["render", "props"])
1351
1359
  ])
1352
1360
  ]),
1353
1361
  s("div", null, [
1354
- d(e(E), {
1355
- render: (Le = (Se = ($e = C.type) == null ? void 0 : $e.column) == null ? void 0 : Se.columnDef) == null ? void 0 : Le.cell,
1356
- props: (Ie = (re = C.type) == null ? void 0 : re.getContext) == null ? void 0 : Ie.call(re)
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)
1357
1365
  }, null, 8, ["render", "props"])
1358
1366
  ])
1359
1367
  ])
@@ -1364,16 +1372,16 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
1364
1372
  ]),
1365
1373
  _: 1
1366
1374
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
1367
- ])
1375
+ ], 2)
1368
1376
  ];
1369
1377
  }),
1370
1378
  _: 1
1371
1379
  }, 8, ["title", "actions"]),
1372
- (T(), z(Xe, { to: "body" }, [
1373
- d(wt, Ae(e(c), { onSubmitted: o }), null, 16),
1374
- d(Qo, et(tt(e(n))), null, 16),
1375
- d(mo, Ae(e(x), {
1376
- onSubmitted: f[2] || (f[2] = (_) => e(a).fetchTemplates())
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())
1377
1385
  }), null, 16)
1378
1386
  ]))
1379
1387
  ], 64);