@feedmepos/mf-inventory-portal 1.2.7-dev.2 → 1.2.7-dev.4
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-CBwWCCOM.js → App-C36fMhxq.js} +1 -1
- package/dist/{ApprovalView-BrRGheio.js → ApprovalView-BK-UXBwv.js} +26 -26
- package/dist/{BindingsDialog-BSPkkRis.js → BindingsDialog-C5ry8Cg7.js} +2 -2
- package/dist/{BindingsPicker-L3XnC3__.js → BindingsPicker-D1lrIB-Y.js} +1 -1
- package/dist/{BindingsTable-CgUm0Ity.js → BindingsTable-CoWyge2-.js} +1 -1
- package/dist/{ClosingDraftView-D_gq2fCk.js → ClosingDraftView-FFi85ylu.js} +203 -203
- package/dist/{ClosingTemplateView-Q16zr6EV.js → ClosingTemplateView-BvSH7TM0.js} +53 -53
- package/dist/{DeliveryOrderPrintPreview-mVDQO6Xq.js → DeliveryOrderPrintPreview-BVVWnadB.js} +9 -9
- package/dist/{FmAdminBadge-Cjy6QPoR.js → FmAdminBadge-DtBVrN_M.js} +6 -6
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DnH2Qxnr.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CSigrMC2.js} +21 -21
- package/dist/{FmMultiselectDialog-BbYhJk_O.js → FmMultiselectDialog-Df50mxnw.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-D0qlxGgo.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CdSQVfaU.js} +27 -27
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CCuLSITo.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-A7Pgq3Sl.js} +1 -1
- package/dist/{IngredientGroupView-CJ9Rsfg-.js → IngredientGroupView-BVM3Um9Z.js} +12 -12
- package/dist/IngredientsView-75ahXQeJ.js +2271 -0
- package/dist/{IntegrationView-B4giJ-Zl.js → IntegrationView-DEUOEn_W.js} +84 -84
- package/dist/{InventoryBindingForm-bNRoyTsA.js → InventoryBindingForm-C2HvBwlT.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DAaoOXUY.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CXJSFCLP.js} +41 -41
- package/dist/{InventoryBindingSummary-NfFve-nM.js → InventoryBindingSummary-B-V9QkyH.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DP11tzty.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BELqcyvD.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-yjjkBSqL.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BBE5_txM.js} +5 -5
- package/dist/{PublishView-w9GYA6kf.js → PublishView-DKkCs9F8.js} +17 -17
- package/dist/{PurchaseOrderPrintPreview-DmdDJmEq.js → PurchaseOrderPrintPreview-BvFR-uQk.js} +9 -9
- package/dist/{ReceiveRequestView-z4o7lZvK.js → ReceiveRequestView-BIrBMqdY.js} +80 -80
- package/dist/{RecipeView-DiiQtfXn.js → RecipeView-CI_Tec4J.js} +49 -49
- package/dist/{StockView-DKR2nFdm.js → StockView-Bx3lqHZg.js} +327 -327
- package/dist/{SupplierView-BJcU4iQk.js → SupplierView-BT2aZGQE.js} +1103 -1016
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-UNVxzRmJ.js → TransferDetails.vue_vue_type_script_setup_true_lang-DWdnLRCB.js} +245 -245
- package/dist/{TransferTemplateView-rCbAWlh_.js → TransferTemplateView-DQtlCFze.js} +88 -87
- package/dist/{UnitView-BW9hbVHL.js → UnitView-h61yFjgP.js} +59 -59
- package/dist/{WarehouseView-BO0hf42-.js → WarehouseView-I8GqyD2C.js} +25 -25
- package/dist/api/netsuite.d.ts +3 -0
- package/dist/api/purchase-order-template.d.ts +1 -0
- package/dist/{app-ChezCkd5.js → app-CxSrmhCK.js} +6888 -6786
- package/dist/app.d.ts +57 -0
- package/dist/app.js +3 -3
- package/dist/components/FmInventoryTableToolbar.vue.d.ts +9 -2
- package/dist/components/SubsidiaryTreeDialog.vue.d.ts +2 -0
- package/dist/{decimal-1sc-GcXN.js → decimal-DpfcXNky.js} +1 -1
- package/dist/{format-unit-display-BK2TkQOA.js → format-unit-display-xov4MvuI.js} +368 -400
- package/dist/{index-CWivxw9k.js → index-B4hWNXtZ.js} +1 -1
- package/dist/{index-cLW2Uxz3.js → index-CwzV_5fz.js} +1 -1
- package/dist/purchase-order-template-DkBl6qMP.js +41 -0
- package/dist/{stock-FEj_v-SS.js → stock-Nt176YY7.js} +1 -1
- package/dist/stores/integration/netsuite.d.ts +10 -0
- package/dist/{supplier-2r8VFThu.js → supplier-B7gAUwhb.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-CvgFQA-k.js → use-ingredient-select-dialog-9HkEvXXS.js} +5 -5
- package/dist/{use-inventory-binding-dialog-BNp88Pjt.js → use-inventory-binding-dialog-pSVgqxMM.js} +8 -8
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +16 -0
- package/dist/views/ingredients/components/ingredient-form/IngredientFormProps.d.ts +4 -0
- package/dist/views/integration/components/netsuite/business/BusinessNetSuiteSideSheet.vue.d.ts +2 -0
- package/dist/views/supplier/components/SupplierSupplyItemField.vue.d.ts +3 -0
- package/package.json +1 -1
- package/dist/IngredientsView-BbKzQnQP.js +0 -1886
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as ce, ref 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 Pt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { defineComponent as ce, ref as L, computed as R, resolveComponent as D, openBlock as x, createBlock as N, withCtx as I, createElementVNode as e, normalizeClass as ge, toDisplayString as k, createVNode as g, createElementBlock as O, Fragment as ne, renderList as le, unref as i, h as ke, watch as xe, isRef as Ue, createCommentVNode as se, reactive as it, mergeModels as Ye, useModel as ut, onMounted as Ee, createTextVNode as ue, normalizeStyle as Ze, Teleport as ct, normalizeProps as Ae, mergeProps as Ve } from "vue";
|
|
2
|
+
import { u as pe, a0 as dt, f as He, h as mt, a as Pe, F as Ge, a1 as pt, w as Ie, k as me, X as ft, t as Se, $ as Fe, A as vt, M as yt, Z as ve, a2 as _t, a3 as oe, a4 as kt, a5 as Ke, o as ht, s as bt, a6 as gt, a7 as xt, a8 as St, a9 as Ce, aa as Ft, ab as et, Y as X, ac as wt, z as tt, ad as he, ae as $t, af as At, q as Me, n as We, r as Vt, c as Ct, ag as Mt, ah as Bt, ai as Dt, aj as jt, ak as It, K as Tt, _ as Ut, L as Et, O as Ht, P as qe } from "./app-CxSrmhCK.js";
|
|
3
|
+
import { u as Re, a as ye } from "./stock-Nt176YY7.js";
|
|
4
|
+
import { g as we } from "./decimal-DpfcXNky.js";
|
|
5
|
+
import { e as Pt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BBE5_txM.js";
|
|
6
6
|
import { _ as Te, S as Be, g as st } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
|
|
7
7
|
import { _ as Rt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
8
8
|
import { useI18n as de, useCoreStore as at } from "@feedmepos/mf-common";
|
|
9
|
-
import { useSnackbar as _e, useDialog as Oe, useProxiedModel as
|
|
10
|
-
import { defineStore as
|
|
11
|
-
import { u as
|
|
12
|
-
import { _ as zt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-
|
|
9
|
+
import { useSnackbar as _e, useDialog as Oe, useProxiedModel as Le, useBreakpoints as Ot } from "@feedmepos/ui-library";
|
|
10
|
+
import { defineStore as Lt } from "pinia";
|
|
11
|
+
import { u as Nt } from "./use-inventory-binding-dialog-pSVgqxMM.js";
|
|
12
|
+
import { _ as zt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BELqcyvD.js";
|
|
13
13
|
import { E as Yt } from "./empty-placeholder-wf6-BWE8.js";
|
|
14
|
-
import { F as Gt } from "./FmAdminBadge-
|
|
14
|
+
import { F as Gt } from "./FmAdminBadge-DtBVrN_M.js";
|
|
15
15
|
import "./array-Ca8T3f_G.js";
|
|
16
16
|
var be = /* @__PURE__ */ ((y) => (y.History = "History", y.Convert = "Convert", y.Adjust = "Adjust", y))(be || {});
|
|
17
|
-
const
|
|
17
|
+
const Kt = [
|
|
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
|
+
], Wt = [
|
|
25
25
|
{
|
|
26
26
|
translationKey: "inventory.stock.action.history",
|
|
27
27
|
color: "text-neutral-700",
|
|
@@ -97,7 +97,7 @@ function $e(y, b) {
|
|
|
97
97
|
type: "unit"
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
const Xt = { class: "fm-typo-en-body-md-400 flex-grow" },
|
|
100
|
+
const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ ce({
|
|
101
101
|
__name: "UnitDisplayControl",
|
|
102
102
|
props: {
|
|
103
103
|
unit: {},
|
|
@@ -113,7 +113,7 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
113
113
|
const a = b(o.sku);
|
|
114
114
|
C ? localStorage.setItem(a, C) : localStorage.setItem(a, o.unit._id), A.value = $e(o.sku, o.unit);
|
|
115
115
|
}
|
|
116
|
-
const o = y, A =
|
|
116
|
+
const o = y, A = L($e(o.sku, o.unit)), p = R(() => {
|
|
117
117
|
const { measurements: C } = o.unit;
|
|
118
118
|
return [
|
|
119
119
|
{
|
|
@@ -134,10 +134,10 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
134
134
|
var C;
|
|
135
135
|
return ((C = p.value.find((a) => c(a))) == null ? void 0 : C.label) ?? "";
|
|
136
136
|
}
|
|
137
|
-
), $ =
|
|
137
|
+
), $ = L(!1);
|
|
138
138
|
return (C, a) => {
|
|
139
139
|
const s = D("FmIcon"), _ = D("FmMenuItem"), M = D("FmMenu");
|
|
140
|
-
return x(),
|
|
140
|
+
return x(), N(M, {
|
|
141
141
|
"stop-click-propagation": "",
|
|
142
142
|
onMenuChanged: a[0] || (a[0] = (S) => $.value = S)
|
|
143
143
|
}, {
|
|
@@ -149,7 +149,7 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
149
149
|
$.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
|
|
150
150
|
])
|
|
151
151
|
}, [
|
|
152
|
-
e("div", Xt,
|
|
152
|
+
e("div", Xt, k(v.value), 1),
|
|
153
153
|
g(s, {
|
|
154
154
|
class: "text-fm-color-neutral-gray-400",
|
|
155
155
|
name: "expand_more"
|
|
@@ -157,7 +157,7 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
157
157
|
], 2)
|
|
158
158
|
]),
|
|
159
159
|
default: I(() => [
|
|
160
|
-
(x(!0), O(ne, null,
|
|
160
|
+
(x(!0), O(ne, null, le(p.value, (S) => (x(), N(_, {
|
|
161
161
|
key: S.value ?? 0,
|
|
162
162
|
label: S.label,
|
|
163
163
|
"model-value": c(S),
|
|
@@ -172,15 +172,15 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
172
172
|
__name: "StockHeaderPreview",
|
|
173
173
|
setup(y) {
|
|
174
174
|
const { t: b } = de();
|
|
175
|
-
return (u, o) => (x(),
|
|
175
|
+
return (u, o) => (x(), N(Rt, null, {
|
|
176
176
|
default: I(() => [
|
|
177
|
-
e("div", Jt,
|
|
177
|
+
e("div", Jt, k(i(b)("inventory.stock.prediction.daysRemaining")), 1)
|
|
178
178
|
]),
|
|
179
179
|
_: 1
|
|
180
180
|
}));
|
|
181
181
|
}
|
|
182
|
-
}),
|
|
183
|
-
const y =
|
|
182
|
+
}), lt = Lt("stockActions", () => {
|
|
183
|
+
const y = L(!1), b = pe(), u = Re(), o = nt(), A = _e(), p = Oe(), { t: c } = de();
|
|
184
184
|
async function v() {
|
|
185
185
|
if (b._currentLocation) {
|
|
186
186
|
y.value = !0;
|
|
@@ -197,7 +197,7 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
const $ =
|
|
200
|
+
const $ = L();
|
|
201
201
|
async function C(F) {
|
|
202
202
|
var B, j, P;
|
|
203
203
|
if (!!!((j = (B = F.convert) == null ? void 0 : B.inventoryBindings) != null && j.length)) {
|
|
@@ -220,13 +220,13 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
220
220
|
};
|
|
221
221
|
$.value = w;
|
|
222
222
|
}
|
|
223
|
-
const a =
|
|
223
|
+
const a = L();
|
|
224
224
|
async function s(F) {
|
|
225
225
|
const n = {
|
|
226
226
|
stock: F,
|
|
227
227
|
show: !0,
|
|
228
|
-
"onUpdate:show"(
|
|
229
|
-
a.value.show =
|
|
228
|
+
"onUpdate:show"(r) {
|
|
229
|
+
a.value.show = r;
|
|
230
230
|
},
|
|
231
231
|
onSubmitted() {
|
|
232
232
|
v();
|
|
@@ -234,28 +234,28 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
234
234
|
};
|
|
235
235
|
a.value = n;
|
|
236
236
|
}
|
|
237
|
-
const _ =
|
|
237
|
+
const _ = L();
|
|
238
238
|
async function M(F) {
|
|
239
239
|
const n = {
|
|
240
240
|
sku: F,
|
|
241
241
|
show: !0,
|
|
242
|
-
"onUpdate:show"(
|
|
243
|
-
_.value.show =
|
|
242
|
+
"onUpdate:show"(r) {
|
|
243
|
+
_.value.show = r;
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
246
|
_.value = n;
|
|
247
247
|
}
|
|
248
248
|
function S(F, n) {
|
|
249
|
-
const
|
|
249
|
+
const r = He(n);
|
|
250
250
|
switch (F) {
|
|
251
251
|
case be.History:
|
|
252
|
-
M(
|
|
252
|
+
M(r);
|
|
253
253
|
return;
|
|
254
254
|
case be.Convert:
|
|
255
|
-
C(
|
|
255
|
+
C(r);
|
|
256
256
|
return;
|
|
257
257
|
case be.Adjust:
|
|
258
|
-
s(
|
|
258
|
+
s(r);
|
|
259
259
|
return;
|
|
260
260
|
}
|
|
261
261
|
}
|
|
@@ -269,7 +269,7 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
269
269
|
};
|
|
270
270
|
});
|
|
271
271
|
function Zt() {
|
|
272
|
-
const y = pe(), b =
|
|
272
|
+
const y = pe(), b = lt(), { t: u } = de();
|
|
273
273
|
return {
|
|
274
274
|
columnDefs: [
|
|
275
275
|
{
|
|
@@ -294,25 +294,25 @@ function Zt() {
|
|
|
294
294
|
amount: p.balance,
|
|
295
295
|
defaultTrackingMeasurement: p.trackingMeasurement ?? void 0
|
|
296
296
|
};
|
|
297
|
-
return
|
|
297
|
+
return ke(rt, c);
|
|
298
298
|
},
|
|
299
299
|
size: 180
|
|
300
300
|
},
|
|
301
301
|
{
|
|
302
302
|
accessorKey: "day",
|
|
303
303
|
id: "expireDate",
|
|
304
|
-
header: () =>
|
|
304
|
+
header: () => ke(Qt),
|
|
305
305
|
enableSorting: !0,
|
|
306
306
|
sortUndefined: "last",
|
|
307
307
|
cell(A) {
|
|
308
308
|
var a, s;
|
|
309
309
|
const p = A.row.original.day, c = (a = A.row.original.thresholds) == null ? void 0 : a.low, v = (s = A.row.original.thresholds) == null ? void 0 : s.mid;
|
|
310
310
|
if (typeof p != "number" || typeof c != "number" || typeof v != "number")
|
|
311
|
-
return
|
|
311
|
+
return ke(Te, {
|
|
312
312
|
days: p
|
|
313
313
|
});
|
|
314
314
|
const $ = p <= c ? Be.low : p <= v ? Be.mid : Be.high;
|
|
315
|
-
return
|
|
315
|
+
return ke(Te, {
|
|
316
316
|
days: p,
|
|
317
317
|
level: $
|
|
318
318
|
});
|
|
@@ -324,7 +324,7 @@ function Zt() {
|
|
|
324
324
|
cell(A) {
|
|
325
325
|
var p;
|
|
326
326
|
return mt(
|
|
327
|
-
((p = y._currentLocation) == null ? void 0 : p.type) === "restaurant" ?
|
|
327
|
+
((p = y._currentLocation) == null ? void 0 : p.type) === "restaurant" ? Kt : Wt,
|
|
328
328
|
(c) => b.onActionMenu(c, A.row.original)
|
|
329
329
|
);
|
|
330
330
|
},
|
|
@@ -375,7 +375,7 @@ const en = {
|
|
|
375
375
|
function Je(y) {
|
|
376
376
|
return { ...en, context: y };
|
|
377
377
|
}
|
|
378
|
-
const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-800" }, on = { class: "flex flex-col gap-24 w-full" }, sn = { class: "flex flex-col gap-8" }, an = { class: "fm-typo-en-body-lg-600" },
|
|
378
|
+
const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-800" }, on = { class: "flex flex-col gap-24 w-full" }, sn = { class: "flex flex-col gap-8" }, an = { class: "fm-typo-en-body-lg-600" }, rn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, ln = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, un = { class: "flex flex-col p-16 gap-8" }, cn = { class: "flex flex-col gap-4" }, dn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, mn = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, pn = { class: "xs:col-span-3" }, fn = { class: "flex gap-8" }, vn = /* @__PURE__ */ ce({
|
|
379
379
|
__name: "ConvertSkuDialog",
|
|
380
380
|
props: {
|
|
381
381
|
sku: {},
|
|
@@ -384,11 +384,11 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
|
|
|
384
384
|
},
|
|
385
385
|
emits: ["update:show", "submitted"],
|
|
386
386
|
setup(y, { expose: b, emit: u }) {
|
|
387
|
-
const o = y, A = u, p =
|
|
387
|
+
const o = y, A = u, p = Nt(), c = Pe(), v = ye(), $ = _e(), { t: C } = de(), a = L(0), s = L(null), _ = R(() => c.skus), M = R(
|
|
388
388
|
() => {
|
|
389
389
|
var m, t;
|
|
390
390
|
return (((t = (m = o.sku) == null ? void 0 : m.convert) == null ? void 0 : t.inventoryBindings) ?? []).filter(
|
|
391
|
-
(
|
|
391
|
+
(l) => l.type === Ge.enum.SKU
|
|
392
392
|
);
|
|
393
393
|
}
|
|
394
394
|
), S = R({
|
|
@@ -398,14 +398,14 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
|
|
|
398
398
|
set(m) {
|
|
399
399
|
m ? s.value = He(M.value) : (s.value = null, a.value = Math.min(a.value, o.maxCount ?? 0));
|
|
400
400
|
}
|
|
401
|
-
}), F =
|
|
401
|
+
}), F = L(!1);
|
|
402
402
|
xe([() => o.show], ([m]) => {
|
|
403
403
|
m && (a.value = 0);
|
|
404
404
|
});
|
|
405
405
|
function n() {
|
|
406
406
|
Y(o.sku, Se(a.value), s.value);
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function r(m) {
|
|
409
409
|
if (s.value)
|
|
410
410
|
return !0;
|
|
411
411
|
const t = Je(m).isInteger().max(o.maxCount ?? 0).error ?? "";
|
|
@@ -416,44 +416,44 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
|
|
|
416
416
|
const t = (f = o.sku.convert) != null && f.measurement ? o.sku.unit.measurements.find((V) => {
|
|
417
417
|
var H;
|
|
418
418
|
return V.id === ((H = o.sku.convert) == null ? void 0 : H.measurement);
|
|
419
|
-
}) ?? null : null,
|
|
420
|
-
return Je(
|
|
419
|
+
}) ?? null : null, l = Ie(o.sku.unit, t), h = _t(+m);
|
|
420
|
+
return Je(h).isInteger().max(l).error ? "Precision cannot be more than " + l : !0;
|
|
421
421
|
}
|
|
422
422
|
const B = R(
|
|
423
423
|
() => {
|
|
424
424
|
var m, t;
|
|
425
|
-
return (m = o.sku.convert) != null && m.measurement ? (t = o.sku.unit.measurements.find((
|
|
426
|
-
var
|
|
427
|
-
return
|
|
425
|
+
return (m = o.sku.convert) != null && m.measurement ? (t = o.sku.unit.measurements.find((l) => {
|
|
426
|
+
var h;
|
|
427
|
+
return l.id === ((h = o.sku.convert) == null ? void 0 : h.measurement);
|
|
428
428
|
})) == null ? void 0 : t.abbrev : o.sku.unit.abbrev;
|
|
429
429
|
}
|
|
430
430
|
), j = R(() => {
|
|
431
|
-
var
|
|
431
|
+
var h, d;
|
|
432
432
|
const t = pt({
|
|
433
|
-
bindings: ((
|
|
433
|
+
bindings: ((h = o.sku.convert) == null ? void 0 : h.inventoryBindings) ?? [],
|
|
434
434
|
skus: c.skus,
|
|
435
435
|
skuGroups: c.skuGroups,
|
|
436
436
|
recipes: c.recipes
|
|
437
437
|
}).inventoryBindings.filter((f) => "success" in f && f.success).map((f) => f).map((f) => f.binding);
|
|
438
438
|
return (d = s.value ?? t) == null ? void 0 : d.map((f) => {
|
|
439
|
-
var
|
|
440
|
-
const V = c.skus.find((fe) => fe._id === f.id), H = ((
|
|
439
|
+
var re, ie, te, ae, Ne;
|
|
440
|
+
const V = c.skus.find((fe) => fe._id === f.id), H = ((re = f.measurement) == null ? void 0 : re.abbrev) ?? ((ie = V == null ? void 0 : V.unit) == null ? void 0 : ie.abbrev), W = (te = o.sku.convert) != null && te.measurement ? o.sku.unit.measurements.find((fe) => {
|
|
441
441
|
var ze;
|
|
442
442
|
return fe.id === ((ze = o.sku.convert) == null ? void 0 : ze.measurement);
|
|
443
|
-
}) ?? null : null, ee = Ie(o.sku.unit,
|
|
443
|
+
}) ?? null : null, ee = Ie(o.sku.unit, W), E = w(`${a.value}`) === !0 ? me(
|
|
444
444
|
ft(
|
|
445
445
|
f.amount,
|
|
446
446
|
Se(+a.value, ee)
|
|
447
447
|
),
|
|
448
448
|
!1
|
|
449
|
-
) : "0", q = (
|
|
449
|
+
) : "0", q = (Ne = (ae = s.value) == null ? void 0 : ae.find((fe) => fe.id === (V == null ? void 0 : V._id))) == null ? void 0 : Ne.amount, Q = q ? me(q, !1) : null;
|
|
450
450
|
return {
|
|
451
451
|
sku: V,
|
|
452
452
|
convertAmount: Q ?? E,
|
|
453
453
|
abbrev: H
|
|
454
454
|
};
|
|
455
455
|
});
|
|
456
|
-
}), P =
|
|
456
|
+
}), P = L();
|
|
457
457
|
b({
|
|
458
458
|
validateInputs: () => {
|
|
459
459
|
var m, t;
|
|
@@ -468,8 +468,8 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
|
|
|
468
468
|
(t = (m = P.value) == null ? void 0 : m.resetInputs) == null || t.call(m);
|
|
469
469
|
}
|
|
470
470
|
});
|
|
471
|
-
const T =
|
|
472
|
-
async function Y(m, t,
|
|
471
|
+
const T = Le(o, "show");
|
|
472
|
+
async function Y(m, t, l) {
|
|
473
473
|
F.value = !0;
|
|
474
474
|
try {
|
|
475
475
|
await v.convertSku({
|
|
@@ -477,59 +477,59 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
|
|
|
477
477
|
{
|
|
478
478
|
doc: m,
|
|
479
479
|
amount: t,
|
|
480
|
-
overrides:
|
|
481
|
-
...
|
|
480
|
+
overrides: l == null ? void 0 : l.map((h) => ({
|
|
481
|
+
...h,
|
|
482
482
|
amount: {
|
|
483
|
-
...
|
|
484
|
-
amount: -1 * Math.abs(
|
|
483
|
+
...h.amount,
|
|
484
|
+
amount: -1 * Math.abs(h.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 (
|
|
491
|
+
} catch (h) {
|
|
492
492
|
$.open({
|
|
493
493
|
title: "Something went wrong",
|
|
494
494
|
message: `Cannot convert ${m.name}. Please try again.`,
|
|
495
495
|
type: "error"
|
|
496
|
-
}), console.error("error at converting stock amount", m, t,
|
|
496
|
+
}), console.error("error at converting stock amount", m, t, h);
|
|
497
497
|
} finally {
|
|
498
498
|
F.value = !1;
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
const
|
|
503
|
-
let d =
|
|
504
|
-
t.length > 0 && isFinite(
|
|
501
|
+
function K(m, t, l) {
|
|
502
|
+
const h = +t;
|
|
503
|
+
let d = l;
|
|
504
|
+
t.length > 0 && isFinite(h) ? d = l.map((f) => (f.id !== m || (f.amount = ve(h)), f)) : d = l.map((f) => (f.id !== m || (f.amount = { amount: 0, precision: 0 }), f)), s.value = d;
|
|
505
505
|
}
|
|
506
506
|
function U(m) {
|
|
507
|
-
const t = _.value.find((
|
|
507
|
+
const t = _.value.find((l) => l._id === m);
|
|
508
508
|
return t ? st(t.unit, !0) : [];
|
|
509
509
|
}
|
|
510
510
|
function Z(m, t) {
|
|
511
|
-
const
|
|
512
|
-
return
|
|
513
|
-
...
|
|
514
|
-
label:
|
|
511
|
+
const l = U(m), h = l.find((d) => d.value === t) ?? l.find((d) => d.value === null);
|
|
512
|
+
return h ? {
|
|
513
|
+
...h,
|
|
514
|
+
label: h.abbrev
|
|
515
515
|
} : null;
|
|
516
516
|
}
|
|
517
|
-
function z(m, t,
|
|
518
|
-
let
|
|
517
|
+
function z(m, t, l) {
|
|
518
|
+
let h;
|
|
519
519
|
if (t === null)
|
|
520
|
-
|
|
520
|
+
h = l.map((d) => (d.id !== m || (d.measurement = null), d)) ?? [];
|
|
521
521
|
else {
|
|
522
522
|
const d = _.value.find((f) => f._id === m);
|
|
523
|
-
|
|
523
|
+
h = l.map((f) => {
|
|
524
524
|
var V, H;
|
|
525
|
-
return f.id !== m || (f.measurement = (H = (V = d == null ? void 0 : d.unit) == null ? void 0 : V.measurements) == null ? void 0 : H.find((
|
|
525
|
+
return f.id !== m || (f.measurement = (H = (V = d == null ? void 0 : d.unit) == null ? void 0 : V.measurements) == null ? void 0 : H.find((W) => W.id === t)), f;
|
|
526
526
|
}) ?? [];
|
|
527
527
|
}
|
|
528
|
-
s.value =
|
|
528
|
+
s.value = h;
|
|
529
529
|
}
|
|
530
530
|
function J(m, t) {
|
|
531
|
-
const
|
|
532
|
-
s.value =
|
|
531
|
+
const l = t.filter((h) => h.id !== m);
|
|
532
|
+
s.value = l;
|
|
533
533
|
}
|
|
534
534
|
function G() {
|
|
535
535
|
const m = (s.value ?? []).map((t) => ({
|
|
@@ -548,8 +548,8 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
|
|
|
548
548
|
m || (s.value = null, a.value = 0);
|
|
549
549
|
}
|
|
550
550
|
), (m, t) => {
|
|
551
|
-
const
|
|
552
|
-
return x(),
|
|
551
|
+
const l = D("FmTextField"), h = D("FmForm"), d = D("FmCard"), f = D("FmSwitch"), V = D("FmFormGroup"), H = D("FmSelect"), W = D("FmButton"), ee = D("FmSideSheet");
|
|
552
|
+
return x(), N(ee, {
|
|
553
553
|
"dismiss-away": "",
|
|
554
554
|
modelValue: i(T),
|
|
555
555
|
"onUpdate:modelValue": t[3] || (t[3] = (E) => Ue(T) ? T.value = E : null),
|
|
@@ -557,23 +557,23 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
|
|
|
557
557
|
}, {
|
|
558
558
|
"side-sheet-header": I(() => [
|
|
559
559
|
e("div", tn, [
|
|
560
|
-
e("div", nn,
|
|
560
|
+
e("div", nn, k(i(C)("inventory.stock.convert.title", { name: m.sku.name })), 1)
|
|
561
561
|
])
|
|
562
562
|
]),
|
|
563
563
|
default: I(() => [
|
|
564
564
|
e("div", on, [
|
|
565
|
-
g(
|
|
565
|
+
g(h, {
|
|
566
566
|
ref_key: "formRef",
|
|
567
567
|
ref: P,
|
|
568
568
|
onValidationSuccess: n
|
|
569
569
|
}, {
|
|
570
570
|
default: I(() => [
|
|
571
|
-
g(
|
|
571
|
+
g(l, {
|
|
572
572
|
disabled: F.value,
|
|
573
573
|
"model-value": a.value,
|
|
574
574
|
"onUpdate:modelValue": t[0] || (t[0] = (E) => a.value = E),
|
|
575
575
|
label: i(C)("inventory.stock.convert.amount"),
|
|
576
|
-
rules: [
|
|
576
|
+
rules: [r, w, i(Fe)(0)],
|
|
577
577
|
"append-text": B.value,
|
|
578
578
|
"helper-text": s.value ? void 0 : `Max ${m.maxCount} ${B.value}`
|
|
579
579
|
}, null, 8, ["disabled", "model-value", "label", "rules", "append-text", "helper-text"])
|
|
@@ -586,15 +586,15 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
|
|
|
586
586
|
}, {
|
|
587
587
|
default: I(() => [
|
|
588
588
|
e("div", sn, [
|
|
589
|
-
e("div", an,
|
|
590
|
-
(x(!0), O(ne, null,
|
|
589
|
+
e("div", an, k(i(C)("inventory.stock.convert.deductionSummary")), 1),
|
|
590
|
+
(x(!0), O(ne, null, le(j.value, (E) => {
|
|
591
591
|
var q, Q;
|
|
592
592
|
return x(), O("div", {
|
|
593
593
|
key: (q = E.sku) == null ? void 0 : q._id,
|
|
594
594
|
class: "flex items-center"
|
|
595
595
|
}, [
|
|
596
|
-
e("div",
|
|
597
|
-
e("div",
|
|
596
|
+
e("div", rn, k((Q = E.sku) == null ? void 0 : Q.name), 1),
|
|
597
|
+
e("div", ln, " -" + k(E.convertAmount) + " " + k(E.abbrev), 1)
|
|
598
598
|
]);
|
|
599
599
|
}), 128))
|
|
600
600
|
])
|
|
@@ -617,8 +617,8 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
|
|
|
617
617
|
rules: [i(vt)(1, "Must have at least one ingredient binding")]
|
|
618
618
|
}, null, 8, ["modelValue", "rules"]),
|
|
619
619
|
e("div", cn, [
|
|
620
|
-
e("div", dn,
|
|
621
|
-
(x(!0), O(ne, null,
|
|
620
|
+
e("div", dn, k(i(C)("inventory.stock.convert.ingredients")), 1),
|
|
621
|
+
(x(!0), O(ne, null, le(s.value, (E) => (x(), N(V, {
|
|
622
622
|
key: E.id,
|
|
623
623
|
disabled: F.value,
|
|
624
624
|
modelValue: +i(me)(E.amount ?? { amount: 1, precision: 0 }),
|
|
@@ -631,31 +631,31 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
|
|
|
631
631
|
]
|
|
632
632
|
}, {
|
|
633
633
|
default: I(({ invalid: q }) => {
|
|
634
|
-
var Q,
|
|
634
|
+
var Q, re, ie;
|
|
635
635
|
return [
|
|
636
636
|
e("div", mn, [
|
|
637
|
-
e("div", pn,
|
|
638
|
-
g(
|
|
637
|
+
e("div", pn, k((Q = _.value.find((te) => te._id === E.id)) == null ? void 0 : Q.name), 1),
|
|
638
|
+
g(l, {
|
|
639
639
|
class: "xs:col-span-2",
|
|
640
640
|
disabled: F.value,
|
|
641
641
|
modelValue: +i(me)(
|
|
642
642
|
E.amount ?? { amount: 1, precision: 0 }
|
|
643
643
|
),
|
|
644
|
-
"onUpdate:modelValue": (te) =>
|
|
644
|
+
"onUpdate:modelValue": (te) => K(E.id, te, s.value ?? []),
|
|
645
645
|
invalid: q
|
|
646
646
|
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
|
|
647
647
|
g(H, {
|
|
648
648
|
disabled: F.value,
|
|
649
649
|
class: "translate-y-[2px]",
|
|
650
650
|
items: U(E.id),
|
|
651
|
-
"model-value": (ie = Z(E.id, (
|
|
651
|
+
"model-value": (ie = Z(E.id, (re = E.measurement) == null ? void 0 : re.id)) == null ? void 0 : ie.value,
|
|
652
652
|
"onUpdate:modelValue": (te) => z(E.id, te, s.value ?? []),
|
|
653
653
|
invalid: q
|
|
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(W, {
|
|
659
659
|
disabled: F.value,
|
|
660
660
|
type: "button",
|
|
661
661
|
variant: "tertiary",
|
|
@@ -669,7 +669,7 @@ const tn = { class: "flex items-center" }, nn = { 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(W, {
|
|
673
673
|
icon: "link",
|
|
674
674
|
label: i(C)("inventory.stock.convert.linkIngredient"),
|
|
675
675
|
variant: "plain",
|
|
@@ -685,7 +685,7 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
|
|
|
685
685
|
]),
|
|
686
686
|
"side-sheet-footer": I(() => [
|
|
687
687
|
e("div", fn, [
|
|
688
|
-
g(
|
|
688
|
+
g(W, {
|
|
689
689
|
loading: F.value,
|
|
690
690
|
label: i(C)("inventory.stock.convert.convertButton"),
|
|
691
691
|
onClick: t[2] || (t[2] = (E) => {
|
|
@@ -728,7 +728,7 @@ const je = {
|
|
|
728
728
|
label: "Purchase",
|
|
729
729
|
toAdjustmentAmount: Qe
|
|
730
730
|
}
|
|
731
|
-
}, yn = { class: "col-span-2 flex" }, _n = { class: "fm-typo-en-body-lg-600 flex-1" },
|
|
731
|
+
}, yn = { class: "col-span-2 flex" }, _n = { class: "fm-typo-en-body-lg-600 flex-1" }, kn = /* @__PURE__ */ ce({
|
|
732
732
|
__name: "AdjustedItemForm",
|
|
733
733
|
props: {
|
|
734
734
|
modelValue: {},
|
|
@@ -738,7 +738,7 @@ const je = {
|
|
|
738
738
|
setup(y, { emit: b }) {
|
|
739
739
|
const u = y, o = b, A = R(
|
|
740
740
|
() => Object.keys(je).map((a) => ({
|
|
741
|
-
label:
|
|
741
|
+
label: kt(a),
|
|
742
742
|
value: a
|
|
743
743
|
}))
|
|
744
744
|
), p = R(() => st(u.modelValue.doc.unit, !0)), c = R({
|
|
@@ -750,7 +750,7 @@ const je = {
|
|
|
750
750
|
...u.modelValue
|
|
751
751
|
};
|
|
752
752
|
s.type = a;
|
|
753
|
-
const _ =
|
|
753
|
+
const _ = Ke(u.modelValue.amount);
|
|
754
754
|
s.amount = je[s.type].toAdjustmentAmount(
|
|
755
755
|
+me(_),
|
|
756
756
|
_.precision
|
|
@@ -758,7 +758,7 @@ const je = {
|
|
|
758
758
|
}
|
|
759
759
|
}), v = R({
|
|
760
760
|
get() {
|
|
761
|
-
const a =
|
|
761
|
+
const a = Ke(u.modelValue.amount);
|
|
762
762
|
return +me(a);
|
|
763
763
|
},
|
|
764
764
|
set(a) {
|
|
@@ -795,13 +795,13 @@ const je = {
|
|
|
795
795
|
});
|
|
796
796
|
return (a, s) => {
|
|
797
797
|
const _ = D("FmButton"), M = D("FmSelect"), S = D("FmTextarea"), F = D("FmCard");
|
|
798
|
-
return x(),
|
|
798
|
+
return x(), N(F, {
|
|
799
799
|
variant: "outlined",
|
|
800
800
|
class: "grid grid-cols-2 gap-8 p-16"
|
|
801
801
|
}, {
|
|
802
802
|
default: I(() => [
|
|
803
803
|
e("div", yn, [
|
|
804
|
-
e("div", _n,
|
|
804
|
+
e("div", _n, k(a.modelValue.doc.name), 1),
|
|
805
805
|
g(_, {
|
|
806
806
|
variant: "tertiary",
|
|
807
807
|
"prepend-icon": "delete",
|
|
@@ -815,7 +815,7 @@ const je = {
|
|
|
815
815
|
items: A.value,
|
|
816
816
|
modelValue: c.value,
|
|
817
817
|
"onUpdate:modelValue": s[1] || (s[1] = (n) => c.value = n),
|
|
818
|
-
rules: [i(
|
|
818
|
+
rules: [i(ht)()],
|
|
819
819
|
"label-mark": "required"
|
|
820
820
|
}, null, 8, ["disabled", "items", "modelValue", "rules"]),
|
|
821
821
|
g(zt, {
|
|
@@ -849,7 +849,7 @@ const je = {
|
|
|
849
849
|
});
|
|
850
850
|
};
|
|
851
851
|
}
|
|
852
|
-
}),
|
|
852
|
+
}), hn = { class: "flex items-center" }, bn = { class: "fm-typo-en-title-md-800" }, gn = { class: "flex items-center" }, xn = { class: "fm-typo-en-title-sm-800 flex-1" }, Sn = { class: "flex gap-8" }, Fn = /* @__PURE__ */ ce({
|
|
853
853
|
__name: "AdjustSkuDialog",
|
|
854
854
|
props: {
|
|
855
855
|
stock: {},
|
|
@@ -857,11 +857,11 @@ const je = {
|
|
|
857
857
|
},
|
|
858
858
|
emits: ["update:show", "submitted"],
|
|
859
859
|
setup(y, { expose: b, emit: u }) {
|
|
860
|
-
const o = y, A = u, p = Pe(), c = Oe(), v = ye(), $ = _e(), C =
|
|
860
|
+
const o = y, A = u, p = Pe(), c = Oe(), v = ye(), $ = _e(), C = L(!1), { t: a } = de();
|
|
861
861
|
function s() {
|
|
862
862
|
F(He(S));
|
|
863
863
|
}
|
|
864
|
-
const _ =
|
|
864
|
+
const _ = L();
|
|
865
865
|
b({
|
|
866
866
|
validateInputs: () => {
|
|
867
867
|
var w, B;
|
|
@@ -876,7 +876,7 @@ const je = {
|
|
|
876
876
|
(B = (w = _.value) == null ? void 0 : w.resetInputs) == null || B.call(w);
|
|
877
877
|
}
|
|
878
878
|
});
|
|
879
|
-
const M =
|
|
879
|
+
const M = Le(o, "show"), S = it({
|
|
880
880
|
remark: "",
|
|
881
881
|
adjustments: [
|
|
882
882
|
{
|
|
@@ -963,20 +963,20 @@ const je = {
|
|
|
963
963
|
);
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function r(w) {
|
|
967
967
|
S.adjustments.splice(w, 1);
|
|
968
968
|
}
|
|
969
969
|
return (w, B) => {
|
|
970
970
|
const j = D("FmTextarea"), P = D("FmButton"), T = D("FmForm"), Y = D("FmSideSheet");
|
|
971
|
-
return x(),
|
|
971
|
+
return x(), N(Y, {
|
|
972
972
|
modelValue: i(M),
|
|
973
|
-
"onUpdate:modelValue": B[2] || (B[2] = (
|
|
973
|
+
"onUpdate:modelValue": B[2] || (B[2] = (K) => Ue(M) ? M.value = K : null),
|
|
974
974
|
"dismiss-away": "",
|
|
975
975
|
"max-width": 500
|
|
976
976
|
}, {
|
|
977
977
|
"side-sheet-header": I(() => [
|
|
978
|
-
e("div",
|
|
979
|
-
e("div", bn,
|
|
978
|
+
e("div", hn, [
|
|
979
|
+
e("div", bn, k(i(a)("inventory.stock.adjust.title")), 1)
|
|
980
980
|
])
|
|
981
981
|
]),
|
|
982
982
|
default: I(() => [
|
|
@@ -990,10 +990,10 @@ const je = {
|
|
|
990
990
|
g(j, {
|
|
991
991
|
label: i(a)("inventory.stock.adjust.remark"),
|
|
992
992
|
modelValue: S.remark,
|
|
993
|
-
"onUpdate:modelValue": B[0] || (B[0] = (
|
|
993
|
+
"onUpdate:modelValue": B[0] || (B[0] = (K) => S.remark = K)
|
|
994
994
|
}, null, 8, ["label", "modelValue"]),
|
|
995
995
|
e("div", gn, [
|
|
996
|
-
e("div", xn,
|
|
996
|
+
e("div", xn, k(i(a)("inventory.stock.adjust.adjustedItems")), 1),
|
|
997
997
|
g(P, {
|
|
998
998
|
"prepend-icon": "add",
|
|
999
999
|
variant: "tertiary",
|
|
@@ -1001,11 +1001,11 @@ const je = {
|
|
|
1001
1001
|
onClick: n
|
|
1002
1002
|
})
|
|
1003
1003
|
]),
|
|
1004
|
-
(x(!0), O(ne, null,
|
|
1005
|
-
key:
|
|
1004
|
+
(x(!0), O(ne, null, le(S.adjustments, (K, U) => (x(), N(kn, {
|
|
1005
|
+
key: K.id,
|
|
1006
1006
|
modelValue: S.adjustments[U],
|
|
1007
1007
|
"onUpdate:modelValue": (Z) => S.adjustments[U] = Z,
|
|
1008
|
-
"onClick:delete": (Z) =>
|
|
1008
|
+
"onClick:delete": (Z) => r(U)
|
|
1009
1009
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "onClick:delete"]))), 128))
|
|
1010
1010
|
]),
|
|
1011
1011
|
_: 1
|
|
@@ -1016,7 +1016,7 @@ const je = {
|
|
|
1016
1016
|
g(P, {
|
|
1017
1017
|
label: i(a)("inventory.stock.adjust.adjustButton"),
|
|
1018
1018
|
loading: C.value,
|
|
1019
|
-
onClick: B[1] || (B[1] = (
|
|
1019
|
+
onClick: B[1] || (B[1] = (K) => {
|
|
1020
1020
|
var U, Z;
|
|
1021
1021
|
return (Z = (U = _.value) == null ? void 0 : U.validateInputs) == null ? void 0 : Z.call(U);
|
|
1022
1022
|
})
|
|
@@ -1057,10 +1057,10 @@ const je = {
|
|
|
1057
1057
|
}),
|
|
1058
1058
|
emits: /* @__PURE__ */ Ye(["refreshHistory"], ["update:modelValue"]),
|
|
1059
1059
|
setup(y, { emit: b }) {
|
|
1060
|
-
const u = y, o = b, A = ye(), p = ut(y, "modelValue"), c =
|
|
1060
|
+
const u = y, o = b, A = ye(), p = ut(y, "modelValue"), c = L(!1), v = L(!1), $ = L(!1), C = L({
|
|
1061
1061
|
_id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
|
|
1062
1062
|
skus: []
|
|
1063
|
-
}), a =
|
|
1063
|
+
}), a = L();
|
|
1064
1064
|
Ee(async () => {
|
|
1065
1065
|
c.value = !0;
|
|
1066
1066
|
const n = await A.readSingleAdjustment(u.adjustmentId);
|
|
@@ -1068,14 +1068,14 @@ const je = {
|
|
|
1068
1068
|
C.value = n, c.value = !1;
|
|
1069
1069
|
});
|
|
1070
1070
|
async function s() {
|
|
1071
|
-
var
|
|
1072
|
-
if ((w = (
|
|
1071
|
+
var r, w;
|
|
1072
|
+
if ((w = (r = a == null ? void 0 : a.value) == null ? void 0 : r.validateInputs) == null || w.call(r), !v.value) return;
|
|
1073
1073
|
const n = {};
|
|
1074
1074
|
Object.keys(p.value || {}).forEach((B) => {
|
|
1075
1075
|
var j;
|
|
1076
1076
|
Object.keys(((j = p.value) == null ? void 0 : j[B]) || {}).forEach((P) => {
|
|
1077
|
-
var Y,
|
|
1078
|
-
const T = (
|
|
1077
|
+
var Y, K;
|
|
1078
|
+
const T = (K = (Y = p.value) == null ? void 0 : Y[B]) == null ? void 0 : K[Number(P)];
|
|
1079
1079
|
T && M(T.amount) > 0 && (n[B] || (n[B] = []), n[B].push(T));
|
|
1080
1080
|
});
|
|
1081
1081
|
}), await A.revertWastageAdjustment({
|
|
@@ -1083,17 +1083,17 @@ const je = {
|
|
|
1083
1083
|
amountsGoingToAdjust: n
|
|
1084
1084
|
}), o("refreshHistory"), $.value = !1, p.value = {};
|
|
1085
1085
|
}
|
|
1086
|
-
function _(n,
|
|
1086
|
+
function _(n, r, w) {
|
|
1087
1087
|
return R({
|
|
1088
1088
|
get: () => {
|
|
1089
1089
|
var j, P, T;
|
|
1090
|
-
const B = (T = (P = (j = p.value) == null ? void 0 : j[n]) == null ? void 0 : P[
|
|
1090
|
+
const B = (T = (P = (j = p.value) == null ? void 0 : j[n]) == null ? void 0 : P[r]) == null ? void 0 : T.amount;
|
|
1091
1091
|
return B ? M(B, !0) : 0;
|
|
1092
1092
|
},
|
|
1093
1093
|
set: (B) => {
|
|
1094
1094
|
p.value || (p.value = {});
|
|
1095
1095
|
const j = { ...p.value };
|
|
1096
|
-
j[n] || (j[n] = {}), j[n][
|
|
1096
|
+
j[n] || (j[n] = {}), j[n][r] = {
|
|
1097
1097
|
amount: Ce.fromNumber(B),
|
|
1098
1098
|
type: oe.Enum.WASTAGE,
|
|
1099
1099
|
measurement: w
|
|
@@ -1101,28 +1101,28 @@ const je = {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
});
|
|
1103
1103
|
}
|
|
1104
|
-
function M(n,
|
|
1104
|
+
function M(n, r = !0) {
|
|
1105
1105
|
const w = Number(Ce.toFormatString({ value: n }));
|
|
1106
|
-
return
|
|
1106
|
+
return r ? Math.abs(w) : w;
|
|
1107
1107
|
}
|
|
1108
|
-
function S(n,
|
|
1109
|
-
return
|
|
1108
|
+
function S(n, r) {
|
|
1109
|
+
return r.measurement ? r.measurement.abbrev : n.sku.unit.abbrev;
|
|
1110
1110
|
}
|
|
1111
|
-
function F(n,
|
|
1112
|
-
return
|
|
1111
|
+
function F(n, r) {
|
|
1112
|
+
return r === 0 ? "N/A" : (n + r).toString();
|
|
1113
1113
|
}
|
|
1114
|
-
return (n,
|
|
1115
|
-
const w = D("FmIcon"), B = D("FmStepperField"), j = D("FmCard"), P = D("FmForm"), T = D("FmSpacer"), Y = D("FmButton"),
|
|
1116
|
-
return x(),
|
|
1114
|
+
return (n, r) => {
|
|
1115
|
+
const w = D("FmIcon"), B = D("FmStepperField"), j = D("FmCard"), P = D("FmForm"), T = D("FmSpacer"), Y = D("FmButton"), K = D("FmDialog");
|
|
1116
|
+
return x(), N(K, {
|
|
1117
1117
|
modelValue: $.value,
|
|
1118
|
-
"onUpdate:modelValue":
|
|
1118
|
+
"onUpdate:modelValue": r[4] || (r[4] = (U) => $.value = U),
|
|
1119
1119
|
overlay: !0
|
|
1120
1120
|
}, {
|
|
1121
1121
|
"dialog-button": I(() => [
|
|
1122
1122
|
g(Gt, null, {
|
|
1123
1123
|
default: I(() => [
|
|
1124
1124
|
e("button", {
|
|
1125
|
-
onClick:
|
|
1125
|
+
onClick: r[0] || (r[0] = (U) => $.value = !0),
|
|
1126
1126
|
class: "rounded-md hover:bg-gray-100 transition-colors"
|
|
1127
1127
|
}, [
|
|
1128
1128
|
g(w, {
|
|
@@ -1134,12 +1134,12 @@ const je = {
|
|
|
1134
1134
|
_: 1
|
|
1135
1135
|
})
|
|
1136
1136
|
]),
|
|
1137
|
-
"dialog-header": I(() =>
|
|
1137
|
+
"dialog-header": I(() => r[5] || (r[5] = [
|
|
1138
1138
|
e("div", null, "Amend Adjustment", -1)
|
|
1139
1139
|
])),
|
|
1140
1140
|
"dialog-footer": I(() => [
|
|
1141
1141
|
e("div", In, [
|
|
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
1143
|
e("div", Tn, [
|
|
1144
1144
|
g(T),
|
|
1145
1145
|
g(Y, {
|
|
@@ -1147,7 +1147,7 @@ const je = {
|
|
|
1147
1147
|
label: "Close",
|
|
1148
1148
|
size: "md",
|
|
1149
1149
|
variant: "tertiary",
|
|
1150
|
-
onClick:
|
|
1150
|
+
onClick: r[3] || (r[3] = (U) => $.value = !1)
|
|
1151
1151
|
}),
|
|
1152
1152
|
g(Y, {
|
|
1153
1153
|
class: "sm:w-full xs:w-full",
|
|
@@ -1160,44 +1160,44 @@ const je = {
|
|
|
1160
1160
|
])
|
|
1161
1161
|
]),
|
|
1162
1162
|
default: I(() => [
|
|
1163
|
-
c.value ? (x(), O("div", $n)) : (x(),
|
|
1163
|
+
c.value ? (x(), O("div", $n)) : (x(), N(P, {
|
|
1164
1164
|
key: 1,
|
|
1165
1165
|
ref_key: "formRef",
|
|
1166
1166
|
ref: a,
|
|
1167
|
-
onValidationFailed:
|
|
1167
|
+
onValidationFailed: r[1] || (r[1] = () => {
|
|
1168
1168
|
v.value = !1;
|
|
1169
1169
|
}),
|
|
1170
|
-
onValidationSuccess:
|
|
1170
|
+
onValidationSuccess: r[2] || (r[2] = () => {
|
|
1171
1171
|
v.value = !0;
|
|
1172
1172
|
}),
|
|
1173
1173
|
blameFormChildOnValidationFailed: ""
|
|
1174
1174
|
}, {
|
|
1175
1175
|
default: I(() => [
|
|
1176
1176
|
e("p", An, [
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
ue(" " +
|
|
1177
|
+
r[6] || (r[6] = e("b", null, "Date:", -1)),
|
|
1178
|
+
r[7] || (r[7] = e("br", null, null, -1)),
|
|
1179
|
+
ue(" " + k(i(xt)(i(St)(C.value._id))), 1)
|
|
1180
1180
|
]),
|
|
1181
1181
|
e("div", Vn, [
|
|
1182
|
-
(x(!0), O(ne, null,
|
|
1183
|
-
(x(!0), O(ne, null,
|
|
1182
|
+
(x(!0), O(ne, null, le(C.value.skus, (U, Z) => (x(), O(ne, { key: Z }, [
|
|
1183
|
+
(x(!0), O(ne, null, le(U.amounts, (z, J) => (x(), N(j, {
|
|
1184
1184
|
key: J,
|
|
1185
1185
|
variant: "outlined",
|
|
1186
1186
|
class: "p-2"
|
|
1187
1187
|
}, {
|
|
1188
1188
|
default: I(() => [
|
|
1189
1189
|
e("div", Cn, [
|
|
1190
|
-
e("span", Mn,
|
|
1191
|
-
e("span", null,
|
|
1190
|
+
e("span", Mn, k(U.sku.code), 1),
|
|
1191
|
+
e("span", null, k(U.sku.name), 1)
|
|
1192
1192
|
]),
|
|
1193
|
-
|
|
1193
|
+
r[12] || (r[12] = e("hr", { class: "m-2" }, null, -1)),
|
|
1194
1194
|
e("div", Bn, [
|
|
1195
|
-
|
|
1196
|
-
e("span", null,
|
|
1195
|
+
r[8] || (r[8] = e("span", { class: "fm-typo-en-body-lg-600" }, "Adjustment type:", -1)),
|
|
1196
|
+
e("span", null, k(z.type), 1)
|
|
1197
1197
|
]),
|
|
1198
1198
|
e("div", Dn, [
|
|
1199
|
-
|
|
1200
|
-
e("span", null,
|
|
1199
|
+
r[9] || (r[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
|
|
1200
|
+
e("span", null, k(i(Ce).toFormatString({ value: z.amount })) + " " + k(S(U, z)), 1)
|
|
1201
1201
|
]),
|
|
1202
1202
|
g(B, {
|
|
1203
1203
|
"model-value": _(U.sku._id, J).value,
|
|
@@ -1212,12 +1212,12 @@ const je = {
|
|
|
1212
1212
|
]
|
|
1213
1213
|
}, null, 8, ["model-value", "onUpdate:modelValue", "helper-text", "append-text", "rules"]),
|
|
1214
1214
|
e("div", jn, [
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
ue(" " +
|
|
1215
|
+
r[10] || (r[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
|
|
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(" " + k(F(
|
|
1218
1218
|
M(z.amount, !1),
|
|
1219
1219
|
_(U.sku._id, J).value
|
|
1220
|
-
)) + " " +
|
|
1220
|
+
)) + " " + k(S(U, z)), 1)
|
|
1221
1221
|
])
|
|
1222
1222
|
]),
|
|
1223
1223
|
_: 2
|
|
@@ -1235,16 +1235,16 @@ const je = {
|
|
|
1235
1235
|
}), En = { class: "p-16" }, Hn = { class: "fm-typo-en-body-md-600 flex-grow" }, Pn = { class: "flex-grow text-fm-color-typo-secondary" }, Rn = {
|
|
1236
1236
|
key: 0,
|
|
1237
1237
|
class: "my-5"
|
|
1238
|
-
}, On = { class: "text-neutral-400" },
|
|
1238
|
+
}, On = { class: "text-neutral-400" }, Ln = { class: "flex-grow" }, Nn = { class: "flex gap-1" }, zn = { class: "flex flex-col gap-1" }, Yn = {
|
|
1239
1239
|
key: 1,
|
|
1240
1240
|
class: "t-system text-fsecondary"
|
|
1241
1241
|
}, Gn = {
|
|
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
|
+
}, Kn = {
|
|
1245
1245
|
key: 1,
|
|
1246
1246
|
class: "shrink-0 text-fm-color-typo-secondary"
|
|
1247
|
-
},
|
|
1247
|
+
}, Wn = /* @__PURE__ */ ce({
|
|
1248
1248
|
__name: "StockRecordCard",
|
|
1249
1249
|
props: {
|
|
1250
1250
|
record: {},
|
|
@@ -1253,9 +1253,9 @@ const je = {
|
|
|
1253
1253
|
},
|
|
1254
1254
|
emits: ["refreshHistory"],
|
|
1255
1255
|
setup(y, { emit: b }) {
|
|
1256
|
-
const u = y, o =
|
|
1256
|
+
const u = y, o = L(!1);
|
|
1257
1257
|
at();
|
|
1258
|
-
const A =
|
|
1258
|
+
const A = L(), p = L(null), c = R(() => p.value === null ? "unset" : o.value ? `${p.value}px` : "0px");
|
|
1259
1259
|
Ee(() => {
|
|
1260
1260
|
var a;
|
|
1261
1261
|
p.value = ((a = A.value) == null ? void 0 : a.scrollHeight) || 0;
|
|
@@ -1263,15 +1263,15 @@ const je = {
|
|
|
1263
1263
|
const v = R(() => {
|
|
1264
1264
|
var F;
|
|
1265
1265
|
const a = u.record.adjustments, s = u.sku, _ = {}, S = a.flatMap((n) => {
|
|
1266
|
-
var
|
|
1267
|
-
return ((
|
|
1266
|
+
var r;
|
|
1267
|
+
return ((r = n.skus) == null ? void 0 : r.filter((w) => w.sku._id === s._id)) ?? [];
|
|
1268
1268
|
}).flatMap((n) => n.amounts);
|
|
1269
1269
|
for (const n of S) {
|
|
1270
|
-
const
|
|
1271
|
-
_[F = n.type] ?? (_[F] = { amount: 0, precision: 0 }), _[n.type] = et(
|
|
1270
|
+
const r = n.measurement ? Ft(n.measurement.conversion, n.amount) : n.amount;
|
|
1271
|
+
_[F = n.type] ?? (_[F] = { amount: 0, precision: 0 }), _[n.type] = et(r, _[n.type]);
|
|
1272
1272
|
}
|
|
1273
1273
|
return Object.entries(_).reduce(
|
|
1274
|
-
(n, [
|
|
1274
|
+
(n, [r, w]) => (n[r] = /// comment, because without it formatter makes code uglier
|
|
1275
1275
|
`${X.toFormatString({
|
|
1276
1276
|
value: w,
|
|
1277
1277
|
precision: 4
|
|
@@ -1284,12 +1284,12 @@ const je = {
|
|
|
1284
1284
|
(_) => {
|
|
1285
1285
|
var M, S;
|
|
1286
1286
|
return ((S = (M = _.skus) == null ? void 0 : M.map) == null ? void 0 : S.call(M, (F) => {
|
|
1287
|
-
var n,
|
|
1287
|
+
var n, r;
|
|
1288
1288
|
return {
|
|
1289
1289
|
...F,
|
|
1290
1290
|
ref: _.ref,
|
|
1291
1291
|
backdateFrom: _.effectiveAt != null ? ot(_._id) : null,
|
|
1292
|
-
toBalance: (
|
|
1292
|
+
toBalance: (r = (n = _.skus) == null ? void 0 : n[0]) == null ? void 0 : r.toBalance,
|
|
1293
1293
|
adjustmentId: _._id
|
|
1294
1294
|
};
|
|
1295
1295
|
})) ?? [];
|
|
@@ -1298,9 +1298,9 @@ const je = {
|
|
|
1298
1298
|
var F;
|
|
1299
1299
|
const M = (F = u.bills.find((n) => n._id === _.ref)) == null ? void 0 : F.seqNumber, S = M ? $("inventory.stock.record.bill", [M]) : "";
|
|
1300
1300
|
return _.amounts.map((n) => {
|
|
1301
|
-
var
|
|
1301
|
+
var r;
|
|
1302
1302
|
return {
|
|
1303
|
-
amount: `${X.toFormatString({ value: n.amount, precision: 4 })} ${((
|
|
1303
|
+
amount: `${X.toFormatString({ value: n.amount, precision: 4 })} ${((r = n.measurement) == null ? void 0 : r.abbrev) ?? _.sku.unit.abbrev}`,
|
|
1304
1304
|
backdateFrom: _.backdateFrom,
|
|
1305
1305
|
name: n.type,
|
|
1306
1306
|
remark: n.remark || S || "",
|
|
@@ -1317,33 +1317,33 @@ const je = {
|
|
|
1317
1317
|
})));
|
|
1318
1318
|
return (a, s) => {
|
|
1319
1319
|
const _ = D("FmIcon"), M = D("FmTooltip"), S = D("FmCard");
|
|
1320
|
-
return x(),
|
|
1320
|
+
return x(), N(S, { variant: "outlined" }, {
|
|
1321
1321
|
default: I(() => [
|
|
1322
1322
|
e("div", En, [
|
|
1323
1323
|
e("div", {
|
|
1324
1324
|
class: "flex items-center cursor-pointer mb-1",
|
|
1325
1325
|
onClick: s[0] || (s[0] = (F) => o.value = !o.value)
|
|
1326
1326
|
}, [
|
|
1327
|
-
e("div", Hn,
|
|
1327
|
+
e("div", Hn, k(a.record.date), 1),
|
|
1328
1328
|
g(_, {
|
|
1329
1329
|
name: o.value ? "expand_more" : "expand_less",
|
|
1330
1330
|
color: "#777777",
|
|
1331
1331
|
size: "md"
|
|
1332
1332
|
}, null, 8, ["name"])
|
|
1333
1333
|
]),
|
|
1334
|
-
(x(!0), O(ne, null,
|
|
1334
|
+
(x(!0), O(ne, null, le(v.value, (F, n) => (x(), O("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", Pn,
|
|
1339
|
+
e("div", Pn, k(i($)(`inventory.inventoryAdjustment.type.${n}`)), 1),
|
|
1340
1340
|
e("div", {
|
|
1341
1341
|
class: ge({
|
|
1342
1342
|
"text-fm-color-typo-error": F.startsWith("-"),
|
|
1343
1343
|
"text-fm-color-typo-success": !F.startsWith("-"),
|
|
1344
1344
|
"ml-auto": !0
|
|
1345
1345
|
})
|
|
1346
|
-
},
|
|
1346
|
+
}, k(F), 3)
|
|
1347
1347
|
]))), 128)),
|
|
1348
1348
|
e("div", {
|
|
1349
1349
|
ref_key: "detailRef",
|
|
@@ -1356,26 +1356,26 @@ const je = {
|
|
|
1356
1356
|
})
|
|
1357
1357
|
}, [
|
|
1358
1358
|
C.value.length ? (x(), O("hr", Rn)) : se("", !0),
|
|
1359
|
-
(x(!0), O(ne, null,
|
|
1359
|
+
(x(!0), O(ne, null, le(C.value, (F) => (x(), O("div", {
|
|
1360
1360
|
key: F.time,
|
|
1361
1361
|
class: "flex gap-1 w-full"
|
|
1362
1362
|
}, [
|
|
1363
|
-
e("div", On,
|
|
1364
|
-
e("div",
|
|
1365
|
-
(x(!0), O(ne, null,
|
|
1363
|
+
e("div", On, k(F.time), 1),
|
|
1364
|
+
e("div", Ln, [
|
|
1365
|
+
(x(!0), O(ne, null, le(F.adjustments, (n) => (x(), O("div", {
|
|
1366
1366
|
key: n.name,
|
|
1367
1367
|
class: "flex gap-1"
|
|
1368
1368
|
}, [
|
|
1369
|
-
e("div",
|
|
1370
|
-
ue(
|
|
1371
|
-
n.backdateFrom ? (x(),
|
|
1369
|
+
e("div", Nn, [
|
|
1370
|
+
ue(k(i($)(`inventory.inventoryAdjustment.type.${n.name}`)) + " ", 1),
|
|
1371
|
+
n.backdateFrom ? (x(), N(M, {
|
|
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", zn,
|
|
1378
|
+
e("div", zn, k(i($)("inventory.stock.record.backdate", [
|
|
1379
1379
|
i(tt)(new Date(n.backdateFrom))
|
|
1380
1380
|
])), 1)
|
|
1381
1381
|
]),
|
|
@@ -1388,8 +1388,8 @@ const je = {
|
|
|
1388
1388
|
]),
|
|
1389
1389
|
_: 2
|
|
1390
1390
|
}, 1024)) : se("", !0),
|
|
1391
|
-
n.remark ? (x(), O("span", Yn, " # " +
|
|
1392
|
-
n.name === i(oe).Enum.CLOSING ? (x(), O("span", Gn, " Actual Balance: " +
|
|
1391
|
+
n.remark ? (x(), O("span", Yn, " # " + k(n.remark), 1)) : se("", !0),
|
|
1392
|
+
n.name === i(oe).Enum.CLOSING ? (x(), O("span", Gn, " Actual Balance: " + k(n.toBalance) + " " + k(n.baseUnit), 1)) : se("", !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(oe).Enum.WASTAGE ? (x(),
|
|
1400
|
+
}, k(n.amount), 3),
|
|
1401
|
+
n.name === i(oe).Enum.WASTAGE ? (x(), N(Un, {
|
|
1402
1402
|
key: 0,
|
|
1403
1403
|
adjustmentId: n.adjustmentId,
|
|
1404
|
-
onRefreshHistory: s[1] || (s[1] = (
|
|
1404
|
+
onRefreshHistory: s[1] || (s[1] = (r) => a.$emit("refreshHistory"))
|
|
1405
1405
|
}, null, 8, ["adjustmentId"])) : se("", !0),
|
|
1406
|
-
n.cost ? (x(), O("div",
|
|
1406
|
+
n.cost ? (x(), O("div", Kn, " (" + k(i(he)(n.cost, !1, n.cost.precision)) + ") ", 1)) : se("", !0)
|
|
1407
1407
|
]))), 128))
|
|
1408
1408
|
])
|
|
1409
1409
|
]))), 128))
|
|
@@ -1480,16 +1480,16 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1480
1480
|
}, oo = { class: "fm-typo-en-body-lg-400 translate-x-4" }, so = {
|
|
1481
1481
|
key: 1,
|
|
1482
1482
|
class: "flex flex-col gap-12"
|
|
1483
|
-
}, ao = { class: "pb-16" },
|
|
1483
|
+
}, ao = { class: "pb-16" }, ro = { class: "fm-typo-cn-body-lg-600" }, lo = {
|
|
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
|
-
}, io = { class: "flex flex-col gap-1" }, uo = { class: "text-fm-color-typo-secondary" }, co = { class: "font-bold" }, mo = { class: "flex flex-col gap-1" }, po = { class: "text-fm-color-typo-secondary flex" }, fo = { class: "font-bold" }, vo = { class: "flex flex-col gap-1" }, yo = { class: "text-fm-color-typo-secondary" }, _o = { class: "font-bold" },
|
|
1486
|
+
}, io = { class: "flex flex-col gap-1" }, uo = { class: "text-fm-color-typo-secondary" }, co = { class: "font-bold" }, mo = { class: "flex flex-col gap-1" }, po = { class: "text-fm-color-typo-secondary flex" }, fo = { class: "font-bold" }, vo = { class: "flex flex-col gap-1" }, yo = { class: "text-fm-color-typo-secondary" }, _o = { class: "font-bold" }, ko = { class: "flex flex-col gap-1" }, ho = { class: "text-fm-color-typo-secondary" }, bo = { class: "font-bold" }, go = { class: "flex flex-col gap-1" }, xo = { class: "text-fm-color-typo-secondary" }, So = { class: "font-bold" }, Fo = { class: "flex flex-col gap-1" }, wo = { class: "text-fm-color-typo-secondary" }, $o = { class: "font-bold" }, Ao = { class: "flex flex-col gap-1" }, Vo = { class: "text-fm-color-typo-secondary" }, Co = { class: "font-bold" }, Mo = { class: "flex flex-col gap-1" }, Bo = { class: "text-fm-color-typo-secondary" }, Do = { class: "font-bold" }, jo = { class: "flex flex-col gap-1" }, Io = { class: "text-fm-color-typo-secondary" }, To = { class: "font-bold" }, Uo = {
|
|
1487
1487
|
key: 0,
|
|
1488
1488
|
class: "flex flex-col gap-8"
|
|
1489
|
-
}, Eo = { class: "flex" }, Ho = { class: "flex-1 flex flex-col gap-1" }, Po = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Ro = { class: "font-bold" }, Oo = { class: "flex-1 flex flex-col gap-1" },
|
|
1489
|
+
}, Eo = { class: "flex" }, Ho = { class: "flex-1 flex flex-col gap-1" }, Po = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Ro = { class: "font-bold" }, Oo = { class: "flex-1 flex flex-col gap-1" }, Lo = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, No = { class: "flex flex-col gap-1" }, zo = { class: "font-bold" }, Yo = {
|
|
1490
1490
|
key: 2,
|
|
1491
1491
|
class: "flex-1 flex flex-col items-center gap-8"
|
|
1492
|
-
}, Go = ["src"],
|
|
1492
|
+
}, Go = ["src"], Ko = { class: "font-bold text-lg" }, Wo = { class: "text-xs text-neutral-400 text-center" }, qo = /* @__PURE__ */ ce({
|
|
1493
1493
|
__name: "StockHistory",
|
|
1494
1494
|
props: {
|
|
1495
1495
|
sku: {},
|
|
@@ -1497,7 +1497,7 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1497
1497
|
},
|
|
1498
1498
|
emits: ["update:show"],
|
|
1499
1499
|
setup(y) {
|
|
1500
|
-
const b = at(), u = Re(), o = ye(), A = wn(), p = pe(), c = Ct(), { t: v } = de(), $ = y, C =
|
|
1500
|
+
const b = at(), u = Re(), o = ye(), A = wn(), p = pe(), c = Ct(), { t: v } = de(), $ = y, C = L(!1), a = _e(), s = L($t(0));
|
|
1501
1501
|
async function _() {
|
|
1502
1502
|
C.value = !0;
|
|
1503
1503
|
try {
|
|
@@ -1517,24 +1517,24 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1517
1517
|
}), xe([() => s.value, () => $.sku], () => {
|
|
1518
1518
|
_();
|
|
1519
1519
|
});
|
|
1520
|
-
const M =
|
|
1521
|
-
function n(t,
|
|
1522
|
-
return
|
|
1520
|
+
const M = L([]), S = L([]), F = L(new Array());
|
|
1521
|
+
function n(t, l) {
|
|
1522
|
+
return l === "day" ? It(t) : tt(t);
|
|
1523
1523
|
}
|
|
1524
|
-
function
|
|
1525
|
-
const
|
|
1524
|
+
function r(t, l) {
|
|
1525
|
+
const h = t.reduce(
|
|
1526
1526
|
(d, f) => {
|
|
1527
1527
|
const V = f.effectiveAt ?? ot(f._id);
|
|
1528
1528
|
if (!V)
|
|
1529
1529
|
return d;
|
|
1530
|
-
const H = n(new Date(V),
|
|
1530
|
+
const H = n(new Date(V), l);
|
|
1531
1531
|
return d[H] ?? (d[H] = []), d[H].push(f), d;
|
|
1532
1532
|
},
|
|
1533
1533
|
{}
|
|
1534
1534
|
);
|
|
1535
|
-
return Object.keys(
|
|
1535
|
+
return Object.keys(h).map((d) => ({
|
|
1536
1536
|
date: d,
|
|
1537
|
-
adjustments:
|
|
1537
|
+
adjustments: h[d]
|
|
1538
1538
|
}));
|
|
1539
1539
|
}
|
|
1540
1540
|
async function w() {
|
|
@@ -1544,53 +1544,53 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1544
1544
|
Bt(new Date(s.value.endDate)).toISOString()
|
|
1545
1545
|
);
|
|
1546
1546
|
M.value = t;
|
|
1547
|
-
const
|
|
1548
|
-
await B(
|
|
1549
|
-
date:
|
|
1547
|
+
const l = t.filter(({ ref: h }) => h == null ? void 0 : h.startsWith("bill_")).map(({ ref: h }) => h);
|
|
1548
|
+
await B(l), S.value = r(t, "day").map(({ date: h, adjustments: d }) => ({
|
|
1549
|
+
date: h,
|
|
1550
1550
|
adjustments: d,
|
|
1551
|
-
adjustmentsByTime:
|
|
1551
|
+
adjustmentsByTime: r(d, "minute")
|
|
1552
1552
|
}));
|
|
1553
1553
|
}
|
|
1554
1554
|
async function B(t) {
|
|
1555
|
-
t.length && (F.value = await A.findBillsById(t).catch((
|
|
1555
|
+
t.length && (F.value = await A.findBillsById(t).catch((l) => {
|
|
1556
1556
|
var f;
|
|
1557
|
-
console.error("Error on using latest bill API, retrying using legacy api",
|
|
1558
|
-
const
|
|
1559
|
-
return A.findBillsByBusinessId(
|
|
1557
|
+
console.error("Error on using latest bill API, retrying using legacy api", l);
|
|
1558
|
+
const h = ((f = b.currentBusiness.value) == null ? void 0 : f._id) ?? "", d = p.currentLocation.doc._id;
|
|
1559
|
+
return A.findBillsByBusinessId(h, [d], t);
|
|
1560
1560
|
}));
|
|
1561
1561
|
}
|
|
1562
1562
|
const j = R(() => {
|
|
1563
|
-
const t = M.value,
|
|
1564
|
-
return qn(t,
|
|
1563
|
+
const t = M.value, l = $.sku;
|
|
1564
|
+
return qn(t, l);
|
|
1565
1565
|
}), P = R(() => {
|
|
1566
|
-
const t = M.value,
|
|
1567
|
-
return Xn(t,
|
|
1566
|
+
const t = M.value, l = $.sku;
|
|
1567
|
+
return Xn(t, l);
|
|
1568
1568
|
}), T = R(() => {
|
|
1569
|
-
const t = [...M.value].computeFirst((
|
|
1569
|
+
const t = [...M.value].computeFirst((h) => {
|
|
1570
1570
|
var f, V;
|
|
1571
|
-
const d = (V = (f =
|
|
1571
|
+
const d = (V = (f = h.skus) == null ? void 0 : f.find) == null ? void 0 : V.call(f, (H) => H.sku._id === $.sku._id);
|
|
1572
1572
|
return d == null ? void 0 : d.fromBalance;
|
|
1573
1573
|
}) ?? {
|
|
1574
1574
|
amount: 0,
|
|
1575
1575
|
precision: 0
|
|
1576
|
-
},
|
|
1577
|
-
return
|
|
1576
|
+
}, l = $.sku;
|
|
1577
|
+
return l ? `${X.toFormatString({
|
|
1578
1578
|
value: t,
|
|
1579
1579
|
precision: 4
|
|
1580
|
-
})} ${
|
|
1580
|
+
})} ${l.unit.abbrev}` : "";
|
|
1581
1581
|
}), Y = R(() => {
|
|
1582
|
-
const t = [...M.value].reverse().computeFirst((
|
|
1582
|
+
const t = [...M.value].reverse().computeFirst((h) => {
|
|
1583
1583
|
var f, V;
|
|
1584
|
-
const d = (V = (f =
|
|
1584
|
+
const d = (V = (f = h.skus) == null ? void 0 : f.find) == null ? void 0 : V.call(f, (H) => H.sku._id === $.sku._id);
|
|
1585
1585
|
return d == null ? void 0 : d.toBalance;
|
|
1586
1586
|
}) ?? {
|
|
1587
1587
|
amount: 0,
|
|
1588
1588
|
precision: 0
|
|
1589
|
-
},
|
|
1590
|
-
return
|
|
1591
|
-
}),
|
|
1592
|
-
var
|
|
1593
|
-
const
|
|
1589
|
+
}, l = $.sku;
|
|
1590
|
+
return l ? `${X.toFormatString({ value: t, precision: 4 })} ${l.unit.abbrev}` : "";
|
|
1591
|
+
}), K = R(() => {
|
|
1592
|
+
var h;
|
|
1593
|
+
const l = M.value.flatMap((d) => {
|
|
1594
1594
|
var f;
|
|
1595
1595
|
return ((f = d.skus) == null ? void 0 : f.flatMap((V) => V.amounts)) ?? [];
|
|
1596
1596
|
}).filter((d) => d.amount.amount < 0).reduce(
|
|
@@ -1609,38 +1609,38 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1609
1609
|
{
|
|
1610
1610
|
amount: 0,
|
|
1611
1611
|
precision: 0,
|
|
1612
|
-
currency: Me((
|
|
1612
|
+
currency: Me((h = b.currentCountry) == null ? void 0 : h.value)
|
|
1613
1613
|
}
|
|
1614
1614
|
);
|
|
1615
|
-
return
|
|
1615
|
+
return he(l, !1, l.precision);
|
|
1616
1616
|
});
|
|
1617
1617
|
function U() {
|
|
1618
|
-
const { startDate: t, endDate:
|
|
1619
|
-
t !== null &&
|
|
1618
|
+
const { startDate: t, endDate: l } = Dt(s.value);
|
|
1619
|
+
t !== null && l !== null && (s.value = {
|
|
1620
1620
|
startDate: t,
|
|
1621
|
-
endDate:
|
|
1621
|
+
endDate: l
|
|
1622
1622
|
});
|
|
1623
1623
|
}
|
|
1624
|
-
const Z = R(() => $.sku.valuation ===
|
|
1625
|
-
var H,
|
|
1624
|
+
const Z = R(() => $.sku.valuation === We.Enum.FIFO ? v("inventory.ingredient.valuationMethod.FIFO") : v("inventory.ingredient.valuationMethod.WAVG")), z = R(() => {
|
|
1625
|
+
var H, W, ee, E;
|
|
1626
1626
|
const t = [...M.value].reverse().computeFirst((q) => {
|
|
1627
|
-
var Q,
|
|
1628
|
-
return (
|
|
1627
|
+
var Q, re;
|
|
1628
|
+
return (re = (Q = q.skus) == null ? void 0 : Q.find) == null ? void 0 : re.call(Q, (ie) => ie.sku._id === $.sku._id);
|
|
1629
1629
|
});
|
|
1630
1630
|
if (!t) return "No data";
|
|
1631
|
-
const
|
|
1632
|
-
amount: ((H =
|
|
1633
|
-
precision: ((
|
|
1634
|
-
}, d =
|
|
1631
|
+
const l = [...t.amounts].reverse()[0], h = {
|
|
1632
|
+
amount: ((H = l.cost) == null ? void 0 : H.amount) ?? 0,
|
|
1633
|
+
precision: ((W = l.cost) == null ? void 0 : W.precision) ?? 0
|
|
1634
|
+
}, d = l.amount, f = d.amount == 0 ? X.fromNumber(0) : X.divide([h, d]);
|
|
1635
1635
|
return {
|
|
1636
1636
|
...X.multiply([f, d]),
|
|
1637
|
-
currency: ((ee =
|
|
1637
|
+
currency: ((ee = l.cost) == null ? void 0 : ee.currency) || Me(((E = b.currentCountry) == null ? void 0 : E.value) ?? Vt)
|
|
1638
1638
|
};
|
|
1639
1639
|
}), J = R(() => {
|
|
1640
|
-
var
|
|
1640
|
+
var h;
|
|
1641
1641
|
const t = [...M.value].reverse().computeFirst((d) => {
|
|
1642
1642
|
var V, H;
|
|
1643
|
-
const f = (H = (V = d.skus) == null ? void 0 : V.find) == null ? void 0 : H.call(V, (
|
|
1643
|
+
const f = (H = (V = d.skus) == null ? void 0 : V.find) == null ? void 0 : H.call(V, (W) => W.sku._id === $.sku._id);
|
|
1644
1644
|
return f == null ? void 0 : f.toCostBalances;
|
|
1645
1645
|
});
|
|
1646
1646
|
return t ? {
|
|
@@ -1648,33 +1648,33 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1648
1648
|
amount: 0,
|
|
1649
1649
|
precision: 0
|
|
1650
1650
|
}),
|
|
1651
|
-
currency: Me((
|
|
1651
|
+
currency: Me((h = b.currentCountry) == null ? void 0 : h.value)
|
|
1652
1652
|
} : "No data";
|
|
1653
1653
|
});
|
|
1654
1654
|
function G() {
|
|
1655
|
-
const { startDate: t, endDate:
|
|
1656
|
-
t !== null &&
|
|
1655
|
+
const { startDate: t, endDate: l } = jt(s.value);
|
|
1656
|
+
t !== null && l !== null && (s.value = {
|
|
1657
1657
|
startDate: t,
|
|
1658
|
-
endDate:
|
|
1658
|
+
endDate: l
|
|
1659
1659
|
});
|
|
1660
1660
|
}
|
|
1661
|
-
const m =
|
|
1662
|
-
return (t,
|
|
1663
|
-
const
|
|
1664
|
-
return x(),
|
|
1661
|
+
const m = Le($, "show");
|
|
1662
|
+
return (t, l) => {
|
|
1663
|
+
const h = D("FmButton"), d = D("FmField"), f = D("FmDateRangePicker"), V = D("FmSpacer"), H = D("FmCircularProgress"), W = D("FmIcon"), ee = D("FmTooltip"), E = D("FmMenuDivider"), q = D("FmChip"), Q = D("FmCardSection"), re = D("FmCard"), ie = D("FmSideSheet");
|
|
1664
|
+
return x(), N(ie, {
|
|
1665
1665
|
"dismiss-away": "",
|
|
1666
1666
|
modelValue: i(m),
|
|
1667
|
-
"onUpdate:modelValue":
|
|
1667
|
+
"onUpdate:modelValue": l[4] || (l[4] = (te) => Ue(m) ? m.value = te : null),
|
|
1668
1668
|
"close-button": !1,
|
|
1669
1669
|
"max-width": 560
|
|
1670
1670
|
}, {
|
|
1671
1671
|
"side-sheet-header": I(() => [
|
|
1672
1672
|
e("div", Jn, [
|
|
1673
|
-
e("div", Qn,
|
|
1674
|
-
g(
|
|
1673
|
+
e("div", Qn, k(i(v)("inventory.stock.history.title", [t.sku.name])), 1),
|
|
1674
|
+
g(h, {
|
|
1675
1675
|
variant: "tertiary",
|
|
1676
1676
|
"prepend-icon": "close",
|
|
1677
|
-
onClick:
|
|
1677
|
+
onClick: l[0] || (l[0] = (te) => m.value = !1)
|
|
1678
1678
|
})
|
|
1679
1679
|
])
|
|
1680
1680
|
]),
|
|
@@ -1686,7 +1686,7 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1686
1686
|
e("div", to, [
|
|
1687
1687
|
g(f, {
|
|
1688
1688
|
modelValue: s.value,
|
|
1689
|
-
"onUpdate:modelValue":
|
|
1689
|
+
"onUpdate:modelValue": l[1] || (l[1] = (ae) => s.value = ae),
|
|
1690
1690
|
"show-predefined-range": "",
|
|
1691
1691
|
"start-label": "",
|
|
1692
1692
|
"end-label": "",
|
|
@@ -1698,7 +1698,7 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1698
1698
|
focused: ae
|
|
1699
1699
|
}, {
|
|
1700
1700
|
default: I(() => [
|
|
1701
|
-
ue(
|
|
1701
|
+
ue(k(s.value.startDate) + " - " + k(s.value.endDate), 1)
|
|
1702
1702
|
]),
|
|
1703
1703
|
_: 2
|
|
1704
1704
|
}, 1032, ["focused"])
|
|
@@ -1706,40 +1706,40 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1706
1706
|
_: 1
|
|
1707
1707
|
}, 8, ["modelValue"])
|
|
1708
1708
|
]),
|
|
1709
|
-
g(
|
|
1709
|
+
g(h, {
|
|
1710
1710
|
variant: "tertiary",
|
|
1711
|
-
onClick:
|
|
1711
|
+
onClick: l[2] || (l[2] = (ae) => U()),
|
|
1712
1712
|
"prepend-icon": "navigate_before"
|
|
1713
1713
|
}),
|
|
1714
|
-
g(
|
|
1714
|
+
g(h, {
|
|
1715
1715
|
variant: "tertiary",
|
|
1716
|
-
onClick:
|
|
1716
|
+
onClick: l[3] || (l[3] = (ae) => G()),
|
|
1717
1717
|
"prepend-icon": "navigate_next"
|
|
1718
1718
|
})
|
|
1719
1719
|
]),
|
|
1720
1720
|
C.value ? (x(), O("div", no, [
|
|
1721
1721
|
g(V),
|
|
1722
1722
|
g(H, { size: "xl" }),
|
|
1723
|
-
e("div", oo,
|
|
1723
|
+
e("div", oo, k(i(v)("inventory.stock.history.loading")), 1),
|
|
1724
1724
|
g(V),
|
|
1725
1725
|
g(V)
|
|
1726
1726
|
])) : S.value && ((te = S.value) == null ? void 0 : te.length) > 0 ? (x(), O("div", so, [
|
|
1727
|
-
g(
|
|
1727
|
+
g(re, { variant: "outlined" }, {
|
|
1728
1728
|
default: I(() => [
|
|
1729
1729
|
g(Q, { class: "flex flex-col gap-4" }, {
|
|
1730
1730
|
default: I(() => [
|
|
1731
1731
|
e("div", ao, [
|
|
1732
|
-
e("div",
|
|
1732
|
+
e("div", ro, k(i(v)("inventory.stock.history.summary.title")), 1)
|
|
1733
1733
|
]),
|
|
1734
|
-
e("div",
|
|
1734
|
+
e("div", lo, [
|
|
1735
1735
|
e("div", io, [
|
|
1736
|
-
e("div", uo,
|
|
1737
|
-
e("div", co,
|
|
1736
|
+
e("div", uo, k(i(v)("inventory.stock.history.summary.totalPurchase")), 1),
|
|
1737
|
+
e("div", co, k(j.value.PURCHASE), 1)
|
|
1738
1738
|
]),
|
|
1739
1739
|
e("div", mo, [
|
|
1740
1740
|
e("div", po, [
|
|
1741
|
-
ue(
|
|
1742
|
-
P.value != null ? (x(),
|
|
1741
|
+
ue(k(i(v)("inventory.stock.history.summary.totalSales")) + " ", 1),
|
|
1742
|
+
P.value != null ? (x(), N(ee, {
|
|
1743
1743
|
key: 0,
|
|
1744
1744
|
variant: "plain",
|
|
1745
1745
|
placement: "top",
|
|
@@ -1747,7 +1747,7 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1747
1747
|
"z-index": 50
|
|
1748
1748
|
}, {
|
|
1749
1749
|
default: I(() => [
|
|
1750
|
-
g(
|
|
1750
|
+
g(W, {
|
|
1751
1751
|
name: "warning",
|
|
1752
1752
|
size: "sm"
|
|
1753
1753
|
})
|
|
@@ -1755,35 +1755,35 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1755
1755
|
_: 1
|
|
1756
1756
|
}, 8, ["content"])) : se("", !0)
|
|
1757
1757
|
]),
|
|
1758
|
-
e("div", fo,
|
|
1758
|
+
e("div", fo, k(j.value.SALES), 1)
|
|
1759
1759
|
]),
|
|
1760
1760
|
e("div", vo, [
|
|
1761
|
-
e("div", yo,
|
|
1762
|
-
e("div", _o,
|
|
1761
|
+
e("div", yo, k(i(v)("inventory.stock.history.summary.totalLose")), 1),
|
|
1762
|
+
e("div", _o, k(j.value.LOSE), 1)
|
|
1763
1763
|
]),
|
|
1764
|
-
e("div",
|
|
1765
|
-
e("div",
|
|
1766
|
-
e("div", bo,
|
|
1764
|
+
e("div", ko, [
|
|
1765
|
+
e("div", ho, k(i(v)("inventory.stock.history.summary.totalRequest")), 1),
|
|
1766
|
+
e("div", bo, k(j.value.REQUEST), 1)
|
|
1767
1767
|
]),
|
|
1768
1768
|
e("div", go, [
|
|
1769
|
-
e("div", xo,
|
|
1770
|
-
e("div", So,
|
|
1769
|
+
e("div", xo, k(i(v)("inventory.stock.history.summary.totalReceive")), 1),
|
|
1770
|
+
e("div", So, k(j.value.RECEIVE), 1)
|
|
1771
1771
|
]),
|
|
1772
1772
|
e("div", Fo, [
|
|
1773
|
-
e("div", wo,
|
|
1774
|
-
e("div", $o,
|
|
1773
|
+
e("div", wo, k(i(v)("inventory.stock.history.summary.totalConvert")), 1),
|
|
1774
|
+
e("div", $o, k(j.value.CONVERT), 1)
|
|
1775
1775
|
]),
|
|
1776
1776
|
e("div", Ao, [
|
|
1777
|
-
e("div", Vo,
|
|
1778
|
-
e("div", Co,
|
|
1777
|
+
e("div", Vo, k(i(v)("inventory.stock.history.summary.totalDamage")), 1),
|
|
1778
|
+
e("div", Co, k(j.value.DAMAGE), 1)
|
|
1779
1779
|
]),
|
|
1780
1780
|
e("div", Mo, [
|
|
1781
|
-
e("div", Bo,
|
|
1782
|
-
e("div", Do,
|
|
1781
|
+
e("div", Bo, k(i(v)("inventory.stock.history.summary.openingBalance")), 1),
|
|
1782
|
+
e("div", Do, k(T.value), 1)
|
|
1783
1783
|
]),
|
|
1784
1784
|
e("div", jo, [
|
|
1785
|
-
e("div", Io,
|
|
1786
|
-
e("div", To,
|
|
1785
|
+
e("div", Io, k(i(v)("inventory.stock.history.summary.lastStockBalance")), 1),
|
|
1786
|
+
e("div", To, k(Y.value), 1)
|
|
1787
1787
|
])
|
|
1788
1788
|
]),
|
|
1789
1789
|
i(c).enableTotalCost ? (x(), O("div", Uo, [
|
|
@@ -1793,7 +1793,7 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1793
1793
|
g(Xe, { "z-index": 50 }, {
|
|
1794
1794
|
default: I(() => [
|
|
1795
1795
|
e("div", Po, [
|
|
1796
|
-
ue(
|
|
1796
|
+
ue(k(i(v)("inventory.stock.history.estimatedValue")) + " ", 1),
|
|
1797
1797
|
g(ee, {
|
|
1798
1798
|
variant: "plain",
|
|
1799
1799
|
placement: "top",
|
|
@@ -1801,7 +1801,7 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1801
1801
|
"z-index": 50
|
|
1802
1802
|
}, {
|
|
1803
1803
|
default: I(() => [
|
|
1804
|
-
g(
|
|
1804
|
+
g(W, {
|
|
1805
1805
|
name: "help",
|
|
1806
1806
|
size: "sm"
|
|
1807
1807
|
})
|
|
@@ -1813,18 +1813,18 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1813
1813
|
_: 1
|
|
1814
1814
|
}),
|
|
1815
1815
|
e("div", Ro, [
|
|
1816
|
-
t.sku.valuation === i(
|
|
1816
|
+
t.sku.valuation === i(We).Enum.FIFO ? (x(), O(ne, { key: 0 }, [
|
|
1817
1817
|
g(q, {
|
|
1818
1818
|
label: "FIFO",
|
|
1819
1819
|
compact: ""
|
|
1820
1820
|
}),
|
|
1821
|
-
ue(" " +
|
|
1821
|
+
ue(" " + k(typeof J.value != "string" ? i(he)(
|
|
1822
1822
|
J.value,
|
|
1823
1823
|
!1,
|
|
1824
1824
|
J.value.precision
|
|
1825
1825
|
) : J.value), 1)
|
|
1826
1826
|
], 64)) : (x(), O(ne, { key: 1 }, [
|
|
1827
|
-
ue(
|
|
1827
|
+
ue(k(typeof z.value != "string" ? i(he)(
|
|
1828
1828
|
z.value,
|
|
1829
1829
|
!1,
|
|
1830
1830
|
z.value.precision
|
|
@@ -1835,18 +1835,18 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1835
1835
|
e("div", Oo, [
|
|
1836
1836
|
g(Xe, { "z-index": 50 }, {
|
|
1837
1837
|
default: I(() => [
|
|
1838
|
-
e("div",
|
|
1839
|
-
ue(
|
|
1838
|
+
e("div", Lo, [
|
|
1839
|
+
ue(k(i(v)("inventory.stock.history.costSold")) + " ", 1),
|
|
1840
1840
|
g(ee, {
|
|
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", No, k(i(v)("inventory.stock.history.costSoldTooltip")), 1)
|
|
1847
1847
|
]),
|
|
1848
1848
|
default: I(() => [
|
|
1849
|
-
g(
|
|
1849
|
+
g(W, {
|
|
1850
1850
|
name: "help",
|
|
1851
1851
|
size: "sm"
|
|
1852
1852
|
})
|
|
@@ -1857,7 +1857,7 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1857
1857
|
]),
|
|
1858
1858
|
_: 1
|
|
1859
1859
|
}),
|
|
1860
|
-
e("div", zo,
|
|
1860
|
+
e("div", zo, k(K.value), 1)
|
|
1861
1861
|
])
|
|
1862
1862
|
])
|
|
1863
1863
|
])) : se("", !0)
|
|
@@ -1867,11 +1867,11 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1867
1867
|
]),
|
|
1868
1868
|
_: 1
|
|
1869
1869
|
}),
|
|
1870
|
-
|
|
1871
|
-
(x(!0), O(ne, null,
|
|
1870
|
+
l[5] || (l[5] = e("div", null, null, -1)),
|
|
1871
|
+
(x(!0), O(ne, null, le(S.value, (ae) => (x(), O(ne, {
|
|
1872
1872
|
key: ae.date
|
|
1873
1873
|
}, [
|
|
1874
|
-
t.sku ? (x(),
|
|
1874
|
+
t.sku ? (x(), N(Wn, {
|
|
1875
1875
|
key: 0,
|
|
1876
1876
|
record: ae,
|
|
1877
1877
|
sku: t.sku,
|
|
@@ -1887,8 +1887,8 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1887
1887
|
alt: "List is empty"
|
|
1888
1888
|
}, null, 8, Go)
|
|
1889
1889
|
]),
|
|
1890
|
-
e("div",
|
|
1891
|
-
e("div",
|
|
1890
|
+
e("div", Ko, k(i(v)("inventory.stock.history.noRecords")), 1),
|
|
1891
|
+
e("div", Wo, k(i(v)("inventory.stock.history.changeDateRange")), 1),
|
|
1892
1892
|
g(V),
|
|
1893
1893
|
g(V)
|
|
1894
1894
|
]))
|
|
@@ -1902,9 +1902,9 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1902
1902
|
}), Xo = { class: "flex flex-col gap-8" }, Jo = { class: "flex flex-col" }, Qo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Zo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, vs = /* @__PURE__ */ ce({
|
|
1903
1903
|
__name: "StockView",
|
|
1904
1904
|
setup(y) {
|
|
1905
|
-
const { t: b } = de(), u = Pe(), o = pe(), A = Re(), p =
|
|
1905
|
+
const { t: b } = de(), u = Pe(), o = pe(), A = Re(), p = lt(), c = ye(), v = nt(), { columnDefs: $ } = Zt(), C = Oe();
|
|
1906
1906
|
o.watchLocation(M);
|
|
1907
|
-
const a =
|
|
1907
|
+
const a = L(!1), s = _e();
|
|
1908
1908
|
async function _() {
|
|
1909
1909
|
C.open({
|
|
1910
1910
|
title: b("inventory.stock.stock_balance.refreshBalance"),
|
|
@@ -1947,14 +1947,14 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1947
1947
|
() => u.skus.map((T) => {
|
|
1948
1948
|
var z, J, G;
|
|
1949
1949
|
const Y = T.trackingMeasurement;
|
|
1950
|
-
let
|
|
1950
|
+
let K = (J = (z = A.stockBalance.skus) == null ? void 0 : z.find(
|
|
1951
1951
|
(m) => m.id === T._id
|
|
1952
1952
|
)) == null ? void 0 : J.balance, U = v.inventoryForecast.skus.find(
|
|
1953
1953
|
(m) => m.id === T._id
|
|
1954
1954
|
);
|
|
1955
1955
|
return {
|
|
1956
1956
|
...T,
|
|
1957
|
-
balance:
|
|
1957
|
+
balance: K ?? {
|
|
1958
1958
|
amount: 0,
|
|
1959
1959
|
precision: 0
|
|
1960
1960
|
},
|
|
@@ -1962,7 +1962,7 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1962
1962
|
trackingUnitAbbrev: Y ? ((G = T.unit.measurements.find((m) => m.id === Y)) == null ? void 0 : G.abbrev) ?? "" : T.unit.abbrev
|
|
1963
1963
|
};
|
|
1964
1964
|
})
|
|
1965
|
-
), F =
|
|
1965
|
+
), F = L(""), { breakpoints: n } = Ot(), r = R(() => n.value.xs || n.value.sm), w = R(() => r.value ? 10 : 20), B = Tt(), j = R(() => [
|
|
1966
1966
|
{
|
|
1967
1967
|
label: b("inventory.stock.stock_balance.refreshBalance"),
|
|
1968
1968
|
value: "refresh-balance",
|
|
@@ -1989,8 +1989,8 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
1989
1989
|
}
|
|
1990
1990
|
}
|
|
1991
1991
|
return (T, Y) => {
|
|
1992
|
-
const
|
|
1993
|
-
return x(),
|
|
1992
|
+
const K = D("FmTable");
|
|
1993
|
+
return x(), N(Ut, {
|
|
1994
1994
|
title: i(b)("inventory.stock.title"),
|
|
1995
1995
|
actions: j.value,
|
|
1996
1996
|
"onClick:action": P
|
|
@@ -2002,8 +2002,8 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
2002
2002
|
class: ge([
|
|
2003
2003
|
"flex flex-col gap-8 max-h-full",
|
|
2004
2004
|
{
|
|
2005
|
-
"p-0":
|
|
2006
|
-
"px-24 ": !
|
|
2005
|
+
"p-0": r.value,
|
|
2006
|
+
"px-24 ": !r.value
|
|
2007
2007
|
}
|
|
2008
2008
|
])
|
|
2009
2009
|
}, [
|
|
@@ -2013,7 +2013,7 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
2013
2013
|
search: F.value,
|
|
2014
2014
|
"onUpdate:search": Y[0] || (Y[0] = (G) => F.value = G)
|
|
2015
2015
|
}, null, 8, ["search"]),
|
|
2016
|
-
(x(),
|
|
2016
|
+
(x(), N(K, {
|
|
2017
2017
|
style: Ze(i(B).tableHeight),
|
|
2018
2018
|
"column-defs": i($),
|
|
2019
2019
|
"row-data": S.value,
|
|
@@ -2029,19 +2029,19 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
2029
2029
|
onRowClick: i(p).showSkuHistory
|
|
2030
2030
|
}, {
|
|
2031
2031
|
default: I((m) => {
|
|
2032
|
-
var t,
|
|
2032
|
+
var t, l, h, d, f, V, H, W, ee, E;
|
|
2033
2033
|
return [
|
|
2034
2034
|
e("div", Xo, [
|
|
2035
2035
|
e("div", Jo, [
|
|
2036
2036
|
e("div", Qo, [
|
|
2037
2037
|
g(i(qe), {
|
|
2038
|
-
render: (
|
|
2038
|
+
render: (h = (l = (t = m.code) == null ? void 0 : t.column) == null ? void 0 : l.columnDef) == null ? void 0 : h.cell,
|
|
2039
2039
|
props: (f = (d = m.code) == null ? void 0 : d.getContext) == null ? void 0 : f.call(d)
|
|
2040
2040
|
}, null, 8, ["render", "props"])
|
|
2041
2041
|
]),
|
|
2042
2042
|
e("div", Zo, [
|
|
2043
2043
|
g(i(qe), {
|
|
2044
|
-
render: (
|
|
2044
|
+
render: (W = (H = (V = m.name) == null ? void 0 : V.column) == null ? void 0 : H.columnDef) == null ? void 0 : W.cell,
|
|
2045
2045
|
props: (E = (ee = m.name) == null ? void 0 : ee.getContext) == null ? void 0 : E.call(ee)
|
|
2046
2046
|
}, null, 8, ["render", "props"])
|
|
2047
2047
|
])
|
|
@@ -2052,7 +2052,7 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
2052
2052
|
}, null, 8, ["days"])
|
|
2053
2053
|
]),
|
|
2054
2054
|
e("div", null, [
|
|
2055
|
-
g(
|
|
2055
|
+
g(rt, {
|
|
2056
2056
|
class: "xs:w-[160px]",
|
|
2057
2057
|
unit: G.original.unit,
|
|
2058
2058
|
sku: G.original,
|
|
@@ -2069,10 +2069,10 @@ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = {
|
|
|
2069
2069
|
_: 1
|
|
2070
2070
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
2071
2071
|
], 2),
|
|
2072
|
-
(x(),
|
|
2073
|
-
(Z = i(p).stockHistoryProps) != null && Z.sku ? (x(),
|
|
2074
|
-
(z = i(p).convertSkuDialogProps) != null && z.sku ? (x(),
|
|
2075
|
-
(J = i(p).adjustSkuDialogProps) != null && J.stock ? (x(),
|
|
2072
|
+
(x(), N(ct, { to: "body" }, [
|
|
2073
|
+
(Z = i(p).stockHistoryProps) != null && Z.sku ? (x(), N(qo, Ae(Ve({ key: 0 }, i(p).stockHistoryProps)), null, 16)) : se("", !0),
|
|
2074
|
+
(z = i(p).convertSkuDialogProps) != null && z.sku ? (x(), N(vn, Ae(Ve({ key: 1 }, i(p).convertSkuDialogProps)), null, 16)) : se("", !0),
|
|
2075
|
+
(J = i(p).adjustSkuDialogProps) != null && J.stock ? (x(), N(Fn, Ae(Ve({ key: 2 }, i(p).adjustSkuDialogProps)), null, 16)) : se("", !0)
|
|
2076
2076
|
]))
|
|
2077
2077
|
];
|
|
2078
2078
|
}),
|