@feedmepos/mf-inventory-portal 1.1.7 → 1.1.8-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-Q1owgYie.js → App-veHf70us.js} +1 -1
- package/dist/{ApprovalView-BC6549i5.js → ApprovalView-BHmFwrSI.js} +2 -2
- package/dist/{BindingsDialog-0QfXxRu_.js → BindingsDialog-BtsPrnkN.js} +2 -2
- package/dist/{BindingsPicker-BgwXjm2p.js → BindingsPicker-BZLdo3j7.js} +1 -1
- package/dist/{BindingsTable-DpFr3UiN.js → BindingsTable-Cl_202xc.js} +1 -1
- package/dist/{ClosingDraftView-BAXB-oYb.js → ClosingDraftView-BmYBBxXF.js} +443 -432
- package/dist/{ClosingTemplateView-D4JIKbHj.js → ClosingTemplateView-D_q5Cqh0.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-DhhQcRX8.js → DeliveryOrderPrintPreview-OpO2cRqM.js} +5 -5
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C1r4dUi1.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DnD-9Xlp.js} +13 -13
- package/dist/{FmMultiselectDialog-CMapyW92.js → FmMultiselectDialog-BAXYhHXd.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CGKgWump.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BhNXYuvq.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BLXeAd6v.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-C7SW2nNO.js} +1 -1
- package/dist/{IngredientGroupView-CYsjNj8v.js → IngredientGroupView-D0h1YsbP.js} +2 -2
- package/dist/{IngredientsView-dnmBJKzG.js → IngredientsView-C_3wyh5v.js} +4 -4
- package/dist/{IntegrationView-DEX-OtIi.js → IntegrationView-QqGcH-dN.js} +3 -3
- package/dist/{InventoryBindingForm-DzvL-l4u.js → InventoryBindingForm-z8_qpiTO.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Cv5t5HYo.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Lx9VL2I6.js} +3 -3
- package/dist/{InventoryBindingSummary-nwF3dcR4.js → InventoryBindingSummary-Bsl4Gv9C.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CUZi-c3G.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BxHFH1_k.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CQzdlmJ0.js → PremiumBadge.vue_vue_type_script_setup_true_lang-D5oYHtLv.js} +1 -1
- package/dist/{PublishView-BuWPjyoB.js → PublishView-D4MSi6ZU.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-2uET9tFI.js → PurchaseOrderPrintPreview-BfIw_wm3.js} +7 -7
- package/dist/{ReceiveRequestView-BZtuKeJT.js → ReceiveRequestView-BLN4uh1f.js} +8 -8
- package/dist/{RecipeView-BbXj7r6o.js → RecipeView-BYrXdWYU.js} +3 -3
- package/dist/{StockView-DKcR_Kmp.js → StockView-BkOpMBkI.js} +609 -594
- package/dist/{SupplierView-CdpHCgy7.js → SupplierView-DCes9XEn.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-SFt9tDex.js → TransferDetails.vue_vue_type_script_setup_true_lang-DdmVEYUZ.js} +5 -5
- package/dist/{TransferTemplateView-DuutgPoJ.js → TransferTemplateView-CSQWhzL3.js} +6 -6
- package/dist/{UnitView-ghRUvZ4b.js → UnitView-BR8h1-Fg.js} +3 -3
- package/dist/{WarehouseView-CdL4qG7c.js → WarehouseView-C0owHwI6.js} +1 -1
- package/dist/{app-Ve0uP1Mz.js → app-CsCsQ8Wq.js} +198 -198
- package/dist/app.js +1 -1
- package/dist/{decimal-BMp-Vzzy.js → decimal-CCcb_ZM5.js} +1 -1
- package/dist/{format-unit-display-eeJk710H.js → format-unit-display-LULBvgMu.js} +2 -2
- package/dist/{index-B9iRubzb.js → index-CcJb5oyS.js} +1 -1
- package/dist/{index-BEkSWejP.js → index-GxCc62xJ.js} +1 -1
- package/dist/{stock-CaNAztA8.js → stock-DYOew5RJ.js} +1 -1
- package/dist/{supplier-BgFEcnyT.js → supplier-CeQJLRf5.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-kdyHK268.js → use-ingredient-select-dialog-DjZg2Cco.js} +1 -1
- package/dist/{use-inventory-binding-dialog-BCWV0llB.js → use-inventory-binding-dialog-CBXOv0gD.js} +1 -1
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as ie, ref as O, computed as U, resolveComponent as M, openBlock as
|
|
2
|
-
import { u as pe, W as lt, f as Te, h as it, a as Ue, F as Le, X as ut, Y as
|
|
3
|
-
import { u as Pe, a as Ee } from "./stock-
|
|
4
|
-
import { g as Se } from "./decimal-
|
|
5
|
-
import { e as jt, u as Ze, i as et, _ as Ke } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { defineComponent as ie, ref as O, computed as U, resolveComponent as M, openBlock as $, createBlock as K, withCtx as j, createElementVNode as n, normalizeClass as ge, toDisplayString as h, createVNode as g, createElementBlock as H, Fragment as ee, renderList as le, unref as l, h as _e, watch as be, isRef as Ie, createCommentVNode as J, reactive as at, onMounted as qe, normalizeStyle as Qe, createTextVNode as ce, Teleport as rt, normalizeProps as we, mergeProps as $e } from "vue";
|
|
2
|
+
import { u as pe, W as lt, f as Te, h as it, a as Ue, F as Le, X as ut, Y as Me, j as de, P as ct, t as xe, V as De, A as dt, M as mt, T as fe, Z as pt, $ as Z, a0 as vt, a1 as Ne, m as ft, a2 as yt, a3 as _t, a4 as kt, a5 as Xe, Q as Y, a6 as ht, s as Je, a7 as ke, a8 as gt, a9 as bt, o as Ae, l as ze, p as xt, c as St, aa as Ft, ab as wt, ac as $t, ad as At, ae as Ct, B as Vt, _ as Bt, C as Mt, E as Dt, G as Ye } from "./app-CsCsQ8Wq.js";
|
|
3
|
+
import { u as Pe, a as Ee } from "./stock-DYOew5RJ.js";
|
|
4
|
+
import { g as Se } from "./decimal-CCcb_ZM5.js";
|
|
5
|
+
import { e as jt, u as Ze, i as et, _ as Ke } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-D5oYHtLv.js";
|
|
6
6
|
import { _ as je, S as Ce, g as tt } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
|
|
7
7
|
import { _ as It } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
8
8
|
import { useI18n as ue, useCoreStore as Tt } from "@feedmepos/mf-common";
|
|
9
9
|
import { useSnackbar as ye, useDialog as nt, useProxiedModel as He, useBreakpoints as Ut } from "@feedmepos/ui-library";
|
|
10
10
|
import { defineStore as Pt } from "pinia";
|
|
11
|
-
import { u as Et } from "./use-inventory-binding-dialog-
|
|
12
|
-
import { _ as Ht } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-
|
|
11
|
+
import { u as Et } from "./use-inventory-binding-dialog-CBXOv0gD.js";
|
|
12
|
+
import { _ as Ht } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BxHFH1_k.js";
|
|
13
13
|
import { E as Rt } from "./empty-placeholder-wf6-BWE8.js";
|
|
14
14
|
import "./array-Ca8T3f_G.js";
|
|
15
15
|
var he = /* @__PURE__ */ ((f) => (f.History = "History", f.Convert = "Convert", f.Adjust = "Adjust", f))(he || {});
|
|
@@ -41,7 +41,7 @@ const Ot = [
|
|
|
41
41
|
}
|
|
42
42
|
];
|
|
43
43
|
async function Nt(f) {
|
|
44
|
-
const
|
|
44
|
+
const i = `${(pe().currentLocation.name || "").replace(
|
|
45
45
|
/ /g,
|
|
46
46
|
"_"
|
|
47
47
|
)}_${lt().format("DD_MM_YYYY_HHmm")}.xlsx`;
|
|
@@ -71,22 +71,22 @@ async function Nt(f) {
|
|
|
71
71
|
selector: (o) => {
|
|
72
72
|
var _;
|
|
73
73
|
const S = Fe(o, o.unit);
|
|
74
|
-
return S.type === "unit" ? o.unit.abbrev : ((_ = o.unit.measurements.find((
|
|
74
|
+
return S.type === "unit" ? o.unit.abbrev : ((_ = o.unit.measurements.find((u) => u.id === S.measurement)) == null ? void 0 : _.abbrev) || "";
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
]
|
|
78
78
|
}
|
|
79
79
|
],
|
|
80
|
-
|
|
80
|
+
i
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
function Fe(f, y) {
|
|
84
|
-
const
|
|
85
|
-
return
|
|
84
|
+
const i = localStorage.getItem(`uom:${f._id}`);
|
|
85
|
+
return i ? i === y._id ? {
|
|
86
86
|
type: "unit"
|
|
87
|
-
} : y.measurements.find((o) => o.id ===
|
|
87
|
+
} : y.measurements.find((o) => o.id === i) ? {
|
|
88
88
|
type: "measurement",
|
|
89
|
-
measurement:
|
|
89
|
+
measurement: i
|
|
90
90
|
} : {
|
|
91
91
|
type: "unit"
|
|
92
92
|
} : f.trackingMeasurement && y.measurements.find((o) => o.id === f.trackingMeasurement) ? {
|
|
@@ -108,9 +108,9 @@ const zt = { class: "fm-typo-en-body-md-400 flex-grow" }, ot = /* @__PURE__ */ i
|
|
|
108
108
|
function y(x) {
|
|
109
109
|
return `uom:${x._id}`;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
const
|
|
113
|
-
x ? localStorage.setItem(
|
|
111
|
+
function i(x) {
|
|
112
|
+
const r = y(o.sku);
|
|
113
|
+
x ? localStorage.setItem(r, x) : localStorage.setItem(r, o.unit._id), S.value = Fe(o.sku, o.unit);
|
|
114
114
|
}
|
|
115
115
|
const o = f, S = O(Fe(o.sku, o.unit)), _ = U(() => {
|
|
116
116
|
const { measurements: x } = o.unit;
|
|
@@ -119,48 +119,48 @@ const zt = { class: "fm-typo-en-body-md-400 flex-grow" }, ot = /* @__PURE__ */ i
|
|
|
119
119
|
label: `${Se(o.amount, o.unit)}`,
|
|
120
120
|
value: null
|
|
121
121
|
},
|
|
122
|
-
...x.map(({ id:
|
|
123
|
-
label: `${Se(o.amount, o.unit,
|
|
124
|
-
value:
|
|
122
|
+
...x.map(({ id: r }) => ({
|
|
123
|
+
label: `${Se(o.amount, o.unit, r)}`,
|
|
124
|
+
value: r
|
|
125
125
|
}))
|
|
126
126
|
];
|
|
127
127
|
});
|
|
128
|
-
function
|
|
129
|
-
return
|
|
128
|
+
function u({ value: x }) {
|
|
129
|
+
return l(S).type === "unit" ? x === null : x === l(S).measurement;
|
|
130
130
|
}
|
|
131
131
|
const m = U(
|
|
132
132
|
() => {
|
|
133
133
|
var x;
|
|
134
|
-
return ((x = _.value.find((
|
|
134
|
+
return ((x = _.value.find((r) => u(r))) == null ? void 0 : x.label) ?? "";
|
|
135
135
|
}
|
|
136
136
|
), w = O(!1);
|
|
137
|
-
return (x,
|
|
138
|
-
const
|
|
139
|
-
return
|
|
137
|
+
return (x, r) => {
|
|
138
|
+
const t = M("FmIcon"), F = M("FmMenuItem"), C = M("FmMenu");
|
|
139
|
+
return $(), K(C, {
|
|
140
140
|
"stop-click-propagation": "",
|
|
141
|
-
onMenuChanged:
|
|
141
|
+
onMenuChanged: r[0] || (r[0] = (k) => w.value = k)
|
|
142
142
|
}, {
|
|
143
|
-
"menu-button":
|
|
144
|
-
|
|
143
|
+
"menu-button": j(() => [
|
|
144
|
+
n("button", {
|
|
145
145
|
type: "button",
|
|
146
146
|
class: ge([
|
|
147
147
|
"w-full text-left flex items-center gap-8 cursor-pointer fm-corner-radius-sm px-8 py-4 border bg-white",
|
|
148
148
|
w.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
|
|
149
149
|
])
|
|
150
150
|
}, [
|
|
151
|
-
|
|
152
|
-
g(
|
|
151
|
+
n("div", zt, h(m.value), 1),
|
|
152
|
+
g(t, {
|
|
153
153
|
class: "text-fm-color-neutral-gray-400",
|
|
154
154
|
name: "expand_more"
|
|
155
155
|
})
|
|
156
156
|
], 2)
|
|
157
157
|
]),
|
|
158
|
-
default:
|
|
159
|
-
(
|
|
158
|
+
default: j(() => [
|
|
159
|
+
($(!0), H(ee, null, le(_.value, (k) => ($(), K(F, {
|
|
160
160
|
key: k.value ?? 0,
|
|
161
161
|
label: k.label,
|
|
162
|
-
"model-value":
|
|
163
|
-
onClick: (
|
|
162
|
+
"model-value": u(k),
|
|
163
|
+
onClick: (a) => i(k.value)
|
|
164
164
|
}, null, 8, ["label", "model-value", "onClick"]))), 128))
|
|
165
165
|
]),
|
|
166
166
|
_: 1
|
|
@@ -171,24 +171,24 @@ const zt = { class: "fm-typo-en-body-md-400 flex-grow" }, ot = /* @__PURE__ */ i
|
|
|
171
171
|
__name: "StockHeaderPreview",
|
|
172
172
|
setup(f) {
|
|
173
173
|
const { t: y } = ue();
|
|
174
|
-
return (
|
|
175
|
-
default:
|
|
176
|
-
|
|
174
|
+
return (i, o) => ($(), K(It, null, {
|
|
175
|
+
default: j(() => [
|
|
176
|
+
n("div", Yt, h(l(y)("inventory.stock.prediction.daysRemaining")), 1)
|
|
177
177
|
]),
|
|
178
178
|
_: 1
|
|
179
179
|
}));
|
|
180
180
|
}
|
|
181
181
|
}), st = Pt("stockActions", () => {
|
|
182
|
-
const f = O(!1), y = pe(),
|
|
182
|
+
const f = O(!1), y = pe(), i = Pe(), o = Ze(), S = ye(), _ = nt(), { t: u } = ue();
|
|
183
183
|
async function m() {
|
|
184
184
|
if (y._currentLocation) {
|
|
185
185
|
f.value = !0;
|
|
186
186
|
try {
|
|
187
|
-
await
|
|
187
|
+
await i.readStockBalance(), await i.readProductBalance(), await o.readStockEstimateBalance();
|
|
188
188
|
} catch {
|
|
189
189
|
S.open({
|
|
190
|
-
title:
|
|
191
|
-
message:
|
|
190
|
+
title: u("inventory.stock.error.title"),
|
|
191
|
+
message: u("inventory.stock.error.message"),
|
|
192
192
|
type: "error"
|
|
193
193
|
});
|
|
194
194
|
} finally {
|
|
@@ -197,18 +197,18 @@ const zt = { class: "fm-typo-en-body-md-400 flex-grow" }, ot = /* @__PURE__ */ i
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
const w = O();
|
|
200
|
-
async function x(
|
|
201
|
-
var
|
|
202
|
-
if (!!!((
|
|
200
|
+
async function x(a) {
|
|
201
|
+
var A, D, P;
|
|
202
|
+
if (!!!((D = (A = a.convert) == null ? void 0 : A.inventoryBindings) != null && D.length)) {
|
|
203
203
|
_.open({
|
|
204
|
-
title:
|
|
205
|
-
message:
|
|
204
|
+
title: u("inventory.stock.error.convert.title"),
|
|
205
|
+
message: u("inventory.stock.error.convert.message")
|
|
206
206
|
});
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
|
-
const
|
|
210
|
-
maxCount: ((P =
|
|
211
|
-
sku:
|
|
209
|
+
const B = {
|
|
210
|
+
maxCount: ((P = i.productBalance.find(({ id: E }) => E === a._id)) == null ? void 0 : P.count) || 0,
|
|
211
|
+
sku: a,
|
|
212
212
|
show: !0,
|
|
213
213
|
"onUpdate:show"(E) {
|
|
214
214
|
w.value.show = E;
|
|
@@ -217,36 +217,36 @@ const zt = { class: "fm-typo-en-body-md-400 flex-grow" }, ot = /* @__PURE__ */ i
|
|
|
217
217
|
m();
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
|
-
w.value =
|
|
220
|
+
w.value = B;
|
|
221
221
|
}
|
|
222
|
-
const
|
|
223
|
-
async function
|
|
224
|
-
const
|
|
225
|
-
stock:
|
|
222
|
+
const r = O();
|
|
223
|
+
async function t(a) {
|
|
224
|
+
const V = {
|
|
225
|
+
stock: a,
|
|
226
226
|
show: !0,
|
|
227
227
|
"onUpdate:show"(L) {
|
|
228
|
-
|
|
228
|
+
r.value.show = L;
|
|
229
229
|
},
|
|
230
230
|
onSubmitted() {
|
|
231
231
|
m();
|
|
232
232
|
}
|
|
233
233
|
};
|
|
234
|
-
|
|
234
|
+
r.value = V;
|
|
235
235
|
}
|
|
236
236
|
const F = O();
|
|
237
|
-
async function C(
|
|
238
|
-
const
|
|
239
|
-
sku:
|
|
237
|
+
async function C(a) {
|
|
238
|
+
const V = {
|
|
239
|
+
sku: a,
|
|
240
240
|
show: !0,
|
|
241
241
|
"onUpdate:show"(L) {
|
|
242
242
|
F.value.show = L;
|
|
243
243
|
}
|
|
244
244
|
};
|
|
245
|
-
F.value =
|
|
245
|
+
F.value = V;
|
|
246
246
|
}
|
|
247
|
-
function k(
|
|
248
|
-
const L = Te(
|
|
249
|
-
switch (
|
|
247
|
+
function k(a, V) {
|
|
248
|
+
const L = Te(V);
|
|
249
|
+
switch (a) {
|
|
250
250
|
case he.History:
|
|
251
251
|
C(L);
|
|
252
252
|
return;
|
|
@@ -254,7 +254,7 @@ const zt = { class: "fm-typo-en-body-md-400 flex-grow" }, ot = /* @__PURE__ */ i
|
|
|
254
254
|
x(L);
|
|
255
255
|
return;
|
|
256
256
|
case he.Adjust:
|
|
257
|
-
|
|
257
|
+
t(L);
|
|
258
258
|
return;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
@@ -264,36 +264,36 @@ const zt = { class: "fm-typo-en-body-md-400 flex-grow" }, ot = /* @__PURE__ */ i
|
|
|
264
264
|
stockHistoryProps: F,
|
|
265
265
|
showSkuHistory: C,
|
|
266
266
|
convertSkuDialogProps: w,
|
|
267
|
-
adjustSkuDialogProps:
|
|
267
|
+
adjustSkuDialogProps: r
|
|
268
268
|
};
|
|
269
269
|
});
|
|
270
270
|
function Gt() {
|
|
271
|
-
const f = pe(), y = st(), { t:
|
|
271
|
+
const f = pe(), y = st(), { t: i } = ue();
|
|
272
272
|
return {
|
|
273
273
|
columnDefs: [
|
|
274
274
|
{
|
|
275
275
|
accessorKey: "code",
|
|
276
|
-
header: () =>
|
|
276
|
+
header: () => i("inventory.stock.code"),
|
|
277
277
|
enableSorting: !0,
|
|
278
278
|
size: 300
|
|
279
279
|
},
|
|
280
280
|
{
|
|
281
281
|
accessorKey: "name",
|
|
282
|
-
header: () =>
|
|
282
|
+
header: () => i("inventory.stock.product"),
|
|
283
283
|
enableSorting: !0,
|
|
284
284
|
size: "auto"
|
|
285
285
|
},
|
|
286
286
|
{
|
|
287
287
|
id: "UOM",
|
|
288
|
-
header: () =>
|
|
288
|
+
header: () => i("inventory.stock.balance"),
|
|
289
289
|
cell(S) {
|
|
290
|
-
const _ = S.row.original,
|
|
290
|
+
const _ = S.row.original, u = {
|
|
291
291
|
unit: _.unit,
|
|
292
292
|
sku: _,
|
|
293
293
|
amount: _.balance,
|
|
294
294
|
defaultTrackingMeasurement: _.trackingMeasurement ?? void 0
|
|
295
295
|
};
|
|
296
|
-
return _e(ot,
|
|
296
|
+
return _e(ot, u);
|
|
297
297
|
},
|
|
298
298
|
size: 180
|
|
299
299
|
},
|
|
@@ -304,13 +304,13 @@ function Gt() {
|
|
|
304
304
|
enableSorting: !0,
|
|
305
305
|
sortUndefined: "last",
|
|
306
306
|
cell(S) {
|
|
307
|
-
var
|
|
308
|
-
const _ = S.row.original.day,
|
|
309
|
-
if (typeof _ != "number" || typeof
|
|
307
|
+
var r, t;
|
|
308
|
+
const _ = S.row.original.day, u = (r = S.row.original.thresholds) == null ? void 0 : r.low, m = (t = S.row.original.thresholds) == null ? void 0 : t.mid;
|
|
309
|
+
if (typeof _ != "number" || typeof u != "number" || typeof m != "number")
|
|
310
310
|
return _e(je, {
|
|
311
311
|
days: _
|
|
312
312
|
});
|
|
313
|
-
const w = _ <=
|
|
313
|
+
const w = _ <= u ? Ce.low : _ <= m ? Ce.mid : Ce.high;
|
|
314
314
|
return _e(je, {
|
|
315
315
|
days: _,
|
|
316
316
|
level: w
|
|
@@ -324,7 +324,7 @@ function Gt() {
|
|
|
324
324
|
var _;
|
|
325
325
|
return it(
|
|
326
326
|
((_ = f._currentLocation) == null ? void 0 : _.type) === "restaurant" ? Ot : Lt,
|
|
327
|
-
(
|
|
327
|
+
(u) => y.onActionMenu(u, S.row.original)
|
|
328
328
|
);
|
|
329
329
|
},
|
|
330
330
|
enableSorting: !1,
|
|
@@ -382,8 +382,8 @@ const qt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
382
382
|
show: { type: Boolean }
|
|
383
383
|
},
|
|
384
384
|
emits: ["update:show", "submitted"],
|
|
385
|
-
setup(f, { expose: y, emit:
|
|
386
|
-
const o = f, S =
|
|
385
|
+
setup(f, { expose: y, emit: i }) {
|
|
386
|
+
const o = f, S = i, _ = Et(), u = Ue(), m = Ee(), w = ye(), { t: x } = ue(), r = O(0), t = O(null), F = U(() => u.skus), C = U(
|
|
387
387
|
() => {
|
|
388
388
|
var p, e;
|
|
389
389
|
return (((e = (p = o.sku) == null ? void 0 : p.convert) == null ? void 0 : e.inventoryBindings) ?? []).filter(
|
|
@@ -392,33 +392,33 @@ const qt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
392
392
|
}
|
|
393
393
|
), k = U({
|
|
394
394
|
get() {
|
|
395
|
-
return !!
|
|
395
|
+
return !!t.value;
|
|
396
396
|
},
|
|
397
397
|
set(p) {
|
|
398
|
-
p ?
|
|
398
|
+
p ? t.value = Te(C.value) : (t.value = null, r.value = Math.min(r.value, o.maxCount ?? 0));
|
|
399
399
|
}
|
|
400
|
-
}),
|
|
400
|
+
}), a = O(!1);
|
|
401
401
|
be([() => o.show], ([p]) => {
|
|
402
|
-
p && (
|
|
402
|
+
p && (r.value = 0);
|
|
403
403
|
});
|
|
404
|
-
function
|
|
405
|
-
|
|
404
|
+
function V() {
|
|
405
|
+
te(o.sku, xe(r.value), t.value);
|
|
406
406
|
}
|
|
407
407
|
function L(p) {
|
|
408
|
-
if (
|
|
408
|
+
if (t.value)
|
|
409
409
|
return !0;
|
|
410
410
|
const e = Ge(p).isInteger().max(o.maxCount ?? 0).error ?? "";
|
|
411
411
|
return e || !0;
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function B(p) {
|
|
414
414
|
var d;
|
|
415
415
|
const e = (d = o.sku.convert) != null && d.measurement ? o.sku.unit.measurements.find((b) => {
|
|
416
416
|
var I;
|
|
417
417
|
return b.id === ((I = o.sku.convert) == null ? void 0 : I.measurement);
|
|
418
|
-
}) ?? null : null, s =
|
|
418
|
+
}) ?? null : null, s = Me(o.sku.unit, e), v = pt(+p);
|
|
419
419
|
return Ge(v).isInteger().max(s).error ? "Precision cannot be more than " + s : !0;
|
|
420
420
|
}
|
|
421
|
-
const
|
|
421
|
+
const A = U(
|
|
422
422
|
() => {
|
|
423
423
|
var p, e;
|
|
424
424
|
return (p = o.sku.convert) != null && p.measurement ? (e = o.sku.unit.measurements.find((s) => {
|
|
@@ -426,29 +426,29 @@ const qt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
426
426
|
return s.id === ((v = o.sku.convert) == null ? void 0 : v.measurement);
|
|
427
427
|
})) == null ? void 0 : e.abbrev : o.sku.unit.abbrev;
|
|
428
428
|
}
|
|
429
|
-
),
|
|
429
|
+
), D = U(() => {
|
|
430
430
|
var v, c;
|
|
431
431
|
const e = ut({
|
|
432
432
|
bindings: ((v = o.sku.convert) == null ? void 0 : v.inventoryBindings) ?? [],
|
|
433
|
-
skus:
|
|
434
|
-
skuGroups:
|
|
435
|
-
recipes:
|
|
433
|
+
skus: u.skus,
|
|
434
|
+
skuGroups: u.skuGroups,
|
|
435
|
+
recipes: u.recipes
|
|
436
436
|
}).inventoryBindings.filter((d) => "success" in d && d.success).map((d) => d).map((d) => d.binding);
|
|
437
|
-
return (c =
|
|
438
|
-
var se, re, X,
|
|
439
|
-
const b =
|
|
437
|
+
return (c = t.value ?? e) == null ? void 0 : c.map((d) => {
|
|
438
|
+
var se, re, X, ne, Re;
|
|
439
|
+
const b = u.skus.find((ve) => ve._id === d.id), I = ((se = d.measurement) == null ? void 0 : se.abbrev) ?? ((re = b == null ? void 0 : b.unit) == null ? void 0 : re.abbrev), Q = (X = o.sku.convert) != null && X.measurement ? o.sku.unit.measurements.find((ve) => {
|
|
440
440
|
var Oe;
|
|
441
441
|
return ve.id === ((Oe = o.sku.convert) == null ? void 0 : Oe.measurement);
|
|
442
|
-
}) ?? null : null, oe =
|
|
442
|
+
}) ?? null : null, oe = Me(o.sku.unit, Q), T = B(`${r.value}`) === !0 ? de(
|
|
443
443
|
ct(
|
|
444
444
|
d.amount,
|
|
445
|
-
xe(+
|
|
445
|
+
xe(+r.value, oe)
|
|
446
446
|
),
|
|
447
447
|
!1
|
|
448
|
-
) : "0", z = (Re = (
|
|
448
|
+
) : "0", z = (Re = (ne = t.value) == null ? void 0 : ne.find((ve) => ve.id === (b == null ? void 0 : b._id))) == null ? void 0 : Re.amount, W = z ? de(z, !1) : null;
|
|
449
449
|
return {
|
|
450
450
|
sku: b,
|
|
451
|
-
convertAmount:
|
|
451
|
+
convertAmount: W ?? T,
|
|
452
452
|
abbrev: I
|
|
453
453
|
};
|
|
454
454
|
});
|
|
@@ -468,8 +468,8 @@ const qt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
468
468
|
}
|
|
469
469
|
});
|
|
470
470
|
const E = He(o, "show");
|
|
471
|
-
async function
|
|
472
|
-
|
|
471
|
+
async function te(p, e, s) {
|
|
472
|
+
a.value = !0;
|
|
473
473
|
try {
|
|
474
474
|
await m.convertSku({
|
|
475
475
|
conversions: [
|
|
@@ -494,26 +494,26 @@ const qt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
494
494
|
type: "error"
|
|
495
495
|
}), console.error("error at converting stock amount", p, e, v);
|
|
496
496
|
} finally {
|
|
497
|
-
|
|
497
|
+
a.value = !1;
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
function q(p, e, s) {
|
|
501
501
|
const v = +e;
|
|
502
502
|
let c = s;
|
|
503
|
-
e.length > 0 && isFinite(v) ? c = s.map((d) => (d.id !== p || (d.amount = fe(v)), d)) : c = s.map((d) => (d.id !== p || (d.amount = { amount: 0, precision: 0 }), d)),
|
|
503
|
+
e.length > 0 && isFinite(v) ? c = s.map((d) => (d.id !== p || (d.amount = fe(v)), d)) : c = s.map((d) => (d.id !== p || (d.amount = { amount: 0, precision: 0 }), d)), t.value = c;
|
|
504
504
|
}
|
|
505
505
|
function N(p) {
|
|
506
506
|
const e = F.value.find((s) => s._id === p);
|
|
507
507
|
return e ? tt(e.unit, !0) : [];
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function R(p, e) {
|
|
510
510
|
const s = N(p), v = s.find((c) => c.value === e) ?? s.find((c) => c.value === null);
|
|
511
511
|
return v ? {
|
|
512
512
|
...v,
|
|
513
513
|
label: v.abbrev
|
|
514
514
|
} : null;
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function G(p, e, s) {
|
|
517
517
|
let v;
|
|
518
518
|
if (e === null)
|
|
519
519
|
v = s.map((c) => (c.id !== p || (c.measurement = null), c)) ?? [];
|
|
@@ -524,57 +524,57 @@ const qt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
524
524
|
return d.id !== p || (d.measurement = (I = (b = c == null ? void 0 : c.unit) == null ? void 0 : b.measurements) == null ? void 0 : I.find((Q) => Q.id === e)), d;
|
|
525
525
|
}) ?? [];
|
|
526
526
|
}
|
|
527
|
-
|
|
527
|
+
t.value = v;
|
|
528
528
|
}
|
|
529
529
|
function ae(p, e) {
|
|
530
530
|
const s = e.filter((v) => v.id !== p);
|
|
531
|
-
|
|
531
|
+
t.value = s;
|
|
532
532
|
}
|
|
533
533
|
function me() {
|
|
534
|
-
const p = (
|
|
534
|
+
const p = (t.value ?? []).map((e) => ({
|
|
535
535
|
...e,
|
|
536
536
|
type: Le.enum.SKU
|
|
537
537
|
}));
|
|
538
538
|
_.promptIngredientsBinding(
|
|
539
539
|
p,
|
|
540
|
-
(e) =>
|
|
540
|
+
(e) => t.value = e,
|
|
541
541
|
o.sku._id
|
|
542
542
|
);
|
|
543
543
|
}
|
|
544
544
|
return be(
|
|
545
545
|
() => o.show,
|
|
546
546
|
(p) => {
|
|
547
|
-
p || (
|
|
547
|
+
p || (t.value = null, r.value = 0);
|
|
548
548
|
}
|
|
549
549
|
), (p, e) => {
|
|
550
550
|
const s = M("FmTextField"), v = M("FmForm"), c = M("FmCard"), d = M("FmSwitch"), b = M("FmFormGroup"), I = M("FmSelect"), Q = M("FmButton"), oe = M("FmSideSheet");
|
|
551
|
-
return
|
|
551
|
+
return $(), K(oe, {
|
|
552
552
|
"dismiss-away": "",
|
|
553
|
-
modelValue:
|
|
553
|
+
modelValue: l(E),
|
|
554
554
|
"onUpdate:modelValue": e[3] || (e[3] = (T) => Ie(E) ? E.value = T : null),
|
|
555
555
|
"max-width": 500
|
|
556
556
|
}, {
|
|
557
|
-
"side-sheet-header":
|
|
558
|
-
|
|
559
|
-
|
|
557
|
+
"side-sheet-header": j(() => [
|
|
558
|
+
n("div", qt, [
|
|
559
|
+
n("div", Qt, h(l(x)("inventory.stock.convert.title", { name: p.sku.name })), 1)
|
|
560
560
|
])
|
|
561
561
|
]),
|
|
562
|
-
default:
|
|
563
|
-
|
|
562
|
+
default: j(() => [
|
|
563
|
+
n("div", Xt, [
|
|
564
564
|
g(v, {
|
|
565
565
|
ref_key: "formRef",
|
|
566
566
|
ref: P,
|
|
567
|
-
onValidationSuccess:
|
|
567
|
+
onValidationSuccess: V
|
|
568
568
|
}, {
|
|
569
|
-
default:
|
|
569
|
+
default: j(() => [
|
|
570
570
|
g(s, {
|
|
571
|
-
disabled:
|
|
572
|
-
"model-value":
|
|
573
|
-
"onUpdate:modelValue": e[0] || (e[0] = (T) =>
|
|
574
|
-
label:
|
|
575
|
-
rules: [L,
|
|
576
|
-
"append-text":
|
|
577
|
-
"helper-text":
|
|
571
|
+
disabled: a.value,
|
|
572
|
+
"model-value": r.value,
|
|
573
|
+
"onUpdate:modelValue": e[0] || (e[0] = (T) => r.value = T),
|
|
574
|
+
label: l(x)("inventory.stock.convert.amount"),
|
|
575
|
+
rules: [L, B, l(De)(0)],
|
|
576
|
+
"append-text": A.value,
|
|
577
|
+
"helper-text": t.value ? void 0 : `Max ${p.maxCount} ${A.value}`
|
|
578
578
|
}, null, 8, ["disabled", "model-value", "label", "rules", "append-text", "helper-text"])
|
|
579
579
|
]),
|
|
580
580
|
_: 1
|
|
@@ -583,17 +583,17 @@ const qt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
583
583
|
variant: "outlined",
|
|
584
584
|
class: "p-16"
|
|
585
585
|
}, {
|
|
586
|
-
default:
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
(
|
|
590
|
-
var z,
|
|
591
|
-
return
|
|
586
|
+
default: j(() => [
|
|
587
|
+
n("div", Jt, [
|
|
588
|
+
n("div", Zt, h(l(x)("inventory.stock.convert.deductionSummary")), 1),
|
|
589
|
+
($(!0), H(ee, null, le(D.value, (T) => {
|
|
590
|
+
var z, W;
|
|
591
|
+
return $(), H("div", {
|
|
592
592
|
key: (z = T.sku) == null ? void 0 : z._id,
|
|
593
593
|
class: "flex items-center"
|
|
594
594
|
}, [
|
|
595
|
-
|
|
596
|
-
|
|
595
|
+
n("div", en, h((W = T.sku) == null ? void 0 : W.name), 1),
|
|
596
|
+
n("div", tn, " -" + h(T.convertAmount) + " " + h(T.abbrev), 1)
|
|
597
597
|
]);
|
|
598
598
|
}), 128))
|
|
599
599
|
])
|
|
@@ -601,65 +601,65 @@ const qt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
601
601
|
_: 1
|
|
602
602
|
}),
|
|
603
603
|
g(c, { variant: "outlined" }, {
|
|
604
|
-
default:
|
|
605
|
-
|
|
604
|
+
default: j(() => [
|
|
605
|
+
n("div", nn, [
|
|
606
606
|
g(d, {
|
|
607
607
|
value: "",
|
|
608
608
|
modelValue: k.value,
|
|
609
609
|
"onUpdate:modelValue": e[1] || (e[1] = (T) => k.value = T),
|
|
610
|
-
label:
|
|
610
|
+
label: l(x)("inventory.stock.convert.overrideDeduction"),
|
|
611
611
|
"label-placement": "right"
|
|
612
612
|
}, null, 8, ["modelValue", "label"]),
|
|
613
|
-
k.value ? (
|
|
613
|
+
k.value ? ($(), H(ee, { key: 0 }, [
|
|
614
614
|
g(b, {
|
|
615
|
-
modelValue:
|
|
616
|
-
rules: [
|
|
615
|
+
modelValue: t.value,
|
|
616
|
+
rules: [l(dt)(1, "Must have at least one ingredient binding")]
|
|
617
617
|
}, null, 8, ["modelValue", "rules"]),
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
(
|
|
618
|
+
n("div", on, [
|
|
619
|
+
n("div", sn, h(l(x)("inventory.stock.convert.ingredients")), 1),
|
|
620
|
+
($(!0), H(ee, null, le(t.value, (T) => ($(), K(b, {
|
|
621
621
|
key: T.id,
|
|
622
|
-
disabled:
|
|
623
|
-
modelValue: +
|
|
622
|
+
disabled: a.value,
|
|
623
|
+
modelValue: +l(de)(T.amount ?? { amount: 1, precision: 0 }),
|
|
624
624
|
rules: [
|
|
625
|
-
|
|
625
|
+
l(mt)(
|
|
626
626
|
F.value.find((z) => z._id === T.id).unit,
|
|
627
627
|
T.measurement
|
|
628
628
|
),
|
|
629
|
-
|
|
629
|
+
l(De)(0)
|
|
630
630
|
]
|
|
631
631
|
}, {
|
|
632
|
-
default:
|
|
633
|
-
var
|
|
632
|
+
default: j(({ invalid: z }) => {
|
|
633
|
+
var W, se, re;
|
|
634
634
|
return [
|
|
635
|
-
|
|
636
|
-
|
|
635
|
+
n("div", an, [
|
|
636
|
+
n("div", rn, h((W = F.value.find((X) => X._id === T.id)) == null ? void 0 : W.name), 1),
|
|
637
637
|
g(s, {
|
|
638
638
|
class: "xs:col-span-2",
|
|
639
|
-
disabled:
|
|
640
|
-
modelValue: +
|
|
639
|
+
disabled: a.value,
|
|
640
|
+
modelValue: +l(de)(
|
|
641
641
|
T.amount ?? { amount: 1, precision: 0 }
|
|
642
642
|
),
|
|
643
|
-
"onUpdate:modelValue": (X) => q(T.id, X,
|
|
643
|
+
"onUpdate:modelValue": (X) => q(T.id, X, t.value ?? []),
|
|
644
644
|
invalid: z
|
|
645
645
|
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
|
|
646
646
|
g(I, {
|
|
647
|
-
disabled:
|
|
647
|
+
disabled: a.value,
|
|
648
648
|
class: "translate-y-[2px]",
|
|
649
649
|
items: N(T.id),
|
|
650
|
-
"model-value": (re =
|
|
651
|
-
"onUpdate:modelValue": (X) =>
|
|
650
|
+
"model-value": (re = R(T.id, (se = T.measurement) == null ? void 0 : se.id)) == null ? void 0 : re.value,
|
|
651
|
+
"onUpdate:modelValue": (X) => G(T.id, X, t.value ?? []),
|
|
652
652
|
invalid: z
|
|
653
653
|
}, {
|
|
654
|
-
"helper-text":
|
|
654
|
+
"helper-text": j(() => e[4] || (e[4] = [])),
|
|
655
655
|
_: 2
|
|
656
656
|
}, 1032, ["disabled", "items", "model-value", "onUpdate:modelValue", "invalid"]),
|
|
657
657
|
g(Q, {
|
|
658
|
-
disabled:
|
|
658
|
+
disabled: a.value,
|
|
659
659
|
type: "button",
|
|
660
660
|
variant: "tertiary",
|
|
661
661
|
icon: "delete",
|
|
662
|
-
onClick: (X) => ae(T.id,
|
|
662
|
+
onClick: (X) => ae(T.id, t.value ?? [])
|
|
663
663
|
}, null, 8, ["disabled", "onClick"])
|
|
664
664
|
])
|
|
665
665
|
];
|
|
@@ -667,29 +667,29 @@ const qt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
667
667
|
_: 2
|
|
668
668
|
}, 1032, ["disabled", "modelValue", "rules"]))), 128))
|
|
669
669
|
]),
|
|
670
|
-
|
|
670
|
+
n("div", null, [
|
|
671
671
|
g(Q, {
|
|
672
672
|
icon: "link",
|
|
673
|
-
label:
|
|
673
|
+
label: l(x)("inventory.stock.convert.linkIngredient"),
|
|
674
674
|
variant: "plain",
|
|
675
675
|
onClick: me
|
|
676
676
|
}, null, 8, ["label"])
|
|
677
677
|
])
|
|
678
|
-
], 64)) :
|
|
678
|
+
], 64)) : J("", !0)
|
|
679
679
|
])
|
|
680
680
|
]),
|
|
681
681
|
_: 1
|
|
682
682
|
})
|
|
683
683
|
])
|
|
684
684
|
]),
|
|
685
|
-
"side-sheet-footer":
|
|
686
|
-
|
|
685
|
+
"side-sheet-footer": j(() => [
|
|
686
|
+
n("div", ln, [
|
|
687
687
|
g(Q, {
|
|
688
|
-
loading:
|
|
689
|
-
label:
|
|
688
|
+
loading: a.value,
|
|
689
|
+
label: l(x)("inventory.stock.convert.convertButton"),
|
|
690
690
|
onClick: e[2] || (e[2] = (T) => {
|
|
691
|
-
var z,
|
|
692
|
-
return (
|
|
691
|
+
var z, W;
|
|
692
|
+
return (W = (z = P.value) == null ? void 0 : z.validateInputs) == null ? void 0 : W.call(z);
|
|
693
693
|
})
|
|
694
694
|
}, null, 8, ["loading", "label"])
|
|
695
695
|
])
|
|
@@ -700,30 +700,30 @@ const qt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
|
|
|
700
700
|
}
|
|
701
701
|
});
|
|
702
702
|
function Ve(f, y) {
|
|
703
|
-
const
|
|
704
|
-
return { ...
|
|
703
|
+
const i = xe(f, y);
|
|
704
|
+
return { ...i, amount: -i.amount };
|
|
705
705
|
}
|
|
706
706
|
function We(f, y) {
|
|
707
707
|
return xe(Math.abs(f), y);
|
|
708
708
|
}
|
|
709
|
-
const
|
|
710
|
-
[
|
|
709
|
+
const Be = {
|
|
710
|
+
[Z.enum.DAMAGE]: {
|
|
711
711
|
label: "Waste",
|
|
712
712
|
toAdjustmentAmount: Ve
|
|
713
713
|
},
|
|
714
|
-
[
|
|
714
|
+
[Z.enum.THEFT]: {
|
|
715
715
|
label: "Theft",
|
|
716
716
|
toAdjustmentAmount: Ve
|
|
717
717
|
},
|
|
718
|
-
[
|
|
718
|
+
[Z.enum.LOSE]: {
|
|
719
719
|
label: "Lose",
|
|
720
720
|
toAdjustmentAmount: Ve
|
|
721
721
|
},
|
|
722
|
-
[
|
|
722
|
+
[Z.enum.EXTRA]: {
|
|
723
723
|
label: "Extra",
|
|
724
724
|
toAdjustmentAmount: We
|
|
725
725
|
},
|
|
726
|
-
[
|
|
726
|
+
[Z.enum.PURCHASE]: {
|
|
727
727
|
label: "Purchase",
|
|
728
728
|
toAdjustmentAmount: We
|
|
729
729
|
}
|
|
@@ -735,112 +735,112 @@ const Me = {
|
|
|
735
735
|
},
|
|
736
736
|
emits: ["update:modelValue", "click:delete"],
|
|
737
737
|
setup(f, { emit: y }) {
|
|
738
|
-
const
|
|
739
|
-
() => Object.keys(
|
|
740
|
-
label: vt(
|
|
741
|
-
value:
|
|
738
|
+
const i = f, o = y, S = U(
|
|
739
|
+
() => Object.keys(Be).map((r) => ({
|
|
740
|
+
label: vt(r),
|
|
741
|
+
value: r
|
|
742
742
|
}))
|
|
743
|
-
), _ = U(() => tt(
|
|
743
|
+
), _ = U(() => tt(i.modelValue.doc.unit, !0)), u = U({
|
|
744
744
|
get() {
|
|
745
|
-
return
|
|
745
|
+
return i.modelValue.type ?? Z.enum.PURCHASE;
|
|
746
746
|
},
|
|
747
|
-
set(
|
|
748
|
-
const
|
|
749
|
-
...
|
|
747
|
+
set(r) {
|
|
748
|
+
const t = {
|
|
749
|
+
...i.modelValue
|
|
750
750
|
};
|
|
751
|
-
|
|
752
|
-
const F = Ne(
|
|
753
|
-
|
|
751
|
+
t.type = r;
|
|
752
|
+
const F = Ne(i.modelValue.amount);
|
|
753
|
+
t.amount = Be[t.type].toAdjustmentAmount(
|
|
754
754
|
+de(F),
|
|
755
755
|
F.precision
|
|
756
|
-
), o("update:modelValue",
|
|
756
|
+
), o("update:modelValue", t);
|
|
757
757
|
}
|
|
758
758
|
}), m = U({
|
|
759
759
|
get() {
|
|
760
|
-
const
|
|
761
|
-
return +de(
|
|
760
|
+
const r = Ne(i.modelValue.amount);
|
|
761
|
+
return +de(r);
|
|
762
762
|
},
|
|
763
|
-
set(
|
|
764
|
-
const
|
|
765
|
-
...
|
|
766
|
-
}, F = fe(
|
|
767
|
-
|
|
768
|
-
|
|
763
|
+
set(r) {
|
|
764
|
+
const t = {
|
|
765
|
+
...i.modelValue
|
|
766
|
+
}, F = fe(r);
|
|
767
|
+
t.amount = Be[u.value].toAdjustmentAmount(
|
|
768
|
+
r,
|
|
769
769
|
F.precision
|
|
770
|
-
), o("update:modelValue",
|
|
770
|
+
), o("update:modelValue", t);
|
|
771
771
|
}
|
|
772
772
|
}), w = U({
|
|
773
773
|
get() {
|
|
774
|
-
var
|
|
775
|
-
return ((
|
|
774
|
+
var r;
|
|
775
|
+
return ((r = i.modelValue.measurement) == null ? void 0 : r.id) ?? null;
|
|
776
776
|
},
|
|
777
|
-
set(
|
|
777
|
+
set(r) {
|
|
778
778
|
var F, C;
|
|
779
|
-
const
|
|
780
|
-
...
|
|
779
|
+
const t = {
|
|
780
|
+
...i.modelValue
|
|
781
781
|
};
|
|
782
|
-
|
|
782
|
+
t.measurement = ((C = (F = i.modelValue.doc.unit) == null ? void 0 : F.measurements) == null ? void 0 : C.find((k) => k.id === r)) ?? null, o("update:modelValue", t);
|
|
783
783
|
}
|
|
784
784
|
}), x = U({
|
|
785
785
|
get() {
|
|
786
|
-
return
|
|
786
|
+
return i.modelValue.remark ?? "";
|
|
787
787
|
},
|
|
788
|
-
set(
|
|
789
|
-
const
|
|
790
|
-
...
|
|
788
|
+
set(r) {
|
|
789
|
+
const t = {
|
|
790
|
+
...i.modelValue
|
|
791
791
|
};
|
|
792
|
-
|
|
792
|
+
t.remark = r, o("update:modelValue", t);
|
|
793
793
|
}
|
|
794
794
|
});
|
|
795
|
-
return (
|
|
796
|
-
const F = M("FmButton"), C = M("FmSelect"), k = M("FmTextarea"),
|
|
797
|
-
return
|
|
795
|
+
return (r, t) => {
|
|
796
|
+
const F = M("FmButton"), C = M("FmSelect"), k = M("FmTextarea"), a = M("FmCard");
|
|
797
|
+
return $(), K(a, {
|
|
798
798
|
variant: "outlined",
|
|
799
799
|
class: "grid grid-cols-2 gap-8 p-16"
|
|
800
800
|
}, {
|
|
801
|
-
default:
|
|
802
|
-
|
|
803
|
-
|
|
801
|
+
default: j(() => [
|
|
802
|
+
n("div", cn, [
|
|
803
|
+
n("div", dn, h(r.modelValue.doc.name), 1),
|
|
804
804
|
g(F, {
|
|
805
805
|
variant: "tertiary",
|
|
806
806
|
"prepend-icon": "delete",
|
|
807
|
-
onClick:
|
|
807
|
+
onClick: t[0] || (t[0] = (V) => o("click:delete"))
|
|
808
808
|
})
|
|
809
809
|
]),
|
|
810
810
|
g(C, {
|
|
811
|
-
disabled:
|
|
811
|
+
disabled: r.disabled,
|
|
812
812
|
class: "col-span-2",
|
|
813
813
|
label: "Type",
|
|
814
814
|
items: S.value,
|
|
815
|
-
modelValue:
|
|
816
|
-
"onUpdate:modelValue":
|
|
817
|
-
rules: [
|
|
815
|
+
modelValue: u.value,
|
|
816
|
+
"onUpdate:modelValue": t[1] || (t[1] = (V) => u.value = V),
|
|
817
|
+
rules: [l(ft)()],
|
|
818
818
|
"label-mark": "required"
|
|
819
819
|
}, null, 8, ["disabled", "items", "modelValue", "rules"]),
|
|
820
820
|
g(Ht, {
|
|
821
|
-
disabled:
|
|
821
|
+
disabled: r.disabled,
|
|
822
822
|
label: "Amount",
|
|
823
|
-
step: +
|
|
823
|
+
step: +l(de)({
|
|
824
824
|
amount: 1,
|
|
825
|
-
precision:
|
|
825
|
+
precision: l(Me)(r.modelValue.doc.unit, r.modelValue.measurement)
|
|
826
826
|
}),
|
|
827
827
|
modelValue: m.value,
|
|
828
|
-
"onUpdate:modelValue":
|
|
829
|
-
rules: [
|
|
828
|
+
"onUpdate:modelValue": t[2] || (t[2] = (V) => m.value = V),
|
|
829
|
+
rules: [l(De)(0)]
|
|
830
830
|
}, null, 8, ["disabled", "step", "modelValue", "rules"]),
|
|
831
831
|
g(C, {
|
|
832
|
-
disabled:
|
|
832
|
+
disabled: r.disabled,
|
|
833
833
|
label: "Unit",
|
|
834
834
|
items: _.value,
|
|
835
835
|
modelValue: w.value,
|
|
836
|
-
"onUpdate:modelValue":
|
|
836
|
+
"onUpdate:modelValue": t[3] || (t[3] = (V) => w.value = V)
|
|
837
837
|
}, null, 8, ["disabled", "items", "modelValue"]),
|
|
838
838
|
g(k, {
|
|
839
839
|
class: "col-span-2",
|
|
840
|
-
disabled:
|
|
840
|
+
disabled: r.disabled,
|
|
841
841
|
label: "Remark",
|
|
842
842
|
modelValue: x.value,
|
|
843
|
-
"onUpdate:modelValue":
|
|
843
|
+
"onUpdate:modelValue": t[4] || (t[4] = (V) => x.value = V),
|
|
844
844
|
"label-mark": "optional"
|
|
845
845
|
}, null, 8, ["disabled", "modelValue"])
|
|
846
846
|
]),
|
|
@@ -855,24 +855,24 @@ const Me = {
|
|
|
855
855
|
show: { type: Boolean }
|
|
856
856
|
},
|
|
857
857
|
emits: ["update:show", "submitted"],
|
|
858
|
-
setup(f, { expose: y, emit:
|
|
859
|
-
const o = f, S =
|
|
860
|
-
function
|
|
861
|
-
|
|
858
|
+
setup(f, { expose: y, emit: i }) {
|
|
859
|
+
const o = f, S = i, _ = Ue(), u = nt(), m = Ee(), w = ye(), x = O(!1), { t: r } = ue();
|
|
860
|
+
function t() {
|
|
861
|
+
a(Te(k));
|
|
862
862
|
}
|
|
863
863
|
const F = O();
|
|
864
864
|
y({
|
|
865
865
|
validateInputs: () => {
|
|
866
|
-
var
|
|
867
|
-
(
|
|
866
|
+
var B, A;
|
|
867
|
+
(A = (B = F.value) == null ? void 0 : B.validateInputs) == null || A.call(B);
|
|
868
868
|
},
|
|
869
869
|
resetInputsValidation: () => {
|
|
870
|
-
var
|
|
871
|
-
(
|
|
870
|
+
var B, A;
|
|
871
|
+
(A = (B = F.value) == null ? void 0 : B.resetInputsValidation) == null || A.call(B);
|
|
872
872
|
},
|
|
873
873
|
resetInputs: () => {
|
|
874
|
-
var
|
|
875
|
-
(
|
|
874
|
+
var B, A;
|
|
875
|
+
(A = (B = F.value) == null ? void 0 : B.resetInputs) == null || A.call(B);
|
|
876
876
|
}
|
|
877
877
|
});
|
|
878
878
|
const C = He(o, "show"), k = at({
|
|
@@ -880,7 +880,7 @@ const Me = {
|
|
|
880
880
|
adjustments: [
|
|
881
881
|
{
|
|
882
882
|
id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
|
|
883
|
-
type:
|
|
883
|
+
type: Z.enum.PURCHASE,
|
|
884
884
|
doc: o.stock,
|
|
885
885
|
measurement: null,
|
|
886
886
|
remark: "",
|
|
@@ -888,11 +888,11 @@ const Me = {
|
|
|
888
888
|
}
|
|
889
889
|
]
|
|
890
890
|
});
|
|
891
|
-
be([() => o.show], ([
|
|
892
|
-
|
|
891
|
+
be([() => o.show], ([B]) => {
|
|
892
|
+
B && (k.remark = "", k.adjustments = [
|
|
893
893
|
{
|
|
894
894
|
id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
|
|
895
|
-
type:
|
|
895
|
+
type: Z.enum.PURCHASE,
|
|
896
896
|
doc: o.stock,
|
|
897
897
|
measurement: null,
|
|
898
898
|
remark: "",
|
|
@@ -900,42 +900,42 @@ const Me = {
|
|
|
900
900
|
}
|
|
901
901
|
]);
|
|
902
902
|
});
|
|
903
|
-
async function
|
|
903
|
+
async function a(B) {
|
|
904
904
|
x.value = !0;
|
|
905
905
|
try {
|
|
906
906
|
await m.adjustSku({
|
|
907
|
-
remark:
|
|
908
|
-
adjustments:
|
|
909
|
-
id:
|
|
907
|
+
remark: B.remark,
|
|
908
|
+
adjustments: B.adjustments.map(({ doc: A, remark: D, type: P, amount: E, measurement: te }) => ({
|
|
909
|
+
id: A._id,
|
|
910
910
|
amount: E,
|
|
911
|
-
measurement:
|
|
912
|
-
remark:
|
|
913
|
-
doc:
|
|
911
|
+
measurement: te,
|
|
912
|
+
remark: D,
|
|
913
|
+
doc: A,
|
|
914
914
|
type: P
|
|
915
915
|
}))
|
|
916
916
|
}), S("update:show", !1), S("submitted");
|
|
917
|
-
} catch (
|
|
917
|
+
} catch (A) {
|
|
918
918
|
w.open({
|
|
919
|
-
title:
|
|
920
|
-
message:
|
|
919
|
+
title: r("inventory.stock.adjust.error.title"),
|
|
920
|
+
message: r("inventory.stock.adjust.error.message"),
|
|
921
921
|
type: "error"
|
|
922
|
-
}), console.log("error on adjust ingredients",
|
|
922
|
+
}), console.log("error on adjust ingredients", B, A);
|
|
923
923
|
} finally {
|
|
924
924
|
x.value = !1;
|
|
925
925
|
}
|
|
926
926
|
}
|
|
927
|
-
function
|
|
928
|
-
const
|
|
929
|
-
label:
|
|
930
|
-
sublabel:
|
|
931
|
-
value:
|
|
932
|
-
})),
|
|
933
|
-
|
|
927
|
+
function V() {
|
|
928
|
+
const B = _.skus.map((D) => ({
|
|
929
|
+
label: D.name,
|
|
930
|
+
sublabel: D.code,
|
|
931
|
+
value: D._id
|
|
932
|
+
})), A = B.filter((D) => k.adjustments.find((P) => P.doc._id === D.value)).map((D) => D.value);
|
|
933
|
+
u.open({
|
|
934
934
|
title: "Select ingredients",
|
|
935
935
|
contentComponent: yt,
|
|
936
936
|
contentComponentProps: {
|
|
937
|
-
items:
|
|
938
|
-
modelValue:
|
|
937
|
+
items: B,
|
|
938
|
+
modelValue: A
|
|
939
939
|
},
|
|
940
940
|
overlay: !0,
|
|
941
941
|
closeButton: !0,
|
|
@@ -949,11 +949,11 @@ const Me = {
|
|
|
949
949
|
close: !0,
|
|
950
950
|
variant: "tertiary"
|
|
951
951
|
}
|
|
952
|
-
}).onPrimary((
|
|
953
|
-
k.adjustments =
|
|
952
|
+
}).onPrimary((D) => {
|
|
953
|
+
k.adjustments = D.map(
|
|
954
954
|
(P) => k.adjustments.find((E) => E.doc._id === P) ?? {
|
|
955
955
|
id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
|
|
956
|
-
type:
|
|
956
|
+
type: Z.enum.PURCHASE,
|
|
957
957
|
doc: _.skus.find((E) => E._id === P),
|
|
958
958
|
measurement: null,
|
|
959
959
|
remark: "",
|
|
@@ -962,62 +962,62 @@ const Me = {
|
|
|
962
962
|
);
|
|
963
963
|
});
|
|
964
964
|
}
|
|
965
|
-
function L(
|
|
966
|
-
k.adjustments.splice(
|
|
965
|
+
function L(B) {
|
|
966
|
+
k.adjustments.splice(B, 1);
|
|
967
967
|
}
|
|
968
|
-
return (
|
|
969
|
-
const
|
|
970
|
-
return
|
|
971
|
-
modelValue:
|
|
972
|
-
"onUpdate:modelValue":
|
|
968
|
+
return (B, A) => {
|
|
969
|
+
const D = M("FmTextarea"), P = M("FmButton"), E = M("FmForm"), te = M("FmSideSheet");
|
|
970
|
+
return $(), K(te, {
|
|
971
|
+
modelValue: l(C),
|
|
972
|
+
"onUpdate:modelValue": A[2] || (A[2] = (q) => Ie(C) ? C.value = q : null),
|
|
973
973
|
"dismiss-away": "",
|
|
974
974
|
"max-width": 500
|
|
975
975
|
}, {
|
|
976
|
-
"side-sheet-header":
|
|
977
|
-
|
|
978
|
-
|
|
976
|
+
"side-sheet-header": j(() => [
|
|
977
|
+
n("div", pn, [
|
|
978
|
+
n("div", vn, h(l(r)("inventory.stock.adjust.title")), 1)
|
|
979
979
|
])
|
|
980
980
|
]),
|
|
981
|
-
default:
|
|
981
|
+
default: j(() => [
|
|
982
982
|
g(E, {
|
|
983
983
|
class: "w-full flex flex-col gap-12",
|
|
984
984
|
ref_key: "formRef",
|
|
985
985
|
ref: F,
|
|
986
|
-
onValidationSuccess:
|
|
986
|
+
onValidationSuccess: t
|
|
987
987
|
}, {
|
|
988
|
-
default:
|
|
989
|
-
g(
|
|
990
|
-
label: r
|
|
988
|
+
default: j(() => [
|
|
989
|
+
g(D, {
|
|
990
|
+
label: l(r)("inventory.stock.adjust.remark"),
|
|
991
991
|
modelValue: k.remark,
|
|
992
|
-
"onUpdate:modelValue":
|
|
992
|
+
"onUpdate:modelValue": A[0] || (A[0] = (q) => k.remark = q)
|
|
993
993
|
}, null, 8, ["label", "modelValue"]),
|
|
994
|
-
|
|
995
|
-
|
|
994
|
+
n("div", fn, [
|
|
995
|
+
n("div", yn, h(l(r)("inventory.stock.adjust.adjustedItems")), 1),
|
|
996
996
|
g(P, {
|
|
997
997
|
"prepend-icon": "add",
|
|
998
998
|
variant: "tertiary",
|
|
999
999
|
size: "md",
|
|
1000
|
-
onClick:
|
|
1000
|
+
onClick: V
|
|
1001
1001
|
})
|
|
1002
1002
|
]),
|
|
1003
|
-
(
|
|
1003
|
+
($(!0), H(ee, null, le(k.adjustments, (q, N) => ($(), K(mn, {
|
|
1004
1004
|
key: q.id,
|
|
1005
1005
|
modelValue: k.adjustments[N],
|
|
1006
|
-
"onUpdate:modelValue": (
|
|
1007
|
-
"onClick:delete": (
|
|
1006
|
+
"onUpdate:modelValue": (R) => k.adjustments[N] = R,
|
|
1007
|
+
"onClick:delete": (R) => L(N)
|
|
1008
1008
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "onClick:delete"]))), 128))
|
|
1009
1009
|
]),
|
|
1010
1010
|
_: 1
|
|
1011
1011
|
}, 512)
|
|
1012
1012
|
]),
|
|
1013
|
-
"side-sheet-footer":
|
|
1014
|
-
|
|
1013
|
+
"side-sheet-footer": j(() => [
|
|
1014
|
+
n("div", _n, [
|
|
1015
1015
|
g(P, {
|
|
1016
|
-
label: r
|
|
1016
|
+
label: l(r)("inventory.stock.adjust.adjustButton"),
|
|
1017
1017
|
loading: x.value,
|
|
1018
|
-
onClick:
|
|
1019
|
-
var N,
|
|
1020
|
-
return (
|
|
1018
|
+
onClick: A[1] || (A[1] = (q) => {
|
|
1019
|
+
var N, R;
|
|
1020
|
+
return (R = (N = F.value) == null ? void 0 : N.validateInputs) == null ? void 0 : R.call(N);
|
|
1021
1021
|
})
|
|
1022
1022
|
}, null, 8, ["label", "loading"])
|
|
1023
1023
|
])
|
|
@@ -1028,20 +1028,20 @@ const Me = {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
}), hn = _t((f, y) => ({
|
|
1030
1030
|
// TODO: remove once latest inventory backend has been push
|
|
1031
|
-
async findBillsByBusinessId(
|
|
1032
|
-
const _ = `${f.businessesBackendUrl}/${
|
|
1031
|
+
async findBillsByBusinessId(i, o, S) {
|
|
1032
|
+
const _ = `${f.businessesBackendUrl}/${i}/reports/find-many`, u = {
|
|
1033
1033
|
// type: TYPE.bill,
|
|
1034
1034
|
type: "bill",
|
|
1035
1035
|
restaurantIds: o,
|
|
1036
1036
|
ids: S
|
|
1037
1037
|
};
|
|
1038
|
-
return await y.post(_,
|
|
1038
|
+
return await y.post(_, u);
|
|
1039
1039
|
},
|
|
1040
|
-
async findBillsById(
|
|
1041
|
-
const S = pe().currentLocationDBName, _ = `${f.inventoryBackendUrl}/${S}/bill/search`,
|
|
1042
|
-
ids:
|
|
1040
|
+
async findBillsById(i) {
|
|
1041
|
+
const S = pe().currentLocationDBName, _ = `${f.inventoryBackendUrl}/${S}/bill/search`, u = {
|
|
1042
|
+
ids: i
|
|
1043
1043
|
};
|
|
1044
|
-
return await y.post(_,
|
|
1044
|
+
return await y.post(_, u);
|
|
1045
1045
|
}
|
|
1046
1046
|
})), gn = { class: "p-16" }, bn = { class: "fm-typo-en-body-md-600 flex-grow" }, xn = { class: "flex-grow text-fm-color-typo-secondary" }, Sn = {
|
|
1047
1047
|
key: 0,
|
|
@@ -1050,6 +1050,9 @@ const Me = {
|
|
|
1050
1050
|
key: 1,
|
|
1051
1051
|
class: "t-system text-fsecondary"
|
|
1052
1052
|
}, Vn = {
|
|
1053
|
+
key: 2,
|
|
1054
|
+
class: "inline-flex items-center rounded-md bg-yellow-400/10 px-2 text-xs font-medium text-yellow-500 inset-ring inset-ring-yellow-400/20"
|
|
1055
|
+
}, Bn = {
|
|
1053
1056
|
key: 0,
|
|
1054
1057
|
class: "shrink-0 text-fm-color-typo-secondary"
|
|
1055
1058
|
}, Mn = /* @__PURE__ */ ie({
|
|
@@ -1060,78 +1063,87 @@ const Me = {
|
|
|
1060
1063
|
bills: { default: () => [] }
|
|
1061
1064
|
},
|
|
1062
1065
|
setup(f) {
|
|
1063
|
-
const y = f,
|
|
1066
|
+
const y = f, i = O(!1), o = O(), S = O(null), _ = U(() => S.value === null ? "unset" : i.value ? `${S.value}px` : "0px");
|
|
1064
1067
|
qe(() => {
|
|
1065
1068
|
var x;
|
|
1066
1069
|
S.value = ((x = o.value) == null ? void 0 : x.scrollHeight) || 0;
|
|
1067
1070
|
});
|
|
1068
|
-
const
|
|
1071
|
+
const u = U(() => {
|
|
1069
1072
|
var k;
|
|
1070
|
-
const x = y.record.adjustments,
|
|
1071
|
-
var
|
|
1072
|
-
return ((
|
|
1073
|
-
}).flatMap((
|
|
1074
|
-
for (const
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1073
|
+
const x = y.record.adjustments, r = y.sku, t = {}, C = x.flatMap((a) => {
|
|
1074
|
+
var V;
|
|
1075
|
+
return ((V = a.skus) == null ? void 0 : V.filter((L) => L.sku._id === r._id)) ?? [];
|
|
1076
|
+
}).flatMap((a) => a.amounts);
|
|
1077
|
+
for (const a of C) {
|
|
1078
|
+
const V = a.measurement ? kt(a.measurement.conversion, a.amount) : a.amount;
|
|
1079
|
+
t[k = a.type] ?? (t[k] = { amount: 0, precision: 0 }), t[a.type] = Xe(V, t[a.type]);
|
|
1077
1080
|
}
|
|
1078
|
-
return Object.entries(
|
|
1079
|
-
(
|
|
1080
|
-
`${
|
|
1081
|
+
return Object.entries(t).reduce(
|
|
1082
|
+
(a, [V, L]) => (a[V] = /// comment, because without it formatter makes code uglier
|
|
1083
|
+
`${Y.toFormatString({
|
|
1081
1084
|
value: L,
|
|
1082
1085
|
precision: 4
|
|
1083
|
-
})} ${
|
|
1086
|
+
})} ${r.unit.abbrev}`, a),
|
|
1084
1087
|
{}
|
|
1085
1088
|
);
|
|
1086
|
-
}), { t: m } = ue(), w = U(() => y.record.adjustmentsByTime.map(({ date: x, adjustments:
|
|
1089
|
+
}), { t: m } = ue(), w = U(() => y.record.adjustmentsByTime.map(({ date: x, adjustments: r }) => ({
|
|
1087
1090
|
time: ht(new Date(x)),
|
|
1088
|
-
adjustments:
|
|
1089
|
-
(
|
|
1091
|
+
adjustments: r.flatMap(
|
|
1092
|
+
(t) => {
|
|
1090
1093
|
var F, C;
|
|
1091
|
-
return ((C = (F =
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1094
|
+
return ((C = (F = t.skus) == null ? void 0 : F.map) == null ? void 0 : C.call(F, (k) => {
|
|
1095
|
+
var a, V;
|
|
1096
|
+
return {
|
|
1097
|
+
...k,
|
|
1098
|
+
ref: t.ref,
|
|
1099
|
+
backdateFrom: t.effectiveAt != null ? et(t._id) : null,
|
|
1100
|
+
toBalance: (V = (a = t.skus) == null ? void 0 : a[0]) == null ? void 0 : V.toBalance
|
|
1101
|
+
};
|
|
1102
|
+
})) ?? [];
|
|
1096
1103
|
}
|
|
1097
|
-
).flatMap((
|
|
1104
|
+
).flatMap((t) => {
|
|
1098
1105
|
var k;
|
|
1099
|
-
const F = (k = y.bills.find((
|
|
1100
|
-
return
|
|
1101
|
-
var
|
|
1106
|
+
const F = (k = y.bills.find((a) => a._id === t.ref)) == null ? void 0 : k.seqNumber, C = F ? m("inventory.stock.record.bill", [F]) : "";
|
|
1107
|
+
return t.amounts.map((a) => {
|
|
1108
|
+
var V;
|
|
1102
1109
|
return {
|
|
1103
|
-
amount: `${
|
|
1104
|
-
backdateFrom:
|
|
1105
|
-
name:
|
|
1106
|
-
remark:
|
|
1107
|
-
cost:
|
|
1110
|
+
amount: `${Y.toFormatString({ value: a.amount, precision: 4 })} ${((V = a.measurement) == null ? void 0 : V.abbrev) ?? t.sku.unit.abbrev}`,
|
|
1111
|
+
backdateFrom: t.backdateFrom,
|
|
1112
|
+
name: a.type,
|
|
1113
|
+
remark: a.remark || C || "",
|
|
1114
|
+
cost: a.cost,
|
|
1115
|
+
toBalance: Y.toFormatString({
|
|
1116
|
+
value: t.toBalance ?? Y.fromNumber(0),
|
|
1117
|
+
precision: 4
|
|
1118
|
+
}),
|
|
1119
|
+
baseUnit: t.sku.unit.abbrev
|
|
1108
1120
|
};
|
|
1109
1121
|
});
|
|
1110
1122
|
})
|
|
1111
1123
|
})));
|
|
1112
|
-
return (x,
|
|
1113
|
-
const
|
|
1114
|
-
return
|
|
1115
|
-
default:
|
|
1116
|
-
|
|
1117
|
-
|
|
1124
|
+
return (x, r) => {
|
|
1125
|
+
const t = M("FmIcon"), F = M("FmTooltip"), C = M("FmCard");
|
|
1126
|
+
return $(), K(C, { variant: "outlined" }, {
|
|
1127
|
+
default: j(() => [
|
|
1128
|
+
n("div", gn, [
|
|
1129
|
+
n("div", {
|
|
1118
1130
|
class: "flex items-center cursor-pointer mb-1",
|
|
1119
|
-
onClick:
|
|
1131
|
+
onClick: r[0] || (r[0] = (k) => i.value = !i.value)
|
|
1120
1132
|
}, [
|
|
1121
|
-
|
|
1122
|
-
g(
|
|
1123
|
-
name:
|
|
1133
|
+
n("div", bn, h(x.record.date), 1),
|
|
1134
|
+
g(t, {
|
|
1135
|
+
name: i.value ? "expand_more" : "expand_less",
|
|
1124
1136
|
color: "#777777",
|
|
1125
1137
|
size: "md"
|
|
1126
1138
|
}, null, 8, ["name"])
|
|
1127
1139
|
]),
|
|
1128
|
-
(
|
|
1129
|
-
key:
|
|
1140
|
+
($(!0), H(ee, null, le(u.value, (k, a) => ($(), H("div", {
|
|
1141
|
+
key: a,
|
|
1130
1142
|
class: "flex flex-row py-1",
|
|
1131
1143
|
style: { "font-size": "0.8rem" }
|
|
1132
1144
|
}, [
|
|
1133
|
-
|
|
1134
|
-
|
|
1145
|
+
n("div", xn, h(l(m)(`inventory.inventoryAdjustment.type.${a}`)), 1),
|
|
1146
|
+
n("div", {
|
|
1135
1147
|
class: ge({
|
|
1136
1148
|
"text-fm-color-typo-error": k.startsWith("-"),
|
|
1137
1149
|
"text-fm-color-typo-success": !k.startsWith("-"),
|
|
@@ -1139,7 +1151,7 @@ const Me = {
|
|
|
1139
1151
|
})
|
|
1140
1152
|
}, h(k), 3)
|
|
1141
1153
|
]))), 128)),
|
|
1142
|
-
|
|
1154
|
+
n("div", {
|
|
1143
1155
|
ref_key: "detailRef",
|
|
1144
1156
|
ref: o,
|
|
1145
1157
|
style: Qe({
|
|
@@ -1149,47 +1161,50 @@ const Me = {
|
|
|
1149
1161
|
transition: "max-height 0.2s ease-out"
|
|
1150
1162
|
})
|
|
1151
1163
|
}, [
|
|
1152
|
-
w.value.length ? (
|
|
1153
|
-
(
|
|
1164
|
+
w.value.length ? ($(), H("hr", Sn)) : J("", !0),
|
|
1165
|
+
($(!0), H(ee, null, le(w.value, (k) => ($(), H("div", {
|
|
1154
1166
|
key: k.time,
|
|
1155
1167
|
class: "flex gap-1 w-full"
|
|
1156
1168
|
}, [
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
(
|
|
1160
|
-
key:
|
|
1169
|
+
n("div", Fn, h(k.time), 1),
|
|
1170
|
+
n("div", wn, [
|
|
1171
|
+
($(!0), H(ee, null, le(k.adjustments, (a) => ($(), H("div", {
|
|
1172
|
+
key: a.name,
|
|
1161
1173
|
class: "flex gap-1"
|
|
1162
1174
|
}, [
|
|
1163
|
-
|
|
1164
|
-
ce(h(
|
|
1165
|
-
|
|
1175
|
+
n("div", $n, [
|
|
1176
|
+
ce(h(l(m)(`inventory.inventoryAdjustment.type.${a.name}`)) + " ", 1),
|
|
1177
|
+
a.backdateFrom ? ($(), K(F, {
|
|
1166
1178
|
key: 0,
|
|
1167
1179
|
variant: "plain",
|
|
1168
1180
|
placement: "top",
|
|
1169
1181
|
"z-index": 50
|
|
1170
1182
|
}, {
|
|
1171
|
-
content:
|
|
1172
|
-
|
|
1183
|
+
content: j(() => [
|
|
1184
|
+
n("div", An, h(l(m)("inventory.stock.record.backdate", [
|
|
1185
|
+
l(Je)(new Date(a.backdateFrom))
|
|
1186
|
+
])), 1)
|
|
1173
1187
|
]),
|
|
1174
|
-
default:
|
|
1175
|
-
g(
|
|
1188
|
+
default: j(() => [
|
|
1189
|
+
g(t, {
|
|
1176
1190
|
name: "info",
|
|
1177
1191
|
size: "sm",
|
|
1178
1192
|
color: "primary"
|
|
1179
1193
|
})
|
|
1180
1194
|
]),
|
|
1181
1195
|
_: 2
|
|
1182
|
-
}, 1024)) :
|
|
1183
|
-
|
|
1196
|
+
}, 1024)) : J("", !0),
|
|
1197
|
+
a.remark ? ($(), H("span", Cn, " # " + h(a.remark), 1)) : J("", !0),
|
|
1198
|
+
a.name === l(Z).Enum.CLOSING ? ($(), H("span", Vn, " Actual Balance: " + h(a.toBalance) + " " + h(a.baseUnit), 1)) : J("", !0)
|
|
1184
1199
|
]),
|
|
1185
|
-
|
|
1200
|
+
n("div", {
|
|
1186
1201
|
class: ge({
|
|
1187
|
-
"text-fm-color-typo-error":
|
|
1188
|
-
"text-fm-color-typo-success": !
|
|
1202
|
+
"text-fm-color-typo-error": a.amount.startsWith("-"),
|
|
1203
|
+
"text-fm-color-typo-success": !a.amount.startsWith("-"),
|
|
1189
1204
|
"ml-auto": !0
|
|
1190
1205
|
})
|
|
1191
|
-
}, h(
|
|
1192
|
-
|
|
1206
|
+
}, h(a.amount), 3),
|
|
1207
|
+
a.cost ? ($(), H("div", Bn, " (" + h(l(ke)(a.cost, !1, a.cost.precision)) + ") ", 1)) : J("", !0)
|
|
1193
1208
|
]))), 128))
|
|
1194
1209
|
])
|
|
1195
1210
|
]))), 128))
|
|
@@ -1201,81 +1216,81 @@ const Me = {
|
|
|
1201
1216
|
};
|
|
1202
1217
|
}
|
|
1203
1218
|
});
|
|
1204
|
-
function
|
|
1219
|
+
function Dn(f, y) {
|
|
1205
1220
|
var _;
|
|
1206
|
-
const
|
|
1207
|
-
(
|
|
1221
|
+
const i = Object.keys(Z.enum).reduce(
|
|
1222
|
+
(u, m) => (u[m] = { amount: 0, precision: 0 }, u),
|
|
1208
1223
|
{}
|
|
1209
1224
|
);
|
|
1210
1225
|
if (!y)
|
|
1211
|
-
return Object.entries(
|
|
1212
|
-
(
|
|
1226
|
+
return Object.entries(i).reduce(
|
|
1227
|
+
(u, [m]) => (u[m] = Y.fromNumber(0), u),
|
|
1213
1228
|
{}
|
|
1214
1229
|
);
|
|
1215
|
-
const S = f.flatMap((
|
|
1230
|
+
const S = f.flatMap((u) => {
|
|
1216
1231
|
var m;
|
|
1217
|
-
return ((m =
|
|
1218
|
-
}).flatMap((
|
|
1219
|
-
for (const
|
|
1220
|
-
const m =
|
|
1221
|
-
|
|
1232
|
+
return ((m = u.skus) == null ? void 0 : m.filter((w) => w.sku._id === y._id)) ?? [];
|
|
1233
|
+
}).flatMap((u) => u.amounts);
|
|
1234
|
+
for (const u of S) {
|
|
1235
|
+
const m = u.measurement ? Y.multiply([u.measurement.conversion, u.amount]) : u.amount;
|
|
1236
|
+
i[_ = u.type] ?? (i[_] = { amount: 0, precision: 0 }), i[u.type] = Y.add([m, i[u.type]]);
|
|
1222
1237
|
}
|
|
1223
|
-
return Object.entries(
|
|
1224
|
-
(
|
|
1238
|
+
return Object.entries(i).reduce(
|
|
1239
|
+
(u, [m, w]) => {
|
|
1225
1240
|
const x = {
|
|
1226
1241
|
...w,
|
|
1227
1242
|
amount: Math.abs(w.amount)
|
|
1228
1243
|
};
|
|
1229
|
-
return
|
|
1230
|
-
`${
|
|
1244
|
+
return u[m] = /// comment, because without it formatter makes code uglier
|
|
1245
|
+
`${Y.toFormatString({
|
|
1231
1246
|
value: x,
|
|
1232
1247
|
precision: 4
|
|
1233
|
-
})} ${y.unit.abbrev}`,
|
|
1248
|
+
})} ${y.unit.abbrev}`, u;
|
|
1234
1249
|
},
|
|
1235
1250
|
{}
|
|
1236
1251
|
);
|
|
1237
1252
|
}
|
|
1238
|
-
function
|
|
1253
|
+
function jn(f, y) {
|
|
1239
1254
|
if (!y)
|
|
1240
1255
|
return null;
|
|
1241
|
-
let
|
|
1256
|
+
let i = null;
|
|
1242
1257
|
const S = f.flatMap((_) => {
|
|
1243
|
-
var
|
|
1244
|
-
return ((
|
|
1258
|
+
var u;
|
|
1259
|
+
return ((u = _.skus) == null ? void 0 : u.filter((m) => m.sku._id === y._id)) ?? [];
|
|
1245
1260
|
}).flatMap((_) => {
|
|
1246
|
-
var
|
|
1247
|
-
return !_.history || ((
|
|
1261
|
+
var u;
|
|
1262
|
+
return !_.history || ((u = _.history) == null ? void 0 : u.length) === 0 ? [] : _.history[0];
|
|
1248
1263
|
});
|
|
1249
1264
|
for (const _ of S) {
|
|
1250
|
-
const
|
|
1251
|
-
for (const m of
|
|
1252
|
-
if (m.type !==
|
|
1265
|
+
const u = _.amounts;
|
|
1266
|
+
for (const m of u) {
|
|
1267
|
+
if (m.type !== Z.Enum.SALES)
|
|
1253
1268
|
continue;
|
|
1254
|
-
const w = m.measurement ?
|
|
1255
|
-
|
|
1269
|
+
const w = m.measurement ? Y.multiply([m.measurement.conversion, m.amount]) : m.amount;
|
|
1270
|
+
i ?? (i = Y.fromNumber(0)), i = Y.add([i, w]);
|
|
1256
1271
|
}
|
|
1257
1272
|
}
|
|
1258
|
-
return
|
|
1259
|
-
value:
|
|
1273
|
+
return i != null ? (i.amount = Math.abs(i.amount), `${Y.toFormatString({
|
|
1274
|
+
value: i,
|
|
1260
1275
|
precision: 4
|
|
1261
1276
|
})} ${y.unit.abbrev}`) : null;
|
|
1262
1277
|
}
|
|
1263
|
-
const
|
|
1278
|
+
const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Tn = { class: "flex-1 line-clamp-2" }, Un = { class: "flex flex-col gap-32 w-full h-full" }, Pn = { class: "flex items-center relative gap-4" }, En = { class: "flex-1" }, Hn = {
|
|
1264
1279
|
key: 0,
|
|
1265
1280
|
class: "flex-1 flex flex-col items-center gap-16"
|
|
1266
|
-
},
|
|
1281
|
+
}, Rn = { class: "fm-typo-en-body-lg-400 translate-x-4" }, On = {
|
|
1267
1282
|
key: 1,
|
|
1268
1283
|
class: "flex flex-col gap-12"
|
|
1269
|
-
},
|
|
1284
|
+
}, Ln = { class: "pb-16" }, Nn = { class: "fm-typo-cn-body-lg-600" }, zn = {
|
|
1270
1285
|
class: "grid gap-12 fm-typo-en-body-md-400",
|
|
1271
1286
|
style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
|
|
1272
|
-
},
|
|
1287
|
+
}, Yn = { class: "flex flex-col gap-1" }, Kn = { class: "text-fm-color-typo-secondary" }, Gn = { class: "font-bold" }, Wn = { class: "flex flex-col gap-1" }, qn = { class: "text-fm-color-typo-secondary flex" }, Qn = { class: "font-bold" }, Xn = { class: "flex flex-col gap-1" }, Jn = { class: "text-fm-color-typo-secondary" }, Zn = { class: "font-bold" }, eo = { class: "flex flex-col gap-1" }, to = { class: "text-fm-color-typo-secondary" }, no = { class: "font-bold" }, oo = { class: "flex flex-col gap-1" }, so = { class: "text-fm-color-typo-secondary" }, ao = { class: "font-bold" }, ro = { class: "flex flex-col gap-1" }, lo = { class: "text-fm-color-typo-secondary" }, io = { class: "font-bold" }, uo = { class: "flex flex-col gap-1" }, co = { class: "text-fm-color-typo-secondary" }, mo = { class: "font-bold" }, po = { class: "flex flex-col gap-1" }, vo = { class: "text-fm-color-typo-secondary" }, fo = { class: "font-bold" }, yo = { class: "flex flex-col gap-1" }, _o = { class: "text-fm-color-typo-secondary" }, ko = { class: "font-bold" }, ho = {
|
|
1273
1288
|
key: 0,
|
|
1274
1289
|
class: "flex flex-col gap-8"
|
|
1275
|
-
},
|
|
1290
|
+
}, go = { class: "flex" }, bo = { class: "flex-1 flex flex-col gap-1" }, xo = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, So = { class: "font-bold" }, Fo = { class: "flex-1 flex flex-col gap-1" }, wo = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, $o = { class: "flex flex-col gap-1" }, Ao = { class: "font-bold" }, Co = {
|
|
1276
1291
|
key: 2,
|
|
1277
1292
|
class: "flex-1 flex flex-col items-center gap-8"
|
|
1278
|
-
},
|
|
1293
|
+
}, Vo = ["src"], Bo = { class: "font-bold text-lg" }, Mo = { class: "text-xs text-neutral-400 text-center" }, Do = /* @__PURE__ */ ie({
|
|
1279
1294
|
__name: "StockHistory",
|
|
1280
1295
|
props: {
|
|
1281
1296
|
sku: {},
|
|
@@ -1283,28 +1298,28 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1283
1298
|
},
|
|
1284
1299
|
emits: ["update:show"],
|
|
1285
1300
|
setup(f) {
|
|
1286
|
-
const y = Tt(),
|
|
1301
|
+
const y = Tt(), i = Pe(), o = Ee(), S = hn(), _ = pe(), u = St(), { t: m } = ue(), w = f, x = O(!1), r = ye(), t = O(gt(0));
|
|
1287
1302
|
async function F() {
|
|
1288
1303
|
x.value = !0;
|
|
1289
1304
|
try {
|
|
1290
|
-
await
|
|
1305
|
+
await B(), await i.readStockBalance();
|
|
1291
1306
|
} catch (e) {
|
|
1292
|
-
|
|
1307
|
+
r.open({
|
|
1293
1308
|
title: "Something went wrong",
|
|
1294
1309
|
message: "Cannot fetch stock history. Please try again.",
|
|
1295
1310
|
type: "error"
|
|
1296
|
-
}), console.log("failed at fetching item adjustment history", w.sku,
|
|
1311
|
+
}), console.log("failed at fetching item adjustment history", w.sku, t, e);
|
|
1297
1312
|
} finally {
|
|
1298
1313
|
x.value = !1;
|
|
1299
1314
|
}
|
|
1300
1315
|
}
|
|
1301
1316
|
qe(() => {
|
|
1302
1317
|
F();
|
|
1303
|
-
}), be([() =>
|
|
1318
|
+
}), be([() => t.value, () => w.sku], () => {
|
|
1304
1319
|
F();
|
|
1305
1320
|
});
|
|
1306
|
-
const C = O([]), k = O([]),
|
|
1307
|
-
function
|
|
1321
|
+
const C = O([]), k = O([]), a = O(new Array());
|
|
1322
|
+
function V(e, s) {
|
|
1308
1323
|
return s === "day" ? Ct(e) : Je(e);
|
|
1309
1324
|
}
|
|
1310
1325
|
function L(e, s) {
|
|
@@ -1313,7 +1328,7 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1313
1328
|
const b = d.effectiveAt ?? et(d._id);
|
|
1314
1329
|
if (!b)
|
|
1315
1330
|
return c;
|
|
1316
|
-
const I =
|
|
1331
|
+
const I = V(new Date(b), s);
|
|
1317
1332
|
return c[I] ?? (c[I] = []), c[I].push(d), c;
|
|
1318
1333
|
},
|
|
1319
1334
|
{}
|
|
@@ -1323,34 +1338,34 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1323
1338
|
adjustments: v[c]
|
|
1324
1339
|
}));
|
|
1325
1340
|
}
|
|
1326
|
-
async function
|
|
1341
|
+
async function B() {
|
|
1327
1342
|
let e = await o.readStockAdjustment(
|
|
1328
1343
|
w.sku._id,
|
|
1329
|
-
Ft(new Date(
|
|
1330
|
-
wt(new Date(
|
|
1344
|
+
Ft(new Date(t.value.startDate)).toISOString(),
|
|
1345
|
+
wt(new Date(t.value.endDate)).toISOString()
|
|
1331
1346
|
);
|
|
1332
1347
|
C.value = e;
|
|
1333
1348
|
const s = e.filter(({ ref: v }) => v == null ? void 0 : v.startsWith("bill_")).map(({ ref: v }) => v);
|
|
1334
|
-
await
|
|
1349
|
+
await A(s), k.value = L(e, "day").map(({ date: v, adjustments: c }) => ({
|
|
1335
1350
|
date: v,
|
|
1336
1351
|
adjustments: c,
|
|
1337
1352
|
adjustmentsByTime: L(c, "minute")
|
|
1338
1353
|
}));
|
|
1339
1354
|
}
|
|
1340
|
-
async function
|
|
1341
|
-
e.length && (
|
|
1355
|
+
async function A(e) {
|
|
1356
|
+
e.length && (a.value = await S.findBillsById(e).catch((s) => {
|
|
1342
1357
|
var d;
|
|
1343
1358
|
console.error("Error on using latest bill API, retrying using legacy api", s);
|
|
1344
1359
|
const v = ((d = y.currentBusiness.value) == null ? void 0 : d._id) ?? "", c = _.currentLocation.doc._id;
|
|
1345
1360
|
return S.findBillsByBusinessId(v, [c], e);
|
|
1346
1361
|
}));
|
|
1347
1362
|
}
|
|
1348
|
-
const
|
|
1363
|
+
const D = U(() => {
|
|
1349
1364
|
const e = C.value, s = w.sku;
|
|
1350
|
-
return
|
|
1365
|
+
return Dn(e, s);
|
|
1351
1366
|
}), P = U(() => {
|
|
1352
1367
|
const e = C.value, s = w.sku;
|
|
1353
|
-
return
|
|
1368
|
+
return jn(e, s);
|
|
1354
1369
|
}), E = U(() => {
|
|
1355
1370
|
const e = [...C.value].computeFirst((v) => {
|
|
1356
1371
|
var d, b;
|
|
@@ -1360,11 +1375,11 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1360
1375
|
amount: 0,
|
|
1361
1376
|
precision: 0
|
|
1362
1377
|
}, s = w.sku;
|
|
1363
|
-
return s ? `${
|
|
1378
|
+
return s ? `${Y.toFormatString({
|
|
1364
1379
|
value: e,
|
|
1365
1380
|
precision: 4
|
|
1366
1381
|
})} ${s.unit.abbrev}` : "";
|
|
1367
|
-
}),
|
|
1382
|
+
}), te = U(() => {
|
|
1368
1383
|
const e = [...C.value].reverse().computeFirst((v) => {
|
|
1369
1384
|
var d, b;
|
|
1370
1385
|
const c = (b = (d = v.skus) == null ? void 0 : d.find) == null ? void 0 : b.call(d, (I) => I.sku._id === w.sku._id);
|
|
@@ -1373,7 +1388,7 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1373
1388
|
amount: 0,
|
|
1374
1389
|
precision: 0
|
|
1375
1390
|
}, s = w.sku;
|
|
1376
|
-
return s ? `${
|
|
1391
|
+
return s ? `${Y.toFormatString({ value: e, precision: 4 })} ${s.unit.abbrev}` : "";
|
|
1377
1392
|
}), q = U(() => {
|
|
1378
1393
|
var v;
|
|
1379
1394
|
const s = C.value.flatMap((c) => {
|
|
@@ -1401,25 +1416,25 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1401
1416
|
return ke(s, !1, s.precision);
|
|
1402
1417
|
});
|
|
1403
1418
|
function N() {
|
|
1404
|
-
const { startDate: e, endDate: s } = $t(
|
|
1405
|
-
e !== null && s !== null && (
|
|
1419
|
+
const { startDate: e, endDate: s } = $t(t.value);
|
|
1420
|
+
e !== null && s !== null && (t.value = {
|
|
1406
1421
|
startDate: e,
|
|
1407
1422
|
endDate: s
|
|
1408
1423
|
});
|
|
1409
1424
|
}
|
|
1410
|
-
const
|
|
1425
|
+
const R = U(() => w.sku.valuation === ze.Enum.FIFO ? m("inventory.ingredient.valuationMethod.FIFO") : m("inventory.ingredient.valuationMethod.WAVG")), G = U(() => {
|
|
1411
1426
|
var I, Q, oe, T;
|
|
1412
1427
|
const e = [...C.value].reverse().computeFirst((z) => {
|
|
1413
|
-
var
|
|
1414
|
-
return (se = (
|
|
1428
|
+
var W, se;
|
|
1429
|
+
return (se = (W = z.skus) == null ? void 0 : W.find) == null ? void 0 : se.call(W, (re) => re.sku._id === w.sku._id);
|
|
1415
1430
|
});
|
|
1416
1431
|
if (!e) return "No data";
|
|
1417
1432
|
const s = [...e.amounts].reverse()[0], v = {
|
|
1418
1433
|
amount: ((I = s.cost) == null ? void 0 : I.amount) ?? 0,
|
|
1419
1434
|
precision: ((Q = s.cost) == null ? void 0 : Q.precision) ?? 0
|
|
1420
|
-
}, c = s.amount, d = c.amount == 0 ?
|
|
1435
|
+
}, c = s.amount, d = c.amount == 0 ? Y.fromNumber(0) : Y.divide([v, c]);
|
|
1421
1436
|
return {
|
|
1422
|
-
...
|
|
1437
|
+
...Y.multiply([d, c]),
|
|
1423
1438
|
currency: ((oe = s.cost) == null ? void 0 : oe.currency) || Ae(((T = y.currentCountry) == null ? void 0 : T.value) ?? xt)
|
|
1424
1439
|
};
|
|
1425
1440
|
}), ae = U(() => {
|
|
@@ -1430,7 +1445,7 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1430
1445
|
return d == null ? void 0 : d.toCostBalances;
|
|
1431
1446
|
});
|
|
1432
1447
|
return e ? {
|
|
1433
|
-
...e.reduce((c, d) =>
|
|
1448
|
+
...e.reduce((c, d) => Y.add([c, Y.fromDinero(d.cost)]), {
|
|
1434
1449
|
amount: 0,
|
|
1435
1450
|
precision: 0
|
|
1436
1451
|
}),
|
|
@@ -1438,25 +1453,25 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1438
1453
|
} : "No data";
|
|
1439
1454
|
});
|
|
1440
1455
|
function me() {
|
|
1441
|
-
const { startDate: e, endDate: s } = At(
|
|
1442
|
-
e !== null && s !== null && (
|
|
1456
|
+
const { startDate: e, endDate: s } = At(t.value);
|
|
1457
|
+
e !== null && s !== null && (t.value = {
|
|
1443
1458
|
startDate: e,
|
|
1444
1459
|
endDate: s
|
|
1445
1460
|
});
|
|
1446
1461
|
}
|
|
1447
1462
|
const p = He(w, "show");
|
|
1448
1463
|
return (e, s) => {
|
|
1449
|
-
const v = M("FmButton"), c = M("FmField"), d = M("FmDateRangePicker"), b = M("FmSpacer"), I = M("FmCircularProgress"), Q = M("FmIcon"), oe = M("FmTooltip"), T = M("FmMenuDivider"), z = M("FmChip"),
|
|
1450
|
-
return
|
|
1464
|
+
const v = M("FmButton"), c = M("FmField"), d = M("FmDateRangePicker"), b = M("FmSpacer"), I = M("FmCircularProgress"), Q = M("FmIcon"), oe = M("FmTooltip"), T = M("FmMenuDivider"), z = M("FmChip"), W = M("FmCardSection"), se = M("FmCard"), re = M("FmSideSheet");
|
|
1465
|
+
return $(), K(re, {
|
|
1451
1466
|
"dismiss-away": "",
|
|
1452
|
-
modelValue:
|
|
1467
|
+
modelValue: l(p),
|
|
1453
1468
|
"onUpdate:modelValue": s[4] || (s[4] = (X) => Ie(p) ? p.value = X : null),
|
|
1454
1469
|
"close-button": !1,
|
|
1455
1470
|
"max-width": 560
|
|
1456
1471
|
}, {
|
|
1457
|
-
"side-sheet-header":
|
|
1458
|
-
|
|
1459
|
-
|
|
1472
|
+
"side-sheet-header": j(() => [
|
|
1473
|
+
n("div", In, [
|
|
1474
|
+
n("div", Tn, h(l(m)("inventory.stock.history.title", [e.sku.name])), 1),
|
|
1460
1475
|
g(v, {
|
|
1461
1476
|
variant: "tertiary",
|
|
1462
1477
|
"prepend-icon": "close",
|
|
@@ -1464,27 +1479,27 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1464
1479
|
})
|
|
1465
1480
|
])
|
|
1466
1481
|
]),
|
|
1467
|
-
default:
|
|
1482
|
+
default: j(() => {
|
|
1468
1483
|
var X;
|
|
1469
1484
|
return [
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1485
|
+
n("div", Un, [
|
|
1486
|
+
n("div", Pn, [
|
|
1487
|
+
n("div", En, [
|
|
1473
1488
|
g(d, {
|
|
1474
|
-
modelValue:
|
|
1475
|
-
"onUpdate:modelValue": s[1] || (s[1] = (
|
|
1489
|
+
modelValue: t.value,
|
|
1490
|
+
"onUpdate:modelValue": s[1] || (s[1] = (ne) => t.value = ne),
|
|
1476
1491
|
"show-predefined-range": "",
|
|
1477
1492
|
"start-label": "",
|
|
1478
1493
|
"end-label": "",
|
|
1479
1494
|
"z-index": 50
|
|
1480
1495
|
}, {
|
|
1481
|
-
"trigger-button":
|
|
1496
|
+
"trigger-button": j(({ opened: ne }) => [
|
|
1482
1497
|
g(c, {
|
|
1483
1498
|
"prepend-icon": "calendar_month",
|
|
1484
|
-
focused:
|
|
1499
|
+
focused: ne
|
|
1485
1500
|
}, {
|
|
1486
|
-
default:
|
|
1487
|
-
ce(h(
|
|
1501
|
+
default: j(() => [
|
|
1502
|
+
ce(h(t.value.startDate) + " - " + h(t.value.endDate), 1)
|
|
1488
1503
|
]),
|
|
1489
1504
|
_: 2
|
|
1490
1505
|
}, 1032, ["focused"])
|
|
@@ -1494,99 +1509,99 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1494
1509
|
]),
|
|
1495
1510
|
g(v, {
|
|
1496
1511
|
variant: "tertiary",
|
|
1497
|
-
onClick: s[2] || (s[2] = (
|
|
1512
|
+
onClick: s[2] || (s[2] = (ne) => N()),
|
|
1498
1513
|
"prepend-icon": "navigate_before"
|
|
1499
1514
|
}),
|
|
1500
1515
|
g(v, {
|
|
1501
1516
|
variant: "tertiary",
|
|
1502
|
-
onClick: s[3] || (s[3] = (
|
|
1517
|
+
onClick: s[3] || (s[3] = (ne) => me()),
|
|
1503
1518
|
"prepend-icon": "navigate_next"
|
|
1504
1519
|
})
|
|
1505
1520
|
]),
|
|
1506
|
-
x.value ? (
|
|
1521
|
+
x.value ? ($(), H("div", Hn, [
|
|
1507
1522
|
g(b),
|
|
1508
1523
|
g(I, { size: "xl" }),
|
|
1509
|
-
|
|
1524
|
+
n("div", Rn, h(l(m)("inventory.stock.history.loading")), 1),
|
|
1510
1525
|
g(b),
|
|
1511
1526
|
g(b)
|
|
1512
|
-
])) : k.value && ((X = k.value) == null ? void 0 : X.length) > 0 ? (
|
|
1527
|
+
])) : k.value && ((X = k.value) == null ? void 0 : X.length) > 0 ? ($(), H("div", On, [
|
|
1513
1528
|
g(se, { variant: "outlined" }, {
|
|
1514
|
-
default:
|
|
1515
|
-
g(
|
|
1516
|
-
default:
|
|
1517
|
-
|
|
1518
|
-
|
|
1529
|
+
default: j(() => [
|
|
1530
|
+
g(W, { class: "flex flex-col gap-4" }, {
|
|
1531
|
+
default: j(() => [
|
|
1532
|
+
n("div", Ln, [
|
|
1533
|
+
n("div", Nn, h(l(m)("inventory.stock.history.summary.title")), 1)
|
|
1519
1534
|
]),
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1535
|
+
n("div", zn, [
|
|
1536
|
+
n("div", Yn, [
|
|
1537
|
+
n("div", Kn, h(l(m)("inventory.stock.history.summary.totalPurchase")), 1),
|
|
1538
|
+
n("div", Gn, h(D.value.PURCHASE), 1)
|
|
1524
1539
|
]),
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
ce(h(
|
|
1528
|
-
P.value != null ? (
|
|
1540
|
+
n("div", Wn, [
|
|
1541
|
+
n("div", qn, [
|
|
1542
|
+
ce(h(l(m)("inventory.stock.history.summary.totalSales")) + " ", 1),
|
|
1543
|
+
P.value != null ? ($(), K(oe, {
|
|
1529
1544
|
key: 0,
|
|
1530
1545
|
variant: "plain",
|
|
1531
1546
|
placement: "top",
|
|
1532
1547
|
content: `Before: ${P.value}`,
|
|
1533
1548
|
"z-index": 50
|
|
1534
1549
|
}, {
|
|
1535
|
-
default:
|
|
1550
|
+
default: j(() => [
|
|
1536
1551
|
g(Q, {
|
|
1537
1552
|
name: "warning",
|
|
1538
1553
|
size: "sm"
|
|
1539
1554
|
})
|
|
1540
1555
|
]),
|
|
1541
1556
|
_: 1
|
|
1542
|
-
}, 8, ["content"])) :
|
|
1557
|
+
}, 8, ["content"])) : J("", !0)
|
|
1543
1558
|
]),
|
|
1544
|
-
|
|
1559
|
+
n("div", Qn, h(D.value.SALES), 1)
|
|
1545
1560
|
]),
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1561
|
+
n("div", Xn, [
|
|
1562
|
+
n("div", Jn, h(l(m)("inventory.stock.history.summary.totalLose")), 1),
|
|
1563
|
+
n("div", Zn, h(D.value.LOSE), 1)
|
|
1549
1564
|
]),
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1565
|
+
n("div", eo, [
|
|
1566
|
+
n("div", to, h(l(m)("inventory.stock.history.summary.totalRequest")), 1),
|
|
1567
|
+
n("div", no, h(D.value.REQUEST), 1)
|
|
1553
1568
|
]),
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1569
|
+
n("div", oo, [
|
|
1570
|
+
n("div", so, h(l(m)("inventory.stock.history.summary.totalReceive")), 1),
|
|
1571
|
+
n("div", ao, h(D.value.RECEIVE), 1)
|
|
1557
1572
|
]),
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1573
|
+
n("div", ro, [
|
|
1574
|
+
n("div", lo, h(l(m)("inventory.stock.history.summary.totalConvert")), 1),
|
|
1575
|
+
n("div", io, h(D.value.CONVERT), 1)
|
|
1561
1576
|
]),
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1577
|
+
n("div", uo, [
|
|
1578
|
+
n("div", co, h(l(m)("inventory.stock.history.summary.totalDamage")), 1),
|
|
1579
|
+
n("div", mo, h(D.value.DAMAGE), 1)
|
|
1565
1580
|
]),
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1581
|
+
n("div", po, [
|
|
1582
|
+
n("div", vo, h(l(m)("inventory.stock.history.summary.openingBalance")), 1),
|
|
1583
|
+
n("div", fo, h(E.value), 1)
|
|
1569
1584
|
]),
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1585
|
+
n("div", yo, [
|
|
1586
|
+
n("div", _o, h(l(m)("inventory.stock.history.summary.lastStockBalance")), 1),
|
|
1587
|
+
n("div", ko, h(te.value), 1)
|
|
1573
1588
|
])
|
|
1574
1589
|
]),
|
|
1575
|
-
|
|
1590
|
+
l(u).enableTotalCost ? ($(), H("div", ho, [
|
|
1576
1591
|
g(T, { class: "w-full" }),
|
|
1577
|
-
|
|
1578
|
-
|
|
1592
|
+
n("div", go, [
|
|
1593
|
+
n("div", bo, [
|
|
1579
1594
|
g(Ke, { "z-index": 50 }, {
|
|
1580
|
-
default:
|
|
1581
|
-
|
|
1582
|
-
ce(h(
|
|
1595
|
+
default: j(() => [
|
|
1596
|
+
n("div", xo, [
|
|
1597
|
+
ce(h(l(m)("inventory.stock.history.estimatedValue")) + " ", 1),
|
|
1583
1598
|
g(oe, {
|
|
1584
1599
|
variant: "plain",
|
|
1585
1600
|
placement: "top",
|
|
1586
|
-
content: `[${
|
|
1601
|
+
content: `[${R.value}] ${l(m)("inventory.stock.history.estimatedValueTooltip")}`,
|
|
1587
1602
|
"z-index": 50
|
|
1588
1603
|
}, {
|
|
1589
|
-
default:
|
|
1604
|
+
default: j(() => [
|
|
1590
1605
|
g(Q, {
|
|
1591
1606
|
name: "help",
|
|
1592
1607
|
size: "sm"
|
|
@@ -1598,40 +1613,40 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1598
1613
|
]),
|
|
1599
1614
|
_: 1
|
|
1600
1615
|
}),
|
|
1601
|
-
|
|
1602
|
-
e.sku.valuation ===
|
|
1616
|
+
n("div", So, [
|
|
1617
|
+
e.sku.valuation === l(ze).Enum.FIFO ? ($(), H(ee, { key: 0 }, [
|
|
1603
1618
|
g(z, {
|
|
1604
1619
|
label: "FIFO",
|
|
1605
1620
|
compact: ""
|
|
1606
1621
|
}),
|
|
1607
|
-
ce(" " + h(typeof ae.value != "string" ?
|
|
1622
|
+
ce(" " + h(typeof ae.value != "string" ? l(ke)(
|
|
1608
1623
|
ae.value,
|
|
1609
1624
|
!1,
|
|
1610
1625
|
ae.value.precision
|
|
1611
1626
|
) : ae.value), 1)
|
|
1612
|
-
], 64)) : (
|
|
1613
|
-
ce(h(typeof
|
|
1614
|
-
|
|
1627
|
+
], 64)) : ($(), H(ee, { key: 1 }, [
|
|
1628
|
+
ce(h(typeof G.value != "string" ? l(ke)(
|
|
1629
|
+
G.value,
|
|
1615
1630
|
!1,
|
|
1616
|
-
|
|
1617
|
-
) :
|
|
1631
|
+
G.value.precision
|
|
1632
|
+
) : G.value), 1)
|
|
1618
1633
|
], 64))
|
|
1619
1634
|
])
|
|
1620
1635
|
]),
|
|
1621
|
-
|
|
1636
|
+
n("div", Fo, [
|
|
1622
1637
|
g(Ke, { "z-index": 50 }, {
|
|
1623
|
-
default:
|
|
1624
|
-
|
|
1625
|
-
ce(h(
|
|
1638
|
+
default: j(() => [
|
|
1639
|
+
n("div", wo, [
|
|
1640
|
+
ce(h(l(m)("inventory.stock.history.costSold")) + " ", 1),
|
|
1626
1641
|
g(oe, {
|
|
1627
1642
|
variant: "plain",
|
|
1628
1643
|
placement: "top",
|
|
1629
1644
|
"z-index": 50
|
|
1630
1645
|
}, {
|
|
1631
|
-
content:
|
|
1632
|
-
|
|
1646
|
+
content: j(() => [
|
|
1647
|
+
n("div", $o, h(l(m)("inventory.stock.history.costSoldTooltip")), 1)
|
|
1633
1648
|
]),
|
|
1634
|
-
default:
|
|
1649
|
+
default: j(() => [
|
|
1635
1650
|
g(Q, {
|
|
1636
1651
|
name: "help",
|
|
1637
1652
|
size: "sm"
|
|
@@ -1643,37 +1658,37 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1643
1658
|
]),
|
|
1644
1659
|
_: 1
|
|
1645
1660
|
}),
|
|
1646
|
-
|
|
1661
|
+
n("div", Ao, h(q.value), 1)
|
|
1647
1662
|
])
|
|
1648
1663
|
])
|
|
1649
|
-
])) :
|
|
1664
|
+
])) : J("", !0)
|
|
1650
1665
|
]),
|
|
1651
1666
|
_: 1
|
|
1652
1667
|
})
|
|
1653
1668
|
]),
|
|
1654
1669
|
_: 1
|
|
1655
1670
|
}),
|
|
1656
|
-
s[5] || (s[5] =
|
|
1657
|
-
(
|
|
1658
|
-
key:
|
|
1671
|
+
s[5] || (s[5] = n("div", null, null, -1)),
|
|
1672
|
+
($(!0), H(ee, null, le(k.value, (ne) => ($(), H(ee, {
|
|
1673
|
+
key: ne.date
|
|
1659
1674
|
}, [
|
|
1660
|
-
e.sku ? (
|
|
1675
|
+
e.sku ? ($(), K(Mn, {
|
|
1661
1676
|
key: 0,
|
|
1662
|
-
record:
|
|
1677
|
+
record: ne,
|
|
1663
1678
|
sku: e.sku,
|
|
1664
|
-
bills:
|
|
1665
|
-
}, null, 8, ["record", "sku", "bills"])) :
|
|
1679
|
+
bills: a.value
|
|
1680
|
+
}, null, 8, ["record", "sku", "bills"])) : J("", !0)
|
|
1666
1681
|
], 64))), 128))
|
|
1667
|
-
])) : (
|
|
1682
|
+
])) : ($(), H("div", Co, [
|
|
1668
1683
|
g(b),
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
src:
|
|
1684
|
+
n("div", null, [
|
|
1685
|
+
n("img", {
|
|
1686
|
+
src: l(Rt),
|
|
1672
1687
|
alt: "List is empty"
|
|
1673
|
-
}, null, 8,
|
|
1688
|
+
}, null, 8, Vo)
|
|
1674
1689
|
]),
|
|
1675
|
-
|
|
1676
|
-
|
|
1690
|
+
n("div", Bo, h(l(m)("inventory.stock.history.noRecords")), 1),
|
|
1691
|
+
n("div", Mo, h(l(m)("inventory.stock.history.changeDateRange")), 1),
|
|
1677
1692
|
g(b),
|
|
1678
1693
|
g(b)
|
|
1679
1694
|
]))
|
|
@@ -1684,48 +1699,48 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1684
1699
|
}, 8, ["modelValue"]);
|
|
1685
1700
|
};
|
|
1686
1701
|
}
|
|
1687
|
-
}),
|
|
1702
|
+
}), jo = { class: "flex flex-col gap-8" }, Io = { class: "flex flex-col" }, To = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Uo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, Xo = /* @__PURE__ */ ie({
|
|
1688
1703
|
__name: "StockView",
|
|
1689
1704
|
setup(f) {
|
|
1690
|
-
const { t: y } = ue(),
|
|
1691
|
-
o.watchLocation(
|
|
1705
|
+
const { t: y } = ue(), i = Ue(), o = pe(), S = Pe(), _ = st(), u = Ze(), { columnDefs: m } = Gt();
|
|
1706
|
+
o.watchLocation(r);
|
|
1692
1707
|
const w = O(!1), x = ye();
|
|
1693
|
-
async function
|
|
1708
|
+
async function r() {
|
|
1694
1709
|
if (o._currentLocation) {
|
|
1695
1710
|
w.value = !0;
|
|
1696
1711
|
try {
|
|
1697
|
-
await S.readStockBalance(), await S.readProductBalance(), await
|
|
1698
|
-
} catch (
|
|
1712
|
+
await S.readStockBalance(), await S.readProductBalance(), await u.readStockEstimateBalance();
|
|
1713
|
+
} catch (A) {
|
|
1699
1714
|
x.open({
|
|
1700
1715
|
title: y("inventory.stock.error.title"),
|
|
1701
1716
|
message: y("inventory.stock.error.message"),
|
|
1702
1717
|
type: "error"
|
|
1703
|
-
}), console.error("error on fetch stock balance",
|
|
1718
|
+
}), console.error("error on fetch stock balance", A);
|
|
1704
1719
|
} finally {
|
|
1705
1720
|
w.value = !1;
|
|
1706
1721
|
}
|
|
1707
1722
|
}
|
|
1708
1723
|
}
|
|
1709
|
-
const
|
|
1710
|
-
() =>
|
|
1711
|
-
var q, N,
|
|
1712
|
-
const
|
|
1724
|
+
const t = U(
|
|
1725
|
+
() => i.skus.map((A) => {
|
|
1726
|
+
var q, N, R;
|
|
1727
|
+
const D = A.trackingMeasurement;
|
|
1713
1728
|
let P = (N = (q = S.stockBalance.skus) == null ? void 0 : q.find(
|
|
1714
|
-
(
|
|
1715
|
-
)) == null ? void 0 : N.balance, E =
|
|
1716
|
-
(
|
|
1729
|
+
(G) => G.id === A._id
|
|
1730
|
+
)) == null ? void 0 : N.balance, E = u.inventoryForecast.skus.find(
|
|
1731
|
+
(G) => G.id === A._id
|
|
1717
1732
|
);
|
|
1718
1733
|
return {
|
|
1719
|
-
|
|
1734
|
+
...A,
|
|
1720
1735
|
balance: P ?? {
|
|
1721
1736
|
amount: 0,
|
|
1722
1737
|
precision: 0
|
|
1723
1738
|
},
|
|
1724
1739
|
day: (E == null ? void 0 : E.depletionDays) ?? void 0,
|
|
1725
|
-
trackingUnitAbbrev:
|
|
1740
|
+
trackingUnitAbbrev: D ? ((R = A.unit.measurements.find((G) => G.id === D)) == null ? void 0 : R.abbrev) ?? "" : A.unit.abbrev
|
|
1726
1741
|
};
|
|
1727
1742
|
})
|
|
1728
|
-
), F = O(""), { breakpoints: C } = Ut(), k = U(() => C.value.xs || C.value.sm),
|
|
1743
|
+
), F = O(""), { breakpoints: C } = Ut(), k = U(() => C.value.xs || C.value.sm), a = U(() => k.value ? 10 : 20), V = Vt(), L = U(() => [
|
|
1729
1744
|
{
|
|
1730
1745
|
label: y("inventory.common.refresh"),
|
|
1731
1746
|
value: "refresh"
|
|
@@ -1735,25 +1750,25 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1735
1750
|
value: "export"
|
|
1736
1751
|
}
|
|
1737
1752
|
]);
|
|
1738
|
-
function
|
|
1739
|
-
switch (
|
|
1753
|
+
function B(A) {
|
|
1754
|
+
switch (A) {
|
|
1740
1755
|
case "refresh":
|
|
1741
|
-
return
|
|
1756
|
+
return r();
|
|
1742
1757
|
case "export":
|
|
1743
|
-
return Nt(
|
|
1758
|
+
return Nt(t.value);
|
|
1744
1759
|
}
|
|
1745
1760
|
}
|
|
1746
|
-
return (
|
|
1761
|
+
return (A, D) => {
|
|
1747
1762
|
const P = M("FmTable");
|
|
1748
|
-
return
|
|
1749
|
-
title:
|
|
1763
|
+
return $(), K(Bt, {
|
|
1764
|
+
title: l(y)("inventory.stock.title"),
|
|
1750
1765
|
actions: L.value,
|
|
1751
|
-
"onClick:action":
|
|
1766
|
+
"onClick:action": B
|
|
1752
1767
|
}, {
|
|
1753
|
-
default:
|
|
1754
|
-
var E,
|
|
1768
|
+
default: j(() => {
|
|
1769
|
+
var E, te, q, N;
|
|
1755
1770
|
return [
|
|
1756
|
-
|
|
1771
|
+
n("div", {
|
|
1757
1772
|
class: ge([
|
|
1758
1773
|
"flex flex-col gap-8 max-h-full",
|
|
1759
1774
|
{
|
|
@@ -1762,57 +1777,57 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1762
1777
|
}
|
|
1763
1778
|
])
|
|
1764
1779
|
}, [
|
|
1765
|
-
g(
|
|
1780
|
+
g(Mt, {
|
|
1766
1781
|
searchable: "",
|
|
1767
1782
|
"change-location": "",
|
|
1768
1783
|
search: F.value,
|
|
1769
|
-
"onUpdate:search":
|
|
1784
|
+
"onUpdate:search": D[0] || (D[0] = (R) => F.value = R)
|
|
1770
1785
|
}, null, 8, ["search"]),
|
|
1771
|
-
(
|
|
1772
|
-
style: Qe(
|
|
1773
|
-
"column-defs":
|
|
1774
|
-
"row-data":
|
|
1786
|
+
($(), K(P, {
|
|
1787
|
+
style: Qe(l(V).tableHeight),
|
|
1788
|
+
"column-defs": l(m),
|
|
1789
|
+
"row-data": t.value,
|
|
1775
1790
|
"search-value": F.value,
|
|
1776
|
-
loading: w.value || !
|
|
1777
|
-
key: (E =
|
|
1778
|
-
onRowClick:
|
|
1779
|
-
"page-size":
|
|
1791
|
+
loading: w.value || !l(o)._currentLocation,
|
|
1792
|
+
key: (E = l(o)._currentLocation) == null ? void 0 : E.dbName,
|
|
1793
|
+
onRowClick: D[1] || (D[1] = (R) => l(_).showSkuHistory(R.original)),
|
|
1794
|
+
"page-size": a.value
|
|
1780
1795
|
}, {
|
|
1781
|
-
"list-row":
|
|
1796
|
+
"list-row": j((R) => [
|
|
1782
1797
|
g(Dt, {
|
|
1783
|
-
row:
|
|
1784
|
-
onRowClick:
|
|
1798
|
+
row: R,
|
|
1799
|
+
onRowClick: l(_).showSkuHistory
|
|
1785
1800
|
}, {
|
|
1786
|
-
default:
|
|
1801
|
+
default: j((G) => {
|
|
1787
1802
|
var ae, me, p, e, s, v, c, d, b, I;
|
|
1788
1803
|
return [
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
g(
|
|
1793
|
-
render: (p = (me = (ae =
|
|
1794
|
-
props: (s = (e =
|
|
1804
|
+
n("div", jo, [
|
|
1805
|
+
n("div", Io, [
|
|
1806
|
+
n("div", To, [
|
|
1807
|
+
g(l(Ye), {
|
|
1808
|
+
render: (p = (me = (ae = G.code) == null ? void 0 : ae.column) == null ? void 0 : me.columnDef) == null ? void 0 : p.cell,
|
|
1809
|
+
props: (s = (e = G.code) == null ? void 0 : e.getContext) == null ? void 0 : s.call(e)
|
|
1795
1810
|
}, null, 8, ["render", "props"])
|
|
1796
1811
|
]),
|
|
1797
|
-
|
|
1798
|
-
g(
|
|
1799
|
-
render: (d = (c = (v =
|
|
1800
|
-
props: (I = (b =
|
|
1812
|
+
n("div", Uo, [
|
|
1813
|
+
g(l(Ye), {
|
|
1814
|
+
render: (d = (c = (v = G.name) == null ? void 0 : v.column) == null ? void 0 : c.columnDef) == null ? void 0 : d.cell,
|
|
1815
|
+
props: (I = (b = G.name) == null ? void 0 : b.getContext) == null ? void 0 : I.call(b)
|
|
1801
1816
|
}, null, 8, ["render", "props"])
|
|
1802
1817
|
])
|
|
1803
1818
|
]),
|
|
1804
|
-
|
|
1819
|
+
n("div", null, [
|
|
1805
1820
|
g(je, {
|
|
1806
|
-
days:
|
|
1821
|
+
days: R.original.day
|
|
1807
1822
|
}, null, 8, ["days"])
|
|
1808
1823
|
]),
|
|
1809
|
-
|
|
1824
|
+
n("div", null, [
|
|
1810
1825
|
g(ot, {
|
|
1811
1826
|
class: "xs:w-[160px]",
|
|
1812
|
-
unit:
|
|
1813
|
-
sku:
|
|
1814
|
-
amount:
|
|
1815
|
-
"default-tracking-measurement":
|
|
1827
|
+
unit: R.original.unit,
|
|
1828
|
+
sku: R.original,
|
|
1829
|
+
amount: R.original.balance,
|
|
1830
|
+
"default-tracking-measurement": R.original.trackingMeasurement ?? void 0
|
|
1816
1831
|
}, null, 8, ["unit", "sku", "amount", "default-tracking-measurement"])
|
|
1817
1832
|
])
|
|
1818
1833
|
])
|
|
@@ -1824,10 +1839,10 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1824
1839
|
_: 1
|
|
1825
1840
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
1826
1841
|
], 2),
|
|
1827
|
-
(
|
|
1828
|
-
(
|
|
1829
|
-
(q =
|
|
1830
|
-
(N =
|
|
1842
|
+
($(), K(rt, { to: "body" }, [
|
|
1843
|
+
(te = l(_).stockHistoryProps) != null && te.sku ? ($(), K(Do, we($e({ key: 0 }, l(_).stockHistoryProps)), null, 16)) : J("", !0),
|
|
1844
|
+
(q = l(_).convertSkuDialogProps) != null && q.sku ? ($(), K(un, we($e({ key: 1 }, l(_).convertSkuDialogProps)), null, 16)) : J("", !0),
|
|
1845
|
+
(N = l(_).adjustSkuDialogProps) != null && N.stock ? ($(), K(kn, we($e({ key: 2 }, l(_).adjustSkuDialogProps)), null, 16)) : J("", !0)
|
|
1831
1846
|
]))
|
|
1832
1847
|
];
|
|
1833
1848
|
}),
|
|
@@ -1837,5 +1852,5 @@ const jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, In = {
|
|
|
1837
1852
|
}
|
|
1838
1853
|
});
|
|
1839
1854
|
export {
|
|
1840
|
-
|
|
1855
|
+
Xo as default
|
|
1841
1856
|
};
|