@feedmepos/mf-inventory-portal 1.2.0-dev.3 → 1.2.0
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-CvnYXQ_H.js → App-Bs0pR0sL.js} +1 -1
- package/dist/{ApprovalView-Brt_cfLI.js → ApprovalView-Dr-qd_Ai.js} +2 -2
- package/dist/{BindingsDialog-BBCRbm60.js → BindingsDialog-Chh00-83.js} +2 -2
- package/dist/{BindingsPicker-D3cfis0-.js → BindingsPicker-DCTGJ8eM.js} +1 -1
- package/dist/{BindingsTable-BuHEtiqI.js → BindingsTable-BsDs5d0V.js} +1 -1
- package/dist/{ClosingDraftView-fLxuV9T9.js → ClosingDraftView-Dyr4hrHk.js} +2 -2
- package/dist/{ClosingTemplateView-BJRZQ_9d.js → ClosingTemplateView-Dw0Lld6E.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-CKLGVFoJ.js → DeliveryOrderPrintPreview-CrH9UVdW.js} +1 -1
- package/dist/FmAdminBadge-BUJh40aj.js +34 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-6h2ZF1IM.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B-p9ffPK.js} +3 -3
- package/dist/{FmMultiselectDialog-uEoXq-hv.js → FmMultiselectDialog-ypgaHejh.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CSNDv3kk.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DJctVhvZ.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CeZBz1eT.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-D59M4Bl1.js} +1 -1
- package/dist/{IngredientGroupView-BhsEp63p.js → IngredientGroupView-Cf9ePE7_.js} +2 -2
- package/dist/{IngredientsView-D3aehOrb.js → IngredientsView-61WfWyGy.js} +4 -4
- package/dist/{IntegrationView-Ds4_pk0y.js → IntegrationView-DEDn2mc5.js} +3 -3
- package/dist/{InventoryBindingForm-CVaSaP-L.js → InventoryBindingForm-AB8rum4-.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DsJObBbP.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BgZt_9h1.js} +3 -3
- package/dist/{InventoryBindingSummary-4dCMV0Je.js → InventoryBindingSummary-CWOG5DIz.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BWTfN1Nc.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CmN30iEZ.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-lKPfAldc.js → PremiumBadge.vue_vue_type_script_setup_true_lang-C1cUDp0u.js} +1 -1
- package/dist/{PublishView-BW1IjgqP.js → PublishView-FHyjjevA.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-DupzzHHn.js → PurchaseOrderPrintPreview-BPvvkjkR.js} +1 -1
- package/dist/{ReceiveRequestView-CZMDH6oI.js → ReceiveRequestView-CoWU2g0R.js} +8 -8
- package/dist/{RecipeView-BJ1JyMWl.js → RecipeView-CznjQMrS.js} +3 -3
- package/dist/{StockView-C0h2udKi.js → StockView-N-84Q5Ih.js} +327 -321
- package/dist/{SupplierView-nRrJO3aS.js → SupplierView-CJG2Idbl.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CWXS6_zv.js → TransferDetails.vue_vue_type_script_setup_true_lang-BmU-VLNN.js} +778 -752
- package/dist/{TransferTemplateView-BmGAvcDy.js → TransferTemplateView-DZnPt5b5.js} +6 -6
- package/dist/{UnitView-CFayjoeC.js → UnitView-BrLjAWNq.js} +3 -3
- package/dist/{WarehouseView-Dw74JEJ4.js → WarehouseView-CI-RuaPq.js} +1 -1
- package/dist/{app-Cjc33Hak.js → app-B6mXF-3v.js} +4119 -4119
- package/dist/app.js +1 -1
- package/dist/components/FmAdminBadge.vue.d.ts +39 -0
- package/dist/{decimal-DkctM_2I.js → decimal-DErYDfEJ.js} +1 -1
- package/dist/{format-unit-display-BWs5lTJP.js → format-unit-display-BtjJtmQp.js} +2 -2
- package/dist/{index-C64jubVC.js → index-CvfUsVdt.js} +1 -1
- package/dist/{index-IbY1gBGq.js → index-lj4ClRIU.js} +1 -1
- package/dist/{stock-BhsZeZQ6.js → stock-CIpuon0m.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-D-CggzHd.js → supplier-D_2yzArc.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-C03zsmuo.js → use-ingredient-select-dialog-C9iEMCVA.js} +1 -1
- package/dist/{use-inventory-binding-dialog-D3Chc97P.js → use-inventory-binding-dialog-CavX3SFd.js} +1 -1
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +6 -2
- package/package.json +3 -3
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { defineComponent as ce, ref as N, computed as R, resolveComponent as D, openBlock as F, createBlock as L, withCtx as I, createElementVNode as e, normalizeClass as ge, toDisplayString as _, createVNode as
|
|
2
|
-
import { u as pe, W as dt, f as He, h as mt, a as Pe, F as Ge, X as pt, Y as Ie, j as me, P as
|
|
3
|
-
import { u as Re, a as ye } from "./stock-
|
|
4
|
-
import { g as we } from "./decimal-
|
|
5
|
-
import { e as Pt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { defineComponent as ce, ref as N, computed as R, resolveComponent as D, openBlock as F, createBlock as L, withCtx as I, createElementVNode as e, normalizeClass as ge, toDisplayString as _, createVNode as g, createElementBlock as O, Fragment as ne, renderList as le, unref as r, h as he, watch as xe, isRef as Ue, createCommentVNode as se, reactive as it, mergeModels as Ye, useModel as ut, onMounted as Ee, createTextVNode as ue, normalizeStyle as Ze, Teleport as ct, normalizeProps as Ae, mergeProps as Ve } from "vue";
|
|
2
|
+
import { u as pe, W as dt, f as He, h as mt, a as Pe, F as Ge, X as pt, Y as Ie, j as me, P as ft, t as Se, V as Fe, A as vt, M as yt, T as ve, Z as _t, $ as oe, a0 as ht, a1 as We, m as kt, a2 as bt, a3 as gt, a4 as xt, a5 as St, a6 as Ce, a7 as Ft, a8 as et, Q as X, a9 as wt, s as tt, aa as ke, ab as $t, ac as At, o as Me, l as Ke, p as Vt, c as Ct, ad as Mt, ae as Bt, af as Dt, ag as jt, ah as It, B as Tt, _ as Ut, C as Et, E as Ht, G as qe } from "./app-B6mXF-3v.js";
|
|
3
|
+
import { u as Re, a as ye } from "./stock-CIpuon0m.js";
|
|
4
|
+
import { g as we } from "./decimal-DErYDfEJ.js";
|
|
5
|
+
import { e as Pt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-C1cUDp0u.js";
|
|
6
6
|
import { _ as Te, S as Be, g as st } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
|
|
7
7
|
import { _ as Rt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
8
8
|
import { useI18n as de, useCoreStore as at } from "@feedmepos/mf-common";
|
|
9
9
|
import { useSnackbar as _e, useDialog as Oe, useProxiedModel as Ne, useBreakpoints as Ot } from "@feedmepos/ui-library";
|
|
10
10
|
import { defineStore as Nt } from "pinia";
|
|
11
|
-
import { u as Lt } from "./use-inventory-binding-dialog-
|
|
12
|
-
import { _ as zt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-
|
|
11
|
+
import { u as Lt } from "./use-inventory-binding-dialog-CavX3SFd.js";
|
|
12
|
+
import { _ as zt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CmN30iEZ.js";
|
|
13
13
|
import { E as Yt } from "./empty-placeholder-wf6-BWE8.js";
|
|
14
|
+
import { F as Gt } from "./FmAdminBadge-BUJh40aj.js";
|
|
14
15
|
import "./array-Ca8T3f_G.js";
|
|
15
|
-
var be = /* @__PURE__ */ ((
|
|
16
|
-
const
|
|
16
|
+
var be = /* @__PURE__ */ ((v) => (v.History = "History", v.Convert = "Convert", v.Adjust = "Adjust", v))(be || {});
|
|
17
|
+
const Wt = [
|
|
17
18
|
{
|
|
18
19
|
translationKey: "inventory.stock.action.history",
|
|
19
20
|
color: "text-neutral-700",
|
|
20
21
|
value: "History"
|
|
21
22
|
/* History */
|
|
22
23
|
}
|
|
23
|
-
],
|
|
24
|
+
], Kt = [
|
|
24
25
|
{
|
|
25
26
|
translationKey: "inventory.stock.action.history",
|
|
26
27
|
color: "text-neutral-700",
|
|
@@ -40,7 +41,7 @@ const Gt = [
|
|
|
40
41
|
/* Adjust */
|
|
41
42
|
}
|
|
42
43
|
];
|
|
43
|
-
async function
|
|
44
|
+
async function qt(v) {
|
|
44
45
|
const u = `${(pe().currentLocation.name || "").replace(
|
|
45
46
|
/ /g,
|
|
46
47
|
"_"
|
|
@@ -49,7 +50,7 @@ async function Kt(f) {
|
|
|
49
50
|
[
|
|
50
51
|
{
|
|
51
52
|
name: "stock",
|
|
52
|
-
data:
|
|
53
|
+
data: v,
|
|
53
54
|
columns: [
|
|
54
55
|
{
|
|
55
56
|
name: "Code",
|
|
@@ -80,23 +81,23 @@ async function Kt(f) {
|
|
|
80
81
|
u
|
|
81
82
|
);
|
|
82
83
|
}
|
|
83
|
-
function $e(
|
|
84
|
-
const u = localStorage.getItem(`uom:${
|
|
85
|
-
return u ? u ===
|
|
84
|
+
function $e(v, x) {
|
|
85
|
+
const u = localStorage.getItem(`uom:${v._id}`);
|
|
86
|
+
return u ? u === x._id ? {
|
|
86
87
|
type: "unit"
|
|
87
|
-
} :
|
|
88
|
+
} : x.measurements.find((o) => o.id === u) ? {
|
|
88
89
|
type: "measurement",
|
|
89
90
|
measurement: u
|
|
90
91
|
} : {
|
|
91
92
|
type: "unit"
|
|
92
|
-
} :
|
|
93
|
+
} : v.trackingMeasurement && x.measurements.find((o) => o.id === v.trackingMeasurement) ? {
|
|
93
94
|
type: "measurement",
|
|
94
|
-
measurement:
|
|
95
|
+
measurement: v.trackingMeasurement
|
|
95
96
|
} : {
|
|
96
97
|
type: "unit"
|
|
97
98
|
};
|
|
98
99
|
}
|
|
99
|
-
const
|
|
100
|
+
const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ ce({
|
|
100
101
|
__name: "UnitDisplayControl",
|
|
101
102
|
props: {
|
|
102
103
|
unit: {},
|
|
@@ -104,15 +105,15 @@ const qt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
|
|
|
104
105
|
amount: {},
|
|
105
106
|
defaultTrackingMeasurement: {}
|
|
106
107
|
},
|
|
107
|
-
setup(
|
|
108
|
-
function
|
|
108
|
+
setup(v) {
|
|
109
|
+
function x($) {
|
|
109
110
|
return `uom:${$._id}`;
|
|
110
111
|
}
|
|
111
112
|
function u($) {
|
|
112
|
-
const i =
|
|
113
|
+
const i = x(o.sku);
|
|
113
114
|
$ ? localStorage.setItem(i, $) : localStorage.setItem(i, o.unit._id), A.value = $e(o.sku, o.unit);
|
|
114
115
|
}
|
|
115
|
-
const o =
|
|
116
|
+
const o = v, A = N($e(o.sku, o.unit)), p = R(() => {
|
|
116
117
|
const { measurements: $ } = o.unit;
|
|
117
118
|
return [
|
|
118
119
|
{
|
|
@@ -128,7 +129,7 @@ const qt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
|
|
|
128
129
|
function l({ value: $ }) {
|
|
129
130
|
return r(A).type === "unit" ? $ === null : $ === r(A).measurement;
|
|
130
131
|
}
|
|
131
|
-
const
|
|
132
|
+
const f = R(
|
|
132
133
|
() => {
|
|
133
134
|
var $;
|
|
134
135
|
return (($ = p.value.find((i) => l(i))) == null ? void 0 : $.label) ?? "";
|
|
@@ -148,8 +149,8 @@ const qt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
|
|
|
148
149
|
M.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
|
|
149
150
|
])
|
|
150
151
|
}, [
|
|
151
|
-
e("div",
|
|
152
|
-
|
|
152
|
+
e("div", Xt, _(f.value), 1),
|
|
153
|
+
g(s, {
|
|
153
154
|
class: "text-fm-color-neutral-gray-400",
|
|
154
155
|
name: "expand_more"
|
|
155
156
|
})
|
|
@@ -167,22 +168,22 @@ const qt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
|
|
|
167
168
|
});
|
|
168
169
|
};
|
|
169
170
|
}
|
|
170
|
-
}),
|
|
171
|
+
}), Qt = { class: "whitespace-nowrap" }, Jt = /* @__PURE__ */ ce({
|
|
171
172
|
__name: "StockHeaderPreview",
|
|
172
|
-
setup(
|
|
173
|
-
const { t:
|
|
173
|
+
setup(v) {
|
|
174
|
+
const { t: x } = de();
|
|
174
175
|
return (u, o) => (F(), L(Rt, null, {
|
|
175
176
|
default: I(() => [
|
|
176
|
-
e("div",
|
|
177
|
+
e("div", Qt, _(r(x)("inventory.stock.prediction.daysRemaining")), 1)
|
|
177
178
|
]),
|
|
178
179
|
_: 1
|
|
179
180
|
}));
|
|
180
181
|
}
|
|
181
182
|
}), lt = Nt("stockActions", () => {
|
|
182
|
-
const
|
|
183
|
-
async function
|
|
184
|
-
if (
|
|
185
|
-
|
|
183
|
+
const v = N(!1), x = pe(), u = Re(), o = nt(), A = _e(), p = Oe(), { t: l } = de();
|
|
184
|
+
async function f() {
|
|
185
|
+
if (x._currentLocation) {
|
|
186
|
+
v.value = !0;
|
|
186
187
|
try {
|
|
187
188
|
await u.readStockBalance(), await u.readProductBalance(), await o.readStockEstimateBalance();
|
|
188
189
|
} catch {
|
|
@@ -192,7 +193,7 @@ const qt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
|
|
|
192
193
|
type: "error"
|
|
193
194
|
});
|
|
194
195
|
} finally {
|
|
195
|
-
|
|
196
|
+
v.value = !1;
|
|
196
197
|
}
|
|
197
198
|
}
|
|
198
199
|
}
|
|
@@ -214,7 +215,7 @@ const qt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
|
|
|
214
215
|
M.value.show = T;
|
|
215
216
|
},
|
|
216
217
|
onSubmitted() {
|
|
217
|
-
|
|
218
|
+
f();
|
|
218
219
|
}
|
|
219
220
|
};
|
|
220
221
|
M.value = y;
|
|
@@ -228,7 +229,7 @@ const qt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
|
|
|
228
229
|
i.value.show = t;
|
|
229
230
|
},
|
|
230
231
|
onSubmitted() {
|
|
231
|
-
|
|
232
|
+
f();
|
|
232
233
|
}
|
|
233
234
|
};
|
|
234
235
|
i.value = h;
|
|
@@ -259,7 +260,7 @@ const qt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
|
|
|
259
260
|
}
|
|
260
261
|
}
|
|
261
262
|
return {
|
|
262
|
-
fetchStockBalance:
|
|
263
|
+
fetchStockBalance: f,
|
|
263
264
|
onActionMenu: S,
|
|
264
265
|
stockHistoryProps: V,
|
|
265
266
|
showSkuHistory: k,
|
|
@@ -267,8 +268,8 @@ const qt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
|
|
|
267
268
|
adjustSkuDialogProps: i
|
|
268
269
|
};
|
|
269
270
|
});
|
|
270
|
-
function
|
|
271
|
-
const
|
|
271
|
+
function Zt() {
|
|
272
|
+
const v = pe(), x = lt(), { t: u } = de();
|
|
272
273
|
return {
|
|
273
274
|
columnDefs: [
|
|
274
275
|
{
|
|
@@ -300,17 +301,17 @@ function Jt() {
|
|
|
300
301
|
{
|
|
301
302
|
accessorKey: "day",
|
|
302
303
|
id: "expireDate",
|
|
303
|
-
header: () => he(
|
|
304
|
+
header: () => he(Jt),
|
|
304
305
|
enableSorting: !0,
|
|
305
306
|
sortUndefined: "last",
|
|
306
307
|
cell(A) {
|
|
307
308
|
var i, s;
|
|
308
|
-
const p = A.row.original.day, l = (i = A.row.original.thresholds) == null ? void 0 : i.low,
|
|
309
|
-
if (typeof p != "number" || typeof l != "number" || typeof
|
|
309
|
+
const p = A.row.original.day, l = (i = A.row.original.thresholds) == null ? void 0 : i.low, f = (s = A.row.original.thresholds) == null ? void 0 : s.mid;
|
|
310
|
+
if (typeof p != "number" || typeof l != "number" || typeof f != "number")
|
|
310
311
|
return he(Te, {
|
|
311
312
|
days: p
|
|
312
313
|
});
|
|
313
|
-
const M = p <= l ? Be.low : p <=
|
|
314
|
+
const M = p <= l ? Be.low : p <= f ? Be.mid : Be.high;
|
|
314
315
|
return he(Te, {
|
|
315
316
|
days: p,
|
|
316
317
|
level: M
|
|
@@ -323,8 +324,8 @@ function Jt() {
|
|
|
323
324
|
cell(A) {
|
|
324
325
|
var p;
|
|
325
326
|
return mt(
|
|
326
|
-
((p =
|
|
327
|
-
(l) =>
|
|
327
|
+
((p = v._currentLocation) == null ? void 0 : p.type) === "restaurant" ? Wt : Kt,
|
|
328
|
+
(l) => x.onActionMenu(l, A.row.original)
|
|
328
329
|
);
|
|
329
330
|
},
|
|
330
331
|
enableSorting: !1,
|
|
@@ -337,44 +338,44 @@ function Jt() {
|
|
|
337
338
|
]
|
|
338
339
|
};
|
|
339
340
|
}
|
|
340
|
-
const
|
|
341
|
+
const en = {
|
|
341
342
|
context: null,
|
|
342
343
|
error: null,
|
|
343
|
-
isRequired(
|
|
344
|
-
return `${this.context ?? ""}`.length === 0 && (this.error =
|
|
344
|
+
isRequired(v = "This field is required") {
|
|
345
|
+
return `${this.context ?? ""}`.length === 0 && (this.error = v), this;
|
|
345
346
|
},
|
|
346
|
-
isString(
|
|
347
|
-
return this.error ? this : (typeof this.context != "string" && (this.error ?? (this.error =
|
|
347
|
+
isString(v = "Must be a valid string") {
|
|
348
|
+
return this.error ? this : (typeof this.context != "string" && (this.error ?? (this.error = v)), this);
|
|
348
349
|
},
|
|
349
350
|
toInt() {
|
|
350
351
|
return this.error ? this : (this.context = +this.context, this);
|
|
351
352
|
},
|
|
352
|
-
isInteger(
|
|
353
|
-
return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error =
|
|
353
|
+
isInteger(v = "Must be an integer") {
|
|
354
|
+
return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error = v), this);
|
|
354
355
|
},
|
|
355
|
-
min(
|
|
356
|
+
min(v, x) {
|
|
356
357
|
if (this.error) return this;
|
|
357
358
|
try {
|
|
358
|
-
typeof this.context == "number" ? +this.context <
|
|
359
|
+
typeof this.context == "number" ? +this.context < v && (this.error = x ?? `Must be at least ${v}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < v && (this.error = x ?? `Must be at least ${v}`) : this.error = "Length cannot be determined";
|
|
359
360
|
} catch {
|
|
360
361
|
this.error = "Length cannot be determined";
|
|
361
362
|
}
|
|
362
363
|
return this;
|
|
363
364
|
},
|
|
364
|
-
max(
|
|
365
|
+
max(v, x) {
|
|
365
366
|
if (this.error) return this;
|
|
366
367
|
try {
|
|
367
|
-
typeof this.context == "number" ? +this.context >
|
|
368
|
+
typeof this.context == "number" ? +this.context > v && (this.error = x ?? `Must be at most ${v}`) : "length" in this.context ? +this.context.length > v && (this.error = x ?? `Must be at most ${v}`) : this.error = "Length cannot be determined";
|
|
368
369
|
} catch {
|
|
369
370
|
this.error = "Length cannot be determined";
|
|
370
371
|
}
|
|
371
372
|
return this;
|
|
372
373
|
}
|
|
373
374
|
};
|
|
374
|
-
function Qe(
|
|
375
|
-
return { ...
|
|
375
|
+
function Qe(v) {
|
|
376
|
+
return { ...en, context: v };
|
|
376
377
|
}
|
|
377
|
-
const
|
|
378
|
+
const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-800" }, on = { class: "flex flex-col gap-24 w-full" }, sn = { class: "flex flex-col gap-8" }, an = { class: "fm-typo-en-body-lg-600" }, rn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, ln = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, un = { class: "flex flex-col p-16 gap-8" }, cn = { class: "flex flex-col gap-4" }, dn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, mn = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, pn = { class: "xs:col-span-3" }, fn = { class: "flex gap-8" }, vn = /* @__PURE__ */ ce({
|
|
378
379
|
__name: "ConvertSkuDialog",
|
|
379
380
|
props: {
|
|
380
381
|
sku: {},
|
|
@@ -382,8 +383,8 @@ const en = { class: "flex items-center" }, tn = { class: "fm-typo-en-title-md-80
|
|
|
382
383
|
show: { type: Boolean }
|
|
383
384
|
},
|
|
384
385
|
emits: ["update:show", "submitted"],
|
|
385
|
-
setup(
|
|
386
|
-
const o =
|
|
386
|
+
setup(v, { expose: x, emit: u }) {
|
|
387
|
+
const o = v, A = u, p = Lt(), l = Pe(), f = ye(), M = _e(), { t: $ } = de(), i = N(0), s = N(null), V = R(() => l.skus), k = R(
|
|
387
388
|
() => {
|
|
388
389
|
var d, n;
|
|
389
390
|
return (((n = (d = o.sku) == null ? void 0 : d.convert) == null ? void 0 : n.inventoryBindings) ?? []).filter(
|
|
@@ -436,16 +437,16 @@ const en = { class: "flex items-center" }, tn = { class: "fm-typo-en-title-md-80
|
|
|
436
437
|
}).inventoryBindings.filter((m) => "success" in m && m.success).map((m) => m).map((m) => m.binding);
|
|
437
438
|
return (c = s.value ?? n) == null ? void 0 : c.map((m) => {
|
|
438
439
|
var re, ie, te, ae, Le;
|
|
439
|
-
const C = l.skus.find((
|
|
440
|
+
const C = l.skus.find((fe) => fe._id === m.id), H = ((re = m.measurement) == null ? void 0 : re.abbrev) ?? ((ie = C == null ? void 0 : C.unit) == null ? void 0 : ie.abbrev), K = (te = o.sku.convert) != null && te.measurement ? o.sku.unit.measurements.find((fe) => {
|
|
440
441
|
var ze;
|
|
441
|
-
return
|
|
442
|
+
return fe.id === ((ze = o.sku.convert) == null ? void 0 : ze.measurement);
|
|
442
443
|
}) ?? null : null, ee = Ie(o.sku.unit, K), E = y(`${i.value}`) === !0 ? me(
|
|
443
|
-
|
|
444
|
+
ft(
|
|
444
445
|
m.amount,
|
|
445
446
|
Se(+i.value, ee)
|
|
446
447
|
),
|
|
447
448
|
!1
|
|
448
|
-
) : "0", q = (Le = (ae = s.value) == null ? void 0 : ae.find((
|
|
449
|
+
) : "0", q = (Le = (ae = s.value) == null ? void 0 : ae.find((fe) => fe.id === (C == null ? void 0 : C._id))) == null ? void 0 : Le.amount, J = q ? me(q, !1) : null;
|
|
449
450
|
return {
|
|
450
451
|
sku: C,
|
|
451
452
|
convertAmount: J ?? E,
|
|
@@ -453,7 +454,7 @@ const en = { class: "flex items-center" }, tn = { class: "fm-typo-en-title-md-80
|
|
|
453
454
|
};
|
|
454
455
|
});
|
|
455
456
|
}), P = N();
|
|
456
|
-
|
|
457
|
+
x({
|
|
457
458
|
validateInputs: () => {
|
|
458
459
|
var d, n;
|
|
459
460
|
(n = (d = P.value) == null ? void 0 : d.validateInputs) == null || n.call(d);
|
|
@@ -471,7 +472,7 @@ const en = { class: "flex items-center" }, tn = { class: "fm-typo-en-title-md-80
|
|
|
471
472
|
async function Y(d, n, a) {
|
|
472
473
|
B.value = !0;
|
|
473
474
|
try {
|
|
474
|
-
await
|
|
475
|
+
await f.convertSku({
|
|
475
476
|
conversions: [
|
|
476
477
|
{
|
|
477
478
|
doc: d,
|
|
@@ -500,7 +501,7 @@ const en = { class: "flex items-center" }, tn = { class: "fm-typo-en-title-md-80
|
|
|
500
501
|
function W(d, n, a) {
|
|
501
502
|
const b = +n;
|
|
502
503
|
let c = a;
|
|
503
|
-
n.length > 0 && isFinite(b) ? c = a.map((m) => (m.id !== d || (m.amount =
|
|
504
|
+
n.length > 0 && isFinite(b) ? c = a.map((m) => (m.id !== d || (m.amount = ve(b)), m)) : c = a.map((m) => (m.id !== d || (m.amount = { amount: 0, precision: 0 }), m)), s.value = c;
|
|
504
505
|
}
|
|
505
506
|
function U(d) {
|
|
506
507
|
const n = V.value.find((a) => a._id === d);
|
|
@@ -555,19 +556,19 @@ const en = { class: "flex items-center" }, tn = { class: "fm-typo-en-title-md-80
|
|
|
555
556
|
"max-width": 500
|
|
556
557
|
}, {
|
|
557
558
|
"side-sheet-header": I(() => [
|
|
558
|
-
e("div",
|
|
559
|
-
e("div",
|
|
559
|
+
e("div", tn, [
|
|
560
|
+
e("div", nn, _(r($)("inventory.stock.convert.title", { name: d.sku.name })), 1)
|
|
560
561
|
])
|
|
561
562
|
]),
|
|
562
563
|
default: I(() => [
|
|
563
|
-
e("div",
|
|
564
|
-
|
|
564
|
+
e("div", on, [
|
|
565
|
+
g(b, {
|
|
565
566
|
ref_key: "formRef",
|
|
566
567
|
ref: P,
|
|
567
568
|
onValidationSuccess: h
|
|
568
569
|
}, {
|
|
569
570
|
default: I(() => [
|
|
570
|
-
|
|
571
|
+
g(a, {
|
|
571
572
|
disabled: B.value,
|
|
572
573
|
"model-value": i.value,
|
|
573
574
|
"onUpdate:modelValue": n[0] || (n[0] = (E) => i.value = E),
|
|
@@ -579,31 +580,31 @@ const en = { class: "flex items-center" }, tn = { class: "fm-typo-en-title-md-80
|
|
|
579
580
|
]),
|
|
580
581
|
_: 1
|
|
581
582
|
}, 512),
|
|
582
|
-
|
|
583
|
+
g(c, {
|
|
583
584
|
variant: "outlined",
|
|
584
585
|
class: "p-16"
|
|
585
586
|
}, {
|
|
586
587
|
default: I(() => [
|
|
587
|
-
e("div",
|
|
588
|
-
e("div",
|
|
588
|
+
e("div", sn, [
|
|
589
|
+
e("div", an, _(r($)("inventory.stock.convert.deductionSummary")), 1),
|
|
589
590
|
(F(!0), O(ne, null, le(j.value, (E) => {
|
|
590
591
|
var q, J;
|
|
591
592
|
return F(), O("div", {
|
|
592
593
|
key: (q = E.sku) == null ? void 0 : q._id,
|
|
593
594
|
class: "flex items-center"
|
|
594
595
|
}, [
|
|
595
|
-
e("div",
|
|
596
|
-
e("div",
|
|
596
|
+
e("div", rn, _((J = E.sku) == null ? void 0 : J.name), 1),
|
|
597
|
+
e("div", ln, " -" + _(E.convertAmount) + " " + _(E.abbrev), 1)
|
|
597
598
|
]);
|
|
598
599
|
}), 128))
|
|
599
600
|
])
|
|
600
601
|
]),
|
|
601
602
|
_: 1
|
|
602
603
|
}),
|
|
603
|
-
|
|
604
|
+
g(c, { variant: "outlined" }, {
|
|
604
605
|
default: I(() => [
|
|
605
|
-
e("div",
|
|
606
|
-
|
|
606
|
+
e("div", un, [
|
|
607
|
+
g(m, {
|
|
607
608
|
value: "",
|
|
608
609
|
modelValue: S.value,
|
|
609
610
|
"onUpdate:modelValue": n[1] || (n[1] = (E) => S.value = E),
|
|
@@ -611,12 +612,12 @@ const en = { class: "flex items-center" }, tn = { class: "fm-typo-en-title-md-80
|
|
|
611
612
|
"label-placement": "right"
|
|
612
613
|
}, null, 8, ["modelValue", "label"]),
|
|
613
614
|
S.value ? (F(), O(ne, { key: 0 }, [
|
|
614
|
-
|
|
615
|
+
g(C, {
|
|
615
616
|
modelValue: s.value,
|
|
616
|
-
rules: [r(
|
|
617
|
+
rules: [r(vt)(1, "Must have at least one ingredient binding")]
|
|
617
618
|
}, null, 8, ["modelValue", "rules"]),
|
|
618
|
-
e("div",
|
|
619
|
-
e("div",
|
|
619
|
+
e("div", cn, [
|
|
620
|
+
e("div", dn, _(r($)("inventory.stock.convert.ingredients")), 1),
|
|
620
621
|
(F(!0), O(ne, null, le(s.value, (E) => (F(), L(C, {
|
|
621
622
|
key: E.id,
|
|
622
623
|
disabled: B.value,
|
|
@@ -632,9 +633,9 @@ const en = { class: "flex items-center" }, tn = { class: "fm-typo-en-title-md-80
|
|
|
632
633
|
default: I(({ invalid: q }) => {
|
|
633
634
|
var J, re, ie;
|
|
634
635
|
return [
|
|
635
|
-
e("div",
|
|
636
|
-
e("div",
|
|
637
|
-
|
|
636
|
+
e("div", mn, [
|
|
637
|
+
e("div", pn, _((J = V.value.find((te) => te._id === E.id)) == null ? void 0 : J.name), 1),
|
|
638
|
+
g(a, {
|
|
638
639
|
class: "xs:col-span-2",
|
|
639
640
|
disabled: B.value,
|
|
640
641
|
modelValue: +r(me)(
|
|
@@ -643,7 +644,7 @@ const en = { class: "flex items-center" }, tn = { class: "fm-typo-en-title-md-80
|
|
|
643
644
|
"onUpdate:modelValue": (te) => W(E.id, te, s.value ?? []),
|
|
644
645
|
invalid: q
|
|
645
646
|
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
|
|
646
|
-
|
|
647
|
+
g(H, {
|
|
647
648
|
disabled: B.value,
|
|
648
649
|
class: "translate-y-[2px]",
|
|
649
650
|
items: U(E.id),
|
|
@@ -654,7 +655,7 @@ const en = { class: "flex items-center" }, tn = { class: "fm-typo-en-title-md-80
|
|
|
654
655
|
"helper-text": I(() => n[4] || (n[4] = [])),
|
|
655
656
|
_: 2
|
|
656
657
|
}, 1032, ["disabled", "items", "model-value", "onUpdate:modelValue", "invalid"]),
|
|
657
|
-
|
|
658
|
+
g(K, {
|
|
658
659
|
disabled: B.value,
|
|
659
660
|
type: "button",
|
|
660
661
|
variant: "tertiary",
|
|
@@ -668,7 +669,7 @@ const en = { class: "flex items-center" }, tn = { class: "fm-typo-en-title-md-80
|
|
|
668
669
|
}, 1032, ["disabled", "modelValue", "rules"]))), 128))
|
|
669
670
|
]),
|
|
670
671
|
e("div", null, [
|
|
671
|
-
|
|
672
|
+
g(K, {
|
|
672
673
|
icon: "link",
|
|
673
674
|
label: r($)("inventory.stock.convert.linkIngredient"),
|
|
674
675
|
variant: "plain",
|
|
@@ -683,8 +684,8 @@ const en = { class: "flex items-center" }, tn = { class: "fm-typo-en-title-md-80
|
|
|
683
684
|
])
|
|
684
685
|
]),
|
|
685
686
|
"side-sheet-footer": I(() => [
|
|
686
|
-
e("div",
|
|
687
|
-
|
|
687
|
+
e("div", fn, [
|
|
688
|
+
g(K, {
|
|
688
689
|
loading: B.value,
|
|
689
690
|
label: r($)("inventory.stock.convert.convertButton"),
|
|
690
691
|
onClick: n[2] || (n[2] = (E) => {
|
|
@@ -699,12 +700,12 @@ const en = { class: "flex items-center" }, tn = { class: "fm-typo-en-title-md-80
|
|
|
699
700
|
};
|
|
700
701
|
}
|
|
701
702
|
});
|
|
702
|
-
function De(
|
|
703
|
-
const u = Se(
|
|
703
|
+
function De(v, x) {
|
|
704
|
+
const u = Se(v, x);
|
|
704
705
|
return { ...u, amount: -u.amount };
|
|
705
706
|
}
|
|
706
|
-
function Je(
|
|
707
|
-
return Se(Math.abs(
|
|
707
|
+
function Je(v, x) {
|
|
708
|
+
return Se(Math.abs(v), x);
|
|
708
709
|
}
|
|
709
710
|
const je = {
|
|
710
711
|
[oe.enum.DAMAGE]: {
|
|
@@ -727,15 +728,15 @@ const je = {
|
|
|
727
728
|
label: "Purchase",
|
|
728
729
|
toAdjustmentAmount: Je
|
|
729
730
|
}
|
|
730
|
-
},
|
|
731
|
+
}, yn = { class: "col-span-2 flex" }, _n = { class: "fm-typo-en-body-lg-600 flex-1" }, hn = /* @__PURE__ */ ce({
|
|
731
732
|
__name: "AdjustedItemForm",
|
|
732
733
|
props: {
|
|
733
734
|
modelValue: {},
|
|
734
735
|
disabled: { type: Boolean }
|
|
735
736
|
},
|
|
736
737
|
emits: ["update:modelValue", "click:delete"],
|
|
737
|
-
setup(
|
|
738
|
-
const u =
|
|
738
|
+
setup(v, { emit: x }) {
|
|
739
|
+
const u = v, o = x, A = R(
|
|
739
740
|
() => Object.keys(je).map((i) => ({
|
|
740
741
|
label: ht(i),
|
|
741
742
|
value: i
|
|
@@ -755,7 +756,7 @@ const je = {
|
|
|
755
756
|
V.precision
|
|
756
757
|
), o("update:modelValue", s);
|
|
757
758
|
}
|
|
758
|
-
}),
|
|
759
|
+
}), f = R({
|
|
759
760
|
get() {
|
|
760
761
|
const i = We(u.modelValue.amount);
|
|
761
762
|
return +me(i);
|
|
@@ -763,7 +764,7 @@ const je = {
|
|
|
763
764
|
set(i) {
|
|
764
765
|
const s = {
|
|
765
766
|
...u.modelValue
|
|
766
|
-
}, V =
|
|
767
|
+
}, V = ve(i);
|
|
767
768
|
s.amount = je[l.value].toAdjustmentAmount(
|
|
768
769
|
i,
|
|
769
770
|
V.precision
|
|
@@ -799,15 +800,15 @@ const je = {
|
|
|
799
800
|
class: "grid grid-cols-2 gap-8 p-16"
|
|
800
801
|
}, {
|
|
801
802
|
default: I(() => [
|
|
802
|
-
e("div",
|
|
803
|
-
e("div",
|
|
804
|
-
|
|
803
|
+
e("div", yn, [
|
|
804
|
+
e("div", _n, _(i.modelValue.doc.name), 1),
|
|
805
|
+
g(V, {
|
|
805
806
|
variant: "tertiary",
|
|
806
807
|
"prepend-icon": "delete",
|
|
807
808
|
onClick: s[0] || (s[0] = (h) => o("click:delete"))
|
|
808
809
|
})
|
|
809
810
|
]),
|
|
810
|
-
|
|
811
|
+
g(k, {
|
|
811
812
|
disabled: i.disabled,
|
|
812
813
|
class: "col-span-2",
|
|
813
814
|
label: "Type",
|
|
@@ -817,25 +818,25 @@ const je = {
|
|
|
817
818
|
rules: [r(kt)()],
|
|
818
819
|
"label-mark": "required"
|
|
819
820
|
}, null, 8, ["disabled", "items", "modelValue", "rules"]),
|
|
820
|
-
|
|
821
|
+
g(zt, {
|
|
821
822
|
disabled: i.disabled,
|
|
822
823
|
label: "Amount",
|
|
823
824
|
step: +r(me)({
|
|
824
825
|
amount: 1,
|
|
825
826
|
precision: r(Ie)(i.modelValue.doc.unit, i.modelValue.measurement)
|
|
826
827
|
}),
|
|
827
|
-
modelValue:
|
|
828
|
-
"onUpdate:modelValue": s[2] || (s[2] = (h) =>
|
|
828
|
+
modelValue: f.value,
|
|
829
|
+
"onUpdate:modelValue": s[2] || (s[2] = (h) => f.value = h),
|
|
829
830
|
rules: [r(Fe)(0)]
|
|
830
831
|
}, null, 8, ["disabled", "step", "modelValue", "rules"]),
|
|
831
|
-
|
|
832
|
+
g(k, {
|
|
832
833
|
disabled: i.disabled,
|
|
833
834
|
label: "Unit",
|
|
834
835
|
items: p.value,
|
|
835
836
|
modelValue: M.value,
|
|
836
837
|
"onUpdate:modelValue": s[3] || (s[3] = (h) => M.value = h)
|
|
837
838
|
}, null, 8, ["disabled", "items", "modelValue"]),
|
|
838
|
-
|
|
839
|
+
g(S, {
|
|
839
840
|
class: "col-span-2",
|
|
840
841
|
disabled: i.disabled,
|
|
841
842
|
label: "Remark",
|
|
@@ -848,20 +849,20 @@ const je = {
|
|
|
848
849
|
});
|
|
849
850
|
};
|
|
850
851
|
}
|
|
851
|
-
}),
|
|
852
|
+
}), kn = { class: "flex items-center" }, bn = { class: "fm-typo-en-title-md-800" }, gn = { class: "flex items-center" }, xn = { class: "fm-typo-en-title-sm-800 flex-1" }, Sn = { class: "flex gap-8" }, Fn = /* @__PURE__ */ ce({
|
|
852
853
|
__name: "AdjustSkuDialog",
|
|
853
854
|
props: {
|
|
854
855
|
stock: {},
|
|
855
856
|
show: { type: Boolean }
|
|
856
857
|
},
|
|
857
858
|
emits: ["update:show", "submitted"],
|
|
858
|
-
setup(
|
|
859
|
-
const o =
|
|
859
|
+
setup(v, { expose: x, emit: u }) {
|
|
860
|
+
const o = v, A = u, p = Pe(), l = Oe(), f = ye(), M = _e(), $ = N(!1), { t: i } = de();
|
|
860
861
|
function s() {
|
|
861
862
|
B(He(S));
|
|
862
863
|
}
|
|
863
864
|
const V = N();
|
|
864
|
-
|
|
865
|
+
x({
|
|
865
866
|
validateInputs: () => {
|
|
866
867
|
var y, w;
|
|
867
868
|
(w = (y = V.value) == null ? void 0 : y.validateInputs) == null || w.call(y);
|
|
@@ -884,7 +885,7 @@ const je = {
|
|
|
884
885
|
doc: o.stock,
|
|
885
886
|
measurement: null,
|
|
886
887
|
remark: "",
|
|
887
|
-
amount:
|
|
888
|
+
amount: ve(1)
|
|
888
889
|
}
|
|
889
890
|
]
|
|
890
891
|
});
|
|
@@ -896,14 +897,14 @@ const je = {
|
|
|
896
897
|
doc: o.stock,
|
|
897
898
|
measurement: null,
|
|
898
899
|
remark: "",
|
|
899
|
-
amount:
|
|
900
|
+
amount: ve(1)
|
|
900
901
|
}
|
|
901
902
|
]);
|
|
902
903
|
});
|
|
903
904
|
async function B(y) {
|
|
904
905
|
$.value = !0;
|
|
905
906
|
try {
|
|
906
|
-
await
|
|
907
|
+
await f.adjustSku({
|
|
907
908
|
remark: y.remark,
|
|
908
909
|
adjustments: y.adjustments.map(({ doc: w, remark: j, type: P, amount: T, measurement: Y }) => ({
|
|
909
910
|
id: w._id,
|
|
@@ -957,7 +958,7 @@ const je = {
|
|
|
957
958
|
doc: p.skus.find((T) => T._id === P),
|
|
958
959
|
measurement: null,
|
|
959
960
|
remark: "",
|
|
960
|
-
amount:
|
|
961
|
+
amount: ve(1)
|
|
961
962
|
}
|
|
962
963
|
);
|
|
963
964
|
});
|
|
@@ -974,33 +975,33 @@ const je = {
|
|
|
974
975
|
"max-width": 500
|
|
975
976
|
}, {
|
|
976
977
|
"side-sheet-header": I(() => [
|
|
977
|
-
e("div",
|
|
978
|
-
e("div",
|
|
978
|
+
e("div", kn, [
|
|
979
|
+
e("div", bn, _(r(i)("inventory.stock.adjust.title")), 1)
|
|
979
980
|
])
|
|
980
981
|
]),
|
|
981
982
|
default: I(() => [
|
|
982
|
-
|
|
983
|
+
g(T, {
|
|
983
984
|
class: "w-full flex flex-col gap-12",
|
|
984
985
|
ref_key: "formRef",
|
|
985
986
|
ref: V,
|
|
986
987
|
onValidationSuccess: s
|
|
987
988
|
}, {
|
|
988
989
|
default: I(() => [
|
|
989
|
-
|
|
990
|
+
g(j, {
|
|
990
991
|
label: r(i)("inventory.stock.adjust.remark"),
|
|
991
992
|
modelValue: S.remark,
|
|
992
993
|
"onUpdate:modelValue": w[0] || (w[0] = (W) => S.remark = W)
|
|
993
994
|
}, null, 8, ["label", "modelValue"]),
|
|
994
|
-
e("div",
|
|
995
|
-
e("div",
|
|
996
|
-
|
|
995
|
+
e("div", gn, [
|
|
996
|
+
e("div", xn, _(r(i)("inventory.stock.adjust.adjustedItems")), 1),
|
|
997
|
+
g(P, {
|
|
997
998
|
"prepend-icon": "add",
|
|
998
999
|
variant: "tertiary",
|
|
999
1000
|
size: "md",
|
|
1000
1001
|
onClick: h
|
|
1001
1002
|
})
|
|
1002
1003
|
]),
|
|
1003
|
-
(F(!0), O(ne, null, le(S.adjustments, (W, U) => (F(), L(
|
|
1004
|
+
(F(!0), O(ne, null, le(S.adjustments, (W, U) => (F(), L(hn, {
|
|
1004
1005
|
key: W.id,
|
|
1005
1006
|
modelValue: S.adjustments[U],
|
|
1006
1007
|
"onUpdate:modelValue": (Z) => S.adjustments[U] = Z,
|
|
@@ -1011,8 +1012,8 @@ const je = {
|
|
|
1011
1012
|
}, 512)
|
|
1012
1013
|
]),
|
|
1013
1014
|
"side-sheet-footer": I(() => [
|
|
1014
|
-
e("div",
|
|
1015
|
-
|
|
1015
|
+
e("div", Sn, [
|
|
1016
|
+
g(P, {
|
|
1016
1017
|
label: r(i)("inventory.stock.adjust.adjustButton"),
|
|
1017
1018
|
loading: $.value,
|
|
1018
1019
|
onClick: w[1] || (w[1] = (W) => {
|
|
@@ -1026,27 +1027,27 @@ const je = {
|
|
|
1026
1027
|
}, 8, ["modelValue"]);
|
|
1027
1028
|
};
|
|
1028
1029
|
}
|
|
1029
|
-
}),
|
|
1030
|
+
}), wn = gt((v, x) => ({
|
|
1030
1031
|
// TODO: remove once latest inventory backend has been push
|
|
1031
1032
|
async findBillsByBusinessId(u, o, A) {
|
|
1032
|
-
const p = `${
|
|
1033
|
+
const p = `${v.businessesBackendUrl}/${u}/reports/find-many`, l = {
|
|
1033
1034
|
// type: TYPE.bill,
|
|
1034
1035
|
type: "bill",
|
|
1035
1036
|
restaurantIds: o,
|
|
1036
1037
|
ids: A
|
|
1037
1038
|
};
|
|
1038
|
-
return await
|
|
1039
|
+
return await x.post(p, l);
|
|
1039
1040
|
},
|
|
1040
1041
|
async findBillsById(u) {
|
|
1041
|
-
const A = pe().currentLocationDBName, p = `${
|
|
1042
|
+
const A = pe().currentLocationDBName, p = `${v.inventoryBackendUrl}/${A}/bill/search`, l = {
|
|
1042
1043
|
ids: u
|
|
1043
1044
|
};
|
|
1044
|
-
return await
|
|
1045
|
+
return await x.post(p, l);
|
|
1045
1046
|
}
|
|
1046
|
-
})),
|
|
1047
|
+
})), $n = {
|
|
1047
1048
|
key: 0,
|
|
1048
1049
|
class: "flex justify-center items-center h-32"
|
|
1049
|
-
},
|
|
1050
|
+
}, An = { class: "mb-3" }, Vn = { class: "flex flex-col gap-8" }, Cn = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, Mn = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, Bn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Dn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, jn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, In = { class: "flex flex-col w-full px-2" }, Tn = { class: "flex gap-2" }, Un = /* @__PURE__ */ ce({
|
|
1050
1051
|
__name: "AmendAdjustmentForm",
|
|
1051
1052
|
props: /* @__PURE__ */ Ye({
|
|
1052
1053
|
adjustmentId: {}
|
|
@@ -1055,8 +1056,8 @@ const je = {
|
|
|
1055
1056
|
modelModifiers: {}
|
|
1056
1057
|
}),
|
|
1057
1058
|
emits: /* @__PURE__ */ Ye(["refreshHistory"], ["update:modelValue"]),
|
|
1058
|
-
setup(
|
|
1059
|
-
const u =
|
|
1059
|
+
setup(v, { emit: x }) {
|
|
1060
|
+
const u = v, o = x, A = ye(), p = ut(v, "modelValue"), l = N(!1), f = N(!1), M = N(!1), $ = N({
|
|
1060
1061
|
_id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
|
|
1061
1062
|
skus: []
|
|
1062
1063
|
}), i = N();
|
|
@@ -1068,7 +1069,7 @@ const je = {
|
|
|
1068
1069
|
});
|
|
1069
1070
|
async function s() {
|
|
1070
1071
|
var t, y;
|
|
1071
|
-
if ((y = (t = i == null ? void 0 : i.value) == null ? void 0 : t.validateInputs) == null || y.call(t), !
|
|
1072
|
+
if ((y = (t = i == null ? void 0 : i.value) == null ? void 0 : t.validateInputs) == null || y.call(t), !f.value) return;
|
|
1072
1073
|
const h = {};
|
|
1073
1074
|
Object.keys(p.value || {}).forEach((w) => {
|
|
1074
1075
|
var j;
|
|
@@ -1122,9 +1123,14 @@ const je = {
|
|
|
1122
1123
|
onClick: t[0] || (t[0] = (U) => M.value = !0),
|
|
1123
1124
|
class: "rounded-md hover:bg-gray-100 transition-colors"
|
|
1124
1125
|
}, [
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1126
|
+
g(Gt, null, {
|
|
1127
|
+
default: I(() => [
|
|
1128
|
+
g(y, {
|
|
1129
|
+
name: "edit",
|
|
1130
|
+
size: "sm"
|
|
1131
|
+
})
|
|
1132
|
+
]),
|
|
1133
|
+
_: 1
|
|
1128
1134
|
})
|
|
1129
1135
|
])
|
|
1130
1136
|
]),
|
|
@@ -1132,18 +1138,18 @@ const je = {
|
|
|
1132
1138
|
e("div", null, "Amend Adjustment", -1)
|
|
1133
1139
|
])),
|
|
1134
1140
|
"dialog-footer": I(() => [
|
|
1135
|
-
e("div",
|
|
1141
|
+
e("div", In, [
|
|
1136
1142
|
t[13] || (t[13] = e("span", { class: "text-fm-color-system-warning-400 fm-typo-en-body-sm-400" }, "1. New adjustment EXTRA will be created for each reversal", -1)),
|
|
1137
|
-
e("div",
|
|
1138
|
-
|
|
1139
|
-
|
|
1143
|
+
e("div", Tn, [
|
|
1144
|
+
g(T),
|
|
1145
|
+
g(Y, {
|
|
1140
1146
|
class: "sm:w-full xs:w-full",
|
|
1141
1147
|
label: "Close",
|
|
1142
1148
|
size: "md",
|
|
1143
1149
|
variant: "tertiary",
|
|
1144
1150
|
onClick: t[3] || (t[3] = (U) => M.value = !1)
|
|
1145
1151
|
}),
|
|
1146
|
-
|
|
1152
|
+
g(Y, {
|
|
1147
1153
|
class: "sm:w-full xs:w-full",
|
|
1148
1154
|
label: "Submit",
|
|
1149
1155
|
size: "md",
|
|
@@ -1154,25 +1160,25 @@ const je = {
|
|
|
1154
1160
|
])
|
|
1155
1161
|
]),
|
|
1156
1162
|
default: I(() => [
|
|
1157
|
-
l.value ? (F(), O("div",
|
|
1163
|
+
l.value ? (F(), O("div", $n)) : (F(), L(P, {
|
|
1158
1164
|
key: 1,
|
|
1159
1165
|
ref_key: "formRef",
|
|
1160
1166
|
ref: i,
|
|
1161
1167
|
onValidationFailed: t[1] || (t[1] = () => {
|
|
1162
|
-
|
|
1168
|
+
f.value = !1;
|
|
1163
1169
|
}),
|
|
1164
1170
|
onValidationSuccess: t[2] || (t[2] = () => {
|
|
1165
|
-
|
|
1171
|
+
f.value = !0;
|
|
1166
1172
|
}),
|
|
1167
1173
|
blameFormChildOnValidationFailed: ""
|
|
1168
1174
|
}, {
|
|
1169
1175
|
default: I(() => [
|
|
1170
|
-
e("p",
|
|
1176
|
+
e("p", An, [
|
|
1171
1177
|
t[6] || (t[6] = e("b", null, "Date:", -1)),
|
|
1172
1178
|
t[7] || (t[7] = e("br", null, null, -1)),
|
|
1173
1179
|
ue(" " + _(r(xt)(r(St)($.value._id))), 1)
|
|
1174
1180
|
]),
|
|
1175
|
-
e("div",
|
|
1181
|
+
e("div", Vn, [
|
|
1176
1182
|
(F(!0), O(ne, null, le($.value.skus, (U, Z) => (F(), O(ne, { key: Z }, [
|
|
1177
1183
|
(F(!0), O(ne, null, le(U.amounts, (z, Q) => (F(), L(j, {
|
|
1178
1184
|
key: Q,
|
|
@@ -1180,20 +1186,20 @@ const je = {
|
|
|
1180
1186
|
class: "p-2"
|
|
1181
1187
|
}, {
|
|
1182
1188
|
default: I(() => [
|
|
1183
|
-
e("div",
|
|
1184
|
-
e("span",
|
|
1189
|
+
e("div", Cn, [
|
|
1190
|
+
e("span", Mn, _(U.sku.code), 1),
|
|
1185
1191
|
e("span", null, _(U.sku.name), 1)
|
|
1186
1192
|
]),
|
|
1187
1193
|
t[12] || (t[12] = e("hr", { class: "m-2" }, null, -1)),
|
|
1188
|
-
e("div",
|
|
1194
|
+
e("div", Bn, [
|
|
1189
1195
|
t[8] || (t[8] = e("span", { class: "fm-typo-en-body-lg-600" }, "Adjustment type:", -1)),
|
|
1190
1196
|
e("span", null, _(z.type), 1)
|
|
1191
1197
|
]),
|
|
1192
|
-
e("div",
|
|
1198
|
+
e("div", Dn, [
|
|
1193
1199
|
t[9] || (t[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
|
|
1194
1200
|
e("span", null, _(r(Ce).toFormatString({ value: z.amount })) + " " + _(S(U, z)), 1)
|
|
1195
1201
|
]),
|
|
1196
|
-
|
|
1202
|
+
g(w, {
|
|
1197
1203
|
"model-value": V(U.sku._id, Q).value,
|
|
1198
1204
|
"onUpdate:modelValue": (G) => V(U.sku._id, Q).value = G,
|
|
1199
1205
|
class: "mb-3",
|
|
@@ -1205,7 +1211,7 @@ const je = {
|
|
|
1205
1211
|
r(Fe)(-1)
|
|
1206
1212
|
]
|
|
1207
1213
|
}, null, 8, ["model-value", "onUpdate:modelValue", "helper-text", "append-text", "rules"]),
|
|
1208
|
-
e("div",
|
|
1214
|
+
e("div", jn, [
|
|
1209
1215
|
t[10] || (t[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
|
|
1210
1216
|
t[11] || (t[11] = e("span", { class: "text-fm-color-system-warning-400 fm-typo-en-body-sm-400" }, "* It's an estimate for your reference, as it didn't include all the reversals related to this adjustment", -1)),
|
|
1211
1217
|
ue(" " + _(B(
|
|
@@ -1226,19 +1232,19 @@ const je = {
|
|
|
1226
1232
|
}, 8, ["modelValue"]);
|
|
1227
1233
|
};
|
|
1228
1234
|
}
|
|
1229
|
-
}),
|
|
1235
|
+
}), En = { class: "p-16" }, Hn = { class: "fm-typo-en-body-md-600 flex-grow" }, Pn = { class: "flex-grow text-fm-color-typo-secondary" }, Rn = {
|
|
1230
1236
|
key: 0,
|
|
1231
1237
|
class: "my-5"
|
|
1232
|
-
},
|
|
1238
|
+
}, On = { class: "text-neutral-400" }, Nn = { class: "flex-grow" }, Ln = { class: "flex gap-1" }, zn = { class: "flex flex-col gap-1" }, Yn = {
|
|
1233
1239
|
key: 1,
|
|
1234
1240
|
class: "t-system text-fsecondary"
|
|
1235
|
-
},
|
|
1241
|
+
}, Gn = {
|
|
1236
1242
|
key: 2,
|
|
1237
1243
|
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"
|
|
1238
|
-
},
|
|
1244
|
+
}, Wn = {
|
|
1239
1245
|
key: 1,
|
|
1240
1246
|
class: "shrink-0 text-fm-color-typo-secondary"
|
|
1241
|
-
},
|
|
1247
|
+
}, Kn = /* @__PURE__ */ ce({
|
|
1242
1248
|
__name: "StockRecordCard",
|
|
1243
1249
|
props: {
|
|
1244
1250
|
record: {},
|
|
@@ -1246,8 +1252,8 @@ const je = {
|
|
|
1246
1252
|
bills: { default: () => [] }
|
|
1247
1253
|
},
|
|
1248
1254
|
emits: ["refreshHistory"],
|
|
1249
|
-
setup(
|
|
1250
|
-
const u =
|
|
1255
|
+
setup(v, { emit: x }) {
|
|
1256
|
+
const u = v, o = N(!1), A = at(), p = N(), l = N(null), f = R(() => l.value === null ? "unset" : o.value ? `${l.value}px` : "0px");
|
|
1251
1257
|
Ee(() => {
|
|
1252
1258
|
var s;
|
|
1253
1259
|
l.value = ((s = p.value) == null ? void 0 : s.scrollHeight) || 0;
|
|
@@ -1311,13 +1317,13 @@ const je = {
|
|
|
1311
1317
|
const k = D("FmIcon"), S = D("FmTooltip"), B = D("FmCard");
|
|
1312
1318
|
return F(), L(B, { variant: "outlined" }, {
|
|
1313
1319
|
default: I(() => [
|
|
1314
|
-
e("div",
|
|
1320
|
+
e("div", En, [
|
|
1315
1321
|
e("div", {
|
|
1316
1322
|
class: "flex items-center cursor-pointer mb-1",
|
|
1317
1323
|
onClick: V[0] || (V[0] = (h) => o.value = !o.value)
|
|
1318
1324
|
}, [
|
|
1319
|
-
e("div",
|
|
1320
|
-
|
|
1325
|
+
e("div", Hn, _(s.record.date), 1),
|
|
1326
|
+
g(k, {
|
|
1321
1327
|
name: o.value ? "expand_more" : "expand_less",
|
|
1322
1328
|
color: "#777777",
|
|
1323
1329
|
size: "md"
|
|
@@ -1328,7 +1334,7 @@ const je = {
|
|
|
1328
1334
|
class: "flex flex-row py-1",
|
|
1329
1335
|
style: { "font-size": "0.8rem" }
|
|
1330
1336
|
}, [
|
|
1331
|
-
e("div",
|
|
1337
|
+
e("div", Pn, _(r($)(`inventory.inventoryAdjustment.type.${t}`)), 1),
|
|
1332
1338
|
e("div", {
|
|
1333
1339
|
class: ge({
|
|
1334
1340
|
"text-fm-color-typo-error": h.startsWith("-"),
|
|
@@ -1342,25 +1348,25 @@ const je = {
|
|
|
1342
1348
|
ref: p,
|
|
1343
1349
|
style: Ze({
|
|
1344
1350
|
fontSize: "0.8rem",
|
|
1345
|
-
maxHeight:
|
|
1351
|
+
maxHeight: f.value,
|
|
1346
1352
|
overflow: "hidden",
|
|
1347
1353
|
transition: "max-height 0.2s ease-out"
|
|
1348
1354
|
})
|
|
1349
1355
|
}, [
|
|
1350
|
-
i.value.length ? (F(), O("hr",
|
|
1356
|
+
i.value.length ? (F(), O("hr", Rn)) : se("", !0),
|
|
1351
1357
|
(F(!0), O(ne, null, le(i.value, (h) => (F(), O("div", {
|
|
1352
1358
|
key: h.time,
|
|
1353
1359
|
class: "flex gap-1 w-full"
|
|
1354
1360
|
}, [
|
|
1355
|
-
e("div",
|
|
1356
|
-
e("div",
|
|
1361
|
+
e("div", On, _(h.time), 1),
|
|
1362
|
+
e("div", Nn, [
|
|
1357
1363
|
(F(!0), O(ne, null, le(h.adjustments, (t) => {
|
|
1358
1364
|
var y;
|
|
1359
1365
|
return F(), O("div", {
|
|
1360
1366
|
key: t.name,
|
|
1361
1367
|
class: "flex gap-1"
|
|
1362
1368
|
}, [
|
|
1363
|
-
e("div",
|
|
1369
|
+
e("div", Ln, [
|
|
1364
1370
|
ue(_(r($)(`inventory.inventoryAdjustment.type.${t.name}`)) + " ", 1),
|
|
1365
1371
|
t.backdateFrom ? (F(), L(S, {
|
|
1366
1372
|
key: 0,
|
|
@@ -1369,12 +1375,12 @@ const je = {
|
|
|
1369
1375
|
"z-index": 50
|
|
1370
1376
|
}, {
|
|
1371
1377
|
content: I(() => [
|
|
1372
|
-
e("div",
|
|
1378
|
+
e("div", zn, _(r($)("inventory.stock.record.backdate", [
|
|
1373
1379
|
r(tt)(new Date(t.backdateFrom))
|
|
1374
1380
|
])), 1)
|
|
1375
1381
|
]),
|
|
1376
1382
|
default: I(() => [
|
|
1377
|
-
|
|
1383
|
+
g(k, {
|
|
1378
1384
|
name: "info",
|
|
1379
1385
|
size: "sm",
|
|
1380
1386
|
color: "primary"
|
|
@@ -1382,8 +1388,8 @@ const je = {
|
|
|
1382
1388
|
]),
|
|
1383
1389
|
_: 2
|
|
1384
1390
|
}, 1024)) : se("", !0),
|
|
1385
|
-
t.remark ? (F(), O("span",
|
|
1386
|
-
t.name === r(oe).Enum.CLOSING ? (F(), O("span",
|
|
1391
|
+
t.remark ? (F(), O("span", Yn, " # " + _(t.remark), 1)) : se("", !0),
|
|
1392
|
+
t.name === r(oe).Enum.CLOSING ? (F(), O("span", Gn, " Actual Balance: " + _(t.toBalance) + " " + _(t.baseUnit), 1)) : se("", !0)
|
|
1387
1393
|
]),
|
|
1388
1394
|
e("div", {
|
|
1389
1395
|
class: ge({
|
|
@@ -1392,12 +1398,12 @@ const je = {
|
|
|
1392
1398
|
"ml-auto": !0
|
|
1393
1399
|
})
|
|
1394
1400
|
}, _(t.amount), 3),
|
|
1395
|
-
t.name === r(oe).Enum.WASTAGE && ((y = r(A).sessionUser.value) != null && y.role.isAdmin) ? (F(), L(
|
|
1401
|
+
t.name === r(oe).Enum.WASTAGE && ((y = r(A).sessionUser.value) != null && y.role.isAdmin) ? (F(), L(Un, {
|
|
1396
1402
|
key: 0,
|
|
1397
1403
|
adjustmentId: t.adjustmentId,
|
|
1398
1404
|
onRefreshHistory: V[1] || (V[1] = (w) => s.$emit("refreshHistory"))
|
|
1399
1405
|
}, null, 8, ["adjustmentId"])) : se("", !0),
|
|
1400
|
-
t.cost ? (F(), O("div",
|
|
1406
|
+
t.cost ? (F(), O("div", Wn, " (" + _(r(ke)(t.cost, !1, t.cost.precision)) + ") ", 1)) : se("", !0)
|
|
1401
1407
|
]);
|
|
1402
1408
|
}), 128))
|
|
1403
1409
|
])
|
|
@@ -1410,89 +1416,89 @@ const je = {
|
|
|
1410
1416
|
};
|
|
1411
1417
|
}
|
|
1412
1418
|
});
|
|
1413
|
-
function
|
|
1419
|
+
function qn(v, x) {
|
|
1414
1420
|
var p;
|
|
1415
1421
|
const u = Object.keys(oe.enum).reduce(
|
|
1416
|
-
(l,
|
|
1422
|
+
(l, f) => (l[f] = { amount: 0, precision: 0 }, l),
|
|
1417
1423
|
{}
|
|
1418
1424
|
);
|
|
1419
|
-
if (!
|
|
1425
|
+
if (!x)
|
|
1420
1426
|
return Object.entries(u).reduce(
|
|
1421
|
-
(l, [
|
|
1427
|
+
(l, [f]) => (l[f] = X.fromNumber(0), l),
|
|
1422
1428
|
{}
|
|
1423
1429
|
);
|
|
1424
|
-
const A =
|
|
1425
|
-
var
|
|
1426
|
-
return ((
|
|
1430
|
+
const A = v.flatMap((l) => {
|
|
1431
|
+
var f;
|
|
1432
|
+
return ((f = l.skus) == null ? void 0 : f.filter((M) => M.sku._id === x._id)) ?? [];
|
|
1427
1433
|
}).flatMap((l) => l.amounts);
|
|
1428
1434
|
for (const l of A) {
|
|
1429
|
-
const
|
|
1430
|
-
u[p = l.type] ?? (u[p] = { amount: 0, precision: 0 }), u[l.type] = X.add([
|
|
1435
|
+
const f = l.measurement ? X.multiply([l.measurement.conversion, l.amount]) : l.amount;
|
|
1436
|
+
u[p = l.type] ?? (u[p] = { amount: 0, precision: 0 }), u[l.type] = X.add([f, u[l.type]]);
|
|
1431
1437
|
}
|
|
1432
1438
|
return Object.entries(u).reduce(
|
|
1433
|
-
(l, [
|
|
1439
|
+
(l, [f, M]) => {
|
|
1434
1440
|
const $ = {
|
|
1435
1441
|
...M,
|
|
1436
1442
|
amount: Math.abs(M.amount)
|
|
1437
1443
|
};
|
|
1438
|
-
return l[
|
|
1444
|
+
return l[f] = /// comment, because without it formatter makes code uglier
|
|
1439
1445
|
`${X.toFormatString({
|
|
1440
1446
|
value: $,
|
|
1441
1447
|
precision: 4
|
|
1442
|
-
})} ${
|
|
1448
|
+
})} ${x.unit.abbrev}`, l;
|
|
1443
1449
|
},
|
|
1444
1450
|
{}
|
|
1445
1451
|
);
|
|
1446
1452
|
}
|
|
1447
|
-
function
|
|
1448
|
-
if (!
|
|
1453
|
+
function Xn(v, x) {
|
|
1454
|
+
if (!x)
|
|
1449
1455
|
return null;
|
|
1450
1456
|
let u = null;
|
|
1451
|
-
const A =
|
|
1457
|
+
const A = v.flatMap((p) => {
|
|
1452
1458
|
var l;
|
|
1453
|
-
return ((l = p.skus) == null ? void 0 : l.filter((
|
|
1459
|
+
return ((l = p.skus) == null ? void 0 : l.filter((f) => f.sku._id === x._id)) ?? [];
|
|
1454
1460
|
}).flatMap((p) => {
|
|
1455
1461
|
var l;
|
|
1456
1462
|
return !p.history || ((l = p.history) == null ? void 0 : l.length) === 0 ? [] : p.history[0];
|
|
1457
1463
|
});
|
|
1458
1464
|
for (const p of A) {
|
|
1459
1465
|
const l = p.amounts;
|
|
1460
|
-
for (const
|
|
1461
|
-
if (
|
|
1466
|
+
for (const f of l) {
|
|
1467
|
+
if (f.type !== oe.Enum.SALES)
|
|
1462
1468
|
continue;
|
|
1463
|
-
const M =
|
|
1469
|
+
const M = f.measurement ? X.multiply([f.measurement.conversion, f.amount]) : f.amount;
|
|
1464
1470
|
u ?? (u = X.fromNumber(0)), u = X.add([u, M]);
|
|
1465
1471
|
}
|
|
1466
1472
|
}
|
|
1467
1473
|
return u != null ? (u.amount = Math.abs(u.amount), `${X.toFormatString({
|
|
1468
1474
|
value: u,
|
|
1469
1475
|
precision: 4
|
|
1470
|
-
})} ${
|
|
1476
|
+
})} ${x.unit.abbrev}`) : null;
|
|
1471
1477
|
}
|
|
1472
|
-
const
|
|
1478
|
+
const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = { class: "flex-1 line-clamp-2" }, Zn = { class: "flex flex-col gap-32 w-full h-full" }, eo = { class: "flex items-center relative gap-4" }, to = { class: "flex-1" }, no = {
|
|
1473
1479
|
key: 0,
|
|
1474
1480
|
class: "flex-1 flex flex-col items-center gap-16"
|
|
1475
|
-
},
|
|
1481
|
+
}, oo = { class: "fm-typo-en-body-lg-400 translate-x-4" }, so = {
|
|
1476
1482
|
key: 1,
|
|
1477
1483
|
class: "flex flex-col gap-12"
|
|
1478
|
-
},
|
|
1484
|
+
}, ao = { class: "pb-16" }, ro = { class: "fm-typo-cn-body-lg-600" }, lo = {
|
|
1479
1485
|
class: "grid gap-12 fm-typo-en-body-md-400",
|
|
1480
1486
|
style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
|
|
1481
|
-
},
|
|
1487
|
+
}, io = { class: "flex flex-col gap-1" }, uo = { class: "text-fm-color-typo-secondary" }, co = { class: "font-bold" }, mo = { class: "flex flex-col gap-1" }, po = { class: "text-fm-color-typo-secondary flex" }, fo = { class: "font-bold" }, vo = { class: "flex flex-col gap-1" }, yo = { class: "text-fm-color-typo-secondary" }, _o = { class: "font-bold" }, ho = { class: "flex flex-col gap-1" }, ko = { class: "text-fm-color-typo-secondary" }, bo = { class: "font-bold" }, go = { class: "flex flex-col gap-1" }, xo = { class: "text-fm-color-typo-secondary" }, So = { class: "font-bold" }, Fo = { class: "flex flex-col gap-1" }, wo = { class: "text-fm-color-typo-secondary" }, $o = { class: "font-bold" }, Ao = { class: "flex flex-col gap-1" }, Vo = { class: "text-fm-color-typo-secondary" }, Co = { class: "font-bold" }, Mo = { class: "flex flex-col gap-1" }, Bo = { class: "text-fm-color-typo-secondary" }, Do = { class: "font-bold" }, jo = { class: "flex flex-col gap-1" }, Io = { class: "text-fm-color-typo-secondary" }, To = { class: "font-bold" }, Uo = {
|
|
1482
1488
|
key: 0,
|
|
1483
1489
|
class: "flex flex-col gap-8"
|
|
1484
|
-
},
|
|
1490
|
+
}, Eo = { class: "flex" }, Ho = { class: "flex-1 flex flex-col gap-1" }, Po = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Ro = { class: "font-bold" }, Oo = { class: "flex-1 flex flex-col gap-1" }, No = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Lo = { class: "flex flex-col gap-1" }, zo = { class: "font-bold" }, Yo = {
|
|
1485
1491
|
key: 2,
|
|
1486
1492
|
class: "flex-1 flex flex-col items-center gap-8"
|
|
1487
|
-
},
|
|
1493
|
+
}, Go = ["src"], Wo = { class: "font-bold text-lg" }, Ko = { class: "text-xs text-neutral-400 text-center" }, qo = /* @__PURE__ */ ce({
|
|
1488
1494
|
__name: "StockHistory",
|
|
1489
1495
|
props: {
|
|
1490
1496
|
sku: {},
|
|
1491
1497
|
show: { type: Boolean }
|
|
1492
1498
|
},
|
|
1493
1499
|
emits: ["update:show"],
|
|
1494
|
-
setup(
|
|
1495
|
-
const
|
|
1500
|
+
setup(v) {
|
|
1501
|
+
const x = at(), u = Re(), o = ye(), A = wn(), p = pe(), l = Ct(), { t: f } = de(), M = v, $ = N(!1), i = _e(), s = N($t(0));
|
|
1496
1502
|
async function V() {
|
|
1497
1503
|
$.value = !0;
|
|
1498
1504
|
try {
|
|
@@ -1550,16 +1556,16 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1550
1556
|
n.length && (B.value = await A.findBillsById(n).catch((a) => {
|
|
1551
1557
|
var m;
|
|
1552
1558
|
console.error("Error on using latest bill API, retrying using legacy api", a);
|
|
1553
|
-
const b = ((m =
|
|
1559
|
+
const b = ((m = x.currentBusiness.value) == null ? void 0 : m._id) ?? "", c = p.currentLocation.doc._id;
|
|
1554
1560
|
return A.findBillsByBusinessId(b, [c], n);
|
|
1555
1561
|
}));
|
|
1556
1562
|
}
|
|
1557
1563
|
const j = R(() => {
|
|
1558
1564
|
const n = k.value, a = M.sku;
|
|
1559
|
-
return
|
|
1565
|
+
return qn(n, a);
|
|
1560
1566
|
}), P = R(() => {
|
|
1561
1567
|
const n = k.value, a = M.sku;
|
|
1562
|
-
return
|
|
1568
|
+
return Xn(n, a);
|
|
1563
1569
|
}), T = R(() => {
|
|
1564
1570
|
const n = [...k.value].computeFirst((b) => {
|
|
1565
1571
|
var m, C;
|
|
@@ -1604,7 +1610,7 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1604
1610
|
{
|
|
1605
1611
|
amount: 0,
|
|
1606
1612
|
precision: 0,
|
|
1607
|
-
currency: Me((b =
|
|
1613
|
+
currency: Me((b = x.currentCountry) == null ? void 0 : b.value)
|
|
1608
1614
|
}
|
|
1609
1615
|
);
|
|
1610
1616
|
return ke(a, !1, a.precision);
|
|
@@ -1616,7 +1622,7 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1616
1622
|
endDate: a
|
|
1617
1623
|
});
|
|
1618
1624
|
}
|
|
1619
|
-
const Z = R(() => M.sku.valuation === Ke.Enum.FIFO ?
|
|
1625
|
+
const Z = R(() => M.sku.valuation === Ke.Enum.FIFO ? f("inventory.ingredient.valuationMethod.FIFO") : f("inventory.ingredient.valuationMethod.WAVG")), z = R(() => {
|
|
1620
1626
|
var H, K, ee, E;
|
|
1621
1627
|
const n = [...k.value].reverse().computeFirst((q) => {
|
|
1622
1628
|
var J, re;
|
|
@@ -1629,7 +1635,7 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1629
1635
|
}, c = a.amount, m = c.amount == 0 ? X.fromNumber(0) : X.divide([b, c]);
|
|
1630
1636
|
return {
|
|
1631
1637
|
...X.multiply([m, c]),
|
|
1632
|
-
currency: ((ee = a.cost) == null ? void 0 : ee.currency) || Me(((E =
|
|
1638
|
+
currency: ((ee = a.cost) == null ? void 0 : ee.currency) || Me(((E = x.currentCountry) == null ? void 0 : E.value) ?? Vt)
|
|
1633
1639
|
};
|
|
1634
1640
|
}), Q = R(() => {
|
|
1635
1641
|
var b;
|
|
@@ -1643,7 +1649,7 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1643
1649
|
amount: 0,
|
|
1644
1650
|
precision: 0
|
|
1645
1651
|
}),
|
|
1646
|
-
currency: Me((b =
|
|
1652
|
+
currency: Me((b = x.currentCountry) == null ? void 0 : b.value)
|
|
1647
1653
|
} : "No data";
|
|
1648
1654
|
});
|
|
1649
1655
|
function G() {
|
|
@@ -1664,9 +1670,9 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1664
1670
|
"max-width": 560
|
|
1665
1671
|
}, {
|
|
1666
1672
|
"side-sheet-header": I(() => [
|
|
1667
|
-
e("div",
|
|
1668
|
-
e("div",
|
|
1669
|
-
|
|
1673
|
+
e("div", Qn, [
|
|
1674
|
+
e("div", Jn, _(r(f)("inventory.stock.history.title", [n.sku.name])), 1),
|
|
1675
|
+
g(b, {
|
|
1670
1676
|
variant: "tertiary",
|
|
1671
1677
|
"prepend-icon": "close",
|
|
1672
1678
|
onClick: a[0] || (a[0] = (te) => d.value = !1)
|
|
@@ -1676,10 +1682,10 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1676
1682
|
default: I(() => {
|
|
1677
1683
|
var te;
|
|
1678
1684
|
return [
|
|
1679
|
-
e("div",
|
|
1680
|
-
e("div",
|
|
1681
|
-
e("div",
|
|
1682
|
-
|
|
1685
|
+
e("div", Zn, [
|
|
1686
|
+
e("div", eo, [
|
|
1687
|
+
e("div", to, [
|
|
1688
|
+
g(m, {
|
|
1683
1689
|
modelValue: s.value,
|
|
1684
1690
|
"onUpdate:modelValue": a[1] || (a[1] = (ae) => s.value = ae),
|
|
1685
1691
|
"show-predefined-range": "",
|
|
@@ -1688,7 +1694,7 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1688
1694
|
"z-index": 50
|
|
1689
1695
|
}, {
|
|
1690
1696
|
"trigger-button": I(({ opened: ae }) => [
|
|
1691
|
-
|
|
1697
|
+
g(c, {
|
|
1692
1698
|
"prepend-icon": "calendar_month",
|
|
1693
1699
|
focused: ae
|
|
1694
1700
|
}, {
|
|
@@ -1701,39 +1707,39 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1701
1707
|
_: 1
|
|
1702
1708
|
}, 8, ["modelValue"])
|
|
1703
1709
|
]),
|
|
1704
|
-
|
|
1710
|
+
g(b, {
|
|
1705
1711
|
variant: "tertiary",
|
|
1706
1712
|
onClick: a[2] || (a[2] = (ae) => U()),
|
|
1707
1713
|
"prepend-icon": "navigate_before"
|
|
1708
1714
|
}),
|
|
1709
|
-
|
|
1715
|
+
g(b, {
|
|
1710
1716
|
variant: "tertiary",
|
|
1711
1717
|
onClick: a[3] || (a[3] = (ae) => G()),
|
|
1712
1718
|
"prepend-icon": "navigate_next"
|
|
1713
1719
|
})
|
|
1714
1720
|
]),
|
|
1715
|
-
$.value ? (F(), O("div",
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
e("div",
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
])) : S.value && ((te = S.value) == null ? void 0 : te.length) > 0 ? (F(), O("div",
|
|
1722
|
-
|
|
1721
|
+
$.value ? (F(), O("div", no, [
|
|
1722
|
+
g(C),
|
|
1723
|
+
g(H, { size: "xl" }),
|
|
1724
|
+
e("div", oo, _(r(f)("inventory.stock.history.loading")), 1),
|
|
1725
|
+
g(C),
|
|
1726
|
+
g(C)
|
|
1727
|
+
])) : S.value && ((te = S.value) == null ? void 0 : te.length) > 0 ? (F(), O("div", so, [
|
|
1728
|
+
g(re, { variant: "outlined" }, {
|
|
1723
1729
|
default: I(() => [
|
|
1724
|
-
|
|
1730
|
+
g(J, { class: "flex flex-col gap-4" }, {
|
|
1725
1731
|
default: I(() => [
|
|
1726
|
-
e("div",
|
|
1727
|
-
e("div",
|
|
1732
|
+
e("div", ao, [
|
|
1733
|
+
e("div", ro, _(r(f)("inventory.stock.history.summary.title")), 1)
|
|
1728
1734
|
]),
|
|
1729
|
-
e("div",
|
|
1730
|
-
e("div",
|
|
1731
|
-
e("div",
|
|
1732
|
-
e("div",
|
|
1735
|
+
e("div", lo, [
|
|
1736
|
+
e("div", io, [
|
|
1737
|
+
e("div", uo, _(r(f)("inventory.stock.history.summary.totalPurchase")), 1),
|
|
1738
|
+
e("div", co, _(j.value.PURCHASE), 1)
|
|
1733
1739
|
]),
|
|
1734
|
-
e("div",
|
|
1735
|
-
e("div",
|
|
1736
|
-
ue(_(r(
|
|
1740
|
+
e("div", mo, [
|
|
1741
|
+
e("div", po, [
|
|
1742
|
+
ue(_(r(f)("inventory.stock.history.summary.totalSales")) + " ", 1),
|
|
1737
1743
|
P.value != null ? (F(), L(ee, {
|
|
1738
1744
|
key: 0,
|
|
1739
1745
|
variant: "plain",
|
|
@@ -1742,7 +1748,7 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1742
1748
|
"z-index": 50
|
|
1743
1749
|
}, {
|
|
1744
1750
|
default: I(() => [
|
|
1745
|
-
|
|
1751
|
+
g(K, {
|
|
1746
1752
|
name: "warning",
|
|
1747
1753
|
size: "sm"
|
|
1748
1754
|
})
|
|
@@ -1750,53 +1756,53 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1750
1756
|
_: 1
|
|
1751
1757
|
}, 8, ["content"])) : se("", !0)
|
|
1752
1758
|
]),
|
|
1753
|
-
e("div",
|
|
1759
|
+
e("div", fo, _(j.value.SALES), 1)
|
|
1754
1760
|
]),
|
|
1755
1761
|
e("div", vo, [
|
|
1756
|
-
e("div",
|
|
1757
|
-
e("div",
|
|
1762
|
+
e("div", yo, _(r(f)("inventory.stock.history.summary.totalLose")), 1),
|
|
1763
|
+
e("div", _o, _(j.value.LOSE), 1)
|
|
1758
1764
|
]),
|
|
1759
|
-
e("div",
|
|
1760
|
-
e("div",
|
|
1761
|
-
e("div",
|
|
1765
|
+
e("div", ho, [
|
|
1766
|
+
e("div", ko, _(r(f)("inventory.stock.history.summary.totalRequest")), 1),
|
|
1767
|
+
e("div", bo, _(j.value.REQUEST), 1)
|
|
1762
1768
|
]),
|
|
1763
|
-
e("div",
|
|
1764
|
-
e("div",
|
|
1765
|
-
e("div",
|
|
1769
|
+
e("div", go, [
|
|
1770
|
+
e("div", xo, _(r(f)("inventory.stock.history.summary.totalReceive")), 1),
|
|
1771
|
+
e("div", So, _(j.value.RECEIVE), 1)
|
|
1766
1772
|
]),
|
|
1767
|
-
e("div",
|
|
1768
|
-
e("div",
|
|
1769
|
-
e("div",
|
|
1773
|
+
e("div", Fo, [
|
|
1774
|
+
e("div", wo, _(r(f)("inventory.stock.history.summary.totalConvert")), 1),
|
|
1775
|
+
e("div", $o, _(j.value.CONVERT), 1)
|
|
1770
1776
|
]),
|
|
1771
|
-
e("div",
|
|
1772
|
-
e("div",
|
|
1773
|
-
e("div",
|
|
1777
|
+
e("div", Ao, [
|
|
1778
|
+
e("div", Vo, _(r(f)("inventory.stock.history.summary.totalDamage")), 1),
|
|
1779
|
+
e("div", Co, _(j.value.DAMAGE), 1)
|
|
1774
1780
|
]),
|
|
1775
|
-
e("div",
|
|
1776
|
-
e("div",
|
|
1777
|
-
e("div",
|
|
1781
|
+
e("div", Mo, [
|
|
1782
|
+
e("div", Bo, _(r(f)("inventory.stock.history.summary.openingBalance")), 1),
|
|
1783
|
+
e("div", Do, _(T.value), 1)
|
|
1778
1784
|
]),
|
|
1779
|
-
e("div",
|
|
1780
|
-
e("div",
|
|
1781
|
-
e("div",
|
|
1785
|
+
e("div", jo, [
|
|
1786
|
+
e("div", Io, _(r(f)("inventory.stock.history.summary.lastStockBalance")), 1),
|
|
1787
|
+
e("div", To, _(Y.value), 1)
|
|
1782
1788
|
])
|
|
1783
1789
|
]),
|
|
1784
|
-
r(l).enableTotalCost ? (F(), O("div",
|
|
1785
|
-
|
|
1786
|
-
e("div",
|
|
1787
|
-
e("div",
|
|
1788
|
-
|
|
1790
|
+
r(l).enableTotalCost ? (F(), O("div", Uo, [
|
|
1791
|
+
g(E, { class: "w-full" }),
|
|
1792
|
+
e("div", Eo, [
|
|
1793
|
+
e("div", Ho, [
|
|
1794
|
+
g(Xe, { "z-index": 50 }, {
|
|
1789
1795
|
default: I(() => [
|
|
1790
|
-
e("div",
|
|
1791
|
-
ue(_(r(
|
|
1792
|
-
|
|
1796
|
+
e("div", Po, [
|
|
1797
|
+
ue(_(r(f)("inventory.stock.history.estimatedValue")) + " ", 1),
|
|
1798
|
+
g(ee, {
|
|
1793
1799
|
variant: "plain",
|
|
1794
1800
|
placement: "top",
|
|
1795
|
-
content: `[${Z.value}] ${r(
|
|
1801
|
+
content: `[${Z.value}] ${r(f)("inventory.stock.history.estimatedValueTooltip")}`,
|
|
1796
1802
|
"z-index": 50
|
|
1797
1803
|
}, {
|
|
1798
1804
|
default: I(() => [
|
|
1799
|
-
|
|
1805
|
+
g(K, {
|
|
1800
1806
|
name: "help",
|
|
1801
1807
|
size: "sm"
|
|
1802
1808
|
})
|
|
@@ -1807,9 +1813,9 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1807
1813
|
]),
|
|
1808
1814
|
_: 1
|
|
1809
1815
|
}),
|
|
1810
|
-
e("div",
|
|
1816
|
+
e("div", Ro, [
|
|
1811
1817
|
n.sku.valuation === r(Ke).Enum.FIFO ? (F(), O(ne, { key: 0 }, [
|
|
1812
|
-
|
|
1818
|
+
g(q, {
|
|
1813
1819
|
label: "FIFO",
|
|
1814
1820
|
compact: ""
|
|
1815
1821
|
}),
|
|
@@ -1827,21 +1833,21 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1827
1833
|
], 64))
|
|
1828
1834
|
])
|
|
1829
1835
|
]),
|
|
1830
|
-
e("div",
|
|
1831
|
-
|
|
1836
|
+
e("div", Oo, [
|
|
1837
|
+
g(Xe, { "z-index": 50 }, {
|
|
1832
1838
|
default: I(() => [
|
|
1833
|
-
e("div",
|
|
1834
|
-
ue(_(r(
|
|
1835
|
-
|
|
1839
|
+
e("div", No, [
|
|
1840
|
+
ue(_(r(f)("inventory.stock.history.costSold")) + " ", 1),
|
|
1841
|
+
g(ee, {
|
|
1836
1842
|
variant: "plain",
|
|
1837
1843
|
placement: "top",
|
|
1838
1844
|
"z-index": 50
|
|
1839
1845
|
}, {
|
|
1840
1846
|
content: I(() => [
|
|
1841
|
-
e("div",
|
|
1847
|
+
e("div", Lo, _(r(f)("inventory.stock.history.costSoldTooltip")), 1)
|
|
1842
1848
|
]),
|
|
1843
1849
|
default: I(() => [
|
|
1844
|
-
|
|
1850
|
+
g(K, {
|
|
1845
1851
|
name: "help",
|
|
1846
1852
|
size: "sm"
|
|
1847
1853
|
})
|
|
@@ -1852,7 +1858,7 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1852
1858
|
]),
|
|
1853
1859
|
_: 1
|
|
1854
1860
|
}),
|
|
1855
|
-
e("div",
|
|
1861
|
+
e("div", zo, _(W.value), 1)
|
|
1856
1862
|
])
|
|
1857
1863
|
])
|
|
1858
1864
|
])) : se("", !0)
|
|
@@ -1866,7 +1872,7 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1866
1872
|
(F(!0), O(ne, null, le(S.value, (ae) => (F(), O(ne, {
|
|
1867
1873
|
key: ae.date
|
|
1868
1874
|
}, [
|
|
1869
|
-
n.sku ? (F(), L(
|
|
1875
|
+
n.sku ? (F(), L(Kn, {
|
|
1870
1876
|
key: 0,
|
|
1871
1877
|
record: ae,
|
|
1872
1878
|
sku: n.sku,
|
|
@@ -1874,18 +1880,18 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1874
1880
|
onRefreshHistory: V
|
|
1875
1881
|
}, null, 8, ["record", "sku", "bills"])) : se("", !0)
|
|
1876
1882
|
], 64))), 128))
|
|
1877
|
-
])) : (F(), O("div",
|
|
1878
|
-
|
|
1883
|
+
])) : (F(), O("div", Yo, [
|
|
1884
|
+
g(C),
|
|
1879
1885
|
e("div", null, [
|
|
1880
1886
|
e("img", {
|
|
1881
1887
|
src: r(Yt),
|
|
1882
1888
|
alt: "List is empty"
|
|
1883
|
-
}, null, 8,
|
|
1889
|
+
}, null, 8, Go)
|
|
1884
1890
|
]),
|
|
1885
|
-
e("div",
|
|
1886
|
-
e("div",
|
|
1887
|
-
|
|
1888
|
-
|
|
1891
|
+
e("div", Wo, _(r(f)("inventory.stock.history.noRecords")), 1),
|
|
1892
|
+
e("div", Ko, _(r(f)("inventory.stock.history.changeDateRange")), 1),
|
|
1893
|
+
g(C),
|
|
1894
|
+
g(C)
|
|
1889
1895
|
]))
|
|
1890
1896
|
])
|
|
1891
1897
|
];
|
|
@@ -1894,10 +1900,10 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1894
1900
|
}, 8, ["modelValue"]);
|
|
1895
1901
|
};
|
|
1896
1902
|
}
|
|
1897
|
-
}),
|
|
1903
|
+
}), Xo = { class: "flex flex-col gap-8" }, Qo = { class: "flex flex-col" }, Jo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Zo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, vs = /* @__PURE__ */ ce({
|
|
1898
1904
|
__name: "StockView",
|
|
1899
|
-
setup(
|
|
1900
|
-
const { t:
|
|
1905
|
+
setup(v) {
|
|
1906
|
+
const { t: x } = de(), u = Pe(), o = pe(), A = Re(), p = lt(), l = ye(), f = nt(), { columnDefs: M } = Zt(), $ = Oe();
|
|
1901
1907
|
o.watchLocation(k);
|
|
1902
1908
|
const i = N(!1), s = _e();
|
|
1903
1909
|
async function V() {
|
|
@@ -1905,11 +1911,11 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1905
1911
|
title: "Are you sure you want to refresh the stock balance?",
|
|
1906
1912
|
closeButton: !0,
|
|
1907
1913
|
primaryActions: {
|
|
1908
|
-
text:
|
|
1914
|
+
text: x("common.confirm"),
|
|
1909
1915
|
close: !0
|
|
1910
1916
|
},
|
|
1911
1917
|
secondaryActions: {
|
|
1912
|
-
text:
|
|
1918
|
+
text: x("common.close"),
|
|
1913
1919
|
close: !0,
|
|
1914
1920
|
variant: "tertiary"
|
|
1915
1921
|
}
|
|
@@ -1925,11 +1931,11 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1925
1931
|
if (o._currentLocation) {
|
|
1926
1932
|
i.value = !0;
|
|
1927
1933
|
try {
|
|
1928
|
-
await A.readStockBalance(), await A.readProductBalance(), await
|
|
1934
|
+
await A.readStockBalance(), await A.readProductBalance(), await f.readStockEstimateBalance();
|
|
1929
1935
|
} catch (T) {
|
|
1930
1936
|
s.open({
|
|
1931
|
-
title:
|
|
1932
|
-
message:
|
|
1937
|
+
title: x("inventory.stock.error.title"),
|
|
1938
|
+
message: x("inventory.stock.error.message"),
|
|
1933
1939
|
type: "error"
|
|
1934
1940
|
}), console.error("error on fetch stock balance", T);
|
|
1935
1941
|
} finally {
|
|
@@ -1943,7 +1949,7 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1943
1949
|
const Y = T.trackingMeasurement;
|
|
1944
1950
|
let W = (Q = (z = A.stockBalance.skus) == null ? void 0 : z.find(
|
|
1945
1951
|
(d) => d.id === T._id
|
|
1946
|
-
)) == null ? void 0 : Q.balance, U =
|
|
1952
|
+
)) == null ? void 0 : Q.balance, U = f.inventoryForecast.skus.find(
|
|
1947
1953
|
(d) => d.id === T._id
|
|
1948
1954
|
);
|
|
1949
1955
|
return {
|
|
@@ -1958,17 +1964,17 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1958
1964
|
})
|
|
1959
1965
|
), B = N(""), { breakpoints: h } = Ot(), t = R(() => h.value.xs || h.value.sm), y = R(() => t.value ? 10 : 20), w = Tt(), j = R(() => [
|
|
1960
1966
|
{
|
|
1961
|
-
label:
|
|
1967
|
+
label: x("inventory.stock.stock_balance.refreshBalance"),
|
|
1962
1968
|
value: "refresh-balance",
|
|
1963
1969
|
isPrimary: !0,
|
|
1964
1970
|
prependIcon: "calculate"
|
|
1965
1971
|
},
|
|
1966
1972
|
{
|
|
1967
|
-
label:
|
|
1973
|
+
label: x("inventory.common.refresh"),
|
|
1968
1974
|
value: "refresh"
|
|
1969
1975
|
},
|
|
1970
1976
|
{
|
|
1971
|
-
label:
|
|
1977
|
+
label: x("inventory.common.export"),
|
|
1972
1978
|
value: "export"
|
|
1973
1979
|
}
|
|
1974
1980
|
]);
|
|
@@ -1979,13 +1985,13 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1979
1985
|
case "refresh":
|
|
1980
1986
|
return k();
|
|
1981
1987
|
case "export":
|
|
1982
|
-
return
|
|
1988
|
+
return qt(S.value);
|
|
1983
1989
|
}
|
|
1984
1990
|
}
|
|
1985
1991
|
return (T, Y) => {
|
|
1986
1992
|
const W = D("FmTable");
|
|
1987
1993
|
return F(), L(Ut, {
|
|
1988
|
-
title: r(
|
|
1994
|
+
title: r(x)("inventory.stock.title"),
|
|
1989
1995
|
actions: j.value,
|
|
1990
1996
|
"onClick:action": P
|
|
1991
1997
|
}, {
|
|
@@ -2001,7 +2007,7 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
2001
2007
|
}
|
|
2002
2008
|
])
|
|
2003
2009
|
}, [
|
|
2004
|
-
|
|
2010
|
+
g(Et, {
|
|
2005
2011
|
searchable: "",
|
|
2006
2012
|
"change-location": "",
|
|
2007
2013
|
search: B.value,
|
|
@@ -2018,35 +2024,35 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
2018
2024
|
"page-size": y.value
|
|
2019
2025
|
}, {
|
|
2020
2026
|
"list-row": I((G) => [
|
|
2021
|
-
|
|
2027
|
+
g(Ht, {
|
|
2022
2028
|
row: G,
|
|
2023
2029
|
onRowClick: r(p).showSkuHistory
|
|
2024
2030
|
}, {
|
|
2025
2031
|
default: I((d) => {
|
|
2026
2032
|
var n, a, b, c, m, C, H, K, ee, E;
|
|
2027
2033
|
return [
|
|
2028
|
-
e("div",
|
|
2029
|
-
e("div",
|
|
2030
|
-
e("div",
|
|
2031
|
-
|
|
2034
|
+
e("div", Xo, [
|
|
2035
|
+
e("div", Qo, [
|
|
2036
|
+
e("div", Jo, [
|
|
2037
|
+
g(r(qe), {
|
|
2032
2038
|
render: (b = (a = (n = d.code) == null ? void 0 : n.column) == null ? void 0 : a.columnDef) == null ? void 0 : b.cell,
|
|
2033
2039
|
props: (m = (c = d.code) == null ? void 0 : c.getContext) == null ? void 0 : m.call(c)
|
|
2034
2040
|
}, null, 8, ["render", "props"])
|
|
2035
2041
|
]),
|
|
2036
|
-
e("div",
|
|
2037
|
-
|
|
2042
|
+
e("div", Zo, [
|
|
2043
|
+
g(r(qe), {
|
|
2038
2044
|
render: (K = (H = (C = d.name) == null ? void 0 : C.column) == null ? void 0 : H.columnDef) == null ? void 0 : K.cell,
|
|
2039
2045
|
props: (E = (ee = d.name) == null ? void 0 : ee.getContext) == null ? void 0 : E.call(ee)
|
|
2040
2046
|
}, null, 8, ["render", "props"])
|
|
2041
2047
|
])
|
|
2042
2048
|
]),
|
|
2043
2049
|
e("div", null, [
|
|
2044
|
-
|
|
2050
|
+
g(Te, {
|
|
2045
2051
|
days: G.original.day
|
|
2046
2052
|
}, null, 8, ["days"])
|
|
2047
2053
|
]),
|
|
2048
2054
|
e("div", null, [
|
|
2049
|
-
|
|
2055
|
+
g(rt, {
|
|
2050
2056
|
class: "xs:w-[160px]",
|
|
2051
2057
|
unit: G.original.unit,
|
|
2052
2058
|
sku: G.original,
|
|
@@ -2064,9 +2070,9 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
2064
2070
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
2065
2071
|
], 2),
|
|
2066
2072
|
(F(), L(ct, { to: "body" }, [
|
|
2067
|
-
(Z = r(p).stockHistoryProps) != null && Z.sku ? (F(), L(
|
|
2073
|
+
(Z = r(p).stockHistoryProps) != null && Z.sku ? (F(), L(qo, Ae(Ve({ key: 0 }, r(p).stockHistoryProps)), null, 16)) : se("", !0),
|
|
2068
2074
|
(z = r(p).convertSkuDialogProps) != null && z.sku ? (F(), L(vn, Ae(Ve({ key: 1 }, r(p).convertSkuDialogProps)), null, 16)) : se("", !0),
|
|
2069
|
-
(Q = r(p).adjustSkuDialogProps) != null && Q.stock ? (F(), L(
|
|
2075
|
+
(Q = r(p).adjustSkuDialogProps) != null && Q.stock ? (F(), L(Fn, Ae(Ve({ key: 2 }, r(p).adjustSkuDialogProps)), null, 16)) : se("", !0)
|
|
2070
2076
|
]))
|
|
2071
2077
|
];
|
|
2072
2078
|
}),
|
|
@@ -2076,5 +2082,5 @@ const Xn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
2076
2082
|
}
|
|
2077
2083
|
});
|
|
2078
2084
|
export {
|
|
2079
|
-
|
|
2085
|
+
vs as default
|
|
2080
2086
|
};
|