@feedmepos/mf-inventory-portal 1.2.8 → 1.2.10-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-D1IJlQS8.js → App-Bg2M5RwP.js} +1 -1
- package/dist/{ApprovalView-GnDYWZHY.js → ApprovalView-C46UDXnc.js} +24 -24
- package/dist/{BindingsDialog-Bs00N9mp.js → BindingsDialog-CtJjpbw-.js} +2 -2
- package/dist/{BindingsPicker-LO15pMdZ.js → BindingsPicker-B6Er5Lea.js} +1 -1
- package/dist/{BindingsTable-g27KG9q4.js → BindingsTable-MPeTr_ip.js} +1 -1
- package/dist/{ClosingDraftView-Ddsgcrmg.js → ClosingDraftView-BaD3MLeG.js} +33 -33
- package/dist/{ClosingTemplateView-G8Ya81UZ.js → ClosingTemplateView-C4z3GXwd.js} +3 -3
- package/dist/{DeliveryOrderPrintPreview-qq1rhFKV.js → DeliveryOrderPrintPreview-BfafKFMa.js} +8 -8
- package/dist/{FmAdminBadge-B2NpMmJi.js → FmAdminBadge-Dg5rl1fj.js} +4 -4
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C1i9CHE1.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BATVvC9u.js} +11 -11
- package/dist/{FmMultiselectDialog-u2dbuZUp.js → FmMultiselectDialog-DJ-dIe8C.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-vpiiv6C1.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BBWaPrlm.js} +38 -38
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-3T-d1pIb.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-oaujHoaU.js} +1 -1
- package/dist/{IngredientGroupView-CqB73-e4.js → IngredientGroupView-u4ubHtNF.js} +15 -15
- package/dist/{IngredientsView-Cq42ytcN.js → IngredientsView-CXbJifY6.js} +766 -744
- package/dist/{IntegrationView-OHnUGZst.js → IntegrationView-XEypfcAW.js} +137 -137
- package/dist/{InventoryBindingForm-DorgxR-Y.js → InventoryBindingForm-CETOb5Nj.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CZy77tY7.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DC52GJ2Y.js} +22 -22
- package/dist/{InventoryBindingSummary-B_YavyPb.js → InventoryBindingSummary-DbyJW8z0.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-XuEDo134.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BQWWQxaq.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Blq1oE5l.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BruydtsG.js} +9 -9
- package/dist/{PublishView-Ds_ztGcV.js → PublishView-Cl3IluMR.js} +12 -12
- package/dist/{PurchaseOrderPrintPreview-DnyqN_xE.js → PurchaseOrderPrintPreview-BG_uBL4o.js} +7 -7
- package/dist/{ReceiveRequestView-ChpKsDaF.js → ReceiveRequestView-BvGlUVTp.js} +191 -191
- package/dist/{RecipeView-Dyp9Xcme.js → RecipeView-C-7XU5F8.js} +12 -12
- package/dist/{StockView-D-iP52Zw.js → StockView-rYhlg4fr.js} +680 -665
- package/dist/SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-D0kASPO9.js +158 -0
- package/dist/{SupplierView-BaEK3C8q.js → SupplierView-BoGoqUS-.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B_ravTwn.js → TransferDetails.vue_vue_type_script_setup_true_lang-D53vhWDq.js} +6 -6
- package/dist/{TransferTemplateView-3zS7hNZz.js → TransferTemplateView-DZIDXFp7.js} +143 -143
- package/dist/{UnitView-BP5eztAG.js → UnitView-CvHIFkue.js} +27 -27
- package/dist/{WarehouseView-DMY7Lgwq.js → WarehouseView-Dh_WZz5L.js} +18 -18
- package/dist/{app-P6XaUzjP.js → app-BT34Yv61.js} +8968 -8917
- package/dist/app.d.ts +6 -6
- package/dist/app.js +4 -4
- package/dist/{closing-template-BGYZPBty.js → closing-template-JDCk0_lU.js} +1 -1
- package/dist/{decimal-wz5HXhQ8.js → decimal-BTgTm2JD.js} +1 -1
- package/dist/{format-unit-display-DOOJqLop.js → format-unit-display-HHCA1rN3.js} +48 -48
- package/dist/{index-oR0svfBM.js → index-Bz_lEYOD.js} +1 -1
- package/dist/{index-CHTB43Wl.js → index-CdamrmzX.js} +1 -1
- package/dist/{purchase-order-template-BGunGekw.js → purchase-order-template-DJiYiY6t.js} +1 -1
- package/dist/{stock-TJayQnag.js → stock-C8afHO4C.js} +1 -1
- package/dist/stores/integration/netsuite.d.ts +1 -0
- package/dist/{supplier-C_vqpE92.js → supplier-C8RMKqQX.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-CIahwuTX.js → use-ingredient-select-dialog-fLK9yq-0.js} +1 -1
- package/dist/{use-inventory-binding-dialog-BiKRXVhY.js → use-inventory-binding-dialog--7tzpXgV.js} +1 -1
- package/dist/views/ingredients/components/ingredient-dialog/IngredientDialogProps.d.ts +1 -1
- package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +2 -0
- package/package.json +2 -2
- package/dist/StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js +0 -59
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as ce, ref as N, computed as P, resolveComponent as j, openBlock as
|
|
2
|
-
import { u as pe,
|
|
3
|
-
import { u as Re, a as ye } from "./stock-
|
|
4
|
-
import { g as we } from "./decimal-
|
|
5
|
-
import { e as Rt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-
|
|
6
|
-
import { _ as Te, S as Me, g as st } from "./
|
|
7
|
-
import { _ as
|
|
1
|
+
import { defineComponent as ce, ref as N, computed as P, resolveComponent as j, openBlock as S, createBlock as z, withCtx as I, createElementVNode as e, normalizeClass as ge, toDisplayString as _, createVNode as g, createElementBlock as R, Fragment as te, renderList as ie, unref as i, h as be, watch as xe, isRef as Ue, createCommentVNode as oe, 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, a1 as dt, f as He, h as mt, a as Pe, F as Ge, a2 as pt, w as Ie, k as me, Y as ft, t as Se, a0 as Fe, A as vt, M as yt, $ as ve, a3 as _t, a4 as se, a5 as bt, a6 as Ke, o as kt, s as ht, a7 as gt, a8 as xt, a9 as St, aa as Ce, ab as Ft, ac as et, Z as q, ad as wt, z as tt, ae as ke, af as $t, ag as At, q as Be, n as We, r as Vt, c as Ct, ah as Bt, ai as Mt, aj as Dt, ak as jt, al as It, b as Tt, K as Ut, L as Et, O as Ht, P as Pt, Q as qe } from "./app-BT34Yv61.js";
|
|
3
|
+
import { u as Re, a as ye } from "./stock-C8afHO4C.js";
|
|
4
|
+
import { g as we } from "./decimal-BTgTm2JD.js";
|
|
5
|
+
import { e as Rt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BruydtsG.js";
|
|
6
|
+
import { _ as Te, S as Me, g as st, a as Ot } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-D0kASPO9.js";
|
|
7
|
+
import { _ as Nt } 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
|
-
import { useSnackbar as _e, useDialog as Oe, useProxiedModel as Ne, useBreakpoints as
|
|
10
|
-
import { defineStore as
|
|
11
|
-
import { u as
|
|
12
|
-
import { _ as
|
|
13
|
-
import { E as
|
|
14
|
-
import { F as
|
|
9
|
+
import { useSnackbar as _e, useDialog as Oe, useProxiedModel as Ne, useBreakpoints as Lt } from "@feedmepos/ui-library";
|
|
10
|
+
import { defineStore as zt } from "pinia";
|
|
11
|
+
import { u as Yt } from "./use-inventory-binding-dialog--7tzpXgV.js";
|
|
12
|
+
import { _ as Gt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BQWWQxaq.js";
|
|
13
|
+
import { E as Kt } from "./empty-placeholder-wf6-BWE8.js";
|
|
14
|
+
import { F as Wt } from "./FmAdminBadge-Dg5rl1fj.js";
|
|
15
15
|
import "./array-Ca8T3f_G.js";
|
|
16
|
-
var he = /* @__PURE__ */ ((
|
|
17
|
-
const
|
|
16
|
+
var he = /* @__PURE__ */ ((b) => (b.History = "History", b.Convert = "Convert", b.Adjust = "Adjust", b))(he || {});
|
|
17
|
+
const qt = [
|
|
18
18
|
{
|
|
19
19
|
translationKey: "inventory.stock.action.history",
|
|
20
20
|
color: "text-neutral-700",
|
|
21
21
|
value: "History"
|
|
22
22
|
/* History */
|
|
23
23
|
}
|
|
24
|
-
],
|
|
24
|
+
], Xt = [
|
|
25
25
|
{
|
|
26
26
|
translationKey: "inventory.stock.action.history",
|
|
27
27
|
color: "text-neutral-700",
|
|
@@ -41,7 +41,7 @@ const Wt = [
|
|
|
41
41
|
/* Adjust */
|
|
42
42
|
}
|
|
43
43
|
];
|
|
44
|
-
async function
|
|
44
|
+
async function Qt(b) {
|
|
45
45
|
const c = `${(pe().currentLocation.name || "").replace(
|
|
46
46
|
/ /g,
|
|
47
47
|
"_"
|
|
@@ -50,7 +50,7 @@ async function Xt(_) {
|
|
|
50
50
|
[
|
|
51
51
|
{
|
|
52
52
|
name: "stock",
|
|
53
|
-
data:
|
|
53
|
+
data: b,
|
|
54
54
|
columns: [
|
|
55
55
|
{
|
|
56
56
|
name: "Code",
|
|
@@ -62,17 +62,17 @@ async function Xt(_) {
|
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
name: "Balance",
|
|
65
|
-
selector: (
|
|
66
|
-
const A = $e(
|
|
67
|
-
return A.type === "unit" ? we(
|
|
65
|
+
selector: (o) => {
|
|
66
|
+
const A = $e(o, o.unit);
|
|
67
|
+
return A.type === "unit" ? we(o.balance, o.unit, null, !1) : we(o.balance, o.unit, A.measurement, !1);
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
name: "Unit",
|
|
72
|
-
selector: (
|
|
73
|
-
var
|
|
74
|
-
const A = $e(
|
|
75
|
-
return A.type === "unit" ?
|
|
72
|
+
selector: (o) => {
|
|
73
|
+
var p;
|
|
74
|
+
const A = $e(o, o.unit);
|
|
75
|
+
return A.type === "unit" ? o.unit.abbrev : ((p = o.unit.measurements.find((m) => m.id === A.measurement)) == null ? void 0 : p.abbrev) || "";
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
]
|
|
@@ -81,18 +81,18 @@ async function Xt(_) {
|
|
|
81
81
|
c
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
|
-
function $e(
|
|
85
|
-
const c = localStorage.getItem(`uom:${
|
|
84
|
+
function $e(b, h) {
|
|
85
|
+
const c = localStorage.getItem(`uom:${b._id}`);
|
|
86
86
|
return c ? c === h._id ? {
|
|
87
87
|
type: "unit"
|
|
88
|
-
} : h.measurements.find((
|
|
88
|
+
} : h.measurements.find((o) => o.id === c) ? {
|
|
89
89
|
type: "measurement",
|
|
90
90
|
measurement: c
|
|
91
91
|
} : {
|
|
92
92
|
type: "unit"
|
|
93
|
-
} :
|
|
93
|
+
} : b.trackingMeasurement && h.measurements.find((o) => o.id === b.trackingMeasurement) ? {
|
|
94
94
|
type: "measurement",
|
|
95
|
-
measurement:
|
|
95
|
+
measurement: b.trackingMeasurement
|
|
96
96
|
} : {
|
|
97
97
|
type: "unit"
|
|
98
98
|
};
|
|
@@ -105,62 +105,62 @@ const Jt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
105
105
|
amount: {},
|
|
106
106
|
defaultTrackingMeasurement: {}
|
|
107
107
|
},
|
|
108
|
-
setup(
|
|
108
|
+
setup(b) {
|
|
109
109
|
function h(C) {
|
|
110
110
|
return `uom:${C._id}`;
|
|
111
111
|
}
|
|
112
112
|
function c(C) {
|
|
113
|
-
const l = h(
|
|
114
|
-
C ? localStorage.setItem(l, C) : localStorage.setItem(l,
|
|
113
|
+
const l = h(o.sku);
|
|
114
|
+
C ? localStorage.setItem(l, C) : localStorage.setItem(l, o.unit._id), A.value = $e(o.sku, o.unit);
|
|
115
115
|
}
|
|
116
|
-
const
|
|
117
|
-
const { measurements: C } =
|
|
116
|
+
const o = b, A = N($e(o.sku, o.unit)), p = P(() => {
|
|
117
|
+
const { measurements: C } = o.unit;
|
|
118
118
|
return [
|
|
119
119
|
{
|
|
120
|
-
label: `${we(
|
|
120
|
+
label: `${we(o.amount, o.unit)}`,
|
|
121
121
|
value: null
|
|
122
122
|
},
|
|
123
123
|
...C.map(({ id: l }) => ({
|
|
124
|
-
label: `${we(
|
|
124
|
+
label: `${we(o.amount, o.unit, l)}`,
|
|
125
125
|
value: l
|
|
126
126
|
}))
|
|
127
127
|
];
|
|
128
128
|
});
|
|
129
|
-
function
|
|
129
|
+
function m({ value: C }) {
|
|
130
130
|
return i(A).type === "unit" ? C === null : C === i(A).measurement;
|
|
131
131
|
}
|
|
132
132
|
const v = P(
|
|
133
133
|
() => {
|
|
134
134
|
var C;
|
|
135
|
-
return ((C =
|
|
135
|
+
return ((C = p.value.find((l) => m(l))) == null ? void 0 : C.label) ?? "";
|
|
136
136
|
}
|
|
137
|
-
),
|
|
137
|
+
), F = N(!1);
|
|
138
138
|
return (C, l) => {
|
|
139
|
-
const
|
|
140
|
-
return
|
|
139
|
+
const s = j("FmIcon"), y = j("FmMenuItem"), B = j("FmMenu");
|
|
140
|
+
return S(), z(B, {
|
|
141
141
|
"stop-click-propagation": "",
|
|
142
|
-
onMenuChanged: l[0] || (l[0] = (w) =>
|
|
142
|
+
onMenuChanged: l[0] || (l[0] = (w) => F.value = w)
|
|
143
143
|
}, {
|
|
144
144
|
"menu-button": I(() => [
|
|
145
145
|
e("button", {
|
|
146
146
|
type: "button",
|
|
147
147
|
class: ge([
|
|
148
148
|
"w-full text-left flex items-center gap-8 cursor-pointer fm-corner-radius-sm px-8 py-4 border bg-white",
|
|
149
|
-
|
|
149
|
+
F.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
|
|
150
150
|
])
|
|
151
151
|
}, [
|
|
152
|
-
e("div", Jt,
|
|
153
|
-
g(
|
|
152
|
+
e("div", Jt, _(v.value), 1),
|
|
153
|
+
g(s, {
|
|
154
154
|
class: "text-fm-color-neutral-gray-400",
|
|
155
155
|
name: "expand_more"
|
|
156
156
|
})
|
|
157
157
|
], 2)
|
|
158
158
|
]),
|
|
159
159
|
default: I(() => [
|
|
160
|
-
(
|
|
160
|
+
(S(!0), R(te, null, ie(p.value, (w) => (S(), z(y, {
|
|
161
161
|
key: w.value ?? 0,
|
|
162
162
|
label: w.label,
|
|
163
|
-
"model-value":
|
|
163
|
+
"model-value": m(w),
|
|
164
164
|
onClick: ($) => c(w.value)
|
|
165
165
|
}, null, 8, ["label", "model-value", "onClick"]))), 128))
|
|
166
166
|
]),
|
|
@@ -168,60 +168,60 @@ const Jt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
168
168
|
});
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
}),
|
|
171
|
+
}), Zt = { class: "whitespace-nowrap" }, en = /* @__PURE__ */ ce({
|
|
172
172
|
__name: "StockHeaderPreview",
|
|
173
|
-
setup(
|
|
173
|
+
setup(b) {
|
|
174
174
|
const { t: h } = de();
|
|
175
|
-
return (c,
|
|
175
|
+
return (c, o) => (S(), z(Nt, null, {
|
|
176
176
|
default: I(() => [
|
|
177
|
-
e("div",
|
|
177
|
+
e("div", Zt, _(i(h)("inventory.stock.prediction.daysRemaining")), 1)
|
|
178
178
|
]),
|
|
179
179
|
_: 1
|
|
180
180
|
}));
|
|
181
181
|
}
|
|
182
|
-
}), rt =
|
|
183
|
-
const
|
|
182
|
+
}), rt = zt("stockActions", () => {
|
|
183
|
+
const b = N(!1), h = pe(), c = Re(), o = nt(), A = _e(), p = Oe(), { t: m } = de();
|
|
184
184
|
async function v() {
|
|
185
185
|
if (h._currentLocation) {
|
|
186
|
-
|
|
186
|
+
b.value = !0;
|
|
187
187
|
try {
|
|
188
|
-
await c.readStockBalance(), await c.readProductBalance(), await
|
|
188
|
+
await c.readStockBalance(), await c.readProductBalance(), await o.readStockEstimateBalance();
|
|
189
189
|
} catch {
|
|
190
190
|
A.open({
|
|
191
|
-
title:
|
|
192
|
-
message:
|
|
191
|
+
title: m("inventory.stock.error.title"),
|
|
192
|
+
message: m("inventory.stock.error.message"),
|
|
193
193
|
type: "error"
|
|
194
194
|
});
|
|
195
195
|
} finally {
|
|
196
|
-
|
|
196
|
+
b.value = !1;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
const
|
|
200
|
+
const F = N();
|
|
201
201
|
async function C($) {
|
|
202
202
|
var M, D, H;
|
|
203
203
|
if (!!!((D = (M = $.convert) == null ? void 0 : M.inventoryBindings) != null && D.length)) {
|
|
204
|
-
|
|
205
|
-
title:
|
|
206
|
-
message:
|
|
204
|
+
p.open({
|
|
205
|
+
title: m("inventory.stock.error.convert.title"),
|
|
206
|
+
message: m("inventory.stock.error.convert.message")
|
|
207
207
|
});
|
|
208
208
|
return;
|
|
209
209
|
}
|
|
210
|
-
const
|
|
211
|
-
maxCount: ((H = c.productBalance.find(({ id:
|
|
210
|
+
const x = {
|
|
211
|
+
maxCount: ((H = c.productBalance.find(({ id: O }) => O === $._id)) == null ? void 0 : H.count) || 0,
|
|
212
212
|
sku: $,
|
|
213
213
|
show: !0,
|
|
214
|
-
"onUpdate:show"(
|
|
215
|
-
|
|
214
|
+
"onUpdate:show"(O) {
|
|
215
|
+
F.value.show = O;
|
|
216
216
|
},
|
|
217
217
|
onSubmitted() {
|
|
218
218
|
v();
|
|
219
219
|
}
|
|
220
220
|
};
|
|
221
|
-
|
|
221
|
+
F.value = x;
|
|
222
222
|
}
|
|
223
223
|
const l = N();
|
|
224
|
-
async function
|
|
224
|
+
async function s($) {
|
|
225
225
|
const n = {
|
|
226
226
|
stock: $,
|
|
227
227
|
show: !0,
|
|
@@ -255,7 +255,7 @@ const Jt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
255
255
|
C(r);
|
|
256
256
|
return;
|
|
257
257
|
case he.Adjust:
|
|
258
|
-
|
|
258
|
+
s(r);
|
|
259
259
|
return;
|
|
260
260
|
}
|
|
261
261
|
}
|
|
@@ -264,12 +264,12 @@ const Jt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
264
264
|
onActionMenu: w,
|
|
265
265
|
stockHistoryProps: y,
|
|
266
266
|
showSkuHistory: B,
|
|
267
|
-
convertSkuDialogProps:
|
|
267
|
+
convertSkuDialogProps: F,
|
|
268
268
|
adjustSkuDialogProps: l
|
|
269
269
|
};
|
|
270
270
|
});
|
|
271
|
-
function
|
|
272
|
-
const
|
|
271
|
+
function tn() {
|
|
272
|
+
const b = pe(), h = rt(), { t: c } = de();
|
|
273
273
|
return {
|
|
274
274
|
columnDefs: [
|
|
275
275
|
{
|
|
@@ -288,33 +288,33 @@ function en() {
|
|
|
288
288
|
id: "UOM",
|
|
289
289
|
header: () => c("inventory.stock.balance"),
|
|
290
290
|
cell(A) {
|
|
291
|
-
const
|
|
292
|
-
unit:
|
|
293
|
-
sku:
|
|
294
|
-
amount:
|
|
295
|
-
defaultTrackingMeasurement:
|
|
291
|
+
const p = A.row.original, m = {
|
|
292
|
+
unit: p.unit,
|
|
293
|
+
sku: p,
|
|
294
|
+
amount: p.balance,
|
|
295
|
+
defaultTrackingMeasurement: p.trackingMeasurement ?? void 0
|
|
296
296
|
};
|
|
297
|
-
return
|
|
297
|
+
return be(lt, m);
|
|
298
298
|
},
|
|
299
299
|
size: 180
|
|
300
300
|
},
|
|
301
301
|
{
|
|
302
302
|
accessorKey: "day",
|
|
303
303
|
id: "expireDate",
|
|
304
|
-
header: () =>
|
|
304
|
+
header: () => be(en),
|
|
305
305
|
enableSorting: !0,
|
|
306
306
|
sortUndefined: "last",
|
|
307
307
|
cell(A) {
|
|
308
|
-
var l,
|
|
309
|
-
const
|
|
310
|
-
if (typeof
|
|
311
|
-
return
|
|
312
|
-
days:
|
|
308
|
+
var l, s;
|
|
309
|
+
const p = A.row.original.day, m = (l = A.row.original.thresholds) == null ? void 0 : l.low, v = (s = A.row.original.thresholds) == null ? void 0 : s.mid;
|
|
310
|
+
if (typeof p != "number" || typeof m != "number" || typeof v != "number")
|
|
311
|
+
return be(Te, {
|
|
312
|
+
days: p
|
|
313
313
|
});
|
|
314
|
-
const
|
|
315
|
-
return
|
|
316
|
-
days:
|
|
317
|
-
level:
|
|
314
|
+
const F = p <= m ? Me.low : p <= v ? Me.mid : Me.high;
|
|
315
|
+
return be(Te, {
|
|
316
|
+
days: p,
|
|
317
|
+
level: F
|
|
318
318
|
});
|
|
319
319
|
},
|
|
320
320
|
size: 200
|
|
@@ -322,10 +322,10 @@ function en() {
|
|
|
322
322
|
{
|
|
323
323
|
id: "action",
|
|
324
324
|
cell(A) {
|
|
325
|
-
var
|
|
325
|
+
var p;
|
|
326
326
|
return mt(
|
|
327
|
-
((
|
|
328
|
-
(
|
|
327
|
+
((p = b._currentLocation) == null ? void 0 : p.type) === "restaurant" ? qt : Xt,
|
|
328
|
+
(m) => h.onActionMenu(m, A.row.original)
|
|
329
329
|
);
|
|
330
330
|
},
|
|
331
331
|
enableSorting: !1,
|
|
@@ -338,44 +338,44 @@ function en() {
|
|
|
338
338
|
]
|
|
339
339
|
};
|
|
340
340
|
}
|
|
341
|
-
const
|
|
341
|
+
const nn = {
|
|
342
342
|
context: null,
|
|
343
343
|
error: null,
|
|
344
|
-
isRequired(
|
|
345
|
-
return `${this.context ?? ""}`.length === 0 && (this.error =
|
|
344
|
+
isRequired(b = "This field is required") {
|
|
345
|
+
return `${this.context ?? ""}`.length === 0 && (this.error = b), this;
|
|
346
346
|
},
|
|
347
|
-
isString(
|
|
348
|
-
return this.error ? this : (typeof this.context != "string" && (this.error ?? (this.error =
|
|
347
|
+
isString(b = "Must be a valid string") {
|
|
348
|
+
return this.error ? this : (typeof this.context != "string" && (this.error ?? (this.error = b)), this);
|
|
349
349
|
},
|
|
350
350
|
toInt() {
|
|
351
351
|
return this.error ? this : (this.context = +this.context, this);
|
|
352
352
|
},
|
|
353
|
-
isInteger(
|
|
354
|
-
return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error =
|
|
353
|
+
isInteger(b = "Must be an integer") {
|
|
354
|
+
return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error = b), this);
|
|
355
355
|
},
|
|
356
|
-
min(
|
|
356
|
+
min(b, h) {
|
|
357
357
|
if (this.error) return this;
|
|
358
358
|
try {
|
|
359
|
-
typeof this.context == "number" ? +this.context <
|
|
359
|
+
typeof this.context == "number" ? +this.context < b && (this.error = h ?? `Must be at least ${b}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < b && (this.error = h ?? `Must be at least ${b}`) : this.error = "Length cannot be determined";
|
|
360
360
|
} catch {
|
|
361
361
|
this.error = "Length cannot be determined";
|
|
362
362
|
}
|
|
363
363
|
return this;
|
|
364
364
|
},
|
|
365
|
-
max(
|
|
365
|
+
max(b, h) {
|
|
366
366
|
if (this.error) return this;
|
|
367
367
|
try {
|
|
368
|
-
typeof this.context == "number" ? +this.context >
|
|
368
|
+
typeof this.context == "number" ? +this.context > b && (this.error = h ?? `Must be at most ${b}`) : "length" in this.context ? +this.context.length > b && (this.error = h ?? `Must be at most ${b}`) : this.error = "Length cannot be determined";
|
|
369
369
|
} catch {
|
|
370
370
|
this.error = "Length cannot be determined";
|
|
371
371
|
}
|
|
372
372
|
return this;
|
|
373
373
|
}
|
|
374
374
|
};
|
|
375
|
-
function
|
|
376
|
-
return { ...
|
|
375
|
+
function Qe(b) {
|
|
376
|
+
return { ...nn, context: b };
|
|
377
377
|
}
|
|
378
|
-
const
|
|
378
|
+
const on = { class: "flex items-center" }, sn = { class: "fm-typo-en-title-md-800" }, an = { class: "flex flex-col gap-24 w-full" }, ln = { class: "flex flex-col gap-8" }, rn = { class: "fm-typo-en-body-lg-600" }, un = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, cn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, dn = { class: "flex flex-col p-16 gap-8" }, mn = { class: "flex flex-col gap-4" }, pn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, fn = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, vn = { class: "xs:col-span-3" }, yn = { class: "flex gap-8" }, _n = /* @__PURE__ */ ce({
|
|
379
379
|
__name: "ConvertSkuDialog",
|
|
380
380
|
props: {
|
|
381
381
|
sku: {},
|
|
@@ -383,73 +383,73 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
|
|
|
383
383
|
show: { type: Boolean }
|
|
384
384
|
},
|
|
385
385
|
emits: ["update:show", "submitted"],
|
|
386
|
-
setup(
|
|
387
|
-
const
|
|
386
|
+
setup(b, { expose: h, emit: c }) {
|
|
387
|
+
const o = b, A = c, p = Yt(), m = Pe(), v = ye(), F = _e(), { t: C } = de(), l = N(0), s = N(null), y = P(() => m.skus), B = P(
|
|
388
388
|
() => {
|
|
389
389
|
var k, t;
|
|
390
|
-
return (((t = (k =
|
|
391
|
-
(
|
|
390
|
+
return (((t = (k = o.sku) == null ? void 0 : k.convert) == null ? void 0 : t.inventoryBindings) ?? []).filter(
|
|
391
|
+
(a) => a.type === Ge.enum.SKU
|
|
392
392
|
);
|
|
393
393
|
}
|
|
394
394
|
), w = P({
|
|
395
395
|
get() {
|
|
396
|
-
return !!
|
|
396
|
+
return !!s.value;
|
|
397
397
|
},
|
|
398
398
|
set(k) {
|
|
399
|
-
k ?
|
|
399
|
+
k ? s.value = He(B.value) : (s.value = null, l.value = Math.min(l.value, o.maxCount ?? 0));
|
|
400
400
|
}
|
|
401
401
|
}), $ = N(!1);
|
|
402
|
-
xe([() =>
|
|
402
|
+
xe([() => o.show], ([k]) => {
|
|
403
403
|
k && (l.value = 0);
|
|
404
404
|
});
|
|
405
405
|
function n() {
|
|
406
|
-
Q(
|
|
406
|
+
Q(o.sku, Se(l.value), s.value);
|
|
407
407
|
}
|
|
408
408
|
function r(k) {
|
|
409
|
-
if (
|
|
409
|
+
if (s.value)
|
|
410
410
|
return !0;
|
|
411
|
-
const t =
|
|
411
|
+
const t = Qe(k).isInteger().max(o.maxCount ?? 0).error ?? "";
|
|
412
412
|
return t || !0;
|
|
413
413
|
}
|
|
414
|
-
function
|
|
415
|
-
var
|
|
416
|
-
const t = (
|
|
414
|
+
function x(k) {
|
|
415
|
+
var f;
|
|
416
|
+
const t = (f = o.sku.convert) != null && f.measurement ? o.sku.unit.measurements.find((V) => {
|
|
417
417
|
var E;
|
|
418
|
-
return V.id === ((E =
|
|
419
|
-
}) ?? null : null,
|
|
420
|
-
return
|
|
418
|
+
return V.id === ((E = o.sku.convert) == null ? void 0 : E.measurement);
|
|
419
|
+
}) ?? null : null, a = Ie(o.sku.unit, t), d = _t(+k);
|
|
420
|
+
return Qe(d).isInteger().max(a).error ? "Precision cannot be more than " + a : !0;
|
|
421
421
|
}
|
|
422
422
|
const M = P(
|
|
423
423
|
() => {
|
|
424
424
|
var k, t;
|
|
425
|
-
return (k =
|
|
426
|
-
var
|
|
427
|
-
return
|
|
428
|
-
})) == null ? void 0 : t.abbrev :
|
|
425
|
+
return (k = o.sku.convert) != null && k.measurement ? (t = o.sku.unit.measurements.find((a) => {
|
|
426
|
+
var d;
|
|
427
|
+
return a.id === ((d = o.sku.convert) == null ? void 0 : d.measurement);
|
|
428
|
+
})) == null ? void 0 : t.abbrev : o.sku.unit.abbrev;
|
|
429
429
|
}
|
|
430
430
|
), D = P(() => {
|
|
431
|
-
var
|
|
431
|
+
var d, u;
|
|
432
432
|
const t = pt({
|
|
433
|
-
bindings: ((
|
|
434
|
-
skus:
|
|
435
|
-
skuGroups:
|
|
436
|
-
recipes:
|
|
437
|
-
}).inventoryBindings.filter((
|
|
438
|
-
return (u =
|
|
439
|
-
var
|
|
440
|
-
const V =
|
|
433
|
+
bindings: ((d = o.sku.convert) == null ? void 0 : d.inventoryBindings) ?? [],
|
|
434
|
+
skus: m.skus,
|
|
435
|
+
skuGroups: m.skuGroups,
|
|
436
|
+
recipes: m.recipes
|
|
437
|
+
}).inventoryBindings.filter((f) => "success" in f && f.success).map((f) => f).map((f) => f.binding);
|
|
438
|
+
return (u = s.value ?? t) == null ? void 0 : u.map((f) => {
|
|
439
|
+
var Z, le, ee, re, Le;
|
|
440
|
+
const V = m.skus.find((fe) => fe._id === f.id), E = ((Z = f.measurement) == null ? void 0 : Z.abbrev) ?? ((le = V == null ? void 0 : V.unit) == null ? void 0 : le.abbrev), K = (ee = o.sku.convert) != null && ee.measurement ? o.sku.unit.measurements.find((fe) => {
|
|
441
441
|
var ze;
|
|
442
|
-
return fe.id === ((ze =
|
|
443
|
-
}) ?? null : null,
|
|
442
|
+
return fe.id === ((ze = o.sku.convert) == null ? void 0 : ze.measurement);
|
|
443
|
+
}) ?? null : null, ae = Ie(o.sku.unit, K), U = x(`${l.value}`) === !0 ? me(
|
|
444
444
|
ft(
|
|
445
|
-
|
|
446
|
-
Se(+l.value,
|
|
445
|
+
f.amount,
|
|
446
|
+
Se(+l.value, ae)
|
|
447
447
|
),
|
|
448
448
|
!1
|
|
449
|
-
) : "0", Y = (Le = (
|
|
449
|
+
) : "0", Y = (Le = (re = s.value) == null ? void 0 : re.find((fe) => fe.id === (V == null ? void 0 : V._id))) == null ? void 0 : Le.amount, W = Y ? me(Y, !1) : null;
|
|
450
450
|
return {
|
|
451
451
|
sku: V,
|
|
452
|
-
convertAmount:
|
|
452
|
+
convertAmount: W ?? U,
|
|
453
453
|
abbrev: E
|
|
454
454
|
};
|
|
455
455
|
});
|
|
@@ -468,8 +468,8 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
|
|
|
468
468
|
(t = (k = H.value) == null ? void 0 : k.resetInputs) == null || t.call(k);
|
|
469
469
|
}
|
|
470
470
|
});
|
|
471
|
-
const
|
|
472
|
-
async function Q(k, t,
|
|
471
|
+
const O = Ne(o, "show");
|
|
472
|
+
async function Q(k, t, a) {
|
|
473
473
|
$.value = !0;
|
|
474
474
|
try {
|
|
475
475
|
await v.convertSku({
|
|
@@ -477,105 +477,105 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
|
|
|
477
477
|
{
|
|
478
478
|
doc: k,
|
|
479
479
|
amount: t,
|
|
480
|
-
overrides:
|
|
481
|
-
...
|
|
480
|
+
overrides: a == null ? void 0 : a.map((d) => ({
|
|
481
|
+
...d,
|
|
482
482
|
amount: {
|
|
483
|
-
...
|
|
484
|
-
amount: -1 * Math.abs(
|
|
483
|
+
...d.amount,
|
|
484
|
+
amount: -1 * Math.abs(d.amount.amount)
|
|
485
485
|
// ensure truly negative
|
|
486
486
|
}
|
|
487
487
|
}))
|
|
488
488
|
}
|
|
489
489
|
]
|
|
490
490
|
}), A("update:show", !1), A("submitted");
|
|
491
|
-
} catch (
|
|
492
|
-
|
|
491
|
+
} catch (d) {
|
|
492
|
+
F.open({
|
|
493
493
|
title: "Something went wrong",
|
|
494
494
|
message: `Cannot convert ${k.name}. Please try again.`,
|
|
495
495
|
type: "error"
|
|
496
|
-
}), console.error("error at converting stock amount", k, t,
|
|
496
|
+
}), console.error("error at converting stock amount", k, t, d);
|
|
497
497
|
} finally {
|
|
498
498
|
$.value = !1;
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
function X(k, t,
|
|
502
|
-
const
|
|
503
|
-
let u =
|
|
504
|
-
t.length > 0 && isFinite(
|
|
501
|
+
function X(k, t, a) {
|
|
502
|
+
const d = +t;
|
|
503
|
+
let u = a;
|
|
504
|
+
t.length > 0 && isFinite(d) ? u = a.map((f) => (f.id !== k || (f.amount = ve(d)), f)) : u = a.map((f) => (f.id !== k || (f.amount = { amount: 0, precision: 0 }), f)), s.value = u;
|
|
505
505
|
}
|
|
506
506
|
function T(k) {
|
|
507
|
-
const t = y.value.find((
|
|
507
|
+
const t = y.value.find((a) => a._id === k);
|
|
508
508
|
return t ? st(t.unit, !0) : [];
|
|
509
509
|
}
|
|
510
510
|
function L(k, t) {
|
|
511
|
-
const
|
|
512
|
-
return
|
|
513
|
-
...
|
|
514
|
-
label:
|
|
511
|
+
const a = T(k), d = a.find((u) => u.value === t) ?? a.find((u) => u.value === null);
|
|
512
|
+
return d ? {
|
|
513
|
+
...d,
|
|
514
|
+
label: d.abbrev
|
|
515
515
|
} : null;
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
let
|
|
517
|
+
function G(k, t, a) {
|
|
518
|
+
let d;
|
|
519
519
|
if (t === null)
|
|
520
|
-
|
|
520
|
+
d = a.map((u) => (u.id !== k || (u.measurement = null), u)) ?? [];
|
|
521
521
|
else {
|
|
522
|
-
const u = y.value.find((
|
|
523
|
-
|
|
522
|
+
const u = y.value.find((f) => f._id === k);
|
|
523
|
+
d = a.map((f) => {
|
|
524
524
|
var V, E;
|
|
525
|
-
return
|
|
525
|
+
return f.id !== k || (f.measurement = (E = (V = u == null ? void 0 : u.unit) == null ? void 0 : V.measurements) == null ? void 0 : E.find((K) => K.id === t)), f;
|
|
526
526
|
}) ?? [];
|
|
527
527
|
}
|
|
528
|
-
|
|
528
|
+
s.value = d;
|
|
529
529
|
}
|
|
530
530
|
function J(k, t) {
|
|
531
|
-
const
|
|
532
|
-
|
|
531
|
+
const a = t.filter((d) => d.id !== k);
|
|
532
|
+
s.value = a;
|
|
533
533
|
}
|
|
534
|
-
function
|
|
535
|
-
const k = (
|
|
534
|
+
function ne() {
|
|
535
|
+
const k = (s.value ?? []).map((t) => ({
|
|
536
536
|
...t,
|
|
537
537
|
type: Ge.enum.SKU
|
|
538
538
|
}));
|
|
539
|
-
|
|
539
|
+
p.promptIngredientsBinding(
|
|
540
540
|
k,
|
|
541
|
-
(t) =>
|
|
542
|
-
|
|
541
|
+
(t) => s.value = t,
|
|
542
|
+
o.sku._id
|
|
543
543
|
);
|
|
544
544
|
}
|
|
545
545
|
return xe(
|
|
546
|
-
() =>
|
|
546
|
+
() => o.show,
|
|
547
547
|
(k) => {
|
|
548
|
-
k || (
|
|
548
|
+
k || (s.value = null, l.value = 0);
|
|
549
549
|
}
|
|
550
550
|
), (k, t) => {
|
|
551
|
-
const
|
|
552
|
-
return
|
|
551
|
+
const a = j("FmTextField"), d = j("FmForm"), u = j("FmCard"), f = j("FmSwitch"), V = j("FmFormGroup"), E = j("FmSelect"), K = j("FmButton"), ae = j("FmSideSheet");
|
|
552
|
+
return S(), z(ae, {
|
|
553
553
|
"dismiss-away": "",
|
|
554
|
-
modelValue: i(
|
|
555
|
-
"onUpdate:modelValue": t[3] || (t[3] = (U) => Ue(
|
|
554
|
+
modelValue: i(O),
|
|
555
|
+
"onUpdate:modelValue": t[3] || (t[3] = (U) => Ue(O) ? O.value = U : null),
|
|
556
556
|
"max-width": 500
|
|
557
557
|
}, {
|
|
558
558
|
"side-sheet-header": I(() => [
|
|
559
|
-
e("div",
|
|
560
|
-
e("div",
|
|
559
|
+
e("div", on, [
|
|
560
|
+
e("div", sn, _(i(C)("inventory.stock.convert.title", { name: k.sku.name })), 1)
|
|
561
561
|
])
|
|
562
562
|
]),
|
|
563
563
|
default: I(() => [
|
|
564
|
-
e("div",
|
|
565
|
-
g(
|
|
564
|
+
e("div", an, [
|
|
565
|
+
g(d, {
|
|
566
566
|
ref_key: "formRef",
|
|
567
567
|
ref: H,
|
|
568
568
|
onValidationSuccess: n
|
|
569
569
|
}, {
|
|
570
570
|
default: I(() => [
|
|
571
|
-
g(
|
|
571
|
+
g(a, {
|
|
572
572
|
disabled: $.value,
|
|
573
573
|
"model-value": l.value,
|
|
574
574
|
"onUpdate:modelValue": t[0] || (t[0] = (U) => l.value = U),
|
|
575
575
|
label: i(C)("inventory.stock.convert.amount"),
|
|
576
|
-
rules: [r,
|
|
576
|
+
rules: [r, x, i(Fe)(0)],
|
|
577
577
|
"append-text": M.value,
|
|
578
|
-
"helper-text":
|
|
578
|
+
"helper-text": s.value ? void 0 : `Max ${k.maxCount} ${M.value}`
|
|
579
579
|
}, null, 8, ["disabled", "model-value", "label", "rules", "append-text", "helper-text"])
|
|
580
580
|
]),
|
|
581
581
|
_: 1
|
|
@@ -585,16 +585,16 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
|
|
|
585
585
|
class: "p-16"
|
|
586
586
|
}, {
|
|
587
587
|
default: I(() => [
|
|
588
|
-
e("div",
|
|
589
|
-
e("div",
|
|
590
|
-
(
|
|
591
|
-
var Y,
|
|
592
|
-
return
|
|
588
|
+
e("div", ln, [
|
|
589
|
+
e("div", rn, _(i(C)("inventory.stock.convert.deductionSummary")), 1),
|
|
590
|
+
(S(!0), R(te, null, ie(D.value, (U) => {
|
|
591
|
+
var Y, W;
|
|
592
|
+
return S(), R("div", {
|
|
593
593
|
key: (Y = U.sku) == null ? void 0 : Y._id,
|
|
594
594
|
class: "flex items-center"
|
|
595
595
|
}, [
|
|
596
|
-
e("div",
|
|
597
|
-
e("div",
|
|
596
|
+
e("div", un, _((W = U.sku) == null ? void 0 : W.name), 1),
|
|
597
|
+
e("div", cn, " -" + _(U.convertAmount) + " " + _(U.abbrev), 1)
|
|
598
598
|
]);
|
|
599
599
|
}), 128))
|
|
600
600
|
])
|
|
@@ -603,22 +603,22 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
|
|
|
603
603
|
}),
|
|
604
604
|
g(u, { variant: "outlined" }, {
|
|
605
605
|
default: I(() => [
|
|
606
|
-
e("div",
|
|
607
|
-
g(
|
|
606
|
+
e("div", dn, [
|
|
607
|
+
g(f, {
|
|
608
608
|
value: "",
|
|
609
609
|
modelValue: w.value,
|
|
610
610
|
"onUpdate:modelValue": t[1] || (t[1] = (U) => w.value = U),
|
|
611
611
|
label: i(C)("inventory.stock.convert.overrideDeduction"),
|
|
612
612
|
"label-placement": "right"
|
|
613
613
|
}, null, 8, ["modelValue", "label"]),
|
|
614
|
-
w.value ? (
|
|
614
|
+
w.value ? (S(), R(te, { key: 0 }, [
|
|
615
615
|
g(V, {
|
|
616
|
-
modelValue:
|
|
616
|
+
modelValue: s.value,
|
|
617
617
|
rules: [i(vt)(1, "Must have at least one ingredient binding")]
|
|
618
618
|
}, null, 8, ["modelValue", "rules"]),
|
|
619
|
-
e("div",
|
|
620
|
-
e("div",
|
|
621
|
-
(
|
|
619
|
+
e("div", mn, [
|
|
620
|
+
e("div", pn, _(i(C)("inventory.stock.convert.ingredients")), 1),
|
|
621
|
+
(S(!0), R(te, null, ie(s.value, (U) => (S(), z(V, {
|
|
622
622
|
key: U.id,
|
|
623
623
|
disabled: $.value,
|
|
624
624
|
modelValue: +i(me)(U.amount ?? { amount: 1, precision: 0 }),
|
|
@@ -631,36 +631,36 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
|
|
|
631
631
|
]
|
|
632
632
|
}, {
|
|
633
633
|
default: I(({ invalid: Y }) => {
|
|
634
|
-
var
|
|
634
|
+
var W, Z, le;
|
|
635
635
|
return [
|
|
636
|
-
e("div",
|
|
637
|
-
e("div",
|
|
638
|
-
g(
|
|
636
|
+
e("div", fn, [
|
|
637
|
+
e("div", vn, _((W = y.value.find((ee) => ee._id === U.id)) == null ? void 0 : W.name), 1),
|
|
638
|
+
g(a, {
|
|
639
639
|
class: "xs:col-span-2",
|
|
640
640
|
disabled: $.value,
|
|
641
641
|
modelValue: +i(me)(
|
|
642
642
|
U.amount ?? { amount: 1, precision: 0 }
|
|
643
643
|
),
|
|
644
|
-
"onUpdate:modelValue": (
|
|
644
|
+
"onUpdate:modelValue": (ee) => X(U.id, ee, s.value ?? []),
|
|
645
645
|
invalid: Y
|
|
646
646
|
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
|
|
647
647
|
g(E, {
|
|
648
648
|
disabled: $.value,
|
|
649
649
|
class: "translate-y-[2px]",
|
|
650
650
|
items: T(U.id),
|
|
651
|
-
"model-value": (
|
|
652
|
-
"onUpdate:modelValue": (
|
|
651
|
+
"model-value": (le = L(U.id, (Z = U.measurement) == null ? void 0 : Z.id)) == null ? void 0 : le.value,
|
|
652
|
+
"onUpdate:modelValue": (ee) => G(U.id, ee, s.value ?? []),
|
|
653
653
|
invalid: Y
|
|
654
654
|
}, {
|
|
655
655
|
"helper-text": I(() => t[4] || (t[4] = [])),
|
|
656
656
|
_: 2
|
|
657
657
|
}, 1032, ["disabled", "items", "model-value", "onUpdate:modelValue", "invalid"]),
|
|
658
|
-
g(
|
|
658
|
+
g(K, {
|
|
659
659
|
disabled: $.value,
|
|
660
660
|
type: "button",
|
|
661
661
|
variant: "tertiary",
|
|
662
662
|
icon: "delete",
|
|
663
|
-
onClick: (
|
|
663
|
+
onClick: (ee) => J(U.id, s.value ?? [])
|
|
664
664
|
}, null, 8, ["disabled", "onClick"])
|
|
665
665
|
])
|
|
666
666
|
];
|
|
@@ -669,14 +669,14 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
|
|
|
669
669
|
}, 1032, ["disabled", "modelValue", "rules"]))), 128))
|
|
670
670
|
]),
|
|
671
671
|
e("div", null, [
|
|
672
|
-
g(
|
|
672
|
+
g(K, {
|
|
673
673
|
icon: "link",
|
|
674
674
|
label: i(C)("inventory.stock.convert.linkIngredient"),
|
|
675
675
|
variant: "plain",
|
|
676
|
-
onClick:
|
|
676
|
+
onClick: ne
|
|
677
677
|
}, null, 8, ["label"])
|
|
678
678
|
])
|
|
679
|
-
], 64)) :
|
|
679
|
+
], 64)) : oe("", !0)
|
|
680
680
|
])
|
|
681
681
|
]),
|
|
682
682
|
_: 1
|
|
@@ -684,13 +684,13 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
|
|
|
684
684
|
])
|
|
685
685
|
]),
|
|
686
686
|
"side-sheet-footer": I(() => [
|
|
687
|
-
e("div",
|
|
688
|
-
g(
|
|
687
|
+
e("div", yn, [
|
|
688
|
+
g(K, {
|
|
689
689
|
loading: $.value,
|
|
690
690
|
label: i(C)("inventory.stock.convert.convertButton"),
|
|
691
691
|
onClick: t[2] || (t[2] = (U) => {
|
|
692
|
-
var Y,
|
|
693
|
-
return (
|
|
692
|
+
var Y, W;
|
|
693
|
+
return (W = (Y = H.value) == null ? void 0 : Y.validateInputs) == null ? void 0 : W.call(Y);
|
|
694
694
|
})
|
|
695
695
|
}, null, 8, ["loading", "label"])
|
|
696
696
|
])
|
|
@@ -700,61 +700,61 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
|
|
|
700
700
|
};
|
|
701
701
|
}
|
|
702
702
|
});
|
|
703
|
-
function De(
|
|
704
|
-
const c = Se(
|
|
703
|
+
function De(b, h) {
|
|
704
|
+
const c = Se(b, h);
|
|
705
705
|
return { ...c, amount: -c.amount };
|
|
706
706
|
}
|
|
707
|
-
function
|
|
708
|
-
return Se(Math.abs(
|
|
707
|
+
function Je(b, h) {
|
|
708
|
+
return Se(Math.abs(b), h);
|
|
709
709
|
}
|
|
710
710
|
const je = {
|
|
711
|
-
[
|
|
711
|
+
[se.enum.DAMAGE]: {
|
|
712
712
|
label: "Waste",
|
|
713
713
|
toAdjustmentAmount: De
|
|
714
714
|
},
|
|
715
|
-
[
|
|
715
|
+
[se.enum.THEFT]: {
|
|
716
716
|
label: "Theft",
|
|
717
717
|
toAdjustmentAmount: De
|
|
718
718
|
},
|
|
719
|
-
[
|
|
719
|
+
[se.enum.LOSE]: {
|
|
720
720
|
label: "Lose",
|
|
721
721
|
toAdjustmentAmount: De
|
|
722
722
|
},
|
|
723
|
-
[
|
|
723
|
+
[se.enum.EXTRA]: {
|
|
724
724
|
label: "Extra",
|
|
725
|
-
toAdjustmentAmount:
|
|
725
|
+
toAdjustmentAmount: Je
|
|
726
726
|
},
|
|
727
|
-
[
|
|
727
|
+
[se.enum.PURCHASE]: {
|
|
728
728
|
label: "Purchase",
|
|
729
|
-
toAdjustmentAmount:
|
|
729
|
+
toAdjustmentAmount: Je
|
|
730
730
|
}
|
|
731
|
-
},
|
|
731
|
+
}, bn = { class: "col-span-2 flex" }, kn = { class: "fm-typo-en-body-lg-600 flex-1" }, hn = /* @__PURE__ */ ce({
|
|
732
732
|
__name: "AdjustedItemForm",
|
|
733
733
|
props: {
|
|
734
734
|
modelValue: {},
|
|
735
735
|
disabled: { type: Boolean }
|
|
736
736
|
},
|
|
737
737
|
emits: ["update:modelValue", "click:delete"],
|
|
738
|
-
setup(
|
|
739
|
-
const c =
|
|
738
|
+
setup(b, { emit: h }) {
|
|
739
|
+
const c = b, o = h, A = P(
|
|
740
740
|
() => Object.keys(je).map((l) => ({
|
|
741
|
-
label:
|
|
741
|
+
label: bt(l),
|
|
742
742
|
value: l
|
|
743
743
|
}))
|
|
744
|
-
),
|
|
744
|
+
), p = P(() => st(c.modelValue.doc.unit, !0)), m = P({
|
|
745
745
|
get() {
|
|
746
|
-
return c.modelValue.type ??
|
|
746
|
+
return c.modelValue.type ?? se.enum.PURCHASE;
|
|
747
747
|
},
|
|
748
748
|
set(l) {
|
|
749
|
-
const
|
|
749
|
+
const s = {
|
|
750
750
|
...c.modelValue
|
|
751
751
|
};
|
|
752
|
-
|
|
752
|
+
s.type = l;
|
|
753
753
|
const y = Ke(c.modelValue.amount);
|
|
754
|
-
|
|
754
|
+
s.amount = je[s.type].toAdjustmentAmount(
|
|
755
755
|
+me(y),
|
|
756
756
|
y.precision
|
|
757
|
-
),
|
|
757
|
+
), o("update:modelValue", s);
|
|
758
758
|
}
|
|
759
759
|
}), v = P({
|
|
760
760
|
get() {
|
|
@@ -762,50 +762,50 @@ const je = {
|
|
|
762
762
|
return +me(l);
|
|
763
763
|
},
|
|
764
764
|
set(l) {
|
|
765
|
-
const
|
|
765
|
+
const s = {
|
|
766
766
|
...c.modelValue
|
|
767
767
|
}, y = ve(l);
|
|
768
|
-
|
|
768
|
+
s.amount = je[m.value].toAdjustmentAmount(
|
|
769
769
|
l,
|
|
770
770
|
y.precision
|
|
771
|
-
),
|
|
771
|
+
), o("update:modelValue", s);
|
|
772
772
|
}
|
|
773
|
-
}),
|
|
773
|
+
}), F = P({
|
|
774
774
|
get() {
|
|
775
775
|
var l;
|
|
776
776
|
return ((l = c.modelValue.measurement) == null ? void 0 : l.id) ?? null;
|
|
777
777
|
},
|
|
778
778
|
set(l) {
|
|
779
779
|
var y, B;
|
|
780
|
-
const
|
|
780
|
+
const s = {
|
|
781
781
|
...c.modelValue
|
|
782
782
|
};
|
|
783
|
-
|
|
783
|
+
s.measurement = ((B = (y = c.modelValue.doc.unit) == null ? void 0 : y.measurements) == null ? void 0 : B.find((w) => w.id === l)) ?? null, o("update:modelValue", s);
|
|
784
784
|
}
|
|
785
785
|
}), C = P({
|
|
786
786
|
get() {
|
|
787
787
|
return c.modelValue.remark ?? "";
|
|
788
788
|
},
|
|
789
789
|
set(l) {
|
|
790
|
-
const
|
|
790
|
+
const s = {
|
|
791
791
|
...c.modelValue
|
|
792
792
|
};
|
|
793
|
-
|
|
793
|
+
s.remark = l, o("update:modelValue", s);
|
|
794
794
|
}
|
|
795
795
|
});
|
|
796
|
-
return (l,
|
|
796
|
+
return (l, s) => {
|
|
797
797
|
const y = j("FmButton"), B = j("FmSelect"), w = j("FmTextarea"), $ = j("FmCard");
|
|
798
|
-
return
|
|
798
|
+
return S(), z($, {
|
|
799
799
|
variant: "outlined",
|
|
800
800
|
class: "grid grid-cols-2 gap-8 p-16"
|
|
801
801
|
}, {
|
|
802
802
|
default: I(() => [
|
|
803
|
-
e("div",
|
|
804
|
-
e("div", kn,
|
|
803
|
+
e("div", bn, [
|
|
804
|
+
e("div", kn, _(l.modelValue.doc.name), 1),
|
|
805
805
|
g(y, {
|
|
806
806
|
variant: "tertiary",
|
|
807
807
|
"prepend-icon": "delete",
|
|
808
|
-
onClick:
|
|
808
|
+
onClick: s[0] || (s[0] = (n) => o("click:delete"))
|
|
809
809
|
})
|
|
810
810
|
]),
|
|
811
811
|
g(B, {
|
|
@@ -813,12 +813,12 @@ const je = {
|
|
|
813
813
|
class: "col-span-2",
|
|
814
814
|
label: "Type",
|
|
815
815
|
items: A.value,
|
|
816
|
-
modelValue:
|
|
817
|
-
"onUpdate:modelValue":
|
|
818
|
-
rules: [i(
|
|
816
|
+
modelValue: m.value,
|
|
817
|
+
"onUpdate:modelValue": s[1] || (s[1] = (n) => m.value = n),
|
|
818
|
+
rules: [i(kt)()],
|
|
819
819
|
"label-mark": "required"
|
|
820
820
|
}, null, 8, ["disabled", "items", "modelValue", "rules"]),
|
|
821
|
-
g(
|
|
821
|
+
g(Gt, {
|
|
822
822
|
disabled: l.disabled,
|
|
823
823
|
label: "Amount",
|
|
824
824
|
step: +i(me)({
|
|
@@ -826,22 +826,22 @@ const je = {
|
|
|
826
826
|
precision: i(Ie)(l.modelValue.doc.unit, l.modelValue.measurement)
|
|
827
827
|
}),
|
|
828
828
|
modelValue: v.value,
|
|
829
|
-
"onUpdate:modelValue":
|
|
829
|
+
"onUpdate:modelValue": s[2] || (s[2] = (n) => v.value = n),
|
|
830
830
|
rules: [i(Fe)(0)]
|
|
831
831
|
}, null, 8, ["disabled", "step", "modelValue", "rules"]),
|
|
832
832
|
g(B, {
|
|
833
833
|
disabled: l.disabled,
|
|
834
834
|
label: "Unit",
|
|
835
|
-
items:
|
|
836
|
-
modelValue:
|
|
837
|
-
"onUpdate:modelValue":
|
|
835
|
+
items: p.value,
|
|
836
|
+
modelValue: F.value,
|
|
837
|
+
"onUpdate:modelValue": s[3] || (s[3] = (n) => F.value = n)
|
|
838
838
|
}, null, 8, ["disabled", "items", "modelValue"]),
|
|
839
839
|
g(w, {
|
|
840
840
|
class: "col-span-2",
|
|
841
841
|
disabled: l.disabled,
|
|
842
842
|
label: "Remark",
|
|
843
843
|
modelValue: C.value,
|
|
844
|
-
"onUpdate:modelValue":
|
|
844
|
+
"onUpdate:modelValue": s[4] || (s[4] = (n) => C.value = n),
|
|
845
845
|
"label-mark": "optional"
|
|
846
846
|
}, null, 8, ["disabled", "modelValue"])
|
|
847
847
|
]),
|
|
@@ -849,66 +849,66 @@ const je = {
|
|
|
849
849
|
});
|
|
850
850
|
};
|
|
851
851
|
}
|
|
852
|
-
}),
|
|
852
|
+
}), gn = { class: "flex items-center" }, xn = { class: "fm-typo-en-title-md-800" }, Sn = { class: "flex items-center" }, Fn = { class: "fm-typo-en-title-sm-800 flex-1" }, wn = { class: "flex gap-8" }, $n = /* @__PURE__ */ ce({
|
|
853
853
|
__name: "AdjustSkuDialog",
|
|
854
854
|
props: {
|
|
855
855
|
stock: {},
|
|
856
856
|
show: { type: Boolean }
|
|
857
857
|
},
|
|
858
858
|
emits: ["update:show", "submitted"],
|
|
859
|
-
setup(
|
|
860
|
-
const
|
|
861
|
-
function
|
|
859
|
+
setup(b, { expose: h, emit: c }) {
|
|
860
|
+
const o = b, A = c, p = Pe(), m = Oe(), v = ye(), F = _e(), C = N(!1), { t: l } = de();
|
|
861
|
+
function s() {
|
|
862
862
|
$(He(w));
|
|
863
863
|
}
|
|
864
864
|
const y = N();
|
|
865
865
|
h({
|
|
866
866
|
validateInputs: () => {
|
|
867
|
-
var
|
|
868
|
-
(M = (
|
|
867
|
+
var x, M;
|
|
868
|
+
(M = (x = y.value) == null ? void 0 : x.validateInputs) == null || M.call(x);
|
|
869
869
|
},
|
|
870
870
|
resetInputsValidation: () => {
|
|
871
|
-
var
|
|
872
|
-
(M = (
|
|
871
|
+
var x, M;
|
|
872
|
+
(M = (x = y.value) == null ? void 0 : x.resetInputsValidation) == null || M.call(x);
|
|
873
873
|
},
|
|
874
874
|
resetInputs: () => {
|
|
875
|
-
var
|
|
876
|
-
(M = (
|
|
875
|
+
var x, M;
|
|
876
|
+
(M = (x = y.value) == null ? void 0 : x.resetInputs) == null || M.call(x);
|
|
877
877
|
}
|
|
878
878
|
});
|
|
879
|
-
const B = Ne(
|
|
879
|
+
const B = Ne(o, "show"), w = it({
|
|
880
880
|
remark: "",
|
|
881
881
|
adjustments: [
|
|
882
882
|
{
|
|
883
883
|
id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
|
|
884
|
-
type:
|
|
885
|
-
doc:
|
|
884
|
+
type: se.enum.PURCHASE,
|
|
885
|
+
doc: o.stock,
|
|
886
886
|
measurement: null,
|
|
887
887
|
remark: "",
|
|
888
888
|
amount: ve(1)
|
|
889
889
|
}
|
|
890
890
|
]
|
|
891
891
|
});
|
|
892
|
-
xe([() =>
|
|
893
|
-
|
|
892
|
+
xe([() => o.show], ([x]) => {
|
|
893
|
+
x && (w.remark = "", w.adjustments = [
|
|
894
894
|
{
|
|
895
895
|
id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
|
|
896
|
-
type:
|
|
897
|
-
doc:
|
|
896
|
+
type: se.enum.PURCHASE,
|
|
897
|
+
doc: o.stock,
|
|
898
898
|
measurement: null,
|
|
899
899
|
remark: "",
|
|
900
900
|
amount: ve(1)
|
|
901
901
|
}
|
|
902
902
|
]);
|
|
903
903
|
});
|
|
904
|
-
async function $(
|
|
904
|
+
async function $(x) {
|
|
905
905
|
C.value = !0;
|
|
906
906
|
try {
|
|
907
907
|
await v.adjustSku({
|
|
908
|
-
remark:
|
|
909
|
-
adjustments:
|
|
908
|
+
remark: x.remark,
|
|
909
|
+
adjustments: x.adjustments.map(({ doc: M, remark: D, type: H, amount: O, measurement: Q }) => ({
|
|
910
910
|
id: M._id,
|
|
911
|
-
amount:
|
|
911
|
+
amount: O,
|
|
912
912
|
measurement: Q,
|
|
913
913
|
remark: D,
|
|
914
914
|
doc: M,
|
|
@@ -916,26 +916,26 @@ const je = {
|
|
|
916
916
|
}))
|
|
917
917
|
}), A("update:show", !1), A("submitted");
|
|
918
918
|
} catch (M) {
|
|
919
|
-
|
|
919
|
+
F.open({
|
|
920
920
|
title: l("inventory.stock.adjust.error.title"),
|
|
921
921
|
message: l("inventory.stock.adjust.error.message"),
|
|
922
922
|
type: "error"
|
|
923
|
-
}), console.log("error on adjust ingredients",
|
|
923
|
+
}), console.log("error on adjust ingredients", x, M);
|
|
924
924
|
} finally {
|
|
925
925
|
C.value = !1;
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
function n() {
|
|
929
|
-
const
|
|
929
|
+
const x = p.skus.map((D) => ({
|
|
930
930
|
label: D.name,
|
|
931
931
|
sublabel: D.code,
|
|
932
932
|
value: D._id
|
|
933
|
-
})), M =
|
|
934
|
-
|
|
933
|
+
})), M = x.filter((D) => w.adjustments.find((H) => H.doc._id === D.value)).map((D) => D.value);
|
|
934
|
+
m.open({
|
|
935
935
|
title: "Select ingredients",
|
|
936
936
|
contentComponent: ht,
|
|
937
937
|
contentComponentProps: {
|
|
938
|
-
items:
|
|
938
|
+
items: x,
|
|
939
939
|
modelValue: M
|
|
940
940
|
},
|
|
941
941
|
overlay: !0,
|
|
@@ -952,10 +952,10 @@ const je = {
|
|
|
952
952
|
}
|
|
953
953
|
}).onPrimary((D) => {
|
|
954
954
|
w.adjustments = D.map(
|
|
955
|
-
(H) => w.adjustments.find((
|
|
955
|
+
(H) => w.adjustments.find((O) => O.doc._id === H) ?? {
|
|
956
956
|
id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
|
|
957
|
-
type:
|
|
958
|
-
doc:
|
|
957
|
+
type: se.enum.PURCHASE,
|
|
958
|
+
doc: p.skus.find((O) => O._id === H),
|
|
959
959
|
measurement: null,
|
|
960
960
|
remark: "",
|
|
961
961
|
amount: ve(1)
|
|
@@ -963,28 +963,28 @@ const je = {
|
|
|
963
963
|
);
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
|
-
function r(
|
|
967
|
-
w.adjustments.splice(
|
|
966
|
+
function r(x) {
|
|
967
|
+
w.adjustments.splice(x, 1);
|
|
968
968
|
}
|
|
969
|
-
return (
|
|
970
|
-
const D = j("FmTextarea"), H = j("FmButton"),
|
|
971
|
-
return
|
|
969
|
+
return (x, M) => {
|
|
970
|
+
const D = j("FmTextarea"), H = j("FmButton"), O = j("FmForm"), Q = j("FmSideSheet");
|
|
971
|
+
return S(), z(Q, {
|
|
972
972
|
modelValue: i(B),
|
|
973
973
|
"onUpdate:modelValue": M[2] || (M[2] = (X) => Ue(B) ? B.value = X : null),
|
|
974
974
|
"dismiss-away": "",
|
|
975
975
|
"max-width": 500
|
|
976
976
|
}, {
|
|
977
977
|
"side-sheet-header": I(() => [
|
|
978
|
-
e("div",
|
|
979
|
-
e("div",
|
|
978
|
+
e("div", gn, [
|
|
979
|
+
e("div", xn, _(i(l)("inventory.stock.adjust.title")), 1)
|
|
980
980
|
])
|
|
981
981
|
]),
|
|
982
982
|
default: I(() => [
|
|
983
|
-
g(
|
|
983
|
+
g(O, {
|
|
984
984
|
class: "w-full flex flex-col gap-12",
|
|
985
985
|
ref_key: "formRef",
|
|
986
986
|
ref: y,
|
|
987
|
-
onValidationSuccess:
|
|
987
|
+
onValidationSuccess: s
|
|
988
988
|
}, {
|
|
989
989
|
default: I(() => [
|
|
990
990
|
g(D, {
|
|
@@ -992,8 +992,8 @@ const je = {
|
|
|
992
992
|
modelValue: w.remark,
|
|
993
993
|
"onUpdate:modelValue": M[0] || (M[0] = (X) => w.remark = X)
|
|
994
994
|
}, null, 8, ["label", "modelValue"]),
|
|
995
|
-
e("div",
|
|
996
|
-
e("div",
|
|
995
|
+
e("div", Sn, [
|
|
996
|
+
e("div", Fn, _(i(l)("inventory.stock.adjust.adjustedItems")), 1),
|
|
997
997
|
g(H, {
|
|
998
998
|
"prepend-icon": "add",
|
|
999
999
|
variant: "tertiary",
|
|
@@ -1001,7 +1001,7 @@ const je = {
|
|
|
1001
1001
|
onClick: n
|
|
1002
1002
|
})
|
|
1003
1003
|
]),
|
|
1004
|
-
(
|
|
1004
|
+
(S(!0), R(te, null, ie(w.adjustments, (X, T) => (S(), z(hn, {
|
|
1005
1005
|
key: X.id,
|
|
1006
1006
|
modelValue: w.adjustments[T],
|
|
1007
1007
|
"onUpdate:modelValue": (L) => w.adjustments[T] = L,
|
|
@@ -1012,7 +1012,7 @@ const je = {
|
|
|
1012
1012
|
}, 512)
|
|
1013
1013
|
]),
|
|
1014
1014
|
"side-sheet-footer": I(() => [
|
|
1015
|
-
e("div",
|
|
1015
|
+
e("div", wn, [
|
|
1016
1016
|
g(H, {
|
|
1017
1017
|
label: i(l)("inventory.stock.adjust.adjustButton"),
|
|
1018
1018
|
loading: C.value,
|
|
@@ -1027,27 +1027,27 @@ const je = {
|
|
|
1027
1027
|
}, 8, ["modelValue"]);
|
|
1028
1028
|
};
|
|
1029
1029
|
}
|
|
1030
|
-
}),
|
|
1030
|
+
}), An = gt((b, h) => ({
|
|
1031
1031
|
// TODO: remove once latest inventory backend has been push
|
|
1032
|
-
async findBillsByBusinessId(c,
|
|
1033
|
-
const
|
|
1032
|
+
async findBillsByBusinessId(c, o, A) {
|
|
1033
|
+
const p = `${b.businessesBackendUrl}/${c}/reports/find-many`, m = {
|
|
1034
1034
|
// type: TYPE.bill,
|
|
1035
1035
|
type: "bill",
|
|
1036
|
-
restaurantIds:
|
|
1036
|
+
restaurantIds: o,
|
|
1037
1037
|
ids: A
|
|
1038
1038
|
};
|
|
1039
|
-
return await h.post(
|
|
1039
|
+
return await h.post(p, m);
|
|
1040
1040
|
},
|
|
1041
1041
|
async findBillsById(c) {
|
|
1042
|
-
const A = pe().currentLocationDBName,
|
|
1042
|
+
const A = pe().currentLocationDBName, p = `${b.inventoryBackendUrl}/${A}/bill/search`, m = {
|
|
1043
1043
|
ids: c
|
|
1044
1044
|
};
|
|
1045
|
-
return await h.post(
|
|
1045
|
+
return await h.post(p, m);
|
|
1046
1046
|
}
|
|
1047
|
-
})),
|
|
1047
|
+
})), Vn = {
|
|
1048
1048
|
key: 0,
|
|
1049
1049
|
class: "flex justify-center items-center h-32"
|
|
1050
|
-
},
|
|
1050
|
+
}, Cn = { class: "mb-3" }, Bn = { class: "flex flex-col gap-8" }, Mn = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, Dn = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, jn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, In = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Tn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Un = { class: "flex flex-col w-full px-2" }, En = { class: "flex gap-2" }, Hn = /* @__PURE__ */ ce({
|
|
1051
1051
|
__name: "AmendAdjustmentForm",
|
|
1052
1052
|
props: /* @__PURE__ */ Ye({
|
|
1053
1053
|
adjustmentId: {}
|
|
@@ -1056,54 +1056,54 @@ const je = {
|
|
|
1056
1056
|
modelModifiers: {}
|
|
1057
1057
|
}),
|
|
1058
1058
|
emits: /* @__PURE__ */ Ye(["refreshHistory"], ["update:modelValue"]),
|
|
1059
|
-
setup(
|
|
1060
|
-
const c =
|
|
1059
|
+
setup(b, { emit: h }) {
|
|
1060
|
+
const c = b, o = h, A = ye(), p = ut(b, "modelValue"), m = N(!1), v = N(!1), F = N(!1), C = N({
|
|
1061
1061
|
_id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
|
|
1062
1062
|
skus: []
|
|
1063
1063
|
}), l = N();
|
|
1064
1064
|
Ee(async () => {
|
|
1065
|
-
|
|
1065
|
+
m.value = !0;
|
|
1066
1066
|
const n = await A.readSingleAdjustment(c.adjustmentId);
|
|
1067
1067
|
if (!n) throw new Error("Adjustment not found");
|
|
1068
|
-
C.value = n,
|
|
1068
|
+
C.value = n, m.value = !1;
|
|
1069
1069
|
});
|
|
1070
|
-
async function
|
|
1071
|
-
var r,
|
|
1072
|
-
if ((
|
|
1070
|
+
async function s() {
|
|
1071
|
+
var r, x;
|
|
1072
|
+
if ((x = (r = l == null ? void 0 : l.value) == null ? void 0 : r.validateInputs) == null || x.call(r), !v.value) return;
|
|
1073
1073
|
const n = {};
|
|
1074
|
-
Object.keys(
|
|
1074
|
+
Object.keys(p.value || {}).forEach((M) => {
|
|
1075
1075
|
var D;
|
|
1076
|
-
Object.keys(((D =
|
|
1076
|
+
Object.keys(((D = p.value) == null ? void 0 : D[M]) || {}).forEach((H) => {
|
|
1077
1077
|
var Q, X;
|
|
1078
|
-
const
|
|
1079
|
-
|
|
1078
|
+
const O = (X = (Q = p.value) == null ? void 0 : Q[M]) == null ? void 0 : X[Number(H)];
|
|
1079
|
+
O && B(O.amount) > 0 && (n[M] || (n[M] = []), n[M].push(O));
|
|
1080
1080
|
});
|
|
1081
1081
|
}), await A.revertWastageAdjustment({
|
|
1082
1082
|
targetWastageAdjustmentId: c.adjustmentId,
|
|
1083
1083
|
amountsGoingToAdjust: n
|
|
1084
|
-
}),
|
|
1084
|
+
}), o("refreshHistory"), F.value = !1, p.value = {};
|
|
1085
1085
|
}
|
|
1086
|
-
function y(n, r,
|
|
1086
|
+
function y(n, r, x) {
|
|
1087
1087
|
return P({
|
|
1088
1088
|
get: () => {
|
|
1089
|
-
var D, H,
|
|
1090
|
-
const M = (
|
|
1089
|
+
var D, H, O;
|
|
1090
|
+
const M = (O = (H = (D = p.value) == null ? void 0 : D[n]) == null ? void 0 : H[r]) == null ? void 0 : O.amount;
|
|
1091
1091
|
return M ? B(M, !0) : 0;
|
|
1092
1092
|
},
|
|
1093
1093
|
set: (M) => {
|
|
1094
|
-
|
|
1095
|
-
const D = { ...
|
|
1094
|
+
p.value || (p.value = {});
|
|
1095
|
+
const D = { ...p.value };
|
|
1096
1096
|
D[n] || (D[n] = {}), D[n][r] = {
|
|
1097
1097
|
amount: Ce.fromNumber(M),
|
|
1098
|
-
type:
|
|
1099
|
-
measurement:
|
|
1100
|
-
},
|
|
1098
|
+
type: se.Enum.WASTAGE,
|
|
1099
|
+
measurement: x
|
|
1100
|
+
}, p.value = D;
|
|
1101
1101
|
}
|
|
1102
1102
|
});
|
|
1103
1103
|
}
|
|
1104
1104
|
function B(n, r = !0) {
|
|
1105
|
-
const
|
|
1106
|
-
return r ? Math.abs(
|
|
1105
|
+
const x = Number(Ce.toFormatString({ value: n }));
|
|
1106
|
+
return r ? Math.abs(x) : x;
|
|
1107
1107
|
}
|
|
1108
1108
|
function w(n, r) {
|
|
1109
1109
|
return r.measurement ? r.measurement.abbrev : n.sku.unit.abbrev;
|
|
@@ -1112,20 +1112,20 @@ const je = {
|
|
|
1112
1112
|
return r === 0 ? "N/A" : (n + r).toString();
|
|
1113
1113
|
}
|
|
1114
1114
|
return (n, r) => {
|
|
1115
|
-
const
|
|
1116
|
-
return
|
|
1117
|
-
modelValue:
|
|
1118
|
-
"onUpdate:modelValue": r[4] || (r[4] = (T) =>
|
|
1115
|
+
const x = j("FmIcon"), M = j("FmStepperField"), D = j("FmCard"), H = j("FmForm"), O = j("FmSpacer"), Q = j("FmButton"), X = j("FmDialog");
|
|
1116
|
+
return S(), z(X, {
|
|
1117
|
+
modelValue: F.value,
|
|
1118
|
+
"onUpdate:modelValue": r[4] || (r[4] = (T) => F.value = T),
|
|
1119
1119
|
overlay: !0
|
|
1120
1120
|
}, {
|
|
1121
1121
|
"dialog-button": I(() => [
|
|
1122
|
-
g(
|
|
1122
|
+
g(Wt, null, {
|
|
1123
1123
|
default: I(() => [
|
|
1124
1124
|
e("button", {
|
|
1125
|
-
onClick: r[0] || (r[0] = (T) =>
|
|
1125
|
+
onClick: r[0] || (r[0] = (T) => F.value = !0),
|
|
1126
1126
|
class: "rounded-md hover:bg-gray-100 transition-colors"
|
|
1127
1127
|
}, [
|
|
1128
|
-
g(
|
|
1128
|
+
g(x, {
|
|
1129
1129
|
name: "edit",
|
|
1130
1130
|
size: "sm"
|
|
1131
1131
|
})
|
|
@@ -1138,29 +1138,29 @@ const je = {
|
|
|
1138
1138
|
e("div", null, "Amend Adjustment", -1)
|
|
1139
1139
|
])),
|
|
1140
1140
|
"dialog-footer": I(() => [
|
|
1141
|
-
e("div",
|
|
1141
|
+
e("div", Un, [
|
|
1142
1142
|
r[13] || (r[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)),
|
|
1143
|
-
e("div",
|
|
1144
|
-
g(
|
|
1143
|
+
e("div", En, [
|
|
1144
|
+
g(O),
|
|
1145
1145
|
g(Q, {
|
|
1146
1146
|
class: "sm:w-full xs:w-full",
|
|
1147
1147
|
label: "Close",
|
|
1148
1148
|
size: "md",
|
|
1149
1149
|
variant: "tertiary",
|
|
1150
|
-
onClick: r[3] || (r[3] = (T) =>
|
|
1150
|
+
onClick: r[3] || (r[3] = (T) => F.value = !1)
|
|
1151
1151
|
}),
|
|
1152
1152
|
g(Q, {
|
|
1153
1153
|
class: "sm:w-full xs:w-full",
|
|
1154
1154
|
label: "Submit",
|
|
1155
1155
|
size: "md",
|
|
1156
1156
|
variant: "primary",
|
|
1157
|
-
onClick:
|
|
1157
|
+
onClick: s
|
|
1158
1158
|
})
|
|
1159
1159
|
])
|
|
1160
1160
|
])
|
|
1161
1161
|
]),
|
|
1162
1162
|
default: I(() => [
|
|
1163
|
-
|
|
1163
|
+
m.value ? (S(), R("div", Vn)) : (S(), z(H, {
|
|
1164
1164
|
key: 1,
|
|
1165
1165
|
ref_key: "formRef",
|
|
1166
1166
|
ref: l,
|
|
@@ -1173,51 +1173,51 @@ const je = {
|
|
|
1173
1173
|
blameFormChildOnValidationFailed: ""
|
|
1174
1174
|
}, {
|
|
1175
1175
|
default: I(() => [
|
|
1176
|
-
e("p",
|
|
1176
|
+
e("p", Cn, [
|
|
1177
1177
|
r[6] || (r[6] = e("b", null, "Date:", -1)),
|
|
1178
1178
|
r[7] || (r[7] = e("br", null, null, -1)),
|
|
1179
|
-
ue(" " +
|
|
1179
|
+
ue(" " + _(i(xt)(i(St)(C.value._id))), 1)
|
|
1180
1180
|
]),
|
|
1181
|
-
e("div",
|
|
1182
|
-
(
|
|
1183
|
-
(
|
|
1181
|
+
e("div", Bn, [
|
|
1182
|
+
(S(!0), R(te, null, ie(C.value.skus, (T, L) => (S(), R(te, { key: L }, [
|
|
1183
|
+
(S(!0), R(te, null, ie(T.amounts, (G, J) => (S(), z(D, {
|
|
1184
1184
|
key: J,
|
|
1185
1185
|
variant: "outlined",
|
|
1186
1186
|
class: "p-2"
|
|
1187
1187
|
}, {
|
|
1188
1188
|
default: I(() => [
|
|
1189
|
-
e("div",
|
|
1190
|
-
e("span",
|
|
1191
|
-
e("span", null,
|
|
1189
|
+
e("div", Mn, [
|
|
1190
|
+
e("span", Dn, _(T.sku.code), 1),
|
|
1191
|
+
e("span", null, _(T.sku.name), 1)
|
|
1192
1192
|
]),
|
|
1193
1193
|
r[12] || (r[12] = e("hr", { class: "m-2" }, null, -1)),
|
|
1194
|
-
e("div",
|
|
1194
|
+
e("div", jn, [
|
|
1195
1195
|
r[8] || (r[8] = e("span", { class: "fm-typo-en-body-lg-600" }, "Adjustment type:", -1)),
|
|
1196
|
-
e("span", null,
|
|
1196
|
+
e("span", null, _(G.type), 1)
|
|
1197
1197
|
]),
|
|
1198
|
-
e("div",
|
|
1198
|
+
e("div", In, [
|
|
1199
1199
|
r[9] || (r[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
|
|
1200
|
-
e("span", null,
|
|
1200
|
+
e("span", null, _(i(Ce).toFormatString({ value: G.amount })) + " " + _(w(T, G)), 1)
|
|
1201
1201
|
]),
|
|
1202
1202
|
g(M, {
|
|
1203
1203
|
"model-value": y(T.sku._id, J).value,
|
|
1204
|
-
"onUpdate:modelValue": (
|
|
1204
|
+
"onUpdate:modelValue": (ne) => y(T.sku._id, J).value = ne,
|
|
1205
1205
|
class: "mb-3",
|
|
1206
1206
|
label: "Adjust Amount (Leave 0 to skip)",
|
|
1207
|
-
"helper-text": `Max: ${B(
|
|
1208
|
-
"append-text": w(T,
|
|
1207
|
+
"helper-text": `Max: ${B(G.amount)}`,
|
|
1208
|
+
"append-text": w(T, G),
|
|
1209
1209
|
rules: [
|
|
1210
|
-
(
|
|
1210
|
+
(ne) => ne <= B(G.amount) || `Cannot be more than ${B(G.amount)}`,
|
|
1211
1211
|
i(Fe)(-1)
|
|
1212
1212
|
]
|
|
1213
1213
|
}, null, 8, ["model-value", "onUpdate:modelValue", "helper-text", "append-text", "rules"]),
|
|
1214
|
-
e("div",
|
|
1214
|
+
e("div", Tn, [
|
|
1215
1215
|
r[10] || (r[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
|
|
1216
1216
|
r[11] || (r[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)),
|
|
1217
|
-
ue(" " +
|
|
1218
|
-
B(
|
|
1217
|
+
ue(" " + _($(
|
|
1218
|
+
B(G.amount, !1),
|
|
1219
1219
|
y(T.sku._id, J).value
|
|
1220
|
-
)) + " " +
|
|
1220
|
+
)) + " " + _(w(T, G)), 1)
|
|
1221
1221
|
])
|
|
1222
1222
|
]),
|
|
1223
1223
|
_: 2
|
|
@@ -1232,19 +1232,19 @@ const je = {
|
|
|
1232
1232
|
}, 8, ["modelValue"]);
|
|
1233
1233
|
};
|
|
1234
1234
|
}
|
|
1235
|
-
}),
|
|
1235
|
+
}), Pn = { class: "p-16" }, Rn = { class: "fm-typo-en-body-md-600 flex-grow" }, On = { class: "flex-grow text-fm-color-typo-secondary" }, Nn = {
|
|
1236
1236
|
key: 0,
|
|
1237
1237
|
class: "my-5"
|
|
1238
|
-
},
|
|
1238
|
+
}, Ln = { class: "text-neutral-400" }, zn = { class: "flex-grow" }, Yn = { class: "flex gap-1" }, Gn = { class: "flex flex-col gap-1" }, Kn = {
|
|
1239
1239
|
key: 1,
|
|
1240
1240
|
class: "t-system text-fsecondary"
|
|
1241
|
-
},
|
|
1241
|
+
}, Wn = {
|
|
1242
1242
|
key: 2,
|
|
1243
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"
|
|
1244
|
-
},
|
|
1244
|
+
}, qn = {
|
|
1245
1245
|
key: 1,
|
|
1246
1246
|
class: "shrink-0 text-fm-color-typo-secondary"
|
|
1247
|
-
},
|
|
1247
|
+
}, Xn = /* @__PURE__ */ ce({
|
|
1248
1248
|
__name: "StockRecordCard",
|
|
1249
1249
|
props: {
|
|
1250
1250
|
record: {},
|
|
@@ -1252,35 +1252,35 @@ const je = {
|
|
|
1252
1252
|
bills: { default: () => [] }
|
|
1253
1253
|
},
|
|
1254
1254
|
emits: ["refreshHistory"],
|
|
1255
|
-
setup(
|
|
1256
|
-
const c =
|
|
1255
|
+
setup(b, { emit: h }) {
|
|
1256
|
+
const c = b, o = N(!1);
|
|
1257
1257
|
at();
|
|
1258
|
-
const A = N(),
|
|
1258
|
+
const A = N(), p = N(null), m = P(() => p.value === null ? "unset" : o.value ? `${p.value}px` : "0px");
|
|
1259
1259
|
Ee(() => {
|
|
1260
1260
|
var l;
|
|
1261
|
-
|
|
1261
|
+
p.value = ((l = A.value) == null ? void 0 : l.scrollHeight) || 0;
|
|
1262
1262
|
});
|
|
1263
1263
|
const v = P(() => {
|
|
1264
1264
|
var $;
|
|
1265
|
-
const l = c.record.adjustments,
|
|
1265
|
+
const l = c.record.adjustments, s = c.sku, y = {}, w = l.flatMap((n) => {
|
|
1266
1266
|
var r;
|
|
1267
|
-
return ((r = n.skus) == null ? void 0 : r.filter((
|
|
1267
|
+
return ((r = n.skus) == null ? void 0 : r.filter((x) => x.sku._id === s._id)) ?? [];
|
|
1268
1268
|
}).flatMap((n) => n.amounts);
|
|
1269
1269
|
for (const n of w) {
|
|
1270
1270
|
const r = n.measurement ? Ft(n.measurement.conversion, n.amount) : n.amount;
|
|
1271
1271
|
y[$ = n.type] ?? (y[$] = { amount: 0, precision: 0 }), y[n.type] = et(r, y[n.type]);
|
|
1272
1272
|
}
|
|
1273
1273
|
return Object.entries(y).reduce(
|
|
1274
|
-
(n, [r,
|
|
1274
|
+
(n, [r, x]) => (n[r] = /// comment, because without it formatter makes code uglier
|
|
1275
1275
|
`${q.toFormatString({
|
|
1276
|
-
value:
|
|
1276
|
+
value: x,
|
|
1277
1277
|
precision: 4
|
|
1278
|
-
})} ${
|
|
1278
|
+
})} ${s.unit.abbrev}`, n),
|
|
1279
1279
|
{}
|
|
1280
1280
|
);
|
|
1281
|
-
}), { t:
|
|
1281
|
+
}), { t: F } = de(), C = P(() => c.record.adjustmentsByTime.map(({ date: l, adjustments: s }) => ({
|
|
1282
1282
|
time: wt(new Date(l)),
|
|
1283
|
-
adjustments:
|
|
1283
|
+
adjustments: s.flatMap(
|
|
1284
1284
|
(y) => {
|
|
1285
1285
|
var B, w;
|
|
1286
1286
|
return ((w = (B = y.skus) == null ? void 0 : B.map) == null ? void 0 : w.call(B, ($) => {
|
|
@@ -1296,7 +1296,7 @@ const je = {
|
|
|
1296
1296
|
}
|
|
1297
1297
|
).flatMap((y) => {
|
|
1298
1298
|
var $;
|
|
1299
|
-
const B = ($ = c.bills.find((n) => n._id === y.ref)) == null ? void 0 : $.seqNumber, w = B ?
|
|
1299
|
+
const B = ($ = c.bills.find((n) => n._id === y.ref)) == null ? void 0 : $.seqNumber, w = B ? F("inventory.stock.record.bill", [B]) : "";
|
|
1300
1300
|
return y.amounts.map((n) => {
|
|
1301
1301
|
var r;
|
|
1302
1302
|
return {
|
|
@@ -1315,67 +1315,67 @@ const je = {
|
|
|
1315
1315
|
});
|
|
1316
1316
|
})
|
|
1317
1317
|
})));
|
|
1318
|
-
return (l,
|
|
1318
|
+
return (l, s) => {
|
|
1319
1319
|
const y = j("FmIcon"), B = j("FmTooltip"), w = j("FmCard");
|
|
1320
|
-
return
|
|
1320
|
+
return S(), z(w, { variant: "outlined" }, {
|
|
1321
1321
|
default: I(() => [
|
|
1322
|
-
e("div",
|
|
1322
|
+
e("div", Pn, [
|
|
1323
1323
|
e("div", {
|
|
1324
1324
|
class: "flex items-center cursor-pointer mb-1",
|
|
1325
|
-
onClick:
|
|
1325
|
+
onClick: s[0] || (s[0] = ($) => o.value = !o.value)
|
|
1326
1326
|
}, [
|
|
1327
|
-
e("div",
|
|
1327
|
+
e("div", Rn, _(l.record.date), 1),
|
|
1328
1328
|
g(y, {
|
|
1329
|
-
name:
|
|
1329
|
+
name: o.value ? "expand_more" : "expand_less",
|
|
1330
1330
|
color: "#777777",
|
|
1331
1331
|
size: "md"
|
|
1332
1332
|
}, null, 8, ["name"])
|
|
1333
1333
|
]),
|
|
1334
|
-
(
|
|
1334
|
+
(S(!0), R(te, null, ie(v.value, ($, n) => (S(), R("div", {
|
|
1335
1335
|
key: n,
|
|
1336
1336
|
class: "flex flex-row py-1",
|
|
1337
1337
|
style: { "font-size": "0.8rem" }
|
|
1338
1338
|
}, [
|
|
1339
|
-
e("div",
|
|
1339
|
+
e("div", On, _(i(F)(`inventory.inventoryAdjustment.type.${n}`)), 1),
|
|
1340
1340
|
e("div", {
|
|
1341
1341
|
class: ge({
|
|
1342
1342
|
"text-fm-color-typo-error": $.startsWith("-"),
|
|
1343
1343
|
"text-fm-color-typo-success": !$.startsWith("-"),
|
|
1344
1344
|
"ml-auto": !0
|
|
1345
1345
|
})
|
|
1346
|
-
},
|
|
1346
|
+
}, _($), 3)
|
|
1347
1347
|
]))), 128)),
|
|
1348
1348
|
e("div", {
|
|
1349
1349
|
ref_key: "detailRef",
|
|
1350
1350
|
ref: A,
|
|
1351
1351
|
style: Ze({
|
|
1352
1352
|
fontSize: "0.8rem",
|
|
1353
|
-
maxHeight:
|
|
1353
|
+
maxHeight: m.value,
|
|
1354
1354
|
overflow: "hidden",
|
|
1355
1355
|
transition: "max-height 0.2s ease-out"
|
|
1356
1356
|
})
|
|
1357
1357
|
}, [
|
|
1358
|
-
C.value.length ? (
|
|
1359
|
-
(
|
|
1358
|
+
C.value.length ? (S(), R("hr", Nn)) : oe("", !0),
|
|
1359
|
+
(S(!0), R(te, null, ie(C.value, ($) => (S(), R("div", {
|
|
1360
1360
|
key: $.time,
|
|
1361
1361
|
class: "flex gap-1 w-full"
|
|
1362
1362
|
}, [
|
|
1363
|
-
e("div",
|
|
1364
|
-
e("div",
|
|
1365
|
-
(
|
|
1363
|
+
e("div", Ln, _($.time), 1),
|
|
1364
|
+
e("div", zn, [
|
|
1365
|
+
(S(!0), R(te, null, ie($.adjustments, (n) => (S(), R("div", {
|
|
1366
1366
|
key: n.name,
|
|
1367
1367
|
class: "flex gap-1"
|
|
1368
1368
|
}, [
|
|
1369
|
-
e("div",
|
|
1370
|
-
ue(
|
|
1371
|
-
n.backdateFrom ? (
|
|
1369
|
+
e("div", Yn, [
|
|
1370
|
+
ue(_(i(F)(`inventory.inventoryAdjustment.type.${n.name}`)) + " ", 1),
|
|
1371
|
+
n.backdateFrom ? (S(), z(B, {
|
|
1372
1372
|
key: 0,
|
|
1373
1373
|
variant: "plain",
|
|
1374
1374
|
placement: "top",
|
|
1375
1375
|
"z-index": 50
|
|
1376
1376
|
}, {
|
|
1377
1377
|
content: I(() => [
|
|
1378
|
-
e("div",
|
|
1378
|
+
e("div", Gn, _(i(F)("inventory.stock.record.backdate", [
|
|
1379
1379
|
i(tt)(new Date(n.backdateFrom))
|
|
1380
1380
|
])), 1)
|
|
1381
1381
|
]),
|
|
@@ -1387,9 +1387,9 @@ const je = {
|
|
|
1387
1387
|
})
|
|
1388
1388
|
]),
|
|
1389
1389
|
_: 2
|
|
1390
|
-
}, 1024)) :
|
|
1391
|
-
n.remark ? (
|
|
1392
|
-
n.name === i(
|
|
1390
|
+
}, 1024)) : oe("", !0),
|
|
1391
|
+
n.remark ? (S(), R("span", Kn, " # " + _(n.remark), 1)) : oe("", !0),
|
|
1392
|
+
n.name === i(se).Enum.CLOSING ? (S(), R("span", Wn, " Actual Balance: " + _(n.toBalance) + " " + _(n.baseUnit), 1)) : oe("", !0)
|
|
1393
1393
|
]),
|
|
1394
1394
|
e("div", {
|
|
1395
1395
|
class: ge({
|
|
@@ -1397,13 +1397,13 @@ const je = {
|
|
|
1397
1397
|
"text-fm-color-typo-success": !n.amount.startsWith("-"),
|
|
1398
1398
|
"ml-auto": !0
|
|
1399
1399
|
})
|
|
1400
|
-
},
|
|
1401
|
-
n.name === i(
|
|
1400
|
+
}, _(n.amount), 3),
|
|
1401
|
+
n.name === i(se).Enum.WASTAGE ? (S(), z(Hn, {
|
|
1402
1402
|
key: 0,
|
|
1403
1403
|
adjustmentId: n.adjustmentId,
|
|
1404
|
-
onRefreshHistory:
|
|
1405
|
-
}, null, 8, ["adjustmentId"])) :
|
|
1406
|
-
n.cost ? (
|
|
1404
|
+
onRefreshHistory: s[1] || (s[1] = (r) => l.$emit("refreshHistory"))
|
|
1405
|
+
}, null, 8, ["adjustmentId"])) : oe("", !0),
|
|
1406
|
+
n.cost ? (S(), R("div", qn, " (" + _(i(ke)(n.cost, !1, n.cost.precision)) + ") ", 1)) : oe("", !0)
|
|
1407
1407
|
]))), 128))
|
|
1408
1408
|
])
|
|
1409
1409
|
]))), 128))
|
|
@@ -1415,58 +1415,58 @@ const je = {
|
|
|
1415
1415
|
};
|
|
1416
1416
|
}
|
|
1417
1417
|
});
|
|
1418
|
-
function
|
|
1419
|
-
var
|
|
1420
|
-
const c = Object.keys(
|
|
1421
|
-
(
|
|
1418
|
+
function Qn(b, h) {
|
|
1419
|
+
var p;
|
|
1420
|
+
const c = Object.keys(se.enum).reduce(
|
|
1421
|
+
(m, v) => (m[v] = { amount: 0, precision: 0 }, m),
|
|
1422
1422
|
{}
|
|
1423
1423
|
);
|
|
1424
1424
|
if (!h)
|
|
1425
1425
|
return Object.entries(c).reduce(
|
|
1426
|
-
(
|
|
1426
|
+
(m, [v]) => (m[v] = q.fromNumber(0), m),
|
|
1427
1427
|
{}
|
|
1428
1428
|
);
|
|
1429
|
-
const A =
|
|
1429
|
+
const A = b.flatMap((m) => {
|
|
1430
1430
|
var v;
|
|
1431
|
-
return ((v =
|
|
1432
|
-
}).flatMap((
|
|
1433
|
-
for (const
|
|
1434
|
-
const v =
|
|
1435
|
-
c[
|
|
1431
|
+
return ((v = m.skus) == null ? void 0 : v.filter((F) => F.sku._id === h._id)) ?? [];
|
|
1432
|
+
}).flatMap((m) => m.amounts);
|
|
1433
|
+
for (const m of A) {
|
|
1434
|
+
const v = m.measurement ? q.multiply([m.measurement.conversion, m.amount]) : m.amount;
|
|
1435
|
+
c[p = m.type] ?? (c[p] = { amount: 0, precision: 0 }), c[m.type] = q.add([v, c[m.type]]);
|
|
1436
1436
|
}
|
|
1437
1437
|
return Object.entries(c).reduce(
|
|
1438
|
-
(
|
|
1438
|
+
(m, [v, F]) => {
|
|
1439
1439
|
const C = {
|
|
1440
|
-
...
|
|
1441
|
-
amount: Math.abs(
|
|
1440
|
+
...F,
|
|
1441
|
+
amount: Math.abs(F.amount)
|
|
1442
1442
|
};
|
|
1443
|
-
return
|
|
1443
|
+
return m[v] = /// comment, because without it formatter makes code uglier
|
|
1444
1444
|
`${q.toFormatString({
|
|
1445
1445
|
value: C,
|
|
1446
1446
|
precision: 4
|
|
1447
|
-
})} ${h.unit.abbrev}`,
|
|
1447
|
+
})} ${h.unit.abbrev}`, m;
|
|
1448
1448
|
},
|
|
1449
1449
|
{}
|
|
1450
1450
|
);
|
|
1451
1451
|
}
|
|
1452
|
-
function Jn(
|
|
1452
|
+
function Jn(b, h) {
|
|
1453
1453
|
if (!h)
|
|
1454
1454
|
return null;
|
|
1455
1455
|
let c = null;
|
|
1456
|
-
const A =
|
|
1457
|
-
var
|
|
1458
|
-
return ((
|
|
1459
|
-
}).flatMap((
|
|
1460
|
-
var
|
|
1461
|
-
return !
|
|
1456
|
+
const A = b.flatMap((p) => {
|
|
1457
|
+
var m;
|
|
1458
|
+
return ((m = p.skus) == null ? void 0 : m.filter((v) => v.sku._id === h._id)) ?? [];
|
|
1459
|
+
}).flatMap((p) => {
|
|
1460
|
+
var m;
|
|
1461
|
+
return !p.history || ((m = p.history) == null ? void 0 : m.length) === 0 ? [] : p.history[0];
|
|
1462
1462
|
});
|
|
1463
|
-
for (const
|
|
1464
|
-
const
|
|
1465
|
-
for (const v of
|
|
1466
|
-
if (v.type !==
|
|
1463
|
+
for (const p of A) {
|
|
1464
|
+
const m = p.amounts;
|
|
1465
|
+
for (const v of m) {
|
|
1466
|
+
if (v.type !== se.Enum.SALES)
|
|
1467
1467
|
continue;
|
|
1468
|
-
const
|
|
1469
|
-
c ?? (c = q.fromNumber(0)), c = q.add([c,
|
|
1468
|
+
const F = v.measurement ? q.multiply([v.measurement.conversion, v.amount]) : v.amount;
|
|
1469
|
+
c ?? (c = q.fromNumber(0)), c = q.add([c, F]);
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
1472
|
return c != null ? (c.amount = Math.abs(c.amount), `${q.toFormatString({
|
|
@@ -1474,128 +1474,128 @@ function Jn(_, h) {
|
|
|
1474
1474
|
precision: 4
|
|
1475
1475
|
})} ${h.unit.abbrev}`) : null;
|
|
1476
1476
|
}
|
|
1477
|
-
const
|
|
1477
|
+
const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = { class: "flex-1 line-clamp-2" }, to = { class: "flex flex-col gap-32 w-full h-full" }, no = { class: "flex items-center relative gap-4" }, oo = { class: "flex-1" }, so = {
|
|
1478
1478
|
key: 0,
|
|
1479
1479
|
class: "flex-1 flex flex-col items-center gap-16"
|
|
1480
|
-
},
|
|
1480
|
+
}, ao = { class: "fm-typo-en-body-lg-400 translate-x-4" }, lo = {
|
|
1481
1481
|
key: 1,
|
|
1482
1482
|
class: "flex flex-col gap-12"
|
|
1483
|
-
},
|
|
1483
|
+
}, ro = { class: "pb-16" }, io = { class: "fm-typo-cn-body-lg-600" }, uo = {
|
|
1484
1484
|
class: "grid gap-12 fm-typo-en-body-md-400",
|
|
1485
1485
|
style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
|
|
1486
|
-
},
|
|
1486
|
+
}, co = { class: "flex flex-col gap-1" }, mo = { class: "text-fm-color-typo-secondary" }, po = { class: "font-bold" }, fo = { class: "flex flex-col gap-1" }, vo = { class: "text-fm-color-typo-secondary flex" }, yo = { class: "font-bold" }, _o = { class: "flex flex-col gap-1" }, bo = { class: "text-fm-color-typo-secondary" }, ko = { class: "font-bold" }, ho = { class: "flex flex-col gap-1" }, go = { class: "text-fm-color-typo-secondary" }, xo = { class: "font-bold" }, So = { class: "flex flex-col gap-1" }, Fo = { class: "text-fm-color-typo-secondary" }, wo = { class: "font-bold" }, $o = { class: "flex flex-col gap-1" }, Ao = { class: "text-fm-color-typo-secondary" }, Vo = { class: "font-bold" }, Co = { class: "flex flex-col gap-1" }, Bo = { class: "text-fm-color-typo-secondary" }, Mo = { class: "font-bold" }, Do = { class: "flex flex-col gap-1" }, jo = { class: "text-fm-color-typo-secondary" }, Io = { class: "font-bold" }, To = { class: "flex flex-col gap-1" }, Uo = { class: "text-fm-color-typo-secondary" }, Eo = { class: "font-bold" }, Ho = {
|
|
1487
1487
|
key: 0,
|
|
1488
1488
|
class: "flex flex-col gap-8"
|
|
1489
|
-
},
|
|
1489
|
+
}, Po = { class: "flex" }, Ro = { class: "flex-1 flex flex-col gap-1" }, Oo = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, No = { class: "font-bold" }, Lo = { class: "flex-1 flex flex-col gap-1" }, zo = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Yo = { class: "flex flex-col gap-1" }, Go = { class: "font-bold" }, Ko = {
|
|
1490
1490
|
key: 2,
|
|
1491
1491
|
class: "flex-1 flex flex-col items-center gap-8"
|
|
1492
|
-
},
|
|
1492
|
+
}, Wo = ["src"], qo = { class: "font-bold text-lg" }, Xo = { class: "text-xs text-neutral-400 text-center" }, Qo = /* @__PURE__ */ ce({
|
|
1493
1493
|
__name: "StockHistory",
|
|
1494
1494
|
props: {
|
|
1495
1495
|
sku: {},
|
|
1496
1496
|
show: { type: Boolean }
|
|
1497
1497
|
},
|
|
1498
1498
|
emits: ["update:show"],
|
|
1499
|
-
setup(
|
|
1500
|
-
const h = at(), c = Re(),
|
|
1499
|
+
setup(b) {
|
|
1500
|
+
const h = at(), c = Re(), o = ye(), A = An(), p = pe(), m = Ct(), { t: v } = de(), F = b, C = N(!1), l = _e(), s = N($t(0));
|
|
1501
1501
|
async function y() {
|
|
1502
1502
|
C.value = !0;
|
|
1503
1503
|
try {
|
|
1504
|
-
await
|
|
1504
|
+
await x(), await c.readStockBalance();
|
|
1505
1505
|
} catch (t) {
|
|
1506
1506
|
l.open({
|
|
1507
1507
|
title: "Something went wrong",
|
|
1508
1508
|
message: "Cannot fetch stock history. Please try again.",
|
|
1509
1509
|
type: "error"
|
|
1510
|
-
}), console.log("failed at fetching item adjustment history",
|
|
1510
|
+
}), console.log("failed at fetching item adjustment history", F.sku, s, t);
|
|
1511
1511
|
} finally {
|
|
1512
1512
|
C.value = !1;
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
1515
1515
|
Ee(() => {
|
|
1516
1516
|
y();
|
|
1517
|
-
}), xe([() =>
|
|
1517
|
+
}), xe([() => s.value, () => F.sku], () => {
|
|
1518
1518
|
y();
|
|
1519
1519
|
});
|
|
1520
1520
|
const B = N([]), w = N([]), $ = N(new Array());
|
|
1521
|
-
function n(t,
|
|
1522
|
-
return
|
|
1521
|
+
function n(t, a) {
|
|
1522
|
+
return a === "day" ? It(t) : tt(t);
|
|
1523
1523
|
}
|
|
1524
|
-
function r(t,
|
|
1525
|
-
const
|
|
1526
|
-
(u,
|
|
1527
|
-
const V =
|
|
1524
|
+
function r(t, a) {
|
|
1525
|
+
const d = t.reduce(
|
|
1526
|
+
(u, f) => {
|
|
1527
|
+
const V = f.effectiveAt ?? ot(f._id);
|
|
1528
1528
|
if (!V)
|
|
1529
1529
|
return u;
|
|
1530
|
-
const E = n(new Date(V),
|
|
1531
|
-
return u[E] ?? (u[E] = []), u[E].push(
|
|
1530
|
+
const E = n(new Date(V), a);
|
|
1531
|
+
return u[E] ?? (u[E] = []), u[E].push(f), u;
|
|
1532
1532
|
},
|
|
1533
1533
|
{}
|
|
1534
1534
|
);
|
|
1535
|
-
return Object.keys(
|
|
1535
|
+
return Object.keys(d).map((u) => ({
|
|
1536
1536
|
date: u,
|
|
1537
|
-
adjustments:
|
|
1537
|
+
adjustments: d[u]
|
|
1538
1538
|
}));
|
|
1539
1539
|
}
|
|
1540
|
-
async function
|
|
1541
|
-
let t = await
|
|
1542
|
-
|
|
1543
|
-
Bt(new Date(
|
|
1544
|
-
Mt(new Date(
|
|
1540
|
+
async function x() {
|
|
1541
|
+
let t = await o.readStockAdjustment(
|
|
1542
|
+
F.sku._id,
|
|
1543
|
+
Bt(new Date(s.value.startDate)).toISOString(),
|
|
1544
|
+
Mt(new Date(s.value.endDate)).toISOString()
|
|
1545
1545
|
);
|
|
1546
1546
|
B.value = t;
|
|
1547
|
-
const
|
|
1548
|
-
await M(
|
|
1549
|
-
date:
|
|
1547
|
+
const a = t.filter(({ ref: d }) => d == null ? void 0 : d.startsWith("bill_")).map(({ ref: d }) => d);
|
|
1548
|
+
await M(a), w.value = r(t, "day").map(({ date: d, adjustments: u }) => ({
|
|
1549
|
+
date: d,
|
|
1550
1550
|
adjustments: u,
|
|
1551
1551
|
adjustmentsByTime: r(u, "minute")
|
|
1552
1552
|
}));
|
|
1553
1553
|
}
|
|
1554
1554
|
async function M(t) {
|
|
1555
|
-
t.length && ($.value = await A.findBillsById(t).catch((
|
|
1556
|
-
var
|
|
1557
|
-
console.error("Error on using latest bill API, retrying using legacy api",
|
|
1558
|
-
const
|
|
1559
|
-
return A.findBillsByBusinessId(
|
|
1555
|
+
t.length && ($.value = await A.findBillsById(t).catch((a) => {
|
|
1556
|
+
var f;
|
|
1557
|
+
console.error("Error on using latest bill API, retrying using legacy api", a);
|
|
1558
|
+
const d = ((f = h.currentBusiness.value) == null ? void 0 : f._id) ?? "", u = p.currentLocation.doc._id;
|
|
1559
|
+
return A.findBillsByBusinessId(d, [u], t);
|
|
1560
1560
|
}));
|
|
1561
1561
|
}
|
|
1562
1562
|
const D = P(() => {
|
|
1563
|
-
const t = B.value,
|
|
1564
|
-
return
|
|
1563
|
+
const t = B.value, a = F.sku;
|
|
1564
|
+
return Qn(t, a);
|
|
1565
1565
|
}), H = P(() => {
|
|
1566
|
-
const t = B.value,
|
|
1567
|
-
return Jn(t,
|
|
1568
|
-
}),
|
|
1569
|
-
const t = [...B.value].computeFirst((
|
|
1570
|
-
var
|
|
1571
|
-
const u = (V = (
|
|
1566
|
+
const t = B.value, a = F.sku;
|
|
1567
|
+
return Jn(t, a);
|
|
1568
|
+
}), O = P(() => {
|
|
1569
|
+
const t = [...B.value].computeFirst((d) => {
|
|
1570
|
+
var f, V;
|
|
1571
|
+
const u = (V = (f = d.skus) == null ? void 0 : f.find) == null ? void 0 : V.call(f, (E) => E.sku._id === F.sku._id);
|
|
1572
1572
|
return u == null ? void 0 : u.fromBalance;
|
|
1573
1573
|
}) ?? {
|
|
1574
1574
|
amount: 0,
|
|
1575
1575
|
precision: 0
|
|
1576
|
-
},
|
|
1577
|
-
return
|
|
1576
|
+
}, a = F.sku;
|
|
1577
|
+
return a ? `${q.toFormatString({
|
|
1578
1578
|
value: t,
|
|
1579
1579
|
precision: 4
|
|
1580
|
-
})} ${
|
|
1580
|
+
})} ${a.unit.abbrev}` : "";
|
|
1581
1581
|
}), Q = P(() => {
|
|
1582
|
-
const t = [...B.value].reverse().computeFirst((
|
|
1583
|
-
var
|
|
1584
|
-
const u = (V = (
|
|
1582
|
+
const t = [...B.value].reverse().computeFirst((d) => {
|
|
1583
|
+
var f, V;
|
|
1584
|
+
const u = (V = (f = d.skus) == null ? void 0 : f.find) == null ? void 0 : V.call(f, (E) => E.sku._id === F.sku._id);
|
|
1585
1585
|
return u == null ? void 0 : u.toBalance;
|
|
1586
1586
|
}) ?? {
|
|
1587
1587
|
amount: 0,
|
|
1588
1588
|
precision: 0
|
|
1589
|
-
},
|
|
1590
|
-
return
|
|
1589
|
+
}, a = F.sku;
|
|
1590
|
+
return a ? `${q.toFormatString({ value: t, precision: 4 })} ${a.unit.abbrev}` : "";
|
|
1591
1591
|
}), X = P(() => {
|
|
1592
|
-
var
|
|
1593
|
-
const
|
|
1594
|
-
var
|
|
1595
|
-
return ((
|
|
1592
|
+
var d;
|
|
1593
|
+
const a = B.value.flatMap((u) => {
|
|
1594
|
+
var f;
|
|
1595
|
+
return ((f = u.skus) == null ? void 0 : f.flatMap((V) => V.amounts)) ?? [];
|
|
1596
1596
|
}).filter((u) => u.amount.amount < 0).reduce(
|
|
1597
|
-
(u,
|
|
1598
|
-
const V =
|
|
1597
|
+
(u, f) => {
|
|
1598
|
+
const V = f.cost;
|
|
1599
1599
|
if (!V) return u;
|
|
1600
1600
|
const E = {
|
|
1601
1601
|
...At(u, Math.max(u.precision, V.precision)),
|
|
@@ -1609,96 +1609,96 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
|
|
|
1609
1609
|
{
|
|
1610
1610
|
amount: 0,
|
|
1611
1611
|
precision: 0,
|
|
1612
|
-
currency: Be((
|
|
1612
|
+
currency: Be((d = h.currentCountry) == null ? void 0 : d.value)
|
|
1613
1613
|
}
|
|
1614
1614
|
);
|
|
1615
|
-
return
|
|
1615
|
+
return ke(a, !1, a.precision);
|
|
1616
1616
|
});
|
|
1617
1617
|
function T() {
|
|
1618
|
-
const { startDate: t, endDate:
|
|
1619
|
-
t !== null &&
|
|
1618
|
+
const { startDate: t, endDate: a } = Dt(s.value);
|
|
1619
|
+
t !== null && a !== null && (s.value = {
|
|
1620
1620
|
startDate: t,
|
|
1621
|
-
endDate:
|
|
1621
|
+
endDate: a
|
|
1622
1622
|
});
|
|
1623
1623
|
}
|
|
1624
|
-
const L = P(() =>
|
|
1625
|
-
var E,
|
|
1624
|
+
const L = P(() => F.sku.valuation === We.Enum.FIFO ? v("inventory.ingredient.valuationMethod.FIFO") : v("inventory.ingredient.valuationMethod.WAVG")), G = P(() => {
|
|
1625
|
+
var E, K, ae, U;
|
|
1626
1626
|
const t = [...B.value].reverse().computeFirst((Y) => {
|
|
1627
|
-
var
|
|
1628
|
-
return (
|
|
1627
|
+
var W, Z;
|
|
1628
|
+
return (Z = (W = Y.skus) == null ? void 0 : W.find) == null ? void 0 : Z.call(W, (le) => le.sku._id === F.sku._id);
|
|
1629
1629
|
});
|
|
1630
1630
|
if (!t) return "No data";
|
|
1631
|
-
const
|
|
1632
|
-
amount: ((E =
|
|
1633
|
-
precision: ((
|
|
1634
|
-
}, u =
|
|
1631
|
+
const a = [...t.amounts].reverse()[0], d = {
|
|
1632
|
+
amount: ((E = a.cost) == null ? void 0 : E.amount) ?? 0,
|
|
1633
|
+
precision: ((K = a.cost) == null ? void 0 : K.precision) ?? 0
|
|
1634
|
+
}, u = a.amount, f = u.amount == 0 ? q.fromNumber(0) : q.divide([d, u]);
|
|
1635
1635
|
return {
|
|
1636
|
-
...q.multiply([
|
|
1637
|
-
currency: ((
|
|
1636
|
+
...q.multiply([f, u]),
|
|
1637
|
+
currency: ((ae = a.cost) == null ? void 0 : ae.currency) || Be(((U = h.currentCountry) == null ? void 0 : U.value) ?? Vt)
|
|
1638
1638
|
};
|
|
1639
1639
|
}), J = P(() => {
|
|
1640
|
-
var
|
|
1640
|
+
var d;
|
|
1641
1641
|
const t = [...B.value].reverse().computeFirst((u) => {
|
|
1642
1642
|
var V, E;
|
|
1643
|
-
const
|
|
1644
|
-
return
|
|
1643
|
+
const f = (E = (V = u.skus) == null ? void 0 : V.find) == null ? void 0 : E.call(V, (K) => K.sku._id === F.sku._id);
|
|
1644
|
+
return f == null ? void 0 : f.toCostBalances;
|
|
1645
1645
|
});
|
|
1646
1646
|
return t ? {
|
|
1647
|
-
...t.reduce((u,
|
|
1647
|
+
...t.reduce((u, f) => q.add([u, q.fromDinero(f.cost)]), {
|
|
1648
1648
|
amount: 0,
|
|
1649
1649
|
precision: 0
|
|
1650
1650
|
}),
|
|
1651
|
-
currency: Be((
|
|
1651
|
+
currency: Be((d = h.currentCountry) == null ? void 0 : d.value)
|
|
1652
1652
|
} : "No data";
|
|
1653
1653
|
});
|
|
1654
|
-
function
|
|
1655
|
-
const { startDate: t, endDate:
|
|
1656
|
-
t !== null &&
|
|
1654
|
+
function ne() {
|
|
1655
|
+
const { startDate: t, endDate: a } = jt(s.value);
|
|
1656
|
+
t !== null && a !== null && (s.value = {
|
|
1657
1657
|
startDate: t,
|
|
1658
|
-
endDate:
|
|
1658
|
+
endDate: a
|
|
1659
1659
|
});
|
|
1660
1660
|
}
|
|
1661
|
-
const k = Ne(
|
|
1662
|
-
return (t,
|
|
1663
|
-
const
|
|
1664
|
-
return
|
|
1661
|
+
const k = Ne(F, "show");
|
|
1662
|
+
return (t, a) => {
|
|
1663
|
+
const d = j("FmButton"), u = j("FmField"), f = j("FmDateRangePicker"), V = j("FmSpacer"), E = j("FmCircularProgress"), K = j("FmIcon"), ae = j("FmTooltip"), U = j("FmMenuDivider"), Y = j("FmChip"), W = j("FmCardSection"), Z = j("FmCard"), le = j("FmSideSheet");
|
|
1664
|
+
return S(), z(le, {
|
|
1665
1665
|
"dismiss-away": "",
|
|
1666
1666
|
modelValue: i(k),
|
|
1667
|
-
"onUpdate:modelValue":
|
|
1667
|
+
"onUpdate:modelValue": a[4] || (a[4] = (ee) => Ue(k) ? k.value = ee : null),
|
|
1668
1668
|
"close-button": !1,
|
|
1669
1669
|
"max-width": 560
|
|
1670
1670
|
}, {
|
|
1671
1671
|
"side-sheet-header": I(() => [
|
|
1672
|
-
e("div",
|
|
1673
|
-
e("div",
|
|
1674
|
-
g(
|
|
1672
|
+
e("div", Zn, [
|
|
1673
|
+
e("div", eo, _(i(v)("inventory.stock.history.title", [t.sku.name])), 1),
|
|
1674
|
+
g(d, {
|
|
1675
1675
|
variant: "tertiary",
|
|
1676
1676
|
"prepend-icon": "close",
|
|
1677
|
-
onClick:
|
|
1677
|
+
onClick: a[0] || (a[0] = (ee) => k.value = !1)
|
|
1678
1678
|
})
|
|
1679
1679
|
])
|
|
1680
1680
|
]),
|
|
1681
1681
|
default: I(() => {
|
|
1682
|
-
var
|
|
1682
|
+
var ee;
|
|
1683
1683
|
return [
|
|
1684
|
-
e("div",
|
|
1685
|
-
e("div",
|
|
1686
|
-
e("div",
|
|
1687
|
-
g(
|
|
1688
|
-
modelValue:
|
|
1689
|
-
"onUpdate:modelValue":
|
|
1684
|
+
e("div", to, [
|
|
1685
|
+
e("div", no, [
|
|
1686
|
+
e("div", oo, [
|
|
1687
|
+
g(f, {
|
|
1688
|
+
modelValue: s.value,
|
|
1689
|
+
"onUpdate:modelValue": a[1] || (a[1] = (re) => s.value = re),
|
|
1690
1690
|
"show-predefined-range": "",
|
|
1691
1691
|
"start-label": "",
|
|
1692
1692
|
"end-label": "",
|
|
1693
1693
|
"z-index": 50
|
|
1694
1694
|
}, {
|
|
1695
|
-
"trigger-button": I(({ opened:
|
|
1695
|
+
"trigger-button": I(({ opened: re }) => [
|
|
1696
1696
|
g(u, {
|
|
1697
1697
|
"prepend-icon": "calendar_month",
|
|
1698
|
-
focused:
|
|
1698
|
+
focused: re
|
|
1699
1699
|
}, {
|
|
1700
1700
|
default: I(() => [
|
|
1701
|
-
ue(
|
|
1701
|
+
ue(_(s.value.startDate) + " - " + _(s.value.endDate), 1)
|
|
1702
1702
|
]),
|
|
1703
1703
|
_: 2
|
|
1704
1704
|
}, 1032, ["focused"])
|
|
@@ -1706,40 +1706,40 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
|
|
|
1706
1706
|
_: 1
|
|
1707
1707
|
}, 8, ["modelValue"])
|
|
1708
1708
|
]),
|
|
1709
|
-
g(
|
|
1709
|
+
g(d, {
|
|
1710
1710
|
variant: "tertiary",
|
|
1711
|
-
onClick:
|
|
1711
|
+
onClick: a[2] || (a[2] = (re) => T()),
|
|
1712
1712
|
"prepend-icon": "navigate_before"
|
|
1713
1713
|
}),
|
|
1714
|
-
g(
|
|
1714
|
+
g(d, {
|
|
1715
1715
|
variant: "tertiary",
|
|
1716
|
-
onClick:
|
|
1716
|
+
onClick: a[3] || (a[3] = (re) => ne()),
|
|
1717
1717
|
"prepend-icon": "navigate_next"
|
|
1718
1718
|
})
|
|
1719
1719
|
]),
|
|
1720
|
-
C.value ? (
|
|
1720
|
+
C.value ? (S(), R("div", so, [
|
|
1721
1721
|
g(V),
|
|
1722
1722
|
g(E, { size: "xl" }),
|
|
1723
|
-
e("div",
|
|
1723
|
+
e("div", ao, _(i(v)("inventory.stock.history.loading")), 1),
|
|
1724
1724
|
g(V),
|
|
1725
1725
|
g(V)
|
|
1726
|
-
])) : w.value && ((
|
|
1727
|
-
g(
|
|
1726
|
+
])) : w.value && ((ee = w.value) == null ? void 0 : ee.length) > 0 ? (S(), R("div", lo, [
|
|
1727
|
+
g(Z, { variant: "outlined" }, {
|
|
1728
1728
|
default: I(() => [
|
|
1729
|
-
g(
|
|
1729
|
+
g(W, { class: "flex flex-col gap-4" }, {
|
|
1730
1730
|
default: I(() => [
|
|
1731
|
-
e("div",
|
|
1732
|
-
e("div",
|
|
1731
|
+
e("div", ro, [
|
|
1732
|
+
e("div", io, _(i(v)("inventory.stock.history.summary.title")), 1)
|
|
1733
1733
|
]),
|
|
1734
|
-
e("div",
|
|
1735
|
-
e("div",
|
|
1736
|
-
e("div",
|
|
1737
|
-
e("div",
|
|
1734
|
+
e("div", uo, [
|
|
1735
|
+
e("div", co, [
|
|
1736
|
+
e("div", mo, _(i(v)("inventory.stock.history.summary.totalPurchase")), 1),
|
|
1737
|
+
e("div", po, _(D.value.PURCHASE), 1)
|
|
1738
1738
|
]),
|
|
1739
|
-
e("div",
|
|
1740
|
-
e("div",
|
|
1741
|
-
ue(
|
|
1742
|
-
H.value != null ? (
|
|
1739
|
+
e("div", fo, [
|
|
1740
|
+
e("div", vo, [
|
|
1741
|
+
ue(_(i(v)("inventory.stock.history.summary.totalSales")) + " ", 1),
|
|
1742
|
+
H.value != null ? (S(), z(ae, {
|
|
1743
1743
|
key: 0,
|
|
1744
1744
|
variant: "plain",
|
|
1745
1745
|
placement: "top",
|
|
@@ -1747,61 +1747,61 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
|
|
|
1747
1747
|
"z-index": 50
|
|
1748
1748
|
}, {
|
|
1749
1749
|
default: I(() => [
|
|
1750
|
-
g(
|
|
1750
|
+
g(K, {
|
|
1751
1751
|
name: "warning",
|
|
1752
1752
|
size: "sm"
|
|
1753
1753
|
})
|
|
1754
1754
|
]),
|
|
1755
1755
|
_: 1
|
|
1756
|
-
}, 8, ["content"])) :
|
|
1756
|
+
}, 8, ["content"])) : oe("", !0)
|
|
1757
1757
|
]),
|
|
1758
|
-
e("div",
|
|
1758
|
+
e("div", yo, _(D.value.SALES), 1)
|
|
1759
1759
|
]),
|
|
1760
|
-
e("div",
|
|
1761
|
-
e("div",
|
|
1762
|
-
e("div", ko,
|
|
1760
|
+
e("div", _o, [
|
|
1761
|
+
e("div", bo, _(i(v)("inventory.stock.history.summary.totalLose")), 1),
|
|
1762
|
+
e("div", ko, _(D.value.LOSE), 1)
|
|
1763
1763
|
]),
|
|
1764
|
-
e("div",
|
|
1765
|
-
e("div",
|
|
1766
|
-
e("div",
|
|
1764
|
+
e("div", ho, [
|
|
1765
|
+
e("div", go, _(i(v)("inventory.stock.history.summary.totalRequest")), 1),
|
|
1766
|
+
e("div", xo, _(D.value.REQUEST), 1)
|
|
1767
1767
|
]),
|
|
1768
|
-
e("div",
|
|
1769
|
-
e("div",
|
|
1770
|
-
e("div",
|
|
1768
|
+
e("div", So, [
|
|
1769
|
+
e("div", Fo, _(i(v)("inventory.stock.history.summary.totalReceive")), 1),
|
|
1770
|
+
e("div", wo, _(D.value.RECEIVE), 1)
|
|
1771
1771
|
]),
|
|
1772
|
-
e("div",
|
|
1773
|
-
e("div",
|
|
1774
|
-
e("div",
|
|
1772
|
+
e("div", $o, [
|
|
1773
|
+
e("div", Ao, _(i(v)("inventory.stock.history.summary.totalConvert")), 1),
|
|
1774
|
+
e("div", Vo, _(D.value.CONVERT), 1)
|
|
1775
1775
|
]),
|
|
1776
|
-
e("div",
|
|
1777
|
-
e("div",
|
|
1778
|
-
e("div",
|
|
1776
|
+
e("div", Co, [
|
|
1777
|
+
e("div", Bo, _(i(v)("inventory.stock.history.summary.totalDamage")), 1),
|
|
1778
|
+
e("div", Mo, _(D.value.DAMAGE), 1)
|
|
1779
1779
|
]),
|
|
1780
|
-
e("div",
|
|
1781
|
-
e("div",
|
|
1782
|
-
e("div",
|
|
1780
|
+
e("div", Do, [
|
|
1781
|
+
e("div", jo, _(i(v)("inventory.stock.history.summary.openingBalance")), 1),
|
|
1782
|
+
e("div", Io, _(O.value), 1)
|
|
1783
1783
|
]),
|
|
1784
|
-
e("div",
|
|
1785
|
-
e("div",
|
|
1786
|
-
e("div",
|
|
1784
|
+
e("div", To, [
|
|
1785
|
+
e("div", Uo, _(i(v)("inventory.stock.history.summary.lastStockBalance")), 1),
|
|
1786
|
+
e("div", Eo, _(Q.value), 1)
|
|
1787
1787
|
])
|
|
1788
1788
|
]),
|
|
1789
|
-
i(
|
|
1789
|
+
i(m).enableTotalCost ? (S(), R("div", Ho, [
|
|
1790
1790
|
g(U, { class: "w-full" }),
|
|
1791
|
-
e("div",
|
|
1792
|
-
e("div",
|
|
1791
|
+
e("div", Po, [
|
|
1792
|
+
e("div", Ro, [
|
|
1793
1793
|
g(Xe, { "z-index": 50 }, {
|
|
1794
1794
|
default: I(() => [
|
|
1795
|
-
e("div",
|
|
1796
|
-
ue(
|
|
1797
|
-
g(
|
|
1795
|
+
e("div", Oo, [
|
|
1796
|
+
ue(_(i(v)("inventory.stock.history.estimatedValue")) + " ", 1),
|
|
1797
|
+
g(ae, {
|
|
1798
1798
|
variant: "plain",
|
|
1799
1799
|
placement: "top",
|
|
1800
1800
|
content: `[${L.value}] ${i(v)("inventory.stock.history.estimatedValueTooltip")}`,
|
|
1801
1801
|
"z-index": 50
|
|
1802
1802
|
}, {
|
|
1803
1803
|
default: I(() => [
|
|
1804
|
-
g(
|
|
1804
|
+
g(K, {
|
|
1805
1805
|
name: "help",
|
|
1806
1806
|
size: "sm"
|
|
1807
1807
|
})
|
|
@@ -1812,41 +1812,41 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
|
|
|
1812
1812
|
]),
|
|
1813
1813
|
_: 1
|
|
1814
1814
|
}),
|
|
1815
|
-
e("div",
|
|
1816
|
-
t.sku.valuation === i(We).Enum.FIFO ? (
|
|
1815
|
+
e("div", No, [
|
|
1816
|
+
t.sku.valuation === i(We).Enum.FIFO ? (S(), R(te, { key: 0 }, [
|
|
1817
1817
|
g(Y, {
|
|
1818
1818
|
label: "FIFO",
|
|
1819
1819
|
compact: ""
|
|
1820
1820
|
}),
|
|
1821
|
-
ue(" " +
|
|
1821
|
+
ue(" " + _(typeof J.value != "string" ? i(ke)(
|
|
1822
1822
|
J.value,
|
|
1823
1823
|
!1,
|
|
1824
1824
|
J.value.precision
|
|
1825
1825
|
) : J.value), 1)
|
|
1826
|
-
], 64)) : (
|
|
1827
|
-
ue(
|
|
1828
|
-
|
|
1826
|
+
], 64)) : (S(), R(te, { key: 1 }, [
|
|
1827
|
+
ue(_(typeof G.value != "string" ? i(ke)(
|
|
1828
|
+
G.value,
|
|
1829
1829
|
!1,
|
|
1830
|
-
|
|
1831
|
-
) :
|
|
1830
|
+
G.value.precision
|
|
1831
|
+
) : G.value), 1)
|
|
1832
1832
|
], 64))
|
|
1833
1833
|
])
|
|
1834
1834
|
]),
|
|
1835
|
-
e("div",
|
|
1835
|
+
e("div", Lo, [
|
|
1836
1836
|
g(Xe, { "z-index": 50 }, {
|
|
1837
1837
|
default: I(() => [
|
|
1838
|
-
e("div",
|
|
1839
|
-
ue(
|
|
1840
|
-
g(
|
|
1838
|
+
e("div", zo, [
|
|
1839
|
+
ue(_(i(v)("inventory.stock.history.costSold")) + " ", 1),
|
|
1840
|
+
g(ae, {
|
|
1841
1841
|
variant: "plain",
|
|
1842
1842
|
placement: "top",
|
|
1843
1843
|
"z-index": 50
|
|
1844
1844
|
}, {
|
|
1845
1845
|
content: I(() => [
|
|
1846
|
-
e("div",
|
|
1846
|
+
e("div", Yo, _(i(v)("inventory.stock.history.costSoldTooltip")), 1)
|
|
1847
1847
|
]),
|
|
1848
1848
|
default: I(() => [
|
|
1849
|
-
g(
|
|
1849
|
+
g(K, {
|
|
1850
1850
|
name: "help",
|
|
1851
1851
|
size: "sm"
|
|
1852
1852
|
})
|
|
@@ -1857,38 +1857,38 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
|
|
|
1857
1857
|
]),
|
|
1858
1858
|
_: 1
|
|
1859
1859
|
}),
|
|
1860
|
-
e("div",
|
|
1860
|
+
e("div", Go, _(X.value), 1)
|
|
1861
1861
|
])
|
|
1862
1862
|
])
|
|
1863
|
-
])) :
|
|
1863
|
+
])) : oe("", !0)
|
|
1864
1864
|
]),
|
|
1865
1865
|
_: 1
|
|
1866
1866
|
})
|
|
1867
1867
|
]),
|
|
1868
1868
|
_: 1
|
|
1869
1869
|
}),
|
|
1870
|
-
|
|
1871
|
-
(
|
|
1872
|
-
key:
|
|
1870
|
+
a[5] || (a[5] = e("div", null, null, -1)),
|
|
1871
|
+
(S(!0), R(te, null, ie(w.value, (re) => (S(), R(te, {
|
|
1872
|
+
key: re.date
|
|
1873
1873
|
}, [
|
|
1874
|
-
t.sku ? (
|
|
1874
|
+
t.sku ? (S(), z(Xn, {
|
|
1875
1875
|
key: 0,
|
|
1876
|
-
record:
|
|
1876
|
+
record: re,
|
|
1877
1877
|
sku: t.sku,
|
|
1878
1878
|
bills: $.value,
|
|
1879
1879
|
onRefreshHistory: y
|
|
1880
|
-
}, null, 8, ["record", "sku", "bills"])) :
|
|
1880
|
+
}, null, 8, ["record", "sku", "bills"])) : oe("", !0)
|
|
1881
1881
|
], 64))), 128))
|
|
1882
|
-
])) : (
|
|
1882
|
+
])) : (S(), R("div", Ko, [
|
|
1883
1883
|
g(V),
|
|
1884
1884
|
e("div", null, [
|
|
1885
1885
|
e("img", {
|
|
1886
|
-
src: i(
|
|
1886
|
+
src: i(Kt),
|
|
1887
1887
|
alt: "List is empty"
|
|
1888
|
-
}, null, 8,
|
|
1888
|
+
}, null, 8, Wo)
|
|
1889
1889
|
]),
|
|
1890
|
-
e("div",
|
|
1891
|
-
e("div",
|
|
1890
|
+
e("div", qo, _(i(v)("inventory.stock.history.noRecords")), 1),
|
|
1891
|
+
e("div", Xo, _(i(v)("inventory.stock.history.changeDateRange")), 1),
|
|
1892
1892
|
g(V),
|
|
1893
1893
|
g(V)
|
|
1894
1894
|
]))
|
|
@@ -1899,13 +1899,16 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
|
|
|
1899
1899
|
}, 8, ["modelValue"]);
|
|
1900
1900
|
};
|
|
1901
1901
|
}
|
|
1902
|
-
}), Jo = {
|
|
1902
|
+
}), Jo = {
|
|
1903
|
+
key: 0,
|
|
1904
|
+
class: "flex items-center gap-1"
|
|
1905
|
+
}, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, es = { class: "flex flex-col gap-8" }, ts = { class: "flex flex-col" }, ns = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, os = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ks = /* @__PURE__ */ ce({
|
|
1903
1906
|
__name: "StockView",
|
|
1904
|
-
setup(
|
|
1905
|
-
const { t: h } = de(), c = Pe(),
|
|
1906
|
-
|
|
1907
|
-
const
|
|
1908
|
-
() => new Set(
|
|
1907
|
+
setup(b) {
|
|
1908
|
+
const { t: h } = de(), c = Pe(), o = pe(), A = Re(), p = rt(), m = ye(), v = nt(), F = Tt(), { columnDefs: C } = tn(), l = Oe();
|
|
1909
|
+
o.watchLocation($);
|
|
1910
|
+
const s = P(
|
|
1911
|
+
() => new Set(F.getAvailableItems(F.businessSubsidiaryId))
|
|
1909
1912
|
), y = N(!1), B = _e();
|
|
1910
1913
|
async function w() {
|
|
1911
1914
|
l.open({
|
|
@@ -1922,7 +1925,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
|
|
|
1922
1925
|
variant: "tertiary"
|
|
1923
1926
|
}
|
|
1924
1927
|
}).onPrimary(async () => {
|
|
1925
|
-
await
|
|
1928
|
+
await m.recalculation.refreshCurrentBalances(), B.open({
|
|
1926
1929
|
title: "Refresh Stock Balance",
|
|
1927
1930
|
message: "Stock balance refresh has been queued. This may take a moment to complete.",
|
|
1928
1931
|
type: "success"
|
|
@@ -1930,7 +1933,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
|
|
|
1930
1933
|
});
|
|
1931
1934
|
}
|
|
1932
1935
|
async function $() {
|
|
1933
|
-
if (
|
|
1936
|
+
if (o._currentLocation) {
|
|
1934
1937
|
y.value = !0;
|
|
1935
1938
|
try {
|
|
1936
1939
|
await A.readStockBalance(), await A.readProductBalance(), await v.readStockEstimateBalance();
|
|
@@ -1947,12 +1950,12 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
|
|
|
1947
1950
|
}
|
|
1948
1951
|
const n = P(() => {
|
|
1949
1952
|
let T = c.skus;
|
|
1950
|
-
return
|
|
1951
|
-
var t,
|
|
1952
|
-
const
|
|
1953
|
-
let J = (
|
|
1953
|
+
return x.value && s.value && (T = c.skus.filter((L) => s.value.has(L._id))), T.map((L) => {
|
|
1954
|
+
var t, a, d;
|
|
1955
|
+
const G = L.trackingMeasurement;
|
|
1956
|
+
let J = (a = (t = A.stockBalance.skus) == null ? void 0 : t.find(
|
|
1954
1957
|
(u) => u.id === L._id
|
|
1955
|
-
)) == null ? void 0 :
|
|
1958
|
+
)) == null ? void 0 : a.balance, ne = v.inventoryForecast.skus.find(
|
|
1956
1959
|
(u) => u.id === L._id
|
|
1957
1960
|
);
|
|
1958
1961
|
return {
|
|
@@ -1961,11 +1964,11 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
|
|
|
1961
1964
|
amount: 0,
|
|
1962
1965
|
precision: 0
|
|
1963
1966
|
},
|
|
1964
|
-
day: (
|
|
1965
|
-
trackingUnitAbbrev:
|
|
1967
|
+
day: (ne == null ? void 0 : ne.depletionDays) ?? void 0,
|
|
1968
|
+
trackingUnitAbbrev: G ? ((d = L.unit.measurements.find((u) => u.id === G)) == null ? void 0 : d.abbrev) ?? "" : L.unit.abbrev
|
|
1966
1969
|
};
|
|
1967
1970
|
});
|
|
1968
|
-
}), r = N(""),
|
|
1971
|
+
}), r = N(""), x = N(!0), { breakpoints: M } = Lt(), D = P(() => M.value.xs || M.value.sm), H = P(() => D.value ? 10 : 20), O = Ut(), Q = P(() => [
|
|
1969
1972
|
{
|
|
1970
1973
|
label: h("inventory.stock.stock_balance.refreshBalance"),
|
|
1971
1974
|
value: "refresh-balance",
|
|
@@ -1988,18 +1991,18 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
|
|
|
1988
1991
|
case "refresh":
|
|
1989
1992
|
return $();
|
|
1990
1993
|
case "export":
|
|
1991
|
-
return
|
|
1994
|
+
return Qt(n.value);
|
|
1992
1995
|
}
|
|
1993
1996
|
}
|
|
1994
1997
|
return (T, L) => {
|
|
1995
|
-
const
|
|
1996
|
-
return
|
|
1998
|
+
const G = j("FmSwitch"), J = j("FmTable");
|
|
1999
|
+
return S(), z(Et, {
|
|
1997
2000
|
title: i(h)("inventory.stock.title"),
|
|
1998
2001
|
actions: Q.value,
|
|
1999
2002
|
"onClick:action": X
|
|
2000
2003
|
}, {
|
|
2001
2004
|
default: I(() => {
|
|
2002
|
-
var
|
|
2005
|
+
var ne, k, t, a;
|
|
2003
2006
|
return [
|
|
2004
2007
|
e("div", {
|
|
2005
2008
|
class: ge([
|
|
@@ -2014,53 +2017,65 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
|
|
|
2014
2017
|
searchable: "",
|
|
2015
2018
|
"change-location": "",
|
|
2016
2019
|
search: r.value,
|
|
2017
|
-
"onUpdate:search": L[
|
|
2018
|
-
},
|
|
2019
|
-
|
|
2020
|
-
|
|
2020
|
+
"onUpdate:search": L[1] || (L[1] = (d) => r.value = d)
|
|
2021
|
+
}, {
|
|
2022
|
+
default: I(() => [
|
|
2023
|
+
i(F).isEnabled ? (S(), R("div", Jo, [
|
|
2024
|
+
e("span", Zo, _(i(h)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
|
|
2025
|
+
g(Ot),
|
|
2026
|
+
g(G, {
|
|
2027
|
+
modelValue: x.value,
|
|
2028
|
+
"onUpdate:modelValue": L[0] || (L[0] = (d) => x.value = d)
|
|
2029
|
+
}, null, 8, ["modelValue"])
|
|
2030
|
+
])) : oe("", !0)
|
|
2031
|
+
]),
|
|
2032
|
+
_: 1
|
|
2033
|
+
}, 8, ["search"]),
|
|
2034
|
+
(S(), z(J, {
|
|
2035
|
+
style: Ze(i(O).tableHeight),
|
|
2021
2036
|
"column-defs": i(C),
|
|
2022
2037
|
"row-data": n.value,
|
|
2023
2038
|
"search-value": r.value,
|
|
2024
|
-
loading: y.value || !i(
|
|
2025
|
-
key: (
|
|
2026
|
-
onRowClick: L[
|
|
2039
|
+
loading: y.value || !i(o)._currentLocation,
|
|
2040
|
+
key: (ne = i(o)._currentLocation) == null ? void 0 : ne.dbName,
|
|
2041
|
+
onRowClick: L[2] || (L[2] = (d) => i(p).showSkuHistory(d.original)),
|
|
2027
2042
|
"page-size": H.value
|
|
2028
2043
|
}, {
|
|
2029
|
-
"list-row": I((
|
|
2044
|
+
"list-row": I((d) => [
|
|
2030
2045
|
g(Pt, {
|
|
2031
|
-
row:
|
|
2032
|
-
onRowClick: i(
|
|
2046
|
+
row: d,
|
|
2047
|
+
onRowClick: i(p).showSkuHistory
|
|
2033
2048
|
}, {
|
|
2034
|
-
default: I((
|
|
2035
|
-
var
|
|
2049
|
+
default: I((u) => {
|
|
2050
|
+
var f, V, E, K, ae, U, Y, W, Z, le;
|
|
2036
2051
|
return [
|
|
2037
|
-
e("div",
|
|
2038
|
-
e("div",
|
|
2039
|
-
e("div",
|
|
2052
|
+
e("div", es, [
|
|
2053
|
+
e("div", ts, [
|
|
2054
|
+
e("div", ns, [
|
|
2040
2055
|
g(i(qe), {
|
|
2041
|
-
render: (
|
|
2042
|
-
props: (
|
|
2056
|
+
render: (E = (V = (f = u.code) == null ? void 0 : f.column) == null ? void 0 : V.columnDef) == null ? void 0 : E.cell,
|
|
2057
|
+
props: (ae = (K = u.code) == null ? void 0 : K.getContext) == null ? void 0 : ae.call(K)
|
|
2043
2058
|
}, null, 8, ["render", "props"])
|
|
2044
2059
|
]),
|
|
2045
|
-
e("div",
|
|
2060
|
+
e("div", os, [
|
|
2046
2061
|
g(i(qe), {
|
|
2047
|
-
render: (
|
|
2048
|
-
props: (
|
|
2062
|
+
render: (W = (Y = (U = u.name) == null ? void 0 : U.column) == null ? void 0 : Y.columnDef) == null ? void 0 : W.cell,
|
|
2063
|
+
props: (le = (Z = u.name) == null ? void 0 : Z.getContext) == null ? void 0 : le.call(Z)
|
|
2049
2064
|
}, null, 8, ["render", "props"])
|
|
2050
2065
|
])
|
|
2051
2066
|
]),
|
|
2052
2067
|
e("div", null, [
|
|
2053
2068
|
g(Te, {
|
|
2054
|
-
days:
|
|
2069
|
+
days: d.original.day
|
|
2055
2070
|
}, null, 8, ["days"])
|
|
2056
2071
|
]),
|
|
2057
2072
|
e("div", null, [
|
|
2058
2073
|
g(lt, {
|
|
2059
2074
|
class: "xs:w-[160px]",
|
|
2060
|
-
unit:
|
|
2061
|
-
sku:
|
|
2062
|
-
amount:
|
|
2063
|
-
"default-tracking-measurement":
|
|
2075
|
+
unit: d.original.unit,
|
|
2076
|
+
sku: d.original,
|
|
2077
|
+
amount: d.original.balance,
|
|
2078
|
+
"default-tracking-measurement": d.original.trackingMeasurement ?? void 0
|
|
2064
2079
|
}, null, 8, ["unit", "sku", "amount", "default-tracking-measurement"])
|
|
2065
2080
|
])
|
|
2066
2081
|
])
|
|
@@ -2072,10 +2087,10 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
|
|
|
2072
2087
|
_: 1
|
|
2073
2088
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
2074
2089
|
], 2),
|
|
2075
|
-
(
|
|
2076
|
-
(
|
|
2077
|
-
(
|
|
2078
|
-
(
|
|
2090
|
+
(S(), z(ct, { to: "body" }, [
|
|
2091
|
+
(k = i(p).stockHistoryProps) != null && k.sku ? (S(), z(Qo, Ae(Ve({ key: 0 }, i(p).stockHistoryProps)), null, 16)) : oe("", !0),
|
|
2092
|
+
(t = i(p).convertSkuDialogProps) != null && t.sku ? (S(), z(_n, Ae(Ve({ key: 1 }, i(p).convertSkuDialogProps)), null, 16)) : oe("", !0),
|
|
2093
|
+
(a = i(p).adjustSkuDialogProps) != null && a.stock ? (S(), z($n, Ae(Ve({ key: 2 }, i(p).adjustSkuDialogProps)), null, 16)) : oe("", !0)
|
|
2079
2094
|
]))
|
|
2080
2095
|
];
|
|
2081
2096
|
}),
|
|
@@ -2085,5 +2100,5 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
|
|
|
2085
2100
|
}
|
|
2086
2101
|
});
|
|
2087
2102
|
export {
|
|
2088
|
-
|
|
2103
|
+
ks as default
|
|
2089
2104
|
};
|