@feedmepos/mf-inventory-portal 0.0.19-dev.7 → 0.0.19-dev.9

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 (34) hide show
  1. package/dist/{ApprovalView-DG8QlKvJ.js → ApprovalView-Bcxk6B7K.js} +5 -5
  2. package/dist/{BindingsDialog-CdmRqTWf.js → BindingsDialog-XDkcjW_c.js} +1 -1
  3. package/dist/{BindingsPicker-CaNAr1xF.js → BindingsPicker-CgbiqX72.js} +1 -1
  4. package/dist/{BindingsTable-vgfhljFI.js → BindingsTable-xNXNsBAd.js} +1 -1
  5. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CAn3vR8I.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DFPkUHl-.js} +1 -1
  6. package/dist/{IngredientsView-DS2OE87m.js → IngredientsView-DD7ns3mP.js} +4 -4
  7. package/dist/{IntegrationView-CJEvYesP.js → IntegrationView-CErHEVAO.js} +2 -2
  8. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DuwIBtAG.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-XXoPyhlc.js} +1 -1
  9. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DklebFji.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BpyUheXn.js} +1 -1
  10. package/dist/{PurchaseOrderPrintPreview-2agLvAK5.js → PurchaseOrderPrintPreview-L_iaaURb.js} +1 -1
  11. package/dist/{ReceiveRequestView-B9pzwq0T.js → ReceiveRequestView-BKbeFDxm.js} +7 -7
  12. package/dist/{RecipeView-ByVpYfdY.js → RecipeView-Drp4l4gL.js} +4 -4
  13. package/dist/{StockView-CZDg_RPV.js → StockView-Cj6fErwD.js} +7 -7
  14. package/dist/{SupplierView-CYCRUXSW.js → SupplierView-EFsHWet-.js} +4 -4
  15. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BULTuX-1.js → TransferDetails.vue_vue_type_script_setup_true_lang-kM5fyqq6.js} +4 -4
  16. package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-DGFGL3N-.js → TransferDialog.vue_vue_type_script_setup_true_lang-CyFMCmXw.js} +539 -500
  17. package/dist/TransferTemplateView-Cymhrayh.js +933 -0
  18. package/dist/{UnitView-B1usfuLP.js → UnitView-C_tAxIpq.js} +5 -5
  19. package/dist/{WarehouseView-YkwvhNsQ.js → WarehouseView-BAqVtbD6.js} +3 -3
  20. package/dist/{app-C_wH_yzL.js → app-CeUU5Gd8.js} +113 -113
  21. package/dist/app.js +1 -1
  22. package/dist/cypress/component/receive-request/KDI-15-total-price-currency.cy.d.ts +2 -0
  23. package/dist/{decimal-CbRAPS5R.js → decimal-D3KXLC4T.js} +1 -1
  24. package/dist/{id-to-date-Dm3h4drD.js → id-to-date-Cj02m808.js} +1 -1
  25. package/dist/{layout-Ci-JOeGS.js → layout-2zzAZIVO.js} +1 -1
  26. package/dist/{purchase-order-transaction-type-D4b3vEiG.js → purchase-order-transaction-type-Dz0YF5qh.js} +2 -2
  27. package/dist/style.css +1 -1
  28. package/dist/{supplier-2nwpEqjI.js → supplier-mDVKd7Ge.js} +1 -1
  29. package/dist/tsconfig.app.tsbuildinfo +1 -1
  30. package/dist/views/receive-request/helper/get-transfer-type.d.ts +2 -0
  31. package/dist/{xlsx-CtXbHg9y.js → xlsx-B-2KyDJq.js} +1 -1
  32. package/dist/{xlsx.util-WiAW11Ii.js → xlsx.util-D6EzRE71.js} +2 -2
  33. package/package.json +3 -3
  34. package/dist/TransferTemplateView-q0cwx2wS.js +0 -877
@@ -1,33 +1,33 @@
1
- import { reactive as Re, onMounted as Be, computed as P, h as V, getCurrentInstance as Fe, watch as fe, defineComponent as te, openBlock as T, createElementBlock as $, Fragment as ue, renderList as be, createElementVNode as i, toDisplayString as M, unref as n, resolveComponent as x, createVNode as C, withCtx as A, createCommentVNode as z, ref as B, createBlock as E, normalizeClass as $e, normalizeStyle as Qe, isRef as re } from "vue";
2
- import { useBreakpoints as Ge, components as ne, FmButtonVariant as ge, useSnackbar as ye, useDialog as Ue, useProxiedModel as Je } from "@feedmepos/ui-library";
3
- import { F as ee, D as De, R as ie } from "./row-action.enum-7jVyol1k.js";
4
- import { P as S, u as Xe, f as et, a as Oe } from "./purchase-order-transaction-type-D4b3vEiG.js";
5
- import { a as j, t as tt, a2 as Ce, D as ot, b as Ee, R as Ae, $ as st, a0 as at, r as nt, G as Me, l as rt, A as we, M as lt, a3 as Ne, c as Le, a5 as it, O as Te, P as ke, a6 as ut, j as K, a7 as ct, u as xe, n as dt, a8 as pt, a9 as mt, aa as ft, E as yt, ab as vt, y as ht } from "./app-C_wH_yzL.js";
6
- import { _ as He, u as _t } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DklebFji.js";
1
+ import { reactive as Be, onMounted as Ue, computed as F, h as V, getCurrentInstance as $e, watch as fe, defineComponent as oe, openBlock as T, createElementBlock as $, Fragment as ue, renderList as ge, createElementVNode as u, toDisplayString as M, unref as n, resolveComponent as P, createVNode as C, withCtx as D, createCommentVNode as z, ref as B, createBlock as E, normalizeClass as Ae, normalizeStyle as Ge, isRef as re } from "vue";
2
+ import { useBreakpoints as Je, components as X, FmButtonVariant as Ce, useSnackbar as ye, useDialog as Oe, useProxiedModel as Xe } from "@feedmepos/ui-library";
3
+ import { F as te, D as De, R as ie } from "./row-action.enum-7jVyol1k.js";
4
+ import { P as x, u as et, f as tt, a as Ee } from "./purchase-order-transaction-type-Dz0YF5qh.js";
5
+ import { a as j, t as ot, a2 as ke, D as st, b as Me, R as Ie, $ as at, a0 as nt, r as rt, G as Le, l as lt, A as Te, M as it, a3 as Ne, c as qe, a5 as ut, O as xe, P as we, a6 as ct, j as K, a7 as dt, u as Se, n as pt, a8 as mt, a9 as ft, aa as yt, E as vt, ab as ht, y as _t } from "./app-CeUU5Gd8.js";
6
+ import { _ as He, u as bt } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BpyUheXn.js";
7
7
  import { useI18n as ce } from "@feedmepos/mf-common";
8
8
  import "vue-router";
9
- import { u as ve } from "./supplier-2nwpEqjI.js";
10
- import { F as le, c as bt, _ as gt } from "./layout-Ci-JOeGS.js";
11
- import { _ as Ct } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
12
- import { defineStore as kt } from "pinia";
13
- function X(t, c, s, e) {
14
- var b, y, p;
9
+ import { u as ve } from "./supplier-mDVKd7Ge.js";
10
+ import { F as le, c as gt, _ as Ct } from "./layout-2zzAZIVO.js";
11
+ import { _ as kt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
12
+ import { defineStore as wt } from "pinia";
13
+ function ee(t, d, s, e) {
14
+ var b, f, i;
15
15
  if (e != null && e.manualTotalCost)
16
16
  return e == null ? void 0 : e.manualTotalCost;
17
- const l = (p = (y = (b = e == null ? void 0 : e.supplier) == null ? void 0 : b.supplyItems) == null ? void 0 : y.find(
18
- (v) => v.skuId === t._id
19
- )) == null ? void 0 : p.defaultCost, m = t.defaultCost, d = l ?? m, k = d == null ? void 0 : d.costPerUnit, f = k ? d != null && d.measurement ? +j(k) / +j(d == null ? void 0 : d.measurement.conversion) : +j(k) : void 0, o = f ? s ? f * +j(s.conversion) : f : void 0, a = o ? +j(c) * o : void 0;
17
+ const l = (i = (f = (b = e == null ? void 0 : e.supplier) == null ? void 0 : b.supplyItems) == null ? void 0 : f.find(
18
+ (y) => y.skuId === t._id
19
+ )) == null ? void 0 : i.defaultCost, m = t.defaultCost, p = l ?? m, k = p == null ? void 0 : p.costPerUnit, v = k ? p != null && p.measurement ? +j(k) / +j(p == null ? void 0 : p.measurement.conversion) : +j(k) : void 0, o = v ? s ? v * +j(s.conversion) : v : void 0, a = o ? +j(d) * o : void 0;
20
20
  return a ? {
21
- ...tt(a ?? 0, 2),
22
- currency: Ce()
21
+ ...ot(a ?? 0, 2),
22
+ currency: ke()
23
23
  } : {
24
24
  amount: 1,
25
25
  precision: 0,
26
- currency: Ce()
26
+ currency: ke()
27
27
  };
28
28
  }
29
29
  var R = /* @__PURE__ */ ((t) => (t.Code = "Code", t.Name = "Name", t.Amount = "Amount", t.Cost = "Cost", t.Delete = "Delete", t))(R || {});
30
- const wt = () => {
30
+ const Tt = () => {
31
31
  const { t } = ce();
32
32
  return V(
33
33
  He,
@@ -38,31 +38,31 @@ const wt = () => {
38
38
  t("inventory.transfer.form.items.table.Cost", [Ne()])
39
39
  );
40
40
  };
41
- function Tt(t) {
42
- const { t: c } = ce(), s = Re({}), { breakpoints: e } = Ge(), l = Ee();
43
- Be(() => {
44
- for (const f of t.items) {
45
- if (!f.totalCost)
41
+ function xt(t) {
42
+ const { t: d } = ce(), s = Be({}), { breakpoints: e } = Je(), l = Me();
43
+ Ue(() => {
44
+ for (const v of t.items) {
45
+ if (!v.totalCost)
46
46
  continue;
47
- const o = X(f.sku, f.quantity, f.measurement, {
47
+ const o = ee(v.sku, v.quantity, v.measurement, {
48
48
  supplier: t.supplier
49
- }), a = f.totalCost ?? ot.reset();
50
- o ? s[f.sku._id] = o.amount !== a.amount || o.precision !== a.precision : s[f.sku._id] = !0;
49
+ }), a = v.totalCost ?? st.reset();
50
+ o ? s[v.sku._id] = o.amount !== a.amount || o.precision !== a.precision : s[v.sku._id] = !0;
51
51
  }
52
52
  });
53
- function m(f) {
53
+ function m(v) {
54
54
  var a, r;
55
- return !!(f.defaultCost ?? ((r = (a = t.supplier) == null ? void 0 : a.supplyItems) == null ? void 0 : r.find((b) => b.skuId === f._id)));
55
+ return !!(v.defaultCost ?? ((r = (a = t.supplier) == null ? void 0 : a.supplyItems) == null ? void 0 : r.find((b) => b.skuId === v._id)));
56
56
  }
57
- const d = [
57
+ const p = [
58
58
  {
59
59
  id: "Code",
60
- header: () => c("inventory.transfer.form.items.table.Code"),
60
+ header: () => d("inventory.transfer.form.items.table.Code"),
61
61
  accessorKey: "code",
62
62
  size: 96,
63
- cell(f) {
64
- const o = f.row.original;
65
- return V(ne.FmTextField, {
63
+ cell(v) {
64
+ const o = v.row.original;
65
+ return V(X.FmTextField, {
66
66
  modelValue: o.code,
67
67
  "onUpdate:modelValue": (a) => {
68
68
  t.updateItem({
@@ -71,7 +71,7 @@ function Tt(t) {
71
71
  });
72
72
  },
73
73
  key: o.sku._id,
74
- rules: [Ae()],
74
+ rules: [Ie()],
75
75
  labelMark: "required"
76
76
  });
77
77
  },
@@ -79,11 +79,11 @@ function Tt(t) {
79
79
  },
80
80
  {
81
81
  id: "Name",
82
- header: () => c("inventory.transfer.form.items.table.Name"),
82
+ header: () => d("inventory.transfer.form.items.table.Name"),
83
83
  minSize: 300,
84
- cell(f) {
85
- const o = f.row.original;
86
- return V(ne.FmTextField, {
84
+ cell(v) {
85
+ const o = v.row.original;
86
+ return V(X.FmTextField, {
87
87
  modelValue: o.name,
88
88
  "onUpdate:modelValue": (a) => {
89
89
  t.updateItem({
@@ -92,7 +92,7 @@ function Tt(t) {
92
92
  });
93
93
  },
94
94
  key: o.sku._id,
95
- rules: [Ae()],
95
+ rules: [Ie()],
96
96
  labelMark: "required"
97
97
  });
98
98
  },
@@ -100,11 +100,11 @@ function Tt(t) {
100
100
  },
101
101
  {
102
102
  id: "Amount",
103
- header: () => c("inventory.transfer.form.items.table.Amount"),
104
- minSize: 150,
105
- cell(f) {
106
- const o = f.row.original;
107
- return V(st, {
103
+ header: () => d("inventory.transfer.form.items.table.Amount"),
104
+ minSize: 200,
105
+ cell(v) {
106
+ const o = v.row.original;
107
+ return V(at, {
108
108
  style: {
109
109
  flex: "1 1 0%"
110
110
  },
@@ -120,19 +120,21 @@ function Tt(t) {
120
120
  quantity: a.amount,
121
121
  measurement: a.measurement
122
122
  };
123
- l.enableTotalCost && (r.totalCost = X(o.sku, o.quantity, o.measurement, {
123
+ l.enableTotalCost && (r.totalCost = ee(o.sku, o.quantity, o.measurement, {
124
124
  supplier: t.supplier,
125
125
  // NOTE: set undefined here if `manualTotalCost[row.sku._id] = false`, so that the function
126
126
  // will return the auto calculated default cost instead of the manual total cost
127
127
  manualTotalCost: s[o.sku._id] ? r.totalCost : void 0
128
128
  })), t.updateItem(r);
129
129
  },
130
+ stepper: o.quantityStep,
131
+ disableUnit: !!t.template,
130
132
  rules: [
131
- at(
133
+ nt(
132
134
  +j(
133
135
  o.minimumQuantity ?? {
134
136
  amount: 1,
135
- precision: nt(o.sku.unit, o.measurement)
137
+ precision: rt(o.sku.unit, o.measurement)
136
138
  }
137
139
  )
138
140
  )
@@ -144,23 +146,24 @@ function Tt(t) {
144
146
  },
145
147
  {
146
148
  id: "Cost",
147
- header: wt,
149
+ header: Tt,
148
150
  size: 180,
149
- cell(f) {
150
- const o = f.row.original, a = m(o.sku), r = e.value.xs || e.value.sm;
151
+ cell(v) {
152
+ const o = v.row.original, a = m(o.sku), r = e.value.xs || e.value.sm;
151
153
  return !s[o.sku._id] && a ? V(
152
154
  "div",
153
155
  {
154
- class: "flex gap-4 fm-typo-en-body-md-400 items-center"
156
+ class: "flex gap-4 fm-typo-en-body-md-400 items-center",
157
+ key: o.sku._id
155
158
  },
156
159
  [
157
- V(ne.FmButton, {
160
+ V(X.FmButton, {
158
161
  prependIcon: "edit",
159
- variant: ge.Tertiary,
162
+ variant: Ce.Tertiary,
160
163
  onClick() {
161
164
  t.updateItem({
162
165
  ...o,
163
- totalCost: X(o.sku, o.quantity, o.measurement, {
166
+ totalCost: ee(o.sku, o.quantity, o.measurement, {
164
167
  supplier: t.supplier
165
168
  })
166
169
  }), s[o.sku._id] = !0;
@@ -174,12 +177,12 @@ function Tt(t) {
174
177
  [
175
178
  V(
176
179
  "span",
177
- r ? Me(
178
- X(o.sku, o.quantity, o.measurement, {
180
+ r ? Le(
181
+ ee(o.sku, o.quantity, o.measurement, {
179
182
  supplier: t.supplier
180
183
  })
181
184
  ) : j(
182
- X(o.sku, o.quantity, o.measurement, {
185
+ ee(o.sku, o.quantity, o.measurement, {
183
186
  supplier: t.supplier
184
187
  })
185
188
  )
@@ -195,7 +198,7 @@ function Tt(t) {
195
198
  )
196
199
  ]
197
200
  ) : V(
198
- ne.FmTextField,
201
+ X.FmTextField,
199
202
  {
200
203
  modelValue: j(o.totalCost ?? { amount: 0, precision: 0 }),
201
204
  key: o.sku._id,
@@ -203,19 +206,19 @@ function Tt(t) {
203
206
  t.updateItem({
204
207
  ...o,
205
208
  totalCost: {
206
- ...rt(+b),
207
- currency: Ce()
209
+ ...lt(+b),
210
+ currency: ke()
208
211
  }
209
212
  });
210
213
  },
211
- rules: [we(0), lt(2)]
214
+ rules: [Te(0), it(2)]
212
215
  },
213
216
  {
214
217
  prepend() {
215
218
  return r ? V("div", { class: "text-fm-typo-en-body-lg-400" }, Ne()) : null;
216
219
  },
217
220
  append() {
218
- return a ? V(ne.FmButton, {
221
+ return a ? V(X.FmButton, {
219
222
  prependIcon: "close",
220
223
  variant: "tertiary",
221
224
  onClick() {
@@ -223,7 +226,7 @@ function Tt(t) {
223
226
  ...o,
224
227
  // NOTE: different from PO template, if a default cost is reenabled,
225
228
  // the total cost will automatically assigned
226
- totalCost: X(o.sku, o.quantity, o.measurement, {
229
+ totalCost: ee(o.sku, o.quantity, o.measurement, {
227
230
  supplier: t.supplier
228
231
  })
229
232
  }), s[o.sku._id] = !1;
@@ -238,15 +241,17 @@ function Tt(t) {
238
241
  {
239
242
  id: "Delete",
240
243
  header: "",
241
- cell(f) {
242
- return V(ne.FmButton, {
244
+ cell(v) {
245
+ const o = v.row.original;
246
+ return V(X.FmButton, {
247
+ key: o.sku._id,
243
248
  class: "delete-button",
244
249
  type: "button",
245
250
  icon: "delete",
246
251
  variant: "tertiary",
247
252
  size: "md",
248
253
  onClick: () => {
249
- t.deleteItem(f.row.original);
254
+ t.deleteItem(o);
250
255
  }
251
256
  });
252
257
  },
@@ -259,52 +264,55 @@ function Tt(t) {
259
264
  }
260
265
  ];
261
266
  return {
262
- columnDefs: P(() => l.enableTotalCost && t.transferType === S.PURCHASE ? d : d.filter((f) => f.id !== "Cost"))
267
+ columnDefs: F(() => l.enableTotalCost && t.transferType === x.PURCHASE ? p : p.filter(
268
+ (v) => v.id !== "Cost"
269
+ /* Cost */
270
+ ))
263
271
  };
264
272
  }
265
- function xt(t = "modelValue") {
266
- var m, d;
267
- const c = ((m = Fe()) == null ? void 0 : m.props) ?? {}, s = ((d = Fe()) == null ? void 0 : d.emit) ?? (() => {
268
- }), e = Re(Le(c[t])), l = `update:${it(t)}`;
273
+ function St(t = "modelValue") {
274
+ var m, p;
275
+ const d = ((m = $e()) == null ? void 0 : m.props) ?? {}, s = ((p = $e()) == null ? void 0 : p.emit) ?? (() => {
276
+ }), e = Be(qe(d[t])), l = `update:${ut(t)}`;
269
277
  return fe(e, (k) => {
270
278
  s(l, k);
271
279
  }), e;
272
280
  }
273
- const St = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, Pt = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, Ft = { class: "w-[450px] xs:w-full flex" }, $t = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, Dt = /* @__PURE__ */ i("span", { class: "text-fm-color-typo-secondary" }, "/", -1), At = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, It = /* @__PURE__ */ i("span", null, /* @__PURE__ */ M(" "), -1), qe = /* @__PURE__ */ te({
281
+ const Pt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, Ft = { 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" }, Dt = /* @__PURE__ */ u("span", { class: "text-fm-color-typo-secondary" }, "/", -1), It = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Vt = /* @__PURE__ */ u("span", null, /* @__PURE__ */ M(" "), -1), ze = /* @__PURE__ */ oe({
274
282
  __name: "SupplierPriceHistory",
275
283
  props: {
276
284
  prices: {}
277
285
  },
278
286
  setup(t) {
279
- const c = ve();
287
+ const d = ve();
280
288
  function s(e) {
281
- return c.suppliers.find((l) => l._id === e);
289
+ return d.suppliers.find((l) => l._id === e);
282
290
  }
283
- return (e, l) => (T(), $("div", St, [
284
- (T(!0), $(ue, null, be(Object.keys(e.prices), (m) => {
285
- var d;
291
+ return (e, l) => (T(), $("div", Pt, [
292
+ (T(!0), $(ue, null, ge(Object.keys(e.prices), (m) => {
293
+ var p;
286
294
  return T(), $("div", {
287
295
  key: m,
288
296
  class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
289
297
  }, [
290
- i("div", Pt, M((d = s(m)) == null ? void 0 : d.name), 1),
291
- i("div", Ft, [
292
- (T(!0), $(ue, null, be(e.prices[m].slice(0, 3), (k) => {
293
- var f;
298
+ u("div", Ft, M((p = s(m)) == null ? void 0 : p.name), 1),
299
+ u("div", $t, [
300
+ (T(!0), $(ue, null, ge(e.prices[m].slice(0, 3), (k) => {
301
+ var v;
294
302
  return T(), $("div", {
295
303
  key: k.date,
296
304
  class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
297
305
  }, [
298
- i("div", $t, [
299
- i("span", null, M(k.totalCost ? n(Me)(k.totalCost) : "No data"), 1),
306
+ u("div", At, [
307
+ u("span", null, M(k.totalCost ? n(Le)(k.totalCost) : "No data"), 1),
300
308
  Dt,
301
- i("span", null, M(n(j)(k.totalUnit, !1)), 1),
302
- i("span", null, M(((f = k.measurement) == null ? void 0 : f.abbrev) ?? k.unit.abbrev), 1)
309
+ u("span", null, M(n(j)(k.totalUnit, !1)), 1),
310
+ u("span", null, M(((v = k.measurement) == null ? void 0 : v.abbrev) ?? k.unit.abbrev), 1)
303
311
  ]),
304
- i("div", At, [
305
- i("span", null, "(#" + M(k.seqNumber) + ")", 1),
306
- It,
307
- i("span", null, M(n(Te)(new Date(k.date))), 1)
312
+ u("div", It, [
313
+ u("span", null, "(#" + M(k.seqNumber) + ")", 1),
314
+ Vt,
315
+ u("span", null, M(n(xe)(new Date(k.date))), 1)
308
316
  ])
309
317
  ]);
310
318
  }), 128))
@@ -313,7 +321,7 @@ const St = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
313
321
  }), 128))
314
322
  ]));
315
323
  }
316
- }), Vt = { class: "flex flex-col gap-8 py-16" }, Rt = { class: "flex items-center" }, Bt = { class: "flex-1 flex gap-1 items-center" }, Ut = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ot = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Et = { class: "flex gap-8 w-full" }, Mt = { class: "flex-1 flex flex-col gap-4" }, Nt = /* @__PURE__ */ i("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1), Lt = { class: "flex-1 flex flex-col gap-4" }, Ht = /* @__PURE__ */ i("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1), qt = { class: "flex gap-8 w-full" }, zt = { class: "flex-1 flex flex-col gap-4" }, jt = /* @__PURE__ */ i("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1), Kt = { class: "flex-1 flex flex-col gap-4" }, Yt = /* @__PURE__ */ i("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1), Wt = /* @__PURE__ */ te({
324
+ }), Rt = { class: "flex flex-col gap-8 py-16" }, Bt = { class: "flex items-center" }, Ut = { class: "flex-1 flex gap-1 items-center" }, Ot = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Et = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Mt = { class: "flex gap-8 w-full" }, Lt = { class: "flex-1 flex flex-col gap-4" }, Nt = /* @__PURE__ */ u("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1), qt = { class: "flex-1 flex flex-col gap-4" }, Ht = /* @__PURE__ */ u("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1), zt = { class: "flex gap-8 w-full" }, jt = { class: "flex-1 flex flex-col gap-4" }, Kt = /* @__PURE__ */ u("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1), Yt = { class: "flex-1 flex flex-col gap-4" }, Wt = /* @__PURE__ */ u("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1), Zt = /* @__PURE__ */ oe({
317
325
  __name: "TransferItem",
318
326
  props: {
319
327
  cellByColId: {},
@@ -322,75 +330,75 @@ const St = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
322
330
  row: {}
323
331
  },
324
332
  setup(t) {
325
- const { t: c } = ce();
333
+ const { t: d } = ce();
326
334
  return (s, e) => {
327
- var d, k, f, o, a, r, b, y, p, v, F, I, Z, O, N, Y, L, h, g, U, H, q, de, oe, he, u, _;
328
- const l = x("FmLabel"), m = x("FmSpacer");
329
- return T(), $("div", Vt, [
330
- i("div", Rt, [
331
- i("div", Bt, [
332
- i("span", Ut, " (" + M(s.row.original.sku.code) + ") ", 1),
333
- i("span", Ot, M(s.row.original.sku.name), 1)
335
+ var p, k, v, o, a, r, b, f, i, y, S, I, Z, O, L, Y, N, h, g, U, q, H, de, se, he, c, _;
336
+ const l = P("FmLabel"), m = P("FmSpacer");
337
+ return T(), $("div", Rt, [
338
+ u("div", Bt, [
339
+ u("div", Ut, [
340
+ u("span", Ot, " (" + M(s.row.original.sku.code) + ") ", 1),
341
+ u("span", Et, M(s.row.original.sku.name), 1)
334
342
  ]),
335
- i("div", null, [
343
+ u("div", null, [
336
344
  C(n(le), {
337
- render: (f = (k = (d = s.cellByColId.Delete) == null ? void 0 : d.column) == null ? void 0 : k.columnDef) == null ? void 0 : f.cell,
345
+ render: (v = (k = (p = s.cellByColId.Delete) == null ? void 0 : p.column) == null ? void 0 : k.columnDef) == null ? void 0 : v.cell,
338
346
  props: (a = (o = s.cellByColId.Delete) == null ? void 0 : o.getContext) == null ? void 0 : a.call(o)
339
347
  }, null, 8, ["render", "props"])
340
348
  ])
341
349
  ]),
342
- i("div", Et, [
343
- i("div", Mt, [
350
+ u("div", Mt, [
351
+ u("div", Lt, [
344
352
  C(l, {
345
- label: n(c)(`inventory.transfer.form.items.table.${n(R).Code}`)
353
+ label: n(d)(`inventory.transfer.form.items.table.${n(R).Code}`)
346
354
  }, null, 8, ["label"]),
347
355
  C(n(le), {
348
- render: (y = (b = (r = s.cellByColId[n(R).Code]) == null ? void 0 : r.column) == null ? void 0 : b.columnDef) == null ? void 0 : y.cell,
349
- props: (v = (p = s.cellByColId[n(R).Code]) == null ? void 0 : p.getContext) == null ? void 0 : v.call(p)
356
+ render: (f = (b = (r = s.cellByColId[n(R).Code]) == null ? void 0 : r.column) == null ? void 0 : b.columnDef) == null ? void 0 : f.cell,
357
+ props: (y = (i = s.cellByColId[n(R).Code]) == null ? void 0 : i.getContext) == null ? void 0 : y.call(i)
350
358
  }, null, 8, ["render", "props"]),
351
359
  Nt
352
360
  ]),
353
- i("div", Lt, [
361
+ u("div", qt, [
354
362
  C(l, {
355
- label: n(c)(`inventory.transfer.form.items.table.${n(R).Name}`)
363
+ label: n(d)(`inventory.transfer.form.items.table.${n(R).Name}`)
356
364
  }, null, 8, ["label"]),
357
365
  C(n(le), {
358
- render: (Z = (I = (F = s.cellByColId[n(R).Name]) == null ? void 0 : F.column) == null ? void 0 : I.columnDef) == null ? void 0 : Z.cell,
359
- props: (N = (O = s.cellByColId[n(R).Name]) == null ? void 0 : O.getContext) == null ? void 0 : N.call(O)
366
+ render: (Z = (I = (S = s.cellByColId[n(R).Name]) == null ? void 0 : S.column) == null ? void 0 : I.columnDef) == null ? void 0 : Z.cell,
367
+ props: (L = (O = s.cellByColId[n(R).Name]) == null ? void 0 : O.getContext) == null ? void 0 : L.call(O)
360
368
  }, null, 8, ["render", "props"]),
361
369
  Ht
362
370
  ])
363
371
  ]),
364
- i("div", qt, [
365
- i("div", zt, [
372
+ u("div", zt, [
373
+ u("div", jt, [
366
374
  C(l, {
367
- label: n(c)(`inventory.transfer.form.items.table.${n(R).Amount}`)
375
+ label: n(d)(`inventory.transfer.form.items.table.${n(R).Amount}`)
368
376
  }, null, 8, ["label"]),
369
377
  C(n(le), {
370
- render: (h = (L = (Y = s.cellByColId[n(R).Amount]) == null ? void 0 : Y.column) == null ? void 0 : L.columnDef) == null ? void 0 : h.cell,
378
+ render: (h = (N = (Y = s.cellByColId[n(R).Amount]) == null ? void 0 : Y.column) == null ? void 0 : N.columnDef) == null ? void 0 : h.cell,
371
379
  props: (U = (g = s.cellByColId[n(R).Amount]) == null ? void 0 : g.getContext) == null ? void 0 : U.call(g)
372
380
  }, null, 8, ["render", "props"]),
373
- jt
381
+ Kt
374
382
  ]),
375
- i("div", Kt, [
383
+ u("div", Yt, [
376
384
  C(He, { "z-index": 50 }, {
377
- default: A(() => [
385
+ default: D(() => [
378
386
  C(l, {
379
- label: n(c)(`inventory.transfer.form.items.table.${n(R).Cost}2`)
387
+ label: n(d)(`inventory.transfer.form.items.table.${n(R).Cost}2`)
380
388
  }, null, 8, ["label"])
381
389
  ]),
382
390
  _: 1
383
391
  }),
384
392
  C(n(le), {
385
- render: (de = (q = (H = s.cellByColId[n(R).Cost]) == null ? void 0 : H.column) == null ? void 0 : q.columnDef) == null ? void 0 : de.cell,
386
- props: (he = (oe = s.cellByColId[n(R).Cost]) == null ? void 0 : oe.getContext) == null ? void 0 : he.call(oe)
393
+ render: (de = (H = (q = s.cellByColId[n(R).Cost]) == null ? void 0 : q.column) == null ? void 0 : H.columnDef) == null ? void 0 : de.cell,
394
+ props: (he = (se = s.cellByColId[n(R).Cost]) == null ? void 0 : se.getContext) == null ? void 0 : he.call(se)
387
395
  }, null, 8, ["render", "props"]),
388
- Yt
396
+ Wt
389
397
  ])
390
398
  ]),
391
- s.showComparePrice && Object.keys(s.comparePriceBySku[(u = s.row.original.sku) == null ? void 0 : u._id] ?? {}).length > 0 ? (T(), $(ue, { key: 0 }, [
399
+ s.showComparePrice && Object.keys(s.comparePriceBySku[(c = s.row.original.sku) == null ? void 0 : c._id] ?? {}).length > 0 ? (T(), $(ue, { key: 0 }, [
392
400
  C(m, { class: "h-8" }),
393
- C(qe, {
401
+ C(ze, {
394
402
  prices: s.comparePriceBySku[(_ = s.row.original.sku) == null ? void 0 : _._id]
395
403
  }, null, 8, ["prices"])
396
404
  ], 64)) : z("", !0)
@@ -399,7 +407,7 @@ const St = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
399
407
  }
400
408
  });
401
409
  function pe(t) {
402
- return ut.parse(t);
410
+ return ct.parse(t);
403
411
  }
404
412
  function me(t) {
405
413
  return {
@@ -413,78 +421,78 @@ function me(t) {
413
421
  address: t.doc.profile.address
414
422
  };
415
423
  }
416
- function Zt(t, c) {
424
+ function Qt(t, d) {
417
425
  const s = ve(), e = K();
418
426
  e.watchLocation(async () => {
419
427
  await s.readSuppliers();
420
428
  const a = t();
421
429
  if (a.supplier._id) return;
422
430
  const r = s.suppliers[0], b = e.locations[0];
423
- c({
431
+ d({
424
432
  ...a,
425
433
  supplier: r ? pe(r) : b ? me(b) : a.supplier
426
434
  });
427
435
  });
428
- const l = P(
436
+ const l = F(
429
437
  () => {
430
438
  var a, r;
431
- return typeof ((r = (a = t()) == null ? void 0 : a.supplier) == null ? void 0 : r.internal) == "string" ? S.TRANSFER : S.PURCHASE;
439
+ return typeof ((r = (a = t()) == null ? void 0 : a.supplier) == null ? void 0 : r.internal) == "string" ? x.TRANSFER : x.PURCHASE;
432
440
  }
433
- ), m = P({
441
+ ), m = F({
434
442
  get() {
435
443
  var a, r;
436
444
  return (r = (a = t()) == null ? void 0 : a.supplier) == null ? void 0 : r._id;
437
445
  },
438
446
  set(a) {
439
447
  const r = t() ?? {};
440
- if (l.value === S.PURCHASE) {
441
- const p = s.suppliers.find((v) => v._id === a);
442
- c({
448
+ if (l.value === x.PURCHASE) {
449
+ const i = s.suppliers.find((y) => y._id === a);
450
+ d({
443
451
  ...r,
444
- supplier: p ? pe(p) : r.supplier
452
+ supplier: i ? pe(i) : r.supplier
445
453
  });
446
454
  return;
447
455
  }
448
- const y = e.locations.find((p) => p.doc._id === a);
449
- c({
456
+ const f = e.locations.find((i) => i.doc._id === a);
457
+ d({
450
458
  ...r,
451
- supplier: y ? me(y) : r.supplier
459
+ supplier: f ? me(f) : r.supplier
452
460
  });
453
461
  }
454
- }), d = P(() => s.suppliers.map(pe)), k = P(() => {
462
+ }), p = F(() => s.suppliers.map(pe)), k = F(() => {
455
463
  var r;
456
- const a = ((r = e._currentLocation) == null ? void 0 : r.type) === ke.warehouse;
464
+ const a = ((r = e._currentLocation) == null ? void 0 : r.type) === we.warehouse;
457
465
  return e.locations.filter((b) => {
458
- var p;
459
- return !(b.dbName === ((p = e._currentLocation) == null ? void 0 : p.dbName)) && (!a || b.type === ke.warehouse) && b.acceptRequest;
466
+ var i;
467
+ return !(b.dbName === ((i = e._currentLocation) == null ? void 0 : i.dbName)) && (!a || b.type === we.warehouse) && b.acceptRequest;
460
468
  }).map(me);
461
- }), f = P(() => l.value === S.PURCHASE ? d.value.map((r) => ({
469
+ }), v = F(() => l.value === x.PURCHASE ? p.value.map((r) => ({
462
470
  label: r.name,
463
471
  value: r._id
464
472
  })) : k.value.map((r) => ({
465
473
  label: r.name,
466
474
  sublabel: r.internal ? `${r.internal}` : void 0,
467
475
  value: r._id
468
- }))), o = P(() => {
469
- var y, p;
470
- const a = (p = (y = t()) == null ? void 0 : y.supplier) == null ? void 0 : p._id;
471
- if (l.value === S.PURCHASE) {
472
- const v = s.suppliers.find((F) => F._id === a);
473
- return v ? pe(v) : null;
476
+ }))), o = F(() => {
477
+ var f, i;
478
+ const a = (i = (f = t()) == null ? void 0 : f.supplier) == null ? void 0 : i._id;
479
+ if (l.value === x.PURCHASE) {
480
+ const y = s.suppliers.find((S) => S._id === a);
481
+ return y ? pe(y) : null;
474
482
  }
475
- const b = e.locations.find((v) => v.doc._id);
483
+ const b = e.locations.find((y) => y.doc._id);
476
484
  return b ? me(b) : null;
477
485
  });
478
486
  return {
479
487
  transferLocationModel: m,
480
- transferLocationOptions: f,
481
- locationOptionsTypePurchase: d,
488
+ transferLocationOptions: v,
489
+ locationOptionsTypePurchase: p,
482
490
  locationOptionsTypeTransfer: k,
483
491
  selectedLocation: o
484
492
  };
485
493
  }
486
- function Qt(t) {
487
- const c = P({
494
+ function Gt(t) {
495
+ const d = F({
488
496
  get() {
489
497
  const m = t.getEffectiveAt();
490
498
  return m ? new Date(m) : null;
@@ -492,42 +500,42 @@ function Qt(t) {
492
500
  set(m) {
493
501
  t.setEffectiveAt((m == null ? void 0 : m.toISOString()) ?? null);
494
502
  }
495
- }), s = P({
503
+ }), s = F({
496
504
  get() {
497
- return !!c.value;
505
+ return !!d.value;
498
506
  },
499
507
  set(m) {
500
- m ? c.value = /* @__PURE__ */ new Date() : c.value = null;
508
+ m ? d.value = /* @__PURE__ */ new Date() : d.value = null;
501
509
  }
502
- }), e = P({
510
+ }), e = F({
503
511
  get() {
504
- return c.value === null ? "" : Te(c.value);
512
+ return d.value === null ? "" : xe(d.value);
505
513
  },
506
514
  set(m) {
507
- m ? c.value = /* @__PURE__ */ new Date(`${m} ${l.value}`) : c.value = null;
515
+ m ? d.value = /* @__PURE__ */ new Date(`${m} ${l.value}`) : d.value = null;
508
516
  }
509
- }), l = P({
517
+ }), l = F({
510
518
  get() {
511
- return c.value === null ? "" : ct(c.value);
519
+ return d.value === null ? "" : dt(d.value);
512
520
  },
513
521
  set(m) {
514
- m ? c.value = /* @__PURE__ */ new Date(`${e.value} ${m}`) : c.value = null;
522
+ m ? d.value = /* @__PURE__ */ new Date(`${e.value} ${m}`) : d.value = null;
515
523
  }
516
524
  });
517
525
  return {
518
- backdatePo: c,
526
+ backdatePo: d,
519
527
  backdateSwitch: s,
520
528
  backdateModel: e,
521
529
  backdateTimeModel: l
522
530
  };
523
531
  }
524
- const Gt = {
532
+ const Jt = {
525
533
  width: "24",
526
534
  height: "24",
527
535
  viewBox: "0 0 24 24",
528
536
  fill: "none",
529
537
  xmlns: "http://www.w3.org/2000/svg"
530
- }, Jt = ["fill"], Xt = ["fill"], eo = ["stroke"], to = ["stroke"], oo = /* @__PURE__ */ te({
538
+ }, Xt = ["fill"], eo = ["fill"], to = ["stroke"], oo = ["stroke"], so = /* @__PURE__ */ oe({
531
539
  __name: "SparkIcon",
532
540
  props: {
533
541
  size: {
@@ -540,74 +548,74 @@ const Gt = {
540
548
  }
541
549
  },
542
550
  setup(t) {
543
- return (c, s) => (T(), $("svg", Gt, [
544
- i("path", {
551
+ return (d, s) => (T(), $("svg", Jt, [
552
+ u("path", {
545
553
  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",
546
554
  fill: t.color
547
- }, null, 8, Jt),
548
- i("path", {
555
+ }, null, 8, Xt),
556
+ u("path", {
549
557
  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",
550
558
  fill: t.color
551
- }, null, 8, Xt),
552
- i("path", {
559
+ }, null, 8, eo),
560
+ u("path", {
553
561
  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",
554
562
  stroke: t.color,
555
563
  "stroke-width": "1.5",
556
564
  "stroke-linecap": "round",
557
565
  "stroke-linejoin": "round"
558
- }, null, 8, eo),
559
- i("path", {
566
+ }, null, 8, to),
567
+ u("path", {
560
568
  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",
561
569
  stroke: t.color,
562
570
  "stroke-width": "1.5",
563
571
  "stroke-linecap": "round",
564
572
  "stroke-linejoin": "round"
565
- }, null, 8, to)
573
+ }, null, 8, oo)
566
574
  ]));
567
575
  }
568
- }), so = { class: "flex gap-8 items-center" }, ao = /* @__PURE__ */ i("div", { class: "fm-typo-en-body-lg-600 line-clamp-1" }, "Forecast stock", -1), no = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, ro = { class: "flex items-center w-full" }, lo = { class: "flex-1" }, io = /* @__PURE__ */ i("p", { class: "fm-typo-en-title-sm-800" }, "Forecast stock", -1), uo = { class: "flex items-start gap-8" }, co = /* @__PURE__ */ i("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Selecting forecast stock will replace your current item selection. ", -1), po = { class: "flex gap-1" }, mo = /* @__PURE__ */ i("div", { class: "grow" }, null, -1), Ie = /* @__PURE__ */ te({
576
+ }), ao = { class: "flex gap-8 items-center" }, no = /* @__PURE__ */ u("div", { class: "fm-typo-en-body-lg-600 line-clamp-1" }, "Forecast stock", -1), ro = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, lo = { class: "flex items-center w-full" }, io = { class: "flex-1" }, uo = /* @__PURE__ */ u("p", { class: "fm-typo-en-title-sm-800" }, "Forecast stock", -1), co = { class: "flex items-start gap-8" }, po = /* @__PURE__ */ u("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Selecting forecast stock will replace your current item selection. ", -1), mo = { class: "flex gap-1" }, fo = /* @__PURE__ */ u("div", { class: "grow" }, null, -1), Ve = /* @__PURE__ */ oe({
569
577
  __name: "ForecastStock",
570
578
  props: {
571
579
  disabled: { type: Boolean }
572
580
  },
573
581
  emits: ["update:poItems"],
574
- setup(t, { emit: c }) {
575
- const s = c, e = B(!1), l = B(7), m = _t(), d = ye(), k = xe();
576
- async function f() {
582
+ setup(t, { emit: d }) {
583
+ const s = d, e = B(!1), l = B(7), m = bt(), p = ye(), k = Se();
584
+ async function v() {
577
585
  if (l.value < 1)
578
586
  return;
579
587
  e.value = !1, await m.readPurchaseOrder(l.value);
580
588
  const o = [];
581
589
  if (m.purchaseOrderForecast.skus.length <= 0) {
582
- d.open({ message: "There is no forecast at the moment.", type: "info" });
590
+ p.open({ message: "There is no forecast at the moment.", type: "info" });
583
591
  return;
584
592
  }
585
593
  const a = m.purchaseOrderForecast.skus.reduce((r, b) => {
586
- const y = k.skus.find((F) => F._id === b.id);
587
- if (r.find((F) => F.sku._id === b.id) || !y)
594
+ const f = k.skus.find((S) => S._id === b.id);
595
+ if (r.find((S) => S.sku._id === b.id) || !f)
588
596
  return r;
589
- const v = {
590
- sku: y,
591
- code: y.code,
592
- name: y.name,
597
+ const y = {
598
+ sku: f,
599
+ code: f.code,
600
+ name: f.name,
593
601
  quantity: {
594
602
  amount: b.amount,
595
603
  precision: 0
596
604
  }
597
605
  };
598
- return r.push(v), r;
606
+ return r.push(y), r;
599
607
  }, o);
600
608
  s("update:poItems", a);
601
609
  }
602
610
  return (o, a) => {
603
- const r = x("FmButton"), b = x("FmIcon"), y = x("FmStepperField"), p = x("FmPopover");
604
- return T(), E(p, {
611
+ const r = P("FmButton"), b = P("FmIcon"), f = P("FmStepperField"), i = P("FmPopover");
612
+ return T(), E(i, {
605
613
  disabled: o.disabled,
606
614
  class: "flex",
607
615
  "show-popover": e.value,
608
- onPopoverChanged: a[3] || (a[3] = (v) => e.value = v)
616
+ onPopoverChanged: a[3] || (a[3] = (y) => e.value = y)
609
617
  }, {
610
- "popover-button": A(() => [
618
+ "popover-button": D(() => [
611
619
  C(r, {
612
620
  label: "unused",
613
621
  variant: "secondary",
@@ -616,25 +624,25 @@ const Gt = {
616
624
  "border-color": o.disabled ? "disabled" : "primary",
617
625
  disabled: o.disabled
618
626
  }, {
619
- default: A(() => [
620
- i("div", so, [
621
- C(oo, {
627
+ default: D(() => [
628
+ u("div", ao, [
629
+ C(so, {
622
630
  size: 24,
623
631
  color: o.disabled ? "#c7c7cc" : "#ff7823"
624
632
  }, null, 8, ["color"]),
625
- ao
633
+ no
626
634
  ])
627
635
  ]),
628
636
  _: 1
629
637
  }, 8, ["text-color", "border-color", "disabled"])
630
638
  ]),
631
- default: A(() => [
632
- i("div", no, [
633
- i("div", ro, [
634
- i("div", lo, [
635
- C(Ct, { "z-index": 99 }, {
636
- default: A(() => [
637
- io
639
+ default: D(() => [
640
+ u("div", ro, [
641
+ u("div", lo, [
642
+ u("div", io, [
643
+ C(kt, { "z-index": 99 }, {
644
+ default: D(() => [
645
+ uo
638
646
  ]),
639
647
  _: 1
640
648
  })
@@ -643,37 +651,37 @@ const Gt = {
643
651
  icon: "close",
644
652
  size: "md",
645
653
  variant: "tertiary",
646
- onClick: a[0] || (a[0] = (v) => e.value = !1)
654
+ onClick: a[0] || (a[0] = (y) => e.value = !1)
647
655
  })
648
656
  ]),
649
- C(y, {
657
+ C(f, {
650
658
  modelValue: l.value,
651
- "onUpdate:modelValue": a[1] || (a[1] = (v) => l.value = v),
659
+ "onUpdate:modelValue": a[1] || (a[1] = (y) => l.value = y),
652
660
  label: "Enter day to forecast stock",
653
- rules: [n(we)(1)]
661
+ rules: [n(Te)(1)]
654
662
  }, {
655
- "helper-text": A(() => [
656
- i("div", uo, [
663
+ "helper-text": D(() => [
664
+ u("div", co, [
657
665
  C(b, {
658
666
  name: "warning",
659
667
  size: "sm",
660
668
  class: "text-fm-color-system-warning-300"
661
669
  }),
662
- co
670
+ po
663
671
  ])
664
672
  ]),
665
673
  _: 1
666
674
  }, 8, ["modelValue", "rules"]),
667
- i("div", po, [
668
- mo,
675
+ u("div", mo, [
676
+ fo,
669
677
  C(r, {
670
678
  label: "Cancel",
671
679
  variant: "tertiary",
672
- onClick: a[2] || (a[2] = (v) => e.value = !1)
680
+ onClick: a[2] || (a[2] = (y) => e.value = !1)
673
681
  }),
674
682
  C(r, {
675
683
  label: "Generate",
676
- onClick: f
684
+ onClick: v
677
685
  })
678
686
  ])
679
687
  ])
@@ -682,41 +690,41 @@ const Gt = {
682
690
  }, 8, ["disabled", "show-popover"]);
683
691
  };
684
692
  }
685
- }), ze = dt((t, c) => ({
693
+ }), je = pt((t, d) => ({
686
694
  async getTemplate(s) {
687
695
  const e = K(), l = `${t.inventoryBackendUrl}/${e.currentLocationDBName}/purchase-order-template/${s}`;
688
- return c.get(l);
696
+ return d.get(l);
689
697
  },
690
698
  async readTemplates() {
691
699
  const s = K(), e = `${t.inventoryBackendUrl}/${s.currentLocationDBName}/purchase-order-template`;
692
- return c.get(e);
700
+ return d.get(e);
693
701
  },
694
702
  async createTemplate(s) {
695
703
  const e = K(), l = `${t.inventoryBackendUrl}/${e.currentLocationDBName}/purchase-order-template`;
696
- return c.post(l, s);
704
+ return d.post(l, s);
697
705
  },
698
706
  async updateTemplate(s) {
699
707
  const e = K(), l = `${t.inventoryBackendUrl}/${e.currentLocationDBName}/purchase-order-template`;
700
- return c.post(l, s);
708
+ return d.post(l, s);
701
709
  },
702
710
  async deleteTemplate(s) {
703
711
  const e = K(), l = `${t.inventoryBackendUrl}/${e.currentLocationDBName}/purchase-order-template`;
704
- return c.delete(l, { _id: s._id, _rev: s._rev });
712
+ return d.delete(l, { _id: s._id, _rev: s._rev });
705
713
  }
706
- })), fo = kt("transferTemplateActions", () => {
707
- const t = Xe("receive/request"), c = Ue(), s = ye(), e = ze(), l = B({});
714
+ })), yo = wt("transferTemplateActions", () => {
715
+ const t = et("receive/request"), d = Oe(), s = ye(), e = je(), l = B({});
708
716
  function m() {
709
717
  l.value = {
710
- mode: ee.CREATE,
718
+ mode: te.CREATE,
711
719
  show: !0,
712
720
  "onUpdate:show"(a) {
713
721
  l.value.show = a;
714
722
  }
715
723
  };
716
724
  }
717
- function d(a) {
725
+ function p(a) {
718
726
  l.value = {
719
- mode: ee.UPDATE,
727
+ mode: te.UPDATE,
720
728
  modelValue: a,
721
729
  show: !0,
722
730
  "onUpdate:show"(r) {
@@ -725,17 +733,17 @@ const Gt = {
725
733
  };
726
734
  }
727
735
  function k(a, r, b) {
728
- c.open({
736
+ d.open({
729
737
  title: `Confirm deleting template ${a.name}?`,
730
738
  message: "Deleted template can no longer be retrieved",
731
739
  primaryActions: {
732
740
  text: "Delete",
733
- variant: ge.Destructive,
741
+ variant: Ce.Destructive,
734
742
  close: !0
735
743
  },
736
744
  secondaryActions: {
737
745
  text: "Cancel",
738
- variant: ge.Plain,
746
+ variant: Ce.Plain,
739
747
  close: !0
740
748
  }
741
749
  }).onPrimary(async () => {
@@ -745,27 +753,27 @@ const Gt = {
745
753
  });
746
754
  try {
747
755
  r.value = !0;
748
- const [y] = await Promise.allSettled([
756
+ const [f] = await Promise.allSettled([
749
757
  e.deleteTemplate(a),
750
- new Promise((p) => setTimeout(p, 1e3))
758
+ new Promise((i) => setTimeout(i, 1e3))
751
759
  ]);
752
- if (y.status === "rejected") throw y.reason;
760
+ if (f.status === "rejected") throw f.reason;
753
761
  s.open({
754
762
  title: `Deleted ${a.name}`,
755
763
  type: "success"
756
764
  });
757
- } catch (y) {
765
+ } catch (f) {
758
766
  s.open({
759
767
  title: `Unable to delete ${a.name}`,
760
- message: `See error from server: ${y}`,
768
+ message: `See error from server: ${f}`,
761
769
  type: "error"
762
- }), console.error("error on deleting purchase order template", y);
770
+ }), console.error("error on deleting purchase order template", f);
763
771
  } finally {
764
772
  r.value = !1, b();
765
773
  }
766
774
  });
767
775
  }
768
- function f(a) {
776
+ function v(a) {
769
777
  }
770
778
  function o(a) {
771
779
  t.promptCreateTransferDialog({
@@ -775,90 +783,121 @@ const Gt = {
775
783
  }
776
784
  return {
777
785
  createTemplate: m,
778
- viewTemplate: f,
779
- updateTemplate: d,
786
+ viewTemplate: v,
787
+ updateTemplate: p,
780
788
  deleteTemplate: k,
781
789
  useTemplate: o,
782
790
  templateDialogProps: l,
783
791
  transferFormDialogProps: t.transferDialogProps
784
792
  };
785
- }), Ve = "use";
786
- function yo() {
787
- const { t } = ce(), { viewTemplate: c, updateTemplate: s, deleteTemplate: e, useTemplate: l } = fo(), m = B(new Array()), d = B(!1), k = K(), f = ze();
793
+ });
794
+ function be(t) {
795
+ var s;
796
+ return ((s = t == null ? void 0 : t.supplier) == null ? void 0 : s.internal) ? x.TRANSFER : x.PURCHASE;
797
+ }
798
+ const Re = "use";
799
+ function vo() {
800
+ const { t } = ce(), { viewTemplate: d, updateTemplate: s, deleteTemplate: e, useTemplate: l } = yo(), m = B(new Array()), p = B(!1), k = K(), v = je();
788
801
  async function o() {
789
802
  if (m.value = [], !!k._currentLocation) {
790
- d.value = !0;
803
+ p.value = !0;
791
804
  try {
792
- const [y] = await Promise.all([
793
- f.readTemplates(),
794
- new Promise((p) => setTimeout(p, 1e3))
805
+ const [f] = await Promise.all([
806
+ v.readTemplates(),
807
+ new Promise((i) => setTimeout(i, 1e3))
795
808
  ]);
796
- m.value = y;
797
- } catch (y) {
798
- console.log("Something went wrong when fetching templates:", y);
809
+ m.value = f;
810
+ } catch (f) {
811
+ console.log("Something went wrong when fetching templates:", f);
799
812
  } finally {
800
- d.value = !1;
813
+ p.value = !1;
801
814
  }
802
815
  }
803
816
  }
804
- async function a(y) {
805
- if (!m.value.find((p) => p._id) && k._currentLocation) {
806
- d.value = !0;
817
+ async function a(f) {
818
+ if (!m.value.find((i) => i._id) && k._currentLocation) {
819
+ p.value = !0;
807
820
  try {
808
- const [p] = await Promise.all([
809
- f.getTemplate(y),
810
- new Promise((v) => setTimeout(v, 1e3))
821
+ const [i] = await Promise.all([
822
+ v.getTemplate(f),
823
+ new Promise((y) => setTimeout(y, 1e3))
811
824
  ]);
812
- m.value = [p];
813
- } catch (p) {
814
- console.log("Something went wrong when fetching templates:", p);
825
+ m.value = [i];
826
+ } catch (i) {
827
+ console.log("Something went wrong when fetching templates:", i);
815
828
  } finally {
816
- d.value = !1;
829
+ p.value = !1;
817
830
  }
818
831
  }
819
832
  }
820
- function r(y, p) {
821
- switch (p = Le(p), y) {
822
- case Ve:
823
- return l(p);
833
+ function r(f, i) {
834
+ switch (i = qe(i), f) {
835
+ case Re:
836
+ return l(i);
824
837
  case ie.Details:
825
- return c(p);
838
+ return d(i);
826
839
  case ie.Edit:
827
- return s(p);
840
+ return s(i);
828
841
  case ie.Delete:
829
- return e(p, d, o);
842
+ return e(i, p, o);
830
843
  }
831
844
  }
832
845
  return { columnDefs: [
833
846
  {
847
+ id: "_id",
834
848
  accessorKey: "_id",
835
849
  header: () => t("inventory.transfer.table.createdAt"),
836
- cell(y) {
837
- return et(`${y.getValue()}`);
850
+ cell(f) {
851
+ return tt(`${f.getValue()}`);
838
852
  },
839
853
  enableSorting: !0
840
854
  },
841
855
  {
856
+ id: "name",
842
857
  accessorKey: "name",
843
858
  header: () => t("inventory.transfer.table.name"),
844
859
  enableSorting: !0,
845
860
  size: 200
846
861
  },
847
862
  {
863
+ id: "supplier",
848
864
  accessorKey: "purchaseOrder.supplier.name",
849
865
  header: () => t("inventory.transfer.table.transferFrom"),
850
866
  enableSorting: !0,
851
867
  size: 200
852
868
  },
853
869
  {
870
+ id: "type",
871
+ header: () => t("inventory.transfer.receiveRequest.details.type.title"),
872
+ enableSorting: !0,
873
+ sortingFn(f, i) {
874
+ const y = be(f.original.purchaseOrder), S = be(i.original.purchaseOrder);
875
+ return y.localeCompare(S);
876
+ },
877
+ size: 200,
878
+ cell(f) {
879
+ const i = be(f.row.original.purchaseOrder), y = t(
880
+ `inventory.transfer.receiveRequest.details.type.${i.toLocaleLowerCase()}`
881
+ );
882
+ return V(X.FmChip, {
883
+ label: y,
884
+ class: "fm-chip-transfer-info",
885
+ compact: !0
886
+ });
887
+ }
888
+ },
889
+ {
890
+ id: "noOfItems",
854
891
  accessorKey: "purchaseOrder.items.length",
855
892
  header: () => t("inventory.transfer.table.noOfItems"),
856
893
  enableSorting: !1,
857
894
  meta: {
858
- width: "10rem"
895
+ width: "10rem",
896
+ textAlign: "right"
859
897
  }
860
898
  },
861
899
  {
900
+ id: "ref",
862
901
  accessorKey: "purchaseOrder.ref",
863
902
  header: () => t("inventory.transfer.table.reference"),
864
903
  enableSorting: !1,
@@ -866,17 +905,17 @@ function yo() {
866
905
  },
867
906
  {
868
907
  id: "action",
869
- cell(y) {
870
- const p = y.row.original, v = [
908
+ cell(f) {
909
+ const i = f.row.original, y = [
871
910
  {
872
911
  label: t("inventory.transfer.template.use"),
873
- value: Ve,
912
+ value: Re,
874
913
  color: "text-fm-color-typo-primary"
875
914
  },
876
915
  De[ie.Edit],
877
916
  De[ie.Delete]
878
917
  ];
879
- return bt(v, (F) => r(F, p));
918
+ return gt(y, (S) => r(S, i));
880
919
  },
881
920
  enableSorting: !1,
882
921
  size: 40,
@@ -885,35 +924,35 @@ function yo() {
885
924
  headerClass: ""
886
925
  }
887
926
  }
888
- ], templates: m, loading: d, fetchTemplates: o, loadTemplate: a };
927
+ ], templates: m, loading: p, fetchTemplates: o, loadTemplate: a };
889
928
  }
890
- function vo() {
891
- const t = ye(), c = Oe(), s = B(!1);
892
- fe(s, (d) => {
893
- d && (l.value = !0, e().finally(() => {
929
+ function ho() {
930
+ const t = ye(), d = Ee(), s = B(!1);
931
+ fe(s, (p) => {
932
+ p && (l.value = !0, e().finally(() => {
894
933
  l.value = !1;
895
934
  }));
896
935
  });
897
936
  async function e() {
898
937
  try {
899
- const { startDate: d, endDate: k } = pt(6), a = (await c.getPurchaseOrders({ start: d, end: k })).filter(
938
+ const { startDate: p, endDate: k } = mt(6), a = (await d.getPurchaseOrders({ start: p, end: k })).filter(
900
939
  (r) => {
901
- var b, y;
902
- return r.status === mt.enum.COMPLETE && ((b = r.supplier) == null ? void 0 : b.internal) !== "warehouse" && ((y = r.supplier) == null ? void 0 : y.internal) !== "restaurant";
940
+ var b, f;
941
+ return r.status === ft.enum.COMPLETE && ((b = r.supplier) == null ? void 0 : b.internal) !== "warehouse" && ((f = r.supplier) == null ? void 0 : f.internal) !== "restaurant";
903
942
  }
904
943
  ).reduce((r, b) => {
905
- const y = new Date(ft(b._id)), p = b.supplier._id;
906
- for (const v of b.items) {
907
- if (!v.totalCost) continue;
908
- const F = r[v.sku._id] ?? {}, I = F[p] ?? [];
944
+ const f = new Date(yt(b._id)), i = b.supplier._id;
945
+ for (const y of b.items) {
946
+ if (!y.totalCost) continue;
947
+ const S = r[y.sku._id] ?? {}, I = S[i] ?? [];
909
948
  I.push({
910
- date: y.toISOString(),
911
- totalUnit: v.quantity,
912
- totalCost: v.totalCost,
913
- unit: v.sku.unit,
914
- measurement: v.measurement,
949
+ date: f.toISOString(),
950
+ totalUnit: y.quantity,
951
+ totalCost: y.totalCost,
952
+ unit: y.sku.unit,
953
+ measurement: y.measurement,
915
954
  seqNumber: b.seqNumber
916
- }), F[p] = I, r[v.sku._id] = F;
955
+ }), S[i] = I, r[y.sku._id] = S;
917
956
  }
918
957
  return r;
919
958
  }, {});
@@ -932,7 +971,7 @@ function vo() {
932
971
  comparePriceBySku: m
933
972
  };
934
973
  }
935
- const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }, bo = ["colspan"], go = /* @__PURE__ */ te({
974
+ const _o = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, bo = { key: 0 }, go = ["colspan"], Co = /* @__PURE__ */ oe({
936
975
  __name: "TransferItemTable",
937
976
  props: {
938
977
  row: {},
@@ -940,65 +979,65 @@ const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }
940
979
  showComparePrice: { type: Boolean }
941
980
  },
942
981
  setup(t) {
943
- function c(s) {
982
+ function d(s) {
944
983
  return s.column.columnDef.meta;
945
984
  }
946
985
  return (s, e) => {
947
986
  var l, m;
948
987
  return T(), $(ue, null, [
949
- i("tr", {
950
- class: $e(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
988
+ u("tr", {
989
+ class: Ae(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
951
990
  "bg-fm-color-neutral-gray-100": s.row.getIsSelected()
952
991
  }])
953
992
  }, [
954
- (T(!0), $(ue, null, be(s.row.getVisibleCells(), (d) => {
955
- var k, f, o, a;
993
+ (T(!0), $(ue, null, ge(s.row.getVisibleCells(), (p) => {
994
+ var k, v, o, a;
956
995
  return T(), $("td", {
957
- key: d.id,
958
- class: $e([
996
+ key: p.id,
997
+ class: Ae([
959
998
  "h-[52px] px-16 text-fm-color-typo-primary",
960
- ((k = c(d)) == null ? void 0 : k.cellClass) ?? "px-16"
999
+ ((k = d(p)) == null ? void 0 : k.cellClass) ?? "px-16"
961
1000
  ]),
962
- style: Qe({
963
- width: (f = c(d)) == null ? void 0 : f.width,
964
- maxWidth: (o = c(d)) == null ? void 0 : o.maxWidth,
965
- textAlign: ((a = c(d)) == null ? void 0 : a.textAlign) ?? "left"
1001
+ style: Ge({
1002
+ width: (v = d(p)) == null ? void 0 : v.width,
1003
+ maxWidth: (o = d(p)) == null ? void 0 : o.maxWidth,
1004
+ textAlign: ((a = d(p)) == null ? void 0 : a.textAlign) ?? "left"
966
1005
  })
967
1006
  }, [
968
- i("span", ho, [
1007
+ u("span", _o, [
969
1008
  C(n(le), {
970
- render: d.column.columnDef.cell,
971
- props: d.getContext()
1009
+ render: p.column.columnDef.cell,
1010
+ props: p.getContext()
972
1011
  }, null, 8, ["render", "props"])
973
1012
  ])
974
1013
  ], 6);
975
1014
  }), 128))
976
1015
  ], 2),
977
- s.showComparePrice && Object.keys(s.comparePriceBySku[(l = s.row.original.sku) == null ? void 0 : l._id] ?? {}).length > 0 ? (T(), $("tr", _o, [
978
- i("td", {
1016
+ s.showComparePrice && Object.keys(s.comparePriceBySku[(l = s.row.original.sku) == null ? void 0 : l._id] ?? {}).length > 0 ? (T(), $("tr", bo, [
1017
+ u("td", {
979
1018
  colspan: s.row.getVisibleCells().length
980
1019
  }, [
981
- C(qe, {
1020
+ C(ze, {
982
1021
  prices: s.comparePriceBySku[(m = s.row.original.sku) == null ? void 0 : m._id]
983
1022
  }, null, 8, ["prices"])
984
- ], 8, bo)
1023
+ ], 8, go)
985
1024
  ])) : z("", !0)
986
1025
  ], 64);
987
1026
  };
988
1027
  }
989
- }), Co = { class: "flex flex-col gap-4" }, ko = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, wo = { class: "flex flex-col gap-16" }, To = { class: "flex flex-col gap-24" }, xo = {
1028
+ }), ko = { class: "flex flex-col gap-4" }, wo = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, To = { class: "flex flex-col gap-16" }, xo = { class: "flex flex-col gap-24" }, So = {
990
1029
  key: 0,
991
1030
  class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col"
992
- }, So = { class: "flex xs:flex-col sm:flex-col" }, Po = /* @__PURE__ */ i("div", { class: "xs:hidden sm:hidden h-48 lg:w-16 md:w-16" }, null, -1), Fo = {
1031
+ }, Po = { class: "flex xs:flex-col sm:flex-col" }, Fo = /* @__PURE__ */ u("div", { class: "xs:hidden sm:hidden h-48 lg:w-16 md:w-16" }, null, -1), $o = {
993
1032
  key: 0,
994
1033
  class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
995
- }, $o = { class: "flex-1" }, Do = { class: "flex-1" }, Ao = {
1034
+ }, Ao = { class: "flex-1" }, Do = { class: "flex-1" }, Io = {
996
1035
  key: 1,
997
1036
  class: "flex items-center gap-4"
998
- }, Io = /* @__PURE__ */ i("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, " Cannot backdate without an initial closing made to the system. ", -1), Vo = { class: "flex flex-col gap-16" }, Ro = { class: "flex sm:flex-col xs:flex-col gap-16 items-center xs:items-start sm:items-start" }, Bo = /* @__PURE__ */ i("div", { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, "Transfer items", -1), Uo = { class: "flex gap-8" }, Oo = /* @__PURE__ */ i("div", null, "Forecast is not available on transfer document created from a template.", -1), Eo = {
1037
+ }, Vo = /* @__PURE__ */ u("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, " Cannot backdate without an initial closing made to the system. ", -1), Ro = { class: "flex flex-col gap-16" }, Bo = { class: "flex sm:flex-col xs:flex-col gap-16 items-center xs:items-start sm:items-start" }, Uo = /* @__PURE__ */ u("div", { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, "Transfer items", -1), Oo = { class: "flex gap-8" }, Eo = /* @__PURE__ */ u("div", null, "Forecast is not available on transfer document created from a template.", -1), Mo = {
999
1038
  key: 0,
1000
1039
  class: "xs:w-full"
1001
- }, Mo = /* @__PURE__ */ te({
1040
+ }, Lo = /* @__PURE__ */ oe({
1002
1041
  __name: "TransferForm2",
1003
1042
  props: {
1004
1043
  modelValue: {},
@@ -1007,81 +1046,81 @@ const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }
1007
1046
  skus: {},
1008
1047
  lastClosingDate: {}
1009
1048
  },
1010
- setup(t, { expose: c }) {
1011
- const s = t, e = xt(), { t: l } = ce(), m = K(), d = xe(), k = ve(), f = Ee(), o = yo(), a = P(
1012
- () => o.templates.value.find((u) => u._id === e.template)
1013
- ), r = P(() => e.status === "DRAFT" || !e._rev);
1014
- Be(() => {
1049
+ setup(t, { expose: d }) {
1050
+ const s = t, e = St(), { t: l } = ce(), m = K(), p = Se(), k = ve(), v = Me(), o = vo(), a = F(
1051
+ () => o.templates.value.find((c) => c._id === e.template)
1052
+ ), r = F(() => e.status === "DRAFT" || !e._rev);
1053
+ Ue(() => {
1015
1054
  e.template && o.loadTemplate(e.template);
1016
1055
  });
1017
- const b = P(
1018
- () => m.currentLocation.type === ke.restaurant
1056
+ const b = F(
1057
+ () => m.currentLocation.type === we.restaurant
1019
1058
  );
1020
1059
  fe(
1021
1060
  () => s.modelValue,
1022
- (u) => {
1023
- console.log("TransferForm.model", u);
1061
+ (c) => {
1062
+ console.log("TransferForm.model", c);
1024
1063
  }
1025
1064
  ), m.watchLocation(async () => {
1026
- location && (e.supplier || (e.supplier = k.suppliers.find((u) => u) ?? e.supplier));
1065
+ location && (e.supplier || (e.supplier = k.suppliers.find((c) => c) ?? e.supplier));
1027
1066
  });
1028
- const y = Ue(), p = Zt(
1067
+ const f = Oe(), i = Qt(
1029
1068
  () => e,
1030
- (u) => {
1031
- Object.assign(e, u);
1069
+ (c) => {
1070
+ Object.assign(e, c);
1032
1071
  }
1033
- ), v = P({
1072
+ ), y = F({
1034
1073
  get() {
1035
- var u;
1036
- return typeof ((u = e == null ? void 0 : e.supplier) == null ? void 0 : u.internal) == "string" ? S.TRANSFER : S.PURCHASE;
1074
+ var c;
1075
+ return typeof ((c = e == null ? void 0 : e.supplier) == null ? void 0 : c.internal) == "string" ? x.TRANSFER : x.PURCHASE;
1037
1076
  },
1038
- set(u) {
1039
- var D;
1040
- const _ = typeof ((D = e == null ? void 0 : e.supplier) == null ? void 0 : D.internal) == "string" ? S.TRANSFER : S.PURCHASE;
1041
- u !== _ && (e.supplier = u === S.PURCHASE ? p.locationOptionsTypePurchase.value[0] : p.locationOptionsTypeTransfer.value[0]);
1077
+ set(c) {
1078
+ var A;
1079
+ const _ = typeof ((A = e == null ? void 0 : e.supplier) == null ? void 0 : A.internal) == "string" ? x.TRANSFER : x.PURCHASE;
1080
+ c !== _ && (e.supplier = c === x.PURCHASE ? i.locationOptionsTypePurchase.value[0] : i.locationOptionsTypeTransfer.value[0]);
1042
1081
  }
1043
- }), F = P(() => p.transferLocationOptions.value), I = P({
1082
+ }), S = F(() => i.transferLocationOptions.value), I = F({
1044
1083
  get() {
1045
1084
  return e.supplier._id;
1046
1085
  },
1047
- set(u) {
1048
- p.transferLocationModel.value = u;
1086
+ set(c) {
1087
+ i.transferLocationModel.value = c;
1049
1088
  }
1050
- }), Z = P({
1089
+ }), Z = F({
1051
1090
  get() {
1052
1091
  return e.remark ?? void 0;
1053
1092
  },
1054
- set(u) {
1055
- e.remark = u;
1093
+ set(c) {
1094
+ e.remark = c;
1056
1095
  }
1057
- }), { backdatePo: O, backdateSwitch: N, backdateModel: Y, backdateTimeModel: L } = Qt({
1096
+ }), { backdatePo: O, backdateSwitch: L, backdateModel: Y, backdateTimeModel: N } = Gt({
1058
1097
  getEffectiveAt() {
1059
1098
  return e.effectiveAt;
1060
1099
  },
1061
- setEffectiveAt(u) {
1062
- e.effectiveAt = u;
1100
+ setEffectiveAt(c) {
1101
+ e.effectiveAt = c;
1063
1102
  }
1064
- }), { comparePricesToggle: h, comparePriceFetching: g, comparePriceBySku: U } = vo(), H = B();
1065
- c({
1103
+ }), { comparePricesToggle: h, comparePriceFetching: g, comparePriceBySku: U } = ho(), q = B();
1104
+ d({
1066
1105
  validateInputs: () => {
1067
- var u, _;
1068
- (_ = (u = H.value) == null ? void 0 : u.validateInputs) == null || _.call(u);
1106
+ var c, _;
1107
+ (_ = (c = q.value) == null ? void 0 : c.validateInputs) == null || _.call(c);
1069
1108
  },
1070
1109
  resetInputsValidation: () => {
1071
- var u, _;
1072
- (_ = (u = H.value) == null ? void 0 : u.resetInputsValidation) == null || _.call(u);
1110
+ var c, _;
1111
+ (_ = (c = q.value) == null ? void 0 : c.resetInputsValidation) == null || _.call(c);
1073
1112
  },
1074
1113
  resetInputs: () => {
1075
- var u, _;
1076
- (_ = (u = H.value) == null ? void 0 : u.resetInputs) == null || _.call(u);
1114
+ var c, _;
1115
+ (_ = (c = q.value) == null ? void 0 : c.resetInputs) == null || _.call(c);
1077
1116
  }
1078
1117
  });
1079
- const q = Tt({
1080
- updateItem: (u) => {
1081
- e.items = e.items.map((_) => _.sku._id !== u.sku._id ? _ : u);
1118
+ const H = xt({
1119
+ updateItem: (c) => {
1120
+ e.items = e.items.map((_) => _.sku._id !== c.sku._id ? _ : c);
1082
1121
  },
1083
- deleteItem: (u) => {
1084
- e.items = e.items.filter((_) => _.sku._id !== u.sku._id);
1122
+ deleteItem: (c) => {
1123
+ e.items = e.items.filter((_) => _.sku._id !== c.sku._id);
1085
1124
  },
1086
1125
  get supplier() {
1087
1126
  return e.supplier;
@@ -1090,28 +1129,28 @@ const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }
1090
1129
  return e.items;
1091
1130
  },
1092
1131
  get transferType() {
1093
- return v.value;
1132
+ return y.value;
1094
1133
  },
1095
1134
  get template() {
1096
1135
  return a.value;
1097
1136
  }
1098
- }), de = P(() => q.columnDefs.value);
1099
- function oe() {
1100
- const u = d.skus.map((D) => ({
1101
- label: D.name,
1102
- sublabel: D.code,
1103
- value: D
1104
- })), _ = u.filter((D) => {
1137
+ }), de = F(() => H.columnDefs.value);
1138
+ function se() {
1139
+ const c = p.skus.map((A) => ({
1140
+ label: A.name,
1141
+ sublabel: A.code,
1142
+ value: A
1143
+ })), _ = c.filter((A) => {
1105
1144
  var Q;
1106
- return (Q = e.items) == null ? void 0 : Q.find((se) => se.sku._id === D.value._id);
1107
- }).map((D) => D.value);
1108
- y.open({
1145
+ return (Q = e.items) == null ? void 0 : Q.find((ae) => ae.sku._id === A.value._id);
1146
+ }).map((A) => A.value);
1147
+ f.open({
1109
1148
  title: "Select item",
1110
1149
  closeButton: !0,
1111
- contentComponent: ht,
1150
+ contentComponent: _t,
1112
1151
  contentComponentProps: {
1113
1152
  modelValue: _,
1114
- items: u
1153
+ items: c
1115
1154
  },
1116
1155
  primaryActions: {
1117
1156
  text: "Confirm",
@@ -1122,8 +1161,8 @@ const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }
1122
1161
  close: !0,
1123
1162
  variant: "tertiary"
1124
1163
  }
1125
- }).onPrimary((D) => {
1126
- const Q = e.items ?? [], se = D.map((W) => {
1164
+ }).onPrimary((A) => {
1165
+ const Q = e.items ?? [], ae = A.map((W) => {
1127
1166
  const G = Q.find((_e) => _e.sku._id === W._id);
1128
1167
  if (G)
1129
1168
  return G;
@@ -1136,7 +1175,7 @@ const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }
1136
1175
  precision: 0
1137
1176
  }
1138
1177
  };
1139
- return v.value == S.PURCHASE && (J.totalCost = X(
1178
+ return y.value == x.PURCHASE && (J.totalCost = ee(
1140
1179
  J.sku,
1141
1180
  J.quantity,
1142
1181
  J.measurement,
@@ -1145,76 +1184,76 @@ const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }
1145
1184
  }
1146
1185
  )), J;
1147
1186
  });
1148
- se.sort((W, G) => W.sku.code.localeCompare(G.sku.code)), e.items = se;
1187
+ ae.sort((W, G) => W.sku.code.localeCompare(G.sku.code)), e.items = ae;
1149
1188
  });
1150
1189
  }
1151
- function he(u) {
1152
- return u;
1190
+ function he(c) {
1191
+ return c;
1153
1192
  }
1154
- return (u, _) => {
1155
- const D = x("FmChip"), Q = x("FmSelect"), se = x("FmTextField"), W = x("FmTextarea"), G = x("FmSwitch"), J = x("FmDatePicker"), _e = x("FmTimePicker"), Se = x("FmFormGroup"), je = x("FmIcon"), Ke = x("FmButton"), Ye = x("FmTooltip"), We = x("FmTable"), Ze = x("FmForm");
1156
- return T(), $("div", Co, [
1157
- i("div", ko, [
1158
- a.value ? (T(), E(D, {
1193
+ return (c, _) => {
1194
+ const A = P("FmChip"), Q = P("FmSelect"), ae = P("FmTextField"), W = P("FmTextarea"), G = P("FmSwitch"), J = P("FmDatePicker"), _e = P("FmTimePicker"), Pe = P("FmFormGroup"), Ke = P("FmIcon"), Ye = P("FmButton"), We = P("FmTooltip"), Ze = P("FmTable"), Qe = P("FmForm");
1195
+ return T(), $("div", ko, [
1196
+ u("div", wo, [
1197
+ a.value ? (T(), E(A, {
1159
1198
  key: 0,
1160
1199
  label: `Template: ${a.value.name}`,
1161
1200
  icon: "summarize",
1162
1201
  compact: ""
1163
1202
  }, null, 8, ["label"])) : z("", !0),
1164
- C(D, {
1203
+ C(A, {
1165
1204
  label: n(m).currentLocation.name,
1166
1205
  icon: "storefront",
1167
1206
  compact: ""
1168
1207
  }, null, 8, ["label"]),
1169
- u.lastClosingDate ? (T(), E(D, {
1208
+ c.lastClosingDate ? (T(), E(A, {
1170
1209
  key: 1,
1171
- label: `Last closing: ${n(Te)(u.lastClosingDate)} ${n(yt)(u.lastClosingDate)}`,
1210
+ label: `Last closing: ${n(xe)(c.lastClosingDate)} ${n(vt)(c.lastClosingDate)}`,
1172
1211
  icon: "calendar_month",
1173
1212
  compact: ""
1174
1213
  }, null, 8, ["label"])) : z("", !0)
1175
1214
  ]),
1176
- C(Ze, {
1215
+ C(Qe, {
1177
1216
  ref_key: "formRef",
1178
- ref: H,
1217
+ ref: q,
1179
1218
  class: "flex flex-col gap-32",
1180
- disabled: u.disabled
1219
+ disabled: c.disabled
1181
1220
  }, {
1182
- default: A(() => {
1183
- var Pe;
1221
+ default: D(() => {
1222
+ var Fe;
1184
1223
  return [
1185
- i("div", wo, [
1186
- i("div", To, [
1224
+ u("div", To, [
1225
+ u("div", xo, [
1187
1226
  C(Q, {
1188
1227
  label: n(l)("inventory.transfer.form.type.title"),
1189
- "model-value": v.value,
1190
- "onUpdate:modelValue": _[0] || (_[0] = (w) => v.value = w),
1228
+ "model-value": y.value,
1229
+ "onUpdate:modelValue": _[0] || (_[0] = (w) => y.value = w),
1191
1230
  items: [
1192
1231
  {
1193
1232
  label: n(l)(
1194
- `inventory.transfer.form.type.${n(S).PURCHASE.toLocaleLowerCase()}`
1233
+ `inventory.transfer.form.type.${n(x).PURCHASE.toLocaleLowerCase()}`
1195
1234
  ),
1196
- value: n(S).PURCHASE,
1197
- disabled: !n(p).locationOptionsTypePurchase.value.length,
1198
- sublabel: n(p).locationOptionsTypePurchase.value.length ? void 0 : "No supplier available"
1235
+ value: n(x).PURCHASE,
1236
+ disabled: !n(i).locationOptionsTypePurchase.value.length,
1237
+ sublabel: n(i).locationOptionsTypePurchase.value.length ? void 0 : "No supplier available"
1199
1238
  },
1200
1239
  {
1201
1240
  label: n(l)(
1202
- `inventory.transfer.form.type.${n(S).TRANSFER.toLocaleLowerCase()}`
1241
+ `inventory.transfer.form.type.${n(x).TRANSFER.toLocaleLowerCase()}`
1203
1242
  ),
1204
- value: n(S).TRANSFER,
1205
- disabled: !n(p).locationOptionsTypeTransfer.value.length,
1206
- sublabel: n(p).locationOptionsTypeTransfer.value.length ? void 0 : "No location available"
1243
+ value: n(x).TRANSFER,
1244
+ disabled: !n(i).locationOptionsTypeTransfer.value.length,
1245
+ sublabel: n(i).locationOptionsTypeTransfer.value.length ? void 0 : "No location available"
1207
1246
  }
1208
1247
  ],
1209
- rules: [n(we)(1)(F.value)]
1248
+ rules: [n(Te)(1)(S.value)]
1210
1249
  }, null, 8, ["label", "model-value", "items", "rules"]),
1211
1250
  C(Q, {
1212
- label: v.value === n(S).PURCHASE ? "Purchase from" : "Transfer from",
1251
+ label: y.value === n(x).PURCHASE ? "Purchase from" : "Transfer from",
1213
1252
  modelValue: I.value,
1214
1253
  "onUpdate:modelValue": _[1] || (_[1] = (w) => I.value = w),
1215
- items: F.value
1254
+ items: S.value
1216
1255
  }, null, 8, ["label", "modelValue", "items"]),
1217
- C(se, {
1256
+ C(ae, {
1218
1257
  label: "Reference",
1219
1258
  "label-mark": "optional",
1220
1259
  modelValue: n(e).ref,
@@ -1227,94 +1266,94 @@ const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }
1227
1266
  modelValue: Z.value,
1228
1267
  "onUpdate:modelValue": _[3] || (_[3] = (w) => Z.value = w)
1229
1268
  }, null, 8, ["modelValue"]),
1230
- n(f).enableBackdatePo ? (T(), $("div", xo, [
1231
- i("div", So, [
1269
+ n(v).enableBackdatePo ? (T(), $("div", So, [
1270
+ u("div", Po, [
1232
1271
  C(G, {
1233
- modelValue: n(N),
1234
- "onUpdate:modelValue": _[4] || (_[4] = (w) => re(N) ? N.value = w : null),
1272
+ modelValue: n(L),
1273
+ "onUpdate:modelValue": _[4] || (_[4] = (w) => re(L) ? L.value = w : null),
1235
1274
  label: "Backdate transfer",
1236
1275
  sublabel: "Apply transfer to older date",
1237
1276
  "label-placement": "right",
1238
- disabled: b.value && !u.lastClosingDate
1277
+ disabled: b.value && !c.lastClosingDate
1239
1278
  }, null, 8, ["modelValue", "disabled"]),
1240
- Po,
1241
- n(N) ? (T(), $("div", Fo, [
1242
- i("div", $o, [
1279
+ Fo,
1280
+ n(L) ? (T(), $("div", $o, [
1281
+ u("div", Ao, [
1243
1282
  C(J, {
1244
1283
  modelValue: n(Y),
1245
1284
  "onUpdate:modelValue": _[5] || (_[5] = (w) => re(Y) ? Y.value = w : null)
1246
1285
  }, null, 8, ["modelValue"])
1247
1286
  ]),
1248
- i("div", Do, [
1287
+ u("div", Do, [
1249
1288
  C(_e, {
1250
- modelValue: n(L),
1251
- "onUpdate:modelValue": _[6] || (_[6] = (w) => re(L) ? L.value = w : null)
1289
+ modelValue: n(N),
1290
+ "onUpdate:modelValue": _[6] || (_[6] = (w) => re(N) ? N.value = w : null)
1252
1291
  }, null, 8, ["modelValue"])
1253
1292
  ])
1254
1293
  ])) : z("", !0)
1255
1294
  ]),
1256
- n(O) ? (T(), E(Se, {
1295
+ n(O) ? (T(), E(Pe, {
1257
1296
  key: 0,
1258
1297
  modelValue: n(O),
1259
1298
  "onUpdate:modelValue": _[7] || (_[7] = (w) => re(O) ? O.value = w : null),
1260
- rules: [n(vt)(new Date(u.lastClosingDate), /* @__PURE__ */ new Date())]
1299
+ rules: [n(ht)(new Date(c.lastClosingDate), /* @__PURE__ */ new Date())]
1261
1300
  }, null, 8, ["modelValue", "rules"])) : z("", !0),
1262
- b.value && !u.lastClosingDate ? (T(), $("div", Ao, [
1263
- C(je, {
1301
+ b.value && !c.lastClosingDate ? (T(), $("div", Io, [
1302
+ C(Ke, {
1264
1303
  name: "error",
1265
1304
  size: "sm",
1266
1305
  class: "text-fm-color-typo-warning"
1267
1306
  }),
1268
- Io
1307
+ Vo
1269
1308
  ])) : z("", !0)
1270
1309
  ])) : z("", !0)
1271
1310
  ])
1272
1311
  ]),
1273
- i("div", Vo, [
1274
- C(Se, {
1312
+ u("div", Ro, [
1313
+ C(Pe, {
1275
1314
  "model-value": n(e).items,
1276
1315
  rules: [
1277
- function(ae) {
1278
- return ae && ae.length > 0 || "Must have at least one item!";
1316
+ function(ne) {
1317
+ return ne && ne.length > 0 || "Must have at least one item!";
1279
1318
  }
1280
1319
  ]
1281
1320
  }, null, 8, ["model-value", "rules"]),
1282
- i("div", Ro, [
1283
- Bo,
1284
- i("div", Uo, [
1285
- C(Ke, {
1286
- disabled: u.disabled,
1321
+ u("div", Bo, [
1322
+ Uo,
1323
+ u("div", Oo, [
1324
+ C(Ye, {
1325
+ disabled: c.disabled,
1287
1326
  label: "Add Item",
1288
1327
  "prepend-icon": "add",
1289
1328
  variant: "secondary",
1290
1329
  "text-color": "primary",
1291
1330
  "bg-color": "transparent",
1292
1331
  "border-color": "primary",
1293
- onClick: _[8] || (_[8] = (w) => oe()),
1332
+ onClick: _[8] || (_[8] = (w) => se()),
1294
1333
  size: "md"
1295
1334
  }, null, 8, ["disabled"]),
1296
- n(e).template ? (T(), E(Ye, {
1335
+ n(e).template ? (T(), E(We, {
1297
1336
  key: 0,
1298
1337
  "z-index": 50
1299
1338
  }, {
1300
- content: A(() => [
1301
- Oo
1339
+ content: D(() => [
1340
+ Eo
1302
1341
  ]),
1303
- default: A(() => [
1304
- C(Ie, {
1342
+ default: D(() => [
1343
+ C(Ve, {
1305
1344
  "onUpdate:poItems": _[9] || (_[9] = (w) => n(e).items = w),
1306
1345
  disabled: ""
1307
1346
  })
1308
1347
  ]),
1309
1348
  _: 1
1310
- })) : (T(), E(Ie, {
1349
+ })) : (T(), E(Ve, {
1311
1350
  key: 1,
1312
1351
  "onUpdate:poItems": _[10] || (_[10] = (w) => n(e).items = w),
1313
- disabled: u.disabled || !!n(e).template
1352
+ disabled: c.disabled || !!n(e).template
1314
1353
  }, null, 8, ["disabled"]))
1315
1354
  ])
1316
1355
  ]),
1317
- v.value === n(S).PURCHASE && r.value && n(f).enableTotalCost && ((Pe = u.modelValue) != null && Pe.items.length) ? (T(), $("div", Eo, [
1356
+ y.value === n(x).PURCHASE && r.value && n(v).enableTotalCost && ((Fe = c.modelValue) != null && Fe.items.length) ? (T(), $("div", Mo, [
1318
1357
  C(G, {
1319
1358
  label: n(g) ? "Fetching data..." : "Compare price history",
1320
1359
  "prepend-icon": "compare_arrows",
@@ -1324,30 +1363,30 @@ const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }
1324
1363
  disabled: n(g)
1325
1364
  }, null, 8, ["label", "model-value", "disabled"])
1326
1365
  ])) : z("", !0),
1327
- (T(), E(We, {
1366
+ (T(), E(Ze, {
1328
1367
  "column-defs": de.value,
1329
1368
  "row-data": n(e).items,
1330
1369
  key: n(e).items.map((w) => w.sku._id).join("."),
1331
1370
  "hide-footer": ""
1332
1371
  }, {
1333
- "table-row": A((w) => [
1334
- C(go, {
1372
+ "table-row": D((w) => [
1373
+ C(Co, {
1335
1374
  "compare-price-by-sku": n(U),
1336
- "show-compare-price": v.value === n(S).PURCHASE && n(h),
1375
+ "show-compare-price": y.value === n(x).PURCHASE && n(h),
1337
1376
  row: w
1338
1377
  }, null, 8, ["compare-price-by-sku", "show-compare-price", "row"])
1339
1378
  ]),
1340
- "list-row": A((w) => [
1341
- (T(), E(gt, {
1379
+ "list-row": D((w) => [
1380
+ (T(), E(Ct, {
1342
1381
  row: w,
1343
- key: n(e).items.map((ae) => ae.sku._id).join(".")
1382
+ key: n(e).items.map((ne) => ne.sku._id).join(".")
1344
1383
  }, {
1345
- default: A((ae) => [
1346
- C(Wt, {
1384
+ default: D((ne) => [
1385
+ C(Zt, {
1347
1386
  "compare-price-by-sku": n(U),
1348
- "show-compare-price": v.value === n(S).PURCHASE && n(h),
1387
+ "show-compare-price": y.value === n(x).PURCHASE && n(h),
1349
1388
  row: w,
1350
- "cell-by-col-id": ae
1389
+ "cell-by-col-id": ne
1351
1390
  }, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "cell-by-col-id"])
1352
1391
  ]),
1353
1392
  _: 2
@@ -1363,7 +1402,7 @@ const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }
1363
1402
  ]);
1364
1403
  };
1365
1404
  }
1366
- }), No = { class: "flex items-center" }, Lo = { class: "fm-typo-en-title-md-800" }, Ho = { class: "flex gap-4" }, ts = /* @__PURE__ */ te({
1405
+ }), No = { class: "flex items-center" }, qo = { class: "fm-typo-en-title-md-800" }, Ho = { class: "flex gap-4" }, os = /* @__PURE__ */ oe({
1367
1406
  __name: "TransferDialog",
1368
1407
  props: {
1369
1408
  mode: {},
@@ -1373,16 +1412,16 @@ const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }
1373
1412
  lastClosingDate: {}
1374
1413
  },
1375
1414
  emits: ["update:show", "submitted"],
1376
- setup(t, { expose: c, emit: s }) {
1377
- var L;
1378
- const e = t, l = s, m = Oe(), d = ye(), k = ve(), f = xe(), o = K();
1415
+ setup(t, { expose: d, emit: s }) {
1416
+ var N;
1417
+ const e = t, l = s, m = Ee(), p = ye(), k = ve(), v = Se(), o = K();
1379
1418
  async function a(h) {
1380
1419
  if (h) {
1381
- v.value = !0;
1420
+ y.value = !0;
1382
1421
  try {
1383
- await k.readSuppliers(), v.value = !1;
1422
+ await k.readSuppliers(), y.value = !1;
1384
1423
  } catch {
1385
- d.open({
1424
+ p.open({
1386
1425
  title: "Unable to fetch list of suppliers",
1387
1426
  message: "Try to refresh page to retry operation",
1388
1427
  type: "error"
@@ -1423,26 +1462,26 @@ const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }
1423
1462
  deliveryOrder: []
1424
1463
  };
1425
1464
  }
1426
- const b = Je(e, "show"), y = B(e.modelValue ?? r()), p = B(((L = e.modelValue) == null ? void 0 : L._id) ?? `${Math.random()}`);
1465
+ const b = Xe(e, "show"), f = B(e.modelValue ?? r()), i = B(((N = e.modelValue) == null ? void 0 : N._id) ?? `${Math.random()}`);
1427
1466
  fe(
1428
1467
  () => e.show,
1429
1468
  (h) => {
1430
1469
  var g;
1431
- h && (y.value = e.modelValue ?? r(), p.value = ((g = e.modelValue) == null ? void 0 : g._id) ?? `${Math.random()}`);
1470
+ h && (f.value = e.modelValue ?? r(), i.value = ((g = e.modelValue) == null ? void 0 : g._id) ?? `${Math.random()}`);
1432
1471
  }
1433
1472
  );
1434
- const v = B(!1), F = P(() => {
1473
+ const y = B(!1), S = F(() => {
1435
1474
  switch (e.mode) {
1436
- case ee.CREATE:
1475
+ case te.CREATE:
1437
1476
  return "Add transfer";
1438
- case ee.READ:
1477
+ case te.READ:
1439
1478
  return "View transfer";
1440
- case ee.UPDATE:
1479
+ case te.UPDATE:
1441
1480
  return "Edit transfer";
1442
1481
  }
1443
1482
  return "";
1444
1483
  }), I = B();
1445
- c({
1484
+ d({
1446
1485
  validateInputs: () => {
1447
1486
  var h, g;
1448
1487
  (g = (h = I.value) == null ? void 0 : h.validateInputs) == null || g.call(h);
@@ -1457,48 +1496,48 @@ const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }
1457
1496
  }
1458
1497
  });
1459
1498
  async function Z() {
1460
- const h = y.value;
1461
- v.value = !0, (h.supplier.internal === "warehouse" || h.supplier.internal === "restaurant") && (h.items = h.items.map(({ totalCost: g, ...U }) => U));
1499
+ const h = f.value;
1500
+ y.value = !0, (h.supplier.internal === "warehouse" || h.supplier.internal === "restaurant") && (h.items = h.items.map(({ totalCost: g, ...U }) => U));
1462
1501
  try {
1463
- await m.createPurchaseOrder(h), await new Promise((g) => setTimeout(g, 1e3)), d.open({
1502
+ await m.createPurchaseOrder(h), await new Promise((g) => setTimeout(g, 1e3)), p.open({
1464
1503
  title: "Created",
1465
1504
  message: "Your transfer draft has been created!",
1466
1505
  type: "success"
1467
1506
  }), l("update:show", !1), l("submitted");
1468
1507
  } catch (g) {
1469
- d.open({
1508
+ p.open({
1470
1509
  title: "Cannot create purchase order",
1471
1510
  message: "Report to system administrator for troubleshooting.",
1472
1511
  type: "error"
1473
1512
  }), console.error("Error in creating purchase order", g);
1474
1513
  } finally {
1475
- v.value = !1;
1514
+ y.value = !1;
1476
1515
  }
1477
1516
  }
1478
1517
  async function O() {
1479
- const h = y.value;
1480
- v.value = !0, (h.supplier.internal === "warehouse" || h.supplier.internal === "restaurant") && (h.items = h.items.map(({ totalCost: g, ...U }) => U));
1518
+ const h = f.value;
1519
+ y.value = !0, (h.supplier.internal === "warehouse" || h.supplier.internal === "restaurant") && (h.items = h.items.map(({ totalCost: g, ...U }) => U));
1481
1520
  try {
1482
- await m.updatePurchaseOrder(h), await new Promise((g) => setTimeout(g, 1e3)), d.open({
1521
+ await m.updatePurchaseOrder(h), await new Promise((g) => setTimeout(g, 1e3)), p.open({
1483
1522
  title: "Updated",
1484
1523
  message: "Your transfer draft has been updated!",
1485
1524
  type: "success"
1486
1525
  }), l("update:show", !1), l("submitted");
1487
1526
  } catch (g) {
1488
- d.open({
1527
+ p.open({
1489
1528
  title: "Cannot update purchase order",
1490
1529
  message: "Report to system administrator for troubleshooting.",
1491
1530
  type: "error"
1492
1531
  }), console.error("Error in updating purchase order", g);
1493
1532
  } finally {
1494
- v.value = !1;
1533
+ y.value = !1;
1495
1534
  }
1496
1535
  }
1497
- function N() {
1536
+ function L() {
1498
1537
  switch (e.mode) {
1499
- case ee.CREATE:
1538
+ case te.CREATE:
1500
1539
  return Z();
1501
- case ee.UPDATE:
1540
+ case te.UPDATE:
1502
1541
  return O();
1503
1542
  }
1504
1543
  }
@@ -1507,46 +1546,46 @@ const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }
1507
1546
  (g = (h = I.value) == null ? void 0 : h.validateInputs) == null || g.call(h);
1508
1547
  }
1509
1548
  return (h, g) => {
1510
- const U = x("FmButton"), H = x("FmSideSheet");
1511
- return T(), E(H, {
1549
+ const U = P("FmButton"), q = P("FmSideSheet");
1550
+ return T(), E(q, {
1512
1551
  modelValue: n(b),
1513
- "onUpdate:modelValue": g[2] || (g[2] = (q) => re(b) ? b.value = q : null),
1552
+ "onUpdate:modelValue": g[2] || (g[2] = (H) => re(b) ? b.value = H : null),
1514
1553
  "dismiss-away": "",
1515
1554
  "close-button": "",
1516
1555
  "max-width": 900
1517
1556
  }, {
1518
- "side-sheet-header": A(() => [
1519
- i("div", No, [
1520
- i("div", Lo, M(F.value), 1)
1557
+ "side-sheet-header": D(() => [
1558
+ u("div", No, [
1559
+ u("div", qo, M(S.value), 1)
1521
1560
  ])
1522
1561
  ]),
1523
- default: A(() => [
1524
- (T(), E(Mo, {
1562
+ default: D(() => [
1563
+ (T(), E(Lo, {
1525
1564
  class: "w-full",
1526
1565
  ref_key: "formRef",
1527
1566
  ref: I,
1528
- onValidationSuccess: N,
1529
- modelValue: y.value,
1530
- "onUpdate:modelValue": g[0] || (g[0] = (q) => y.value = q),
1531
- disabled: v.value,
1567
+ onValidationSuccess: L,
1568
+ modelValue: f.value,
1569
+ "onUpdate:modelValue": g[0] || (g[0] = (H) => f.value = H),
1570
+ disabled: y.value,
1532
1571
  suppliers: n(k).suppliers,
1533
- skus: n(f).skus,
1534
- key: p.value,
1572
+ skus: n(v).skus,
1573
+ key: i.value,
1535
1574
  "last-closing-date": h.lastClosingDate
1536
1575
  }, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
1537
1576
  ]),
1538
- "side-sheet-footer": A(() => [
1539
- i("div", Ho, [
1577
+ "side-sheet-footer": D(() => [
1578
+ u("div", Ho, [
1540
1579
  C(U, {
1541
- loading: v.value,
1580
+ loading: y.value,
1542
1581
  label: "Save",
1543
1582
  onClick: Y
1544
1583
  }, null, 8, ["loading"]),
1545
1584
  C(U, {
1546
- disabled: v.value,
1585
+ disabled: y.value,
1547
1586
  variant: "tertiary",
1548
1587
  label: "Close",
1549
- onClick: g[1] || (g[1] = (q) => l("update:show", !1))
1588
+ onClick: g[1] || (g[1] = (H) => l("update:show", !1))
1550
1589
  }, null, 8, ["disabled"])
1551
1590
  ])
1552
1591
  ]),
@@ -1556,11 +1595,11 @@ const ho = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, _o = { key: 0 }
1556
1595
  }
1557
1596
  });
1558
1597
  export {
1559
- ts as _,
1560
- ze as a,
1561
- fo as b,
1562
- X as c,
1563
- xt as d,
1564
- yo as e,
1565
- Zt as u
1598
+ os as _,
1599
+ je as a,
1600
+ yo as b,
1601
+ ee as c,
1602
+ St as d,
1603
+ vo as e,
1604
+ Qt as u
1566
1605
  };