@feedmepos/mf-inventory-portal 0.0.22-dev.23 → 0.0.22-dev.24

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 (33) hide show
  1. package/dist/{ApprovalView-C5jr9Rv7.js → ApprovalView-CZEOSFru.js} +4 -4
  2. package/dist/{BindingsDialog-DwQ2FG0q.js → BindingsDialog-iBZC_QDN.js} +1 -1
  3. package/dist/{BindingsPicker-DHzbaxZA.js → BindingsPicker-NAj0WmeR.js} +1 -1
  4. package/dist/{BindingsTable-Cdl38M5V.js → BindingsTable-p22R7suj.js} +1 -1
  5. package/dist/{ClosingTemplateView-CNI2s4p9.js → ClosingTemplateView-T-3klkyu.js} +5 -5
  6. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BKvEBn1i.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-R5hnQlay.js} +1 -1
  7. package/dist/{IngredientsView-DS_l9O8H.js → IngredientsView-L2tMndtX.js} +3 -3
  8. package/dist/{IntegrationView-PxEi1K-z.js → IntegrationView-CmWJiCEe.js} +2 -2
  9. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DIOR3LyW.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D4vAS6gY.js} +1 -1
  10. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CGUFCqIs.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BOmZ_h5b.js} +1 -1
  11. package/dist/{PurchaseOrderPrintPreview-Bkt9dkCI.js → PurchaseOrderPrintPreview-C1CDOlfV.js} +1 -1
  12. package/dist/{ReceiveRequestView-BpKYdSAx.js → ReceiveRequestView-RONhvtH3.js} +6 -6
  13. package/dist/{RecipeView-DwMVz69Y.js → RecipeView-DAKDPe9p.js} +3 -3
  14. package/dist/{StockView-DyLe5KUJ.js → StockView-DMY30yTq.js} +6 -6
  15. package/dist/{SupplierView-CtlZH86C.js → SupplierView-wo0vm0zp.js} +3 -3
  16. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Cbq-C-lN.js → TransferDetails.vue_vue_type_script_setup_true_lang-CPnJoocO.js} +4 -4
  17. package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-BI6GT9hU.js → TransferDialog.vue_vue_type_script_setup_true_lang-D9xk2eG9.js} +547 -543
  18. package/dist/{TransferTemplateView-Bn-h0lIx.js → TransferTemplateView-Bu8cFL0E.js} +8 -8
  19. package/dist/{UnitView-BZKRc5bQ.js → UnitView-NHhQ8_zS.js} +4 -4
  20. package/dist/{WarehouseView-heXatxJN.js → WarehouseView-spqcKIhp.js} +2 -2
  21. package/dist/{app-BcRtBju3.js → app-oMmPlWI8.js} +300 -300
  22. package/dist/app.js +1 -1
  23. package/dist/{decimal-BW4-dJkS.js → decimal-4camzaMo.js} +1 -1
  24. package/dist/{defineDeepModel-uuiMt6SI.js → defineDeepModel-BXdpx3f7.js} +1 -1
  25. package/dist/{format-time-from-id-CFFnB2Xm.js → format-time-from-id-qMM41rcj.js} +1 -1
  26. package/dist/{id-to-date-Eq_Y7TFp.js → id-to-date-B1InnVkV.js} +1 -1
  27. package/dist/{purchase-order-transaction-type-BeETndfM.js → purchase-order-transaction-type-BAXZRNJ7.js} +3 -3
  28. package/dist/{supplier-BWqPgsDR.js → supplier-C708CRUk.js} +1 -1
  29. package/dist/{use-template-enabled-locations-2-L61HiXQo.js → use-template-enabled-locations-2-Rp0RC8xT.js} +1 -1
  30. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +38 -1
  31. package/dist/{xlsx-DnAptFFG.js → xlsx-AkMhmIy7.js} +1 -1
  32. package/dist/{xlsx.util-CwrbPSsY.js → xlsx.util-DT03683X.js} +2 -2
  33. package/package.json +1 -1
@@ -1,22 +1,22 @@
1
- import { reactive as Ge, onMounted as qe, computed as P, h as M, defineComponent as ie, openBlock as F, createElementBlock as $, Fragment as re, renderList as $e, createElementVNode as r, toDisplayString as D, unref as e, resolveComponent as I, createVNode as k, withCtx as O, createCommentVNode as z, ref as q, createBlock as j, watch as De, normalizeClass as Y, normalizeStyle as et, isRef as me } from "vue";
1
+ import { reactive as Ge, onMounted as Le, computed as T, h as q, defineComponent as ie, openBlock as F, createElementBlock as V, Fragment as re, renderList as $e, createElementVNode as r, toDisplayString as R, unref as e, resolveComponent as I, createVNode as _, withCtx as U, createCommentVNode as z, ref as L, createBlock as j, watch as De, normalizeClass as Y, normalizeStyle as et, isRef as me } from "vue";
2
2
  import { useBreakpoints as Ne, components as pe, FmButtonVariant as tt, useSnackbar as Re, useDialog as st, useProxiedModel as ot } from "@feedmepos/ui-library";
3
3
  import { F as ke } from "./row-action.enum-PMKMRrZR.js";
4
- import { P as V, d as He, c as nt } from "./purchase-order-transaction-type-BeETndfM.js";
5
- import { a as Z, t as lt, ab as Ae, E as at, b as ze, R as Ve, a5 as rt, a7 as it, s as ut, a8 as Ee, a6 as dt, H as je, m as ct, A as Pe, M as pt, ac as Qe, P as Oe, Q as We, ad as mt, j as Ue, ae as ft, u as Be, af as yt, ag as vt, ah as bt, G as _t, ai as gt, aj as kt, z as Ct } from "./app-BcRtBju3.js";
6
- import { _ as Ye, u as ht } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-CGUFCqIs.js";
4
+ import { P as D, d as He, c as nt } from "./purchase-order-transaction-type-BAXZRNJ7.js";
5
+ import { a as Z, t as lt, ab as Ae, E as at, b as ze, R as Ve, a5 as rt, a7 as it, s as ut, a8 as Ee, a6 as dt, H as je, m as ct, A as Pe, M as pt, ac as Qe, P as Oe, Q as We, ad as mt, j as Ue, ae as ft, u as Be, af as yt, ag as vt, ah as bt, G as _t, ai as gt, aj as kt, z as Ct } from "./app-oMmPlWI8.js";
6
+ import { _ as Ye, u as ht } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BOmZ_h5b.js";
7
7
  import { useI18n as ye } from "@feedmepos/mf-common";
8
8
  import "vue-router";
9
- import { u as Ie } from "./supplier-BWqPgsDR.js";
10
- import { d as wt } from "./defineDeepModel-uuiMt6SI.js";
9
+ import { u as Te } from "./supplier-C708CRUk.js";
10
+ import { d as wt } from "./defineDeepModel-BXdpx3f7.js";
11
11
  import { F as fe, _ as St } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
12
12
  import { _ as xt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
13
- function ae(n, v, u, i) {
14
- var c, p, g;
15
- if (i != null && i.manualTotalCost)
16
- return i == null ? void 0 : i.manualTotalCost;
17
- const d = (g = (p = (c = i == null ? void 0 : i.supplier) == null ? void 0 : c.supplyItems) == null ? void 0 : p.find(
18
- (y) => y.skuId === n._id
19
- )) == null ? void 0 : g.defaultCost, t = n.defaultCost, l = d ?? t, w = l == null ? void 0 : l.costPerUnit, m = w ? l != null && l.measurement ? +Z(w) / +Z(l == null ? void 0 : l.measurement.conversion) : +Z(w) : void 0, s = m ? u ? m * +Z(u.conversion) : m : void 0, a = s ? +Z(v) * s : void 0;
13
+ function ae(l, v, i, d) {
14
+ var k, x, p;
15
+ if (d != null && d.manualTotalCost)
16
+ return d == null ? void 0 : d.manualTotalCost;
17
+ const m = (p = (x = (k = d == null ? void 0 : d.supplier) == null ? void 0 : k.supplyItems) == null ? void 0 : x.find(
18
+ (u) => u.skuId === l._id
19
+ )) == null ? void 0 : p.defaultCost, t = l.defaultCost, n = m ?? t, S = n == null ? void 0 : n.costPerUnit, c = S ? n != null && n.measurement ? +Z(S) / +Z(n == null ? void 0 : n.measurement.conversion) : +Z(S) : void 0, s = c ? i ? c * +Z(i.conversion) : c : void 0, a = s ? +Z(v) * s : void 0;
20
20
  return a ? {
21
21
  ...lt(a ?? 0, 2),
22
22
  currency: Ae()
@@ -26,46 +26,46 @@ function ae(n, v, u, i) {
26
26
  currency: Ae()
27
27
  };
28
28
  }
29
- var B = /* @__PURE__ */ ((n) => (n.Code = "Code", n.Name = "Name", n.Amount = "Amount", n.Cost = "Cost", n.Delete = "Delete", n))(B || {});
29
+ var E = /* @__PURE__ */ ((l) => (l.Code = "Code", l.Name = "Name", l.Amount = "Amount", l.Cost = "Cost", l.Delete = "Delete", l))(E || {});
30
30
  const Ft = () => {
31
- const { t: n } = ye();
32
- return M(
31
+ const { t: l } = ye();
32
+ return q(
33
33
  Ye,
34
34
  {
35
35
  zIndex: 50,
36
36
  class: "whitespace-nowrap"
37
37
  },
38
- n("inventory.transfer.form.items.table.Cost", [Qe()])
38
+ l("inventory.transfer.form.items.table.Cost", [Qe()])
39
39
  );
40
40
  };
41
- function Pt(n) {
42
- const { t: v } = ye(), u = Ge({}), { breakpoints: i } = Ne(), d = ze();
43
- qe(() => {
44
- for (const m of n.items) {
45
- if (!m.totalCost)
41
+ function Pt(l) {
42
+ const { t: v } = ye(), i = Ge({}), { breakpoints: d } = Ne(), m = ze();
43
+ Le(() => {
44
+ for (const c of l.items) {
45
+ if (!c.totalCost)
46
46
  continue;
47
- const s = ae(m.sku, m.quantity, m.measurement, {
48
- supplier: n.supplier
49
- }), a = m.totalCost ?? at.reset();
50
- s ? u[m.sku._id] = s.amount !== a.amount || s.precision !== a.precision : u[m.sku._id] = !0;
47
+ const s = ae(c.sku, c.quantity, c.measurement, {
48
+ supplier: l.supplier
49
+ }), a = c.totalCost ?? at.reset();
50
+ s ? i[c.sku._id] = s.amount !== a.amount || s.precision !== a.precision : i[c.sku._id] = !0;
51
51
  }
52
52
  });
53
- function t(m) {
54
- var a, b, c, p, g, y, S;
55
- return !!(((b = (a = m.defaultCost) == null ? void 0 : a.costPerUnit) == null ? void 0 : b.amount) ?? ((S = (y = (g = (p = (c = n.supplier) == null ? void 0 : c.supplyItems) == null ? void 0 : p.find((x) => x.skuId === m._id)) == null ? void 0 : g.defaultCost) == null ? void 0 : y.costPerUnit) == null ? void 0 : S.amount));
53
+ function t(c) {
54
+ var a, y, k, x, p, u, h;
55
+ return !!(((y = (a = c.defaultCost) == null ? void 0 : a.costPerUnit) == null ? void 0 : y.amount) ?? ((h = (u = (p = (x = (k = l.supplier) == null ? void 0 : k.supplyItems) == null ? void 0 : x.find((C) => C.skuId === c._id)) == null ? void 0 : p.defaultCost) == null ? void 0 : u.costPerUnit) == null ? void 0 : h.amount));
56
56
  }
57
- const l = [
57
+ const n = [
58
58
  {
59
59
  id: "Code",
60
60
  header: () => v("inventory.transfer.form.items.table.Code"),
61
61
  accessorKey: "code",
62
62
  size: 96,
63
- cell(m) {
64
- const s = m.row.original;
65
- return M(pe.FmTextField, {
63
+ cell(c) {
64
+ const s = c.row.original;
65
+ return q(pe.FmTextField, {
66
66
  modelValue: s.code,
67
67
  "onUpdate:modelValue": (a) => {
68
- n.updateItem({
68
+ l.updateItem({
69
69
  ...s,
70
70
  code: a
71
71
  });
@@ -81,12 +81,12 @@ function Pt(n) {
81
81
  id: "Name",
82
82
  header: () => v("inventory.transfer.form.items.table.Name"),
83
83
  minSize: 300,
84
- cell(m) {
85
- const s = m.row.original;
86
- return M(pe.FmTextField, {
84
+ cell(c) {
85
+ const s = c.row.original;
86
+ return q(pe.FmTextField, {
87
87
  modelValue: s.name,
88
88
  "onUpdate:modelValue": (a) => {
89
- n.updateItem({
89
+ l.updateItem({
90
90
  ...s,
91
91
  name: a
92
92
  });
@@ -102,12 +102,12 @@ function Pt(n) {
102
102
  id: "Amount",
103
103
  header: () => v("inventory.transfer.form.items.table.Amount"),
104
104
  minSize: 200,
105
- cell(m) {
106
- var b, c, p;
107
- const s = m.row.original, a = (p = (c = (b = n.template) == null ? void 0 : b.purchaseOrder) == null ? void 0 : c.items) == null ? void 0 : p.find(
108
- (g) => g.sku._id === s.sku._id
105
+ cell(c) {
106
+ var y, k, x;
107
+ const s = c.row.original, a = (x = (k = (y = l.template) == null ? void 0 : y.purchaseOrder) == null ? void 0 : k.items) == null ? void 0 : x.find(
108
+ (p) => p.sku._id === s.sku._id
109
109
  );
110
- return M(rt, {
110
+ return q(rt, {
111
111
  style: {
112
112
  flex: "1 1 0%"
113
113
  },
@@ -117,22 +117,22 @@ function Pt(n) {
117
117
  },
118
118
  key: s.sku._id,
119
119
  unit: s.sku.unit,
120
- "onUpdate:modelValue": (g) => {
121
- const y = {
120
+ "onUpdate:modelValue": (p) => {
121
+ const u = {
122
122
  ...s,
123
- quantity: g.amount,
124
- measurement: g.measurement
123
+ quantity: p.amount,
124
+ measurement: p.measurement
125
125
  };
126
- d.enableTotalCost && (y.totalCost = ae(s.sku, s.quantity, s.measurement, {
127
- supplier: n.supplier,
126
+ m.enableTotalCost && (u.totalCost = ae(s.sku, s.quantity, s.measurement, {
127
+ supplier: l.supplier,
128
128
  // NOTE: set undefined here if `manualTotalCost[row.sku._id] = false`, so that the function
129
129
  // will return the auto calculated default cost instead of the manual total cost
130
- manualTotalCost: u[s.sku._id] ? y.totalCost : void 0
131
- })), n.updateItem(y);
130
+ manualTotalCost: i[s.sku._id] ? u.totalCost : void 0
131
+ })), l.updateItem(u);
132
132
  },
133
133
  stepper: a == null ? void 0 : a.quantityStep,
134
134
  disableUnit: !!a,
135
- disabled: n.disabled,
135
+ disabled: l.disabled,
136
136
  rules: [
137
137
  it(
138
138
  +Z(
@@ -156,55 +156,55 @@ function Pt(n) {
156
156
  id: "Cost",
157
157
  header: Ft,
158
158
  size: 180,
159
- cell(m) {
160
- const s = m.row.original, a = t(s.sku), b = i.value.xs || i.value.sm;
161
- return !u[s.sku._id] && a ? M(
159
+ cell(c) {
160
+ const s = c.row.original, a = t(s.sku), y = d.value.xs || d.value.sm;
161
+ return !i[s.sku._id] && a ? q(
162
162
  "div",
163
163
  {
164
164
  class: [
165
165
  "flex gap-4 fm-typo-en-body-md-400 items-center",
166
- n.disabled ? "text-fm-color-typo-disabled" : ""
166
+ l.disabled ? "text-fm-color-typo-disabled" : ""
167
167
  ],
168
168
  key: s.sku._id
169
169
  },
170
170
  [
171
- M(pe.FmButton, {
171
+ q(pe.FmButton, {
172
172
  prependIcon: "edit",
173
173
  variant: tt.Tertiary,
174
- disabled: n.disabled,
174
+ disabled: l.disabled,
175
175
  onClick() {
176
- n.updateItem({
176
+ l.updateItem({
177
177
  ...s,
178
178
  totalCost: ae(s.sku, s.quantity, s.measurement, {
179
- supplier: n.supplier
179
+ supplier: l.supplier
180
180
  })
181
- }), u[s.sku._id] = !0;
181
+ }), i[s.sku._id] = !0;
182
182
  }
183
183
  }),
184
- M(
184
+ q(
185
185
  "div",
186
186
  {
187
187
  class: "flex flex-col"
188
188
  },
189
189
  [
190
- M(
190
+ q(
191
191
  "span",
192
- b ? je(
192
+ y ? je(
193
193
  ae(s.sku, s.quantity, s.measurement, {
194
- supplier: n.supplier
194
+ supplier: l.supplier
195
195
  })
196
196
  ) : Z(
197
197
  ae(s.sku, s.quantity, s.measurement, {
198
- supplier: n.supplier
198
+ supplier: l.supplier
199
199
  })
200
200
  )
201
201
  ),
202
- M(
202
+ q(
203
203
  "span",
204
204
  {
205
205
  class: [
206
206
  "fm-typo-en-body-sm-400",
207
- n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
207
+ l.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
208
208
  ]
209
209
  },
210
210
  v("inventory.transfer.form.items.autoCalculated")
@@ -212,16 +212,16 @@ function Pt(n) {
212
212
  ]
213
213
  )
214
214
  ]
215
- ) : M(
215
+ ) : q(
216
216
  pe.FmTextField,
217
217
  {
218
218
  modelValue: Z(s.totalCost ?? { amount: 0, precision: 0 }),
219
219
  key: s.sku._id,
220
- "onUpdate:modelValue": (c) => {
221
- n.updateItem({
220
+ "onUpdate:modelValue": (k) => {
221
+ l.updateItem({
222
222
  ...s,
223
223
  totalCost: {
224
- ...ct(+c),
224
+ ...ct(+k),
225
225
  currency: Ae()
226
226
  }
227
227
  });
@@ -230,31 +230,31 @@ function Pt(n) {
230
230
  },
231
231
  {
232
232
  prepend() {
233
- return b ? M(
233
+ return y ? q(
234
234
  "div",
235
235
  {
236
236
  class: [
237
237
  "text-fm-typo-en-body-lg-400",
238
- n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
238
+ l.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
239
239
  ]
240
240
  },
241
241
  Qe()
242
242
  ) : null;
243
243
  },
244
244
  append() {
245
- return a ? M(pe.FmButton, {
245
+ return a ? q(pe.FmButton, {
246
246
  prependIcon: "close",
247
247
  variant: "tertiary",
248
- disabled: n.disabled,
248
+ disabled: l.disabled,
249
249
  onClick() {
250
- n.updateItem({
250
+ l.updateItem({
251
251
  ...s,
252
252
  // NOTE: different from PO template, if a default cost is reenabled,
253
253
  // the total cost will automatically assigned
254
254
  totalCost: ae(s.sku, s.quantity, s.measurement, {
255
- supplier: n.supplier
255
+ supplier: l.supplier
256
256
  })
257
- }), u[s.sku._id] = !1;
257
+ }), i[s.sku._id] = !1;
258
258
  }
259
259
  }) : null;
260
260
  }
@@ -266,18 +266,18 @@ function Pt(n) {
266
266
  {
267
267
  id: "Delete",
268
268
  header: "",
269
- cell(m) {
270
- const s = m.row.original;
271
- return M(pe.FmButton, {
269
+ cell(c) {
270
+ const s = c.row.original;
271
+ return q(pe.FmButton, {
272
272
  key: s.sku._id,
273
273
  class: "delete-button",
274
274
  type: "button",
275
275
  icon: "delete",
276
276
  variant: "tertiary",
277
277
  size: "md",
278
- disabled: n.disabled,
278
+ disabled: l.disabled,
279
279
  onClick: () => {
280
- n.deleteItem(s);
280
+ l.deleteItem(s);
281
281
  }
282
282
  });
283
283
  },
@@ -290,47 +290,47 @@ function Pt(n) {
290
290
  }
291
291
  ];
292
292
  return {
293
- columnDefs: P(() => d.enableTotalCost && n.transferType === V.PURCHASE ? l : l.filter(
294
- (m) => m.id !== "Cost"
293
+ columnDefs: T(() => m.enableTotalCost && l.transferType === D.PURCHASE ? n : n.filter(
294
+ (c) => c.id !== "Cost"
295
295
  /* Cost */
296
296
  ))
297
297
  };
298
298
  }
299
- const It = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, Tt = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, $t = { class: "w-[450px] xs:w-full flex" }, At = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, Vt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ze = /* @__PURE__ */ ie({
299
+ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, It = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, $t = { class: "w-[450px] xs:w-full flex" }, At = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, Vt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ze = /* @__PURE__ */ ie({
300
300
  __name: "SupplierPriceHistory",
301
301
  props: {
302
302
  prices: {}
303
303
  },
304
- setup(n) {
305
- const v = Ie();
306
- function u(i) {
307
- return v.suppliers.find((d) => d._id === i);
304
+ setup(l) {
305
+ const v = Te();
306
+ function i(d) {
307
+ return v.suppliers.find((m) => m._id === d);
308
308
  }
309
- return (i, d) => (F(), $("div", It, [
310
- (F(!0), $(re, null, $e(Object.keys(i.prices), (t) => {
311
- var l;
312
- return F(), $("div", {
309
+ return (d, m) => (F(), V("div", Tt, [
310
+ (F(!0), V(re, null, $e(Object.keys(d.prices), (t) => {
311
+ var n;
312
+ return F(), V("div", {
313
313
  key: t,
314
314
  class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
315
315
  }, [
316
- r("div", Tt, D((l = u(t)) == null ? void 0 : l.name), 1),
316
+ r("div", It, R((n = i(t)) == null ? void 0 : n.name), 1),
317
317
  r("div", $t, [
318
- (F(!0), $(re, null, $e(i.prices[t].slice(0, 3), (w) => {
319
- var m;
320
- return F(), $("div", {
321
- key: w.date,
318
+ (F(!0), V(re, null, $e(d.prices[t].slice(0, 3), (S) => {
319
+ var c;
320
+ return F(), V("div", {
321
+ key: S.date,
322
322
  class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
323
323
  }, [
324
324
  r("div", At, [
325
- r("span", null, D(w.totalCost ? e(je)(w.totalCost) : "No data"), 1),
326
- d[0] || (d[0] = r("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
327
- r("span", null, D(e(Z)(w.totalUnit, !1)), 1),
328
- r("span", null, D(((m = w.measurement) == null ? void 0 : m.abbrev) ?? w.unit.abbrev), 1)
325
+ r("span", null, R(S.totalCost ? e(je)(S.totalCost) : "No data"), 1),
326
+ m[0] || (m[0] = r("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
327
+ r("span", null, R(e(Z)(S.totalUnit, !1)), 1),
328
+ r("span", null, R(((c = S.measurement) == null ? void 0 : c.abbrev) ?? S.unit.abbrev), 1)
329
329
  ]),
330
330
  r("div", Vt, [
331
- r("span", null, "(#" + D(w.seqNumber) + ")", 1),
332
- d[1] || (d[1] = r("span", null, D(" "), -1)),
333
- r("span", null, D(e(Oe)(new Date(w.date))), 1)
331
+ r("span", null, "(#" + R(S.seqNumber) + ")", 1),
332
+ m[1] || (m[1] = r("span", null, R(" "), -1)),
333
+ r("span", null, R(e(Oe)(new Date(S.date))), 1)
334
334
  ])
335
335
  ]);
336
336
  }), 128))
@@ -339,7 +339,7 @@ const It = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
339
339
  }), 128))
340
340
  ]));
341
341
  }
342
- }), Dt = { class: "flex flex-col gap-8 py-16" }, Rt = { class: "flex items-center" }, Ot = { class: "flex-1 flex gap-1 items-center" }, Ut = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Bt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Mt = { class: "flex gap-8 w-full" }, Et = { class: "flex-1 flex flex-col gap-4" }, Lt = { class: "flex-1 flex flex-col gap-4" }, qt = { class: "flex gap-8 w-full" }, Nt = { class: "flex-1 flex flex-col gap-4" }, Ht = {
342
+ }), Dt = { class: "flex flex-col gap-8 py-16" }, Rt = { class: "flex items-center" }, Ot = { class: "flex-1 flex gap-1 items-center" }, Ut = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Bt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Mt = { class: "flex gap-8 w-full" }, Et = { class: "flex-1 flex flex-col gap-4" }, qt = { class: "flex-1 flex flex-col gap-4" }, Lt = { class: "flex gap-8 w-full" }, Nt = { class: "flex-1 flex flex-col gap-4" }, Ht = {
343
343
  key: 0,
344
344
  class: "flex-1 flex flex-col gap-4"
345
345
  }, zt = /* @__PURE__ */ ie({
@@ -350,212 +350,216 @@ const It = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
350
350
  showComparePrice: { type: Boolean },
351
351
  row: {}
352
352
  },
353
- setup(n) {
353
+ setup(l) {
354
354
  const { t: v } = ye();
355
- return (u, i) => {
356
- var l, w, m, s, a, b, c, p, g, y, S, x, E, A, U, L, G, ee, K, J, Q, _, C, R, te, W, se;
357
- const d = I("FmLabel"), t = I("FmSpacer");
358
- return F(), $("div", Dt, [
355
+ return (i, d) => {
356
+ var n, S, c, s, a, y, k, x, p, u, h, C, B, P, $, M, G, ee, K, J, Q, b, g, O, te, W, se;
357
+ const m = I("FmLabel"), t = I("FmSpacer");
358
+ return F(), V("div", Dt, [
359
359
  r("div", Rt, [
360
360
  r("div", Ot, [
361
- r("span", Ut, " (" + D(u.row.original.sku.code) + ") ", 1),
362
- r("span", Bt, D(u.row.original.sku.name), 1)
361
+ r("span", Ut, " (" + R(i.row.original.sku.code) + ") ", 1),
362
+ r("span", Bt, R(i.row.original.sku.name), 1)
363
363
  ]),
364
364
  r("div", null, [
365
- k(e(fe), {
366
- render: (m = (w = (l = u.cellByColId.Delete) == null ? void 0 : l.column) == null ? void 0 : w.columnDef) == null ? void 0 : m.cell,
367
- props: (a = (s = u.cellByColId.Delete) == null ? void 0 : s.getContext) == null ? void 0 : a.call(s)
365
+ _(e(fe), {
366
+ render: (c = (S = (n = i.cellByColId.Delete) == null ? void 0 : n.column) == null ? void 0 : S.columnDef) == null ? void 0 : c.cell,
367
+ props: (a = (s = i.cellByColId.Delete) == null ? void 0 : s.getContext) == null ? void 0 : a.call(s)
368
368
  }, null, 8, ["render", "props"])
369
369
  ])
370
370
  ]),
371
371
  r("div", Mt, [
372
372
  r("div", Et, [
373
- k(d, {
374
- label: e(v)(`inventory.transfer.form.items.table.${e(B).Code}`)
373
+ _(m, {
374
+ label: e(v)(`inventory.transfer.form.items.table.${e(E).Code}`)
375
375
  }, null, 8, ["label"]),
376
- k(e(fe), {
377
- render: (p = (c = (b = u.cellByColId[e(B).Code]) == null ? void 0 : b.column) == null ? void 0 : c.columnDef) == null ? void 0 : p.cell,
378
- props: (y = (g = u.cellByColId[e(B).Code]) == null ? void 0 : g.getContext) == null ? void 0 : y.call(g)
376
+ _(e(fe), {
377
+ render: (x = (k = (y = i.cellByColId[e(E).Code]) == null ? void 0 : y.column) == null ? void 0 : k.columnDef) == null ? void 0 : x.cell,
378
+ props: (u = (p = i.cellByColId[e(E).Code]) == null ? void 0 : p.getContext) == null ? void 0 : u.call(p)
379
379
  }, null, 8, ["render", "props"]),
380
- i[0] || (i[0] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
380
+ d[0] || (d[0] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
381
381
  ]),
382
- r("div", Lt, [
383
- k(d, {
384
- label: e(v)(`inventory.transfer.form.items.table.${e(B).Name}`)
382
+ r("div", qt, [
383
+ _(m, {
384
+ label: e(v)(`inventory.transfer.form.items.table.${e(E).Name}`)
385
385
  }, null, 8, ["label"]),
386
- k(e(fe), {
387
- render: (E = (x = (S = u.cellByColId[e(B).Name]) == null ? void 0 : S.column) == null ? void 0 : x.columnDef) == null ? void 0 : E.cell,
388
- props: (U = (A = u.cellByColId[e(B).Name]) == null ? void 0 : A.getContext) == null ? void 0 : U.call(A)
386
+ _(e(fe), {
387
+ render: (B = (C = (h = i.cellByColId[e(E).Name]) == null ? void 0 : h.column) == null ? void 0 : C.columnDef) == null ? void 0 : B.cell,
388
+ props: ($ = (P = i.cellByColId[e(E).Name]) == null ? void 0 : P.getContext) == null ? void 0 : $.call(P)
389
389
  }, null, 8, ["render", "props"]),
390
- i[1] || (i[1] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
390
+ d[1] || (d[1] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
391
391
  ])
392
392
  ]),
393
- r("div", qt, [
393
+ r("div", Lt, [
394
394
  r("div", Nt, [
395
- k(d, {
396
- label: e(v)(`inventory.transfer.form.items.table.${e(B).Amount}`)
395
+ _(m, {
396
+ label: e(v)(`inventory.transfer.form.items.table.${e(E).Amount}`)
397
397
  }, null, 8, ["label"]),
398
- k(e(fe), {
399
- render: (ee = (G = (L = u.cellByColId[e(B).Amount]) == null ? void 0 : L.column) == null ? void 0 : G.columnDef) == null ? void 0 : ee.cell,
400
- props: (J = (K = u.cellByColId[e(B).Amount]) == null ? void 0 : K.getContext) == null ? void 0 : J.call(K)
398
+ _(e(fe), {
399
+ render: (ee = (G = (M = i.cellByColId[e(E).Amount]) == null ? void 0 : M.column) == null ? void 0 : G.columnDef) == null ? void 0 : ee.cell,
400
+ props: (J = (K = i.cellByColId[e(E).Amount]) == null ? void 0 : K.getContext) == null ? void 0 : J.call(K)
401
401
  }, null, 8, ["render", "props"]),
402
- i[2] || (i[2] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
402
+ d[2] || (d[2] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
403
403
  ]),
404
- u.cellByColId[e(B).Cost] ? (F(), $("div", Ht, [
405
- k(Ye, { "z-index": 50 }, {
406
- default: O(() => [
407
- k(d, {
408
- label: e(v)(`inventory.transfer.form.items.table.${e(B).Cost}2`)
404
+ i.cellByColId[e(E).Cost] ? (F(), V("div", Ht, [
405
+ _(Ye, { "z-index": 50 }, {
406
+ default: U(() => [
407
+ _(m, {
408
+ label: e(v)(`inventory.transfer.form.items.table.${e(E).Cost}2`)
409
409
  }, null, 8, ["label"])
410
410
  ]),
411
411
  _: 1
412
412
  }),
413
- k(e(fe), {
414
- render: (C = (_ = (Q = u.cellByColId[e(B).Cost]) == null ? void 0 : Q.column) == null ? void 0 : _.columnDef) == null ? void 0 : C.cell,
415
- props: (te = (R = u.cellByColId[e(B).Cost]) == null ? void 0 : R.getContext) == null ? void 0 : te.call(R)
413
+ _(e(fe), {
414
+ render: (g = (b = (Q = i.cellByColId[e(E).Cost]) == null ? void 0 : Q.column) == null ? void 0 : b.columnDef) == null ? void 0 : g.cell,
415
+ props: (te = (O = i.cellByColId[e(E).Cost]) == null ? void 0 : O.getContext) == null ? void 0 : te.call(O)
416
416
  }, null, 8, ["render", "props"]),
417
- i[3] || (i[3] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
417
+ d[3] || (d[3] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
418
418
  ])) : z("", !0)
419
419
  ]),
420
- u.showComparePrice && Object.keys(u.comparePriceBySku[(W = u.row.original.sku) == null ? void 0 : W._id] ?? {}).length > 0 ? (F(), $(re, { key: 0 }, [
421
- k(t, { class: "h-8" }),
422
- k(Ze, {
423
- prices: u.comparePriceBySku[(se = u.row.original.sku) == null ? void 0 : se._id]
420
+ i.showComparePrice && Object.keys(i.comparePriceBySku[(W = i.row.original.sku) == null ? void 0 : W._id] ?? {}).length > 0 ? (F(), V(re, { key: 0 }, [
421
+ _(t, { class: "h-8" }),
422
+ _(Ze, {
423
+ prices: i.comparePriceBySku[(se = i.row.original.sku) == null ? void 0 : se._id]
424
424
  }, null, 8, ["prices"])
425
425
  ], 64)) : z("", !0)
426
426
  ]);
427
427
  };
428
428
  }
429
429
  });
430
- function Ce(n) {
431
- return mt.parse(n);
430
+ function Ce(l) {
431
+ return mt.parse(l);
432
432
  }
433
- function Fe(n) {
433
+ function Fe(l) {
434
434
  return {
435
- _id: n.doc._id,
436
- internal: n.type,
437
- contactName: n.doc.profile.name,
438
- name: n.doc.profile.name,
439
- email: n.doc.profile.email,
440
- phoneNumber: n.doc.profile.phoneNo,
441
- registrationNumber: n.doc.profile.regNo,
442
- address: n.doc.profile.address
435
+ _id: l.doc._id,
436
+ internal: l.type,
437
+ contactName: l.doc.profile.name,
438
+ name: l.doc.profile.name,
439
+ email: l.doc.profile.email,
440
+ phoneNumber: l.doc.profile.phoneNo,
441
+ registrationNumber: l.doc.profile.regNo,
442
+ address: l.doc.profile.address
443
443
  };
444
444
  }
445
- function jt(n, v, u = !1) {
446
- const i = Ie(), d = Ue();
447
- d.watchLocation(async () => {
448
- var S;
449
- await i.readSuppliers();
450
- const c = n();
451
- if ((S = c.supplier) != null && S._id) return;
452
- const p = d.businessLevel ? i.businessSuppliers[0] : i.suppliers[0], y = (u ? d.locations.filter((x) => x.doc._id !== d.currentLocation.doc._id) : d.locations)[0];
445
+ function jt(l, v, i = !1, d = !1) {
446
+ const m = Te(), t = Ue();
447
+ t.watchLocation(async () => {
448
+ var B;
449
+ await m.readSuppliers();
450
+ const p = l();
451
+ if ((B = p.supplier) != null && B._id) return;
452
+ const u = d ? m.suppliers[0] : m.businessSuppliers[0], C = (i ? t.locations.filter((P) => P.doc._id !== t.currentLocation.doc._id) : t.locations)[0];
453
453
  v({
454
- ...c,
455
- supplier: p ? Ce(p) : y ? Fe(y) : c.supplier
454
+ ...p,
455
+ supplier: u ? Ce(u) : C ? Fe(C) : p.supplier
456
456
  });
457
457
  });
458
- const t = P(
458
+ const n = T(
459
459
  () => {
460
- var c, p;
461
- return typeof ((p = (c = n()) == null ? void 0 : c.supplier) == null ? void 0 : p.internal) == "string" ? V.TRANSFER : V.PURCHASE;
460
+ var p, u;
461
+ return typeof ((u = (p = l()) == null ? void 0 : p.supplier) == null ? void 0 : u.internal) == "string" ? D.TRANSFER : D.PURCHASE;
462
462
  }
463
- ), l = P({
463
+ ), S = T({
464
464
  get() {
465
- var c, p;
466
- return (p = (c = n()) == null ? void 0 : c.supplier) == null ? void 0 : p._id;
465
+ var p, u;
466
+ return (u = (p = l()) == null ? void 0 : p.supplier) == null ? void 0 : u._id;
467
467
  },
468
- set(c) {
469
- const p = n() ?? {};
470
- if (t.value === V.PURCHASE) {
471
- const E = (d.businessLevel ? i.businessSuppliers : i.suppliers).find((A) => A._id === c);
468
+ set(p) {
469
+ const u = l() ?? {};
470
+ if (n.value === D.PURCHASE) {
471
+ const $ = (d ? m.suppliers : m.businessSuppliers).find((M) => M._id === p);
472
472
  v({
473
- ...p,
474
- supplier: E ? Ce(E) : p.supplier
473
+ ...u,
474
+ supplier: $ ? Ce($) : u.supplier
475
475
  });
476
476
  return;
477
477
  }
478
- const S = (u ? d.locations.filter((x) => x.doc._id !== d.currentLocation.doc._id) : d.locations).find((x) => x.doc._id === c);
478
+ const B = (i ? t.locations.filter((P) => P.doc._id !== t.currentLocation.doc._id) : t.locations).find((P) => P.doc._id === p);
479
479
  v({
480
- ...p,
481
- supplier: S ? Fe(S) : p.supplier
480
+ ...u,
481
+ supplier: B ? Fe(B) : u.supplier
482
482
  });
483
483
  }
484
- }), w = P(() => i.locationSuppliers.map(Ce)), m = P(() => i.businessSuppliers.map(Ce)), s = P(() => {
485
- var g;
486
- const c = ((g = d._currentLocation) == null ? void 0 : g.type) === We.warehouse;
487
- return (u ? d.locations.filter((y) => y.doc._id !== d.currentLocation.doc._id) : d.locations).filter((y) => c || y.acceptRequest).map(Fe);
488
- }), a = P(() => {
489
- if (t.value === V.PURCHASE) {
490
- const p = w.value.map((y) => ({
491
- label: y.name,
492
- value: y._id
493
- })), g = m.value.map((y) => ({
494
- label: y.name,
484
+ }), c = T(() => m.locationSuppliers.map(Ce)), s = T(() => m.businessSuppliers.map(Ce)), a = T(() => {
485
+ const p = [...c.value], u = [...s.value];
486
+ return d ? [...u, ...p] : u;
487
+ }), y = T(() => {
488
+ var h;
489
+ const p = ((h = t._currentLocation) == null ? void 0 : h.type) === We.warehouse;
490
+ return (i ? t.locations.filter((C) => C.doc._id !== t.currentLocation.doc._id) : t.locations).filter((C) => p || C.acceptRequest).map(Fe);
491
+ }), k = T(() => {
492
+ if (n.value === D.PURCHASE) {
493
+ const u = c.value.map((C) => ({
494
+ label: C.name,
495
+ value: C._id
496
+ })), h = s.value.map((C) => ({
497
+ label: C.name,
495
498
  sublabel: "Business supplier",
496
- value: y._id
499
+ value: C._id
497
500
  }));
498
- return d.businessLevel ? g : [...p, ...g];
501
+ return d ? [...u, ...h] : h;
499
502
  }
500
- return s.value.map((p) => ({
501
- label: p.name,
502
- sublabel: p.internal ? `${p.internal}` : void 0,
503
- value: p._id
503
+ return y.value.map((u) => ({
504
+ label: u.name,
505
+ sublabel: u.internal ? `${u.internal}` : void 0,
506
+ value: u._id
504
507
  }));
505
- }), b = P(() => {
506
- var y, S;
507
- const c = (S = (y = n()) == null ? void 0 : y.supplier) == null ? void 0 : S._id;
508
- if (t.value === V.PURCHASE) {
509
- const x = i.suppliers.find((E) => E._id === c);
510
- return x ? Ce(x) : null;
508
+ }), x = T(() => {
509
+ var C, B;
510
+ const p = (B = (C = l()) == null ? void 0 : C.supplier) == null ? void 0 : B._id;
511
+ if (n.value === D.PURCHASE) {
512
+ const P = m.suppliers.find(($) => $._id === p);
513
+ return P ? Ce(P) : null;
511
514
  }
512
- const g = d.locations.find((x) => x.doc._id);
513
- return g ? Fe(g) : null;
515
+ const h = t.locations.find((P) => P.doc._id);
516
+ return h ? Fe(h) : null;
514
517
  });
515
518
  return {
516
- transferLocationModel: l,
517
- transferLocationOptions: a,
518
- locationOptionsTypePurchase: w,
519
- locationOptionsTypeTransfer: s,
520
- selectedLocation: b
519
+ transferLocationModel: S,
520
+ transferLocationOptions: k,
521
+ locationOptionsTypePurchase: a,
522
+ locationOptionsTypePurchaseLocationLevel: c,
523
+ locationOptionsTypeTransfer: y,
524
+ selectedLocation: x
521
525
  };
522
526
  }
523
- function Qt(n) {
524
- const v = P({
527
+ function Qt(l) {
528
+ const v = T({
525
529
  get() {
526
- const t = n.getEffectiveAt();
530
+ const t = l.getEffectiveAt();
527
531
  return t ? new Date(t) : null;
528
532
  },
529
533
  set(t) {
530
- n.setEffectiveAt((t == null ? void 0 : t.toISOString()) ?? null);
534
+ l.setEffectiveAt((t == null ? void 0 : t.toISOString()) ?? null);
531
535
  }
532
- }), u = P({
536
+ }), i = T({
533
537
  get() {
534
538
  return !!v.value;
535
539
  },
536
540
  set(t) {
537
541
  t ? v.value = /* @__PURE__ */ new Date() : v.value = null;
538
542
  }
539
- }), i = P({
543
+ }), d = T({
540
544
  get() {
541
545
  return v.value === null ? "" : Oe(v.value);
542
546
  },
543
547
  set(t) {
544
- t ? v.value = /* @__PURE__ */ new Date(`${t} ${d.value}`) : v.value = null;
548
+ t ? v.value = /* @__PURE__ */ new Date(`${t} ${m.value}`) : v.value = null;
545
549
  }
546
- }), d = P({
550
+ }), m = T({
547
551
  get() {
548
552
  return v.value === null ? "" : ft(v.value);
549
553
  },
550
554
  set(t) {
551
- t ? v.value = /* @__PURE__ */ new Date(`${i.value} ${t}`) : v.value = null;
555
+ t ? v.value = /* @__PURE__ */ new Date(`${d.value} ${t}`) : v.value = null;
552
556
  }
553
557
  });
554
558
  return {
555
559
  backdatePo: v,
556
- backdateSwitch: u,
557
- backdateModel: i,
558
- backdateTimeModel: d
560
+ backdateSwitch: i,
561
+ backdateModel: d,
562
+ backdateTimeModel: m
559
563
  };
560
564
  }
561
565
  const Wt = {
@@ -576,79 +580,79 @@ const Wt = {
576
580
  default: "#c7c7cc"
577
581
  }
578
582
  },
579
- setup(n) {
580
- return (v, u) => (F(), $("svg", Wt, [
583
+ setup(l) {
584
+ return (v, i) => (F(), V("svg", Wt, [
581
585
  r("path", {
582
586
  d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
583
- fill: n.color
587
+ fill: l.color
584
588
  }, null, 8, Yt),
585
589
  r("path", {
586
590
  d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
587
- fill: n.color
591
+ fill: l.color
588
592
  }, null, 8, Zt),
589
593
  r("path", {
590
594
  d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
591
- stroke: n.color,
595
+ stroke: l.color,
592
596
  "stroke-width": "1.5",
593
597
  "stroke-linecap": "round",
594
598
  "stroke-linejoin": "round"
595
599
  }, null, 8, Kt),
596
600
  r("path", {
597
601
  d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
598
- stroke: n.color,
602
+ stroke: l.color,
599
603
  "stroke-width": "1.5",
600
604
  "stroke-linecap": "round",
601
605
  "stroke-linejoin": "round"
602
606
  }, null, 8, Jt)
603
607
  ]));
604
608
  }
605
- }), Gt = { class: "flex gap-8 items-center" }, es = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, ts = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, ss = { class: "flex items-center w-full" }, os = { class: "flex-1" }, ns = { class: "fm-typo-en-title-sm-800" }, ls = { class: "flex items-start gap-8" }, as = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, rs = { class: "flex gap-1" }, Le = /* @__PURE__ */ ie({
609
+ }), Gt = { class: "flex gap-8 items-center" }, es = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, ts = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, ss = { class: "flex items-center w-full" }, os = { class: "flex-1" }, ns = { class: "fm-typo-en-title-sm-800" }, ls = { class: "flex items-start gap-8" }, as = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, rs = { class: "flex gap-1" }, qe = /* @__PURE__ */ ie({
606
610
  __name: "ForecastStock",
607
611
  props: {
608
612
  disabled: { type: Boolean }
609
613
  },
610
614
  emits: ["update:poItems"],
611
- setup(n, { emit: v }) {
612
- const u = v, i = q(!1), d = q(7), t = ht(), l = Re(), w = Be(), { t: m } = ye();
615
+ setup(l, { emit: v }) {
616
+ const i = v, d = L(!1), m = L(7), t = ht(), n = Re(), S = Be(), { t: c } = ye();
613
617
  async function s() {
614
- if (d.value < 1)
618
+ if (m.value < 1)
615
619
  return;
616
- i.value = !1, await t.readPurchaseOrder(d.value);
620
+ d.value = !1, await t.readPurchaseOrder(m.value);
617
621
  const a = [];
618
622
  if (t.purchaseOrderForecast.skus.length <= 0) {
619
- l.open({
620
- message: m("inventory.transfer.form.items.forecastStock.notAvailable"),
623
+ n.open({
624
+ message: c("inventory.transfer.form.items.forecastStock.notAvailable"),
621
625
  type: "info"
622
626
  });
623
627
  return;
624
628
  }
625
- const b = t.purchaseOrderForecast.skus.reduce((c, p) => {
626
- const g = w.skus.find((x) => x._id === p.id);
627
- if (c.find((x) => x.sku._id === p.id) || !g)
628
- return c;
629
- const S = {
630
- sku: g,
631
- code: g.code,
632
- name: g.name,
629
+ const y = t.purchaseOrderForecast.skus.reduce((k, x) => {
630
+ const p = S.skus.find((C) => C._id === x.id);
631
+ if (k.find((C) => C.sku._id === x.id) || !p)
632
+ return k;
633
+ const h = {
634
+ sku: p,
635
+ code: p.code,
636
+ name: p.name,
633
637
  quantity: {
634
- amount: p.amount,
638
+ amount: x.amount,
635
639
  precision: 0
636
640
  }
637
641
  };
638
- return c.push(S), c;
642
+ return k.push(h), k;
639
643
  }, a);
640
- u("update:poItems", b);
644
+ i("update:poItems", y);
641
645
  }
642
- return (a, b) => {
643
- const c = I("FmButton"), p = I("FmIcon"), g = I("FmStepperField"), y = I("FmPopover");
644
- return F(), j(y, {
646
+ return (a, y) => {
647
+ const k = I("FmButton"), x = I("FmIcon"), p = I("FmStepperField"), u = I("FmPopover");
648
+ return F(), j(u, {
645
649
  disabled: a.disabled,
646
650
  class: "flex",
647
- "show-popover": i.value,
648
- onPopoverChanged: b[3] || (b[3] = (S) => i.value = S)
651
+ "show-popover": d.value,
652
+ onPopoverChanged: y[3] || (y[3] = (h) => d.value = h)
649
653
  }, {
650
- "popover-button": O(() => [
651
- k(c, {
654
+ "popover-button": U(() => [
655
+ _(k, {
652
656
  label: "unused",
653
657
  variant: "secondary",
654
658
  "text-color": a.disabled ? "disabled" : "primary",
@@ -656,63 +660,63 @@ const Wt = {
656
660
  "border-color": a.disabled ? "disabled" : "primary",
657
661
  disabled: a.disabled
658
662
  }, {
659
- default: O(() => [
663
+ default: U(() => [
660
664
  r("div", Gt, [
661
- k(Xt, {
665
+ _(Xt, {
662
666
  size: 24,
663
667
  color: a.disabled ? "#c7c7cc" : "#ff7823"
664
668
  }, null, 8, ["color"]),
665
- r("div", es, D(e(m)("inventory.transfer.form.items.forecastStock.title")), 1)
669
+ r("div", es, R(e(c)("inventory.transfer.form.items.forecastStock.title")), 1)
666
670
  ])
667
671
  ]),
668
672
  _: 1
669
673
  }, 8, ["text-color", "border-color", "disabled"])
670
674
  ]),
671
- default: O(() => [
675
+ default: U(() => [
672
676
  r("div", ts, [
673
677
  r("div", ss, [
674
678
  r("div", os, [
675
- k(xt, { "z-index": 99 }, {
676
- default: O(() => [
677
- r("p", ns, D(e(m)("inventory.transfer.form.items.forecastStock.title")), 1)
679
+ _(xt, { "z-index": 99 }, {
680
+ default: U(() => [
681
+ r("p", ns, R(e(c)("inventory.transfer.form.items.forecastStock.title")), 1)
678
682
  ]),
679
683
  _: 1
680
684
  })
681
685
  ]),
682
- k(c, {
686
+ _(k, {
683
687
  icon: "close",
684
688
  size: "md",
685
689
  variant: "tertiary",
686
- onClick: b[0] || (b[0] = (S) => i.value = !1)
690
+ onClick: y[0] || (y[0] = (h) => d.value = !1)
687
691
  })
688
692
  ]),
689
- k(g, {
690
- modelValue: d.value,
691
- "onUpdate:modelValue": b[1] || (b[1] = (S) => d.value = S),
692
- label: e(m)("inventory.transfer.form.items.forecastStock.days"),
693
+ _(p, {
694
+ modelValue: m.value,
695
+ "onUpdate:modelValue": y[1] || (y[1] = (h) => m.value = h),
696
+ label: e(c)("inventory.transfer.form.items.forecastStock.days"),
693
697
  rules: [e(Pe)(1)]
694
698
  }, {
695
- "helper-text": O(() => [
699
+ "helper-text": U(() => [
696
700
  r("div", ls, [
697
- k(p, {
701
+ _(x, {
698
702
  name: "warning",
699
703
  size: "sm",
700
704
  class: "text-fm-color-system-warning-300"
701
705
  }),
702
- r("div", as, D(e(m)("inventory.transfer.form.items.forecastStock.replace")), 1)
706
+ r("div", as, R(e(c)("inventory.transfer.form.items.forecastStock.replace")), 1)
703
707
  ])
704
708
  ]),
705
709
  _: 1
706
710
  }, 8, ["modelValue", "label", "rules"]),
707
711
  r("div", rs, [
708
- b[4] || (b[4] = r("div", { class: "grow" }, null, -1)),
709
- k(c, {
710
- label: e(m)("common.cancel"),
712
+ y[4] || (y[4] = r("div", { class: "grow" }, null, -1)),
713
+ _(k, {
714
+ label: e(c)("common.cancel"),
711
715
  variant: "tertiary",
712
- onClick: b[2] || (b[2] = (S) => i.value = !1)
716
+ onClick: y[2] || (y[2] = (h) => d.value = !1)
713
717
  }, null, 8, ["label"]),
714
- k(c, {
715
- label: e(m)("inventory.transfer.form.items.forecastStock.generate"),
718
+ _(k, {
719
+ label: e(c)("inventory.transfer.form.items.forecastStock.generate"),
716
720
  onClick: s
717
721
  }, null, 8, ["label"])
718
722
  ])
@@ -724,47 +728,47 @@ const Wt = {
724
728
  }
725
729
  });
726
730
  function is() {
727
- const n = Re(), v = He(), u = q(!1);
728
- De(u, (l) => {
729
- l && (d.value = !0, i().finally(() => {
730
- d.value = !1;
731
+ const l = Re(), v = He(), i = L(!1);
732
+ De(i, (n) => {
733
+ n && (m.value = !0, d().finally(() => {
734
+ m.value = !1;
731
735
  }));
732
736
  });
733
- async function i() {
737
+ async function d() {
734
738
  try {
735
- const { startDate: l, endDate: w } = yt(6), a = (await v.getPurchaseOrders({ start: l, end: w })).filter(
736
- (b) => {
737
- var c, p;
738
- return b.status === vt.enum.COMPLETE && ((c = b.supplier) == null ? void 0 : c.internal) !== "warehouse" && ((p = b.supplier) == null ? void 0 : p.internal) !== "restaurant";
739
+ const { startDate: n, endDate: S } = yt(6), a = (await v.getPurchaseOrders({ start: n, end: S })).filter(
740
+ (y) => {
741
+ var k, x;
742
+ return y.status === vt.enum.COMPLETE && ((k = y.supplier) == null ? void 0 : k.internal) !== "warehouse" && ((x = y.supplier) == null ? void 0 : x.internal) !== "restaurant";
739
743
  }
740
- ).reduce((b, c) => {
741
- const p = new Date(bt(c._id)), g = c.supplier._id;
742
- for (const y of c.items) {
743
- if (!y.totalCost) continue;
744
- const S = b[y.sku._id] ?? {}, x = S[g] ?? [];
745
- x.push({
746
- date: p.toISOString(),
747
- totalUnit: y.quantity,
748
- totalCost: y.totalCost,
749
- unit: y.sku.unit,
750
- measurement: y.measurement,
751
- seqNumber: c.seqNumber
752
- }), S[g] = x, b[y.sku._id] = S;
744
+ ).reduce((y, k) => {
745
+ const x = new Date(bt(k._id)), p = k.supplier._id;
746
+ for (const u of k.items) {
747
+ if (!u.totalCost) continue;
748
+ const h = y[u.sku._id] ?? {}, C = h[p] ?? [];
749
+ C.push({
750
+ date: x.toISOString(),
751
+ totalUnit: u.quantity,
752
+ totalCost: u.totalCost,
753
+ unit: u.sku.unit,
754
+ measurement: u.measurement,
755
+ seqNumber: k.seqNumber
756
+ }), h[p] = C, y[u.sku._id] = h;
753
757
  }
754
- return b;
758
+ return y;
755
759
  }, {});
756
760
  t.value = a;
757
761
  } catch {
758
- n.open({
762
+ l.open({
759
763
  title: "Something went wrong",
760
764
  message: "Cannot retrieve supplier purchase history. Please try again."
761
- }), u.value = !1;
765
+ }), i.value = !1;
762
766
  }
763
767
  }
764
- const d = q(!1), t = q({});
768
+ const m = L(!1), t = L({});
765
769
  return {
766
- comparePricesToggle: u,
767
- comparePriceFetching: d,
770
+ comparePricesToggle: i,
771
+ comparePriceFetching: m,
768
772
  comparePriceBySku: t
769
773
  };
770
774
  }
@@ -775,47 +779,47 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
775
779
  comparePriceBySku: {},
776
780
  showComparePrice: { type: Boolean }
777
781
  },
778
- setup(n) {
779
- function v(u) {
780
- return u.column.columnDef.meta;
782
+ setup(l) {
783
+ function v(i) {
784
+ return i.column.columnDef.meta;
781
785
  }
782
- return (u, i) => {
783
- var d, t;
784
- return F(), $(re, null, [
786
+ return (i, d) => {
787
+ var m, t;
788
+ return F(), V(re, null, [
785
789
  r("tr", {
786
790
  class: Y(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
787
- "bg-fm-color-neutral-gray-100": u.row.getIsSelected()
791
+ "bg-fm-color-neutral-gray-100": i.row.getIsSelected()
788
792
  }])
789
793
  }, [
790
- (F(!0), $(re, null, $e(u.row.getVisibleCells(), (l) => {
791
- var w, m, s, a;
792
- return F(), $("td", {
793
- key: l.id,
794
+ (F(!0), V(re, null, $e(i.row.getVisibleCells(), (n) => {
795
+ var S, c, s, a;
796
+ return F(), V("td", {
797
+ key: n.id,
794
798
  class: Y([
795
799
  "h-[52px] px-16 text-fm-color-typo-primary",
796
- ((w = v(l)) == null ? void 0 : w.cellClass) ?? "px-16"
800
+ ((S = v(n)) == null ? void 0 : S.cellClass) ?? "px-16"
797
801
  ]),
798
802
  style: et({
799
- width: (m = v(l)) == null ? void 0 : m.width,
800
- maxWidth: (s = v(l)) == null ? void 0 : s.maxWidth,
801
- textAlign: ((a = v(l)) == null ? void 0 : a.textAlign) ?? "left"
803
+ width: (c = v(n)) == null ? void 0 : c.width,
804
+ maxWidth: (s = v(n)) == null ? void 0 : s.maxWidth,
805
+ textAlign: ((a = v(n)) == null ? void 0 : a.textAlign) ?? "left"
802
806
  })
803
807
  }, [
804
808
  r("span", us, [
805
- k(e(fe), {
806
- render: l.column.columnDef.cell,
807
- props: l.getContext()
809
+ _(e(fe), {
810
+ render: n.column.columnDef.cell,
811
+ props: n.getContext()
808
812
  }, null, 8, ["render", "props"])
809
813
  ])
810
814
  ], 6);
811
815
  }), 128))
812
816
  ], 2),
813
- u.showComparePrice && Object.keys(u.comparePriceBySku[(d = u.row.original.sku) == null ? void 0 : d._id] ?? {}).length > 0 ? (F(), $("tr", ds, [
817
+ i.showComparePrice && Object.keys(i.comparePriceBySku[(m = i.row.original.sku) == null ? void 0 : m._id] ?? {}).length > 0 ? (F(), V("tr", ds, [
814
818
  r("td", {
815
- colspan: u.row.getVisibleCells().length
819
+ colspan: i.row.getVisibleCells().length
816
820
  }, [
817
- k(Ze, {
818
- prices: u.comparePriceBySku[(t = u.row.original.sku) == null ? void 0 : t._id]
821
+ _(Ze, {
822
+ prices: i.comparePriceBySku[(t = i.row.original.sku) == null ? void 0 : t._id]
819
823
  }, null, 8, ["prices"])
820
824
  ], 8, cs)
821
825
  ])) : z("", !0)
@@ -831,7 +835,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
831
835
  }, ws = { class: "flex-1" }, Ss = { class: "flex-1" }, xs = {
832
836
  key: 1,
833
837
  class: "flex items-center gap-4"
834
- }, Fs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, Ps = { class: "flex flex-col gap-16" }, Is = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, Ts = { class: "flex gap-8" }, $s = { key: 0 }, As = /* @__PURE__ */ ie({
838
+ }, Fs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, Ps = { class: "flex flex-col gap-16" }, Ts = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, Is = { class: "flex gap-8" }, $s = { key: 0 }, As = /* @__PURE__ */ ie({
835
839
  __name: "TransferForm2",
836
840
  props: {
837
841
  modelValue: {},
@@ -842,59 +846,59 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
842
846
  lastClosingDate: {}
843
847
  },
844
848
  emits: ["validation-success", "form:ready"],
845
- setup(n, { expose: v, emit: u }) {
846
- const i = n, d = u, t = wt(), { t: l } = ye(), w = Ue(), m = Be(), s = kt(), a = Ie(), b = ze(), c = nt(), { breakpoints: p } = Ne(), g = P(() => p.value.xs || p.value.sm), y = P(
847
- () => c.templates.value.find((o) => o._id === t.template)
848
- ), S = P(() => t.status === "DRAFT" || !t._rev);
849
- De(y, (o) => {
850
- var f;
851
- o && ((f = t.supplier) != null && f._id || (t.supplier = (o == null ? void 0 : o.purchaseOrder.supplier) ?? t.supplier));
852
- }), qe(async () => {
849
+ setup(l, { expose: v, emit: i }) {
850
+ const d = l, m = i, t = wt(), { t: n } = ye(), S = Ue(), c = Be(), s = kt(), a = Te(), y = ze(), k = nt(), { breakpoints: x } = Ne(), p = T(() => x.value.xs || x.value.sm), u = T(
851
+ () => k.templates.value.find((o) => o._id === t.template)
852
+ ), h = T(() => t.status === "DRAFT" || !t._rev);
853
+ De(u, (o) => {
854
+ o && h.value && (t.supplier = (o == null ? void 0 : o.purchaseOrder.supplier) ?? t.supplier);
855
+ }), Le(async () => {
853
856
  var o;
854
857
  try {
855
858
  if (!t.template) return;
856
- await c.loadTemplate(t.template), t.items.length || (t.items = ((o = y.value) == null ? void 0 : o.purchaseOrder.items) ?? []);
859
+ await k.loadTemplate(t.template), t.items.length || (t.items = ((o = u.value) == null ? void 0 : o.purchaseOrder.items) ?? []);
857
860
  } finally {
858
- d("form:ready");
861
+ m("form:ready");
859
862
  }
860
863
  });
861
- const x = P(
862
- () => w.currentLocation.type === We.restaurant
864
+ const C = T(
865
+ () => S.currentLocation.type === We.restaurant
863
866
  );
864
- w.watchLocation(async () => {
867
+ S.watchLocation(async () => {
865
868
  location && (t.supplier || (t.supplier = a.suppliers.find((o) => o) ?? t.supplier));
866
869
  });
867
- const E = st(), A = jt(
870
+ const B = st(), P = jt(
868
871
  () => t,
869
872
  (o) => {
870
873
  Object.assign(t, o);
871
874
  },
875
+ !0,
872
876
  !0
873
- ), U = P({
877
+ ), $ = T({
874
878
  get() {
875
879
  var o;
876
- return typeof ((o = t == null ? void 0 : t.supplier) == null ? void 0 : o.internal) == "string" ? V.TRANSFER : V.PURCHASE;
880
+ return typeof ((o = t == null ? void 0 : t.supplier) == null ? void 0 : o.internal) == "string" ? D.TRANSFER : D.PURCHASE;
877
881
  },
878
882
  set(o) {
879
883
  var N;
880
- const f = typeof ((N = t == null ? void 0 : t.supplier) == null ? void 0 : N.internal) == "string" ? V.TRANSFER : V.PURCHASE;
881
- o !== f && (t.supplier = o === V.PURCHASE ? A.locationOptionsTypePurchase.value[0] : A.locationOptionsTypeTransfer.value[0]);
884
+ const f = typeof ((N = t == null ? void 0 : t.supplier) == null ? void 0 : N.internal) == "string" ? D.TRANSFER : D.PURCHASE;
885
+ o !== f && (t.supplier = o === D.PURCHASE ? P.locationOptionsTypePurchase.value[0] : P.locationOptionsTypeTransfer.value[0]);
882
886
  }
883
- }), L = P(() => A.transferLocationOptions.value), G = P({
887
+ }), M = T(() => P.transferLocationOptions.value), G = T({
884
888
  get() {
885
889
  return t.supplier._id;
886
890
  },
887
891
  set(o) {
888
- A.transferLocationModel.value = o;
892
+ P.transferLocationModel.value = o;
889
893
  }
890
- }), ee = P({
894
+ }), ee = T({
891
895
  get() {
892
896
  return t.remark ?? void 0;
893
897
  },
894
898
  set(o) {
895
899
  t.remark = o;
896
900
  }
897
- }), K = P({
901
+ }), K = T({
898
902
  get() {
899
903
  var o;
900
904
  return ((o = t.netSuite) == null ? void 0 : o.subsidiary) ?? null;
@@ -908,14 +912,14 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
908
912
  const f = s.getAvailableItems((oe = t.netSuite) == null ? void 0 : oe.subsidiary.id), N = t.items.map((H) => H.sku._id).filter((H) => f.includes(H));
909
913
  t.items = t.items.filter((H) => N.includes(H.sku._id));
910
914
  }
911
- }), { backdatePo: J, backdateSwitch: Q, backdateModel: _, backdateTimeModel: C } = Qt({
915
+ }), { backdatePo: J, backdateSwitch: Q, backdateModel: b, backdateTimeModel: g } = Qt({
912
916
  getEffectiveAt() {
913
917
  return t.effectiveAt;
914
918
  },
915
919
  setEffectiveAt(o) {
916
920
  t.effectiveAt = o;
917
921
  }
918
- }), { comparePricesToggle: R, comparePriceFetching: te, comparePriceBySku: W } = is(), se = q();
922
+ }), { comparePricesToggle: O, comparePriceFetching: te, comparePriceBySku: W } = is(), se = L();
919
923
  v({
920
924
  validateInputs: () => {
921
925
  var o, f;
@@ -944,30 +948,30 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
944
948
  return t.items;
945
949
  },
946
950
  get transferType() {
947
- return U.value;
951
+ return $.value;
948
952
  },
949
953
  get template() {
950
- return y.value;
954
+ return u.value;
951
955
  },
952
956
  get disabled() {
953
- return i.disabled;
957
+ return d.disabled;
954
958
  }
955
- }), Je = P(() => Ke.columnDefs.value);
959
+ }), Je = T(() => Ke.columnDefs.value);
956
960
  function Xe() {
957
961
  var he, we, be, Se;
958
- const o = new Set((be = (we = (he = y.value) == null ? void 0 : he.purchaseOrder) == null ? void 0 : we.items) == null ? void 0 : be.map((T) => T.sku._id)), f = s.getAvailableItems((Se = t.netSuite) == null ? void 0 : Se.subsidiary.id), N = o.size ? m.skus.filter((T) => o.has(T._id)) : m.skus, oe = N.map((T) => T._id).filter((T) => f.includes(T)), H = N.map(
959
- (T) => ({
960
- label: T.name,
961
- sublabel: T.code,
962
- value: T,
963
- disabled: !oe.includes(T._id)
962
+ const o = new Set((be = (we = (he = u.value) == null ? void 0 : he.purchaseOrder) == null ? void 0 : we.items) == null ? void 0 : be.map((A) => A.sku._id)), f = s.getAvailableItems((Se = t.netSuite) == null ? void 0 : Se.subsidiary.id), N = o.size ? c.skus.filter((A) => o.has(A._id)) : c.skus, oe = N.map((A) => A._id).filter((A) => f.includes(A)), H = N.map(
963
+ (A) => ({
964
+ label: A.name,
965
+ sublabel: A.code,
966
+ value: A,
967
+ disabled: !oe.includes(A._id)
964
968
  })
965
- ), ve = H.filter((T) => {
969
+ ), ve = H.filter((A) => {
966
970
  var ne;
967
- return (ne = t.items) == null ? void 0 : ne.find((ue) => ue.sku._id === T.value._id);
968
- }).map((T) => T.value);
969
- E.open({
970
- title: l("inventory.transfer.form.items.selectItem"),
971
+ return (ne = t.items) == null ? void 0 : ne.find((ue) => ue.sku._id === A.value._id);
972
+ }).map((A) => A.value);
973
+ B.open({
974
+ title: n("inventory.transfer.form.items.selectItem"),
971
975
  closeButton: !0,
972
976
  contentComponent: Ct,
973
977
  contentComponentProps: {
@@ -976,21 +980,21 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
976
980
  virtualScroll: !0
977
981
  },
978
982
  primaryActions: {
979
- text: l("common.confirm"),
983
+ text: n("common.confirm"),
980
984
  close: !0
981
985
  },
982
986
  secondaryActions: {
983
- text: l("common.close"),
987
+ text: n("common.close"),
984
988
  close: !0,
985
989
  variant: "tertiary"
986
990
  }
987
- }).onPrimary((T) => {
988
- const ne = t.items ?? [], ue = T.map((X) => {
991
+ }).onPrimary((A) => {
992
+ const ne = t.items ?? [], ue = A.map((X) => {
989
993
  var xe, _e;
990
994
  const de = ne.find((ce) => ce.sku._id === X._id);
991
995
  if (de)
992
996
  return de;
993
- const le = ((_e = (xe = y.value) == null ? void 0 : xe.purchaseOrder.items) == null ? void 0 : _e.find(
997
+ const le = ((_e = (xe = u.value) == null ? void 0 : xe.purchaseOrder.items) == null ? void 0 : _e.find(
994
998
  (ce) => ce.sku._id === X._id
995
999
  )) ?? {
996
1000
  sku: X,
@@ -1001,7 +1005,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
1001
1005
  precision: 0
1002
1006
  }
1003
1007
  };
1004
- return U.value == V.PURCHASE && (le.totalCost = ae(
1008
+ return $.value == D.PURCHASE && (le.totalCost = ae(
1005
1009
  le.sku,
1006
1010
  le.quantity,
1007
1011
  le.measurement,
@@ -1018,52 +1022,52 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
1018
1022
  }
1019
1023
  return (o, f) => {
1020
1024
  var _e, ce;
1021
- const N = I("FmChip"), oe = I("FmLabel"), H = I("FmField"), ve = I("FmSelect"), he = I("FmTextField"), we = I("FmTextarea"), be = I("FmSwitch"), Se = I("FmDatePicker"), T = I("FmTimePicker"), ne = I("FmFormGroup"), ue = I("FmIcon"), X = I("FmButton"), de = I("FmTooltip"), le = I("FmTable"), xe = I("FmForm");
1022
- return F(), $("div", ms, [
1025
+ const N = I("FmChip"), oe = I("FmLabel"), H = I("FmField"), ve = I("FmSelect"), he = I("FmTextField"), we = I("FmTextarea"), be = I("FmSwitch"), Se = I("FmDatePicker"), A = I("FmTimePicker"), ne = I("FmFormGroup"), ue = I("FmIcon"), X = I("FmButton"), de = I("FmTooltip"), le = I("FmTable"), xe = I("FmForm");
1026
+ return F(), V("div", ms, [
1023
1027
  r("div", fs, [
1024
- (_e = i.modelValue) != null && _e.template ? (F(), j(N, {
1028
+ (_e = d.modelValue) != null && _e.template ? (F(), j(N, {
1025
1029
  key: 0,
1026
1030
  variant: o.disabled ? "warning" : void 0,
1027
- label: `${e(l)("inventory.transfer.template.title")}: ${((ce = y.value) == null ? void 0 : ce.name) ?? e(l)("inventory.transfer.form.loading")}`,
1031
+ label: `${e(n)("inventory.transfer.template.title")}: ${((ce = u.value) == null ? void 0 : ce.name) ?? e(n)("inventory.transfer.form.loading")}`,
1028
1032
  icon: "summarize",
1029
1033
  compact: ""
1030
1034
  }, null, 8, ["variant", "label"])) : z("", !0),
1031
- k(N, {
1032
- label: e(w).currentLocation.name,
1035
+ _(N, {
1036
+ label: e(S).currentLocation.name,
1033
1037
  icon: "storefront",
1034
1038
  compact: ""
1035
1039
  }, null, 8, ["label"]),
1036
1040
  o.lastClosingDate ? (F(), j(N, {
1037
1041
  key: 1,
1038
- label: `${e(l)("inventory.transfer.form.lastClosing")}: ${e(Oe)(o.lastClosingDate)} ${e(_t)(o.lastClosingDate)}`,
1042
+ label: `${e(n)("inventory.transfer.form.lastClosing")}: ${e(Oe)(o.lastClosingDate)} ${e(_t)(o.lastClosingDate)}`,
1039
1043
  icon: "calendar_month",
1040
1044
  compact: ""
1041
1045
  }, null, 8, ["label"])) : z("", !0)
1042
1046
  ]),
1043
- k(xe, {
1047
+ _(xe, {
1044
1048
  ref_key: "formRef",
1045
1049
  ref: se,
1046
1050
  class: "flex flex-col gap-32",
1047
1051
  disabled: o.disabled,
1048
1052
  onValidationFailed: console.log,
1049
- onValidationSuccess: f[13] || (f[13] = (Te) => d("validation-success"))
1053
+ onValidationSuccess: f[13] || (f[13] = (Ie) => m("validation-success"))
1050
1054
  }, {
1051
- default: O(() => {
1052
- var Te, Me;
1055
+ default: U(() => {
1056
+ var Ie, Me;
1053
1057
  return [
1054
1058
  r("div", ys, [
1055
1059
  r("div", vs, [
1056
- (Te = i.modelValue) != null && Te.template ? (F(), $(re, { key: 0 }, [
1060
+ (Ie = d.modelValue) != null && Ie.template ? (F(), V(re, { key: 0 }, [
1057
1061
  r("div", bs, [
1058
- k(oe, {
1059
- label: e(l)("inventory.transfer.form.type.title")
1062
+ _(oe, {
1063
+ label: e(n)("inventory.transfer.form.type.title")
1060
1064
  }, null, 8, ["label"]),
1061
1065
  r("div", _s, [
1062
- k(H, null, {
1063
- default: O(() => [
1066
+ _(H, null, {
1067
+ default: U(() => [
1064
1068
  r("span", {
1065
1069
  class: Y({ "text-fm-color-typo-disabled": o.disabled })
1066
- }, D(e(l)(`inventory.transfer.form.type.${U.value.toLocaleLowerCase("en-us")}`)), 3)
1070
+ }, R(e(n)(`inventory.transfer.form.type.${$.value.toLocaleLowerCase("en-us")}`)), 3)
1067
1071
  ]),
1068
1072
  _: 1
1069
1073
  }),
@@ -1076,17 +1080,17 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
1076
1080
  ])
1077
1081
  ]),
1078
1082
  r("div", gs, [
1079
- k(oe, {
1080
- label: U.value === e(V).PURCHASE ? e(l)("inventory.transfer.form.purchaseFrom") : e(l)("inventory.transfer.form.transferFrom")
1083
+ _(oe, {
1084
+ label: $.value === e(D).PURCHASE ? e(n)("inventory.transfer.form.purchaseFrom") : e(n)("inventory.transfer.form.transferFrom")
1081
1085
  }, null, 8, ["label"]),
1082
1086
  r("div", ks, [
1083
- k(H, null, {
1084
- default: O(() => {
1085
- var h;
1087
+ _(H, null, {
1088
+ default: U(() => {
1089
+ var w;
1086
1090
  return [
1087
1091
  r("span", {
1088
1092
  class: Y({ "text-fm-color-typo-disabled": o.disabled })
1089
- }, D((h = L.value.find((ge) => ge.value === G.value)) == null ? void 0 : h.label), 3)
1093
+ }, R((w = M.value.find((ge) => ge.value === G.value)) == null ? void 0 : w.label), 3)
1090
1094
  ];
1091
1095
  }),
1092
1096
  _: 1
@@ -1099,88 +1103,88 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
1099
1103
  }, " This field is locked from template. ", 2)
1100
1104
  ])
1101
1105
  ])
1102
- ], 64)) : (F(), $(re, { key: 1 }, [
1103
- k(ve, {
1104
- label: e(l)("inventory.transfer.form.type.title"),
1105
- "model-value": U.value,
1106
- "onUpdate:modelValue": f[0] || (f[0] = (h) => U.value = h),
1106
+ ], 64)) : (F(), V(re, { key: 1 }, [
1107
+ _(ve, {
1108
+ label: e(n)("inventory.transfer.form.type.title"),
1109
+ "model-value": $.value,
1110
+ "onUpdate:modelValue": f[0] || (f[0] = (w) => $.value = w),
1107
1111
  items: [
1108
1112
  {
1109
- label: e(l)("inventory.transfer.form.type.purchase"),
1110
- value: e(V).PURCHASE,
1111
- disabled: !e(A).locationOptionsTypePurchase.value.length,
1112
- sublabel: e(A).locationOptionsTypePurchase.value.length ? void 0 : e(l)("inventory.transfer.form.noSupplierAvailable")
1113
+ label: e(n)("inventory.transfer.form.type.purchase"),
1114
+ value: e(D).PURCHASE,
1115
+ disabled: !e(P).locationOptionsTypePurchase.value.length,
1116
+ sublabel: e(P).locationOptionsTypePurchase.value.length ? void 0 : e(n)("inventory.transfer.form.noSupplierAvailable")
1113
1117
  },
1114
1118
  {
1115
- label: e(l)("inventory.transfer.form.type.transfer"),
1116
- value: e(V).TRANSFER,
1117
- disabled: !e(A).locationOptionsTypeTransfer.value.length,
1118
- sublabel: e(A).locationOptionsTypeTransfer.value.length ? void 0 : e(l)("inventory.transfer.form.noLocationAvailable")
1119
+ label: e(n)("inventory.transfer.form.type.transfer"),
1120
+ value: e(D).TRANSFER,
1121
+ disabled: !e(P).locationOptionsTypeTransfer.value.length,
1122
+ sublabel: e(P).locationOptionsTypeTransfer.value.length ? void 0 : e(n)("inventory.transfer.form.noLocationAvailable")
1119
1123
  }
1120
1124
  ],
1121
- rules: [e(Pe)(1)(L.value)]
1125
+ rules: [e(Pe)(1)(M.value)]
1122
1126
  }, null, 8, ["label", "model-value", "items", "rules"]),
1123
- k(ve, {
1124
- label: U.value === e(V).PURCHASE ? e(l)("inventory.transfer.form.purchaseFrom") : e(l)("inventory.transfer.form.transferFrom"),
1127
+ _(ve, {
1128
+ label: $.value === e(D).PURCHASE ? e(n)("inventory.transfer.form.purchaseFrom") : e(n)("inventory.transfer.form.transferFrom"),
1125
1129
  modelValue: G.value,
1126
- "onUpdate:modelValue": f[1] || (f[1] = (h) => G.value = h),
1127
- items: L.value
1130
+ "onUpdate:modelValue": f[1] || (f[1] = (w) => G.value = w),
1131
+ items: M.value
1128
1132
  }, null, 8, ["label", "modelValue", "items"])
1129
1133
  ], 64)),
1130
- k(he, {
1131
- label: e(l)("inventory.transfer.form.reference"),
1134
+ _(he, {
1135
+ label: e(n)("inventory.transfer.form.reference"),
1132
1136
  "label-mark": "optional",
1133
1137
  modelValue: e(t).ref,
1134
- "onUpdate:modelValue": f[2] || (f[2] = (h) => e(t).ref = h)
1138
+ "onUpdate:modelValue": f[2] || (f[2] = (w) => e(t).ref = w)
1135
1139
  }, null, 8, ["label", "modelValue"]),
1136
- k(we, {
1137
- label: e(l)("inventory.transfer.form.remark"),
1140
+ _(we, {
1141
+ label: e(n)("inventory.transfer.form.remark"),
1138
1142
  "label-mark": "optional",
1139
1143
  "max-length": 240,
1140
1144
  modelValue: ee.value,
1141
- "onUpdate:modelValue": f[3] || (f[3] = (h) => ee.value = h),
1145
+ "onUpdate:modelValue": f[3] || (f[3] = (w) => ee.value = w),
1142
1146
  class: Y([o.disabled ? "text-fm-color-typo-disabled " : ""])
1143
1147
  }, null, 8, ["label", "modelValue", "class"]),
1144
1148
  e(s).isEnabled ? (F(), j(ve, {
1145
1149
  key: 2,
1146
1150
  modelValue: K.value,
1147
- "onUpdate:modelValue": f[4] || (f[4] = (h) => K.value = h),
1148
- label: `NetSuite ${e(l)("inventory.transfer.form.netsuite.subsidiary")}`,
1151
+ "onUpdate:modelValue": f[4] || (f[4] = (w) => K.value = w),
1152
+ label: `NetSuite ${e(n)("inventory.transfer.form.netsuite.subsidiary")}`,
1149
1153
  items: e(s).subsidiaryOptions,
1150
1154
  "label-mark": "required",
1151
1155
  rules: [e(Ve)()]
1152
1156
  }, null, 8, ["modelValue", "label", "items", "rules"])) : z("", !0),
1153
- e(b).enableBackdatePo ? (F(), $("div", Cs, [
1157
+ e(y).enableBackdatePo ? (F(), V("div", Cs, [
1154
1158
  r("div", {
1155
1159
  class: Y([
1156
1160
  "flex",
1157
1161
  {
1158
- "flex-col": g.value
1162
+ "flex-col": p.value
1159
1163
  }
1160
1164
  ])
1161
1165
  }, [
1162
- k(be, {
1166
+ _(be, {
1163
1167
  modelValue: e(Q),
1164
- "onUpdate:modelValue": f[5] || (f[5] = (h) => me(Q) ? Q.value = h : null),
1165
- label: e(l)("inventory.transfer.form.backdate.title"),
1166
- sublabel: e(l)("inventory.transfer.form.backdate.subtitle"),
1168
+ "onUpdate:modelValue": f[5] || (f[5] = (w) => me(Q) ? Q.value = w : null),
1169
+ label: e(n)("inventory.transfer.form.backdate.title"),
1170
+ sublabel: e(n)("inventory.transfer.form.backdate.subtitle"),
1167
1171
  "label-placement": "right",
1168
- disabled: x.value && !o.lastClosingDate || o.disabled
1172
+ disabled: C.value && !o.lastClosingDate || o.disabled
1169
1173
  }, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
1170
1174
  r("div", {
1171
- class: Y({ hidden: g.value, "w-16": !g.value })
1175
+ class: Y({ hidden: p.value, "w-16": !p.value })
1172
1176
  }, null, 2),
1173
- e(Q) ? (F(), $("div", hs, [
1177
+ e(Q) ? (F(), V("div", hs, [
1174
1178
  r("div", ws, [
1175
- k(Se, {
1176
- modelValue: e(_),
1177
- "onUpdate:modelValue": f[6] || (f[6] = (h) => me(_) ? _.value = h : null)
1179
+ _(Se, {
1180
+ modelValue: e(b),
1181
+ "onUpdate:modelValue": f[6] || (f[6] = (w) => me(b) ? b.value = w : null)
1178
1182
  }, null, 8, ["modelValue"])
1179
1183
  ]),
1180
1184
  r("div", Ss, [
1181
- k(T, {
1182
- modelValue: e(C),
1183
- "onUpdate:modelValue": f[7] || (f[7] = (h) => me(C) ? C.value = h : null)
1185
+ _(A, {
1186
+ modelValue: e(g),
1187
+ "onUpdate:modelValue": f[7] || (f[7] = (w) => me(g) ? g.value = w : null)
1184
1188
  }, null, 8, ["modelValue"])
1185
1189
  ])
1186
1190
  ])) : z("", !0)
@@ -1188,22 +1192,22 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
1188
1192
  e(J) ? (F(), j(ne, {
1189
1193
  key: 0,
1190
1194
  modelValue: e(J),
1191
- "onUpdate:modelValue": f[8] || (f[8] = (h) => me(J) ? J.value = h : null),
1195
+ "onUpdate:modelValue": f[8] || (f[8] = (w) => me(J) ? J.value = w : null),
1192
1196
  rules: [e(gt)(new Date(o.lastClosingDate), /* @__PURE__ */ new Date())]
1193
1197
  }, null, 8, ["modelValue", "rules"])) : z("", !0),
1194
- x.value && !o.lastClosingDate ? (F(), $("div", xs, [
1195
- k(ue, {
1198
+ C.value && !o.lastClosingDate ? (F(), V("div", xs, [
1199
+ _(ue, {
1196
1200
  name: "error",
1197
1201
  size: "sm",
1198
1202
  class: "text-fm-color-typo-warning"
1199
1203
  }),
1200
- r("span", Fs, D(e(l)("inventory.transfer.form.backdate.error")), 1)
1204
+ r("span", Fs, R(e(n)("inventory.transfer.form.backdate.error")), 1)
1201
1205
  ])) : z("", !0)
1202
1206
  ])) : z("", !0)
1203
1207
  ])
1204
1208
  ]),
1205
1209
  r("div", Ps, [
1206
- k(ne, {
1210
+ _(ne, {
1207
1211
  "model-value": e(t).items,
1208
1212
  rules: [e(Pe)(1)]
1209
1213
  }, null, 8, ["model-value", "rules"]),
@@ -1211,79 +1215,79 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
1211
1215
  class: Y([
1212
1216
  "flex gap-16",
1213
1217
  {
1214
- "flex-col items-start": g.value,
1215
- "items-center": !g.value
1218
+ "flex-col items-start": p.value,
1219
+ "items-center": !p.value
1216
1220
  }
1217
1221
  ])
1218
1222
  }, [
1219
- r("div", Is, D(e(l)("inventory.transfer.form.items.title")), 1),
1220
- r("div", Ts, [
1221
- k(X, {
1223
+ r("div", Ts, R(e(n)("inventory.transfer.form.items.title")), 1),
1224
+ r("div", Is, [
1225
+ _(X, {
1222
1226
  disabled: o.disabled,
1223
- label: e(l)("inventory.transfer.form.items.addItem"),
1227
+ label: e(n)("inventory.transfer.form.items.addItem"),
1224
1228
  "prepend-icon": "add",
1225
1229
  variant: "secondary",
1226
1230
  "text-color": "primary",
1227
1231
  "bg-color": "transparent",
1228
1232
  "border-color": "primary",
1229
- onClick: f[9] || (f[9] = (h) => Xe()),
1233
+ onClick: f[9] || (f[9] = (w) => Xe()),
1230
1234
  size: "md"
1231
1235
  }, null, 8, ["disabled", "label"]),
1232
1236
  e(t).template ? (F(), j(de, {
1233
1237
  key: 0,
1234
1238
  "z-index": 50
1235
1239
  }, {
1236
- content: O(() => [
1237
- r("div", null, D(e(l)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
1240
+ content: U(() => [
1241
+ r("div", null, R(e(n)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
1238
1242
  ]),
1239
- default: O(() => [
1240
- k(Le, {
1241
- "onUpdate:poItems": f[10] || (f[10] = (h) => e(t).items = h),
1243
+ default: U(() => [
1244
+ _(qe, {
1245
+ "onUpdate:poItems": f[10] || (f[10] = (w) => e(t).items = w),
1242
1246
  disabled: ""
1243
1247
  })
1244
1248
  ]),
1245
1249
  _: 1
1246
- })) : (F(), j(Le, {
1250
+ })) : (F(), j(qe, {
1247
1251
  key: 1,
1248
- "onUpdate:poItems": f[11] || (f[11] = (h) => e(t).items = h),
1252
+ "onUpdate:poItems": f[11] || (f[11] = (w) => e(t).items = w),
1249
1253
  disabled: o.disabled || !!e(t).template
1250
1254
  }, null, 8, ["disabled"]))
1251
1255
  ])
1252
1256
  ], 2),
1253
- U.value === e(V).PURCHASE && S.value && e(b).enableTotalCost && ((Me = o.modelValue) != null && Me.items.length) ? (F(), $("div", $s, [
1254
- k(be, {
1255
- label: e(te) ? e(l)("inventory.transfer.form.items.fetchingData") : e(l)("inventory.transfer.form.items.comparePriceHistory"),
1257
+ $.value === e(D).PURCHASE && h.value && e(y).enableTotalCost && ((Me = o.modelValue) != null && Me.items.length) ? (F(), V("div", $s, [
1258
+ _(be, {
1259
+ label: e(te) ? e(n)("inventory.transfer.form.items.fetchingData") : e(n)("inventory.transfer.form.items.comparePriceHistory"),
1256
1260
  "prepend-icon": "compare_arrows",
1257
1261
  "label-placement": "right",
1258
- "model-value": e(R),
1259
- "onUpdate:modelValue": f[12] || (f[12] = (h) => me(R) ? R.value = h : null),
1262
+ "model-value": e(O),
1263
+ "onUpdate:modelValue": f[12] || (f[12] = (w) => me(O) ? O.value = w : null),
1260
1264
  disabled: e(te) || o.disabled
1261
1265
  }, null, 8, ["label", "model-value", "disabled"])
1262
1266
  ])) : z("", !0),
1263
1267
  (F(), j(le, {
1264
1268
  "column-defs": Je.value,
1265
1269
  "row-data": e(t).items,
1266
- key: e(t).items.map((h) => h.sku._id).join("."),
1270
+ key: e(t).items.map((w) => w.sku._id).join("."),
1267
1271
  "hide-footer": "",
1268
1272
  "page-size": e(t).items.length
1269
1273
  }, {
1270
- "table-row": O((h) => [
1271
- k(ps, {
1274
+ "table-row": U((w) => [
1275
+ _(ps, {
1272
1276
  "compare-price-by-sku": e(W),
1273
- "show-compare-price": U.value === e(V).PURCHASE && e(R),
1274
- row: h
1277
+ "show-compare-price": $.value === e(D).PURCHASE && e(O),
1278
+ row: w
1275
1279
  }, null, 8, ["compare-price-by-sku", "show-compare-price", "row"])
1276
1280
  ]),
1277
- "list-row": O((h) => [
1281
+ "list-row": U((w) => [
1278
1282
  (F(), j(St, {
1279
- row: h,
1283
+ row: w,
1280
1284
  key: e(t).items.map((ge) => ge.sku._id).join(".")
1281
1285
  }, {
1282
- default: O((ge) => [
1283
- k(zt, {
1286
+ default: U((ge) => [
1287
+ _(zt, {
1284
1288
  "compare-price-by-sku": e(W),
1285
- "show-compare-price": U.value === e(V).PURCHASE && e(R),
1286
- row: h,
1289
+ "show-compare-price": $.value === e(D).PURCHASE && e(O),
1290
+ row: w,
1287
1291
  "cell-by-col-id": ge
1288
1292
  }, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "cell-by-col-id"])
1289
1293
  ]),
@@ -1310,16 +1314,16 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
1310
1314
  lastClosingDate: {}
1311
1315
  },
1312
1316
  emits: ["update:show", "submitted"],
1313
- setup(n, { expose: v, emit: u }) {
1317
+ setup(l, { expose: v, emit: i }) {
1314
1318
  var Q;
1315
- const i = n, d = u, t = He(), l = Re(), w = Ie(), m = Be(), s = Ue(), { t: a } = ye(), b = q(!1), c = q(!1), p = q(!1);
1316
- async function g(_) {
1317
- if (_) {
1318
- c.value = !1;
1319
+ const d = l, m = i, t = He(), n = Re(), S = Te(), c = Be(), s = Ue(), { t: a } = ye(), y = L(!1), k = L(!1), x = L(!1);
1320
+ async function p(b) {
1321
+ if (b) {
1322
+ k.value = !1;
1319
1323
  try {
1320
- await w.readSuppliers(), c.value = !0;
1324
+ await S.readSuppliers(), k.value = !0;
1321
1325
  } catch {
1322
- l.open({
1326
+ n.open({
1323
1327
  title: a("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
1324
1328
  message: a("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
1325
1329
  type: "error"
@@ -1327,8 +1331,8 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
1327
1331
  }
1328
1332
  }
1329
1333
  }
1330
- s.watchLocation(g);
1331
- function y() {
1334
+ s.watchLocation(p);
1335
+ function u() {
1332
1336
  return {
1333
1337
  remark: void 0,
1334
1338
  ref: void 0,
@@ -1358,19 +1362,19 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
1358
1362
  _id: "",
1359
1363
  seqNumber: 0,
1360
1364
  deliveryOrder: [],
1361
- template: i.templateId
1365
+ template: d.templateId
1362
1366
  };
1363
1367
  }
1364
- const S = ot(i, "show"), x = q(i.modelValue ?? y()), E = q(((Q = i.modelValue) == null ? void 0 : Q._id) ?? `${Math.random()}`);
1368
+ const h = ot(d, "show"), C = L(d.modelValue ?? u()), B = L(((Q = d.modelValue) == null ? void 0 : Q._id) ?? `${Math.random()}`);
1365
1369
  De(
1366
- () => i.show,
1367
- (_) => {
1368
- var C;
1369
- _ && (p.value = !1, x.value = i.modelValue ?? y(), E.value = ((C = i.modelValue) == null ? void 0 : C._id) ?? `${Math.random()}`);
1370
+ () => d.show,
1371
+ (b) => {
1372
+ var g;
1373
+ b && (x.value = !1, C.value = d.modelValue ?? u(), B.value = ((g = d.modelValue) == null ? void 0 : g._id) ?? `${Math.random()}`);
1370
1374
  }
1371
1375
  );
1372
- const A = P(() => !c.value || !p.value), U = P(() => {
1373
- switch (i.mode) {
1376
+ const P = T(() => !k.value || !x.value), $ = T(() => {
1377
+ switch (d.mode) {
1374
1378
  case ke.READ:
1375
1379
  return "View transfer";
1376
1380
  case ke.CREATE:
@@ -1379,61 +1383,61 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
1379
1383
  return a("inventory.transfer.receiveRequest.update.title");
1380
1384
  }
1381
1385
  return "";
1382
- }), L = q();
1386
+ }), M = L();
1383
1387
  v({
1384
1388
  validateInputs: () => {
1385
- var _, C;
1386
- (C = (_ = L.value) == null ? void 0 : _.validateInputs) == null || C.call(_);
1389
+ var b, g;
1390
+ (g = (b = M.value) == null ? void 0 : b.validateInputs) == null || g.call(b);
1387
1391
  },
1388
1392
  resetInputsValidation: () => {
1389
- var _, C;
1390
- (C = (_ = L.value) == null ? void 0 : _.resetInputsValidation) == null || C.call(_);
1393
+ var b, g;
1394
+ (g = (b = M.value) == null ? void 0 : b.resetInputsValidation) == null || g.call(b);
1391
1395
  },
1392
1396
  resetInputs: () => {
1393
- var _, C;
1394
- (C = (_ = L.value) == null ? void 0 : _.resetInputs) == null || C.call(_);
1397
+ var b, g;
1398
+ (g = (b = M.value) == null ? void 0 : b.resetInputs) == null || g.call(b);
1395
1399
  }
1396
1400
  });
1397
1401
  async function G() {
1398
- const _ = x.value;
1399
- b.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: C, ...R }) => R));
1402
+ const b = C.value;
1403
+ y.value = !0, (b.supplier.internal === "warehouse" || b.supplier.internal === "restaurant") && (b.items = b.items.map(({ totalCost: g, ...O }) => O));
1400
1404
  try {
1401
- await t.createPurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)), l.open({
1405
+ await t.createPurchaseOrder(b), await new Promise((g) => setTimeout(g, 1e3)), n.open({
1402
1406
  title: a("inventory.transfer.receiveRequest.create.success"),
1403
1407
  message: a("inventory.transfer.receiveRequest.create.successMessage"),
1404
1408
  type: "success"
1405
- }), d("update:show", !1), d("submitted");
1406
- } catch (C) {
1407
- l.open({
1409
+ }), m("update:show", !1), m("submitted");
1410
+ } catch (g) {
1411
+ n.open({
1408
1412
  title: a("inventory.transfer.receiveRequest.create.error.title"),
1409
1413
  message: a("inventory.transfer.receiveRequest.create.error.message"),
1410
1414
  type: "error"
1411
- }), console.error("Error in creating purchase order", C);
1415
+ }), console.error("Error in creating purchase order", g);
1412
1416
  } finally {
1413
- b.value = !1;
1417
+ y.value = !1;
1414
1418
  }
1415
1419
  }
1416
1420
  async function ee() {
1417
- const _ = x.value;
1418
- b.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: C, ...R }) => R));
1421
+ const b = C.value;
1422
+ y.value = !0, (b.supplier.internal === "warehouse" || b.supplier.internal === "restaurant") && (b.items = b.items.map(({ totalCost: g, ...O }) => O));
1419
1423
  try {
1420
- await t.updatePurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)), l.open({
1424
+ await t.updatePurchaseOrder(b), await new Promise((g) => setTimeout(g, 1e3)), n.open({
1421
1425
  title: a("inventory.transfer.receiveRequest.update.success"),
1422
1426
  message: a("inventory.transfer.receiveRequest.update.successMessage"),
1423
1427
  type: "success"
1424
- }), d("update:show", !1), d("submitted");
1425
- } catch (C) {
1426
- l.open({
1428
+ }), m("update:show", !1), m("submitted");
1429
+ } catch (g) {
1430
+ n.open({
1427
1431
  title: a("inventory.transfer.receiveRequest.update.error.title"),
1428
1432
  message: a("inventory.transfer.receiveRequest.update.error.message"),
1429
1433
  type: "error"
1430
- }), console.error("Error in updating purchase order", C);
1434
+ }), console.error("Error in updating purchase order", g);
1431
1435
  } finally {
1432
- b.value = !1;
1436
+ y.value = !1;
1433
1437
  }
1434
1438
  }
1435
1439
  function K() {
1436
- switch (i.mode) {
1440
+ switch (d.mode) {
1437
1441
  case ke.CREATE:
1438
1442
  return G();
1439
1443
  case ke.UPDATE:
@@ -1441,52 +1445,52 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
1441
1445
  }
1442
1446
  }
1443
1447
  function J() {
1444
- var _, C;
1445
- (C = (_ = L.value) == null ? void 0 : _.validateInputs) == null || C.call(_);
1448
+ var b, g;
1449
+ (g = (b = M.value) == null ? void 0 : b.validateInputs) == null || g.call(b);
1446
1450
  }
1447
- return (_, C) => {
1448
- const R = I("FmButton"), te = I("FmSideSheet");
1451
+ return (b, g) => {
1452
+ const O = I("FmButton"), te = I("FmSideSheet");
1449
1453
  return F(), j(te, {
1450
- modelValue: e(S),
1451
- "onUpdate:modelValue": C[3] || (C[3] = (W) => me(S) ? S.value = W : null),
1454
+ modelValue: e(h),
1455
+ "onUpdate:modelValue": g[3] || (g[3] = (W) => me(h) ? h.value = W : null),
1452
1456
  "dismiss-away": "",
1453
1457
  "close-button": "",
1454
1458
  "max-width": 900
1455
1459
  }, {
1456
- "side-sheet-header": O(() => [
1460
+ "side-sheet-header": U(() => [
1457
1461
  r("div", Vs, [
1458
- r("div", Ds, D(U.value), 1)
1462
+ r("div", Ds, R($.value), 1)
1459
1463
  ])
1460
1464
  ]),
1461
- default: O(() => [
1465
+ default: U(() => [
1462
1466
  (F(), j(As, {
1463
1467
  class: "w-full",
1464
1468
  ref_key: "formRef",
1465
- ref: L,
1466
- "onForm:ready": C[0] || (C[0] = () => p.value = !0),
1469
+ ref: M,
1470
+ "onForm:ready": g[0] || (g[0] = () => x.value = !0),
1467
1471
  onValidationSuccess: K,
1468
- modelValue: x.value,
1469
- "onUpdate:modelValue": C[1] || (C[1] = (W) => x.value = W),
1470
- disabled: b.value || A.value,
1471
- suppliers: e(w).suppliers,
1472
- skus: e(m).skus,
1473
- key: E.value,
1474
- "last-closing-date": _.lastClosingDate
1472
+ modelValue: C.value,
1473
+ "onUpdate:modelValue": g[1] || (g[1] = (W) => C.value = W),
1474
+ disabled: y.value || P.value,
1475
+ suppliers: e(S).suppliers,
1476
+ skus: e(c).skus,
1477
+ key: B.value,
1478
+ "last-closing-date": b.lastClosingDate
1475
1479
  }, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
1476
1480
  ]),
1477
- "side-sheet-footer": O(() => [
1481
+ "side-sheet-footer": U(() => [
1478
1482
  r("div", Rs, [
1479
- k(R, {
1480
- loading: b.value,
1481
- disabled: A.value,
1483
+ _(O, {
1484
+ loading: y.value,
1485
+ disabled: P.value,
1482
1486
  label: e(a)("common.save"),
1483
1487
  onClick: J
1484
1488
  }, null, 8, ["loading", "disabled", "label"]),
1485
- k(R, {
1486
- disabled: A.value,
1489
+ _(O, {
1490
+ disabled: P.value,
1487
1491
  variant: "tertiary",
1488
1492
  label: e(a)("common.close"),
1489
- onClick: C[2] || (C[2] = (W) => d("update:show", !1))
1493
+ onClick: g[2] || (g[2] = (W) => m("update:show", !1))
1490
1494
  }, null, 8, ["disabled", "label"])
1491
1495
  ])
1492
1496
  ]),