@feedmepos/mf-inventory-portal 0.0.24-dev.1 → 0.0.24-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/{App-D3sNH2MR.js → App-BB4XENeM.js} +1 -1
  2. package/dist/{ApprovalView-DHnRx0hJ.js → ApprovalView-DZAePC0L.js} +2 -2
  3. package/dist/{BindingsDialog-oTeg2Dai.js → BindingsDialog-D9I7xJPr.js} +2 -2
  4. package/dist/{BindingsPicker-CWdjmMJ3.js → BindingsPicker-D298qOIo.js} +1 -1
  5. package/dist/{BindingsTable-bKLR1OKX.js → BindingsTable-icsoROx_.js} +1 -1
  6. package/dist/{ClosingDraftView-CIQVz7lY.js → ClosingDraftView-CDIFl55J.js} +2 -2
  7. package/dist/{ClosingTemplateView-D5pLzQwU.js → ClosingTemplateView-B3sgGCgw.js} +1 -1
  8. package/dist/{FmCustomAttribute.vue_vue_type_script_setup_true_lang-ClLDcchC.js → FmCustomAttribute.vue_vue_type_script_setup_true_lang-Sgq1OQAe.js} +1 -1
  9. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C_boDzZI.js +286 -0
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DhpHOaRH.js → FmUnitInput.vue_vue_type_script_setup_true_lang-ByHVBLHt.js} +1 -1
  11. package/dist/{IngredientGroupView-4C437mso.js → IngredientGroupView-DrULhOXc.js} +1 -1
  12. package/dist/{IngredientsView-DoiGgjre.js → IngredientsView-CmVHwti-.js} +3 -3
  13. package/dist/{IntegrationView-8ZKE7MAM.js → IntegrationView-qFUn-4zs.js} +1 -1
  14. package/dist/{InventoryBindingForm-CcnfliYQ.js → InventoryBindingForm-C1xPd0CB.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-B_J-6C9x.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DQJHeGE9.js} +3 -3
  16. package/dist/{InventoryBindingSummary-CRdHCzNE.js → InventoryBindingSummary-0tdJMFOQ.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B2-TypU0.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-mdzrbF5Z.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BuQde75S.js → PremiumBadge.vue_vue_type_script_setup_true_lang-yLcNia4J.js} +1 -1
  19. package/dist/{PublishView-t5gjGmK_.js → PublishView-Cn1oAbmz.js} +2 -2
  20. package/dist/{PurchaseOrderPrintPreview-6i53Y-v1.js → PurchaseOrderPrintPreview-gZrApRzK.js} +1 -1
  21. package/dist/{ReceiveRequestView-uOeSh0Mr.js → ReceiveRequestView-D9YOnAog.js} +184 -174
  22. package/dist/{RecipeView-BTWywckD.js → RecipeView-CI4HwNjC.js} +3 -3
  23. package/dist/{StockView-DN2xk8ei.js → StockView-B6iv7SOV.js} +7 -7
  24. package/dist/{SupplierView-l0XUg3J4.js → SupplierView-CkaayHMA.js} +3 -3
  25. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CWMn6fFf.js → TransferDetails.vue_vue_type_script_setup_true_lang-BFPjBpwI.js} +3 -3
  26. package/dist/{TransferTemplateView-wDKXpCWZ.js → TransferTemplateView-CcdoKSZ2.js} +425 -404
  27. package/dist/{UnitView-CUI-k-tS.js → UnitView-DIU3UAdi.js} +3 -3
  28. package/dist/{WarehouseView-WsI_eG5r.js → WarehouseView-Bs95hEIK.js} +1 -1
  29. package/dist/{app-DntcWR3_.js → app-wfVkfux5.js} +89 -89
  30. package/dist/app.js +1 -1
  31. package/dist/{decimal-DTCTnMwO.js → decimal-EaJS2tkh.js} +1 -1
  32. package/dist/{format-unit-display-Hy48Iw5j.js → format-unit-display-BoJgjxR6.js} +2 -2
  33. package/dist/{index-Bv9RYyTZ.js → index-Ccyg4vxa.js} +3 -3
  34. package/dist/{index-D4yJP9I2.js → index-DuxMFNzG.js} +1 -1
  35. package/dist/{stock-BsdmfT-b.js → stock-BzPWMuAI.js} +1 -1
  36. package/dist/{supplier-CXhkgC4M.js → supplier-rNvX0bxV.js} +1 -1
  37. package/dist/tsconfig.app.tsbuildinfo +1 -1
  38. package/dist/{use-inventory-binding-dialog-DPMJmBCr.js → use-inventory-binding-dialog-Dq6yszq-.js} +1 -1
  39. package/dist/{vue-i18n-ByVzHsI7.js → vue-i18n-Bca6LQ7c.js} +209 -209
  40. package/package.json +3 -3
  41. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B_c6Vn6P.js +0 -282
@@ -1,13 +1,13 @@
1
- import { defineComponent as Z, onMounted as ce, computed as R, ref as E, watch as pe, inject as Je, resolveComponent as V, openBlock as D, createElementBlock as K, createElementVNode as t, createVNode as c, withCtx as q, renderSlot as Oe, withDirectives as Ve, normalizeClass as ie, vModelText as Ae, reactive as Ze, h as J, toDisplayString as O, unref as e, createBlock as W, mergeProps as Ee, isRef as Ue, createCommentVNode as Y, Fragment as qe, renderList as Xe, normalizeStyle as Ye, Teleport as et, normalizeProps as tt, guardReactiveProps as ot } from "vue";
2
- import { H as Ne, ay as ue, t as De, I as st, az as lt, aA as nt, j as G, aB as at, b as ze, $ as Re, m as me, a as He, P as re, L as rt, A as de, M as it, c as je, G as Q, u as Qe, ac as ut, E as Ke, J as mt, K as dt, e as ee, aC as ne, a9 as ct, a1 as pt, z as ft, i as Pe, _ as yt, B as vt } from "./app-DntcWR3_.js";
3
- import { useI18n as X } from "@feedmepos/mf-common";
4
- import { P as H, a as bt, f as xt, t as _t, b as Le, u as ht } from "./format-unit-display-Hy48Iw5j.js";
5
- import { components as ae, useDialog as gt, useSnackbar as Tt, useProxiedModel as Ge, useBreakpoints as Ft } from "@feedmepos/ui-library";
1
+ import { defineComponent as X, onMounted as ce, computed as R, ref as U, watch as pe, inject as Je, resolveComponent as V, openBlock as D, createElementBlock as K, createElementVNode as t, createVNode as c, withCtx as B, renderSlot as Oe, withDirectives as Ve, normalizeClass as Z, vModelText as Ae, reactive as Ze, h as J, toDisplayString as I, unref as e, createBlock as W, mergeProps as Ee, isRef as Ue, createCommentVNode as ee, Fragment as qe, renderList as Xe, normalizeStyle as Ye, Teleport as et, normalizeProps as tt, guardReactiveProps as ot } from "vue";
2
+ import { H as Ne, ay as ue, t as De, I as st, az as lt, aA as nt, j as G, aB as at, b as ze, $ as Re, m as me, a as He, P as ie, L as rt, A as de, M as it, c as je, G as Q, u as Qe, ac as ut, V as mt, E as Ke, J as dt, K as ct, e as te, aC as ae, a9 as pt, a1 as ft, z as yt, i as Pe, _ as vt, B as bt } from "./app-wfVkfux5.js";
3
+ import { useI18n as Y } from "@feedmepos/mf-common";
4
+ import { P as H, a as xt, f as _t, t as ht, b as Le, u as gt } from "./format-unit-display-BoJgjxR6.js";
5
+ import { components as re, useDialog as Tt, useSnackbar as Ft, useProxiedModel as Ge, useBreakpoints as wt } from "@feedmepos/ui-library";
6
6
  import { storeToRefs as Be } from "pinia";
7
- import { _ as wt, b as kt, F as Ct, a as St } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-DhpHOaRH.js";
8
- import { c as Mt, u as $t, _ as It } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B_c6Vn6P.js";
9
- import { u as Ot } from "./supplier-CXhkgC4M.js";
10
- const Vt = { class: "flex flex-col" }, At = { class: "flex flex-col" }, Dt = { class: "flex-1" }, Rt = { class: "flex items-center" }, Pt = { class: "flex-1" }, Lt = { class: "flex-1" }, Bt = /* @__PURE__ */ Z({
7
+ import { _ as kt, b as Ct, F as St, a as Mt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-ByHVBLHt.js";
8
+ import { c as $t, u as It, _ as Ot } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C_boDzZI.js";
9
+ import { u as Vt } from "./supplier-rNvX0bxV.js";
10
+ const At = { class: "flex flex-col" }, Dt = { class: "flex flex-col" }, Rt = { class: "flex-1" }, Pt = { class: "flex items-center" }, Lt = { class: "flex-1" }, Bt = { class: "flex-1" }, Et = /* @__PURE__ */ X({
11
11
  __name: "FmMinMaxInput",
12
12
  props: {
13
13
  rules: {},
@@ -45,7 +45,7 @@ const Vt = { class: "flex flex-col" }, At = { class: "flex flex-col" }, Dt = { c
45
45
  helperState: {}
46
46
  },
47
47
  setup(y) {
48
- const x = y, u = Ne("modelValue"), o = st();
48
+ const _ = y, u = Ne("modelValue"), s = st();
49
49
  ce(() => {
50
50
  const { min: p, max: r } = u ?? {};
51
51
  if (!(!p || !r) && p.precision !== r.precision) {
@@ -55,7 +55,7 @@ const Vt = { class: "flex flex-col" }, At = { class: "flex flex-col" }, Dt = { c
55
55
  });
56
56
  const m = R(() => {
57
57
  const { min: p, max: r } = u ?? {};
58
- return Math.max((p == null ? void 0 : p.precision) ?? 0, (r == null ? void 0 : r.precision) ?? 0, x.precision ?? 0);
58
+ return Math.max((p == null ? void 0 : p.precision) ?? 0, (r == null ? void 0 : r.precision) ?? 0, _.precision ?? 0);
59
59
  }), C = (p) => {
60
60
  if (!p) return "";
61
61
  const r = lt(p), b = m.value, a = ue(r, b);
@@ -63,34 +63,34 @@ const Vt = { class: "flex flex-col" }, At = { class: "flex flex-col" }, Dt = { c
63
63
  +G(a),
64
64
  a.precision
65
65
  );
66
- }, i = E(C(u.min)), l = E(C(u.max));
66
+ }, i = U(C(u.min)), l = U(C(u.max));
67
67
  pe([i, l], ([p, r]) => {
68
- const b = u ?? {}, a = o(p), f = o(r), w = m.value;
68
+ const b = u ?? {}, a = s(p), f = s(r), w = m.value;
69
69
  if (p !== "" && a === !0) {
70
- const s = De(+p, w);
71
- b.min = s;
70
+ const o = De(+p, w);
71
+ b.min = o;
72
72
  } else
73
73
  b.min = null;
74
74
  if (r !== "" && f === !0) {
75
- const s = De(+r, w);
76
- b.max = s;
75
+ const o = De(+r, w);
76
+ b.max = o;
77
77
  } else
78
78
  b.max = null;
79
79
  u.min = b.min, u.max = b.max;
80
80
  });
81
- const d = Symbol.for("fm:form-state"), k = Je(d, null), h = R(() => x.disabled ?? (k == null ? void 0 : k.getDisabled()) ?? !1), A = E(), F = E(), v = E(!1), g = E(!1), I = R(() => v.value || g.value), B = R(() => [...[
81
+ const d = Symbol.for("fm:form-state"), k = Je(d, null), g = R(() => _.disabled ?? (k == null ? void 0 : k.getDisabled()) ?? !1), A = U(), T = U(), v = U(!1), F = U(!1), O = R(() => v.value || F.value), E = R(() => [...[
82
82
  function() {
83
- return typeof o(i.value) == "string" || typeof o(l.value) == "string" ? "Must be a number" : !0;
83
+ return typeof s(i.value) == "string" || typeof s(l.value) == "string" ? "Must be a number" : !0;
84
84
  },
85
85
  function(b) {
86
86
  return !b || !b.min || !b.max ? !0 : +G(b.min) > +G(b.max) ? "Min must be less than or equal to max" : !0;
87
87
  }
88
- ], ...x.rules ?? []]);
88
+ ], ..._.rules ?? []]);
89
89
  return (p, r) => {
90
90
  const b = V("FmLabel"), a = V("FmField"), f = V("FmFormGroup");
91
- return D(), K("div", Vt, [
92
- t("div", At, [
93
- t("div", Dt, [
91
+ return D(), K("div", At, [
92
+ t("div", Dt, [
93
+ t("div", Rt, [
94
94
  c(b, {
95
95
  label: p.label,
96
96
  disabled: p.disabled,
@@ -98,12 +98,12 @@ const Vt = { class: "flex flex-col" }, At = { class: "flex flex-col" }, Dt = { c
98
98
  optional: p.labelMark === "optional"
99
99
  }, null, 8, ["label", "disabled", "required", "optional"])
100
100
  ]),
101
- c(a, { focused: I.value }, {
102
- default: q(() => [
103
- t("div", Rt, [
101
+ c(a, { focused: O.value }, {
102
+ default: B(() => [
103
+ t("div", Pt, [
104
104
  Oe(p.$slots, "prepend"),
105
105
  r[6] || (r[6] = t("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Min.", -1)),
106
- t("div", Pt, [
106
+ t("div", Lt, [
107
107
  Ve(t("input", {
108
108
  type: "text",
109
109
  ref_key: "minInputRef",
@@ -111,10 +111,10 @@ const Vt = { class: "flex flex-col" }, At = { class: "flex flex-col" }, Dt = { c
111
111
  onFocus: r[0] || (r[0] = () => v.value = !0),
112
112
  onBlur: r[1] || (r[1] = () => v.value = !1),
113
113
  "onUpdate:modelValue": r[2] || (r[2] = (w) => i.value = w),
114
- class: ie({
114
+ class: Z({
115
115
  "fm-text-field--input fm-typo-en-body-lg-400": !0,
116
- "text-fm-color-typo-primary": !h.value,
117
- "text-fm-color-typo-disabled": h.value
116
+ "text-fm-color-typo-primary": !g.value,
117
+ "text-fm-color-typo-disabled": g.value
118
118
  })
119
119
  }, null, 34), [
120
120
  [Ae, i.value]
@@ -122,18 +122,18 @@ const Vt = { class: "flex flex-col" }, At = { class: "flex flex-col" }, Dt = { c
122
122
  ]),
123
123
  r[7] || (r[7] = t("div", { class: "block h-32 mx-4 w-[1px] bg-fm-color-neutral-gray-200" }, null, -1)),
124
124
  r[8] || (r[8] = t("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Max.", -1)),
125
- t("div", Lt, [
125
+ t("div", Bt, [
126
126
  Ve(t("input", {
127
127
  type: "text",
128
128
  ref_key: "maxInputRef",
129
- ref: F,
130
- onFocus: r[3] || (r[3] = () => g.value = !0),
131
- onBlur: r[4] || (r[4] = () => g.value = !1),
129
+ ref: T,
130
+ onFocus: r[3] || (r[3] = () => F.value = !0),
131
+ onBlur: r[4] || (r[4] = () => F.value = !1),
132
132
  "onUpdate:modelValue": r[5] || (r[5] = (w) => l.value = w),
133
- class: ie({
133
+ class: Z({
134
134
  "fm-text-field--input fm-typo-en-body-lg-400": !0,
135
- "text-fm-color-typo-primary": !h.value,
136
- "text-fm-color-typo-disabled": h.value
135
+ "text-fm-color-typo-primary": !g.value,
136
+ "text-fm-color-typo-disabled": g.value
137
137
  })
138
138
  }, null, 34), [
139
139
  [Ae, l.value]
@@ -149,7 +149,7 @@ const Vt = { class: "flex flex-col" }, At = { class: "flex flex-col" }, Dt = { c
149
149
  class: "flex-1",
150
150
  "model-value": p.modelValue,
151
151
  info: p.labelInfo,
152
- rules: B.value,
152
+ rules: E.value,
153
153
  "helper-text": p.helperText,
154
154
  "helper-state": p.helperState
155
155
  }, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
@@ -157,45 +157,45 @@ const Vt = { class: "flex flex-col" }, At = { class: "flex flex-col" }, Dt = { c
157
157
  };
158
158
  }
159
159
  });
160
- function Et({ min: y, max: x } = { min: !0, max: !0 }) {
161
- return function(o) {
162
- return !o || !o.min && y != !1 || !o.max && x != !1 ? "Required" : !0;
160
+ function Ut({ min: y, max: _ } = { min: !0, max: !0 }) {
161
+ return function(s) {
162
+ return !s || !s.min && y != !1 || !s.max && _ != !1 ? "Required" : !0;
163
163
  };
164
164
  }
165
- function Ut(y, x) {
166
- return function(o) {
167
- return !o || !o.min || !o.max ? !0 : +G(o.min) < y ? `Must be between ${y} and ${x}` : +G(o.max) > x ? `Must be between ${y} and ${x}` : !0;
165
+ function qt(y, _) {
166
+ return function(s) {
167
+ return !s || !s.min || !s.max ? !0 : +G(s.min) < y ? `Must be between ${y} and ${_}` : +G(s.max) > _ ? `Must be between ${y} and ${_}` : !0;
168
168
  };
169
169
  }
170
- function qt(y) {
171
- const x = at(y), u = G(y);
170
+ function Nt(y) {
171
+ const _ = at(y), u = G(y);
172
172
  return function(m) {
173
- const C = !(m != null && m.min) || x(m.min) === !0, i = !(m != null && m.max) || x(m.max) === !0;
173
+ const C = !(m != null && m.min) || _(m.min) === !0, i = !(m != null && m.max) || _(m.max) === !0;
174
174
  return !C && !i ? `Min & max must be a multiple of ${u}` : C ? i ? !0 : `Max must be a multiple of ${u}` : `Min must be a multiple of ${u}`;
175
175
  };
176
176
  }
177
177
  var L = /* @__PURE__ */ ((y) => (y.Code = "Code", y.Name = "Name", y.DefaultAmount = "DefaultAmount", y.Limit = "Limit", y.MinimumAmount = "MinimumAmount", y.Step = "Step", y.Cost = "Cost", y.Delete = "Delete", y))(L || {});
178
- function Nt(y) {
179
- const { t: x } = X(), u = ze(), o = Ze({});
178
+ function zt(y) {
179
+ const { t: _ } = Y(), u = ze(), s = Ze({});
180
180
  ce(() => {
181
181
  for (const i of y.items) {
182
182
  if (!i.totalCost)
183
183
  continue;
184
- const l = Mt(i.sku, i.quantity, i.measurement, {
184
+ const l = $t(i.sku, i.quantity, i.measurement, {
185
185
  supplier: y.supplier
186
186
  }), d = i.totalCost ?? Re.reset();
187
- l ? o[i.sku._id] = l.amount !== d.amount || l.precision !== d.precision : o[i.sku._id] = !0;
187
+ l ? s[i.sku._id] = l.amount !== d.amount || l.precision !== d.precision : s[i.sku._id] = !0;
188
188
  }
189
189
  });
190
190
  const m = [
191
191
  {
192
192
  id: "Code",
193
- header: () => x("inventory.transfer.form.items.table.Code"),
193
+ header: () => _("inventory.transfer.form.items.table.Code"),
194
194
  accessorKey: "code",
195
195
  size: 180,
196
196
  cell(i) {
197
197
  const l = i.row.original;
198
- return J(ae.FmTextField, {
198
+ return J(re.FmTextField, {
199
199
  modelValue: l.code,
200
200
  "onUpdate:modelValue": (d) => {
201
201
  y.updateItem({
@@ -212,11 +212,11 @@ function Nt(y) {
212
212
  },
213
213
  {
214
214
  id: "Name",
215
- header: () => x("inventory.transfer.form.items.table.Name"),
215
+ header: () => _("inventory.transfer.form.items.table.Name"),
216
216
  minSize: 300,
217
217
  cell(i) {
218
218
  const l = i.row.original;
219
- return J(ae.FmTextField, {
219
+ return J(re.FmTextField, {
220
220
  modelValue: l.name,
221
221
  "onUpdate:modelValue": (d) => {
222
222
  y.updateItem({
@@ -233,15 +233,15 @@ function Nt(y) {
233
233
  },
234
234
  {
235
235
  id: "DefaultAmount",
236
- header: () => x("inventory.transfer.form.items.table.DefaultAmount"),
236
+ header: () => _("inventory.transfer.form.items.table.DefaultAmount"),
237
237
  minSize: 200,
238
238
  cell(i) {
239
239
  var v;
240
- const l = i.row.original, d = He(), k = d.skuById[l.sku._id], h = d.unitById[(v = k.unit) == null ? void 0 : v._id], A = h.measurements.find((g) => {
241
- var I;
242
- return ((I = l.measurement) == null ? void 0 : I.id) === g.id;
243
- }), F = l.sku.unit._id !== k.unit._id || !h || l.measurement && !A;
244
- return J(wt, {
240
+ const l = i.row.original, d = He(), k = d.skuById[l.sku._id], g = d.unitById[(v = k.unit) == null ? void 0 : v._id], A = g.measurements.find((F) => {
241
+ var O;
242
+ return ((O = l.measurement) == null ? void 0 : O.id) === F.id;
243
+ }), T = l.sku.unit._id !== k.unit._id || !g || l.measurement && !A;
244
+ return J(kt, {
245
245
  style: {
246
246
  flex: "1 1 0%"
247
247
  },
@@ -252,38 +252,38 @@ function Nt(y) {
252
252
  },
253
253
  disabled: y.disabled,
254
254
  key: l.sku._id,
255
- unit: h,
256
- "onUpdate:modelValue": (g) => {
257
- var B;
258
- let I = l.code;
255
+ unit: g,
256
+ "onUpdate:modelValue": (F) => {
257
+ var E;
258
+ let O = l.code;
259
259
  if (u.isEnabled) {
260
- const p = u.getItemPKTCode(k, (B = g.measurement) == null ? void 0 : B.id);
261
- p && (I = p);
260
+ const p = u.getItemPKTCode(k, (E = F.measurement) == null ? void 0 : E.id);
261
+ p && (O = p);
262
262
  }
263
263
  y.updateItem({
264
264
  ...l,
265
- code: I,
265
+ code: O,
266
266
  sku: k,
267
- quantity: g.amount,
268
- measurement: g.measurement
267
+ quantity: F.amount,
268
+ measurement: F.measurement
269
269
  });
270
270
  },
271
271
  rules: [
272
- kt(l.quantityStep),
273
- Ct(
272
+ Ct(l.quantityStep),
273
+ St(
274
274
  +G(
275
275
  l.minimumQuantity ?? {
276
276
  amount: 1,
277
277
  // NOTE: leave this reading from row.sku.unit and row.measurement instead,
278
- precision: re(l.sku.unit, l.measurement)
278
+ precision: ie(l.sku.unit, l.measurement)
279
279
  }
280
280
  )
281
281
  ),
282
- St(
282
+ Mt(
283
283
  l.maximumQuantity ? +G(l.maximumQuantity) : 1 / 0
284
284
  ),
285
- function(I) {
286
- return F ? "This item is no longer valid due to change in unit. Please reapply unit." : !0;
285
+ function(O) {
286
+ return T ? "This item is no longer valid due to change in unit. Please reapply unit." : !0;
287
287
  }
288
288
  ],
289
289
  applyDefaultRules: !0
@@ -298,7 +298,7 @@ function Nt(y) {
298
298
  minSize: 280,
299
299
  cell(i) {
300
300
  const l = i.row.original;
301
- return J(Bt, {
301
+ return J(Et, {
302
302
  style: {
303
303
  flex: "1 1 0%"
304
304
  },
@@ -314,12 +314,12 @@ function Nt(y) {
314
314
  d != null && d.min ? k.minimumQuantity = d.min : k.minimumQuantity = null, d != null && d.max ? k.maximumQuantity = d.max : k.maximumQuantity = null, y.updateItem(k);
315
315
  },
316
316
  rules: [
317
- Et({ max: !1 }),
318
- qt(l.quantityStep),
319
- Ut(
317
+ Ut({ max: !1 }),
318
+ Nt(l.quantityStep),
319
+ qt(
320
320
  +G({
321
321
  amount: 0,
322
- precision: re(l.sku.unit, l.measurement)
322
+ precision: ie(l.sku.unit, l.measurement)
323
323
  }),
324
324
  1 / 0
325
325
  )
@@ -331,11 +331,11 @@ function Nt(y) {
331
331
  },
332
332
  {
333
333
  id: "Step",
334
- header: () => x("inventory.transfer.form.items.table.Step"),
334
+ header: () => _("inventory.transfer.form.items.table.Step"),
335
335
  minSize: 100,
336
336
  cell(i) {
337
337
  const l = i.row.original;
338
- return J(ae.FmTextField, {
338
+ return J(re.FmTextField, {
339
339
  modelValue: G(l.quantityStep ?? Re.reset(), !1),
340
340
  key: l.sku._id,
341
341
  "onUpdate:modelValue": (d) => {
@@ -347,7 +347,7 @@ function Nt(y) {
347
347
  rules: [
348
348
  de({
349
349
  amount: 1,
350
- precision: re(l.sku.unit, l.measurement)
350
+ precision: ie(l.sku.unit, l.measurement)
351
351
  }),
352
352
  it(l.sku.unit, l.measurement)
353
353
  ]
@@ -360,7 +360,7 @@ function Nt(y) {
360
360
  header: "",
361
361
  cell(i) {
362
362
  const l = i.row.original;
363
- return J(ae.FmButton, {
363
+ return J(re.FmButton, {
364
364
  class: "delete-button",
365
365
  key: l.sku._id,
366
366
  type: "button",
@@ -385,22 +385,22 @@ function Nt(y) {
385
385
  columnDefs: R(() => je().enableTotalCost && y.transferType === H.PURCHASE ? m : m.filter((l) => l.id !== "Cost"))
386
386
  };
387
387
  }
388
- const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-center" }, jt = { class: "flex-1 flex gap-1 items-center" }, Qt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Kt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Gt = { class: "flex gap-8 w-full" }, Wt = { class: "flex-1 flex flex-col gap-4" }, Jt = { class: "flex-1 flex flex-col gap-4" }, Zt = { class: "flex gap-8 w-full" }, Xt = { class: "flex-1 flex flex-col gap-4" }, Yt = { class: "flex-1 flex flex-col gap-4" }, eo = { class: "flex gap-8 w-full" }, to = { class: "flex-1 flex flex-col gap-4" }, oo = /* @__PURE__ */ Z({
388
+ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-center" }, Qt = { class: "flex-1 flex gap-1 items-center" }, Kt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Gt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Wt = { class: "flex gap-8 w-full" }, Jt = { class: "flex-1 flex flex-col gap-4" }, Zt = { class: "flex-1 flex flex-col gap-4" }, Xt = { class: "flex gap-8 w-full" }, Yt = { class: "flex-1 flex flex-col gap-4" }, eo = { class: "flex-1 flex flex-col gap-4" }, to = { class: "flex gap-8 w-full" }, oo = { class: "flex-1 flex flex-col gap-4" }, so = /* @__PURE__ */ X({
389
389
  __name: "TransferTemplateItem",
390
390
  props: {
391
391
  cellByColId: {},
392
392
  row: {}
393
393
  },
394
394
  setup(y) {
395
- const { t: x } = X();
396
- return (u, o) => {
397
- var C, i, l, d, k, h, A, F, v, g, I, B, p, r, b, a, f, w, s, n, S, $, M, _, P, U, N, j, T, z;
395
+ const { t: _ } = Y();
396
+ return (u, s) => {
397
+ var C, i, l, d, k, g, A, T, v, F, O, E, p, r, b, a, f, w, o, n, S, $, M, h, P, q, z, j, x, N;
398
398
  const m = V("FmLabel");
399
- return D(), K("div", zt, [
400
- t("div", Ht, [
401
- t("div", jt, [
402
- t("span", Qt, " (" + O(u.row.original.sku.code) + ") ", 1),
403
- t("span", Kt, O(u.row.original.sku.name), 1)
399
+ return D(), K("div", Ht, [
400
+ t("div", jt, [
401
+ t("div", Qt, [
402
+ t("span", Kt, " (" + I(u.row.original.sku.code) + ") ", 1),
403
+ t("span", Gt, I(u.row.original.sku.name), 1)
404
404
  ]),
405
405
  t("div", null, [
406
406
  c(e(Q), {
@@ -409,162 +409,162 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
409
409
  }, null, 8, ["render", "props"])
410
410
  ])
411
411
  ]),
412
- t("div", Gt, [
413
- t("div", Wt, [
412
+ t("div", Wt, [
413
+ t("div", Jt, [
414
414
  c(m, {
415
- label: e(x)(`inventory.transfer.form.items.table.${e(L).Code}`)
415
+ label: e(_)(`inventory.transfer.form.items.table.${e(L).Code}`)
416
416
  }, null, 8, ["label"]),
417
417
  c(e(Q), {
418
- render: (F = (A = (h = u.cellByColId[e(L).Code]) == null ? void 0 : h.column) == null ? void 0 : A.columnDef) == null ? void 0 : F.cell,
419
- props: (g = (v = u.cellByColId[e(L).Code]) == null ? void 0 : v.getContext) == null ? void 0 : g.call(v)
418
+ render: (T = (A = (g = u.cellByColId[e(L).Code]) == null ? void 0 : g.column) == null ? void 0 : A.columnDef) == null ? void 0 : T.cell,
419
+ props: (F = (v = u.cellByColId[e(L).Code]) == null ? void 0 : v.getContext) == null ? void 0 : F.call(v)
420
420
  }, null, 8, ["render", "props"]),
421
- o[0] || (o[0] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
421
+ s[0] || (s[0] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
422
422
  ]),
423
- t("div", Jt, [
423
+ t("div", Zt, [
424
424
  c(m, {
425
- label: e(x)(`inventory.transfer.form.items.table.${e(L).Name}`)
425
+ label: e(_)(`inventory.transfer.form.items.table.${e(L).Name}`)
426
426
  }, null, 8, ["label"]),
427
427
  c(e(Q), {
428
- render: (p = (B = (I = u.cellByColId[e(L).Name]) == null ? void 0 : I.column) == null ? void 0 : B.columnDef) == null ? void 0 : p.cell,
428
+ render: (p = (E = (O = u.cellByColId[e(L).Name]) == null ? void 0 : O.column) == null ? void 0 : E.columnDef) == null ? void 0 : p.cell,
429
429
  props: (b = (r = u.cellByColId[e(L).Name]) == null ? void 0 : r.getContext) == null ? void 0 : b.call(r)
430
430
  }, null, 8, ["render", "props"]),
431
- o[1] || (o[1] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
431
+ s[1] || (s[1] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
432
432
  ])
433
433
  ]),
434
- t("div", Zt, [
435
- t("div", Xt, [
434
+ t("div", Xt, [
435
+ t("div", Yt, [
436
436
  c(m, {
437
- label: e(x)(`inventory.transfer.form.items.table.${e(L).DefaultAmount}`)
437
+ label: e(_)(`inventory.transfer.form.items.table.${e(L).DefaultAmount}`)
438
438
  }, null, 8, ["label"]),
439
439
  c(e(Q), {
440
440
  render: (w = (f = (a = u.cellByColId[e(L).DefaultAmount]) == null ? void 0 : a.column) == null ? void 0 : f.columnDef) == null ? void 0 : w.cell,
441
- props: (n = (s = u.cellByColId[e(L).DefaultAmount]) == null ? void 0 : s.getContext) == null ? void 0 : n.call(s)
441
+ props: (n = (o = u.cellByColId[e(L).DefaultAmount]) == null ? void 0 : o.getContext) == null ? void 0 : n.call(o)
442
442
  }, null, 8, ["render", "props"]),
443
- o[2] || (o[2] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
443
+ s[2] || (s[2] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
444
444
  ]),
445
- t("div", Yt, [
445
+ t("div", eo, [
446
446
  c(m, {
447
- label: e(x)(`inventory.transfer.form.items.table.${e(L).Step}`)
447
+ label: e(_)(`inventory.transfer.form.items.table.${e(L).Step}`)
448
448
  }, null, 8, ["label"]),
449
449
  c(e(Q), {
450
450
  render: (M = ($ = (S = u.cellByColId[e(L).Step]) == null ? void 0 : S.column) == null ? void 0 : $.columnDef) == null ? void 0 : M.cell,
451
- props: (P = (_ = u.cellByColId[e(L).Step]) == null ? void 0 : _.getContext) == null ? void 0 : P.call(_)
451
+ props: (P = (h = u.cellByColId[e(L).Step]) == null ? void 0 : h.getContext) == null ? void 0 : P.call(h)
452
452
  }, null, 8, ["render", "props"]),
453
- o[3] || (o[3] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
453
+ s[3] || (s[3] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
454
454
  ])
455
455
  ]),
456
- t("div", eo, [
457
- t("div", to, [
456
+ t("div", to, [
457
+ t("div", oo, [
458
458
  c(m, {
459
- label: e(x)(`inventory.transfer.form.items.table.${e(L).Limit}`)
459
+ label: e(_)(`inventory.transfer.form.items.table.${e(L).Limit}`)
460
460
  }, null, 8, ["label"]),
461
461
  c(e(Q), {
462
- render: (j = (N = (U = u.cellByColId[e(L).Limit]) == null ? void 0 : U.column) == null ? void 0 : N.columnDef) == null ? void 0 : j.cell,
463
- props: (z = (T = u.cellByColId[e(L).Limit]) == null ? void 0 : T.getContext) == null ? void 0 : z.call(T)
462
+ render: (j = (z = (q = u.cellByColId[e(L).Limit]) == null ? void 0 : q.column) == null ? void 0 : z.columnDef) == null ? void 0 : j.cell,
463
+ props: (N = (x = u.cellByColId[e(L).Limit]) == null ? void 0 : x.getContext) == null ? void 0 : N.call(x)
464
464
  }, null, 8, ["render", "props"]),
465
- o[4] || (o[4] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
465
+ s[4] || (s[4] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
466
466
  ])
467
467
  ])
468
468
  ]);
469
469
  };
470
470
  }
471
- }), so = { class: "flex flex-col gap-16" }, lo = { class: "flex flex-col gap-24" }, no = { class: "flex flex-col gap-16" }, ao = { class: "flex items-center" }, ro = { class: "flex flex-col" }, io = { class: "flex flex-col gap-16" }, uo = { class: "flex" }, mo = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, co = /* @__PURE__ */ Z({
471
+ }), lo = { class: "flex flex-col gap-16" }, no = { class: "flex flex-col gap-24" }, ao = { class: "flex flex-col gap-16" }, ro = { class: "flex items-center" }, io = { class: "flex flex-col" }, uo = { class: "flex flex-col gap-16" }, mo = { class: "flex" }, co = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, po = /* @__PURE__ */ X({
472
472
  __name: "TransferTemplateForm",
473
473
  props: {
474
474
  modelValue: {},
475
475
  disabled: { type: Boolean }
476
476
  },
477
- setup(y, { expose: x }) {
478
- const u = y, o = Ne(), { t: m } = X(), C = Qe(), i = He(), l = Ot(), d = ze();
477
+ setup(y, { expose: _ }) {
478
+ const u = y, s = Ne(), { t: m } = Y(), C = Qe(), i = He(), l = Vt(), d = ze();
479
479
  pe(
480
480
  () => u.modelValue,
481
- (s) => {
482
- console.log("TransferTemplateForm.model", s);
481
+ (o) => {
482
+ console.log("TransferTemplateForm.model", o);
483
483
  }
484
484
  ), C.watchLocation(async () => {
485
- location && (o.purchaseOrder.supplier || (o.purchaseOrder.supplier = l.suppliers.find((s) => s) ?? o.purchaseOrder.supplier));
485
+ location && (s.purchaseOrder.supplier || (s.purchaseOrder.supplier = l.suppliers.find((o) => o) ?? s.purchaseOrder.supplier));
486
486
  });
487
- const k = gt(), h = $t(
488
- () => o.purchaseOrder,
489
- (s) => {
490
- o.purchaseOrder = {
491
- ...o.purchaseOrder,
492
- supplier: s.supplier ?? (o == null ? void 0 : o.purchaseOrder.supplier)
487
+ const k = Tt(), g = It(
488
+ () => s.purchaseOrder,
489
+ (o) => {
490
+ s.purchaseOrder = {
491
+ ...s.purchaseOrder,
492
+ supplier: o.supplier ?? (s == null ? void 0 : s.purchaseOrder.supplier)
493
493
  };
494
494
  }
495
495
  ), A = R({
496
496
  get() {
497
- var s, n;
498
- return typeof ((n = (s = o.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : n.internal) == "string" ? H.TRANSFER : H.PURCHASE;
497
+ var o, n;
498
+ return typeof ((n = (o = s.purchaseOrder) == null ? void 0 : o.supplier) == null ? void 0 : n.internal) == "string" ? H.TRANSFER : H.PURCHASE;
499
499
  },
500
- set(s) {
500
+ set(o) {
501
501
  var S, $;
502
- const n = typeof (($ = (S = o.purchaseOrder) == null ? void 0 : S.supplier) == null ? void 0 : $.internal) == "string" ? H.TRANSFER : H.PURCHASE;
503
- s !== n && (o.purchaseOrder.supplier = s === H.PURCHASE ? h.locationOptionsTypePurchase.value[0] : h.locationOptionsTypeTransfer.value[0]);
502
+ const n = typeof (($ = (S = s.purchaseOrder) == null ? void 0 : S.supplier) == null ? void 0 : $.internal) == "string" ? H.TRANSFER : H.PURCHASE;
503
+ o !== n && (s.purchaseOrder.supplier = o === H.PURCHASE ? g.locationOptionsTypePurchase.value[0] : g.locationOptionsTypeTransfer.value[0]);
504
504
  }
505
- }), F = R(() => h.transferLocationOptions.value), v = R({
505
+ }), T = R(() => g.transferLocationOptions.value), v = R({
506
506
  get() {
507
- var s;
508
- return (s = o.purchaseOrder.supplier) == null ? void 0 : s._id;
507
+ var o;
508
+ return (o = s.purchaseOrder.supplier) == null ? void 0 : o._id;
509
509
  },
510
- set(s) {
511
- h.transferLocationModel.value = s;
510
+ set(o) {
511
+ g.transferLocationModel.value = o;
512
512
  }
513
513
  }), {
514
- promptSelectLocations: g,
515
- columnDefs: I,
516
- rowData: B
514
+ promptSelectLocations: F,
515
+ columnDefs: O,
516
+ rowData: E
517
517
  } = ut({
518
518
  getLocations() {
519
- return o.locations;
519
+ return s.locations;
520
520
  },
521
- setLocations(s) {
522
- o.locations = s;
521
+ setLocations(o) {
522
+ s.locations = o;
523
523
  }
524
524
  });
525
525
  function p() {
526
- var s, n;
527
- return (s = o.locations) != null && s.find((S) => {
526
+ var o, n;
527
+ return (o = s.locations) != null && o.find((S) => {
528
528
  var $, M;
529
- return (($ = S.doc) == null ? void 0 : $._id) === ((M = o.purchaseOrder.supplier) == null ? void 0 : M._id);
530
- }) ? `Location ${(n = o.purchaseOrder.supplier) == null ? void 0 : n.name} must be removed because template cannot be used to transfer to itself.` : !0;
529
+ return (($ = S.doc) == null ? void 0 : $._id) === ((M = s.purchaseOrder.supplier) == null ? void 0 : M._id);
530
+ }) ? `Location ${(n = s.purchaseOrder.supplier) == null ? void 0 : n.name} must be removed because template cannot be used to transfer to itself.` : !0;
531
531
  }
532
532
  const r = R({
533
533
  get() {
534
- return o.purchaseOrder.remark ?? void 0;
534
+ return s.purchaseOrder.remark ?? void 0;
535
535
  },
536
- set(s) {
537
- o.purchaseOrder.remark = s;
536
+ set(o) {
537
+ s.purchaseOrder.remark = o;
538
538
  }
539
- }), b = E();
540
- x({
539
+ }), b = U();
540
+ _({
541
541
  validateInputs: () => {
542
- var s, n;
543
- (n = (s = b.value) == null ? void 0 : s.validateInputs) == null || n.call(s);
542
+ var o, n;
543
+ (n = (o = b.value) == null ? void 0 : o.validateInputs) == null || n.call(o);
544
544
  },
545
545
  resetInputsValidation: () => {
546
- var s, n;
547
- (n = (s = b.value) == null ? void 0 : s.resetInputsValidation) == null || n.call(s);
546
+ var o, n;
547
+ (n = (o = b.value) == null ? void 0 : o.resetInputsValidation) == null || n.call(o);
548
548
  },
549
549
  resetInputs: () => {
550
- var s, n;
551
- (n = (s = b.value) == null ? void 0 : s.resetInputs) == null || n.call(s);
550
+ var o, n;
551
+ (n = (o = b.value) == null ? void 0 : o.resetInputs) == null || n.call(o);
552
552
  }
553
553
  });
554
- const a = Nt({
555
- updateItem: (s) => {
556
- o.purchaseOrder.items = o.purchaseOrder.items.map((n) => n.sku._id !== s.sku._id ? n : s);
554
+ const a = zt({
555
+ updateItem: (o) => {
556
+ s.purchaseOrder.items = s.purchaseOrder.items.map((n) => n.sku._id !== o.sku._id ? n : o);
557
557
  },
558
- deleteItem: (s) => {
559
- o.purchaseOrder.items = o.purchaseOrder.items.filter(
560
- (n) => n.sku._id !== s.sku._id
558
+ deleteItem: (o) => {
559
+ s.purchaseOrder.items = s.purchaseOrder.items.filter(
560
+ (n) => n.sku._id !== o.sku._id
561
561
  );
562
562
  },
563
563
  get supplier() {
564
- return o.purchaseOrder.supplier;
564
+ return s.purchaseOrder.supplier;
565
565
  },
566
566
  get items() {
567
- return o.purchaseOrder.items;
567
+ return s.purchaseOrder.items;
568
568
  },
569
569
  get transferType() {
570
570
  return H.PURCHASE;
@@ -574,21 +574,21 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
574
574
  }
575
575
  }), f = R(() => a.columnDefs.value);
576
576
  function w() {
577
- const s = i.skus.map((S) => ({
577
+ const o = i.skus.map((S) => ({
578
578
  label: S.name,
579
579
  sublabel: S.code,
580
580
  value: S
581
- })), n = s.filter((S) => {
581
+ })), n = o.filter((S) => {
582
582
  var $;
583
- return ($ = o.purchaseOrder.items) == null ? void 0 : $.find((M) => M.sku._id === S.value._id);
583
+ return ($ = s.purchaseOrder.items) == null ? void 0 : $.find((M) => M.sku._id === S.value._id);
584
584
  }).map((S) => S.value);
585
585
  k.open({
586
586
  title: m("inventory.transfer.form.items.selectItem"),
587
587
  closeButton: !0,
588
- contentComponent: mt,
588
+ contentComponent: dt,
589
589
  contentComponentProps: {
590
590
  modelValue: n,
591
- items: s,
591
+ items: o,
592
592
  virtualScroll: !0
593
593
  },
594
594
  primaryActions: {
@@ -601,126 +601,147 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
601
601
  variant: "tertiary"
602
602
  }
603
603
  }).onPrimary((S) => {
604
- const $ = o.purchaseOrder.items ?? [], M = S.map((_) => {
605
- const P = $.find((T) => T.sku._id === _._id);
604
+ const $ = s.purchaseOrder.items ?? [], M = S.map((h) => {
605
+ const P = $.find((x) => x.sku._id === h._id);
606
606
  if (P)
607
607
  return P;
608
- let U = _.code;
608
+ let q = h.code;
609
609
  if (d.isEnabled) {
610
- const T = d.getItemPKTCode(_);
611
- T && (U = T);
610
+ const x = d.getItemPKTCode(h);
611
+ x && (q = x);
612
612
  }
613
- const N = { amount: 1, precision: re(_.unit) };
613
+ const z = { amount: 1, precision: ie(h.unit) };
614
614
  return {
615
- sku: _,
616
- code: U,
617
- name: _.name,
618
- quantity: N,
619
- minimumQuantity: N,
620
- maximumQuantity: dt(N, {
615
+ sku: h,
616
+ code: q,
617
+ name: h.name,
618
+ quantity: z,
619
+ minimumQuantity: z,
620
+ maximumQuantity: ct(z, {
621
621
  amount: 100,
622
622
  precision: 0
623
623
  }),
624
- quantityStep: N
624
+ quantityStep: z
625
625
  };
626
626
  });
627
- M.sort((_, P) => _.sku.code.localeCompare(P.sku.code)), o.purchaseOrder.items = M;
627
+ M.sort((h, P) => h.sku.code.localeCompare(P.sku.code)), s.purchaseOrder.items = M;
628
628
  });
629
629
  }
630
- return (s, n) => {
631
- const S = V("FmTextField"), $ = V("FmSelect"), M = V("FmTextarea"), _ = V("FmButton"), P = V("FmTable"), U = V("FmFormGroup"), N = V("FmForm");
632
- return D(), W(N, {
630
+ return (o, n) => {
631
+ const S = V("FmTextField"), $ = V("FmSelect"), M = V("FmTextarea"), h = V("FmButton"), P = V("FmTable"), q = V("FmFormGroup"), z = V("FmForm");
632
+ return D(), W(z, {
633
633
  ref_key: "formRef",
634
634
  ref: b,
635
635
  class: "flex flex-col gap-32",
636
- disabled: s.disabled
636
+ disabled: o.disabled
637
637
  }, {
638
- default: q(() => {
638
+ default: B(() => {
639
639
  var j;
640
640
  return [
641
- t("div", so, [
642
- t("div", lo, [
641
+ t("div", lo, [
642
+ t("div", no, [
643
643
  c(S, {
644
644
  label: e(m)("inventory.transfer.form.name"),
645
645
  "label-mark": "required",
646
- modelValue: e(o).name,
647
- "onUpdate:modelValue": n[0] || (n[0] = (T) => e(o).name = T),
646
+ modelValue: e(s).name,
647
+ "onUpdate:modelValue": n[0] || (n[0] = (x) => e(s).name = x),
648
648
  rules: [e(me)()]
649
649
  }, null, 8, ["label", "modelValue", "rules"]),
650
650
  c($, {
651
651
  label: e(m)("inventory.transfer.form.type.title"),
652
652
  "model-value": A.value,
653
- "onUpdate:modelValue": n[1] || (n[1] = (T) => A.value = T),
653
+ "onUpdate:modelValue": n[1] || (n[1] = (x) => A.value = x),
654
654
  items: [
655
655
  {
656
656
  label: e(m)("inventory.transfer.form.type.purchase"),
657
657
  value: e(H).PURCHASE,
658
- disabled: !e(h).locationOptionsTypePurchase.value.length,
659
- sublabel: e(h).locationOptionsTypePurchase.value.length ? void 0 : e(m)("inventory.transfer.form.noSupplierAvailable")
658
+ disabled: !e(g).locationOptionsTypePurchase.value.length,
659
+ sublabel: e(g).locationOptionsTypePurchase.value.length ? void 0 : e(m)("inventory.transfer.form.noSupplierAvailable")
660
660
  },
661
661
  {
662
662
  label: e(m)("inventory.transfer.form.type.transfer"),
663
663
  value: e(H).TRANSFER,
664
- disabled: !e(h).locationOptionsTypeTransfer.value.length,
665
- sublabel: e(h).locationOptionsTypeTransfer.value.length ? void 0 : e(m)("inventory.transfer.form.noLocationAvailable")
664
+ disabled: !e(g).locationOptionsTypeTransfer.value.length,
665
+ sublabel: e(g).locationOptionsTypeTransfer.value.length ? void 0 : e(m)("inventory.transfer.form.noLocationAvailable")
666
666
  }
667
667
  ],
668
- rules: [e(de)(1)(F.value)]
669
- }, null, 8, ["label", "model-value", "items", "rules"]),
668
+ rules: [e(de)(1)(T.value)]
669
+ }, {
670
+ default: B(() => [
671
+ t("span", {
672
+ class: Z([
673
+ "line-clamp-1 fm-typo-en-body-lg-400",
674
+ o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
675
+ ])
676
+ }, I(e(mt)(A.value)), 3)
677
+ ]),
678
+ _: 1
679
+ }, 8, ["label", "model-value", "items", "rules"]),
670
680
  c($, {
671
681
  label: A.value === e(H).PURCHASE ? e(m)("inventory.transfer.form.purchaseFrom") : e(m)("inventory.transfer.form.transferFrom"),
672
682
  modelValue: v.value,
673
- "onUpdate:modelValue": n[2] || (n[2] = (T) => v.value = T),
674
- items: F.value
683
+ "onUpdate:modelValue": n[2] || (n[2] = (x) => v.value = x),
684
+ items: T.value
675
685
  }, {
676
- "menu-wrapper": q((T) => {
677
- var z;
686
+ "menu-wrapper": B((x) => {
687
+ var N;
678
688
  return [
679
- c(It, Ee(T, {
680
- items: F.value,
681
- "model-value": (z = s.modelValue.purchaseOrder.supplier) == null ? void 0 : z._id
689
+ c(Ot, Ee(x, {
690
+ items: T.value,
691
+ "model-value": (N = o.modelValue.purchaseOrder.supplier) == null ? void 0 : N._id
682
692
  }), null, 16, ["items", "model-value"])
683
693
  ];
684
694
  }),
695
+ default: B(() => {
696
+ var x;
697
+ return [
698
+ t("span", {
699
+ class: Z([
700
+ "line-clamp-1 fm-typo-en-body-lg-400",
701
+ o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
702
+ ])
703
+ }, I((x = T.value.find((N) => N.value === v.value)) == null ? void 0 : x.label), 3)
704
+ ];
705
+ }),
685
706
  _: 1
686
707
  }, 8, ["label", "modelValue", "items"]),
687
708
  c(S, {
688
709
  label: e(m)("inventory.transfer.form.reference"),
689
710
  "label-mark": "optional",
690
- modelValue: e(o).purchaseOrder.ref,
691
- "onUpdate:modelValue": n[3] || (n[3] = (T) => e(o).purchaseOrder.ref = T)
711
+ modelValue: e(s).purchaseOrder.ref,
712
+ "onUpdate:modelValue": n[3] || (n[3] = (x) => e(s).purchaseOrder.ref = x)
692
713
  }, null, 8, ["label", "modelValue"]),
693
714
  c(M, {
694
715
  label: e(m)("inventory.transfer.form.remark"),
695
716
  "label-mark": "optional",
696
717
  "max-length": 240,
697
718
  modelValue: r.value,
698
- "onUpdate:modelValue": n[4] || (n[4] = (T) => r.value = T),
699
- class: ie({ "text-fm-color-typo-disabled": s.disabled })
719
+ "onUpdate:modelValue": n[4] || (n[4] = (x) => r.value = x),
720
+ class: Z({ "text-fm-color-typo-disabled": o.disabled })
700
721
  }, null, 8, ["label", "modelValue", "class"])
701
722
  ])
702
723
  ]),
703
- t("div", no, [
704
- t("div", ao, [
724
+ t("div", ao, [
725
+ t("div", ro, [
705
726
  n[6] || (n[6] = t("div", { class: "flex-1 fm-typo-en-title-sm-600" }, "Locations", -1)),
706
- c(_, {
707
- disabled: s.disabled,
727
+ c(h, {
728
+ disabled: o.disabled,
708
729
  label: "Select location",
709
730
  "prepend-icon": "add",
710
731
  variant: "plain",
711
732
  class: "border-2 rounded-lg border-fm-color-primary",
712
- onClick: e(g)
733
+ onClick: e(F)
713
734
  }, null, 8, ["disabled", "onClick"])
714
735
  ]),
715
736
  c(P, {
716
- "column-defs": e(I),
717
- "row-data": e(B),
737
+ "column-defs": e(O),
738
+ "row-data": e(E),
718
739
  "shrink-at": 9999,
719
- onRowClick: e(g),
740
+ onRowClick: e(F),
720
741
  "hide-footer": ""
721
742
  }, null, 8, ["column-defs", "row-data", "onRowClick"]),
722
- t("div", ro, [
723
- c(U, {
743
+ t("div", io, [
744
+ c(q, {
724
745
  "model-value": [
725
746
  (j = u.modelValue.purchaseOrder.supplier) == null ? void 0 : j._id,
726
747
  ...u.modelValue.locations ?? []
@@ -729,35 +750,35 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
729
750
  }, null, 8, ["model-value", "rules"])
730
751
  ])
731
752
  ]),
732
- t("div", io, [
733
- t("div", uo, [
734
- t("div", mo, O(e(m)("inventory.transfer.form.items.title")), 1),
735
- c(_, {
736
- disabled: s.disabled,
753
+ t("div", uo, [
754
+ t("div", mo, [
755
+ t("div", co, I(e(m)("inventory.transfer.form.items.title")), 1),
756
+ c(h, {
757
+ disabled: o.disabled,
737
758
  label: e(m)("inventory.transfer.form.items.addItem"),
738
759
  "prepend-icon": "add",
739
760
  variant: "plain",
740
761
  class: "border-2 rounded-lg border-fm-color-primary",
741
- onClick: n[5] || (n[5] = (T) => w()),
762
+ onClick: n[5] || (n[5] = (x) => w()),
742
763
  size: "md"
743
764
  }, null, 8, ["disabled", "label"])
744
765
  ]),
745
766
  (D(), W(P, {
746
767
  "column-defs": f.value,
747
- "row-data": e(o).purchaseOrder.items,
748
- key: e(o).purchaseOrder.items.map((T) => T.sku._id).join("."),
768
+ "row-data": e(s).purchaseOrder.items,
769
+ key: e(s).purchaseOrder.items.map((x) => x.sku._id).join("."),
749
770
  "hide-footer": "",
750
- "page-size": e(o).purchaseOrder.items.length
771
+ "page-size": e(s).purchaseOrder.items.length
751
772
  }, {
752
- "list-row": q((T) => [
773
+ "list-row": B((x) => [
753
774
  (D(), W(Ke, {
754
- row: T,
755
- key: e(o).purchaseOrder.items.map((z) => z.sku._id).join(".")
775
+ row: x,
776
+ key: e(s).purchaseOrder.items.map((N) => N.sku._id).join(".")
756
777
  }, {
757
- default: q((z) => [
758
- c(oo, {
759
- row: T,
760
- "cell-by-col-id": z
778
+ default: B((N) => [
779
+ c(so, {
780
+ row: x,
781
+ "cell-by-col-id": N
761
782
  }, null, 8, ["row", "cell-by-col-id"])
762
783
  ]),
763
784
  _: 2
@@ -765,8 +786,8 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
765
786
  ]),
766
787
  _: 1
767
788
  }, 8, ["column-defs", "row-data", "page-size"])),
768
- c(U, {
769
- "model-value": e(o).purchaseOrder.items.length,
789
+ c(q, {
790
+ "model-value": e(s).purchaseOrder.items.length,
770
791
  rules: [e(de)(1)]
771
792
  }, null, 8, ["model-value", "rules"])
772
793
  ])
@@ -776,7 +797,7 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
776
797
  }, 8, ["disabled"]);
777
798
  };
778
799
  }
779
- }), po = { class: "flex items-center" }, fo = { class: "fm-typo-en-title-md-800" }, yo = { class: "flex gap-4" }, vo = /* @__PURE__ */ Z({
800
+ }), fo = { class: "flex items-center" }, yo = { class: "fm-typo-en-title-md-800" }, vo = { class: "flex gap-4" }, bo = /* @__PURE__ */ X({
780
801
  __name: "TransferTemplateDialog",
781
802
  props: {
782
803
  mode: {},
@@ -784,9 +805,9 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
784
805
  show: { type: Boolean }
785
806
  },
786
807
  emits: ["update:show", "submitted"],
787
- setup(y, { expose: x, emit: u }) {
808
+ setup(y, { expose: _, emit: u }) {
788
809
  var b;
789
- const o = y, m = u, C = bt(), i = Tt(), { t: l } = X(), d = Ge(o, "show");
810
+ const s = y, m = u, C = xt(), i = Ft(), { t: l } = Y(), d = Ge(s, "show");
790
811
  function k() {
791
812
  return {
792
813
  _id: "",
@@ -817,134 +838,134 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
817
838
  }
818
839
  };
819
840
  }
820
- const h = E(o.modelValue ?? k()), A = E(((b = o.modelValue) == null ? void 0 : b._id) ?? `${Math.random()}`);
841
+ const g = U(s.modelValue ?? k()), A = U(((b = s.modelValue) == null ? void 0 : b._id) ?? `${Math.random()}`);
821
842
  pe(
822
- () => o.show,
843
+ () => s.show,
823
844
  (a) => {
824
845
  var f;
825
- a && (h.value = o.modelValue ?? k(), A.value = ((f = o.modelValue) == null ? void 0 : f._id) ?? `${Math.random()}`);
846
+ a && (g.value = s.modelValue ?? k(), A.value = ((f = s.modelValue) == null ? void 0 : f._id) ?? `${Math.random()}`);
826
847
  }
827
848
  );
828
- const F = E(!1), v = R(() => {
829
- switch (o.mode) {
830
- case ee.READ:
849
+ const T = U(!1), v = R(() => {
850
+ switch (s.mode) {
851
+ case te.READ:
831
852
  return "";
832
- case ee.CREATE:
853
+ case te.CREATE:
833
854
  return l("inventory.transfer.template.create.title");
834
- case ee.UPDATE:
855
+ case te.UPDATE:
835
856
  return l("inventory.transfer.template.update.title");
836
857
  }
837
858
  return "";
838
- }), g = E();
839
- x({
859
+ }), F = U();
860
+ _({
840
861
  validateInputs: () => {
841
862
  var a, f;
842
- (f = (a = g.value) == null ? void 0 : a.validateInputs) == null || f.call(a);
863
+ (f = (a = F.value) == null ? void 0 : a.validateInputs) == null || f.call(a);
843
864
  },
844
865
  resetInputsValidation: () => {
845
866
  var a, f;
846
- (f = (a = g.value) == null ? void 0 : a.resetInputsValidation) == null || f.call(a);
867
+ (f = (a = F.value) == null ? void 0 : a.resetInputsValidation) == null || f.call(a);
847
868
  },
848
869
  resetInputs: () => {
849
870
  var a, f;
850
- (f = (a = g.value) == null ? void 0 : a.resetInputs) == null || f.call(a);
871
+ (f = (a = F.value) == null ? void 0 : a.resetInputs) == null || f.call(a);
851
872
  }
852
873
  });
853
- async function I() {
874
+ async function O() {
854
875
  var f, w;
855
- const a = h.value;
876
+ const a = g.value;
856
877
  if (a) {
857
- F.value = !0, (((f = a.purchaseOrder.supplier) == null ? void 0 : f.internal) === ne.enum.warehouse || ((w = a.purchaseOrder.supplier) == null ? void 0 : w.internal) === ne.enum.restaurant) && (a.purchaseOrder.items = a.purchaseOrder.items.map(
858
- ({ totalCost: s, ...n }) => n
878
+ T.value = !0, (((f = a.purchaseOrder.supplier) == null ? void 0 : f.internal) === ae.enum.warehouse || ((w = a.purchaseOrder.supplier) == null ? void 0 : w.internal) === ae.enum.restaurant) && (a.purchaseOrder.items = a.purchaseOrder.items.map(
879
+ ({ totalCost: o, ...n }) => n
859
880
  ));
860
881
  try {
861
- await C.createTemplate(a), await new Promise((s) => setTimeout(s, 1e3)), i.open({
882
+ await C.createTemplate(a), await new Promise((o) => setTimeout(o, 1e3)), i.open({
862
883
  title: l("inventory.transfer.template.create.success"),
863
884
  message: l("inventory.transfer.template.create.successMessage"),
864
885
  type: "success"
865
886
  }), m("update:show", !1), m("submitted");
866
- } catch (s) {
887
+ } catch (o) {
867
888
  i.open({
868
889
  title: l("inventory.transfer.template.create.error"),
869
890
  message: l("inventory.transfer.template.create.errorMessage"),
870
891
  type: "error"
871
- }), console.error("Error in creating transfer template", s);
892
+ }), console.error("Error in creating transfer template", o);
872
893
  } finally {
873
- F.value = !1;
894
+ T.value = !1;
874
895
  }
875
896
  }
876
897
  }
877
- async function B() {
898
+ async function E() {
878
899
  var f, w;
879
- const a = h.value;
900
+ const a = g.value;
880
901
  if (a) {
881
- F.value = !0, (((f = a.purchaseOrder.supplier) == null ? void 0 : f.internal) === ne.enum.warehouse || ((w = a.purchaseOrder.supplier) == null ? void 0 : w.internal) === ne.enum.restaurant) && (a.purchaseOrder.items = a.purchaseOrder.items.map(
882
- ({ totalCost: s, ...n }) => n
902
+ T.value = !0, (((f = a.purchaseOrder.supplier) == null ? void 0 : f.internal) === ae.enum.warehouse || ((w = a.purchaseOrder.supplier) == null ? void 0 : w.internal) === ae.enum.restaurant) && (a.purchaseOrder.items = a.purchaseOrder.items.map(
903
+ ({ totalCost: o, ...n }) => n
883
904
  ));
884
905
  try {
885
- await C.updateTemplate(a), await new Promise((s) => setTimeout(s, 1e3)), i.open({
906
+ await C.updateTemplate(a), await new Promise((o) => setTimeout(o, 1e3)), i.open({
886
907
  title: l("inventory.transfer.template.update.success"),
887
908
  message: l("inventory.transfer.template.update.successMessage"),
888
909
  type: "success"
889
910
  }), m("update:show", !1), m("submitted");
890
- } catch (s) {
911
+ } catch (o) {
891
912
  i.open({
892
913
  title: l("inventory.transfer.template.update.error"),
893
914
  message: l("inventory.transfer.template.update.errorMessage"),
894
915
  type: "error"
895
- }), console.error("Error in updating transfer template", s);
916
+ }), console.error("Error in updating transfer template", o);
896
917
  } finally {
897
- F.value = !1;
918
+ T.value = !1;
898
919
  }
899
920
  }
900
921
  }
901
922
  function p() {
902
- switch (o.mode) {
903
- case ee.CREATE:
904
- return I();
905
- case ee.UPDATE:
906
- return B();
923
+ switch (s.mode) {
924
+ case te.CREATE:
925
+ return O();
926
+ case te.UPDATE:
927
+ return E();
907
928
  }
908
929
  }
909
930
  function r() {
910
931
  var a, f;
911
- (f = (a = g.value) == null ? void 0 : a.validateInputs) == null || f.call(a);
932
+ (f = (a = F.value) == null ? void 0 : a.validateInputs) == null || f.call(a);
912
933
  }
913
934
  return (a, f) => {
914
- const w = V("FmButton"), s = V("FmSideSheet");
915
- return D(), W(s, {
935
+ const w = V("FmButton"), o = V("FmSideSheet");
936
+ return D(), W(o, {
916
937
  modelValue: e(d),
917
938
  "onUpdate:modelValue": f[2] || (f[2] = (n) => Ue(d) ? d.value = n : null),
918
939
  "dismiss-away": "",
919
940
  "close-button": "",
920
941
  "max-width": 1200
921
942
  }, {
922
- "side-sheet-header": q(() => [
923
- t("div", po, [
924
- t("div", fo, O(v.value), 1)
943
+ "side-sheet-header": B(() => [
944
+ t("div", fo, [
945
+ t("div", yo, I(v.value), 1)
925
946
  ])
926
947
  ]),
927
- default: q(() => [
928
- (D(), W(co, {
948
+ default: B(() => [
949
+ (D(), W(po, {
929
950
  class: "w-full",
930
951
  ref_key: "formRef",
931
- ref: g,
952
+ ref: F,
932
953
  onValidationSuccess: p,
933
- "model-value": h.value,
934
- "onUpdate:modelValue": f[0] || (f[0] = (n) => h.value = n),
935
- disabled: F.value,
954
+ "model-value": g.value,
955
+ "onUpdate:modelValue": f[0] || (f[0] = (n) => g.value = n),
956
+ disabled: T.value,
936
957
  key: A.value
937
958
  }, null, 8, ["model-value", "disabled"]))
938
959
  ]),
939
- "side-sheet-footer": q(() => [
940
- t("div", yo, [
960
+ "side-sheet-footer": B(() => [
961
+ t("div", vo, [
941
962
  c(w, {
942
- loading: F.value,
963
+ loading: T.value,
943
964
  label: e(l)("common.save"),
944
965
  onClick: r
945
966
  }, null, 8, ["loading", "label"]),
946
967
  c(w, {
947
- disabled: F.value,
968
+ disabled: T.value,
948
969
  variant: "tertiary",
949
970
  label: e(l)("common.close"),
950
971
  onClick: f[1] || (f[1] = (n) => m("update:show", !1))
@@ -955,131 +976,131 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
955
976
  }, 8, ["modelValue"]);
956
977
  };
957
978
  }
958
- }), bo = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, xo = { class: "flex justify-between" }, _o = { class: "fm-typo-en-body-lg-600" }, ho = { class: "fm-status-badge fm-status-badge-info-secondary" }, go = { class: "flex flex-col gap-8" }, To = { class: "flex flex-col gap-4" }, Fo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wo = { class: "flex gap-1" }, ko = { class: "fm-typo-en-body-lg-600" }, Co = {
979
+ }), xo = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, _o = { class: "flex justify-between" }, ho = { class: "fm-typo-en-body-lg-600" }, go = { class: "fm-status-badge fm-status-badge-info-secondary" }, To = { class: "flex flex-col gap-8" }, Fo = { class: "flex flex-col gap-4" }, wo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ko = { class: "flex gap-1" }, Co = { class: "fm-typo-en-body-lg-600" }, So = {
959
980
  key: 0,
960
981
  class: "flex flex-col gap-4"
961
- }, So = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mo = { class: "fm-typo-en-body-lg-600" }, $o = {
982
+ }, Mo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $o = { class: "fm-typo-en-body-lg-600" }, Io = {
962
983
  key: 1,
963
984
  class: "flex flex-col gap-4"
964
- }, Io = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Oo = { class: "fm-typo-en-body-lg-600" }, Vo = {
985
+ }, Oo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vo = { class: "fm-typo-en-body-lg-600" }, Ao = {
965
986
  key: 2,
966
987
  class: "flex flex-col gap-4"
967
- }, Ao = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Do = { class: "fm-typo-en-body-lg-600" }, Ro = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Po = { class: "flex flex-col gap-8" }, Lo = { class: "fm-typo-en-body-lg-600" }, Bo = { class: "flex w-full gap-4" }, Eo = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, Uo = { class: "fm-typo-en-body-lg-600 shrink-0" }, qo = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, No = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, zo = {
988
+ }, Do = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ro = { class: "fm-typo-en-body-lg-600" }, Po = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Lo = { class: "flex flex-col gap-8" }, Bo = { class: "fm-typo-en-body-lg-600" }, Eo = { class: "flex w-full gap-4" }, Uo = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, qo = { class: "fm-typo-en-body-lg-600 shrink-0" }, No = { 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" }, Ho = {
968
989
  key: 0,
969
990
  class: "shrink-0 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
970
- }, Ho = {
991
+ }, jo = {
971
992
  key: 0,
972
993
  class: "flex gap-4 items-center"
973
- }, jo = { class: "flex flex-col gap-12" }, Qo = { class: "flex flex-col gap-8" }, Ko = { class: "flex gap-8 xs:flex-col" }, Go = /* @__PURE__ */ Z({
994
+ }, Qo = { class: "flex flex-col gap-12" }, Ko = { class: "flex flex-col gap-8" }, Go = { class: "flex gap-8 xs:flex-col" }, Wo = /* @__PURE__ */ X({
974
995
  __name: "TransferTemplateDetails",
975
996
  props: {
976
997
  template: {},
977
998
  show: { type: Boolean }
978
999
  },
979
1000
  emits: ["update:show", "action:edit"],
980
- setup(y, { emit: x }) {
981
- const u = y, o = x, m = je(), { t: C } = X(), i = R(() => {
982
- var F;
983
- return (F = u.template) == null ? void 0 : F.purchaseOrder;
1001
+ setup(y, { emit: _ }) {
1002
+ const u = y, s = _, m = je(), { t: C } = Y(), i = R(() => {
1003
+ var T;
1004
+ return (T = u.template) == null ? void 0 : T.purchaseOrder;
984
1005
  }), l = [
985
1006
  { accessorKey: "name", header: () => "Name" },
986
1007
  { accessorKey: "type", header: () => "Type" }
987
- ], d = E(""), k = R(
1008
+ ], d = U(""), k = R(
988
1009
  () => {
989
- var F, v, g, I;
990
- return ((v = (F = i.value) == null ? void 0 : F.supplier) == null ? void 0 : v.internal) === "restaurant" || ((I = (g = i.value) == null ? void 0 : g.supplier) == null ? void 0 : I.internal) === "warehouse" ? H.TRANSFER : H.PURCHASE;
1010
+ var T, v, F, O;
1011
+ return ((v = (T = i.value) == null ? void 0 : T.supplier) == null ? void 0 : v.internal) === "restaurant" || ((O = (F = i.value) == null ? void 0 : F.supplier) == null ? void 0 : O.internal) === "warehouse" ? H.TRANSFER : H.PURCHASE;
991
1012
  }
992
- ), h = E(!0), A = Ge(u, "show");
993
- return (F, v) => {
1013
+ ), g = U(!0), A = Ge(u, "show");
1014
+ return (T, v) => {
994
1015
  var f;
995
- const g = V("FmMenuDivider"), I = V("FmCard"), B = V("FmIcon"), p = V("FmTextField"), r = V("FmTable"), b = V("FmButton"), a = V("FmSideSheet");
1016
+ const F = V("FmMenuDivider"), O = V("FmCard"), E = V("FmIcon"), p = V("FmTextField"), r = V("FmTable"), b = V("FmButton"), a = V("FmSideSheet");
996
1017
  return D(), W(a, {
997
- header: e(C)("inventory.transfer.template.details.view", { template: (f = F.template) == null ? void 0 : f.name }),
1018
+ header: e(C)("inventory.transfer.template.details.view", { template: (f = T.template) == null ? void 0 : f.name }),
998
1019
  modelValue: e(A),
999
1020
  "onUpdate:modelValue": v[2] || (v[2] = (w) => Ue(A) ? A.value = w : null),
1000
- "dismiss-away": h.value,
1021
+ "dismiss-away": g.value,
1001
1022
  "close-button": "",
1002
1023
  "max-width": 500
1003
1024
  }, {
1004
- default: q(() => {
1005
- var w, s;
1025
+ default: B(() => {
1026
+ var w, o;
1006
1027
  return [
1007
- t("div", bo, [
1028
+ t("div", xo, [
1008
1029
  t("div", null, [
1009
- c(I, {
1030
+ c(O, {
1010
1031
  variant: "outlined",
1011
1032
  class: "flex flex-col gap-8 px-12 py-16"
1012
1033
  }, {
1013
- default: q(() => {
1014
- var n, S, $, M, _, P, U;
1034
+ default: B(() => {
1035
+ var n, S, $, M, h, P, q;
1015
1036
  return [
1016
- t("div", xo, [
1017
- t("div", _o, O(e(C)("inventory.transfer.template.details.templateSummary")), 1),
1018
- t("div", ho, O(e(C)(
1037
+ t("div", _o, [
1038
+ t("div", ho, I(e(C)("inventory.transfer.template.details.templateSummary")), 1),
1039
+ t("div", go, I(e(C)(
1019
1040
  `inventory.transfer.receiveRequest.details.type.${k.value.toLocaleLowerCase("en-US")}`
1020
1041
  )), 1)
1021
1042
  ]),
1022
- c(g),
1023
- t("div", go, [
1024
- t("div", To, [
1025
- t("div", Fo, [
1026
- t("div", wo, O(e(C)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1043
+ c(F),
1044
+ t("div", To, [
1045
+ t("div", Fo, [
1046
+ t("div", wo, [
1047
+ t("div", ko, I(e(C)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1027
1048
  ]),
1028
- t("div", ko, O(e(ct)(((n = F.template) == null ? void 0 : n._id) ?? "")), 1)
1049
+ t("div", Co, I(e(pt)(((n = T.template) == null ? void 0 : n._id) ?? "")), 1)
1029
1050
  ]),
1030
- ($ = (S = i.value) == null ? void 0 : S.supplier) != null && $.name ? (D(), K("div", Co, [
1031
- t("div", So, O(e(C)("inventory.transfer.receiveRequest.details.from")), 1),
1032
- t("div", Mo, O((_ = (M = i.value) == null ? void 0 : M.supplier) == null ? void 0 : _.name), 1)
1033
- ])) : Y("", !0),
1034
- (P = i.value) != null && P.ref ? (D(), K("div", $o, [
1035
- t("div", Io, O(e(C)("inventory.transfer.receiveRequest.details.reference")), 1),
1036
- t("div", Oo, O(i.value.ref), 1)
1037
- ])) : Y("", !0),
1038
- (U = i.value) != null && U.remark ? (D(), K("div", Vo, [
1039
- t("div", Ao, O(e(C)("inventory.transfer.receiveRequest.details.remark")), 1),
1040
- t("div", Do, O(i.value.remark), 1)
1041
- ])) : Y("", !0)
1051
+ ($ = (S = i.value) == null ? void 0 : S.supplier) != null && $.name ? (D(), K("div", So, [
1052
+ t("div", Mo, I(e(C)("inventory.transfer.receiveRequest.details.from")), 1),
1053
+ t("div", $o, I((h = (M = i.value) == null ? void 0 : M.supplier) == null ? void 0 : h.name), 1)
1054
+ ])) : ee("", !0),
1055
+ (P = i.value) != null && P.ref ? (D(), K("div", Io, [
1056
+ t("div", Oo, I(e(C)("inventory.transfer.receiveRequest.details.reference")), 1),
1057
+ t("div", Vo, I(i.value.ref), 1)
1058
+ ])) : ee("", !0),
1059
+ (q = i.value) != null && q.remark ? (D(), K("div", Ao, [
1060
+ t("div", Do, I(e(C)("inventory.transfer.receiveRequest.details.remark")), 1),
1061
+ t("div", Ro, I(i.value.remark), 1)
1062
+ ])) : ee("", !0)
1042
1063
  ])
1043
1064
  ];
1044
1065
  }),
1045
1066
  _: 1
1046
1067
  })
1047
1068
  ]),
1048
- t("div", Ro, [
1049
- t("div", Po, [
1050
- t("div", Lo, O(e(C)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
1069
+ t("div", Po, [
1070
+ t("div", Lo, [
1071
+ t("div", Bo, I(e(C)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
1051
1072
  (D(!0), K(qe, null, Xe(((w = i.value) == null ? void 0 : w.items) ?? [], (n) => (D(), K("div", {
1052
1073
  key: n.code,
1053
1074
  class: "flex flex-col"
1054
1075
  }, [
1055
- t("div", Bo, [
1056
- t("div", Eo, O(n.name), 1),
1076
+ t("div", Eo, [
1077
+ t("div", Uo, I(n.name), 1),
1057
1078
  v[3] || (v[3] = t("div", { class: "flex-1 min-w-32" }, null, -1)),
1058
- t("div", Uo, O(e(xt)(n.quantity, n.sku.unit, n.measurement)), 1)
1079
+ t("div", qo, I(e(_t)(n.quantity, n.sku.unit, n.measurement)), 1)
1059
1080
  ]),
1060
- t("div", qo, [
1061
- t("div", No, O(n.code), 1),
1062
- n.totalCost && e(m).enableTotalCost ? (D(), K("div", zo, " (" + O(e(pt)(n.totalCost)) + ") ", 1)) : Y("", !0)
1081
+ t("div", No, [
1082
+ t("div", zo, I(n.code), 1),
1083
+ n.totalCost && e(m).enableTotalCost ? (D(), K("div", Ho, " (" + I(e(ft)(n.totalCost)) + ") ", 1)) : ee("", !0)
1063
1084
  ]),
1064
- e(_t)(n) ? (D(), K("div", Ho, [
1065
- c(B, {
1085
+ e(ht)(n) ? (D(), K("div", jo, [
1086
+ c(E, {
1066
1087
  name: "error",
1067
1088
  color: "system-error-300",
1068
1089
  size: "sm"
1069
1090
  }),
1070
1091
  v[4] || (v[4] = t("div", { class: "fm-typo-en-body-sm-400 text-fm-color-system-error-400" }, " This item has invalid unit configuration. Apply update on this item. ", -1))
1071
- ])) : Y("", !0)
1092
+ ])) : ee("", !0)
1072
1093
  ]))), 128))
1073
1094
  ])
1074
1095
  ]),
1075
1096
  v[6] || (v[6] = t("div", null, null, -1)),
1076
1097
  v[7] || (v[7] = t("div", null, null, -1)),
1077
- t("div", jo, [
1098
+ t("div", Qo, [
1078
1099
  v[5] || (v[5] = t("div", { class: "flex flex-col" }, [
1079
1100
  t("div", { class: "fm-typo-en-body-lg-600" }, "Enabled locations"),
1080
1101
  t("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " This template is only usable for the following locations. ")
1081
1102
  ], -1)),
1082
- t("div", Qo, [
1103
+ t("div", Ko, [
1083
1104
  c(p, {
1084
1105
  modelValue: d.value,
1085
1106
  "onUpdate:modelValue": v[0] || (v[0] = (n) => d.value = n),
@@ -1091,18 +1112,18 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
1091
1112
  style: { height: "500px" },
1092
1113
  "column-defs": l,
1093
1114
  "search-value": d.value,
1094
- "row-data": ((s = u.template) == null ? void 0 : s.locations) ?? [{ name: "All locations" }]
1115
+ "row-data": ((o = u.template) == null ? void 0 : o.locations) ?? [{ name: "All locations" }]
1095
1116
  }, null, 8, ["search-value", "row-data"])
1096
1117
  ])
1097
1118
  ])
1098
1119
  ])
1099
1120
  ];
1100
1121
  }),
1101
- "side-sheet-footer": q(() => [
1102
- t("div", Ko, [
1122
+ "side-sheet-footer": B(() => [
1123
+ t("div", Go, [
1103
1124
  c(b, {
1104
1125
  label: e(C)("common.edit"),
1105
- onClick: v[1] || (v[1] = (w) => o("action:edit")),
1126
+ onClick: v[1] || (v[1] = (w) => s("action:edit")),
1106
1127
  variant: "tertiary"
1107
1128
  }, null, 8, ["label"])
1108
1129
  ])
@@ -1111,16 +1132,16 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
1111
1132
  }, 8, ["header", "modelValue", "dismiss-away"]);
1112
1133
  };
1113
1134
  }
1114
- }), Wo = { class: "flex-1 flex flex-col gap-8" }, Jo = { class: "flex flex-col" }, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Yo = { 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" }, ds = /* @__PURE__ */ Z({
1135
+ }), Jo = { class: "flex-1 flex flex-col gap-8" }, Zo = { class: "flex flex-col" }, Xo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, es = { class: "fm-typo-en-body-lg-400" }, ts = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, os = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, cs = /* @__PURE__ */ X({
1115
1136
  __name: "TransferTemplateView",
1116
1137
  setup(y) {
1117
- const { t: x } = X(), { createTemplate: u, viewTemplate: o, importTemplates: m, exportTemplates: C } = Le(), { templateDialogProps: i, templateDetailsProps: l } = Be(Le()), d = ht(), { loading: k, templates: h } = Be(d), A = E(!1), F = ft(), v = Qe(), { breakpoints: g } = Ft();
1138
+ const { t: _ } = Y(), { createTemplate: u, viewTemplate: s, importTemplates: m, exportTemplates: C } = Le(), { templateDialogProps: i, templateDetailsProps: l } = Be(Le()), d = gt(), { loading: k, templates: g } = Be(d), A = U(!1), T = yt(), v = Qe(), { breakpoints: F } = wt();
1118
1139
  ce(d.fetchTemplates);
1119
- const I = R(
1140
+ const O = R(
1120
1141
  () => A.value || k.value || !v._currentLocation
1121
- ), B = R(() => h.value), p = E(""), r = R(() => g.value.xs || g.value.sm), b = R(() => r.value ? 10 : 20);
1122
- function a(s) {
1123
- switch (s) {
1142
+ ), E = R(() => g.value), p = U(""), r = R(() => F.value.xs || F.value.sm), b = R(() => r.value ? 10 : 20);
1143
+ function a(o) {
1144
+ switch (o) {
1124
1145
  case Pe.Add:
1125
1146
  return u();
1126
1147
  case "refresh":
@@ -1131,12 +1152,12 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
1131
1152
  return C();
1132
1153
  }
1133
1154
  }
1134
- function f(s) {
1135
- return s;
1155
+ function f(o) {
1156
+ return o;
1136
1157
  }
1137
1158
  const w = R(() => [
1138
1159
  {
1139
- label: x("inventory.closing.template.create.title"),
1160
+ label: _("inventory.closing.template.create.title"),
1140
1161
  value: Pe.Add,
1141
1162
  isPrimary: !0,
1142
1163
  prependIcon: "add"
@@ -1157,19 +1178,19 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
1157
1178
  isPrimary: !1
1158
1179
  }
1159
1180
  ]);
1160
- return (s, n) => {
1181
+ return (o, n) => {
1161
1182
  const S = V("FmTable");
1162
1183
  return D(), K(qe, null, [
1163
- c(yt, {
1164
- title: e(x)("inventory.transfer.template.title2"),
1184
+ c(vt, {
1185
+ title: e(_)("inventory.transfer.template.title2"),
1165
1186
  actions: w.value,
1166
1187
  "onClick:action": a
1167
1188
  }, {
1168
- default: q(() => {
1189
+ default: B(() => {
1169
1190
  var $;
1170
1191
  return [
1171
1192
  t("div", {
1172
- class: ie([
1193
+ class: Z([
1173
1194
  "flex flex-col gap-8 max-h-full",
1174
1195
  {
1175
1196
  "p-0": r.value,
@@ -1177,62 +1198,62 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
1177
1198
  }
1178
1199
  ])
1179
1200
  }, [
1180
- c(vt, {
1201
+ c(bt, {
1181
1202
  searchable: "",
1182
1203
  search: p.value,
1183
1204
  "onUpdate:search": n[0] || (n[0] = (M) => p.value = M)
1184
1205
  }, null, 8, ["search"]),
1185
1206
  (D(), W(S, {
1186
- style: Ye(e(F).tableHeight),
1207
+ style: Ye(e(T).tableHeight),
1187
1208
  "column-defs": e(d).columnDefs,
1188
- "row-data": B.value,
1209
+ "row-data": E.value,
1189
1210
  "search-value": p.value,
1190
- loading: I.value,
1211
+ loading: O.value,
1191
1212
  key: ($ = e(v)._currentLocation) == null ? void 0 : $.dbName,
1192
- onRowClick: n[1] || (n[1] = (M) => e(o)(M.original)),
1213
+ onRowClick: n[1] || (n[1] = (M) => e(s)(M.original)),
1193
1214
  "page-size": b.value
1194
1215
  }, {
1195
- "list-row": q((M) => [
1216
+ "list-row": B((M) => [
1196
1217
  c(Ke, {
1197
1218
  row: M,
1198
- onRowClick: (_) => e(o)(_)
1219
+ onRowClick: (h) => e(s)(h)
1199
1220
  }, {
1200
- default: q((_) => {
1201
- var P, U, N, j, T, z, fe, ye, te, ve, be, xe, _e, oe, he, ge, Te, Fe, we, ke, se, Ce, Se, Me, $e, le, Ie;
1221
+ default: B((h) => {
1222
+ var P, q, z, j, x, N, fe, ye, oe, ve, be, xe, _e, se, he, ge, Te, Fe, we, ke, le, Ce, Se, Me, $e, ne, Ie;
1202
1223
  return [
1203
- t("div", Wo, [
1204
- t("div", Jo, [
1205
- t("div", Zo, [
1224
+ t("div", Jo, [
1225
+ t("div", Zo, [
1226
+ t("div", Xo, [
1206
1227
  c(e(Q), {
1207
- render: (N = (U = (P = _._id) == null ? void 0 : P.column) == null ? void 0 : U.columnDef) == null ? void 0 : N.cell,
1208
- props: (T = (j = _._id) == null ? void 0 : j.getContext) == null ? void 0 : T.call(j)
1228
+ render: (z = (q = (P = h._id) == null ? void 0 : P.column) == null ? void 0 : q.columnDef) == null ? void 0 : z.cell,
1229
+ props: (x = (j = h._id) == null ? void 0 : j.getContext) == null ? void 0 : x.call(j)
1209
1230
  }, null, 8, ["render", "props"])
1210
1231
  ]),
1211
- t("div", Xo, [
1232
+ t("div", Yo, [
1212
1233
  c(e(Q), {
1213
- render: (ye = (fe = (z = _.name) == null ? void 0 : z.column) == null ? void 0 : fe.columnDef) == null ? void 0 : ye.cell,
1214
- props: (ve = (te = _.name) == null ? void 0 : te.getContext) == null ? void 0 : ve.call(te)
1234
+ render: (ye = (fe = (N = h.name) == null ? void 0 : N.column) == null ? void 0 : fe.columnDef) == null ? void 0 : ye.cell,
1235
+ props: (ve = (oe = h.name) == null ? void 0 : oe.getContext) == null ? void 0 : ve.call(oe)
1215
1236
  }, null, 8, ["render", "props"])
1216
1237
  ]),
1217
- t("div", Yo, [
1238
+ t("div", es, [
1218
1239
  c(e(Q), {
1219
- render: (_e = (xe = (be = _.supplier) == null ? void 0 : be.column) == null ? void 0 : xe.columnDef) == null ? void 0 : _e.cell,
1220
- props: (he = (oe = _.supplier) == null ? void 0 : oe.getContext) == null ? void 0 : he.call(oe)
1240
+ render: (_e = (xe = (be = h.supplier) == null ? void 0 : be.column) == null ? void 0 : xe.columnDef) == null ? void 0 : _e.cell,
1241
+ props: (he = (se = h.supplier) == null ? void 0 : se.getContext) == null ? void 0 : he.call(se)
1221
1242
  }, null, 8, ["render", "props"])
1222
1243
  ]),
1223
- t("div", null, O((ge = M.original.locations) != null && ge.length ? `Enabled for ${(Te = M.original.locations) == null ? void 0 : Te.length} outlets` : "Enabled for all outlets"), 1),
1224
- t("div", es, O(M.original.purchaseOrder.items.length ? M.original.purchaseOrder.items.map((We) => We.name).join(", ") : "No items"), 1),
1225
- t("div", ts, [
1244
+ t("div", null, I((ge = M.original.locations) != null && ge.length ? `Enabled for ${(Te = M.original.locations) == null ? void 0 : Te.length} outlets` : "Enabled for all outlets"), 1),
1245
+ t("div", ts, I(M.original.purchaseOrder.items.length ? M.original.purchaseOrder.items.map((We) => We.name).join(", ") : "No items"), 1),
1246
+ t("div", os, [
1226
1247
  c(e(Q), {
1227
- render: (ke = (we = (Fe = _.ref) == null ? void 0 : Fe.column) == null ? void 0 : we.columnDef) == null ? void 0 : ke.cell,
1228
- props: (Ce = (se = _.ref) == null ? void 0 : se.getContext) == null ? void 0 : Ce.call(se)
1248
+ render: (ke = (we = (Fe = h.ref) == null ? void 0 : Fe.column) == null ? void 0 : we.columnDef) == null ? void 0 : ke.cell,
1249
+ props: (Ce = (le = h.ref) == null ? void 0 : le.getContext) == null ? void 0 : Ce.call(le)
1229
1250
  }, null, 8, ["render", "props"])
1230
1251
  ])
1231
1252
  ]),
1232
1253
  t("div", null, [
1233
1254
  c(e(Q), {
1234
- render: ($e = (Me = (Se = _.type) == null ? void 0 : Se.column) == null ? void 0 : Me.columnDef) == null ? void 0 : $e.cell,
1235
- props: (Ie = (le = _.type) == null ? void 0 : le.getContext) == null ? void 0 : Ie.call(le)
1255
+ render: ($e = (Me = (Se = h.type) == null ? void 0 : Se.column) == null ? void 0 : Me.columnDef) == null ? void 0 : $e.cell,
1256
+ props: (Ie = (ne = h.type) == null ? void 0 : ne.getContext) == null ? void 0 : Ie.call(ne)
1236
1257
  }, null, 8, ["render", "props"])
1237
1258
  ])
1238
1259
  ])
@@ -1249,8 +1270,8 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
1249
1270
  _: 1
1250
1271
  }, 8, ["title", "actions"]),
1251
1272
  (D(), W(et, { to: "body" }, [
1252
- c(Go, tt(ot(e(l))), null, 16),
1253
- c(vo, Ee(e(i), {
1273
+ c(Wo, tt(ot(e(l))), null, 16),
1274
+ c(bo, Ee(e(i), {
1254
1275
  onSubmitted: n[2] || (n[2] = ($) => e(d).fetchTemplates())
1255
1276
  }), null, 16)
1256
1277
  ]))
@@ -1259,5 +1280,5 @@ const zt = { class: "flex flex-col gap-8 py-16" }, Ht = { class: "flex items-cen
1259
1280
  }
1260
1281
  });
1261
1282
  export {
1262
- ds as default
1283
+ cs as default
1263
1284
  };