@feedmepos/mf-inventory-portal 1.5.9-dev.3 → 1.5.10

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 (83) hide show
  1. package/dist/{App-D0rEB_hc.js → App-erqZSd0c.js} +4 -4
  2. package/dist/{ApprovalView-WJ0U3xPN.js → ApprovalView-C2CGthqi.js} +7 -7
  3. package/dist/{BindingsDialog-BDj19giE.js → BindingsDialog-Cw6MdCbI.js} +2 -2
  4. package/dist/{BindingsPicker-CFCUtXom.js → BindingsPicker-CcSrxhUo.js} +2 -2
  5. package/dist/{BindingsTable-B6G_a_Xh.js → BindingsTable-C5nMju9L.js} +3 -3
  6. package/dist/{ClosingDraftView-B0Y-eJad.js → ClosingDraftView-C_Loim5S.js} +159 -158
  7. package/dist/{ClosingHistoryView-Ccn6VT7W.js → ClosingHistoryView-7TcMNjKb.js} +5 -5
  8. package/dist/{ClosingTemplateView-DFt1U6N2.js → ClosingTemplateView-PQdTcIFY.js} +14 -14
  9. package/dist/{DefaultView-Bgxhn9_C.js → DefaultView-BIlFmXaB.js} +2 -2
  10. package/dist/{DeliveryOrderPrintPreview-C7YjR-lR.js → DeliveryOrderPrintPreview-BhT1YxRZ.js} +2 -2
  11. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DlhCmX5Q.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DO7xvy5V.js} +2 -2
  12. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CQ-fk1j9.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Bf6RHJdQ.js} +2 -2
  13. package/dist/{FmMultiselectDialog-PP-y-9ll.js → FmMultiselectDialog-B-X6WQXu.js} +1 -1
  14. package/dist/{FmMultiselectDialog-BcbD6L-6.js → FmMultiselectDialog-cXV6Jo4B.js} +2 -2
  15. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang--OJFkfUg.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BHazP1jS.js} +5 -5
  16. package/dist/{ImportView-y-sW6YJk.js → ImportView-B3jO8aU8.js} +6 -6
  17. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CvADA35V.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-GPVWrmed.js} +1 -1
  18. package/dist/{IngredientGroupView-BhF7iLsu.js → IngredientGroupView-BuUoHLDb.js} +5 -5
  19. package/dist/{IngredientsView-CVBBu2JY.js → IngredientsView-Dq_YrtQ5.js} +15 -15
  20. package/dist/{IntegrationExplorerView-DTBg02Bz.js → IntegrationExplorerView-Dh5ZPJK-.js} +5 -5
  21. package/dist/{IntegrationView-Cydrrs74.js → IntegrationView-DWbHZdc4.js} +13 -13
  22. package/dist/{InventoryBindingForm-DKQa7fnN.js → InventoryBindingForm-D-EN8Tpz.js} +1 -1
  23. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-C9LQum08.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CI4hutH2.js} +5 -5
  24. package/dist/{InventoryBindingSummary-DeWzvrhq.js → InventoryBindingSummary-BTagfxn1.js} +1 -1
  25. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BFVNbGxB.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BUBHDMNn.js} +1 -1
  26. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-kHL5pvnT.js → PremiumBadge.vue_vue_type_script_setup_true_lang-D2B20Qv0.js} +1 -1
  27. package/dist/{PublishView-Bw8BGRrk.js → PublishView-CpiWv2n6.js} +3 -3
  28. package/dist/{PurchaseOrderPrintPreview-CZ55EFid.js → PurchaseOrderPrintPreview-Czi5Aip0.js} +2 -2
  29. package/dist/{ReceiveRequestView-C2jIwxqP.js → ReceiveRequestView-BVEU4j9p.js} +25 -25
  30. package/dist/{RecipeView-QFEzo1zV.js → RecipeView-OVmWTAt-.js} +17 -17
  31. package/dist/{SettingsView-xzJr3rcE.js → SettingsView-CMQLojRr.js} +4 -4
  32. package/dist/{StockView-D2oGxb2R.js → StockView-DZeeZlJq.js} +279 -278
  33. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-D_N6p0fJ.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Bf1b1rJK.js} +1 -1
  34. package/dist/{SupplierView-BtqDtx6n.js → SupplierView-BcmkfFvI.js} +12 -12
  35. package/dist/{SurchargeView-CoFwSL5Q.js → SurchargeView-DhcatJUO.js} +6 -6
  36. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-BLLGccT0.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-D6bwhx8Z.js} +2 -2
  37. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-zh4NhAEI.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-4Ti9w_wf.js} +1 -1
  38. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DgZSc_9V.js → TransferDetails.vue_vue_type_script_setup_true_lang-Dw1TIZVj.js} +20 -20
  39. package/dist/{TransferTemplateView-Dl-OyvDb.js → TransferTemplateView-CRPvLRHd.js} +18 -18
  40. package/dist/{UnitCostHistoryView-BIw918FD.js → UnitCostHistoryView-B4pAplGT.js} +4 -4
  41. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-CtGOQmnR.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-D3OGljNP.js} +4 -4
  42. package/dist/{UnitView-B_dLvYDI.js → UnitView-95-cARn9.js} +7 -7
  43. package/dist/{WarehouseView-64cnOkX7.js → WarehouseView-o1FxslRs.js} +5 -5
  44. package/dist/{WastageTemplateView-D5VBwUYy.js → WastageTemplateView-D3hu-bq0.js} +14 -14
  45. package/dist/{app-CNNLRTCj.js → app-BEJm79K1.js} +11 -11
  46. package/dist/app.js +1 -1
  47. package/dist/{closing-template-BctmJnkK.js → closing-template-BotB3jos.js} +1 -1
  48. package/dist/{date2-p0u0cTaX.js → date2-CnEklTL8.js} +1 -1
  49. package/dist/{dayjs.min-DqTkfBNo.js → dayjs.min-CUR65wqq.js} +1 -1
  50. package/dist/{decimal-EZa-WCtE.js → decimal-CV_OL7iL.js} +2 -2
  51. package/dist/{defineDeepModel-DFCv7__x.js → defineDeepModel-D7NJvnaz.js} +1 -1
  52. package/dist/{duplicate-template-PFPE8NVL.js → duplicate-template-DCaAVNSG.js} +1 -1
  53. package/dist/{export-rK4ja3U6.js → export-HmzdllkU.js} +2 -2
  54. package/dist/{feature-C49Rhz57.js → feature-BpZTiO4W.js} +2 -2
  55. package/dist/{format-time-from-id-B9l_ZpVG.js → format-time-from-id-Awu23hHz.js} +1 -1
  56. package/dist/{format-unit-display-B-rCf09w.js → format-unit-display-B2_RGXzk.js} +11 -11
  57. package/dist/{import-export.helper-jBgZqyRF.js → import-export.helper-BuNDvFsc.js} +6 -6
  58. package/dist/{index-C8LCuoJ5.js → index-BBqEhoS9.js} +1 -1
  59. package/dist/{index-DCYuK2RB.js → index-BK75WSFH.js} +3 -3
  60. package/dist/{index-DO8fSF5f.js → index-D_u-AkFp.js} +1 -1
  61. package/dist/{inventory-core-dart.default-GR9b8uej.js → inventory-core-dart.default-D_hfcDPc.js} +1 -1
  62. package/dist/{lz-string-lKMFi5Fy.js → lz-string-K7l_8Og1.js} +1 -1
  63. package/dist/{netsuite-CxsdEdoM.js → netsuite-CPUKn7UQ.js} +2 -2
  64. package/dist/{number-CTtISVh1.js → number-DoYjk_zN.js} +3 -3
  65. package/dist/{predefined-templates-zjPFiMBW.js → predefined-templates-CEDkdeWc.js} +1 -1
  66. package/dist/{purchase-order-template-BX4kVFz2.js → purchase-order-template-ChZyiCwx.js} +1 -1
  67. package/dist/{recalculationUtils-D1e0w69y.js → recalculationUtils-CEkm9-mp.js} +1 -1
  68. package/dist/{rules-DaMQCy7O.js → rules-DDjcQi_O.js} +2 -2
  69. package/dist/{stock-SBDQxjEi.js → stock-Voq2gMuS.js} +1 -1
  70. package/dist/{supplier-B3bRVYvx.js → supplier-DFopX4OU.js} +2 -2
  71. package/dist/{surcharge-CWAUQM24.js → surcharge-CjwbPJQi.js} +1 -1
  72. package/dist/{uom-rules-BxjfqLv1.js → uom-rules-CHnn3ILl.js} +1 -1
  73. package/dist/{use-ingredient-select-dialog-DzxVCjao.js → use-ingredient-select-dialog-DS6__LXy.js} +2 -2
  74. package/dist/{use-inventory-binding-dialog-Dd-ZQEt_.js → use-inventory-binding-dialog-DcJJo3Lr.js} +2 -2
  75. package/dist/{use-template-enabled-locations-BixH3gtL.js → use-template-enabled-locations-BVs_0JOA.js} +2 -2
  76. package/dist/{use-transfer-locations-DCi3j1zt.js → use-transfer-locations-Dzp5fj3Z.js} +2 -2
  77. package/dist/{useHrmPermission-CNOgDieE.js → useHrmPermission-DQQ5MYsL.js} +1 -1
  78. package/dist/{useNavigationMenu-BNwACcDB.js → useNavigationMenu-msCIV-Ux.js} +2 -2
  79. package/dist/{useSseClient-Bj-ZNA8d.js → useSseClient-cer6d2VA.js} +3 -3
  80. package/dist/{vue-i18n-C6mAjZMj.js → vue-i18n-BiedKAFs.js} +518 -518
  81. package/dist/{xlsx-BtQUuMVO.js → xlsx-DGn-BAF9.js} +398 -398
  82. package/dist/{xlsx.util-CH88y-5V.js → xlsx.util-DXnaPoeW.js} +3 -3
  83. package/package.json +4 -4
@@ -2,26 +2,26 @@ import { defineComponent as je, ref as W, computed as M, onMounted as kt, resolv
2
2
  import { u as xn, _ as Dn } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js";
3
3
  import { useCoreStore as Yt, useI18n as Ye } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as Ke, useDialog as An, components as pe, useProxiedModel as Kt, useBreakpoints as Cn } from "@feedmepos/ui-library";
5
- import { m as Sn, u as We, L as oe, w as te, q as Wt, s as Be, M as _e, B as Te, c as $n, a as wt, j as In } from "./app-CNNLRTCj.js";
5
+ import { m as Sn, u as We, L as oe, w as te, q as Wt, s as Be, M as _e, B as Te, c as $n, a as wt, j as In } from "./app-BEJm79K1.js";
6
6
  import { defineStore as qt, storeToRefs as Fn } from "pinia";
7
- import { b as rt, e as Gt, f as Bn, a as Ce } from "./date2-p0u0cTaX.js";
8
- import { R as Tn } from "./rules-DaMQCy7O.js";
9
- import { e as lt, a as ht, t as Qt, c as He, l as Zt, m as Jt, j as Xt, k as en, o as ne } from "./number-CTtISVh1.js";
10
- import { b as jn, d as Mn } from "./xlsx.util-CH88y-5V.js";
11
- import { i as tn, u as nn } from "./uom-rules-BxjfqLv1.js";
12
- import { u as Un, a as Rn } from "./useSseClient-Bj-ZNA8d.js";
13
- import { u as ct } from "./stock-SBDQxjEi.js";
7
+ import { b as rt, e as Gt, f as Bn, a as Ce } from "./date2-CnEklTL8.js";
8
+ import { R as Tn } from "./rules-DDjcQi_O.js";
9
+ import { e as lt, a as ht, t as Qt, c as He, l as Zt, m as Jt, j as Xt, k as en, o as ne } from "./number-DoYjk_zN.js";
10
+ import { b as jn, d as Mn } from "./xlsx.util-DXnaPoeW.js";
11
+ import { i as tn, u as nn } from "./uom-rules-CHnn3ILl.js";
12
+ import { u as Un, a as Rn } from "./useSseClient-cer6d2VA.js";
13
+ import { u as ct } from "./stock-Voq2gMuS.js";
14
14
  import { D as Lt, R as Ne } from "./row-action.enum-DQ9bJ_uv.js";
15
15
  import { c as Pn } from "./component-kqxARxvM.js";
16
- import { f as Vn } from "./format-time-from-id-B9l_ZpVG.js";
17
- import { f as Nn } from "./recalculationUtils-D1e0w69y.js";
18
- import { _ as zn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CQ-fk1j9.js";
16
+ import { f as Vn } from "./format-time-from-id-Awu23hHz.js";
17
+ import { f as Nn } from "./recalculationUtils-CEkm9-mp.js";
18
+ import { _ as zn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Bf6RHJdQ.js";
19
19
  import { _ as En } from "./empty-placeholder-B0QU467o.js";
20
20
  import { F as gt } from "./FmAdminBadge-DjnBAgyv.js";
21
- import { u as Ln } from "./vue-i18n-C6mAjZMj.js";
22
- import { F as On } from "./decimal-EZa-WCtE.js";
23
- import { r as Hn, u as ot, w as Yn } from "./xlsx-BtQUuMVO.js";
24
- import { d as Kn } from "./dayjs.min-DqTkfBNo.js";
21
+ import { u as Ln } from "./vue-i18n-BiedKAFs.js";
22
+ import { F as On } from "./decimal-CV_OL7iL.js";
23
+ import { r as Hn, u as ot, w as Yn } from "./xlsx-DGn-BAF9.js";
24
+ import { d as Kn } from "./dayjs.min-CUR65wqq.js";
25
25
  import { F as Wn } from "./FmDroppableField-J0xUsOTV.js";
26
26
  import { _ as qn } from "./FmConfirmationButton.vue_vue_type_script_setup_true_lang-DLrMEGFR.js";
27
27
  import { _ as Gn, F as at } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
@@ -171,7 +171,7 @@ const qe = Sn((n, l) => {
171
171
  }
172
172
  }
173
173
  return (F, _) => {
174
- const R = Z("FmLabel"), p = Z("FmDatePicker"), v = Z("FmTimePicker"), m = Z("FmTextField"), b = Z("FmButton"), y = Z("FmForm");
174
+ const R = Z("FmLabel"), p = Z("FmDatePicker"), v = Z("FmTimePicker"), d = Z("FmTextField"), b = Z("FmButton"), y = Z("FmForm");
175
175
  return c.value ? (h(), ae(y, {
176
176
  key: 1,
177
177
  onValidationSuccess: E,
@@ -208,7 +208,7 @@ const qe = Sn((n, l) => {
208
208
  }, null, 8, ["modelValue"]),
209
209
  N.value ? (h(), T("div", Xn, " Cannot select future date ")) : K("", !0)
210
210
  ])) : K("", !0),
211
- $(m, {
211
+ $(d, {
212
212
  modelValue: t.value,
213
213
  "onUpdate:modelValue": _[2] || (_[2] = (w) => t.value = w),
214
214
  label: "Remark",
@@ -255,7 +255,7 @@ function oa(n, l, t, s, g, i, r, c) {
255
255
  precision: 0
256
256
  }, R = Number(
257
257
  te.toFormatString({ value: _ })
258
- ), p = g ? Number(te.toFormatString({ value: g })) : 0, v = Number(te.toFormatString({ value: l })), m = Number(te.toFormatString({ value: A })), b = m - v, y = b * F / R, w = m * F / R, Y = v * F / R, q = {};
258
+ ), p = g ? Number(te.toFormatString({ value: g })) : 0, v = Number(te.toFormatString({ value: l })), d = Number(te.toFormatString({ value: A })), b = d - v, y = b * F / R, w = d * F / R, Y = v * F / R, q = {};
259
259
  return r && i && r.forEach((L) => {
260
260
  const I = { amount: 0, precision: 0 }, Q = i[L];
261
261
  if (Q) {
@@ -277,7 +277,7 @@ function oa(n, l, t, s, g, i, r, c) {
277
277
  {}
278
278
  ),
279
279
  systemBalance: v,
280
- physicalBalance: m,
280
+ physicalBalance: d,
281
281
  adjustedAmount: Number(te.toFormatString({ value: f })),
282
282
  adjustedDiffPercentage: N ? Number(
283
283
  te.toFormatString({
@@ -453,7 +453,7 @@ function ia(n, l, t, s = [], g) {
453
453
  E,
454
454
  s
455
455
  );
456
- }), m = sa(p), b = la(m, E, s), y = [
456
+ }), d = sa(p), b = la(d, E, s), y = [
457
457
  ["Business name:", R == null ? void 0 : R.name],
458
458
  ["Business ID:", R == null ? void 0 : R._id],
459
459
  ["Menu version", R == null ? void 0 : R.menuVersion],
@@ -730,7 +730,7 @@ const ca = { class: "flex flex-col" }, ua = {
730
730
  });
731
731
  });
732
732
  }
733
- async function m(b, y) {
733
+ async function d(b, y) {
734
734
  try {
735
735
  t.open({
736
736
  title: "Cloning",
@@ -757,7 +757,7 @@ const ca = { class: "flex flex-col" }, ua = {
757
757
  syncDraft: _,
758
758
  exportDraft: B,
759
759
  refreshBalance: p,
760
- cloneDraft: m,
760
+ cloneDraft: d,
761
761
  viewClosingDraftShow: c,
762
762
  viewClosingDraftProps: x,
763
763
  invalidateDraftCache: v
@@ -799,7 +799,7 @@ const on = qt(
799
799
  try {
800
800
  const [v] = await Promise.all([
801
801
  x.getDraft(p),
802
- new Promise((m) => setTimeout(m, 1e3))
802
+ new Promise((d) => setTimeout(d, 1e3))
803
803
  ]);
804
804
  g.value = B([v]);
805
805
  } catch (v) {
@@ -811,11 +811,11 @@ const on = qt(
811
811
  }
812
812
  function B(p) {
813
813
  const v = Nn(
814
- p.filter((m) => !!m.closingId).map((m) => ({ closingId: m.closingId, draftCreatedAt: new Date(Te(m._id)) }))
814
+ p.filter((d) => !!d.closingId).map((d) => ({ closingId: d.closingId, draftCreatedAt: new Date(Te(d._id)) }))
815
815
  );
816
- return p.map((m) => ({
817
- ...m,
818
- closingIdDisplay: m.closingId ? v.get(m.closingId) ?? null : null
816
+ return p.map((d) => ({
817
+ ...d,
818
+ closingIdDisplay: d.closingId ? v.get(d.closingId) ?? null : null
819
819
  }));
820
820
  }
821
821
  function N(p) {
@@ -827,8 +827,8 @@ const on = qt(
827
827
  }
828
828
  function E(p) {
829
829
  var b, y;
830
- const v = p.items.length + (((b = p.negativeStockItems) == null ? void 0 : b.length) ?? 0), m = (p == null ? void 0 : p.approveRemark) ?? ((y = p == null ? void 0 : p.rejectionHistory) == null ? void 0 : y.computeFirst((w) => w.rejectRemark)) ?? p.remark ?? "";
831
- return { count: v, remark: m };
830
+ const v = p.items.length + (((b = p.negativeStockItems) == null ? void 0 : b.length) ?? 0), d = (p == null ? void 0 : p.approveRemark) ?? ((y = p == null ? void 0 : p.rejectionHistory) == null ? void 0 : y.computeFirst((w) => w.rejectRemark)) ?? p.remark ?? "";
831
+ return { count: v, remark: d };
832
832
  }
833
833
  function F() {
834
834
  s.closeDraftDialog(), A();
@@ -876,8 +876,8 @@ const on = qt(
876
876
  header: () => l("inventory.closing.draft.table.effectiveAt"),
877
877
  cell(p) {
878
878
  const v = p.row.original;
879
- let m = p.getValue();
880
- return m || (m = Te(v._id)), Ce(m);
879
+ let d = p.getValue();
880
+ return d || (d = Te(v._id)), Ce(d);
881
881
  },
882
882
  enableSorting: !0,
883
883
  size: 230
@@ -885,14 +885,14 @@ const on = qt(
885
885
  {
886
886
  id: "description",
887
887
  accessorFn: (p) => {
888
- const { count: v, remark: m } = E(p);
889
- return `${v} ${m}`;
888
+ const { count: v, remark: d } = E(p);
889
+ return `${v} ${d}`;
890
890
  },
891
891
  header: () => l("inventory.closing.draft.table.description"),
892
892
  enableSorting: !0,
893
893
  size: 350,
894
894
  cell(p) {
895
- const { count: v, remark: m } = E(p.row.original), b = (y, w) => k("div", { class: "flex gap-4" }, [
895
+ const { count: v, remark: d } = E(p.row.original), b = (y, w) => k("div", { class: "flex gap-4" }, [
896
896
  k(
897
897
  "span",
898
898
  { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary" },
@@ -909,7 +909,7 @@ const on = qt(
909
909
  ]);
910
910
  return k("div", { class: "flex flex-col gap-2", style: "width: 300px;" }, [
911
911
  b(l("inventory.closing.draft.table.items"), v),
912
- m ? b(l("inventory.closing.draft.table.remark"), m) : null
912
+ d ? b(l("inventory.closing.draft.table.remark"), d) : null
913
913
  ]);
914
914
  }
915
915
  },
@@ -920,8 +920,8 @@ const on = qt(
920
920
  enableSorting: !1,
921
921
  cell(p) {
922
922
  var Y;
923
- const v = p.row.original, m = v.status, b = new Date(v.updatedAt), y = (Y = v == null ? void 0 : v.rejectionHistory) == null ? void 0 : Y.computeFirst((q) => q.rejectedAt), w = y ? new Date(y) : null;
924
- return m === "DRAFT" && w ? w.getTime() > b.getTime() ? k(
923
+ const v = p.row.original, d = v.status, b = new Date(v.updatedAt), y = (Y = v == null ? void 0 : v.rejectionHistory) == null ? void 0 : Y.computeFirst((q) => q.rejectedAt), w = y ? new Date(y) : null;
924
+ return d === "DRAFT" && w ? w.getTime() > b.getTime() ? k(
925
925
  "div",
926
926
  {
927
927
  class: "flex"
@@ -953,9 +953,9 @@ const on = qt(
953
953
  k(
954
954
  "div",
955
955
  {
956
- class: ["fm-status-badge", st(m)]
956
+ class: ["fm-status-badge", st(d)]
957
957
  },
958
- Be(m)
958
+ Be(d)
959
959
  )
960
960
  );
961
961
  }
@@ -967,13 +967,13 @@ const on = qt(
967
967
  enableSorting: !0,
968
968
  size: 200,
969
969
  cell(p) {
970
- var m;
970
+ var d;
971
971
  const v = p.row.original;
972
972
  return k("div", { class: "flex flex-col" }, [
973
973
  k(
974
974
  "div",
975
975
  { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" },
976
- ((m = v.updatedBy) == null ? void 0 : m.name) ?? ""
976
+ ((d = v.updatedBy) == null ? void 0 : d.name) ?? ""
977
977
  ),
978
978
  k(
979
979
  "div",
@@ -987,7 +987,7 @@ const on = qt(
987
987
  id: "action",
988
988
  cell(p) {
989
989
  var Y;
990
- const v = p.row.original, m = ((Y = t.sessionUser.value) == null ? void 0 : Y.role.isAdmin) ?? !1, b = [
990
+ const v = p.row.original, d = ((Y = t.sessionUser.value) == null ? void 0 : Y.role.isAdmin) ?? !1, b = [
991
991
  Lt[Ne.Details],
992
992
  Lt[Ne.Export]
993
993
  ], y = [
@@ -1006,7 +1006,7 @@ const on = qt(
1006
1006
  color: "text-fm-color-typo-error",
1007
1007
  value: oe.enum.markAsFailed
1008
1008
  }
1009
- ], w = m && v.status !== _e.enum.DRAFT ? [
1009
+ ], w = d && v.status !== _e.enum.DRAFT ? [
1010
1010
  {
1011
1011
  translationKey: "inventory.closing.draft.cloneDraft",
1012
1012
  color: "text-fm-color-typo-primary",
@@ -1099,18 +1099,18 @@ const on = qt(
1099
1099
  get: () => x.show,
1100
1100
  set: (P) => A("update:show", P)
1101
1101
  }), _ = W(1), R = () => _.value > 1, p = () => _.value > 2, v = () => !1;
1102
- function m(P) {
1102
+ function d(P) {
1103
1103
  return P === 1 ? f.value : P === 2 ? E.value.length == 0 : !1;
1104
1104
  }
1105
1105
  const b = M(() => !f.value || E.value.length > 0);
1106
1106
  function y(P) {
1107
1107
  let S = P + 1;
1108
- for (; S <= 3 && m(S); ) S++;
1108
+ for (; S <= 3 && d(S); ) S++;
1109
1109
  return S > 3 ? 3 : S;
1110
1110
  }
1111
1111
  function w(P) {
1112
1112
  let S = P - 1;
1113
- for (; S >= 1 && m(S); ) S--;
1113
+ for (; S >= 1 && d(S); ) S--;
1114
1114
  return S < 1 ? 1 : S;
1115
1115
  }
1116
1116
  function Y() {
@@ -1279,14 +1279,14 @@ function Fa(n) {
1279
1279
  let c = !1, x = null, A = !1, f = !1;
1280
1280
  function B() {
1281
1281
  R();
1282
- const m = n.closingDraftId.value, b = n.currentRev.value;
1283
- if (!m || !b)
1282
+ const d = n.closingDraftId.value, b = n.currentRev.value;
1283
+ if (!d || !b)
1284
1284
  return;
1285
1285
  c = !1;
1286
1286
  const y = {
1287
1287
  type: "closing-draft",
1288
1288
  params: {
1289
- draftId: m,
1289
+ draftId: d,
1290
1290
  locationId: l.getDbName(),
1291
1291
  closingDraftRevision: b
1292
1292
  }
@@ -1300,40 +1300,41 @@ function Fa(n) {
1300
1300
  function N() {
1301
1301
  f = !0, B();
1302
1302
  }
1303
- async function E(m) {
1304
- var b;
1305
- if (c || !m) {
1306
- r.value = m, i.value = !1;
1303
+ async function E(d) {
1304
+ var y;
1305
+ if (c || !d) {
1306
+ r.value = d, i.value = !1;
1307
1307
  return;
1308
1308
  }
1309
- if (!(m.closingDraftId && m.closingDraftId !== n.closingDraftId.value)) {
1310
- if (r.value = m, m.message === "processing" || !m.completedAt && !m.message) {
1311
- A = !0, i.value = !0;
1312
- return;
1313
- }
1314
- if (m.message === "completed" || m.completedAt) {
1315
- if (!A) {
1316
- i.value = !1;
1317
- return;
1318
- }
1319
- A = !1, await F();
1309
+ if (d.closingDraftId && d.closingDraftId !== n.closingDraftId.value)
1310
+ return;
1311
+ if (r.value = d, d.message === "processing" || !d.completedAt && !d.message) {
1312
+ A = !0, i.value = !0;
1313
+ return;
1314
+ }
1315
+ if (d.message === "completed" || d.completedAt) {
1316
+ if (!A) {
1317
+ i.value = !1;
1320
1318
  return;
1321
1319
  }
1322
- A = !1, i.value = !1, s.open({
1323
- title: g("inventory.common.refreshFailed"),
1324
- message: g("inventory.stock.stock_balance.refreshBalanceError"),
1325
- type: "error"
1326
- }), (b = n.onError) == null || b.call(n, m.message ?? "Unknown error");
1320
+ A = !1, await F();
1321
+ return;
1327
1322
  }
1323
+ const b = A;
1324
+ A = !1, i.value = !1, b && (console.log("Closing draft balance refresh error:", d), s.open({
1325
+ title: g("inventory.common.refreshFailed"),
1326
+ message: g("inventory.stock.stock_balance.refreshBalanceError"),
1327
+ type: "error"
1328
+ }), (y = n.onError) == null || y.call(n, d.message ?? "Unknown error"));
1328
1329
  }
1329
1330
  async function F() {
1330
- const m = n.closingDraftId.value;
1331
- if (!m) {
1331
+ const d = n.closingDraftId.value;
1332
+ if (!d) {
1332
1333
  i.value = !1;
1333
1334
  return;
1334
1335
  }
1335
1336
  try {
1336
- const b = await l.getDraft(m);
1337
+ const b = await l.getDraft(d);
1337
1338
  i.value = !1, n.onCompleted(b), s.open({
1338
1339
  title: "Balance refreshed",
1339
1340
  message: "Stock balance has been recalculated.",
@@ -1347,7 +1348,7 @@ function Fa(n) {
1347
1348
  });
1348
1349
  }
1349
1350
  }
1350
- async function _(m) {
1351
+ async function _(d) {
1351
1352
  if (!(!n.closingDraftId.value || i.value || A)) {
1352
1353
  i.value = !0, A = !0, r.value = {
1353
1354
  requestId: "",
@@ -1357,7 +1358,7 @@ function Fa(n) {
1357
1358
  startedAt: (/* @__PURE__ */ new Date()).toISOString()
1358
1359
  };
1359
1360
  try {
1360
- await l.initializeStockSnapshot(n.closingDraftId.value, m);
1361
+ await l.initializeStockSnapshot(n.closingDraftId.value, d);
1361
1362
  } catch (b) {
1362
1363
  A = !1, i.value = !1, s.open({
1363
1364
  title: g("inventory.common.refreshFailed"),
@@ -1378,8 +1379,8 @@ function Fa(n) {
1378
1379
  }
1379
1380
  return ze(
1380
1381
  [n.closingDraftId, n.currentRev],
1381
- ([m, b], [y, w]) => {
1382
- f && (m === y && b === w || B());
1382
+ ([d, b], [y, w]) => {
1383
+ f && (d === y && b === w || B());
1383
1384
  }
1384
1385
  ), hn(() => {
1385
1386
  v();
@@ -1443,13 +1444,13 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1443
1444
  return a === "MYR" ? "RM" : a;
1444
1445
  }), g = on(), i = M(() => {
1445
1446
  var a, e;
1446
- return (a = t.draft) != null && a.closingId ? ((e = g.drafts.find((d) => d._id === t.draft._id)) == null ? void 0 : e.closingIdDisplay) ?? null : null;
1447
+ return (a = t.draft) != null && a.closingId ? ((e = g.drafts.find((m) => m._id === t.draft._id)) == null ? void 0 : e.closingIdDisplay) ?? null : null;
1447
1448
  }), r = it(), c = Kt(t, "show"), x = W(!1), A = W(!1), f = W(new Array()), B = W(new Array()), N = W([]), E = ct(), F = Ke(), _ = wt(), R = We(), p = Et({}), v = M(() => new Set(
1448
1449
  _.skus.filter((a) => {
1449
1450
  var e;
1450
1451
  return p[(e = a.customAttributes) == null ? void 0 : e.tag];
1451
1452
  }).map((a) => a._id)
1452
- )), m = l, b = M(() => {
1453
+ )), d = l, b = M(() => {
1453
1454
  var a;
1454
1455
  return (a = t.draft) == null ? void 0 : a._id;
1455
1456
  }), y = M(() => {
@@ -1464,7 +1465,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1464
1465
  closingDraftId: b,
1465
1466
  currentRev: y,
1466
1467
  onCompleted: (a) => {
1467
- m("refresh", a), f.value = a.stockSnapshot ?? [], c.value = !1;
1468
+ d("refresh", a), f.value = a.stockSnapshot ?? [], c.value = !1;
1468
1469
  }
1469
1470
  }), z = W({
1470
1471
  templateItem: !0,
@@ -1511,12 +1512,12 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1511
1512
  );
1512
1513
  }
1513
1514
  const Q = M(() => {
1514
- var e, d;
1515
- const a = [...((e = t.draft) == null ? void 0 : e.items) ?? [], ...((d = t.draft) == null ? void 0 : d.negativeStockItems) ?? []];
1515
+ var e, m;
1516
+ const a = [...((e = t.draft) == null ? void 0 : e.items) ?? [], ...((m = t.draft) == null ? void 0 : m.negativeStockItems) ?? []];
1516
1517
  return v.value.size ? a.filter((j) => v.value.has(j.sku._id)) : a;
1517
1518
  }), se = M(() => {
1518
1519
  const a = Q.value.map((e) => e.sku);
1519
- return a.sort((e, d) => e.code.localeCompare(d.code)), a;
1520
+ return a.sort((e, m) => e.code.localeCompare(m.code)), a;
1520
1521
  }), we = nn();
1521
1522
  kt(Ee), ze(
1522
1523
  () => t.show,
@@ -1534,7 +1535,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1534
1535
  );
1535
1536
  const xe = M(() => Qe.value.reduce((a, e) => a + Number(e.stockTakeValue), 0)), De = He(0), $e = He(100);
1536
1537
  async function Ee() {
1537
- var e, d, j, D;
1538
+ var e, m, j, D;
1538
1539
  if (!R._currentLocation) return;
1539
1540
  x.value = !0;
1540
1541
  const a = ((e = t.draft) == null ? void 0 : e.status) === _e.enum.COMPLETED;
@@ -1548,7 +1549,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1548
1549
  message: "Closing draft is completed but closing document cannot be found.",
1549
1550
  type: "error"
1550
1551
  }), console.error("Closing draft is completed but closing document cannot be found.", {
1551
- draftId: (d = t.draft) == null ? void 0 : d._id
1552
+ draftId: (m = t.draft) == null ? void 0 : m._id
1552
1553
  });
1553
1554
  return;
1554
1555
  }
@@ -1590,10 +1591,10 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1590
1591
  }
1591
1592
  }
1592
1593
  async function Le() {
1593
- var e, d;
1594
+ var e, m;
1594
1595
  if (w.value)
1595
1596
  return;
1596
- if (!(((e = t.draft) == null ? void 0 : e.effectiveAt) ?? (t.draft ? Te((d = t.draft) == null ? void 0 : d._id) : null))) {
1597
+ if (!(((e = t.draft) == null ? void 0 : e.effectiveAt) ?? (t.draft ? Te((m = t.draft) == null ? void 0 : m._id) : null))) {
1597
1598
  F.open({
1598
1599
  title: "Cannot refresh",
1599
1600
  message: "Effective date is not available for this draft.",
@@ -1611,8 +1612,8 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1611
1612
  );
1612
1613
  }
1613
1614
  async function Me() {
1614
- var e, d;
1615
- if (!(((e = t.draft) == null ? void 0 : e.effectiveAt) ?? (t.draft ? Te((d = t.draft) == null ? void 0 : d._id) : null))) {
1615
+ var e, m;
1616
+ if (!(((e = t.draft) == null ? void 0 : e.effectiveAt) ?? (t.draft ? Te((m = t.draft) == null ? void 0 : m._id) : null))) {
1616
1617
  F.open({
1617
1618
  title: "Cannot refresh",
1618
1619
  message: "Effective date is not available for this draft.",
@@ -1655,7 +1656,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1655
1656
  header: () => "Name",
1656
1657
  size: 350,
1657
1658
  cell(e) {
1658
- const d = e.row.original, j = d.adjustedDiffPercentage, D = typeof j == "number" && Math.abs(j) > 10, V = k("div", { class: "flex flex-col gap-4" }, [
1659
+ const m = e.row.original, j = m.adjustedDiffPercentage, D = typeof j == "number" && Math.abs(j) > 10, V = k("div", { class: "flex flex-col gap-4" }, [
1659
1660
  k(
1660
1661
  "div",
1661
1662
  {
@@ -1664,7 +1665,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1664
1665
  D ? " text-fm-color-system-error-300" : "text-fm-color-typo-primary"
1665
1666
  ]
1666
1667
  },
1667
- d.name
1668
+ m.name
1668
1669
  ),
1669
1670
  k(
1670
1671
  "div",
@@ -1674,7 +1675,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1674
1675
  D ? " text-fm-color-system-error-300" : "text-fm-color-typo-secondary"
1675
1676
  ]
1676
1677
  },
1677
- d.code
1678
+ m.code
1678
1679
  )
1679
1680
  ]);
1680
1681
  return k(
@@ -1684,7 +1685,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1684
1685
  },
1685
1686
  {
1686
1687
  content() {
1687
- return D ? "Adjustment difference is more than 10%." : `${d.code} - ${d.name}`;
1688
+ return D ? "Adjustment difference is more than 10%." : `${m.code} - ${m.name}`;
1688
1689
  },
1689
1690
  default() {
1690
1691
  return k("div", { class: "flex items-center gap-4 justify-start w-full" }, [
@@ -1699,11 +1700,11 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1699
1700
  ...Ct.value.map(
1700
1701
  (e) => ({
1701
1702
  id: `customAttr_${e}`,
1702
- accessorFn: (d) => d.customAttributeValues[e],
1703
+ accessorFn: (m) => m.customAttributeValues[e],
1703
1704
  header: () => ye(Be(e)),
1704
1705
  size: 160,
1705
- cell(d) {
1706
- const j = d.row.original.customAttributeValues[e];
1706
+ cell(m) {
1707
+ const j = m.row.original.customAttributeValues[e];
1707
1708
  return j == null ? "N/A" : typeof j == "number" ? k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(j)) : k("div", { class: "text-right fm-typo-en-body-lg-400" }, String(j));
1708
1709
  },
1709
1710
  meta: {
@@ -1717,8 +1718,8 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1717
1718
  header: () => ye("Cost per unit"),
1718
1719
  size: 160,
1719
1720
  cell(e) {
1720
- const d = e.row.original.costPerUnit;
1721
- return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(d));
1721
+ const m = e.row.original.costPerUnit;
1722
+ return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(m));
1722
1723
  },
1723
1724
  meta: {
1724
1725
  textAlign: "right"
@@ -1730,9 +1731,9 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1730
1731
  size: 120,
1731
1732
  cell(e) {
1732
1733
  var C;
1733
- const d = e.row.original, j = d.costUnit, D = d.baseUnit, V = j ?? D;
1734
+ const m = e.row.original, j = m.costUnit, D = m.baseUnit, V = j ?? D;
1734
1735
  if (j && j !== D) {
1735
- const J = se.value.find((G) => G._id === d.id), O = (C = J == null ? void 0 : J.defaultCost) == null ? void 0 : C.measurement;
1736
+ const J = se.value.find((G) => G._id === m.id), O = (C = J == null ? void 0 : J.defaultCost) == null ? void 0 : C.measurement;
1736
1737
  if (O) {
1737
1738
  const G = O.conversion.amount / Math.pow(10, O.conversion.precision);
1738
1739
  return k("div", { class: "flex flex-col" }, [
@@ -1759,8 +1760,8 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1759
1760
  header: () => ye("Opening (B/F)", "The opening balance brought forward from previous period."),
1760
1761
  size: 150,
1761
1762
  cell(e) {
1762
- const d = e.row.original.opening;
1763
- return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(d));
1763
+ const m = e.row.original.opening;
1764
+ return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(m));
1764
1765
  },
1765
1766
  meta: {
1766
1767
  textAlign: "right"
@@ -1770,11 +1771,11 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1770
1771
  ...N.value.map(
1771
1772
  (e) => ({
1772
1773
  id: `adjustment_${e}`,
1773
- accessorFn: (d) => d.adjustmentAmounts[e] ?? { amount: 0, precision: 0 },
1774
+ accessorFn: (m) => m.adjustmentAmounts[e] ?? { amount: 0, precision: 0 },
1774
1775
  header: () => ye(Be(e)),
1775
1776
  size: 150,
1776
- cell(d) {
1777
- const j = d.row.original.adjustmentAmounts[e] ?? { amount: 0, precision: 0 };
1777
+ cell(m) {
1778
+ const j = m.row.original.adjustmentAmounts[e] ?? { amount: 0, precision: 0 };
1778
1779
  return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(j));
1779
1780
  },
1780
1781
  meta: {
@@ -1788,8 +1789,8 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1788
1789
  header: () => ye("System Balance", "The system calculated balance before stock take."),
1789
1790
  size: 200,
1790
1791
  cell(e) {
1791
- const d = e.row.original.systemBalance;
1792
- return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(d));
1792
+ const m = e.row.original.systemBalance;
1793
+ return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(m));
1793
1794
  },
1794
1795
  meta: {
1795
1796
  textAlign: "right"
@@ -1799,17 +1800,17 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1799
1800
  id: "physicalBalance",
1800
1801
  accessorFn: (e) => {
1801
1802
  var j;
1802
- const d = (j = B.value.find((D) => D.id === e.id)) == null ? void 0 : j.balance;
1803
- return d ? On.toDouble(d) : e.physicalBalance;
1803
+ const m = (j = B.value.find((D) => D.id === e.id)) == null ? void 0 : j.balance;
1804
+ return m ? On.toDouble(m) : e.physicalBalance;
1804
1805
  },
1805
1806
  header: () => ye("Stock Take balance", "The physical balance recorded during stock take."),
1806
1807
  cell(e) {
1807
1808
  var O;
1808
- const d = e.row.original, j = te.fromNumber(d.physicalBalance);
1809
+ const m = e.row.original, j = te.fromNumber(m.physicalBalance);
1809
1810
  let D = !0;
1810
- const V = (O = B.value.find((G) => G.id === d.id)) == null ? void 0 : O.balance;
1811
+ const V = (O = B.value.find((G) => G.id === m.id)) == null ? void 0 : O.balance;
1811
1812
  let C;
1812
- V && !te.equals({ a: j, b: V }) ? (D = !1, C = ne(V)) : C = ne(d.physicalBalance);
1813
+ V && !te.equals({ a: j, b: V }) ? (D = !1, C = ne(V)) : C = ne(m.physicalBalance);
1813
1814
  const J = k("div", { class: "flex flex-col items-end" }, [
1814
1815
  k(
1815
1816
  "span",
@@ -1819,16 +1820,16 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1819
1820
  D ? null : k(
1820
1821
  "span",
1821
1822
  { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1822
- `Draft: ${ne(d.physicalBalance)}`
1823
+ `Draft: ${ne(m.physicalBalance)}`
1823
1824
  )
1824
1825
  ]);
1825
- return d.breakdown.length ? k(
1826
+ return m.breakdown.length ? k(
1826
1827
  pe.FmPopover,
1827
1828
  {
1828
- showPopover: le.value === d.id,
1829
+ showPopover: le.value === m.id,
1829
1830
  placement: "bottom-end",
1830
1831
  zIndex: 9999,
1831
- "onPopover-changed": (G) => P(d.id, G)
1832
+ "onPopover-changed": (G) => P(m.id, G)
1832
1833
  },
1833
1834
  {
1834
1835
  "popover-button": () => k(
@@ -1842,7 +1843,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1842
1843
  k(pe.FmIcon, { name: "info", size: "sm", outline: !0 })
1843
1844
  ]
1844
1845
  ),
1845
- default: () => I(d)
1846
+ default: () => I(m)
1846
1847
  }
1847
1848
  ) : J;
1848
1849
  },
@@ -1857,8 +1858,8 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1857
1858
  header: () => ye("Variance", "The difference between Stock Take balance and System Balance."),
1858
1859
  size: 200,
1859
1860
  cell(e) {
1860
- const d = e.row.original.adjustedAmount;
1861
- return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(d));
1861
+ const m = e.row.original.adjustedAmount;
1862
+ return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(m));
1862
1863
  },
1863
1864
  meta: {
1864
1865
  textAlign: "right"
@@ -1870,8 +1871,8 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1870
1871
  header: () => ye(`Variance (${s.value})`),
1871
1872
  size: 150,
1872
1873
  cell(e) {
1873
- const d = e.row.original.varianceInCost;
1874
- return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(d));
1874
+ const m = e.row.original.varianceInCost;
1875
+ return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(m));
1875
1876
  },
1876
1877
  meta: {
1877
1878
  textAlign: "right"
@@ -1886,19 +1887,19 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1886
1887
  ),
1887
1888
  size: 200,
1888
1889
  cell(e) {
1889
- const d = e.row.original.adjustedDiffPercentage;
1890
- if (d == null)
1890
+ const m = e.row.original.adjustedDiffPercentage;
1891
+ if (m == null)
1891
1892
  return k(
1892
1893
  "div",
1893
1894
  { class: "flex items-center gap-4 justify-end fm-typo-en-body-lg-400" },
1894
1895
  Ot
1895
1896
  );
1896
- const j = ne(d);
1897
- if (d === 0)
1897
+ const j = ne(m);
1898
+ if (m === 0)
1898
1899
  return k("div", { class: "flex items-center gap-4 justify-end fm-typo-en-body-lg-400" }, [
1899
1900
  ne(0)
1900
1901
  ]);
1901
- const D = d > 0;
1902
+ const D = m > 0;
1902
1903
  return k("div", { class: "flex items-center gap-4 justify-end fm-typo-en-body-lg-400" }, [
1903
1904
  k(pe.FmIcon, {
1904
1905
  name: D ? "arrow_drop_up" : "arrow_drop_down",
@@ -1919,9 +1920,9 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1919
1920
  size: 180,
1920
1921
  cell(e) {
1921
1922
  var O;
1922
- const d = e.row.original, j = d.stockTakeValue, D = se.value.find((G) => G._id === d.id), V = (O = D == null ? void 0 : D.defaultCost) == null ? void 0 : O.measurement, C = d.physicalBalance, J = d.costPerUnit;
1923
+ const m = e.row.original, j = m.stockTakeValue, D = se.value.find((G) => G._id === m.id), V = (O = D == null ? void 0 : D.defaultCost) == null ? void 0 : O.measurement, C = m.physicalBalance, J = m.costPerUnit;
1923
1924
  if (V) {
1924
- const G = te.toFormatString({ value: V.conversion }), me = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${d.baseUnit} ÷ ${G} × ${J} ${s.value}`;
1925
+ const G = te.toFormatString({ value: V.conversion }), me = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${m.baseUnit} ÷ ${G} × ${J} ${s.value}`;
1925
1926
  return k(
1926
1927
  pe.FmTooltip,
1927
1928
  { zIndex: 51 },
@@ -1939,7 +1940,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1939
1940
  }
1940
1941
  );
1941
1942
  } else {
1942
- const G = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${d.baseUnit} × ${J} ${s.value}`;
1943
+ const G = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${m.baseUnit} × ${J} ${s.value}`;
1943
1944
  return k(
1944
1945
  pe.FmTooltip,
1945
1946
  { zIndex: 51 },
@@ -1969,9 +1970,9 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1969
1970
  size: 180,
1970
1971
  cell(e) {
1971
1972
  var O;
1972
- const d = e.row.original, j = d.systemValue, D = se.value.find((G) => G._id === d.id), V = (O = D == null ? void 0 : D.defaultCost) == null ? void 0 : O.measurement, C = d.systemBalance, J = d.costPerUnit;
1973
+ const m = e.row.original, j = m.systemValue, D = se.value.find((G) => G._id === m.id), V = (O = D == null ? void 0 : D.defaultCost) == null ? void 0 : O.measurement, C = m.systemBalance, J = m.costPerUnit;
1973
1974
  if (V) {
1974
- const G = te.toFormatString({ value: V.conversion }), me = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${d.baseUnit} ÷ ${G} × ${J} ${s.value}`;
1975
+ const G = te.toFormatString({ value: V.conversion }), me = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${m.baseUnit} ÷ ${G} × ${J} ${s.value}`;
1975
1976
  return k(
1976
1977
  pe.FmTooltip,
1977
1978
  { zIndex: 51 },
@@ -1989,7 +1990,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
1989
1990
  }
1990
1991
  );
1991
1992
  } else {
1992
- const G = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${d.baseUnit} × ${J} ${s.value}`;
1993
+ const G = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${m.baseUnit} × ${J} ${s.value}`;
1993
1994
  return k(
1994
1995
  pe.FmTooltip,
1995
1996
  { zIndex: 51 },
@@ -2017,7 +2018,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
2017
2018
  header: () => "Amounts",
2018
2019
  enableSorting: !1,
2019
2020
  cell(e) {
2020
- const d = e.row.original, j = (C, J, O = "normal") => k(
2021
+ const m = e.row.original, j = (C, J, O = "normal") => k(
2021
2022
  pe.FmTooltip,
2022
2023
  { zIndex: 50 },
2023
2024
  {
@@ -2047,7 +2048,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
2047
2048
  return O === "orphan" ? `${C} ${J} (invalid UOM — not on SKU)` : O === "inactive" ? `${C} ${J} (NetSuite-inactive UOM)` : `${C} ${J}`;
2048
2049
  }
2049
2050
  }
2050
- ), D = d.measurements.filter((C) => !!C.amount).map((C) => j(C.amount, C.abbrev, C.variant)), V = d.baseUnitAmount || !D.length ? [j(d.baseUnitAmount, d.baseUnit), ...D] : D;
2051
+ ), D = m.measurements.filter((C) => !!C.amount).map((C) => j(C.amount, C.abbrev, C.variant)), V = m.baseUnitAmount || !D.length ? [j(m.baseUnitAmount, m.baseUnit), ...D] : D;
2051
2052
  return k(
2052
2053
  "div",
2053
2054
  {
@@ -2059,8 +2060,8 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
2059
2060
  }
2060
2061
  }
2061
2062
  ]), ln = M(() => xt.value.map((a) => a.size ?? 0).reduce((a, e) => a + e)), dt = W(""), cn = M(() => {
2062
- var d, j;
2063
- const a = ((j = (d = t.draft) == null ? void 0 : d.negativeStockItems) == null ? void 0 : j.reduce(
2063
+ var m, j;
2064
+ const a = ((j = (m = t.draft) == null ? void 0 : m.negativeStockItems) == null ? void 0 : j.reduce(
2064
2065
  (D, V) => (D[V.sku._id] = V, D),
2065
2066
  {}
2066
2067
  )) ?? {}, e = new Map(
@@ -2185,13 +2186,13 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
2185
2186
  const a = /* @__PURE__ */ new Set();
2186
2187
  for (const e of se.value)
2187
2188
  if (e.customAttributes)
2188
- for (const d of Object.keys(e.customAttributes))
2189
- d !== "tag" && a.add(d);
2189
+ for (const m of Object.keys(e.customAttributes))
2190
+ m !== "tag" && a.add(m);
2190
2191
  return Array.from(a).sort();
2191
2192
  }), Ze = Et({}), Ct = M(
2192
2193
  () => mt.value.filter((a) => Ze[a])
2193
2194
  ), dn = M(() => {
2194
- var e, d, j, D, V;
2195
+ var e, m, j, D, V;
2195
2196
  if (!t.draft) return [];
2196
2197
  const a = t.draft.approvedAt ? {
2197
2198
  action: `Approve at ${Ce(t.draft.approvedAt)}`,
@@ -2211,7 +2212,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
2211
2212
  } : null,
2212
2213
  {
2213
2214
  label: "Location",
2214
- value: ((d = R._currentLocation) == null ? void 0 : d.name) ?? Ot
2215
+ value: ((m = R._currentLocation) == null ? void 0 : m.name) ?? Ot
2215
2216
  },
2216
2217
  {
2217
2218
  label: "Created at",
@@ -2309,7 +2310,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
2309
2310
  t.draft && (Xe.value = !0, r.approveDraft(
2310
2311
  t.draft,
2311
2312
  () => {
2312
- Xe.value = !1, Je.value = !1, m("submitted");
2313
+ Xe.value = !1, Je.value = !1, d("submitted");
2313
2314
  },
2314
2315
  () => {
2315
2316
  Xe.value = !1;
@@ -2317,7 +2318,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
2317
2318
  ));
2318
2319
  }
2319
2320
  return (a, e) => {
2320
- const d = Z("FmButtonGroup"), j = Z("FmMenuDivider"), D = Z("FmCard"), V = Z("FmIcon"), C = Z("FmButton"), J = Z("FmCircularProgress"), O = Z("FmChip"), G = Z("FmTextField"), me = Z("FmTable"), Ae = Z("FmSpacer"), ge = Z("FmTooltip"), Ie = Z("FmSideSheet");
2321
+ const m = Z("FmButtonGroup"), j = Z("FmMenuDivider"), D = Z("FmCard"), V = Z("FmIcon"), C = Z("FmButton"), J = Z("FmCircularProgress"), O = Z("FmChip"), G = Z("FmTextField"), me = Z("FmTable"), Ae = Z("FmSpacer"), ge = Z("FmTooltip"), Ie = Z("FmSideSheet");
2321
2322
  return h(), T(ce, null, [
2322
2323
  $(Ie, {
2323
2324
  "dismiss-away": "",
@@ -2358,7 +2359,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
2358
2359
  key: 1,
2359
2360
  label: "Reject",
2360
2361
  variant: "destructive",
2361
- onClick: e[6] || (e[6] = () => t.draft && u(r).rejectDraft(t.draft, () => m("submitted")))
2362
+ onClick: e[6] || (e[6] = () => t.draft && u(r).rejectDraft(t.draft, () => d("submitted")))
2362
2363
  })) : K("", !0),
2363
2364
  $(C, {
2364
2365
  label: "Close",
@@ -2372,7 +2373,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
2372
2373
  loading: A.value,
2373
2374
  onClick: e[8] || (e[8] = () => {
2374
2375
  t.draft && (A.value = !0, u(r).syncDraft(t.draft, () => {
2375
- A.value = !1, m("submitted");
2376
+ A.value = !1, d("submitted");
2376
2377
  }));
2377
2378
  })
2378
2379
  }, null, 8, ["loading"])
@@ -2390,7 +2391,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
2390
2391
  default: X(() => [
2391
2392
  o("div", Ba, [
2392
2393
  o("div", null, [
2393
- $(d, {
2394
+ $(m, {
2394
2395
  items: ft,
2395
2396
  modelValue: Oe.value,
2396
2397
  "onUpdate:modelValue": e[0] || (e[0] = (U) => Oe.value = U)
@@ -2704,7 +2705,7 @@ async function Do(n) {
2704
2705
  header: 1,
2705
2706
  defval: ""
2706
2707
  }), B = (v) => String(v).trim().toLowerCase().replace(/^\uFEFF/, ""), N = f.findIndex(
2707
- (v) => v.some((m) => B(m) === "code")
2708
+ (v) => v.some((d) => B(d) === "code")
2708
2709
  );
2709
2710
  if (N === -1) {
2710
2711
  l([]);
@@ -2783,13 +2784,13 @@ function $o() {
2783
2784
  );
2784
2785
  const v = new Map(
2785
2786
  p.map((b) => [b.id, b.balance])
2786
- ), m = new Set(F.map((b) => b.sku._id));
2787
+ ), d = new Set(F.map((b) => b.sku._id));
2787
2788
  n.value = F.map((b) => {
2788
2789
  const y = v.get(b.sku._id) ?? { amount: 0, precision: 0 }, w = y.amount / Math.pow(10, y.precision);
2789
2790
  return { ...b, systemBalance: y, variance: b.physicalCount - w };
2790
2791
  });
2791
2792
  for (const b of Object.values(s.skuByCode)) {
2792
- if (m.has(b._id)) continue;
2793
+ if (d.has(b._id)) continue;
2793
2794
  const y = v.get(b._id);
2794
2795
  if (!y) continue;
2795
2796
  const w = y.amount / Math.pow(10, y.precision);
@@ -3019,7 +3020,7 @@ const Io = { class: "flex flex-col gap-16" }, Fo = {
3019
3020
  }
3020
3021
  ];
3021
3022
  });
3022
- async function m(w) {
3023
+ async function d(w) {
3023
3024
  x.value = w, await F(w);
3024
3025
  }
3025
3026
  async function b() {
@@ -3065,7 +3066,7 @@ const Io = { class: "flex flex-col gap-16" }, Fo = {
3065
3066
  class: Se({ "h-[200px]": !x.value }),
3066
3067
  accept: ".csv",
3067
3068
  disabled: u(E),
3068
- onFileUpload: m
3069
+ onFileUpload: d
3069
3070
  }, kn({ _: 2 }, [
3070
3071
  x.value ? {
3071
3072
  name: "default",
@@ -3228,14 +3229,14 @@ const Io = { class: "flex flex-col gap-16" }, Fo = {
3228
3229
  value: "add",
3229
3230
  isPrimary: !0,
3230
3231
  prependIcon: "add"
3231
- }, m = {
3232
+ }, d = {
3232
3233
  label: l("inventory.common.refresh"),
3233
3234
  value: "refresh",
3234
3235
  isPrimary: !1
3235
3236
  };
3236
- return [...F.value ? [v] : [], m];
3237
+ return [...F.value ? [v] : [], d];
3237
3238
  });
3238
- return (v, m) => {
3239
+ return (v, d) => {
3239
3240
  const b = Z("FmTable");
3240
3241
  return h(), T(ce, null, [
3241
3242
  $(Dn, {
@@ -3257,7 +3258,7 @@ const Io = { class: "flex flex-col gap-16" }, Fo = {
3257
3258
  "change-location": "",
3258
3259
  searchable: "",
3259
3260
  search: f.value,
3260
- "onUpdate:search": m[0] || (m[0] = (y) => f.value = y)
3261
+ "onUpdate:search": d[0] || (d[0] = (y) => f.value = y)
3261
3262
  }, null, 8, ["search"]),
3262
3263
  (h(), ae(b, {
3263
3264
  key: u(r).tableKey,
@@ -3266,7 +3267,7 @@ const Io = { class: "flex flex-col gap-16" }, Fo = {
3266
3267
  "row-data": u(r).drafts,
3267
3268
  "search-value": f.value,
3268
3269
  loading: A.value,
3269
- onRowClick: m[1] || (m[1] = (y) => u(t)(y.original)),
3270
+ onRowClick: d[1] || (d[1] = (y) => u(t)(y.original)),
3270
3271
  "page-size": E.value
3271
3272
  }, {
3272
3273
  "list-row": X((y) => [
@@ -3322,15 +3323,15 @@ const Io = { class: "flex flex-col gap-16" }, Fo = {
3322
3323
  }, 8, ["title", "actions"]),
3323
3324
  $(Jo, {
3324
3325
  show: B.value,
3325
- "onUpdate:show": m[2] || (m[2] = (y) => B.value = y),
3326
+ "onUpdate:show": d[2] || (d[2] = (y) => B.value = y),
3326
3327
  onSubmitted: u(r).fetchDrafts
3327
3328
  }, null, 8, ["show", "onSubmitted"]),
3328
3329
  (h(), ae(_n, { to: "body" }, [
3329
3330
  $(xo, wn(u(s), {
3330
3331
  show: u(g),
3331
- "onUpdate:show": m[3] || (m[3] = (y) => _t(g) ? g.value = y : null),
3332
- onSubmitted: m[4] || (m[4] = () => (g.value = !1, u(r).fetchDrafts())),
3333
- onRefresh: m[5] || (m[5] = (y) => u(r).updateDraftRef(y))
3332
+ "onUpdate:show": d[3] || (d[3] = (y) => _t(g) ? g.value = y : null),
3333
+ onSubmitted: d[4] || (d[4] = () => (g.value = !1, u(r).fetchDrafts())),
3334
+ onRefresh: d[5] || (d[5] = (y) => u(r).updateDraftRef(y))
3334
3335
  }), null, 16, ["show"])
3335
3336
  ]))
3336
3337
  ], 64);