@feedmepos/mf-inventory-portal 1.2.55 → 1.2.56-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 (114) hide show
  1. package/dist/{App-pElNw5pB.js → App-Dlnr4iYC.js} +3 -3
  2. package/dist/{ApprovalView-B4TSRWMy.js → ApprovalView-Txmz-hCz.js} +5 -5
  3. package/dist/{BindingsDialog-DyxWNBG1.js → BindingsDialog-BXnuWCaK.js} +5 -5
  4. package/dist/{BindingsPicker-D7UkLDlk.js → BindingsPicker-CO2_vfjx.js} +3 -3
  5. package/dist/{BindingsTable-Dc8pJO-n.js → BindingsTable-amypZb8r.js} +5 -5
  6. package/dist/{ClosingDraftView-CSR72RnD.js → ClosingDraftView-Kegm5V38.js} +139 -139
  7. package/dist/{ClosingHistoryView-DvFKOvsZ.js → ClosingHistoryView-D9VXx7c6.js} +36 -36
  8. package/dist/{ClosingTemplateView-CYnVhBqP.js → ClosingTemplateView-PYKa8KDQ.js} +14 -14
  9. package/dist/{DeliveryOrderPrintPreview-Dwgt-cEo.js → DeliveryOrderPrintPreview-BBUliD2T.js} +7 -7
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D3H1RQaf.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DhJjC8RN.js} +17 -17
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CF-BSx4K.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D0z-41dr.js} +2 -2
  12. package/dist/{FmMultiselectDialog-CqBo_5R3.js → FmMultiselectDialog-CswtC1AP.js} +16 -16
  13. package/dist/{FmMultiselectDialog-C1tRdXUe.js → FmMultiselectDialog-DTYS42tQ.js} +1 -1
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CM6QPPoa.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DXkTWOFj.js} +11 -11
  15. package/dist/{ImportView-Y-yzGfLi.js → ImportView-DvECDSkN.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BpvivxRy.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-Dg0gQJFw.js} +1 -1
  17. package/dist/{IngredientGroupView-Bdw32H_9.js → IngredientGroupView-PYLW-jdb.js} +5 -5
  18. package/dist/{IngredientsView-C9xBCLKU.js → IngredientsView-fzMFu5Kd.js} +14 -14
  19. package/dist/{IntegrationView-BmZmgOrT.js → IntegrationView-BJraR9yF.js} +12 -12
  20. package/dist/{InventoryBindingForm-DB68Fqx5.js → InventoryBindingForm-BCLg-OVi.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CGI1smUx.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BAoFz9Xy.js} +14 -14
  22. package/dist/{InventoryBindingSummary-B9mGdrM6.js → InventoryBindingSummary-BaihKVNj.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C7gllFiR.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-sxY8hdeR.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DAX2Rm45.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BhOwDBiq.js} +2 -2
  25. package/dist/{PublishView-hsMNcVGC.js → PublishView-BMmcC0Vq.js} +8 -8
  26. package/dist/{PurchaseOrderPrintPreview-B3O2mDR7.js → PurchaseOrderPrintPreview-BWl9FIys.js} +11 -11
  27. package/dist/{ReceiveRequestView-CCZ_ZTKk.js → ReceiveRequestView-Cn5w0cDy.js} +19 -19
  28. package/dist/RecipeView-BW5KCmkx.js +1557 -0
  29. package/dist/{StockView-lVtSv6e5.js → StockView-oxOQh8eg.js} +116 -116
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cx2Wdpp9.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-JGzokQMQ.js} +1 -1
  31. package/dist/{SupplierView-Bn6K86cD.js → SupplierView-TSbv1g43.js} +11 -11
  32. package/dist/{SurchargeView-C5u_CWxK.js → SurchargeView-CZDaMAk2.js} +6 -6
  33. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-C2boqsh0.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-BH90OuDB.js} +2 -2
  34. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-B0Z-WupJ.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D0geyvW9.js} +1 -1
  35. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BpiFp1cK.js → TransferDetails.vue_vue_type_script_setup_true_lang-Dxm9e7s0.js} +72 -72
  36. package/dist/{TransferTemplateView-CMfA9CeA.js → TransferTemplateView-Ds4UfF6z.js} +15 -15
  37. package/dist/{UnitView-BwBCxwBg.js → UnitView-DNfslwNA.js} +6 -6
  38. package/dist/{WarehouseView-d-i7QZ91.js → WarehouseView-DkcPy1mF.js} +5 -5
  39. package/dist/{WastageTemplateView-CTN9FvAU.js → WastageTemplateView-CP_sQsdU.js} +60 -60
  40. package/dist/api/inventory.d.ts +126 -36
  41. package/dist/api/netsuite.d.ts +8 -1
  42. package/dist/{app-BanOUWeW.js → app-Do7d9F2j.js} +7340 -6379
  43. package/dist/app.d.ts +200 -0
  44. package/dist/app.js +1 -1
  45. package/dist/{closing-template-rJXi1N62.js → closing-template-BidraMN0.js} +1 -1
  46. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +37 -1
  47. package/dist/components/shell/inventory/binding-dialog.vue.d.ts +14 -0
  48. package/dist/components/shell/inventory/binding-ui.vue.d.ts +16 -1
  49. package/dist/{date2-DrFFpmvm.js → date2-xmQqiCBU.js} +1 -1
  50. package/dist/{dayjs.min-BUn7FVfa.js → dayjs.min-C2InbamH.js} +16 -16
  51. package/dist/{decimal-Iv5cW8Fk.js → decimal-BHD_uD50.js} +2 -2
  52. package/dist/{defineDeepModel-B0BLK0AX.js → defineDeepModel-CoBQILOz.js} +1 -1
  53. package/dist/{duplicate-template-CS5JxzRU.js → duplicate-template-BfJ6g_ux.js} +1 -1
  54. package/dist/{feature-BE1entk_.js → feature-BsP8KV0O.js} +94 -89
  55. package/dist/{format-time-from-id-Zk8nyA3X.js → format-time-from-id-CLLM4KoK.js} +1 -1
  56. package/dist/{format-unit-display-DTfb4FQh.js → format-unit-display-BLtS1XcY.js} +10 -10
  57. package/dist/{import-export.helper-eysNTnLw.js → import-export.helper-DQvkoWnj.js} +7 -7
  58. package/dist/{index-BSGrS1Uy.js → index-CUm44l1O.js} +1 -1
  59. package/dist/{index-BBVzJMx-.js → index-CrS7Yig1.js} +1471 -1412
  60. package/dist/{index-CMCmigUe.js → index-p8EMSeUp.js} +3 -3
  61. package/dist/{lodash-Bo5fWIzQ.js → lodash-BNImU2Ov.js} +1 -1
  62. package/dist/{netsuite-DARuwqPK.js → netsuite-DpB7HK5Q.js} +60 -60
  63. package/dist/{purchase-order-template-DMhr8Uo1.js → purchase-order-template-DgbM99CO.js} +1 -1
  64. package/dist/{rules-15LhIexr.js → rules-CmGXcEkE.js} +18 -18
  65. package/dist/{stock-DtaMiLiO.js → stock-C1-SWNBT.js} +1 -1
  66. package/dist/{stock-DPWppSPR.js → stock-CUjopFIE.js} +3 -3
  67. package/dist/stores/feature.d.ts +2 -0
  68. package/dist/stores/integration/netsuite.d.ts +8 -1
  69. package/dist/stores/inventory.d.ts +119 -30
  70. package/dist/{supplier-C5BpCM5Y.js → supplier-BLGyTOqT.js} +2 -2
  71. package/dist/{surcharge-C105g1nX.js → surcharge-BA-bc8RT.js} +1 -1
  72. package/dist/tsconfig.app.tsbuildinfo +1 -1
  73. package/dist/{use-ingredient-select-dialog-wgqteN3b.js → use-ingredient-select-dialog-BDMeEnJC.js} +2 -2
  74. package/dist/{use-inventory-binding-dialog-CKmfTceT.js → use-inventory-binding-dialog-CmAOk0d6.js} +2 -2
  75. package/dist/{use-template-enabled-locations-2-Dy3GQZqT.js → use-template-enabled-locations-2-DSQY7vNB.js} +2 -2
  76. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +64 -8
  77. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +192 -24
  78. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +8 -1
  79. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +96 -12
  80. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +96 -12
  81. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +18 -18
  82. package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +14 -0
  83. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +32 -4
  84. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +28 -0
  85. package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +169 -0
  86. package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryBindingAlternative.vue.d.ts +43 -0
  87. package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryBindingRule.vue.d.ts +25 -0
  88. package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryRecipeBindingV2Field.vue.d.ts +125 -0
  89. package/dist/views/ingredients/components/inventory-binding/v2/components/InventorySkuBindingV2Field.vue.d.ts +129 -0
  90. package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-alternative-table.d.ts +30 -0
  91. package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +4 -0
  92. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +8 -1
  93. package/dist/views/integration/components/netsuite/InventoryTransferIngredientTable.vue.d.ts +16 -2
  94. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +33 -5
  95. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +16 -2
  96. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +32 -4
  97. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +8 -1
  98. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +41 -6
  99. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +246 -36
  100. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +287 -42
  101. package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +16 -0
  102. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +16 -2
  103. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +16 -2
  104. package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +16 -2
  105. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +16 -2
  106. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +8 -1
  107. package/dist/views/transfer-template/composables/use-netsuite-custom-field.d.ts +24 -3
  108. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +96 -12
  109. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +96 -12
  110. package/dist/{vue-i18n-CtTdNLQE.js → vue-i18n-CIhYwCeG.js} +499 -499
  111. package/dist/{xlsx-rlGBAsJO.js → xlsx-BcQjo8NU.js} +1 -1
  112. package/dist/{xlsx.util-CyG8PI8e.js → xlsx.util-GOcrvAJZ.js} +1 -1
  113. package/package.json +1 -1
  114. package/dist/RecipeView-CWzRUSTy.js +0 -646
@@ -1,20 +1,20 @@
1
1
  import { defineComponent as Ue, ref as Y, computed as R, onMounted as Xe, resolveComponent as K, openBlock as x, createElementBlock as P, Fragment as ce, createTextVNode as ue, createBlock as fe, withCtx as Q, createElementVNode as n, toDisplayString as W, unref as v, createVNode as k, createCommentVNode as ne, h as F, watch as Ee, renderList as $e, reactive as Mt, isRef as ht, normalizeClass as Be, normalizeStyle as kt, Teleport as Lt, mergeProps as Nt } from "vue";
2
- import { F as yt, u as Et, _ as zt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
2
+ import { F as gt, u as Et, _ as zt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
3
3
  import { useCoreStore as _t, useI18n as et } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as tt, useDialog as Ht, components as be, useProxiedModel as Ot, useBreakpoints as Kt } from "@feedmepos/ui-library";
5
- import { o as Yt, u as Qe, J as Z, w as z, s as xt, K as he, B as ze, v as He, c as Qt, a as Dt } from "./app-BanOUWeW.js";
5
+ import { o as Yt, u as Qe, K as Z, y as z, s as xt, L as he, D as ze, v as He, c as Qt, a as Dt } from "./app-Do7d9F2j.js";
6
6
  import { defineStore as At, storeToRefs as qt } from "pinia";
7
- import { d as Ke, e as wt, f as Gt, a as ke } from "./date2-DrFFpmvm.js";
8
- import { R as Wt, f as at, a as Je, t as Zt, d as Ie, o as St, p as Ft, m as Ct, l as Jt } from "./rules-15LhIexr.js";
9
- import { b as Xt, d as ea } from "./xlsx.util-CyG8PI8e.js";
10
- import { u as $t } from "./stock-DPWppSPR.js";
11
- import { u as nt } from "./stock-DtaMiLiO.js";
7
+ import { d as Ke, e as wt, f as Gt, a as ke } from "./date2-xmQqiCBU.js";
8
+ import { R as Wt, i as at, a as Je, t as Zt, d as Ie, p as St, q as Ft, o as Ct, m as Jt } from "./rules-CmGXcEkE.js";
9
+ import { b as Xt, d as ea } from "./xlsx.util-GOcrvAJZ.js";
10
+ import { u as $t } from "./stock-CUjopFIE.js";
11
+ import { u as nt } from "./stock-C1-SWNBT.js";
12
12
  import { D as bt, R as Ce } from "./row-action.enum-BcW_L_nE.js";
13
13
  import { c as ta } from "./component-DpCUABT3.js";
14
- import { f as aa } from "./format-time-from-id-Zk8nyA3X.js";
15
- import { _ as na } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CF-BSx4K.js";
14
+ import { f as aa } from "./format-time-from-id-CLLM4KoK.js";
15
+ import { _ as na } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D0z-41dr.js";
16
16
  import { E as oa } from "./empty-placeholder-wf6-BWE8.js";
17
- import { u as sa } from "./vue-i18n-CtTdNLQE.js";
17
+ import { u as sa } from "./vue-i18n-CIhYwCeG.js";
18
18
  import { _ as ra, F as Ne } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
19
19
  const qe = Yt((u, o) => {
20
20
  function e() {
@@ -22,28 +22,28 @@ const qe = Yt((u, o) => {
22
22
  }
23
23
  return {
24
24
  async getDraft(d) {
25
- const h = e(), y = `${u.inventoryBackendUrl}/${h}/closing-draft/${d}`;
26
- return o.get(y);
25
+ const h = e(), g = `${u.inventoryBackendUrl}/${h}/closing-draft/${d}`;
26
+ return o.get(g);
27
27
  },
28
28
  async readDrafts() {
29
29
  const d = e(), h = `${u.inventoryBackendUrl}/${d}/closing-draft`;
30
30
  return o.get(h);
31
31
  },
32
32
  async runOperation(d) {
33
- const h = e(), y = `${u.inventoryBackendUrl}/${h}/closing-draft/run-operation`;
34
- return o.post(y, d);
33
+ const h = e(), g = `${u.inventoryBackendUrl}/${h}/closing-draft/run-operation`;
34
+ return o.post(g, d);
35
35
  },
36
36
  async runOperationV1(d) {
37
- const h = e(), y = `${u.inventoryBackendUrl}/${h}/closing-draft/v1/run-operation`;
38
- return o.post(y, d);
37
+ const h = e(), g = `${u.inventoryBackendUrl}/${h}/closing-draft/v1/run-operation`;
38
+ return o.post(g, d);
39
39
  },
40
40
  async sync(d) {
41
- const h = e(), y = `${u.inventoryBackendUrl}/${h}/closing-draft/sync`;
42
- return o.post(y, d);
41
+ const h = e(), g = `${u.inventoryBackendUrl}/${h}/closing-draft/sync`;
42
+ return o.post(g, d);
43
43
  },
44
44
  async cloneDraft(d) {
45
- const h = e(), y = `${u.inventoryBackendUrl}/${h}/closing-draft/${d}/clone`;
46
- return o.post(y, {});
45
+ const h = e(), g = `${u.inventoryBackendUrl}/${h}/closing-draft/${d}/clone`;
46
+ return o.post(g, {});
47
47
  }
48
48
  };
49
49
  }), la = { class: "fm-typo-en-body-lg-400" }, ia = { class: "fm-typo-en-body-lg-600" }, ca = {
@@ -61,7 +61,7 @@ const qe = Yt((u, o) => {
61
61
  onFinished: { type: Function }
62
62
  },
63
63
  setup(u) {
64
- const o = u, e = Y(), d = qe(), h = tt(), y = Y(!1), f = Y(null), M = Y(!1), U = R(() => {
64
+ const o = u, e = Y(), d = qe(), h = tt(), g = Y(!1), f = Y(null), M = Y(!1), U = R(() => {
65
65
  switch (o.action) {
66
66
  case Z.enum.approveDraft:
67
67
  return "Approve";
@@ -115,7 +115,7 @@ const qe = Yt((u, o) => {
115
115
  }
116
116
  }), j = R(() => f.value ? f.value.getTime() > (/* @__PURE__ */ new Date()).getTime() : !1);
117
117
  async function q(r) {
118
- y.value = !0;
118
+ g.value = !0;
119
119
  try {
120
120
  r ? await d.runOperationV1({
121
121
  _id: o.draft._id,
@@ -145,16 +145,16 @@ const qe = Yt((u, o) => {
145
145
  type: "error"
146
146
  }), console.error("error on submit closing draft action", t);
147
147
  } finally {
148
- y.value = !1;
148
+ g.value = !1;
149
149
  }
150
150
  }
151
151
  return (r, t) => {
152
- const C = K("FmLabel"), I = K("FmDatePicker"), G = K("FmTimePicker"), g = K("FmTextField"), i = K("FmButton"), $ = K("FmForm");
152
+ const C = K("FmLabel"), I = K("FmDatePicker"), G = K("FmTimePicker"), y = K("FmTextField"), i = K("FmButton"), $ = K("FmForm");
153
153
  return M.value ? (x(), fe($, {
154
154
  key: 1,
155
155
  onValidationSuccess: q,
156
156
  class: "flex flex-col gap-32",
157
- disabled: y.value
157
+ disabled: g.value
158
158
  }, {
159
159
  default: Q(() => [
160
160
  n("div", la, [
@@ -186,7 +186,7 @@ const qe = Yt((u, o) => {
186
186
  }, null, 8, ["modelValue"]),
187
187
  j.value ? (x(), P("div", ua, " Cannot select future date ")) : ne("", !0)
188
188
  ])) : ne("", !0),
189
- k(g, {
189
+ k(y, {
190
190
  modelValue: e.value,
191
191
  "onUpdate:modelValue": t[2] || (t[2] = (H) => e.value = H),
192
192
  label: "Remark",
@@ -203,7 +203,7 @@ const qe = Yt((u, o) => {
203
203
  label: U.value,
204
204
  type: "submit",
205
205
  variant: V.value,
206
- loading: y.value
206
+ loading: g.value
207
207
  }, null, 8, ["label", "variant", "loading"])
208
208
  ])
209
209
  ]),
@@ -217,13 +217,13 @@ const qe = Yt((u, o) => {
217
217
  function Bt(u) {
218
218
  const o = u.measurementsAmounts.groupBy((d) => d.measurement.id), e = u.sku.unit.measurements.reduce((d, h) => {
219
219
  var M, U;
220
- const y = ((U = (M = o.get(h.id)) == null ? void 0 : M[0]) == null ? void 0 : U.amount) ?? ma, f = at(h.conversion, y);
220
+ const g = ((U = (M = o.get(h.id)) == null ? void 0 : M[0]) == null ? void 0 : U.amount) ?? ma, f = at(h.conversion, g);
221
221
  return d + +Je(f);
222
222
  }, +Je(u.baseAmount));
223
223
  return Zt(e, u.baseAmount.precision);
224
224
  }
225
225
  const fa = Ie(0), pa = Ie(100), Tt = "N/A";
226
- function va(u, o, e, d, h, y) {
226
+ function va(u, o, e, d, h, g) {
227
227
  var ee, se, w, te, de;
228
228
  const f = Bt(u), M = d ?? f, U = St(M, o), V = o.amount === 0 ? null : Ft(U, {
229
229
  ...o,
@@ -233,7 +233,7 @@ function va(u, o, e, d, h, y) {
233
233
  precision: 0
234
234
  }, r = Number(
235
235
  z.toFormatString({ value: q })
236
- ), t = h ? Number(z.toFormatString({ value: h })) : 0, C = Number(z.toFormatString({ value: o })), I = Number(z.toFormatString({ value: M })), G = C - I, g = G * j / r, i = I * j / r, $ = C * j / r;
236
+ ), t = h ? Number(z.toFormatString({ value: h })) : 0, C = Number(z.toFormatString({ value: o })), I = Number(z.toFormatString({ value: M })), G = C - I, y = G * j / r, i = I * j / r, $ = C * j / r;
237
237
  return {
238
238
  code: u.sku.code,
239
239
  name: u.sku.name,
@@ -241,7 +241,7 @@ function va(u, o, e, d, h, y) {
241
241
  costUnit: ((de = (te = u.sku.defaultCost) == null ? void 0 : te.measurement) == null ? void 0 : de.abbrev) ?? null,
242
242
  baseUnitAmount: Number(z.toFormatString({ value: u.baseAmount })),
243
243
  ...u.measurementsAmounts.filter(
244
- (D) => ga(D.measurement) && e.includes(D.measurement.id)
244
+ (D) => ya(D.measurement) && e.includes(D.measurement.id)
245
245
  ).reduce(
246
246
  (D, A, J) => (D[`measurementAbbrev${J}`] = `(${A.measurement.abbrev}) × ${z.toFormatString({ value: A.measurement.conversion })}`, D[`measurementAmount${J}`] = Number(z.toFormatString({ value: A.amount })), D),
247
247
  {}
@@ -256,17 +256,17 @@ function va(u, o, e, d, h, y) {
256
256
  ) : null,
257
257
  costPerUnit: j,
258
258
  opening: t,
259
- adjustmentTypes: y ?? Tt,
259
+ adjustmentTypes: g ?? Tt,
260
260
  varianceQty: G,
261
- varianceInCost: g,
261
+ varianceInCost: y,
262
262
  stockTakeValue: i,
263
263
  systemValue: $
264
264
  };
265
265
  }
266
- function ga(u) {
266
+ function ya(u) {
267
267
  return !u.abbrev.toLocaleLowerCase().includes("inactive");
268
268
  }
269
- function ya(u) {
269
+ function ga(u) {
270
270
  const o = jt(u);
271
271
  return u.reduce(
272
272
  (e, d) => {
@@ -349,30 +349,30 @@ function ba(u) {
349
349
  id: "baseUnitAmount",
350
350
  name: "Base unit amount"
351
351
  },
352
- ...Array.from({ length: u }).flatMap((h, y) => [
352
+ ...Array.from({ length: u }).flatMap((h, g) => [
353
353
  {
354
- id: `measurementAmount${y}`,
355
- name: `UOM amount ${y + 1}`
354
+ id: `measurementAmount${g}`,
355
+ name: `UOM amount ${g + 1}`
356
356
  },
357
357
  {
358
- id: `measurementAbbrev${y}`,
359
- name: `UOM ${y + 1}`
358
+ id: `measurementAbbrev${g}`,
359
+ name: `UOM ${g + 1}`
360
360
  }
361
361
  ])
362
362
  ];
363
363
  }
364
364
  function ha(u, o, e) {
365
- var G, g, i, $, H, ee, se;
365
+ var G, y, i, $, H, ee, se;
366
366
  const d = o.groupBy(
367
367
  (w) => w.id,
368
368
  (w) => w.balance
369
369
  ), h = e.groupBy(
370
370
  (w) => w.id,
371
371
  (w) => w.balance
372
- ), y = /* @__PURE__ */ new Map();
372
+ ), g = /* @__PURE__ */ new Map();
373
373
  if (u.opening)
374
374
  for (const w of u.opening)
375
- y.set(w.skuId, w.balance);
375
+ g.set(w.skuId, w.balance);
376
376
  const f = /* @__PURE__ */ new Map();
377
377
  if (u.adjustmentSnapshot)
378
378
  for (const w of u.adjustmentSnapshot) {
@@ -381,7 +381,7 @@ function ha(u, o, e) {
381
381
  }
382
382
  const M = [...u.items, ...u.negativeStockItems ?? []], U = jt(M), V = M.map((w) => {
383
383
  var J, O, re;
384
- const te = ((J = d.get(w.sku._id)) == null ? void 0 : J[0]) ?? fa, de = ((O = U == null ? void 0 : U.get(w.sku._id)) == null ? void 0 : O[0]) ?? [], D = y.get(w.sku._id), A = f.get(w.sku._id);
384
+ const te = ((J = d.get(w.sku._id)) == null ? void 0 : J[0]) ?? fa, de = ((O = U == null ? void 0 : U.get(w.sku._id)) == null ? void 0 : O[0]) ?? [], D = g.get(w.sku._id), A = f.get(w.sku._id);
385
385
  return va(
386
386
  w,
387
387
  te,
@@ -390,14 +390,14 @@ function ha(u, o, e) {
390
390
  D,
391
391
  A
392
392
  );
393
- }), _ = ya(M), j = _t().currentBusiness.value, q = ba(_), r = [
393
+ }), _ = ga(M), j = _t().currentBusiness.value, q = ba(_), r = [
394
394
  ["Business name:", j == null ? void 0 : j.name],
395
395
  ["Business ID:", j == null ? void 0 : j._id],
396
396
  ["Menu version", j == null ? void 0 : j.menuVersion],
397
397
  ["Created at", new Date(u.createdAt)],
398
398
  ["Created by", (G = u.createdBy) == null ? void 0 : G.name],
399
399
  ["Updated at", new Date(u.updatedAt)],
400
- ["Updated by", (g = u.updatedBy) == null ? void 0 : g.name],
400
+ ["Updated by", (y = u.updatedBy) == null ? void 0 : y.name],
401
401
  ["Recent action", u.approvedAt ? "Approve" : u.rejectionHistory ? "Reject" : ""],
402
402
  [
403
403
  "Action by",
@@ -440,7 +440,7 @@ const ka = { class: "flex flex-col" }, _a = {
440
440
  }
441
441
  h.value = !0;
442
442
  });
443
- const y = R({
443
+ const g = R({
444
444
  get() {
445
445
  return d.value === null ? "" : Ke(d.value);
446
446
  },
@@ -457,7 +457,7 @@ const ka = { class: "flex flex-col" }, _a = {
457
457
  },
458
458
  set(V) {
459
459
  if (V) {
460
- const _ = /* @__PURE__ */ new Date(`${y.value} ${V}`);
460
+ const _ = /* @__PURE__ */ new Date(`${g.value} ${V}`);
461
461
  _.setSeconds(59, 999), d.value = _;
462
462
  } else
463
463
  d.value = null;
@@ -495,8 +495,8 @@ const ka = { class: "flex flex-col" }, _a = {
495
495
  _: 1
496
496
  }),
497
497
  k(j, {
498
- modelValue: y.value,
499
- "onUpdate:modelValue": _[0] || (_[0] = (C) => y.value = C),
498
+ modelValue: g.value,
499
+ "onUpdate:modelValue": _[0] || (_[0] = (C) => g.value = C),
500
500
  max: v(Ke)(/* @__PURE__ */ new Date())
501
501
  }, null, 8, ["modelValue", "max"]),
502
502
  k(E, { class: "fm-typo-en-body-lg-600" }, {
@@ -535,24 +535,24 @@ const ka = { class: "flex flex-col" }, _a = {
535
535
  }), Ye = At(
536
536
  "closingDraftActions",
537
537
  function() {
538
- const o = Ht(), e = tt(), d = nt(), h = qe(), y = $t(), f = Y(!1), M = Y();
539
- function U(g) {
538
+ const o = Ht(), e = tt(), d = nt(), h = qe(), g = $t(), f = Y(!1), M = Y();
539
+ function U(y) {
540
540
  const i = {
541
- draft: g
541
+ draft: y
542
542
  };
543
543
  M.value = i, f.value = !0;
544
544
  }
545
- async function V(g) {
545
+ async function V(y) {
546
546
  var $;
547
- if (g.status === he.enum.COMPLETED) {
548
- const H = g.closingAdjustmentId;
547
+ if (y.status === he.enum.COMPLETED) {
548
+ const H = y.closingAdjustmentId;
549
549
  if (!H)
550
550
  return e.open({
551
551
  title: "Something went wrong",
552
552
  message: "Closing draft is completed but closing document cannot be found.",
553
553
  type: "error"
554
554
  }), console.error("Closing draft is completed but closing document cannot be found.", {
555
- draftId: g._id
555
+ draftId: y._id
556
556
  }), [];
557
557
  const ee = await d.readAdjustmentById(H);
558
558
  return ((ee == null ? void 0 : ee.skus) ?? []).map((w) => ({
@@ -561,20 +561,20 @@ const ka = { class: "flex flex-col" }, _a = {
561
561
  costs: w.fromCostBalances
562
562
  }));
563
563
  } else
564
- return await y.readStockBalance(), (($ = y.stockBalance) == null ? void 0 : $.skus) ?? [];
564
+ return await g.readStockBalance(), (($ = g.stockBalance) == null ? void 0 : $.skus) ?? [];
565
565
  }
566
- async function _(g, i, $) {
566
+ async function _(y, i, $) {
567
567
  i || (e.open({
568
568
  title: "Exporting",
569
569
  message: "Fetching data..."
570
- }), i = await V(g)), ha(g, i, $ ?? []);
570
+ }), i = await V(y)), ha(y, i, $ ?? []);
571
571
  }
572
- function E(g, i, $) {
572
+ function E(y, i, $) {
573
573
  o.open({
574
574
  title: "Approve draft",
575
575
  contentComponent: Ze,
576
576
  contentComponentProps: {
577
- draft: g,
577
+ draft: y,
578
578
  action: Z.enum.approveDraft,
579
579
  onFinished: () => {
580
580
  o.close(), i == null || i();
@@ -587,12 +587,12 @@ const ka = { class: "flex flex-col" }, _a = {
587
587
  $ == null || $();
588
588
  });
589
589
  }
590
- function j(g, i) {
590
+ function j(y, i) {
591
591
  o.open({
592
592
  title: "Reject draft",
593
593
  contentComponent: Ze,
594
594
  contentComponentProps: {
595
- draft: g,
595
+ draft: y,
596
596
  action: Z.enum.rejectDraft,
597
597
  onFinished: () => {
598
598
  o.close(), i == null || i();
@@ -601,12 +601,12 @@ const ka = { class: "flex flex-col" }, _a = {
601
601
  }
602
602
  });
603
603
  }
604
- function q(g, i) {
604
+ function q(y, i) {
605
605
  o.open({
606
606
  title: "Mark draft as failed",
607
607
  contentComponent: Ze,
608
608
  contentComponentProps: {
609
- draft: g,
609
+ draft: y,
610
610
  action: Z.enum.markAsFailed,
611
611
  onFinished: () => {
612
612
  o.close(), i == null || i();
@@ -615,13 +615,13 @@ const ka = { class: "flex flex-col" }, _a = {
615
615
  }
616
616
  });
617
617
  }
618
- async function r(g, i) {
618
+ async function r(y, i) {
619
619
  await h.sync({
620
- _id: g._id,
621
- _rev: g._rev ?? "",
620
+ _id: y._id,
621
+ _rev: y._rev ?? "",
622
622
  action: Z.enum.approveDraft,
623
623
  data: {
624
- remark: g.remark ?? ""
624
+ remark: y.remark ?? ""
625
625
  }
626
626
  }).delayed(500), e.open({
627
627
  title: "Success",
@@ -632,12 +632,12 @@ const ka = { class: "flex flex-col" }, _a = {
632
632
  function t() {
633
633
  f.value = !1;
634
634
  }
635
- async function C(g, i, $) {
635
+ async function C(y, i, $) {
636
636
  await o.open({
637
637
  title: "Refresh balance",
638
638
  contentComponent: Da,
639
639
  contentComponentProps: {
640
- draft: g,
640
+ draft: y,
641
641
  onFinished: (H) => {
642
642
  o.close(), $ == null || $(H);
643
643
  },
@@ -647,26 +647,26 @@ const ka = { class: "flex flex-col" }, _a = {
647
647
  }
648
648
  });
649
649
  }
650
- async function I(g) {
650
+ async function I(y) {
651
651
  await o.open({
652
652
  title: "Invalidate closing draft cache",
653
653
  message: "It will invalidate opening and stock movement cache for this draft.",
654
654
  primaryActions: { text: "Proceed", close: !0 },
655
655
  secondaryActions: { text: "Cancel", close: !0 }
656
656
  }).onPrimary(async () => {
657
- await d.recalculation.scheduleInvalidateClosingDraftCache([g._id]), e.open({
657
+ await d.recalculation.scheduleInvalidateClosingDraftCache([y._id]), e.open({
658
658
  title: "Success",
659
659
  message: "Invalidate cache requested",
660
660
  type: "success"
661
661
  });
662
662
  });
663
663
  }
664
- async function G(g, i) {
664
+ async function G(y, i) {
665
665
  try {
666
666
  e.open({
667
667
  title: "Cloning",
668
668
  message: "Creating a copy of the draft..."
669
- }), await h.cloneDraft(g._id), e.open({
669
+ }), await h.cloneDraft(y._id), e.open({
670
670
  title: "Success",
671
671
  message: "Draft cloned successfully",
672
672
  type: "success"
@@ -710,23 +710,23 @@ function Oe(u) {
710
710
  const Aa = At(
711
711
  "closingDraftTable",
712
712
  function() {
713
- const { t: o } = et(), e = _t(), d = Ye(), h = Y(new Array()), y = Y(!1), f = Qe(), M = qe();
713
+ const { t: o } = et(), e = _t(), d = Ye(), h = Y(new Array()), g = Y(!1), f = Qe(), M = qe();
714
714
  async function U() {
715
715
  if (h.value = [], !!f._currentLocation) {
716
- y.value = !0;
716
+ g.value = !0;
717
717
  try {
718
718
  const [r] = await Promise.all([M.readDrafts()]).delayed(1e3);
719
719
  h.value = r.reverse();
720
720
  } catch (r) {
721
721
  console.log("Something went wrong when fetching drafts:", r);
722
722
  } finally {
723
- y.value = !1;
723
+ g.value = !1;
724
724
  }
725
725
  }
726
726
  }
727
727
  async function V(r) {
728
728
  if (!h.value.find((t) => t._id) && f._currentLocation) {
729
- y.value = !0;
729
+ g.value = !0;
730
730
  try {
731
731
  const [t] = await Promise.all([
732
732
  M.getDraft(r),
@@ -736,7 +736,7 @@ const Aa = At(
736
736
  } catch (t) {
737
737
  console.log("Something went wrong when fetching drafts:", t);
738
738
  } finally {
739
- y.value = !1;
739
+ g.value = !1;
740
740
  }
741
741
  }
742
742
  }
@@ -829,8 +829,8 @@ const Aa = At(
829
829
  enableSorting: !1,
830
830
  cell(r) {
831
831
  var i;
832
- const t = r.row.original, C = t.status, I = new Date(t.updatedAt), G = (i = t == null ? void 0 : t.rejectionHistory) == null ? void 0 : i.computeFirst(($) => $.rejectedAt), g = G ? new Date(G) : null;
833
- return C === "DRAFT" && g ? g.getTime() > I.getTime() ? F(
832
+ const t = r.row.original, C = t.status, I = new Date(t.updatedAt), G = (i = t == null ? void 0 : t.rejectionHistory) == null ? void 0 : i.computeFirst(($) => $.rejectedAt), y = G ? new Date(G) : null;
833
+ return C === "DRAFT" && y ? y.getTime() > I.getTime() ? F(
834
834
  "div",
835
835
  {
836
836
  class: "flex"
@@ -892,7 +892,7 @@ const Aa = At(
892
892
  color: "text-fm-color-typo-error",
893
893
  value: Z.enum.markAsFailed
894
894
  }
895
- ], g = C && t.status !== he.enum.DRAFT ? [
895
+ ], y = C && t.status !== he.enum.DRAFT ? [
896
896
  {
897
897
  translationKey: "inventory.closing.draft.cloneDraft",
898
898
  color: "text-fm-color-typo-primary",
@@ -905,7 +905,7 @@ const Aa = At(
905
905
  ...t.status === he.enum.DRAFT ? G : []
906
906
  ],
907
907
  ($) => j($, t),
908
- g
908
+ y
909
909
  );
910
910
  },
911
911
  enableSorting: !1,
@@ -917,7 +917,7 @@ const Aa = At(
917
917
  }
918
918
  ],
919
919
  drafts: h,
920
- loading: y,
920
+ loading: g,
921
921
  fetchDrafts: U,
922
922
  loadDraft: V,
923
923
  updateDraftRef: _
@@ -945,7 +945,7 @@ const Aa = At(
945
945
  },
946
946
  emits: ["update:show", "refresh", "approve"],
947
947
  setup(u, { emit: o }) {
948
- const { FmStepper: e, FmStep: d, FmDialog: h, FmButton: y } = be, { t: f } = sa(), M = Dt(), U = u, V = o, _ = R(
948
+ const { FmStepper: e, FmStep: d, FmDialog: h, FmButton: g } = be, { t: f } = sa(), M = Dt(), U = u, V = o, _ = R(
949
949
  () => {
950
950
  var D, A;
951
951
  return ((D = U.draft) == null ? void 0 : D.stockSnapshot) && ((A = U.draft) == null ? void 0 : A.stockSnapshot) !== void 0;
@@ -984,18 +984,18 @@ const Aa = At(
984
984
  get: () => U.show,
985
985
  set: (D) => V("update:show", D)
986
986
  }), t = Y(1), C = () => t.value > 1, I = () => t.value > 2, G = () => !1;
987
- function g(D) {
987
+ function y(D) {
988
988
  return D === 1 ? _.value : D === 2 ? q.value.length == 0 : !1;
989
989
  }
990
990
  const i = R(() => !_.value || q.value.length > 0);
991
991
  function $(D) {
992
992
  let A = D + 1;
993
- for (; A <= 3 && g(A); ) A++;
993
+ for (; A <= 3 && y(A); ) A++;
994
994
  return A > 3 ? 3 : A;
995
995
  }
996
996
  function H(D) {
997
997
  let A = D - 1;
998
- for (; A >= 1 && g(A); ) A--;
998
+ for (; A >= 1 && y(A); ) A--;
999
999
  return A < 1 ? 1 : A;
1000
1000
  }
1001
1001
  function ee() {
@@ -1055,7 +1055,7 @@ const Aa = At(
1055
1055
  default: Q(() => [
1056
1056
  n("div", Fa, W(v(f)("inventory.closing.approval.step.generateReport.description")), 1),
1057
1057
  t.value === 1 ? (x(), P("div", Ca, [
1058
- k(v(y), {
1058
+ k(v(g), {
1059
1059
  label: v(f)("inventory.stock.stock_balance.refreshBalance"),
1060
1060
  "prepend-icon": "refresh",
1061
1061
  variant: "secondary",
@@ -1063,7 +1063,7 @@ const Aa = At(
1063
1063
  onClick: se
1064
1064
  }, null, 8, ["label", "loading"]),
1065
1065
  n("div", $a, [
1066
- k(v(y), {
1066
+ k(v(g), {
1067
1067
  label: v(f)("inventory.common.continue"),
1068
1068
  disabled: !_.value,
1069
1069
  onClick: w
@@ -1108,12 +1108,12 @@ const Aa = At(
1108
1108
  ])
1109
1109
  ])) : ne("", !0),
1110
1110
  n("div", Ma, [
1111
- k(v(y), {
1111
+ k(v(g), {
1112
1112
  label: v(f)("inventory.common.back"),
1113
1113
  variant: "secondary",
1114
1114
  onClick: te
1115
1115
  }, null, 8, ["label"]),
1116
- k(v(y), {
1116
+ k(v(g), {
1117
1117
  label: v(f)("inventory.common.continue"),
1118
1118
  disabled: i.value,
1119
1119
  onClick: w
@@ -1132,12 +1132,12 @@ const Aa = At(
1132
1132
  default: Q(() => [
1133
1133
  n("div", La, W(v(f)("inventory.closing.approval.step.approval.warning")), 1),
1134
1134
  t.value === 3 ? (x(), P("div", Na, [
1135
- k(v(y), {
1135
+ k(v(g), {
1136
1136
  label: v(f)("inventory.common.back"),
1137
1137
  variant: "secondary",
1138
1138
  onClick: te
1139
1139
  }, null, 8, ["label"]),
1140
- k(v(y), {
1140
+ k(v(g), {
1141
1141
  label: v(f)("inventory.common.approve"),
1142
1142
  variant: "destructive",
1143
1143
  disabled: i.value,
@@ -1181,7 +1181,7 @@ const Aa = At(
1181
1181
  }, dn = { class: "flex-1 flex flex-col items-center" }, mn = { class: "flex-1 flex flex-col items-center" }, fn = {
1182
1182
  class: "py-12 flex flex-col gap-4",
1183
1183
  name: "received-at header"
1184
- }, pn = { class: "fm-typo-en-body-lg-400" }, vn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, gn = { class: "flex gap-12 content-stretch" }, yn = {
1184
+ }, pn = { class: "fm-typo-en-body-lg-400" }, vn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, yn = { class: "flex gap-12 content-stretch" }, gn = {
1185
1185
  class: "flex flex-col w-24",
1186
1186
  name: "circles"
1187
1187
  }, bn = { class: "flex-1 flex flex-col items-center" }, hn = {
@@ -1201,12 +1201,12 @@ const Aa = At(
1201
1201
  return c === "MYR" ? "RM" : c;
1202
1202
  });
1203
1203
  $t();
1204
- const h = Ye(), y = Ot(e, "show"), f = Y(!1), M = Y(!1), U = Y(!1), V = Y(new Array()), _ = Y(new Array()), E = Y([]), j = nt(), q = qe(), r = tt(), t = Dt(), C = Qe(), I = Mt({}), G = R(() => new Set(
1204
+ const h = Ye(), g = Ot(e, "show"), f = Y(!1), M = Y(!1), U = Y(!1), V = Y(new Array()), _ = Y(new Array()), E = Y([]), j = nt(), q = qe(), r = tt(), t = Dt(), C = Qe(), I = Mt({}), G = R(() => new Set(
1205
1205
  t.skus.filter((c) => {
1206
1206
  var a;
1207
1207
  return I[(a = c.customAttributes) == null ? void 0 : a.tag];
1208
1208
  }).map((c) => c._id)
1209
- )), g = o, i = Y({
1209
+ )), y = o, i = Y({
1210
1210
  templateItem: !0,
1211
1211
  nonTemplateItem: !0
1212
1212
  }), $ = R(() => {
@@ -1315,11 +1315,11 @@ const Aa = At(
1315
1315
  }), console.error("error refreshing stock balances: there is no change in _rev");
1316
1316
  return;
1317
1317
  }
1318
- g("refresh", S), V.value = S.stockSnapshot ?? [], r.open({
1318
+ y("refresh", S), V.value = S.stockSnapshot ?? [], r.open({
1319
1319
  title: "Balance refreshed",
1320
1320
  message: "Stock balance has been recalculated.",
1321
1321
  type: "success"
1322
- }), y.value = !1;
1322
+ }), g.value = !1;
1323
1323
  } catch (S) {
1324
1324
  r.open({
1325
1325
  title: "Refresh failed",
@@ -1761,7 +1761,7 @@ const Aa = At(
1761
1761
  {}
1762
1762
  )) ?? {};
1763
1763
  return H.value.map((l) => {
1764
- var rt, lt, it, ct, ut, dt, mt, ft, pt, vt, gt;
1764
+ var rt, lt, it, ct, ut, dt, mt, ft, pt, vt, yt;
1765
1765
  const m = (rt = O.value.get(l._id)) == null ? void 0 : rt[0], b = ((lt = J.value.get(l._id)) == null ? void 0 : lt[0]) ?? w, B = ((it = l.defaultCost) == null ? void 0 : it.costPerUnit) ?? w, S = Number(z.toFormatString({ value: B })), L = ((ut = (ct = l.defaultCost) == null ? void 0 : ct.measurement) == null ? void 0 : ut.conversion) ?? {
1766
1766
  amount: 1,
1767
1767
  precision: 0
@@ -1769,10 +1769,10 @@ const Aa = At(
1769
1769
  z.toFormatString({ value: L })
1770
1770
  ), me = le.value.get(l._id), pe = me ? Number(z.toFormatString({ value: me })) : 0, xe = re.value.get(l._id), T = {};
1771
1771
  if (E.value.forEach((oe) => {
1772
- const ve = T[oe] ?? { amount: 0, precision: 0 }, ge = xe == null ? void 0 : xe[oe];
1773
- ge && (T[oe] = Jt(ve, ge));
1772
+ const ve = T[oe] ?? { amount: 0, precision: 0 }, ye = xe == null ? void 0 : xe[oe];
1773
+ ye && (T[oe] = Jt(ve, ye));
1774
1774
  }), !m) {
1775
- const oe = Number(z.toFormatString({ value: b })), ve = oe - 0, ge = ve * S / N, Le = 0, Pt = oe * S / N;
1775
+ const oe = Number(z.toFormatString({ value: b })), ve = oe - 0, ye = ve * S / N, Le = 0, Pt = oe * S / N;
1776
1776
  return {
1777
1777
  id: l._id,
1778
1778
  code: l.code,
@@ -1788,7 +1788,7 @@ const Aa = At(
1788
1788
  costPerUnit: S,
1789
1789
  opening: pe,
1790
1790
  varianceQty: ve,
1791
- varianceInCost: ge,
1791
+ varianceInCost: ye,
1792
1792
  stockTakeValue: Le,
1793
1793
  systemValue: Pt,
1794
1794
  adjustmentAmounts: T
@@ -1796,10 +1796,10 @@ const Aa = At(
1796
1796
  }
1797
1797
  const ae = Bt(m), ie = (pt = (ft = _.value) == null ? void 0 : ft.find(
1798
1798
  (oe) => oe.id === l._id
1799
- )) == null ? void 0 : pt.balance, ye = St(
1799
+ )) == null ? void 0 : pt.balance, ge = St(
1800
1800
  ie ?? ae,
1801
1801
  b
1802
- ), Fe = b.amount === 0 ? null : Ft(ye, {
1802
+ ), Fe = b.amount === 0 ? null : Ft(ge, {
1803
1803
  ...b,
1804
1804
  amount: Math.abs(b.amount)
1805
1805
  }), Me = Fe ? at(Fe, te) : null, Ge = Number(z.toFormatString({ value: b })), We = Number(z.toFormatString({ value: ae })), st = Ge - We, Ut = st * S / N, Rt = We * S / N, Vt = Ge * S / N;
@@ -1807,16 +1807,16 @@ const Aa = At(
1807
1807
  id: l._id,
1808
1808
  code: l.code,
1809
1809
  name: l.name,
1810
- costUnit: ((gt = (vt = l.defaultCost) == null ? void 0 : vt.measurement) == null ? void 0 : gt.abbrev) ?? null,
1810
+ costUnit: ((yt = (vt = l.defaultCost) == null ? void 0 : vt.measurement) == null ? void 0 : yt.abbrev) ?? null,
1811
1811
  baseUnit: l.unit.abbrev,
1812
1812
  baseUnitAmount: Number(z.toFormatString({ value: m.baseAmount })),
1813
1813
  ...m.measurementsAmounts.filter((oe) => {
1814
- var ve, ge, Le;
1815
- return (Le = (ge = (ve = ee.value) == null ? void 0 : ve.get(l._id)) == null ? void 0 : ge[0]) == null ? void 0 : Le.includes(oe.measurement.id);
1816
- }).reduce((oe, ve, ge) => (oe[`measurementAbbrev${ge}`] = `(${ve.measurement.abbrev}) × ${z.toFormatString({ value: ve.measurement.conversion })}`, oe[`measurementAmount${ge}`] = Number(z.toFormatString({ value: ve.amount })), oe), {}),
1814
+ var ve, ye, Le;
1815
+ return (Le = (ye = (ve = ee.value) == null ? void 0 : ve.get(l._id)) == null ? void 0 : ye[0]) == null ? void 0 : Le.includes(oe.measurement.id);
1816
+ }).reduce((oe, ve, ye) => (oe[`measurementAbbrev${ye}`] = `(${ve.measurement.abbrev}) × ${z.toFormatString({ value: ve.measurement.conversion })}`, oe[`measurementAmount${ye}`] = Number(z.toFormatString({ value: ve.amount })), oe), {}),
1817
1817
  systemBalance: Ge,
1818
1818
  physicalBalance: We,
1819
- adjustedAmount: Number(z.toFormatString({ value: ye })),
1819
+ adjustedAmount: Number(z.toFormatString({ value: ge })),
1820
1820
  adjustedDiffPercentage: Me ? Number(
1821
1821
  z.toFormatString({
1822
1822
  value: Ct(Me, 2)
@@ -1947,7 +1947,7 @@ const Aa = At(
1947
1947
  e.draft && (Pe.value = !0, h.approveDraft(
1948
1948
  e.draft,
1949
1949
  () => {
1950
- Pe.value = !1, Ve.value = !1, g("submitted");
1950
+ Pe.value = !1, Ve.value = !1, y("submitted");
1951
1951
  },
1952
1952
  () => {
1953
1953
  Pe.value = !1;
@@ -1960,12 +1960,12 @@ const Aa = At(
1960
1960
  k(xe, {
1961
1961
  "dismiss-away": "",
1962
1962
  "max-width": 9999,
1963
- "model-value": v(y),
1964
- "onUpdate:modelValue": a[9] || (a[9] = (T) => ht(y) ? y.value = T : null),
1963
+ "model-value": v(g),
1964
+ "onUpdate:modelValue": a[9] || (a[9] = (T) => ht(g) ? g.value = T : null),
1965
1965
  header: "Closing details"
1966
1966
  }, {
1967
1967
  "side-sheet-footer": Q(() => {
1968
- var T, ae, ie, ye;
1968
+ var T, ae, ie, ge;
1969
1969
  return [
1970
1970
  n("div", Dn, [
1971
1971
  n("div", An, [
@@ -1996,21 +1996,21 @@ const Aa = At(
1996
1996
  key: 1,
1997
1997
  label: "Reject",
1998
1998
  variant: "destructive",
1999
- onClick: a[6] || (a[6] = () => e.draft && v(h).rejectDraft(e.draft, () => g("submitted")))
1999
+ onClick: a[6] || (a[6] = () => e.draft && v(h).rejectDraft(e.draft, () => y("submitted")))
2000
2000
  })) : ne("", !0),
2001
2001
  k(m, {
2002
2002
  label: "Close",
2003
2003
  variant: "tertiary",
2004
- onClick: a[7] || (a[7] = (Fe) => y.value = !1)
2004
+ onClick: a[7] || (a[7] = (Fe) => g.value = !1)
2005
2005
  }),
2006
- (ie = e.draft) != null && ie.approvedAt && ((ye = e.draft) == null ? void 0 : ye.status) !== v(he).enum.COMPLETED ? (x(), fe(yt, { key: 2 }, {
2006
+ (ie = e.draft) != null && ie.approvedAt && ((ge = e.draft) == null ? void 0 : ge.status) !== v(he).enum.COMPLETED ? (x(), fe(gt, { key: 2 }, {
2007
2007
  default: Q(() => [
2008
2008
  k(m, {
2009
2009
  label: "Sync",
2010
2010
  loading: U.value,
2011
2011
  onClick: a[8] || (a[8] = () => {
2012
2012
  e.draft && (U.value = !0, v(h).syncDraft(e.draft, () => {
2013
- U.value = !1, g("submitted");
2013
+ U.value = !1, y("submitted");
2014
2014
  }));
2015
2015
  })
2016
2016
  }, null, 8, ["loading"])
@@ -2052,9 +2052,9 @@ const Aa = At(
2052
2052
  ]),
2053
2053
  k(s),
2054
2054
  n("div", Ka, [
2055
- (x(!0), P(ce, null, $e(Ae.value, (ie, ye) => (x(), P("div", {
2055
+ (x(!0), P(ce, null, $e(Ae.value, (ie, ge) => (x(), P("div", {
2056
2056
  class: "flex flex-col gap-4",
2057
- key: ye
2057
+ key: ge
2058
2058
  }, [
2059
2059
  n("div", Ya, [
2060
2060
  n("div", Qa, W(ie.label), 1)
@@ -2081,7 +2081,7 @@ const Aa = At(
2081
2081
  loading: M.value,
2082
2082
  onClick: D
2083
2083
  }, null, 8, ["loading"])) : ne("", !0),
2084
- k(yt, null, {
2084
+ k(gt, null, {
2085
2085
  default: Q(() => [
2086
2086
  k(m, {
2087
2087
  label: "Invalidate Draft Cache",
@@ -2216,8 +2216,8 @@ const Aa = At(
2216
2216
  n("div", vn, W(T.date), 1)
2217
2217
  ])
2218
2218
  ]),
2219
- n("div", gn, [
2220
- n("div", yn, [
2219
+ n("div", yn, [
2220
+ n("div", gn, [
2221
2221
  n("div", bn, [
2222
2222
  n("div", {
2223
2223
  class: Be([
@@ -2237,8 +2237,8 @@ const Aa = At(
2237
2237
  }, {
2238
2238
  default: Q(() => [
2239
2239
  n("div", kn, [
2240
- (x(!0), P(ce, null, $e(T.info, (ie, ye) => (x(), P("div", {
2241
- key: ye,
2240
+ (x(!0), P(ce, null, $e(T.info, (ie, ge) => (x(), P("div", {
2241
+ key: ge,
2242
2242
  class: "flex flex-col gap-4"
2243
2243
  }, [
2244
2244
  n("div", _n, W(ie == null ? void 0 : ie.label), 1),
@@ -2274,7 +2274,7 @@ const Aa = At(
2274
2274
  ]),
2275
2275
  _: 1
2276
2276
  }, 8, ["model-value"]),
2277
- v(y) && e.draft ? (x(), fe(Ea, {
2277
+ v(g) && e.draft ? (x(), fe(Ea, {
2278
2278
  key: 0,
2279
2279
  show: Ve.value,
2280
2280
  "onUpdate:show": a[10] || (a[10] = (T) => Ve.value = T),
@@ -2290,8 +2290,8 @@ const Aa = At(
2290
2290
  }), $n = { class: "flex-1 flex flex-col gap-8" }, Bn = { class: "flex flex-col" }, Tn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, jn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, In = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Un = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, to = /* @__PURE__ */ Ue({
2291
2291
  __name: "ClosingDraftView",
2292
2292
  setup(u) {
2293
- const { t: o } = et(), { viewDraft: e } = Ye(), { viewClosingDraftProps: d, viewClosingDraftShow: h } = qt(Ye()), y = Qe(), f = Aa(), M = Et(), { breakpoints: U } = Kt();
2294
- y.watchLocation(f.fetchDrafts);
2293
+ const { t: o } = et(), { viewDraft: e } = Ye(), { viewClosingDraftProps: d, viewClosingDraftShow: h } = qt(Ye()), g = Qe(), f = Aa(), M = Et(), { breakpoints: U } = Kt();
2294
+ g.watchLocation(f.fetchDrafts);
2295
2295
  const V = R(() => f.loading), _ = Y(""), E = R(() => U.value.xs || U.value.sm), j = R(() => E.value ? 10 : 20);
2296
2296
  function q(C) {
2297
2297
  switch (C) {
@@ -2337,7 +2337,7 @@ const Aa = At(
2337
2337
  "change-location": "",
2338
2338
  searchable: "",
2339
2339
  search: _.value,
2340
- "onUpdate:search": I[0] || (I[0] = (g) => _.value = g)
2340
+ "onUpdate:search": I[0] || (I[0] = (y) => _.value = y)
2341
2341
  }, null, 8, ["search"]),
2342
2342
  k(G, {
2343
2343
  style: kt(v(M).tableHeight),
@@ -2345,12 +2345,12 @@ const Aa = At(
2345
2345
  "row-data": v(f).drafts,
2346
2346
  "search-value": _.value,
2347
2347
  loading: V.value,
2348
- onRowClick: I[1] || (I[1] = (g) => v(e)(g.original)),
2348
+ onRowClick: I[1] || (I[1] = (y) => v(e)(y.original)),
2349
2349
  "page-size": j.value
2350
2350
  }, {
2351
- "list-row": Q((g) => [
2351
+ "list-row": Q((y) => [
2352
2352
  k(ra, {
2353
- row: g,
2353
+ row: y,
2354
2354
  onRowClick: (i) => v(e)(i)
2355
2355
  }, {
2356
2356
  default: Q((i) => {
@@ -2371,8 +2371,8 @@ const Aa = At(
2371
2371
  }, null, 8, ["render", "props"])
2372
2372
  ]),
2373
2373
  n("div", In, W([
2374
- ...g.original.items.slice(0, 3).map((_e) => _e.sku.name),
2375
- ...g.original.items.length >= 3 ? [`and ${g.original.items.length - 3} more items`] : []
2374
+ ...y.original.items.slice(0, 3).map((_e) => _e.sku.name),
2375
+ ...y.original.items.length >= 3 ? [`and ${y.original.items.length - 3} more items`] : []
2376
2376
  ].join(", ")), 1),
2377
2377
  n("div", Un, [
2378
2378
  k(v(Ne), {
@@ -2402,9 +2402,9 @@ const Aa = At(
2402
2402
  (x(), fe(Lt, { to: "body" }, [
2403
2403
  k(Cn, Nt(v(d), {
2404
2404
  show: v(h),
2405
- "onUpdate:show": I[2] || (I[2] = (g) => ht(h) ? h.value = g : null),
2405
+ "onUpdate:show": I[2] || (I[2] = (y) => ht(h) ? h.value = y : null),
2406
2406
  onSubmitted: I[3] || (I[3] = () => (h.value = !1, v(f).fetchDrafts())),
2407
- onRefresh: I[4] || (I[4] = (g) => v(f).updateDraftRef(g))
2407
+ onRefresh: I[4] || (I[4] = (y) => v(f).updateDraftRef(y))
2408
2408
  }), null, 16, ["show"])
2409
2409
  ]))
2410
2410
  ], 64);