@feedmepos/mf-inventory-portal 1.2.55-dev.1 → 1.2.55
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-Dr4bSbWV.js → App-pElNw5pB.js} +3 -3
- package/dist/{ApprovalView-BrUi6das.js → ApprovalView-B4TSRWMy.js} +5 -5
- package/dist/{BindingsDialog-DtsEDaFx.js → BindingsDialog-DyxWNBG1.js} +2 -2
- package/dist/{BindingsPicker-BDSimsxV.js → BindingsPicker-D7UkLDlk.js} +2 -2
- package/dist/{BindingsTable-ArpmNkQm.js → BindingsTable-Dc8pJO-n.js} +3 -3
- package/dist/{ClosingDraftView-D7qz1YGt.js → ClosingDraftView-CSR72RnD.js} +694 -687
- package/dist/{ClosingHistoryView-ND9smQRb.js → ClosingHistoryView-DvFKOvsZ.js} +3 -3
- package/dist/{ClosingTemplateView--1tzOPIu.js → ClosingTemplateView-CYnVhBqP.js} +14 -14
- package/dist/{DeliveryOrderPrintPreview-Ctv1Qp_a.js → DeliveryOrderPrintPreview-Dwgt-cEo.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-lA-iPoWZ.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D3H1RQaf.js} +3 -3
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-UJewH4Il.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CF-BSx4K.js} +2 -2
- package/dist/{FmMultiselectDialog-BrJlUxMZ.js → FmMultiselectDialog-C1tRdXUe.js} +1 -1
- package/dist/{FmMultiselectDialog-Br5_D-b5.js → FmMultiselectDialog-CqBo_5R3.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BvIdnKjl.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CM6QPPoa.js} +3 -3
- package/dist/{ImportView-fEnHrPWZ.js → ImportView-Y-yzGfLi.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVELkyVY.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BpvivxRy.js} +1 -1
- package/dist/{IngredientGroupView-B1owkM3C.js → IngredientGroupView-Bdw32H_9.js} +5 -5
- package/dist/{IngredientsView-BTKXnnw5.js → IngredientsView-C9xBCLKU.js} +14 -14
- package/dist/{IntegrationView-C2jarXxh.js → IntegrationView-BmZmgOrT.js} +12 -12
- package/dist/{InventoryBindingForm-Gq8XfKbC.js → InventoryBindingForm-DB68Fqx5.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BVkTXQvA.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CGI1smUx.js} +4 -4
- package/dist/{InventoryBindingSummary-CqQu65hi.js → InventoryBindingSummary-B9mGdrM6.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DIukT297.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C7gllFiR.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-D2aU4Ij2.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DAX2Rm45.js} +2 -2
- package/dist/{PublishView-CBYg-KST.js → PublishView-hsMNcVGC.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-C_jrGksW.js → PurchaseOrderPrintPreview-B3O2mDR7.js} +1 -1
- package/dist/{ReceiveRequestView-iawt5dnN.js → ReceiveRequestView-CCZ_ZTKk.js} +19 -19
- package/dist/{RecipeView-Dv5BTxLT.js → RecipeView-CWzRUSTy.js} +8 -8
- package/dist/{StockView-oSkKCORB.js → StockView-lVtSv6e5.js} +15 -15
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BJ3gnpTq.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cx2Wdpp9.js} +1 -1
- package/dist/{SupplierView-tipIYgX7.js → SupplierView-Bn6K86cD.js} +11 -11
- package/dist/{SurchargeView-CW1lsyEC.js → SurchargeView-C5u_CWxK.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-B3FZqxjr.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-C2boqsh0.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D86rTw7c.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-B0Z-WupJ.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-cGzs-dHw.js → TransferDetails.vue_vue_type_script_setup_true_lang-BpiFp1cK.js} +14 -14
- package/dist/{TransferTemplateView-dSJSgnil.js → TransferTemplateView-CMfA9CeA.js} +15 -15
- package/dist/{UnitView-VHi5WMrF.js → UnitView-BwBCxwBg.js} +6 -6
- package/dist/{WarehouseView-DLZaux-w.js → WarehouseView-d-i7QZ91.js} +5 -5
- package/dist/{WastageTemplateView-KyvwCkdu.js → WastageTemplateView-CTN9FvAU.js} +14 -14
- package/dist/{app-Cq2T5z21.js → app-BanOUWeW.js} +9 -9
- package/dist/app.js +1 -1
- package/dist/{closing-template-TwdeC6qT.js → closing-template-rJXi1N62.js} +1 -1
- package/dist/{date2-Dunl1OWI.js → date2-DrFFpmvm.js} +1 -1
- package/dist/{dayjs.min-D_81k3gd.js → dayjs.min-BUn7FVfa.js} +1 -1
- package/dist/{decimal-B9DLzi9Y.js → decimal-Iv5cW8Fk.js} +2 -2
- package/dist/{defineDeepModel-B15nBS96.js → defineDeepModel-B0BLK0AX.js} +1 -1
- package/dist/{duplicate-template-BSxFsv2u.js → duplicate-template-CS5JxzRU.js} +1 -1
- package/dist/{feature-KwyjpPTq.js → feature-BE1entk_.js} +2 -2
- package/dist/{format-time-from-id-BfL9V23H.js → format-time-from-id-Zk8nyA3X.js} +1 -1
- package/dist/{format-unit-display-BfSLhflE.js → format-unit-display-DTfb4FQh.js} +10 -10
- package/dist/{import-export.helper-TUsgMxew.js → import-export.helper-eysNTnLw.js} +5 -5
- package/dist/{index-DTnKa-sF.js → index-BBVzJMx-.js} +1 -1
- package/dist/{index-C2H5HeFF.js → index-BSGrS1Uy.js} +1 -1
- package/dist/{index-CXtJlhZZ.js → index-CMCmigUe.js} +3 -3
- package/dist/{lodash-DRR2nS2T.js → lodash-Bo5fWIzQ.js} +1 -1
- package/dist/{netsuite-CAFiEoX5.js → netsuite-DARuwqPK.js} +3 -3
- package/dist/{purchase-order-template-CSJXceBK.js → purchase-order-template-DMhr8Uo1.js} +1 -1
- package/dist/{rules-BdFLL1aa.js → rules-15LhIexr.js} +3 -3
- package/dist/{stock-CgsgvX9b.js → stock-DPWppSPR.js} +3 -3
- package/dist/{stock-B80FaSS2.js → stock-DtaMiLiO.js} +1 -1
- package/dist/{supplier-BsycjnD1.js → supplier-C5BpCM5Y.js} +2 -2
- package/dist/{surcharge-BH6kETCu.js → surcharge-C105g1nX.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-B2cFOc3t.js → use-ingredient-select-dialog-wgqteN3b.js} +2 -2
- package/dist/{use-inventory-binding-dialog-CKUtJDHW.js → use-inventory-binding-dialog-CKmfTceT.js} +2 -2
- package/dist/{use-template-enabled-locations-2-tPL4lEZ_.js → use-template-enabled-locations-2-Dy3GQZqT.js} +2 -2
- package/dist/{vue-i18n-BhCaMx-9.js → vue-i18n-CtTdNLQE.js} +487 -487
- package/dist/{xlsx-DJaY2xSF.js → xlsx-rlGBAsJO.js} +398 -398
- package/dist/{xlsx.util-CZq_uKdw.js → xlsx.util-CyG8PI8e.js} +1 -1
- package/package.json +1 -1
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { F as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { useSnackbar as
|
|
5
|
-
import { o as
|
|
6
|
-
import { defineStore 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
|
-
import { u as
|
|
18
|
-
import { _ as
|
|
19
|
-
const
|
|
1
|
+
import { defineComponent as Ue, ref as Y, computed as R, onMounted as Xe, resolveComponent as K, openBlock as x, createElementBlock as P, Fragment as ce, createTextVNode as ue, createBlock as fe, withCtx as Q, createElementVNode as n, toDisplayString as W, unref as v, createVNode as k, createCommentVNode as ne, h as F, watch as Ee, renderList as $e, reactive as Mt, isRef as ht, normalizeClass as Be, normalizeStyle as kt, Teleport as Lt, mergeProps as Nt } from "vue";
|
|
2
|
+
import { F as yt, u as Et, _ as zt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
|
|
3
|
+
import { useCoreStore as _t, useI18n as et } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as tt, useDialog as Ht, components as be, useProxiedModel as Ot, useBreakpoints as Kt } from "@feedmepos/ui-library";
|
|
5
|
+
import { o as Yt, u as Qe, J as Z, w as z, s as xt, K as he, B as ze, v as He, c as Qt, a as Dt } from "./app-BanOUWeW.js";
|
|
6
|
+
import { defineStore as At, storeToRefs as qt } from "pinia";
|
|
7
|
+
import { d as Ke, e as wt, f as Gt, a as ke } from "./date2-DrFFpmvm.js";
|
|
8
|
+
import { R as Wt, f as at, a as Je, t as Zt, d as Ie, o as St, p as Ft, m as Ct, l as Jt } from "./rules-15LhIexr.js";
|
|
9
|
+
import { b as Xt, d as ea } from "./xlsx.util-CyG8PI8e.js";
|
|
10
|
+
import { u as $t } from "./stock-DPWppSPR.js";
|
|
11
|
+
import { u as nt } from "./stock-DtaMiLiO.js";
|
|
12
|
+
import { D as bt, R as Ce } from "./row-action.enum-BcW_L_nE.js";
|
|
13
|
+
import { c as ta } from "./component-DpCUABT3.js";
|
|
14
|
+
import { f as aa } from "./format-time-from-id-Zk8nyA3X.js";
|
|
15
|
+
import { _ as na } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CF-BSx4K.js";
|
|
16
|
+
import { E as oa } from "./empty-placeholder-wf6-BWE8.js";
|
|
17
|
+
import { u as sa } from "./vue-i18n-CtTdNLQE.js";
|
|
18
|
+
import { _ as ra, F as Ne } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
|
|
19
|
+
const qe = Yt((u, o) => {
|
|
20
20
|
function e() {
|
|
21
|
-
return
|
|
21
|
+
return Qe().currentLocation.dbName;
|
|
22
22
|
}
|
|
23
23
|
return {
|
|
24
24
|
async getDraft(d) {
|
|
25
|
-
const h = e(),
|
|
26
|
-
return o.get(
|
|
25
|
+
const h = e(), y = `${u.inventoryBackendUrl}/${h}/closing-draft/${d}`;
|
|
26
|
+
return o.get(y);
|
|
27
27
|
},
|
|
28
28
|
async readDrafts() {
|
|
29
|
-
const d = e(), h = `${
|
|
29
|
+
const d = e(), h = `${u.inventoryBackendUrl}/${d}/closing-draft`;
|
|
30
30
|
return o.get(h);
|
|
31
31
|
},
|
|
32
32
|
async runOperation(d) {
|
|
33
|
-
const h = e(),
|
|
34
|
-
return o.post(
|
|
33
|
+
const h = e(), y = `${u.inventoryBackendUrl}/${h}/closing-draft/run-operation`;
|
|
34
|
+
return o.post(y, d);
|
|
35
35
|
},
|
|
36
36
|
async runOperationV1(d) {
|
|
37
|
-
const h = e(),
|
|
38
|
-
return o.post(
|
|
37
|
+
const h = e(), y = `${u.inventoryBackendUrl}/${h}/closing-draft/v1/run-operation`;
|
|
38
|
+
return o.post(y, d);
|
|
39
39
|
},
|
|
40
40
|
async sync(d) {
|
|
41
|
-
const h = e(),
|
|
42
|
-
return o.post(
|
|
41
|
+
const h = e(), y = `${u.inventoryBackendUrl}/${h}/closing-draft/sync`;
|
|
42
|
+
return o.post(y, d);
|
|
43
43
|
},
|
|
44
44
|
async cloneDraft(d) {
|
|
45
|
-
const h = e(),
|
|
46
|
-
return o.post(
|
|
45
|
+
const h = e(), y = `${u.inventoryBackendUrl}/${h}/closing-draft/${d}/clone`;
|
|
46
|
+
return o.post(y, {});
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
}),
|
|
49
|
+
}), la = { class: "fm-typo-en-body-lg-400" }, ia = { class: "fm-typo-en-body-lg-600" }, ca = {
|
|
50
50
|
key: 0,
|
|
51
51
|
class: "flex flex-col"
|
|
52
|
-
},
|
|
52
|
+
}, ua = {
|
|
53
53
|
key: 0,
|
|
54
54
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-error mt-4"
|
|
55
|
-
},
|
|
55
|
+
}, da = { class: "flex gap-12 py-8 justify-end w-full" }, Ze = /* @__PURE__ */ Ue({
|
|
56
56
|
__name: "ClosingDraftAction",
|
|
57
57
|
props: {
|
|
58
58
|
draft: {},
|
|
@@ -60,8 +60,8 @@ const Qe = Kt((c, o) => {
|
|
|
60
60
|
onCancel: { type: Function },
|
|
61
61
|
onFinished: { type: Function }
|
|
62
62
|
},
|
|
63
|
-
setup(
|
|
64
|
-
const o =
|
|
63
|
+
setup(u) {
|
|
64
|
+
const o = u, e = Y(), d = qe(), h = tt(), y = Y(!1), f = Y(null), M = Y(!1), U = R(() => {
|
|
65
65
|
switch (o.action) {
|
|
66
66
|
case Z.enum.approveDraft:
|
|
67
67
|
return "Approve";
|
|
@@ -71,7 +71,7 @@ const Qe = Kt((c, o) => {
|
|
|
71
71
|
return "Mark as Failed";
|
|
72
72
|
}
|
|
73
73
|
throw new Error(`Unknown action: ${o.action}`);
|
|
74
|
-
}),
|
|
74
|
+
}), V = R(() => {
|
|
75
75
|
switch (o.action) {
|
|
76
76
|
case Z.enum.approveDraft:
|
|
77
77
|
return "primary";
|
|
@@ -82,7 +82,7 @@ const Qe = Kt((c, o) => {
|
|
|
82
82
|
}
|
|
83
83
|
throw new Error(`Unknown action: ${o.action}`);
|
|
84
84
|
});
|
|
85
|
-
|
|
85
|
+
Xe(() => {
|
|
86
86
|
if (o.draft.effectiveAt)
|
|
87
87
|
f.value = new Date(o.draft.effectiveAt);
|
|
88
88
|
else {
|
|
@@ -91,9 +91,9 @@ const Qe = Kt((c, o) => {
|
|
|
91
91
|
}
|
|
92
92
|
M.value = !0;
|
|
93
93
|
});
|
|
94
|
-
const _ =
|
|
94
|
+
const _ = R({
|
|
95
95
|
get() {
|
|
96
|
-
return f.value === null ? "" :
|
|
96
|
+
return f.value === null ? "" : Ke(f.value);
|
|
97
97
|
},
|
|
98
98
|
set(r) {
|
|
99
99
|
if (r) {
|
|
@@ -102,9 +102,9 @@ const Qe = Kt((c, o) => {
|
|
|
102
102
|
} else
|
|
103
103
|
f.value = null;
|
|
104
104
|
}
|
|
105
|
-
}), E =
|
|
105
|
+
}), E = R({
|
|
106
106
|
get() {
|
|
107
|
-
return f.value === null ? "" :
|
|
107
|
+
return f.value === null ? "" : wt(f.value);
|
|
108
108
|
},
|
|
109
109
|
set(r) {
|
|
110
110
|
if (r) {
|
|
@@ -113,9 +113,9 @@ const Qe = Kt((c, o) => {
|
|
|
113
113
|
} else
|
|
114
114
|
f.value = null;
|
|
115
115
|
}
|
|
116
|
-
}), j =
|
|
117
|
-
async function
|
|
118
|
-
|
|
116
|
+
}), j = R(() => f.value ? f.value.getTime() > (/* @__PURE__ */ new Date()).getTime() : !1);
|
|
117
|
+
async function q(r) {
|
|
118
|
+
y.value = !0;
|
|
119
119
|
try {
|
|
120
120
|
r ? await d.runOperationV1({
|
|
121
121
|
_id: o.draft._id,
|
|
@@ -145,55 +145,55 @@ const Qe = Kt((c, o) => {
|
|
|
145
145
|
type: "error"
|
|
146
146
|
}), console.error("error on submit closing draft action", t);
|
|
147
147
|
} finally {
|
|
148
|
-
|
|
148
|
+
y.value = !1;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
return (r, t) => {
|
|
152
|
-
const C = K("FmLabel"), I = K("FmDatePicker"),
|
|
153
|
-
return M.value ? (x(),
|
|
152
|
+
const C = K("FmLabel"), I = K("FmDatePicker"), G = K("FmTimePicker"), g = K("FmTextField"), i = K("FmButton"), $ = K("FmForm");
|
|
153
|
+
return M.value ? (x(), fe($, {
|
|
154
154
|
key: 1,
|
|
155
|
-
onValidationSuccess:
|
|
155
|
+
onValidationSuccess: q,
|
|
156
156
|
class: "flex flex-col gap-32",
|
|
157
|
-
disabled:
|
|
157
|
+
disabled: y.value
|
|
158
158
|
}, {
|
|
159
|
-
default:
|
|
160
|
-
n("div",
|
|
161
|
-
t[4] || (t[4] =
|
|
162
|
-
n("span",
|
|
163
|
-
t[5] || (t[5] =
|
|
159
|
+
default: Q(() => [
|
|
160
|
+
n("div", la, [
|
|
161
|
+
t[4] || (t[4] = ue(" You are about to ")),
|
|
162
|
+
n("span", ia, W(U.value), 1),
|
|
163
|
+
t[5] || (t[5] = ue(" this draft. Please provide a remark to justify this action. "))
|
|
164
164
|
]),
|
|
165
|
-
r.action === v(Z).enum.approveDraft ? (x(), P("div",
|
|
165
|
+
r.action === v(Z).enum.approveDraft ? (x(), P("div", ca, [
|
|
166
166
|
k(C, { class: "fm-typo-en-body-lg-600" }, {
|
|
167
|
-
default:
|
|
168
|
-
|
|
167
|
+
default: Q(() => t[6] || (t[6] = [
|
|
168
|
+
ue("Closing Date")
|
|
169
169
|
])),
|
|
170
170
|
_: 1
|
|
171
171
|
}),
|
|
172
172
|
k(I, {
|
|
173
173
|
modelValue: _.value,
|
|
174
174
|
"onUpdate:modelValue": t[0] || (t[0] = (H) => _.value = H),
|
|
175
|
-
max: v(
|
|
175
|
+
max: v(Ke)(/* @__PURE__ */ new Date())
|
|
176
176
|
}, null, 8, ["modelValue", "max"]),
|
|
177
177
|
k(C, { class: "fm-typo-en-body-lg-600" }, {
|
|
178
|
-
default:
|
|
179
|
-
|
|
178
|
+
default: Q(() => t[7] || (t[7] = [
|
|
179
|
+
ue("Closing Time")
|
|
180
180
|
])),
|
|
181
181
|
_: 1
|
|
182
182
|
}),
|
|
183
|
-
k(
|
|
183
|
+
k(G, {
|
|
184
184
|
modelValue: E.value,
|
|
185
185
|
"onUpdate:modelValue": t[1] || (t[1] = (H) => E.value = H)
|
|
186
186
|
}, null, 8, ["modelValue"]),
|
|
187
|
-
j.value ? (x(), P("div",
|
|
187
|
+
j.value ? (x(), P("div", ua, " Cannot select future date ")) : ne("", !0)
|
|
188
188
|
])) : ne("", !0),
|
|
189
|
-
k(
|
|
189
|
+
k(g, {
|
|
190
190
|
modelValue: e.value,
|
|
191
191
|
"onUpdate:modelValue": t[2] || (t[2] = (H) => e.value = H),
|
|
192
192
|
label: "Remark",
|
|
193
193
|
"label-mark": "required",
|
|
194
|
-
rules: [v(
|
|
194
|
+
rules: [v(Wt)()]
|
|
195
195
|
}, null, 8, ["modelValue", "rules"]),
|
|
196
|
-
n("div",
|
|
196
|
+
n("div", da, [
|
|
197
197
|
k(i, {
|
|
198
198
|
label: "Cancel",
|
|
199
199
|
variant: "tertiary",
|
|
@@ -202,48 +202,48 @@ const Qe = Kt((c, o) => {
|
|
|
202
202
|
k(i, {
|
|
203
203
|
label: U.value,
|
|
204
204
|
type: "submit",
|
|
205
|
-
variant:
|
|
206
|
-
loading:
|
|
205
|
+
variant: V.value,
|
|
206
|
+
loading: y.value
|
|
207
207
|
}, null, 8, ["label", "variant", "loading"])
|
|
208
208
|
])
|
|
209
209
|
]),
|
|
210
210
|
_: 1
|
|
211
|
-
}, 8, ["disabled"])) : (x(), P(
|
|
212
|
-
|
|
211
|
+
}, 8, ["disabled"])) : (x(), P(ce, { key: 0 }, [
|
|
212
|
+
ue("Loading")
|
|
213
213
|
], 64));
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
|
-
}),
|
|
217
|
-
function
|
|
218
|
-
const o =
|
|
216
|
+
}), ma = Ie(0);
|
|
217
|
+
function Bt(u) {
|
|
218
|
+
const o = u.measurementsAmounts.groupBy((d) => d.measurement.id), e = u.sku.unit.measurements.reduce((d, h) => {
|
|
219
219
|
var M, U;
|
|
220
|
-
const
|
|
221
|
-
return d + +
|
|
222
|
-
}, +
|
|
223
|
-
return
|
|
220
|
+
const y = ((U = (M = o.get(h.id)) == null ? void 0 : M[0]) == null ? void 0 : U.amount) ?? ma, f = at(h.conversion, y);
|
|
221
|
+
return d + +Je(f);
|
|
222
|
+
}, +Je(u.baseAmount));
|
|
223
|
+
return Zt(e, u.baseAmount.precision);
|
|
224
224
|
}
|
|
225
|
-
const
|
|
226
|
-
function
|
|
227
|
-
var
|
|
228
|
-
const f =
|
|
225
|
+
const fa = Ie(0), pa = Ie(100), Tt = "N/A";
|
|
226
|
+
function va(u, o, e, d, h, y) {
|
|
227
|
+
var ee, se, w, te, de;
|
|
228
|
+
const f = Bt(u), M = d ?? f, U = St(M, o), V = o.amount === 0 ? null : Ft(U, {
|
|
229
229
|
...o,
|
|
230
230
|
amount: Math.abs(o.amount)
|
|
231
|
-
}), _ =
|
|
231
|
+
}), _ = V ? at(V, pa) : null, E = ((ee = u.sku.defaultCost) == null ? void 0 : ee.costPerUnit) ?? { amount: 0, precision: 0 }, j = Number(z.toFormatString({ value: E })), q = ((w = (se = u.sku.defaultCost) == null ? void 0 : se.measurement) == null ? void 0 : w.conversion) ?? {
|
|
232
232
|
amount: 1,
|
|
233
233
|
precision: 0
|
|
234
234
|
}, r = Number(
|
|
235
|
-
z.toFormatString({ value:
|
|
236
|
-
), t = h ? Number(z.toFormatString({ value: h })) : 0, C = Number(z.toFormatString({ value: o })), I = Number(z.toFormatString({ value: M })),
|
|
235
|
+
z.toFormatString({ value: q })
|
|
236
|
+
), t = h ? Number(z.toFormatString({ value: h })) : 0, C = Number(z.toFormatString({ value: o })), I = Number(z.toFormatString({ value: M })), G = C - I, g = G * j / r, i = I * j / r, $ = C * j / r;
|
|
237
237
|
return {
|
|
238
|
-
code:
|
|
239
|
-
name:
|
|
240
|
-
baseUnit:
|
|
241
|
-
costUnit: ((
|
|
242
|
-
baseUnitAmount: Number(z.toFormatString({ value:
|
|
243
|
-
...
|
|
244
|
-
(
|
|
238
|
+
code: u.sku.code,
|
|
239
|
+
name: u.sku.name,
|
|
240
|
+
baseUnit: u.sku.unit.abbrev,
|
|
241
|
+
costUnit: ((de = (te = u.sku.defaultCost) == null ? void 0 : te.measurement) == null ? void 0 : de.abbrev) ?? null,
|
|
242
|
+
baseUnitAmount: Number(z.toFormatString({ value: u.baseAmount })),
|
|
243
|
+
...u.measurementsAmounts.filter(
|
|
244
|
+
(D) => ga(D.measurement) && e.includes(D.measurement.id)
|
|
245
245
|
).reduce(
|
|
246
|
-
(
|
|
246
|
+
(D, A, J) => (D[`measurementAbbrev${J}`] = `(${A.measurement.abbrev}) × ${z.toFormatString({ value: A.measurement.conversion })}`, D[`measurementAmount${J}`] = Number(z.toFormatString({ value: A.amount })), D),
|
|
247
247
|
{}
|
|
248
248
|
),
|
|
249
249
|
systemBalance: C,
|
|
@@ -251,24 +251,24 @@ function pa(c, o, e, d, h, g) {
|
|
|
251
251
|
adjustedAmount: Number(z.toFormatString({ value: U })),
|
|
252
252
|
adjustedDiffPercentage: _ ? Number(
|
|
253
253
|
z.toFormatString({
|
|
254
|
-
value:
|
|
254
|
+
value: Ct(_, 2)
|
|
255
255
|
})
|
|
256
256
|
) : null,
|
|
257
257
|
costPerUnit: j,
|
|
258
258
|
opening: t,
|
|
259
|
-
adjustmentTypes:
|
|
260
|
-
varianceQty:
|
|
261
|
-
varianceInCost:
|
|
259
|
+
adjustmentTypes: y ?? Tt,
|
|
260
|
+
varianceQty: G,
|
|
261
|
+
varianceInCost: g,
|
|
262
262
|
stockTakeValue: i,
|
|
263
263
|
systemValue: $
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
return !
|
|
266
|
+
function ga(u) {
|
|
267
|
+
return !u.abbrev.toLocaleLowerCase().includes("inactive");
|
|
268
268
|
}
|
|
269
|
-
function ya(
|
|
270
|
-
const o =
|
|
271
|
-
return
|
|
269
|
+
function ya(u) {
|
|
270
|
+
const o = jt(u);
|
|
271
|
+
return u.reduce(
|
|
272
272
|
(e, d) => {
|
|
273
273
|
var h;
|
|
274
274
|
return Math.max(e, ((h = o == null ? void 0 : o.get(d.sku._id)) == null ? void 0 : h[0].length) ?? 0);
|
|
@@ -276,14 +276,14 @@ function ya(c) {
|
|
|
276
276
|
0
|
|
277
277
|
);
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
return
|
|
279
|
+
function jt(u) {
|
|
280
|
+
return u.groupBy(
|
|
281
281
|
(o) => o.sku._id,
|
|
282
282
|
(o) => o.measurementsAmounts.filter((e) => !e.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((e) => e.measurement.id)
|
|
283
283
|
);
|
|
284
284
|
}
|
|
285
|
-
function
|
|
286
|
-
const o =
|
|
285
|
+
function ba(u) {
|
|
286
|
+
const o = xt(), e = o === "MYR" ? "RM" : o;
|
|
287
287
|
return [
|
|
288
288
|
{
|
|
289
289
|
id: "code",
|
|
@@ -349,173 +349,173 @@ function ga(c) {
|
|
|
349
349
|
id: "baseUnitAmount",
|
|
350
350
|
name: "Base unit amount"
|
|
351
351
|
},
|
|
352
|
-
...Array.from({ length:
|
|
352
|
+
...Array.from({ length: u }).flatMap((h, y) => [
|
|
353
353
|
{
|
|
354
|
-
id: `measurementAmount${
|
|
355
|
-
name: `UOM amount ${
|
|
354
|
+
id: `measurementAmount${y}`,
|
|
355
|
+
name: `UOM amount ${y + 1}`
|
|
356
356
|
},
|
|
357
357
|
{
|
|
358
|
-
id: `measurementAbbrev${
|
|
359
|
-
name: `UOM ${
|
|
358
|
+
id: `measurementAbbrev${y}`,
|
|
359
|
+
name: `UOM ${y + 1}`
|
|
360
360
|
}
|
|
361
361
|
])
|
|
362
362
|
];
|
|
363
363
|
}
|
|
364
|
-
function
|
|
365
|
-
var
|
|
364
|
+
function ha(u, o, e) {
|
|
365
|
+
var G, g, i, $, H, ee, se;
|
|
366
366
|
const d = o.groupBy(
|
|
367
367
|
(w) => w.id,
|
|
368
368
|
(w) => w.balance
|
|
369
369
|
), h = e.groupBy(
|
|
370
370
|
(w) => w.id,
|
|
371
371
|
(w) => w.balance
|
|
372
|
-
),
|
|
373
|
-
if (
|
|
374
|
-
for (const w of
|
|
375
|
-
|
|
372
|
+
), y = /* @__PURE__ */ new Map();
|
|
373
|
+
if (u.opening)
|
|
374
|
+
for (const w of u.opening)
|
|
375
|
+
y.set(w.skuId, w.balance);
|
|
376
376
|
const f = /* @__PURE__ */ new Map();
|
|
377
|
-
if (
|
|
378
|
-
for (const w of
|
|
379
|
-
const
|
|
380
|
-
f.set(w.skuId,
|
|
377
|
+
if (u.adjustmentSnapshot)
|
|
378
|
+
for (const w of u.adjustmentSnapshot) {
|
|
379
|
+
const te = Object.keys(w.adjustmentsByType).join(", ");
|
|
380
|
+
f.set(w.skuId, te || Tt);
|
|
381
381
|
}
|
|
382
|
-
const M = [...
|
|
382
|
+
const M = [...u.items, ...u.negativeStockItems ?? []], U = jt(M), V = M.map((w) => {
|
|
383
383
|
var J, O, re;
|
|
384
|
-
const
|
|
385
|
-
return
|
|
384
|
+
const te = ((J = d.get(w.sku._id)) == null ? void 0 : J[0]) ?? fa, de = ((O = U == null ? void 0 : U.get(w.sku._id)) == null ? void 0 : O[0]) ?? [], D = y.get(w.sku._id), A = f.get(w.sku._id);
|
|
385
|
+
return va(
|
|
386
386
|
w,
|
|
387
|
-
|
|
388
|
-
|
|
387
|
+
te,
|
|
388
|
+
de,
|
|
389
389
|
(re = h.get(w.sku._id)) == null ? void 0 : re[0],
|
|
390
|
-
|
|
391
|
-
|
|
390
|
+
D,
|
|
391
|
+
A
|
|
392
392
|
);
|
|
393
|
-
}), _ = ya(M), j =
|
|
393
|
+
}), _ = ya(M), j = _t().currentBusiness.value, q = ba(_), r = [
|
|
394
394
|
["Business name:", j == null ? void 0 : j.name],
|
|
395
395
|
["Business ID:", j == null ? void 0 : j._id],
|
|
396
396
|
["Menu version", j == null ? void 0 : j.menuVersion],
|
|
397
|
-
["Created at", new Date(
|
|
398
|
-
["Created by", (
|
|
399
|
-
["Updated at", new Date(
|
|
400
|
-
["Updated by", (
|
|
401
|
-
["Recent action",
|
|
397
|
+
["Created at", new Date(u.createdAt)],
|
|
398
|
+
["Created by", (G = u.createdBy) == null ? void 0 : G.name],
|
|
399
|
+
["Updated at", new Date(u.updatedAt)],
|
|
400
|
+
["Updated by", (g = u.updatedBy) == null ? void 0 : g.name],
|
|
401
|
+
["Recent action", u.approvedAt ? "Approve" : u.rejectionHistory ? "Reject" : ""],
|
|
402
402
|
[
|
|
403
403
|
"Action by",
|
|
404
|
-
|
|
404
|
+
u.approvedAt ? (i = u.approvedBy) == null ? void 0 : i.name : u.rejectionHistory ? (H = ($ = u.rejectionHistory[0]) == null ? void 0 : $.rejectedBy) == null ? void 0 : H.name : ""
|
|
405
405
|
],
|
|
406
406
|
[
|
|
407
407
|
"Action at",
|
|
408
|
-
|
|
408
|
+
u.approvedAt ? new Date(u.approvedAt) : u.rejectionHistory ? new Date((ee = u.rejectionHistory[0]) == null ? void 0 : ee.rejectedAt) : ""
|
|
409
409
|
],
|
|
410
410
|
[
|
|
411
411
|
"Action remark",
|
|
412
|
-
|
|
412
|
+
u.approvedAt ? u.approveRemark : u.rejectionHistory ? new Date((se = u.rejectionHistory[0]) == null ? void 0 : se.rejectRemark) : ""
|
|
413
413
|
],
|
|
414
414
|
[],
|
|
415
|
-
|
|
416
|
-
...
|
|
417
|
-
], t =
|
|
418
|
-
return
|
|
415
|
+
q.map((w) => w.name),
|
|
416
|
+
...V.map((w) => q.map((te) => w[te.id]))
|
|
417
|
+
], t = q.map((w) => `system:${w.id}`), C = Xt(r, t), I = `[${j == null ? void 0 : j.name}] closing draft (${Gt(new Date(u.updatedAt))}).xlsx`;
|
|
418
|
+
return ea(C, I), I;
|
|
419
419
|
}
|
|
420
|
-
const
|
|
420
|
+
const ka = { class: "flex flex-col" }, _a = {
|
|
421
421
|
key: 0,
|
|
422
422
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-error mt-4"
|
|
423
|
-
},
|
|
423
|
+
}, xa = { class: "flex gap-12 py-8 justify-end w-full" }, Da = /* @__PURE__ */ Ue({
|
|
424
424
|
__name: "RefreshBalanceAction",
|
|
425
425
|
props: {
|
|
426
426
|
draft: {},
|
|
427
427
|
onCancel: { type: Function },
|
|
428
428
|
onFinished: { type: Function }
|
|
429
429
|
},
|
|
430
|
-
setup(
|
|
431
|
-
const o =
|
|
432
|
-
|
|
433
|
-
const e =
|
|
434
|
-
|
|
430
|
+
setup(u) {
|
|
431
|
+
const o = u;
|
|
432
|
+
nt();
|
|
433
|
+
const e = Y(!1), d = Y(null), h = Y(!1);
|
|
434
|
+
Xe(() => {
|
|
435
435
|
if (o.draft.effectiveAt)
|
|
436
436
|
d.value = new Date(o.draft.effectiveAt);
|
|
437
437
|
else {
|
|
438
|
-
const
|
|
439
|
-
|
|
438
|
+
const V = new Date(o.draft.createdAt);
|
|
439
|
+
V.setHours(23, 59, 59, 999), d.value = V;
|
|
440
440
|
}
|
|
441
441
|
h.value = !0;
|
|
442
442
|
});
|
|
443
|
-
const
|
|
443
|
+
const y = R({
|
|
444
444
|
get() {
|
|
445
|
-
return d.value === null ? "" :
|
|
445
|
+
return d.value === null ? "" : Ke(d.value);
|
|
446
446
|
},
|
|
447
|
-
set(
|
|
448
|
-
if (
|
|
449
|
-
const _ = /* @__PURE__ */ new Date(`${
|
|
447
|
+
set(V) {
|
|
448
|
+
if (V) {
|
|
449
|
+
const _ = /* @__PURE__ */ new Date(`${V} ${f.value}`);
|
|
450
450
|
_.setSeconds(59, 999), d.value = _;
|
|
451
451
|
} else
|
|
452
452
|
d.value = null;
|
|
453
453
|
}
|
|
454
|
-
}), f =
|
|
454
|
+
}), f = R({
|
|
455
455
|
get() {
|
|
456
|
-
return d.value === null ? "" :
|
|
456
|
+
return d.value === null ? "" : wt(d.value);
|
|
457
457
|
},
|
|
458
|
-
set(
|
|
459
|
-
if (
|
|
460
|
-
const _ = /* @__PURE__ */ new Date(`${
|
|
458
|
+
set(V) {
|
|
459
|
+
if (V) {
|
|
460
|
+
const _ = /* @__PURE__ */ new Date(`${y.value} ${V}`);
|
|
461
461
|
_.setSeconds(59, 999), d.value = _;
|
|
462
462
|
} else
|
|
463
463
|
d.value = null;
|
|
464
464
|
}
|
|
465
|
-
}), M =
|
|
465
|
+
}), M = R(() => d.value ? d.value.getTime() > (/* @__PURE__ */ new Date()).getTime() : !1);
|
|
466
466
|
async function U() {
|
|
467
467
|
e.value = !0, o.onFinished(d.value.toISOString());
|
|
468
468
|
}
|
|
469
|
-
return (
|
|
470
|
-
const E = K("FmLabel"), j = K("FmDatePicker"),
|
|
471
|
-
return h.value ? (x(),
|
|
469
|
+
return (V, _) => {
|
|
470
|
+
const E = K("FmLabel"), j = K("FmDatePicker"), q = K("FmTimePicker"), r = K("FmButton"), t = K("FmForm");
|
|
471
|
+
return h.value ? (x(), fe(t, {
|
|
472
472
|
key: 1,
|
|
473
473
|
onValidationSuccess: U,
|
|
474
474
|
class: "flex flex-col gap-32",
|
|
475
475
|
disabled: e.value
|
|
476
476
|
}, {
|
|
477
|
-
default:
|
|
477
|
+
default: Q(() => [
|
|
478
478
|
_[5] || (_[5] = n("div", { class: "fm-typo-en-body-lg-400" }, [
|
|
479
479
|
n("p", null, [
|
|
480
|
-
|
|
480
|
+
ue(" Performing "),
|
|
481
481
|
n("span", { class: "fm-typo-en-body-lg-600" }, '"Refresh Balance"'),
|
|
482
|
-
|
|
482
|
+
ue(" until closing effective date and time. ")
|
|
483
483
|
]),
|
|
484
484
|
n("p", { class: "mt-2" }, [
|
|
485
|
-
|
|
485
|
+
ue(" Please note that this action will "),
|
|
486
486
|
n("b", null, "update"),
|
|
487
|
-
|
|
487
|
+
ue(" the effective date and time. ")
|
|
488
488
|
])
|
|
489
489
|
], -1)),
|
|
490
|
-
n("div",
|
|
490
|
+
n("div", ka, [
|
|
491
491
|
k(E, { class: "fm-typo-en-body-lg-600" }, {
|
|
492
|
-
default:
|
|
493
|
-
|
|
492
|
+
default: Q(() => _[3] || (_[3] = [
|
|
493
|
+
ue("Closing Date")
|
|
494
494
|
])),
|
|
495
495
|
_: 1
|
|
496
496
|
}),
|
|
497
497
|
k(j, {
|
|
498
|
-
modelValue:
|
|
499
|
-
"onUpdate:modelValue": _[0] || (_[0] = (C) =>
|
|
500
|
-
max: v(
|
|
498
|
+
modelValue: y.value,
|
|
499
|
+
"onUpdate:modelValue": _[0] || (_[0] = (C) => y.value = C),
|
|
500
|
+
max: v(Ke)(/* @__PURE__ */ new Date())
|
|
501
501
|
}, null, 8, ["modelValue", "max"]),
|
|
502
502
|
k(E, { class: "fm-typo-en-body-lg-600" }, {
|
|
503
|
-
default:
|
|
504
|
-
|
|
503
|
+
default: Q(() => _[4] || (_[4] = [
|
|
504
|
+
ue("Closing Time")
|
|
505
505
|
])),
|
|
506
506
|
_: 1
|
|
507
507
|
}),
|
|
508
|
-
k(
|
|
508
|
+
k(q, {
|
|
509
509
|
modelValue: f.value,
|
|
510
510
|
"onUpdate:modelValue": _[1] || (_[1] = (C) => f.value = C)
|
|
511
511
|
}, null, 8, ["modelValue"]),
|
|
512
|
-
M.value ? (x(), P("div",
|
|
512
|
+
M.value ? (x(), P("div", _a, " Cannot select future date ")) : ne("", !0)
|
|
513
513
|
]),
|
|
514
|
-
n("div",
|
|
514
|
+
n("div", xa, [
|
|
515
515
|
k(r, {
|
|
516
516
|
label: "Cancel",
|
|
517
517
|
variant: "tertiary",
|
|
518
|
-
onClick: _[2] || (_[2] = (C) =>
|
|
518
|
+
onClick: _[2] || (_[2] = (C) => V.onCancel())
|
|
519
519
|
}),
|
|
520
520
|
k(r, {
|
|
521
521
|
label: "Refresh balance",
|
|
@@ -527,54 +527,54 @@ const ha = { class: "flex flex-col" }, ka = {
|
|
|
527
527
|
])
|
|
528
528
|
]),
|
|
529
529
|
_: 1
|
|
530
|
-
}, 8, ["disabled"])) : (x(), P(
|
|
531
|
-
|
|
530
|
+
}, 8, ["disabled"])) : (x(), P(ce, { key: 0 }, [
|
|
531
|
+
ue("Loading")
|
|
532
532
|
], 64));
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
|
-
}),
|
|
535
|
+
}), Ye = At(
|
|
536
536
|
"closingDraftActions",
|
|
537
537
|
function() {
|
|
538
|
-
const o =
|
|
539
|
-
function U(
|
|
538
|
+
const o = Ht(), e = tt(), d = nt(), h = qe(), y = $t(), f = Y(!1), M = Y();
|
|
539
|
+
function U(g) {
|
|
540
540
|
const i = {
|
|
541
|
-
draft:
|
|
541
|
+
draft: g
|
|
542
542
|
};
|
|
543
543
|
M.value = i, f.value = !0;
|
|
544
544
|
}
|
|
545
|
-
async function
|
|
545
|
+
async function V(g) {
|
|
546
546
|
var $;
|
|
547
|
-
if (
|
|
548
|
-
const H =
|
|
547
|
+
if (g.status === he.enum.COMPLETED) {
|
|
548
|
+
const H = g.closingAdjustmentId;
|
|
549
549
|
if (!H)
|
|
550
550
|
return e.open({
|
|
551
551
|
title: "Something went wrong",
|
|
552
552
|
message: "Closing draft is completed but closing document cannot be found.",
|
|
553
553
|
type: "error"
|
|
554
554
|
}), console.error("Closing draft is completed but closing document cannot be found.", {
|
|
555
|
-
draftId:
|
|
555
|
+
draftId: g._id
|
|
556
556
|
}), [];
|
|
557
|
-
const
|
|
558
|
-
return ((
|
|
557
|
+
const ee = await d.readAdjustmentById(H);
|
|
558
|
+
return ((ee == null ? void 0 : ee.skus) ?? []).map((w) => ({
|
|
559
559
|
id: w.sku._id,
|
|
560
560
|
balance: w.fromBalance,
|
|
561
561
|
costs: w.fromCostBalances
|
|
562
562
|
}));
|
|
563
563
|
} else
|
|
564
|
-
return await
|
|
564
|
+
return await y.readStockBalance(), (($ = y.stockBalance) == null ? void 0 : $.skus) ?? [];
|
|
565
565
|
}
|
|
566
|
-
async function _(
|
|
566
|
+
async function _(g, i, $) {
|
|
567
567
|
i || (e.open({
|
|
568
568
|
title: "Exporting",
|
|
569
569
|
message: "Fetching data..."
|
|
570
|
-
}), i = await
|
|
570
|
+
}), i = await V(g)), ha(g, i, $ ?? []);
|
|
571
571
|
}
|
|
572
|
-
function E(
|
|
572
|
+
function E(g, i, $) {
|
|
573
573
|
o.open({
|
|
574
574
|
title: "Approve draft",
|
|
575
|
-
contentComponent:
|
|
575
|
+
contentComponent: Ze,
|
|
576
576
|
contentComponentProps: {
|
|
577
|
-
draft:
|
|
577
|
+
draft: g,
|
|
578
578
|
action: Z.enum.approveDraft,
|
|
579
579
|
onFinished: () => {
|
|
580
580
|
o.close(), i == null || i();
|
|
@@ -587,12 +587,12 @@ const ha = { class: "flex flex-col" }, ka = {
|
|
|
587
587
|
$ == null || $();
|
|
588
588
|
});
|
|
589
589
|
}
|
|
590
|
-
function j(
|
|
590
|
+
function j(g, i) {
|
|
591
591
|
o.open({
|
|
592
592
|
title: "Reject draft",
|
|
593
|
-
contentComponent:
|
|
593
|
+
contentComponent: Ze,
|
|
594
594
|
contentComponentProps: {
|
|
595
|
-
draft:
|
|
595
|
+
draft: g,
|
|
596
596
|
action: Z.enum.rejectDraft,
|
|
597
597
|
onFinished: () => {
|
|
598
598
|
o.close(), i == null || i();
|
|
@@ -601,12 +601,12 @@ const ha = { class: "flex flex-col" }, ka = {
|
|
|
601
601
|
}
|
|
602
602
|
});
|
|
603
603
|
}
|
|
604
|
-
function
|
|
604
|
+
function q(g, i) {
|
|
605
605
|
o.open({
|
|
606
606
|
title: "Mark draft as failed",
|
|
607
|
-
contentComponent:
|
|
607
|
+
contentComponent: Ze,
|
|
608
608
|
contentComponentProps: {
|
|
609
|
-
draft:
|
|
609
|
+
draft: g,
|
|
610
610
|
action: Z.enum.markAsFailed,
|
|
611
611
|
onFinished: () => {
|
|
612
612
|
o.close(), i == null || i();
|
|
@@ -615,13 +615,13 @@ const ha = { class: "flex flex-col" }, ka = {
|
|
|
615
615
|
}
|
|
616
616
|
});
|
|
617
617
|
}
|
|
618
|
-
async function r(
|
|
618
|
+
async function r(g, i) {
|
|
619
619
|
await h.sync({
|
|
620
|
-
_id:
|
|
621
|
-
_rev:
|
|
620
|
+
_id: g._id,
|
|
621
|
+
_rev: g._rev ?? "",
|
|
622
622
|
action: Z.enum.approveDraft,
|
|
623
623
|
data: {
|
|
624
|
-
remark:
|
|
624
|
+
remark: g.remark ?? ""
|
|
625
625
|
}
|
|
626
626
|
}).delayed(500), e.open({
|
|
627
627
|
title: "Success",
|
|
@@ -632,12 +632,12 @@ const ha = { class: "flex flex-col" }, ka = {
|
|
|
632
632
|
function t() {
|
|
633
633
|
f.value = !1;
|
|
634
634
|
}
|
|
635
|
-
async function C(
|
|
635
|
+
async function C(g, i, $) {
|
|
636
636
|
await o.open({
|
|
637
637
|
title: "Refresh balance",
|
|
638
|
-
contentComponent:
|
|
638
|
+
contentComponent: Da,
|
|
639
639
|
contentComponentProps: {
|
|
640
|
-
draft:
|
|
640
|
+
draft: g,
|
|
641
641
|
onFinished: (H) => {
|
|
642
642
|
o.close(), $ == null || $(H);
|
|
643
643
|
},
|
|
@@ -647,26 +647,26 @@ const ha = { class: "flex flex-col" }, ka = {
|
|
|
647
647
|
}
|
|
648
648
|
});
|
|
649
649
|
}
|
|
650
|
-
async function I(
|
|
650
|
+
async function I(g) {
|
|
651
651
|
await o.open({
|
|
652
652
|
title: "Invalidate closing draft cache",
|
|
653
653
|
message: "It will invalidate opening and stock movement cache for this draft.",
|
|
654
654
|
primaryActions: { text: "Proceed", close: !0 },
|
|
655
655
|
secondaryActions: { text: "Cancel", close: !0 }
|
|
656
656
|
}).onPrimary(async () => {
|
|
657
|
-
await d.recalculation.scheduleInvalidateClosingDraftCache([
|
|
657
|
+
await d.recalculation.scheduleInvalidateClosingDraftCache([g._id]), e.open({
|
|
658
658
|
title: "Success",
|
|
659
659
|
message: "Invalidate cache requested",
|
|
660
660
|
type: "success"
|
|
661
661
|
});
|
|
662
662
|
});
|
|
663
663
|
}
|
|
664
|
-
async function
|
|
664
|
+
async function G(g, i) {
|
|
665
665
|
try {
|
|
666
666
|
e.open({
|
|
667
667
|
title: "Cloning",
|
|
668
668
|
message: "Creating a copy of the draft..."
|
|
669
|
-
}), await h.cloneDraft(
|
|
669
|
+
}), await h.cloneDraft(g._id), e.open({
|
|
670
670
|
title: "Success",
|
|
671
671
|
message: "Draft cloned successfully",
|
|
672
672
|
type: "success"
|
|
@@ -684,19 +684,19 @@ const ha = { class: "flex flex-col" }, ka = {
|
|
|
684
684
|
closeDraftDialog: t,
|
|
685
685
|
approveDraft: E,
|
|
686
686
|
rejectDraft: j,
|
|
687
|
-
markAsFailed:
|
|
687
|
+
markAsFailed: q,
|
|
688
688
|
syncDraft: r,
|
|
689
689
|
exportDraft: _,
|
|
690
690
|
refreshBalance: C,
|
|
691
|
-
cloneDraft:
|
|
691
|
+
cloneDraft: G,
|
|
692
692
|
viewClosingDraftShow: f,
|
|
693
693
|
viewClosingDraftProps: M,
|
|
694
694
|
invalidateDraftCache: I
|
|
695
695
|
};
|
|
696
696
|
}
|
|
697
697
|
);
|
|
698
|
-
function
|
|
699
|
-
switch (
|
|
698
|
+
function Oe(u) {
|
|
699
|
+
switch (u) {
|
|
700
700
|
case "DRAFT":
|
|
701
701
|
return "fm-status-badge-draft";
|
|
702
702
|
case "PROCESSING":
|
|
@@ -707,26 +707,26 @@ function He(c) {
|
|
|
707
707
|
return "fm-status-badge-complete";
|
|
708
708
|
}
|
|
709
709
|
}
|
|
710
|
-
const
|
|
710
|
+
const Aa = At(
|
|
711
711
|
"closingDraftTable",
|
|
712
712
|
function() {
|
|
713
|
-
const { t: o } =
|
|
713
|
+
const { t: o } = et(), e = _t(), d = Ye(), h = Y(new Array()), y = Y(!1), f = Qe(), M = qe();
|
|
714
714
|
async function U() {
|
|
715
715
|
if (h.value = [], !!f._currentLocation) {
|
|
716
|
-
|
|
716
|
+
y.value = !0;
|
|
717
717
|
try {
|
|
718
718
|
const [r] = await Promise.all([M.readDrafts()]).delayed(1e3);
|
|
719
719
|
h.value = r.reverse();
|
|
720
720
|
} catch (r) {
|
|
721
721
|
console.log("Something went wrong when fetching drafts:", r);
|
|
722
722
|
} finally {
|
|
723
|
-
|
|
723
|
+
y.value = !1;
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
726
|
}
|
|
727
|
-
async function
|
|
727
|
+
async function V(r) {
|
|
728
728
|
if (!h.value.find((t) => t._id) && f._currentLocation) {
|
|
729
|
-
|
|
729
|
+
y.value = !0;
|
|
730
730
|
try {
|
|
731
731
|
const [t] = await Promise.all([
|
|
732
732
|
M.getDraft(r),
|
|
@@ -736,7 +736,7 @@ const Da = Dt(
|
|
|
736
736
|
} catch (t) {
|
|
737
737
|
console.log("Something went wrong when fetching drafts:", t);
|
|
738
738
|
} finally {
|
|
739
|
-
|
|
739
|
+
y.value = !1;
|
|
740
740
|
}
|
|
741
741
|
}
|
|
742
742
|
}
|
|
@@ -750,10 +750,10 @@ const Da = Dt(
|
|
|
750
750
|
d.closeDraftDialog(), U();
|
|
751
751
|
}
|
|
752
752
|
function j(r, t) {
|
|
753
|
-
switch (t =
|
|
754
|
-
case
|
|
753
|
+
switch (t = Qt(t), r) {
|
|
754
|
+
case Ce.Details:
|
|
755
755
|
return d.viewDraft(t);
|
|
756
|
-
case
|
|
756
|
+
case Ce.Export:
|
|
757
757
|
return d.exportDraft(t);
|
|
758
758
|
case Z.enum.approveDraft:
|
|
759
759
|
return d.approveDraft(t, E);
|
|
@@ -761,7 +761,7 @@ const Da = Dt(
|
|
|
761
761
|
return d.rejectDraft(t, E);
|
|
762
762
|
case Z.enum.markAsFailed:
|
|
763
763
|
return d.markAsFailed(t, E);
|
|
764
|
-
case
|
|
764
|
+
case Ce.Duplicate:
|
|
765
765
|
return d.cloneDraft(t, E);
|
|
766
766
|
}
|
|
767
767
|
}
|
|
@@ -772,7 +772,7 @@ const Da = Dt(
|
|
|
772
772
|
accessorKey: "_id",
|
|
773
773
|
header: () => o("inventory.closing.table.createdAt"),
|
|
774
774
|
cell(r) {
|
|
775
|
-
return
|
|
775
|
+
return aa(`${r.getValue()}`);
|
|
776
776
|
},
|
|
777
777
|
enableSorting: !0
|
|
778
778
|
},
|
|
@@ -782,14 +782,14 @@ const Da = Dt(
|
|
|
782
782
|
cell(r) {
|
|
783
783
|
const t = r.row.original;
|
|
784
784
|
let C = r.getValue();
|
|
785
|
-
return C || (C =
|
|
785
|
+
return C || (C = ze(t._id)), ke(C);
|
|
786
786
|
},
|
|
787
787
|
enableSorting: !0,
|
|
788
788
|
size: 200
|
|
789
789
|
},
|
|
790
790
|
{
|
|
791
791
|
id: "updatedAt",
|
|
792
|
-
accessorFn: (r) =>
|
|
792
|
+
accessorFn: (r) => ke(r.updatedAt),
|
|
793
793
|
header: () => "Updated at",
|
|
794
794
|
enableSorting: !0,
|
|
795
795
|
size: 200
|
|
@@ -829,8 +829,8 @@ const Da = Dt(
|
|
|
829
829
|
enableSorting: !1,
|
|
830
830
|
cell(r) {
|
|
831
831
|
var i;
|
|
832
|
-
const t = r.row.original, C = t.status, I = new Date(t.updatedAt),
|
|
833
|
-
return C === "DRAFT" &&
|
|
832
|
+
const t = r.row.original, C = t.status, I = new Date(t.updatedAt), G = (i = t == null ? void 0 : t.rejectionHistory) == null ? void 0 : i.computeFirst(($) => $.rejectedAt), g = G ? new Date(G) : null;
|
|
833
|
+
return C === "DRAFT" && g ? g.getTime() > I.getTime() ? F(
|
|
834
834
|
"div",
|
|
835
835
|
{
|
|
836
836
|
class: "flex"
|
|
@@ -838,7 +838,7 @@ const Da = Dt(
|
|
|
838
838
|
F(
|
|
839
839
|
"div",
|
|
840
840
|
{
|
|
841
|
-
class: ["fm-status-badge",
|
|
841
|
+
class: ["fm-status-badge", Oe("FAILED")]
|
|
842
842
|
},
|
|
843
843
|
"Rejected"
|
|
844
844
|
)
|
|
@@ -850,7 +850,7 @@ const Da = Dt(
|
|
|
850
850
|
F(
|
|
851
851
|
"div",
|
|
852
852
|
{
|
|
853
|
-
class: ["fm-status-badge",
|
|
853
|
+
class: ["fm-status-badge", Oe("PROCESSING")]
|
|
854
854
|
},
|
|
855
855
|
"Updated"
|
|
856
856
|
)
|
|
@@ -862,9 +862,9 @@ const Da = Dt(
|
|
|
862
862
|
F(
|
|
863
863
|
"div",
|
|
864
864
|
{
|
|
865
|
-
class: ["fm-status-badge",
|
|
865
|
+
class: ["fm-status-badge", Oe(C)]
|
|
866
866
|
},
|
|
867
|
-
|
|
867
|
+
He(C)
|
|
868
868
|
)
|
|
869
869
|
);
|
|
870
870
|
}
|
|
@@ -874,9 +874,9 @@ const Da = Dt(
|
|
|
874
874
|
cell(r) {
|
|
875
875
|
var i;
|
|
876
876
|
const t = r.row.original, C = ((i = e.sessionUser.value) == null ? void 0 : i.role.isAdmin) ?? !1, I = [
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
],
|
|
877
|
+
bt[Ce.Details],
|
|
878
|
+
bt[Ce.Export]
|
|
879
|
+
], G = [
|
|
880
880
|
{
|
|
881
881
|
translationKey: "inventory.closing.draft.approveDraft",
|
|
882
882
|
color: "text-fm-color-typo-primary",
|
|
@@ -892,20 +892,20 @@ const Da = Dt(
|
|
|
892
892
|
color: "text-fm-color-typo-error",
|
|
893
893
|
value: Z.enum.markAsFailed
|
|
894
894
|
}
|
|
895
|
-
],
|
|
895
|
+
], g = C && t.status !== he.enum.DRAFT ? [
|
|
896
896
|
{
|
|
897
897
|
translationKey: "inventory.closing.draft.cloneDraft",
|
|
898
898
|
color: "text-fm-color-typo-primary",
|
|
899
|
-
value:
|
|
899
|
+
value: Ce.Duplicate
|
|
900
900
|
}
|
|
901
901
|
] : [];
|
|
902
|
-
return
|
|
902
|
+
return ta(
|
|
903
903
|
[
|
|
904
904
|
...I,
|
|
905
|
-
...t.status === he.enum.DRAFT ?
|
|
905
|
+
...t.status === he.enum.DRAFT ? G : []
|
|
906
906
|
],
|
|
907
907
|
($) => j($, t),
|
|
908
|
-
|
|
908
|
+
g
|
|
909
909
|
);
|
|
910
910
|
},
|
|
911
911
|
enableSorting: !1,
|
|
@@ -917,25 +917,25 @@ const Da = Dt(
|
|
|
917
917
|
}
|
|
918
918
|
],
|
|
919
919
|
drafts: h,
|
|
920
|
-
loading:
|
|
920
|
+
loading: y,
|
|
921
921
|
fetchDrafts: U,
|
|
922
|
-
loadDraft:
|
|
922
|
+
loadDraft: V,
|
|
923
923
|
updateDraftRef: _
|
|
924
924
|
};
|
|
925
925
|
}
|
|
926
|
-
),
|
|
926
|
+
), wa = { class: "fm-typo-en-heading-lg-600" }, Sa = { class: "py-4" }, Fa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, Ca = { key: 0 }, $a = { class: "mt-4 flex gap-4" }, Ba = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, Ta = { key: 0 }, ja = {
|
|
927
927
|
key: 0,
|
|
928
928
|
class: "mb-4"
|
|
929
|
-
},
|
|
929
|
+
}, Ia = { class: "flex flex-col gap-1 max-h-200 overflow-auto w-full" }, Ua = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ra = {
|
|
930
930
|
key: 0,
|
|
931
931
|
class: "text-fm-color-system-success-300 mr-1"
|
|
932
|
-
},
|
|
932
|
+
}, Va = {
|
|
933
933
|
key: 1,
|
|
934
934
|
class: "text-fm-color-system-error-300 mr-1"
|
|
935
|
-
}, Pa = { class: "fm-typo-en-body-md-400" },
|
|
935
|
+
}, Pa = { class: "fm-typo-en-body-md-400" }, Ma = { class: "mt-4 flex gap-4" }, La = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, Na = {
|
|
936
936
|
key: 0,
|
|
937
937
|
class: "flex gap-4"
|
|
938
|
-
},
|
|
938
|
+
}, Ea = /* @__PURE__ */ Ue({
|
|
939
939
|
__name: "ClosingDraftApprovalDialog",
|
|
940
940
|
props: {
|
|
941
941
|
show: { type: Boolean },
|
|
@@ -944,31 +944,31 @@ const Da = Dt(
|
|
|
944
944
|
draft: {}
|
|
945
945
|
},
|
|
946
946
|
emits: ["update:show", "refresh", "approve"],
|
|
947
|
-
setup(
|
|
948
|
-
const { FmStepper: e, FmStep: d, FmDialog: h, FmButton:
|
|
947
|
+
setup(u, { emit: o }) {
|
|
948
|
+
const { FmStepper: e, FmStep: d, FmDialog: h, FmButton: y } = be, { t: f } = sa(), M = Dt(), U = u, V = o, _ = R(
|
|
949
949
|
() => {
|
|
950
|
-
var
|
|
951
|
-
return ((
|
|
950
|
+
var D, A;
|
|
951
|
+
return ((D = U.draft) == null ? void 0 : D.stockSnapshot) && ((A = U.draft) == null ? void 0 : A.stockSnapshot) !== void 0;
|
|
952
952
|
}
|
|
953
|
-
), E =
|
|
953
|
+
), E = R(() => {
|
|
954
954
|
var J, O, re;
|
|
955
|
-
const
|
|
956
|
-
id:
|
|
957
|
-
code:
|
|
958
|
-
name:
|
|
959
|
-
}))) ?? [],
|
|
960
|
-
id:
|
|
961
|
-
code:
|
|
962
|
-
name:
|
|
955
|
+
const D = ((J = U.draft) == null ? void 0 : J.items.map((le) => ({
|
|
956
|
+
id: le.sku._id,
|
|
957
|
+
code: le.sku.code,
|
|
958
|
+
name: le.sku.name
|
|
959
|
+
}))) ?? [], A = ((re = (O = U.draft) == null ? void 0 : O.negativeStockItems) == null ? void 0 : re.map((le) => ({
|
|
960
|
+
id: le.sku._id,
|
|
961
|
+
code: le.sku.code,
|
|
962
|
+
name: le.sku.name
|
|
963
963
|
}))) ?? [];
|
|
964
|
-
return [...
|
|
965
|
-
(
|
|
964
|
+
return [...D, ...A].reduce(
|
|
965
|
+
(le, X) => (le[X.id] = X, le),
|
|
966
966
|
{}
|
|
967
967
|
);
|
|
968
|
-
}), j =
|
|
968
|
+
}), j = R(
|
|
969
969
|
() => {
|
|
970
|
-
var
|
|
971
|
-
return (((J = (
|
|
970
|
+
var D, A, J;
|
|
971
|
+
return (((J = (A = (D = U.draft) == null ? void 0 : D.stockSnapshot) == null ? void 0 : A.filter((O) => O.balance.amount < 0)) == null ? void 0 : J.map((O) => {
|
|
972
972
|
const re = M.skuById[O.id];
|
|
973
973
|
return re ? {
|
|
974
974
|
id: re._id,
|
|
@@ -977,93 +977,93 @@ const Da = Dt(
|
|
|
977
977
|
} : null;
|
|
978
978
|
})) ?? []).filter((O) => O !== null);
|
|
979
979
|
}
|
|
980
|
-
),
|
|
981
|
-
var
|
|
982
|
-
return _.value ? ((
|
|
983
|
-
}), r =
|
|
980
|
+
), q = R(() => {
|
|
981
|
+
var D;
|
|
982
|
+
return _.value ? ((D = j.value) == null ? void 0 : D.filter((A) => !E.value[A.id]).map((A) => A.id)) ?? [] : [];
|
|
983
|
+
}), r = R({
|
|
984
984
|
get: () => U.show,
|
|
985
|
-
set: (
|
|
986
|
-
}), t =
|
|
987
|
-
function
|
|
988
|
-
return
|
|
985
|
+
set: (D) => V("update:show", D)
|
|
986
|
+
}), t = Y(1), C = () => t.value > 1, I = () => t.value > 2, G = () => !1;
|
|
987
|
+
function g(D) {
|
|
988
|
+
return D === 1 ? _.value : D === 2 ? q.value.length == 0 : !1;
|
|
989
989
|
}
|
|
990
|
-
const i =
|
|
991
|
-
function $(
|
|
992
|
-
let
|
|
993
|
-
for (;
|
|
994
|
-
return
|
|
990
|
+
const i = R(() => !_.value || q.value.length > 0);
|
|
991
|
+
function $(D) {
|
|
992
|
+
let A = D + 1;
|
|
993
|
+
for (; A <= 3 && g(A); ) A++;
|
|
994
|
+
return A > 3 ? 3 : A;
|
|
995
995
|
}
|
|
996
|
-
function H(
|
|
997
|
-
let
|
|
998
|
-
for (;
|
|
999
|
-
return
|
|
996
|
+
function H(D) {
|
|
997
|
+
let A = D - 1;
|
|
998
|
+
for (; A >= 1 && g(A); ) A--;
|
|
999
|
+
return A < 1 ? 1 : A;
|
|
1000
1000
|
}
|
|
1001
|
-
function
|
|
1001
|
+
function ee() {
|
|
1002
1002
|
return _.value ? i.value ? 3 : 2 : 1;
|
|
1003
1003
|
}
|
|
1004
|
-
|
|
1004
|
+
Ee(
|
|
1005
1005
|
() => U.show,
|
|
1006
|
-
(
|
|
1007
|
-
|
|
1006
|
+
(D) => {
|
|
1007
|
+
D && (t.value = ee());
|
|
1008
1008
|
}
|
|
1009
|
-
),
|
|
1009
|
+
), Ee(
|
|
1010
1010
|
() => _.value,
|
|
1011
|
-
(
|
|
1012
|
-
|
|
1011
|
+
(D) => {
|
|
1012
|
+
D && t.value === 1 && (t.value = $(1));
|
|
1013
1013
|
}
|
|
1014
|
-
),
|
|
1015
|
-
() =>
|
|
1016
|
-
(
|
|
1017
|
-
|
|
1014
|
+
), Ee(
|
|
1015
|
+
() => q.value.length,
|
|
1016
|
+
(D) => {
|
|
1017
|
+
D === 0 && t.value === 2 && (t.value = $(2));
|
|
1018
1018
|
}
|
|
1019
1019
|
);
|
|
1020
|
-
function
|
|
1021
|
-
|
|
1020
|
+
function se() {
|
|
1021
|
+
V("refresh");
|
|
1022
1022
|
}
|
|
1023
1023
|
function w() {
|
|
1024
1024
|
t.value < 3 && (t.value = $(t.value));
|
|
1025
1025
|
}
|
|
1026
|
-
function
|
|
1026
|
+
function te() {
|
|
1027
1027
|
t.value > 1 && (t.value = H(t.value));
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1030
|
-
|
|
1029
|
+
function de() {
|
|
1030
|
+
V("approve");
|
|
1031
1031
|
}
|
|
1032
|
-
return (
|
|
1032
|
+
return (D, A) => {
|
|
1033
1033
|
const J = K("FmIcon");
|
|
1034
|
-
return x(),
|
|
1034
|
+
return x(), fe(v(h), {
|
|
1035
1035
|
modelValue: r.value,
|
|
1036
|
-
"onUpdate:modelValue":
|
|
1036
|
+
"onUpdate:modelValue": A[1] || (A[1] = (O) => r.value = O),
|
|
1037
1037
|
"max-width": 600
|
|
1038
1038
|
}, {
|
|
1039
|
-
"dialog-header":
|
|
1040
|
-
n("div",
|
|
1039
|
+
"dialog-header": Q(() => [
|
|
1040
|
+
n("div", wa, W(v(f)("inventory.closing.approval.title")), 1)
|
|
1041
1041
|
]),
|
|
1042
|
-
default:
|
|
1043
|
-
n("div",
|
|
1042
|
+
default: Q(() => [
|
|
1043
|
+
n("div", Sa, [
|
|
1044
1044
|
k(v(e), {
|
|
1045
1045
|
modelValue: t.value,
|
|
1046
|
-
"onUpdate:modelValue":
|
|
1046
|
+
"onUpdate:modelValue": A[0] || (A[0] = (O) => t.value = O),
|
|
1047
1047
|
orientation: "vertical"
|
|
1048
1048
|
}, {
|
|
1049
|
-
default:
|
|
1049
|
+
default: Q(() => [
|
|
1050
1050
|
k(v(d), {
|
|
1051
1051
|
value: 1,
|
|
1052
1052
|
title: v(f)("inventory.closing.approval.step.generateReport.title"),
|
|
1053
1053
|
complete: C
|
|
1054
1054
|
}, {
|
|
1055
|
-
default:
|
|
1056
|
-
n("div",
|
|
1057
|
-
t.value === 1 ? (x(), P("div",
|
|
1058
|
-
k(v(
|
|
1055
|
+
default: Q(() => [
|
|
1056
|
+
n("div", Fa, W(v(f)("inventory.closing.approval.step.generateReport.description")), 1),
|
|
1057
|
+
t.value === 1 ? (x(), P("div", Ca, [
|
|
1058
|
+
k(v(y), {
|
|
1059
1059
|
label: v(f)("inventory.stock.stock_balance.refreshBalance"),
|
|
1060
1060
|
"prepend-icon": "refresh",
|
|
1061
1061
|
variant: "secondary",
|
|
1062
|
-
loading:
|
|
1063
|
-
onClick:
|
|
1062
|
+
loading: D.refreshing,
|
|
1063
|
+
onClick: se
|
|
1064
1064
|
}, null, 8, ["label", "loading"]),
|
|
1065
|
-
n("div",
|
|
1066
|
-
k(v(
|
|
1065
|
+
n("div", $a, [
|
|
1066
|
+
k(v(y), {
|
|
1067
1067
|
label: v(f)("inventory.common.continue"),
|
|
1068
1068
|
disabled: !_.value,
|
|
1069
1069
|
onClick: w
|
|
@@ -1079,41 +1079,41 @@ const Da = Dt(
|
|
|
1079
1079
|
disabled: () => !_.value,
|
|
1080
1080
|
complete: I
|
|
1081
1081
|
}, {
|
|
1082
|
-
default:
|
|
1083
|
-
n("div",
|
|
1084
|
-
t.value === 2 ? (x(), P("div",
|
|
1085
|
-
j.value.length > 0 ? (x(), P("div",
|
|
1086
|
-
|
|
1087
|
-
n("div",
|
|
1088
|
-
(x(!0), P(
|
|
1082
|
+
default: Q(() => [
|
|
1083
|
+
n("div", Ba, W(j.value.length > 0 ? `${v(f)("inventory.closing.approval.step.negativeItems.resolveMessage")} [${v(f)("inventory.closing.approval.step.negativeItems.itemsHeader")} (${q.value.length})]` : v(f)("inventory.closing.approval.step.negativeItems.noItemsMessage")), 1),
|
|
1084
|
+
t.value === 2 ? (x(), P("div", Ta, [
|
|
1085
|
+
j.value.length > 0 ? (x(), P("div", ja, [
|
|
1086
|
+
A[2] || (A[2] = n("div", { class: "fm-typo-en-body-md-600 mb-2" }, null, -1)),
|
|
1087
|
+
n("div", Ia, [
|
|
1088
|
+
(x(!0), P(ce, null, $e(j.value, (O) => (x(), P("div", {
|
|
1089
1089
|
key: O.id,
|
|
1090
1090
|
class: "flex gap-8"
|
|
1091
1091
|
}, [
|
|
1092
|
-
n("div",
|
|
1093
|
-
E.value[O.id] ? (x(), P("span",
|
|
1092
|
+
n("div", Ua, [
|
|
1093
|
+
E.value[O.id] ? (x(), P("span", Ra, [
|
|
1094
1094
|
k(J, {
|
|
1095
1095
|
name: "check_circle",
|
|
1096
1096
|
size: "sm"
|
|
1097
1097
|
})
|
|
1098
|
-
])) : (x(), P("span",
|
|
1098
|
+
])) : (x(), P("span", Va, [
|
|
1099
1099
|
k(J, {
|
|
1100
1100
|
name: "error",
|
|
1101
1101
|
size: "sm"
|
|
1102
1102
|
})
|
|
1103
1103
|
])),
|
|
1104
|
-
|
|
1104
|
+
ue(" " + W(O.code), 1)
|
|
1105
1105
|
]),
|
|
1106
|
-
n("div", Pa,
|
|
1106
|
+
n("div", Pa, W(O.name), 1)
|
|
1107
1107
|
]))), 128))
|
|
1108
1108
|
])
|
|
1109
1109
|
])) : ne("", !0),
|
|
1110
|
-
n("div",
|
|
1111
|
-
k(v(
|
|
1110
|
+
n("div", Ma, [
|
|
1111
|
+
k(v(y), {
|
|
1112
1112
|
label: v(f)("inventory.common.back"),
|
|
1113
1113
|
variant: "secondary",
|
|
1114
|
-
onClick:
|
|
1114
|
+
onClick: te
|
|
1115
1115
|
}, null, 8, ["label"]),
|
|
1116
|
-
k(v(
|
|
1116
|
+
k(v(y), {
|
|
1117
1117
|
label: v(f)("inventory.common.continue"),
|
|
1118
1118
|
disabled: i.value,
|
|
1119
1119
|
onClick: w
|
|
@@ -1127,22 +1127,22 @@ const Da = Dt(
|
|
|
1127
1127
|
value: 3,
|
|
1128
1128
|
title: v(f)("inventory.closing.approval.step.approval.title"),
|
|
1129
1129
|
disabled: () => i.value,
|
|
1130
|
-
complete:
|
|
1130
|
+
complete: G
|
|
1131
1131
|
}, {
|
|
1132
|
-
default:
|
|
1133
|
-
n("div",
|
|
1134
|
-
t.value === 3 ? (x(), P("div",
|
|
1135
|
-
k(v(
|
|
1132
|
+
default: Q(() => [
|
|
1133
|
+
n("div", La, W(v(f)("inventory.closing.approval.step.approval.warning")), 1),
|
|
1134
|
+
t.value === 3 ? (x(), P("div", Na, [
|
|
1135
|
+
k(v(y), {
|
|
1136
1136
|
label: v(f)("inventory.common.back"),
|
|
1137
1137
|
variant: "secondary",
|
|
1138
|
-
onClick:
|
|
1138
|
+
onClick: te
|
|
1139
1139
|
}, null, 8, ["label"]),
|
|
1140
|
-
k(v(
|
|
1140
|
+
k(v(y), {
|
|
1141
1141
|
label: v(f)("inventory.common.approve"),
|
|
1142
1142
|
variant: "destructive",
|
|
1143
1143
|
disabled: i.value,
|
|
1144
|
-
loading:
|
|
1145
|
-
onClick:
|
|
1144
|
+
loading: D.approving,
|
|
1145
|
+
onClick: de
|
|
1146
1146
|
}, null, 8, ["label", "disabled", "loading"])
|
|
1147
1147
|
])) : ne("", !0)
|
|
1148
1148
|
]),
|
|
@@ -1157,86 +1157,87 @@ const Da = Dt(
|
|
|
1157
1157
|
}, 8, ["modelValue"]);
|
|
1158
1158
|
};
|
|
1159
1159
|
}
|
|
1160
|
-
}),
|
|
1160
|
+
}), za = { class: "w-full flex flex-col gap-32" }, Ha = { class: "flex justify-between" }, Oa = { class: "flex" }, Ka = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, Ya = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qa = { class: "flex gap-1" }, qa = { class: "fm-typo-en-body-lg-600" }, Ga = { class: "flex flex-col gap-16" }, Wa = { class: "flex items-center" }, Za = {
|
|
1161
1161
|
key: 0,
|
|
1162
1162
|
class: "flex gap-8"
|
|
1163
|
-
},
|
|
1163
|
+
}, Ja = {
|
|
1164
1164
|
key: 0,
|
|
1165
1165
|
class: "w-full flex flex-col items-center"
|
|
1166
|
-
},
|
|
1166
|
+
}, Xa = { class: "flex items-center gap-8" }, en = { class: "flex flex-col gap-8" }, tn = { class: "flex gap-8" }, an = {
|
|
1167
1167
|
key: 0,
|
|
1168
1168
|
class: "flex gap-8"
|
|
1169
|
-
},
|
|
1169
|
+
}, nn = { class: "overflow-x-auto" }, on = {
|
|
1170
1170
|
key: 1,
|
|
1171
1171
|
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
1172
|
-
},
|
|
1172
|
+
}, sn = {
|
|
1173
1173
|
key: 0,
|
|
1174
1174
|
class: "flex flex-col items-center gap-8 h-full"
|
|
1175
|
-
},
|
|
1175
|
+
}, rn = ["src"], ln = {
|
|
1176
1176
|
key: 1,
|
|
1177
1177
|
class: "px-4 flex flex-col"
|
|
1178
|
-
},
|
|
1178
|
+
}, cn = { class: "flex gap-12 content-stretch" }, un = {
|
|
1179
1179
|
class: "flex flex-col w-24",
|
|
1180
1180
|
name: "circles"
|
|
1181
|
-
},
|
|
1181
|
+
}, dn = { class: "flex-1 flex flex-col items-center" }, mn = { class: "flex-1 flex flex-col items-center" }, fn = {
|
|
1182
1182
|
class: "py-12 flex flex-col gap-4",
|
|
1183
1183
|
name: "received-at header"
|
|
1184
|
-
},
|
|
1184
|
+
}, pn = { class: "fm-typo-en-body-lg-400" }, vn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, gn = { class: "flex gap-12 content-stretch" }, yn = {
|
|
1185
1185
|
class: "flex flex-col w-24",
|
|
1186
1186
|
name: "circles"
|
|
1187
|
-
},
|
|
1187
|
+
}, bn = { class: "flex-1 flex flex-col items-center" }, hn = {
|
|
1188
1188
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
1189
1189
|
name: "delivery details"
|
|
1190
|
-
},
|
|
1190
|
+
}, kn = { class: "flex flex-col gap-8" }, _n = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, xn = { class: "flex flex-col gap-4" }, Dn = { class: "flex items-center justify-between gap-8 w-full" }, An = { class: "flex items-center gap-8" }, wn = { class: "flex flex-col items-end" }, Sn = { class: "text-2xl font-semibold" }, Fn = "N/A", Cn = /* @__PURE__ */ Ue({
|
|
1191
1191
|
__name: "ClosingDraftDialog",
|
|
1192
1192
|
props: {
|
|
1193
1193
|
show: { type: Boolean },
|
|
1194
1194
|
draft: {}
|
|
1195
1195
|
},
|
|
1196
1196
|
emits: ["submitted", "refresh"],
|
|
1197
|
-
setup(
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1197
|
+
setup(u, { emit: o }) {
|
|
1198
|
+
et();
|
|
1199
|
+
const e = u, d = R(() => {
|
|
1200
|
+
const c = xt();
|
|
1201
|
+
return c === "MYR" ? "RM" : c;
|
|
1201
1202
|
});
|
|
1202
|
-
|
|
1203
|
-
const h =
|
|
1204
|
-
t.skus.filter((
|
|
1203
|
+
$t();
|
|
1204
|
+
const h = Ye(), y = Ot(e, "show"), f = Y(!1), M = Y(!1), U = Y(!1), V = Y(new Array()), _ = Y(new Array()), E = Y([]), j = nt(), q = qe(), r = tt(), t = Dt(), C = Qe(), I = Mt({}), G = R(() => new Set(
|
|
1205
|
+
t.skus.filter((c) => {
|
|
1205
1206
|
var a;
|
|
1206
|
-
return I[(a =
|
|
1207
|
-
}).map((
|
|
1208
|
-
)),
|
|
1207
|
+
return I[(a = c.customAttributes) == null ? void 0 : a.tag];
|
|
1208
|
+
}).map((c) => c._id)
|
|
1209
|
+
)), g = o, i = Y({
|
|
1209
1210
|
templateItem: !0,
|
|
1210
1211
|
nonTemplateItem: !0
|
|
1211
|
-
}), $ =
|
|
1212
|
+
}), $ = R(() => {
|
|
1212
1213
|
var a, p;
|
|
1213
|
-
const
|
|
1214
|
-
return
|
|
1215
|
-
}), H =
|
|
1216
|
-
const
|
|
1217
|
-
return
|
|
1218
|
-
}),
|
|
1214
|
+
const c = [...((a = e.draft) == null ? void 0 : a.items) ?? [], ...((p = e.draft) == null ? void 0 : p.negativeStockItems) ?? []];
|
|
1215
|
+
return G.value.size ? c.filter((s) => G.value.has(s.sku._id)) : c;
|
|
1216
|
+
}), H = R(() => {
|
|
1217
|
+
const c = $.value.map((a) => a.sku);
|
|
1218
|
+
return c.sort((a, p) => a.code.localeCompare(p.code)), c;
|
|
1219
|
+
}), ee = R(() => $.value.groupBy(
|
|
1219
1220
|
(a) => a.sku._id,
|
|
1220
1221
|
(a) => a.measurementsAmounts.filter((p) => !p.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((p) => p.measurement.id)
|
|
1221
1222
|
));
|
|
1222
|
-
|
|
1223
|
+
Xe(de), Ee(
|
|
1223
1224
|
() => e.show,
|
|
1224
|
-
(
|
|
1225
|
-
|
|
1225
|
+
(c) => {
|
|
1226
|
+
c && (_e.value = we[0], de(), i.value = {
|
|
1226
1227
|
templateItem: !0,
|
|
1227
1228
|
nonTemplateItem: !0
|
|
1228
1229
|
});
|
|
1229
1230
|
}
|
|
1230
1231
|
);
|
|
1231
|
-
const
|
|
1232
|
-
async function
|
|
1232
|
+
const se = R(() => je.value.reduce((c, a) => c + Number(a.stockTakeValue), 0)), w = Ie(0), te = Ie(100);
|
|
1233
|
+
async function de() {
|
|
1233
1234
|
var a, p, s, l;
|
|
1234
1235
|
if (!C._currentLocation) return;
|
|
1235
1236
|
f.value = !0;
|
|
1236
|
-
const
|
|
1237
|
+
const c = ((a = e.draft) == null ? void 0 : a.status) === he.enum.COMPLETED;
|
|
1237
1238
|
_.value = [];
|
|
1238
1239
|
try {
|
|
1239
|
-
if (await t.init(),
|
|
1240
|
+
if (await t.init(), c) {
|
|
1240
1241
|
const L = e.draft.closingAdjustmentId;
|
|
1241
1242
|
if (!L) {
|
|
1242
1243
|
r.open({
|
|
@@ -1248,21 +1249,21 @@ const Da = Dt(
|
|
|
1248
1249
|
});
|
|
1249
1250
|
return;
|
|
1250
1251
|
}
|
|
1251
|
-
const N = await j.readAdjustmentById(L),
|
|
1252
|
-
for (const
|
|
1253
|
-
const
|
|
1254
|
-
id:
|
|
1255
|
-
balance:
|
|
1256
|
-
costs:
|
|
1252
|
+
const N = await j.readAdjustmentById(L), me = (N == null ? void 0 : N.skus) ?? [];
|
|
1253
|
+
for (const pe of me) {
|
|
1254
|
+
const xe = {
|
|
1255
|
+
id: pe.sku._id,
|
|
1256
|
+
balance: pe.fromBalance,
|
|
1257
|
+
costs: pe.fromCostBalances
|
|
1257
1258
|
}, T = {
|
|
1258
|
-
id:
|
|
1259
|
-
balance:
|
|
1260
|
-
costs:
|
|
1259
|
+
id: pe.sku._id,
|
|
1260
|
+
balance: pe.toBalance,
|
|
1261
|
+
costs: pe.toCostBalances
|
|
1261
1262
|
};
|
|
1262
|
-
|
|
1263
|
+
V.value.push(xe), _.value.push(T);
|
|
1263
1264
|
}
|
|
1264
1265
|
} else
|
|
1265
|
-
|
|
1266
|
+
V.value = ((s = e.draft) == null ? void 0 : s.stockSnapshot) ?? [];
|
|
1266
1267
|
const m = /* @__PURE__ */ new Set();
|
|
1267
1268
|
if ((l = e.draft) != null && l.adjustmentSnapshot)
|
|
1268
1269
|
for (const L of e.draft.adjustmentSnapshot)
|
|
@@ -1283,9 +1284,9 @@ const Da = Dt(
|
|
|
1283
1284
|
f.value = !1;
|
|
1284
1285
|
}
|
|
1285
1286
|
}
|
|
1286
|
-
async function
|
|
1287
|
+
async function D() {
|
|
1287
1288
|
var a, p;
|
|
1288
|
-
if (!(((a = e.draft) == null ? void 0 : a.effectiveAt) ?? (e.draft ?
|
|
1289
|
+
if (!(((a = e.draft) == null ? void 0 : a.effectiveAt) ?? (e.draft ? ze((p = e.draft) == null ? void 0 : p._id) : null))) {
|
|
1289
1290
|
r.open({
|
|
1290
1291
|
title: "Cannot refresh",
|
|
1291
1292
|
message: "Effective date is not available for this draft.",
|
|
@@ -1304,7 +1305,7 @@ const Da = Dt(
|
|
|
1304
1305
|
try {
|
|
1305
1306
|
await j.recalculation.scheduleCalculateStockSnapshotAtDate(s, e.draft._id);
|
|
1306
1307
|
let S = null;
|
|
1307
|
-
for (let L = 0; L < m && (S = await
|
|
1308
|
+
for (let L = 0; L < m && (S = await q.getDraft(e.draft._id).delayed(b), S._rev === l); L++)
|
|
1308
1309
|
;
|
|
1309
1310
|
if (!S || S._rev === l) {
|
|
1310
1311
|
r.open({
|
|
@@ -1314,11 +1315,11 @@ const Da = Dt(
|
|
|
1314
1315
|
}), console.error("error refreshing stock balances: there is no change in _rev");
|
|
1315
1316
|
return;
|
|
1316
1317
|
}
|
|
1317
|
-
|
|
1318
|
+
g("refresh", S), V.value = S.stockSnapshot ?? [], r.open({
|
|
1318
1319
|
title: "Balance refreshed",
|
|
1319
1320
|
message: "Stock balance has been recalculated.",
|
|
1320
1321
|
type: "success"
|
|
1321
|
-
}),
|
|
1322
|
+
}), y.value = !1;
|
|
1322
1323
|
} catch (S) {
|
|
1323
1324
|
r.open({
|
|
1324
1325
|
title: "Refresh failed",
|
|
@@ -1333,7 +1334,7 @@ const Da = Dt(
|
|
|
1333
1334
|
}
|
|
1334
1335
|
async function A() {
|
|
1335
1336
|
var a, p;
|
|
1336
|
-
if (!(((a = e.draft) == null ? void 0 : a.effectiveAt) ?? (e.draft ?
|
|
1337
|
+
if (!(((a = e.draft) == null ? void 0 : a.effectiveAt) ?? (e.draft ? ze((p = e.draft) == null ? void 0 : p._id) : null))) {
|
|
1337
1338
|
r.open({
|
|
1338
1339
|
title: "Cannot refresh",
|
|
1339
1340
|
message: "Effective date is not available for this draft.",
|
|
@@ -1343,36 +1344,36 @@ const Da = Dt(
|
|
|
1343
1344
|
}
|
|
1344
1345
|
await h.invalidateDraftCache(e.draft);
|
|
1345
1346
|
}
|
|
1346
|
-
const
|
|
1347
|
-
() =>
|
|
1348
|
-
(
|
|
1349
|
-
(
|
|
1347
|
+
const J = R(
|
|
1348
|
+
() => V.value.groupBy(
|
|
1349
|
+
(c) => c.id,
|
|
1350
|
+
(c) => c.balance
|
|
1350
1351
|
)
|
|
1351
|
-
),
|
|
1352
|
-
var
|
|
1353
|
-
return (
|
|
1354
|
-
}),
|
|
1355
|
-
var
|
|
1356
|
-
return (
|
|
1352
|
+
), O = R(() => $.value.groupBy((c) => c.sku._id)), re = R(() => {
|
|
1353
|
+
var c;
|
|
1354
|
+
return (c = e.draft) != null && c.adjustmentSnapshot ? new Map(e.draft.adjustmentSnapshot.map((a) => [a.skuId, a.adjustmentsByType])) : /* @__PURE__ */ new Map();
|
|
1355
|
+
}), le = R(() => {
|
|
1356
|
+
var c;
|
|
1357
|
+
return (c = e.draft) != null && c.opening ? new Map(e.draft.opening.map((a) => [a.skuId, a.balance])) : /* @__PURE__ */ new Map();
|
|
1357
1358
|
});
|
|
1358
|
-
function
|
|
1359
|
+
function X(c, a) {
|
|
1359
1360
|
return F(
|
|
1360
1361
|
be.FmTooltip,
|
|
1361
1362
|
{ zIndex: 51, placement: "left", class: "w-full flex justify-end" },
|
|
1362
1363
|
{
|
|
1363
1364
|
default() {
|
|
1364
|
-
return
|
|
1365
|
+
return c;
|
|
1365
1366
|
},
|
|
1366
1367
|
content() {
|
|
1367
|
-
return a ||
|
|
1368
|
+
return a || c;
|
|
1368
1369
|
}
|
|
1369
1370
|
}
|
|
1370
1371
|
);
|
|
1371
1372
|
}
|
|
1372
|
-
const
|
|
1373
|
-
const
|
|
1373
|
+
const Te = R(() => {
|
|
1374
|
+
const c = H.value.reduce((p, s) => {
|
|
1374
1375
|
var l, m;
|
|
1375
|
-
return Math.max(p, ((m = (l =
|
|
1376
|
+
return Math.max(p, ((m = (l = ee.value) == null ? void 0 : l.get(s._id)) == null ? void 0 : m[0].length) ?? 0);
|
|
1376
1377
|
}, 0);
|
|
1377
1378
|
return [
|
|
1378
1379
|
{
|
|
@@ -1424,7 +1425,7 @@ const Da = Dt(
|
|
|
1424
1425
|
{
|
|
1425
1426
|
id: "costPerUnit",
|
|
1426
1427
|
accessorKey: "costPerUnit",
|
|
1427
|
-
header: () =>
|
|
1428
|
+
header: () => X("Cost per unit"),
|
|
1428
1429
|
size: 160,
|
|
1429
1430
|
cell(p) {
|
|
1430
1431
|
const s = p.row.original.costPerUnit;
|
|
@@ -1466,7 +1467,7 @@ const Da = Dt(
|
|
|
1466
1467
|
{
|
|
1467
1468
|
id: "opening",
|
|
1468
1469
|
accessorKey: "opening",
|
|
1469
|
-
header: () =>
|
|
1470
|
+
header: () => X("Opening (B/F)", "The opening balance brought forward from previous period."),
|
|
1470
1471
|
size: 150,
|
|
1471
1472
|
cell(p) {
|
|
1472
1473
|
const s = p.row.original.opening;
|
|
@@ -1481,11 +1482,11 @@ const Da = Dt(
|
|
|
1481
1482
|
(p) => ({
|
|
1482
1483
|
id: `adjustment_${p}`,
|
|
1483
1484
|
accessorFn: (s) => s.adjustmentAmounts[p] ?? { amount: 0, precision: 0 },
|
|
1484
|
-
header: () =>
|
|
1485
|
+
header: () => X(He(p)),
|
|
1485
1486
|
size: 150,
|
|
1486
1487
|
cell(s) {
|
|
1487
1488
|
const l = s.row.original.adjustmentAmounts[p] ?? { amount: 0, precision: 0 };
|
|
1488
|
-
return F("div", { class: "text-right" },
|
|
1489
|
+
return F("div", { class: "text-right" }, Je(l));
|
|
1489
1490
|
},
|
|
1490
1491
|
meta: {
|
|
1491
1492
|
textAlign: "right"
|
|
@@ -1495,7 +1496,7 @@ const Da = Dt(
|
|
|
1495
1496
|
{
|
|
1496
1497
|
id: "systemBalance",
|
|
1497
1498
|
accessorKey: "systemBalance",
|
|
1498
|
-
header: () =>
|
|
1499
|
+
header: () => X("System Balance", "The system calculated balance before stock take."),
|
|
1499
1500
|
size: 200,
|
|
1500
1501
|
meta: {
|
|
1501
1502
|
textAlign: "right"
|
|
@@ -1508,7 +1509,7 @@ const Da = Dt(
|
|
|
1508
1509
|
const s = (l = _.value.find((m) => m.id === p.id)) == null ? void 0 : l.balance;
|
|
1509
1510
|
return s ? z.toFormatString({ value: s }) : p.physicalBalance;
|
|
1510
1511
|
},
|
|
1511
|
-
header: () =>
|
|
1512
|
+
header: () => X("Stock Take balance", "The physical balance recorded during stock take."),
|
|
1512
1513
|
cell(p) {
|
|
1513
1514
|
var S;
|
|
1514
1515
|
const s = p.row.original, l = z.fromNumber(s.physicalBalance);
|
|
@@ -1538,7 +1539,7 @@ const Da = Dt(
|
|
|
1538
1539
|
{
|
|
1539
1540
|
id: "adjustedAmount",
|
|
1540
1541
|
accessorKey: "adjustedAmount",
|
|
1541
|
-
header: () =>
|
|
1542
|
+
header: () => X("Variance", "The difference between Stock Take balance and System Balance."),
|
|
1542
1543
|
size: 200,
|
|
1543
1544
|
meta: {
|
|
1544
1545
|
textAlign: "right"
|
|
@@ -1547,7 +1548,7 @@ const Da = Dt(
|
|
|
1547
1548
|
{
|
|
1548
1549
|
id: "varianceInCost",
|
|
1549
1550
|
accessorKey: "varianceInCost",
|
|
1550
|
-
header: () =>
|
|
1551
|
+
header: () => X(`Variance (${d.value})`),
|
|
1551
1552
|
size: 150,
|
|
1552
1553
|
cell(p) {
|
|
1553
1554
|
const s = p.row.original.varianceInCost;
|
|
@@ -1564,14 +1565,14 @@ const Da = Dt(
|
|
|
1564
1565
|
{
|
|
1565
1566
|
id: "adjustedDiffPercentage",
|
|
1566
1567
|
accessorKey: "adjustedDiffPercentage",
|
|
1567
|
-
header: () =>
|
|
1568
|
+
header: () => X(
|
|
1568
1569
|
"Variance (%)",
|
|
1569
1570
|
"Difference between Stock Take balance and System Balance in percentage."
|
|
1570
1571
|
),
|
|
1571
1572
|
size: 200,
|
|
1572
1573
|
cell(p) {
|
|
1573
1574
|
const s = p.row.original.adjustedDiffPercentage;
|
|
1574
|
-
if (!s) return
|
|
1575
|
+
if (!s) return Fn;
|
|
1575
1576
|
const l = s.toFixed(2);
|
|
1576
1577
|
if (l === "0.00")
|
|
1577
1578
|
return F("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
|
|
@@ -1592,19 +1593,19 @@ const Da = Dt(
|
|
|
1592
1593
|
{
|
|
1593
1594
|
id: "stockTakeValue",
|
|
1594
1595
|
accessorKey: "stockTakeValue",
|
|
1595
|
-
header: () =>
|
|
1596
|
+
header: () => X(`Stock take value (${d.value})`),
|
|
1596
1597
|
size: 180,
|
|
1597
1598
|
cell(p) {
|
|
1598
1599
|
var L;
|
|
1599
1600
|
const s = p.row.original, l = s.stockTakeValue, m = H.value.find((N) => N._id === s.id), b = (L = m == null ? void 0 : m.defaultCost) == null ? void 0 : L.measurement, B = s.physicalBalance, S = s.costPerUnit;
|
|
1600
1601
|
if (b) {
|
|
1601
|
-
const N = z.toFormatString({ value: b.conversion }),
|
|
1602
|
+
const N = z.toFormatString({ value: b.conversion }), me = `${B.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} ${s.baseUnit} ÷ ${N} × ${S} ${d.value}`;
|
|
1602
1603
|
return F(
|
|
1603
1604
|
be.FmTooltip,
|
|
1604
1605
|
{ zIndex: 51 },
|
|
1605
1606
|
{
|
|
1606
1607
|
content() {
|
|
1607
|
-
return
|
|
1608
|
+
return me;
|
|
1608
1609
|
},
|
|
1609
1610
|
default() {
|
|
1610
1611
|
return F(
|
|
@@ -1648,19 +1649,19 @@ const Da = Dt(
|
|
|
1648
1649
|
{
|
|
1649
1650
|
id: "systemValue",
|
|
1650
1651
|
accessorKey: "systemValue",
|
|
1651
|
-
header: () =>
|
|
1652
|
+
header: () => X(`System value (${d.value})`),
|
|
1652
1653
|
size: 180,
|
|
1653
1654
|
cell(p) {
|
|
1654
1655
|
var L;
|
|
1655
1656
|
const s = p.row.original, l = s.systemValue, m = H.value.find((N) => N._id === s.id), b = (L = m == null ? void 0 : m.defaultCost) == null ? void 0 : L.measurement, B = s.systemBalance, S = s.costPerUnit;
|
|
1656
1657
|
if (b) {
|
|
1657
|
-
const N = z.toFormatString({ value: b.conversion }),
|
|
1658
|
+
const N = z.toFormatString({ value: b.conversion }), me = `${B.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })} ${s.baseUnit} ÷ ${N} × ${S} ${d.value}`;
|
|
1658
1659
|
return F(
|
|
1659
1660
|
be.FmTooltip,
|
|
1660
1661
|
{ zIndex: 51 },
|
|
1661
1662
|
{
|
|
1662
1663
|
content() {
|
|
1663
|
-
return
|
|
1664
|
+
return me;
|
|
1664
1665
|
},
|
|
1665
1666
|
default() {
|
|
1666
1667
|
return F(
|
|
@@ -1734,7 +1735,7 @@ const Da = Dt(
|
|
|
1734
1735
|
}
|
|
1735
1736
|
}
|
|
1736
1737
|
);
|
|
1737
|
-
let m = Array.from({ length:
|
|
1738
|
+
let m = Array.from({ length: c }).map((b, B) => {
|
|
1738
1739
|
if (!s[`measurementAmount${B}`])
|
|
1739
1740
|
return null;
|
|
1740
1741
|
const S = s[`measurementAmount${B}`], L = s[`measurementAbbrev${B}`];
|
|
@@ -1753,94 +1754,94 @@ const Da = Dt(
|
|
|
1753
1754
|
}
|
|
1754
1755
|
}
|
|
1755
1756
|
];
|
|
1756
|
-
}),
|
|
1757
|
+
}), Re = R(() => Te.value.map((c) => c.size ?? 0).reduce((c, a) => c + a)), De = Y(""), je = R(() => {
|
|
1757
1758
|
var p, s;
|
|
1758
|
-
const
|
|
1759
|
+
const c = ((s = (p = e.draft) == null ? void 0 : p.negativeStockItems) == null ? void 0 : s.reduce(
|
|
1759
1760
|
(l, m) => (l[m.sku._id] = m, l),
|
|
1760
1761
|
{}
|
|
1761
1762
|
)) ?? {};
|
|
1762
1763
|
return H.value.map((l) => {
|
|
1763
|
-
var
|
|
1764
|
-
const m = (
|
|
1764
|
+
var rt, lt, it, ct, ut, dt, mt, ft, pt, vt, gt;
|
|
1765
|
+
const m = (rt = O.value.get(l._id)) == null ? void 0 : rt[0], b = ((lt = J.value.get(l._id)) == null ? void 0 : lt[0]) ?? w, B = ((it = l.defaultCost) == null ? void 0 : it.costPerUnit) ?? w, S = Number(z.toFormatString({ value: B })), L = ((ut = (ct = l.defaultCost) == null ? void 0 : ct.measurement) == null ? void 0 : ut.conversion) ?? {
|
|
1765
1766
|
amount: 1,
|
|
1766
1767
|
precision: 0
|
|
1767
1768
|
}, N = Number(
|
|
1768
1769
|
z.toFormatString({ value: L })
|
|
1769
|
-
),
|
|
1770
|
-
if (E.value.forEach((
|
|
1771
|
-
const
|
|
1772
|
-
|
|
1770
|
+
), me = le.value.get(l._id), pe = me ? Number(z.toFormatString({ value: me })) : 0, xe = re.value.get(l._id), T = {};
|
|
1771
|
+
if (E.value.forEach((oe) => {
|
|
1772
|
+
const ve = T[oe] ?? { amount: 0, precision: 0 }, ge = xe == null ? void 0 : xe[oe];
|
|
1773
|
+
ge && (T[oe] = Jt(ve, ge));
|
|
1773
1774
|
}), !m) {
|
|
1774
|
-
const
|
|
1775
|
+
const oe = Number(z.toFormatString({ value: b })), ve = oe - 0, ge = ve * S / N, Le = 0, Pt = oe * S / N;
|
|
1775
1776
|
return {
|
|
1776
1777
|
id: l._id,
|
|
1777
1778
|
code: l.code,
|
|
1778
1779
|
name: l.name,
|
|
1779
|
-
costUnit: ((
|
|
1780
|
+
costUnit: ((mt = (dt = l.defaultCost) == null ? void 0 : dt.measurement) == null ? void 0 : mt.abbrev) ?? null,
|
|
1780
1781
|
baseUnit: l.unit.abbrev,
|
|
1781
1782
|
baseUnitAmount: 0,
|
|
1782
|
-
systemBalance:
|
|
1783
|
+
systemBalance: oe,
|
|
1783
1784
|
physicalBalance: 0,
|
|
1784
|
-
adjustedAmount: -
|
|
1785
|
+
adjustedAmount: -oe,
|
|
1785
1786
|
adjustedDiffPercentage: -100,
|
|
1786
|
-
isTemplateItem: !
|
|
1787
|
+
isTemplateItem: !c[l._id],
|
|
1787
1788
|
costPerUnit: S,
|
|
1788
|
-
opening:
|
|
1789
|
-
varianceQty:
|
|
1790
|
-
varianceInCost:
|
|
1791
|
-
stockTakeValue:
|
|
1789
|
+
opening: pe,
|
|
1790
|
+
varianceQty: ve,
|
|
1791
|
+
varianceInCost: ge,
|
|
1792
|
+
stockTakeValue: Le,
|
|
1792
1793
|
systemValue: Pt,
|
|
1793
1794
|
adjustmentAmounts: T
|
|
1794
1795
|
};
|
|
1795
1796
|
}
|
|
1796
|
-
const ae =
|
|
1797
|
-
(
|
|
1798
|
-
)) == null ? void 0 :
|
|
1799
|
-
|
|
1797
|
+
const ae = Bt(m), ie = (pt = (ft = _.value) == null ? void 0 : ft.find(
|
|
1798
|
+
(oe) => oe.id === l._id
|
|
1799
|
+
)) == null ? void 0 : pt.balance, ye = St(
|
|
1800
|
+
ie ?? ae,
|
|
1800
1801
|
b
|
|
1801
|
-
),
|
|
1802
|
+
), Fe = b.amount === 0 ? null : Ft(ye, {
|
|
1802
1803
|
...b,
|
|
1803
1804
|
amount: Math.abs(b.amount)
|
|
1804
|
-
}),
|
|
1805
|
+
}), Me = Fe ? at(Fe, te) : null, Ge = Number(z.toFormatString({ value: b })), We = Number(z.toFormatString({ value: ae })), st = Ge - We, Ut = st * S / N, Rt = We * S / N, Vt = Ge * S / N;
|
|
1805
1806
|
return {
|
|
1806
1807
|
id: l._id,
|
|
1807
1808
|
code: l.code,
|
|
1808
1809
|
name: l.name,
|
|
1809
|
-
costUnit: ((
|
|
1810
|
+
costUnit: ((gt = (vt = l.defaultCost) == null ? void 0 : vt.measurement) == null ? void 0 : gt.abbrev) ?? null,
|
|
1810
1811
|
baseUnit: l.unit.abbrev,
|
|
1811
1812
|
baseUnitAmount: Number(z.toFormatString({ value: m.baseAmount })),
|
|
1812
|
-
...m.measurementsAmounts.filter((
|
|
1813
|
-
var
|
|
1814
|
-
return (
|
|
1815
|
-
}).reduce((
|
|
1816
|
-
systemBalance:
|
|
1817
|
-
physicalBalance:
|
|
1818
|
-
adjustedAmount: Number(z.toFormatString({ value:
|
|
1819
|
-
adjustedDiffPercentage:
|
|
1813
|
+
...m.measurementsAmounts.filter((oe) => {
|
|
1814
|
+
var ve, ge, Le;
|
|
1815
|
+
return (Le = (ge = (ve = ee.value) == null ? void 0 : ve.get(l._id)) == null ? void 0 : ge[0]) == null ? void 0 : Le.includes(oe.measurement.id);
|
|
1816
|
+
}).reduce((oe, ve, ge) => (oe[`measurementAbbrev${ge}`] = `(${ve.measurement.abbrev}) × ${z.toFormatString({ value: ve.measurement.conversion })}`, oe[`measurementAmount${ge}`] = Number(z.toFormatString({ value: ve.amount })), oe), {}),
|
|
1817
|
+
systemBalance: Ge,
|
|
1818
|
+
physicalBalance: We,
|
|
1819
|
+
adjustedAmount: Number(z.toFormatString({ value: ye })),
|
|
1820
|
+
adjustedDiffPercentage: Me ? Number(
|
|
1820
1821
|
z.toFormatString({
|
|
1821
|
-
value:
|
|
1822
|
+
value: Ct(Me, 2)
|
|
1822
1823
|
})
|
|
1823
1824
|
) : null,
|
|
1824
|
-
isTemplateItem: !
|
|
1825
|
+
isTemplateItem: !c[l._id],
|
|
1825
1826
|
costPerUnit: S,
|
|
1826
|
-
opening:
|
|
1827
|
-
varianceQty:
|
|
1828
|
-
varianceInCost:
|
|
1829
|
-
stockTakeValue:
|
|
1830
|
-
systemValue:
|
|
1827
|
+
opening: pe,
|
|
1828
|
+
varianceQty: st,
|
|
1829
|
+
varianceInCost: Ut,
|
|
1830
|
+
stockTakeValue: Rt,
|
|
1831
|
+
systemValue: Vt,
|
|
1831
1832
|
adjustmentAmounts: T
|
|
1832
1833
|
};
|
|
1833
1834
|
}).filter((l) => !!(l.isTemplateItem && i.value.templateItem || !l.isTemplateItem && i.value.nonTemplateItem));
|
|
1834
|
-
}),
|
|
1835
|
+
}), Ae = R(() => {
|
|
1835
1836
|
var a, p, s, l, m;
|
|
1836
1837
|
if (!e.draft) return [];
|
|
1837
|
-
const
|
|
1838
|
-
action: `Approve at ${
|
|
1838
|
+
const c = e.draft.approvedAt ? {
|
|
1839
|
+
action: `Approve at ${ke(e.draft.approvedAt)}`,
|
|
1839
1840
|
// actionAt: props.draft.approvedAt,
|
|
1840
1841
|
actionBy: e.draft.approvedBy,
|
|
1841
1842
|
remark: e.draft.approveRemark
|
|
1842
1843
|
} : (a = e.draft.rejectionHistory) == null ? void 0 : a.computeFirst((b) => ({
|
|
1843
|
-
action: `Reject at ${
|
|
1844
|
+
action: `Reject at ${ke(b.rejectedAt)}`,
|
|
1844
1845
|
// actionAt: e.rejectedAt,
|
|
1845
1846
|
actionBy: b.rejectedBy,
|
|
1846
1847
|
remark: b.rejectRemark
|
|
@@ -1852,7 +1853,7 @@ const Da = Dt(
|
|
|
1852
1853
|
},
|
|
1853
1854
|
{
|
|
1854
1855
|
label: "Created at",
|
|
1855
|
-
value:
|
|
1856
|
+
value: ke(e.draft.createdAt)
|
|
1856
1857
|
},
|
|
1857
1858
|
{
|
|
1858
1859
|
label: "Created by",
|
|
@@ -1860,7 +1861,7 @@ const Da = Dt(
|
|
|
1860
1861
|
},
|
|
1861
1862
|
{
|
|
1862
1863
|
label: "Updated at",
|
|
1863
|
-
value:
|
|
1864
|
+
value: ke(e.draft.updatedAt)
|
|
1864
1865
|
},
|
|
1865
1866
|
{
|
|
1866
1867
|
label: "Updated by",
|
|
@@ -1868,7 +1869,7 @@ const Da = Dt(
|
|
|
1868
1869
|
},
|
|
1869
1870
|
{
|
|
1870
1871
|
label: "Effective at",
|
|
1871
|
-
value:
|
|
1872
|
+
value: ke(e.draft.effectiveAt ?? ze((s = e.draft) == null ? void 0 : s._id))
|
|
1872
1873
|
},
|
|
1873
1874
|
{
|
|
1874
1875
|
label: "Using template",
|
|
@@ -1878,20 +1879,20 @@ const Da = Dt(
|
|
|
1878
1879
|
label: "Remark",
|
|
1879
1880
|
value: e.draft.remark
|
|
1880
1881
|
} : null,
|
|
1881
|
-
|
|
1882
|
+
c ? {
|
|
1882
1883
|
label: "Last action",
|
|
1883
|
-
value:
|
|
1884
|
+
value: c.action
|
|
1884
1885
|
} : null,
|
|
1885
|
-
|
|
1886
|
+
c && c.actionBy ? {
|
|
1886
1887
|
label: "Last action by",
|
|
1887
|
-
value: (m =
|
|
1888
|
+
value: (m = c.actionBy) == null ? void 0 : m.name
|
|
1888
1889
|
} : null,
|
|
1889
|
-
|
|
1890
|
+
c && c.remark ? {
|
|
1890
1891
|
label: "Action remark",
|
|
1891
|
-
value:
|
|
1892
|
+
value: c.remark
|
|
1892
1893
|
} : null
|
|
1893
1894
|
].filter((b) => b).map((b) => b);
|
|
1894
|
-
}),
|
|
1895
|
+
}), we = [
|
|
1895
1896
|
{
|
|
1896
1897
|
label: "Overview",
|
|
1897
1898
|
value: "overview"
|
|
@@ -1900,32 +1901,32 @@ const Da = Dt(
|
|
|
1900
1901
|
label: "Action history",
|
|
1901
1902
|
value: "history"
|
|
1902
1903
|
}
|
|
1903
|
-
], _e =
|
|
1904
|
+
], _e = Y(we[0]), Se = R(() => {
|
|
1904
1905
|
var s, l, m;
|
|
1905
|
-
const
|
|
1906
|
+
const c = ((s = e.draft) == null ? void 0 : s.activityLogs) ?? [], a = ((l = e.draft) == null ? void 0 : l.rejectionHistory) ?? [];
|
|
1906
1907
|
for (const b of a)
|
|
1907
|
-
|
|
1908
|
+
c.find(
|
|
1908
1909
|
(S) => `${S.action}_${S.performedAt}` == `${Z.enum.rejectDraft}_${b.rejectedAt}`
|
|
1909
|
-
) ||
|
|
1910
|
+
) || c.push({
|
|
1910
1911
|
action: Z.enum.rejectDraft,
|
|
1911
1912
|
performedAt: b.rejectedAt,
|
|
1912
1913
|
performedBy: b.rejectedBy,
|
|
1913
1914
|
remark: b.rejectRemark
|
|
1914
1915
|
});
|
|
1915
|
-
return (m = e.draft) != null && m.approvedAt && (
|
|
1916
|
+
return (m = e.draft) != null && m.approvedAt && (c.find(
|
|
1916
1917
|
(B) => {
|
|
1917
1918
|
var S;
|
|
1918
1919
|
return `${B.action}_${B.performedAt}` == `${Z.enum.approveDraft}_${(S = e.draft) == null ? void 0 : S.approvedAt}`;
|
|
1919
1920
|
}
|
|
1920
|
-
) ||
|
|
1921
|
+
) || c.push({
|
|
1921
1922
|
action: Z.enum.approveDraft,
|
|
1922
1923
|
performedAt: e.draft.approvedAt,
|
|
1923
1924
|
performedBy: e.draft.approvedBy ?? { name: "Unknown", id: "unknown" },
|
|
1924
1925
|
remark: e.draft.approveRemark
|
|
1925
|
-
})),
|
|
1926
|
+
})), c.sort((b, B) => new Date(B.performedAt).getTime() - new Date(b.performedAt).getTime()).map(
|
|
1926
1927
|
(b) => ({
|
|
1927
|
-
header:
|
|
1928
|
-
date:
|
|
1928
|
+
header: He(b.action),
|
|
1929
|
+
date: ke(b.performedAt),
|
|
1929
1930
|
info: [
|
|
1930
1931
|
{
|
|
1931
1932
|
label: "Performed by",
|
|
@@ -1938,132 +1939,138 @@ const Da = Dt(
|
|
|
1938
1939
|
]
|
|
1939
1940
|
})
|
|
1940
1941
|
);
|
|
1941
|
-
}),
|
|
1942
|
-
var
|
|
1943
|
-
return ((
|
|
1942
|
+
}), Ve = Y(!1), Pe = Y(!1), ot = R(() => {
|
|
1943
|
+
var c;
|
|
1944
|
+
return ((c = e.draft) == null ? void 0 : c.status) !== he.enum.DRAFT ? "Status is not draft." : null;
|
|
1944
1945
|
});
|
|
1945
|
-
function
|
|
1946
|
+
function It() {
|
|
1946
1947
|
e.draft && (Pe.value = !0, h.approveDraft(
|
|
1947
1948
|
e.draft,
|
|
1948
1949
|
() => {
|
|
1949
|
-
Pe.value = !1,
|
|
1950
|
+
Pe.value = !1, Ve.value = !1, g("submitted");
|
|
1950
1951
|
},
|
|
1951
1952
|
() => {
|
|
1952
1953
|
Pe.value = !1;
|
|
1953
1954
|
}
|
|
1954
1955
|
));
|
|
1955
1956
|
}
|
|
1956
|
-
return (
|
|
1957
|
-
const p = K("FmButtonGroup"), s = K("FmMenuDivider"), l = K("FmCard"), m = K("FmButton"), b = K("FmCircularProgress"), B = K("FmChip"), S = K("FmTextField"), L = K("FmIcon"), N = K("FmTable"),
|
|
1958
|
-
return x(), P(
|
|
1959
|
-
k(
|
|
1957
|
+
return (c, a) => {
|
|
1958
|
+
const p = K("FmButtonGroup"), s = K("FmMenuDivider"), l = K("FmCard"), m = K("FmButton"), b = K("FmCircularProgress"), B = K("FmChip"), S = K("FmTextField"), L = K("FmIcon"), N = K("FmTable"), me = K("FmSpacer"), pe = K("FmTooltip"), xe = K("FmSideSheet");
|
|
1959
|
+
return x(), P(ce, null, [
|
|
1960
|
+
k(xe, {
|
|
1960
1961
|
"dismiss-away": "",
|
|
1961
1962
|
"max-width": 9999,
|
|
1962
|
-
"model-value": v(
|
|
1963
|
-
"onUpdate:modelValue": a[9] || (a[9] = (T) =>
|
|
1963
|
+
"model-value": v(y),
|
|
1964
|
+
"onUpdate:modelValue": a[9] || (a[9] = (T) => ht(y) ? y.value = T : null),
|
|
1964
1965
|
header: "Closing details"
|
|
1965
1966
|
}, {
|
|
1966
|
-
"side-sheet-footer":
|
|
1967
|
-
var T, ae,
|
|
1967
|
+
"side-sheet-footer": Q(() => {
|
|
1968
|
+
var T, ae, ie, ye;
|
|
1968
1969
|
return [
|
|
1969
|
-
n("div",
|
|
1970
|
-
(
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1970
|
+
n("div", Dn, [
|
|
1971
|
+
n("div", An, [
|
|
1972
|
+
((T = e.draft) == null ? void 0 : T.status) === v(he).enum.DRAFT ? (x(), P(ce, { key: 0 }, [
|
|
1973
|
+
ot.value ? (x(), fe(pe, {
|
|
1974
|
+
key: 0,
|
|
1975
|
+
"z-index": 51,
|
|
1976
|
+
placement: "right"
|
|
1977
|
+
}, {
|
|
1978
|
+
content: Q(() => [
|
|
1979
|
+
ue(W(ot.value), 1)
|
|
1980
|
+
]),
|
|
1981
|
+
default: Q(() => [
|
|
1982
|
+
k(m, {
|
|
1983
|
+
disabled: "",
|
|
1984
|
+
key: "approve key",
|
|
1985
|
+
label: "Approve"
|
|
1986
|
+
})
|
|
1987
|
+
]),
|
|
1988
|
+
_: 1
|
|
1989
|
+
})) : (x(), fe(m, {
|
|
1990
|
+
key: "approve key",
|
|
1991
|
+
label: "Approve",
|
|
1992
|
+
onClick: a[5] || (a[5] = (Fe) => Ve.value = !0)
|
|
1993
|
+
}))
|
|
1994
|
+
], 64)) : ne("", !0),
|
|
1995
|
+
((ae = e.draft) == null ? void 0 : ae.status) === v(he).enum.DRAFT ? (x(), fe(m, {
|
|
1996
|
+
key: 1,
|
|
1997
|
+
label: "Reject",
|
|
1998
|
+
variant: "destructive",
|
|
1999
|
+
onClick: a[6] || (a[6] = () => e.draft && v(h).rejectDraft(e.draft, () => g("submitted")))
|
|
2000
|
+
})) : ne("", !0),
|
|
2001
|
+
k(m, {
|
|
2002
|
+
label: "Close",
|
|
2003
|
+
variant: "tertiary",
|
|
2004
|
+
onClick: a[7] || (a[7] = (Fe) => y.value = !1)
|
|
2005
|
+
}),
|
|
2006
|
+
(ie = e.draft) != null && ie.approvedAt && ((ye = e.draft) == null ? void 0 : ye.status) !== v(he).enum.COMPLETED ? (x(), fe(yt, { key: 2 }, {
|
|
2007
|
+
default: Q(() => [
|
|
1980
2008
|
k(m, {
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
2009
|
+
label: "Sync",
|
|
2010
|
+
loading: U.value,
|
|
2011
|
+
onClick: a[8] || (a[8] = () => {
|
|
2012
|
+
e.draft && (U.value = !0, v(h).syncDraft(e.draft, () => {
|
|
2013
|
+
U.value = !1, g("submitted");
|
|
2014
|
+
}));
|
|
2015
|
+
})
|
|
2016
|
+
}, null, 8, ["loading"])
|
|
1985
2017
|
]),
|
|
1986
2018
|
_: 1
|
|
1987
|
-
})) : (
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
]
|
|
1993
|
-
((ae = e.draft) == null ? void 0 : ae.status) === v(he).enum.DRAFT ? (x(), me(m, {
|
|
1994
|
-
key: 1,
|
|
1995
|
-
label: "Reject",
|
|
1996
|
-
variant: "destructive",
|
|
1997
|
-
onClick: a[6] || (a[6] = () => e.draft && v(h).rejectDraft(e.draft, () => y("submitted")))
|
|
1998
|
-
})) : ne("", !0),
|
|
1999
|
-
(le = e.draft) != null && le.approvedAt && ((ge = e.draft) == null ? void 0 : ge.status) !== v(he).enum.COMPLETED ? (x(), me(vt, { key: 2 }, {
|
|
2000
|
-
default: q(() => [
|
|
2001
|
-
k(m, {
|
|
2002
|
-
label: "Sync",
|
|
2003
|
-
loading: U.value,
|
|
2004
|
-
onClick: a[7] || (a[7] = () => {
|
|
2005
|
-
e.draft && (U.value = !0, v(h).syncDraft(e.draft, () => {
|
|
2006
|
-
U.value = !1, y("submitted");
|
|
2007
|
-
}));
|
|
2008
|
-
})
|
|
2009
|
-
}, null, 8, ["loading"])
|
|
2010
|
-
]),
|
|
2011
|
-
_: 1
|
|
2012
|
-
})) : ne("", !0),
|
|
2013
|
-
k(m, {
|
|
2014
|
-
label: "Close",
|
|
2015
|
-
variant: "tertiary",
|
|
2016
|
-
onClick: a[8] || (a[8] = (Se) => g.value = !1)
|
|
2017
|
-
})
|
|
2019
|
+
})) : ne("", !0)
|
|
2020
|
+
]),
|
|
2021
|
+
n("div", wn, [
|
|
2022
|
+
a[19] || (a[19] = n("div", { class: "text-xs text-gray-500 uppercase tracking-wide" }, " Total stock take value ", -1)),
|
|
2023
|
+
n("div", Sn, W(d.value) + " " + W(se.value.toFixed(2)), 1)
|
|
2024
|
+
])
|
|
2018
2025
|
])
|
|
2019
2026
|
];
|
|
2020
2027
|
}),
|
|
2021
|
-
default:
|
|
2022
|
-
n("div",
|
|
2028
|
+
default: Q(() => [
|
|
2029
|
+
n("div", za, [
|
|
2023
2030
|
n("div", null, [
|
|
2024
2031
|
k(p, {
|
|
2025
|
-
items:
|
|
2032
|
+
items: we,
|
|
2026
2033
|
modelValue: _e.value,
|
|
2027
2034
|
"onUpdate:modelValue": a[0] || (a[0] = (T) => _e.value = T)
|
|
2028
2035
|
}, null, 8, ["modelValue"])
|
|
2029
2036
|
]),
|
|
2030
|
-
_e.value.value === "overview" ? (x(), P(
|
|
2037
|
+
_e.value.value === "overview" ? (x(), P(ce, { key: 0 }, [
|
|
2031
2038
|
k(l, {
|
|
2032
2039
|
variant: "outlined",
|
|
2033
2040
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
2034
2041
|
}, {
|
|
2035
|
-
default:
|
|
2042
|
+
default: Q(() => {
|
|
2036
2043
|
var T, ae;
|
|
2037
2044
|
return [
|
|
2038
|
-
n("div",
|
|
2045
|
+
n("div", Ha, [
|
|
2039
2046
|
a[11] || (a[11] = n("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
|
|
2040
|
-
n("div",
|
|
2047
|
+
n("div", Oa, [
|
|
2041
2048
|
n("div", {
|
|
2042
|
-
class:
|
|
2043
|
-
},
|
|
2049
|
+
class: Be(["fm-status-badge", v(Oe)(((T = c.draft) == null ? void 0 : T.status) ?? "DRAFT")])
|
|
2050
|
+
}, W(v(He)(((ae = c.draft) == null ? void 0 : ae.status) ?? "")), 3)
|
|
2044
2051
|
])
|
|
2045
2052
|
]),
|
|
2046
2053
|
k(s),
|
|
2047
|
-
n("div",
|
|
2048
|
-
(x(!0), P(
|
|
2054
|
+
n("div", Ka, [
|
|
2055
|
+
(x(!0), P(ce, null, $e(Ae.value, (ie, ye) => (x(), P("div", {
|
|
2049
2056
|
class: "flex flex-col gap-4",
|
|
2050
|
-
key:
|
|
2057
|
+
key: ye
|
|
2051
2058
|
}, [
|
|
2052
|
-
n("div",
|
|
2053
|
-
n("div",
|
|
2059
|
+
n("div", Ya, [
|
|
2060
|
+
n("div", Qa, W(ie.label), 1)
|
|
2054
2061
|
]),
|
|
2055
|
-
n("div",
|
|
2062
|
+
n("div", qa, W(ie.value), 1)
|
|
2056
2063
|
]))), 128))
|
|
2057
2064
|
])
|
|
2058
2065
|
];
|
|
2059
2066
|
}),
|
|
2060
2067
|
_: 1
|
|
2061
2068
|
}),
|
|
2062
|
-
n("div",
|
|
2063
|
-
n("div",
|
|
2069
|
+
n("div", Ga, [
|
|
2070
|
+
n("div", Wa, [
|
|
2064
2071
|
a[12] || (a[12] = n("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
|
|
2065
|
-
f.value ? ne("", !0) : (x(), P("div",
|
|
2066
|
-
|
|
2072
|
+
f.value ? ne("", !0) : (x(), P("div", Za, [
|
|
2073
|
+
c.draft && c.draft.status !== v(he).enum.COMPLETED ? (x(), fe(m, {
|
|
2067
2074
|
key: 0,
|
|
2068
2075
|
label: "Refresh balance",
|
|
2069
2076
|
"prepend-icon": "refresh",
|
|
@@ -2072,10 +2079,10 @@ const Da = Dt(
|
|
|
2072
2079
|
"bg-color": "transparent",
|
|
2073
2080
|
"border-color": "primary",
|
|
2074
2081
|
loading: M.value,
|
|
2075
|
-
onClick:
|
|
2082
|
+
onClick: D
|
|
2076
2083
|
}, null, 8, ["loading"])) : ne("", !0),
|
|
2077
|
-
k(
|
|
2078
|
-
default:
|
|
2084
|
+
k(yt, null, {
|
|
2085
|
+
default: Q(() => [
|
|
2079
2086
|
k(m, {
|
|
2080
2087
|
label: "Invalidate Draft Cache",
|
|
2081
2088
|
"prepend-icon": "refresh",
|
|
@@ -2096,26 +2103,26 @@ const Da = Dt(
|
|
|
2096
2103
|
"text-color": "primary",
|
|
2097
2104
|
"bg-color": "transparent",
|
|
2098
2105
|
"border-color": "primary",
|
|
2099
|
-
onClick: a[1] || (a[1] = (T) =>
|
|
2100
|
-
|
|
2101
|
-
|
|
2106
|
+
onClick: a[1] || (a[1] = (T) => c.draft ? v(h).exportDraft(
|
|
2107
|
+
c.draft,
|
|
2108
|
+
V.value,
|
|
2102
2109
|
_.value
|
|
2103
2110
|
) : null)
|
|
2104
2111
|
})
|
|
2105
2112
|
]))
|
|
2106
2113
|
]),
|
|
2107
|
-
f.value ? (x(), P("div",
|
|
2114
|
+
f.value ? (x(), P("div", Ja, [
|
|
2108
2115
|
a[14] || (a[14] = n("div", { class: "h-80" }, null, -1)),
|
|
2109
|
-
n("div",
|
|
2116
|
+
n("div", Xa, [
|
|
2110
2117
|
n("div", null, [
|
|
2111
2118
|
k(b, { size: "md" })
|
|
2112
2119
|
]),
|
|
2113
2120
|
a[13] || (a[13] = n("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fetching info... ", -1))
|
|
2114
2121
|
]),
|
|
2115
2122
|
a[15] || (a[15] = n("div", { class: "h-80" }, null, -1))
|
|
2116
|
-
])) : (x(), P(
|
|
2117
|
-
n("div",
|
|
2118
|
-
n("div",
|
|
2123
|
+
])) : (x(), P(ce, { key: 1 }, [
|
|
2124
|
+
n("div", en, [
|
|
2125
|
+
n("div", tn, [
|
|
2119
2126
|
k(B, {
|
|
2120
2127
|
label: "Template Item(s)",
|
|
2121
2128
|
selected: i.value.templateItem,
|
|
@@ -2128,61 +2135,61 @@ const Da = Dt(
|
|
|
2128
2135
|
}, null, 8, ["selected"])
|
|
2129
2136
|
]),
|
|
2130
2137
|
k(S, {
|
|
2131
|
-
modelValue:
|
|
2132
|
-
"onUpdate:modelValue": a[4] || (a[4] = (T) =>
|
|
2138
|
+
modelValue: De.value,
|
|
2139
|
+
"onUpdate:modelValue": a[4] || (a[4] = (T) => De.value = T),
|
|
2133
2140
|
placeholder: "Filter items"
|
|
2134
2141
|
}, null, 8, ["modelValue"])
|
|
2135
2142
|
]),
|
|
2136
|
-
v(t).skuTags.size ? (x(), P("div",
|
|
2137
|
-
(x(!0), P(
|
|
2143
|
+
v(t).skuTags.size ? (x(), P("div", an, [
|
|
2144
|
+
(x(!0), P(ce, null, $e(v(t).skuTags.keys(), (T) => (x(), fe(B, {
|
|
2138
2145
|
key: `${T}`,
|
|
2139
2146
|
label: `${T}`,
|
|
2140
2147
|
selectable: "",
|
|
2141
2148
|
selected: I[`${T}`],
|
|
2142
2149
|
onClick: (ae) => I[`${T}`] = !I[`${T}`]
|
|
2143
2150
|
}, {
|
|
2144
|
-
default:
|
|
2145
|
-
I[`${T}`] ? (x(),
|
|
2151
|
+
default: Q(() => [
|
|
2152
|
+
I[`${T}`] ? (x(), fe(L, {
|
|
2146
2153
|
key: 0,
|
|
2147
2154
|
name: "check",
|
|
2148
2155
|
class: "text-white",
|
|
2149
2156
|
size: "sm"
|
|
2150
2157
|
})) : ne("", !0),
|
|
2151
2158
|
n("span", {
|
|
2152
|
-
class:
|
|
2159
|
+
class: Be([
|
|
2153
2160
|
"",
|
|
2154
2161
|
{
|
|
2155
2162
|
"text-white fm-typo-en-body-md-600": I[`${T}`],
|
|
2156
2163
|
"text-fm-color-typo-primary fm-typo-en-body-md-400": !I[`${T}`]
|
|
2157
2164
|
}
|
|
2158
2165
|
])
|
|
2159
|
-
},
|
|
2166
|
+
}, W(T), 3)
|
|
2160
2167
|
]),
|
|
2161
2168
|
_: 2
|
|
2162
2169
|
}, 1032, ["label", "selected", "onClick"]))), 128))
|
|
2163
2170
|
])) : ne("", !0),
|
|
2164
|
-
n("div",
|
|
2171
|
+
n("div", nn, [
|
|
2165
2172
|
n("div", {
|
|
2166
|
-
style:
|
|
2173
|
+
style: kt({ height: "600px", minWidth: `${Re.value}px` })
|
|
2167
2174
|
}, [
|
|
2168
2175
|
k(N, {
|
|
2169
|
-
"column-defs":
|
|
2170
|
-
"row-data":
|
|
2171
|
-
"search-value":
|
|
2176
|
+
"column-defs": Te.value,
|
|
2177
|
+
"row-data": je.value,
|
|
2178
|
+
"search-value": De.value
|
|
2172
2179
|
}, null, 8, ["column-defs", "row-data", "search-value"])
|
|
2173
2180
|
], 4)
|
|
2174
2181
|
])
|
|
2175
2182
|
], 64))
|
|
2176
2183
|
])
|
|
2177
2184
|
], 64)) : ne("", !0),
|
|
2178
|
-
_e.value.value === "history" ? (x(), P("div",
|
|
2179
|
-
|
|
2180
|
-
(x(!0), P(
|
|
2181
|
-
n("div",
|
|
2182
|
-
n("div",
|
|
2183
|
-
n("div",
|
|
2185
|
+
_e.value.value === "history" ? (x(), P("div", on, [
|
|
2186
|
+
Se.value.length ? (x(), P("div", ln, [
|
|
2187
|
+
(x(!0), P(ce, null, $e(Se.value, (T, ae) => (x(), P(ce, { key: ae }, [
|
|
2188
|
+
n("div", cn, [
|
|
2189
|
+
n("div", un, [
|
|
2190
|
+
n("div", dn, [
|
|
2184
2191
|
n("div", {
|
|
2185
|
-
class:
|
|
2192
|
+
class: Be([
|
|
2186
2193
|
{
|
|
2187
2194
|
"bg-fm-color-primary": ae !== 0,
|
|
2188
2195
|
"bg-white": ae === 0
|
|
@@ -2192,54 +2199,54 @@ const Da = Dt(
|
|
|
2192
2199
|
}, null, 2)
|
|
2193
2200
|
]),
|
|
2194
2201
|
a[18] || (a[18] = n("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
2195
|
-
n("div",
|
|
2202
|
+
n("div", mn, [
|
|
2196
2203
|
n("div", {
|
|
2197
|
-
class:
|
|
2204
|
+
class: Be([
|
|
2198
2205
|
{
|
|
2199
|
-
"bg-fm-color-primary": ae <
|
|
2200
|
-
"bg-white": ae >=
|
|
2206
|
+
"bg-fm-color-primary": ae < Se.value.length - 1,
|
|
2207
|
+
"bg-white": ae >= Se.value.length - 1
|
|
2201
2208
|
},
|
|
2202
2209
|
"w-[2px] h-full"
|
|
2203
2210
|
])
|
|
2204
2211
|
}, null, 2)
|
|
2205
2212
|
])
|
|
2206
2213
|
]),
|
|
2207
|
-
n("div",
|
|
2208
|
-
n("div",
|
|
2209
|
-
n("div",
|
|
2214
|
+
n("div", fn, [
|
|
2215
|
+
n("div", pn, W(T.header), 1),
|
|
2216
|
+
n("div", vn, W(T.date), 1)
|
|
2210
2217
|
])
|
|
2211
2218
|
]),
|
|
2212
|
-
n("div",
|
|
2219
|
+
n("div", gn, [
|
|
2213
2220
|
n("div", yn, [
|
|
2214
|
-
n("div",
|
|
2221
|
+
n("div", bn, [
|
|
2215
2222
|
n("div", {
|
|
2216
|
-
class:
|
|
2223
|
+
class: Be([
|
|
2217
2224
|
{
|
|
2218
|
-
"bg-fm-color-primary": ae <
|
|
2219
|
-
"bg-white": ae >=
|
|
2225
|
+
"bg-fm-color-primary": ae < Se.value.length - 1,
|
|
2226
|
+
"bg-white": ae >= Se.value.length - 1
|
|
2220
2227
|
},
|
|
2221
2228
|
"w-[2px] h-full"
|
|
2222
2229
|
])
|
|
2223
2230
|
}, null, 2)
|
|
2224
2231
|
])
|
|
2225
2232
|
]),
|
|
2226
|
-
n("div",
|
|
2233
|
+
n("div", hn, [
|
|
2227
2234
|
k(l, {
|
|
2228
2235
|
variant: "outlined",
|
|
2229
2236
|
class: "py-12 px-16"
|
|
2230
2237
|
}, {
|
|
2231
|
-
default:
|
|
2232
|
-
n("div",
|
|
2233
|
-
(x(!0), P(
|
|
2234
|
-
key:
|
|
2238
|
+
default: Q(() => [
|
|
2239
|
+
n("div", kn, [
|
|
2240
|
+
(x(!0), P(ce, null, $e(T.info, (ie, ye) => (x(), P("div", {
|
|
2241
|
+
key: ye,
|
|
2235
2242
|
class: "flex flex-col gap-4"
|
|
2236
2243
|
}, [
|
|
2237
|
-
n("div",
|
|
2238
|
-
n("div",
|
|
2239
|
-
(x(!0), P(
|
|
2240
|
-
key:
|
|
2244
|
+
n("div", _n, W(ie == null ? void 0 : ie.label), 1),
|
|
2245
|
+
n("div", xn, [
|
|
2246
|
+
(x(!0), P(ce, null, $e(ie == null ? void 0 : ie.values, (Fe, Me) => (x(), P("div", {
|
|
2247
|
+
key: Me,
|
|
2241
2248
|
class: "fm-typo-en-body-lg-600"
|
|
2242
|
-
},
|
|
2249
|
+
}, W(Fe), 1))), 128))
|
|
2243
2250
|
])
|
|
2244
2251
|
]))), 128))
|
|
2245
2252
|
])
|
|
@@ -2249,44 +2256,44 @@ const Da = Dt(
|
|
|
2249
2256
|
])
|
|
2250
2257
|
])
|
|
2251
2258
|
], 64))), 128))
|
|
2252
|
-
])) : (x(), P("div",
|
|
2253
|
-
k(
|
|
2259
|
+
])) : (x(), P("div", sn, [
|
|
2260
|
+
k(me),
|
|
2254
2261
|
n("div", null, [
|
|
2255
2262
|
n("img", {
|
|
2256
|
-
src: v(
|
|
2263
|
+
src: v(oa),
|
|
2257
2264
|
alt: "List is empty"
|
|
2258
|
-
}, null, 8,
|
|
2265
|
+
}, null, 8, rn)
|
|
2259
2266
|
]),
|
|
2260
|
-
a[16] || (a[16] = n("div", { class: "fm-typo-en-body-lg-600" },
|
|
2261
|
-
a[17] || (a[17] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" },
|
|
2262
|
-
k(
|
|
2263
|
-
k(
|
|
2267
|
+
a[16] || (a[16] = n("div", { class: "fm-typo-en-body-lg-600" }, W("No records found"), -1)),
|
|
2268
|
+
a[17] || (a[17] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, W("You can track approval and rejection history here"), -1)),
|
|
2269
|
+
k(me),
|
|
2270
|
+
k(me)
|
|
2264
2271
|
]))
|
|
2265
2272
|
])) : ne("", !0)
|
|
2266
2273
|
])
|
|
2267
2274
|
]),
|
|
2268
2275
|
_: 1
|
|
2269
2276
|
}, 8, ["model-value"]),
|
|
2270
|
-
v(
|
|
2277
|
+
v(y) && e.draft ? (x(), fe(Ea, {
|
|
2271
2278
|
key: 0,
|
|
2272
|
-
show:
|
|
2273
|
-
"onUpdate:show": a[10] || (a[10] = (T) =>
|
|
2279
|
+
show: Ve.value,
|
|
2280
|
+
"onUpdate:show": a[10] || (a[10] = (T) => Ve.value = T),
|
|
2274
2281
|
refreshing: M.value,
|
|
2275
2282
|
approving: Pe.value,
|
|
2276
2283
|
draft: e.draft,
|
|
2277
|
-
onRefresh:
|
|
2278
|
-
onApprove:
|
|
2284
|
+
onRefresh: D,
|
|
2285
|
+
onApprove: It
|
|
2279
2286
|
}, null, 8, ["show", "refreshing", "approving", "draft"])) : ne("", !0)
|
|
2280
2287
|
], 64);
|
|
2281
2288
|
};
|
|
2282
2289
|
}
|
|
2283
|
-
}),
|
|
2290
|
+
}), $n = { class: "flex-1 flex flex-col gap-8" }, Bn = { class: "flex flex-col" }, Tn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, jn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, In = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Un = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, to = /* @__PURE__ */ Ue({
|
|
2284
2291
|
__name: "ClosingDraftView",
|
|
2285
|
-
setup(
|
|
2286
|
-
const { t: o } =
|
|
2287
|
-
|
|
2288
|
-
const
|
|
2289
|
-
function
|
|
2292
|
+
setup(u) {
|
|
2293
|
+
const { t: o } = et(), { viewDraft: e } = Ye(), { viewClosingDraftProps: d, viewClosingDraftShow: h } = qt(Ye()), y = Qe(), f = Aa(), M = Et(), { breakpoints: U } = Kt();
|
|
2294
|
+
y.watchLocation(f.fetchDrafts);
|
|
2295
|
+
const V = R(() => f.loading), _ = Y(""), E = R(() => U.value.xs || U.value.sm), j = R(() => E.value ? 10 : 20);
|
|
2296
|
+
function q(C) {
|
|
2290
2297
|
switch (C) {
|
|
2291
2298
|
case "refresh":
|
|
2292
2299
|
return f.fetchDrafts();
|
|
@@ -2295,7 +2302,7 @@ const Da = Dt(
|
|
|
2295
2302
|
function r(C) {
|
|
2296
2303
|
return C;
|
|
2297
2304
|
}
|
|
2298
|
-
const t =
|
|
2305
|
+
const t = R(() => E.value ? [
|
|
2299
2306
|
{
|
|
2300
2307
|
label: o("inventory.common.refresh"),
|
|
2301
2308
|
value: "refresh",
|
|
@@ -2309,16 +2316,16 @@ const Da = Dt(
|
|
|
2309
2316
|
}
|
|
2310
2317
|
]);
|
|
2311
2318
|
return (C, I) => {
|
|
2312
|
-
const
|
|
2313
|
-
return x(), P(
|
|
2314
|
-
k(
|
|
2319
|
+
const G = K("FmTable");
|
|
2320
|
+
return x(), P(ce, null, [
|
|
2321
|
+
k(zt, {
|
|
2315
2322
|
title: v(o)("inventory.closing.draft.title"),
|
|
2316
2323
|
actions: t.value,
|
|
2317
|
-
"onClick:action":
|
|
2324
|
+
"onClick:action": q
|
|
2318
2325
|
}, {
|
|
2319
|
-
default:
|
|
2326
|
+
default: Q(() => [
|
|
2320
2327
|
n("div", {
|
|
2321
|
-
class:
|
|
2328
|
+
class: Be([
|
|
2322
2329
|
"flex flex-col gap-8 max-h-full",
|
|
2323
2330
|
{
|
|
2324
2331
|
"p-0": E.value,
|
|
@@ -2326,58 +2333,58 @@ const Da = Dt(
|
|
|
2326
2333
|
}
|
|
2327
2334
|
])
|
|
2328
2335
|
}, [
|
|
2329
|
-
k(
|
|
2336
|
+
k(na, {
|
|
2330
2337
|
"change-location": "",
|
|
2331
2338
|
searchable: "",
|
|
2332
2339
|
search: _.value,
|
|
2333
|
-
"onUpdate:search": I[0] || (I[0] = (
|
|
2340
|
+
"onUpdate:search": I[0] || (I[0] = (g) => _.value = g)
|
|
2334
2341
|
}, null, 8, ["search"]),
|
|
2335
|
-
k(
|
|
2336
|
-
style:
|
|
2342
|
+
k(G, {
|
|
2343
|
+
style: kt(v(M).tableHeight),
|
|
2337
2344
|
"column-defs": v(f).columnDefs,
|
|
2338
2345
|
"row-data": v(f).drafts,
|
|
2339
2346
|
"search-value": _.value,
|
|
2340
|
-
loading:
|
|
2341
|
-
onRowClick: I[1] || (I[1] = (
|
|
2347
|
+
loading: V.value,
|
|
2348
|
+
onRowClick: I[1] || (I[1] = (g) => v(e)(g.original)),
|
|
2342
2349
|
"page-size": j.value
|
|
2343
2350
|
}, {
|
|
2344
|
-
"list-row":
|
|
2345
|
-
k(
|
|
2346
|
-
row:
|
|
2351
|
+
"list-row": Q((g) => [
|
|
2352
|
+
k(ra, {
|
|
2353
|
+
row: g,
|
|
2347
2354
|
onRowClick: (i) => v(e)(i)
|
|
2348
2355
|
}, {
|
|
2349
|
-
default:
|
|
2350
|
-
var $, H,
|
|
2356
|
+
default: Q((i) => {
|
|
2357
|
+
var $, H, ee, se, w, te, de, D, A, J, O, re, le, X, Te, Re, De, je, Ae, we;
|
|
2351
2358
|
return [
|
|
2352
|
-
n("div",
|
|
2353
|
-
n("div",
|
|
2354
|
-
n("div",
|
|
2355
|
-
k(v(
|
|
2356
|
-
render: (
|
|
2357
|
-
props: (w = (
|
|
2359
|
+
n("div", $n, [
|
|
2360
|
+
n("div", Bn, [
|
|
2361
|
+
n("div", Tn, [
|
|
2362
|
+
k(v(Ne), {
|
|
2363
|
+
render: (ee = (H = ($ = i._id) == null ? void 0 : $.column) == null ? void 0 : H.columnDef) == null ? void 0 : ee.cell,
|
|
2364
|
+
props: (w = (se = i._id) == null ? void 0 : se.getContext) == null ? void 0 : w.call(se)
|
|
2358
2365
|
}, null, 8, ["render", "props"])
|
|
2359
2366
|
]),
|
|
2360
|
-
n("div",
|
|
2361
|
-
k(v(
|
|
2362
|
-
render: (
|
|
2363
|
-
props: (J = (
|
|
2367
|
+
n("div", jn, [
|
|
2368
|
+
k(v(Ne), {
|
|
2369
|
+
render: (D = (de = (te = i.name) == null ? void 0 : te.column) == null ? void 0 : de.columnDef) == null ? void 0 : D.cell,
|
|
2370
|
+
props: (J = (A = i.name) == null ? void 0 : A.getContext) == null ? void 0 : J.call(A)
|
|
2364
2371
|
}, null, 8, ["render", "props"])
|
|
2365
2372
|
]),
|
|
2366
|
-
n("div",
|
|
2367
|
-
...
|
|
2368
|
-
...
|
|
2373
|
+
n("div", In, W([
|
|
2374
|
+
...g.original.items.slice(0, 3).map((_e) => _e.sku.name),
|
|
2375
|
+
...g.original.items.length >= 3 ? [`and ${g.original.items.length - 3} more items`] : []
|
|
2369
2376
|
].join(", ")), 1),
|
|
2370
|
-
n("div",
|
|
2371
|
-
k(v(
|
|
2372
|
-
render: (
|
|
2373
|
-
props: (
|
|
2377
|
+
n("div", Un, [
|
|
2378
|
+
k(v(Ne), {
|
|
2379
|
+
render: (le = (re = (O = i.ref) == null ? void 0 : O.column) == null ? void 0 : re.columnDef) == null ? void 0 : le.cell,
|
|
2380
|
+
props: (Te = (X = i.ref) == null ? void 0 : X.getContext) == null ? void 0 : Te.call(X)
|
|
2374
2381
|
}, null, 8, ["render", "props"])
|
|
2375
2382
|
])
|
|
2376
2383
|
]),
|
|
2377
2384
|
n("div", null, [
|
|
2378
|
-
k(v(
|
|
2379
|
-
render: (
|
|
2380
|
-
props: (
|
|
2385
|
+
k(v(Ne), {
|
|
2386
|
+
render: (je = (De = (Re = i.status) == null ? void 0 : Re.column) == null ? void 0 : De.columnDef) == null ? void 0 : je.cell,
|
|
2387
|
+
props: (we = (Ae = i.status) == null ? void 0 : Ae.getContext) == null ? void 0 : we.call(Ae)
|
|
2381
2388
|
}, null, 8, ["render", "props"])
|
|
2382
2389
|
])
|
|
2383
2390
|
])
|
|
@@ -2392,12 +2399,12 @@ const Da = Dt(
|
|
|
2392
2399
|
]),
|
|
2393
2400
|
_: 1
|
|
2394
2401
|
}, 8, ["title", "actions"]),
|
|
2395
|
-
(x(),
|
|
2396
|
-
k(
|
|
2402
|
+
(x(), fe(Lt, { to: "body" }, [
|
|
2403
|
+
k(Cn, Nt(v(d), {
|
|
2397
2404
|
show: v(h),
|
|
2398
|
-
"onUpdate:show": I[2] || (I[2] = (
|
|
2405
|
+
"onUpdate:show": I[2] || (I[2] = (g) => ht(h) ? h.value = g : null),
|
|
2399
2406
|
onSubmitted: I[3] || (I[3] = () => (h.value = !1, v(f).fetchDrafts())),
|
|
2400
|
-
onRefresh: I[4] || (I[4] = (
|
|
2407
|
+
onRefresh: I[4] || (I[4] = (g) => v(f).updateDraftRef(g))
|
|
2401
2408
|
}), null, 16, ["show"])
|
|
2402
2409
|
]))
|
|
2403
2410
|
], 64);
|
|
@@ -2405,5 +2412,5 @@ const Da = Dt(
|
|
|
2405
2412
|
}
|
|
2406
2413
|
});
|
|
2407
2414
|
export {
|
|
2408
|
-
|
|
2415
|
+
to as default
|
|
2409
2416
|
};
|