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

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 (107) hide show
  1. package/dist/{App-RT4bBubX.js → App-COPx00z6.js} +50 -49
  2. package/dist/{ApprovalView-BgOWHNMD.js → ApprovalView-DEtUW_BD.js} +24 -24
  3. package/dist/{BindingsDialog-Dip74zuT.js → BindingsDialog-8WUk3Dv3.js} +2 -2
  4. package/dist/{BindingsPicker-DMQXwEn4.js → BindingsPicker-D8ABQZWj.js} +7 -7
  5. package/dist/{BindingsTable-Czz32F7d.js → BindingsTable-E4ObCYZW.js} +5 -5
  6. package/dist/{ClosingDraftView-Ps4DgRNG.js → ClosingDraftView-BuwTXzoD.js} +499 -498
  7. package/dist/{ClosingTemplateView-EjVLgUCH.js → ClosingTemplateView-Dwlu2WDi.js} +10 -10
  8. package/dist/{DeliveryOrderPrintPreview-C52aY34D.js → DeliveryOrderPrintPreview-CZQP0ZBf.js} +1 -1
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-MSqPw_6t.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CIpktJ_p.js} +32 -32
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DbN_e9U8.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BAsfttD3.js} +51 -51
  11. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DHuB4hRb.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BtLdE9Qw.js} +1 -1
  12. package/dist/{IngredientGroupView-CRTjNc-p.js → IngredientGroupView-DKncarkj.js} +11 -11
  13. package/dist/{IngredientsView-CuLOu_v9.js → IngredientsView-DJhR4pNL.js} +15 -14
  14. package/dist/IntegrationView-DbehNBiT.js +10361 -0
  15. package/dist/{InventoryBindingForm-C1NfSdOs.js → InventoryBindingForm-CakKTaAx.js} +1 -1
  16. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BJ7h3Nr6.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-qrYebXqE.js} +94 -89
  17. package/dist/{InventoryBindingSummary-CFjSwhxA.js → InventoryBindingSummary-ax4kqODn.js} +1 -1
  18. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B73N8AvB.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BD8iRcNk.js} +1 -1
  19. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-rve3vJhu.js → PremiumBadge.vue_vue_type_script_setup_true_lang-D13DAIwe.js} +10 -10
  20. package/dist/{PublishView-Bj0JawUb.js → PublishView-BMQzmmkT.js} +12 -12
  21. package/dist/{PurchaseOrderPrintPreview-DCAZVrDM.js → PurchaseOrderPrintPreview-CdbxZWLq.js} +4 -4
  22. package/dist/{ReceiveRequestView-B_bWd1hC.js → ReceiveRequestView-Blxchs0k.js} +53 -52
  23. package/dist/RecipeView-Bnigp2lS.js +8493 -0
  24. package/dist/{StockView-CsZ2hfAY.js → StockView-B4p6XQPR.js} +73 -72
  25. package/dist/{SupplierView-BUaouKYm.js → SupplierView-ojORzTSY.js} +12 -11
  26. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-G478rFCP.js +1894 -0
  27. package/dist/{TransferTemplateView-Rq7N13OR.js → TransferTemplateView-DTN23wTJ.js} +291 -290
  28. package/dist/{UnitView-C9j2RjtY.js → UnitView-w-bUgjIw.js} +23 -23
  29. package/dist/{WarehouseView-Ct6TWKej.js → WarehouseView-cJ7u4vTr.js} +26 -26
  30. package/dist/api/bill.d.ts +2 -2
  31. package/dist/api/food-market-hub.d.ts +1 -1
  32. package/dist/api/inventory.d.ts +110 -44
  33. package/dist/api/netsuite.d.ts +191 -8
  34. package/dist/api/purchase-order.d.ts +5 -1
  35. package/dist/{app-Cryb1Kx8.js → app-DtLEhFCD.js} +19871 -19809
  36. package/dist/app.d.ts +7 -7
  37. package/dist/app.js +2 -2
  38. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +30 -8
  39. package/dist/components/shell/inventory/binding-dialog.vue.d.ts +2 -2
  40. package/dist/components/shell/inventory/binding-ui.vue.d.ts +27 -5
  41. package/dist/composable/usePromise.d.ts +41 -0
  42. package/dist/{decimal-Ko0ukH7B.js → decimal-D0mDm48J.js} +1 -1
  43. package/dist/feature-GZEf4CLT.js +17427 -0
  44. package/dist/{format-unit-display-C1sTywhb.js → format-unit-display-Dl7kbJn1.js} +60 -60
  45. package/dist/{index-BAyyesj2.js → index-BglOiNaU.js} +7 -6
  46. package/dist/{index-WgH7CKAS.js → index-DKLr1Nm9.js} +1 -1
  47. package/dist/main.d.ts +1 -0
  48. package/dist/{stock-BVCXjojk.js → stock-V0Qm2pTD.js} +3 -3
  49. package/dist/stores/feature.d.ts +3 -20
  50. package/dist/stores/integration/foodmarkethub.d.ts +1 -1
  51. package/dist/stores/integration/netsuite.d.ts +22 -7
  52. package/dist/stores/inventory.d.ts +132 -44
  53. package/dist/stores/location.d.ts +137 -137
  54. package/dist/{supplier-Brxhm840.js → supplier-DK4PWcz4.js} +4 -4
  55. package/dist/tsconfig.app.tsbuildinfo +1 -1
  56. package/dist/{use-ingredient-select-dialog-DCAYNC6e.js → use-ingredient-select-dialog-BfJ-qHni.js} +1 -1
  57. package/dist/{use-inventory-binding-dialog-TYwx9mzF.js → use-inventory-binding-dialog-C5IYjwW5.js} +1 -1
  58. package/dist/views/adjustment-template/wastage-template/actions.d.ts +228 -228
  59. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +2 -2
  60. package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +1 -1
  61. package/dist/views/adjustment-template/wastage-template/table.d.ts +234 -234
  62. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +140 -136
  63. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +420 -408
  64. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +4 -4
  65. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +252 -252
  66. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +252 -252
  67. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +12 -12
  68. package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +2 -2
  69. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +8 -8
  70. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +3 -3
  71. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +4 -4
  72. package/dist/views/integration/components/ApplyProduct.vue.d.ts +2 -2
  73. package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +2 -2
  74. package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +2 -2
  75. package/dist/views/integration/components/netsuite/InventoryTransfer.vue.d.ts +48 -0
  76. package/dist/views/integration/components/netsuite/InventoryTransferIngredientTable.vue.d.ts +180 -0
  77. package/dist/views/integration/components/netsuite/NetSuiteSideSheet.vue.d.ts +24 -0
  78. package/dist/views/integration/components/netsuite/NetSuiteSideSheetProps.d.ts +8 -0
  79. package/dist/views/integration/components/netsuite/{AddLocationDialog.vue.d.ts → business/AddLocationDialog.vue.d.ts} +204 -204
  80. package/dist/views/integration/components/netsuite/{LocationConfigurationDialog.vue.d.ts → business/BusinessNetSuiteSideSheet.vue.d.ts} +3 -3
  81. package/dist/views/integration/components/netsuite/{LocationConfigurationDialogProps.d.ts → business/BusinessNetSuiteSideSheetProps.d.ts} +1 -5
  82. package/dist/views/integration/components/netsuite/{NetSuiteLocationField.vue.d.ts → business/NetSuiteLocationField.vue.d.ts} +11 -9
  83. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +665 -637
  84. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +22 -22
  85. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +44 -44
  86. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +11 -11
  87. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +614 -0
  88. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +1190 -1142
  89. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +1192 -1144
  90. package/dist/views/receive-request/constants/po-action-to-ui-style.d.ts +6 -0
  91. package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +46 -2
  92. package/dist/views/recipe/components/recipe-override-form-field/RecipeOverrideFormField.vue.d.ts +61 -0
  93. package/dist/views/recipe/composables/use-recipe-overrides-form-field.d.ts +10 -0
  94. package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
  95. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +14 -14
  96. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +22 -22
  97. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +17 -17
  98. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +11 -11
  99. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +805 -805
  100. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +805 -805
  101. package/dist/views/transfer-template/composables/useTransferTemplateHelper.d.ts +33 -33
  102. package/dist/vue-i18n-3LoKMrMa.js +2365 -0
  103. package/package.json +8 -5
  104. package/dist/IntegrationView-DXxwE0z8.js +0 -2148
  105. package/dist/RecipeView-m7aSOTrT.js +0 -616
  106. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DqImAdxA.js +0 -1746
  107. package/dist/vue-i18n-B-kKlljK.js +0 -2365
@@ -1,33 +1,33 @@
1
- import { defineComponent as Se, ref as O, resolveComponent as U, openBlock as h, createBlock as Z, withCtx as K, createElementVNode as o, createTextVNode as je, toDisplayString as N, unref as g, createVNode as w, h as j, reactive as We, computed as E, onMounted as qe, watch as Ze, isRef as Me, createElementBlock as T, Fragment as q, createCommentVNode as X, normalizeClass as fe, renderList as ge, normalizeStyle as Ie, Teleport as Je, mergeProps as Qe } from "vue";
2
- import { Y as Xe, u as Be, ag as J, m as et, K as Fe, j as M, t as tt, L as be, r as at, s as nt, v as ot, ah as Ue, ai as Ee, a4 as He, aj as oe, aa as st, af as ne, W as Le, D as Te, i as _e, h as rt, f as lt, a as ct, B as it, _ as ut, C as dt, E as mt, G as De } from "./app-Cryb1Kx8.js";
3
- import { useCoreStore as ft, useI18n as ze } from "@feedmepos/mf-common";
4
- import { useSnackbar as $e, useDialog as pt, useProxiedModel as vt, components as me, useBreakpoints as yt } from "@feedmepos/ui-library";
5
- import { defineStore as Ne, storeToRefs as gt } from "pinia";
6
- import { a as Oe, u as Ve } from "./stock-BVCXjojk.js";
7
- import { E as bt } from "./empty-placeholder-wf6-BWE8.js";
8
- const Ce = Xe((n, s) => {
1
+ import { defineComponent as Fe, ref as O, resolveComponent as U, openBlock as h, createBlock as W, withCtx as Y, createElementVNode as o, createTextVNode as Be, toDisplayString as N, unref as g, createVNode as w, h as j, reactive as We, computed as E, onMounted as Ze, watch as Je, isRef as Ie, createElementBlock as P, Fragment as q, createCommentVNode as ee, normalizeClass as pe, renderList as be, normalizeStyle as Ue, Teleport as Xe, mergeProps as Qe } from "vue";
2
+ import { X as et, u as je, af as Z, l as tt, J as $e, i as M, t as at, K as he, q as nt, r as ot, s as st, ag as Ee, ah as He, a3 as Le, ai as ne, a9 as rt, ae, V as ze, D as Pe, h as De, f as lt, e as ct, a as it, z as ut, _ as dt, B as mt, C as ft, E as ke } from "./app-DtLEhFCD.js";
3
+ import { useCoreStore as pt, useI18n as Ne } from "@feedmepos/mf-common";
4
+ import { useSnackbar as Re, useDialog as vt, useProxiedModel as yt, components as fe, useBreakpoints as gt } from "@feedmepos/ui-library";
5
+ import { defineStore as Oe, storeToRefs as bt } from "pinia";
6
+ import { a as Ve, u as Ye } from "./stock-V0Qm2pTD.js";
7
+ import { E as ht } from "./empty-placeholder-wf6-BWE8.js";
8
+ const Se = et((n, r) => {
9
9
  function e() {
10
- return Be().currentLocation.dbName;
10
+ return je().currentLocation.dbName;
11
11
  }
12
12
  return {
13
- async getDraft(d) {
14
- const m = e(), b = `${n.inventoryBackendUrl}/${m}/closing-draft/${d}`;
15
- return s.get(b);
13
+ async getDraft(i) {
14
+ const u = e(), b = `${n.inventoryBackendUrl}/${u}/closing-draft/${i}`;
15
+ return r.get(b);
16
16
  },
17
17
  async readDrafts() {
18
- const d = e(), m = `${n.inventoryBackendUrl}/${d}/closing-draft`;
19
- return s.get(m);
18
+ const i = e(), u = `${n.inventoryBackendUrl}/${i}/closing-draft`;
19
+ return r.get(u);
20
20
  },
21
- async runOperation(d) {
22
- const m = e(), b = `${n.inventoryBackendUrl}/${m}/closing-draft/run-operation`;
23
- return s.post(b, d);
21
+ async runOperation(i) {
22
+ const u = e(), b = `${n.inventoryBackendUrl}/${u}/closing-draft/run-operation`;
23
+ return r.post(b, i);
24
24
  },
25
- async sync(d) {
26
- const m = e(), b = `${n.inventoryBackendUrl}/${m}/closing-draft/sync`;
27
- return s.post(b, d);
25
+ async sync(i) {
26
+ const u = e(), b = `${n.inventoryBackendUrl}/${u}/closing-draft/sync`;
27
+ return r.post(b, i);
28
28
  }
29
29
  };
30
- }), ht = { class: "fm-typo-en-body-lg-400" }, xt = { class: "fm-typo-en-body-lg-600" }, At = { class: "flex gap-12 py-8 justify-end w-full" }, Pe = /* @__PURE__ */ Se({
30
+ }), xt = { class: "fm-typo-en-body-lg-400" }, At = { class: "fm-typo-en-body-lg-600" }, _t = { class: "flex gap-12 py-8 justify-end w-full" }, Me = /* @__PURE__ */ Fe({
31
31
  __name: "ClosingDraftAction",
32
32
  props: {
33
33
  draft: {},
@@ -36,24 +36,24 @@ const Ce = Xe((n, s) => {
36
36
  onFinished: { type: Function }
37
37
  },
38
38
  setup(n) {
39
- const s = n, e = O(), d = Ce(), m = $e(), b = O(!1);
39
+ const r = n, e = O(), i = Se(), u = Re(), b = O(!1);
40
40
  async function x() {
41
41
  b.value = !0;
42
42
  try {
43
- await d.runOperation({
44
- _id: s.draft._id,
45
- _rev: s.draft._rev ?? "",
46
- action: s.action,
43
+ await i.runOperation({
44
+ _id: r.draft._id,
45
+ _rev: r.draft._rev ?? "",
46
+ action: r.action,
47
47
  data: {
48
48
  remark: e.value
49
49
  }
50
- }).delayed(500), m.open({
50
+ }).delayed(500), u.open({
51
51
  title: "Success",
52
52
  message: "Action submitted",
53
53
  type: "success"
54
- }), s.onFinished();
54
+ }), r.onFinished();
55
55
  } catch (C) {
56
- m.open({
56
+ u.open({
57
57
  title: "Something went wrong",
58
58
  message: "Unable to submit actino. Please try again",
59
59
  type: "error"
@@ -62,36 +62,36 @@ const Ce = Xe((n, s) => {
62
62
  b.value = !1;
63
63
  }
64
64
  }
65
- return (C, f) => {
65
+ return (C, d) => {
66
66
  const F = U("FmTextField"), R = U("FmButton"), H = U("FmForm");
67
- return h(), Z(H, {
67
+ return h(), W(H, {
68
68
  onValidationSuccess: x,
69
69
  class: "flex flex-col gap-32",
70
70
  disabled: b.value
71
71
  }, {
72
- default: K(() => [
73
- o("div", ht, [
74
- f[2] || (f[2] = je(" You are about to ")),
75
- o("span", xt, N(C.action == g(J).enum.approveDraft ? "approve" : "reject"), 1),
76
- f[3] || (f[3] = je(" this draft. Please provider a remark to justify this action. "))
72
+ default: Y(() => [
73
+ o("div", xt, [
74
+ d[2] || (d[2] = Be(" You are about to ")),
75
+ o("span", At, N(C.action == g(Z).enum.approveDraft ? "approve" : "reject"), 1),
76
+ d[3] || (d[3] = Be(" this draft. Please provider a remark to justify this action. "))
77
77
  ]),
78
78
  w(F, {
79
79
  modelValue: e.value,
80
- "onUpdate:modelValue": f[0] || (f[0] = (I) => e.value = I),
80
+ "onUpdate:modelValue": d[0] || (d[0] = (I) => e.value = I),
81
81
  label: "Remark",
82
82
  "label-mark": "required",
83
- rules: [g(et)()]
83
+ rules: [g(tt)()]
84
84
  }, null, 8, ["modelValue", "rules"]),
85
- o("div", At, [
85
+ o("div", _t, [
86
86
  w(R, {
87
87
  label: "Cancel",
88
88
  variant: "tertiary",
89
- onClick: f[1] || (f[1] = (I) => C.onCancel())
89
+ onClick: d[1] || (d[1] = (I) => C.onCancel())
90
90
  }),
91
91
  w(R, {
92
- label: C.action == g(J).enum.approveDraft ? "Approve" : "Reject",
92
+ label: C.action == g(Z).enum.approveDraft ? "Approve" : "Reject",
93
93
  type: "submit",
94
- variant: C.action == g(J).enum.approveDraft ? "primary" : "destructive",
94
+ variant: C.action == g(Z).enum.approveDraft ? "primary" : "destructive",
95
95
  loading: b.value
96
96
  }, null, 8, ["label", "variant", "loading"])
97
97
  ])
@@ -100,58 +100,58 @@ const Ce = Xe((n, s) => {
100
100
  }, 8, ["disabled"]);
101
101
  };
102
102
  }
103
- }), _t = be(0);
104
- function Ye(n) {
105
- const s = n.measurementsAmounts.groupBy((d) => d.measurement.id), e = n.sku.unit.measurements.reduce((d, m) => {
106
- var C, f;
107
- const b = ((f = (C = s.get(m.id)) == null ? void 0 : C[0]) == null ? void 0 : f.amount) ?? _t, x = Fe(m.conversion, b);
108
- return d + +M(x);
103
+ }), Dt = he(0);
104
+ function Ke(n) {
105
+ const r = n.measurementsAmounts.groupBy((i) => i.measurement.id), e = n.sku.unit.measurements.reduce((i, u) => {
106
+ var C, d;
107
+ const b = ((d = (C = r.get(u.id)) == null ? void 0 : C[0]) == null ? void 0 : d.amount) ?? Dt, x = $e(u.conversion, b);
108
+ return i + +M(x);
109
109
  }, +M(n.baseAmount));
110
- return tt(e, n.baseAmount.precision);
110
+ return at(e, n.baseAmount.precision);
111
111
  }
112
- const Dt = be(0), kt = be(100);
113
- function wt(n, s, e) {
114
- const d = Ye(n), m = Ue(d, s), b = s.amount === 0 ? null : Ee(m, {
115
- ...s,
116
- amount: Math.abs(s.amount)
117
- }), x = b ? Fe(b, kt) : null;
112
+ const kt = he(0), wt = he(100);
113
+ function Ct(n, r, e) {
114
+ const i = Ke(n), u = Ee(i, r), b = r.amount === 0 ? null : He(u, {
115
+ ...r,
116
+ amount: Math.abs(r.amount)
117
+ }), x = b ? $e(b, wt) : null;
118
118
  return {
119
119
  code: n.sku.code,
120
120
  name: n.sku.name,
121
121
  baseUnit: n.sku.unit.abbrev,
122
122
  baseUnitAmount: +M(n.baseAmount),
123
123
  ...n.measurementsAmounts.filter(
124
- (f) => Ct(f.measurement) && e.includes(f.measurement.id)
124
+ (d) => jt(d.measurement) && e.includes(d.measurement.id)
125
125
  ).reduce(
126
- (f, F, R) => (f[`measurementAbbrev${R}`] = `(${F.measurement.abbrev}) × ${M(F.measurement.conversion)}`, f[`measurementAmount${R}`] = +M(F.amount), f),
126
+ (d, F, R) => (d[`measurementAbbrev${R}`] = `(${F.measurement.abbrev}) × ${M(F.measurement.conversion)}`, d[`measurementAmount${R}`] = +M(F.amount), d),
127
127
  {}
128
128
  ),
129
- systemBalance: +M(s),
130
- physicalBalance: +M(d),
131
- adjustedAmount: +M(m),
132
- adjustedDiffPercentage: x ? +M(He(x, 2)) : null
129
+ systemBalance: +M(r),
130
+ physicalBalance: +M(i),
131
+ adjustedAmount: +M(u),
132
+ adjustedDiffPercentage: x ? +M(Le(x, 2)) : null
133
133
  };
134
134
  }
135
- function Ct(n) {
135
+ function jt(n) {
136
136
  return !n.abbrev.toLocaleLowerCase().includes("inactive");
137
137
  }
138
- function jt(n) {
139
- const s = Ke(n);
138
+ function St(n) {
139
+ const r = Ge(n);
140
140
  return n.reduce(
141
- (e, d) => {
142
- var m;
143
- return Math.max(e, ((m = s == null ? void 0 : s.get(d.sku._id)) == null ? void 0 : m[0].length) ?? 0);
141
+ (e, i) => {
142
+ var u;
143
+ return Math.max(e, ((u = r == null ? void 0 : r.get(i.sku._id)) == null ? void 0 : u[0].length) ?? 0);
144
144
  },
145
145
  0
146
146
  );
147
147
  }
148
- function Ke(n) {
148
+ function Ge(n) {
149
149
  return n.groupBy(
150
- (s) => s.sku._id,
151
- (s) => s.measurementsAmounts.filter((e) => !e.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((e) => e.measurement.id)
150
+ (r) => r.sku._id,
151
+ (r) => r.measurementsAmounts.filter((e) => !e.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((e) => e.measurement.id)
152
152
  );
153
153
  }
154
- function St(n) {
154
+ function Bt(n) {
155
155
  return [
156
156
  {
157
157
  id: "code",
@@ -185,149 +185,149 @@ function St(n) {
185
185
  id: "baseUnit",
186
186
  name: "Base unit"
187
187
  },
188
- ...Array.from({ length: n }).flatMap((e, d) => [
188
+ ...Array.from({ length: n }).flatMap((e, i) => [
189
189
  {
190
- id: `measurementAmount${d}`,
191
- name: `UOM amount ${d + 1}`
190
+ id: `measurementAmount${i}`,
191
+ name: `UOM amount ${i + 1}`
192
192
  },
193
193
  {
194
- id: `measurementAbbrev${d}`,
195
- name: `UOM ${d + 1}`
194
+ id: `measurementAbbrev${i}`,
195
+ name: `UOM ${i + 1}`
196
196
  }
197
197
  ])
198
198
  ];
199
199
  }
200
- function Bt(n, s) {
201
- var r, y, v, _, L, D, P;
202
- const e = s.groupBy(
200
+ function Ft(n, r) {
201
+ var p, v, y, A, L, _, T;
202
+ const e = r.groupBy(
203
203
  (S) => S.id,
204
204
  (S) => S.balance
205
- ), d = [...n.items, ...n.negativeStockItems ?? []], m = Ke(d), b = d.map((S) => {
206
- var Q, se;
207
- const G = ((Q = e.get(S.sku._id)) == null ? void 0 : Q[0]) ?? Dt, le = ((se = m == null ? void 0 : m.get(S.sku._id)) == null ? void 0 : se[0]) ?? [];
208
- return wt(S, G, le);
209
- }), x = jt(d), f = ft().currentBusiness.value, F = St(x), R = [
210
- ["Business name:", f == null ? void 0 : f.name],
211
- ["Business ID:", f == null ? void 0 : f._id],
212
- ["Menu version", f == null ? void 0 : f.menuVersion],
205
+ ), i = [...n.items, ...n.negativeStockItems ?? []], u = Ge(i), b = i.map((S) => {
206
+ var X, se;
207
+ const J = ((X = e.get(S.sku._id)) == null ? void 0 : X[0]) ?? kt, oe = ((se = u == null ? void 0 : u.get(S.sku._id)) == null ? void 0 : se[0]) ?? [];
208
+ return Ct(S, J, oe);
209
+ }), x = St(i), d = pt().currentBusiness.value, F = Bt(x), R = [
210
+ ["Business name:", d == null ? void 0 : d.name],
211
+ ["Business ID:", d == null ? void 0 : d._id],
212
+ ["Menu version", d == null ? void 0 : d.menuVersion],
213
213
  ["Created at", new Date(n.createdAt)],
214
- ["Created by", (r = n.createdBy) == null ? void 0 : r.name],
214
+ ["Created by", (p = n.createdBy) == null ? void 0 : p.name],
215
215
  ["Updated at", new Date(n.updatedAt)],
216
- ["Updated by", (y = n.updatedBy) == null ? void 0 : y.name],
216
+ ["Updated by", (v = n.updatedBy) == null ? void 0 : v.name],
217
217
  ["Recent action", n.approvedAt ? "Approve" : n.rejectionHistory ? "Reject" : ""],
218
218
  [
219
219
  "Action by",
220
- n.approvedAt ? (v = n.approvedBy) == null ? void 0 : v.name : n.rejectionHistory ? (L = (_ = n.rejectionHistory[0]) == null ? void 0 : _.rejectedBy) == null ? void 0 : L.name : ""
220
+ n.approvedAt ? (y = n.approvedBy) == null ? void 0 : y.name : n.rejectionHistory ? (L = (A = n.rejectionHistory[0]) == null ? void 0 : A.rejectedBy) == null ? void 0 : L.name : ""
221
221
  ],
222
222
  [
223
223
  "Action at",
224
- n.approvedAt ? new Date(n.approvedAt) : n.rejectionHistory ? new Date((D = n.rejectionHistory[0]) == null ? void 0 : D.rejectedAt) : ""
224
+ n.approvedAt ? new Date(n.approvedAt) : n.rejectionHistory ? new Date((_ = n.rejectionHistory[0]) == null ? void 0 : _.rejectedAt) : ""
225
225
  ],
226
226
  [
227
227
  "Action remark",
228
- n.approvedAt ? n.approveRemark : n.rejectionHistory ? new Date((P = n.rejectionHistory[0]) == null ? void 0 : P.rejectRemark) : ""
228
+ n.approvedAt ? n.approveRemark : n.rejectionHistory ? new Date((T = n.rejectionHistory[0]) == null ? void 0 : T.rejectRemark) : ""
229
229
  ],
230
230
  [],
231
231
  F.map((S) => S.name),
232
- ...b.map((S) => F.map((G) => S[G.id]))
233
- ], H = F.map((S) => `system:${S.id}`), I = at(R, H), i = `[${f == null ? void 0 : f.name}] closing draft (${nt(new Date(n.updatedAt))}).xlsx`;
234
- return ot(I, i), i;
232
+ ...b.map((S) => F.map((J) => S[J.id]))
233
+ ], H = F.map((S) => `system:${S.id}`), I = nt(R, H), l = `[${d == null ? void 0 : d.name}] closing draft (${ot(new Date(n.updatedAt))}).xlsx`;
234
+ return st(I, l), l;
235
235
  }
236
- const we = Ne(
236
+ const Ce = Oe(
237
237
  "closingDraftActions",
238
238
  function() {
239
- const s = pt(), e = $e(), d = Oe(), m = Ce(), b = Ve(), x = O(!1), C = O();
240
- function f(y) {
241
- const v = {
242
- draft: y
239
+ const r = vt(), e = Re(), i = Ve(), u = Se(), b = Ye(), x = O(!1), C = O();
240
+ function d(v) {
241
+ const y = {
242
+ draft: v
243
243
  };
244
- C.value = v, x.value = !0;
244
+ C.value = y, x.value = !0;
245
245
  }
246
- async function F(y) {
247
- var _;
248
- if (y.status === oe.enum.COMPLETED) {
249
- const L = y.closingAdjustmentId;
246
+ async function F(v) {
247
+ var A;
248
+ if (v.status === ne.enum.COMPLETED) {
249
+ const L = v.closingAdjustmentId;
250
250
  if (!L)
251
251
  return e.open({
252
252
  title: "Something went wrong",
253
253
  message: "Closing draft is completed but closing document cannot be found.",
254
254
  type: "error"
255
255
  }), console.error("Closing draft is completed but closing document cannot be found.", {
256
- draftId: y._id
256
+ draftId: v._id
257
257
  }), [];
258
- const D = await d.readAdjustmentById(L);
259
- return ((D == null ? void 0 : D.skus) ?? []).map((S) => ({
258
+ const _ = await i.readAdjustmentById(L);
259
+ return ((_ == null ? void 0 : _.skus) ?? []).map((S) => ({
260
260
  id: S.sku._id,
261
261
  balance: S.fromBalance,
262
262
  costs: S.fromCostBalances
263
263
  }));
264
264
  } else
265
- return await b.readStockBalance(), ((_ = b.stockBalance) == null ? void 0 : _.skus) ?? [];
265
+ return await b.readStockBalance(), ((A = b.stockBalance) == null ? void 0 : A.skus) ?? [];
266
266
  }
267
- async function R(y, v) {
268
- v || (e.open({
267
+ async function R(v, y) {
268
+ y || (e.open({
269
269
  title: "Exporting",
270
270
  message: "Fetching data..."
271
- }), v = await F(y)), Bt(y, v);
271
+ }), y = await F(v)), Ft(v, y);
272
272
  }
273
- function H(y, v) {
274
- s.open({
273
+ function H(v, y) {
274
+ r.open({
275
275
  title: "Approve draft",
276
- contentComponent: Pe,
276
+ contentComponent: Me,
277
277
  contentComponentProps: {
278
- draft: y,
279
- action: J.enum.approveDraft,
278
+ draft: v,
279
+ action: Z.enum.approveDraft,
280
280
  onFinished: () => {
281
- s.close(), v == null || v();
281
+ r.close(), y == null || y();
282
282
  },
283
- onCancel: () => s.close()
283
+ onCancel: () => r.close()
284
284
  }
285
285
  });
286
286
  }
287
- function I(y, v) {
288
- s.open({
287
+ function I(v, y) {
288
+ r.open({
289
289
  title: "Reject draft",
290
- contentComponent: Pe,
290
+ contentComponent: Me,
291
291
  contentComponentProps: {
292
- draft: y,
293
- action: J.enum.rejectDraft,
292
+ draft: v,
293
+ action: Z.enum.rejectDraft,
294
294
  onFinished: () => {
295
- s.close(), v == null || v();
295
+ r.close(), y == null || y();
296
296
  },
297
- onCancel: () => s.close()
297
+ onCancel: () => r.close()
298
298
  }
299
299
  });
300
300
  }
301
- async function i(y, v) {
302
- await m.sync({
303
- _id: y._id,
304
- _rev: y._rev ?? "",
305
- action: J.enum.approveDraft,
301
+ async function l(v, y) {
302
+ await u.sync({
303
+ _id: v._id,
304
+ _rev: v._rev ?? "",
305
+ action: Z.enum.approveDraft,
306
306
  data: {
307
- remark: y.remark ?? ""
307
+ remark: v.remark ?? ""
308
308
  }
309
309
  }).delayed(500), e.open({
310
310
  title: "Success",
311
311
  message: "Sync requested",
312
312
  type: "success"
313
- }), v == null || v();
313
+ }), y == null || y();
314
314
  }
315
- function r() {
315
+ function p() {
316
316
  x.value = !1;
317
317
  }
318
318
  return {
319
- viewDraft: f,
320
- closeDraftDialog: r,
319
+ viewDraft: d,
320
+ closeDraftDialog: p,
321
321
  approveDraft: H,
322
322
  rejectDraft: I,
323
- syncDraft: i,
323
+ syncDraft: l,
324
324
  exportDraft: R,
325
325
  viewClosingDraftShow: x,
326
326
  viewClosingDraftProps: C
327
327
  };
328
328
  }
329
329
  );
330
- function ke(n) {
330
+ function we(n) {
331
331
  switch (n) {
332
332
  case "DRAFT":
333
333
  return "fm-status-badge-draft";
@@ -339,58 +339,58 @@ function ke(n) {
339
339
  return "fm-status-badge-complete";
340
340
  }
341
341
  }
342
- const Ft = Ne(
342
+ const $t = Oe(
343
343
  "closingDraftTable",
344
344
  function() {
345
- const { t: s } = ze(), e = we(), d = O(new Array()), m = O(!1), b = Be(), x = Ce();
345
+ const { t: r } = Ne(), e = Ce(), i = O(new Array()), u = O(!1), b = je(), x = Se();
346
346
  async function C() {
347
- if (d.value = [], !!b._currentLocation) {
348
- m.value = !0;
347
+ if (i.value = [], !!b._currentLocation) {
348
+ u.value = !0;
349
349
  try {
350
- const [i] = await Promise.all([x.readDrafts()]).delayed(1e3);
351
- d.value = i.reverse();
352
- } catch (i) {
353
- console.log("Something went wrong when fetching drafts:", i);
350
+ const [l] = await Promise.all([x.readDrafts()]).delayed(1e3);
351
+ i.value = l.reverse();
352
+ } catch (l) {
353
+ console.log("Something went wrong when fetching drafts:", l);
354
354
  } finally {
355
- m.value = !1;
355
+ u.value = !1;
356
356
  }
357
357
  }
358
358
  }
359
- async function f(i) {
360
- if (!d.value.find((r) => r._id) && b._currentLocation) {
361
- m.value = !0;
359
+ async function d(l) {
360
+ if (!i.value.find((p) => p._id) && b._currentLocation) {
361
+ u.value = !0;
362
362
  try {
363
- const [r] = await Promise.all([
364
- x.getDraft(i),
365
- new Promise((y) => setTimeout(y, 1e3))
363
+ const [p] = await Promise.all([
364
+ x.getDraft(l),
365
+ new Promise((v) => setTimeout(v, 1e3))
366
366
  ]);
367
- d.value = [r];
368
- } catch (r) {
369
- console.log("Something went wrong when fetching drafts:", r);
367
+ i.value = [p];
368
+ } catch (p) {
369
+ console.log("Something went wrong when fetching drafts:", p);
370
370
  } finally {
371
- m.value = !1;
371
+ u.value = !1;
372
372
  }
373
373
  }
374
374
  }
375
- function F(i) {
376
- d.value = d.value.map((r) => r._id === i._id ? {
377
- ...i,
378
- _rev: r._rev
379
- } : r);
375
+ function F(l) {
376
+ i.value = i.value.map((p) => p._id === l._id ? {
377
+ ...l,
378
+ _rev: p._rev
379
+ } : p);
380
380
  }
381
381
  function R() {
382
382
  e.closeDraftDialog(), C();
383
383
  }
384
- function H(i, r) {
385
- switch (r = lt(r), i) {
386
- case _e.Details:
387
- return e.viewDraft(r);
388
- case _e.Export:
389
- return e.exportDraft(r);
390
- case J.enum.approveDraft:
391
- return e.approveDraft(r, R);
392
- case J.enum.rejectDraft:
393
- return e.rejectDraft(r, R);
384
+ function H(l, p) {
385
+ switch (p = ct(p), l) {
386
+ case De.Details:
387
+ return e.viewDraft(p);
388
+ case De.Export:
389
+ return e.exportDraft(p);
390
+ case Z.enum.approveDraft:
391
+ return e.approveDraft(p, R);
392
+ case Z.enum.rejectDraft:
393
+ return e.rejectDraft(p, R);
394
394
  }
395
395
  }
396
396
  return {
@@ -398,15 +398,15 @@ const Ft = Ne(
398
398
  {
399
399
  id: "_id",
400
400
  accessorKey: "_id",
401
- header: () => s("inventory.closing.table.createdAt"),
402
- cell(i) {
403
- return st(`${i.getValue()}`);
401
+ header: () => r("inventory.closing.table.createdAt"),
402
+ cell(l) {
403
+ return rt(`${l.getValue()}`);
404
404
  },
405
405
  enableSorting: !0
406
406
  },
407
407
  {
408
408
  id: "updatedAt",
409
- accessorFn: (i) => ne(i.updatedAt),
409
+ accessorFn: (l) => ae(l.updatedAt),
410
410
  header: () => "Updated at",
411
411
  enableSorting: !0,
412
412
  size: 200
@@ -420,11 +420,11 @@ const Ft = Ne(
420
420
  },
421
421
  {
422
422
  id: "noOfItems",
423
- accessorFn: (i) => {
424
- var r;
425
- return i.items.length + (((r = i.negativeStockItems) == null ? void 0 : r.length) ?? 0);
423
+ accessorFn: (l) => {
424
+ var p;
425
+ return l.items.length + (((p = l.negativeStockItems) == null ? void 0 : p.length) ?? 0);
426
426
  },
427
- header: () => s("inventory.closing.table.noOfItems"),
427
+ header: () => r("inventory.closing.table.noOfItems"),
428
428
  enableSorting: !1,
429
429
  meta: {
430
430
  width: "10rem",
@@ -433,21 +433,21 @@ const Ft = Ne(
433
433
  },
434
434
  {
435
435
  id: "recentRemark",
436
- accessorFn: (i) => {
437
- var r;
438
- return (i == null ? void 0 : i.approveRemark) ?? ((r = i == null ? void 0 : i.rejectionHistory) == null ? void 0 : r.computeFirst((y) => y.rejectRemark)) ?? i.remark;
436
+ accessorFn: (l) => {
437
+ var p;
438
+ return (l == null ? void 0 : l.approveRemark) ?? ((p = l == null ? void 0 : l.rejectionHistory) == null ? void 0 : p.computeFirst((v) => v.rejectRemark)) ?? l.remark;
439
439
  },
440
440
  header: () => "Recent remark"
441
441
  },
442
442
  {
443
443
  id: "status",
444
- accessorFn: (i) => i.status,
445
- header: () => s("inventory.closing.table.status"),
444
+ accessorFn: (l) => l.status,
445
+ header: () => r("inventory.closing.table.status"),
446
446
  enableSorting: !1,
447
- cell(i) {
448
- var D;
449
- const r = i.row.original, y = r.status, v = new Date(r.updatedAt), _ = (D = r == null ? void 0 : r.rejectionHistory) == null ? void 0 : D.computeFirst((P) => P.rejectedAt), L = _ ? new Date(_) : null;
450
- return y === "DRAFT" && L ? L.getTime() > v.getTime() ? j(
447
+ cell(l) {
448
+ var _;
449
+ const p = l.row.original, v = p.status, y = new Date(p.updatedAt), A = (_ = p == null ? void 0 : p.rejectionHistory) == null ? void 0 : _.computeFirst((T) => T.rejectedAt), L = A ? new Date(A) : null;
450
+ return v === "DRAFT" && L ? L.getTime() > y.getTime() ? j(
451
451
  "div",
452
452
  {
453
453
  class: "flex"
@@ -455,7 +455,7 @@ const Ft = Ne(
455
455
  j(
456
456
  "div",
457
457
  {
458
- class: ["fm-status-badge", ke("FAILED")]
458
+ class: ["fm-status-badge", we("FAILED")]
459
459
  },
460
460
  "Rejected"
461
461
  )
@@ -467,7 +467,7 @@ const Ft = Ne(
467
467
  j(
468
468
  "div",
469
469
  {
470
- class: ["fm-status-badge", ke("PROCESSING")]
470
+ class: ["fm-status-badge", we("PROCESSING")]
471
471
  },
472
472
  "Updated"
473
473
  )
@@ -479,37 +479,37 @@ const Ft = Ne(
479
479
  j(
480
480
  "div",
481
481
  {
482
- class: ["fm-status-badge", ke(y)]
482
+ class: ["fm-status-badge", we(v)]
483
483
  },
484
- Le(y)
484
+ ze(v)
485
485
  )
486
486
  );
487
487
  }
488
488
  },
489
489
  {
490
490
  id: "action",
491
- cell(i) {
492
- const r = i.row.original, y = [
493
- Te[_e.Details],
494
- Te[_e.Export]
495
- ], v = [
491
+ cell(l) {
492
+ const p = l.row.original, v = [
493
+ Pe[De.Details],
494
+ Pe[De.Export]
495
+ ], y = [
496
496
  {
497
497
  translationKey: "inventory.closing.draft.approveDraft",
498
498
  color: "text-fm-color-typo-primary",
499
- value: J.enum.approveDraft
499
+ value: Z.enum.approveDraft
500
500
  },
501
501
  {
502
502
  translationKey: "inventory.closing.draft.rejectDraft",
503
503
  color: "text-fm-color-typo-error",
504
- value: J.enum.rejectDraft
504
+ value: Z.enum.rejectDraft
505
505
  }
506
506
  ];
507
- return rt(
507
+ return lt(
508
508
  [
509
- ...y,
510
- ...r.status === oe.enum.DRAFT ? v : []
509
+ ...v,
510
+ ...p.status === ne.enum.DRAFT ? y : []
511
511
  ],
512
- (_) => H(_, r)
512
+ (A) => H(A, p)
513
513
  );
514
514
  },
515
515
  enableSorting: !1,
@@ -520,80 +520,81 @@ const Ft = Ne(
520
520
  }
521
521
  }
522
522
  ],
523
- drafts: d,
524
- loading: m,
523
+ drafts: i,
524
+ loading: u,
525
525
  fetchDrafts: C,
526
- loadDraft: f,
526
+ loadDraft: d,
527
527
  updateDraftRef: F
528
528
  };
529
529
  }
530
- ), $t = { class: "w-full flex flex-col gap-32" }, Rt = { class: "flex justify-between" }, Tt = { class: "flex" }, Pt = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, Mt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, It = { class: "flex gap-1" }, Ut = { class: "fm-typo-en-body-lg-600" }, Et = { class: "flex flex-col gap-16" }, Ht = { class: "flex items-center" }, Lt = {
530
+ ), Rt = { class: "w-full flex flex-col gap-32" }, Tt = { class: "flex justify-between" }, Pt = { class: "flex" }, Mt = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, It = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ut = { class: "flex gap-1" }, Et = { class: "fm-typo-en-body-lg-600" }, Ht = { class: "flex flex-col gap-16" }, Lt = { class: "flex items-center" }, zt = {
531
531
  key: 0,
532
532
  class: "flex gap-8"
533
- }, zt = {
533
+ }, Nt = {
534
534
  key: 0,
535
535
  class: "w-full flex flex-col items-center"
536
- }, Nt = { class: "flex items-center gap-8" }, Ot = {
536
+ }, Ot = { class: "flex items-center gap-8" }, Vt = {
537
537
  key: 0,
538
538
  class: "flex gap-8"
539
- }, Vt = { class: "overflow-x-auto" }, Yt = {
539
+ }, Yt = { class: "overflow-x-auto" }, Kt = {
540
540
  key: 1,
541
541
  class: "flex-1 xs:w-screen xs:max-w-full"
542
- }, Kt = {
542
+ }, Gt = {
543
543
  key: 0,
544
544
  class: "flex flex-col items-center gap-8 h-full"
545
- }, Gt = ["src"], Wt = {
545
+ }, qt = ["src"], Wt = {
546
546
  key: 1,
547
547
  class: "px-4 flex flex-col"
548
- }, qt = { class: "flex gap-12 content-stretch" }, Zt = {
548
+ }, Zt = { class: "flex gap-12 content-stretch" }, Jt = {
549
549
  class: "flex flex-col w-24",
550
550
  name: "circles"
551
- }, Jt = { class: "flex-1 flex flex-col items-center" }, Qt = { class: "flex-1 flex flex-col items-center" }, Xt = {
551
+ }, Xt = { class: "flex-1 flex flex-col items-center" }, Qt = { class: "flex-1 flex flex-col items-center" }, ea = {
552
552
  class: "py-12 flex flex-col gap-4",
553
553
  name: "received-at header"
554
- }, ea = { class: "fm-typo-en-body-lg-400" }, ta = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, aa = { class: "flex gap-12 content-stretch" }, na = {
554
+ }, ta = { class: "fm-typo-en-body-lg-400" }, aa = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, na = { class: "flex gap-12 content-stretch" }, oa = {
555
555
  class: "flex flex-col w-24",
556
556
  name: "circles"
557
- }, oa = { class: "flex-1 flex flex-col items-center" }, sa = {
557
+ }, sa = { class: "flex-1 flex flex-col items-center" }, ra = {
558
558
  class: "py-12 flex flex-col gap-4 flex-1",
559
559
  name: "delivery details"
560
- }, ra = { class: "flex flex-col gap-8" }, la = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ca = { class: "flex flex-col gap-4" }, ia = { class: "flex gap-8" }, ua = /* @__PURE__ */ Se({
560
+ }, la = { class: "flex flex-col gap-8" }, ca = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ia = { class: "flex flex-col gap-4" }, ua = { class: "flex gap-8" }, da = /* @__PURE__ */ Fe({
561
561
  __name: "ClosingDraftDialog",
562
562
  props: {
563
563
  show: { type: Boolean },
564
564
  draft: {}
565
565
  },
566
566
  emits: ["submitted", "refresh"],
567
- setup(n, { emit: s }) {
568
- const e = n, d = Ve(), m = we(), b = vt(e, "show"), x = O(!1), C = O(!1), f = O(!1), F = O(new Array()), R = Oe(), H = Ce(), I = $e(), i = ct(), r = We({}), y = E(() => new Set(
569
- i.skus.filter((a) => {
567
+ setup(n, { emit: r }) {
568
+ const e = n, i = Ye(), u = Ce(), b = yt(e, "show"), x = O(!1), C = O(!1), d = O(!1), F = O(new Array()), R = Ve(), H = Se(), I = Re(), l = it(), p = je(), v = We({}), y = E(() => new Set(
569
+ l.skus.filter((a) => {
570
570
  var t;
571
- return r[(t = a.customAttributes) == null ? void 0 : t.tag];
571
+ return v[(t = a.customAttributes) == null ? void 0 : t.tag];
572
572
  }).map((a) => a._id)
573
- )), v = s, _ = E(() => {
574
- var t, l;
575
- const a = [...((t = e.draft) == null ? void 0 : t.items) ?? [], ...((l = e.draft) == null ? void 0 : l.negativeStockItems) ?? []];
576
- return y.value.size ? a.filter((u) => y.value.has(u.sku._id)) : a;
577
- }), L = E(() => {
578
- const a = _.value.map((t) => t.sku);
579
- return a.sort((t, l) => t.code.localeCompare(l.code)), a;
580
- }), D = E(() => _.value.groupBy(
573
+ )), A = r, L = E(() => {
574
+ var t, s;
575
+ const a = [...((t = e.draft) == null ? void 0 : t.items) ?? [], ...((s = e.draft) == null ? void 0 : s.negativeStockItems) ?? []];
576
+ return y.value.size ? a.filter((m) => y.value.has(m.sku._id)) : a;
577
+ }), _ = E(() => {
578
+ const a = L.value.map((t) => t.sku);
579
+ return a.sort((t, s) => t.code.localeCompare(s.code)), a;
580
+ }), T = E(() => L.value.groupBy(
581
581
  (t) => t.sku._id,
582
- (t) => t.measurementsAmounts.filter((l) => !l.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((l) => l.measurement.id)
582
+ (t) => t.measurementsAmounts.filter((s) => !s.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((s) => s.measurement.id)
583
583
  ));
584
- qe(G), Ze(
584
+ Ze(oe), Je(
585
585
  () => e.show,
586
586
  (a) => {
587
- a && (te.value = ie[0], G());
587
+ a && (K.value = ue[0], oe());
588
588
  }
589
589
  );
590
- const P = be(0), S = be(100);
591
- async function G() {
592
- var t, l, u;
590
+ const S = he(0), J = he(100);
591
+ async function oe() {
592
+ var t, s, m;
593
+ if (!p._currentLocation) return;
593
594
  x.value = !0;
594
- const a = ((t = e.draft) == null ? void 0 : t.status) === oe.enum.COMPLETED;
595
+ const a = ((t = e.draft) == null ? void 0 : t.status) === ne.enum.COMPLETED;
595
596
  try {
596
- if (await i.init(), a) {
597
+ if (await l.init(), a) {
597
598
  const c = e.draft.closingAdjustmentId;
598
599
  if (!c) {
599
600
  I.open({
@@ -601,18 +602,18 @@ const Ft = Ne(
601
602
  message: "Closing draft is completed but closing document cannot be found.",
602
603
  type: "error"
603
604
  }), console.error("Closing draft is completed but closing document cannot be found.", {
604
- draftId: (l = e.draft) == null ? void 0 : l._id
605
+ draftId: (s = e.draft) == null ? void 0 : s._id
605
606
  });
606
607
  return;
607
608
  }
608
- const p = await R.readAdjustmentById(c), $ = (p == null ? void 0 : p.skus) ?? [];
609
+ const f = await R.readAdjustmentById(c), $ = (f == null ? void 0 : f.skus) ?? [];
609
610
  F.value = $.map((k) => ({
610
611
  id: k.sku._id,
611
612
  balance: k.fromBalance,
612
613
  costs: k.fromCostBalances
613
614
  }));
614
615
  } else
615
- F.value = ((u = e.draft) == null ? void 0 : u.stockSnapshot) ?? [];
616
+ F.value = ((m = e.draft) == null ? void 0 : m.stockSnapshot) ?? [];
616
617
  } catch (c) {
617
618
  I.open({
618
619
  title: "Something went wrong",
@@ -623,9 +624,9 @@ const Ft = Ne(
623
624
  x.value = !1;
624
625
  }
625
626
  }
626
- async function le() {
627
- var c, p, $;
628
- const a = ((c = e.draft) == null ? void 0 : c.effectiveAt) ?? ((p = e.draft) == null ? void 0 : p.updatedAt);
627
+ async function X() {
628
+ var c, f, $;
629
+ const a = ((c = e.draft) == null ? void 0 : c.effectiveAt) ?? ((f = e.draft) == null ? void 0 : f.updatedAt);
629
630
  if (!a) {
630
631
  I.open({
631
632
  title: "Cannot refresh",
@@ -635,14 +636,14 @@ const Ft = Ne(
635
636
  return;
636
637
  }
637
638
  C.value = !0;
638
- const t = ($ = e.draft) == null ? void 0 : $._rev, l = 30, u = 2e3;
639
+ const t = ($ = e.draft) == null ? void 0 : $._rev, s = 30, m = 2e3;
639
640
  try {
640
641
  await R.recalculation.scheduleCalculateStockSnapshotAtDate(
641
642
  a,
642
643
  e.draft._id
643
644
  );
644
645
  let k = null;
645
- for (let B = 0; B < l && (k = await H.getDraft(e.draft._id).delayed(u), k._rev === t); B++)
646
+ for (let B = 0; B < s && (k = await H.getDraft(e.draft._id).delayed(m), k._rev === t); B++)
646
647
  ;
647
648
  if (!k || k._rev === t) {
648
649
  I.open({
@@ -652,7 +653,7 @@ const Ft = Ne(
652
653
  }), console.error("error refreshing stock balances: there is no change in stockSnapshotAt");
653
654
  return;
654
655
  }
655
- v("refresh", k), F.value = k.stockSnapshot ?? [], I.open({
656
+ A("refresh", k), F.value = k.stockSnapshot ?? [], I.open({
656
657
  title: "Balance refreshed",
657
658
  message: "Stock balance has been recalculated.",
658
659
  type: "success"
@@ -667,15 +668,15 @@ const Ft = Ne(
667
668
  C.value = !1;
668
669
  }
669
670
  }
670
- const Q = E(
671
+ const se = E(
671
672
  () => F.value.groupBy(
672
673
  (a) => a.id,
673
674
  (a) => a.balance
674
675
  )
675
- ), se = E(() => _.value.groupBy((a) => a.sku._id));
676
- function ce(a) {
676
+ ), xe = E(() => L.value.groupBy((a) => a.sku._id));
677
+ function le(a) {
677
678
  return j(
678
- me.FmTooltip,
679
+ fe.FmTooltip,
679
680
  { zIndex: 51, placement: "left", class: "w-full flex justify-end" },
680
681
  {
681
682
  default() {
@@ -687,48 +688,48 @@ const Ft = Ne(
687
688
  }
688
689
  );
689
690
  }
690
- const pe = E(() => {
691
- const a = L.value.reduce((l, u) => {
692
- var c, p;
693
- return Math.max(l, ((p = (c = D.value) == null ? void 0 : c.get(u._id)) == null ? void 0 : p[0].length) ?? 0);
691
+ const ve = E(() => {
692
+ const a = _.value.reduce((s, m) => {
693
+ var c, f;
694
+ return Math.max(s, ((f = (c = T.value) == null ? void 0 : c.get(m._id)) == null ? void 0 : f[0].length) ?? 0);
694
695
  }, 0);
695
696
  return [
696
697
  {
697
698
  id: "sku",
698
- accessorFn: (l) => `${l.code} ${l.name}`,
699
+ accessorFn: (s) => `${s.code} ${s.name}`,
699
700
  header: () => "Name",
700
701
  size: 350,
701
- cell(l) {
702
- const u = l.row.original, c = u.adjustedDiffPercentage, p = typeof c == "number" && Math.abs(c) > 10, $ = j("div", { class: "flex flex-col gap-4" }, [
702
+ cell(s) {
703
+ const m = s.row.original, c = m.adjustedDiffPercentage, f = typeof c == "number" && Math.abs(c) > 10, $ = j("div", { class: "flex flex-col gap-4" }, [
703
704
  j(
704
705
  "div",
705
706
  {
706
707
  class: [
707
708
  "line-clamp-1 fm-typo-en-body-lg-400",
708
- p ? " text-fm-color-system-error-300" : "text-fm-color-typo-primary"
709
+ f ? " text-fm-color-system-error-300" : "text-fm-color-typo-primary"
709
710
  ]
710
711
  },
711
- u.name
712
+ m.name
712
713
  ),
713
714
  j(
714
715
  "div",
715
716
  {
716
717
  class: [
717
718
  "line-clamp-1 fm-typo-en-body-md-400",
718
- p ? " text-fm-color-system-error-300" : "text-fm-color-typo-secondary"
719
+ f ? " text-fm-color-system-error-300" : "text-fm-color-typo-secondary"
719
720
  ]
720
721
  },
721
- u.code
722
+ m.code
722
723
  )
723
724
  ]);
724
725
  return j(
725
- me.FmTooltip,
726
+ fe.FmTooltip,
726
727
  {
727
728
  zIndex: 51
728
729
  },
729
730
  {
730
731
  content() {
731
- return p ? "Adjustment difference is more than 10%." : `${u.code} - ${u.name}`;
732
+ return f ? "Adjustment difference is more than 10%." : `${m.code} - ${m.name}`;
732
733
  },
733
734
  default() {
734
735
  return j("div", { class: "flex items-center gap-4 justify-start w-full" }, [
@@ -747,7 +748,7 @@ const Ft = Ne(
747
748
  {
748
749
  id: "physicalBalance",
749
750
  accessorKey: "physicalBalance",
750
- header: () => ce("Actual balance"),
751
+ header: () => le("Actual balance"),
751
752
  size: 200,
752
753
  meta: {
753
754
  textAlign: "right"
@@ -756,7 +757,7 @@ const Ft = Ne(
756
757
  {
757
758
  id: "systemBalance",
758
759
  accessorKey: "systemBalance",
759
- header: () => ce("Balance"),
760
+ header: () => le("Balance"),
760
761
  size: 200,
761
762
  meta: {
762
763
  textAlign: "right"
@@ -765,7 +766,7 @@ const Ft = Ne(
765
766
  {
766
767
  id: "adjustedAmount",
767
768
  accessorKey: "adjustedAmount",
768
- header: () => ce("Adjusted balance"),
769
+ header: () => le("Adjusted balance"),
769
770
  size: 200,
770
771
  meta: {
771
772
  textAlign: "right"
@@ -775,13 +776,13 @@ const Ft = Ne(
775
776
  id: "adjustedDiffPercentage",
776
777
  accessorKey: "adjustedDiffPercentage",
777
778
  header: () => j(
778
- me.FmTooltip,
779
+ fe.FmTooltip,
779
780
  { zIndex: 51, placement: "left", class: "w-full flex justify-end" },
780
781
  {
781
782
  default() {
782
783
  return j("div", { class: "flex items-center gap-4" }, [
783
784
  "Diff (%)",
784
- j(me.FmIcon, { name: "info", color: "neutral-gray-400", size: "sm" })
785
+ j(fe.FmIcon, { name: "info", color: "neutral-gray-400", size: "sm" })
785
786
  ]);
786
787
  },
787
788
  content() {
@@ -790,17 +791,17 @@ const Ft = Ne(
790
791
  }
791
792
  ),
792
793
  size: 200,
793
- cell(l) {
794
- const u = l.row.original.adjustedDiffPercentage;
795
- if (!u) return "N/A";
796
- const c = u.toFixed(2);
794
+ cell(s) {
795
+ const m = s.row.original.adjustedDiffPercentage;
796
+ if (!m) return "N/A";
797
+ const c = m.toFixed(2);
797
798
  if (c === "0.00")
798
799
  return j("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
799
- const p = u > 0;
800
+ const f = m > 0;
800
801
  return j("div", { class: "flex items-center gap-4 justify-end" }, [
801
- j(me.FmIcon, {
802
- name: p ? "arrow_drop_up" : "arrow_drop_down",
803
- color: p ? "system-success-300" : "system-error-300",
802
+ j(fe.FmIcon, {
803
+ name: f ? "arrow_drop_up" : "arrow_drop_down",
804
+ color: f ? "system-success-300" : "system-error-300",
804
805
  size: "md"
805
806
  }),
806
807
  c
@@ -814,9 +815,9 @@ const Ft = Ne(
814
815
  id: "physicalBalances",
815
816
  header: () => "Amounts",
816
817
  enableSorting: !1,
817
- cell(l) {
818
- const u = l.row.original, c = ($, k) => j(
819
- me.FmTooltip,
818
+ cell(s) {
819
+ const m = s.row.original, c = ($, k) => j(
820
+ fe.FmTooltip,
820
821
  { zIndex: 50 },
821
822
  {
822
823
  default() {
@@ -843,67 +844,67 @@ const Ft = Ne(
843
844
  }
844
845
  }
845
846
  );
846
- let p = Array.from({ length: a }).map(($, k) => {
847
- if (!u[`measurementAmount${k}`])
847
+ let f = Array.from({ length: a }).map(($, k) => {
848
+ if (!m[`measurementAmount${k}`])
848
849
  return null;
849
- const B = u[`measurementAmount${k}`], ue = u[`measurementAbbrev${k}`];
850
- return c(B, ue);
850
+ const B = m[`measurementAmount${k}`], de = m[`measurementAbbrev${k}`];
851
+ return c(B, de);
851
852
  }).filter(($) => $);
852
- return (u.baseUnitAmount || !p.length) && (p = [c(u.baseUnitAmount, u.baseUnit), ...p]), j(
853
+ return (m.baseUnitAmount || !f.length) && (f = [c(m.baseUnitAmount, m.baseUnit), ...f]), j(
853
854
  "div",
854
855
  {
855
856
  class: "flex gap-8 flex-nowrap",
856
857
  style: {
857
- minWidth: `${120 * p.length}px`
858
+ minWidth: `${120 * f.length}px`
858
859
  }
859
860
  },
860
- p
861
+ f
861
862
  );
862
863
  }
863
864
  }
864
865
  ];
865
- }), he = E(() => pe.value.map((a) => a.size ?? 0).reduce((a, t) => a + t)), ee = O(""), ve = E(() => L.value.map((a) => {
866
- var B, ue;
867
- const t = (B = se.value.get(a._id)) == null ? void 0 : B[0], l = ((ue = Q.value.get(a._id)) == null ? void 0 : ue[0]) ?? P;
866
+ }), ce = E(() => ve.value.map((a) => a.size ?? 0).reduce((a, t) => a + t)), ie = O(""), ye = E(() => _.value.map((a) => {
867
+ var B, de;
868
+ const t = (B = xe.value.get(a._id)) == null ? void 0 : B[0], s = ((de = se.value.get(a._id)) == null ? void 0 : de[0]) ?? S;
868
869
  if (!t)
869
870
  return {
870
871
  code: a.code,
871
872
  name: a.name,
872
873
  baseUnit: a.unit.abbrev,
873
874
  baseUnitAmount: 0,
874
- systemBalance: +M(l),
875
+ systemBalance: +M(s),
875
876
  physicalBalance: 0,
876
- adjustedAmount: -+M(l),
877
+ adjustedAmount: -+M(s),
877
878
  adjustedDiffPercentage: -100
878
879
  };
879
- const u = Ye(t), c = Ue(u, l), p = l.amount === 0 ? null : Ee(c, {
880
- ...l,
881
- amount: Math.abs(l.amount)
882
- }), $ = p ? Fe(p, S) : null;
880
+ const m = Ke(t), c = Ee(m, s), f = s.amount === 0 ? null : He(c, {
881
+ ...s,
882
+ amount: Math.abs(s.amount)
883
+ }), $ = f ? $e(f, J) : null;
883
884
  return {
884
885
  code: a.code,
885
886
  name: a.name,
886
887
  baseUnit: a.unit.abbrev,
887
888
  baseUnitAmount: +M(t.baseAmount),
888
- ...t.measurementsAmounts.filter((ae) => {
889
- var W, re, Ae;
890
- return (Ae = (re = (W = D.value) == null ? void 0 : W.get(a._id)) == null ? void 0 : re[0]) == null ? void 0 : Ae.includes(ae.measurement.id);
891
- }).reduce((ae, W, re) => (ae[`measurementAbbrev${re}`] = `(${W.measurement.abbrev}) × ${M(W.measurement.conversion)}`, ae[`measurementAmount${re}`] = +M(W.amount), ae), {}),
892
- systemBalance: +M(l),
893
- physicalBalance: +M(u),
889
+ ...t.measurementsAmounts.filter((te) => {
890
+ var G, re, _e;
891
+ return (_e = (re = (G = T.value) == null ? void 0 : G.get(a._id)) == null ? void 0 : re[0]) == null ? void 0 : _e.includes(te.measurement.id);
892
+ }).reduce((te, G, re) => (te[`measurementAbbrev${re}`] = `(${G.measurement.abbrev}) × ${M(G.measurement.conversion)}`, te[`measurementAmount${re}`] = +M(G.amount), te), {}),
893
+ systemBalance: +M(s),
894
+ physicalBalance: +M(m),
894
895
  adjustedAmount: +M(c),
895
- adjustedDiffPercentage: $ ? +M(He($, 2)) : null
896
+ adjustedDiffPercentage: $ ? +M(Le($, 2)) : null
896
897
  };
897
- })), xe = E(() => {
898
- var t, l, u;
898
+ })), Ae = E(() => {
899
+ var t, s, m;
899
900
  if (!e.draft) return [];
900
901
  const a = e.draft.approvedAt ? {
901
- action: `Approve at ${ne(e.draft.approvedAt)}`,
902
+ action: `Approve at ${ae(e.draft.approvedAt)}`,
902
903
  // actionAt: props.draft.approvedAt,
903
904
  actionBy: e.draft.approvedBy,
904
905
  remark: e.draft.approveRemark
905
906
  } : (t = e.draft.rejectionHistory) == null ? void 0 : t.computeFirst((c) => ({
906
- action: `Reject at ${ne(c.rejectedAt)}`,
907
+ action: `Reject at ${ae(c.rejectedAt)}`,
907
908
  // actionAt: e.rejectedAt,
908
909
  actionBy: c.rejectedBy,
909
910
  remark: c.rejectRemark
@@ -911,7 +912,7 @@ const Ft = Ne(
911
912
  return [
912
913
  {
913
914
  label: "Created at",
914
- value: ne(e.draft.createdAt)
915
+ value: ae(e.draft.createdAt)
915
916
  },
916
917
  {
917
918
  label: "Created by",
@@ -919,7 +920,7 @@ const Ft = Ne(
919
920
  },
920
921
  {
921
922
  label: "Updated at",
922
- value: ne(e.draft.updatedAt)
923
+ value: ae(e.draft.updatedAt)
923
924
  },
924
925
  {
925
926
  label: "Updated by",
@@ -927,11 +928,11 @@ const Ft = Ne(
927
928
  },
928
929
  {
929
930
  label: "Effective at",
930
- value: ne(e.draft.effectiveAt ?? e.draft.updatedAt)
931
+ value: ae(e.draft.effectiveAt ?? e.draft.updatedAt)
931
932
  },
932
933
  {
933
934
  label: "Using template",
934
- value: ((l = e.draft.usingTemplates.find((c) => c)) == null ? void 0 : l.name) ?? "None"
935
+ value: ((s = e.draft.usingTemplates.find((c) => c)) == null ? void 0 : s.name) ?? "None"
935
936
  },
936
937
  e.draft.remark ? {
937
938
  label: "Remark",
@@ -943,14 +944,14 @@ const Ft = Ne(
943
944
  } : null,
944
945
  a && a.actionBy ? {
945
946
  label: "Last action by",
946
- value: (u = a.actionBy) == null ? void 0 : u.name
947
+ value: (m = a.actionBy) == null ? void 0 : m.name
947
948
  } : null,
948
949
  a && a.remark ? {
949
950
  label: "Action remark",
950
951
  value: a.remark
951
952
  } : null
952
953
  ].filter((c) => c).map((c) => c);
953
- }), ie = [
954
+ }), ue = [
954
955
  {
955
956
  label: "Overview",
956
957
  value: "overview"
@@ -959,33 +960,33 @@ const Ft = Ne(
959
960
  label: "Action history",
960
961
  value: "history"
961
962
  }
962
- ], te = O(ie[0]), Y = E(() => {
963
- var t, l, u, c;
963
+ ], K = O(ue[0]), Q = E(() => {
964
+ var t, s, m, c;
964
965
  return [
965
966
  ...(((t = e.draft) == null ? void 0 : t.rejectionHistory) ?? []).map(
966
- (p) => ({
967
+ (f) => ({
967
968
  header: "Reject",
968
- date: ne(p.rejectedAt),
969
+ date: ae(f.rejectedAt),
969
970
  info: [
970
971
  {
971
972
  label: "Rejected by",
972
- values: [p.rejectedBy.name]
973
+ values: [f.rejectedBy.name]
973
974
  },
974
975
  {
975
976
  label: "Rejection remark",
976
- values: [p.rejectRemark]
977
+ values: [f.rejectRemark]
977
978
  }
978
979
  ]
979
980
  })
980
981
  ),
981
- ...(l = e.draft) != null && l.approvedBy ? [
982
+ ...(s = e.draft) != null && s.approvedBy ? [
982
983
  {
983
984
  header: "Approve",
984
- date: e.draft.approvedAt ? ne(e.draft.approvedAt) : "",
985
+ date: e.draft.approvedAt ? ae(e.draft.approvedAt) : "",
985
986
  info: [
986
987
  {
987
988
  label: "Approved by",
988
- values: [(u = e.draft) == null ? void 0 : u.approvedBy.name]
989
+ values: [(m = e.draft) == null ? void 0 : m.approvedBy.name]
989
990
  },
990
991
  {
991
992
  label: "Approval remark",
@@ -995,122 +996,122 @@ const Ft = Ne(
995
996
  }
996
997
  ] : []
997
998
  ];
998
- }), ye = E(() => {
999
- var c, p, $, k;
999
+ }), ge = E(() => {
1000
+ var c, f, $, k;
1000
1001
  if ((c = e == null ? void 0 : e.draft) != null && c.approvedAt) return "Draft is already approved.";
1001
- if (((p = e.draft) == null ? void 0 : p.status) !== oe.enum.DRAFT) return "Status is not draft.";
1002
- const a = ve.value.some((B) => B.physicalBalance < 0), t = ((k = ($ = d.stockBalance.skus) == null ? void 0 : $.filter((B) => B.balance.amount < 0)) == null ? void 0 : k.map((B) => B.id)) ?? [], l = new Set(L.value.map((B) => B._id)), u = t.filter((B) => !l.has(B)).length;
1002
+ if (((f = e.draft) == null ? void 0 : f.status) !== ne.enum.DRAFT) return "Status is not draft.";
1003
+ const a = ye.value.some((B) => B.physicalBalance < 0), t = ((k = ($ = i.stockBalance.skus) == null ? void 0 : $.filter((B) => B.balance.amount < 0)) == null ? void 0 : k.map((B) => B.id)) ?? [], s = new Set(_.value.map((B) => B._id)), m = t.filter((B) => !s.has(B)).length;
1003
1004
  return [
1004
1005
  a ? "Negative total exist." : null,
1005
- u ? "Negative stock is not included in this draft. Reopen draft in POS and apply changes." : null
1006
+ m ? "Negative stock is not included in this draft. Reopen draft in POS and apply changes." : null
1006
1007
  ].filter((B) => B).join(" ");
1007
1008
  });
1008
1009
  return (a, t) => {
1009
- const l = U("FmButtonGroup"), u = U("FmMenuDivider"), c = U("FmCard"), p = U("FmButton"), $ = U("FmCircularProgress"), k = U("FmTextField"), B = U("FmIcon"), ue = U("FmChip"), ae = U("FmTable"), W = U("FmSpacer"), re = U("FmTooltip"), Ae = U("FmSideSheet");
1010
- return h(), Z(Ae, {
1010
+ const s = U("FmButtonGroup"), m = U("FmMenuDivider"), c = U("FmCard"), f = U("FmButton"), $ = U("FmCircularProgress"), k = U("FmTextField"), B = U("FmIcon"), de = U("FmChip"), te = U("FmTable"), G = U("FmSpacer"), re = U("FmTooltip"), _e = U("FmSideSheet");
1011
+ return h(), W(_e, {
1011
1012
  "dismiss-away": "",
1012
1013
  "max-width": 9999,
1013
1014
  "model-value": g(b),
1014
- "onUpdate:modelValue": t[8] || (t[8] = (A) => Me(b) ? b.value = A : null),
1015
+ "onUpdate:modelValue": t[8] || (t[8] = (D) => Ie(b) ? b.value = D : null),
1015
1016
  header: "Closing details"
1016
1017
  }, {
1017
- "side-sheet-footer": K(() => {
1018
- var A, z, V, de;
1018
+ "side-sheet-footer": Y(() => {
1019
+ var D, z, V, me;
1019
1020
  return [
1020
- o("div", ia, [
1021
- ((A = e.draft) == null ? void 0 : A.status) === g(oe).enum.DRAFT ? (h(), T(q, { key: 0 }, [
1022
- ye.value ? (h(), Z(re, {
1021
+ o("div", ua, [
1022
+ ((D = e.draft) == null ? void 0 : D.status) === g(ne).enum.DRAFT ? (h(), P(q, { key: 0 }, [
1023
+ ge.value ? (h(), W(re, {
1023
1024
  key: 0,
1024
1025
  "z-index": 51
1025
1026
  }, {
1026
- content: K(() => [
1027
- je(N(ye.value), 1)
1027
+ content: Y(() => [
1028
+ Be(N(ge.value), 1)
1028
1029
  ]),
1029
- default: K(() => [
1030
- w(p, {
1030
+ default: Y(() => [
1031
+ w(f, {
1031
1032
  disabled: "",
1032
1033
  key: "approve key",
1033
1034
  label: "Approve",
1034
- onClick: t[3] || (t[3] = () => e.draft && g(m).approveDraft(e.draft, () => v("submitted")))
1035
+ onClick: t[3] || (t[3] = () => e.draft && g(u).approveDraft(e.draft, () => A("submitted")))
1035
1036
  })
1036
1037
  ]),
1037
1038
  _: 1
1038
- })) : (h(), Z(p, {
1039
+ })) : (h(), W(f, {
1039
1040
  key: "approve key",
1040
1041
  label: "Approve",
1041
- onClick: t[4] || (t[4] = () => e.draft && g(m).approveDraft(e.draft, () => v("submitted")))
1042
+ onClick: t[4] || (t[4] = () => e.draft && g(u).approveDraft(e.draft, () => A("submitted")))
1042
1043
  }))
1043
- ], 64)) : X("", !0),
1044
- ((z = e.draft) == null ? void 0 : z.status) === g(oe).enum.DRAFT ? (h(), Z(p, {
1044
+ ], 64)) : ee("", !0),
1045
+ ((z = e.draft) == null ? void 0 : z.status) === g(ne).enum.DRAFT ? (h(), W(f, {
1045
1046
  key: 1,
1046
1047
  label: "Reject",
1047
1048
  variant: "destructive",
1048
- onClick: t[5] || (t[5] = () => e.draft && g(m).rejectDraft(e.draft, () => v("submitted")))
1049
- })) : X("", !0),
1050
- (V = e.draft) != null && V.approvedAt && ((de = e.draft) == null ? void 0 : de.status) !== g(oe).enum.COMPLETED ? (h(), Z(p, {
1049
+ onClick: t[5] || (t[5] = () => e.draft && g(u).rejectDraft(e.draft, () => A("submitted")))
1050
+ })) : ee("", !0),
1051
+ (V = e.draft) != null && V.approvedAt && ((me = e.draft) == null ? void 0 : me.status) !== g(ne).enum.COMPLETED ? (h(), W(f, {
1051
1052
  key: 2,
1052
1053
  label: "Sync",
1053
- loading: f.value,
1054
+ loading: d.value,
1054
1055
  onClick: t[6] || (t[6] = () => {
1055
- e.draft && (f.value = !0, g(m).syncDraft(e.draft, () => {
1056
- f.value = !1, v("submitted");
1056
+ e.draft && (d.value = !0, g(u).syncDraft(e.draft, () => {
1057
+ d.value = !1, A("submitted");
1057
1058
  }));
1058
1059
  })
1059
- }, null, 8, ["loading"])) : X("", !0),
1060
- w(p, {
1060
+ }, null, 8, ["loading"])) : ee("", !0),
1061
+ w(f, {
1061
1062
  label: "Close",
1062
1063
  variant: "tertiary",
1063
- onClick: t[7] || (t[7] = (Re) => b.value = !1)
1064
+ onClick: t[7] || (t[7] = (Te) => b.value = !1)
1064
1065
  })
1065
1066
  ])
1066
1067
  ];
1067
1068
  }),
1068
- default: K(() => [
1069
- o("div", $t, [
1069
+ default: Y(() => [
1070
+ o("div", Rt, [
1070
1071
  o("div", null, [
1071
- w(l, {
1072
- items: ie,
1073
- modelValue: te.value,
1074
- "onUpdate:modelValue": t[0] || (t[0] = (A) => te.value = A)
1072
+ w(s, {
1073
+ items: ue,
1074
+ modelValue: K.value,
1075
+ "onUpdate:modelValue": t[0] || (t[0] = (D) => K.value = D)
1075
1076
  }, null, 8, ["modelValue"])
1076
1077
  ]),
1077
- te.value.value === "overview" ? (h(), T(q, { key: 0 }, [
1078
+ K.value.value === "overview" ? (h(), P(q, { key: 0 }, [
1078
1079
  w(c, {
1079
1080
  variant: "outlined",
1080
1081
  class: "flex flex-col gap-8 px-12 py-16"
1081
1082
  }, {
1082
- default: K(() => {
1083
- var A, z;
1083
+ default: Y(() => {
1084
+ var D, z;
1084
1085
  return [
1085
- o("div", Rt, [
1086
+ o("div", Tt, [
1086
1087
  t[9] || (t[9] = o("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
1087
- o("div", Tt, [
1088
+ o("div", Pt, [
1088
1089
  o("div", {
1089
- class: fe(["fm-status-badge", g(ke)(((A = a.draft) == null ? void 0 : A.status) ?? "DRAFT")])
1090
- }, N(g(Le)(((z = a.draft) == null ? void 0 : z.status) ?? "")), 3)
1090
+ class: pe(["fm-status-badge", g(we)(((D = a.draft) == null ? void 0 : D.status) ?? "DRAFT")])
1091
+ }, N(g(ze)(((z = a.draft) == null ? void 0 : z.status) ?? "")), 3)
1091
1092
  ])
1092
1093
  ]),
1093
- w(u),
1094
- o("div", Pt, [
1095
- (h(!0), T(q, null, ge(xe.value, (V, de) => (h(), T("div", {
1094
+ w(m),
1095
+ o("div", Mt, [
1096
+ (h(!0), P(q, null, be(Ae.value, (V, me) => (h(), P("div", {
1096
1097
  class: "flex flex-col gap-4",
1097
- key: de
1098
+ key: me
1098
1099
  }, [
1099
- o("div", Mt, [
1100
- o("div", It, N(V.label), 1)
1100
+ o("div", It, [
1101
+ o("div", Ut, N(V.label), 1)
1101
1102
  ]),
1102
- o("div", Ut, N(V.value), 1)
1103
+ o("div", Et, N(V.value), 1)
1103
1104
  ]))), 128))
1104
1105
  ])
1105
1106
  ];
1106
1107
  }),
1107
1108
  _: 1
1108
1109
  }),
1109
- o("div", Et, [
1110
- o("div", Ht, [
1110
+ o("div", Ht, [
1111
+ o("div", Lt, [
1111
1112
  t[10] || (t[10] = o("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
1112
- x.value ? X("", !0) : (h(), T("div", Lt, [
1113
- a.draft && a.draft.status !== g(oe).enum.COMPLETED ? (h(), Z(p, {
1113
+ x.value ? ee("", !0) : (h(), P("div", zt, [
1114
+ a.draft && a.draft.status !== g(ne).enum.COMPLETED ? (h(), W(f, {
1114
1115
  key: 0,
1115
1116
  label: "Refresh balance",
1116
1117
  "prepend-icon": "refresh",
@@ -1119,86 +1120,86 @@ const Ft = Ne(
1119
1120
  "bg-color": "transparent",
1120
1121
  "border-color": "primary",
1121
1122
  loading: C.value,
1122
- onClick: le
1123
- }, null, 8, ["loading"])) : X("", !0),
1124
- w(p, {
1123
+ onClick: X
1124
+ }, null, 8, ["loading"])) : ee("", !0),
1125
+ w(f, {
1125
1126
  label: "Export data",
1126
1127
  "prepend-icon": "download",
1127
1128
  variant: "secondary",
1128
1129
  "text-color": "primary",
1129
1130
  "bg-color": "transparent",
1130
1131
  "border-color": "primary",
1131
- onClick: t[1] || (t[1] = (A) => a.draft ? g(m).exportDraft(a.draft, F.value) : null)
1132
+ onClick: t[1] || (t[1] = (D) => a.draft ? g(u).exportDraft(a.draft, F.value) : null)
1132
1133
  })
1133
1134
  ]))
1134
1135
  ]),
1135
- x.value ? (h(), T("div", zt, [
1136
+ x.value ? (h(), P("div", Nt, [
1136
1137
  t[12] || (t[12] = o("div", { class: "h-80" }, null, -1)),
1137
- o("div", Nt, [
1138
+ o("div", Ot, [
1138
1139
  o("div", null, [
1139
1140
  w($, { size: "md" })
1140
1141
  ]),
1141
1142
  t[11] || (t[11] = o("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fetching info... ", -1))
1142
1143
  ]),
1143
1144
  t[13] || (t[13] = o("div", { class: "h-80" }, null, -1))
1144
- ])) : (h(), T(q, { key: 1 }, [
1145
+ ])) : (h(), P(q, { key: 1 }, [
1145
1146
  o("div", null, [
1146
1147
  w(k, {
1147
- modelValue: ee.value,
1148
- "onUpdate:modelValue": t[2] || (t[2] = (A) => ee.value = A),
1148
+ modelValue: ie.value,
1149
+ "onUpdate:modelValue": t[2] || (t[2] = (D) => ie.value = D),
1149
1150
  placeholder: "Filter items"
1150
1151
  }, null, 8, ["modelValue"])
1151
1152
  ]),
1152
- g(i).skuTags.size ? (h(), T("div", Ot, [
1153
- (h(!0), T(q, null, ge(g(i).skuTags.keys(), (A) => (h(), Z(ue, {
1154
- key: `${A}`,
1155
- label: `${A}`,
1153
+ g(l).skuTags.size ? (h(), P("div", Vt, [
1154
+ (h(!0), P(q, null, be(g(l).skuTags.keys(), (D) => (h(), W(de, {
1155
+ key: `${D}`,
1156
+ label: `${D}`,
1156
1157
  selectable: "",
1157
- selected: r[`${A}`],
1158
- onClick: (z) => r[`${A}`] = !r[`${A}`]
1158
+ selected: v[`${D}`],
1159
+ onClick: (z) => v[`${D}`] = !v[`${D}`]
1159
1160
  }, {
1160
- default: K(() => [
1161
- r[`${A}`] ? (h(), Z(B, {
1161
+ default: Y(() => [
1162
+ v[`${D}`] ? (h(), W(B, {
1162
1163
  key: 0,
1163
1164
  name: "check",
1164
1165
  class: "text-white",
1165
1166
  size: "sm"
1166
- })) : X("", !0),
1167
+ })) : ee("", !0),
1167
1168
  o("span", {
1168
- class: fe([
1169
+ class: pe([
1169
1170
  "",
1170
1171
  {
1171
- "text-white fm-typo-en-body-md-600": r[`${A}`],
1172
- "text-fm-color-typo-primary fm-typo-en-body-md-400": !r[`${A}`]
1172
+ "text-white fm-typo-en-body-md-600": v[`${D}`],
1173
+ "text-fm-color-typo-primary fm-typo-en-body-md-400": !v[`${D}`]
1173
1174
  }
1174
1175
  ])
1175
- }, N(A), 3)
1176
+ }, N(D), 3)
1176
1177
  ]),
1177
1178
  _: 2
1178
1179
  }, 1032, ["label", "selected", "onClick"]))), 128))
1179
- ])) : X("", !0),
1180
- o("div", Vt, [
1180
+ ])) : ee("", !0),
1181
+ o("div", Yt, [
1181
1182
  o("div", {
1182
- style: Ie({ minWidth: `${he.value}px` })
1183
+ style: Ue({ minWidth: `${ce.value}px` })
1183
1184
  }, [
1184
- w(ae, {
1185
- "column-defs": pe.value,
1186
- "row-data": ve.value,
1187
- "search-value": ee.value
1185
+ w(te, {
1186
+ "column-defs": ve.value,
1187
+ "row-data": ye.value,
1188
+ "search-value": ie.value
1188
1189
  }, null, 8, ["column-defs", "row-data", "search-value"])
1189
1190
  ], 4)
1190
1191
  ])
1191
1192
  ], 64))
1192
1193
  ])
1193
- ], 64)) : X("", !0),
1194
- te.value.value === "history" ? (h(), T("div", Yt, [
1195
- Y.value.length ? (h(), T("div", Wt, [
1196
- (h(!0), T(q, null, ge(Y.value, (A, z) => (h(), T(q, { key: z }, [
1197
- o("div", qt, [
1198
- o("div", Zt, [
1199
- o("div", Jt, [
1194
+ ], 64)) : ee("", !0),
1195
+ K.value.value === "history" ? (h(), P("div", Kt, [
1196
+ Q.value.length ? (h(), P("div", Wt, [
1197
+ (h(!0), P(q, null, be(Q.value, (D, z) => (h(), P(q, { key: z }, [
1198
+ o("div", Zt, [
1199
+ o("div", Jt, [
1200
+ o("div", Xt, [
1200
1201
  o("div", {
1201
- class: fe([
1202
+ class: pe([
1202
1203
  {
1203
1204
  "bg-fm-color-primary": z !== 0,
1204
1205
  "bg-white": z === 0
@@ -1210,52 +1211,52 @@ const Ft = Ne(
1210
1211
  t[16] || (t[16] = o("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
1211
1212
  o("div", Qt, [
1212
1213
  o("div", {
1213
- class: fe([
1214
+ class: pe([
1214
1215
  {
1215
- "bg-fm-color-primary": z < Y.value.length - 1,
1216
- "bg-white": z >= Y.value.length - 1
1216
+ "bg-fm-color-primary": z < Q.value.length - 1,
1217
+ "bg-white": z >= Q.value.length - 1
1217
1218
  },
1218
1219
  "w-[2px] h-full"
1219
1220
  ])
1220
1221
  }, null, 2)
1221
1222
  ])
1222
1223
  ]),
1223
- o("div", Xt, [
1224
- o("div", ea, N(A.header), 1),
1225
- o("div", ta, N(A.date), 1)
1224
+ o("div", ea, [
1225
+ o("div", ta, N(D.header), 1),
1226
+ o("div", aa, N(D.date), 1)
1226
1227
  ])
1227
1228
  ]),
1228
- o("div", aa, [
1229
- o("div", na, [
1230
- o("div", oa, [
1229
+ o("div", na, [
1230
+ o("div", oa, [
1231
+ o("div", sa, [
1231
1232
  o("div", {
1232
- class: fe([
1233
+ class: pe([
1233
1234
  {
1234
- "bg-fm-color-primary": z < Y.value.length - 1,
1235
- "bg-white": z >= Y.value.length - 1
1235
+ "bg-fm-color-primary": z < Q.value.length - 1,
1236
+ "bg-white": z >= Q.value.length - 1
1236
1237
  },
1237
1238
  "w-[2px] h-full"
1238
1239
  ])
1239
1240
  }, null, 2)
1240
1241
  ])
1241
1242
  ]),
1242
- o("div", sa, [
1243
+ o("div", ra, [
1243
1244
  w(c, {
1244
1245
  variant: "outlined",
1245
1246
  class: "py-12 px-16"
1246
1247
  }, {
1247
- default: K(() => [
1248
- o("div", ra, [
1249
- (h(!0), T(q, null, ge(A.info, (V, de) => (h(), T("div", {
1250
- key: de,
1248
+ default: Y(() => [
1249
+ o("div", la, [
1250
+ (h(!0), P(q, null, be(D.info, (V, me) => (h(), P("div", {
1251
+ key: me,
1251
1252
  class: "flex flex-col gap-4"
1252
1253
  }, [
1253
- o("div", la, N(V == null ? void 0 : V.label), 1),
1254
- o("div", ca, [
1255
- (h(!0), T(q, null, ge(V == null ? void 0 : V.values, (Re, Ge) => (h(), T("div", {
1256
- key: Ge,
1254
+ o("div", ca, N(V == null ? void 0 : V.label), 1),
1255
+ o("div", ia, [
1256
+ (h(!0), P(q, null, be(V == null ? void 0 : V.values, (Te, qe) => (h(), P("div", {
1257
+ key: qe,
1257
1258
  class: "fm-typo-en-body-lg-600"
1258
- }, N(Re), 1))), 128))
1259
+ }, N(Te), 1))), 128))
1259
1260
  ])
1260
1261
  ]))), 128))
1261
1262
  ])
@@ -1265,65 +1266,65 @@ const Ft = Ne(
1265
1266
  ])
1266
1267
  ])
1267
1268
  ], 64))), 128))
1268
- ])) : (h(), T("div", Kt, [
1269
- w(W),
1269
+ ])) : (h(), P("div", Gt, [
1270
+ w(G),
1270
1271
  o("div", null, [
1271
1272
  o("img", {
1272
- src: g(bt),
1273
+ src: g(ht),
1273
1274
  alt: "List is empty"
1274
- }, null, 8, Gt)
1275
+ }, null, 8, qt)
1275
1276
  ]),
1276
1277
  t[14] || (t[14] = o("div", { class: "fm-typo-en-body-lg-600" }, N("No records found"), -1)),
1277
1278
  t[15] || (t[15] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, N("You can track approval and rejection history here"), -1)),
1278
- w(W),
1279
- w(W)
1279
+ w(G),
1280
+ w(G)
1280
1281
  ]))
1281
- ])) : X("", !0)
1282
+ ])) : ee("", !0)
1282
1283
  ])
1283
1284
  ]),
1284
1285
  _: 1
1285
1286
  }, 8, ["model-value"]);
1286
1287
  };
1287
1288
  }
1288
- }), da = { class: "flex-1 flex flex-col gap-8" }, ma = { class: "flex flex-col" }, fa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pa = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, va = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, ya = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, ka = /* @__PURE__ */ Se({
1289
+ }), ma = { class: "flex-1 flex flex-col gap-8" }, fa = { class: "flex flex-col" }, pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, va = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, ya = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, ga = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, wa = /* @__PURE__ */ Fe({
1289
1290
  __name: "ClosingDraftView",
1290
1291
  setup(n) {
1291
- const { t: s } = ze(), { viewDraft: e } = we(), { viewClosingDraftProps: d, viewClosingDraftShow: m } = gt(we()), b = Be(), x = Ft(), C = it(), { breakpoints: f } = yt();
1292
+ const { t: r } = Ne(), { viewDraft: e } = Ce(), { viewClosingDraftProps: i, viewClosingDraftShow: u } = bt(Ce()), b = je(), x = $t(), C = ut(), { breakpoints: d } = gt();
1292
1293
  b.watchLocation(x.fetchDrafts);
1293
- const F = E(() => x.loading), R = O(""), H = E(() => f.value.xs || f.value.sm), I = E(() => H.value ? 10 : 20);
1294
- function i(v) {
1295
- switch (v) {
1294
+ const F = E(() => x.loading), R = O(""), H = E(() => d.value.xs || d.value.sm), I = E(() => H.value ? 10 : 20);
1295
+ function l(y) {
1296
+ switch (y) {
1296
1297
  case "refresh":
1297
1298
  return x.fetchDrafts();
1298
1299
  }
1299
1300
  }
1300
- function r(v) {
1301
- return v;
1301
+ function p(y) {
1302
+ return y;
1302
1303
  }
1303
- const y = E(() => H.value ? [
1304
+ const v = E(() => H.value ? [
1304
1305
  {
1305
- label: s("inventory.common.refresh"),
1306
+ label: r("inventory.common.refresh"),
1306
1307
  value: "refresh",
1307
1308
  isPrimary: !1
1308
1309
  }
1309
1310
  ] : [
1310
1311
  {
1311
- label: s("inventory.common.refresh"),
1312
+ label: r("inventory.common.refresh"),
1312
1313
  value: "refresh",
1313
1314
  isPrimary: !1
1314
1315
  }
1315
1316
  ]);
1316
- return (v, _) => {
1317
+ return (y, A) => {
1317
1318
  const L = U("FmTable");
1318
- return h(), T(q, null, [
1319
- w(ut, {
1320
- title: g(s)("inventory.closing.draft.title"),
1321
- actions: y.value,
1322
- "onClick:action": i
1319
+ return h(), P(q, null, [
1320
+ w(dt, {
1321
+ title: g(r)("inventory.closing.draft.title"),
1322
+ actions: v.value,
1323
+ "onClick:action": l
1323
1324
  }, {
1324
- default: K(() => [
1325
+ default: Y(() => [
1325
1326
  o("div", {
1326
- class: fe([
1327
+ class: pe([
1327
1328
  "flex flex-col gap-8 max-h-full",
1328
1329
  {
1329
1330
  "p-0": H.value,
@@ -1331,58 +1332,58 @@ const Ft = Ne(
1331
1332
  }
1332
1333
  ])
1333
1334
  }, [
1334
- w(dt, {
1335
+ w(mt, {
1335
1336
  "change-location": "",
1336
1337
  searchable: "",
1337
1338
  search: R.value,
1338
- "onUpdate:search": _[0] || (_[0] = (D) => R.value = D)
1339
+ "onUpdate:search": A[0] || (A[0] = (_) => R.value = _)
1339
1340
  }, null, 8, ["search"]),
1340
1341
  w(L, {
1341
- style: Ie(g(C).tableHeight),
1342
+ style: Ue(g(C).tableHeight),
1342
1343
  "column-defs": g(x).columnDefs,
1343
1344
  "row-data": g(x).drafts,
1344
1345
  "search-value": R.value,
1345
1346
  loading: F.value,
1346
- onRowClick: _[1] || (_[1] = (D) => g(e)(D.original)),
1347
+ onRowClick: A[1] || (A[1] = (_) => g(e)(_.original)),
1347
1348
  "page-size": I.value
1348
1349
  }, {
1349
- "list-row": K((D) => [
1350
- w(mt, {
1351
- row: D,
1352
- onRowClick: (P) => g(e)(P)
1350
+ "list-row": Y((_) => [
1351
+ w(ft, {
1352
+ row: _,
1353
+ onRowClick: (T) => g(e)(T)
1353
1354
  }, {
1354
- default: K((P) => {
1355
- var S, G, le, Q, se, ce, pe, he, ee, ve, xe, ie, te, Y, ye, a, t, l, u, c;
1355
+ default: Y((T) => {
1356
+ var S, J, oe, X, se, xe, le, ve, ce, ie, ye, Ae, ue, K, Q, ge, a, t, s, m;
1356
1357
  return [
1357
- o("div", da, [
1358
- o("div", ma, [
1359
- o("div", fa, [
1360
- w(g(De), {
1361
- render: (le = (G = (S = P._id) == null ? void 0 : S.column) == null ? void 0 : G.columnDef) == null ? void 0 : le.cell,
1362
- props: (se = (Q = P._id) == null ? void 0 : Q.getContext) == null ? void 0 : se.call(Q)
1358
+ o("div", ma, [
1359
+ o("div", fa, [
1360
+ o("div", pa, [
1361
+ w(g(ke), {
1362
+ render: (oe = (J = (S = T._id) == null ? void 0 : S.column) == null ? void 0 : J.columnDef) == null ? void 0 : oe.cell,
1363
+ props: (se = (X = T._id) == null ? void 0 : X.getContext) == null ? void 0 : se.call(X)
1363
1364
  }, null, 8, ["render", "props"])
1364
1365
  ]),
1365
- o("div", pa, [
1366
- w(g(De), {
1367
- render: (he = (pe = (ce = P.name) == null ? void 0 : ce.column) == null ? void 0 : pe.columnDef) == null ? void 0 : he.cell,
1368
- props: (ve = (ee = P.name) == null ? void 0 : ee.getContext) == null ? void 0 : ve.call(ee)
1366
+ o("div", va, [
1367
+ w(g(ke), {
1368
+ render: (ve = (le = (xe = T.name) == null ? void 0 : xe.column) == null ? void 0 : le.columnDef) == null ? void 0 : ve.cell,
1369
+ props: (ie = (ce = T.name) == null ? void 0 : ce.getContext) == null ? void 0 : ie.call(ce)
1369
1370
  }, null, 8, ["render", "props"])
1370
1371
  ]),
1371
- o("div", va, N([
1372
- ...D.original.items.slice(0, 3).map((p) => p.sku.name),
1373
- ...D.original.items.length >= 3 ? [`and ${D.original.items.length - 3} more items`] : []
1372
+ o("div", ya, N([
1373
+ ..._.original.items.slice(0, 3).map((c) => c.sku.name),
1374
+ ..._.original.items.length >= 3 ? [`and ${_.original.items.length - 3} more items`] : []
1374
1375
  ].join(", ")), 1),
1375
- o("div", ya, [
1376
- w(g(De), {
1377
- render: (te = (ie = (xe = P.ref) == null ? void 0 : xe.column) == null ? void 0 : ie.columnDef) == null ? void 0 : te.cell,
1378
- props: (ye = (Y = P.ref) == null ? void 0 : Y.getContext) == null ? void 0 : ye.call(Y)
1376
+ o("div", ga, [
1377
+ w(g(ke), {
1378
+ render: (ue = (Ae = (ye = T.ref) == null ? void 0 : ye.column) == null ? void 0 : Ae.columnDef) == null ? void 0 : ue.cell,
1379
+ props: (Q = (K = T.ref) == null ? void 0 : K.getContext) == null ? void 0 : Q.call(K)
1379
1380
  }, null, 8, ["render", "props"])
1380
1381
  ])
1381
1382
  ]),
1382
1383
  o("div", null, [
1383
- w(g(De), {
1384
- render: (l = (t = (a = P.status) == null ? void 0 : a.column) == null ? void 0 : t.columnDef) == null ? void 0 : l.cell,
1385
- props: (c = (u = P.status) == null ? void 0 : u.getContext) == null ? void 0 : c.call(u)
1384
+ w(g(ke), {
1385
+ render: (t = (a = (ge = T.status) == null ? void 0 : ge.column) == null ? void 0 : a.columnDef) == null ? void 0 : t.cell,
1386
+ props: (m = (s = T.status) == null ? void 0 : s.getContext) == null ? void 0 : m.call(s)
1386
1387
  }, null, 8, ["render", "props"])
1387
1388
  ])
1388
1389
  ])
@@ -1397,12 +1398,12 @@ const Ft = Ne(
1397
1398
  ]),
1398
1399
  _: 1
1399
1400
  }, 8, ["title", "actions"]),
1400
- (h(), Z(Je, { to: "body" }, [
1401
- w(ua, Qe(g(d), {
1402
- show: g(m),
1403
- "onUpdate:show": _[2] || (_[2] = (D) => Me(m) ? m.value = D : null),
1404
- onSubmitted: _[3] || (_[3] = () => (m.value = !1, g(x).fetchDrafts())),
1405
- onRefresh: _[4] || (_[4] = (D) => g(x).updateDraftRef(D))
1401
+ (h(), W(Xe, { to: "body" }, [
1402
+ w(da, Qe(g(i), {
1403
+ show: g(u),
1404
+ "onUpdate:show": A[2] || (A[2] = (_) => Ie(u) ? u.value = _ : null),
1405
+ onSubmitted: A[3] || (A[3] = () => (u.value = !1, g(x).fetchDrafts())),
1406
+ onRefresh: A[4] || (A[4] = (_) => g(x).updateDraftRef(_))
1406
1407
  }), null, 16, ["show"])
1407
1408
  ]))
1408
1409
  ], 64);
@@ -1410,5 +1411,5 @@ const Ft = Ne(
1410
1411
  }
1411
1412
  });
1412
1413
  export {
1413
- ka as default
1414
+ wa as default
1414
1415
  };