@feedmepos/mf-inventory-portal 1.2.43-dev.3 → 1.2.44-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-DkzM4M0_.js → App-D6h4PbkJ.js} +3 -3
- package/dist/{ApprovalView-Dd5bg0yE.js → ApprovalView-Bll-QWib.js} +5 -5
- package/dist/{BindingsDialog-FoyqtujI.js → BindingsDialog-cm-tG1Du.js} +2 -2
- package/dist/{BindingsPicker-D-DS3PdA.js → BindingsPicker-Ca0BxJKj.js} +2 -2
- package/dist/{BindingsTable-viPFJCPm.js → BindingsTable-BBNWeq4W.js} +3 -3
- package/dist/{ClosingDraftView-BlaIq6iS.js → ClosingDraftView-r2C27qph.js} +766 -723
- package/dist/ClosingHistoryView-CGV72nOD.js +447 -0
- package/dist/{ClosingTemplateView-Dil7tncI.js → ClosingTemplateView-Xij995aZ.js} +14 -14
- package/dist/{DeliveryOrderPrintPreview-zvfi--WO.js → DeliveryOrderPrintPreview-BoBBu5lC.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-_dZiJ1_p.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-SnXudMX4.js} +4 -4
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DBSjX9GC.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-ClY0PFyA.js} +2 -2
- package/dist/{FmMultiselectDialog-CEnIfKkK.js → FmMultiselectDialog-BcZpbDMT.js} +2 -2
- package/dist/{FmMultiselectDialog-D0HzUEWj.js → FmMultiselectDialog-C9g5u6Kk.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BG2lia-P.js → FmUnitInput.vue_vue_type_script_setup_true_lang-B-PD6CbF.js} +3 -3
- package/dist/{ImportView-XUXFdNd5.js → ImportView-CzMwJY2A.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DgutuH9i.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DgOrurbQ.js} +1 -1
- package/dist/{IngredientGroupView-7UTiTjiy.js → IngredientGroupView-DBbwP3E6.js} +5 -5
- package/dist/{IngredientsView-BkK-S9zb.js → IngredientsView-jRqkzOTc.js} +14 -14
- package/dist/{IntegrationView-BTXcGlp6.js → IntegrationView-B-_39POT.js} +12 -12
- package/dist/{InventoryBindingForm-Ch3ltUK8.js → InventoryBindingForm-D14aWQqg.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Dnv5PN-O.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DtHtGqKw.js} +4 -4
- package/dist/{InventoryBindingSummary-BVKjiIfs.js → InventoryBindingSummary-B7Q-G4Fx.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CbK0JN-7.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CqB7pkKN.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-dv4OBeHd.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BfHSMN6k.js} +2 -2
- package/dist/{PublishView-g_HbS6jK.js → PublishView-C_icogKG.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-BReNCrqT.js → PurchaseOrderPrintPreview-BeXqhfRn.js} +1 -1
- package/dist/{ReceiveRequestView-ClT4-xel.js → ReceiveRequestView-COdOrOyg.js} +18 -18
- package/dist/{RecipeView-CtpQ2a0y.js → RecipeView-Desvtm1a.js} +8 -8
- package/dist/{StockView-CEbdj6YL.js → StockView-B1NDBHQh.js} +15 -15
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Bofw0-xa.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CbCD3pOQ.js} +1 -1
- package/dist/{SupplierView-DzmEjA3j.js → SupplierView-CB6Gz5HH.js} +11 -11
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-0A8OWe8S.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-3bruORgT.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-bxporBJ4.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-C0Vd0X-5.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-cDwtvgIk.js → TransferDetails.vue_vue_type_script_setup_true_lang-Bnt6-X4t.js} +14 -14
- package/dist/{TransferTemplateView-ySDW6lRS.js → TransferTemplateView-CLeLzBvW.js} +15 -15
- package/dist/{UnitView-Bv91T6ab.js → UnitView-YM302P8g.js} +6 -6
- package/dist/{WarehouseView-kPmRof7c.js → WarehouseView-D69BsVsb.js} +5 -5
- package/dist/WastageTemplateView-DfP43M8-.js +2327 -0
- package/dist/api/stock.d.ts +2 -0
- package/dist/{app-CV3h70p4.js → app-BuvV4n4w.js} +8 -7
- package/dist/app.js +1 -1
- package/dist/{closing-template-BBIWBX0k.js → closing-template-D1NlAV-G.js} +1 -1
- package/dist/{date2-CkCGGaAb.js → date2-CkkGwYSP.js} +1 -1
- package/dist/{dayjs.min-Dd-afiDx.js → dayjs.min-DFvOuCCo.js} +1 -1
- package/dist/{decimal-CS-CxyFz.js → decimal-D1O4-kbG.js} +2 -2
- package/dist/{defineDeepModel-D_bZeRgl.js → defineDeepModel-s0no34Rq.js} +1 -1
- package/dist/{duplicate-template-DPXszoh-.js → duplicate-template-DJceVj9n.js} +1 -1
- package/dist/{feature-B_VTGztb.js → feature-AINxwcz_.js} +255 -257
- package/dist/{format-time-from-id-BmBEi-Jw.js → format-time-from-id-CRiwabgV.js} +1 -1
- package/dist/{format-unit-display-CDKsLgE4.js → format-unit-display-kd8gPWFg.js} +10 -10
- package/dist/{import-export.helper-BLfWO3Yr.js → import-export.helper-CtI9oUN_.js} +5 -5
- package/dist/{index-DU9SwtH5.js → index-Af5Cs7r5.js} +1 -1
- package/dist/{index-BRDlwURl.js → index-BVBQnKv6.js} +3 -3
- package/dist/{index-DAnsA0Mm.js → index-DKTL7IN3.js} +1 -1
- package/dist/{lodash-CYR2InSF.js → lodash-TAQPcjEK.js} +1 -1
- package/dist/{netsuite-CPkzurdj.js → netsuite-CcC4Y1c-.js} +3 -3
- package/dist/{purchase-order-template-DNQiObjY.js → purchase-order-template-B-Xuh5oQ.js} +1 -1
- package/dist/{rules-2RvCSF3q.js → rules-DwOMpBOV.js} +3 -3
- package/dist/{stock-BWBlXMgT.js → stock-DolMZJgQ.js} +3 -3
- package/dist/{stock-RjFuloPL.js → stock-X1ADgvOm.js} +35 -27
- package/dist/{supplier-8UMBjffB.js → supplier-DTzECjWy.js} +2 -2
- package/dist/{use-ingredient-select-dialog-DsrecsJw.js → use-ingredient-select-dialog-D7UCiLcS.js} +2 -2
- package/dist/{use-inventory-binding-dialog-C4bcTum8.js → use-inventory-binding-dialog-uYYsTsLi.js} +2 -2
- package/dist/{use-template-enabled-locations-2-_G7NryCx.js → use-template-enabled-locations-2-l2e5ocrp.js} +2 -2
- package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +7 -0
- package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +4 -1
- package/dist/{vue-i18n-BU7aJfqP.js → vue-i18n-anAmA_v_.js} +448 -448
- package/dist/{xlsx-JEiDJdww.js → xlsx-CtBehOaB.js} +1 -1
- package/dist/{xlsx.util-Cc50iTml.js → xlsx.util-jpTCFIaP.js} +1 -1
- package/package.json +4 -4
- package/dist/ClosingHistoryView-Byb3JIG8.js +0 -391
- package/dist/WastageTemplateView-CZq9b3sy.js +0 -2287
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { F as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { useSnackbar as
|
|
5
|
-
import { o as
|
|
6
|
-
import { defineStore as kt, storeToRefs as
|
|
7
|
-
import { d as
|
|
8
|
-
import { R as
|
|
9
|
-
import { b as
|
|
10
|
-
import { u as
|
|
11
|
-
import { u as
|
|
12
|
-
import { D as
|
|
13
|
-
import { c as
|
|
14
|
-
import { f as
|
|
15
|
-
import { _ as
|
|
16
|
-
import { E as
|
|
17
|
-
const
|
|
1
|
+
import { defineComponent as He, ref as Y, computed as L, onMounted as Ze, resolveComponent as z, openBlock as S, createElementBlock as E, Fragment as ie, createTextVNode as se, createBlock as oe, withCtx as Q, createElementVNode as c, toDisplayString as ne, unref as $, createVNode as A, createCommentVNode as te, h as x, reactive as It, watch as Ut, isRef as vt, normalizeClass as Fe, renderList as Te, normalizeStyle as gt, Teleport as Pt, mergeProps as Rt } from "vue";
|
|
2
|
+
import { F as Ge, u as Mt, _ as Vt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
|
|
3
|
+
import { useCoreStore as yt, useI18n as bt } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as Je, useDialog as Lt, useProxiedModel as Nt, components as ge, useBreakpoints as Et } from "@feedmepos/ui-library";
|
|
5
|
+
import { o as zt, u as Oe, H as O, s as V, I as ht, J as pe, A as Ve, v as Le, c as Ht, a as Ot } from "./app-BuvV4n4w.js";
|
|
6
|
+
import { defineStore as kt, storeToRefs as Yt } from "pinia";
|
|
7
|
+
import { d as Ee, e as Dt, f as Kt, a as ye } from "./date2-CkkGwYSP.js";
|
|
8
|
+
import { R as Qt, f as Xe, a as We, t as qt, d as je, o as xt, p as At, m as _t, l as Gt } from "./rules-DwOMpBOV.js";
|
|
9
|
+
import { b as Wt, d as Zt } from "./xlsx.util-jpTCFIaP.js";
|
|
10
|
+
import { u as wt } from "./stock-DolMZJgQ.js";
|
|
11
|
+
import { u as et } from "./stock-X1ADgvOm.js";
|
|
12
|
+
import { D as pt, R as Se } from "./row-action.enum-BcW_L_nE.js";
|
|
13
|
+
import { c as Jt, _ as Xt, F as Me } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
|
|
14
|
+
import { f as ea } from "./format-time-from-id-CRiwabgV.js";
|
|
15
|
+
import { _ as ta } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-ClY0PFyA.js";
|
|
16
|
+
import { E as aa } from "./empty-placeholder-wf6-BWE8.js";
|
|
17
|
+
const Ye = zt((l, s) => {
|
|
18
18
|
function e() {
|
|
19
|
-
return
|
|
19
|
+
return Oe().currentLocation.dbName;
|
|
20
20
|
}
|
|
21
21
|
return {
|
|
22
|
-
async getDraft(
|
|
23
|
-
const
|
|
24
|
-
return s.get(
|
|
22
|
+
async getDraft(d) {
|
|
23
|
+
const h = e(), y = `${l.inventoryBackendUrl}/${h}/closing-draft/${d}`;
|
|
24
|
+
return s.get(y);
|
|
25
25
|
},
|
|
26
26
|
async readDrafts() {
|
|
27
|
-
const
|
|
28
|
-
return s.get(
|
|
27
|
+
const d = e(), h = `${l.inventoryBackendUrl}/${d}/closing-draft`;
|
|
28
|
+
return s.get(h);
|
|
29
29
|
},
|
|
30
|
-
async runOperation(
|
|
31
|
-
const
|
|
32
|
-
return s.post(
|
|
30
|
+
async runOperation(d) {
|
|
31
|
+
const h = e(), y = `${l.inventoryBackendUrl}/${h}/closing-draft/run-operation`;
|
|
32
|
+
return s.post(y, d);
|
|
33
33
|
},
|
|
34
|
-
async runOperationV1(
|
|
35
|
-
const
|
|
36
|
-
return s.post(
|
|
34
|
+
async runOperationV1(d) {
|
|
35
|
+
const h = e(), y = `${l.inventoryBackendUrl}/${h}/closing-draft/v1/run-operation`;
|
|
36
|
+
return s.post(y, d);
|
|
37
37
|
},
|
|
38
|
-
async sync(
|
|
39
|
-
const
|
|
40
|
-
return s.post(
|
|
38
|
+
async sync(d) {
|
|
39
|
+
const h = e(), y = `${l.inventoryBackendUrl}/${h}/closing-draft/sync`;
|
|
40
|
+
return s.post(y, d);
|
|
41
41
|
},
|
|
42
|
-
async cloneDraft(
|
|
43
|
-
const
|
|
44
|
-
return s.post(
|
|
42
|
+
async cloneDraft(d) {
|
|
43
|
+
const h = e(), y = `${l.inventoryBackendUrl}/${h}/closing-draft/${d}/clone`;
|
|
44
|
+
return s.post(y, {});
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
}),
|
|
47
|
+
}), na = { class: "fm-typo-en-body-lg-400" }, oa = { class: "fm-typo-en-body-lg-600" }, sa = {
|
|
48
48
|
key: 0,
|
|
49
49
|
class: "flex flex-col"
|
|
50
|
-
},
|
|
50
|
+
}, ra = {
|
|
51
51
|
key: 0,
|
|
52
52
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-error mt-4"
|
|
53
|
-
},
|
|
53
|
+
}, la = { class: "flex gap-12 py-8 justify-end w-full" }, qe = /* @__PURE__ */ He({
|
|
54
54
|
__name: "ClosingDraftAction",
|
|
55
55
|
props: {
|
|
56
56
|
draft: {},
|
|
@@ -58,8 +58,8 @@ const He = Et((r, s) => {
|
|
|
58
58
|
onCancel: { type: Function },
|
|
59
59
|
onFinished: { type: Function }
|
|
60
60
|
},
|
|
61
|
-
setup(
|
|
62
|
-
const s =
|
|
61
|
+
setup(l) {
|
|
62
|
+
const s = l, e = Y(), d = Ye(), h = Je(), y = Y(!1), b = Y(null), I = Y(!1), M = L(() => {
|
|
63
63
|
switch (s.action) {
|
|
64
64
|
case O.enum.approveDraft:
|
|
65
65
|
return "Approve";
|
|
@@ -80,221 +80,221 @@ const He = Et((r, s) => {
|
|
|
80
80
|
}
|
|
81
81
|
throw new Error(`Unknown action: ${s.action}`);
|
|
82
82
|
});
|
|
83
|
-
|
|
83
|
+
Ze(() => {
|
|
84
84
|
if (s.draft.effectiveAt)
|
|
85
|
-
|
|
85
|
+
b.value = new Date(s.draft.effectiveAt);
|
|
86
86
|
else {
|
|
87
87
|
const u = new Date(s.draft.createdAt);
|
|
88
|
-
u.setHours(23, 59, 59, 999),
|
|
88
|
+
u.setHours(23, 59, 59, 999), b.value = u;
|
|
89
89
|
}
|
|
90
90
|
I.value = !0;
|
|
91
91
|
});
|
|
92
|
-
const
|
|
92
|
+
const k = L({
|
|
93
93
|
get() {
|
|
94
|
-
return
|
|
94
|
+
return b.value === null ? "" : Ee(b.value);
|
|
95
95
|
},
|
|
96
96
|
set(u) {
|
|
97
97
|
if (u) {
|
|
98
98
|
const t = /* @__PURE__ */ new Date(`${u} ${P.value}`);
|
|
99
|
-
t.setSeconds(59, 999),
|
|
99
|
+
t.setSeconds(59, 999), b.value = t;
|
|
100
100
|
} else
|
|
101
|
-
|
|
101
|
+
b.value = null;
|
|
102
102
|
}
|
|
103
103
|
}), P = L({
|
|
104
104
|
get() {
|
|
105
|
-
return
|
|
105
|
+
return b.value === null ? "" : Dt(b.value);
|
|
106
106
|
},
|
|
107
107
|
set(u) {
|
|
108
108
|
if (u) {
|
|
109
|
-
const t = /* @__PURE__ */ new Date(`${
|
|
110
|
-
t.setSeconds(59, 999),
|
|
109
|
+
const t = /* @__PURE__ */ new Date(`${k.value} ${u}`);
|
|
110
|
+
t.setSeconds(59, 999), b.value = t;
|
|
111
111
|
} else
|
|
112
|
-
|
|
112
|
+
b.value = null;
|
|
113
113
|
}
|
|
114
|
-
}), B = L(() =>
|
|
115
|
-
async function
|
|
116
|
-
|
|
114
|
+
}), B = L(() => b.value ? b.value.getTime() > (/* @__PURE__ */ new Date()).getTime() : !1);
|
|
115
|
+
async function q(u) {
|
|
116
|
+
y.value = !0;
|
|
117
117
|
try {
|
|
118
|
-
u ? await
|
|
118
|
+
u ? await d.runOperationV1({
|
|
119
119
|
_id: s.draft._id,
|
|
120
120
|
_rev: s.draft._rev ?? "",
|
|
121
121
|
action: s.action,
|
|
122
122
|
data: {
|
|
123
|
-
effectiveAt:
|
|
123
|
+
effectiveAt: b.value ? b.value.toISOString() : null,
|
|
124
124
|
remark: e.value
|
|
125
125
|
}
|
|
126
|
-
}).delayed(500) : await
|
|
126
|
+
}).delayed(500) : await d.runOperation({
|
|
127
127
|
_id: s.draft._id,
|
|
128
128
|
_rev: s.draft._rev ?? "",
|
|
129
129
|
action: s.action,
|
|
130
130
|
data: {
|
|
131
|
-
effectiveAt:
|
|
131
|
+
effectiveAt: b.value ? b.value.toISOString() : null,
|
|
132
132
|
remark: e.value
|
|
133
133
|
}
|
|
134
|
-
}).delayed(500),
|
|
134
|
+
}).delayed(500), h.open({
|
|
135
135
|
title: "Success",
|
|
136
136
|
message: "Action submitted",
|
|
137
137
|
type: "success"
|
|
138
138
|
}), s.onFinished();
|
|
139
139
|
} catch (t) {
|
|
140
|
-
|
|
140
|
+
h.open({
|
|
141
141
|
title: "Something went wrong",
|
|
142
142
|
message: (t == null ? void 0 : t.message) ?? "Unable to submit action. Please try again",
|
|
143
143
|
type: "error"
|
|
144
144
|
}), console.error("error on submit closing draft action", t);
|
|
145
145
|
} finally {
|
|
146
|
-
|
|
146
|
+
y.value = !1;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
return (u, t) => {
|
|
150
|
-
const _ = z("FmLabel"), R = z("FmDatePicker"),
|
|
151
|
-
return I.value ? (
|
|
150
|
+
const _ = z("FmLabel"), R = z("FmDatePicker"), N = z("FmTimePicker"), g = z("FmTextField"), m = z("FmButton"), F = z("FmForm");
|
|
151
|
+
return I.value ? (S(), oe(F, {
|
|
152
152
|
key: 1,
|
|
153
|
-
onValidationSuccess:
|
|
153
|
+
onValidationSuccess: q,
|
|
154
154
|
class: "flex flex-col gap-32",
|
|
155
|
-
disabled:
|
|
155
|
+
disabled: y.value
|
|
156
156
|
}, {
|
|
157
157
|
default: Q(() => [
|
|
158
|
-
c("div",
|
|
159
|
-
t[5] || (t[5] =
|
|
160
|
-
c("span",
|
|
161
|
-
t[6] || (t[6] =
|
|
158
|
+
c("div", na, [
|
|
159
|
+
t[5] || (t[5] = se(" You are about to ")),
|
|
160
|
+
c("span", oa, ne(M.value), 1),
|
|
161
|
+
t[6] || (t[6] = se(" this draft. Please provide a remark to justify this action. "))
|
|
162
162
|
]),
|
|
163
|
-
u.action === $(O).enum.approveDraft ? (
|
|
164
|
-
|
|
163
|
+
u.action === $(O).enum.approveDraft ? (S(), E("div", sa, [
|
|
164
|
+
A(_, { class: "fm-typo-en-body-lg-600" }, {
|
|
165
165
|
default: Q(() => t[7] || (t[7] = [
|
|
166
|
-
|
|
166
|
+
se("Closing Date")
|
|
167
167
|
])),
|
|
168
168
|
_: 1
|
|
169
169
|
}),
|
|
170
|
-
|
|
171
|
-
modelValue:
|
|
172
|
-
"onUpdate:modelValue": t[0] || (t[0] = (H) =>
|
|
173
|
-
max: $(
|
|
170
|
+
A(R, {
|
|
171
|
+
modelValue: k.value,
|
|
172
|
+
"onUpdate:modelValue": t[0] || (t[0] = (H) => k.value = H),
|
|
173
|
+
max: $(Ee)(/* @__PURE__ */ new Date())
|
|
174
174
|
}, null, 8, ["modelValue", "max"]),
|
|
175
|
-
|
|
175
|
+
A(_, { class: "fm-typo-en-body-lg-600" }, {
|
|
176
176
|
default: Q(() => t[8] || (t[8] = [
|
|
177
|
-
|
|
177
|
+
se("Closing Time")
|
|
178
178
|
])),
|
|
179
179
|
_: 1
|
|
180
180
|
}),
|
|
181
|
-
|
|
181
|
+
A(N, {
|
|
182
182
|
modelValue: P.value,
|
|
183
183
|
"onUpdate:modelValue": t[1] || (t[1] = (H) => P.value = H)
|
|
184
184
|
}, null, 8, ["modelValue"]),
|
|
185
|
-
B.value ? (
|
|
186
|
-
])) :
|
|
187
|
-
|
|
185
|
+
B.value ? (S(), E("div", ra, " Cannot select future date ")) : te("", !0)
|
|
186
|
+
])) : te("", !0),
|
|
187
|
+
A(g, {
|
|
188
188
|
modelValue: e.value,
|
|
189
189
|
"onUpdate:modelValue": t[2] || (t[2] = (H) => e.value = H),
|
|
190
190
|
label: "Remark",
|
|
191
191
|
"label-mark": "required",
|
|
192
|
-
rules: [$(
|
|
192
|
+
rules: [$(Qt)()]
|
|
193
193
|
}, null, 8, ["modelValue", "rules"]),
|
|
194
|
-
c("div",
|
|
195
|
-
|
|
194
|
+
c("div", la, [
|
|
195
|
+
A(m, {
|
|
196
196
|
label: "Cancel",
|
|
197
197
|
variant: "tertiary",
|
|
198
198
|
onClick: t[3] || (t[3] = (H) => u.onCancel())
|
|
199
199
|
}),
|
|
200
|
-
u.action === $(O).enum.approveDraft ? (
|
|
200
|
+
u.action === $(O).enum.approveDraft ? (S(), oe(Ge, { key: 0 }, {
|
|
201
201
|
default: Q(() => [
|
|
202
|
-
|
|
202
|
+
A(m, {
|
|
203
203
|
label: "Approve (Legacy)",
|
|
204
204
|
type: "button",
|
|
205
|
-
onClick: t[4] || (t[4] = (H) =>
|
|
205
|
+
onClick: t[4] || (t[4] = (H) => q(!0)),
|
|
206
206
|
variant: U.value,
|
|
207
|
-
loading:
|
|
207
|
+
loading: y.value,
|
|
208
208
|
disabled: B.value
|
|
209
209
|
}, null, 8, ["variant", "loading", "disabled"])
|
|
210
210
|
]),
|
|
211
211
|
_: 1
|
|
212
|
-
})) :
|
|
213
|
-
|
|
214
|
-
label:
|
|
212
|
+
})) : te("", !0),
|
|
213
|
+
A(m, {
|
|
214
|
+
label: M.value,
|
|
215
215
|
type: "submit",
|
|
216
216
|
variant: U.value,
|
|
217
|
-
loading:
|
|
217
|
+
loading: y.value
|
|
218
218
|
}, null, 8, ["label", "variant", "loading"])
|
|
219
219
|
])
|
|
220
220
|
]),
|
|
221
221
|
_: 1
|
|
222
|
-
}, 8, ["disabled"])) : (
|
|
223
|
-
|
|
222
|
+
}, 8, ["disabled"])) : (S(), E(ie, { key: 0 }, [
|
|
223
|
+
se("Loading")
|
|
224
224
|
], 64));
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
|
-
}),
|
|
228
|
-
function
|
|
229
|
-
const s =
|
|
230
|
-
var I,
|
|
231
|
-
const
|
|
232
|
-
return
|
|
233
|
-
}, +
|
|
234
|
-
return
|
|
227
|
+
}), ia = je(0);
|
|
228
|
+
function St(l) {
|
|
229
|
+
const s = l.measurementsAmounts.groupBy((d) => d.measurement.id), e = l.sku.unit.measurements.reduce((d, h) => {
|
|
230
|
+
var I, M;
|
|
231
|
+
const y = ((M = (I = s.get(h.id)) == null ? void 0 : I[0]) == null ? void 0 : M.amount) ?? ia, b = Xe(h.conversion, y);
|
|
232
|
+
return d + +We(b);
|
|
233
|
+
}, +We(l.baseAmount));
|
|
234
|
+
return qt(e, l.baseAmount.precision);
|
|
235
235
|
}
|
|
236
|
-
const
|
|
237
|
-
function
|
|
238
|
-
var
|
|
239
|
-
const
|
|
236
|
+
const ca = je(0), ua = je(100), Ft = "N/A";
|
|
237
|
+
function ma(l, s, e, d, h, y) {
|
|
238
|
+
var K, J, w, X, me;
|
|
239
|
+
const b = St(l), I = d ?? b, M = xt(I, s), U = s.amount === 0 ? null : At(M, {
|
|
240
240
|
...s,
|
|
241
241
|
amount: Math.abs(s.amount)
|
|
242
|
-
}),
|
|
242
|
+
}), k = U ? Xe(U, ua) : null, P = ((K = l.sku.defaultCost) == null ? void 0 : K.costPerUnit) ?? { amount: 0, precision: 0 }, B = Number(V.toFormatString({ value: P })), q = ((w = (J = l.sku.defaultCost) == null ? void 0 : J.measurement) == null ? void 0 : w.conversion) ?? {
|
|
243
243
|
amount: 1,
|
|
244
244
|
precision: 0
|
|
245
245
|
}, u = Number(
|
|
246
|
-
V.toFormatString({ value:
|
|
247
|
-
), t =
|
|
246
|
+
V.toFormatString({ value: q })
|
|
247
|
+
), t = h ? Number(V.toFormatString({ value: h })) : 0, _ = Number(V.toFormatString({ value: s })), R = Number(V.toFormatString({ value: I })), N = _ - R, g = N * B / u, m = R * B / u, F = _ * B / u;
|
|
248
248
|
return {
|
|
249
|
-
code:
|
|
250
|
-
name:
|
|
251
|
-
baseUnit:
|
|
252
|
-
costUnit: ((me = (X =
|
|
253
|
-
baseUnitAmount: Number(V.toFormatString({ value:
|
|
254
|
-
...
|
|
255
|
-
(
|
|
249
|
+
code: l.sku.code,
|
|
250
|
+
name: l.sku.name,
|
|
251
|
+
baseUnit: l.sku.unit.abbrev,
|
|
252
|
+
costUnit: ((me = (X = l.sku.defaultCost) == null ? void 0 : X.measurement) == null ? void 0 : me.abbrev) ?? null,
|
|
253
|
+
baseUnitAmount: Number(V.toFormatString({ value: l.baseAmount })),
|
|
254
|
+
...l.measurementsAmounts.filter(
|
|
255
|
+
(ae) => da(ae.measurement) && e.includes(ae.measurement.id)
|
|
256
256
|
).reduce(
|
|
257
|
-
(
|
|
257
|
+
(ae, re, de) => (ae[`measurementAbbrev${de}`] = `(${re.measurement.abbrev}) × ${V.toFormatString({ value: re.measurement.conversion })}`, ae[`measurementAmount${de}`] = Number(V.toFormatString({ value: re.amount })), ae),
|
|
258
258
|
{}
|
|
259
259
|
),
|
|
260
260
|
systemBalance: _,
|
|
261
261
|
physicalBalance: R,
|
|
262
|
-
adjustedAmount: Number(V.toFormatString({ value:
|
|
263
|
-
adjustedDiffPercentage:
|
|
262
|
+
adjustedAmount: Number(V.toFormatString({ value: M })),
|
|
263
|
+
adjustedDiffPercentage: k ? Number(
|
|
264
264
|
V.toFormatString({
|
|
265
|
-
value:
|
|
265
|
+
value: _t(k, 2)
|
|
266
266
|
})
|
|
267
267
|
) : null,
|
|
268
268
|
costPerUnit: B,
|
|
269
269
|
opening: t,
|
|
270
|
-
adjustmentTypes:
|
|
271
|
-
varianceQty:
|
|
272
|
-
varianceInCost:
|
|
273
|
-
stockTakeValue:
|
|
274
|
-
systemValue:
|
|
270
|
+
adjustmentTypes: y ?? Ft,
|
|
271
|
+
varianceQty: N,
|
|
272
|
+
varianceInCost: g,
|
|
273
|
+
stockTakeValue: m,
|
|
274
|
+
systemValue: F
|
|
275
275
|
};
|
|
276
276
|
}
|
|
277
|
-
function
|
|
278
|
-
return !
|
|
277
|
+
function da(l) {
|
|
278
|
+
return !l.abbrev.toLocaleLowerCase().includes("inactive");
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
const s =
|
|
282
|
-
return
|
|
283
|
-
(e,
|
|
284
|
-
var
|
|
285
|
-
return Math.max(e, ((
|
|
280
|
+
function fa(l) {
|
|
281
|
+
const s = Ct(l);
|
|
282
|
+
return l.reduce(
|
|
283
|
+
(e, d) => {
|
|
284
|
+
var h;
|
|
285
|
+
return Math.max(e, ((h = s == null ? void 0 : s.get(d.sku._id)) == null ? void 0 : h[0].length) ?? 0);
|
|
286
286
|
},
|
|
287
287
|
0
|
|
288
288
|
);
|
|
289
289
|
}
|
|
290
|
-
function
|
|
291
|
-
return
|
|
290
|
+
function Ct(l) {
|
|
291
|
+
return l.groupBy(
|
|
292
292
|
(s) => s.sku._id,
|
|
293
293
|
(s) => s.measurementsAmounts.filter((e) => !e.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((e) => e.measurement.id)
|
|
294
294
|
);
|
|
295
295
|
}
|
|
296
|
-
function
|
|
297
|
-
const s =
|
|
296
|
+
function pa(l) {
|
|
297
|
+
const s = ht(), e = s === "MYR" ? "RM" : s;
|
|
298
298
|
return [
|
|
299
299
|
{
|
|
300
300
|
id: "code",
|
|
@@ -360,175 +360,175 @@ function fa(r) {
|
|
|
360
360
|
id: "baseUnitAmount",
|
|
361
361
|
name: "Base unit amount"
|
|
362
362
|
},
|
|
363
|
-
...Array.from({ length:
|
|
363
|
+
...Array.from({ length: l }).flatMap((h, y) => [
|
|
364
364
|
{
|
|
365
|
-
id: `measurementAmount${
|
|
366
|
-
name: `UOM amount ${
|
|
365
|
+
id: `measurementAmount${y}`,
|
|
366
|
+
name: `UOM amount ${y + 1}`
|
|
367
367
|
},
|
|
368
368
|
{
|
|
369
|
-
id: `measurementAbbrev${
|
|
370
|
-
name: `UOM ${
|
|
369
|
+
id: `measurementAbbrev${y}`,
|
|
370
|
+
name: `UOM ${y + 1}`
|
|
371
371
|
}
|
|
372
372
|
])
|
|
373
373
|
];
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
var
|
|
377
|
-
const
|
|
378
|
-
(
|
|
379
|
-
(
|
|
380
|
-
),
|
|
381
|
-
(
|
|
382
|
-
(
|
|
383
|
-
),
|
|
384
|
-
if (
|
|
385
|
-
for (const
|
|
386
|
-
|
|
387
|
-
const
|
|
388
|
-
if (
|
|
389
|
-
for (const
|
|
390
|
-
const X = Object.keys(
|
|
391
|
-
|
|
375
|
+
function va(l, s, e) {
|
|
376
|
+
var N, g, m, F, H, K, J;
|
|
377
|
+
const d = s.groupBy(
|
|
378
|
+
(w) => w.id,
|
|
379
|
+
(w) => w.balance
|
|
380
|
+
), h = e.groupBy(
|
|
381
|
+
(w) => w.id,
|
|
382
|
+
(w) => w.balance
|
|
383
|
+
), y = /* @__PURE__ */ new Map();
|
|
384
|
+
if (l.opening)
|
|
385
|
+
for (const w of l.opening)
|
|
386
|
+
y.set(w.skuId, w.balance);
|
|
387
|
+
const b = /* @__PURE__ */ new Map();
|
|
388
|
+
if (l.adjustmentSnapshot)
|
|
389
|
+
for (const w of l.adjustmentSnapshot) {
|
|
390
|
+
const X = Object.keys(w.adjustmentsByType).join(", ");
|
|
391
|
+
b.set(w.skuId, X || Ft);
|
|
392
392
|
}
|
|
393
|
-
const I = [...
|
|
394
|
-
var de,
|
|
395
|
-
const X = ((de =
|
|
396
|
-
return
|
|
397
|
-
|
|
393
|
+
const I = [...l.items, ...l.negativeStockItems ?? []], M = Ct(I), U = I.map((w) => {
|
|
394
|
+
var de, be, he;
|
|
395
|
+
const X = ((de = d.get(w.sku._id)) == null ? void 0 : de[0]) ?? ca, me = ((be = M == null ? void 0 : M.get(w.sku._id)) == null ? void 0 : be[0]) ?? [], ae = y.get(w.sku._id), re = b.get(w.sku._id);
|
|
396
|
+
return ma(
|
|
397
|
+
w,
|
|
398
398
|
X,
|
|
399
399
|
me,
|
|
400
|
-
(
|
|
401
|
-
|
|
402
|
-
|
|
400
|
+
(he = h.get(w.sku._id)) == null ? void 0 : he[0],
|
|
401
|
+
ae,
|
|
402
|
+
re
|
|
403
403
|
);
|
|
404
|
-
}),
|
|
404
|
+
}), k = fa(I), B = yt().currentBusiness.value, q = pa(k), u = [
|
|
405
405
|
["Business name:", B == null ? void 0 : B.name],
|
|
406
406
|
["Business ID:", B == null ? void 0 : B._id],
|
|
407
407
|
["Menu version", B == null ? void 0 : B.menuVersion],
|
|
408
|
-
["Created at", new Date(
|
|
409
|
-
["Created by", (
|
|
410
|
-
["Updated at", new Date(
|
|
411
|
-
["Updated by", (
|
|
412
|
-
["Recent action",
|
|
408
|
+
["Created at", new Date(l.createdAt)],
|
|
409
|
+
["Created by", (N = l.createdBy) == null ? void 0 : N.name],
|
|
410
|
+
["Updated at", new Date(l.updatedAt)],
|
|
411
|
+
["Updated by", (g = l.updatedBy) == null ? void 0 : g.name],
|
|
412
|
+
["Recent action", l.approvedAt ? "Approve" : l.rejectionHistory ? "Reject" : ""],
|
|
413
413
|
[
|
|
414
414
|
"Action by",
|
|
415
|
-
|
|
415
|
+
l.approvedAt ? (m = l.approvedBy) == null ? void 0 : m.name : l.rejectionHistory ? (H = (F = l.rejectionHistory[0]) == null ? void 0 : F.rejectedBy) == null ? void 0 : H.name : ""
|
|
416
416
|
],
|
|
417
417
|
[
|
|
418
418
|
"Action at",
|
|
419
|
-
|
|
419
|
+
l.approvedAt ? new Date(l.approvedAt) : l.rejectionHistory ? new Date((K = l.rejectionHistory[0]) == null ? void 0 : K.rejectedAt) : ""
|
|
420
420
|
],
|
|
421
421
|
[
|
|
422
422
|
"Action remark",
|
|
423
|
-
|
|
423
|
+
l.approvedAt ? l.approveRemark : l.rejectionHistory ? new Date((J = l.rejectionHistory[0]) == null ? void 0 : J.rejectRemark) : ""
|
|
424
424
|
],
|
|
425
425
|
[],
|
|
426
|
-
|
|
427
|
-
...U.map((
|
|
428
|
-
], t =
|
|
429
|
-
return
|
|
426
|
+
q.map((w) => w.name),
|
|
427
|
+
...U.map((w) => q.map((X) => w[X.id]))
|
|
428
|
+
], t = q.map((w) => `system:${w.id}`), _ = Wt(u, t), R = `[${B == null ? void 0 : B.name}] closing draft (${Kt(new Date(l.updatedAt))}).xlsx`;
|
|
429
|
+
return Zt(_, R), R;
|
|
430
430
|
}
|
|
431
|
-
const
|
|
431
|
+
const ga = { class: "flex flex-col" }, ya = {
|
|
432
432
|
key: 0,
|
|
433
433
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-error mt-4"
|
|
434
|
-
},
|
|
434
|
+
}, ba = { class: "flex gap-12 py-8 justify-end w-full" }, ha = /* @__PURE__ */ He({
|
|
435
435
|
__name: "RefreshBalanceAction",
|
|
436
436
|
props: {
|
|
437
437
|
draft: {},
|
|
438
438
|
onCancel: { type: Function },
|
|
439
439
|
onFinished: { type: Function }
|
|
440
440
|
},
|
|
441
|
-
setup(
|
|
442
|
-
const s =
|
|
443
|
-
|
|
444
|
-
const e = Y(!1),
|
|
445
|
-
|
|
441
|
+
setup(l) {
|
|
442
|
+
const s = l;
|
|
443
|
+
et();
|
|
444
|
+
const e = Y(!1), d = Y(null), h = Y(!1);
|
|
445
|
+
Ze(() => {
|
|
446
446
|
if (s.draft.effectiveAt)
|
|
447
|
-
|
|
447
|
+
d.value = new Date(s.draft.effectiveAt);
|
|
448
448
|
else {
|
|
449
449
|
const U = new Date(s.draft.createdAt);
|
|
450
|
-
U.setHours(23, 59, 59, 999),
|
|
450
|
+
U.setHours(23, 59, 59, 999), d.value = U;
|
|
451
451
|
}
|
|
452
|
-
|
|
452
|
+
h.value = !0;
|
|
453
453
|
});
|
|
454
|
-
const
|
|
454
|
+
const y = L({
|
|
455
455
|
get() {
|
|
456
|
-
return
|
|
456
|
+
return d.value === null ? "" : Ee(d.value);
|
|
457
457
|
},
|
|
458
458
|
set(U) {
|
|
459
459
|
if (U) {
|
|
460
|
-
const
|
|
461
|
-
|
|
460
|
+
const k = /* @__PURE__ */ new Date(`${U} ${b.value}`);
|
|
461
|
+
k.setSeconds(59, 999), d.value = k;
|
|
462
462
|
} else
|
|
463
|
-
|
|
463
|
+
d.value = null;
|
|
464
464
|
}
|
|
465
|
-
}),
|
|
465
|
+
}), b = L({
|
|
466
466
|
get() {
|
|
467
|
-
return
|
|
467
|
+
return d.value === null ? "" : Dt(d.value);
|
|
468
468
|
},
|
|
469
469
|
set(U) {
|
|
470
470
|
if (U) {
|
|
471
|
-
const
|
|
472
|
-
|
|
471
|
+
const k = /* @__PURE__ */ new Date(`${y.value} ${U}`);
|
|
472
|
+
k.setSeconds(59, 999), d.value = k;
|
|
473
473
|
} else
|
|
474
|
-
|
|
474
|
+
d.value = null;
|
|
475
475
|
}
|
|
476
|
-
}), I = L(() =>
|
|
477
|
-
async function
|
|
478
|
-
e.value = !0, s.onFinished(
|
|
476
|
+
}), I = L(() => d.value ? d.value.getTime() > (/* @__PURE__ */ new Date()).getTime() : !1);
|
|
477
|
+
async function M() {
|
|
478
|
+
e.value = !0, s.onFinished(d.value.toISOString());
|
|
479
479
|
}
|
|
480
|
-
return (U,
|
|
481
|
-
const P = z("FmLabel"), B = z("FmDatePicker"),
|
|
482
|
-
return
|
|
480
|
+
return (U, k) => {
|
|
481
|
+
const P = z("FmLabel"), B = z("FmDatePicker"), q = z("FmTimePicker"), u = z("FmButton"), t = z("FmForm");
|
|
482
|
+
return h.value ? (S(), oe(t, {
|
|
483
483
|
key: 1,
|
|
484
|
-
onValidationSuccess:
|
|
484
|
+
onValidationSuccess: M,
|
|
485
485
|
class: "flex flex-col gap-32",
|
|
486
486
|
disabled: e.value
|
|
487
487
|
}, {
|
|
488
488
|
default: Q(() => [
|
|
489
|
-
|
|
489
|
+
k[5] || (k[5] = c("div", { class: "fm-typo-en-body-lg-400" }, [
|
|
490
490
|
c("p", null, [
|
|
491
|
-
|
|
491
|
+
se(" Performing "),
|
|
492
492
|
c("span", { class: "fm-typo-en-body-lg-600" }, '"Refresh Balance"'),
|
|
493
|
-
|
|
493
|
+
se(" until closing effective date and time. ")
|
|
494
494
|
]),
|
|
495
495
|
c("p", { class: "mt-2" }, [
|
|
496
|
-
|
|
496
|
+
se(" Please note that this action will "),
|
|
497
497
|
c("b", null, "update"),
|
|
498
|
-
|
|
498
|
+
se(" the effective date and time. ")
|
|
499
499
|
])
|
|
500
500
|
], -1)),
|
|
501
|
-
c("div",
|
|
502
|
-
|
|
503
|
-
default: Q(() =>
|
|
504
|
-
|
|
501
|
+
c("div", ga, [
|
|
502
|
+
A(P, { class: "fm-typo-en-body-lg-600" }, {
|
|
503
|
+
default: Q(() => k[3] || (k[3] = [
|
|
504
|
+
se("Closing Date")
|
|
505
505
|
])),
|
|
506
506
|
_: 1
|
|
507
507
|
}),
|
|
508
|
-
|
|
509
|
-
modelValue:
|
|
510
|
-
"onUpdate:modelValue":
|
|
511
|
-
max: $(
|
|
508
|
+
A(B, {
|
|
509
|
+
modelValue: y.value,
|
|
510
|
+
"onUpdate:modelValue": k[0] || (k[0] = (_) => y.value = _),
|
|
511
|
+
max: $(Ee)(/* @__PURE__ */ new Date())
|
|
512
512
|
}, null, 8, ["modelValue", "max"]),
|
|
513
|
-
|
|
514
|
-
default: Q(() =>
|
|
515
|
-
|
|
513
|
+
A(P, { class: "fm-typo-en-body-lg-600" }, {
|
|
514
|
+
default: Q(() => k[4] || (k[4] = [
|
|
515
|
+
se("Closing Time")
|
|
516
516
|
])),
|
|
517
517
|
_: 1
|
|
518
518
|
}),
|
|
519
|
-
|
|
520
|
-
modelValue:
|
|
521
|
-
"onUpdate:modelValue":
|
|
519
|
+
A(q, {
|
|
520
|
+
modelValue: b.value,
|
|
521
|
+
"onUpdate:modelValue": k[1] || (k[1] = (_) => b.value = _)
|
|
522
522
|
}, null, 8, ["modelValue"]),
|
|
523
|
-
I.value ? (
|
|
523
|
+
I.value ? (S(), E("div", ya, " Cannot select future date ")) : te("", !0)
|
|
524
524
|
]),
|
|
525
|
-
c("div",
|
|
526
|
-
|
|
525
|
+
c("div", ba, [
|
|
526
|
+
A(u, {
|
|
527
527
|
label: "Cancel",
|
|
528
528
|
variant: "tertiary",
|
|
529
|
-
onClick:
|
|
529
|
+
onClick: k[2] || (k[2] = (_) => U.onCancel())
|
|
530
530
|
}),
|
|
531
|
-
|
|
531
|
+
A(u, {
|
|
532
532
|
label: "Refresh balance",
|
|
533
533
|
type: "submit",
|
|
534
534
|
variant: "primary",
|
|
@@ -538,157 +538,172 @@ const va = { class: "flex flex-col" }, ga = {
|
|
|
538
538
|
])
|
|
539
539
|
]),
|
|
540
540
|
_: 1
|
|
541
|
-
}, 8, ["disabled"])) : (
|
|
542
|
-
|
|
541
|
+
}, 8, ["disabled"])) : (S(), E(ie, { key: 0 }, [
|
|
542
|
+
se("Loading")
|
|
543
543
|
], 64));
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
|
-
}),
|
|
546
|
+
}), ze = kt(
|
|
547
547
|
"closingDraftActions",
|
|
548
548
|
function() {
|
|
549
|
-
const s =
|
|
550
|
-
function
|
|
551
|
-
const
|
|
552
|
-
draft:
|
|
549
|
+
const s = Lt(), e = Je(), d = et(), h = Ye(), y = wt(), b = Y(!1), I = Y();
|
|
550
|
+
function M(g) {
|
|
551
|
+
const m = {
|
|
552
|
+
draft: g
|
|
553
553
|
};
|
|
554
|
-
I.value =
|
|
554
|
+
I.value = m, b.value = !0;
|
|
555
555
|
}
|
|
556
|
-
async function U(
|
|
557
|
-
var
|
|
558
|
-
if (
|
|
559
|
-
const
|
|
560
|
-
if (!
|
|
556
|
+
async function U(g) {
|
|
557
|
+
var F;
|
|
558
|
+
if (g.status === pe.enum.COMPLETED) {
|
|
559
|
+
const H = g.closingAdjustmentId;
|
|
560
|
+
if (!H)
|
|
561
561
|
return e.open({
|
|
562
562
|
title: "Something went wrong",
|
|
563
563
|
message: "Closing draft is completed but closing document cannot be found.",
|
|
564
564
|
type: "error"
|
|
565
565
|
}), console.error("Closing draft is completed but closing document cannot be found.", {
|
|
566
|
-
draftId:
|
|
566
|
+
draftId: g._id
|
|
567
567
|
}), [];
|
|
568
|
-
const
|
|
569
|
-
return ((
|
|
570
|
-
id:
|
|
571
|
-
balance:
|
|
572
|
-
costs:
|
|
568
|
+
const K = await d.readAdjustmentById(H);
|
|
569
|
+
return ((K == null ? void 0 : K.skus) ?? []).map((w) => ({
|
|
570
|
+
id: w.sku._id,
|
|
571
|
+
balance: w.fromBalance,
|
|
572
|
+
costs: w.fromCostBalances
|
|
573
573
|
}));
|
|
574
574
|
} else
|
|
575
|
-
return await
|
|
575
|
+
return await y.readStockBalance(), ((F = y.stockBalance) == null ? void 0 : F.skus) ?? [];
|
|
576
576
|
}
|
|
577
|
-
async function
|
|
578
|
-
|
|
577
|
+
async function k(g, m, F) {
|
|
578
|
+
m || (e.open({
|
|
579
579
|
title: "Exporting",
|
|
580
580
|
message: "Fetching data..."
|
|
581
|
-
}),
|
|
581
|
+
}), m = await U(g)), va(g, m, F ?? []);
|
|
582
582
|
}
|
|
583
|
-
function P(
|
|
583
|
+
function P(g, m) {
|
|
584
584
|
s.open({
|
|
585
585
|
title: "Approve draft",
|
|
586
|
-
contentComponent:
|
|
586
|
+
contentComponent: qe,
|
|
587
587
|
contentComponentProps: {
|
|
588
|
-
draft:
|
|
588
|
+
draft: g,
|
|
589
589
|
action: O.enum.approveDraft,
|
|
590
590
|
onFinished: () => {
|
|
591
|
-
s.close(),
|
|
591
|
+
s.close(), m == null || m();
|
|
592
592
|
},
|
|
593
593
|
onCancel: () => s.close()
|
|
594
594
|
}
|
|
595
595
|
});
|
|
596
596
|
}
|
|
597
|
-
function B(
|
|
597
|
+
function B(g, m) {
|
|
598
598
|
s.open({
|
|
599
599
|
title: "Reject draft",
|
|
600
|
-
contentComponent:
|
|
600
|
+
contentComponent: qe,
|
|
601
601
|
contentComponentProps: {
|
|
602
|
-
draft:
|
|
602
|
+
draft: g,
|
|
603
603
|
action: O.enum.rejectDraft,
|
|
604
604
|
onFinished: () => {
|
|
605
|
-
s.close(),
|
|
605
|
+
s.close(), m == null || m();
|
|
606
606
|
},
|
|
607
607
|
onCancel: () => s.close()
|
|
608
608
|
}
|
|
609
609
|
});
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function q(g, m) {
|
|
612
612
|
s.open({
|
|
613
613
|
title: "Mark draft as failed",
|
|
614
|
-
contentComponent:
|
|
614
|
+
contentComponent: qe,
|
|
615
615
|
contentComponentProps: {
|
|
616
|
-
draft:
|
|
616
|
+
draft: g,
|
|
617
617
|
action: O.enum.markAsFailed,
|
|
618
618
|
onFinished: () => {
|
|
619
|
-
s.close(),
|
|
619
|
+
s.close(), m == null || m();
|
|
620
620
|
},
|
|
621
621
|
onCancel: () => s.close()
|
|
622
622
|
}
|
|
623
623
|
});
|
|
624
624
|
}
|
|
625
|
-
async function u(
|
|
626
|
-
await
|
|
627
|
-
_id:
|
|
628
|
-
_rev:
|
|
625
|
+
async function u(g, m) {
|
|
626
|
+
await h.sync({
|
|
627
|
+
_id: g._id,
|
|
628
|
+
_rev: g._rev ?? "",
|
|
629
629
|
action: O.enum.approveDraft,
|
|
630
630
|
data: {
|
|
631
|
-
remark:
|
|
631
|
+
remark: g.remark ?? ""
|
|
632
632
|
}
|
|
633
633
|
}).delayed(500), e.open({
|
|
634
634
|
title: "Success",
|
|
635
635
|
message: "Sync requested",
|
|
636
636
|
type: "success"
|
|
637
|
-
}),
|
|
637
|
+
}), m == null || m();
|
|
638
638
|
}
|
|
639
639
|
function t() {
|
|
640
|
-
|
|
640
|
+
b.value = !1;
|
|
641
641
|
}
|
|
642
|
-
async function _(
|
|
642
|
+
async function _(g, m, F) {
|
|
643
643
|
await s.open({
|
|
644
644
|
title: "Refresh balance",
|
|
645
|
-
contentComponent:
|
|
645
|
+
contentComponent: ha,
|
|
646
646
|
contentComponentProps: {
|
|
647
|
-
draft:
|
|
648
|
-
onFinished: (
|
|
649
|
-
s.close(),
|
|
647
|
+
draft: g,
|
|
648
|
+
onFinished: (H) => {
|
|
649
|
+
s.close(), F == null || F(H);
|
|
650
650
|
},
|
|
651
651
|
onCancel: async () => {
|
|
652
|
-
s.close(),
|
|
652
|
+
s.close(), m == null || m();
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
655
|
});
|
|
656
656
|
}
|
|
657
|
-
async function R(
|
|
657
|
+
async function R(g) {
|
|
658
|
+
await s.open({
|
|
659
|
+
title: "Invalidate closing draft cache",
|
|
660
|
+
message: "It will invalidate opening and stock movement cache for this draft.",
|
|
661
|
+
primaryActions: { text: "Proceed", close: !0 },
|
|
662
|
+
secondaryActions: { text: "Cancel", close: !0 }
|
|
663
|
+
}).onPrimary(async () => {
|
|
664
|
+
await d.recalculation.scheduleInvalidateClosingDraftCache([g._id]), e.open({
|
|
665
|
+
title: "Success",
|
|
666
|
+
message: "Invalidate cache requested",
|
|
667
|
+
type: "success"
|
|
668
|
+
});
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
async function N(g, m) {
|
|
658
672
|
try {
|
|
659
673
|
e.open({
|
|
660
674
|
title: "Cloning",
|
|
661
675
|
message: "Creating a copy of the draft..."
|
|
662
|
-
}), await
|
|
676
|
+
}), await h.cloneDraft(g._id), e.open({
|
|
663
677
|
title: "Success",
|
|
664
678
|
message: "Draft cloned successfully",
|
|
665
679
|
type: "success"
|
|
666
|
-
}),
|
|
667
|
-
} catch (
|
|
680
|
+
}), m == null || m();
|
|
681
|
+
} catch (F) {
|
|
668
682
|
e.open({
|
|
669
683
|
title: "Error",
|
|
670
|
-
message: (
|
|
684
|
+
message: (F == null ? void 0 : F.message) || "Failed to clone draft",
|
|
671
685
|
type: "error"
|
|
672
686
|
});
|
|
673
687
|
}
|
|
674
688
|
}
|
|
675
689
|
return {
|
|
676
|
-
viewDraft:
|
|
690
|
+
viewDraft: M,
|
|
677
691
|
closeDraftDialog: t,
|
|
678
692
|
approveDraft: P,
|
|
679
693
|
rejectDraft: B,
|
|
680
|
-
markAsFailed:
|
|
694
|
+
markAsFailed: q,
|
|
681
695
|
syncDraft: u,
|
|
682
|
-
exportDraft:
|
|
696
|
+
exportDraft: k,
|
|
683
697
|
refreshBalance: _,
|
|
684
|
-
cloneDraft:
|
|
685
|
-
viewClosingDraftShow:
|
|
686
|
-
viewClosingDraftProps: I
|
|
698
|
+
cloneDraft: N,
|
|
699
|
+
viewClosingDraftShow: b,
|
|
700
|
+
viewClosingDraftProps: I,
|
|
701
|
+
invalidateDraftCache: R
|
|
687
702
|
};
|
|
688
703
|
}
|
|
689
704
|
);
|
|
690
|
-
function
|
|
691
|
-
switch (
|
|
705
|
+
function Ne(l) {
|
|
706
|
+
switch (l) {
|
|
692
707
|
case "DRAFT":
|
|
693
708
|
return "fm-status-badge-draft";
|
|
694
709
|
case "PROCESSING":
|
|
@@ -702,59 +717,59 @@ function Ve(r) {
|
|
|
702
717
|
const ka = kt(
|
|
703
718
|
"closingDraftTable",
|
|
704
719
|
function() {
|
|
705
|
-
const { t: s } =
|
|
706
|
-
async function
|
|
707
|
-
if (
|
|
708
|
-
|
|
720
|
+
const { t: s } = bt(), e = yt(), d = ze(), h = Y(new Array()), y = Y(!1), b = Oe(), I = Ye();
|
|
721
|
+
async function M() {
|
|
722
|
+
if (h.value = [], !!b._currentLocation) {
|
|
723
|
+
y.value = !0;
|
|
709
724
|
try {
|
|
710
725
|
const [u] = await Promise.all([I.readDrafts()]).delayed(1e3);
|
|
711
|
-
|
|
726
|
+
h.value = u.reverse();
|
|
712
727
|
} catch (u) {
|
|
713
728
|
console.log("Something went wrong when fetching drafts:", u);
|
|
714
729
|
} finally {
|
|
715
|
-
|
|
730
|
+
y.value = !1;
|
|
716
731
|
}
|
|
717
732
|
}
|
|
718
733
|
}
|
|
719
734
|
async function U(u) {
|
|
720
|
-
if (!
|
|
721
|
-
|
|
735
|
+
if (!h.value.find((t) => t._id) && b._currentLocation) {
|
|
736
|
+
y.value = !0;
|
|
722
737
|
try {
|
|
723
738
|
const [t] = await Promise.all([
|
|
724
739
|
I.getDraft(u),
|
|
725
740
|
new Promise((_) => setTimeout(_, 1e3))
|
|
726
741
|
]);
|
|
727
|
-
|
|
742
|
+
h.value = [t];
|
|
728
743
|
} catch (t) {
|
|
729
744
|
console.log("Something went wrong when fetching drafts:", t);
|
|
730
745
|
} finally {
|
|
731
|
-
|
|
746
|
+
y.value = !1;
|
|
732
747
|
}
|
|
733
748
|
}
|
|
734
749
|
}
|
|
735
|
-
function
|
|
736
|
-
|
|
750
|
+
function k(u) {
|
|
751
|
+
h.value = h.value.map((t) => t._id === u._id ? {
|
|
737
752
|
...u,
|
|
738
753
|
_rev: t._rev
|
|
739
754
|
} : t);
|
|
740
755
|
}
|
|
741
756
|
function P() {
|
|
742
|
-
|
|
757
|
+
d.closeDraftDialog(), M();
|
|
743
758
|
}
|
|
744
759
|
function B(u, t) {
|
|
745
|
-
switch (t =
|
|
760
|
+
switch (t = Ht(t), u) {
|
|
746
761
|
case Se.Details:
|
|
747
|
-
return
|
|
762
|
+
return d.viewDraft(t);
|
|
748
763
|
case Se.Export:
|
|
749
|
-
return
|
|
764
|
+
return d.exportDraft(t);
|
|
750
765
|
case O.enum.approveDraft:
|
|
751
|
-
return
|
|
766
|
+
return d.approveDraft(t, P);
|
|
752
767
|
case O.enum.rejectDraft:
|
|
753
|
-
return
|
|
768
|
+
return d.rejectDraft(t, P);
|
|
754
769
|
case O.enum.markAsFailed:
|
|
755
|
-
return
|
|
770
|
+
return d.markAsFailed(t, P);
|
|
756
771
|
case Se.Duplicate:
|
|
757
|
-
return
|
|
772
|
+
return d.cloneDraft(t, P);
|
|
758
773
|
}
|
|
759
774
|
}
|
|
760
775
|
return {
|
|
@@ -764,7 +779,7 @@ const ka = kt(
|
|
|
764
779
|
accessorKey: "_id",
|
|
765
780
|
header: () => s("inventory.closing.table.createdAt"),
|
|
766
781
|
cell(u) {
|
|
767
|
-
return
|
|
782
|
+
return ea(`${u.getValue()}`);
|
|
768
783
|
},
|
|
769
784
|
enableSorting: !0
|
|
770
785
|
},
|
|
@@ -774,14 +789,14 @@ const ka = kt(
|
|
|
774
789
|
cell(u) {
|
|
775
790
|
const t = u.row.original;
|
|
776
791
|
let _ = u.getValue();
|
|
777
|
-
return _ || (_ =
|
|
792
|
+
return _ || (_ = Ve(t._id)), ye(_);
|
|
778
793
|
},
|
|
779
794
|
enableSorting: !0,
|
|
780
795
|
size: 200
|
|
781
796
|
},
|
|
782
797
|
{
|
|
783
798
|
id: "updatedAt",
|
|
784
|
-
accessorFn: (u) =>
|
|
799
|
+
accessorFn: (u) => ye(u.updatedAt),
|
|
785
800
|
header: () => "Updated at",
|
|
786
801
|
enableSorting: !0,
|
|
787
802
|
size: 200
|
|
@@ -820,43 +835,43 @@ const ka = kt(
|
|
|
820
835
|
header: () => s("inventory.closing.table.status"),
|
|
821
836
|
enableSorting: !1,
|
|
822
837
|
cell(u) {
|
|
823
|
-
var
|
|
824
|
-
const t = u.row.original, _ = t.status, R = new Date(t.updatedAt),
|
|
825
|
-
return _ === "DRAFT" &&
|
|
838
|
+
var m;
|
|
839
|
+
const t = u.row.original, _ = t.status, R = new Date(t.updatedAt), N = (m = t == null ? void 0 : t.rejectionHistory) == null ? void 0 : m.computeFirst((F) => F.rejectedAt), g = N ? new Date(N) : null;
|
|
840
|
+
return _ === "DRAFT" && g ? g.getTime() > R.getTime() ? x(
|
|
826
841
|
"div",
|
|
827
842
|
{
|
|
828
843
|
class: "flex"
|
|
829
844
|
},
|
|
830
|
-
|
|
845
|
+
x(
|
|
831
846
|
"div",
|
|
832
847
|
{
|
|
833
|
-
class: ["fm-status-badge",
|
|
848
|
+
class: ["fm-status-badge", Ne("FAILED")]
|
|
834
849
|
},
|
|
835
850
|
"Rejected"
|
|
836
851
|
)
|
|
837
|
-
) :
|
|
852
|
+
) : x(
|
|
838
853
|
"div",
|
|
839
854
|
{
|
|
840
855
|
class: "flex"
|
|
841
856
|
},
|
|
842
|
-
|
|
857
|
+
x(
|
|
843
858
|
"div",
|
|
844
859
|
{
|
|
845
|
-
class: ["fm-status-badge",
|
|
860
|
+
class: ["fm-status-badge", Ne("PROCESSING")]
|
|
846
861
|
},
|
|
847
862
|
"Updated"
|
|
848
863
|
)
|
|
849
|
-
) :
|
|
864
|
+
) : x(
|
|
850
865
|
"div",
|
|
851
866
|
{
|
|
852
867
|
class: "flex"
|
|
853
868
|
},
|
|
854
|
-
|
|
869
|
+
x(
|
|
855
870
|
"div",
|
|
856
871
|
{
|
|
857
|
-
class: ["fm-status-badge",
|
|
872
|
+
class: ["fm-status-badge", Ne(_)]
|
|
858
873
|
},
|
|
859
|
-
|
|
874
|
+
Le(_)
|
|
860
875
|
)
|
|
861
876
|
);
|
|
862
877
|
}
|
|
@@ -864,11 +879,11 @@ const ka = kt(
|
|
|
864
879
|
{
|
|
865
880
|
id: "action",
|
|
866
881
|
cell(u) {
|
|
867
|
-
var
|
|
868
|
-
const t = u.row.original, _ = ((
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
],
|
|
882
|
+
var m;
|
|
883
|
+
const t = u.row.original, _ = ((m = e.sessionUser.value) == null ? void 0 : m.role.isAdmin) ?? !1, R = [
|
|
884
|
+
pt[Se.Details],
|
|
885
|
+
pt[Se.Export]
|
|
886
|
+
], N = [
|
|
872
887
|
{
|
|
873
888
|
translationKey: "inventory.closing.draft.approveDraft",
|
|
874
889
|
color: "text-fm-color-typo-primary",
|
|
@@ -884,20 +899,20 @@ const ka = kt(
|
|
|
884
899
|
color: "text-fm-color-typo-error",
|
|
885
900
|
value: O.enum.markAsFailed
|
|
886
901
|
}
|
|
887
|
-
],
|
|
902
|
+
], g = _ && t.status !== pe.enum.DRAFT ? [
|
|
888
903
|
{
|
|
889
904
|
translationKey: "inventory.closing.draft.cloneDraft",
|
|
890
905
|
color: "text-fm-color-typo-primary",
|
|
891
906
|
value: Se.Duplicate
|
|
892
907
|
}
|
|
893
908
|
] : [];
|
|
894
|
-
return
|
|
909
|
+
return Jt(
|
|
895
910
|
[
|
|
896
911
|
...R,
|
|
897
|
-
...t.status ===
|
|
912
|
+
...t.status === pe.enum.DRAFT ? N : []
|
|
898
913
|
],
|
|
899
|
-
(
|
|
900
|
-
|
|
914
|
+
(F) => B(F, t),
|
|
915
|
+
g
|
|
901
916
|
);
|
|
902
917
|
},
|
|
903
918
|
enableSorting: !1,
|
|
@@ -908,91 +923,91 @@ const ka = kt(
|
|
|
908
923
|
}
|
|
909
924
|
}
|
|
910
925
|
],
|
|
911
|
-
drafts:
|
|
912
|
-
loading:
|
|
913
|
-
fetchDrafts:
|
|
926
|
+
drafts: h,
|
|
927
|
+
loading: y,
|
|
928
|
+
fetchDrafts: M,
|
|
914
929
|
loadDraft: U,
|
|
915
|
-
updateDraftRef:
|
|
930
|
+
updateDraftRef: k
|
|
916
931
|
};
|
|
917
932
|
}
|
|
918
|
-
),
|
|
933
|
+
), Da = { class: "w-full flex flex-col gap-32" }, xa = { class: "flex justify-between" }, Aa = { class: "flex" }, _a = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, wa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Sa = { class: "flex gap-1" }, Fa = { class: "fm-typo-en-body-lg-600" }, Ca = { class: "flex flex-col gap-16" }, $a = { class: "flex items-center" }, Ba = {
|
|
919
934
|
key: 0,
|
|
920
935
|
class: "flex gap-8"
|
|
921
|
-
},
|
|
936
|
+
}, Ta = {
|
|
922
937
|
key: 0,
|
|
923
938
|
class: "w-full flex flex-col items-center"
|
|
924
|
-
},
|
|
939
|
+
}, ja = { class: "flex items-center gap-8" }, Ia = { class: "flex flex-col gap-8" }, Ua = { class: "flex gap-8" }, Pa = {
|
|
925
940
|
key: 0,
|
|
926
941
|
class: "flex gap-8"
|
|
927
|
-
},
|
|
942
|
+
}, Ra = { class: "overflow-x-auto" }, Ma = {
|
|
928
943
|
key: 1,
|
|
929
944
|
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
930
|
-
},
|
|
945
|
+
}, Va = {
|
|
931
946
|
key: 0,
|
|
932
947
|
class: "flex flex-col items-center gap-8 h-full"
|
|
933
|
-
},
|
|
948
|
+
}, La = ["src"], Na = {
|
|
934
949
|
key: 1,
|
|
935
950
|
class: "px-4 flex flex-col"
|
|
936
|
-
},
|
|
951
|
+
}, Ea = { class: "flex gap-12 content-stretch" }, za = {
|
|
937
952
|
class: "flex flex-col w-24",
|
|
938
953
|
name: "circles"
|
|
939
|
-
},
|
|
954
|
+
}, Ha = { class: "flex-1 flex flex-col items-center" }, Oa = { class: "flex-1 flex flex-col items-center" }, Ya = {
|
|
940
955
|
class: "py-12 flex flex-col gap-4",
|
|
941
956
|
name: "received-at header"
|
|
942
|
-
},
|
|
957
|
+
}, Ka = { class: "fm-typo-en-body-lg-400" }, Qa = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, qa = { class: "flex gap-12 content-stretch" }, Ga = {
|
|
943
958
|
class: "flex flex-col w-24",
|
|
944
959
|
name: "circles"
|
|
945
|
-
},
|
|
960
|
+
}, Wa = { class: "flex-1 flex flex-col items-center" }, Za = {
|
|
946
961
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
947
962
|
name: "delivery details"
|
|
948
|
-
},
|
|
963
|
+
}, Ja = { class: "flex flex-col gap-8" }, Xa = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, en = { class: "flex flex-col gap-4" }, tn = { class: "flex gap-8" }, an = "N/A", nn = /* @__PURE__ */ He({
|
|
949
964
|
__name: "ClosingDraftDialog",
|
|
950
965
|
props: {
|
|
951
966
|
show: { type: Boolean },
|
|
952
967
|
draft: {}
|
|
953
968
|
},
|
|
954
969
|
emits: ["submitted", "refresh"],
|
|
955
|
-
setup(
|
|
956
|
-
const e =
|
|
957
|
-
const
|
|
958
|
-
return
|
|
959
|
-
}),
|
|
960
|
-
_.skus.filter((
|
|
970
|
+
setup(l, { emit: s }) {
|
|
971
|
+
const e = l, d = L(() => {
|
|
972
|
+
const r = ht();
|
|
973
|
+
return r === "MYR" ? "RM" : r;
|
|
974
|
+
}), h = wt(), y = ze(), b = Nt(e, "show"), I = Y(!1), M = Y(!1), U = Y(!1), k = Y(new Array()), P = Y(new Array()), B = Y([]), q = et(), u = Ye(), t = Je(), _ = Ot(), R = Oe(), N = It({}), g = L(() => new Set(
|
|
975
|
+
_.skus.filter((r) => {
|
|
961
976
|
var a;
|
|
962
|
-
return
|
|
963
|
-
}).map((
|
|
964
|
-
)),
|
|
977
|
+
return N[(a = r.customAttributes) == null ? void 0 : a.tag];
|
|
978
|
+
}).map((r) => r._id)
|
|
979
|
+
)), m = s, F = Y({
|
|
965
980
|
templateItem: !0,
|
|
966
981
|
nonTemplateItem: !0
|
|
967
982
|
}), H = L(() => {
|
|
968
983
|
var a, f;
|
|
969
|
-
const
|
|
970
|
-
return
|
|
971
|
-
}),
|
|
972
|
-
const
|
|
973
|
-
return
|
|
974
|
-
}),
|
|
984
|
+
const r = [...((a = e.draft) == null ? void 0 : a.items) ?? [], ...((f = e.draft) == null ? void 0 : f.negativeStockItems) ?? []];
|
|
985
|
+
return g.value.size ? r.filter((n) => g.value.has(n.sku._id)) : r;
|
|
986
|
+
}), K = L(() => {
|
|
987
|
+
const r = H.value.map((a) => a.sku);
|
|
988
|
+
return r.sort((a, f) => a.code.localeCompare(f.code)), r;
|
|
989
|
+
}), J = L(() => H.value.groupBy(
|
|
975
990
|
(a) => a.sku._id,
|
|
976
991
|
(a) => a.measurementsAmounts.filter((f) => !f.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((f) => f.measurement.id)
|
|
977
992
|
));
|
|
978
|
-
|
|
993
|
+
Ze(me), Ut(
|
|
979
994
|
() => e.show,
|
|
980
|
-
(
|
|
981
|
-
|
|
995
|
+
(r) => {
|
|
996
|
+
r && (ke.value = _e[0], me(), F.value = {
|
|
982
997
|
templateItem: !0,
|
|
983
998
|
nonTemplateItem: !0
|
|
984
999
|
});
|
|
985
1000
|
}
|
|
986
1001
|
);
|
|
987
|
-
const
|
|
1002
|
+
const w = je(0), X = je(100);
|
|
988
1003
|
async function me() {
|
|
989
1004
|
var a, f, n, o;
|
|
990
1005
|
if (!R._currentLocation) return;
|
|
991
1006
|
I.value = !0;
|
|
992
|
-
const
|
|
1007
|
+
const r = ((a = e.draft) == null ? void 0 : a.status) === pe.enum.COMPLETED;
|
|
993
1008
|
P.value = [];
|
|
994
1009
|
try {
|
|
995
|
-
if (await _.init(),
|
|
1010
|
+
if (await _.init(), r) {
|
|
996
1011
|
const T = e.draft.closingAdjustmentId;
|
|
997
1012
|
if (!T) {
|
|
998
1013
|
t.open({
|
|
@@ -1004,9 +1019,9 @@ const ka = kt(
|
|
|
1004
1019
|
});
|
|
1005
1020
|
return;
|
|
1006
1021
|
}
|
|
1007
|
-
const j = await
|
|
1008
|
-
for (const ce of
|
|
1009
|
-
const
|
|
1022
|
+
const j = await q.readAdjustmentById(T), le = (j == null ? void 0 : j.skus) ?? [];
|
|
1023
|
+
for (const ce of le) {
|
|
1024
|
+
const De = {
|
|
1010
1025
|
id: ce.sku._id,
|
|
1011
1026
|
balance: ce.fromBalance,
|
|
1012
1027
|
costs: ce.fromCostBalances
|
|
@@ -1015,20 +1030,20 @@ const ka = kt(
|
|
|
1015
1030
|
balance: ce.toBalance,
|
|
1016
1031
|
costs: ce.toCostBalances
|
|
1017
1032
|
};
|
|
1018
|
-
|
|
1033
|
+
k.value.push(De), P.value.push(C);
|
|
1019
1034
|
}
|
|
1020
1035
|
} else
|
|
1021
|
-
|
|
1036
|
+
k.value = ((n = e.draft) == null ? void 0 : n.stockSnapshot) ?? [];
|
|
1022
1037
|
const i = /* @__PURE__ */ new Set();
|
|
1023
1038
|
if ((o = e.draft) != null && o.adjustmentSnapshot)
|
|
1024
1039
|
for (const T of e.draft.adjustmentSnapshot)
|
|
1025
1040
|
T.adjustmentsByType && Object.keys(T.adjustmentsByType).forEach((j) => i.add(j));
|
|
1026
|
-
const p = ["receive", "sales", "wastage"],
|
|
1041
|
+
const p = ["receive", "sales", "wastage"], D = [];
|
|
1027
1042
|
p.forEach((T) => {
|
|
1028
|
-
i.has(T) && (
|
|
1043
|
+
i.has(T) && (D.push(T), i.delete(T));
|
|
1029
1044
|
});
|
|
1030
1045
|
const v = Array.from(i).sort();
|
|
1031
|
-
B.value = [...
|
|
1046
|
+
B.value = [...D, ...v];
|
|
1032
1047
|
} catch (i) {
|
|
1033
1048
|
t.open({
|
|
1034
1049
|
title: "Something went wrong",
|
|
@@ -1039,9 +1054,9 @@ const ka = kt(
|
|
|
1039
1054
|
I.value = !1;
|
|
1040
1055
|
}
|
|
1041
1056
|
}
|
|
1042
|
-
async function
|
|
1057
|
+
async function ae() {
|
|
1043
1058
|
var a, f;
|
|
1044
|
-
if (!(((a = e.draft) == null ? void 0 : a.effectiveAt) ?? (e.draft ?
|
|
1059
|
+
if (!(((a = e.draft) == null ? void 0 : a.effectiveAt) ?? (e.draft ? Ve((f = e.draft) == null ? void 0 : f._id) : null))) {
|
|
1045
1060
|
t.open({
|
|
1046
1061
|
title: "Cannot refresh",
|
|
1047
1062
|
message: "Effective date is not available for this draft.",
|
|
@@ -1049,16 +1064,16 @@ const ka = kt(
|
|
|
1049
1064
|
});
|
|
1050
1065
|
return;
|
|
1051
1066
|
}
|
|
1052
|
-
await
|
|
1067
|
+
await y.refreshBalance(
|
|
1053
1068
|
e.draft,
|
|
1054
1069
|
() => {
|
|
1055
1070
|
},
|
|
1056
1071
|
async (n) => {
|
|
1057
|
-
var
|
|
1058
|
-
|
|
1059
|
-
const o = (
|
|
1072
|
+
var D;
|
|
1073
|
+
M.value = !0;
|
|
1074
|
+
const o = (D = e.draft) == null ? void 0 : D._rev, i = 30, p = 2e3;
|
|
1060
1075
|
try {
|
|
1061
|
-
await
|
|
1076
|
+
await q.recalculation.scheduleCalculateStockSnapshotAtDate(n, e.draft._id);
|
|
1062
1077
|
let v = null;
|
|
1063
1078
|
for (let T = 0; T < i && (v = await u.getDraft(e.draft._id).delayed(p), v._rev === o); T++)
|
|
1064
1079
|
;
|
|
@@ -1070,11 +1085,11 @@ const ka = kt(
|
|
|
1070
1085
|
}), console.error("error refreshing stock balances: there is no change in _rev");
|
|
1071
1086
|
return;
|
|
1072
1087
|
}
|
|
1073
|
-
|
|
1088
|
+
m("refresh", v), k.value = v.stockSnapshot ?? [], t.open({
|
|
1074
1089
|
title: "Balance refreshed",
|
|
1075
1090
|
message: "Stock balance has been recalculated.",
|
|
1076
1091
|
type: "success"
|
|
1077
|
-
}),
|
|
1092
|
+
}), b.value = !1;
|
|
1078
1093
|
} catch (v) {
|
|
1079
1094
|
t.open({
|
|
1080
1095
|
title: "Refresh failed",
|
|
@@ -1082,41 +1097,53 @@ const ka = kt(
|
|
|
1082
1097
|
type: "error"
|
|
1083
1098
|
}), console.error("error refreshing stock balances", v);
|
|
1084
1099
|
} finally {
|
|
1085
|
-
|
|
1100
|
+
M.value = !1;
|
|
1086
1101
|
}
|
|
1087
1102
|
}
|
|
1088
1103
|
);
|
|
1089
1104
|
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
(
|
|
1105
|
+
async function re() {
|
|
1106
|
+
var a, f;
|
|
1107
|
+
if (!(((a = e.draft) == null ? void 0 : a.effectiveAt) ?? (e.draft ? Ve((f = e.draft) == null ? void 0 : f._id) : null))) {
|
|
1108
|
+
t.open({
|
|
1109
|
+
title: "Cannot refresh",
|
|
1110
|
+
message: "Effective date is not available for this draft.",
|
|
1111
|
+
type: "error"
|
|
1112
|
+
});
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
await y.invalidateDraftCache(e.draft);
|
|
1116
|
+
}
|
|
1117
|
+
const de = L(
|
|
1118
|
+
() => k.value.groupBy(
|
|
1119
|
+
(r) => r.id,
|
|
1120
|
+
(r) => r.balance
|
|
1094
1121
|
)
|
|
1095
|
-
),
|
|
1096
|
-
var
|
|
1097
|
-
return (
|
|
1098
|
-
}),
|
|
1099
|
-
var
|
|
1100
|
-
return (
|
|
1122
|
+
), be = L(() => H.value.groupBy((r) => r.sku._id)), he = L(() => {
|
|
1123
|
+
var r;
|
|
1124
|
+
return (r = e.draft) != null && r.adjustmentSnapshot ? new Map(e.draft.adjustmentSnapshot.map((a) => [a.skuId, a.adjustmentsByType])) : /* @__PURE__ */ new Map();
|
|
1125
|
+
}), Ie = L(() => {
|
|
1126
|
+
var r;
|
|
1127
|
+
return (r = e.draft) != null && r.opening ? new Map(e.draft.opening.map((a) => [a.skuId, a.balance])) : /* @__PURE__ */ new Map();
|
|
1101
1128
|
});
|
|
1102
|
-
function
|
|
1103
|
-
return
|
|
1104
|
-
|
|
1129
|
+
function Z(r, a) {
|
|
1130
|
+
return x(
|
|
1131
|
+
ge.FmTooltip,
|
|
1105
1132
|
{ zIndex: 51, placement: "left", class: "w-full flex justify-end" },
|
|
1106
1133
|
{
|
|
1107
1134
|
default() {
|
|
1108
|
-
return
|
|
1135
|
+
return r;
|
|
1109
1136
|
},
|
|
1110
1137
|
content() {
|
|
1111
|
-
return a ||
|
|
1138
|
+
return a || r;
|
|
1112
1139
|
}
|
|
1113
1140
|
}
|
|
1114
1141
|
);
|
|
1115
1142
|
}
|
|
1116
|
-
const
|
|
1117
|
-
const
|
|
1143
|
+
const Ce = L(() => {
|
|
1144
|
+
const r = K.value.reduce((f, n) => {
|
|
1118
1145
|
var o, i;
|
|
1119
|
-
return Math.max(f, ((i = (o =
|
|
1146
|
+
return Math.max(f, ((i = (o = J.value) == null ? void 0 : o.get(n._id)) == null ? void 0 : i[0].length) ?? 0);
|
|
1120
1147
|
}, 0);
|
|
1121
1148
|
return [
|
|
1122
1149
|
{
|
|
@@ -1125,8 +1152,8 @@ const ka = kt(
|
|
|
1125
1152
|
header: () => "Name",
|
|
1126
1153
|
size: 350,
|
|
1127
1154
|
cell(f) {
|
|
1128
|
-
const n = f.row.original, o = n.adjustedDiffPercentage, i = typeof o == "number" && Math.abs(o) > 10, p =
|
|
1129
|
-
|
|
1155
|
+
const n = f.row.original, o = n.adjustedDiffPercentage, i = typeof o == "number" && Math.abs(o) > 10, p = x("div", { class: "flex flex-col gap-4" }, [
|
|
1156
|
+
x(
|
|
1130
1157
|
"div",
|
|
1131
1158
|
{
|
|
1132
1159
|
class: [
|
|
@@ -1136,7 +1163,7 @@ const ka = kt(
|
|
|
1136
1163
|
},
|
|
1137
1164
|
n.name
|
|
1138
1165
|
),
|
|
1139
|
-
|
|
1166
|
+
x(
|
|
1140
1167
|
"div",
|
|
1141
1168
|
{
|
|
1142
1169
|
class: [
|
|
@@ -1147,8 +1174,8 @@ const ka = kt(
|
|
|
1147
1174
|
n.code
|
|
1148
1175
|
)
|
|
1149
1176
|
]);
|
|
1150
|
-
return
|
|
1151
|
-
|
|
1177
|
+
return x(
|
|
1178
|
+
ge.FmTooltip,
|
|
1152
1179
|
{
|
|
1153
1180
|
zIndex: 51
|
|
1154
1181
|
},
|
|
@@ -1157,7 +1184,7 @@ const ka = kt(
|
|
|
1157
1184
|
return i ? "Adjustment difference is more than 10%." : `${n.code} - ${n.name}`;
|
|
1158
1185
|
},
|
|
1159
1186
|
default() {
|
|
1160
|
-
return
|
|
1187
|
+
return x("div", { class: "flex items-center gap-4 justify-start w-full" }, [
|
|
1161
1188
|
p
|
|
1162
1189
|
]);
|
|
1163
1190
|
}
|
|
@@ -1168,11 +1195,11 @@ const ka = kt(
|
|
|
1168
1195
|
{
|
|
1169
1196
|
id: "costPerUnit",
|
|
1170
1197
|
accessorKey: "costPerUnit",
|
|
1171
|
-
header: () =>
|
|
1198
|
+
header: () => Z("Cost per unit"),
|
|
1172
1199
|
size: 160,
|
|
1173
1200
|
cell(f) {
|
|
1174
1201
|
const n = f.row.original.costPerUnit;
|
|
1175
|
-
return
|
|
1202
|
+
return x("div", { class: "text-right" }, n.toFixed(2));
|
|
1176
1203
|
},
|
|
1177
1204
|
meta: {
|
|
1178
1205
|
textAlign: "right"
|
|
@@ -1183,23 +1210,23 @@ const ka = kt(
|
|
|
1183
1210
|
header: () => "UOM",
|
|
1184
1211
|
size: 120,
|
|
1185
1212
|
cell(f) {
|
|
1186
|
-
var
|
|
1213
|
+
var D;
|
|
1187
1214
|
const n = f.row.original, o = n.costUnit, i = n.baseUnit, p = o ?? i;
|
|
1188
1215
|
if (o && o !== i) {
|
|
1189
|
-
const v =
|
|
1216
|
+
const v = K.value.find((j) => j._id === n.id), T = (D = v == null ? void 0 : v.defaultCost) == null ? void 0 : D.measurement;
|
|
1190
1217
|
if (T) {
|
|
1191
1218
|
const j = T.conversion.amount / Math.pow(10, T.conversion.precision);
|
|
1192
|
-
return
|
|
1193
|
-
|
|
1219
|
+
return x("div", { class: "flex flex-col" }, [
|
|
1220
|
+
x(
|
|
1194
1221
|
"span",
|
|
1195
1222
|
{ class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
|
|
1196
1223
|
p
|
|
1197
1224
|
),
|
|
1198
|
-
|
|
1225
|
+
x("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, [
|
|
1199
1226
|
"1 ",
|
|
1200
|
-
|
|
1227
|
+
x("span", { class: "fm-typo-en-body-sm-600" }, o),
|
|
1201
1228
|
` = ${j} `,
|
|
1202
|
-
|
|
1229
|
+
x("span", { class: "fm-typo-en-body-sm-600" }, i)
|
|
1203
1230
|
])
|
|
1204
1231
|
]);
|
|
1205
1232
|
}
|
|
@@ -1210,11 +1237,11 @@ const ka = kt(
|
|
|
1210
1237
|
{
|
|
1211
1238
|
id: "opening",
|
|
1212
1239
|
accessorKey: "opening",
|
|
1213
|
-
header: () =>
|
|
1240
|
+
header: () => Z("Opening (B/F)", "The opening balance brought forward from previous period."),
|
|
1214
1241
|
size: 150,
|
|
1215
1242
|
cell(f) {
|
|
1216
1243
|
const n = f.row.original.opening;
|
|
1217
|
-
return
|
|
1244
|
+
return x("div", { class: "text-right" }, n.toFixed(2));
|
|
1218
1245
|
},
|
|
1219
1246
|
meta: {
|
|
1220
1247
|
textAlign: "right"
|
|
@@ -1225,11 +1252,11 @@ const ka = kt(
|
|
|
1225
1252
|
(f) => ({
|
|
1226
1253
|
id: `adjustment_${f}`,
|
|
1227
1254
|
accessorFn: (n) => n.adjustmentAmounts[f] ?? { amount: 0, precision: 0 },
|
|
1228
|
-
header: () =>
|
|
1255
|
+
header: () => Z(Le(f)),
|
|
1229
1256
|
size: 150,
|
|
1230
1257
|
cell(n) {
|
|
1231
1258
|
const o = n.row.original.adjustmentAmounts[f] ?? { amount: 0, precision: 0 };
|
|
1232
|
-
return
|
|
1259
|
+
return x("div", { class: "text-right" }, We(o));
|
|
1233
1260
|
},
|
|
1234
1261
|
meta: {
|
|
1235
1262
|
textAlign: "right"
|
|
@@ -1239,7 +1266,7 @@ const ka = kt(
|
|
|
1239
1266
|
{
|
|
1240
1267
|
id: "systemBalance",
|
|
1241
1268
|
accessorKey: "systemBalance",
|
|
1242
|
-
header: () =>
|
|
1269
|
+
header: () => Z("System Balance", "The system calculated balance before stock take."),
|
|
1243
1270
|
size: 200,
|
|
1244
1271
|
meta: {
|
|
1245
1272
|
textAlign: "right"
|
|
@@ -1252,22 +1279,22 @@ const ka = kt(
|
|
|
1252
1279
|
const n = (o = P.value.find((i) => i.id === f.id)) == null ? void 0 : o.balance;
|
|
1253
1280
|
return n ? V.toFormatString({ value: n }) : f.physicalBalance;
|
|
1254
1281
|
},
|
|
1255
|
-
header: () =>
|
|
1282
|
+
header: () => Z("Stock Take balance", "The physical balance recorded during stock take."),
|
|
1256
1283
|
cell(f) {
|
|
1257
1284
|
var v;
|
|
1258
1285
|
const n = f.row.original, o = V.fromNumber(n.physicalBalance);
|
|
1259
1286
|
let i = !0, p = n.physicalBalance;
|
|
1260
|
-
const
|
|
1261
|
-
return
|
|
1287
|
+
const D = (v = P.value.find((T) => T.id === n.id)) == null ? void 0 : v.balance;
|
|
1288
|
+
return D && (V.equals({
|
|
1262
1289
|
a: o,
|
|
1263
|
-
b:
|
|
1264
|
-
}) || (i = !1, p = Number(V.toFormatString({ value:
|
|
1265
|
-
|
|
1290
|
+
b: D
|
|
1291
|
+
}) || (i = !1, p = Number(V.toFormatString({ value: D })))), x("div", { class: "flex flex-col" }, [
|
|
1292
|
+
x(
|
|
1266
1293
|
"span",
|
|
1267
1294
|
{ class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
|
|
1268
1295
|
p
|
|
1269
1296
|
),
|
|
1270
|
-
i ? null :
|
|
1297
|
+
i ? null : x(
|
|
1271
1298
|
"span",
|
|
1272
1299
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1273
1300
|
`Draft: ${n.physicalBalance.toString()}`
|
|
@@ -1282,7 +1309,7 @@ const ka = kt(
|
|
|
1282
1309
|
{
|
|
1283
1310
|
id: "adjustedAmount",
|
|
1284
1311
|
accessorKey: "adjustedAmount",
|
|
1285
|
-
header: () =>
|
|
1312
|
+
header: () => Z("Variance", "The difference between Stock Take balance and System Balance."),
|
|
1286
1313
|
size: 200,
|
|
1287
1314
|
meta: {
|
|
1288
1315
|
textAlign: "right"
|
|
@@ -1291,11 +1318,11 @@ const ka = kt(
|
|
|
1291
1318
|
{
|
|
1292
1319
|
id: "varianceInCost",
|
|
1293
1320
|
accessorKey: "varianceInCost",
|
|
1294
|
-
header: () =>
|
|
1321
|
+
header: () => Z(`Variance (${d.value})`),
|
|
1295
1322
|
size: 150,
|
|
1296
1323
|
cell(f) {
|
|
1297
1324
|
const n = f.row.original.varianceInCost;
|
|
1298
|
-
return
|
|
1325
|
+
return x(
|
|
1299
1326
|
"div",
|
|
1300
1327
|
{ class: "text-right" },
|
|
1301
1328
|
n.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })
|
|
@@ -1308,20 +1335,20 @@ const ka = kt(
|
|
|
1308
1335
|
{
|
|
1309
1336
|
id: "adjustedDiffPercentage",
|
|
1310
1337
|
accessorKey: "adjustedDiffPercentage",
|
|
1311
|
-
header: () =>
|
|
1338
|
+
header: () => Z(
|
|
1312
1339
|
"Variance (%)",
|
|
1313
1340
|
"Difference between Stock Take balance and System Balance in percentage."
|
|
1314
1341
|
),
|
|
1315
1342
|
size: 200,
|
|
1316
1343
|
cell(f) {
|
|
1317
1344
|
const n = f.row.original.adjustedDiffPercentage;
|
|
1318
|
-
if (!n) return
|
|
1345
|
+
if (!n) return an;
|
|
1319
1346
|
const o = n.toFixed(2);
|
|
1320
1347
|
if (o === "0.00")
|
|
1321
|
-
return
|
|
1348
|
+
return x("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
|
|
1322
1349
|
const i = n > 0;
|
|
1323
|
-
return
|
|
1324
|
-
|
|
1350
|
+
return x("div", { class: "flex items-center gap-4 justify-end" }, [
|
|
1351
|
+
x(ge.FmIcon, {
|
|
1325
1352
|
name: i ? "arrow_drop_up" : "arrow_drop_down",
|
|
1326
1353
|
color: i ? "system-success-300" : "system-error-300",
|
|
1327
1354
|
size: "md"
|
|
@@ -1336,22 +1363,22 @@ const ka = kt(
|
|
|
1336
1363
|
{
|
|
1337
1364
|
id: "stockTakeValue",
|
|
1338
1365
|
accessorKey: "stockTakeValue",
|
|
1339
|
-
header: () =>
|
|
1366
|
+
header: () => Z(`Stock take value (${d.value})`),
|
|
1340
1367
|
size: 180,
|
|
1341
1368
|
cell(f) {
|
|
1342
1369
|
var T;
|
|
1343
|
-
const n = f.row.original, o = n.stockTakeValue, i =
|
|
1370
|
+
const n = f.row.original, o = n.stockTakeValue, i = K.value.find((j) => j._id === n.id), p = (T = i == null ? void 0 : i.defaultCost) == null ? void 0 : T.measurement, D = n.physicalBalance, v = n.costPerUnit;
|
|
1344
1371
|
if (p) {
|
|
1345
|
-
const j = V.toFormatString({ value: p.conversion }),
|
|
1346
|
-
return
|
|
1347
|
-
|
|
1372
|
+
const j = V.toFormatString({ value: p.conversion }), le = `${D.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} ${n.baseUnit} ÷ ${j} × ${v} ${d.value}`;
|
|
1373
|
+
return x(
|
|
1374
|
+
ge.FmTooltip,
|
|
1348
1375
|
{ zIndex: 51 },
|
|
1349
1376
|
{
|
|
1350
1377
|
content() {
|
|
1351
|
-
return
|
|
1378
|
+
return le;
|
|
1352
1379
|
},
|
|
1353
1380
|
default() {
|
|
1354
|
-
return
|
|
1381
|
+
return x(
|
|
1355
1382
|
"div",
|
|
1356
1383
|
{ class: "text-right" },
|
|
1357
1384
|
o.toLocaleString("en-US", {
|
|
@@ -1363,16 +1390,16 @@ const ka = kt(
|
|
|
1363
1390
|
}
|
|
1364
1391
|
);
|
|
1365
1392
|
} else {
|
|
1366
|
-
const j = `${
|
|
1367
|
-
return
|
|
1368
|
-
|
|
1393
|
+
const j = `${D.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} ${n.baseUnit} × ${v} ${d.value}`;
|
|
1394
|
+
return x(
|
|
1395
|
+
ge.FmTooltip,
|
|
1369
1396
|
{ zIndex: 51 },
|
|
1370
1397
|
{
|
|
1371
1398
|
content() {
|
|
1372
1399
|
return j;
|
|
1373
1400
|
},
|
|
1374
1401
|
default() {
|
|
1375
|
-
return
|
|
1402
|
+
return x(
|
|
1376
1403
|
"div",
|
|
1377
1404
|
{ class: "text-right" },
|
|
1378
1405
|
o.toLocaleString("en-US", {
|
|
@@ -1392,22 +1419,22 @@ const ka = kt(
|
|
|
1392
1419
|
{
|
|
1393
1420
|
id: "systemValue",
|
|
1394
1421
|
accessorKey: "systemValue",
|
|
1395
|
-
header: () =>
|
|
1422
|
+
header: () => Z(`System value (${d.value})`),
|
|
1396
1423
|
size: 180,
|
|
1397
1424
|
cell(f) {
|
|
1398
1425
|
var T;
|
|
1399
|
-
const n = f.row.original, o = n.systemValue, i =
|
|
1426
|
+
const n = f.row.original, o = n.systemValue, i = K.value.find((j) => j._id === n.id), p = (T = i == null ? void 0 : i.defaultCost) == null ? void 0 : T.measurement, D = n.systemBalance, v = n.costPerUnit;
|
|
1400
1427
|
if (p) {
|
|
1401
|
-
const j = V.toFormatString({ value: p.conversion }),
|
|
1402
|
-
return
|
|
1403
|
-
|
|
1428
|
+
const j = V.toFormatString({ value: p.conversion }), le = `${D.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })} ${n.baseUnit} ÷ ${j} × ${v} ${d.value}`;
|
|
1429
|
+
return x(
|
|
1430
|
+
ge.FmTooltip,
|
|
1404
1431
|
{ zIndex: 51 },
|
|
1405
1432
|
{
|
|
1406
1433
|
content() {
|
|
1407
|
-
return
|
|
1434
|
+
return le;
|
|
1408
1435
|
},
|
|
1409
1436
|
default() {
|
|
1410
|
-
return
|
|
1437
|
+
return x(
|
|
1411
1438
|
"div",
|
|
1412
1439
|
{ class: "text-right" },
|
|
1413
1440
|
o.toLocaleString("en-US", {
|
|
@@ -1419,16 +1446,16 @@ const ka = kt(
|
|
|
1419
1446
|
}
|
|
1420
1447
|
);
|
|
1421
1448
|
} else {
|
|
1422
|
-
const j = `${
|
|
1423
|
-
return
|
|
1424
|
-
|
|
1449
|
+
const j = `${D.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })} ${n.baseUnit} × ${v} ${d.value}`;
|
|
1450
|
+
return x(
|
|
1451
|
+
ge.FmTooltip,
|
|
1425
1452
|
{ zIndex: 51 },
|
|
1426
1453
|
{
|
|
1427
1454
|
content() {
|
|
1428
1455
|
return j;
|
|
1429
1456
|
},
|
|
1430
1457
|
default() {
|
|
1431
|
-
return
|
|
1458
|
+
return x(
|
|
1432
1459
|
"div",
|
|
1433
1460
|
{ class: "text-right" },
|
|
1434
1461
|
o.toLocaleString("en-US", {
|
|
@@ -1450,41 +1477,41 @@ const ka = kt(
|
|
|
1450
1477
|
header: () => "Amounts",
|
|
1451
1478
|
enableSorting: !1,
|
|
1452
1479
|
cell(f) {
|
|
1453
|
-
const n = f.row.original, o = (p,
|
|
1454
|
-
|
|
1480
|
+
const n = f.row.original, o = (p, D) => x(
|
|
1481
|
+
ge.FmTooltip,
|
|
1455
1482
|
{ zIndex: 50 },
|
|
1456
1483
|
{
|
|
1457
1484
|
default() {
|
|
1458
|
-
return
|
|
1485
|
+
return x(
|
|
1459
1486
|
"div",
|
|
1460
1487
|
{
|
|
1461
1488
|
class: "fm-typo-en-body-md-400 py-4 px-8 border-1 border-fm-color-typo-secondary fm-corner-radius-md line-clamp-1"
|
|
1462
1489
|
},
|
|
1463
1490
|
[
|
|
1464
|
-
|
|
1465
|
-
|
|
1491
|
+
x("span", { class: "text-fm-color-typo-primary" }, `${p} `),
|
|
1492
|
+
x(
|
|
1466
1493
|
"span",
|
|
1467
1494
|
{
|
|
1468
1495
|
class: "text-fm-color-typo-secondary",
|
|
1469
1496
|
style: { maxWidth: "80px" }
|
|
1470
1497
|
},
|
|
1471
|
-
|
|
1498
|
+
D
|
|
1472
1499
|
)
|
|
1473
1500
|
]
|
|
1474
1501
|
);
|
|
1475
1502
|
},
|
|
1476
1503
|
content() {
|
|
1477
|
-
return `${p} ${
|
|
1504
|
+
return `${p} ${D}`;
|
|
1478
1505
|
}
|
|
1479
1506
|
}
|
|
1480
1507
|
);
|
|
1481
|
-
let i = Array.from({ length:
|
|
1482
|
-
if (!n[`measurementAmount${
|
|
1508
|
+
let i = Array.from({ length: r }).map((p, D) => {
|
|
1509
|
+
if (!n[`measurementAmount${D}`])
|
|
1483
1510
|
return null;
|
|
1484
|
-
const v = n[`measurementAmount${
|
|
1511
|
+
const v = n[`measurementAmount${D}`], T = n[`measurementAbbrev${D}`];
|
|
1485
1512
|
return o(v, T);
|
|
1486
1513
|
}).filter((p) => p);
|
|
1487
|
-
return (n.baseUnitAmount || !i.length) && (i = [o(n.baseUnitAmount, n.baseUnit), ...i]),
|
|
1514
|
+
return (n.baseUnitAmount || !i.length) && (i = [o(n.baseUnitAmount, n.baseUnit), ...i]), x(
|
|
1488
1515
|
"div",
|
|
1489
1516
|
{
|
|
1490
1517
|
class: "flex gap-8 flex-nowrap",
|
|
@@ -1497,94 +1524,94 @@ const ka = kt(
|
|
|
1497
1524
|
}
|
|
1498
1525
|
}
|
|
1499
1526
|
];
|
|
1500
|
-
}),
|
|
1527
|
+
}), Ue = L(() => Ce.value.map((r) => r.size ?? 0).reduce((r, a) => r + a)), xe = Y(""), $e = L(() => {
|
|
1501
1528
|
var f, n;
|
|
1502
|
-
const
|
|
1529
|
+
const r = ((n = (f = e.draft) == null ? void 0 : f.negativeStockItems) == null ? void 0 : n.reduce(
|
|
1503
1530
|
(o, i) => (o[i.sku._id] = i, o),
|
|
1504
1531
|
{}
|
|
1505
1532
|
)) ?? {};
|
|
1506
|
-
return
|
|
1507
|
-
var
|
|
1508
|
-
const i = (
|
|
1533
|
+
return K.value.map((o) => {
|
|
1534
|
+
var nt, ot, st, rt, lt, it, ct, ut, mt, dt, ft;
|
|
1535
|
+
const i = (nt = be.value.get(o._id)) == null ? void 0 : nt[0], p = ((ot = de.value.get(o._id)) == null ? void 0 : ot[0]) ?? w, D = ((st = o.defaultCost) == null ? void 0 : st.costPerUnit) ?? w, v = Number(V.toFormatString({ value: D })), T = ((lt = (rt = o.defaultCost) == null ? void 0 : rt.measurement) == null ? void 0 : lt.conversion) ?? {
|
|
1509
1536
|
amount: 1,
|
|
1510
1537
|
precision: 0
|
|
1511
1538
|
}, j = Number(
|
|
1512
1539
|
V.toFormatString({ value: T })
|
|
1513
|
-
),
|
|
1514
|
-
if (B.value.forEach((
|
|
1515
|
-
const ue = C[
|
|
1516
|
-
fe && (C[
|
|
1540
|
+
), le = Ie.value.get(o._id), ce = le ? Number(V.toFormatString({ value: le })) : 0, De = he.value.get(o._id), C = {};
|
|
1541
|
+
if (B.value.forEach((W) => {
|
|
1542
|
+
const ue = C[W] ?? { amount: 0, precision: 0 }, fe = De == null ? void 0 : De[W];
|
|
1543
|
+
fe && (C[W] = Gt(ue, fe));
|
|
1517
1544
|
}), !i) {
|
|
1518
|
-
const
|
|
1545
|
+
const W = Number(V.toFormatString({ value: p })), ue = W - 0, fe = ue * v / j, Re = 0, jt = W * v / j;
|
|
1519
1546
|
return {
|
|
1520
1547
|
id: o._id,
|
|
1521
1548
|
code: o.code,
|
|
1522
1549
|
name: o.name,
|
|
1523
|
-
costUnit: ((
|
|
1550
|
+
costUnit: ((ct = (it = o.defaultCost) == null ? void 0 : it.measurement) == null ? void 0 : ct.abbrev) ?? null,
|
|
1524
1551
|
baseUnit: o.unit.abbrev,
|
|
1525
1552
|
baseUnitAmount: 0,
|
|
1526
|
-
systemBalance:
|
|
1553
|
+
systemBalance: W,
|
|
1527
1554
|
physicalBalance: 0,
|
|
1528
|
-
adjustedAmount: -
|
|
1555
|
+
adjustedAmount: -W,
|
|
1529
1556
|
adjustedDiffPercentage: -100,
|
|
1530
|
-
isTemplateItem: !
|
|
1557
|
+
isTemplateItem: !r[o._id],
|
|
1531
1558
|
costPerUnit: v,
|
|
1532
1559
|
opening: ce,
|
|
1533
1560
|
varianceQty: ue,
|
|
1534
1561
|
varianceInCost: fe,
|
|
1535
|
-
stockTakeValue:
|
|
1536
|
-
systemValue:
|
|
1562
|
+
stockTakeValue: Re,
|
|
1563
|
+
systemValue: jt,
|
|
1537
1564
|
adjustmentAmounts: C
|
|
1538
1565
|
};
|
|
1539
1566
|
}
|
|
1540
|
-
const
|
|
1541
|
-
(
|
|
1542
|
-
)) == null ? void 0 :
|
|
1543
|
-
|
|
1567
|
+
const G = St(i), ee = (mt = (ut = P.value) == null ? void 0 : ut.find(
|
|
1568
|
+
(W) => W.id === o._id
|
|
1569
|
+
)) == null ? void 0 : mt.balance, ve = xt(
|
|
1570
|
+
ee ?? G,
|
|
1544
1571
|
p
|
|
1545
|
-
),
|
|
1572
|
+
), Be = p.amount === 0 ? null : At(ve, {
|
|
1546
1573
|
...p,
|
|
1547
1574
|
amount: Math.abs(p.amount)
|
|
1548
|
-
}),
|
|
1575
|
+
}), Pe = Be ? Xe(Be, X) : null, Ke = Number(V.toFormatString({ value: p })), Qe = Number(V.toFormatString({ value: G })), at = Ke - Qe, $t = at * v / j, Bt = Qe * v / j, Tt = Ke * v / j;
|
|
1549
1576
|
return {
|
|
1550
1577
|
id: o._id,
|
|
1551
1578
|
code: o.code,
|
|
1552
1579
|
name: o.name,
|
|
1553
|
-
costUnit: ((
|
|
1580
|
+
costUnit: ((ft = (dt = o.defaultCost) == null ? void 0 : dt.measurement) == null ? void 0 : ft.abbrev) ?? null,
|
|
1554
1581
|
baseUnit: o.unit.abbrev,
|
|
1555
1582
|
baseUnitAmount: Number(V.toFormatString({ value: i.baseAmount })),
|
|
1556
|
-
...i.measurementsAmounts.filter((
|
|
1557
|
-
var ue, fe,
|
|
1558
|
-
return (
|
|
1559
|
-
}).reduce((
|
|
1560
|
-
systemBalance:
|
|
1561
|
-
physicalBalance:
|
|
1562
|
-
adjustedAmount: Number(V.toFormatString({ value:
|
|
1563
|
-
adjustedDiffPercentage:
|
|
1583
|
+
...i.measurementsAmounts.filter((W) => {
|
|
1584
|
+
var ue, fe, Re;
|
|
1585
|
+
return (Re = (fe = (ue = J.value) == null ? void 0 : ue.get(o._id)) == null ? void 0 : fe[0]) == null ? void 0 : Re.includes(W.measurement.id);
|
|
1586
|
+
}).reduce((W, ue, fe) => (W[`measurementAbbrev${fe}`] = `(${ue.measurement.abbrev}) × ${V.toFormatString({ value: ue.measurement.conversion })}`, W[`measurementAmount${fe}`] = Number(V.toFormatString({ value: ue.amount })), W), {}),
|
|
1587
|
+
systemBalance: Ke,
|
|
1588
|
+
physicalBalance: Qe,
|
|
1589
|
+
adjustedAmount: Number(V.toFormatString({ value: ve })),
|
|
1590
|
+
adjustedDiffPercentage: Pe ? Number(
|
|
1564
1591
|
V.toFormatString({
|
|
1565
|
-
value:
|
|
1592
|
+
value: _t(Pe, 2)
|
|
1566
1593
|
})
|
|
1567
1594
|
) : null,
|
|
1568
|
-
isTemplateItem: !
|
|
1595
|
+
isTemplateItem: !r[o._id],
|
|
1569
1596
|
costPerUnit: v,
|
|
1570
1597
|
opening: ce,
|
|
1571
|
-
varianceQty:
|
|
1572
|
-
varianceInCost:
|
|
1573
|
-
stockTakeValue:
|
|
1574
|
-
systemValue:
|
|
1598
|
+
varianceQty: at,
|
|
1599
|
+
varianceInCost: $t,
|
|
1600
|
+
stockTakeValue: Bt,
|
|
1601
|
+
systemValue: Tt,
|
|
1575
1602
|
adjustmentAmounts: C
|
|
1576
1603
|
};
|
|
1577
|
-
}).filter((o) => !!(o.isTemplateItem &&
|
|
1578
|
-
}),
|
|
1604
|
+
}).filter((o) => !!(o.isTemplateItem && F.value.templateItem || !o.isTemplateItem && F.value.nonTemplateItem));
|
|
1605
|
+
}), Ae = L(() => {
|
|
1579
1606
|
var a, f, n, o, i;
|
|
1580
1607
|
if (!e.draft) return [];
|
|
1581
|
-
const
|
|
1582
|
-
action: `Approve at ${
|
|
1608
|
+
const r = e.draft.approvedAt ? {
|
|
1609
|
+
action: `Approve at ${ye(e.draft.approvedAt)}`,
|
|
1583
1610
|
// actionAt: props.draft.approvedAt,
|
|
1584
1611
|
actionBy: e.draft.approvedBy,
|
|
1585
1612
|
remark: e.draft.approveRemark
|
|
1586
1613
|
} : (a = e.draft.rejectionHistory) == null ? void 0 : a.computeFirst((p) => ({
|
|
1587
|
-
action: `Reject at ${
|
|
1614
|
+
action: `Reject at ${ye(p.rejectedAt)}`,
|
|
1588
1615
|
// actionAt: e.rejectedAt,
|
|
1589
1616
|
actionBy: p.rejectedBy,
|
|
1590
1617
|
remark: p.rejectRemark
|
|
@@ -1596,7 +1623,7 @@ const ka = kt(
|
|
|
1596
1623
|
},
|
|
1597
1624
|
{
|
|
1598
1625
|
label: "Created at",
|
|
1599
|
-
value:
|
|
1626
|
+
value: ye(e.draft.createdAt)
|
|
1600
1627
|
},
|
|
1601
1628
|
{
|
|
1602
1629
|
label: "Created by",
|
|
@@ -1604,7 +1631,7 @@ const ka = kt(
|
|
|
1604
1631
|
},
|
|
1605
1632
|
{
|
|
1606
1633
|
label: "Updated at",
|
|
1607
|
-
value:
|
|
1634
|
+
value: ye(e.draft.updatedAt)
|
|
1608
1635
|
},
|
|
1609
1636
|
{
|
|
1610
1637
|
label: "Updated by",
|
|
@@ -1612,7 +1639,7 @@ const ka = kt(
|
|
|
1612
1639
|
},
|
|
1613
1640
|
{
|
|
1614
1641
|
label: "Effective at",
|
|
1615
|
-
value:
|
|
1642
|
+
value: ye(e.draft.effectiveAt ?? Ve((n = e.draft) == null ? void 0 : n._id))
|
|
1616
1643
|
},
|
|
1617
1644
|
{
|
|
1618
1645
|
label: "Using template",
|
|
@@ -1622,20 +1649,20 @@ const ka = kt(
|
|
|
1622
1649
|
label: "Remark",
|
|
1623
1650
|
value: e.draft.remark
|
|
1624
1651
|
} : null,
|
|
1625
|
-
|
|
1652
|
+
r ? {
|
|
1626
1653
|
label: "Last action",
|
|
1627
|
-
value:
|
|
1654
|
+
value: r.action
|
|
1628
1655
|
} : null,
|
|
1629
|
-
|
|
1656
|
+
r && r.actionBy ? {
|
|
1630
1657
|
label: "Last action by",
|
|
1631
|
-
value: (i =
|
|
1658
|
+
value: (i = r.actionBy) == null ? void 0 : i.name
|
|
1632
1659
|
} : null,
|
|
1633
|
-
|
|
1660
|
+
r && r.remark ? {
|
|
1634
1661
|
label: "Action remark",
|
|
1635
|
-
value:
|
|
1662
|
+
value: r.remark
|
|
1636
1663
|
} : null
|
|
1637
1664
|
].filter((p) => p).map((p) => p);
|
|
1638
|
-
}),
|
|
1665
|
+
}), _e = [
|
|
1639
1666
|
{
|
|
1640
1667
|
label: "Overview",
|
|
1641
1668
|
value: "overview"
|
|
@@ -1644,32 +1671,32 @@ const ka = kt(
|
|
|
1644
1671
|
label: "Action history",
|
|
1645
1672
|
value: "history"
|
|
1646
1673
|
}
|
|
1647
|
-
],
|
|
1674
|
+
], ke = Y(_e[0]), we = L(() => {
|
|
1648
1675
|
var n, o, i;
|
|
1649
|
-
const
|
|
1676
|
+
const r = ((n = e.draft) == null ? void 0 : n.activityLogs) ?? [], a = ((o = e.draft) == null ? void 0 : o.rejectionHistory) ?? [];
|
|
1650
1677
|
for (const p of a)
|
|
1651
|
-
|
|
1678
|
+
r.find(
|
|
1652
1679
|
(v) => `${v.action}_${v.performedAt}` == `${O.enum.rejectDraft}_${p.rejectedAt}`
|
|
1653
|
-
) ||
|
|
1680
|
+
) || r.push({
|
|
1654
1681
|
action: O.enum.rejectDraft,
|
|
1655
1682
|
performedAt: p.rejectedAt,
|
|
1656
1683
|
performedBy: p.rejectedBy,
|
|
1657
1684
|
remark: p.rejectRemark
|
|
1658
1685
|
});
|
|
1659
|
-
return (i = e.draft) != null && i.approvedAt && (
|
|
1660
|
-
(
|
|
1686
|
+
return (i = e.draft) != null && i.approvedAt && (r.find(
|
|
1687
|
+
(D) => {
|
|
1661
1688
|
var v;
|
|
1662
|
-
return `${
|
|
1689
|
+
return `${D.action}_${D.performedAt}` == `${O.enum.approveDraft}_${(v = e.draft) == null ? void 0 : v.approvedAt}`;
|
|
1663
1690
|
}
|
|
1664
|
-
) ||
|
|
1691
|
+
) || r.push({
|
|
1665
1692
|
action: O.enum.approveDraft,
|
|
1666
1693
|
performedAt: e.draft.approvedAt,
|
|
1667
1694
|
performedBy: e.draft.approvedBy ?? { name: "Unknown", id: "unknown" },
|
|
1668
1695
|
remark: e.draft.approveRemark
|
|
1669
|
-
})),
|
|
1696
|
+
})), r.sort((p, D) => new Date(D.performedAt).getTime() - new Date(p.performedAt).getTime()).map(
|
|
1670
1697
|
(p) => ({
|
|
1671
|
-
header:
|
|
1672
|
-
date:
|
|
1698
|
+
header: Le(p.action),
|
|
1699
|
+
date: ye(p.performedAt),
|
|
1673
1700
|
info: [
|
|
1674
1701
|
{
|
|
1675
1702
|
label: "Performed by",
|
|
@@ -1682,127 +1709,127 @@ const ka = kt(
|
|
|
1682
1709
|
]
|
|
1683
1710
|
})
|
|
1684
1711
|
);
|
|
1685
|
-
}),
|
|
1686
|
-
var o, i, p,
|
|
1712
|
+
}), tt = L(() => {
|
|
1713
|
+
var o, i, p, D;
|
|
1687
1714
|
if (!((o = e.draft) != null && o.stockSnapshot)) return "Stock snapshot is not available.";
|
|
1688
|
-
if (((i = e.draft) == null ? void 0 : i.status) !==
|
|
1689
|
-
const
|
|
1715
|
+
if (((i = e.draft) == null ? void 0 : i.status) !== pe.enum.DRAFT) return "Status is not draft.";
|
|
1716
|
+
const r = $e.value.some((v) => v.physicalBalance < 0), a = ((D = (p = h.stockBalance.skus) == null ? void 0 : p.filter((v) => v.balance.amount < 0)) == null ? void 0 : D.map((v) => v.id)) ?? [], f = new Set(K.value.map((v) => v._id)), n = a.filter((v) => !f.has(v)).length;
|
|
1690
1717
|
return [
|
|
1691
|
-
|
|
1718
|
+
r ? "Negative total exist." : null,
|
|
1692
1719
|
n ? "Negative stock is not included in this draft. Please commit the draft to include these stocks." : null
|
|
1693
1720
|
].filter((v) => v).join(" ");
|
|
1694
1721
|
});
|
|
1695
|
-
return (
|
|
1696
|
-
const f = z("FmButtonGroup"), n = z("FmMenuDivider"), o = z("FmCard"), i = z("FmButton"), p = z("FmCircularProgress"),
|
|
1697
|
-
return
|
|
1722
|
+
return (r, a) => {
|
|
1723
|
+
const f = z("FmButtonGroup"), n = z("FmMenuDivider"), o = z("FmCard"), i = z("FmButton"), p = z("FmCircularProgress"), D = z("FmChip"), v = z("FmTextField"), T = z("FmIcon"), j = z("FmTable"), le = z("FmSpacer"), ce = z("FmTooltip"), De = z("FmSideSheet");
|
|
1724
|
+
return S(), oe(De, {
|
|
1698
1725
|
"dismiss-away": "",
|
|
1699
1726
|
"max-width": 9999,
|
|
1700
|
-
"model-value": $(
|
|
1701
|
-
"onUpdate:modelValue": a[10] || (a[10] = (C) =>
|
|
1727
|
+
"model-value": $(b),
|
|
1728
|
+
"onUpdate:modelValue": a[10] || (a[10] = (C) => vt(b) ? b.value = C : null),
|
|
1702
1729
|
header: "Closing details"
|
|
1703
1730
|
}, {
|
|
1704
1731
|
"side-sheet-footer": Q(() => {
|
|
1705
|
-
var C,
|
|
1732
|
+
var C, G, ee, ve;
|
|
1706
1733
|
return [
|
|
1707
|
-
c("div",
|
|
1708
|
-
((C = e.draft) == null ? void 0 : C.status) === $(
|
|
1709
|
-
|
|
1734
|
+
c("div", tn, [
|
|
1735
|
+
((C = e.draft) == null ? void 0 : C.status) === $(pe).enum.DRAFT ? (S(), E(ie, { key: 0 }, [
|
|
1736
|
+
tt.value ? (S(), oe(ce, {
|
|
1710
1737
|
key: 0,
|
|
1711
1738
|
"z-index": 51,
|
|
1712
1739
|
placement: "right"
|
|
1713
1740
|
}, {
|
|
1714
1741
|
content: Q(() => [
|
|
1715
|
-
|
|
1742
|
+
se(ne(tt.value), 1)
|
|
1716
1743
|
]),
|
|
1717
1744
|
default: Q(() => [
|
|
1718
|
-
|
|
1745
|
+
A(i, {
|
|
1719
1746
|
disabled: "",
|
|
1720
1747
|
key: "approve key",
|
|
1721
1748
|
label: "Approve",
|
|
1722
|
-
onClick: a[5] || (a[5] = () => e.draft && $(
|
|
1749
|
+
onClick: a[5] || (a[5] = () => e.draft && $(y).approveDraft(e.draft, () => m("submitted")))
|
|
1723
1750
|
})
|
|
1724
1751
|
]),
|
|
1725
1752
|
_: 1
|
|
1726
|
-
})) : (
|
|
1753
|
+
})) : (S(), oe(i, {
|
|
1727
1754
|
key: "approve key",
|
|
1728
1755
|
label: "Approve",
|
|
1729
|
-
onClick: a[6] || (a[6] = () => e.draft && $(
|
|
1756
|
+
onClick: a[6] || (a[6] = () => e.draft && $(y).approveDraft(e.draft, () => m("submitted")))
|
|
1730
1757
|
}))
|
|
1731
|
-
], 64)) :
|
|
1732
|
-
((
|
|
1758
|
+
], 64)) : te("", !0),
|
|
1759
|
+
((G = e.draft) == null ? void 0 : G.status) === $(pe).enum.DRAFT ? (S(), oe(i, {
|
|
1733
1760
|
key: 1,
|
|
1734
1761
|
label: "Reject",
|
|
1735
1762
|
variant: "destructive",
|
|
1736
|
-
onClick: a[7] || (a[7] = () => e.draft && $(
|
|
1737
|
-
})) :
|
|
1738
|
-
(
|
|
1763
|
+
onClick: a[7] || (a[7] = () => e.draft && $(y).rejectDraft(e.draft, () => m("submitted")))
|
|
1764
|
+
})) : te("", !0),
|
|
1765
|
+
(ee = e.draft) != null && ee.approvedAt && ((ve = e.draft) == null ? void 0 : ve.status) !== $(pe).enum.COMPLETED ? (S(), oe(Ge, { key: 2 }, {
|
|
1739
1766
|
default: Q(() => [
|
|
1740
|
-
|
|
1767
|
+
A(i, {
|
|
1741
1768
|
label: "Sync",
|
|
1742
1769
|
loading: U.value,
|
|
1743
1770
|
onClick: a[8] || (a[8] = () => {
|
|
1744
|
-
e.draft && (U.value = !0, $(
|
|
1745
|
-
U.value = !1,
|
|
1771
|
+
e.draft && (U.value = !0, $(y).syncDraft(e.draft, () => {
|
|
1772
|
+
U.value = !1, m("submitted");
|
|
1746
1773
|
}));
|
|
1747
1774
|
})
|
|
1748
1775
|
}, null, 8, ["loading"])
|
|
1749
1776
|
]),
|
|
1750
1777
|
_: 1
|
|
1751
|
-
})) :
|
|
1752
|
-
|
|
1778
|
+
})) : te("", !0),
|
|
1779
|
+
A(i, {
|
|
1753
1780
|
label: "Close",
|
|
1754
1781
|
variant: "tertiary",
|
|
1755
|
-
onClick: a[9] || (a[9] = (
|
|
1782
|
+
onClick: a[9] || (a[9] = (Be) => b.value = !1)
|
|
1756
1783
|
})
|
|
1757
1784
|
])
|
|
1758
1785
|
];
|
|
1759
1786
|
}),
|
|
1760
1787
|
default: Q(() => [
|
|
1761
|
-
c("div",
|
|
1788
|
+
c("div", Da, [
|
|
1762
1789
|
c("div", null, [
|
|
1763
|
-
|
|
1764
|
-
items:
|
|
1765
|
-
modelValue:
|
|
1766
|
-
"onUpdate:modelValue": a[0] || (a[0] = (C) =>
|
|
1790
|
+
A(f, {
|
|
1791
|
+
items: _e,
|
|
1792
|
+
modelValue: ke.value,
|
|
1793
|
+
"onUpdate:modelValue": a[0] || (a[0] = (C) => ke.value = C)
|
|
1767
1794
|
}, null, 8, ["modelValue"])
|
|
1768
1795
|
]),
|
|
1769
|
-
|
|
1770
|
-
|
|
1796
|
+
ke.value.value === "overview" ? (S(), E(ie, { key: 0 }, [
|
|
1797
|
+
A(o, {
|
|
1771
1798
|
variant: "outlined",
|
|
1772
1799
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1773
1800
|
}, {
|
|
1774
1801
|
default: Q(() => {
|
|
1775
|
-
var C,
|
|
1802
|
+
var C, G;
|
|
1776
1803
|
return [
|
|
1777
|
-
c("div",
|
|
1804
|
+
c("div", xa, [
|
|
1778
1805
|
a[11] || (a[11] = c("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
|
|
1779
|
-
c("div",
|
|
1806
|
+
c("div", Aa, [
|
|
1780
1807
|
c("div", {
|
|
1781
|
-
class: Fe(["fm-status-badge", $(
|
|
1782
|
-
},
|
|
1808
|
+
class: Fe(["fm-status-badge", $(Ne)(((C = r.draft) == null ? void 0 : C.status) ?? "DRAFT")])
|
|
1809
|
+
}, ne($(Le)(((G = r.draft) == null ? void 0 : G.status) ?? "")), 3)
|
|
1783
1810
|
])
|
|
1784
1811
|
]),
|
|
1785
|
-
|
|
1786
|
-
c("div",
|
|
1787
|
-
(
|
|
1812
|
+
A(n),
|
|
1813
|
+
c("div", _a, [
|
|
1814
|
+
(S(!0), E(ie, null, Te(Ae.value, (ee, ve) => (S(), E("div", {
|
|
1788
1815
|
class: "flex flex-col gap-4",
|
|
1789
|
-
key:
|
|
1816
|
+
key: ve
|
|
1790
1817
|
}, [
|
|
1791
|
-
c("div",
|
|
1792
|
-
c("div",
|
|
1818
|
+
c("div", wa, [
|
|
1819
|
+
c("div", Sa, ne(ee.label), 1)
|
|
1793
1820
|
]),
|
|
1794
|
-
c("div",
|
|
1821
|
+
c("div", Fa, ne(ee.value), 1)
|
|
1795
1822
|
]))), 128))
|
|
1796
1823
|
])
|
|
1797
1824
|
];
|
|
1798
1825
|
}),
|
|
1799
1826
|
_: 1
|
|
1800
1827
|
}),
|
|
1801
|
-
c("div",
|
|
1802
|
-
c("div",
|
|
1828
|
+
c("div", Ca, [
|
|
1829
|
+
c("div", $a, [
|
|
1803
1830
|
a[12] || (a[12] = c("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
|
|
1804
|
-
I.value ?
|
|
1805
|
-
|
|
1831
|
+
I.value ? te("", !0) : (S(), E("div", Ba, [
|
|
1832
|
+
r.draft && r.draft.status !== $(pe).enum.COMPLETED ? (S(), oe(i, {
|
|
1806
1833
|
key: 0,
|
|
1807
1834
|
label: "Refresh balance",
|
|
1808
1835
|
"prepend-icon": "refresh",
|
|
@@ -1810,160 +1837,176 @@ const ka = kt(
|
|
|
1810
1837
|
"text-color": "primary",
|
|
1811
1838
|
"bg-color": "transparent",
|
|
1812
1839
|
"border-color": "primary",
|
|
1813
|
-
loading:
|
|
1814
|
-
onClick:
|
|
1815
|
-
}, null, 8, ["loading"])) :
|
|
1816
|
-
|
|
1840
|
+
loading: M.value,
|
|
1841
|
+
onClick: ae
|
|
1842
|
+
}, null, 8, ["loading"])) : te("", !0),
|
|
1843
|
+
A(Ge, null, {
|
|
1844
|
+
default: Q(() => [
|
|
1845
|
+
r.draft && r.draft.status !== $(pe).enum.COMPLETED ? (S(), oe(i, {
|
|
1846
|
+
key: 0,
|
|
1847
|
+
label: "Invalidate Draft Cache",
|
|
1848
|
+
"prepend-icon": "refresh",
|
|
1849
|
+
variant: "secondary",
|
|
1850
|
+
"text-color": "primary",
|
|
1851
|
+
"bg-color": "transparent",
|
|
1852
|
+
"border-color": "primary",
|
|
1853
|
+
loading: M.value,
|
|
1854
|
+
onClick: re
|
|
1855
|
+
}, null, 8, ["loading"])) : te("", !0)
|
|
1856
|
+
]),
|
|
1857
|
+
_: 1
|
|
1858
|
+
}),
|
|
1859
|
+
A(i, {
|
|
1817
1860
|
label: "Export data",
|
|
1818
1861
|
"prepend-icon": "download",
|
|
1819
1862
|
variant: "secondary",
|
|
1820
1863
|
"text-color": "primary",
|
|
1821
1864
|
"bg-color": "transparent",
|
|
1822
1865
|
"border-color": "primary",
|
|
1823
|
-
onClick: a[1] || (a[1] = (C) =>
|
|
1824
|
-
|
|
1825
|
-
|
|
1866
|
+
onClick: a[1] || (a[1] = (C) => r.draft ? $(y).exportDraft(
|
|
1867
|
+
r.draft,
|
|
1868
|
+
k.value,
|
|
1826
1869
|
P.value
|
|
1827
1870
|
) : null)
|
|
1828
1871
|
})
|
|
1829
1872
|
]))
|
|
1830
1873
|
]),
|
|
1831
|
-
I.value ? (
|
|
1874
|
+
I.value ? (S(), E("div", Ta, [
|
|
1832
1875
|
a[14] || (a[14] = c("div", { class: "h-80" }, null, -1)),
|
|
1833
|
-
c("div",
|
|
1876
|
+
c("div", ja, [
|
|
1834
1877
|
c("div", null, [
|
|
1835
|
-
|
|
1878
|
+
A(p, { size: "md" })
|
|
1836
1879
|
]),
|
|
1837
1880
|
a[13] || (a[13] = c("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fetching info... ", -1))
|
|
1838
1881
|
]),
|
|
1839
1882
|
a[15] || (a[15] = c("div", { class: "h-80" }, null, -1))
|
|
1840
|
-
])) : (
|
|
1841
|
-
c("div",
|
|
1842
|
-
c("div",
|
|
1843
|
-
|
|
1883
|
+
])) : (S(), E(ie, { key: 1 }, [
|
|
1884
|
+
c("div", Ia, [
|
|
1885
|
+
c("div", Ua, [
|
|
1886
|
+
A(D, {
|
|
1844
1887
|
label: "Template Item(s)",
|
|
1845
|
-
selected:
|
|
1846
|
-
onClick: a[2] || (a[2] = (C) =>
|
|
1888
|
+
selected: F.value.templateItem,
|
|
1889
|
+
onClick: a[2] || (a[2] = (C) => F.value.templateItem = !F.value.templateItem)
|
|
1847
1890
|
}, null, 8, ["selected"]),
|
|
1848
|
-
|
|
1891
|
+
A(D, {
|
|
1849
1892
|
label: "Non-template Item(s)",
|
|
1850
|
-
selected:
|
|
1851
|
-
onClick: a[3] || (a[3] = (C) =>
|
|
1893
|
+
selected: F.value.nonTemplateItem,
|
|
1894
|
+
onClick: a[3] || (a[3] = (C) => F.value.nonTemplateItem = !F.value.nonTemplateItem)
|
|
1852
1895
|
}, null, 8, ["selected"])
|
|
1853
1896
|
]),
|
|
1854
|
-
|
|
1855
|
-
modelValue:
|
|
1856
|
-
"onUpdate:modelValue": a[4] || (a[4] = (C) =>
|
|
1897
|
+
A(v, {
|
|
1898
|
+
modelValue: xe.value,
|
|
1899
|
+
"onUpdate:modelValue": a[4] || (a[4] = (C) => xe.value = C),
|
|
1857
1900
|
placeholder: "Filter items"
|
|
1858
1901
|
}, null, 8, ["modelValue"])
|
|
1859
1902
|
]),
|
|
1860
|
-
$(_).skuTags.size ? (
|
|
1861
|
-
(
|
|
1903
|
+
$(_).skuTags.size ? (S(), E("div", Pa, [
|
|
1904
|
+
(S(!0), E(ie, null, Te($(_).skuTags.keys(), (C) => (S(), oe(D, {
|
|
1862
1905
|
key: `${C}`,
|
|
1863
1906
|
label: `${C}`,
|
|
1864
1907
|
selectable: "",
|
|
1865
|
-
selected:
|
|
1866
|
-
onClick: (
|
|
1908
|
+
selected: N[`${C}`],
|
|
1909
|
+
onClick: (G) => N[`${C}`] = !N[`${C}`]
|
|
1867
1910
|
}, {
|
|
1868
1911
|
default: Q(() => [
|
|
1869
|
-
|
|
1912
|
+
N[`${C}`] ? (S(), oe(T, {
|
|
1870
1913
|
key: 0,
|
|
1871
1914
|
name: "check",
|
|
1872
1915
|
class: "text-white",
|
|
1873
1916
|
size: "sm"
|
|
1874
|
-
})) :
|
|
1917
|
+
})) : te("", !0),
|
|
1875
1918
|
c("span", {
|
|
1876
1919
|
class: Fe([
|
|
1877
1920
|
"",
|
|
1878
1921
|
{
|
|
1879
|
-
"text-white fm-typo-en-body-md-600":
|
|
1880
|
-
"text-fm-color-typo-primary fm-typo-en-body-md-400": !
|
|
1922
|
+
"text-white fm-typo-en-body-md-600": N[`${C}`],
|
|
1923
|
+
"text-fm-color-typo-primary fm-typo-en-body-md-400": !N[`${C}`]
|
|
1881
1924
|
}
|
|
1882
1925
|
])
|
|
1883
|
-
},
|
|
1926
|
+
}, ne(C), 3)
|
|
1884
1927
|
]),
|
|
1885
1928
|
_: 2
|
|
1886
1929
|
}, 1032, ["label", "selected", "onClick"]))), 128))
|
|
1887
|
-
])) :
|
|
1888
|
-
c("div",
|
|
1930
|
+
])) : te("", !0),
|
|
1931
|
+
c("div", Ra, [
|
|
1889
1932
|
c("div", {
|
|
1890
|
-
style:
|
|
1933
|
+
style: gt({ height: "600px", minWidth: `${Ue.value}px` })
|
|
1891
1934
|
}, [
|
|
1892
|
-
|
|
1893
|
-
"column-defs":
|
|
1894
|
-
"row-data":
|
|
1895
|
-
"search-value":
|
|
1935
|
+
A(j, {
|
|
1936
|
+
"column-defs": Ce.value,
|
|
1937
|
+
"row-data": $e.value,
|
|
1938
|
+
"search-value": xe.value
|
|
1896
1939
|
}, null, 8, ["column-defs", "row-data", "search-value"])
|
|
1897
1940
|
], 4)
|
|
1898
1941
|
])
|
|
1899
1942
|
], 64))
|
|
1900
1943
|
])
|
|
1901
|
-
], 64)) :
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
(
|
|
1905
|
-
c("div",
|
|
1906
|
-
c("div",
|
|
1907
|
-
c("div",
|
|
1944
|
+
], 64)) : te("", !0),
|
|
1945
|
+
ke.value.value === "history" ? (S(), E("div", Ma, [
|
|
1946
|
+
we.value.length ? (S(), E("div", Na, [
|
|
1947
|
+
(S(!0), E(ie, null, Te(we.value, (C, G) => (S(), E(ie, { key: G }, [
|
|
1948
|
+
c("div", Ea, [
|
|
1949
|
+
c("div", za, [
|
|
1950
|
+
c("div", Ha, [
|
|
1908
1951
|
c("div", {
|
|
1909
1952
|
class: Fe([
|
|
1910
1953
|
{
|
|
1911
|
-
"bg-fm-color-primary":
|
|
1912
|
-
"bg-white":
|
|
1954
|
+
"bg-fm-color-primary": G !== 0,
|
|
1955
|
+
"bg-white": G === 0
|
|
1913
1956
|
},
|
|
1914
1957
|
"w-[2px] h-full"
|
|
1915
1958
|
])
|
|
1916
1959
|
}, null, 2)
|
|
1917
1960
|
]),
|
|
1918
1961
|
a[18] || (a[18] = c("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1919
|
-
c("div",
|
|
1962
|
+
c("div", Oa, [
|
|
1920
1963
|
c("div", {
|
|
1921
1964
|
class: Fe([
|
|
1922
1965
|
{
|
|
1923
|
-
"bg-fm-color-primary":
|
|
1924
|
-
"bg-white":
|
|
1966
|
+
"bg-fm-color-primary": G < we.value.length - 1,
|
|
1967
|
+
"bg-white": G >= we.value.length - 1
|
|
1925
1968
|
},
|
|
1926
1969
|
"w-[2px] h-full"
|
|
1927
1970
|
])
|
|
1928
1971
|
}, null, 2)
|
|
1929
1972
|
])
|
|
1930
1973
|
]),
|
|
1931
|
-
c("div",
|
|
1932
|
-
c("div",
|
|
1933
|
-
c("div",
|
|
1974
|
+
c("div", Ya, [
|
|
1975
|
+
c("div", Ka, ne(C.header), 1),
|
|
1976
|
+
c("div", Qa, ne(C.date), 1)
|
|
1934
1977
|
])
|
|
1935
1978
|
]),
|
|
1936
|
-
c("div",
|
|
1979
|
+
c("div", qa, [
|
|
1937
1980
|
c("div", Ga, [
|
|
1938
|
-
c("div",
|
|
1981
|
+
c("div", Wa, [
|
|
1939
1982
|
c("div", {
|
|
1940
1983
|
class: Fe([
|
|
1941
1984
|
{
|
|
1942
|
-
"bg-fm-color-primary":
|
|
1943
|
-
"bg-white":
|
|
1985
|
+
"bg-fm-color-primary": G < we.value.length - 1,
|
|
1986
|
+
"bg-white": G >= we.value.length - 1
|
|
1944
1987
|
},
|
|
1945
1988
|
"w-[2px] h-full"
|
|
1946
1989
|
])
|
|
1947
1990
|
}, null, 2)
|
|
1948
1991
|
])
|
|
1949
1992
|
]),
|
|
1950
|
-
c("div",
|
|
1951
|
-
|
|
1993
|
+
c("div", Za, [
|
|
1994
|
+
A(o, {
|
|
1952
1995
|
variant: "outlined",
|
|
1953
1996
|
class: "py-12 px-16"
|
|
1954
1997
|
}, {
|
|
1955
1998
|
default: Q(() => [
|
|
1956
|
-
c("div",
|
|
1957
|
-
(
|
|
1958
|
-
key:
|
|
1999
|
+
c("div", Ja, [
|
|
2000
|
+
(S(!0), E(ie, null, Te(C.info, (ee, ve) => (S(), E("div", {
|
|
2001
|
+
key: ve,
|
|
1959
2002
|
class: "flex flex-col gap-4"
|
|
1960
2003
|
}, [
|
|
1961
|
-
c("div",
|
|
1962
|
-
c("div",
|
|
1963
|
-
(
|
|
1964
|
-
key:
|
|
2004
|
+
c("div", Xa, ne(ee == null ? void 0 : ee.label), 1),
|
|
2005
|
+
c("div", en, [
|
|
2006
|
+
(S(!0), E(ie, null, Te(ee == null ? void 0 : ee.values, (Be, Pe) => (S(), E("div", {
|
|
2007
|
+
key: Pe,
|
|
1965
2008
|
class: "fm-typo-en-body-lg-600"
|
|
1966
|
-
},
|
|
2009
|
+
}, ne(Be), 1))), 128))
|
|
1967
2010
|
])
|
|
1968
2011
|
]))), 128))
|
|
1969
2012
|
])
|
|
@@ -1973,36 +2016,36 @@ const ka = kt(
|
|
|
1973
2016
|
])
|
|
1974
2017
|
])
|
|
1975
2018
|
], 64))), 128))
|
|
1976
|
-
])) : (
|
|
1977
|
-
|
|
2019
|
+
])) : (S(), E("div", Va, [
|
|
2020
|
+
A(le),
|
|
1978
2021
|
c("div", null, [
|
|
1979
2022
|
c("img", {
|
|
1980
|
-
src: $(
|
|
2023
|
+
src: $(aa),
|
|
1981
2024
|
alt: "List is empty"
|
|
1982
|
-
}, null, 8,
|
|
2025
|
+
}, null, 8, La)
|
|
1983
2026
|
]),
|
|
1984
|
-
a[16] || (a[16] = c("div", { class: "fm-typo-en-body-lg-600" },
|
|
1985
|
-
a[17] || (a[17] = c("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" },
|
|
1986
|
-
|
|
1987
|
-
|
|
2027
|
+
a[16] || (a[16] = c("div", { class: "fm-typo-en-body-lg-600" }, ne("No records found"), -1)),
|
|
2028
|
+
a[17] || (a[17] = c("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, ne("You can track approval and rejection history here"), -1)),
|
|
2029
|
+
A(le),
|
|
2030
|
+
A(le)
|
|
1988
2031
|
]))
|
|
1989
|
-
])) :
|
|
2032
|
+
])) : te("", !0)
|
|
1990
2033
|
])
|
|
1991
2034
|
]),
|
|
1992
2035
|
_: 1
|
|
1993
2036
|
}, 8, ["model-value"]);
|
|
1994
2037
|
};
|
|
1995
2038
|
}
|
|
1996
|
-
}),
|
|
2039
|
+
}), on = { class: "flex-1 flex flex-col gap-8" }, sn = { class: "flex flex-col" }, rn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ln = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, cn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, un = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, $n = /* @__PURE__ */ He({
|
|
1997
2040
|
__name: "ClosingDraftView",
|
|
1998
|
-
setup(
|
|
1999
|
-
const { t: s } =
|
|
2000
|
-
|
|
2001
|
-
const U = L(() =>
|
|
2002
|
-
function
|
|
2041
|
+
setup(l) {
|
|
2042
|
+
const { t: s } = bt(), { viewDraft: e } = ze(), { viewClosingDraftProps: d, viewClosingDraftShow: h } = Yt(ze()), y = Oe(), b = ka(), I = Mt(), { breakpoints: M } = Et();
|
|
2043
|
+
y.watchLocation(b.fetchDrafts);
|
|
2044
|
+
const U = L(() => b.loading), k = Y(""), P = L(() => M.value.xs || M.value.sm), B = L(() => P.value ? 10 : 20);
|
|
2045
|
+
function q(_) {
|
|
2003
2046
|
switch (_) {
|
|
2004
2047
|
case "refresh":
|
|
2005
|
-
return
|
|
2048
|
+
return b.fetchDrafts();
|
|
2006
2049
|
}
|
|
2007
2050
|
}
|
|
2008
2051
|
function u(_) {
|
|
@@ -2022,12 +2065,12 @@ const ka = kt(
|
|
|
2022
2065
|
}
|
|
2023
2066
|
]);
|
|
2024
2067
|
return (_, R) => {
|
|
2025
|
-
const
|
|
2026
|
-
return
|
|
2027
|
-
|
|
2068
|
+
const N = z("FmTable");
|
|
2069
|
+
return S(), E(ie, null, [
|
|
2070
|
+
A(Vt, {
|
|
2028
2071
|
title: $(s)("inventory.closing.draft.title"),
|
|
2029
2072
|
actions: t.value,
|
|
2030
|
-
"onClick:action":
|
|
2073
|
+
"onClick:action": q
|
|
2031
2074
|
}, {
|
|
2032
2075
|
default: Q(() => [
|
|
2033
2076
|
c("div", {
|
|
@@ -2039,58 +2082,58 @@ const ka = kt(
|
|
|
2039
2082
|
}
|
|
2040
2083
|
])
|
|
2041
2084
|
}, [
|
|
2042
|
-
|
|
2085
|
+
A(ta, {
|
|
2043
2086
|
"change-location": "",
|
|
2044
2087
|
searchable: "",
|
|
2045
|
-
search:
|
|
2046
|
-
"onUpdate:search": R[0] || (R[0] = (
|
|
2088
|
+
search: k.value,
|
|
2089
|
+
"onUpdate:search": R[0] || (R[0] = (g) => k.value = g)
|
|
2047
2090
|
}, null, 8, ["search"]),
|
|
2048
|
-
|
|
2049
|
-
style:
|
|
2050
|
-
"column-defs": $(
|
|
2051
|
-
"row-data": $(
|
|
2052
|
-
"search-value":
|
|
2091
|
+
A(N, {
|
|
2092
|
+
style: gt($(I).tableHeight),
|
|
2093
|
+
"column-defs": $(b).columnDefs,
|
|
2094
|
+
"row-data": $(b).drafts,
|
|
2095
|
+
"search-value": k.value,
|
|
2053
2096
|
loading: U.value,
|
|
2054
|
-
onRowClick: R[1] || (R[1] = (
|
|
2097
|
+
onRowClick: R[1] || (R[1] = (g) => $(e)(g.original)),
|
|
2055
2098
|
"page-size": B.value
|
|
2056
2099
|
}, {
|
|
2057
|
-
"list-row": Q((
|
|
2058
|
-
|
|
2059
|
-
row:
|
|
2060
|
-
onRowClick: (
|
|
2100
|
+
"list-row": Q((g) => [
|
|
2101
|
+
A(Xt, {
|
|
2102
|
+
row: g,
|
|
2103
|
+
onRowClick: (m) => $(e)(m)
|
|
2061
2104
|
}, {
|
|
2062
|
-
default: Q((
|
|
2063
|
-
var
|
|
2105
|
+
default: Q((m) => {
|
|
2106
|
+
var F, H, K, J, w, X, me, ae, re, de, be, he, Ie, Z, Ce, Ue, xe, $e, Ae, _e;
|
|
2064
2107
|
return [
|
|
2065
|
-
c("div",
|
|
2066
|
-
c("div",
|
|
2067
|
-
c("div",
|
|
2068
|
-
|
|
2069
|
-
render: (
|
|
2070
|
-
props: (
|
|
2108
|
+
c("div", on, [
|
|
2109
|
+
c("div", sn, [
|
|
2110
|
+
c("div", rn, [
|
|
2111
|
+
A($(Me), {
|
|
2112
|
+
render: (K = (H = (F = m._id) == null ? void 0 : F.column) == null ? void 0 : H.columnDef) == null ? void 0 : K.cell,
|
|
2113
|
+
props: (w = (J = m._id) == null ? void 0 : J.getContext) == null ? void 0 : w.call(J)
|
|
2071
2114
|
}, null, 8, ["render", "props"])
|
|
2072
2115
|
]),
|
|
2073
|
-
c("div",
|
|
2074
|
-
|
|
2075
|
-
render: (
|
|
2076
|
-
props: (de = (
|
|
2116
|
+
c("div", ln, [
|
|
2117
|
+
A($(Me), {
|
|
2118
|
+
render: (ae = (me = (X = m.name) == null ? void 0 : X.column) == null ? void 0 : me.columnDef) == null ? void 0 : ae.cell,
|
|
2119
|
+
props: (de = (re = m.name) == null ? void 0 : re.getContext) == null ? void 0 : de.call(re)
|
|
2077
2120
|
}, null, 8, ["render", "props"])
|
|
2078
2121
|
]),
|
|
2079
|
-
c("div",
|
|
2080
|
-
...
|
|
2081
|
-
...
|
|
2122
|
+
c("div", cn, ne([
|
|
2123
|
+
...g.original.items.slice(0, 3).map((ke) => ke.sku.name),
|
|
2124
|
+
...g.original.items.length >= 3 ? [`and ${g.original.items.length - 3} more items`] : []
|
|
2082
2125
|
].join(", ")), 1),
|
|
2083
|
-
c("div",
|
|
2084
|
-
|
|
2085
|
-
render: (
|
|
2086
|
-
props: (
|
|
2126
|
+
c("div", un, [
|
|
2127
|
+
A($(Me), {
|
|
2128
|
+
render: (Ie = (he = (be = m.ref) == null ? void 0 : be.column) == null ? void 0 : he.columnDef) == null ? void 0 : Ie.cell,
|
|
2129
|
+
props: (Ce = (Z = m.ref) == null ? void 0 : Z.getContext) == null ? void 0 : Ce.call(Z)
|
|
2087
2130
|
}, null, 8, ["render", "props"])
|
|
2088
2131
|
])
|
|
2089
2132
|
]),
|
|
2090
2133
|
c("div", null, [
|
|
2091
|
-
|
|
2092
|
-
render: (
|
|
2093
|
-
props: (
|
|
2134
|
+
A($(Me), {
|
|
2135
|
+
render: ($e = (xe = (Ue = m.status) == null ? void 0 : Ue.column) == null ? void 0 : xe.columnDef) == null ? void 0 : $e.cell,
|
|
2136
|
+
props: (_e = (Ae = m.status) == null ? void 0 : Ae.getContext) == null ? void 0 : _e.call(Ae)
|
|
2094
2137
|
}, null, 8, ["render", "props"])
|
|
2095
2138
|
])
|
|
2096
2139
|
])
|
|
@@ -2105,12 +2148,12 @@ const ka = kt(
|
|
|
2105
2148
|
]),
|
|
2106
2149
|
_: 1
|
|
2107
2150
|
}, 8, ["title", "actions"]),
|
|
2108
|
-
(
|
|
2109
|
-
|
|
2110
|
-
show: $(
|
|
2111
|
-
"onUpdate:show": R[2] || (R[2] = (
|
|
2112
|
-
onSubmitted: R[3] || (R[3] = () => (
|
|
2113
|
-
onRefresh: R[4] || (R[4] = (
|
|
2151
|
+
(S(), oe(Pt, { to: "body" }, [
|
|
2152
|
+
A(nn, Rt($(d), {
|
|
2153
|
+
show: $(h),
|
|
2154
|
+
"onUpdate:show": R[2] || (R[2] = (g) => vt(h) ? h.value = g : null),
|
|
2155
|
+
onSubmitted: R[3] || (R[3] = () => (h.value = !1, $(b).fetchDrafts())),
|
|
2156
|
+
onRefresh: R[4] || (R[4] = (g) => $(b).updateDraftRef(g))
|
|
2114
2157
|
}), null, 16, ["show"])
|
|
2115
2158
|
]))
|
|
2116
2159
|
], 64);
|
|
@@ -2118,5 +2161,5 @@ const ka = kt(
|
|
|
2118
2161
|
}
|
|
2119
2162
|
});
|
|
2120
2163
|
export {
|
|
2121
|
-
|
|
2164
|
+
$n as default
|
|
2122
2165
|
};
|