@feedmepos/mf-inventory-portal 0.0.25-dev.52 → 0.0.25-dev.54

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 (45) hide show
  1. package/dist/{App-DkPiRPu7.js → App-CiKHthJ8.js} +2 -2
  2. package/dist/{ApprovalView-BEF-qPdZ.js → ApprovalView-DquUkzk9.js} +2 -2
  3. package/dist/{BindingsDialog-B6vjaPiA.js → BindingsDialog-B9CAQnn5.js} +2 -2
  4. package/dist/{BindingsPicker-BmWf3j6H.js → BindingsPicker-DkJvqASd.js} +1 -1
  5. package/dist/{BindingsTable-VVNmzkzf.js → BindingsTable-CI-sLArF.js} +1 -1
  6. package/dist/{ClosingDraftView-C6sNEHK5.js → ClosingDraftView-BwPoyvTH.js} +91 -91
  7. package/dist/{ClosingTemplateView-5k8R-fMI.js → ClosingTemplateView-DKk8aaQp.js} +3 -3
  8. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DclFOxv5.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CVuWb0rB.js} +3 -3
  9. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BFqAE1ZI.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Dackb85c.js} +1 -1
  10. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DwAyTAFy.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DUPrXVLj.js} +1 -1
  11. package/dist/{IngredientGroupView-DAeurvqt.js → IngredientGroupView--1wwC7nK.js} +1 -1
  12. package/dist/{IngredientsView-Ca8fShPE.js → IngredientsView-BaKGc-qH.js} +4 -4
  13. package/dist/{IntegrationView-Db4XlQvK.js → IntegrationView-DagTHW0D.js} +2 -2
  14. package/dist/{InventoryBindingForm-BTtpF1P5.js → InventoryBindingForm-DmvGBu41.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-ByJPHKqO.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CB4QqfHQ.js} +3 -3
  16. package/dist/{InventoryBindingSummary-Bb5gN9Bu.js → InventoryBindingSummary-TYalkTTI.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D4vUOy_R.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CvYZzuqm.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-fFfOjNOU.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CX0mFZPG.js} +1 -1
  19. package/dist/{PublishView-BqE9qfwb.js → PublishView-DX9PwwCi.js} +45 -45
  20. package/dist/{PurchaseOrderPrintPreview-Cp6a-P8I.js → PurchaseOrderPrintPreview-C0U2ZQ33.js} +1 -1
  21. package/dist/{ReceiveRequestView-DKPPCyAU.js → ReceiveRequestView-BIO0dZUQ.js} +9 -9
  22. package/dist/{RecipeView-BEsrqzuU.js → RecipeView-COCZ9UAj.js} +3 -3
  23. package/dist/{StockView-DplJi2OM.js → StockView-kRKXsA_c.js} +7 -7
  24. package/dist/{SupplierView-DL3D84U2.js → SupplierView-x-ypWGLN.js} +4 -4
  25. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BzFkrRui.js → TransferDetails.vue_vue_type_script_setup_true_lang-CvYlsA0l.js} +5 -5
  26. package/dist/{TransferTemplateView-DakAYozL.js → TransferTemplateView-HaD0vUkC.js} +7 -7
  27. package/dist/{UnitView-C_Wqv69Z.js → UnitView-B7AnRyaj.js} +3 -3
  28. package/dist/{WarehouseView-CeoVZ9cs.js → WarehouseView-BdO8sNV5.js} +1 -1
  29. package/dist/{app-CulzKCFs.js → app-PWroc2sL.js} +8200 -8269
  30. package/dist/app.d.ts +3 -0
  31. package/dist/app.js +1 -1
  32. package/dist/{decimal-DdjfkmJS.js → decimal-TKHFrYOW.js} +1 -1
  33. package/dist/{feature-jwErVPVw.js → feature-B9ScyQ4z.js} +410 -416
  34. package/dist/{format-unit-display-BMC3HZ0N.js → format-unit-display-Baes6aNL.js} +2 -2
  35. package/dist/{index-C7-QVxlo.js → index-BjQOeto5.js} +1 -1
  36. package/dist/{index-BDCZItPF.js → index-DfJa-u-y.js} +1 -1
  37. package/dist/{stock-Czw9__W8.js → stock-DTa5kUw8.js} +1 -1
  38. package/dist/{supplier-f0XPCLm-.js → supplier-Ducp68Cm.js} +1 -1
  39. package/dist/tsconfig.app.tsbuildinfo +1 -1
  40. package/dist/{use-ingredient-select-dialog-DDeNnPW0.js → use-ingredient-select-dialog-DRmBMp3Q.js} +1 -1
  41. package/dist/{use-inventory-binding-dialog-BTE0Ceov.js → use-inventory-binding-dialog-DUyCUu3C.js} +1 -1
  42. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +88 -0
  43. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +528 -0
  44. package/dist/{vue-i18n-B0gOxrrS.js → vue-i18n-BLlKOfE9.js} +153 -153
  45. package/package.json +4 -4
@@ -1,8 +1,8 @@
1
1
  import { ref as U, onUnmounted as F, defineComponent as h, watch as P, onMounted as x, computed as g, resolveComponent as b, openBlock as S, createElementBlock as I, unref as v, createVNode as _, createElementVNode as p, toDisplayString as w, createBlock as B, createCommentVNode as k } from "vue";
2
- import { u as M, a as D, b as H, R as e, g as s, c as W } from "./app-CulzKCFs.js";
2
+ import { u as M, a as D, b as H, R as e, g as s, c as W } from "./app-PWroc2sL.js";
3
3
  import { useCoreStore as A, useI18n as G } from "@feedmepos/mf-common";
4
4
  import { useRouter as L, useRoute as K } from "vue-router";
5
- import { u as O } from "./feature-jwErVPVw.js";
5
+ import { u as O } from "./feature-B9ScyQ4z.js";
6
6
  import { u as $ } from "./useTabStorage-BkIVScW_.js";
7
7
  import { u as Q } from "./googlemap-Dm8ERVai.js";
8
8
  import "./array-hChJVZLE.js";
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as oe, ref as g, watch as re, computed as b, resolveComponent as ne, openBlock as y, createBlock as K, unref as e, withCtx as x, createElementVNode as s, normalizeClass as se, createVNode as n, normalizeStyle as le, toDisplayString as ce, createElementBlock as ie, createCommentVNode as ue, Teleport as pe, mergeProps as me } from "vue";
2
- import { u as de, aA as _, aL as fe, ac as Q, z as _e, _ as ve, B as he, C as De, E as v } from "./app-CulzKCFs.js";
3
- import { a as ge, P as O, b as be, _ as ye } from "./TransferDetails.vue_vue_type_script_setup_true_lang-BzFkrRui.js";
2
+ import { u as de, aA as _, aL as fe, ac as Q, z as _e, _ as ve, B as he, C as De, E as v } from "./app-PWroc2sL.js";
3
+ import { a as ge, P as O, b as be, _ as ye } from "./TransferDetails.vue_vue_type_script_setup_true_lang-CvYlsA0l.js";
4
4
  import { useBreakpoints as xe } from "@feedmepos/ui-library";
5
5
  import { useI18n as Oe } from "@feedmepos/mf-common";
6
6
  const Re = { class: "flex flex-col py-8" }, we = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ke = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Ce = {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as C, ref as o, onMounted as M, onUnmounted as F, watch as x, resolveComponent as l, openBlock as i, createElementBlock as c, createBlock as I, withCtx as R, createVNode as a, createCommentVNode as z, createElementVNode as P } from "vue";
2
- import { _ as V } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-ByJPHKqO.js";
3
- import { a as L, aT as S } from "./app-CulzKCFs.js";
2
+ import { _ as V } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CB4QqfHQ.js";
3
+ import { a as L, aT as S } from "./app-PWroc2sL.js";
4
4
  const U = {
5
5
  key: 0,
6
6
  class: "flex justify-end gap-8 items-center"
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as S, computed as r, ref as l, onMounted as U, onUnmounted as V, resolveComponent as E, openBlock as p, createElementBlock as f, createVNode as u, createElementVNode as k } from "vue";
2
- import { a as M, aT as x, H as z } from "./app-CulzKCFs.js";
2
+ import { a as M, aT as x, H as z } from "./app-PWroc2sL.js";
3
3
  const F = {
4
4
  key: 0,
5
5
  class: "flex flex-col gap-16"
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as _, ref as c, provide as C, computed as f, resolveComponent as b, openBlock as p, createBlock as h, h as z, onMounted as B, onUnmounted as I, createElementBlock as y, createVNode as N, createElementVNode as x } from "vue";
2
- import { F as v, a as E, aT as F } from "./app-CulzKCFs.js";
2
+ import { F as v, a as E, aT as F } from "./app-PWroc2sL.js";
3
3
  import { components as L } from "@feedmepos/ui-library";
4
4
  import "@feedmepos/mf-common";
5
5
  const P = /* @__PURE__ */ _({
@@ -1,30 +1,30 @@
1
1
  import { defineComponent as ke, ref as V, resolveComponent as E, openBlock as x, createBlock as X, withCtx as Y, createElementVNode as o, createTextVNode as De, toDisplayString as z, unref as y, createVNode as _, h as k, reactive as Ye, computed as H, onMounted as Ke, watch as Ge, isRef as Te, createElementBlock as T, Fragment as q, createCommentVNode as ne, normalizeClass as me, renderList as ve, normalizeStyle as Re, Teleport as qe, mergeProps as We } from "vue";
2
- import { X as Ze, u as we, ak as W, l as Je, J as je, i as P, t as Xe, K as ye, q as Qe, r as et, s as tt, al as Me, am as Pe, a7 as Ie, an as le, ad as at, aj as oe, V as Ue, D as Fe, h as xe, f as nt, e as ot, a as st, z as rt, _ as lt, B as ct, C as it, E as he } from "./app-CulzKCFs.js";
2
+ import { X as Ze, u as we, ak as W, l as Je, J as je, i as P, t as Xe, K as ye, q as Qe, r as et, s as tt, al as Me, am as Pe, a7 as Ie, an as le, ad as at, aj as oe, V as Ue, D as Fe, h as xe, f as nt, e as ot, a as st, z as rt, _ as lt, B as ct, C as it, E as he } from "./app-PWroc2sL.js";
3
3
  import { useCoreStore as ut, useI18n as Ee } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as Ce, useDialog as dt, useProxiedModel as mt, components as de, useBreakpoints as ft } from "@feedmepos/ui-library";
5
5
  import { defineStore as He, storeToRefs as pt } from "pinia";
6
- import { a as Le, u as ze } from "./stock-Czw9__W8.js";
6
+ import { a as Le, u as ze } from "./stock-DTa5kUw8.js";
7
7
  import { E as vt } from "./empty-placeholder-wf6-BWE8.js";
8
8
  const Se = Ze((n, s) => {
9
9
  function e() {
10
10
  return we().currentLocation.dbName;
11
11
  }
12
12
  return {
13
- async getDraft(i) {
14
- const u = e(), g = `${n.inventoryBackendUrl}/${u}/closing-draft/${i}`;
13
+ async getDraft(d) {
14
+ const i = e(), g = `${n.inventoryBackendUrl}/${i}/closing-draft/${d}`;
15
15
  return s.get(g);
16
16
  },
17
17
  async readDrafts() {
18
- const i = e(), u = `${n.inventoryBackendUrl}/${i}/closing-draft`;
19
- return s.get(u);
18
+ const d = e(), i = `${n.inventoryBackendUrl}/${d}/closing-draft`;
19
+ return s.get(i);
20
20
  },
21
- async runOperation(i) {
22
- const u = e(), g = `${n.inventoryBackendUrl}/${u}/closing-draft/run-operation`;
23
- return s.post(g, i);
21
+ async runOperation(d) {
22
+ const i = e(), g = `${n.inventoryBackendUrl}/${i}/closing-draft/run-operation`;
23
+ return s.post(g, d);
24
24
  },
25
- async sync(i) {
26
- const u = e(), g = `${n.inventoryBackendUrl}/${u}/closing-draft/sync`;
27
- return s.post(g, i);
25
+ async sync(d) {
26
+ const i = e(), g = `${n.inventoryBackendUrl}/${i}/closing-draft/sync`;
27
+ return s.post(g, d);
28
28
  }
29
29
  };
30
30
  }), yt = { class: "fm-typo-en-body-lg-400" }, gt = { class: "fm-typo-en-body-lg-600" }, bt = { class: "flex gap-12 py-8 justify-end w-full" }, $e = /* @__PURE__ */ ke({
@@ -36,24 +36,24 @@ const Se = Ze((n, s) => {
36
36
  onFinished: { type: Function }
37
37
  },
38
38
  setup(n) {
39
- const s = n, e = V(), i = Se(), u = Ce(), g = V(!1);
39
+ const s = n, e = V(), d = Se(), i = Ce(), g = V(!1);
40
40
  async function h() {
41
41
  g.value = !0;
42
42
  try {
43
- await i.runOperation({
43
+ await d.runOperation({
44
44
  _id: s.draft._id,
45
45
  _rev: s.draft._rev ?? "",
46
46
  action: s.action,
47
47
  data: {
48
48
  remark: e.value
49
49
  }
50
- }).delayed(500), u.open({
50
+ }).delayed(500), i.open({
51
51
  title: "Success",
52
52
  message: "Action submitted",
53
53
  type: "success"
54
54
  }), s.onFinished();
55
55
  } catch (D) {
56
- u.open({
56
+ i.open({
57
57
  title: "Something went wrong",
58
58
  message: "Unable to submit actino. Please try again",
59
59
  type: "error"
@@ -102,16 +102,16 @@ const Se = Ze((n, s) => {
102
102
  }
103
103
  }), xt = ye(0);
104
104
  function Ne(n) {
105
- const s = n.measurementsAmounts.groupBy((i) => i.measurement.id), e = n.sku.unit.measurements.reduce((i, u) => {
105
+ const s = n.measurementsAmounts.groupBy((d) => d.measurement.id), e = n.sku.unit.measurements.reduce((d, i) => {
106
106
  var D, l;
107
- const g = ((l = (D = s.get(u.id)) == null ? void 0 : D[0]) == null ? void 0 : l.amount) ?? xt, h = je(u.conversion, g);
108
- return i + +P(h);
107
+ const g = ((l = (D = s.get(i.id)) == null ? void 0 : D[0]) == null ? void 0 : l.amount) ?? xt, h = je(i.conversion, g);
108
+ return d + +P(h);
109
109
  }, +P(n.baseAmount));
110
110
  return Xe(e, n.baseAmount.precision);
111
111
  }
112
112
  const ht = ye(0), At = ye(100);
113
113
  function _t(n, s, e) {
114
- const i = Ne(n), u = Me(i, s), g = s.amount === 0 ? null : Pe(u, {
114
+ const d = Ne(n), i = Me(d, s), g = s.amount === 0 ? null : Pe(i, {
115
115
  ...s,
116
116
  amount: Math.abs(s.amount)
117
117
  }), h = g ? je(g, At) : null;
@@ -127,8 +127,8 @@ function _t(n, s, e) {
127
127
  {}
128
128
  ),
129
129
  systemBalance: +P(s),
130
- physicalBalance: +P(i),
131
- adjustedAmount: +P(u),
130
+ physicalBalance: +P(d),
131
+ adjustedAmount: +P(i),
132
132
  adjustedDiffPercentage: h ? +P(Ie(h, 2)) : null
133
133
  };
134
134
  }
@@ -138,9 +138,9 @@ function Dt(n) {
138
138
  function kt(n) {
139
139
  const s = Oe(n);
140
140
  return n.reduce(
141
- (e, i) => {
142
- var u;
143
- return Math.max(e, ((u = s == null ? void 0 : s.get(i.sku._id)) == null ? void 0 : u[0].length) ?? 0);
141
+ (e, d) => {
142
+ var i;
143
+ return Math.max(e, ((i = s == null ? void 0 : s.get(d.sku._id)) == null ? void 0 : i[0].length) ?? 0);
144
144
  },
145
145
  0
146
146
  );
@@ -185,14 +185,14 @@ function wt(n) {
185
185
  id: "baseUnit",
186
186
  name: "Base unit"
187
187
  },
188
- ...Array.from({ length: n }).flatMap((e, i) => [
188
+ ...Array.from({ length: n }).flatMap((e, d) => [
189
189
  {
190
- id: `measurementAmount${i}`,
191
- name: `UOM amount ${i + 1}`
190
+ id: `measurementAmount${d}`,
191
+ name: `UOM amount ${d + 1}`
192
192
  },
193
193
  {
194
- id: `measurementAbbrev${i}`,
195
- name: `UOM ${i + 1}`
194
+ id: `measurementAbbrev${d}`,
195
+ name: `UOM ${d + 1}`
196
196
  }
197
197
  ])
198
198
  ];
@@ -202,11 +202,11 @@ function jt(n, s) {
202
202
  const e = s.groupBy(
203
203
  (w) => w.id,
204
204
  (w) => w.balance
205
- ), i = [...n.items, ...n.negativeStockItems ?? []], u = Oe(i), g = i.map((w) => {
205
+ ), d = [...n.items, ...n.negativeStockItems ?? []], i = Oe(d), g = d.map((w) => {
206
206
  var K, se;
207
- const Z = ((K = e.get(w.sku._id)) == null ? void 0 : K[0]) ?? ht, Q = ((se = u == null ? void 0 : u.get(w.sku._id)) == null ? void 0 : se[0]) ?? [];
207
+ const Z = ((K = e.get(w.sku._id)) == null ? void 0 : K[0]) ?? ht, Q = ((se = i == null ? void 0 : i.get(w.sku._id)) == null ? void 0 : se[0]) ?? [];
208
208
  return _t(w, Z, Q);
209
- }), h = kt(i), l = ut().currentBusiness.value, R = wt(h), M = [
209
+ }), h = kt(d), l = ut().currentBusiness.value, R = wt(h), M = [
210
210
  ["Business name:", l == null ? void 0 : l.name],
211
211
  ["Business ID:", l == null ? void 0 : l._id],
212
212
  ["Menu version", l == null ? void 0 : l.menuVersion],
@@ -236,7 +236,7 @@ function jt(n, s) {
236
236
  const _e = He(
237
237
  "closingDraftActions",
238
238
  function() {
239
- const s = dt(), e = Ce(), i = Le(), u = Se(), g = ze(), h = V(!1), D = V();
239
+ const s = dt(), e = Ce(), d = Le(), i = Se(), g = ze(), h = V(!1), D = V();
240
240
  function l(b) {
241
241
  const v = {
242
242
  draft: b
@@ -255,7 +255,7 @@ const _e = He(
255
255
  }), console.error("Closing draft is completed but closing document cannot be found.", {
256
256
  draftId: b._id
257
257
  }), [];
258
- const C = await i.readAdjustmentById(N);
258
+ const C = await d.readAdjustmentById(N);
259
259
  return ((C == null ? void 0 : C.skus) ?? []).map((w) => ({
260
260
  id: w.sku._id,
261
261
  balance: w.fromBalance,
@@ -299,7 +299,7 @@ const _e = He(
299
299
  });
300
300
  }
301
301
  async function p(b, v) {
302
- await u.sync({
302
+ await i.sync({
303
303
  _id: b._id,
304
304
  _rev: b._rev ?? "",
305
305
  action: W.enum.approveDraft,
@@ -342,33 +342,33 @@ function Ae(n) {
342
342
  const Ct = He(
343
343
  "closingDraftTable",
344
344
  function() {
345
- const { t: s } = Ee(), e = _e(), i = V(new Array()), u = V(!1), g = we(), h = Se();
345
+ const { t: s } = Ee(), e = _e(), d = V(new Array()), i = V(!1), g = we(), h = Se();
346
346
  async function D() {
347
- if (i.value = [], !!g._currentLocation) {
348
- u.value = !0;
347
+ if (d.value = [], !!g._currentLocation) {
348
+ i.value = !0;
349
349
  try {
350
350
  const [r] = await Promise.all([h.readDrafts()]).delayed(1e3);
351
- i.value = r.reverse();
351
+ d.value = r.reverse();
352
352
  } catch (r) {
353
353
  console.log("Something went wrong when fetching drafts:", r);
354
354
  } finally {
355
- u.value = !1;
355
+ i.value = !1;
356
356
  }
357
357
  }
358
358
  }
359
359
  async function l(r) {
360
- if (!i.value.find((p) => p._id) && g._currentLocation) {
361
- u.value = !0;
360
+ if (!d.value.find((p) => p._id) && g._currentLocation) {
361
+ i.value = !0;
362
362
  try {
363
363
  const [p] = await Promise.all([
364
364
  h.getDraft(r),
365
365
  new Promise((B) => setTimeout(B, 1e3))
366
366
  ]);
367
- i.value = [p];
367
+ d.value = [p];
368
368
  } catch (p) {
369
369
  console.log("Something went wrong when fetching drafts:", p);
370
370
  } finally {
371
- u.value = !1;
371
+ i.value = !1;
372
372
  }
373
373
  }
374
374
  }
@@ -514,8 +514,8 @@ const Ct = He(
514
514
  }
515
515
  }
516
516
  ],
517
- drafts: i,
518
- loading: u,
517
+ drafts: d,
518
+ loading: i,
519
519
  fetchDrafts: D,
520
520
  loadDraft: l
521
521
  };
@@ -555,7 +555,7 @@ const Ct = He(
555
555
  },
556
556
  emits: ["submitted"],
557
557
  setup(n, { emit: s }) {
558
- const e = n, i = ze(), u = _e(), g = mt(e, "show"), h = V(!1), D = V(!1), l = V(new Array()), R = Le(), M = Ce(), U = st(), r = Ye({}), p = H(() => new Set(
558
+ const e = n, d = ze(), i = _e(), g = mt(e, "show"), h = V(!1), D = V(!1), l = V(new Array()), R = Le(), M = Ce(), U = st(), r = Ye({}), p = H(() => new Set(
559
559
  U.skus.filter((a) => {
560
560
  var t;
561
561
  return r[(t = a.customAttributes) == null ? void 0 : t.tag];
@@ -584,8 +584,8 @@ const Ct = He(
584
584
  const a = ((t = e.draft) == null ? void 0 : t.status) === le.enum.COMPLETED;
585
585
  try {
586
586
  if (await U.init(), a) {
587
- const d = e.draft.closingAdjustmentId;
588
- if (!d) {
587
+ const u = e.draft.closingAdjustmentId;
588
+ if (!u) {
589
589
  M.open({
590
590
  title: "Something went wrong",
591
591
  message: "Closing draft is completed but closing document cannot be found.",
@@ -595,20 +595,20 @@ const Ct = He(
595
595
  });
596
596
  return;
597
597
  }
598
- const f = await R.readAdjustmentById(d), j = (f == null ? void 0 : f.skus) ?? [];
598
+ const f = await R.readAdjustmentById(u), j = (f == null ? void 0 : f.skus) ?? [];
599
599
  l.value = j.map(($) => ({
600
600
  id: $.sku._id,
601
601
  balance: $.fromBalance,
602
602
  costs: $.fromCostBalances
603
603
  }));
604
604
  } else
605
- await i.readStockBalance(), l.value = ((m = i.stockBalance) == null ? void 0 : m.skus) ?? [];
606
- } catch (d) {
605
+ l.value = ((m = e.draft) == null ? void 0 : m.stockSnapshot) ?? [];
606
+ } catch (u) {
607
607
  M.open({
608
608
  title: "Something went wrong",
609
609
  message: "Something went wrong when fetching info. Please try again.",
610
610
  type: "error"
611
- }), console.error("error on fetch stock balances", d);
611
+ }), console.error("error on fetch stock balances", u);
612
612
  } finally {
613
613
  h.value = !1;
614
614
  }
@@ -635,8 +635,8 @@ const Ct = He(
635
635
  }
636
636
  const K = H(() => {
637
637
  const a = v.value.reduce((c, m) => {
638
- var d, f;
639
- return Math.max(c, ((f = (d = F.value) == null ? void 0 : d.get(m._id)) == null ? void 0 : f[0].length) ?? 0);
638
+ var u, f;
639
+ return Math.max(c, ((f = (u = F.value) == null ? void 0 : u.get(m._id)) == null ? void 0 : f[0].length) ?? 0);
640
640
  }, 0);
641
641
  return [
642
642
  {
@@ -645,7 +645,7 @@ const Ct = He(
645
645
  header: () => "Name",
646
646
  size: 350,
647
647
  cell(c) {
648
- const m = c.row.original, d = m.adjustedDiffPercentage, f = typeof d == "number" && Math.abs(d) > 10, j = k("div", { class: "flex flex-col gap-4" }, [
648
+ const m = c.row.original, u = m.adjustedDiffPercentage, f = typeof u == "number" && Math.abs(u) > 10, j = k("div", { class: "flex flex-col gap-4" }, [
649
649
  k(
650
650
  "div",
651
651
  {
@@ -739,8 +739,8 @@ const Ct = He(
739
739
  cell(c) {
740
740
  const m = c.row.original.adjustedDiffPercentage;
741
741
  if (!m) return "N/A";
742
- const d = m.toFixed(2);
743
- if (d === "0.00")
742
+ const u = m.toFixed(2);
743
+ if (u === "0.00")
744
744
  return k("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
745
745
  const f = m > 0;
746
746
  return k("div", { class: "flex items-center gap-4 justify-end" }, [
@@ -749,7 +749,7 @@ const Ct = He(
749
749
  color: f ? "system-success-300" : "system-error-300",
750
750
  size: "md"
751
751
  }),
752
- d
752
+ u
753
753
  ]);
754
754
  },
755
755
  meta: {
@@ -761,7 +761,7 @@ const Ct = He(
761
761
  header: () => "Amounts",
762
762
  enableSorting: !1,
763
763
  cell(c) {
764
- const m = c.row.original, d = (j, $) => k(
764
+ const m = c.row.original, u = (j, $) => k(
765
765
  de.FmTooltip,
766
766
  { zIndex: 50 },
767
767
  {
@@ -793,9 +793,9 @@ const Ct = He(
793
793
  if (!m[`measurementAmount${$}`])
794
794
  return null;
795
795
  const S = m[`measurementAmount${$}`], ie = m[`measurementAbbrev${$}`];
796
- return d(S, ie);
796
+ return u(S, ie);
797
797
  }).filter((j) => j);
798
- return (m.baseUnitAmount || !f.length) && (f = [d(m.baseUnitAmount, m.baseUnit), ...f]), k(
798
+ return (m.baseUnitAmount || !f.length) && (f = [u(m.baseUnitAmount, m.baseUnit), ...f]), k(
799
799
  "div",
800
800
  {
801
801
  class: "flex gap-8 flex-nowrap",
@@ -822,7 +822,7 @@ const Ct = He(
822
822
  adjustedAmount: -+P(c),
823
823
  adjustedDiffPercentage: -100
824
824
  };
825
- const m = Ne(t), d = Me(m, c), f = c.amount === 0 ? null : Pe(d, {
825
+ const m = Ne(t), u = Me(m, c), f = c.amount === 0 ? null : Pe(u, {
826
826
  ...c,
827
827
  amount: Math.abs(c.amount)
828
828
  }), j = f ? je(f, C) : null;
@@ -837,7 +837,7 @@ const Ct = He(
837
837
  }).reduce((ae, G, re) => (ae[`measurementAbbrev${re}`] = `(${G.measurement.abbrev}) × ${P(G.measurement.conversion)}`, ae[`measurementAmount${re}`] = +P(G.amount), ae), {}),
838
838
  systemBalance: +P(c),
839
839
  physicalBalance: +P(m),
840
- adjustedAmount: +P(d),
840
+ adjustedAmount: +P(u),
841
841
  adjustedDiffPercentage: j ? +P(Ie(j, 2)) : null
842
842
  };
843
843
  })), ge = H(() => {
@@ -848,11 +848,11 @@ const Ct = He(
848
848
  // actionAt: props.draft.approvedAt,
849
849
  actionBy: e.draft.approvedBy,
850
850
  remark: e.draft.approveRemark
851
- } : (t = e.draft.rejectionHistory) == null ? void 0 : t.computeFirst((d) => ({
852
- action: `Reject at ${oe(d.rejectedAt)}`,
851
+ } : (t = e.draft.rejectionHistory) == null ? void 0 : t.computeFirst((u) => ({
852
+ action: `Reject at ${oe(u.rejectedAt)}`,
853
853
  // actionAt: e.rejectedAt,
854
- actionBy: d.rejectedBy,
855
- remark: d.rejectRemark
854
+ actionBy: u.rejectedBy,
855
+ remark: u.rejectRemark
856
856
  }));
857
857
  return [
858
858
  {
@@ -877,7 +877,7 @@ const Ct = He(
877
877
  },
878
878
  {
879
879
  label: "Using template",
880
- value: ((c = e.draft.usingTemplates.find((d) => d)) == null ? void 0 : c.name) ?? "None"
880
+ value: ((c = e.draft.usingTemplates.find((u) => u)) == null ? void 0 : c.name) ?? "None"
881
881
  },
882
882
  e.draft.remark ? {
883
883
  label: "Remark",
@@ -895,7 +895,7 @@ const Ct = He(
895
895
  label: "Action remark",
896
896
  value: a.remark
897
897
  } : null
898
- ].filter((d) => d).map((d) => d);
898
+ ].filter((u) => u).map((u) => u);
899
899
  }), ee = [
900
900
  {
901
901
  label: "Overview",
@@ -906,7 +906,7 @@ const Ct = He(
906
906
  value: "history"
907
907
  }
908
908
  ], te = V(ee[0]), J = H(() => {
909
- var t, c, m, d;
909
+ var t, c, m, u;
910
910
  return [
911
911
  ...(((t = e.draft) == null ? void 0 : t.rejectionHistory) ?? []).map(
912
912
  (f) => ({
@@ -935,24 +935,24 @@ const Ct = He(
935
935
  },
936
936
  {
937
937
  label: "Approval remark",
938
- values: [((d = e.draft) == null ? void 0 : d.approveRemark) ?? ""]
938
+ values: [((u = e.draft) == null ? void 0 : u.approveRemark) ?? ""]
939
939
  }
940
940
  ]
941
941
  }
942
942
  ] : []
943
943
  ];
944
944
  }), pe = H(() => {
945
- var d, f, j, $;
946
- if ((d = e == null ? void 0 : e.draft) != null && d.approvedAt) return "Draft is already approved.";
945
+ var u, f, j, $;
946
+ if ((u = e == null ? void 0 : e.draft) != null && u.approvedAt) return "Draft is already approved.";
947
947
  if (((f = e.draft) == null ? void 0 : f.status) !== le.enum.DRAFT) return "Status is not draft.";
948
- const a = fe.value.some((S) => S.physicalBalance < 0), t = (($ = (j = i.stockBalance.skus) == null ? void 0 : j.filter((S) => S.balance.amount < 0)) == null ? void 0 : $.map((S) => S.id)) ?? [], c = new Set(v.value.map((S) => S._id)), m = t.filter((S) => !c.has(S)).length;
948
+ const a = fe.value.some((S) => S.physicalBalance < 0), t = (($ = (j = d.stockBalance.skus) == null ? void 0 : j.filter((S) => S.balance.amount < 0)) == null ? void 0 : $.map((S) => S.id)) ?? [], c = new Set(v.value.map((S) => S._id)), m = t.filter((S) => !c.has(S)).length;
949
949
  return [
950
950
  a ? "Negative total exist." : null,
951
951
  m ? "Negative stock is not included in this draft. Reopen draft in POS and apply changes." : null
952
952
  ].filter((S) => S).join(" ");
953
953
  });
954
954
  return (a, t) => {
955
- const c = E("FmButtonGroup"), m = E("FmMenuDivider"), d = E("FmCard"), f = E("FmButton"), j = E("FmCircularProgress"), $ = E("FmTextField"), S = E("FmIcon"), ie = E("FmChip"), ae = E("FmTable"), G = E("FmSpacer"), re = E("FmTooltip"), be = E("FmSideSheet");
955
+ const c = E("FmButtonGroup"), m = E("FmMenuDivider"), u = E("FmCard"), f = E("FmButton"), j = E("FmCircularProgress"), $ = E("FmTextField"), S = E("FmIcon"), ie = E("FmChip"), ae = E("FmTable"), G = E("FmSpacer"), re = E("FmTooltip"), be = E("FmSideSheet");
956
956
  return x(), X(be, {
957
957
  "dismiss-away": "",
958
958
  "max-width": 9999,
@@ -977,28 +977,28 @@ const Ct = He(
977
977
  disabled: "",
978
978
  key: "approve key",
979
979
  label: "Approve",
980
- onClick: t[3] || (t[3] = () => e.draft && y(u).approveDraft(e.draft, () => B("submitted")))
980
+ onClick: t[3] || (t[3] = () => e.draft && y(i).approveDraft(e.draft, () => B("submitted")))
981
981
  })
982
982
  ]),
983
983
  _: 1
984
984
  })) : (x(), X(f, {
985
985
  key: "approve key",
986
986
  label: "Approve",
987
- onClick: t[4] || (t[4] = () => e.draft && y(u).approveDraft(e.draft, () => B("submitted")))
987
+ onClick: t[4] || (t[4] = () => e.draft && y(i).approveDraft(e.draft, () => B("submitted")))
988
988
  }))
989
989
  ], 64)) : ne("", !0),
990
990
  ((L = e.draft) == null ? void 0 : L.status) === y(le).enum.DRAFT ? (x(), X(f, {
991
991
  key: 1,
992
992
  label: "Reject",
993
993
  variant: "destructive",
994
- onClick: t[5] || (t[5] = () => e.draft && y(u).rejectDraft(e.draft, () => B("submitted")))
994
+ onClick: t[5] || (t[5] = () => e.draft && y(i).rejectDraft(e.draft, () => B("submitted")))
995
995
  })) : ne("", !0),
996
996
  (O = e.draft) != null && O.approvedAt && ((ue = e.draft) == null ? void 0 : ue.status) !== y(le).enum.COMPLETED ? (x(), X(f, {
997
997
  key: 2,
998
998
  label: "Sync",
999
999
  loading: D.value,
1000
1000
  onClick: t[6] || (t[6] = () => {
1001
- e.draft && (D.value = !0, y(u).syncDraft(e.draft, () => {
1001
+ e.draft && (D.value = !0, y(i).syncDraft(e.draft, () => {
1002
1002
  D.value = !1, B("submitted");
1003
1003
  }));
1004
1004
  })
@@ -1021,7 +1021,7 @@ const Ct = He(
1021
1021
  }, null, 8, ["modelValue"])
1022
1022
  ]),
1023
1023
  te.value.value === "overview" ? (x(), T(q, { key: 0 }, [
1024
- _(d, {
1024
+ _(u, {
1025
1025
  variant: "outlined",
1026
1026
  class: "flex flex-col gap-8 px-12 py-16"
1027
1027
  }, {
@@ -1063,7 +1063,7 @@ const Ct = He(
1063
1063
  "text-color": "primary",
1064
1064
  "bg-color": "transparent",
1065
1065
  "border-color": "primary",
1066
- onClick: t[1] || (t[1] = (A) => a.draft ? y(u).exportDraft(a.draft, l.value) : null)
1066
+ onClick: t[1] || (t[1] = (A) => a.draft ? y(i).exportDraft(a.draft, l.value) : null)
1067
1067
  })
1068
1068
  ]))
1069
1069
  ]),
@@ -1175,7 +1175,7 @@ const Ct = He(
1175
1175
  ])
1176
1176
  ]),
1177
1177
  o("div", aa, [
1178
- _(d, {
1178
+ _(u, {
1179
1179
  variant: "outlined",
1180
1180
  class: "py-12 px-16"
1181
1181
  }, {
@@ -1223,7 +1223,7 @@ const Ct = He(
1223
1223
  }), ca = { class: "flex-1 flex flex-col gap-8" }, ia = { class: "flex flex-col" }, ua = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, da = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, ma = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, fa = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Aa = /* @__PURE__ */ ke({
1224
1224
  __name: "ClosingDraftView",
1225
1225
  setup(n) {
1226
- const { t: s } = Ee(), { viewDraft: e } = _e(), { viewClosingDraftProps: i, viewClosingDraftShow: u } = pt(_e()), g = we(), h = Ct(), D = rt(), { breakpoints: l } = ft();
1226
+ const { t: s } = Ee(), { viewDraft: e } = _e(), { viewClosingDraftProps: d, viewClosingDraftShow: i } = pt(_e()), g = we(), h = Ct(), D = rt(), { breakpoints: l } = ft();
1227
1227
  g.watchLocation(h.fetchDrafts);
1228
1228
  const R = H(() => h.loading), M = V(""), U = H(() => l.value.xs || l.value.sm), r = H(() => U.value ? 10 : 20);
1229
1229
  function p(v) {
@@ -1287,7 +1287,7 @@ const Ct = He(
1287
1287
  onRowClick: (I) => y(e)(I)
1288
1288
  }, {
1289
1289
  default: Y((I) => {
1290
- var w, Z, Q, K, se, ce, fe, ge, ee, te, J, pe, a, t, c, m, d, f, j, $;
1290
+ var w, Z, Q, K, se, ce, fe, ge, ee, te, J, pe, a, t, c, m, u, f, j, $;
1291
1291
  return [
1292
1292
  o("div", ca, [
1293
1293
  o("div", ia, [
@@ -1316,7 +1316,7 @@ const Ct = He(
1316
1316
  ]),
1317
1317
  o("div", null, [
1318
1318
  _(y(he), {
1319
- render: (f = (d = (m = I.status) == null ? void 0 : m.column) == null ? void 0 : d.columnDef) == null ? void 0 : f.cell,
1319
+ render: (f = (u = (m = I.status) == null ? void 0 : m.column) == null ? void 0 : u.columnDef) == null ? void 0 : f.cell,
1320
1320
  props: ($ = (j = I.status) == null ? void 0 : j.getContext) == null ? void 0 : $.call(j)
1321
1321
  }, null, 8, ["render", "props"])
1322
1322
  ])
@@ -1333,10 +1333,10 @@ const Ct = He(
1333
1333
  _: 1
1334
1334
  }, 8, ["title", "actions"]),
1335
1335
  (x(), X(qe, { to: "body" }, [
1336
- _(la, We(y(i), {
1337
- show: y(u),
1338
- "onUpdate:show": F[2] || (F[2] = (C) => Te(u) ? u.value = C : null),
1339
- onSubmitted: F[3] || (F[3] = () => (u.value = !1, y(h).fetchDrafts()))
1336
+ _(la, We(y(d), {
1337
+ show: y(i),
1338
+ "onUpdate:show": F[2] || (F[2] = (C) => Te(i) ? i.value = C : null),
1339
+ onSubmitted: F[3] || (F[3] = () => (i.value = !1, y(h).fetchDrafts()))
1340
1340
  }), null, 16, ["show"])
1341
1341
  ]))
1342
1342
  ], 64);
@@ -1,9 +1,9 @@
1
1
  import { ref as R, h as A, defineComponent as J, resolveComponent as E, openBlock as w, createElementBlock as I, createElementVNode as b, normalizeClass as q, createTextVNode as Fe, toDisplayString as C, unref as i, createCommentVNode as X, createVNode as T, withCtx as P, Fragment as O, renderList as Q, computed as U, watch as Re, createSlots as ie, createBlock as N, isRef as Pe, normalizeStyle as Ye, Teleport as Ge, normalizeProps as Ke, guardReactiveProps as Je, mergeProps as We } from "vue";
2
- import { X as qe, u as ue, ad as Xe, D as Se, h as j, f as Qe, e as Ae, ae as ce, r as Ze, af as Ee, s as Ue, a as de, b as et, v as tt, w as Ve, x as nt, y as ot, d as K, E as W, G as st, ag as lt, l as at, ah as rt, C as Ne, A as it, ai as ct, aj as re, z as mt, _ as ut, B as dt } from "./app-CulzKCFs.js";
2
+ import { X as qe, u as ue, ad as Xe, D as Se, h as j, f as Qe, e as Ae, ae as ce, r as Ze, af as Ee, s as Ue, a as de, b as et, v as tt, w as Ve, x as nt, y as ot, d as K, E as W, G as st, ag as lt, l as at, ah as rt, C as Ne, A as it, ai as ct, aj as re, z as mt, _ as ut, B as dt } from "./app-PWroc2sL.js";
3
3
  import { useCoreStore as pe, useI18n as Y } from "@feedmepos/mf-common";
4
4
  import { useDialogChild as pt, useSnackbar as se, useDialog as Be, FmButtonVariant as De, components as G, useProxiedModel as ft, useBreakpoints as vt } from "@feedmepos/ui-library";
5
5
  import { defineStore as Le, storeToRefs as ze } from "pinia";
6
- import { u as gt } from "./use-ingredient-select-dialog-DDeNnPW0.js";
6
+ import { u as gt } from "./use-ingredient-select-dialog-DRmBMp3Q.js";
7
7
  const le = qe((l, n) => {
8
8
  function o() {
9
9
  var t;
@@ -1716,7 +1716,7 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
1716
1716
  isPrimary: !1
1717
1717
  },
1718
1718
  {
1719
- label: "Publish",
1719
+ label: n("inventory.common.publish"),
1720
1720
  value: "publish",
1721
1721
  isPrimary: !1
1722
1722
  },
@@ -1,6 +1,6 @@
1
- import { i as T, t as R, as as w, u as B, ax as E, aI as H, aJ as z, aK as U } from "./app-CulzKCFs.js";
2
- import { u as D } from "./supplier-f0XPCLm-.js";
3
- import { P as F } from "./format-unit-display-BMC3HZ0N.js";
1
+ import { i as T, t as R, as as w, u as B, ax as E, aI as H, aJ as z, aK as U } from "./app-PWroc2sL.js";
2
+ import { u as D } from "./supplier-Ducp68Cm.js";
3
+ import { P as F } from "./format-unit-display-Baes6aNL.js";
4
4
  import { computed as f, defineComponent as x, mergeModels as j, useModel as q, ref as W, resolveComponent as V, openBlock as S, createElementBlock as I, normalizeStyle as $, createElementVNode as N, createVNode as J, withCtx as K, createBlock as g, createCommentVNode as O, Fragment as Q, renderList as X, unref as M } from "vue";
5
5
  function Y(t, i, a) {
6
6
  var s;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as oe, mergeModels as O, useModel as se, computed as v, ref as P, watch as z, inject as ie, resolveComponent as b, openBlock as f, createElementBlock as y, createElementVNode as u, createVNode as M, withCtx as g, renderSlot as T, normalizeClass as V, toDisplayString as x, withDirectives as le, vModelText as ae, createCommentVNode as q, createTextVNode as ue, createBlock as W, Fragment as re, renderList as me } from "vue";
2
- import { $ as I, I as k, P as L, K as ce, i as h, aG as de, t as pe, J as fe, am as ve, aE as be, aD as ye } from "./app-CulzKCFs.js";
2
+ import { $ as I, I as k, P as L, K as ce, i as h, aG as de, t as pe, J as fe, am as ve, aE as be, aD as ye } from "./app-PWroc2sL.js";
3
3
  import "@feedmepos/ui-library";
4
4
  function E() {
5
5
  return {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as p, openBlock as s, createElementBlock as n, createElementVNode as r, toDisplayString as o, unref as l, Fragment as d, renderList as x } from "vue";
2
- import { i as a, J as y } from "./app-CulzKCFs.js";
2
+ import { i as a, J as y } from "./app-PWroc2sL.js";
3
3
  import { useI18n as _ } from "@feedmepos/mf-common";
4
4
  const v = { class: "flex flex-col" }, g = { class: "flex flex-row fm-typo-en-body-md-600 bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary h-48 items-center" }, h = { class: "flex-1 py-8 px-16" }, b = {
5
5
  class: "flex-0 py-8 px-16",
@@ -1,5 +1,5 @@
1
1
  import { ref as F, computed as C, defineComponent as Y, resolveComponent as S, openBlock as M, createBlock as O, withCtx as R, createElementVNode as x, createVNode as g, unref as l, createElementBlock as ee, toDisplayString as j, createTextVNode as te, watch as ue, isRef as ce, normalizeClass as de, normalizeStyle as me, createSlots as pe, Teleport as fe, normalizeProps as ve, guardReactiveProps as ge } from "vue";
2
- import { a as J, d as h, e as B, f as ye, D as oe, h as Q, G as be, l as _e, A as xe, H as ne, p as se, u as ke, z as he, _ as we, B as Se, C as Ie, E as ae } from "./app-CulzKCFs.js";
2
+ import { a as J, d as h, e as B, f as ye, D as oe, h as Q, G as be, l as _e, A as xe, H as ne, p as se, u as ke, z as he, _ as we, B as Se, C as Ie, E as ae } from "./app-PWroc2sL.js";
3
3
  import { useDialog as le, useSnackbar as Z, useProxiedModel as Ce, useBreakpoints as Fe } from "@feedmepos/ui-library";
4
4
  import { useI18n as W } from "@feedmepos/mf-common";
5
5
  import { defineStore as ie, storeToRefs as re } from "pinia";