@feedmepos/mf-inventory-portal 0.0.23-dev.18 → 0.0.23-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 (95) hide show
  1. package/dist/{App-Dfryh3pQ.js → App-DRE3c1lJ.js} +31 -36
  2. package/dist/{ApprovalView-CRrJeRCQ.js → ApprovalView-B4ZYcS3B.js} +4 -4
  3. package/dist/{BindingsDialog-Zh8FzTSI.js → BindingsDialog-Df1yrWHU.js} +2 -2
  4. package/dist/{BindingsPicker-BXChBNxv.js → BindingsPicker-BERMWh4w.js} +2 -2
  5. package/dist/{BindingsTable-BXB-X1N3.js → BindingsTable-DRIapOWW.js} +6 -6
  6. package/dist/{ClosingTemplateView-Bj6SiRlA.js → ClosingTemplateView-CbFn3Sdy.js} +31 -32
  7. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-7JYNssTm.js +267 -0
  8. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-B8RhFmN_.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-KbYSywk2.js} +2 -2
  9. package/dist/{FmMultiselectDialog-DWMt9hvV.js → FmMultiselectDialog-Da9JMCYa.js} +15 -15
  10. package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-BHSGZyJL.js +326 -0
  11. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Be_B1iME.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DH5IQchQ.js} +1 -1
  12. package/dist/{IngredientGroupView-DCOz2AOB.js → IngredientGroupView-DoETcEvV.js} +11 -12
  13. package/dist/IngredientsView-DHAhj9pV.js +1613 -0
  14. package/dist/{IntegrationView-BfoCYVHZ.js → IntegrationView-D1HeBiGF.js} +50 -50
  15. package/dist/{InventoryBindingForm-2Gs2vUtC.js → InventoryBindingForm-Dmz9BQ37.js} +1 -1
  16. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-D9Of6ewh.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DoyqVBOd.js} +13 -13
  17. package/dist/{InventoryBindingSummary-IUJt469w.js → InventoryBindingSummary-DrpwiRGZ.js} +1 -1
  18. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BtdmfQRZ.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-yNEswIEI.js} +1 -1
  19. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-C97vZfAO.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Br4_VUza.js} +2 -2
  20. package/dist/{PurchaseOrderPrintPreview-BRVCfgd3.js → PurchaseOrderPrintPreview-cp671yWE.js} +1 -1
  21. package/dist/ReceiveRequestView-C1WBlpho.js +4082 -0
  22. package/dist/{RecipeView-Br8u4xZZ.js → RecipeView-CD_dAWLo.js} +10 -11
  23. package/dist/{StockView-B2vBQLJf.js → StockView-DfUzFC1b.js} +1457 -1356
  24. package/dist/{SupplierView-S_qigSL4.js → SupplierView-DB-zrNxh.js} +783 -2352
  25. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-2mzqFGCz.js +1144 -0
  26. package/dist/TransferTemplateView-CaAJrqU6.js +1262 -0
  27. package/dist/{UnitView-CR019bWO.js → UnitView-BlC9-WOA.js} +80 -81
  28. package/dist/{WarehouseView-BX7K073o.js → WarehouseView-CgEY87Lo.js} +24 -25
  29. package/dist/api/bill.d.ts +2 -2
  30. package/dist/api/closing.d.ts +0 -1
  31. package/dist/api/netsuite.d.ts +0 -69
  32. package/dist/{app-BY6TZxqB.js → app-CAyFhmAz.js} +3343 -3426
  33. package/dist/app.d.ts +0 -5
  34. package/dist/app.js +1 -1
  35. package/dist/components/FmMinMaxInputRules.d.ts +1 -4
  36. package/dist/components/row-action.enum.d.ts +0 -1
  37. package/dist/{date2-C385gf6_.js → date2-D9i5izMt.js} +1 -1
  38. package/dist/{dayjs.min-CuXsxyJ4.js → dayjs.min-SJKP9zBL.js} +17 -17
  39. package/dist/{decimal-DmIrlkyN.js → decimal-D7BCubZO.js} +1 -1
  40. package/dist/{defineDeepModel-CJEdL37p.js → defineDeepModel-DS4Shctf.js} +1 -1
  41. package/dist/{feature-DM4scjOG.js → feature-BR-MsGYt.js} +9 -23
  42. package/dist/{format-time-from-id-DmDFxNOY.js → format-time-from-id-CUby60uW.js} +1 -1
  43. package/dist/format-unit-display-D25Al2JZ.js +1198 -0
  44. package/dist/{fuzzy-D2QbaWQl.js → fuzzy-BryBtMz_.js} +1 -1
  45. package/dist/{index-UtLEzrzf.js → index-ByJbUSIQ.js} +1 -1
  46. package/dist/index-CFA_VFyX.js +10545 -0
  47. package/dist/{index-BgM27D6z.js → index-CTvgBOum.js} +25 -28
  48. package/dist/netsuite-D0G4B60k.js +146 -0
  49. package/dist/normalizeArguments-DP7Hrren.js +1552 -0
  50. package/dist/router/name.d.ts +0 -1
  51. package/dist/{row-action.enum-7rGLGZ5v.js → row-action.enum-PMKMRrZR.js} +5 -10
  52. package/dist/{rules-WXcRCM31.js → rules-DxVY0b7F.js} +35 -40
  53. package/dist/stores/feature.d.ts +0 -2
  54. package/dist/stores/integration/netsuite.d.ts +0 -81
  55. package/dist/stores/inventory.d.ts +4 -1
  56. package/dist/style.css +1 -1
  57. package/dist/{supplier-Cg0hV-1Z.js → supplier-aBuwVukl.js} +22 -22
  58. package/dist/tsconfig.app.tsbuildinfo +1 -1
  59. package/dist/{use-inventory-binding-dialog-C4A0C-q4.js → use-inventory-binding-dialog-CLQ0LUmW.js} +2 -2
  60. package/dist/{use-template-enabled-locations-2-ClTvBbS6.js → use-template-enabled-locations-2-BgTiwy_3.js} +2 -2
  61. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +192 -24
  62. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +192 -24
  63. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +34 -34
  64. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +0 -1
  65. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +54 -54
  66. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +54 -54
  67. package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
  68. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +8 -8
  69. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +96 -96
  70. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +96 -96
  71. package/dist/{xlsx-jlUdZfql.js → xlsx-BbtURTDy.js} +1 -1
  72. package/dist/{xlsx.util-C4YF_j8p.js → xlsx.util-zYS4OJFi.js} +1 -1
  73. package/package.json +3 -3
  74. package/dist/ClosingDraftView-ZKdMqDrV.js +0 -1122
  75. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CZ1NPD07.js +0 -283
  76. package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-C--mzLIB.js +0 -329
  77. package/dist/IngredientsView-D3ptwZy1.js +0 -1666
  78. package/dist/ReceiveRequestView-Brh9jtUz.js +0 -4195
  79. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang--DGNx2VJ.js +0 -1235
  80. package/dist/TransferTemplateView-B0_EXehN.js +0 -1275
  81. package/dist/api/closing-draft.d.ts +0 -6
  82. package/dist/form-mode.enum-BKiNVH6A.js +0 -4
  83. package/dist/format-unit-display-DnZmCO-i.js +0 -1217
  84. package/dist/index-CKCFZ2N2.js +0 -12087
  85. package/dist/netsuite-CxzWHfIf.js +0 -251
  86. package/dist/stock-BVyJ8TZF.js +0 -111
  87. package/dist/views/closing-draft/ClosingDraftView.vue.d.ts +0 -2
  88. package/dist/views/closing-draft/components/closing-draft-action/ClosingDraftAction.vue.d.ts +0 -22
  89. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +0 -451
  90. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +0 -25
  91. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +0 -2601
  92. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +0 -1
  93. package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +0 -19
  94. package/dist/views/closing-draft/helpers/get-calculated-total.helper.d.ts +0 -4
  95. package/dist/views/receive-request/helper/check-netsuite-subsidiary.helper.d.ts +0 -1
@@ -1,1122 +0,0 @@
1
- import { defineComponent as fe, ref as E, resolveComponent as P, openBlock as _, createBlock as ae, withCtx as q, createElementVNode as o, createTextVNode as ye, toDisplayString as I, unref as b, createVNode as A, h as O, computed as U, onMounted as Me, watch as Pe, isRef as xe, createCommentVNode as ee, createElementBlock as F, Fragment as J, normalizeClass as te, renderList as le, normalizeStyle as De, Teleport as Ue, mergeProps as He } from "vue";
2
- import { u as Ie, _ as Le, a as ze } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-B8RhFmN_.js";
3
- import { useCoreStore as Ee, useI18n as Ae } from "@feedmepos/mf-common";
4
- import { useSnackbar as pe, useDialog as Ne, useProxiedModel as Oe, components as ce, useBreakpoints as Ke } from "@feedmepos/ui-library";
5
- import { k as Ve, u as ve, p as K, q as _e, r as oe, s as we, c as Ye, a as Ge } from "./app-BY6TZxqB.js";
6
- import { defineStore as ke, storeToRefs as qe } from "pinia";
7
- import { R as Ze, b as ge, a as k, t as We, c as ne, l as Ce, m as je, k as Se } from "./rules-WXcRCM31.js";
8
- import { t as Je, d as Qe } from "./xlsx.util-C4YF_j8p.js";
9
- import { f as Xe, d as G } from "./date2-C385gf6_.js";
10
- import { u as Be } from "./stock-BVyJ8TZF.js";
11
- import { D as be, R as ie } from "./row-action.enum-7rGLGZ5v.js";
12
- import { c as et, _ as tt, F as ue } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
13
- import { f as at } from "./format-time-from-id-DmDFxNOY.js";
14
- import { E as ot } from "./empty-placeholder-wf6-BWE8.js";
15
- const Fe = Ve((a, c) => {
16
- function e() {
17
- return ve().currentLocation.dbName;
18
- }
19
- return {
20
- async getDraft(i) {
21
- const d = e(), v = `${a.inventoryBackendUrl}/${d}/closing-draft/${i}`;
22
- return c.get(v);
23
- },
24
- async readDrafts() {
25
- const i = e(), d = `${a.inventoryBackendUrl}/${i}/closing-draft`;
26
- return c.get(d);
27
- },
28
- async runOperation(i) {
29
- const d = e(), v = `${a.inventoryBackendUrl}/${d}/closing-draft/run-operation`;
30
- return c.post(v, i);
31
- }
32
- };
33
- }), nt = { class: "fm-typo-en-body-lg-400" }, st = { class: "fm-typo-en-body-lg-600" }, rt = { class: "flex gap-12 py-8 justify-end w-full" }, he = /* @__PURE__ */ fe({
34
- __name: "ClosingDraftAction",
35
- props: {
36
- draft: {},
37
- action: {},
38
- onCancel: { type: Function },
39
- onFinished: { type: Function }
40
- },
41
- setup(a) {
42
- const c = a, e = E(), i = Fe(), d = pe(), v = E(!1);
43
- async function u() {
44
- v.value = !0;
45
- try {
46
- await i.runOperation({
47
- _id: c.draft._id,
48
- _rev: c.draft._rev ?? "",
49
- action: c.action,
50
- data: {
51
- remark: e.value
52
- }
53
- }).delayed(500), d.open({
54
- title: "Success",
55
- message: "Action submitted",
56
- type: "success"
57
- }), c.onFinished();
58
- } catch (m) {
59
- d.open({
60
- title: "Something went wrong",
61
- message: "Unable to submit actino. Please try again",
62
- type: "error"
63
- }), console.error("error on submit closing draft aciont", m);
64
- } finally {
65
- v.value = !1;
66
- }
67
- }
68
- return (m, g) => {
69
- const j = P("FmTextField"), R = P("FmButton"), $ = P("FmForm");
70
- return _(), ae($, {
71
- onValidationSuccess: u,
72
- class: "flex flex-col gap-32",
73
- disabled: v.value
74
- }, {
75
- default: q(() => [
76
- o("div", nt, [
77
- g[2] || (g[2] = ye(" You are about to ")),
78
- o("span", st, I(m.action == b(K).enum.approveDraft ? "approve" : "reject"), 1),
79
- g[3] || (g[3] = ye(" this draft. Please provider a remark to justify this action. "))
80
- ]),
81
- A(j, {
82
- modelValue: e.value,
83
- "onUpdate:modelValue": g[0] || (g[0] = (r) => e.value = r),
84
- label: "Remark",
85
- "label-mark": "required",
86
- rules: [b(Ze)()]
87
- }, null, 8, ["modelValue", "rules"]),
88
- o("div", rt, [
89
- A(R, {
90
- label: "Cancel",
91
- variant: "tertiary",
92
- onClick: g[1] || (g[1] = (r) => m.onCancel())
93
- }),
94
- A(R, {
95
- label: m.action == b(K).enum.approveDraft ? "Approve" : "Reject",
96
- type: "submit",
97
- variant: m.action == b(K).enum.approveDraft ? "primary" : "destructive",
98
- loading: v.value
99
- }, null, 8, ["label", "variant", "loading"])
100
- ])
101
- ]),
102
- _: 1
103
- }, 8, ["disabled"]);
104
- };
105
- }
106
- }), lt = ne(0);
107
- function $e(a) {
108
- const c = a.measurementsAmounts.groupBy((i) => i.measurement.id), e = a.sku.unit.measurements.reduce((i, d) => {
109
- var m, g;
110
- const v = ((g = (m = c.get(d.id)) == null ? void 0 : m[0]) == null ? void 0 : g.amount) ?? lt, u = ge(d.conversion, v);
111
- return i + +k(u);
112
- }, +k(a.baseAmount));
113
- return We(e, a.baseAmount.precision);
114
- }
115
- const ct = ne(0), it = ne(100);
116
- function ut(a, c) {
117
- const e = $e(a), i = Ce(e, c), d = c.amount === 0 ? null : je(i, c), v = d ? ge(d, it) : null;
118
- return {
119
- code: a.sku.code,
120
- name: a.sku.name,
121
- baseUnit: a.sku.unit.abbrev,
122
- baseUnitAmount: +k(a.baseAmount),
123
- ...a.measurementsAmounts.filter((m) => Re(m.measurement)).reduce(
124
- (m, g, j) => (m[`measurementAbbrev${j}`] = `(${g.measurement.abbrev}) × ${k(g.measurement.conversion)}`, m[`measurementAmount${j}`] = +k(g.amount), m),
125
- {}
126
- ),
127
- systemBalance: +k(c),
128
- physicalBalance: +k(e),
129
- adjustedAmount: +k(i),
130
- adjustedDiffPercentage: v ? +k(Se(v, 2)) : null
131
- };
132
- }
133
- function Re(a) {
134
- return !a.abbrev.toLocaleLowerCase().includes("inactive");
135
- }
136
- function dt(a) {
137
- return a.reduce((c, e) => c + e.sku.unit.measurements.filter(Re).length, 0);
138
- }
139
- function mt(a) {
140
- return [
141
- {
142
- id: "code",
143
- name: "Code"
144
- },
145
- {
146
- id: "name",
147
- name: "Name"
148
- },
149
- {
150
- id: "unit",
151
- name: "Base unit amount"
152
- },
153
- {
154
- id: "baseUnit",
155
- name: "Base unit"
156
- },
157
- ...Array.from({ length: a }).flatMap((e, i) => [
158
- {
159
- id: `measurementAmount${i}`,
160
- name: `UOM amount ${i + 1}`
161
- },
162
- {
163
- id: `measurementAbbrev${i}`,
164
- name: `UOM ${i + 1}`
165
- }
166
- ]),
167
- {
168
- id: "physicalBalance",
169
- name: "Total balance"
170
- },
171
- {
172
- id: "systemBalance",
173
- name: "System balance"
174
- },
175
- {
176
- id: "adjustedAmount",
177
- name: "Adjusted amount"
178
- },
179
- {
180
- id: "adjustedDiffPercentage",
181
- name: "Diff (%)"
182
- }
183
- ];
184
- }
185
- function ft(a, c) {
186
- var r, s, p, M, T, C, L;
187
- const e = c.groupBy(
188
- (y) => y.id,
189
- (y) => y.balance
190
- ), i = a.items.map((y) => {
191
- var Z;
192
- const S = ((Z = e.get(y.sku._id)) == null ? void 0 : Z[0]) ?? ct;
193
- return ut(y, S);
194
- }), d = dt(a.items), u = Ee().currentBusiness.value, m = mt(d), g = [
195
- ["Business name:", u == null ? void 0 : u.name],
196
- ["Business ID:", u == null ? void 0 : u._id],
197
- ["Menu version", u == null ? void 0 : u.menuVersion],
198
- ["Created at", new Date(a.createdAt)],
199
- ["Created by", (r = a.createdBy) == null ? void 0 : r.name],
200
- ["Updated at", new Date(a.updatedAt)],
201
- ["Updated by", (s = a.updatedBy) == null ? void 0 : s.name],
202
- ["Recent action", a.approvedAt ? "Approve" : a.rejectionHistory ? "Reject" : ""],
203
- [
204
- "Action by",
205
- a.approvedAt ? (p = a.approvedBy) == null ? void 0 : p.name : a.rejectionHistory ? (T = (M = a.rejectionHistory[0]) == null ? void 0 : M.rejectedBy) == null ? void 0 : T.name : ""
206
- ],
207
- [
208
- "Action at",
209
- a.approvedAt ? new Date(a.approvedAt) : a.rejectionHistory ? new Date((C = a.rejectionHistory[0]) == null ? void 0 : C.rejectedAt) : ""
210
- ],
211
- [
212
- "Action remark",
213
- a.approvedAt ? a.approveRemark : a.rejectionHistory ? new Date((L = a.rejectionHistory[0]) == null ? void 0 : L.rejectRemark) : ""
214
- ],
215
- [],
216
- m.map((y) => y.name),
217
- ...i.map((y) => m.map((S) => y[S.id]))
218
- ], j = m.map((y) => `system:${y.id}`), R = Je(g, j), $ = `[${u == null ? void 0 : u.name}] closing draft (${Xe(new Date(a.updatedAt))}).xlsx`;
219
- return Qe(R, $), $;
220
- }
221
- const de = ke(
222
- "closingDraftActions",
223
- function() {
224
- const c = Ne(), e = pe(), i = _e(), d = Be(), v = E(!1), u = E();
225
- function m(s) {
226
- const p = {
227
- draft: s
228
- };
229
- u.value = p, v.value = !0;
230
- }
231
- async function g(s) {
232
- var M;
233
- if (s.status === oe.enum.COMPLETED) {
234
- const T = s.closingId;
235
- if (!T)
236
- return e.open({
237
- title: "Something went wrong",
238
- message: "Closing draft is completed but closing document cannot be found.",
239
- type: "error"
240
- }), console.error("Closing draft is completed but closing document cannot be found.", {
241
- draftId: s == null ? void 0 : s._id
242
- }), [];
243
- const C = await i.getClosingById(T);
244
- return (C == null ? void 0 : C.skus) ?? [];
245
- } else
246
- return await d.readStockBalance(), ((M = d.stockBalance) == null ? void 0 : M.skus) ?? [];
247
- }
248
- async function j(s, p) {
249
- p || (e.open({
250
- title: "Exporting",
251
- message: "Fetching data..."
252
- }), p = await g(s)), ft(s, p);
253
- }
254
- function R(s, p) {
255
- c.open({
256
- title: "Approve draft",
257
- contentComponent: he,
258
- contentComponentProps: {
259
- draft: s,
260
- action: K.enum.approveDraft,
261
- onFinished: () => {
262
- c.close(), p == null || p();
263
- },
264
- onCancel: () => c.close()
265
- }
266
- });
267
- }
268
- function $(s, p) {
269
- c.open({
270
- title: "Reject draft",
271
- contentComponent: he,
272
- contentComponentProps: {
273
- draft: s,
274
- action: K.enum.rejectDraft,
275
- onFinished: () => {
276
- c.close(), p == null || p();
277
- },
278
- onCancel: () => c.close()
279
- }
280
- });
281
- }
282
- function r() {
283
- v.value = !1;
284
- }
285
- return {
286
- viewDraft: m,
287
- closeDraftDialog: r,
288
- approveDraft: R,
289
- rejectDraft: $,
290
- exportDraft: j,
291
- viewClosingDraftShow: v,
292
- viewClosingDraftProps: u
293
- };
294
- }
295
- );
296
- function Te(a) {
297
- switch (a) {
298
- case "DRAFT":
299
- return "fm-status-badge-draft";
300
- case "PROCESSING":
301
- return "fm-status-badge-processing";
302
- case "FAILED":
303
- return "fm-status-badge-cancel";
304
- case "COMPLETED":
305
- return "fm-status-badge-complete";
306
- }
307
- }
308
- const pt = ke("closingTable", function() {
309
- const { t: c } = Ae(), e = de(), i = E(new Array()), d = E(!1), v = ve(), u = Fe();
310
- async function m() {
311
- if (i.value = [], !!v._currentLocation) {
312
- d.value = !0;
313
- try {
314
- const [r] = await Promise.all([u.readDrafts()]).delayed(1e3);
315
- i.value = r.reverse();
316
- } catch (r) {
317
- console.log("Something went wrong when fetching drafts:", r);
318
- } finally {
319
- d.value = !1;
320
- }
321
- }
322
- }
323
- async function g(r) {
324
- if (!i.value.find((s) => s._id) && v._currentLocation) {
325
- d.value = !0;
326
- try {
327
- const [s] = await Promise.all([
328
- u.getDraft(r),
329
- new Promise((p) => setTimeout(p, 1e3))
330
- ]);
331
- i.value = [s];
332
- } catch (s) {
333
- console.log("Something went wrong when fetching drafts:", s);
334
- } finally {
335
- d.value = !1;
336
- }
337
- }
338
- }
339
- function j() {
340
- e.closeDraftDialog(), m();
341
- }
342
- function R(r, s) {
343
- switch (s = Ye(s), r) {
344
- case ie.Details:
345
- return e.viewDraft(s);
346
- case ie.Export:
347
- return e.exportDraft(s);
348
- case K.enum.approveDraft:
349
- return e.approveDraft(s, j);
350
- case K.enum.rejectDraft:
351
- return e.rejectDraft(s, j);
352
- }
353
- }
354
- return {
355
- columnDefs: [
356
- {
357
- id: "_id",
358
- accessorKey: "_id",
359
- header: () => c("inventory.closing.table.createdAt"),
360
- cell(r) {
361
- return at(`${r.getValue()}`);
362
- },
363
- enableSorting: !0
364
- },
365
- {
366
- id: "updatedAt",
367
- accessorFn: (r) => G(r.updatedAt),
368
- header: () => "Updated at",
369
- enableSorting: !0,
370
- size: 200
371
- },
372
- {
373
- id: "updatedBy",
374
- accessorKey: "updatedBy.name",
375
- header: () => "Last update by",
376
- enableSorting: !0,
377
- size: 200
378
- },
379
- {
380
- id: "noOfItems",
381
- accessorKey: "items.length",
382
- header: () => c("inventory.closing.table.noOfItems"),
383
- enableSorting: !1,
384
- meta: {
385
- width: "10rem",
386
- textAlign: "right"
387
- }
388
- },
389
- {
390
- id: "recentRemark",
391
- accessorFn: (r) => {
392
- var s;
393
- return (r == null ? void 0 : r.approveRemark) ?? ((s = r == null ? void 0 : r.rejectionHistory) == null ? void 0 : s.computeFirst((p) => p.rejectRemark));
394
- },
395
- header: () => "Recent remark"
396
- },
397
- {
398
- id: "status",
399
- accessorFn: (r) => r.status,
400
- header: () => c("inventory.closing.table.status"),
401
- enableSorting: !1,
402
- cell(r) {
403
- const p = r.row.original.status;
404
- return O(
405
- "div",
406
- {
407
- class: "flex"
408
- },
409
- O(
410
- "div",
411
- {
412
- class: ["fm-status-badge", Te(p)]
413
- },
414
- we(p)
415
- )
416
- );
417
- }
418
- },
419
- {
420
- id: "action",
421
- cell(r) {
422
- const s = r.row.original, p = [
423
- be[ie.Details],
424
- be[ie.Export]
425
- ], M = [
426
- {
427
- translationKey: "inventory.closing.draft.approveDraft",
428
- color: "text-fm-color-typo-primary",
429
- value: K.enum.approveDraft
430
- },
431
- {
432
- translationKey: "inventory.closing.draft.rejectDraft",
433
- color: "text-fm-color-typo-error",
434
- value: K.enum.rejectDraft
435
- }
436
- ];
437
- return et(
438
- [...p, ...s.status === oe.enum.DRAFT ? M : []],
439
- (T) => R(T, s)
440
- );
441
- },
442
- enableSorting: !1,
443
- size: 40,
444
- meta: {
445
- cellClass: "",
446
- headerClass: ""
447
- }
448
- }
449
- ],
450
- drafts: i,
451
- loading: d,
452
- fetchDrafts: m,
453
- loadDraft: g
454
- };
455
- }), vt = { class: "w-full flex flex-col gap-32" }, gt = { class: "flex justify-between" }, yt = { class: "flex" }, bt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ht = { class: "flex gap-1" }, xt = { class: "fm-typo-en-body-lg-600" }, Dt = { class: "flex flex-col gap-16" }, At = { class: "flex" }, _t = { key: 0 }, wt = {
456
- key: 0,
457
- class: "w-full flex flex-col items-center"
458
- }, kt = { class: "flex items-center gap-8" }, Ct = {
459
- key: 1,
460
- class: "overflow-x-auto"
461
- }, jt = {
462
- key: 1,
463
- class: "flex-1 xs:w-screen xs:max-w-full"
464
- }, St = {
465
- key: 0,
466
- class: "flex flex-col items-center gap-8 h-full"
467
- }, Bt = ["src"], Ft = {
468
- key: 1,
469
- class: "px-4 flex flex-col"
470
- }, $t = { class: "flex gap-12 content-stretch" }, Rt = {
471
- class: "flex flex-col w-24",
472
- name: "circles"
473
- }, Tt = { class: "flex-1 flex flex-col items-center" }, Mt = { class: "flex-1 flex flex-col items-center" }, Pt = {
474
- class: "py-12 flex flex-col gap-4",
475
- name: "received-at header"
476
- }, Ut = { class: "fm-typo-en-body-lg-400" }, Ht = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, It = { class: "flex gap-12 content-stretch" }, Lt = {
477
- class: "flex flex-col w-24",
478
- name: "circles"
479
- }, zt = { class: "flex-1 flex flex-col items-center" }, Et = {
480
- class: "py-12 flex flex-col gap-4 flex-1",
481
- name: "delivery details"
482
- }, Nt = { class: "flex flex-col gap-8" }, Ot = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Kt = { class: "flex flex-col gap-4" }, Vt = { class: "flex gap-8" }, Yt = /* @__PURE__ */ fe({
483
- __name: "ClosingDraftDialog",
484
- props: {
485
- show: { type: Boolean },
486
- draft: {}
487
- },
488
- emits: ["submitted"],
489
- setup(a, { emit: c }) {
490
- const e = a, i = Be(), d = de(), v = Oe(e, "show"), u = E(!1), m = E(new Array()), g = _e(), j = pe(), R = Ge(), $ = c, r = U(() => {
491
- var t;
492
- const n = ((t = e.draft) == null ? void 0 : t.items.map((f) => f.sku)) ?? [];
493
- return n.sort((f, l) => f.code.localeCompare(l.code)), n;
494
- });
495
- Me(M), Pe(
496
- () => e.show,
497
- (n) => {
498
- n && (z.value = Q[0], M());
499
- }
500
- );
501
- const s = ne(0), p = ne(100);
502
- async function M() {
503
- var t, f, l;
504
- u.value = !0;
505
- const n = ((t = e.draft) == null ? void 0 : t.status) === oe.enum.COMPLETED;
506
- try {
507
- if (await R.init(), n) {
508
- const h = e.draft.closingId;
509
- if (!h) {
510
- j.open({
511
- title: "Something went wrong",
512
- message: "Closing draft is completed but closing document cannot be found.",
513
- type: "error"
514
- }), console.error("Closing draft is completed but closing document cannot be found.", {
515
- draftId: (f = e.draft) == null ? void 0 : f._id
516
- });
517
- return;
518
- }
519
- const x = await g.getClosingById(h);
520
- m.value = (x == null ? void 0 : x.skus) ?? [];
521
- } else
522
- await i.readStockBalance(), m.value = ((l = i.stockBalance) == null ? void 0 : l.skus) ?? [];
523
- } catch (h) {
524
- j.open({
525
- title: "Something went wrong",
526
- message: "Something went wrong when fetching info. Please try again.",
527
- type: "error"
528
- }), console.error("error on fetch stock balances", h);
529
- } finally {
530
- u.value = !1;
531
- }
532
- }
533
- const T = U(
534
- () => m.value.groupBy(
535
- (n) => n.id,
536
- (n) => n.balance
537
- )
538
- ), C = U(() => {
539
- var t;
540
- return (((t = e.draft) == null ? void 0 : t.items) ?? []).groupBy((f) => f.sku._id);
541
- });
542
- function L(n) {
543
- return O(
544
- ce.FmTooltip,
545
- { zIndex: 51, placement: "left", class: "w-full flex justify-end" },
546
- {
547
- default() {
548
- return n;
549
- },
550
- content() {
551
- return "Differences are calculated using this formula: (Adjusted / System) × 100%";
552
- }
553
- }
554
- );
555
- }
556
- const y = U(() => {
557
- const n = r.value.reduce((f, l) => Math.max(
558
- f,
559
- l.unit.measurements.filter((h) => !h.name.toLocaleLowerCase().includes("inactive")).length
560
- ), 0);
561
- return [
562
- {
563
- id: "code",
564
- accessorKey: "code",
565
- header: () => "Code",
566
- size: 200
567
- },
568
- {
569
- id: "name",
570
- accessorKey: "name",
571
- header: () => "Name",
572
- size: 300
573
- },
574
- {
575
- id: "baseUnitAmount",
576
- accessorKey: "baseUnitAmount",
577
- header: () => L("Base unit amount"),
578
- size: 200,
579
- meta: {
580
- textAlign: "right"
581
- }
582
- },
583
- {
584
- id: "baseUnit",
585
- accessorKey: "baseUnit",
586
- header: () => "Base unit",
587
- size: 200
588
- },
589
- ...Array.from({ length: n }).flatMap((f, l) => {
590
- const h = `measurementAbbrev${l}`, x = `measurementAmount${l}`;
591
- return [
592
- {
593
- id: x,
594
- accessorKey: x,
595
- header: () => L(`UOM amount ${l + 1}`),
596
- size: 200,
597
- meta: {
598
- textAlign: "right"
599
- }
600
- },
601
- {
602
- id: h,
603
- accessorKey: h,
604
- header: () => `UOM ${l + 1}`,
605
- size: 200
606
- }
607
- ];
608
- }),
609
- {
610
- id: "physicalBalance",
611
- accessorKey: "physicalBalance",
612
- header: () => L("Total balance"),
613
- size: 200,
614
- meta: {
615
- textAlign: "right"
616
- }
617
- },
618
- {
619
- id: "systemBalance",
620
- accessorKey: "systemBalance",
621
- header: () => L("System balance"),
622
- size: 200,
623
- meta: {
624
- textAlign: "right"
625
- }
626
- },
627
- {
628
- id: "adjustedAmount",
629
- accessorKey: "adjustedAmount",
630
- header: () => L("Adjusted amount"),
631
- size: 200,
632
- meta: {
633
- textAlign: "right"
634
- }
635
- },
636
- {
637
- id: "adjustedDiffPercentage",
638
- accessorKey: "adjustedDiffPercentage",
639
- header: () => O(
640
- ce.FmTooltip,
641
- { zIndex: 51, placement: "left", class: "w-full flex justify-end" },
642
- {
643
- default() {
644
- return O("div", { class: "flex items-center gap-4" }, [
645
- "Diff (%)",
646
- O(ce.FmIcon, { name: "info", color: "neutral-gray-400", size: "sm" })
647
- ]);
648
- },
649
- content() {
650
- return "Differences are calculated using this formula: (Adjusted / System) × 100%";
651
- }
652
- }
653
- ),
654
- size: 200,
655
- cell(f) {
656
- const l = f.row.original.adjustedDiffPercentage;
657
- if (!l) return "N/A";
658
- const h = l.toFixed(2);
659
- if (h === "0.00")
660
- return O("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
661
- const x = l > 0;
662
- return O("div", { class: "flex items-center gap-4 justify-end" }, [
663
- O(ce.FmIcon, {
664
- name: x ? "arrow_drop_up" : "arrow_drop_down",
665
- color: x ? "system-success-300" : "system-error-300",
666
- size: "md"
667
- }),
668
- h
669
- ]);
670
- },
671
- meta: {
672
- textAlign: "right"
673
- }
674
- }
675
- ];
676
- }), S = U(() => y.value.map((n) => n.size ?? 0).reduce((n, t) => n + t)), Z = U(() => r.value.map((n) => {
677
- var H, W;
678
- const t = (H = C.value.get(n._id)) == null ? void 0 : H[0], f = ((W = T.value.get(n._id)) == null ? void 0 : W[0]) ?? s;
679
- if (!t)
680
- return {
681
- code: n.code,
682
- name: n.name,
683
- baseUnit: n.unit.abbrev,
684
- baseUnitAmount: 0,
685
- systemBalance: +k(f),
686
- physicalBalance: 0,
687
- adjustedAmount: -+k(f),
688
- adjustedDiffPercentage: -100
689
- };
690
- const l = $e(t), h = Ce(l, f), x = f.amount === 0 ? null : je(h, f), V = x ? ge(x, p) : null;
691
- return {
692
- code: n.code,
693
- name: n.name,
694
- baseUnit: n.unit.abbrev,
695
- baseUnitAmount: +k(t.baseAmount),
696
- ...t.measurementsAmounts.filter((D) => !D.measurement.name.toLocaleLowerCase().includes("inactive")).reduce((D, w, B) => (D[`measurementAbbrev${B}`] = `(${w.measurement.abbrev}) × ${k(w.measurement.conversion)}`, D[`measurementAmount${B}`] = +k(w.amount), D), {}),
697
- systemBalance: +k(f),
698
- physicalBalance: +k(l),
699
- adjustedAmount: +k(h),
700
- adjustedDiffPercentage: V ? +k(Se(V, 2)) : null
701
- };
702
- })), se = U(() => {
703
- var t, f;
704
- if (!e.draft) return [];
705
- const n = e.draft.approvedAt ? {
706
- action: `Approve at ${G(e.draft.approvedAt)}`,
707
- // actionAt: props.draft.approvedAt,
708
- actionBy: e.draft.approvedBy,
709
- remark: e.draft.approveRemark
710
- } : (t = e.draft.rejectionHistory) == null ? void 0 : t.computeFirst((l) => ({
711
- action: `Reject at ${G(l.rejectedAt)}`,
712
- // actionAt: e.rejectedAt,
713
- actionBy: l.rejectedBy,
714
- remark: l.rejectRemark
715
- }));
716
- return [
717
- {
718
- label: "Created at",
719
- value: G(e.draft.createdAt)
720
- },
721
- {
722
- label: "Created by",
723
- value: e.draft.createdBy.name
724
- },
725
- {
726
- label: "Updated at",
727
- value: G(e.draft.updatedAt)
728
- },
729
- {
730
- label: "Updated by",
731
- value: e.draft.updatedBy.name
732
- },
733
- {
734
- label: "Effective at",
735
- value: G(e.draft.effectiveAt ?? e.draft.updatedAt)
736
- },
737
- n ? {
738
- label: "Last action",
739
- value: n.action
740
- } : null,
741
- n && n.actionBy ? {
742
- label: "Last action by",
743
- value: (f = n.actionBy) == null ? void 0 : f.name
744
- } : null,
745
- n && n.remark ? {
746
- label: "Action remark",
747
- value: n.remark
748
- } : null
749
- ].filter((l) => l).map((l) => l);
750
- }), Q = [
751
- {
752
- label: "Overview",
753
- value: "overview"
754
- },
755
- {
756
- label: "Action history",
757
- value: "history"
758
- }
759
- ], z = E(Q[0]), N = U(() => {
760
- var t, f, l, h;
761
- return [
762
- ...(((t = e.draft) == null ? void 0 : t.rejectionHistory) ?? []).map(
763
- (x) => ({
764
- header: "Reject",
765
- date: G(x.rejectedAt),
766
- info: [
767
- {
768
- label: "Rejected by",
769
- values: [x.rejectedBy.name]
770
- },
771
- {
772
- label: "Rejection remark",
773
- values: [x.rejectRemark]
774
- }
775
- ]
776
- })
777
- ),
778
- ...(f = e.draft) != null && f.approvedBy ? [
779
- {
780
- header: "Approve",
781
- date: e.draft.approvedAt ? G(e.draft.approvedAt) : "",
782
- info: [
783
- {
784
- label: "Approved by",
785
- values: [(l = e.draft) == null ? void 0 : l.approvedBy.name]
786
- },
787
- {
788
- label: "Approval remark",
789
- values: [((h = e.draft) == null ? void 0 : h.approveRemark) ?? ""]
790
- }
791
- ]
792
- }
793
- ] : []
794
- ];
795
- });
796
- return (n, t) => {
797
- const f = P("FmButtonGroup"), l = P("FmMenuDivider"), h = P("FmCard"), x = P("FmButton"), V = P("FmCircularProgress"), X = P("FmTable"), H = P("FmSpacer"), W = P("FmSideSheet");
798
- return _(), ae(W, {
799
- "dismiss-away": "",
800
- "max-width": 900,
801
- "model-value": b(v),
802
- "onUpdate:modelValue": t[5] || (t[5] = (D) => xe(v) ? v.value = D : null),
803
- header: "Closing details"
804
- }, {
805
- "side-sheet-footer": q(() => {
806
- var D, w;
807
- return [
808
- o("div", Vt, [
809
- ((D = e.draft) == null ? void 0 : D.status) === b(oe).enum.DRAFT ? (_(), ae(x, {
810
- key: 0,
811
- label: "Approve",
812
- onClick: t[2] || (t[2] = () => e.draft && b(d).approveDraft(e.draft, () => $("submitted")))
813
- })) : ee("", !0),
814
- ((w = e.draft) == null ? void 0 : w.status) === b(oe).enum.DRAFT ? (_(), ae(x, {
815
- key: 1,
816
- label: "Reject",
817
- variant: "destructive",
818
- onClick: t[3] || (t[3] = () => e.draft && b(d).rejectDraft(e.draft, () => $("submitted")))
819
- })) : ee("", !0),
820
- A(x, {
821
- label: "Close",
822
- variant: "tertiary",
823
- onClick: t[4] || (t[4] = (B) => v.value = !1)
824
- })
825
- ])
826
- ];
827
- }),
828
- default: q(() => [
829
- o("div", vt, [
830
- o("div", null, [
831
- A(f, {
832
- items: Q,
833
- modelValue: z.value,
834
- "onUpdate:modelValue": t[0] || (t[0] = (D) => z.value = D)
835
- }, null, 8, ["modelValue"])
836
- ]),
837
- z.value.value === "overview" ? (_(), F(J, { key: 0 }, [
838
- A(h, {
839
- variant: "outlined",
840
- class: "flex flex-col gap-8 px-12 py-16"
841
- }, {
842
- default: q(() => {
843
- var D, w;
844
- return [
845
- o("div", gt, [
846
- t[6] || (t[6] = o("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
847
- o("div", yt, [
848
- o("div", {
849
- class: te(["fm-status-badge", b(Te)(((D = n.draft) == null ? void 0 : D.status) ?? "DRAFT")])
850
- }, I(b(we)(((w = n.draft) == null ? void 0 : w.status) ?? "")), 3)
851
- ])
852
- ]),
853
- A(l),
854
- (_(!0), F(J, null, le(se.value, (B, Y) => (_(), F("div", {
855
- class: "flex flex-col gap-4",
856
- key: Y
857
- }, [
858
- o("div", bt, [
859
- o("div", ht, I(B.label), 1)
860
- ]),
861
- o("div", xt, I(B.value), 1)
862
- ]))), 128))
863
- ];
864
- }),
865
- _: 1
866
- }),
867
- o("div", Dt, [
868
- o("div", At, [
869
- t[7] || (t[7] = o("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
870
- u.value ? ee("", !0) : (_(), F("div", _t, [
871
- A(x, {
872
- label: "Export data",
873
- "prepend-icon": "download",
874
- variant: "secondary",
875
- "text-color": "primary",
876
- "bg-color": "transparent",
877
- "border-color": "primary",
878
- onClick: t[1] || (t[1] = (D) => n.draft ? b(d).exportDraft(n.draft, m.value) : null)
879
- })
880
- ]))
881
- ]),
882
- u.value ? (_(), F("div", wt, [
883
- t[9] || (t[9] = o("div", { class: "h-80" }, null, -1)),
884
- o("div", kt, [
885
- o("div", null, [
886
- A(V, { size: "md" })
887
- ]),
888
- t[8] || (t[8] = o("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fetching info... ", -1))
889
- ]),
890
- t[10] || (t[10] = o("div", { class: "h-80" }, null, -1))
891
- ])) : (_(), F("div", Ct, [
892
- o("div", {
893
- style: De({ width: `${S.value}px` })
894
- }, [
895
- A(X, {
896
- "column-defs": y.value,
897
- "row-data": Z.value
898
- }, null, 8, ["column-defs", "row-data"])
899
- ], 4)
900
- ]))
901
- ])
902
- ], 64)) : ee("", !0),
903
- z.value.value === "history" ? (_(), F("div", jt, [
904
- N.value.length ? (_(), F("div", Ft, [
905
- (_(!0), F(J, null, le(N.value, (D, w) => (_(), F(J, { key: w }, [
906
- o("div", $t, [
907
- o("div", Rt, [
908
- o("div", Tt, [
909
- o("div", {
910
- class: te([
911
- {
912
- "bg-fm-color-primary": w !== 0,
913
- "bg-white": w === 0
914
- },
915
- "w-[2px] h-full"
916
- ])
917
- }, null, 2)
918
- ]),
919
- t[13] || (t[13] = o("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
920
- o("div", Mt, [
921
- o("div", {
922
- class: te([
923
- {
924
- "bg-fm-color-primary": w < N.value.length - 1,
925
- "bg-white": w >= N.value.length - 1
926
- },
927
- "w-[2px] h-full"
928
- ])
929
- }, null, 2)
930
- ])
931
- ]),
932
- o("div", Pt, [
933
- o("div", Ut, I(D.header), 1),
934
- o("div", Ht, I(D.date), 1)
935
- ])
936
- ]),
937
- o("div", It, [
938
- o("div", Lt, [
939
- o("div", zt, [
940
- o("div", {
941
- class: te([
942
- {
943
- "bg-fm-color-primary": w < N.value.length - 1,
944
- "bg-white": w >= N.value.length - 1
945
- },
946
- "w-[2px] h-full"
947
- ])
948
- }, null, 2)
949
- ])
950
- ]),
951
- o("div", Et, [
952
- A(h, {
953
- variant: "outlined",
954
- class: "py-12 px-16"
955
- }, {
956
- default: q(() => [
957
- o("div", Nt, [
958
- (_(!0), F(J, null, le(D.info, (B, Y) => (_(), F("div", {
959
- key: Y,
960
- class: "flex flex-col gap-4"
961
- }, [
962
- o("div", Ot, I(B == null ? void 0 : B.label), 1),
963
- o("div", Kt, [
964
- (_(!0), F(J, null, le(B == null ? void 0 : B.values, (re, me) => (_(), F("div", {
965
- key: me,
966
- class: "fm-typo-en-body-lg-600"
967
- }, I(re), 1))), 128))
968
- ])
969
- ]))), 128))
970
- ])
971
- ]),
972
- _: 2
973
- }, 1024)
974
- ])
975
- ])
976
- ], 64))), 128))
977
- ])) : (_(), F("div", St, [
978
- A(H),
979
- o("div", null, [
980
- o("img", {
981
- src: b(ot),
982
- alt: "List is empty"
983
- }, null, 8, Bt)
984
- ]),
985
- t[11] || (t[11] = o("div", { class: "fm-typo-en-body-lg-600" }, I("No records found"), -1)),
986
- t[12] || (t[12] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, I("You can track approval and rejection history here"), -1)),
987
- A(H),
988
- A(H)
989
- ]))
990
- ])) : ee("", !0)
991
- ])
992
- ]),
993
- _: 1
994
- }, 8, ["model-value"]);
995
- };
996
- }
997
- }), Gt = { class: "flex-1 flex flex-col gap-8" }, qt = { class: "flex flex-col" }, Zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Wt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Jt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Qt = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, fa = /* @__PURE__ */ fe({
998
- __name: "ClosingDraftView",
999
- setup(a) {
1000
- const { t: c } = Ae(), { viewDraft: e } = de(), { viewClosingDraftProps: i, viewClosingDraftShow: d } = qe(de()), v = ve(), u = pt(), m = Ie(), { breakpoints: g } = Ke();
1001
- v.watchLocation(u.fetchDrafts);
1002
- const j = U(() => u.loading), R = E(""), $ = U(() => g.value.xs || g.value.sm), r = U(() => $.value ? 10 : 20);
1003
- function s(T) {
1004
- switch (T) {
1005
- case "refresh":
1006
- return u.fetchDrafts();
1007
- }
1008
- }
1009
- function p(T) {
1010
- return T;
1011
- }
1012
- const M = U(() => $.value ? [
1013
- {
1014
- label: "Refresh",
1015
- value: "refresh",
1016
- isPrimary: !1
1017
- }
1018
- ] : [
1019
- {
1020
- label: "Refresh",
1021
- value: "refresh",
1022
- isPrimary: !1
1023
- }
1024
- ]);
1025
- return (T, C) => {
1026
- const L = P("FmTable");
1027
- return _(), F(J, null, [
1028
- A(Le, {
1029
- title: b(c)("inventory.closing.draft.title"),
1030
- actions: M.value,
1031
- "onClick:action": s
1032
- }, {
1033
- default: q(() => [
1034
- o("div", {
1035
- class: te([
1036
- "flex flex-col gap-8 max-h-full",
1037
- {
1038
- "p-0": $.value,
1039
- "px-24 ": !$.value
1040
- }
1041
- ])
1042
- }, [
1043
- A(ze, {
1044
- "change-location": "",
1045
- searchable: "",
1046
- search: R.value,
1047
- "onUpdate:search": C[0] || (C[0] = (y) => R.value = y)
1048
- }, null, 8, ["search"]),
1049
- A(L, {
1050
- style: De(b(m).tableHeight),
1051
- "column-defs": b(u).columnDefs,
1052
- "row-data": b(u).drafts,
1053
- "search-value": R.value,
1054
- loading: j.value,
1055
- onRowClick: C[1] || (C[1] = (y) => b(e)(y.original)),
1056
- "page-size": r.value
1057
- }, {
1058
- "list-row": q((y) => [
1059
- A(tt, {
1060
- row: y,
1061
- onRowClick: (S) => b(e)(S)
1062
- }, {
1063
- default: q((S) => {
1064
- var Z, se, Q, z, N, n, t, f, l, h, x, V, X, H, W, D, w, B, Y, re;
1065
- return [
1066
- o("div", Gt, [
1067
- o("div", qt, [
1068
- o("div", Zt, [
1069
- A(b(ue), {
1070
- render: (Q = (se = (Z = S._id) == null ? void 0 : Z.column) == null ? void 0 : se.columnDef) == null ? void 0 : Q.cell,
1071
- props: (N = (z = S._id) == null ? void 0 : z.getContext) == null ? void 0 : N.call(z)
1072
- }, null, 8, ["render", "props"])
1073
- ]),
1074
- o("div", Wt, [
1075
- A(b(ue), {
1076
- render: (f = (t = (n = S.name) == null ? void 0 : n.column) == null ? void 0 : t.columnDef) == null ? void 0 : f.cell,
1077
- props: (h = (l = S.name) == null ? void 0 : l.getContext) == null ? void 0 : h.call(l)
1078
- }, null, 8, ["render", "props"])
1079
- ]),
1080
- o("div", Jt, I([
1081
- ...y.original.items.slice(0, 3).map((me) => me.sku.name),
1082
- ...y.original.items.length >= 3 ? [`and ${y.original.items.length - 3} more items`] : []
1083
- ].join(", ")), 1),
1084
- o("div", Qt, [
1085
- A(b(ue), {
1086
- render: (X = (V = (x = S.ref) == null ? void 0 : x.column) == null ? void 0 : V.columnDef) == null ? void 0 : X.cell,
1087
- props: (W = (H = S.ref) == null ? void 0 : H.getContext) == null ? void 0 : W.call(H)
1088
- }, null, 8, ["render", "props"])
1089
- ])
1090
- ]),
1091
- o("div", null, [
1092
- A(b(ue), {
1093
- render: (B = (w = (D = S.status) == null ? void 0 : D.column) == null ? void 0 : w.columnDef) == null ? void 0 : B.cell,
1094
- props: (re = (Y = S.status) == null ? void 0 : Y.getContext) == null ? void 0 : re.call(Y)
1095
- }, null, 8, ["render", "props"])
1096
- ])
1097
- ])
1098
- ];
1099
- }),
1100
- _: 2
1101
- }, 1032, ["row", "onRowClick"])
1102
- ]),
1103
- _: 1
1104
- }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
1105
- ], 2)
1106
- ]),
1107
- _: 1
1108
- }, 8, ["title", "actions"]),
1109
- (_(), ae(Ue, { to: "body" }, [
1110
- A(Yt, He(b(i), {
1111
- show: b(d),
1112
- "onUpdate:show": C[2] || (C[2] = (y) => xe(d) ? d.value = y : null),
1113
- onSubmitted: C[3] || (C[3] = () => (d.value = !1, b(u).fetchDrafts()))
1114
- }), null, 16, ["show"])
1115
- ]))
1116
- ], 64);
1117
- };
1118
- }
1119
- });
1120
- export {
1121
- fa as default
1122
- };