@feedmepos/mf-inventory-portal 1.0.7-dev.1 → 1.0.7

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 (95) hide show
  1. package/dist/{App-zspCOQeF.js → App-DF14rGlK.js} +49 -50
  2. package/dist/{ApprovalView-CKJV87es.js → ApprovalView-C_xhq-_c.js} +24 -24
  3. package/dist/{BindingsDialog-CTmuzAWi.js → BindingsDialog-CCY1fDj8.js} +4 -4
  4. package/dist/{BindingsPicker-Dabonsov.js → BindingsPicker-CnXbK5O3.js} +6 -6
  5. package/dist/{BindingsTable-L0yzAoQq.js → BindingsTable-cQIUUuVv.js} +8 -8
  6. package/dist/{ClosingDraftView-CddxqfNi.js → ClosingDraftView-DUZ31x3s.js} +463 -464
  7. package/dist/{ClosingTemplateView-BsW-nPec.js → ClosingTemplateView-6ysEDEcV.js} +10 -10
  8. package/dist/{DeliveryOrderPrintPreview-DQ4msDpJ.js → DeliveryOrderPrintPreview-BGjFS8h7.js} +1 -1
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-TnVI2vdF.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CanJ2fzb.js} +32 -32
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BRvXmLV6.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BcKtJQMt.js} +86 -86
  11. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BHLx7Lbo.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-Bb9xMoX-.js} +1 -1
  12. package/dist/{IngredientGroupView-CF2GLMSD.js → IngredientGroupView-i08KHlW7.js} +11 -11
  13. package/dist/{IngredientsView-DopQVz7u.js → IngredientsView-D0tBukwK.js} +14 -15
  14. package/dist/{IntegrationView-EnD2l7af.js → IntegrationView-BqCrKL13.js} +85 -86
  15. package/dist/{InventoryBindingForm-VP2_coNH.js → InventoryBindingForm-BJwIFQVS.js} +1 -1
  16. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-dQF7h_Jp.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DU9j1Q8M.js} +27 -27
  17. package/dist/{InventoryBindingSummary-BCEXzmFu.js → InventoryBindingSummary-B2M3Th8T.js} +1 -1
  18. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-RfkBlwxw.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BH4A_Lc5.js} +1 -1
  19. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CGgxjz4P.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CdxCyEBi.js} +10 -10
  20. package/dist/{PublishView-ExvxeKR_.js → PublishView-B9x92vDM.js} +7 -7
  21. package/dist/{PurchaseOrderPrintPreview-59AaXtZ_.js → PurchaseOrderPrintPreview-MbGDNmgh.js} +4 -4
  22. package/dist/{ReceiveRequestView-BxGss8gu.js → ReceiveRequestView-CTNycYUr.js} +52 -53
  23. package/dist/{RecipeView-BqTsG4xX.js → RecipeView-sHTcJgzP.js} +32 -32
  24. package/dist/{StockView-D-WvydHv.js → StockView-CUv4dcGJ.js} +72 -73
  25. package/dist/{SupplierView-C6ruAEih.js → SupplierView-hu6OhDss.js} +11 -12
  26. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CCKlQGMf.js +1746 -0
  27. package/dist/{TransferTemplateView-qSA3Txpn.js → TransferTemplateView-DMSkUc0D.js} +290 -291
  28. package/dist/{UnitView-oHDOLM8k.js → UnitView-B5q7IVbT.js} +23 -23
  29. package/dist/{WarehouseView-C3EqYfCf.js → WarehouseView-Ds6z4Vz6.js} +26 -26
  30. package/dist/api/bill.d.ts +2 -2
  31. package/dist/api/food-market-hub.d.ts +1 -1
  32. package/dist/api/inventory.d.ts +44 -44
  33. package/dist/api/netsuite.d.ts +3 -3
  34. package/dist/api/purchase-order.d.ts +1 -5
  35. package/dist/{app-DqrcGlGd.js → app-BmsY87Mv.js} +17641 -17171
  36. package/dist/app.d.ts +7 -7
  37. package/dist/app.js +1 -1
  38. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +8 -8
  39. package/dist/components/shell/inventory/binding-dialog.vue.d.ts +2 -2
  40. package/dist/components/shell/inventory/binding-ui.vue.d.ts +5 -5
  41. package/dist/{decimal-rgCB5DGy.js → decimal-Baw9w4_A.js} +1 -1
  42. package/dist/{format-unit-display-DUWzu8vU.js → format-unit-display-D0_KiU3j.js} +60 -60
  43. package/dist/{index-YgIaxVhw.js → index-CDydl7WA.js} +1 -1
  44. package/dist/{index-CH3OzDYK.js → index-C_GU5Tc8.js} +6 -7
  45. package/dist/{stock-BPNYXwz1.js → stock-C-hm8Kdq.js} +1 -1
  46. package/dist/stores/feature.d.ts +20 -3
  47. package/dist/stores/integration/foodmarkethub.d.ts +1 -1
  48. package/dist/stores/integration/netsuite.d.ts +7 -7
  49. package/dist/stores/inventory.d.ts +44 -44
  50. package/dist/stores/location.d.ts +137 -137
  51. package/dist/{supplier-CnrH580K.js → supplier-RX_yr24c.js} +4 -4
  52. package/dist/tsconfig.app.tsbuildinfo +1 -1
  53. package/dist/{use-ingredient-select-dialog-CpnJoeWb.js → use-ingredient-select-dialog-BZhczMUl.js} +1 -1
  54. package/dist/{use-inventory-binding-dialog-DHvNwt_F.js → use-inventory-binding-dialog-dV-92pLe.js} +1 -1
  55. package/dist/views/adjustment-template/wastage-template/actions.d.ts +228 -228
  56. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +2 -2
  57. package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +1 -1
  58. package/dist/views/adjustment-template/wastage-template/table.d.ts +234 -234
  59. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +68 -68
  60. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +408 -408
  61. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +4 -4
  62. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +252 -252
  63. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +252 -252
  64. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +12 -12
  65. package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +2 -2
  66. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +8 -8
  67. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +3 -3
  68. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +4 -4
  69. package/dist/views/integration/components/ApplyProduct.vue.d.ts +2 -2
  70. package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +2 -2
  71. package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +2 -2
  72. package/dist/views/integration/components/netsuite/AddLocationDialog.vue.d.ts +204 -204
  73. package/dist/views/integration/components/netsuite/LocationConfigurationDialog.vue.d.ts +2 -2
  74. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +647 -675
  75. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +22 -22
  76. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +44 -44
  77. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +11 -11
  78. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +1146 -1194
  79. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +1170 -1218
  80. package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +2 -2
  81. package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
  82. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +14 -14
  83. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +22 -22
  84. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +17 -17
  85. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +11 -11
  86. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +813 -813
  87. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +813 -813
  88. package/dist/views/transfer-template/composables/useTransferTemplateHelper.d.ts +33 -33
  89. package/dist/{vue-i18n-4m7yAqU2.js → vue-i18n-sbHu6D5a.js} +426 -426
  90. package/package.json +3 -5
  91. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CQ-Om_rI.js +0 -1894
  92. package/dist/composable/usePromise.d.ts +0 -41
  93. package/dist/feature-CifIpcNk.js +0 -17345
  94. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +0 -614
  95. package/dist/views/receive-request/constants/po-action-to-ui-style.d.ts +0 -6
@@ -1,15 +1,14 @@
1
- import { defineComponent as ee, onMounted as ve, computed as U, ref as Q, watch as be, inject as et, resolveComponent as A, openBlock as R, createElementBlock as j, createElementVNode as s, createVNode as p, withCtx as N, renderSlot as Re, withDirectives as Ae, normalizeClass as X, vModelText as Pe, reactive as tt, h as Z, toDisplayString as D, unref as t, createCommentVNode as oe, Fragment as _e, renderList as ze, normalizeStyle as He, createBlock as J, mergeProps as Qe, isRef as je, Teleport as st, normalizeProps as ot, guardReactiveProps as lt } from "vue";
2
- import { G as Ke, ay as ce, t as Ue, I as nt, az as at, aA as rt, i as Y, aB as it, b as ut, a as Ge, $ as Be, l as fe, P as me, K as ue, A as ye, M as dt, E as W, u as We, ac as mt, V as pt, C as Ye, d as ne, aC as de, a9 as ct, a1 as ft, z as yt, h as Le, _ as vt, B as bt } from "./app-DqrcGlGd.js";
3
- import { useI18n as le } from "@feedmepos/mf-common";
4
- import { P as G, a as _t, f as ht, t as xt, b as qe, u as gt } from "./format-unit-display-DUWzu8vU.js";
5
- import { components as se, useDialog as kt, useSnackbar as Tt, useProxiedModel as Ze, useBreakpoints as wt } from "@feedmepos/ui-library";
1
+ import { defineComponent as ee, onMounted as ve, computed as U, ref as Q, watch as be, inject as et, resolveComponent as A, openBlock as R, createElementBlock as j, createElementVNode as s, createVNode as p, withCtx as N, renderSlot as Re, withDirectives as Ae, normalizeClass as Y, vModelText as Pe, reactive as tt, h as J, toDisplayString as V, unref as t, createCommentVNode as oe, Fragment as _e, renderList as ze, normalizeStyle as He, createBlock as X, mergeProps as Qe, isRef as je, Teleport as st, normalizeProps as ot, guardReactiveProps as nt } from "vue";
2
+ import { H as We, az as ce, t as Ue, I as lt, aA as at, aB as rt, j as Z, aC as it, b as ut, a as Ge, a0 as Le, m as fe, Q as me, L as ue, A as ye, M as dt, c as pe, G as K, u as Ke, ad as mt, W as pt, E as Ze, e as le, aD as de, aa as ct, a2 as ft, B as yt, i as Be, _ as vt, C as bt } from "./app-BmsY87Mv.js";
3
+ import { useI18n as ne } from "@feedmepos/mf-common";
4
+ import { P as G, a as _t, f as xt, t as ht, b as qe, u as gt } from "./format-unit-display-D0_KiU3j.js";
5
+ import { components as se, useDialog as kt, useSnackbar as Tt, useProxiedModel as Je, useBreakpoints as wt } from "@feedmepos/ui-library";
6
6
  import { defineStore as Ft, storeToRefs as Ee } from "pinia";
7
- import { _ as It, b as St, F as Ct, a as $t } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BRvXmLV6.js";
8
- import { u as pe } from "./feature-CifIpcNk.js";
9
- import { c as Ot, u as Mt, _ as Vt } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-TnVI2vdF.js";
10
- import { u as Dt } from "./supplier-CnrH580K.js";
11
- import { u as Rt } from "./use-ingredient-select-dialog-CpnJoeWb.js";
12
- const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { class: "flex-1" }, Bt = { class: "flex items-center" }, Lt = { class: "flex-1" }, qt = { class: "flex-1" }, Et = /* @__PURE__ */ ee({
7
+ import { _ as It, b as St, F as Ct, a as $t } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BcKtJQMt.js";
8
+ import { c as Ot, u as Mt, _ as Dt } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CanJ2fzb.js";
9
+ import { u as Vt } from "./supplier-RX_yr24c.js";
10
+ import { u as Rt } from "./use-ingredient-select-dialog-BZhczMUl.js";
11
+ const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { class: "flex-1" }, Lt = { class: "flex items-center" }, Bt = { class: "flex-1" }, qt = { class: "flex-1" }, Et = /* @__PURE__ */ ee({
13
12
  __name: "FmMinMaxInput",
14
13
  props: {
15
14
  rules: {},
@@ -47,7 +46,7 @@ const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { c
47
46
  helperState: {}
48
47
  },
49
48
  setup(m) {
50
- const c = m, v = Ke("modelValue"), e = nt();
49
+ const c = m, v = We("modelValue"), e = lt();
51
50
  ve(() => {
52
51
  const { min: y, max: d } = v ?? {};
53
52
  if (!(!y || !d) && y.precision !== d.precision) {
@@ -55,19 +54,19 @@ const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { c
55
54
  v.min = a, v.max = f;
56
55
  }
57
56
  });
58
- const n = U(() => {
57
+ const l = U(() => {
59
58
  const { min: y, max: d } = v ?? {};
60
59
  return Math.max((y == null ? void 0 : y.precision) ?? 0, (d == null ? void 0 : d.precision) ?? 0, c.precision ?? 0);
61
60
  }), g = (y) => {
62
61
  if (!y) return "";
63
- const d = at(y), k = n.value, a = ce(d, k);
62
+ const d = at(y), k = l.value, a = ce(d, k);
64
63
  return rt(
65
- +Y(a),
64
+ +Z(a),
66
65
  a.precision
67
66
  );
68
67
  }, b = Q(g(v.min)), i = Q(g(v.max));
69
68
  be([b, i], ([y, d]) => {
70
- const k = v ?? {}, a = e(y), f = e(d), C = n.value;
69
+ const k = v ?? {}, a = e(y), f = e(d), C = l.value;
71
70
  if (y !== "" && a === !0) {
72
71
  const $ = Ue(+y, C);
73
72
  k.min = $;
@@ -80,12 +79,12 @@ const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { c
80
79
  k.max = null;
81
80
  v.min = k.min, v.max = k.max;
82
81
  });
83
- const o = Symbol.for("fm:form-state"), u = et(o, null), _ = U(() => c.disabled ?? (u == null ? void 0 : u.getDisabled()) ?? !1), P = Q(), I = Q(), h = Q(!1), S = Q(!1), V = U(() => h.value || S.value), K = U(() => [...[
82
+ const o = Symbol.for("fm:form-state"), u = et(o, null), _ = U(() => c.disabled ?? (u == null ? void 0 : u.getDisabled()) ?? !1), P = Q(), I = Q(), x = Q(!1), S = Q(!1), D = U(() => x.value || S.value), W = U(() => [...[
84
83
  function() {
85
84
  return typeof e(b.value) == "string" || typeof e(i.value) == "string" ? "Must be a number" : !0;
86
85
  },
87
86
  function(k) {
88
- return !k || !k.min || !k.max ? !0 : +Y(k.min) > +Y(k.max) ? "Min must be less than or equal to max" : !0;
87
+ return !k || !k.min || !k.max ? !0 : +Z(k.min) > +Z(k.max) ? "Min must be less than or equal to max" : !0;
89
88
  }
90
89
  ], ...c.rules ?? []]);
91
90
  return (y, d) => {
@@ -100,20 +99,20 @@ const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { c
100
99
  optional: y.labelMark === "optional"
101
100
  }, null, 8, ["label", "disabled", "required", "optional"])
102
101
  ]),
103
- p(a, { focused: V.value }, {
102
+ p(a, { focused: D.value }, {
104
103
  default: N(() => [
105
- s("div", Bt, [
104
+ s("div", Lt, [
106
105
  Re(y.$slots, "prepend"),
107
106
  d[6] || (d[6] = s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Min.", -1)),
108
- s("div", Lt, [
107
+ s("div", Bt, [
109
108
  Ae(s("input", {
110
109
  type: "text",
111
110
  ref_key: "minInputRef",
112
111
  ref: P,
113
- onFocus: d[0] || (d[0] = () => h.value = !0),
114
- onBlur: d[1] || (d[1] = () => h.value = !1),
112
+ onFocus: d[0] || (d[0] = () => x.value = !0),
113
+ onBlur: d[1] || (d[1] = () => x.value = !1),
115
114
  "onUpdate:modelValue": d[2] || (d[2] = (C) => b.value = C),
116
- class: X({
115
+ class: Y({
117
116
  "fm-text-field--input fm-typo-en-body-lg-400": !0,
118
117
  "text-fm-color-typo-primary": !_.value,
119
118
  "text-fm-color-typo-disabled": _.value
@@ -132,7 +131,7 @@ const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { c
132
131
  onFocus: d[3] || (d[3] = () => S.value = !0),
133
132
  onBlur: d[4] || (d[4] = () => S.value = !1),
134
133
  "onUpdate:modelValue": d[5] || (d[5] = (C) => i.value = C),
135
- class: X({
134
+ class: Y({
136
135
  "fm-text-field--input fm-typo-en-body-lg-400": !0,
137
136
  "text-fm-color-typo-primary": !_.value,
138
137
  "text-fm-color-typo-disabled": _.value
@@ -151,7 +150,7 @@ const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { c
151
150
  class: "flex-1",
152
151
  "model-value": y.modelValue,
153
152
  info: y.labelInfo,
154
- rules: K.value,
153
+ rules: W.value,
155
154
  "helper-text": y.helperText,
156
155
  "helper-state": y.helperState
157
156
  }, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
@@ -166,33 +165,33 @@ function Nt({ min: m, max: c } = { min: !0, max: !0 }) {
166
165
  }
167
166
  function zt(m, c) {
168
167
  return function(e) {
169
- return !e || !e.min || !e.max ? !0 : +Y(e.min) < m ? `Must be between ${m} and ${c}` : +Y(e.max) > c ? `Must be between ${m} and ${c}` : !0;
168
+ return !e || !e.min || !e.max ? !0 : +Z(e.min) < m ? `Must be between ${m} and ${c}` : +Z(e.max) > c ? `Must be between ${m} and ${c}` : !0;
170
169
  };
171
170
  }
172
171
  function Ht(m) {
173
- const c = it(m), v = Y(m);
174
- return function(n) {
175
- const g = !(n != null && n.min) || c(n.min) === !0, b = !(n != null && n.max) || c(n.max) === !0;
172
+ const c = it(m), v = Z(m);
173
+ return function(l) {
174
+ const g = !(l != null && l.min) || c(l.min) === !0, b = !(l != null && l.max) || c(l.max) === !0;
176
175
  return !g && !b ? `Min & max must be a multiple of ${v}` : g ? b ? !0 : `Max must be a multiple of ${v}` : `Min must be a multiple of ${v}`;
177
176
  };
178
177
  }
179
- const Je = Ft("transfer-template-helper", () => {
178
+ const Xe = Ft("transfer-template-helper", () => {
180
179
  const m = ut();
181
- function c(v, e, n, g, b) {
180
+ function c(v, e, l, g, b) {
182
181
  var o;
183
- if (!n) {
182
+ if (!l) {
184
183
  b == null || b("Unit is not valid");
185
184
  return;
186
185
  }
187
186
  let i = v.code;
188
187
  if (m.isEnabled) {
189
- const u = m.getItemPKTCode(e, (o = n.measurement) == null ? void 0 : o.id);
188
+ const u = m.getItemPKTCode(e, (o = l.measurement) == null ? void 0 : o.id);
190
189
  u && (i = u);
191
190
  }
192
191
  g({
193
192
  ...v,
194
- quantity: n.amount,
195
- measurement: n.measurement ?? null,
193
+ quantity: l.amount,
194
+ measurement: l.measurement ?? null,
196
195
  code: i
197
196
  });
198
197
  }
@@ -201,17 +200,17 @@ const Je = Ft("transfer-template-helper", () => {
201
200
  };
202
201
  });
203
202
  var H = /* @__PURE__ */ ((m) => (m.Code = "Code", m.Name = "Name", m.DefaultAmount = "DefaultAmount", m.Limit = "Limit", m.Step = "Step", m.Cost = "Cost", m.Delete = "Delete", m))(H || {});
204
- const Ne = Je();
203
+ const Ne = Xe();
205
204
  function Qt(m) {
206
- const { t: c } = le(), v = Ge(), e = pe(), n = tt({});
205
+ const { t: c } = ne(), v = Ge(), e = pe(), l = tt({});
207
206
  ve(() => {
208
207
  for (const i of m.items) {
209
208
  if (!i.totalCost)
210
209
  continue;
211
210
  const o = Ot(i.sku, i.quantity, i.measurement, {
212
211
  supplier: m.supplier
213
- }), u = i.totalCost ?? Be.reset();
214
- o ? n[i.sku._id] = o.amount !== u.amount || o.precision !== u.precision : n[i.sku._id] = !0;
212
+ }), u = i.totalCost ?? Le.reset();
213
+ o ? l[i.sku._id] = o.amount !== u.amount || o.precision !== u.precision : l[i.sku._id] = !0;
215
214
  }
216
215
  });
217
216
  const g = [
@@ -222,7 +221,7 @@ function Qt(m) {
222
221
  size: 180,
223
222
  cell(i) {
224
223
  const o = i.row.original;
225
- return Z(se.FmTextField, {
224
+ return J(se.FmTextField, {
226
225
  modelValue: o.code,
227
226
  "onUpdate:modelValue": (u) => {
228
227
  m.updateItem({
@@ -243,7 +242,7 @@ function Qt(m) {
243
242
  minSize: 300,
244
243
  cell(i) {
245
244
  const o = i.row.original;
246
- return Z(se.FmTextField, {
245
+ return J(se.FmTextField, {
247
246
  modelValue: o.name,
248
247
  "onUpdate:modelValue": (u) => {
249
248
  m.updateItem({
@@ -263,12 +262,12 @@ function Qt(m) {
263
262
  header: () => c("inventory.transfer.form.items.table.DefaultAmount"),
264
263
  minSize: 200,
265
264
  cell(i) {
266
- var h;
267
- const o = i.row.original, u = v.skuById[o.sku._id], _ = v.unitById[(h = u.unit) == null ? void 0 : h._id], P = _.measurements.find((S) => {
268
- var V;
269
- return ((V = o.measurement) == null ? void 0 : V.id) === S.id;
265
+ var x;
266
+ const o = i.row.original, u = v.skuById[o.sku._id], _ = v.unitById[(x = u.unit) == null ? void 0 : x._id], P = _.measurements.find((S) => {
267
+ var D;
268
+ return ((D = o.measurement) == null ? void 0 : D.id) === S.id;
270
269
  }), I = o.sku.unit._id !== u.unit._id || !_ || o.measurement && !P;
271
- return Z(It, {
270
+ return J(It, {
272
271
  style: {
273
272
  flex: "1 1 0%"
274
273
  },
@@ -285,22 +284,22 @@ function Qt(m) {
285
284
  o,
286
285
  u,
287
286
  S,
288
- (V) => {
287
+ (D) => {
289
288
  m.updateItem({
290
289
  ...o,
291
- code: V.code,
290
+ code: D.code,
292
291
  sku: u,
293
- quantity: V.quantity,
294
- measurement: V.measurement
292
+ quantity: D.quantity,
293
+ measurement: D.measurement
295
294
  });
296
295
  }
297
296
  );
298
297
  },
299
298
  rules: [
300
299
  St(o.quantityStep),
301
- ...+Y(o.quantity) ? [
300
+ ...+Z(o.quantity) ? [
302
301
  Ct(
303
- +Y(
302
+ +Z(
304
303
  o.minimumQuantity ?? {
305
304
  amount: 1,
306
305
  // NOTE: leave this reading from row.sku.unit and row.measurement instead,
@@ -310,9 +309,9 @@ function Qt(m) {
310
309
  )
311
310
  ] : [],
312
311
  $t(
313
- o.maximumQuantity ? +Y(o.maximumQuantity) : 1 / 0
312
+ o.maximumQuantity ? +Z(o.maximumQuantity) : 1 / 0
314
313
  ),
315
- function(V) {
314
+ function(D) {
316
315
  return I ? "This item is no longer valid due to change in unit. Please reapply unit." : !0;
317
316
  }
318
317
  ],
@@ -328,7 +327,7 @@ function Qt(m) {
328
327
  minSize: 280,
329
328
  cell(i) {
330
329
  const o = i.row.original;
331
- return Z(Et, {
330
+ return J(Et, {
332
331
  style: {
333
332
  flex: "1 1 0%"
334
333
  },
@@ -347,7 +346,7 @@ function Qt(m) {
347
346
  Nt({ max: !1 }),
348
347
  Ht(o.quantityStep),
349
348
  zt(
350
- +Y({
349
+ +Z({
351
350
  amount: 0,
352
351
  precision: me(o.sku.unit, o.measurement)
353
352
  }),
@@ -365,8 +364,8 @@ function Qt(m) {
365
364
  minSize: 100,
366
365
  cell(i) {
367
366
  const o = i.row.original;
368
- return Z(se.FmTextField, {
369
- modelValue: Y(o.quantityStep ?? Be.reset(), !1),
367
+ return J(se.FmTextField, {
368
+ modelValue: Z(o.quantityStep ?? Le.reset(), !1),
370
369
  key: o.sku._id,
371
370
  "onUpdate:modelValue": (u) => {
372
371
  m.updateItem({
@@ -390,8 +389,8 @@ function Qt(m) {
390
389
  header: "",
391
390
  cell(i) {
392
391
  const o = i.row.original;
393
- return Z("div", { class: "flex items-center" }, [
394
- e.usePurchaseOrderV2 ? Z(
392
+ return J("div", { class: "flex items-center" }, [
393
+ e.usePurchaseOrderV2 ? J(
395
394
  se.FmTooltip,
396
395
  {
397
396
  zIndex: 50,
@@ -399,7 +398,7 @@ function Qt(m) {
399
398
  },
400
399
  {
401
400
  default() {
402
- return Z(se.FmButton, {
401
+ return J(se.FmButton, {
403
402
  key: o.sku._id,
404
403
  type: "button",
405
404
  icon: "add_circle",
@@ -435,7 +434,7 @@ function Qt(m) {
435
434
  }
436
435
  }
437
436
  ) : null,
438
- Z(se.FmButton, {
437
+ J(se.FmButton, {
439
438
  class: "delete-button",
440
439
  key: o.sku._id,
441
440
  type: "button",
@@ -461,56 +460,56 @@ function Qt(m) {
461
460
  columnDefs: U(() => pe().enableTotalCost && m.transferType === G.PURCHASE ? g : g.filter((o) => o.id !== "Cost"))
462
461
  };
463
462
  }
464
- const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-center" }, Gt = { class: "flex-1 flex gap-1 items-center" }, Wt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Yt = { 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" }, Xt = { class: "flex-1 flex flex-col gap-4" }, es = {
463
+ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-center" }, Gt = { class: "flex-1 flex gap-1 items-center" }, Kt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Zt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Jt = { class: "flex gap-8 w-full" }, Xt = { class: "flex-1 flex flex-col gap-4" }, Yt = { class: "flex-1 flex flex-col gap-4" }, es = {
465
464
  key: 0,
466
465
  class: "flex gap-8 w-full"
467
- }, ts = { class: "flex-1 flex flex-col gap-4" }, ss = { class: "flex-1 flex flex-col gap-4" }, os = { class: "flex gap-8 w-full" }, ls = { class: "flex-1 flex flex-col gap-4" }, ns = /* @__PURE__ */ ee({
466
+ }, ts = { class: "flex-1 flex flex-col gap-4" }, ss = { class: "flex-1 flex flex-col gap-4" }, os = { class: "flex gap-8 w-full" }, ns = { class: "flex-1 flex flex-col gap-4" }, ls = /* @__PURE__ */ ee({
468
467
  __name: "TransferTemplateItem",
469
468
  props: {
470
469
  cellByColId: {},
471
470
  row: {}
472
471
  },
473
472
  setup(m) {
474
- const { t: c } = le();
473
+ const { t: c } = ne();
475
474
  function v(e) {
476
475
  return e;
477
476
  }
478
- return (e, n) => {
479
- var b, i, o, u, _, P, I, h, S, V, K, y, d, k, a, f, C, $, x, l, r, T, F, B, z, O, M, L, q, w;
477
+ return (e, l) => {
478
+ var b, i, o, u, _, P, I, x, S, D, W, y, d, k, a, f, C, $, h, n, r, T, F, L, z, O, M, B, q, w;
480
479
  const g = A("FmLabel");
481
480
  return R(), j("div", jt, [
482
- s("div", Kt, [
481
+ s("div", Wt, [
483
482
  s("div", Gt, [
484
- s("span", Wt, " (" + D(e.row.original.sku.code) + ") ", 1),
485
- s("span", Yt, D(e.row.original.sku.name), 1)
483
+ s("span", Kt, " (" + V(e.row.original.sku.code) + ") ", 1),
484
+ s("span", Zt, V(e.row.original.sku.name), 1)
486
485
  ]),
487
486
  s("div", null, [
488
- p(t(W), {
487
+ p(t(K), {
489
488
  render: (o = (i = (b = e.cellByColId.Delete) == null ? void 0 : b.column) == null ? void 0 : i.columnDef) == null ? void 0 : o.cell,
490
489
  props: (_ = (u = e.cellByColId.Delete) == null ? void 0 : u.getContext) == null ? void 0 : _.call(u)
491
490
  }, null, 8, ["render", "props"])
492
491
  ])
493
492
  ]),
494
- s("div", Zt, [
495
- s("div", Jt, [
493
+ s("div", Jt, [
494
+ s("div", Xt, [
496
495
  p(g, {
497
496
  label: t(c)(`inventory.transfer.form.items.table.${t(H).Code}`)
498
497
  }, null, 8, ["label"]),
499
- p(t(W), {
500
- render: (h = (I = (P = e.cellByColId[t(H).Code]) == null ? void 0 : P.column) == null ? void 0 : I.columnDef) == null ? void 0 : h.cell,
501
- props: (V = (S = e.cellByColId[t(H).Code]) == null ? void 0 : S.getContext) == null ? void 0 : V.call(S)
498
+ p(t(K), {
499
+ render: (x = (I = (P = e.cellByColId[t(H).Code]) == null ? void 0 : P.column) == null ? void 0 : I.columnDef) == null ? void 0 : x.cell,
500
+ props: (D = (S = e.cellByColId[t(H).Code]) == null ? void 0 : S.getContext) == null ? void 0 : D.call(S)
502
501
  }, null, 8, ["render", "props"]),
503
- n[0] || (n[0] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
502
+ l[0] || (l[0] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
504
503
  ]),
505
- s("div", Xt, [
504
+ s("div", Yt, [
506
505
  p(g, {
507
506
  label: t(c)(`inventory.transfer.form.items.table.${t(H).Name}`)
508
507
  }, null, 8, ["label"]),
509
- p(t(W), {
510
- render: (d = (y = (K = e.cellByColId[t(H).Name]) == null ? void 0 : K.column) == null ? void 0 : y.columnDef) == null ? void 0 : d.cell,
508
+ p(t(K), {
509
+ render: (d = (y = (W = e.cellByColId[t(H).Name]) == null ? void 0 : W.column) == null ? void 0 : y.columnDef) == null ? void 0 : d.cell,
511
510
  props: (a = (k = e.cellByColId[t(H).Name]) == null ? void 0 : k.getContext) == null ? void 0 : a.call(k)
512
511
  }, null, 8, ["render", "props"]),
513
- n[1] || (n[1] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
512
+ l[1] || (l[1] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
514
513
  ])
515
514
  ]),
516
515
  e.row.original ? (R(), j("div", es, [
@@ -518,33 +517,33 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
518
517
  p(g, {
519
518
  label: t(c)(`inventory.transfer.form.items.table.${t(H).DefaultAmount}`)
520
519
  }, null, 8, ["label"]),
521
- p(t(W), {
520
+ p(t(K), {
522
521
  render: ($ = (C = (f = e.cellByColId[t(H).DefaultAmount]) == null ? void 0 : f.column) == null ? void 0 : C.columnDef) == null ? void 0 : $.cell,
523
- props: (l = (x = e.cellByColId[t(H).DefaultAmount]) == null ? void 0 : x.getContext) == null ? void 0 : l.call(x)
522
+ props: (n = (h = e.cellByColId[t(H).DefaultAmount]) == null ? void 0 : h.getContext) == null ? void 0 : n.call(h)
524
523
  }, null, 8, ["render", "props"]),
525
- n[2] || (n[2] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
524
+ l[2] || (l[2] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
526
525
  ]),
527
526
  s("div", ss, [
528
527
  p(g, {
529
528
  label: t(c)(`inventory.transfer.form.items.table.${t(H).Step}`)
530
529
  }, null, 8, ["label"]),
531
- p(t(W), {
530
+ p(t(K), {
532
531
  render: (F = (T = (r = e.cellByColId[t(H).Step]) == null ? void 0 : r.column) == null ? void 0 : T.columnDef) == null ? void 0 : F.cell,
533
- props: (z = (B = e.cellByColId[t(H).Step]) == null ? void 0 : B.getContext) == null ? void 0 : z.call(B)
532
+ props: (z = (L = e.cellByColId[t(H).Step]) == null ? void 0 : L.getContext) == null ? void 0 : z.call(L)
534
533
  }, null, 8, ["render", "props"]),
535
- n[3] || (n[3] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
534
+ l[3] || (l[3] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
536
535
  ])
537
536
  ])) : oe("", !0),
538
537
  s("div", os, [
539
- s("div", ls, [
538
+ s("div", ns, [
540
539
  p(g, {
541
540
  label: t(c)(`inventory.transfer.form.items.table.${t(H).Limit}`)
542
541
  }, null, 8, ["label"]),
543
- p(t(W), {
544
- render: (L = (M = (O = e.cellByColId[t(H).Limit]) == null ? void 0 : O.column) == null ? void 0 : M.columnDef) == null ? void 0 : L.cell,
542
+ p(t(K), {
543
+ render: (B = (M = (O = e.cellByColId[t(H).Limit]) == null ? void 0 : O.column) == null ? void 0 : M.columnDef) == null ? void 0 : B.cell,
545
544
  props: (w = (q = e.cellByColId[t(H).Limit]) == null ? void 0 : q.getContext) == null ? void 0 : w.call(q)
546
545
  }, null, 8, ["render", "props"]),
547
- n[4] || (n[4] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
546
+ l[4] || (l[4] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
548
547
  ])
549
548
  ])
550
549
  ]);
@@ -562,21 +561,21 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
562
561
  return v.column.columnDef.meta;
563
562
  }
564
563
  return (v, e) => (R(), j("tr", as, [
565
- (R(!0), j(_e, null, ze(v.row.getVisibleCells(), (n) => {
564
+ (R(!0), j(_e, null, ze(v.row.getVisibleCells(), (l) => {
566
565
  var g, b, i, o, u;
567
566
  return R(), j("td", {
568
- key: n.id,
569
- class: X(["text-fm-color-typo-primary", ((g = c(n)) == null ? void 0 : g.cellClass) ?? "px-16"]),
567
+ key: l.id,
568
+ class: Y(["text-fm-color-typo-primary", ((g = c(l)) == null ? void 0 : g.cellClass) ?? "px-16"]),
570
569
  style: He({
571
- width: (b = c(n)) != null && b.width ? (i = c(n)) == null ? void 0 : i.width : n.column.getSize() !== 0 ? `${n.column.getSize()}px` : void 0,
572
- maxWidth: (o = c(n)) == null ? void 0 : o.maxWidth,
573
- textAlign: ((u = c(n)) == null ? void 0 : u.textAlign) ?? "left"
570
+ width: (b = c(l)) != null && b.width ? (i = c(l)) == null ? void 0 : i.width : l.column.getSize() !== 0 ? `${l.column.getSize()}px` : void 0,
571
+ maxWidth: (o = c(l)) == null ? void 0 : o.maxWidth,
572
+ textAlign: ((u = c(l)) == null ? void 0 : u.textAlign) ?? "left"
574
573
  })
575
574
  }, [
576
575
  s("span", rs, [
577
- p(t(W), {
578
- props: n.getContext(),
579
- render: n.column.columnDef.cell
576
+ p(t(K), {
577
+ props: l.getContext(),
578
+ render: l.column.columnDef.cell
580
579
  }, null, 8, ["props", "render"])
581
580
  ])
582
581
  ], 6);
@@ -590,99 +589,99 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
590
589
  disabled: { type: Boolean }
591
590
  },
592
591
  setup(m, { expose: c }) {
593
- const v = m, e = Ke(), { t: n } = le(), g = We(), b = Ge(), i = Dt(), o = pe(), u = Je();
592
+ const v = m, e = We(), { t: l } = ne(), g = Ke(), b = Ge(), i = Vt(), o = pe(), u = Xe();
594
593
  be(
595
594
  () => v.modelValue,
596
- (l) => {
597
- console.log("TransferTemplateForm.model", l);
595
+ (n) => {
596
+ console.log("TransferTemplateForm.model", n);
598
597
  }
599
598
  ), g.watchLocation(async () => {
600
- location && (e.purchaseOrder.supplier || (e.purchaseOrder.supplier = i.suppliers.find((l) => l) ?? e.purchaseOrder.supplier));
599
+ location && (e.purchaseOrder.supplier || (e.purchaseOrder.supplier = i.suppliers.find((n) => n) ?? e.purchaseOrder.supplier));
601
600
  }), kt();
602
601
  const _ = Mt(
603
602
  () => e.purchaseOrder,
604
- (l) => {
603
+ (n) => {
605
604
  e.purchaseOrder = {
606
605
  ...e.purchaseOrder,
607
- supplier: l.supplier ?? (e == null ? void 0 : e.purchaseOrder.supplier)
606
+ supplier: n.supplier ?? (e == null ? void 0 : e.purchaseOrder.supplier)
608
607
  };
609
608
  }
610
609
  ), P = U({
611
610
  get() {
612
- var l, r;
613
- return typeof ((r = (l = e.purchaseOrder) == null ? void 0 : l.supplier) == null ? void 0 : r.internal) == "string" ? G.TRANSFER : G.PURCHASE;
611
+ var n, r;
612
+ return typeof ((r = (n = e.purchaseOrder) == null ? void 0 : n.supplier) == null ? void 0 : r.internal) == "string" ? G.TRANSFER : G.PURCHASE;
614
613
  },
615
- set(l) {
614
+ set(n) {
616
615
  var T, F;
617
616
  const r = typeof ((F = (T = e.purchaseOrder) == null ? void 0 : T.supplier) == null ? void 0 : F.internal) == "string" ? G.TRANSFER : G.PURCHASE;
618
- l !== r && (e.purchaseOrder.supplier = l === G.PURCHASE ? _.locationOptionsTypePurchase.value[0] : _.locationOptionsTypeTransfer.value[0]);
617
+ n !== r && (e.purchaseOrder.supplier = n === G.PURCHASE ? _.locationOptionsTypePurchase.value[0] : _.locationOptionsTypeTransfer.value[0]);
619
618
  }
620
- }), I = U(() => _.transferLocationOptions.value), h = U({
619
+ }), I = U(() => _.transferLocationOptions.value), x = U({
621
620
  get() {
622
- var l;
623
- return (l = e.purchaseOrder.supplier) == null ? void 0 : l._id;
621
+ var n;
622
+ return (n = e.purchaseOrder.supplier) == null ? void 0 : n._id;
624
623
  },
625
- set(l) {
626
- _.transferLocationModel.value = l;
624
+ set(n) {
625
+ _.transferLocationModel.value = n;
627
626
  }
628
627
  }), {
629
628
  promptSelectLocations: S,
630
- columnDefs: V,
631
- rowData: K
629
+ columnDefs: D,
630
+ rowData: W
632
631
  } = mt({
633
632
  getLocations() {
634
633
  return e.locations;
635
634
  },
636
- setLocations(l) {
637
- e.locations = l;
635
+ setLocations(n) {
636
+ e.locations = n;
638
637
  }
639
638
  });
640
639
  function y() {
641
- var l, r;
642
- return (l = e.locations) != null && l.find((T) => {
643
- var F, B;
644
- return ((F = T.doc) == null ? void 0 : F._id) === ((B = e.purchaseOrder.supplier) == null ? void 0 : B._id);
640
+ var n, r;
641
+ return (n = e.locations) != null && n.find((T) => {
642
+ var F, L;
643
+ return ((F = T.doc) == null ? void 0 : F._id) === ((L = e.purchaseOrder.supplier) == null ? void 0 : L._id);
645
644
  }) ? `Location ${(r = e.purchaseOrder.supplier) == null ? void 0 : r.name} must be removed because template cannot be used to transfer to itself.` : !0;
646
645
  }
647
646
  const d = U({
648
647
  get() {
649
648
  return e.purchaseOrder.remark ?? void 0;
650
649
  },
651
- set(l) {
652
- e.purchaseOrder.remark = l;
650
+ set(n) {
651
+ e.purchaseOrder.remark = n;
653
652
  }
654
653
  }), k = Q();
655
654
  c({
656
655
  validateInputs: () => {
657
- var l, r;
658
- (r = (l = k.value) == null ? void 0 : l.validateInputs) == null || r.call(l);
656
+ var n, r;
657
+ (r = (n = k.value) == null ? void 0 : n.validateInputs) == null || r.call(n);
659
658
  },
660
659
  resetInputsValidation: () => {
661
- var l, r;
662
- (r = (l = k.value) == null ? void 0 : l.resetInputsValidation) == null || r.call(l);
660
+ var n, r;
661
+ (r = (n = k.value) == null ? void 0 : n.resetInputsValidation) == null || r.call(n);
663
662
  },
664
663
  resetInputs: () => {
665
- var l, r;
666
- (r = (l = k.value) == null ? void 0 : l.resetInputs) == null || r.call(l);
664
+ var n, r;
665
+ (r = (n = k.value) == null ? void 0 : n.resetInputs) == null || r.call(n);
667
666
  }
668
667
  });
669
668
  const a = U(() => ({
670
- duplicateItem: (l) => {
669
+ duplicateItem: (n) => {
671
670
  e.purchaseOrder.items = [
672
671
  ...e.purchaseOrder.items,
673
672
  {
674
- ...l
673
+ ...n
675
674
  }
676
675
  ];
677
676
  },
678
- updateItem: (l) => {
677
+ updateItem: (n) => {
679
678
  let r = [];
680
- l.id ? r = e.purchaseOrder.items.map((T) => T.id !== l.id ? T : l) : r = e.purchaseOrder.items.map((T) => T.sku._id !== l.sku._id ? T : l), e.purchaseOrder.items = r;
679
+ n.id ? r = e.purchaseOrder.items.map((T) => T.id !== n.id ? T : n) : r = e.purchaseOrder.items.map((T) => T.sku._id !== n.sku._id ? T : n), e.purchaseOrder.items = r;
681
680
  },
682
- deleteItem: (l) => {
683
- console.log(l.id);
681
+ deleteItem: (n) => {
682
+ console.log(n.id);
684
683
  let r = [];
685
- l.id ? r = e.purchaseOrder.items.filter((T) => T.id !== l.id) : r = e.purchaseOrder.items.filter((T) => T.sku._id !== l.sku._id), e.purchaseOrder.items = r;
684
+ n.id ? r = e.purchaseOrder.items.filter((T) => T.id !== n.id) : r = e.purchaseOrder.items.filter((T) => T.sku._id !== n.sku._id), e.purchaseOrder.items = r;
686
685
  }
687
686
  })), f = Qt({
688
687
  duplicateItem: a.value.duplicateItem,
@@ -701,20 +700,20 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
701
700
  return v.disabled;
702
701
  }
703
702
  }), C = U(() => f.columnDefs.value), { promptSelectIngredients: $ } = Rt();
704
- async function x() {
703
+ async function h() {
705
704
  const r = b.skus.map((O) => ({
706
705
  label: O.name,
707
706
  sublabel: O.code,
708
707
  value: O
709
708
  })).filter((O) => {
710
709
  var M;
711
- return (M = e.purchaseOrder.items) == null ? void 0 : M.find((L) => L.sku._id === O.value._id);
710
+ return (M = e.purchaseOrder.items) == null ? void 0 : M.find((B) => B.sku._id === O.value._id);
712
711
  }).map((O) => O.value), T = e.purchaseOrder.items ?? [], F = await $(
713
712
  r.map((O) => O._id),
714
713
  (O) => {
715
- const M = b.skuById[O], L = T.find((E) => E.sku._id === M._id);
716
- if (L)
717
- return L;
714
+ const M = b.skuById[O], B = T.find((E) => E.sku._id === M._id);
715
+ if (B)
716
+ return B;
718
717
  const q = { amount: 1, precision: me(M.unit) };
719
718
  let w = {
720
719
  id: o.usePurchaseOrderV2 ? crypto.randomUUID() : void 0,
@@ -743,25 +742,25 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
743
742
  }
744
743
  );
745
744
  if (!F) return;
746
- const B = F.map((O) => O.sku._id), z = [];
747
- for (const O of B) {
748
- const M = T.filter((L) => L.sku._id === O);
745
+ const L = F.map((O) => O.sku._id), z = [];
746
+ for (const O of L) {
747
+ const M = T.filter((B) => B.sku._id === O);
749
748
  if (M.length > 0)
750
749
  z.push(...M);
751
750
  else {
752
- const L = F.find((q) => q.sku._id === O);
753
- L && z.push(L);
751
+ const B = F.find((q) => q.sku._id === O);
752
+ B && z.push(B);
754
753
  }
755
754
  }
756
755
  z.sort((O, M) => O.sku.code.localeCompare(M.sku.code)), e.purchaseOrder.items = z;
757
756
  }
758
- return (l, r) => {
759
- const T = A("FmTextField"), F = A("FmSelect"), B = A("FmTextarea"), z = A("FmButton"), O = A("FmTable"), M = A("FmFormGroup"), L = A("FmForm");
760
- return R(), J(L, {
757
+ return (n, r) => {
758
+ const T = A("FmTextField"), F = A("FmSelect"), L = A("FmTextarea"), z = A("FmButton"), O = A("FmTable"), M = A("FmFormGroup"), B = A("FmForm");
759
+ return R(), X(B, {
761
760
  ref_key: "formRef",
762
761
  ref: k,
763
762
  class: "flex flex-col gap-32",
764
- disabled: l.disabled
763
+ disabled: n.disabled
765
764
  }, {
766
765
  default: N(() => {
767
766
  var q;
@@ -769,54 +768,54 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
769
768
  s("div", us, [
770
769
  s("div", ds, [
771
770
  p(T, {
772
- label: t(n)("inventory.transfer.form.name"),
771
+ label: t(l)("inventory.transfer.form.name"),
773
772
  "label-mark": "required",
774
773
  modelValue: t(e).name,
775
774
  "onUpdate:modelValue": r[0] || (r[0] = (w) => t(e).name = w),
776
775
  rules: [t(fe)()]
777
776
  }, null, 8, ["label", "modelValue", "rules"]),
778
777
  p(F, {
779
- label: t(n)("inventory.transfer.form.type.title"),
778
+ label: t(l)("inventory.transfer.form.type.title"),
780
779
  "model-value": P.value,
781
780
  "onUpdate:modelValue": r[1] || (r[1] = (w) => P.value = w),
782
781
  items: [
783
782
  {
784
- label: t(n)("inventory.transfer.form.type.purchase"),
783
+ label: t(l)("inventory.transfer.form.type.purchase"),
785
784
  value: t(G).PURCHASE,
786
785
  disabled: !t(_).locationOptionsTypePurchase.value.length,
787
- sublabel: t(_).locationOptionsTypePurchase.value.length ? void 0 : t(n)("inventory.transfer.form.noSupplierAvailable")
786
+ sublabel: t(_).locationOptionsTypePurchase.value.length ? void 0 : t(l)("inventory.transfer.form.noSupplierAvailable")
788
787
  },
789
788
  {
790
- label: t(n)("inventory.transfer.form.type.transfer"),
789
+ label: t(l)("inventory.transfer.form.type.transfer"),
791
790
  value: t(G).TRANSFER,
792
791
  disabled: !t(_).locationOptionsTypeTransfer.value.length,
793
- sublabel: t(_).locationOptionsTypeTransfer.value.length ? void 0 : t(n)("inventory.transfer.form.noLocationAvailable")
792
+ sublabel: t(_).locationOptionsTypeTransfer.value.length ? void 0 : t(l)("inventory.transfer.form.noLocationAvailable")
794
793
  }
795
794
  ],
796
795
  rules: [t(ye)(1)(I.value)]
797
796
  }, {
798
797
  default: N(() => [
799
798
  s("span", {
800
- class: X([
799
+ class: Y([
801
800
  "line-clamp-1 fm-typo-en-body-lg-400",
802
- l.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
801
+ n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
803
802
  ])
804
- }, D(t(pt)(P.value)), 3)
803
+ }, V(t(pt)(P.value)), 3)
805
804
  ]),
806
805
  _: 1
807
806
  }, 8, ["label", "model-value", "items", "rules"]),
808
807
  p(F, {
809
- label: P.value === t(G).PURCHASE ? t(n)("inventory.transfer.form.purchaseFrom") : t(n)("inventory.transfer.form.transferFrom"),
810
- modelValue: h.value,
811
- "onUpdate:modelValue": r[2] || (r[2] = (w) => h.value = w),
808
+ label: P.value === t(G).PURCHASE ? t(l)("inventory.transfer.form.purchaseFrom") : t(l)("inventory.transfer.form.transferFrom"),
809
+ modelValue: x.value,
810
+ "onUpdate:modelValue": r[2] || (r[2] = (w) => x.value = w),
812
811
  items: I.value
813
812
  }, {
814
813
  "menu-wrapper": N((w) => {
815
814
  var E;
816
815
  return [
817
- p(Vt, Qe(w, {
816
+ p(Dt, Qe(w, {
818
817
  items: I.value,
819
- "model-value": (E = l.modelValue.purchaseOrder.supplier) == null ? void 0 : E._id
818
+ "model-value": (E = n.modelValue.purchaseOrder.supplier) == null ? void 0 : E._id
820
819
  }), null, 16, ["items", "model-value"])
821
820
  ];
822
821
  }),
@@ -824,28 +823,28 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
824
823
  var w;
825
824
  return [
826
825
  s("span", {
827
- class: X([
826
+ class: Y([
828
827
  "line-clamp-1 fm-typo-en-body-lg-400",
829
- l.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
828
+ n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
830
829
  ])
831
- }, D((w = I.value.find((E) => E.value === h.value)) == null ? void 0 : w.label), 3)
830
+ }, V((w = I.value.find((E) => E.value === x.value)) == null ? void 0 : w.label), 3)
832
831
  ];
833
832
  }),
834
833
  _: 1
835
834
  }, 8, ["label", "modelValue", "items"]),
836
835
  p(T, {
837
- label: t(n)("inventory.transfer.form.reference"),
836
+ label: t(l)("inventory.transfer.form.reference"),
838
837
  "label-mark": "optional",
839
838
  modelValue: t(e).purchaseOrder.ref,
840
839
  "onUpdate:modelValue": r[3] || (r[3] = (w) => t(e).purchaseOrder.ref = w)
841
840
  }, null, 8, ["label", "modelValue"]),
842
- p(B, {
843
- label: t(n)("inventory.transfer.form.remark"),
841
+ p(L, {
842
+ label: t(l)("inventory.transfer.form.remark"),
844
843
  "label-mark": "optional",
845
844
  "max-length": 240,
846
845
  modelValue: d.value,
847
846
  "onUpdate:modelValue": r[4] || (r[4] = (w) => d.value = w),
848
- class: X({ "text-fm-color-typo-disabled": l.disabled })
847
+ class: Y({ "text-fm-color-typo-disabled": n.disabled })
849
848
  }, null, 8, ["label", "modelValue", "class"])
850
849
  ])
851
850
  ]),
@@ -853,7 +852,7 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
853
852
  s("div", ps, [
854
853
  r[8] || (r[8] = s("div", { class: "flex-1 fm-typo-en-title-sm-600" }, "Locations", -1)),
855
854
  p(z, {
856
- disabled: l.disabled,
855
+ disabled: n.disabled,
857
856
  label: "Select location",
858
857
  "prepend-icon": "add",
859
858
  variant: "plain",
@@ -862,8 +861,8 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
862
861
  }, null, 8, ["disabled", "onClick"])
863
862
  ]),
864
863
  p(O, {
865
- "column-defs": t(V),
866
- "row-data": t(K),
864
+ "column-defs": t(D),
865
+ "row-data": t(W),
867
866
  "shrink-at": 9999,
868
867
  onRowClick: t(S),
869
868
  "hide-footer": ""
@@ -880,18 +879,18 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
880
879
  ]),
881
880
  s("div", fs, [
882
881
  s("div", ys, [
883
- s("div", vs, D(t(n)("inventory.transfer.form.items.title")), 1),
882
+ s("div", vs, V(t(l)("inventory.transfer.form.items.title")), 1),
884
883
  p(z, {
885
- disabled: l.disabled,
886
- label: t(n)("inventory.transfer.form.items.addItem"),
884
+ disabled: n.disabled,
885
+ label: t(l)("inventory.transfer.form.items.addItem"),
887
886
  "prepend-icon": "add",
888
887
  variant: "plain",
889
888
  class: "border-2 rounded-lg border-fm-color-primary",
890
- onClick: r[5] || (r[5] = (w) => x()),
889
+ onClick: r[5] || (r[5] = (w) => h()),
891
890
  size: "md"
892
891
  }, null, 8, ["disabled", "label"])
893
892
  ]),
894
- (R(), J(O, {
893
+ (R(), X(O, {
895
894
  "column-defs": C.value,
896
895
  "row-data": t(e).purchaseOrder.items,
897
896
  key: t(e).purchaseOrder.items.map((w) => w.sku._id).join("."),
@@ -902,20 +901,20 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
902
901
  p(is, {
903
902
  row: w,
904
903
  "onUpdate:item": r[6] || (r[6] = (E) => a.value.updateItem(E)),
905
- disabled: l.disabled
904
+ disabled: n.disabled
906
905
  }, null, 8, ["row", "disabled"])
907
906
  ]),
908
907
  "list-row": N((w) => [
909
- (R(), J(Ye, {
908
+ (R(), X(Ze, {
910
909
  row: w,
911
910
  key: t(e).purchaseOrder.items.map((E) => E.sku._id).join(".")
912
911
  }, {
913
912
  default: N((E) => [
914
- p(ns, {
913
+ p(ls, {
915
914
  row: w,
916
915
  "cell-by-col-id": E,
917
916
  "onUpdate:item": r[7] || (r[7] = (te) => a.value.updateItem(te)),
918
- disabled: l.disabled
917
+ disabled: n.disabled
919
918
  }, null, 8, ["row", "cell-by-col-id", "disabled"])
920
919
  ]),
921
920
  _: 2
@@ -934,7 +933,7 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
934
933
  }, 8, ["disabled"]);
935
934
  };
936
935
  }
937
- }), _s = { class: "flex items-center" }, hs = { class: "fm-typo-en-title-md-800" }, xs = { class: "flex gap-4" }, gs = /* @__PURE__ */ ee({
936
+ }), _s = { class: "flex items-center" }, xs = { class: "fm-typo-en-title-md-800" }, hs = { class: "flex gap-4" }, gs = /* @__PURE__ */ ee({
938
937
  __name: "TransferTemplateDialog",
939
938
  props: {
940
939
  mode: {},
@@ -944,7 +943,7 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
944
943
  emits: ["update:show", "submitted"],
945
944
  setup(m, { expose: c, emit: v }) {
946
945
  var k;
947
- const e = m, n = v, g = _t(), b = Tt(), { t: i } = le(), o = Ze(e, "show");
946
+ const e = m, l = v, g = _t(), b = Tt(), { t: i } = ne(), o = Je(e, "show");
948
947
  function u() {
949
948
  return {
950
949
  _id: "",
@@ -983,13 +982,13 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
983
982
  a && (_.value = e.modelValue ?? u(), P.value = ((f = e.modelValue) == null ? void 0 : f._id) ?? `${Math.random()}`);
984
983
  }
985
984
  );
986
- const I = Q(!1), h = U(() => {
985
+ const I = Q(!1), x = U(() => {
987
986
  switch (e.mode) {
988
- case ne.READ:
987
+ case le.READ:
989
988
  return "";
990
- case ne.CREATE:
989
+ case le.CREATE:
991
990
  return i("inventory.transfer.template.create.title");
992
- case ne.UPDATE:
991
+ case le.UPDATE:
993
992
  return i("inventory.transfer.template.update.title");
994
993
  }
995
994
  return "";
@@ -1008,19 +1007,19 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1008
1007
  (f = (a = S.value) == null ? void 0 : a.resetInputs) == null || f.call(a);
1009
1008
  }
1010
1009
  });
1011
- async function V() {
1010
+ async function D() {
1012
1011
  var f, C;
1013
1012
  const a = _.value;
1014
1013
  if (a) {
1015
1014
  I.value = !0, (((f = a.purchaseOrder.supplier) == null ? void 0 : f.internal) === de.enum.warehouse || ((C = a.purchaseOrder.supplier) == null ? void 0 : C.internal) === de.enum.restaurant) && (a.purchaseOrder.items = a.purchaseOrder.items.map(
1016
- ({ totalCost: $, ...x }) => x
1015
+ ({ totalCost: $, ...h }) => h
1017
1016
  ));
1018
1017
  try {
1019
1018
  await g.createTemplate(a), await new Promise(($) => setTimeout($, 1e3)), b.open({
1020
1019
  title: i("inventory.transfer.template.create.success"),
1021
1020
  message: i("inventory.transfer.template.create.successMessage"),
1022
1021
  type: "success"
1023
- }), n("update:show", !1), n("submitted");
1022
+ }), l("update:show", !1), l("submitted");
1024
1023
  } catch ($) {
1025
1024
  b.open({
1026
1025
  title: i("inventory.transfer.template.create.error"),
@@ -1032,19 +1031,19 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1032
1031
  }
1033
1032
  }
1034
1033
  }
1035
- async function K() {
1034
+ async function W() {
1036
1035
  var f, C;
1037
1036
  const a = _.value;
1038
1037
  if (a) {
1039
1038
  I.value = !0, (((f = a.purchaseOrder.supplier) == null ? void 0 : f.internal) === de.enum.warehouse || ((C = a.purchaseOrder.supplier) == null ? void 0 : C.internal) === de.enum.restaurant) && (a.purchaseOrder.items = a.purchaseOrder.items.map(
1040
- ({ totalCost: $, ...x }) => x
1039
+ ({ totalCost: $, ...h }) => h
1041
1040
  ));
1042
1041
  try {
1043
1042
  await g.updateTemplate(a), await new Promise(($) => setTimeout($, 1e3)), b.open({
1044
1043
  title: i("inventory.transfer.template.update.success"),
1045
1044
  message: i("inventory.transfer.template.update.successMessage"),
1046
1045
  type: "success"
1047
- }), n("update:show", !1), n("submitted");
1046
+ }), l("update:show", !1), l("submitted");
1048
1047
  } catch ($) {
1049
1048
  b.open({
1050
1049
  title: i("inventory.transfer.template.update.error"),
@@ -1058,10 +1057,10 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1058
1057
  }
1059
1058
  function y() {
1060
1059
  switch (e.mode) {
1061
- case ne.CREATE:
1062
- return V();
1063
- case ne.UPDATE:
1064
- return K();
1060
+ case le.CREATE:
1061
+ return D();
1062
+ case le.UPDATE:
1063
+ return W();
1065
1064
  }
1066
1065
  }
1067
1066
  function d() {
@@ -1070,32 +1069,32 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1070
1069
  }
1071
1070
  return (a, f) => {
1072
1071
  const C = A("FmButton"), $ = A("FmSideSheet");
1073
- return R(), J($, {
1072
+ return R(), X($, {
1074
1073
  modelValue: t(o),
1075
- "onUpdate:modelValue": f[2] || (f[2] = (x) => je(o) ? o.value = x : null),
1074
+ "onUpdate:modelValue": f[2] || (f[2] = (h) => je(o) ? o.value = h : null),
1076
1075
  "dismiss-away": "",
1077
1076
  "close-button": "",
1078
1077
  "max-width": 1200
1079
1078
  }, {
1080
1079
  "side-sheet-header": N(() => [
1081
1080
  s("div", _s, [
1082
- s("div", hs, D(h.value), 1)
1081
+ s("div", xs, V(x.value), 1)
1083
1082
  ])
1084
1083
  ]),
1085
1084
  default: N(() => [
1086
- (R(), J(bs, {
1085
+ (R(), X(bs, {
1087
1086
  class: "w-full",
1088
1087
  ref_key: "formRef",
1089
1088
  ref: S,
1090
1089
  onValidationSuccess: y,
1091
1090
  "model-value": _.value,
1092
- "onUpdate:modelValue": f[0] || (f[0] = (x) => _.value = x),
1091
+ "onUpdate:modelValue": f[0] || (f[0] = (h) => _.value = h),
1093
1092
  disabled: I.value,
1094
1093
  key: P.value
1095
1094
  }, null, 8, ["model-value", "disabled"]))
1096
1095
  ]),
1097
1096
  "side-sheet-footer": N(() => [
1098
- s("div", xs, [
1097
+ s("div", hs, [
1099
1098
  p(C, {
1100
1099
  loading: I.value,
1101
1100
  label: t(i)("common.save"),
@@ -1105,7 +1104,7 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1105
1104
  disabled: I.value,
1106
1105
  variant: "tertiary",
1107
1106
  label: t(i)("common.close"),
1108
- onClick: f[1] || (f[1] = (x) => n("update:show", !1))
1107
+ onClick: f[1] || (f[1] = (h) => l("update:show", !1))
1109
1108
  }, null, 8, ["disabled", "label"])
1110
1109
  ])
1111
1110
  ]),
@@ -1116,19 +1115,19 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1116
1115
  }), ks = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, Ts = { class: "flex justify-between" }, ws = { class: "fm-typo-en-body-lg-600" }, Fs = { class: "fm-status-badge fm-status-badge-info-secondary" }, Is = { class: "flex flex-col gap-8" }, Ss = { class: "flex flex-col gap-4" }, Cs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $s = { class: "flex gap-1" }, Os = { class: "fm-typo-en-body-lg-600" }, Ms = {
1117
1116
  key: 0,
1118
1117
  class: "flex flex-col gap-4"
1119
- }, Vs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ds = { class: "fm-typo-en-body-lg-600" }, Rs = {
1118
+ }, Ds = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vs = { class: "fm-typo-en-body-lg-600" }, Rs = {
1120
1119
  key: 1,
1121
1120
  class: "flex flex-col gap-4"
1122
1121
  }, As = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ps = { class: "fm-typo-en-body-lg-600" }, Us = {
1123
1122
  key: 2,
1124
1123
  class: "flex flex-col gap-4"
1125
- }, Bs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ls = { class: "fm-typo-en-body-lg-600" }, qs = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Es = { class: "flex flex-col gap-8" }, Ns = { class: "fm-typo-en-body-lg-600" }, zs = { class: "flex w-full gap-4" }, Hs = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, Qs = { class: "fm-typo-en-body-lg-600 shrink-0" }, js = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Ks = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Gs = {
1124
+ }, Ls = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Bs = { class: "fm-typo-en-body-lg-600" }, qs = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Es = { class: "flex flex-col gap-8" }, Ns = { class: "fm-typo-en-body-lg-600" }, zs = { class: "flex w-full gap-4" }, Hs = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, Qs = { class: "fm-typo-en-body-lg-600 shrink-0" }, js = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Ws = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Gs = {
1126
1125
  key: 0,
1127
1126
  class: "shrink-0 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
1128
- }, Ws = {
1127
+ }, Ks = {
1129
1128
  key: 0,
1130
1129
  class: "flex gap-4 items-center"
1131
- }, Ys = { class: "flex flex-col gap-12" }, Zs = { class: "flex flex-col gap-8" }, Js = { class: "flex gap-8 xs:flex-col" }, Xs = /* @__PURE__ */ ee({
1130
+ }, Zs = { class: "flex flex-col gap-12" }, Js = { class: "flex flex-col gap-8" }, Xs = { class: "flex gap-8 xs:flex-col" }, Ys = /* @__PURE__ */ ee({
1132
1131
  __name: "TransferTemplateDetails",
1133
1132
  props: {
1134
1133
  template: {},
@@ -1136,7 +1135,7 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1136
1135
  },
1137
1136
  emits: ["update:show", "action:edit"],
1138
1137
  setup(m, { emit: c }) {
1139
- const v = m, e = c, n = pe(), { t: g } = le(), b = U(() => {
1138
+ const v = m, e = c, l = pe(), { t: g } = ne(), b = U(() => {
1140
1139
  var I;
1141
1140
  return (I = v.template) == null ? void 0 : I.purchaseOrder;
1142
1141
  }), i = [
@@ -1144,17 +1143,17 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1144
1143
  { accessorKey: "type", header: () => "Type" }
1145
1144
  ], o = Q(""), u = U(
1146
1145
  () => {
1147
- var I, h, S, V;
1148
- return ((h = (I = b.value) == null ? void 0 : I.supplier) == null ? void 0 : h.internal) === "restaurant" || ((V = (S = b.value) == null ? void 0 : S.supplier) == null ? void 0 : V.internal) === "warehouse" ? G.TRANSFER : G.PURCHASE;
1146
+ var I, x, S, D;
1147
+ return ((x = (I = b.value) == null ? void 0 : I.supplier) == null ? void 0 : x.internal) === "restaurant" || ((D = (S = b.value) == null ? void 0 : S.supplier) == null ? void 0 : D.internal) === "warehouse" ? G.TRANSFER : G.PURCHASE;
1149
1148
  }
1150
- ), _ = Q(!0), P = Ze(v, "show");
1151
- return (I, h) => {
1149
+ ), _ = Q(!0), P = Je(v, "show");
1150
+ return (I, x) => {
1152
1151
  var f;
1153
- const S = A("FmMenuDivider"), V = A("FmCard"), K = A("FmIcon"), y = A("FmTextField"), d = A("FmTable"), k = A("FmButton"), a = A("FmSideSheet");
1154
- return R(), J(a, {
1152
+ const S = A("FmMenuDivider"), D = A("FmCard"), W = A("FmIcon"), y = A("FmTextField"), d = A("FmTable"), k = A("FmButton"), a = A("FmSideSheet");
1153
+ return R(), X(a, {
1155
1154
  header: t(g)("inventory.transfer.template.details.view", { template: (f = I.template) == null ? void 0 : f.name }),
1156
1155
  modelValue: t(P),
1157
- "onUpdate:modelValue": h[2] || (h[2] = (C) => je(P) ? P.value = C : null),
1156
+ "onUpdate:modelValue": x[2] || (x[2] = (C) => je(P) ? P.value = C : null),
1158
1157
  "dismiss-away": _.value,
1159
1158
  "close-button": "",
1160
1159
  "max-width": 500
@@ -1164,16 +1163,16 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1164
1163
  return [
1165
1164
  s("div", ks, [
1166
1165
  s("div", null, [
1167
- p(V, {
1166
+ p(D, {
1168
1167
  variant: "outlined",
1169
1168
  class: "flex flex-col gap-8 px-12 py-16"
1170
1169
  }, {
1171
1170
  default: N(() => {
1172
- var x, l, r, T, F, B, z;
1171
+ var h, n, r, T, F, L, z;
1173
1172
  return [
1174
1173
  s("div", Ts, [
1175
- s("div", ws, D(t(g)("inventory.transfer.template.details.templateSummary")), 1),
1176
- s("div", Fs, D(t(g)(
1174
+ s("div", ws, V(t(g)("inventory.transfer.template.details.templateSummary")), 1),
1175
+ s("div", Fs, V(t(g)(
1177
1176
  `inventory.transfer.receiveRequest.details.type.${u.value.toLocaleLowerCase("en-US")}`
1178
1177
  )), 1)
1179
1178
  ]),
@@ -1181,21 +1180,21 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1181
1180
  s("div", Is, [
1182
1181
  s("div", Ss, [
1183
1182
  s("div", Cs, [
1184
- s("div", $s, D(t(g)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1183
+ s("div", $s, V(t(g)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1185
1184
  ]),
1186
- s("div", Os, D(t(ct)(((x = I.template) == null ? void 0 : x._id) ?? "")), 1)
1185
+ s("div", Os, V(t(ct)(((h = I.template) == null ? void 0 : h._id) ?? "")), 1)
1187
1186
  ]),
1188
- (r = (l = b.value) == null ? void 0 : l.supplier) != null && r.name ? (R(), j("div", Ms, [
1189
- s("div", Vs, D(t(g)("inventory.transfer.receiveRequest.details.from")), 1),
1190
- s("div", Ds, D((F = (T = b.value) == null ? void 0 : T.supplier) == null ? void 0 : F.name), 1)
1187
+ (r = (n = b.value) == null ? void 0 : n.supplier) != null && r.name ? (R(), j("div", Ms, [
1188
+ s("div", Ds, V(t(g)("inventory.transfer.receiveRequest.details.from")), 1),
1189
+ s("div", Vs, V((F = (T = b.value) == null ? void 0 : T.supplier) == null ? void 0 : F.name), 1)
1191
1190
  ])) : oe("", !0),
1192
- (B = b.value) != null && B.ref ? (R(), j("div", Rs, [
1193
- s("div", As, D(t(g)("inventory.transfer.receiveRequest.details.reference")), 1),
1194
- s("div", Ps, D(b.value.ref), 1)
1191
+ (L = b.value) != null && L.ref ? (R(), j("div", Rs, [
1192
+ s("div", As, V(t(g)("inventory.transfer.receiveRequest.details.reference")), 1),
1193
+ s("div", Ps, V(b.value.ref), 1)
1195
1194
  ])) : oe("", !0),
1196
1195
  (z = b.value) != null && z.remark ? (R(), j("div", Us, [
1197
- s("div", Bs, D(t(g)("inventory.transfer.receiveRequest.details.remark")), 1),
1198
- s("div", Ls, D(b.value.remark), 1)
1196
+ s("div", Ls, V(t(g)("inventory.transfer.receiveRequest.details.remark")), 1),
1197
+ s("div", Bs, V(b.value.remark), 1)
1199
1198
  ])) : oe("", !0)
1200
1199
  ])
1201
1200
  ];
@@ -1205,42 +1204,42 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1205
1204
  ]),
1206
1205
  s("div", qs, [
1207
1206
  s("div", Es, [
1208
- s("div", Ns, D(t(g)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
1209
- (R(!0), j(_e, null, ze(((C = b.value) == null ? void 0 : C.items) ?? [], (x) => (R(), j("div", {
1210
- key: x.code,
1207
+ s("div", Ns, V(t(g)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
1208
+ (R(!0), j(_e, null, ze(((C = b.value) == null ? void 0 : C.items) ?? [], (h) => (R(), j("div", {
1209
+ key: h.code,
1211
1210
  class: "flex flex-col"
1212
1211
  }, [
1213
1212
  s("div", zs, [
1214
- s("div", Hs, D(x.name), 1),
1215
- h[3] || (h[3] = s("div", { class: "flex-1 min-w-32" }, null, -1)),
1216
- s("div", Qs, D(t(ht)(x.quantity, x.sku.unit, x.measurement)), 1)
1213
+ s("div", Hs, V(h.name), 1),
1214
+ x[3] || (x[3] = s("div", { class: "flex-1 min-w-32" }, null, -1)),
1215
+ s("div", Qs, V(t(xt)(h.quantity, h.sku.unit, h.measurement)), 1)
1217
1216
  ]),
1218
1217
  s("div", js, [
1219
- s("div", Ks, D(x.code), 1),
1220
- x.totalCost && t(n).enableTotalCost ? (R(), j("div", Gs, " (" + D(t(ft)(x.totalCost)) + ") ", 1)) : oe("", !0)
1218
+ s("div", Ws, V(h.code), 1),
1219
+ h.totalCost && t(l).enableTotalCost ? (R(), j("div", Gs, " (" + V(t(ft)(h.totalCost)) + ") ", 1)) : oe("", !0)
1221
1220
  ]),
1222
- t(xt)(x) ? (R(), j("div", Ws, [
1223
- p(K, {
1221
+ t(ht)(h) ? (R(), j("div", Ks, [
1222
+ p(W, {
1224
1223
  name: "error",
1225
1224
  color: "system-error-300",
1226
1225
  size: "sm"
1227
1226
  }),
1228
- h[4] || (h[4] = s("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))
1227
+ x[4] || (x[4] = s("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))
1229
1228
  ])) : oe("", !0)
1230
1229
  ]))), 128))
1231
1230
  ])
1232
1231
  ]),
1233
- h[6] || (h[6] = s("div", null, null, -1)),
1234
- h[7] || (h[7] = s("div", null, null, -1)),
1235
- s("div", Ys, [
1236
- h[5] || (h[5] = s("div", { class: "flex flex-col" }, [
1232
+ x[6] || (x[6] = s("div", null, null, -1)),
1233
+ x[7] || (x[7] = s("div", null, null, -1)),
1234
+ s("div", Zs, [
1235
+ x[5] || (x[5] = s("div", { class: "flex flex-col" }, [
1237
1236
  s("div", { class: "fm-typo-en-body-lg-600" }, "Enabled locations"),
1238
1237
  s("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " This template is only usable for the following locations. ")
1239
1238
  ], -1)),
1240
- s("div", Zs, [
1239
+ s("div", Js, [
1241
1240
  p(y, {
1242
1241
  modelValue: o.value,
1243
- "onUpdate:modelValue": h[0] || (h[0] = (x) => o.value = x),
1242
+ "onUpdate:modelValue": x[0] || (x[0] = (h) => o.value = h),
1244
1243
  placeholder: "Filter locations",
1245
1244
  "prepend-icon": "search"
1246
1245
  }, null, 8, ["modelValue"]),
@@ -1257,10 +1256,10 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1257
1256
  ];
1258
1257
  }),
1259
1258
  "side-sheet-footer": N(() => [
1260
- s("div", Js, [
1259
+ s("div", Xs, [
1261
1260
  p(k, {
1262
1261
  label: t(g)("common.edit"),
1263
- onClick: h[1] || (h[1] = (C) => e("action:edit")),
1262
+ onClick: x[1] || (x[1] = (C) => e("action:edit")),
1264
1263
  variant: "tertiary"
1265
1264
  }, null, 8, ["label"])
1266
1265
  ])
@@ -1269,22 +1268,22 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1269
1268
  }, 8, ["header", "modelValue", "dismiss-away"]);
1270
1269
  };
1271
1270
  }
1272
- }), eo = { class: "flex-1 flex flex-col gap-8" }, to = { class: "flex flex-col" }, so = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, oo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, lo = { class: "fm-typo-en-body-lg-400" }, no = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, ao = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, ho = /* @__PURE__ */ ee({
1271
+ }), eo = { class: "flex-1 flex flex-col gap-8" }, to = { class: "flex flex-col" }, so = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, oo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, no = { class: "fm-typo-en-body-lg-400" }, lo = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, ao = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, _o = /* @__PURE__ */ ee({
1273
1272
  __name: "TransferTemplateView",
1274
1273
  setup(m) {
1275
- const { t: c } = le(), { createTemplate: v, viewTemplate: e, importTemplates: n, exportTemplates: g } = qe(), { templateDialogProps: b, templateDetailsProps: i } = Ee(qe()), o = gt(), { loading: u, templates: _ } = Ee(o), P = Q(!1), I = yt(), h = We(), { breakpoints: S } = wt();
1274
+ const { t: c } = ne(), { createTemplate: v, viewTemplate: e, importTemplates: l, exportTemplates: g } = qe(), { templateDialogProps: b, templateDetailsProps: i } = Ee(qe()), o = gt(), { loading: u, templates: _ } = Ee(o), P = Q(!1), I = yt(), x = Ke(), { breakpoints: S } = wt();
1276
1275
  ve(o.fetchTemplates);
1277
- const V = U(
1278
- () => P.value || u.value || !h._currentLocation
1279
- ), K = U(() => _.value), y = Q(""), d = U(() => S.value.xs || S.value.sm), k = U(() => d.value ? 10 : 20);
1276
+ const D = U(
1277
+ () => P.value || u.value || !x._currentLocation
1278
+ ), W = U(() => _.value), y = Q(""), d = U(() => S.value.xs || S.value.sm), k = U(() => d.value ? 10 : 20);
1280
1279
  function a($) {
1281
1280
  switch ($) {
1282
- case Le.Add:
1281
+ case Be.Add:
1283
1282
  return v();
1284
1283
  case "refresh":
1285
1284
  return o.fetchTemplates();
1286
1285
  case "import":
1287
- return n();
1286
+ return l();
1288
1287
  case "export":
1289
1288
  return g();
1290
1289
  }
@@ -1295,7 +1294,7 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1295
1294
  const C = U(() => [
1296
1295
  {
1297
1296
  label: c("inventory.closing.template.create.title"),
1298
- value: Le.Add,
1297
+ value: Be.Add,
1299
1298
  isPrimary: !0,
1300
1299
  prependIcon: "add"
1301
1300
  },
@@ -1315,8 +1314,8 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1315
1314
  isPrimary: !1
1316
1315
  }
1317
1316
  ]);
1318
- return ($, x) => {
1319
- const l = A("FmTable");
1317
+ return ($, h) => {
1318
+ const n = A("FmTable");
1320
1319
  return R(), j(_e, null, [
1321
1320
  p(vt, {
1322
1321
  title: t(c)("inventory.transfer.template.title2"),
@@ -1327,7 +1326,7 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1327
1326
  var r;
1328
1327
  return [
1329
1328
  s("div", {
1330
- class: X([
1329
+ class: Y([
1331
1330
  "flex flex-col gap-8 max-h-full",
1332
1331
  {
1333
1332
  "p-0": d.value,
@@ -1338,59 +1337,59 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1338
1337
  p(bt, {
1339
1338
  searchable: "",
1340
1339
  search: y.value,
1341
- "onUpdate:search": x[0] || (x[0] = (T) => y.value = T)
1340
+ "onUpdate:search": h[0] || (h[0] = (T) => y.value = T)
1342
1341
  }, null, 8, ["search"]),
1343
- (R(), J(l, {
1342
+ (R(), X(n, {
1344
1343
  style: He(t(I).tableHeight),
1345
1344
  "column-defs": t(o).columnDefs,
1346
- "row-data": K.value,
1345
+ "row-data": W.value,
1347
1346
  "search-value": y.value,
1348
- loading: V.value,
1349
- key: (r = t(h)._currentLocation) == null ? void 0 : r.dbName,
1350
- onRowClick: x[1] || (x[1] = (T) => t(e)(T.original)),
1347
+ loading: D.value,
1348
+ key: (r = t(x)._currentLocation) == null ? void 0 : r.dbName,
1349
+ onRowClick: h[1] || (h[1] = (T) => t(e)(T.original)),
1351
1350
  "page-size": k.value
1352
1351
  }, {
1353
1352
  "list-row": N((T) => [
1354
- p(Ye, {
1353
+ p(Ze, {
1355
1354
  row: T,
1356
1355
  onRowClick: (F) => t(e)(F)
1357
1356
  }, {
1358
1357
  default: N((F) => {
1359
- var B, z, O, M, L, q, w, E, te, he, xe, ge, ke, ae, Te, we, Fe, Ie, Se, Ce, re, $e, Oe, Me, Ve, ie, De;
1358
+ var L, z, O, M, B, q, w, E, te, xe, he, ge, ke, ae, Te, we, Fe, Ie, Se, Ce, re, $e, Oe, Me, De, ie, Ve;
1360
1359
  return [
1361
1360
  s("div", eo, [
1362
1361
  s("div", to, [
1363
1362
  s("div", so, [
1364
- p(t(W), {
1365
- render: (O = (z = (B = F._id) == null ? void 0 : B.column) == null ? void 0 : z.columnDef) == null ? void 0 : O.cell,
1366
- props: (L = (M = F._id) == null ? void 0 : M.getContext) == null ? void 0 : L.call(M)
1363
+ p(t(K), {
1364
+ render: (O = (z = (L = F._id) == null ? void 0 : L.column) == null ? void 0 : z.columnDef) == null ? void 0 : O.cell,
1365
+ props: (B = (M = F._id) == null ? void 0 : M.getContext) == null ? void 0 : B.call(M)
1367
1366
  }, null, 8, ["render", "props"])
1368
1367
  ]),
1369
1368
  s("div", oo, [
1370
- p(t(W), {
1369
+ p(t(K), {
1371
1370
  render: (E = (w = (q = F.name) == null ? void 0 : q.column) == null ? void 0 : w.columnDef) == null ? void 0 : E.cell,
1372
- props: (he = (te = F.name) == null ? void 0 : te.getContext) == null ? void 0 : he.call(te)
1371
+ props: (xe = (te = F.name) == null ? void 0 : te.getContext) == null ? void 0 : xe.call(te)
1373
1372
  }, null, 8, ["render", "props"])
1374
1373
  ]),
1375
- s("div", lo, [
1376
- p(t(W), {
1377
- render: (ke = (ge = (xe = F.supplier) == null ? void 0 : xe.column) == null ? void 0 : ge.columnDef) == null ? void 0 : ke.cell,
1374
+ s("div", no, [
1375
+ p(t(K), {
1376
+ render: (ke = (ge = (he = F.supplier) == null ? void 0 : he.column) == null ? void 0 : ge.columnDef) == null ? void 0 : ke.cell,
1378
1377
  props: (Te = (ae = F.supplier) == null ? void 0 : ae.getContext) == null ? void 0 : Te.call(ae)
1379
1378
  }, null, 8, ["render", "props"])
1380
1379
  ]),
1381
- s("div", null, D((we = T.original.locations) != null && we.length ? `Enabled for ${(Fe = T.original.locations) == null ? void 0 : Fe.length} outlets` : "Enabled for all outlets"), 1),
1382
- s("div", no, D(T.original.purchaseOrder.items.length ? T.original.purchaseOrder.items.map((Xe) => Xe.name).join(", ") : "No items"), 1),
1380
+ s("div", null, V((we = T.original.locations) != null && we.length ? `Enabled for ${(Fe = T.original.locations) == null ? void 0 : Fe.length} outlets` : "Enabled for all outlets"), 1),
1381
+ s("div", lo, V(T.original.purchaseOrder.items.length ? T.original.purchaseOrder.items.map((Ye) => Ye.name).join(", ") : "No items"), 1),
1383
1382
  s("div", ao, [
1384
- p(t(W), {
1383
+ p(t(K), {
1385
1384
  render: (Ce = (Se = (Ie = F.ref) == null ? void 0 : Ie.column) == null ? void 0 : Se.columnDef) == null ? void 0 : Ce.cell,
1386
1385
  props: ($e = (re = F.ref) == null ? void 0 : re.getContext) == null ? void 0 : $e.call(re)
1387
1386
  }, null, 8, ["render", "props"])
1388
1387
  ])
1389
1388
  ]),
1390
1389
  s("div", null, [
1391
- p(t(W), {
1392
- render: (Ve = (Me = (Oe = F.type) == null ? void 0 : Oe.column) == null ? void 0 : Me.columnDef) == null ? void 0 : Ve.cell,
1393
- props: (De = (ie = F.type) == null ? void 0 : ie.getContext) == null ? void 0 : De.call(ie)
1390
+ p(t(K), {
1391
+ render: (De = (Me = (Oe = F.type) == null ? void 0 : Oe.column) == null ? void 0 : Me.columnDef) == null ? void 0 : De.cell,
1392
+ props: (Ve = (ie = F.type) == null ? void 0 : ie.getContext) == null ? void 0 : Ve.call(ie)
1394
1393
  }, null, 8, ["render", "props"])
1395
1394
  ])
1396
1395
  ])
@@ -1406,10 +1405,10 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1406
1405
  }),
1407
1406
  _: 1
1408
1407
  }, 8, ["title", "actions"]),
1409
- (R(), J(st, { to: "body" }, [
1410
- p(Xs, ot(lt(t(i))), null, 16),
1408
+ (R(), X(st, { to: "body" }, [
1409
+ p(Ys, ot(nt(t(i))), null, 16),
1411
1410
  p(gs, Qe(t(b), {
1412
- onSubmitted: x[2] || (x[2] = (r) => t(o).fetchTemplates())
1411
+ onSubmitted: h[2] || (h[2] = (r) => t(o).fetchTemplates())
1413
1412
  }), null, 16)
1414
1413
  ]))
1415
1414
  ], 64);
@@ -1417,5 +1416,5 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-cen
1417
1416
  }
1418
1417
  });
1419
1418
  export {
1420
- ho as default
1419
+ _o as default
1421
1420
  };