@feedmepos/mf-inventory-portal 1.0.9-dev.4 → 1.0.10-dev.1

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 (52) hide show
  1. package/dist/{App-BOKGVcoO.js → App-B650rzJv.js} +2 -2
  2. package/dist/{ApprovalView-Bo-4fnEU.js → ApprovalView-H0w0Pbkj.js} +2 -2
  3. package/dist/{BindingsDialog-DM2b4GN4.js → BindingsDialog-BTEnbuSr.js} +2 -2
  4. package/dist/{BindingsPicker-CJKBXA0c.js → BindingsPicker-DJVlBOBU.js} +3 -3
  5. package/dist/{BindingsTable-BxCEEJfb.js → BindingsTable-BWsGdzSB.js} +1 -1
  6. package/dist/{ClosingDraftView-bQxPF18V.js → ClosingDraftView-AWcZjvya.js} +106 -106
  7. package/dist/{ClosingTemplateView-DLkp9Qt8.js → ClosingTemplateView-N2Ap8Ekd.js} +2 -2
  8. package/dist/{DeliveryOrderPrintPreview-CK3HdYVb.js → DeliveryOrderPrintPreview-C5EPAWPK.js} +1 -1
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DvCBsPdI.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DVfj4MgV.js} +3 -3
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-R8f-Q9Nk.js → FmUnitInput.vue_vue_type_script_setup_true_lang-wvRtPslo.js} +20 -20
  11. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BOyqgaik.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DRygALNq.js} +1 -1
  12. package/dist/IngredientGroupView-B_xMnLFQ.js +604 -0
  13. package/dist/{IngredientsView-DmKCy_JQ.js → IngredientsView-DZxBsZI-.js} +4 -4
  14. package/dist/{IntegrationView-B1dzt8WK.js → IntegrationView-p63ruxVJ.js} +4 -4
  15. package/dist/{InventoryBindingForm-CeTlH0U1.js → InventoryBindingForm-DOCKvvbd.js} +1 -1
  16. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DsM2bCNe.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bzfh5vhC.js} +19 -19
  17. package/dist/{InventoryBindingSummary-QVSD87YL.js → InventoryBindingSummary-Bot16bHd.js} +1 -1
  18. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C-lgLo2e.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cq1W66FY.js} +1 -1
  19. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CEMRfo1C.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CLkcV3TQ.js} +1 -1
  20. package/dist/{PublishView-BYGKLC9D.js → PublishView-gf-pE1NP.js} +2 -2
  21. package/dist/{PurchaseOrderPrintPreview-CEVjGeom.js → PurchaseOrderPrintPreview-BB5aGGvb.js} +1 -1
  22. package/dist/{ReceiveRequestView-D5PcGCLv.js → ReceiveRequestView-CR2Ive4l.js} +42 -42
  23. package/dist/{RecipeView-DmTDCsvk.js → RecipeView-Cr1h7m7C.js} +3 -3
  24. package/dist/{StockView-EmTqUcP1.js → StockView-CbJu6pz1.js} +7 -7
  25. package/dist/{SupplierView-BaLnW761.js → SupplierView-DLnf0IXT.js} +4 -4
  26. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B3ew6mc5.js → TransferDetails.vue_vue_type_script_setup_true_lang-9saG4V9_.js} +36 -36
  27. package/dist/{TransferTemplateView-DoeLAFmJ.js → TransferTemplateView-Cwn20Rza.js} +114 -114
  28. package/dist/{UnitView-6Kobe5di.js → UnitView-ir5d8Ls0.js} +18 -18
  29. package/dist/{WarehouseView-BBMS14jU.js → WarehouseView-BA0b8JDG.js} +1 -1
  30. package/dist/api/inventory.d.ts +207 -0
  31. package/dist/{app-CUTIQqG_.js → app-DmpPc6HP.js} +15490 -15057
  32. package/dist/app.js +1 -1
  33. package/dist/{decimal-Bb7Chjpr.js → decimal-BdCdQEd5.js} +1 -1
  34. package/dist/{feature-D5GLIW5h.js → feature-B_qG9zNF.js} +579 -466
  35. package/dist/{format-unit-display-CqqBiewI.js → format-unit-display-y8ZPuai0.js} +29 -29
  36. package/dist/{index-B7QMXzGe.js → index-BdbeTU14.js} +2823 -2739
  37. package/dist/{index-DiEdX1Bs.js → index-rWHZ5j80.js} +2 -2
  38. package/dist/{stock-CO0XWh8j.js → stock-C05OFvav.js} +1 -1
  39. package/dist/stores/inventory.d.ts +211 -1
  40. package/dist/{supplier-C877x7mU.js → supplier-B58dle3W.js} +1 -1
  41. package/dist/tsconfig.app.tsbuildinfo +1 -1
  42. package/dist/{use-ingredient-select-dialog-ClufUFeU.js → use-ingredient-select-dialog-CrfP3e6M.js} +1 -1
  43. package/dist/{use-inventory-binding-dialog-BuRe6QNp.js → use-inventory-binding-dialog-D0RpVsqZ.js} +1 -1
  44. package/dist/views/ingredient-group/IngredientGroupView.vue.d.ts +3 -0
  45. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +31 -0
  46. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +12 -0
  47. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +20 -0
  48. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +12 -0
  49. package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +24 -0
  50. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +218 -0
  51. package/dist/{vue-i18n-CxuQa0ds.js → vue-i18n-Dt--gl9w.js} +337 -337
  52. package/package.json +3 -3
@@ -1,13 +1,13 @@
1
- import { defineComponent as Fe, ref as O, resolveComponent as U, openBlock as h, createBlock as W, withCtx as Y, createElementVNode as o, createTextVNode as Be, toDisplayString as N, unref as g, createVNode as w, h as S, reactive as We, computed as E, onMounted as Ze, watch as Je, isRef as Ie, createElementBlock as P, Fragment as q, createCommentVNode as ee, normalizeClass as pe, renderList as be, normalizeStyle as Ue, Teleport as Xe, mergeProps as Qe } from "vue";
2
- import { X as et, u as Se, af as Z, l as tt, H as $e, i as M, t as at, J as he, q as nt, r as ot, s as st, ag as Ee, ah as He, a3 as Le, ai as ne, a9 as rt, ae, T as ze, D as Pe, h as _e, f as lt, e as ct, a as it, z as ut, _ as dt, B as mt, C as ft, E as ke } from "./app-CUTIQqG_.js";
1
+ import { defineComponent as Fe, ref as O, resolveComponent as U, openBlock as h, createBlock as W, withCtx as Y, createElementVNode as o, createTextVNode as Be, toDisplayString as N, unref as g, createVNode as w, h as j, reactive as We, computed as E, onMounted as Ze, watch as Je, isRef as Ie, createElementBlock as P, Fragment as q, createCommentVNode as ee, normalizeClass as pe, renderList as be, normalizeStyle as Ue, Teleport as Xe, mergeProps as Qe } from "vue";
2
+ import { X as et, u as je, af as Z, l as tt, J as $e, i as M, t as at, K as he, q as nt, r as ot, s as st, ag as Ee, ah as He, a3 as Le, ai as ne, a9 as rt, ae, V as ze, D as Pe, h as De, f as lt, e as ct, a as it, z as ut, _ as dt, B as mt, C as ft, E as ke } from "./app-DmpPc6HP.js";
3
3
  import { useCoreStore as pt, useI18n as Ne } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as Re, useDialog as vt, useProxiedModel as yt, components as fe, useBreakpoints as gt } from "@feedmepos/ui-library";
5
5
  import { defineStore as Oe, storeToRefs as bt } from "pinia";
6
- import { a as Ve, u as Ye } from "./stock-CO0XWh8j.js";
6
+ import { a as Ve, u as Ye } from "./stock-C05OFvav.js";
7
7
  import { E as ht } from "./empty-placeholder-wf6-BWE8.js";
8
- const je = et((n, r) => {
8
+ const Se = et((n, r) => {
9
9
  function e() {
10
- return Se().currentLocation.dbName;
10
+ return je().currentLocation.dbName;
11
11
  }
12
12
  return {
13
13
  async getDraft(i) {
@@ -27,7 +27,7 @@ const je = et((n, r) => {
27
27
  return r.post(b, i);
28
28
  }
29
29
  };
30
- }), xt = { class: "fm-typo-en-body-lg-400" }, At = { class: "fm-typo-en-body-lg-600" }, Dt = { class: "flex gap-12 py-8 justify-end w-full" }, Me = /* @__PURE__ */ Fe({
30
+ }), xt = { class: "fm-typo-en-body-lg-400" }, At = { class: "fm-typo-en-body-lg-600" }, _t = { class: "flex gap-12 py-8 justify-end w-full" }, Me = /* @__PURE__ */ Fe({
31
31
  __name: "ClosingDraftAction",
32
32
  props: {
33
33
  draft: {},
@@ -36,7 +36,7 @@ const je = et((n, r) => {
36
36
  onFinished: { type: Function }
37
37
  },
38
38
  setup(n) {
39
- const r = n, e = O(), i = je(), u = Re(), b = O(!1);
39
+ const r = n, e = O(), i = Se(), u = Re(), b = O(!1);
40
40
  async function x() {
41
41
  b.value = !0;
42
42
  try {
@@ -82,7 +82,7 @@ const je = et((n, r) => {
82
82
  "label-mark": "required",
83
83
  rules: [g(tt)()]
84
84
  }, null, 8, ["modelValue", "rules"]),
85
- o("div", Dt, [
85
+ o("div", _t, [
86
86
  w(R, {
87
87
  label: "Cancel",
88
88
  variant: "tertiary",
@@ -100,11 +100,11 @@ const je = et((n, r) => {
100
100
  }, 8, ["disabled"]);
101
101
  };
102
102
  }
103
- }), _t = he(0);
103
+ }), Dt = he(0);
104
104
  function Ke(n) {
105
105
  const r = n.measurementsAmounts.groupBy((i) => i.measurement.id), e = n.sku.unit.measurements.reduce((i, u) => {
106
106
  var C, d;
107
- const b = ((d = (C = r.get(u.id)) == null ? void 0 : C[0]) == null ? void 0 : d.amount) ?? _t, x = $e(u.conversion, b);
107
+ const b = ((d = (C = r.get(u.id)) == null ? void 0 : C[0]) == null ? void 0 : d.amount) ?? Dt, x = $e(u.conversion, b);
108
108
  return i + +M(x);
109
109
  }, +M(n.baseAmount));
110
110
  return at(e, n.baseAmount.precision);
@@ -121,7 +121,7 @@ function Ct(n, r, e) {
121
121
  baseUnit: n.sku.unit.abbrev,
122
122
  baseUnitAmount: +M(n.baseAmount),
123
123
  ...n.measurementsAmounts.filter(
124
- (d) => St(d.measurement) && e.includes(d.measurement.id)
124
+ (d) => jt(d.measurement) && e.includes(d.measurement.id)
125
125
  ).reduce(
126
126
  (d, F, R) => (d[`measurementAbbrev${R}`] = `(${F.measurement.abbrev}) × ${M(F.measurement.conversion)}`, d[`measurementAmount${R}`] = +M(F.amount), d),
127
127
  {}
@@ -132,10 +132,10 @@ function Ct(n, r, e) {
132
132
  adjustedDiffPercentage: x ? +M(Le(x, 2)) : null
133
133
  };
134
134
  }
135
- function St(n) {
135
+ function jt(n) {
136
136
  return !n.abbrev.toLocaleLowerCase().includes("inactive");
137
137
  }
138
- function jt(n) {
138
+ function St(n) {
139
139
  const r = Ge(n);
140
140
  return n.reduce(
141
141
  (e, i) => {
@@ -198,15 +198,15 @@ function Bt(n) {
198
198
  ];
199
199
  }
200
200
  function Ft(n, r) {
201
- var p, v, y, A, L, D, T;
201
+ var p, v, y, A, L, _, T;
202
202
  const e = r.groupBy(
203
- (j) => j.id,
204
- (j) => j.balance
205
- ), i = [...n.items, ...n.negativeStockItems ?? []], u = Ge(i), b = i.map((j) => {
203
+ (S) => S.id,
204
+ (S) => S.balance
205
+ ), i = [...n.items, ...n.negativeStockItems ?? []], u = Ge(i), b = i.map((S) => {
206
206
  var X, se;
207
- const J = ((X = e.get(j.sku._id)) == null ? void 0 : X[0]) ?? kt, oe = ((se = u == null ? void 0 : u.get(j.sku._id)) == null ? void 0 : se[0]) ?? [];
208
- return Ct(j, J, oe);
209
- }), x = jt(i), d = pt().currentBusiness.value, F = Bt(x), R = [
207
+ const J = ((X = e.get(S.sku._id)) == null ? void 0 : X[0]) ?? kt, oe = ((se = u == null ? void 0 : u.get(S.sku._id)) == null ? void 0 : se[0]) ?? [];
208
+ return Ct(S, J, oe);
209
+ }), x = St(i), d = pt().currentBusiness.value, F = Bt(x), R = [
210
210
  ["Business name:", d == null ? void 0 : d.name],
211
211
  ["Business ID:", d == null ? void 0 : d._id],
212
212
  ["Menu version", d == null ? void 0 : d.menuVersion],
@@ -221,22 +221,22 @@ function Ft(n, r) {
221
221
  ],
222
222
  [
223
223
  "Action at",
224
- n.approvedAt ? new Date(n.approvedAt) : n.rejectionHistory ? new Date((D = n.rejectionHistory[0]) == null ? void 0 : D.rejectedAt) : ""
224
+ n.approvedAt ? new Date(n.approvedAt) : n.rejectionHistory ? new Date((_ = n.rejectionHistory[0]) == null ? void 0 : _.rejectedAt) : ""
225
225
  ],
226
226
  [
227
227
  "Action remark",
228
228
  n.approvedAt ? n.approveRemark : n.rejectionHistory ? new Date((T = n.rejectionHistory[0]) == null ? void 0 : T.rejectRemark) : ""
229
229
  ],
230
230
  [],
231
- F.map((j) => j.name),
232
- ...b.map((j) => F.map((J) => j[J.id]))
233
- ], H = F.map((j) => `system:${j.id}`), I = nt(R, H), l = `[${d == null ? void 0 : d.name}] closing draft (${ot(new Date(n.updatedAt))}).xlsx`;
231
+ F.map((S) => S.name),
232
+ ...b.map((S) => F.map((J) => S[J.id]))
233
+ ], H = F.map((S) => `system:${S.id}`), I = nt(R, H), l = `[${d == null ? void 0 : d.name}] closing draft (${ot(new Date(n.updatedAt))}).xlsx`;
234
234
  return st(I, l), l;
235
235
  }
236
236
  const Ce = Oe(
237
237
  "closingDraftActions",
238
238
  function() {
239
- const r = vt(), e = Re(), i = Ve(), u = je(), b = Ye(), x = O(!1), C = O();
239
+ const r = vt(), e = Re(), i = Ve(), u = Se(), b = Ye(), x = O(!1), C = O();
240
240
  function d(v) {
241
241
  const y = {
242
242
  draft: v
@@ -255,11 +255,11 @@ const Ce = Oe(
255
255
  }), console.error("Closing draft is completed but closing document cannot be found.", {
256
256
  draftId: v._id
257
257
  }), [];
258
- const D = await i.readAdjustmentById(L);
259
- return ((D == null ? void 0 : D.skus) ?? []).map((j) => ({
260
- id: j.sku._id,
261
- balance: j.fromBalance,
262
- costs: j.fromCostBalances
258
+ const _ = await i.readAdjustmentById(L);
259
+ return ((_ == null ? void 0 : _.skus) ?? []).map((S) => ({
260
+ id: S.sku._id,
261
+ balance: S.fromBalance,
262
+ costs: S.fromCostBalances
263
263
  }));
264
264
  } else
265
265
  return await b.readStockBalance(), ((A = b.stockBalance) == null ? void 0 : A.skus) ?? [];
@@ -342,7 +342,7 @@ function we(n) {
342
342
  const $t = Oe(
343
343
  "closingDraftTable",
344
344
  function() {
345
- const { t: r } = Ne(), e = Ce(), i = O(new Array()), u = O(!1), b = Se(), x = je();
345
+ const { t: r } = Ne(), e = Ce(), i = O(new Array()), u = O(!1), b = je(), x = Se();
346
346
  async function C() {
347
347
  if (i.value = [], !!b._currentLocation) {
348
348
  u.value = !0;
@@ -383,9 +383,9 @@ const $t = Oe(
383
383
  }
384
384
  function H(l, p) {
385
385
  switch (p = ct(p), l) {
386
- case _e.Details:
386
+ case De.Details:
387
387
  return e.viewDraft(p);
388
- case _e.Export:
388
+ case De.Export:
389
389
  return e.exportDraft(p);
390
390
  case Z.enum.approveDraft:
391
391
  return e.approveDraft(p, R);
@@ -445,38 +445,38 @@ const $t = Oe(
445
445
  header: () => r("inventory.closing.table.status"),
446
446
  enableSorting: !1,
447
447
  cell(l) {
448
- var D;
449
- const p = l.row.original, v = p.status, y = new Date(p.updatedAt), A = (D = p == null ? void 0 : p.rejectionHistory) == null ? void 0 : D.computeFirst((T) => T.rejectedAt), L = A ? new Date(A) : null;
450
- return v === "DRAFT" && L ? L.getTime() > y.getTime() ? S(
448
+ var _;
449
+ const p = l.row.original, v = p.status, y = new Date(p.updatedAt), A = (_ = p == null ? void 0 : p.rejectionHistory) == null ? void 0 : _.computeFirst((T) => T.rejectedAt), L = A ? new Date(A) : null;
450
+ return v === "DRAFT" && L ? L.getTime() > y.getTime() ? j(
451
451
  "div",
452
452
  {
453
453
  class: "flex"
454
454
  },
455
- S(
455
+ j(
456
456
  "div",
457
457
  {
458
458
  class: ["fm-status-badge", we("FAILED")]
459
459
  },
460
460
  "Rejected"
461
461
  )
462
- ) : S(
462
+ ) : j(
463
463
  "div",
464
464
  {
465
465
  class: "flex"
466
466
  },
467
- S(
467
+ j(
468
468
  "div",
469
469
  {
470
470
  class: ["fm-status-badge", we("PROCESSING")]
471
471
  },
472
472
  "Updated"
473
473
  )
474
- ) : S(
474
+ ) : j(
475
475
  "div",
476
476
  {
477
477
  class: "flex"
478
478
  },
479
- S(
479
+ j(
480
480
  "div",
481
481
  {
482
482
  class: ["fm-status-badge", we(v)]
@@ -490,8 +490,8 @@ const $t = Oe(
490
490
  id: "action",
491
491
  cell(l) {
492
492
  const p = l.row.original, v = [
493
- Pe[_e.Details],
494
- Pe[_e.Export]
493
+ Pe[De.Details],
494
+ Pe[De.Export]
495
495
  ], y = [
496
496
  {
497
497
  translationKey: "inventory.closing.draft.approveDraft",
@@ -565,7 +565,7 @@ const $t = Oe(
565
565
  },
566
566
  emits: ["submitted", "refresh"],
567
567
  setup(n, { emit: r }) {
568
- const e = n, i = Ye(), u = Ce(), b = yt(e, "show"), x = O(!1), C = O(!1), d = O(!1), F = O(new Array()), R = Ve(), H = je(), I = Re(), l = it(), p = Se(), v = We({}), y = E(() => new Set(
568
+ const e = n, i = Ye(), u = Ce(), b = yt(e, "show"), x = O(!1), C = O(!1), d = O(!1), F = O(new Array()), R = Ve(), H = Se(), I = Re(), l = it(), p = je(), v = We({}), y = E(() => new Set(
569
569
  l.skus.filter((a) => {
570
570
  var t;
571
571
  return v[(t = a.customAttributes) == null ? void 0 : t.tag];
@@ -574,7 +574,7 @@ const $t = Oe(
574
574
  var t, s;
575
575
  const a = [...((t = e.draft) == null ? void 0 : t.items) ?? [], ...((s = e.draft) == null ? void 0 : s.negativeStockItems) ?? []];
576
576
  return y.value.size ? a.filter((m) => y.value.has(m.sku._id)) : a;
577
- }), D = E(() => {
577
+ }), _ = E(() => {
578
578
  const a = L.value.map((t) => t.sku);
579
579
  return a.sort((t, s) => t.code.localeCompare(s.code)), a;
580
580
  }), T = E(() => L.value.groupBy(
@@ -587,7 +587,7 @@ const $t = Oe(
587
587
  a && (K.value = ue[0], oe());
588
588
  }
589
589
  );
590
- const j = he(0), J = he(100);
590
+ const S = he(0), J = he(100);
591
591
  async function oe() {
592
592
  var t, s, m;
593
593
  if (!p._currentLocation) return;
@@ -636,16 +636,16 @@ const $t = Oe(
636
636
  return;
637
637
  }
638
638
  C.value = !0;
639
- const t = ($ = e.draft) == null ? void 0 : $.stockSnapshotAt, s = 30, m = 2e3;
639
+ const t = ($ = e.draft) == null ? void 0 : $._rev, s = 30, m = 2e3;
640
640
  try {
641
641
  await R.recalculation.scheduleCalculateStockSnapshotAtDate(
642
642
  a,
643
643
  e.draft._id
644
644
  );
645
645
  let k = null;
646
- for (let B = 0; B < s && (k = await H.getDraft(e.draft._id).delayed(m), k.stockSnapshotAt === t); B++)
646
+ for (let B = 0; B < s && (k = await H.getDraft(e.draft._id).delayed(m), k._rev === t); B++)
647
647
  ;
648
- if (!k || k.stockSnapshotAt === t) {
648
+ if (!k || k._rev === t) {
649
649
  I.open({
650
650
  title: "Refresh failed",
651
651
  message: "Failed to refresh stock balance. Please try again.",
@@ -675,7 +675,7 @@ const $t = Oe(
675
675
  )
676
676
  ), xe = E(() => L.value.groupBy((a) => a.sku._id));
677
677
  function le(a) {
678
- return S(
678
+ return j(
679
679
  fe.FmTooltip,
680
680
  { zIndex: 51, placement: "left", class: "w-full flex justify-end" },
681
681
  {
@@ -689,7 +689,7 @@ const $t = Oe(
689
689
  );
690
690
  }
691
691
  const ve = E(() => {
692
- const a = D.value.reduce((s, m) => {
692
+ const a = _.value.reduce((s, m) => {
693
693
  var c, f;
694
694
  return Math.max(s, ((f = (c = T.value) == null ? void 0 : c.get(m._id)) == null ? void 0 : f[0].length) ?? 0);
695
695
  }, 0);
@@ -700,8 +700,8 @@ const $t = Oe(
700
700
  header: () => "Name",
701
701
  size: 350,
702
702
  cell(s) {
703
- const m = s.row.original, c = m.adjustedDiffPercentage, f = typeof c == "number" && Math.abs(c) > 10, $ = S("div", { class: "flex flex-col gap-4" }, [
704
- S(
703
+ const m = s.row.original, c = m.adjustedDiffPercentage, f = typeof c == "number" && Math.abs(c) > 10, $ = j("div", { class: "flex flex-col gap-4" }, [
704
+ j(
705
705
  "div",
706
706
  {
707
707
  class: [
@@ -711,7 +711,7 @@ const $t = Oe(
711
711
  },
712
712
  m.name
713
713
  ),
714
- S(
714
+ j(
715
715
  "div",
716
716
  {
717
717
  class: [
@@ -722,7 +722,7 @@ const $t = Oe(
722
722
  m.code
723
723
  )
724
724
  ]);
725
- return S(
725
+ return j(
726
726
  fe.FmTooltip,
727
727
  {
728
728
  zIndex: 51
@@ -732,7 +732,7 @@ const $t = Oe(
732
732
  return f ? "Adjustment difference is more than 10%." : `${m.code} - ${m.name}`;
733
733
  },
734
734
  default() {
735
- return S("div", { class: "flex items-center gap-4 justify-start w-full" }, [
735
+ return j("div", { class: "flex items-center gap-4 justify-start w-full" }, [
736
736
  $
737
737
  ]);
738
738
  }
@@ -775,14 +775,14 @@ const $t = Oe(
775
775
  {
776
776
  id: "adjustedDiffPercentage",
777
777
  accessorKey: "adjustedDiffPercentage",
778
- header: () => S(
778
+ header: () => j(
779
779
  fe.FmTooltip,
780
780
  { zIndex: 51, placement: "left", class: "w-full flex justify-end" },
781
781
  {
782
782
  default() {
783
- return S("div", { class: "flex items-center gap-4" }, [
783
+ return j("div", { class: "flex items-center gap-4" }, [
784
784
  "Diff (%)",
785
- S(fe.FmIcon, { name: "info", color: "neutral-gray-400", size: "sm" })
785
+ j(fe.FmIcon, { name: "info", color: "neutral-gray-400", size: "sm" })
786
786
  ]);
787
787
  },
788
788
  content() {
@@ -796,10 +796,10 @@ const $t = Oe(
796
796
  if (!m) return "N/A";
797
797
  const c = m.toFixed(2);
798
798
  if (c === "0.00")
799
- return S("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
799
+ return j("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
800
800
  const f = m > 0;
801
- return S("div", { class: "flex items-center gap-4 justify-end" }, [
802
- S(fe.FmIcon, {
801
+ return j("div", { class: "flex items-center gap-4 justify-end" }, [
802
+ j(fe.FmIcon, {
803
803
  name: f ? "arrow_drop_up" : "arrow_drop_down",
804
804
  color: f ? "system-success-300" : "system-error-300",
805
805
  size: "md"
@@ -816,19 +816,19 @@ const $t = Oe(
816
816
  header: () => "Amounts",
817
817
  enableSorting: !1,
818
818
  cell(s) {
819
- const m = s.row.original, c = ($, k) => S(
819
+ const m = s.row.original, c = ($, k) => j(
820
820
  fe.FmTooltip,
821
821
  { zIndex: 50 },
822
822
  {
823
823
  default() {
824
- return S(
824
+ return j(
825
825
  "div",
826
826
  {
827
827
  class: "fm-typo-en-body-md-400 py-4 px-8 border-1 border-fm-color-typo-secondary fm-corner-radius-md line-clamp-1"
828
828
  },
829
829
  [
830
- S("span", { class: "text-fm-color-typo-primary" }, `${$} `),
831
- S(
830
+ j("span", { class: "text-fm-color-typo-primary" }, `${$} `),
831
+ j(
832
832
  "span",
833
833
  {
834
834
  class: "text-fm-color-typo-secondary",
@@ -850,7 +850,7 @@ const $t = Oe(
850
850
  const B = m[`measurementAmount${k}`], de = m[`measurementAbbrev${k}`];
851
851
  return c(B, de);
852
852
  }).filter(($) => $);
853
- return (m.baseUnitAmount || !f.length) && (f = [c(m.baseUnitAmount, m.baseUnit), ...f]), S(
853
+ return (m.baseUnitAmount || !f.length) && (f = [c(m.baseUnitAmount, m.baseUnit), ...f]), j(
854
854
  "div",
855
855
  {
856
856
  class: "flex gap-8 flex-nowrap",
@@ -863,9 +863,9 @@ const $t = Oe(
863
863
  }
864
864
  }
865
865
  ];
866
- }), ce = E(() => ve.value.map((a) => a.size ?? 0).reduce((a, t) => a + t)), ie = O(""), ye = E(() => D.value.map((a) => {
866
+ }), ce = E(() => ve.value.map((a) => a.size ?? 0).reduce((a, t) => a + t)), ie = O(""), ye = E(() => _.value.map((a) => {
867
867
  var B, de;
868
- const t = (B = xe.value.get(a._id)) == null ? void 0 : B[0], s = ((de = se.value.get(a._id)) == null ? void 0 : de[0]) ?? j;
868
+ const t = (B = xe.value.get(a._id)) == null ? void 0 : B[0], s = ((de = se.value.get(a._id)) == null ? void 0 : de[0]) ?? S;
869
869
  if (!t)
870
870
  return {
871
871
  code: a.code,
@@ -887,8 +887,8 @@ const $t = Oe(
887
887
  baseUnit: a.unit.abbrev,
888
888
  baseUnitAmount: +M(t.baseAmount),
889
889
  ...t.measurementsAmounts.filter((te) => {
890
- var G, re, De;
891
- return (De = (re = (G = T.value) == null ? void 0 : G.get(a._id)) == null ? void 0 : re[0]) == null ? void 0 : De.includes(te.measurement.id);
890
+ var G, re, _e;
891
+ return (_e = (re = (G = T.value) == null ? void 0 : G.get(a._id)) == null ? void 0 : re[0]) == null ? void 0 : _e.includes(te.measurement.id);
892
892
  }).reduce((te, G, re) => (te[`measurementAbbrev${re}`] = `(${G.measurement.abbrev}) × ${M(G.measurement.conversion)}`, te[`measurementAmount${re}`] = +M(G.amount), te), {}),
893
893
  systemBalance: +M(s),
894
894
  physicalBalance: +M(m),
@@ -1000,26 +1000,26 @@ const $t = Oe(
1000
1000
  var c, f, $, k;
1001
1001
  if ((c = e == null ? void 0 : e.draft) != null && c.approvedAt) return "Draft is already approved.";
1002
1002
  if (((f = e.draft) == null ? void 0 : f.status) !== ne.enum.DRAFT) return "Status is not draft.";
1003
- const a = ye.value.some((B) => B.physicalBalance < 0), t = ((k = ($ = i.stockBalance.skus) == null ? void 0 : $.filter((B) => B.balance.amount < 0)) == null ? void 0 : k.map((B) => B.id)) ?? [], s = new Set(D.value.map((B) => B._id)), m = t.filter((B) => !s.has(B)).length;
1003
+ const a = ye.value.some((B) => B.physicalBalance < 0), t = ((k = ($ = i.stockBalance.skus) == null ? void 0 : $.filter((B) => B.balance.amount < 0)) == null ? void 0 : k.map((B) => B.id)) ?? [], s = new Set(_.value.map((B) => B._id)), m = t.filter((B) => !s.has(B)).length;
1004
1004
  return [
1005
1005
  a ? "Negative total exist." : null,
1006
1006
  m ? "Negative stock is not included in this draft. Reopen draft in POS and apply changes." : null
1007
1007
  ].filter((B) => B).join(" ");
1008
1008
  });
1009
1009
  return (a, t) => {
1010
- const s = U("FmButtonGroup"), m = U("FmMenuDivider"), c = U("FmCard"), f = U("FmButton"), $ = U("FmCircularProgress"), k = U("FmTextField"), B = U("FmIcon"), de = U("FmChip"), te = U("FmTable"), G = U("FmSpacer"), re = U("FmTooltip"), De = U("FmSideSheet");
1011
- return h(), W(De, {
1010
+ const s = U("FmButtonGroup"), m = U("FmMenuDivider"), c = U("FmCard"), f = U("FmButton"), $ = U("FmCircularProgress"), k = U("FmTextField"), B = U("FmIcon"), de = U("FmChip"), te = U("FmTable"), G = U("FmSpacer"), re = U("FmTooltip"), _e = U("FmSideSheet");
1011
+ return h(), W(_e, {
1012
1012
  "dismiss-away": "",
1013
1013
  "max-width": 9999,
1014
1014
  "model-value": g(b),
1015
- "onUpdate:modelValue": t[8] || (t[8] = (_) => Ie(b) ? b.value = _ : null),
1015
+ "onUpdate:modelValue": t[8] || (t[8] = (D) => Ie(b) ? b.value = D : null),
1016
1016
  header: "Closing details"
1017
1017
  }, {
1018
1018
  "side-sheet-footer": Y(() => {
1019
- var _, z, V, me;
1019
+ var D, z, V, me;
1020
1020
  return [
1021
1021
  o("div", ua, [
1022
- ((_ = e.draft) == null ? void 0 : _.status) === g(ne).enum.DRAFT ? (h(), P(q, { key: 0 }, [
1022
+ ((D = e.draft) == null ? void 0 : D.status) === g(ne).enum.DRAFT ? (h(), P(q, { key: 0 }, [
1023
1023
  ge.value ? (h(), W(re, {
1024
1024
  key: 0,
1025
1025
  "z-index": 51
@@ -1072,7 +1072,7 @@ const $t = Oe(
1072
1072
  w(s, {
1073
1073
  items: ue,
1074
1074
  modelValue: K.value,
1075
- "onUpdate:modelValue": t[0] || (t[0] = (_) => K.value = _)
1075
+ "onUpdate:modelValue": t[0] || (t[0] = (D) => K.value = D)
1076
1076
  }, null, 8, ["modelValue"])
1077
1077
  ]),
1078
1078
  K.value.value === "overview" ? (h(), P(q, { key: 0 }, [
@@ -1081,13 +1081,13 @@ const $t = Oe(
1081
1081
  class: "flex flex-col gap-8 px-12 py-16"
1082
1082
  }, {
1083
1083
  default: Y(() => {
1084
- var _, z;
1084
+ var D, z;
1085
1085
  return [
1086
1086
  o("div", Tt, [
1087
1087
  t[9] || (t[9] = o("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
1088
1088
  o("div", Pt, [
1089
1089
  o("div", {
1090
- class: pe(["fm-status-badge", g(we)(((_ = a.draft) == null ? void 0 : _.status) ?? "DRAFT")])
1090
+ class: pe(["fm-status-badge", g(we)(((D = a.draft) == null ? void 0 : D.status) ?? "DRAFT")])
1091
1091
  }, N(g(ze)(((z = a.draft) == null ? void 0 : z.status) ?? "")), 3)
1092
1092
  ])
1093
1093
  ]),
@@ -1129,7 +1129,7 @@ const $t = Oe(
1129
1129
  "text-color": "primary",
1130
1130
  "bg-color": "transparent",
1131
1131
  "border-color": "primary",
1132
- onClick: t[1] || (t[1] = (_) => a.draft ? g(u).exportDraft(a.draft, F.value) : null)
1132
+ onClick: t[1] || (t[1] = (D) => a.draft ? g(u).exportDraft(a.draft, F.value) : null)
1133
1133
  })
1134
1134
  ]))
1135
1135
  ]),
@@ -1146,20 +1146,20 @@ const $t = Oe(
1146
1146
  o("div", null, [
1147
1147
  w(k, {
1148
1148
  modelValue: ie.value,
1149
- "onUpdate:modelValue": t[2] || (t[2] = (_) => ie.value = _),
1149
+ "onUpdate:modelValue": t[2] || (t[2] = (D) => ie.value = D),
1150
1150
  placeholder: "Filter items"
1151
1151
  }, null, 8, ["modelValue"])
1152
1152
  ]),
1153
1153
  g(l).skuTags.size ? (h(), P("div", Vt, [
1154
- (h(!0), P(q, null, be(g(l).skuTags.keys(), (_) => (h(), W(de, {
1155
- key: `${_}`,
1156
- label: `${_}`,
1154
+ (h(!0), P(q, null, be(g(l).skuTags.keys(), (D) => (h(), W(de, {
1155
+ key: `${D}`,
1156
+ label: `${D}`,
1157
1157
  selectable: "",
1158
- selected: v[`${_}`],
1159
- onClick: (z) => v[`${_}`] = !v[`${_}`]
1158
+ selected: v[`${D}`],
1159
+ onClick: (z) => v[`${D}`] = !v[`${D}`]
1160
1160
  }, {
1161
1161
  default: Y(() => [
1162
- v[`${_}`] ? (h(), W(B, {
1162
+ v[`${D}`] ? (h(), W(B, {
1163
1163
  key: 0,
1164
1164
  name: "check",
1165
1165
  class: "text-white",
@@ -1169,11 +1169,11 @@ const $t = Oe(
1169
1169
  class: pe([
1170
1170
  "",
1171
1171
  {
1172
- "text-white fm-typo-en-body-md-600": v[`${_}`],
1173
- "text-fm-color-typo-primary fm-typo-en-body-md-400": !v[`${_}`]
1172
+ "text-white fm-typo-en-body-md-600": v[`${D}`],
1173
+ "text-fm-color-typo-primary fm-typo-en-body-md-400": !v[`${D}`]
1174
1174
  }
1175
1175
  ])
1176
- }, N(_), 3)
1176
+ }, N(D), 3)
1177
1177
  ]),
1178
1178
  _: 2
1179
1179
  }, 1032, ["label", "selected", "onClick"]))), 128))
@@ -1194,7 +1194,7 @@ const $t = Oe(
1194
1194
  ], 64)) : ee("", !0),
1195
1195
  K.value.value === "history" ? (h(), P("div", Kt, [
1196
1196
  Q.value.length ? (h(), P("div", Wt, [
1197
- (h(!0), P(q, null, be(Q.value, (_, z) => (h(), P(q, { key: z }, [
1197
+ (h(!0), P(q, null, be(Q.value, (D, z) => (h(), P(q, { key: z }, [
1198
1198
  o("div", Zt, [
1199
1199
  o("div", Jt, [
1200
1200
  o("div", Xt, [
@@ -1222,8 +1222,8 @@ const $t = Oe(
1222
1222
  ])
1223
1223
  ]),
1224
1224
  o("div", ea, [
1225
- o("div", ta, N(_.header), 1),
1226
- o("div", aa, N(_.date), 1)
1225
+ o("div", ta, N(D.header), 1),
1226
+ o("div", aa, N(D.date), 1)
1227
1227
  ])
1228
1228
  ]),
1229
1229
  o("div", na, [
@@ -1247,7 +1247,7 @@ const $t = Oe(
1247
1247
  }, {
1248
1248
  default: Y(() => [
1249
1249
  o("div", la, [
1250
- (h(!0), P(q, null, be(_.info, (V, me) => (h(), P("div", {
1250
+ (h(!0), P(q, null, be(D.info, (V, me) => (h(), P("div", {
1251
1251
  key: me,
1252
1252
  class: "flex flex-col gap-4"
1253
1253
  }, [
@@ -1289,7 +1289,7 @@ const $t = Oe(
1289
1289
  }), ma = { class: "flex-1 flex flex-col gap-8" }, fa = { class: "flex flex-col" }, pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, va = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, ya = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, ga = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, wa = /* @__PURE__ */ Fe({
1290
1290
  __name: "ClosingDraftView",
1291
1291
  setup(n) {
1292
- const { t: r } = Ne(), { viewDraft: e } = Ce(), { viewClosingDraftProps: i, viewClosingDraftShow: u } = bt(Ce()), b = Se(), x = $t(), C = ut(), { breakpoints: d } = gt();
1292
+ const { t: r } = Ne(), { viewDraft: e } = Ce(), { viewClosingDraftProps: i, viewClosingDraftShow: u } = bt(Ce()), b = je(), x = $t(), C = ut(), { breakpoints: d } = gt();
1293
1293
  b.watchLocation(x.fetchDrafts);
1294
1294
  const F = E(() => x.loading), R = O(""), H = E(() => d.value.xs || d.value.sm), I = E(() => H.value ? 10 : 20);
1295
1295
  function l(y) {
@@ -1336,7 +1336,7 @@ const $t = Oe(
1336
1336
  "change-location": "",
1337
1337
  searchable: "",
1338
1338
  search: R.value,
1339
- "onUpdate:search": A[0] || (A[0] = (D) => R.value = D)
1339
+ "onUpdate:search": A[0] || (A[0] = (_) => R.value = _)
1340
1340
  }, null, 8, ["search"]),
1341
1341
  w(L, {
1342
1342
  style: Ue(g(C).tableHeight),
@@ -1344,22 +1344,22 @@ const $t = Oe(
1344
1344
  "row-data": g(x).drafts,
1345
1345
  "search-value": R.value,
1346
1346
  loading: F.value,
1347
- onRowClick: A[1] || (A[1] = (D) => g(e)(D.original)),
1347
+ onRowClick: A[1] || (A[1] = (_) => g(e)(_.original)),
1348
1348
  "page-size": I.value
1349
1349
  }, {
1350
- "list-row": Y((D) => [
1350
+ "list-row": Y((_) => [
1351
1351
  w(ft, {
1352
- row: D,
1352
+ row: _,
1353
1353
  onRowClick: (T) => g(e)(T)
1354
1354
  }, {
1355
1355
  default: Y((T) => {
1356
- var j, J, oe, X, se, xe, le, ve, ce, ie, ye, Ae, ue, K, Q, ge, a, t, s, m;
1356
+ var S, J, oe, X, se, xe, le, ve, ce, ie, ye, Ae, ue, K, Q, ge, a, t, s, m;
1357
1357
  return [
1358
1358
  o("div", ma, [
1359
1359
  o("div", fa, [
1360
1360
  o("div", pa, [
1361
1361
  w(g(ke), {
1362
- render: (oe = (J = (j = T._id) == null ? void 0 : j.column) == null ? void 0 : J.columnDef) == null ? void 0 : oe.cell,
1362
+ render: (oe = (J = (S = T._id) == null ? void 0 : S.column) == null ? void 0 : J.columnDef) == null ? void 0 : oe.cell,
1363
1363
  props: (se = (X = T._id) == null ? void 0 : X.getContext) == null ? void 0 : se.call(X)
1364
1364
  }, null, 8, ["render", "props"])
1365
1365
  ]),
@@ -1370,8 +1370,8 @@ const $t = Oe(
1370
1370
  }, null, 8, ["render", "props"])
1371
1371
  ]),
1372
1372
  o("div", ya, N([
1373
- ...D.original.items.slice(0, 3).map((c) => c.sku.name),
1374
- ...D.original.items.length >= 3 ? [`and ${D.original.items.length - 3} more items`] : []
1373
+ ..._.original.items.slice(0, 3).map((c) => c.sku.name),
1374
+ ..._.original.items.length >= 3 ? [`and ${_.original.items.length - 3} more items`] : []
1375
1375
  ].join(", ")), 1),
1376
1376
  o("div", ga, [
1377
1377
  w(g(ke), {
@@ -1401,9 +1401,9 @@ const $t = Oe(
1401
1401
  (h(), W(Xe, { to: "body" }, [
1402
1402
  w(da, Qe(g(i), {
1403
1403
  show: g(u),
1404
- "onUpdate:show": A[2] || (A[2] = (D) => Ie(u) ? u.value = D : null),
1404
+ "onUpdate:show": A[2] || (A[2] = (_) => Ie(u) ? u.value = _ : null),
1405
1405
  onSubmitted: A[3] || (A[3] = () => (u.value = !1, g(x).fetchDrafts())),
1406
- onRefresh: A[4] || (A[4] = (D) => g(x).updateDraftRef(D))
1406
+ onRefresh: A[4] || (A[4] = (_) => g(x).updateDraftRef(_))
1407
1407
  }), null, 16, ["show"])
1408
1408
  ]))
1409
1409
  ], 64);
@@ -1,9 +1,9 @@
1
1
  import { ref as D, h as F, defineComponent as O, resolveComponent as R, openBlock as T, createElementBlock as I, createElementVNode as _, normalizeClass as Y, createTextVNode as Fe, toDisplayString as C, unref as v, createCommentVNode as K, createVNode as $, withCtx as P, Fragment as H, renderList as J, computed as E, watch as Re, createSlots as Pe, createBlock as V, isRef as je, normalizeStyle as Ye, Teleport as Ge, normalizeProps as Ke, guardReactiveProps as Je, mergeProps as We } from "vue";
2
- import { X as qe, u as le, a9 as Xe, D as Se, h as N, f as Qe, e as Ae, aa as oe, r as Ze, ab as Ee, s as Ue, a as ae, b as et, v as tt, w as Ve, x as nt, y as ot, d as z, E as j, G as st, ac as lt, l as at, C as Ne, A as rt, ad as it, ae as ne, z as ct, _ as mt, B as ut } from "./app-CUTIQqG_.js";
2
+ import { X as qe, u as le, a9 as Xe, D as Se, h as N, f as Qe, e as Ae, aa as oe, r as Ze, ab as Ee, s as Ue, a as ae, b as et, v as tt, w as Ve, x as nt, y as ot, d as z, E as j, G as st, ac as lt, l as at, C as Ne, A as rt, ad as it, ae as ne, z as ct, _ as mt, B as ut } from "./app-DmpPc6HP.js";
3
3
  import { useCoreStore as re, useI18n as B } from "@feedmepos/mf-common";
4
4
  import { useDialogChild as dt, useSnackbar as Z, useDialog as ie, FmButtonVariant as De, components as L, useProxiedModel as pt, useBreakpoints as ft } from "@feedmepos/ui-library";
5
5
  import { defineStore as Be, storeToRefs as Le } from "pinia";
6
- import { u as vt } from "./use-ingredient-select-dialog-ClufUFeU.js";
6
+ import { u as vt } from "./use-ingredient-select-dialog-CrfP3e6M.js";
7
7
  const ee = qe((i, o) => {
8
8
  function s() {
9
9
  var t;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as x, computed as f, ref as h, onMounted as g, openBlock as u, createElementBlock as i, createElementVNode as t, createTextVNode as n, toDisplayString as e, createCommentVNode as d, Fragment as o, renderList as p, normalizeClass as _ } from "vue";
2
2
  import { useRoute as k } from "vue-router";
3
- import { aq as y, ad as w } from "./app-CUTIQqG_.js";
3
+ import { aq as y, ad as w } from "./app-DmpPc6HP.js";
4
4
  const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub-header" }, O = ["src"], P = { style: { "padding-left": "10px" } }, C = { class: "address" }, D = { class: "text-right" }, R = {
5
5
  key: 0,
6
6
  class: "subtitle"
@@ -1,6 +1,6 @@
1
- import { i as T, t as I, an as w, u as R, as as B, aD as H, aE as D, aF as U } from "./app-CUTIQqG_.js";
2
- import { u as z } from "./supplier-C877x7mU.js";
3
- import { P as F } from "./format-unit-display-CqqBiewI.js";
1
+ import { i as T, t as I, an as w, u as R, as as B, aD as H, aE as D, aF as U } from "./app-DmpPc6HP.js";
2
+ import { u as z } from "./supplier-B58dle3W.js";
3
+ import { P as F } from "./format-unit-display-y8ZPuai0.js";
4
4
  import { computed as f, defineComponent as j, mergeModels as q, useModel as x, ref as W, resolveComponent as V, openBlock as S, createElementBlock as N, normalizeStyle as $, createElementVNode as O, createVNode as J, withCtx as K, createBlock as g, createCommentVNode as A, Fragment as Q, renderList as X, unref as M } from "vue";
5
5
  function Y(t, i, a) {
6
6
  var s;