@feedmepos/mf-inventory-portal 0.0.14-dev.1 → 0.0.14-dev.3
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/{ApprovalView-CjDTRn_0.js → ApprovalView-vyyd-8ky.js} +6 -6
- package/dist/{BindingsDialog-BrmtRPs7.js → BindingsDialog-DcF-RsbY.js} +2 -2
- package/dist/{BindingsPicker-RF1LpUQI.js → BindingsPicker-A0B93D12.js} +2 -2
- package/dist/{BindingsTable-J6p4ayCr.js → BindingsTable-BfV873Gq.js} +3 -3
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DhiBtQCZ.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Cpyyj0s9.js} +1 -1
- package/dist/{FmMultiselectDialog.vue_vue_type_script_setup_true_lang-lXG8Dt51.js → FmMultiselectDialog.vue_vue_type_script_setup_true_lang-BwZfE0mj.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-D0CuYd32.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DZx8ZPCG.js} +3 -3
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BGtOiTS_.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BkX1rDxA.js} +1 -1
- package/dist/{IngredientsView-Dp7VJ6y6.js → IngredientsView-Bm0qofWf.js} +6 -6
- package/dist/{IntegrationView-B0EqVrD6.js → IntegrationView-BSWGafuh.js} +3 -3
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DS2k0Mg0.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-FbnVqAv2.js} +6 -6
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DNlqatNB.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Z_TdnV6k.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-CBvso-CS.js → PurchaseOrderPrintPreview-DeMiH8-p.js} +1 -1
- package/dist/ReceiveRequestView-D9NJhUrh.js +1413 -0
- package/dist/{RecipeView-Dom09pTM.js → RecipeView-B-AMUN35.js} +106 -104
- package/dist/{StockView-CKzNbjdc.js → StockView-CHyjj-NE.js} +499 -511
- package/dist/{SupplierView-IoHcN00m.js → SupplierView-BmdDGDZX.js} +7 -7
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-i1th_271.js → TransferDetails.vue_vue_type_script_setup_true_lang-D-XuhHjH.js} +5 -5
- package/dist/{UnitView-DZd-hHZm.js → UnitView-DKc5Vspf.js} +6 -6
- package/dist/{WarehouseView-Ty1DcynD.js → WarehouseView-BNWmpyAE.js} +3 -3
- package/dist/{app-Cnhjho3o.js → app-CGJ9wObA.js} +3 -3
- package/dist/app.js +1 -1
- package/dist/{date2-B7iD1KxI.js → date2-hh1XMrnz.js} +1 -1
- package/dist/{dayjs.min-DQUng8nj.js → dayjs.min-B1c_VH7n.js} +2 -2
- package/dist/{decimal-q0xrbBIn.js → decimal-CYxIGsNP.js} +1 -1
- package/dist/extensions/array.d.ts +6 -0
- package/dist/{fuzzy-c-Ppr3KD.js → fuzzy-ugVwdrtM.js} +1 -1
- package/dist/{init-date-range-DPx7QxBp.js → init-date-range-OQt8Z7z5.js} +1 -1
- package/dist/{layout-CSVgzCIf.js → layout-zKoU02JL.js} +1 -1
- package/dist/{rules-CpJ31qIF.js → rules-7Z3VPm48.js} +1 -1
- package/dist/stock-estimate-DyvbTwBC.js +145 -0
- package/dist/style.css +1 -1
- package/dist/{supplier-B3SkQyN-.js → supplier-y1XBCh6p.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-inventory-binding-dialog-F9I0iH7I.js → use-inventory-binding-dialog-Dq5XLo6y.js} +2 -2
- package/dist/views/receive-request/ReceiveRequestView.vue.d.ts +1 -0
- package/dist/{xlsx-BVwkQrma.js → xlsx-deTTOyZk.js} +1 -1
- package/package.json +3 -3
- package/dist/ReceiveRequestView-BepmuhAx.js +0 -1411
- package/dist/stock-estimate-DwKCk68D.js +0 -122
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { ref as T, defineComponent as oe, computed as
|
|
1
|
+
import { ref as T, defineComponent as oe, computed as U, resolveComponent as $, openBlock as x, createBlock as N, withCtx as B, createElementVNode as e, normalizeClass as fe, toDisplayString as A, createVNode as b, createElementBlock as j, Fragment as ne, renderList as re, unref as C, h as xe, watch as ge, isRef as De, createCommentVNode as Z, reactive as st, onMounted as Me, normalizeStyle as Ge, createTextVNode as ce, Teleport as at, normalizeProps as Se, mergeProps as $e } from "vue";
|
|
2
2
|
import { _ as lt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CFjO4TPG.js";
|
|
3
|
-
import { f as We, e as ue, c as je, u as Re, h as Le, i as te, s as rt, d as Ne, a as it, C as we, I as Je } from "./app-
|
|
3
|
+
import { f as We, e as ue, c as je, u as Re, h as Le, i as te, s as rt, d as Ne, a as it, C as we, I as Je } from "./app-CGJ9wObA.js";
|
|
4
4
|
import { useCoreStore as Qe } from "@feedmepos/mf-common";
|
|
5
|
-
import { useSnackbar as
|
|
6
|
-
import { c as ct, _ as dt, F as Oe, u as mt } from "./layout-
|
|
7
|
-
import { g as he } from "./decimal-
|
|
8
|
-
import { d as pt, F as W } from "./dayjs.min-
|
|
9
|
-
import { e as ft, _ as vt, i as Xe, u as _t } from "./stock-estimate-
|
|
10
|
-
import { _ as yt } from "./ChangeLocationComponent.vue_vue_type_script_setup_true_lang-
|
|
11
|
-
import { g as Be, a as ie, b as gt, t as be, c as
|
|
12
|
-
import { a as Ve, A as At, M as Vt, R as Dt } from "./rules-
|
|
5
|
+
import { useSnackbar as de, useDialog as Ue, useProxiedModel as Ie, useBreakpoints as ut } from "@feedmepos/ui-library";
|
|
6
|
+
import { c as ct, _ as dt, F as Oe, u as mt } from "./layout-zKoU02JL.js";
|
|
7
|
+
import { g as he } from "./decimal-CYxIGsNP.js";
|
|
8
|
+
import { d as pt, F as W } from "./dayjs.min-B1c_VH7n.js";
|
|
9
|
+
import { e as ft, _ as vt, i as Xe, u as _t } from "./stock-estimate-DyvbTwBC.js";
|
|
10
|
+
import { _ as yt } from "./ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Cpyyj0s9.js";
|
|
11
|
+
import { g as Be, a as ie, b as gt, t as be, c as pe, d as ht, e as Ye, h as bt, i as Ze, j as kt, f as et, k as Ae, l as xt, m as St, n as $t, p as wt, o as Ft, q as Ct, r as Bt } from "./date2-hh1XMrnz.js";
|
|
12
|
+
import { a as Ve, A as At, M as Vt, R as Dt } from "./rules-7Z3VPm48.js";
|
|
13
13
|
import { g as tt } from "./util-CEVKTbZD.js";
|
|
14
|
-
import { u as Mt } from "./use-inventory-binding-dialog-
|
|
15
|
-
import { _ as jt } from "./FmMultiselectDialog.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import { _ as Rt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-
|
|
17
|
-
import { i as Ut } from "./init-date-range-
|
|
14
|
+
import { u as Mt } from "./use-inventory-binding-dialog-Dq5XLo6y.js";
|
|
15
|
+
import { _ as jt } from "./FmMultiselectDialog.vue_vue_type_script_setup_true_lang-BwZfE0mj.js";
|
|
16
|
+
import { _ as Rt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Z_TdnV6k.js";
|
|
17
|
+
import { i as Ut } from "./init-date-range-OQt8Z7z5.js";
|
|
18
18
|
import { E as It } from "./empty-placeholder-wf6-BWE8.js";
|
|
19
19
|
import { _ as ze } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-BvadeWUz.js";
|
|
20
|
-
const ve = We((
|
|
21
|
-
const l = ue(), s = Qe(),
|
|
22
|
-
return
|
|
23
|
-
f.name === "SvcForbiddenError" && (
|
|
20
|
+
const ve = We((c, u) => {
|
|
21
|
+
const l = ue(), s = Qe(), S = de();
|
|
22
|
+
return u.onError(async (f) => {
|
|
23
|
+
f.name === "SvcForbiddenError" && (S == null || S.open({
|
|
24
24
|
title: f.title,
|
|
25
25
|
message: f.message,
|
|
26
26
|
type: "error"
|
|
27
27
|
}));
|
|
28
28
|
}), {
|
|
29
29
|
async readStockBalance() {
|
|
30
|
-
const f = l.currentLocationDBName,
|
|
31
|
-
return await
|
|
30
|
+
const f = l.currentLocationDBName, r = `${c.inventoryBackendUrl}/${f}/stock-balance`;
|
|
31
|
+
return await u.get(r);
|
|
32
32
|
},
|
|
33
33
|
async readSkuBalance() {
|
|
34
|
-
var
|
|
35
|
-
const f = l.currentLocationDBName,
|
|
36
|
-
return (((
|
|
34
|
+
var k;
|
|
35
|
+
const f = l.currentLocationDBName, r = `${c.inventoryBackendUrl}/${f}/sku/balance`;
|
|
36
|
+
return (((k = s.currentBusiness.value) == null ? void 0 : k.menuVersion) ?? "") === "v3" ? await u.get(r) : await u.get(`${r}?useInventoryDoc=true`);
|
|
37
37
|
},
|
|
38
38
|
async readSingleAdjustment(f) {
|
|
39
|
-
const
|
|
40
|
-
return await
|
|
39
|
+
const r = l.currentLocationDBName, m = `${c.inventoryBackendUrl}/${r}/adjustment`;
|
|
40
|
+
return await u.get(`${m}?adjustmentId=${f}`);
|
|
41
41
|
},
|
|
42
|
-
async readStockAdjustment(f,
|
|
43
|
-
const
|
|
44
|
-
return await
|
|
42
|
+
async readStockAdjustment(f, r, m) {
|
|
43
|
+
const k = l.currentLocationDBName, v = `${c.inventoryBackendUrl}/${k}/sku`;
|
|
44
|
+
return await u.get(`${v}?skuId=${f}&start=${r}&end=${m}`);
|
|
45
45
|
},
|
|
46
46
|
async convertSku(f) {
|
|
47
47
|
var v;
|
|
48
|
-
const
|
|
49
|
-
return (((v = s.currentBusiness.value) == null ? void 0 : v.menuVersion) ?? "") === "v3" ? await
|
|
48
|
+
const r = l.currentLocationDBName, m = `${c.inventoryBackendUrl}/${r}/sku/convert`;
|
|
49
|
+
return (((v = s.currentBusiness.value) == null ? void 0 : v.menuVersion) ?? "") === "v3" ? await u.post(m, f) : await u.post(`${m}?useInventoryDoc=true`, f);
|
|
50
50
|
},
|
|
51
51
|
async adjustSku(f) {
|
|
52
52
|
var v;
|
|
53
|
-
const
|
|
54
|
-
return (((v = s.currentBusiness.value) == null ? void 0 : v.menuVersion) ?? "") === "v3" ? await
|
|
53
|
+
const r = l.currentLocationDBName, m = `${c.inventoryBackendUrl}/${r}/sku/adjust`;
|
|
54
|
+
return (((v = s.currentBusiness.value) == null ? void 0 : v.menuVersion) ?? "") === "v3" ? await u.post(m, f) : await u.post(`${m}?useInventoryDoc=true`, f);
|
|
55
55
|
},
|
|
56
56
|
recalculation: {
|
|
57
57
|
getRecalculateAbility() {
|
|
58
|
-
var
|
|
59
|
-
const
|
|
60
|
-
return
|
|
58
|
+
var k;
|
|
59
|
+
const r = `business_${(k = s.currentBusiness.value) == null ? void 0 : k._id}`, m = `${c.inventoryBackendUrl}/${r}/stock/operations/recalculate`;
|
|
60
|
+
return u.get(m);
|
|
61
61
|
},
|
|
62
62
|
startRecalculateTask() {
|
|
63
|
-
var
|
|
64
|
-
const
|
|
65
|
-
return
|
|
63
|
+
var k;
|
|
64
|
+
const r = `business_${(k = s.currentBusiness.value) == null ? void 0 : k._id}`, m = `${c.inventoryBackendUrl}/${r}/stock/operations/recalculate?refundFromPreviousAdjustment=true`;
|
|
65
|
+
return u.post(m);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
};
|
|
@@ -77,31 +77,31 @@ function Tt() {
|
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
const _e = T(Tt()), Te = () => {
|
|
80
|
-
const
|
|
80
|
+
const c = ve();
|
|
81
81
|
return {
|
|
82
82
|
// state
|
|
83
83
|
get stockBalance() {
|
|
84
84
|
return _e.value.stockBalance;
|
|
85
85
|
},
|
|
86
|
-
set stockBalance(
|
|
87
|
-
_e.value.stockBalance =
|
|
86
|
+
set stockBalance(u) {
|
|
87
|
+
_e.value.stockBalance = u;
|
|
88
88
|
},
|
|
89
89
|
get productBalance() {
|
|
90
90
|
return _e.value.productBalance;
|
|
91
91
|
},
|
|
92
|
-
set productBalance(
|
|
93
|
-
_e.value.productBalance =
|
|
92
|
+
set productBalance(u) {
|
|
93
|
+
_e.value.productBalance = u;
|
|
94
94
|
},
|
|
95
95
|
// actions
|
|
96
96
|
async readStockBalance() {
|
|
97
|
-
this.stockBalance = await
|
|
97
|
+
this.stockBalance = await c.readStockBalance();
|
|
98
98
|
},
|
|
99
99
|
async readProductBalance() {
|
|
100
|
-
this.productBalance = await
|
|
100
|
+
this.productBalance = await c.readSkuBalance();
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
|
-
var ye = /* @__PURE__ */ ((
|
|
104
|
+
var ye = /* @__PURE__ */ ((c) => (c.History = "History", c.Convert = "Convert", c.Adjust = "Adjust", c))(ye || {});
|
|
105
105
|
const Pt = [
|
|
106
106
|
{
|
|
107
107
|
label: "History",
|
|
@@ -121,7 +121,7 @@ const Pt = [
|
|
|
121
121
|
color: "text-neutral-700"
|
|
122
122
|
}
|
|
123
123
|
];
|
|
124
|
-
async function Ht(
|
|
124
|
+
async function Ht(c) {
|
|
125
125
|
const l = `${(ue().currentLocation.name || "").replace(
|
|
126
126
|
/ /g,
|
|
127
127
|
"_"
|
|
@@ -130,7 +130,7 @@ async function Ht(u) {
|
|
|
130
130
|
[
|
|
131
131
|
{
|
|
132
132
|
name: "stock",
|
|
133
|
-
data:
|
|
133
|
+
data: c,
|
|
134
134
|
columns: [
|
|
135
135
|
{
|
|
136
136
|
name: "Code",
|
|
@@ -143,16 +143,16 @@ async function Ht(u) {
|
|
|
143
143
|
{
|
|
144
144
|
name: "Balance",
|
|
145
145
|
selector: (s) => {
|
|
146
|
-
const
|
|
147
|
-
return
|
|
146
|
+
const S = ke(s, s.unit);
|
|
147
|
+
return S.type === "unit" ? he(s.balance, s.unit, null, !1) : he(s.balance, s.unit, S.measurement, !1);
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
151
|
name: "Unit",
|
|
152
152
|
selector: (s) => {
|
|
153
153
|
var f;
|
|
154
|
-
const
|
|
155
|
-
return
|
|
154
|
+
const S = ke(s, s.unit);
|
|
155
|
+
return S.type === "unit" ? s.unit.abbrev : ((f = s.unit.measurements.find((r) => r.id === S.measurement)) == null ? void 0 : f.abbrev) || "";
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
]
|
|
@@ -161,18 +161,18 @@ async function Ht(u) {
|
|
|
161
161
|
l
|
|
162
162
|
);
|
|
163
163
|
}
|
|
164
|
-
function ke(
|
|
165
|
-
const l = localStorage.getItem(`uom:${
|
|
166
|
-
return l ? l ===
|
|
164
|
+
function ke(c, u) {
|
|
165
|
+
const l = localStorage.getItem(`uom:${c._id}`);
|
|
166
|
+
return l ? l === u._id ? {
|
|
167
167
|
type: "unit"
|
|
168
|
-
} :
|
|
168
|
+
} : u.measurements.find((s) => s.id === l) ? {
|
|
169
169
|
type: "measurement",
|
|
170
170
|
measurement: l
|
|
171
171
|
} : {
|
|
172
172
|
type: "unit"
|
|
173
|
-
} :
|
|
173
|
+
} : c.trackingMeasurement && u.measurements.find((s) => s.id === c.trackingMeasurement) ? {
|
|
174
174
|
type: "measurement",
|
|
175
|
-
measurement:
|
|
175
|
+
measurement: c.trackingMeasurement
|
|
176
176
|
} : {
|
|
177
177
|
type: "unit"
|
|
178
178
|
};
|
|
@@ -185,15 +185,15 @@ const Lt = { class: "fm-typo-en-body-md-400 flex-grow" }, nt = /* @__PURE__ */ o
|
|
|
185
185
|
amount: {},
|
|
186
186
|
defaultTrackingMeasurement: {}
|
|
187
187
|
},
|
|
188
|
-
setup(
|
|
189
|
-
function
|
|
188
|
+
setup(c) {
|
|
189
|
+
function u(v) {
|
|
190
190
|
return `uom:${v._id}`;
|
|
191
191
|
}
|
|
192
192
|
function l(v) {
|
|
193
|
-
const o =
|
|
194
|
-
v ? localStorage.setItem(o, v) : localStorage.setItem(o, s.unit._id),
|
|
193
|
+
const o = u(s.sku);
|
|
194
|
+
v ? localStorage.setItem(o, v) : localStorage.setItem(o, s.unit._id), S.value = ke(s.sku, s.unit);
|
|
195
195
|
}
|
|
196
|
-
const s =
|
|
196
|
+
const s = c, S = T(ke(s.sku, s.unit)), f = U(() => {
|
|
197
197
|
const { measurements: v } = s.unit;
|
|
198
198
|
return [
|
|
199
199
|
{
|
|
@@ -206,42 +206,42 @@ const Lt = { class: "fm-typo-en-body-md-400 flex-grow" }, nt = /* @__PURE__ */ o
|
|
|
206
206
|
}))
|
|
207
207
|
];
|
|
208
208
|
});
|
|
209
|
-
function
|
|
210
|
-
return C(
|
|
209
|
+
function r({ value: v }) {
|
|
210
|
+
return C(S).type === "unit" ? v === null : v === C(S).measurement;
|
|
211
211
|
}
|
|
212
|
-
const m =
|
|
212
|
+
const m = U(
|
|
213
213
|
() => {
|
|
214
214
|
var v;
|
|
215
|
-
return ((v = f.value.find((o) =>
|
|
215
|
+
return ((v = f.value.find((o) => r(o))) == null ? void 0 : v.label) ?? "";
|
|
216
216
|
}
|
|
217
|
-
),
|
|
217
|
+
), k = T(!1);
|
|
218
218
|
return (v, o) => {
|
|
219
|
-
const
|
|
220
|
-
return
|
|
219
|
+
const g = $("FmIcon"), h = $("FmMenuItem"), i = $("FmMenu");
|
|
220
|
+
return x(), N(i, {
|
|
221
221
|
"stop-click-propagation": "",
|
|
222
|
-
onMenuChanged: o[0] || (o[0] = (
|
|
222
|
+
onMenuChanged: o[0] || (o[0] = (a) => k.value = a)
|
|
223
223
|
}, {
|
|
224
224
|
"menu-button": B(() => [
|
|
225
225
|
e("button", {
|
|
226
226
|
type: "button",
|
|
227
|
-
class:
|
|
227
|
+
class: fe([
|
|
228
228
|
"w-full text-left flex items-center gap-8 cursor-pointer fm-corner-radius-sm px-8 py-4 border bg-white",
|
|
229
|
-
|
|
229
|
+
k.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
|
|
230
230
|
])
|
|
231
231
|
}, [
|
|
232
232
|
e("div", Lt, A(m.value), 1),
|
|
233
|
-
|
|
233
|
+
b(g, {
|
|
234
234
|
class: "text-fm-color-neutral-gray-400",
|
|
235
235
|
name: "expand_more"
|
|
236
236
|
})
|
|
237
237
|
], 2)
|
|
238
238
|
]),
|
|
239
239
|
default: B(() => [
|
|
240
|
-
(
|
|
241
|
-
key:
|
|
242
|
-
label:
|
|
243
|
-
"model-value":
|
|
244
|
-
onClick: (I) => l(
|
|
240
|
+
(x(!0), j(ne, null, re(f.value, (a) => (x(), N(h, {
|
|
241
|
+
key: a.value ?? 0,
|
|
242
|
+
label: a.label,
|
|
243
|
+
"model-value": r(a),
|
|
244
|
+
onClick: (I) => l(a.value)
|
|
245
245
|
}, null, 8, ["label", "model-value", "onClick"]))), 128))
|
|
246
246
|
]),
|
|
247
247
|
_: 1
|
|
@@ -263,25 +263,29 @@ const Lt = { class: "fm-typo-en-body-md-400 flex-grow" }, nt = /* @__PURE__ */ o
|
|
|
263
263
|
props: {
|
|
264
264
|
days: {}
|
|
265
265
|
},
|
|
266
|
-
setup(
|
|
267
|
-
const
|
|
268
|
-
return (
|
|
266
|
+
setup(c) {
|
|
267
|
+
const u = c, l = U(() => typeof u.days != "number" ? "no-info" : u.days > 14 ? "high" : u.days >= 7 && u.days <= 14 ? "mid" : "low");
|
|
268
|
+
return (s, S) => typeof u.days == "number" ? (x(), j("div", Nt, [
|
|
269
269
|
e("div", {
|
|
270
|
-
class:
|
|
270
|
+
class: fe([
|
|
271
|
+
`fm-forecast-notification-${l.value}`,
|
|
272
|
+
"flex items-center gap-8 p-4 fm-corner-radius-md fm-typo-en-body-md-600"
|
|
273
|
+
])
|
|
271
274
|
}, [
|
|
272
275
|
e("div", {
|
|
273
|
-
class:
|
|
276
|
+
class: fe([
|
|
277
|
+
"fm-forecast-notification-indicator",
|
|
278
|
+
`fm-forecast-notification-indicator-${l.value}`
|
|
279
|
+
])
|
|
274
280
|
}, null, 2),
|
|
275
|
-
e("div",
|
|
276
|
-
class: ce(["fm-typo-en-body-md-600", s.value])
|
|
277
|
-
}, A(a.days) + " days", 3)
|
|
281
|
+
e("div", null, A(u.days) + " days", 1)
|
|
278
282
|
], 2)
|
|
279
|
-
])) : (
|
|
283
|
+
])) : (x(), j("div", Ot, zt));
|
|
280
284
|
}
|
|
281
285
|
}), qt = /* @__PURE__ */ e("div", { class: "whitespace-nowrap" }, "Days remaining", -1), Kt = /* @__PURE__ */ oe({
|
|
282
286
|
__name: "StockHeaderPreview",
|
|
283
|
-
setup(
|
|
284
|
-
return (
|
|
287
|
+
setup(c) {
|
|
288
|
+
return (u, l) => (x(), N(vt, null, {
|
|
285
289
|
default: B(() => [
|
|
286
290
|
qt
|
|
287
291
|
]),
|
|
@@ -289,22 +293,22 @@ const Lt = { class: "fm-typo-en-body-md-400 flex-grow" }, nt = /* @__PURE__ */ o
|
|
|
289
293
|
}));
|
|
290
294
|
}
|
|
291
295
|
});
|
|
292
|
-
function Gt(
|
|
293
|
-
const
|
|
294
|
-
async function f(
|
|
295
|
-
const
|
|
296
|
-
sku:
|
|
296
|
+
function Gt(c) {
|
|
297
|
+
const u = ue(), l = Te(), s = Ue(), S = T();
|
|
298
|
+
async function f(h) {
|
|
299
|
+
const i = {
|
|
300
|
+
sku: h,
|
|
297
301
|
show: !0,
|
|
298
|
-
"onUpdate:show"(
|
|
299
|
-
|
|
302
|
+
"onUpdate:show"(a) {
|
|
303
|
+
S.value.show = a;
|
|
300
304
|
}
|
|
301
305
|
};
|
|
302
|
-
|
|
306
|
+
S.value = i;
|
|
303
307
|
}
|
|
304
|
-
const
|
|
305
|
-
async function m(
|
|
306
|
-
var
|
|
307
|
-
if (!!!((w = (
|
|
308
|
+
const r = T();
|
|
309
|
+
async function m(h) {
|
|
310
|
+
var R, w, V;
|
|
311
|
+
if (!!!((w = (R = h.convert) == null ? void 0 : R.inventoryBindings) != null && w.length)) {
|
|
308
312
|
s.open({
|
|
309
313
|
title: "Cannot convert stock",
|
|
310
314
|
message: "Stock is not convertable due to no recipe or ingredient to convert."
|
|
@@ -312,43 +316,43 @@ function Gt(u) {
|
|
|
312
316
|
return;
|
|
313
317
|
}
|
|
314
318
|
const I = {
|
|
315
|
-
maxCount: ((V = l.productBalance.find(({ id: M }) => M ===
|
|
316
|
-
sku:
|
|
319
|
+
maxCount: ((V = l.productBalance.find(({ id: M }) => M === h._id)) == null ? void 0 : V.count) || 0,
|
|
320
|
+
sku: h,
|
|
317
321
|
show: !0,
|
|
318
322
|
"onUpdate:show"(M) {
|
|
319
|
-
|
|
323
|
+
r.value.show = M;
|
|
320
324
|
},
|
|
321
325
|
onSubmitted() {
|
|
322
|
-
|
|
326
|
+
c();
|
|
323
327
|
}
|
|
324
328
|
};
|
|
325
|
-
|
|
329
|
+
r.value = I;
|
|
326
330
|
}
|
|
327
|
-
const
|
|
328
|
-
async function v(
|
|
329
|
-
const
|
|
330
|
-
stock:
|
|
331
|
+
const k = T();
|
|
332
|
+
async function v(h) {
|
|
333
|
+
const i = {
|
|
334
|
+
stock: h,
|
|
331
335
|
show: !0,
|
|
332
|
-
"onUpdate:show"(
|
|
333
|
-
|
|
336
|
+
"onUpdate:show"(a) {
|
|
337
|
+
k.value.show = a;
|
|
334
338
|
},
|
|
335
339
|
onSubmitted() {
|
|
336
|
-
|
|
340
|
+
c();
|
|
337
341
|
}
|
|
338
342
|
};
|
|
339
|
-
|
|
343
|
+
k.value = i;
|
|
340
344
|
}
|
|
341
|
-
function o(
|
|
342
|
-
const
|
|
343
|
-
switch (
|
|
345
|
+
function o(h, i) {
|
|
346
|
+
const a = je(i);
|
|
347
|
+
switch (h) {
|
|
344
348
|
case ye.History:
|
|
345
|
-
f(
|
|
349
|
+
f(a);
|
|
346
350
|
return;
|
|
347
351
|
case ye.Convert:
|
|
348
|
-
m(
|
|
352
|
+
m(a);
|
|
349
353
|
return;
|
|
350
354
|
case ye.Adjust:
|
|
351
|
-
v(
|
|
355
|
+
v(a);
|
|
352
356
|
return;
|
|
353
357
|
}
|
|
354
358
|
}
|
|
@@ -369,14 +373,14 @@ function Gt(u) {
|
|
|
369
373
|
{
|
|
370
374
|
id: "UOM",
|
|
371
375
|
header: "Balance",
|
|
372
|
-
cell(
|
|
373
|
-
const
|
|
374
|
-
unit:
|
|
375
|
-
sku:
|
|
376
|
-
amount:
|
|
377
|
-
defaultTrackingMeasurement:
|
|
376
|
+
cell(h) {
|
|
377
|
+
const i = h.row.original, a = {
|
|
378
|
+
unit: i.unit,
|
|
379
|
+
sku: i,
|
|
380
|
+
amount: i.balance,
|
|
381
|
+
defaultTrackingMeasurement: i.trackingMeasurement ?? void 0
|
|
378
382
|
};
|
|
379
|
-
return xe(nt,
|
|
383
|
+
return xe(nt, a);
|
|
380
384
|
},
|
|
381
385
|
size: 180
|
|
382
386
|
},
|
|
@@ -386,21 +390,21 @@ function Gt(u) {
|
|
|
386
390
|
header: () => xe(Kt),
|
|
387
391
|
enableSorting: !0,
|
|
388
392
|
sortUndefined: "last",
|
|
389
|
-
cell(
|
|
390
|
-
const
|
|
391
|
-
days:
|
|
393
|
+
cell(h) {
|
|
394
|
+
const a = {
|
|
395
|
+
days: h.row.original.day
|
|
392
396
|
};
|
|
393
|
-
return xe(ot,
|
|
397
|
+
return xe(ot, a);
|
|
394
398
|
},
|
|
395
399
|
size: 200
|
|
396
400
|
},
|
|
397
401
|
{
|
|
398
402
|
id: "action",
|
|
399
|
-
cell(
|
|
400
|
-
var
|
|
403
|
+
cell(h) {
|
|
404
|
+
var i;
|
|
401
405
|
return ct(
|
|
402
|
-
((
|
|
403
|
-
(
|
|
406
|
+
((i = u._currentLocation) == null ? void 0 : i.type) === "restaurant" ? Pt : Et,
|
|
407
|
+
(a) => o(a, h.row.original)
|
|
404
408
|
);
|
|
405
409
|
},
|
|
406
410
|
enableSorting: !1,
|
|
@@ -411,48 +415,48 @@ function Gt(u) {
|
|
|
411
415
|
}
|
|
412
416
|
}
|
|
413
417
|
],
|
|
414
|
-
stockHistoryProps:
|
|
415
|
-
convertSkuDialogProps:
|
|
416
|
-
adjustSkuDialogProps:
|
|
418
|
+
stockHistoryProps: S,
|
|
419
|
+
convertSkuDialogProps: r,
|
|
420
|
+
adjustSkuDialogProps: k,
|
|
417
421
|
showSkuHistory: f
|
|
418
422
|
};
|
|
419
423
|
}
|
|
420
424
|
const Wt = {
|
|
421
425
|
context: null,
|
|
422
426
|
error: null,
|
|
423
|
-
isRequired(
|
|
424
|
-
return `${this.context ?? ""}`.length === 0 && (this.error =
|
|
427
|
+
isRequired(c = "This field is required") {
|
|
428
|
+
return `${this.context ?? ""}`.length === 0 && (this.error = c), this;
|
|
425
429
|
},
|
|
426
|
-
isString(
|
|
427
|
-
return this.error ? this : (typeof this.context != "string" && (this.error ?? (this.error =
|
|
430
|
+
isString(c = "Must be a valid string") {
|
|
431
|
+
return this.error ? this : (typeof this.context != "string" && (this.error ?? (this.error = c)), this);
|
|
428
432
|
},
|
|
429
433
|
toInt() {
|
|
430
434
|
return this.error ? this : (this.context = +this.context, this);
|
|
431
435
|
},
|
|
432
|
-
isInteger(
|
|
433
|
-
return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error =
|
|
436
|
+
isInteger(c = "Must be an integer") {
|
|
437
|
+
return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error = c), this);
|
|
434
438
|
},
|
|
435
|
-
min(
|
|
439
|
+
min(c, u) {
|
|
436
440
|
if (this.error) return this;
|
|
437
441
|
try {
|
|
438
|
-
typeof this.context == "number" ? +this.context <
|
|
442
|
+
typeof this.context == "number" ? +this.context < c && (this.error = u ?? `Must be at least ${c}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < c && (this.error = u ?? `Must be at least ${c}`) : this.error = "Length cannot be determined";
|
|
439
443
|
} catch {
|
|
440
444
|
this.error = "Length cannot be determined";
|
|
441
445
|
}
|
|
442
446
|
return this;
|
|
443
447
|
},
|
|
444
|
-
max(
|
|
448
|
+
max(c, u) {
|
|
445
449
|
if (this.error) return this;
|
|
446
450
|
try {
|
|
447
|
-
typeof this.context == "number" ? +this.context >
|
|
451
|
+
typeof this.context == "number" ? +this.context > c && (this.error = u ?? `Must be at most ${c}`) : "length" in this.context ? +this.context.length > c && (this.error = u ?? `Must be at most ${c}`) : this.error = "Length cannot be determined";
|
|
448
452
|
} catch {
|
|
449
453
|
this.error = "Length cannot be determined";
|
|
450
454
|
}
|
|
451
455
|
return this;
|
|
452
456
|
}
|
|
453
457
|
};
|
|
454
|
-
function qe(
|
|
455
|
-
return { ...Wt, context:
|
|
458
|
+
function qe(c) {
|
|
459
|
+
return { ...Wt, context: c };
|
|
456
460
|
}
|
|
457
461
|
const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-800" }, Xt = { class: "flex flex-col gap-24 w-full" }, Zt = { class: "flex flex-col gap-8" }, en = /* @__PURE__ */ e("div", { class: "fm-typo-en-body-lg-600" }, "Deduction summary", -1), tn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, nn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, on = { class: "flex flex-col p-16 gap-8" }, sn = { class: "flex flex-col gap-4" }, an = /* @__PURE__ */ e("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, " Ingredients ", -1), ln = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, rn = { class: "xs:col-span-3" }, un = { class: "flex gap-8" }, cn = /* @__PURE__ */ oe({
|
|
458
462
|
__name: "ConvertSkuDialog",
|
|
@@ -462,29 +466,29 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
462
466
|
show: { type: Boolean }
|
|
463
467
|
},
|
|
464
468
|
emits: ["update:show", "submitted"],
|
|
465
|
-
setup(
|
|
466
|
-
const s =
|
|
469
|
+
setup(c, { expose: u, emit: l }) {
|
|
470
|
+
const s = c, S = l, f = Mt(), r = Re(), m = ve(), k = de(), v = T(0), o = T(null), g = U(() => r.skus), h = U(
|
|
467
471
|
() => {
|
|
468
472
|
var t, n;
|
|
469
473
|
return (((n = (t = s.sku) == null ? void 0 : t.convert) == null ? void 0 : n.inventoryBindings) ?? []).filter(
|
|
470
474
|
(p) => p.type === Le.enum.SKU
|
|
471
475
|
);
|
|
472
476
|
}
|
|
473
|
-
),
|
|
477
|
+
), i = U({
|
|
474
478
|
get() {
|
|
475
479
|
return !!o.value;
|
|
476
480
|
},
|
|
477
481
|
set(t) {
|
|
478
|
-
t ? o.value = je(
|
|
482
|
+
t ? o.value = je(h.value) : (o.value = null, v.value = Math.min(v.value, s.maxCount ?? 0));
|
|
479
483
|
}
|
|
480
|
-
}),
|
|
484
|
+
}), a = T(!1);
|
|
481
485
|
ge([() => s.show], ([t]) => {
|
|
482
486
|
t && (v.value = 0);
|
|
483
487
|
});
|
|
484
488
|
function I() {
|
|
485
489
|
L(s.sku, be(v.value), o.value);
|
|
486
490
|
}
|
|
487
|
-
function
|
|
491
|
+
function R(t) {
|
|
488
492
|
if (o.value)
|
|
489
493
|
return !0;
|
|
490
494
|
const n = qe(t).isInteger().max(s.maxCount ?? 0).error ?? "";
|
|
@@ -498,7 +502,7 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
498
502
|
}) ?? null : null, p = Be(s.sku.unit, n), d = ht(+t);
|
|
499
503
|
return qe(d).isInteger().max(p).error ? "Precision cannot be more than " + p : !0;
|
|
500
504
|
}
|
|
501
|
-
const V =
|
|
505
|
+
const V = U(
|
|
502
506
|
() => {
|
|
503
507
|
var t, n;
|
|
504
508
|
return (t = s.sku.convert) != null && t.measurement ? (n = s.sku.unit.measurements.find((p) => {
|
|
@@ -506,21 +510,21 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
506
510
|
return p.id === ((d = s.sku.convert) == null ? void 0 : d.measurement);
|
|
507
511
|
})) == null ? void 0 : n.abbrev : s.sku.unit.abbrev;
|
|
508
512
|
}
|
|
509
|
-
), M =
|
|
513
|
+
), M = U(() => {
|
|
510
514
|
var p, d, y;
|
|
511
515
|
const t = (d = (p = s.sku.convert) == null ? void 0 : p.inventoryBindings) == null ? void 0 : d.filter((_) => _.type === "SKU");
|
|
512
516
|
return (y = o.value ?? t) == null ? void 0 : y.map((_) => {
|
|
513
517
|
var ee, G, ae, Pe, Ee;
|
|
514
|
-
const F =
|
|
518
|
+
const F = r.skus.find((me) => me._id === _.id), Y = ((ee = _.measurement) == null ? void 0 : ee.abbrev) ?? ((G = F == null ? void 0 : F.unit) == null ? void 0 : G.abbrev), K = (ae = s.sku.convert) != null && ae.measurement ? s.sku.unit.measurements.find((me) => {
|
|
515
519
|
var He;
|
|
516
|
-
return
|
|
520
|
+
return me.id === ((He = s.sku.convert) == null ? void 0 : He.measurement);
|
|
517
521
|
}) ?? null : null, le = Be(s.sku.unit, K), D = w(`${v.value}`) === !0 ? ie(
|
|
518
522
|
gt(
|
|
519
523
|
_.amount,
|
|
520
524
|
be(+v.value, le)
|
|
521
525
|
),
|
|
522
526
|
!1
|
|
523
|
-
) : "0", E = (Ee = (Pe = o.value) == null ? void 0 : Pe.find((
|
|
527
|
+
) : "0", E = (Ee = (Pe = o.value) == null ? void 0 : Pe.find((me) => me.id === (F == null ? void 0 : F._id))) == null ? void 0 : Ee.amount, q = E ? ie(E, !1) : null;
|
|
524
528
|
return {
|
|
525
529
|
sku: F,
|
|
526
530
|
convertAmount: q ?? D,
|
|
@@ -528,7 +532,7 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
528
532
|
};
|
|
529
533
|
});
|
|
530
534
|
}), H = T();
|
|
531
|
-
|
|
535
|
+
u({
|
|
532
536
|
validateInputs: () => {
|
|
533
537
|
var t, n;
|
|
534
538
|
(n = (t = H.value) == null ? void 0 : t.validateInputs) == null || n.call(t);
|
|
@@ -544,7 +548,7 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
544
548
|
});
|
|
545
549
|
const P = Ie(s, "show");
|
|
546
550
|
async function L(t, n, p) {
|
|
547
|
-
|
|
551
|
+
a.value = !0;
|
|
548
552
|
try {
|
|
549
553
|
await m.convertSku({
|
|
550
554
|
conversions: [
|
|
@@ -561,24 +565,24 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
561
565
|
}))
|
|
562
566
|
}
|
|
563
567
|
]
|
|
564
|
-
}),
|
|
568
|
+
}), S("update:show", !1), S("submitted");
|
|
565
569
|
} catch (d) {
|
|
566
|
-
|
|
570
|
+
k.open({
|
|
567
571
|
title: "Something went wrong",
|
|
568
572
|
message: `Cannot convert ${t.name}. Please try again.`,
|
|
569
573
|
type: "error"
|
|
570
574
|
}), console.error("error at converting stock amount", t, n, d);
|
|
571
575
|
} finally {
|
|
572
|
-
|
|
576
|
+
a.value = !1;
|
|
573
577
|
}
|
|
574
578
|
}
|
|
575
579
|
function z(t, n, p) {
|
|
576
580
|
const d = +n;
|
|
577
581
|
let y = p;
|
|
578
|
-
n.length > 0 && isFinite(d) ? y = p.map((_) => (_.id !== t || (_.amount =
|
|
582
|
+
n.length > 0 && isFinite(d) ? y = p.map((_) => (_.id !== t || (_.amount = pe(d)), _)) : y = p.map((_) => (_.id !== t || (_.amount = { amount: 0, precision: 0 }), _)), o.value = y;
|
|
579
583
|
}
|
|
580
584
|
function O(t) {
|
|
581
|
-
const n =
|
|
585
|
+
const n = g.value.find((p) => p._id === t);
|
|
582
586
|
return n ? tt(n.unit, !0) : [];
|
|
583
587
|
}
|
|
584
588
|
function J(t, n) {
|
|
@@ -593,7 +597,7 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
593
597
|
if (n === null)
|
|
594
598
|
d = p.map((y) => (y.id !== t || (y.measurement = null), y)) ?? [];
|
|
595
599
|
else {
|
|
596
|
-
const y =
|
|
600
|
+
const y = g.value.find((_) => _._id === t);
|
|
597
601
|
d = p.map((_) => {
|
|
598
602
|
var F, Y;
|
|
599
603
|
return _.id !== t || (_.measurement = (Y = (F = y == null ? void 0 : y.unit) == null ? void 0 : F.measurements) == null ? void 0 : Y.find((K) => K.id === n)), _;
|
|
@@ -623,7 +627,7 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
623
627
|
}
|
|
624
628
|
), (t, n) => {
|
|
625
629
|
const p = $("FmTextField"), d = $("FmForm"), y = $("FmCard"), _ = $("FmSwitch"), F = $("FmFormGroup"), Y = $("FmSelect"), K = $("FmButton"), le = $("FmSideSheet");
|
|
626
|
-
return
|
|
630
|
+
return x(), N(le, {
|
|
627
631
|
"dismiss-away": "",
|
|
628
632
|
modelValue: C(P),
|
|
629
633
|
"onUpdate:modelValue": n[3] || (n[3] = (D) => De(P) ? P.value = D : null),
|
|
@@ -636,34 +640,34 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
636
640
|
]),
|
|
637
641
|
default: B(() => [
|
|
638
642
|
e("div", Xt, [
|
|
639
|
-
|
|
643
|
+
b(d, {
|
|
640
644
|
ref_key: "formRef",
|
|
641
645
|
ref: H,
|
|
642
646
|
onValidationSuccess: I
|
|
643
647
|
}, {
|
|
644
648
|
default: B(() => [
|
|
645
|
-
|
|
646
|
-
disabled:
|
|
649
|
+
b(p, {
|
|
650
|
+
disabled: a.value,
|
|
647
651
|
"model-value": v.value,
|
|
648
652
|
"onUpdate:modelValue": n[0] || (n[0] = (D) => v.value = D),
|
|
649
653
|
label: "Amount",
|
|
650
|
-
rules: [
|
|
654
|
+
rules: [R, w, C(Ve)(0)],
|
|
651
655
|
"append-text": V.value,
|
|
652
656
|
"helper-text": o.value ? void 0 : `Max ${t.maxCount} ${V.value}`
|
|
653
657
|
}, null, 8, ["disabled", "model-value", "rules", "append-text", "helper-text"])
|
|
654
658
|
]),
|
|
655
659
|
_: 1
|
|
656
660
|
}, 512),
|
|
657
|
-
|
|
661
|
+
b(y, {
|
|
658
662
|
variant: "outlined",
|
|
659
663
|
class: "p-16"
|
|
660
664
|
}, {
|
|
661
665
|
default: B(() => [
|
|
662
666
|
e("div", Zt, [
|
|
663
667
|
en,
|
|
664
|
-
(
|
|
668
|
+
(x(!0), j(ne, null, re(M.value, (D) => {
|
|
665
669
|
var E, q;
|
|
666
|
-
return
|
|
670
|
+
return x(), j("div", {
|
|
667
671
|
key: (E = D.sku) == null ? void 0 : E._id,
|
|
668
672
|
class: "flex items-center"
|
|
669
673
|
}, [
|
|
@@ -675,30 +679,30 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
675
679
|
]),
|
|
676
680
|
_: 1
|
|
677
681
|
}),
|
|
678
|
-
|
|
682
|
+
b(y, { variant: "outlined" }, {
|
|
679
683
|
default: B(() => [
|
|
680
684
|
e("div", on, [
|
|
681
|
-
|
|
685
|
+
b(_, {
|
|
682
686
|
value: "",
|
|
683
|
-
modelValue:
|
|
684
|
-
"onUpdate:modelValue": n[1] || (n[1] = (D) =>
|
|
687
|
+
modelValue: i.value,
|
|
688
|
+
"onUpdate:modelValue": n[1] || (n[1] = (D) => i.value = D),
|
|
685
689
|
label: "Override deduction",
|
|
686
690
|
"label-placement": "right"
|
|
687
691
|
}, null, 8, ["modelValue"]),
|
|
688
|
-
|
|
689
|
-
|
|
692
|
+
i.value ? (x(), j(ne, { key: 0 }, [
|
|
693
|
+
b(F, {
|
|
690
694
|
modelValue: o.value,
|
|
691
695
|
rules: [C(At)(1, "Must have at least one ingredient binding")]
|
|
692
696
|
}, null, 8, ["modelValue", "rules"]),
|
|
693
697
|
e("div", sn, [
|
|
694
698
|
an,
|
|
695
|
-
(
|
|
699
|
+
(x(!0), j(ne, null, re(o.value, (D) => (x(), N(F, {
|
|
696
700
|
key: D.id,
|
|
697
|
-
disabled:
|
|
701
|
+
disabled: a.value,
|
|
698
702
|
modelValue: +C(ie)(D.amount ?? { amount: 1, precision: 0 }),
|
|
699
703
|
rules: [
|
|
700
704
|
C(Vt)(
|
|
701
|
-
|
|
705
|
+
g.value.find((E) => E._id === D.id).unit,
|
|
702
706
|
D.measurement
|
|
703
707
|
),
|
|
704
708
|
C(Ve)(0)
|
|
@@ -708,18 +712,18 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
708
712
|
var q, ee, G;
|
|
709
713
|
return [
|
|
710
714
|
e("div", ln, [
|
|
711
|
-
e("div", rn, A((q =
|
|
712
|
-
|
|
715
|
+
e("div", rn, A((q = g.value.find((ae) => ae._id === D.id)) == null ? void 0 : q.name), 1),
|
|
716
|
+
b(p, {
|
|
713
717
|
class: "xs:col-span-2",
|
|
714
|
-
disabled:
|
|
718
|
+
disabled: a.value,
|
|
715
719
|
modelValue: +C(ie)(
|
|
716
720
|
D.amount ?? { amount: 1, precision: 0 }
|
|
717
721
|
),
|
|
718
722
|
"onUpdate:modelValue": (ae) => z(D.id, ae, o.value ?? []),
|
|
719
723
|
invalid: E
|
|
720
724
|
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
|
|
721
|
-
|
|
722
|
-
disabled:
|
|
725
|
+
b(Y, {
|
|
726
|
+
disabled: a.value,
|
|
723
727
|
class: "translate-y-[2px]",
|
|
724
728
|
items: O(D.id),
|
|
725
729
|
"model-value": (G = J(D.id, (ee = D.measurement) == null ? void 0 : ee.id)) == null ? void 0 : G.value,
|
|
@@ -729,8 +733,8 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
729
733
|
"helper-text": B(() => []),
|
|
730
734
|
_: 2
|
|
731
735
|
}, 1032, ["disabled", "items", "model-value", "onUpdate:modelValue", "invalid"]),
|
|
732
|
-
|
|
733
|
-
disabled:
|
|
736
|
+
b(K, {
|
|
737
|
+
disabled: a.value,
|
|
734
738
|
type: "button",
|
|
735
739
|
variant: "tertiary",
|
|
736
740
|
icon: "delete",
|
|
@@ -743,7 +747,7 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
743
747
|
}, 1032, ["disabled", "modelValue", "rules"]))), 128))
|
|
744
748
|
]),
|
|
745
749
|
e("div", null, [
|
|
746
|
-
|
|
750
|
+
b(K, {
|
|
747
751
|
icon: "link",
|
|
748
752
|
label: "Link ingredient",
|
|
749
753
|
variant: "plain",
|
|
@@ -759,8 +763,8 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
759
763
|
]),
|
|
760
764
|
"side-sheet-footer": B(() => [
|
|
761
765
|
e("div", un, [
|
|
762
|
-
|
|
763
|
-
loading:
|
|
766
|
+
b(K, {
|
|
767
|
+
loading: a.value,
|
|
764
768
|
label: "Convert",
|
|
765
769
|
onClick: n[2] || (n[2] = (D) => {
|
|
766
770
|
var E, q;
|
|
@@ -774,12 +778,12 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
774
778
|
};
|
|
775
779
|
}
|
|
776
780
|
});
|
|
777
|
-
function Fe(
|
|
778
|
-
const l = be(
|
|
781
|
+
function Fe(c, u) {
|
|
782
|
+
const l = be(c, u);
|
|
779
783
|
return { ...l, amount: -l.amount };
|
|
780
784
|
}
|
|
781
|
-
function Ke(
|
|
782
|
-
return be(Math.abs(
|
|
785
|
+
function Ke(c, u) {
|
|
786
|
+
return be(Math.abs(c), u);
|
|
783
787
|
}
|
|
784
788
|
const Ce = {
|
|
785
789
|
[te.enum.DAMAGE]: {
|
|
@@ -809,90 +813,90 @@ const Ce = {
|
|
|
809
813
|
disabled: { type: Boolean }
|
|
810
814
|
},
|
|
811
815
|
emits: ["update:modelValue", "click:delete"],
|
|
812
|
-
setup(
|
|
813
|
-
const l =
|
|
816
|
+
setup(c, { emit: u }) {
|
|
817
|
+
const l = c, s = u, S = U(
|
|
814
818
|
() => Object.keys(Ce).map((o) => ({
|
|
815
819
|
label: rt(o),
|
|
816
820
|
value: o
|
|
817
821
|
}))
|
|
818
|
-
), f =
|
|
822
|
+
), f = U(() => tt(l.modelValue.doc.unit, !0)), r = U({
|
|
819
823
|
get() {
|
|
820
824
|
return l.modelValue.type ?? te.enum.PURCHASE;
|
|
821
825
|
},
|
|
822
826
|
set(o) {
|
|
823
|
-
const
|
|
827
|
+
const g = {
|
|
824
828
|
...l.modelValue
|
|
825
829
|
};
|
|
826
|
-
|
|
827
|
-
const
|
|
828
|
-
|
|
829
|
-
+ie(
|
|
830
|
-
|
|
831
|
-
), s("update:modelValue",
|
|
830
|
+
g.type = o;
|
|
831
|
+
const h = Ye(l.modelValue.amount);
|
|
832
|
+
g.amount = Ce[g.type].toAdjustmentAmount(
|
|
833
|
+
+ie(h),
|
|
834
|
+
h.precision
|
|
835
|
+
), s("update:modelValue", g);
|
|
832
836
|
}
|
|
833
|
-
}), m =
|
|
837
|
+
}), m = U({
|
|
834
838
|
get() {
|
|
835
839
|
const o = Ye(l.modelValue.amount);
|
|
836
840
|
return +ie(o);
|
|
837
841
|
},
|
|
838
842
|
set(o) {
|
|
839
|
-
const
|
|
843
|
+
const g = {
|
|
840
844
|
...l.modelValue
|
|
841
|
-
},
|
|
842
|
-
|
|
845
|
+
}, h = pe(o);
|
|
846
|
+
g.amount = Ce[r.value].toAdjustmentAmount(
|
|
843
847
|
o,
|
|
844
|
-
|
|
845
|
-
), s("update:modelValue",
|
|
848
|
+
h.precision
|
|
849
|
+
), s("update:modelValue", g);
|
|
846
850
|
}
|
|
847
|
-
}),
|
|
851
|
+
}), k = U({
|
|
848
852
|
get() {
|
|
849
853
|
var o;
|
|
850
854
|
return ((o = l.modelValue.measurement) == null ? void 0 : o.id) ?? null;
|
|
851
855
|
},
|
|
852
856
|
set(o) {
|
|
853
|
-
var
|
|
854
|
-
const
|
|
857
|
+
var h, i;
|
|
858
|
+
const g = {
|
|
855
859
|
...l.modelValue
|
|
856
860
|
};
|
|
857
|
-
|
|
861
|
+
g.measurement = ((i = (h = l.modelValue.doc.unit) == null ? void 0 : h.measurements) == null ? void 0 : i.find((a) => a.id === o)) ?? null, s("update:modelValue", g);
|
|
858
862
|
}
|
|
859
|
-
}), v =
|
|
863
|
+
}), v = U({
|
|
860
864
|
get() {
|
|
861
865
|
return l.modelValue.remark ?? "";
|
|
862
866
|
},
|
|
863
867
|
set(o) {
|
|
864
|
-
const
|
|
868
|
+
const g = {
|
|
865
869
|
...l.modelValue
|
|
866
870
|
};
|
|
867
|
-
|
|
871
|
+
g.remark = o, s("update:modelValue", g);
|
|
868
872
|
}
|
|
869
873
|
});
|
|
870
|
-
return (o,
|
|
871
|
-
const
|
|
872
|
-
return
|
|
874
|
+
return (o, g) => {
|
|
875
|
+
const h = $("FmButton"), i = $("FmSelect"), a = $("FmTextarea"), I = $("FmCard");
|
|
876
|
+
return x(), N(I, {
|
|
873
877
|
variant: "outlined",
|
|
874
878
|
class: "grid grid-cols-2 gap-8 p-16"
|
|
875
879
|
}, {
|
|
876
880
|
default: B(() => [
|
|
877
881
|
e("div", dn, [
|
|
878
882
|
e("div", mn, A(o.modelValue.doc.name), 1),
|
|
879
|
-
|
|
883
|
+
b(h, {
|
|
880
884
|
variant: "tertiary",
|
|
881
885
|
"prepend-icon": "delete",
|
|
882
|
-
onClick:
|
|
886
|
+
onClick: g[0] || (g[0] = (R) => s("click:delete"))
|
|
883
887
|
})
|
|
884
888
|
]),
|
|
885
|
-
|
|
889
|
+
b(i, {
|
|
886
890
|
disabled: o.disabled,
|
|
887
891
|
class: "col-span-2",
|
|
888
892
|
label: "Type",
|
|
889
|
-
items:
|
|
890
|
-
modelValue:
|
|
891
|
-
"onUpdate:modelValue":
|
|
893
|
+
items: S.value,
|
|
894
|
+
modelValue: r.value,
|
|
895
|
+
"onUpdate:modelValue": g[1] || (g[1] = (R) => r.value = R),
|
|
892
896
|
rules: [C(Dt)()],
|
|
893
897
|
"label-mark": "required"
|
|
894
898
|
}, null, 8, ["disabled", "items", "modelValue", "rules"]),
|
|
895
|
-
|
|
899
|
+
b(Rt, {
|
|
896
900
|
disabled: o.disabled,
|
|
897
901
|
label: "Amount",
|
|
898
902
|
step: +C(ie)({
|
|
@@ -900,22 +904,22 @@ const Ce = {
|
|
|
900
904
|
precision: C(Be)(o.modelValue.doc.unit, o.modelValue.measurement)
|
|
901
905
|
}),
|
|
902
906
|
modelValue: m.value,
|
|
903
|
-
"onUpdate:modelValue":
|
|
907
|
+
"onUpdate:modelValue": g[2] || (g[2] = (R) => m.value = R),
|
|
904
908
|
rules: [C(Ve)(0)]
|
|
905
909
|
}, null, 8, ["disabled", "step", "modelValue", "rules"]),
|
|
906
|
-
|
|
910
|
+
b(i, {
|
|
907
911
|
disabled: o.disabled,
|
|
908
912
|
label: "Unit",
|
|
909
913
|
items: f.value,
|
|
910
|
-
modelValue:
|
|
911
|
-
"onUpdate:modelValue":
|
|
914
|
+
modelValue: k.value,
|
|
915
|
+
"onUpdate:modelValue": g[3] || (g[3] = (R) => k.value = R)
|
|
912
916
|
}, null, 8, ["disabled", "items", "modelValue"]),
|
|
913
|
-
|
|
917
|
+
b(a, {
|
|
914
918
|
class: "col-span-2",
|
|
915
919
|
disabled: o.disabled,
|
|
916
920
|
label: "Remark",
|
|
917
921
|
modelValue: v.value,
|
|
918
|
-
"onUpdate:modelValue":
|
|
922
|
+
"onUpdate:modelValue": g[4] || (g[4] = (R) => v.value = R),
|
|
919
923
|
"label-mark": "optional"
|
|
920
924
|
}, null, 8, ["disabled", "modelValue"])
|
|
921
925
|
]),
|
|
@@ -932,27 +936,27 @@ const Ce = {
|
|
|
932
936
|
show: { type: Boolean }
|
|
933
937
|
},
|
|
934
938
|
emits: ["update:show", "submitted"],
|
|
935
|
-
setup(
|
|
936
|
-
const s =
|
|
939
|
+
setup(c, { expose: u, emit: l }) {
|
|
940
|
+
const s = c, S = l, f = Re(), r = Ue(), m = ve(), k = de(), v = T(!1);
|
|
937
941
|
function o() {
|
|
938
|
-
|
|
942
|
+
a(je(i));
|
|
939
943
|
}
|
|
940
|
-
const
|
|
941
|
-
|
|
944
|
+
const g = T();
|
|
945
|
+
u({
|
|
942
946
|
validateInputs: () => {
|
|
943
947
|
var w, V;
|
|
944
|
-
(V = (w =
|
|
948
|
+
(V = (w = g.value) == null ? void 0 : w.validateInputs) == null || V.call(w);
|
|
945
949
|
},
|
|
946
950
|
resetInputsValidation: () => {
|
|
947
951
|
var w, V;
|
|
948
|
-
(V = (w =
|
|
952
|
+
(V = (w = g.value) == null ? void 0 : w.resetInputsValidation) == null || V.call(w);
|
|
949
953
|
},
|
|
950
954
|
resetInputs: () => {
|
|
951
955
|
var w, V;
|
|
952
|
-
(V = (w =
|
|
956
|
+
(V = (w = g.value) == null ? void 0 : w.resetInputs) == null || V.call(w);
|
|
953
957
|
}
|
|
954
958
|
});
|
|
955
|
-
const
|
|
959
|
+
const h = Ie(s, "show"), i = st({
|
|
956
960
|
remark: "",
|
|
957
961
|
adjustments: [
|
|
958
962
|
{
|
|
@@ -961,23 +965,23 @@ const Ce = {
|
|
|
961
965
|
doc: s.stock,
|
|
962
966
|
measurement: null,
|
|
963
967
|
remark: "",
|
|
964
|
-
amount:
|
|
968
|
+
amount: pe(1)
|
|
965
969
|
}
|
|
966
970
|
]
|
|
967
971
|
});
|
|
968
972
|
ge([() => s.show], ([w]) => {
|
|
969
|
-
w && (
|
|
973
|
+
w && (i.remark = "", i.adjustments = [
|
|
970
974
|
{
|
|
971
975
|
id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
|
|
972
976
|
type: te.enum.PURCHASE,
|
|
973
977
|
doc: s.stock,
|
|
974
978
|
measurement: null,
|
|
975
979
|
remark: "",
|
|
976
|
-
amount:
|
|
980
|
+
amount: pe(1)
|
|
977
981
|
}
|
|
978
982
|
]);
|
|
979
983
|
});
|
|
980
|
-
async function
|
|
984
|
+
async function a(w) {
|
|
981
985
|
v.value = !0;
|
|
982
986
|
try {
|
|
983
987
|
await m.adjustSku({
|
|
@@ -990,9 +994,9 @@ const Ce = {
|
|
|
990
994
|
doc: V,
|
|
991
995
|
type: H
|
|
992
996
|
}))
|
|
993
|
-
}),
|
|
997
|
+
}), S("update:show", !1), S("submitted");
|
|
994
998
|
} catch (V) {
|
|
995
|
-
|
|
999
|
+
k.open({
|
|
996
1000
|
title: "Something went wrong",
|
|
997
1001
|
message: "Cannot adjust ingredients. Please try again.",
|
|
998
1002
|
type: "error"
|
|
@@ -1006,8 +1010,8 @@ const Ce = {
|
|
|
1006
1010
|
label: M.name,
|
|
1007
1011
|
sublabel: M.code,
|
|
1008
1012
|
value: M._id
|
|
1009
|
-
})), V = w.filter((M) =>
|
|
1010
|
-
|
|
1013
|
+
})), V = w.filter((M) => i.adjustments.find((H) => H.doc._id === M.value)).map((M) => M.value);
|
|
1014
|
+
r.open({
|
|
1011
1015
|
title: "Select ingredients",
|
|
1012
1016
|
contentComponent: jt,
|
|
1013
1017
|
contentComponentProps: {
|
|
@@ -1027,26 +1031,26 @@ const Ce = {
|
|
|
1027
1031
|
variant: "tertiary"
|
|
1028
1032
|
}
|
|
1029
1033
|
}).onPrimary((M) => {
|
|
1030
|
-
|
|
1031
|
-
(H) =>
|
|
1034
|
+
i.adjustments = M.map(
|
|
1035
|
+
(H) => i.adjustments.find((P) => P.doc._id === H) ?? {
|
|
1032
1036
|
id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
|
|
1033
1037
|
type: te.enum.PURCHASE,
|
|
1034
1038
|
doc: f.skus.find((P) => P._id === H),
|
|
1035
1039
|
measurement: null,
|
|
1036
1040
|
remark: "",
|
|
1037
|
-
amount:
|
|
1041
|
+
amount: pe(1)
|
|
1038
1042
|
}
|
|
1039
1043
|
);
|
|
1040
1044
|
});
|
|
1041
1045
|
}
|
|
1042
|
-
function
|
|
1043
|
-
|
|
1046
|
+
function R(w) {
|
|
1047
|
+
i.adjustments.splice(w, 1);
|
|
1044
1048
|
}
|
|
1045
1049
|
return (w, V) => {
|
|
1046
1050
|
const M = $("FmTextarea"), H = $("FmButton"), P = $("FmForm"), L = $("FmSideSheet");
|
|
1047
|
-
return
|
|
1048
|
-
modelValue: C(
|
|
1049
|
-
"onUpdate:modelValue": V[2] || (V[2] = (z) => De(
|
|
1051
|
+
return x(), N(L, {
|
|
1052
|
+
modelValue: C(h),
|
|
1053
|
+
"onUpdate:modelValue": V[2] || (V[2] = (z) => De(h) ? h.value = z : null),
|
|
1050
1054
|
"dismiss-away": "",
|
|
1051
1055
|
"max-width": 500
|
|
1052
1056
|
}, {
|
|
@@ -1054,32 +1058,32 @@ const Ce = {
|
|
|
1054
1058
|
fn
|
|
1055
1059
|
]),
|
|
1056
1060
|
default: B(() => [
|
|
1057
|
-
|
|
1061
|
+
b(P, {
|
|
1058
1062
|
class: "w-full flex flex-col gap-12",
|
|
1059
1063
|
ref_key: "formRef",
|
|
1060
|
-
ref:
|
|
1064
|
+
ref: g,
|
|
1061
1065
|
onValidationSuccess: o
|
|
1062
1066
|
}, {
|
|
1063
1067
|
default: B(() => [
|
|
1064
|
-
|
|
1068
|
+
b(M, {
|
|
1065
1069
|
label: "Remark",
|
|
1066
|
-
modelValue:
|
|
1067
|
-
"onUpdate:modelValue": V[0] || (V[0] = (z) =>
|
|
1070
|
+
modelValue: i.remark,
|
|
1071
|
+
"onUpdate:modelValue": V[0] || (V[0] = (z) => i.remark = z)
|
|
1068
1072
|
}, null, 8, ["modelValue"]),
|
|
1069
1073
|
e("div", vn, [
|
|
1070
1074
|
_n,
|
|
1071
|
-
|
|
1075
|
+
b(H, {
|
|
1072
1076
|
"prepend-icon": "add",
|
|
1073
1077
|
variant: "tertiary",
|
|
1074
1078
|
size: "md",
|
|
1075
1079
|
onClick: I
|
|
1076
1080
|
})
|
|
1077
1081
|
]),
|
|
1078
|
-
(
|
|
1082
|
+
(x(!0), j(ne, null, re(i.adjustments, (z, O) => (x(), N(pn, {
|
|
1079
1083
|
key: z.id,
|
|
1080
|
-
modelValue:
|
|
1081
|
-
"onUpdate:modelValue": (J) =>
|
|
1082
|
-
"onClick:delete": (J) =>
|
|
1084
|
+
modelValue: i.adjustments[O],
|
|
1085
|
+
"onUpdate:modelValue": (J) => i.adjustments[O] = J,
|
|
1086
|
+
"onClick:delete": (J) => R(O)
|
|
1083
1087
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "onClick:delete"]))), 128))
|
|
1084
1088
|
]),
|
|
1085
1089
|
_: 1
|
|
@@ -1087,12 +1091,12 @@ const Ce = {
|
|
|
1087
1091
|
]),
|
|
1088
1092
|
"side-sheet-footer": B(() => [
|
|
1089
1093
|
e("div", yn, [
|
|
1090
|
-
|
|
1094
|
+
b(H, {
|
|
1091
1095
|
label: "Adjust",
|
|
1092
1096
|
loading: v.value,
|
|
1093
1097
|
onClick: V[1] || (V[1] = (z) => {
|
|
1094
1098
|
var O, J;
|
|
1095
|
-
return (J = (O =
|
|
1099
|
+
return (J = (O = g.value) == null ? void 0 : O.validateInputs) == null ? void 0 : J.call(O);
|
|
1096
1100
|
})
|
|
1097
1101
|
}, null, 8, ["loading"])
|
|
1098
1102
|
])
|
|
@@ -1101,22 +1105,22 @@ const Ce = {
|
|
|
1101
1105
|
}, 8, ["modelValue"]);
|
|
1102
1106
|
};
|
|
1103
1107
|
}
|
|
1104
|
-
}), hn = We((
|
|
1108
|
+
}), hn = We((c, u) => ({
|
|
1105
1109
|
// TODO: remove once latest inventory backend has been push
|
|
1106
|
-
async findBillsByBusinessId(l, s,
|
|
1107
|
-
const f = `${
|
|
1110
|
+
async findBillsByBusinessId(l, s, S) {
|
|
1111
|
+
const f = `${c.businessesBackendUrl}/${l}/reports/find-many`, r = {
|
|
1108
1112
|
// type: TYPE.bill,
|
|
1109
1113
|
type: "bill",
|
|
1110
1114
|
restaurantIds: s,
|
|
1111
|
-
ids:
|
|
1115
|
+
ids: S
|
|
1112
1116
|
};
|
|
1113
|
-
return await
|
|
1117
|
+
return await u.post(f, r);
|
|
1114
1118
|
},
|
|
1115
1119
|
async findBillsById(l) {
|
|
1116
|
-
const
|
|
1120
|
+
const S = ue().currentLocationDBName, f = `${c.inventoryBackendUrl}/${S}/bill/search`, r = {
|
|
1117
1121
|
ids: l
|
|
1118
1122
|
};
|
|
1119
|
-
return await
|
|
1123
|
+
return await u.post(f, r);
|
|
1120
1124
|
}
|
|
1121
1125
|
})), bn = { class: "p-16" }, kn = { class: "fm-typo-en-body-md-600 flex-grow" }, xn = { class: "flex-grow text-fm-color-typo-secondary" }, Sn = {
|
|
1122
1126
|
key: 0,
|
|
@@ -1134,85 +1138,85 @@ const Ce = {
|
|
|
1134
1138
|
sku: {},
|
|
1135
1139
|
bills: { default: () => [] }
|
|
1136
1140
|
},
|
|
1137
|
-
setup(
|
|
1138
|
-
const
|
|
1141
|
+
setup(c) {
|
|
1142
|
+
const u = c, l = T(!1), s = T(), S = T(null), f = U(() => S.value === null ? "unset" : l.value ? `${S.value}px` : "0px");
|
|
1139
1143
|
Me(() => {
|
|
1140
|
-
var
|
|
1141
|
-
|
|
1144
|
+
var k;
|
|
1145
|
+
S.value = ((k = s.value) == null ? void 0 : k.scrollHeight) || 0;
|
|
1142
1146
|
});
|
|
1143
|
-
const
|
|
1144
|
-
var
|
|
1145
|
-
const
|
|
1147
|
+
const r = U(() => {
|
|
1148
|
+
var i;
|
|
1149
|
+
const k = u.record.adjustments, v = u.sku, o = {}, h = k.flatMap((a) => {
|
|
1146
1150
|
var I;
|
|
1147
|
-
return ((I =
|
|
1148
|
-
}).flatMap((
|
|
1149
|
-
for (const
|
|
1150
|
-
const I =
|
|
1151
|
-
o[
|
|
1151
|
+
return ((I = a.skus) == null ? void 0 : I.filter((R) => R.sku._id === v._id)) ?? [];
|
|
1152
|
+
}).flatMap((a) => a.amounts);
|
|
1153
|
+
for (const a of h) {
|
|
1154
|
+
const I = a.measurement ? bt(a.measurement.conversion, a.amount) : a.amount;
|
|
1155
|
+
o[i = a.type] ?? (o[i] = { amount: 0, precision: 0 }), o[a.type] = Ze(I, o[a.type]);
|
|
1152
1156
|
}
|
|
1153
1157
|
return Object.entries(o).reduce(
|
|
1154
|
-
(
|
|
1158
|
+
(a, [I, R]) => (a[I] = /// comment, because without it formatter makes code uglier
|
|
1155
1159
|
`${W.toFormatString({
|
|
1156
|
-
value:
|
|
1160
|
+
value: R,
|
|
1157
1161
|
precision: 4
|
|
1158
|
-
})} ${v.unit.abbrev}`,
|
|
1162
|
+
})} ${v.unit.abbrev}`, a),
|
|
1159
1163
|
{}
|
|
1160
1164
|
);
|
|
1161
|
-
}), m =
|
|
1162
|
-
time: kt(new Date(
|
|
1165
|
+
}), m = U(() => u.record.adjustmentsByTime.map(({ date: k, adjustments: v }) => ({
|
|
1166
|
+
time: kt(new Date(k)),
|
|
1163
1167
|
adjustments: v.flatMap(
|
|
1164
1168
|
(o) => {
|
|
1165
|
-
var
|
|
1166
|
-
return ((
|
|
1167
|
-
...
|
|
1169
|
+
var g, h;
|
|
1170
|
+
return ((h = (g = o.skus) == null ? void 0 : g.map) == null ? void 0 : h.call(g, (i) => ({
|
|
1171
|
+
...i,
|
|
1168
1172
|
ref: o.ref,
|
|
1169
1173
|
backdateFrom: o.effectiveAt != null ? Xe(o._id) : null
|
|
1170
1174
|
}))) ?? [];
|
|
1171
1175
|
}
|
|
1172
1176
|
).flatMap((o) => {
|
|
1173
|
-
var
|
|
1174
|
-
const
|
|
1175
|
-
return o.amounts.map((
|
|
1177
|
+
var i;
|
|
1178
|
+
const g = (i = u.bills.find((a) => a._id === o.ref)) == null ? void 0 : i.seqNumber, h = g ? `Bill ${g}` : "";
|
|
1179
|
+
return o.amounts.map((a) => {
|
|
1176
1180
|
var I;
|
|
1177
1181
|
return {
|
|
1178
|
-
amount: `${W.toFormatString({ value:
|
|
1182
|
+
amount: `${W.toFormatString({ value: a.amount, precision: 4 })} ${((I = a.measurement) == null ? void 0 : I.abbrev) ?? o.sku.unit.abbrev}`,
|
|
1179
1183
|
backdateFrom: o.backdateFrom,
|
|
1180
|
-
name:
|
|
1181
|
-
remark:
|
|
1182
|
-
cost:
|
|
1184
|
+
name: a.type,
|
|
1185
|
+
remark: a.remark || h || "",
|
|
1186
|
+
cost: a.cost
|
|
1183
1187
|
};
|
|
1184
1188
|
});
|
|
1185
1189
|
})
|
|
1186
1190
|
})));
|
|
1187
|
-
return (
|
|
1188
|
-
const o = $("FmIcon"),
|
|
1189
|
-
return
|
|
1191
|
+
return (k, v) => {
|
|
1192
|
+
const o = $("FmIcon"), g = $("FmTooltip"), h = $("FmCard");
|
|
1193
|
+
return x(), N(h, { variant: "outlined" }, {
|
|
1190
1194
|
default: B(() => [
|
|
1191
1195
|
e("div", bn, [
|
|
1192
1196
|
e("div", {
|
|
1193
1197
|
class: "flex items-center cursor-pointer mb-1",
|
|
1194
|
-
onClick: v[0] || (v[0] = (
|
|
1198
|
+
onClick: v[0] || (v[0] = (i) => l.value = !l.value)
|
|
1195
1199
|
}, [
|
|
1196
|
-
e("div", kn, A(
|
|
1197
|
-
|
|
1200
|
+
e("div", kn, A(k.record.date), 1),
|
|
1201
|
+
b(o, {
|
|
1198
1202
|
name: l.value ? "expand_more" : "expand_less",
|
|
1199
1203
|
color: "#777777",
|
|
1200
1204
|
size: "md"
|
|
1201
1205
|
}, null, 8, ["name"])
|
|
1202
1206
|
]),
|
|
1203
|
-
(
|
|
1204
|
-
key:
|
|
1207
|
+
(x(!0), j(ne, null, re(r.value, (i, a) => (x(), j("div", {
|
|
1208
|
+
key: a,
|
|
1205
1209
|
class: "flex flex-row py-1",
|
|
1206
1210
|
style: { "font-size": "0.8rem" }
|
|
1207
1211
|
}, [
|
|
1208
|
-
e("div", xn, A(
|
|
1212
|
+
e("div", xn, A(a), 1),
|
|
1209
1213
|
e("div", {
|
|
1210
|
-
class:
|
|
1211
|
-
"text-fm-color-typo-error":
|
|
1212
|
-
"text-fm-color-typo-success": !
|
|
1214
|
+
class: fe({
|
|
1215
|
+
"text-fm-color-typo-error": i.startsWith("-"),
|
|
1216
|
+
"text-fm-color-typo-success": !i.startsWith("-"),
|
|
1213
1217
|
"ml-auto": !0
|
|
1214
1218
|
})
|
|
1215
|
-
}, A(
|
|
1219
|
+
}, A(i), 3)
|
|
1216
1220
|
]))), 128)),
|
|
1217
1221
|
e("div", {
|
|
1218
1222
|
ref_key: "detailRef",
|
|
@@ -1224,30 +1228,30 @@ const Ce = {
|
|
|
1224
1228
|
transition: "max-height 0.2s ease-out"
|
|
1225
1229
|
})
|
|
1226
1230
|
}, [
|
|
1227
|
-
m.value.length ? (
|
|
1228
|
-
(
|
|
1229
|
-
key:
|
|
1231
|
+
m.value.length ? (x(), j("hr", Sn)) : Z("", !0),
|
|
1232
|
+
(x(!0), j(ne, null, re(m.value, (i) => (x(), j("div", {
|
|
1233
|
+
key: i.time,
|
|
1230
1234
|
class: "flex gap-1 w-full"
|
|
1231
1235
|
}, [
|
|
1232
|
-
e("div", $n, A(
|
|
1236
|
+
e("div", $n, A(i.time), 1),
|
|
1233
1237
|
e("div", wn, [
|
|
1234
|
-
(
|
|
1235
|
-
key:
|
|
1238
|
+
(x(!0), j(ne, null, re(i.adjustments, (a) => (x(), j("div", {
|
|
1239
|
+
key: a.name,
|
|
1236
1240
|
class: "flex gap-1"
|
|
1237
1241
|
}, [
|
|
1238
1242
|
e("div", Fn, [
|
|
1239
|
-
|
|
1240
|
-
|
|
1243
|
+
ce(A(a.name) + " ", 1),
|
|
1244
|
+
a.backdateFrom ? (x(), N(g, {
|
|
1241
1245
|
key: 0,
|
|
1242
1246
|
variant: "plain",
|
|
1243
1247
|
placement: "top",
|
|
1244
1248
|
"z-index": 50
|
|
1245
1249
|
}, {
|
|
1246
1250
|
content: B(() => [
|
|
1247
|
-
e("div", Cn, " Backdate from " + A(C(et)(new Date(
|
|
1251
|
+
e("div", Cn, " Backdate from " + A(C(et)(new Date(a.backdateFrom))), 1)
|
|
1248
1252
|
]),
|
|
1249
1253
|
default: B(() => [
|
|
1250
|
-
|
|
1254
|
+
b(o, {
|
|
1251
1255
|
name: "info",
|
|
1252
1256
|
size: "sm",
|
|
1253
1257
|
color: "primary"
|
|
@@ -1255,16 +1259,16 @@ const Ce = {
|
|
|
1255
1259
|
]),
|
|
1256
1260
|
_: 2
|
|
1257
1261
|
}, 1024)) : Z("", !0),
|
|
1258
|
-
|
|
1262
|
+
a.remark ? (x(), j("span", Bn, " # " + A(a.remark), 1)) : Z("", !0)
|
|
1259
1263
|
]),
|
|
1260
1264
|
e("div", {
|
|
1261
|
-
class:
|
|
1262
|
-
"text-fm-color-typo-error":
|
|
1263
|
-
"text-fm-color-typo-success": !
|
|
1265
|
+
class: fe({
|
|
1266
|
+
"text-fm-color-typo-error": a.amount.startsWith("-"),
|
|
1267
|
+
"text-fm-color-typo-success": !a.amount.startsWith("-"),
|
|
1264
1268
|
"ml-auto": !0
|
|
1265
1269
|
})
|
|
1266
|
-
}, A(
|
|
1267
|
-
|
|
1270
|
+
}, A(a.amount), 3),
|
|
1271
|
+
a.cost ? (x(), j("div", An, " (" + A(C(Ae)(a.cost, !1, a.cost.precision)) + ") ", 1)) : Z("", !0)
|
|
1268
1272
|
]))), 128))
|
|
1269
1273
|
])
|
|
1270
1274
|
]))), 128))
|
|
@@ -1276,81 +1280,65 @@ const Ce = {
|
|
|
1276
1280
|
};
|
|
1277
1281
|
}
|
|
1278
1282
|
});
|
|
1279
|
-
function Dn(
|
|
1283
|
+
function Dn(c, u) {
|
|
1280
1284
|
var f;
|
|
1281
1285
|
const l = Object.keys(te.enum).reduce(
|
|
1282
|
-
(
|
|
1286
|
+
(r, m) => (r[m] = { amount: 0, precision: 0 }, r),
|
|
1283
1287
|
{}
|
|
1284
1288
|
);
|
|
1285
|
-
if (!
|
|
1289
|
+
if (!u)
|
|
1286
1290
|
return Object.entries(l).reduce(
|
|
1287
|
-
(
|
|
1291
|
+
(r, [m]) => (r[m] = W.fromNumber(0), r),
|
|
1288
1292
|
{}
|
|
1289
1293
|
);
|
|
1290
|
-
const
|
|
1294
|
+
const S = c.flatMap((r) => {
|
|
1291
1295
|
var m;
|
|
1292
|
-
return ((m =
|
|
1293
|
-
}).flatMap((
|
|
1294
|
-
for (const
|
|
1295
|
-
const m =
|
|
1296
|
-
l[f =
|
|
1296
|
+
return ((m = r.skus) == null ? void 0 : m.filter((k) => k.sku._id === u._id)) ?? [];
|
|
1297
|
+
}).flatMap((r) => r.amounts);
|
|
1298
|
+
for (const r of S) {
|
|
1299
|
+
const m = r.measurement ? W.multiply([r.measurement.conversion, r.amount]) : r.amount;
|
|
1300
|
+
l[f = r.type] ?? (l[f] = { amount: 0, precision: 0 }), l[r.type] = W.add([m, l[r.type]]);
|
|
1297
1301
|
}
|
|
1298
1302
|
return Object.entries(l).reduce(
|
|
1299
|
-
(
|
|
1303
|
+
(r, [m, k]) => {
|
|
1300
1304
|
const v = {
|
|
1301
|
-
...
|
|
1302
|
-
amount: Math.abs(
|
|
1305
|
+
...k,
|
|
1306
|
+
amount: Math.abs(k.amount)
|
|
1303
1307
|
};
|
|
1304
|
-
return
|
|
1308
|
+
return r[m] = /// comment, because without it formatter makes code uglier
|
|
1305
1309
|
`${W.toFormatString({
|
|
1306
1310
|
value: v,
|
|
1307
1311
|
precision: 4
|
|
1308
|
-
})} ${
|
|
1312
|
+
})} ${u.unit.abbrev}`, r;
|
|
1309
1313
|
},
|
|
1310
1314
|
{}
|
|
1311
1315
|
);
|
|
1312
1316
|
}
|
|
1313
|
-
function Mn(
|
|
1314
|
-
if (!
|
|
1317
|
+
function Mn(c, u) {
|
|
1318
|
+
if (!u)
|
|
1315
1319
|
return null;
|
|
1316
1320
|
let l = null;
|
|
1317
|
-
const
|
|
1318
|
-
var
|
|
1319
|
-
return ((
|
|
1321
|
+
const S = c.flatMap((f) => {
|
|
1322
|
+
var r;
|
|
1323
|
+
return ((r = f.skus) == null ? void 0 : r.filter((m) => m.sku._id === u._id)) ?? [];
|
|
1320
1324
|
}).flatMap((f) => {
|
|
1321
|
-
var
|
|
1322
|
-
return !f.history || ((
|
|
1325
|
+
var r;
|
|
1326
|
+
return !f.history || ((r = f.history) == null ? void 0 : r.length) === 0 ? [] : f.history[0];
|
|
1323
1327
|
});
|
|
1324
|
-
for (const f of
|
|
1325
|
-
const
|
|
1326
|
-
for (const m of
|
|
1328
|
+
for (const f of S) {
|
|
1329
|
+
const r = f.amounts;
|
|
1330
|
+
for (const m of r) {
|
|
1327
1331
|
if (m.type !== te.Enum.SALES)
|
|
1328
1332
|
continue;
|
|
1329
|
-
const
|
|
1330
|
-
l ?? (l = W.fromNumber(0)), l = W.add([l,
|
|
1333
|
+
const k = m.measurement ? W.multiply([m.measurement.conversion, m.amount]) : m.amount;
|
|
1334
|
+
l ?? (l = W.fromNumber(0)), l = W.add([l, k]);
|
|
1331
1335
|
}
|
|
1332
1336
|
}
|
|
1333
1337
|
return l != null ? (l.amount = Math.abs(l.amount), `${W.toFormatString({
|
|
1334
1338
|
value: l,
|
|
1335
1339
|
precision: 4
|
|
1336
|
-
})} ${
|
|
1340
|
+
})} ${u.unit.abbrev}`) : null;
|
|
1337
1341
|
}
|
|
1338
|
-
Array.prototype.computeFirst = function(u) {
|
|
1339
|
-
const a = this.length;
|
|
1340
|
-
for (let l = 0; l < a; l++) {
|
|
1341
|
-
const s = this.at(l), g = u(s, l, this);
|
|
1342
|
-
if (g != null)
|
|
1343
|
-
return g;
|
|
1344
|
-
}
|
|
1345
|
-
};
|
|
1346
|
-
Array.prototype.computeLast = function(u) {
|
|
1347
|
-
const a = this.length - 1;
|
|
1348
|
-
for (let l = a; l >= 0; l--) {
|
|
1349
|
-
const s = this.at(l), g = u(s, l, this);
|
|
1350
|
-
if (g != null)
|
|
1351
|
-
return g;
|
|
1352
|
-
}
|
|
1353
|
-
};
|
|
1354
1342
|
const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = { class: "flex-1 line-clamp-2" }, Un = { class: "flex flex-col gap-32 w-full h-full" }, In = { class: "flex items-center relative gap-4" }, Tn = { class: "flex-1" }, Pn = {
|
|
1355
1343
|
key: 0,
|
|
1356
1344
|
class: "flex-1 flex flex-col items-center gap-16"
|
|
@@ -1375,10 +1363,10 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1375
1363
|
show: { type: Boolean }
|
|
1376
1364
|
},
|
|
1377
1365
|
emits: ["update:show"],
|
|
1378
|
-
setup(
|
|
1379
|
-
const
|
|
1380
|
-
async function
|
|
1381
|
-
|
|
1366
|
+
setup(c) {
|
|
1367
|
+
const u = Qe(), l = Te(), s = ve(), S = hn(), f = ue(), r = it(), m = c, k = T(!1), v = de(), o = T(Ut(0));
|
|
1368
|
+
async function g() {
|
|
1369
|
+
k.value = !0;
|
|
1382
1370
|
try {
|
|
1383
1371
|
await w(), await l.readStockBalance();
|
|
1384
1372
|
} catch (t) {
|
|
@@ -1388,19 +1376,19 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1388
1376
|
type: "error"
|
|
1389
1377
|
}), console.log("failed at fetching item adjustment history", m.sku, o, t);
|
|
1390
1378
|
} finally {
|
|
1391
|
-
|
|
1379
|
+
k.value = !1;
|
|
1392
1380
|
}
|
|
1393
1381
|
}
|
|
1394
1382
|
Me(() => {
|
|
1395
|
-
|
|
1383
|
+
g();
|
|
1396
1384
|
}), ge([() => o.value, () => m.sku], () => {
|
|
1397
|
-
|
|
1385
|
+
g();
|
|
1398
1386
|
});
|
|
1399
|
-
const
|
|
1387
|
+
const h = T([]), i = T([]), a = T(new Array());
|
|
1400
1388
|
function I(t, n) {
|
|
1401
1389
|
return n === "day" ? Ct(t) : et(t);
|
|
1402
1390
|
}
|
|
1403
|
-
function
|
|
1391
|
+
function R(t, n) {
|
|
1404
1392
|
const p = t.reduce(
|
|
1405
1393
|
(d, y) => {
|
|
1406
1394
|
const _ = y.effectiveAt ?? Xe(y._id);
|
|
@@ -1422,30 +1410,30 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1422
1410
|
St(new Date(o.value.startDate)).toISOString(),
|
|
1423
1411
|
$t(new Date(o.value.endDate)).toISOString()
|
|
1424
1412
|
);
|
|
1425
|
-
|
|
1413
|
+
h.value = t;
|
|
1426
1414
|
const n = t.filter(({ ref: p }) => p == null ? void 0 : p.startsWith("bill_")).map(({ ref: p }) => p);
|
|
1427
|
-
await V(n),
|
|
1415
|
+
await V(n), i.value = R(t, "day").map(({ date: p, adjustments: d }) => ({
|
|
1428
1416
|
date: p,
|
|
1429
1417
|
adjustments: d,
|
|
1430
|
-
adjustmentsByTime:
|
|
1418
|
+
adjustmentsByTime: R(d, "minute")
|
|
1431
1419
|
}));
|
|
1432
1420
|
}
|
|
1433
1421
|
async function V(t) {
|
|
1434
|
-
t.length && (
|
|
1422
|
+
t.length && (a.value = await S.findBillsById(t).catch((n) => {
|
|
1435
1423
|
var y;
|
|
1436
1424
|
console.error("Error on using latest bill API, retrying using legacy api", n);
|
|
1437
|
-
const p = ((y =
|
|
1438
|
-
return
|
|
1425
|
+
const p = ((y = u.currentBusiness.value) == null ? void 0 : y._id) ?? "", d = f.currentLocation.doc._id;
|
|
1426
|
+
return S.findBillsByBusinessId(p, [d], t);
|
|
1439
1427
|
}));
|
|
1440
1428
|
}
|
|
1441
|
-
const M =
|
|
1442
|
-
const t =
|
|
1429
|
+
const M = U(() => {
|
|
1430
|
+
const t = h.value, n = m.sku;
|
|
1443
1431
|
return Dn(t, n);
|
|
1444
|
-
}), H =
|
|
1445
|
-
const t =
|
|
1432
|
+
}), H = U(() => {
|
|
1433
|
+
const t = h.value, n = m.sku;
|
|
1446
1434
|
return Mn(t, n);
|
|
1447
|
-
}), P =
|
|
1448
|
-
const t = [...
|
|
1435
|
+
}), P = U(() => {
|
|
1436
|
+
const t = [...h.value].computeFirst((p) => {
|
|
1449
1437
|
var y, _;
|
|
1450
1438
|
const d = (_ = (y = p.skus) == null ? void 0 : y.find) == null ? void 0 : _.call(y, (F) => F.sku._id === m.sku._id);
|
|
1451
1439
|
return d == null ? void 0 : d.fromBalance;
|
|
@@ -1457,8 +1445,8 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1457
1445
|
value: t,
|
|
1458
1446
|
precision: 4
|
|
1459
1447
|
})} ${n.unit.abbrev}` : "";
|
|
1460
|
-
}), L =
|
|
1461
|
-
const t = [...
|
|
1448
|
+
}), L = U(() => {
|
|
1449
|
+
const t = [...h.value].reverse().computeFirst((p) => {
|
|
1462
1450
|
var y, _;
|
|
1463
1451
|
const d = (_ = (y = p.skus) == null ? void 0 : y.find) == null ? void 0 : _.call(y, (F) => F.sku._id === m.sku._id);
|
|
1464
1452
|
return d == null ? void 0 : d.toBalance;
|
|
@@ -1480,9 +1468,9 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1480
1468
|
return "MYR";
|
|
1481
1469
|
}
|
|
1482
1470
|
}
|
|
1483
|
-
const O =
|
|
1471
|
+
const O = U(() => {
|
|
1484
1472
|
var p;
|
|
1485
|
-
const n =
|
|
1473
|
+
const n = h.value.flatMap((d) => {
|
|
1486
1474
|
var y;
|
|
1487
1475
|
return ((y = d.skus) == null ? void 0 : y.flatMap((_) => _.amounts)) ?? [];
|
|
1488
1476
|
}).filter((d) => d.amount.amount < 0).reduce(
|
|
@@ -1501,7 +1489,7 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1501
1489
|
{
|
|
1502
1490
|
amount: 0,
|
|
1503
1491
|
precision: 0,
|
|
1504
|
-
currency: z(((p =
|
|
1492
|
+
currency: z(((p = u.currentCountry) == null ? void 0 : p.value) ?? Ne)
|
|
1505
1493
|
}
|
|
1506
1494
|
);
|
|
1507
1495
|
return Ae(n, !1, n.precision);
|
|
@@ -1513,9 +1501,9 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1513
1501
|
endDate: n
|
|
1514
1502
|
});
|
|
1515
1503
|
}
|
|
1516
|
-
const Q =
|
|
1504
|
+
const Q = U(() => {
|
|
1517
1505
|
var p;
|
|
1518
|
-
const t = [...
|
|
1506
|
+
const t = [...h.value].reverse().computeFirst((d) => {
|
|
1519
1507
|
var _, F;
|
|
1520
1508
|
const y = (F = (_ = d.skus) == null ? void 0 : _.find) == null ? void 0 : F.call(_, (Y) => Y.sku._id === m.sku._id);
|
|
1521
1509
|
return y == null ? void 0 : y.toCostBalances;
|
|
@@ -1525,7 +1513,7 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1525
1513
|
amount: 0,
|
|
1526
1514
|
precision: 0
|
|
1527
1515
|
}),
|
|
1528
|
-
currency: z(((p =
|
|
1516
|
+
currency: z(((p = u.currentCountry) == null ? void 0 : p.value) ?? Ne)
|
|
1529
1517
|
} : "No data";
|
|
1530
1518
|
});
|
|
1531
1519
|
function se() {
|
|
@@ -1538,7 +1526,7 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1538
1526
|
const X = Ie(m, "show");
|
|
1539
1527
|
return (t, n) => {
|
|
1540
1528
|
const p = $("FmButton"), d = $("FmField"), y = $("FmDateRangePicker"), _ = $("FmSpacer"), F = $("FmCircularProgress"), Y = $("FmIcon"), K = $("FmTooltip"), le = $("FmMenuDivider"), D = $("FmCardSection"), E = $("FmCard"), q = $("FmSideSheet");
|
|
1541
|
-
return
|
|
1529
|
+
return x(), N(q, {
|
|
1542
1530
|
"dismiss-away": "",
|
|
1543
1531
|
modelValue: C(X),
|
|
1544
1532
|
"onUpdate:modelValue": n[4] || (n[4] = (ee) => De(X) ? X.value = ee : null),
|
|
@@ -1548,7 +1536,7 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1548
1536
|
"side-sheet-header": B(() => [
|
|
1549
1537
|
e("div", jn, [
|
|
1550
1538
|
e("div", Rn, A(t.sku.name) + " history", 1),
|
|
1551
|
-
|
|
1539
|
+
b(p, {
|
|
1552
1540
|
variant: "tertiary",
|
|
1553
1541
|
"prepend-icon": "close",
|
|
1554
1542
|
onClick: n[0] || (n[0] = (ee) => X.value = !1)
|
|
@@ -1561,7 +1549,7 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1561
1549
|
e("div", Un, [
|
|
1562
1550
|
e("div", In, [
|
|
1563
1551
|
e("div", Tn, [
|
|
1564
|
-
|
|
1552
|
+
b(y, {
|
|
1565
1553
|
modelValue: o.value,
|
|
1566
1554
|
"onUpdate:modelValue": n[1] || (n[1] = (G) => o.value = G),
|
|
1567
1555
|
"show-predefined-range": "",
|
|
@@ -1570,12 +1558,12 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1570
1558
|
"z-index": 50
|
|
1571
1559
|
}, {
|
|
1572
1560
|
"trigger-button": B(({ opened: G }) => [
|
|
1573
|
-
|
|
1561
|
+
b(d, {
|
|
1574
1562
|
"prepend-icon": "calendar_month",
|
|
1575
1563
|
focused: G
|
|
1576
1564
|
}, {
|
|
1577
1565
|
default: B(() => [
|
|
1578
|
-
|
|
1566
|
+
ce(A(o.value.startDate) + " - " + A(o.value.endDate), 1)
|
|
1579
1567
|
]),
|
|
1580
1568
|
_: 2
|
|
1581
1569
|
}, 1032, ["focused"])
|
|
@@ -1583,27 +1571,27 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1583
1571
|
_: 1
|
|
1584
1572
|
}, 8, ["modelValue"])
|
|
1585
1573
|
]),
|
|
1586
|
-
|
|
1574
|
+
b(p, {
|
|
1587
1575
|
variant: "tertiary",
|
|
1588
1576
|
onClick: n[2] || (n[2] = (G) => J()),
|
|
1589
1577
|
"prepend-icon": "navigate_before"
|
|
1590
1578
|
}),
|
|
1591
|
-
|
|
1579
|
+
b(p, {
|
|
1592
1580
|
variant: "tertiary",
|
|
1593
1581
|
onClick: n[3] || (n[3] = (G) => se()),
|
|
1594
1582
|
"prepend-icon": "navigate_next"
|
|
1595
1583
|
})
|
|
1596
1584
|
]),
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1585
|
+
k.value ? (x(), j("div", Pn, [
|
|
1586
|
+
b(_),
|
|
1587
|
+
b(F, { size: "xl" }),
|
|
1600
1588
|
En,
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
])) :
|
|
1604
|
-
|
|
1589
|
+
b(_),
|
|
1590
|
+
b(_)
|
|
1591
|
+
])) : i.value && ((ee = i.value) == null ? void 0 : ee.length) > 0 ? (x(), j("div", Hn, [
|
|
1592
|
+
b(E, { variant: "outlined" }, {
|
|
1605
1593
|
default: B(() => [
|
|
1606
|
-
|
|
1594
|
+
b(D, { class: "flex flex-col gap-4" }, {
|
|
1607
1595
|
default: B(() => [
|
|
1608
1596
|
Ln,
|
|
1609
1597
|
e("div", Nn, [
|
|
@@ -1613,8 +1601,8 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1613
1601
|
]),
|
|
1614
1602
|
e("div", qn, [
|
|
1615
1603
|
e("div", Kn, [
|
|
1616
|
-
|
|
1617
|
-
H.value != null ? (
|
|
1604
|
+
ce(" Total sales "),
|
|
1605
|
+
H.value != null ? (x(), N(K, {
|
|
1618
1606
|
key: 0,
|
|
1619
1607
|
variant: "plain",
|
|
1620
1608
|
placement: "top",
|
|
@@ -1622,7 +1610,7 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1622
1610
|
"z-index": 50
|
|
1623
1611
|
}, {
|
|
1624
1612
|
default: B(() => [
|
|
1625
|
-
|
|
1613
|
+
b(Y, {
|
|
1626
1614
|
name: "warning",
|
|
1627
1615
|
size: "sm"
|
|
1628
1616
|
})
|
|
@@ -1661,22 +1649,22 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1661
1649
|
e("div", _o, A(L.value), 1)
|
|
1662
1650
|
])
|
|
1663
1651
|
]),
|
|
1664
|
-
C(
|
|
1665
|
-
|
|
1652
|
+
C(r).enableTotalCost ? (x(), j("div", yo, [
|
|
1653
|
+
b(le, { class: "w-full" }),
|
|
1666
1654
|
e("div", go, [
|
|
1667
1655
|
e("div", ho, [
|
|
1668
|
-
|
|
1656
|
+
b(ze, { "z-index": 50 }, {
|
|
1669
1657
|
default: B(() => [
|
|
1670
1658
|
e("div", bo, [
|
|
1671
|
-
|
|
1672
|
-
|
|
1659
|
+
ce(" Estimated value "),
|
|
1660
|
+
b(K, {
|
|
1673
1661
|
variant: "plain",
|
|
1674
1662
|
placement: "top",
|
|
1675
1663
|
content: "Estimated value is calculated starting from last closing value.",
|
|
1676
1664
|
"z-index": 50
|
|
1677
1665
|
}, {
|
|
1678
1666
|
default: B(() => [
|
|
1679
|
-
|
|
1667
|
+
b(Y, {
|
|
1680
1668
|
name: "help",
|
|
1681
1669
|
size: "sm"
|
|
1682
1670
|
})
|
|
@@ -1690,11 +1678,11 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1690
1678
|
e("div", ko, A(typeof Q.value != "string" ? C(Ae)(Q.value, !1, Q.value.precision) : Q.value), 1)
|
|
1691
1679
|
]),
|
|
1692
1680
|
e("div", xo, [
|
|
1693
|
-
|
|
1681
|
+
b(ze, { "z-index": 50 }, {
|
|
1694
1682
|
default: B(() => [
|
|
1695
1683
|
e("div", So, [
|
|
1696
1684
|
$o,
|
|
1697
|
-
|
|
1685
|
+
b(K, {
|
|
1698
1686
|
variant: "plain",
|
|
1699
1687
|
placement: "top",
|
|
1700
1688
|
"z-index": 50
|
|
@@ -1703,7 +1691,7 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1703
1691
|
wo
|
|
1704
1692
|
]),
|
|
1705
1693
|
default: B(() => [
|
|
1706
|
-
|
|
1694
|
+
b(Y, {
|
|
1707
1695
|
name: "help",
|
|
1708
1696
|
size: "sm"
|
|
1709
1697
|
})
|
|
@@ -1725,18 +1713,18 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1725
1713
|
_: 1
|
|
1726
1714
|
}),
|
|
1727
1715
|
Co,
|
|
1728
|
-
(
|
|
1716
|
+
(x(!0), j(ne, null, re(i.value, (G) => (x(), j(ne, {
|
|
1729
1717
|
key: G.date
|
|
1730
1718
|
}, [
|
|
1731
|
-
t.sku ? (
|
|
1719
|
+
t.sku ? (x(), N(Vn, {
|
|
1732
1720
|
key: 0,
|
|
1733
1721
|
record: G,
|
|
1734
1722
|
sku: t.sku,
|
|
1735
|
-
bills:
|
|
1723
|
+
bills: a.value
|
|
1736
1724
|
}, null, 8, ["record", "sku", "bills"])) : Z("", !0)
|
|
1737
1725
|
], 64))), 128))
|
|
1738
|
-
])) : (
|
|
1739
|
-
|
|
1726
|
+
])) : (x(), j("div", Bo, [
|
|
1727
|
+
b(_),
|
|
1740
1728
|
e("div", null, [
|
|
1741
1729
|
e("img", {
|
|
1742
1730
|
src: C(It),
|
|
@@ -1745,8 +1733,8 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1745
1733
|
]),
|
|
1746
1734
|
Vo,
|
|
1747
1735
|
Do,
|
|
1748
|
-
|
|
1749
|
-
|
|
1736
|
+
b(_),
|
|
1737
|
+
b(_)
|
|
1750
1738
|
]))
|
|
1751
1739
|
])
|
|
1752
1740
|
];
|
|
@@ -1758,68 +1746,68 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1758
1746
|
}), jo = { class: "flex flex-col gap-24" }, Ro = { key: 0 }, Uo = { key: 0 }, Io = { class: "flex items-center gap-8" }, To = /* @__PURE__ */ e("div", { class: "flex-1" }, "Fetching info...", -1), Po = { key: 1 }, Eo = { key: 2 }, Ho = { class: "flex flex-col w-full gap-24" }, Lo = { class: "fm-typo-en-body-lg-400" }, No = { class: "fm-typo-en-body-lg-600" }, Oo = /* @__PURE__ */ e("div", { class: "fm-typo-en-body-lg-400" }, "Proceed?", -1), Yo = { key: 1 }, zo = { class: "flex gap-8 justify-end" }, qo = /* @__PURE__ */ oe({
|
|
1759
1747
|
__name: "StockRecalculateDialog",
|
|
1760
1748
|
emits: ["close"],
|
|
1761
|
-
setup(
|
|
1762
|
-
const l =
|
|
1763
|
-
var
|
|
1764
|
-
return ((
|
|
1765
|
-
}),
|
|
1766
|
-
Me(
|
|
1767
|
-
async function
|
|
1768
|
-
|
|
1749
|
+
setup(c, { emit: u }) {
|
|
1750
|
+
const l = u, s = ue(), S = ve(), f = U(() => {
|
|
1751
|
+
var i;
|
|
1752
|
+
return ((i = s == null ? void 0 : s._currentLocation) == null ? void 0 : i.type) === Je.restaurant;
|
|
1753
|
+
}), r = T(null), m = T(!1), k = T(""), v = de(), o = T(null);
|
|
1754
|
+
Me(g);
|
|
1755
|
+
async function g() {
|
|
1756
|
+
r.value = !0;
|
|
1769
1757
|
try {
|
|
1770
|
-
const [
|
|
1771
|
-
|
|
1772
|
-
new Promise((
|
|
1758
|
+
const [i] = await Promise.all([
|
|
1759
|
+
S.recalculation.getRecalculateAbility(),
|
|
1760
|
+
new Promise((a) => setTimeout(a, 1e3))
|
|
1773
1761
|
]);
|
|
1774
|
-
m.value =
|
|
1762
|
+
m.value = i.canRecalculate, k.value = i.reason ?? "", o.value = i.lastClosing ? new Date(i.lastClosing) : null;
|
|
1775
1763
|
} catch {
|
|
1776
1764
|
v.open({
|
|
1777
1765
|
type: "error",
|
|
1778
1766
|
title: "Unable to fetch recalculate ability",
|
|
1779
1767
|
message: "Please try again later."
|
|
1780
|
-
}),
|
|
1768
|
+
}), k.value = "Something went wrong.";
|
|
1781
1769
|
} finally {
|
|
1782
|
-
|
|
1770
|
+
r.value = !1;
|
|
1783
1771
|
}
|
|
1784
1772
|
}
|
|
1785
|
-
function
|
|
1773
|
+
function h() {
|
|
1786
1774
|
l("close"), v.open({
|
|
1787
1775
|
title: "Request submitted",
|
|
1788
1776
|
message: "Please wait for 15 minutes for all the changes to be reflected."
|
|
1789
|
-
}),
|
|
1777
|
+
}), S.recalculation.startRecalculateTask();
|
|
1790
1778
|
}
|
|
1791
|
-
return (
|
|
1792
|
-
const I = $("FmCircularProgress"),
|
|
1793
|
-
return
|
|
1794
|
-
f.value ? (
|
|
1795
|
-
|
|
1779
|
+
return (i, a) => {
|
|
1780
|
+
const I = $("FmCircularProgress"), R = $("FmButton");
|
|
1781
|
+
return x(), j("div", jo, [
|
|
1782
|
+
f.value ? (x(), j("div", Ro, [
|
|
1783
|
+
r.value === null || r.value === !0 ? (x(), j("div", Uo, [
|
|
1796
1784
|
e("div", Io, [
|
|
1797
1785
|
e("div", null, [
|
|
1798
|
-
|
|
1786
|
+
b(I, { size: "lg" })
|
|
1799
1787
|
]),
|
|
1800
1788
|
To
|
|
1801
1789
|
])
|
|
1802
|
-
])) : m.value ? (
|
|
1790
|
+
])) : m.value ? (x(), j("div", Eo, [
|
|
1803
1791
|
e("div", Ho, [
|
|
1804
1792
|
e("div", Lo, [
|
|
1805
|
-
|
|
1793
|
+
ce(" Last closing was at: "),
|
|
1806
1794
|
e("span", No, A(C(Bt)(o.value)), 1),
|
|
1807
|
-
|
|
1795
|
+
ce(". You may submit a recalculation task to the backend for all adjustments after this date. ")
|
|
1808
1796
|
]),
|
|
1809
1797
|
Oo
|
|
1810
1798
|
])
|
|
1811
|
-
])) : (
|
|
1812
|
-
])) : (
|
|
1799
|
+
])) : (x(), j("div", Po, A(k.value), 1))
|
|
1800
|
+
])) : (x(), j("div", Yo, "Cannot recalculate adjustment history on a non-restaurant outlet.")),
|
|
1813
1801
|
e("div", zo, [
|
|
1814
|
-
m.value ? (
|
|
1802
|
+
m.value ? (x(), N(R, {
|
|
1815
1803
|
key: 0,
|
|
1816
1804
|
label: "Submit",
|
|
1817
|
-
onClick:
|
|
1805
|
+
onClick: h
|
|
1818
1806
|
})) : Z("", !0),
|
|
1819
|
-
|
|
1807
|
+
b(R, {
|
|
1820
1808
|
variant: "tertiary",
|
|
1821
1809
|
label: "Close",
|
|
1822
|
-
onClick:
|
|
1810
|
+
onClick: a[0] || (a[0] = (w) => l("close"))
|
|
1823
1811
|
})
|
|
1824
1812
|
])
|
|
1825
1813
|
]);
|
|
@@ -1827,23 +1815,23 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1827
1815
|
}
|
|
1828
1816
|
}), Ko = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 h-full" }, Go = { class: "px-8 flex gap-8 items-center xs:gap-0 xs:flex-col-reverse sm:gap-0 sm:flex-col-reverse h-48" }, Wo = { class: "xs:w-full sm:w-full flex gap-8 items-center overflow-x-auto no-scrollbar py-8" }, Jo = { class: "flex-1 w-full" }, Qo = { class: "flex flex-col gap-8" }, Xo = { class: "flex flex-col" }, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, es = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, bs = /* @__PURE__ */ oe({
|
|
1829
1817
|
__name: "StockView",
|
|
1830
|
-
setup(
|
|
1831
|
-
const
|
|
1818
|
+
setup(c) {
|
|
1819
|
+
const u = Re(), l = ue(), s = Te(), S = _t(), {
|
|
1832
1820
|
columnDefs: f,
|
|
1833
|
-
stockHistoryProps:
|
|
1821
|
+
stockHistoryProps: r,
|
|
1834
1822
|
convertSkuDialogProps: m,
|
|
1835
|
-
adjustSkuDialogProps:
|
|
1823
|
+
adjustSkuDialogProps: k,
|
|
1836
1824
|
showSkuHistory: v
|
|
1837
|
-
} = Gt(
|
|
1838
|
-
l.watchLocation(
|
|
1839
|
-
const o = T(!1),
|
|
1840
|
-
async function
|
|
1825
|
+
} = Gt(i);
|
|
1826
|
+
l.watchLocation(i);
|
|
1827
|
+
const o = T(!1), g = de(), h = Ue();
|
|
1828
|
+
async function i() {
|
|
1841
1829
|
if (l._currentLocation) {
|
|
1842
1830
|
o.value = !0;
|
|
1843
1831
|
try {
|
|
1844
|
-
await s.readStockBalance(), await s.readProductBalance(), await
|
|
1832
|
+
await s.readStockBalance(), await s.readProductBalance(), await S.readStockEstimateBalance();
|
|
1845
1833
|
} catch {
|
|
1846
|
-
|
|
1834
|
+
g.open({
|
|
1847
1835
|
title: "Something went wrong",
|
|
1848
1836
|
message: "Please refresh the page to retry.",
|
|
1849
1837
|
type: "error"
|
|
@@ -1853,13 +1841,13 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1853
1841
|
}
|
|
1854
1842
|
}
|
|
1855
1843
|
}
|
|
1856
|
-
const
|
|
1857
|
-
() =>
|
|
1844
|
+
const a = U(
|
|
1845
|
+
() => u.skus.map((P) => {
|
|
1858
1846
|
var Q, se, X;
|
|
1859
1847
|
const L = P.trackingMeasurement;
|
|
1860
1848
|
let z = (se = (Q = s.stockBalance.skus) == null ? void 0 : Q.find(
|
|
1861
1849
|
(t) => t.id === P._id
|
|
1862
|
-
)) == null ? void 0 : se.balance, O =
|
|
1850
|
+
)) == null ? void 0 : se.balance, O = S.inventoryForecast.skus.find(
|
|
1863
1851
|
(t) => t.id === P._id
|
|
1864
1852
|
);
|
|
1865
1853
|
return {
|
|
@@ -1872,7 +1860,7 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1872
1860
|
trackingUnitAbbrev: L ? ((X = P.unit.measurements.find((t) => t.id === L)) == null ? void 0 : X.abbrev) ?? "" : P.unit.abbrev
|
|
1873
1861
|
};
|
|
1874
1862
|
})
|
|
1875
|
-
), I = T(""), { breakpoints:
|
|
1863
|
+
), I = T(""), { breakpoints: R } = ut(), w = U(() => R.value.xs || R.value.sm ? 10 : 20), V = mt(), M = U(() => {
|
|
1876
1864
|
var L;
|
|
1877
1865
|
return ((L = l._currentLocation) == null ? void 0 : L.type) === Je.restaurant ? [
|
|
1878
1866
|
{
|
|
@@ -1888,12 +1876,12 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1888
1876
|
] : [];
|
|
1889
1877
|
});
|
|
1890
1878
|
function H() {
|
|
1891
|
-
|
|
1879
|
+
h.open({
|
|
1892
1880
|
title: "Recalculate stock",
|
|
1893
1881
|
contentComponent: qo,
|
|
1894
1882
|
contentComponentProps: {
|
|
1895
1883
|
onClose() {
|
|
1896
|
-
|
|
1884
|
+
h.close();
|
|
1897
1885
|
}
|
|
1898
1886
|
},
|
|
1899
1887
|
overlay: !0,
|
|
@@ -1902,32 +1890,32 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1902
1890
|
}
|
|
1903
1891
|
return (P, L) => {
|
|
1904
1892
|
const z = $("FmTableToolbar"), O = $("FmMenuDivider"), J = $("FmTable");
|
|
1905
|
-
return
|
|
1893
|
+
return x(), N(lt, { title: "Stock" }, {
|
|
1906
1894
|
default: B(() => {
|
|
1907
1895
|
var Q, se, X, t;
|
|
1908
1896
|
return [
|
|
1909
1897
|
e("div", Ko, [
|
|
1910
1898
|
e("div", Go, [
|
|
1911
1899
|
e("div", Wo, [
|
|
1912
|
-
|
|
1900
|
+
b(yt)
|
|
1913
1901
|
]),
|
|
1914
1902
|
e("div", Jo, [
|
|
1915
|
-
|
|
1903
|
+
b(z, {
|
|
1916
1904
|
searchable: "",
|
|
1917
1905
|
"search-model": I.value,
|
|
1918
1906
|
"onUpdate:searchModel": L[0] || (L[0] = (n) => I.value = n),
|
|
1919
1907
|
actions: [{ label: "Export", icon: "ios_share", key: "export" }, ...M.value],
|
|
1920
|
-
"onClick:actionExport": L[1] || (L[1] = (n) => C(Ht)(
|
|
1921
|
-
"onClick:actionRefresh":
|
|
1908
|
+
"onClick:actionExport": L[1] || (L[1] = (n) => C(Ht)(a.value)),
|
|
1909
|
+
"onClick:actionRefresh": i,
|
|
1922
1910
|
"onClick:actionRecalculate": H
|
|
1923
1911
|
}, null, 8, ["search-model", "actions"]),
|
|
1924
|
-
|
|
1912
|
+
b(O, { class: "hidden xs:block" })
|
|
1925
1913
|
])
|
|
1926
1914
|
]),
|
|
1927
|
-
(
|
|
1915
|
+
(x(), N(J, {
|
|
1928
1916
|
style: Ge(C(V).tableHeight),
|
|
1929
1917
|
"column-defs": C(f),
|
|
1930
|
-
"row-data":
|
|
1918
|
+
"row-data": a.value,
|
|
1931
1919
|
"search-value": I.value,
|
|
1932
1920
|
loading: o.value || !C(l)._currentLocation,
|
|
1933
1921
|
key: (Q = C(l)._currentLocation) == null ? void 0 : Q.dbName,
|
|
@@ -1935,7 +1923,7 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1935
1923
|
"page-size": w.value
|
|
1936
1924
|
}, {
|
|
1937
1925
|
"list-row": B((n) => [
|
|
1938
|
-
|
|
1926
|
+
b(dt, {
|
|
1939
1927
|
row: n,
|
|
1940
1928
|
onRowClick: C(v)
|
|
1941
1929
|
}, {
|
|
@@ -1945,25 +1933,25 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1945
1933
|
e("div", Qo, [
|
|
1946
1934
|
e("div", Xo, [
|
|
1947
1935
|
e("div", Zo, [
|
|
1948
|
-
|
|
1936
|
+
b(C(Oe), {
|
|
1949
1937
|
render: (_ = (y = (d = p.code) == null ? void 0 : d.column) == null ? void 0 : y.columnDef) == null ? void 0 : _.cell,
|
|
1950
1938
|
props: (Y = (F = p.code) == null ? void 0 : F.getContext) == null ? void 0 : Y.call(F)
|
|
1951
1939
|
}, null, 8, ["render", "props"])
|
|
1952
1940
|
]),
|
|
1953
1941
|
e("div", es, [
|
|
1954
|
-
|
|
1942
|
+
b(C(Oe), {
|
|
1955
1943
|
render: (D = (le = (K = p.name) == null ? void 0 : K.column) == null ? void 0 : le.columnDef) == null ? void 0 : D.cell,
|
|
1956
1944
|
props: (q = (E = p.name) == null ? void 0 : E.getContext) == null ? void 0 : q.call(E)
|
|
1957
1945
|
}, null, 8, ["render", "props"])
|
|
1958
1946
|
])
|
|
1959
1947
|
]),
|
|
1960
1948
|
e("div", null, [
|
|
1961
|
-
|
|
1949
|
+
b(ot, {
|
|
1962
1950
|
days: n.original.day
|
|
1963
1951
|
}, null, 8, ["days"])
|
|
1964
1952
|
]),
|
|
1965
1953
|
e("div", null, [
|
|
1966
|
-
|
|
1954
|
+
b(nt, {
|
|
1967
1955
|
class: "xs:w-[160px]",
|
|
1968
1956
|
unit: n.original.unit,
|
|
1969
1957
|
sku: n.original,
|
|
@@ -1980,10 +1968,10 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Rn = {
|
|
|
1980
1968
|
_: 1
|
|
1981
1969
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
1982
1970
|
]),
|
|
1983
|
-
(
|
|
1984
|
-
(se = C(
|
|
1985
|
-
(X = C(m)) != null && X.sku ? (
|
|
1986
|
-
(t = C(
|
|
1971
|
+
(x(), N(at, { to: "body" }, [
|
|
1972
|
+
(se = C(r)) != null && se.sku ? (x(), N(Mo, Se($e({ key: 0 }, C(r))), null, 16)) : Z("", !0),
|
|
1973
|
+
(X = C(m)) != null && X.sku ? (x(), N(cn, Se($e({ key: 1 }, C(m))), null, 16)) : Z("", !0),
|
|
1974
|
+
(t = C(k)) != null && t.stock ? (x(), N(gn, Se($e({ key: 2 }, C(k))), null, 16)) : Z("", !0)
|
|
1987
1975
|
]))
|
|
1988
1976
|
];
|
|
1989
1977
|
}),
|