@feedmepos/mf-inventory-portal 1.2.10-dev.2 → 1.2.10-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-BWhxmKHS.js → App-D9otYMgh.js} +1 -1
- package/dist/{ApprovalView-CWKSx6tf.js → ApprovalView-Bue46U6e.js} +2 -2
- package/dist/{BindingsDialog-pf7Pseqo.js → BindingsDialog-Xleskmvg.js} +2 -2
- package/dist/{BindingsPicker-DPF6fGOz.js → BindingsPicker-BeNF1NcZ.js} +1 -1
- package/dist/{BindingsTable-BOwDjj1w.js → BindingsTable-ecWz3SHk.js} +1 -1
- package/dist/{ClosingDraftView-BdPBSsbx.js → ClosingDraftView-DkxOW9Ns.js} +2 -2
- package/dist/{ClosingTemplateView-CrFwfxa0.js → ClosingTemplateView-BbnpVNYF.js} +3 -3
- package/dist/{DeliveryOrderPrintPreview-M96uWAH1.js → DeliveryOrderPrintPreview-CH-IzSM9.js} +1 -1
- package/dist/{FmAdminBadge-yFwlzxM2.js → FmAdminBadge-D4rqYlKu.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BjdAAL2R.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DOR_Iu0w.js} +3 -3
- package/dist/{FmMultiselectDialog-BR3zi2Qz.js → FmMultiselectDialog-DBgk0_mV.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-rT6wwbOn.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DdxSlJRz.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DXzgrzX9.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-C22gncaQ.js} +1 -1
- package/dist/{IngredientGroupView-CEqIGjmQ.js → IngredientGroupView-CrNLRll8.js} +2 -2
- package/dist/{IngredientsView-BjXPJZ3X.js → IngredientsView-DLK0Seww.js} +134 -128
- package/dist/{IntegrationView-CFguVXIq.js → IntegrationView-DRwnqCf9.js} +4 -4
- package/dist/{InventoryBindingForm-KKLzZfag.js → InventoryBindingForm-DU6B0J0B.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-D1F8sNi4.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CLCDb25h.js} +3 -3
- package/dist/{InventoryBindingSummary-ypHlF4-M.js → InventoryBindingSummary-BH2bWICt.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BHTULAxS.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BD2hneTA.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-qOPiI7X6.js → PremiumBadge.vue_vue_type_script_setup_true_lang-GabOf_-7.js} +1 -1
- package/dist/{PublishView-Dg9HHIt8.js → PublishView-B510iDYx.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-NT9bddXA.js → PurchaseOrderPrintPreview-Cbsl8gcZ.js} +1 -1
- package/dist/{ReceiveRequestView-BqvQC4Yv.js → ReceiveRequestView-rKyNjRbk.js} +8 -8
- package/dist/{RecipeView-Cq8bWv-p.js → RecipeView-C9dw-1_E.js} +3 -3
- package/dist/{StockView-B8Sg9MkB.js → StockView-scnHVHGB.js} +170 -165
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DAWM5EXt.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Dt1S8tTH.js} +1 -1
- package/dist/{SupplierView-B6PJPIjW.js → SupplierView-to6stKYV.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CusQL6MO.js → TransferDetails.vue_vue_type_script_setup_true_lang-laVp-HrL.js} +6 -6
- package/dist/{TransferTemplateView-Q76fWi4K.js → TransferTemplateView-VOgIhPGW.js} +7 -7
- package/dist/{UnitView-Bcd_C1qi.js → UnitView-sr5QkKex.js} +3 -3
- package/dist/{WarehouseView-DhkwuXWo.js → WarehouseView-CB3luO1P.js} +1 -1
- package/dist/{app-BLEVBe_A.js → app-BpyxIAaY.js} +6031 -6014
- package/dist/app.js +1 -1
- package/dist/{closing-template-C7_dXuIo.js → closing-template-CEJaVQKn.js} +1 -1
- package/dist/{decimal-8MxI03d0.js → decimal-Dqff6QMJ.js} +1 -1
- package/dist/{format-unit-display-CerhQXAR.js → format-unit-display-DcORb0K7.js} +3 -3
- package/dist/{index-sEpAJ9CK.js → index-CFfIlNHC.js} +1 -1
- package/dist/{index-D-yaA6J1.js → index-rTyWq-0n.js} +1 -1
- package/dist/{purchase-order-template-BkCYKaeL.js → purchase-order-template-BFPrzfeR.js} +1 -1
- package/dist/{stock-CXhe_jH3.js → stock-CkgmiPOr.js} +1 -1
- package/dist/{supplier-DxTkTi0f.js → supplier-Db_-hKgm.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-lmLojXEr.js → use-ingredient-select-dialog-CEEFJa9x.js} +1 -1
- package/dist/{use-inventory-binding-dialog-DAMV-jsc.js → use-inventory-binding-dialog-C6Ev4777.js} +1 -1
- package/package.json +2 -2
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as ce, ref as N, computed as H, resolveComponent as I, openBlock as F, createBlock as K, withCtx as j, createElementVNode as e, normalizeClass as he, toDisplayString as b, createVNode as
|
|
2
|
-
import { u as pe, a1 as
|
|
3
|
-
import { u as Re, a as _e } from "./stock-
|
|
4
|
-
import { g as we } from "./decimal-
|
|
5
|
-
import { e as
|
|
6
|
-
import { _ as Te, S as Be, g as st, a as
|
|
7
|
-
import { _ as
|
|
1
|
+
import { defineComponent as ce, ref as N, computed as H, resolveComponent as I, openBlock as F, createBlock as K, withCtx as j, createElementVNode as e, normalizeClass as he, toDisplayString as b, createVNode as g, createElementBlock as O, Fragment as Z, renderList as ie, unref as u, h as fe, watch as xe, isRef as Ue, createCommentVNode as te, reactive as ut, mergeModels as Ye, useModel as ct, onMounted as Ee, createTextVNode as ue, normalizeStyle as Ze, Teleport as dt, normalizeProps as Ae, mergeProps as Ve } from "vue";
|
|
2
|
+
import { u as pe, a1 as mt, f as He, h as pt, a as Pe, F as Ke, a2 as vt, w as je, k as me, Y as ft, t as Se, a0 as Fe, A as yt, M as _t, $ as ye, a3 as bt, a4 as ne, a5 as kt, a6 as Ge, o as gt, s as ht, a7 as xt, a8 as St, a9 as Ft, aa as Ce, ab as wt, ac as et, Z as X, ad as $t, z as tt, ae as ke, af as At, ag as Vt, q as Me, n as We, r as Ct, c as Mt, ah as Bt, ai as Dt, aj as It, ak as jt, al as Tt, b as Ut, N as Et, J as Ht, K as Pt, L as Rt, O as Ot, P as Nt, Q as qe } from "./app-BpyxIAaY.js";
|
|
3
|
+
import { u as Re, a as _e } from "./stock-CkgmiPOr.js";
|
|
4
|
+
import { g as we } from "./decimal-Dqff6QMJ.js";
|
|
5
|
+
import { e as Lt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-GabOf_-7.js";
|
|
6
|
+
import { _ as Te, S as Be, g as st, a as zt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Dt1S8tTH.js";
|
|
7
|
+
import { _ as Yt } 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 be, 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 be, useDialog as Oe, useProxiedModel as Ne, useBreakpoints as Kt } from "@feedmepos/ui-library";
|
|
10
|
+
import { defineStore as Gt } from "pinia";
|
|
11
|
+
import { u as Wt } from "./use-inventory-binding-dialog-C6Ev4777.js";
|
|
12
|
+
import { _ as qt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BD2hneTA.js";
|
|
13
|
+
import { E as Xt } from "./empty-placeholder-wf6-BWE8.js";
|
|
14
|
+
import { F as lt } from "./FmAdminBadge-D4rqYlKu.js";
|
|
15
15
|
import "./array-Ca8T3f_G.js";
|
|
16
16
|
var ge = /* @__PURE__ */ ((k) => (k.History = "History", k.Convert = "Convert", k.Adjust = "Adjust", k))(ge || {});
|
|
17
17
|
const Jt = [
|
|
@@ -45,8 +45,8 @@ async function Zt(k) {
|
|
|
45
45
|
const c = `${(pe().currentLocation.name || "").replace(
|
|
46
46
|
/ /g,
|
|
47
47
|
"_"
|
|
48
|
-
)}_${
|
|
49
|
-
await
|
|
48
|
+
)}_${mt().format("DD_MM_YYYY_HHmm")}.xlsx`;
|
|
49
|
+
await Lt(
|
|
50
50
|
[
|
|
51
51
|
{
|
|
52
52
|
name: "stock",
|
|
@@ -81,23 +81,23 @@ async function Zt(k) {
|
|
|
81
81
|
c
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
|
-
function $e(k,
|
|
84
|
+
function $e(k, h) {
|
|
85
85
|
const c = localStorage.getItem(`uom:${k._id}`);
|
|
86
|
-
return c ? c ===
|
|
86
|
+
return c ? c === h._id ? {
|
|
87
87
|
type: "unit"
|
|
88
|
-
} :
|
|
88
|
+
} : h.measurements.find((s) => s.id === c) ? {
|
|
89
89
|
type: "measurement",
|
|
90
90
|
measurement: c
|
|
91
91
|
} : {
|
|
92
92
|
type: "unit"
|
|
93
|
-
} : k.trackingMeasurement &&
|
|
93
|
+
} : k.trackingMeasurement && h.measurements.find((s) => s.id === k.trackingMeasurement) ? {
|
|
94
94
|
type: "measurement",
|
|
95
95
|
measurement: k.trackingMeasurement
|
|
96
96
|
} : {
|
|
97
97
|
type: "unit"
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
const en = { class: "fm-typo-en-body-md-400 flex-grow" },
|
|
100
|
+
const en = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ ce({
|
|
101
101
|
__name: "UnitDisplayControl",
|
|
102
102
|
props: {
|
|
103
103
|
unit: {},
|
|
@@ -106,11 +106,11 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
106
106
|
defaultTrackingMeasurement: {}
|
|
107
107
|
},
|
|
108
108
|
setup(k) {
|
|
109
|
-
function
|
|
109
|
+
function h(B) {
|
|
110
110
|
return `uom:${B._id}`;
|
|
111
111
|
}
|
|
112
112
|
function c(B) {
|
|
113
|
-
const i =
|
|
113
|
+
const i = h(s.sku);
|
|
114
114
|
B ? localStorage.setItem(i, B) : localStorage.setItem(i, s.unit._id), $.value = $e(s.sku, s.unit);
|
|
115
115
|
}
|
|
116
116
|
const s = k, $ = N($e(s.sku, s.unit)), d = H(() => {
|
|
@@ -150,7 +150,7 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
150
150
|
])
|
|
151
151
|
}, [
|
|
152
152
|
e("div", en, b(v.value), 1),
|
|
153
|
-
|
|
153
|
+
g(l, {
|
|
154
154
|
class: "text-fm-color-neutral-gray-400",
|
|
155
155
|
name: "expand_more"
|
|
156
156
|
})
|
|
@@ -171,18 +171,18 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
171
171
|
}), tn = { class: "whitespace-nowrap" }, nn = /* @__PURE__ */ ce({
|
|
172
172
|
__name: "StockHeaderPreview",
|
|
173
173
|
setup(k) {
|
|
174
|
-
const { t:
|
|
175
|
-
return (c, s) => (F(), K(
|
|
174
|
+
const { t: h } = de();
|
|
175
|
+
return (c, s) => (F(), K(Yt, null, {
|
|
176
176
|
default: j(() => [
|
|
177
|
-
e("div", tn, b(u(
|
|
177
|
+
e("div", tn, b(u(h)("inventory.stock.prediction.daysRemaining")), 1)
|
|
178
178
|
]),
|
|
179
179
|
_: 1
|
|
180
180
|
}));
|
|
181
181
|
}
|
|
182
|
-
}),
|
|
183
|
-
const k = N(!1),
|
|
182
|
+
}), it = Gt("stockActions", () => {
|
|
183
|
+
const k = N(!1), h = pe(), c = Re(), s = nt(), $ = be(), d = Oe(), { t: m } = de();
|
|
184
184
|
async function v() {
|
|
185
|
-
if (
|
|
185
|
+
if (h._currentLocation) {
|
|
186
186
|
k.value = !0;
|
|
187
187
|
try {
|
|
188
188
|
await c.readStockBalance(), await c.readProductBalance(), await s.readStockEstimateBalance();
|
|
@@ -269,7 +269,7 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
|
|
|
269
269
|
};
|
|
270
270
|
});
|
|
271
271
|
function on() {
|
|
272
|
-
const k = pe(),
|
|
272
|
+
const k = pe(), h = it(), { t: c } = de();
|
|
273
273
|
return {
|
|
274
274
|
columnDefs: [
|
|
275
275
|
{
|
|
@@ -294,7 +294,7 @@ function on() {
|
|
|
294
294
|
amount: d.balance,
|
|
295
295
|
defaultTrackingMeasurement: d.trackingMeasurement ?? void 0
|
|
296
296
|
};
|
|
297
|
-
return fe(
|
|
297
|
+
return fe(rt, m);
|
|
298
298
|
},
|
|
299
299
|
size: 180
|
|
300
300
|
},
|
|
@@ -341,9 +341,9 @@ function on() {
|
|
|
341
341
|
id: "action",
|
|
342
342
|
cell($) {
|
|
343
343
|
var d;
|
|
344
|
-
return
|
|
344
|
+
return pt(
|
|
345
345
|
((d = k._currentLocation) == null ? void 0 : d.type) === "restaurant" ? Jt : Qt,
|
|
346
|
-
(m) =>
|
|
346
|
+
(m) => h.onActionMenu(m, $.row.original)
|
|
347
347
|
);
|
|
348
348
|
},
|
|
349
349
|
enableSorting: !1,
|
|
@@ -371,19 +371,19 @@ const sn = {
|
|
|
371
371
|
isInteger(k = "Must be an integer") {
|
|
372
372
|
return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error = k), this);
|
|
373
373
|
},
|
|
374
|
-
min(k,
|
|
374
|
+
min(k, h) {
|
|
375
375
|
if (this.error) return this;
|
|
376
376
|
try {
|
|
377
|
-
typeof this.context == "number" ? +this.context < k && (this.error =
|
|
377
|
+
typeof this.context == "number" ? +this.context < k && (this.error = h ?? `Must be at least ${k}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < k && (this.error = h ?? `Must be at least ${k}`) : this.error = "Length cannot be determined";
|
|
378
378
|
} catch {
|
|
379
379
|
this.error = "Length cannot be determined";
|
|
380
380
|
}
|
|
381
381
|
return this;
|
|
382
382
|
},
|
|
383
|
-
max(k,
|
|
383
|
+
max(k, h) {
|
|
384
384
|
if (this.error) return this;
|
|
385
385
|
try {
|
|
386
|
-
typeof this.context == "number" ? +this.context > k && (this.error =
|
|
386
|
+
typeof this.context == "number" ? +this.context > k && (this.error = h ?? `Must be at most ${k}`) : "length" in this.context ? +this.context.length > k && (this.error = h ?? `Must be at most ${k}`) : this.error = "Length cannot be determined";
|
|
387
387
|
} catch {
|
|
388
388
|
this.error = "Length cannot be determined";
|
|
389
389
|
}
|
|
@@ -401,8 +401,8 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
401
401
|
show: { type: Boolean }
|
|
402
402
|
},
|
|
403
403
|
emits: ["update:show", "submitted"],
|
|
404
|
-
setup(k, { expose:
|
|
405
|
-
const s = k, $ = c, d =
|
|
404
|
+
setup(k, { expose: h, emit: c }) {
|
|
405
|
+
const s = k, $ = c, d = Wt(), m = Pe(), v = _e(), S = be(), { t: B } = de(), i = N(0), l = N(null), y = H(() => m.skus), C = H(
|
|
406
406
|
() => {
|
|
407
407
|
var _, t;
|
|
408
408
|
return (((t = (_ = s.sku) == null ? void 0 : _.convert) == null ? void 0 : t.inventoryBindings) ?? []).filter(
|
|
@@ -434,7 +434,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
434
434
|
const t = (a = s.sku.convert) != null && a.measurement ? s.sku.unit.measurements.find((x) => {
|
|
435
435
|
var U;
|
|
436
436
|
return x.id === ((U = s.sku.convert) == null ? void 0 : U.measurement);
|
|
437
|
-
}) ?? null : null, o = je(s.sku.unit, t), f =
|
|
437
|
+
}) ?? null : null, o = je(s.sku.unit, t), f = bt(+_);
|
|
438
438
|
return Je(f).isInteger().max(o).error ? "Precision cannot be more than " + o : !0;
|
|
439
439
|
}
|
|
440
440
|
const M = H(
|
|
@@ -447,7 +447,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
447
447
|
}
|
|
448
448
|
), D = H(() => {
|
|
449
449
|
var f, p;
|
|
450
|
-
const t =
|
|
450
|
+
const t = vt({
|
|
451
451
|
bindings: ((f = s.sku.convert) == null ? void 0 : f.inventoryBindings) ?? [],
|
|
452
452
|
skus: m.skus,
|
|
453
453
|
skuGroups: m.skuGroups,
|
|
@@ -459,7 +459,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
459
459
|
var ze;
|
|
460
460
|
return ve.id === ((ze = s.sku.convert) == null ? void 0 : ze.measurement);
|
|
461
461
|
}) ?? null : null, se = je(s.sku.unit, z), T = w(`${i.value}`) === !0 ? me(
|
|
462
|
-
|
|
462
|
+
ft(
|
|
463
463
|
a.amount,
|
|
464
464
|
Se(+i.value, se)
|
|
465
465
|
),
|
|
@@ -472,7 +472,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
472
472
|
};
|
|
473
473
|
});
|
|
474
474
|
}), E = N();
|
|
475
|
-
|
|
475
|
+
h({
|
|
476
476
|
validateInputs: () => {
|
|
477
477
|
var _, t;
|
|
478
478
|
(t = (_ = E.value) == null ? void 0 : _.validateInputs) == null || t.call(_);
|
|
@@ -580,13 +580,13 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
580
580
|
]),
|
|
581
581
|
default: j(() => [
|
|
582
582
|
e("div", rn, [
|
|
583
|
-
|
|
583
|
+
g(f, {
|
|
584
584
|
ref_key: "formRef",
|
|
585
585
|
ref: E,
|
|
586
586
|
onValidationSuccess: n
|
|
587
587
|
}, {
|
|
588
588
|
default: j(() => [
|
|
589
|
-
|
|
589
|
+
g(o, {
|
|
590
590
|
disabled: V.value,
|
|
591
591
|
"model-value": i.value,
|
|
592
592
|
"onUpdate:modelValue": t[0] || (t[0] = (T) => i.value = T),
|
|
@@ -598,7 +598,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
598
598
|
]),
|
|
599
599
|
_: 1
|
|
600
600
|
}, 512),
|
|
601
|
-
|
|
601
|
+
g(p, {
|
|
602
602
|
variant: "outlined",
|
|
603
603
|
class: "p-16"
|
|
604
604
|
}, {
|
|
@@ -619,10 +619,10 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
619
619
|
]),
|
|
620
620
|
_: 1
|
|
621
621
|
}),
|
|
622
|
-
|
|
622
|
+
g(p, { variant: "outlined" }, {
|
|
623
623
|
default: j(() => [
|
|
624
624
|
e("div", pn, [
|
|
625
|
-
|
|
625
|
+
g(a, {
|
|
626
626
|
value: "",
|
|
627
627
|
modelValue: A.value,
|
|
628
628
|
"onUpdate:modelValue": t[1] || (t[1] = (T) => A.value = T),
|
|
@@ -630,9 +630,9 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
630
630
|
"label-placement": "right"
|
|
631
631
|
}, null, 8, ["modelValue", "label"]),
|
|
632
632
|
A.value ? (F(), O(Z, { key: 0 }, [
|
|
633
|
-
|
|
633
|
+
g(x, {
|
|
634
634
|
modelValue: l.value,
|
|
635
|
-
rules: [u(
|
|
635
|
+
rules: [u(yt)(1, "Must have at least one ingredient binding")]
|
|
636
636
|
}, null, 8, ["modelValue", "rules"]),
|
|
637
637
|
e("div", vn, [
|
|
638
638
|
e("div", fn, b(u(B)("inventory.stock.convert.ingredients")), 1),
|
|
@@ -641,7 +641,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
641
641
|
disabled: V.value,
|
|
642
642
|
modelValue: +u(me)(T.amount ?? { amount: 1, precision: 0 }),
|
|
643
643
|
rules: [
|
|
644
|
-
u(
|
|
644
|
+
u(_t)(
|
|
645
645
|
y.value.find((G) => G._id === T.id).unit,
|
|
646
646
|
T.measurement
|
|
647
647
|
),
|
|
@@ -653,7 +653,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
653
653
|
return [
|
|
654
654
|
e("div", yn, [
|
|
655
655
|
e("div", _n, b((W = y.value.find((q) => q._id === T.id)) == null ? void 0 : W.name), 1),
|
|
656
|
-
|
|
656
|
+
g(o, {
|
|
657
657
|
class: "xs:col-span-2",
|
|
658
658
|
disabled: V.value,
|
|
659
659
|
modelValue: +u(me)(
|
|
@@ -662,7 +662,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
662
662
|
"onUpdate:modelValue": (q) => J(T.id, q, l.value ?? []),
|
|
663
663
|
invalid: G
|
|
664
664
|
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
|
|
665
|
-
|
|
665
|
+
g(U, {
|
|
666
666
|
disabled: V.value,
|
|
667
667
|
class: "translate-y-[2px]",
|
|
668
668
|
items: R(T.id),
|
|
@@ -673,7 +673,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
673
673
|
"helper-text": j(() => t[4] || (t[4] = [])),
|
|
674
674
|
_: 2
|
|
675
675
|
}, 1032, ["disabled", "items", "model-value", "onUpdate:modelValue", "invalid"]),
|
|
676
|
-
|
|
676
|
+
g(z, {
|
|
677
677
|
disabled: V.value,
|
|
678
678
|
type: "button",
|
|
679
679
|
variant: "tertiary",
|
|
@@ -687,7 +687,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
687
687
|
}, 1032, ["disabled", "modelValue", "rules"]))), 128))
|
|
688
688
|
]),
|
|
689
689
|
e("div", null, [
|
|
690
|
-
|
|
690
|
+
g(z, {
|
|
691
691
|
icon: "link",
|
|
692
692
|
label: u(B)("inventory.stock.convert.linkIngredient"),
|
|
693
693
|
variant: "plain",
|
|
@@ -703,7 +703,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
703
703
|
]),
|
|
704
704
|
"side-sheet-footer": j(() => [
|
|
705
705
|
e("div", bn, [
|
|
706
|
-
|
|
706
|
+
g(z, {
|
|
707
707
|
loading: V.value,
|
|
708
708
|
label: u(B)("inventory.stock.convert.convertButton"),
|
|
709
709
|
onClick: t[2] || (t[2] = (T) => {
|
|
@@ -718,12 +718,12 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
|
|
|
718
718
|
};
|
|
719
719
|
}
|
|
720
720
|
});
|
|
721
|
-
function De(k,
|
|
722
|
-
const c = Se(k,
|
|
721
|
+
function De(k, h) {
|
|
722
|
+
const c = Se(k, h);
|
|
723
723
|
return { ...c, amount: -c.amount };
|
|
724
724
|
}
|
|
725
|
-
function Qe(k,
|
|
726
|
-
return Se(Math.abs(k),
|
|
725
|
+
function Qe(k, h) {
|
|
726
|
+
return Se(Math.abs(k), h);
|
|
727
727
|
}
|
|
728
728
|
const Ie = {
|
|
729
729
|
[ne.enum.DAMAGE]: {
|
|
@@ -753,10 +753,10 @@ const Ie = {
|
|
|
753
753
|
disabled: { type: Boolean }
|
|
754
754
|
},
|
|
755
755
|
emits: ["update:modelValue", "click:delete"],
|
|
756
|
-
setup(k, { emit:
|
|
757
|
-
const c = k, s =
|
|
756
|
+
setup(k, { emit: h }) {
|
|
757
|
+
const c = k, s = h, $ = H(
|
|
758
758
|
() => Object.keys(Ie).map((i) => ({
|
|
759
|
-
label:
|
|
759
|
+
label: kt(i),
|
|
760
760
|
value: i
|
|
761
761
|
}))
|
|
762
762
|
), d = H(() => st(c.modelValue.doc.unit, !0)), m = H({
|
|
@@ -820,23 +820,23 @@ const Ie = {
|
|
|
820
820
|
default: j(() => [
|
|
821
821
|
e("div", gn, [
|
|
822
822
|
e("div", hn, b(i.modelValue.doc.name), 1),
|
|
823
|
-
|
|
823
|
+
g(y, {
|
|
824
824
|
variant: "tertiary",
|
|
825
825
|
"prepend-icon": "delete",
|
|
826
826
|
onClick: l[0] || (l[0] = (n) => s("click:delete"))
|
|
827
827
|
})
|
|
828
828
|
]),
|
|
829
|
-
|
|
829
|
+
g(C, {
|
|
830
830
|
disabled: i.disabled,
|
|
831
831
|
class: "col-span-2",
|
|
832
832
|
label: "Type",
|
|
833
833
|
items: $.value,
|
|
834
834
|
modelValue: m.value,
|
|
835
835
|
"onUpdate:modelValue": l[1] || (l[1] = (n) => m.value = n),
|
|
836
|
-
rules: [u(
|
|
836
|
+
rules: [u(gt)()],
|
|
837
837
|
"label-mark": "required"
|
|
838
838
|
}, null, 8, ["disabled", "items", "modelValue", "rules"]),
|
|
839
|
-
|
|
839
|
+
g(qt, {
|
|
840
840
|
disabled: i.disabled,
|
|
841
841
|
label: "Amount",
|
|
842
842
|
step: +u(me)({
|
|
@@ -847,14 +847,14 @@ const Ie = {
|
|
|
847
847
|
"onUpdate:modelValue": l[2] || (l[2] = (n) => v.value = n),
|
|
848
848
|
rules: [u(Fe)(0)]
|
|
849
849
|
}, null, 8, ["disabled", "step", "modelValue", "rules"]),
|
|
850
|
-
|
|
850
|
+
g(C, {
|
|
851
851
|
disabled: i.disabled,
|
|
852
852
|
label: "Unit",
|
|
853
853
|
items: d.value,
|
|
854
854
|
modelValue: S.value,
|
|
855
855
|
"onUpdate:modelValue": l[3] || (l[3] = (n) => S.value = n)
|
|
856
856
|
}, null, 8, ["disabled", "items", "modelValue"]),
|
|
857
|
-
|
|
857
|
+
g(A, {
|
|
858
858
|
class: "col-span-2",
|
|
859
859
|
disabled: i.disabled,
|
|
860
860
|
label: "Remark",
|
|
@@ -874,13 +874,13 @@ const Ie = {
|
|
|
874
874
|
show: { type: Boolean }
|
|
875
875
|
},
|
|
876
876
|
emits: ["update:show", "submitted"],
|
|
877
|
-
setup(k, { expose:
|
|
877
|
+
setup(k, { expose: h, emit: c }) {
|
|
878
878
|
const s = k, $ = c, d = Pe(), m = Oe(), v = _e(), S = be(), B = N(!1), { t: i } = de();
|
|
879
879
|
function l() {
|
|
880
880
|
V(He(A));
|
|
881
881
|
}
|
|
882
882
|
const y = N();
|
|
883
|
-
|
|
883
|
+
h({
|
|
884
884
|
validateInputs: () => {
|
|
885
885
|
var w, M;
|
|
886
886
|
(M = (w = y.value) == null ? void 0 : w.validateInputs) == null || M.call(w);
|
|
@@ -894,7 +894,7 @@ const Ie = {
|
|
|
894
894
|
(M = (w = y.value) == null ? void 0 : w.resetInputs) == null || M.call(w);
|
|
895
895
|
}
|
|
896
896
|
});
|
|
897
|
-
const C = Ne(s, "show"), A =
|
|
897
|
+
const C = Ne(s, "show"), A = ut({
|
|
898
898
|
remark: "",
|
|
899
899
|
adjustments: [
|
|
900
900
|
{
|
|
@@ -951,7 +951,7 @@ const Ie = {
|
|
|
951
951
|
})), M = w.filter((D) => A.adjustments.find((E) => E.doc._id === D.value)).map((D) => D.value);
|
|
952
952
|
m.open({
|
|
953
953
|
title: "Select ingredients",
|
|
954
|
-
contentComponent:
|
|
954
|
+
contentComponent: ht,
|
|
955
955
|
contentComponentProps: {
|
|
956
956
|
items: w,
|
|
957
957
|
modelValue: M
|
|
@@ -998,21 +998,21 @@ const Ie = {
|
|
|
998
998
|
])
|
|
999
999
|
]),
|
|
1000
1000
|
default: j(() => [
|
|
1001
|
-
|
|
1001
|
+
g(P, {
|
|
1002
1002
|
class: "w-full flex flex-col gap-12",
|
|
1003
1003
|
ref_key: "formRef",
|
|
1004
1004
|
ref: y,
|
|
1005
1005
|
onValidationSuccess: l
|
|
1006
1006
|
}, {
|
|
1007
1007
|
default: j(() => [
|
|
1008
|
-
|
|
1008
|
+
g(D, {
|
|
1009
1009
|
label: u(i)("inventory.stock.adjust.remark"),
|
|
1010
1010
|
modelValue: A.remark,
|
|
1011
1011
|
"onUpdate:modelValue": M[0] || (M[0] = (J) => A.remark = J)
|
|
1012
1012
|
}, null, 8, ["label", "modelValue"]),
|
|
1013
1013
|
e("div", wn, [
|
|
1014
1014
|
e("div", $n, b(u(i)("inventory.stock.adjust.adjustedItems")), 1),
|
|
1015
|
-
|
|
1015
|
+
g(E, {
|
|
1016
1016
|
"prepend-icon": "add",
|
|
1017
1017
|
variant: "tertiary",
|
|
1018
1018
|
size: "md",
|
|
@@ -1031,7 +1031,7 @@ const Ie = {
|
|
|
1031
1031
|
]),
|
|
1032
1032
|
"side-sheet-footer": j(() => [
|
|
1033
1033
|
e("div", An, [
|
|
1034
|
-
|
|
1034
|
+
g(E, {
|
|
1035
1035
|
label: u(i)("inventory.stock.adjust.adjustButton"),
|
|
1036
1036
|
loading: B.value,
|
|
1037
1037
|
onClick: M[1] || (M[1] = (J) => {
|
|
@@ -1045,7 +1045,7 @@ const Ie = {
|
|
|
1045
1045
|
}, 8, ["modelValue"]);
|
|
1046
1046
|
};
|
|
1047
1047
|
}
|
|
1048
|
-
}), Cn =
|
|
1048
|
+
}), Cn = xt((k, h) => ({
|
|
1049
1049
|
// TODO: remove once latest inventory backend has been push
|
|
1050
1050
|
async findBillsByBusinessId(c, s, $) {
|
|
1051
1051
|
const d = `${k.businessesBackendUrl}/${c}/reports/find-many`, m = {
|
|
@@ -1054,13 +1054,13 @@ const Ie = {
|
|
|
1054
1054
|
restaurantIds: s,
|
|
1055
1055
|
ids: $
|
|
1056
1056
|
};
|
|
1057
|
-
return await
|
|
1057
|
+
return await h.post(d, m);
|
|
1058
1058
|
},
|
|
1059
1059
|
async findBillsById(c) {
|
|
1060
1060
|
const $ = pe().currentLocationDBName, d = `${k.inventoryBackendUrl}/${$}/bill/search`, m = {
|
|
1061
1061
|
ids: c
|
|
1062
1062
|
};
|
|
1063
|
-
return await
|
|
1063
|
+
return await h.post(d, m);
|
|
1064
1064
|
}
|
|
1065
1065
|
})), Mn = {
|
|
1066
1066
|
key: 0,
|
|
@@ -1074,8 +1074,8 @@ const Ie = {
|
|
|
1074
1074
|
modelModifiers: {}
|
|
1075
1075
|
}),
|
|
1076
1076
|
emits: /* @__PURE__ */ Ye(["refreshHistory"], ["update:modelValue"]),
|
|
1077
|
-
setup(k, { emit:
|
|
1078
|
-
const c = k, s =
|
|
1077
|
+
setup(k, { emit: h }) {
|
|
1078
|
+
const c = k, s = h, $ = _e(), d = ct(k, "modelValue"), m = N(!1), v = N(!1), S = N(!1), B = N({
|
|
1079
1079
|
_id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
|
|
1080
1080
|
skus: []
|
|
1081
1081
|
}), i = N();
|
|
@@ -1137,13 +1137,13 @@ const Ie = {
|
|
|
1137
1137
|
overlay: !0
|
|
1138
1138
|
}, {
|
|
1139
1139
|
"dialog-button": j(() => [
|
|
1140
|
-
|
|
1140
|
+
g(lt, null, {
|
|
1141
1141
|
default: j(() => [
|
|
1142
1142
|
e("button", {
|
|
1143
1143
|
onClick: r[0] || (r[0] = (R) => S.value = !0),
|
|
1144
1144
|
class: "rounded-md hover:bg-gray-100 transition-colors"
|
|
1145
1145
|
}, [
|
|
1146
|
-
|
|
1146
|
+
g(w, {
|
|
1147
1147
|
name: "edit",
|
|
1148
1148
|
size: "sm"
|
|
1149
1149
|
})
|
|
@@ -1159,15 +1159,15 @@ const Ie = {
|
|
|
1159
1159
|
e("div", Hn, [
|
|
1160
1160
|
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)),
|
|
1161
1161
|
e("div", Pn, [
|
|
1162
|
-
|
|
1163
|
-
|
|
1162
|
+
g(P),
|
|
1163
|
+
g(Q, {
|
|
1164
1164
|
class: "sm:w-full xs:w-full",
|
|
1165
1165
|
label: "Close",
|
|
1166
1166
|
size: "md",
|
|
1167
1167
|
variant: "tertiary",
|
|
1168
1168
|
onClick: r[3] || (r[3] = (R) => S.value = !1)
|
|
1169
1169
|
}),
|
|
1170
|
-
|
|
1170
|
+
g(Q, {
|
|
1171
1171
|
class: "sm:w-full xs:w-full",
|
|
1172
1172
|
label: "Submit",
|
|
1173
1173
|
size: "md",
|
|
@@ -1194,7 +1194,7 @@ const Ie = {
|
|
|
1194
1194
|
e("p", Bn, [
|
|
1195
1195
|
r[6] || (r[6] = e("b", null, "Date:", -1)),
|
|
1196
1196
|
r[7] || (r[7] = e("br", null, null, -1)),
|
|
1197
|
-
ue(" " + b(u(
|
|
1197
|
+
ue(" " + b(u(St)(u(Ft)(B.value._id))), 1)
|
|
1198
1198
|
]),
|
|
1199
1199
|
e("div", Dn, [
|
|
1200
1200
|
(F(!0), O(Z, null, ie(B.value.skus, (R, oe) => (F(), O(Z, { key: oe }, [
|
|
@@ -1217,7 +1217,7 @@ const Ie = {
|
|
|
1217
1217
|
r[9] || (r[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
|
|
1218
1218
|
e("span", null, b(u(Ce).toFormatString({ value: L.amount })) + " " + b(A(R, L)), 1)
|
|
1219
1219
|
]),
|
|
1220
|
-
|
|
1220
|
+
g(M, {
|
|
1221
1221
|
"model-value": y(R.sku._id, Y).value,
|
|
1222
1222
|
"onUpdate:modelValue": (le) => y(R.sku._id, Y).value = le,
|
|
1223
1223
|
class: "mb-3",
|
|
@@ -1270,7 +1270,7 @@ const Ie = {
|
|
|
1270
1270
|
bills: { default: () => [] }
|
|
1271
1271
|
},
|
|
1272
1272
|
emits: ["refreshHistory"],
|
|
1273
|
-
setup(k, { emit:
|
|
1273
|
+
setup(k, { emit: h }) {
|
|
1274
1274
|
const c = k, s = N(!1);
|
|
1275
1275
|
at();
|
|
1276
1276
|
const $ = N(), d = N(null), m = H(() => d.value === null ? "unset" : s.value ? `${d.value}px` : "0px");
|
|
@@ -1285,7 +1285,7 @@ const Ie = {
|
|
|
1285
1285
|
return ((r = n.skus) == null ? void 0 : r.filter((w) => w.sku._id === l._id)) ?? [];
|
|
1286
1286
|
}).flatMap((n) => n.amounts);
|
|
1287
1287
|
for (const n of A) {
|
|
1288
|
-
const r = n.measurement ?
|
|
1288
|
+
const r = n.measurement ? wt(n.measurement.conversion, n.amount) : n.amount;
|
|
1289
1289
|
y[V = n.type] ?? (y[V] = { amount: 0, precision: 0 }), y[n.type] = et(r, y[n.type]);
|
|
1290
1290
|
}
|
|
1291
1291
|
return Object.entries(y).reduce(
|
|
@@ -1297,7 +1297,7 @@ const Ie = {
|
|
|
1297
1297
|
{}
|
|
1298
1298
|
);
|
|
1299
1299
|
}), { t: S } = de(), B = H(() => c.record.adjustmentsByTime.map(({ date: i, adjustments: l }) => ({
|
|
1300
|
-
time:
|
|
1300
|
+
time: $t(new Date(i)),
|
|
1301
1301
|
adjustments: l.flatMap(
|
|
1302
1302
|
(y) => {
|
|
1303
1303
|
var C, A;
|
|
@@ -1343,7 +1343,7 @@ const Ie = {
|
|
|
1343
1343
|
onClick: l[0] || (l[0] = (V) => s.value = !s.value)
|
|
1344
1344
|
}, [
|
|
1345
1345
|
e("div", Nn, b(i.record.date), 1),
|
|
1346
|
-
|
|
1346
|
+
g(y, {
|
|
1347
1347
|
name: s.value ? "expand_more" : "expand_less",
|
|
1348
1348
|
color: "#777777",
|
|
1349
1349
|
size: "md"
|
|
@@ -1398,7 +1398,7 @@ const Ie = {
|
|
|
1398
1398
|
])), 1)
|
|
1399
1399
|
]),
|
|
1400
1400
|
default: j(() => [
|
|
1401
|
-
|
|
1401
|
+
g(y, {
|
|
1402
1402
|
name: "info",
|
|
1403
1403
|
size: "sm",
|
|
1404
1404
|
color: "primary"
|
|
@@ -1433,20 +1433,20 @@ const Ie = {
|
|
|
1433
1433
|
};
|
|
1434
1434
|
}
|
|
1435
1435
|
});
|
|
1436
|
-
function Zn(k,
|
|
1436
|
+
function Zn(k, h) {
|
|
1437
1437
|
var d;
|
|
1438
1438
|
const c = Object.keys(ne.enum).reduce(
|
|
1439
1439
|
(m, v) => (m[v] = { amount: 0, precision: 0 }, m),
|
|
1440
1440
|
{}
|
|
1441
1441
|
);
|
|
1442
|
-
if (!
|
|
1442
|
+
if (!h)
|
|
1443
1443
|
return Object.entries(c).reduce(
|
|
1444
1444
|
(m, [v]) => (m[v] = X.fromNumber(0), m),
|
|
1445
1445
|
{}
|
|
1446
1446
|
);
|
|
1447
1447
|
const $ = k.flatMap((m) => {
|
|
1448
1448
|
var v;
|
|
1449
|
-
return ((v = m.skus) == null ? void 0 : v.filter((S) => S.sku._id ===
|
|
1449
|
+
return ((v = m.skus) == null ? void 0 : v.filter((S) => S.sku._id === h._id)) ?? [];
|
|
1450
1450
|
}).flatMap((m) => m.amounts);
|
|
1451
1451
|
for (const m of $) {
|
|
1452
1452
|
const v = m.measurement ? X.multiply([m.measurement.conversion, m.amount]) : m.amount;
|
|
@@ -1462,18 +1462,18 @@ function Zn(k, g) {
|
|
|
1462
1462
|
`${X.toFormatString({
|
|
1463
1463
|
value: B,
|
|
1464
1464
|
precision: 4
|
|
1465
|
-
})} ${
|
|
1465
|
+
})} ${h.unit.abbrev}`, m;
|
|
1466
1466
|
},
|
|
1467
1467
|
{}
|
|
1468
1468
|
);
|
|
1469
1469
|
}
|
|
1470
|
-
function eo(k,
|
|
1471
|
-
if (!
|
|
1470
|
+
function eo(k, h) {
|
|
1471
|
+
if (!h)
|
|
1472
1472
|
return null;
|
|
1473
1473
|
let c = null;
|
|
1474
1474
|
const $ = k.flatMap((d) => {
|
|
1475
1475
|
var m;
|
|
1476
|
-
return ((m = d.skus) == null ? void 0 : m.filter((v) => v.sku._id ===
|
|
1476
|
+
return ((m = d.skus) == null ? void 0 : m.filter((v) => v.sku._id === h._id)) ?? [];
|
|
1477
1477
|
}).flatMap((d) => {
|
|
1478
1478
|
var m;
|
|
1479
1479
|
return !d.history || ((m = d.history) == null ? void 0 : m.length) === 0 ? [] : d.history[0];
|
|
@@ -1490,7 +1490,7 @@ function eo(k, g) {
|
|
|
1490
1490
|
return c != null ? (c.amount = Math.abs(c.amount), `${X.toFormatString({
|
|
1491
1491
|
value: c,
|
|
1492
1492
|
precision: 4
|
|
1493
|
-
})} ${
|
|
1493
|
+
})} ${h.unit.abbrev}`) : null;
|
|
1494
1494
|
}
|
|
1495
1495
|
const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = { class: "flex-1 line-clamp-2" }, oo = { class: "flex flex-col gap-32 w-full h-full" }, so = { class: "flex items-center relative gap-4" }, ao = { class: "flex-1" }, lo = {
|
|
1496
1496
|
key: 0,
|
|
@@ -1515,7 +1515,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1515
1515
|
},
|
|
1516
1516
|
emits: ["update:show"],
|
|
1517
1517
|
setup(k) {
|
|
1518
|
-
const
|
|
1518
|
+
const h = at(), c = Re(), s = _e(), $ = Cn(), d = pe(), m = Mt(), { t: v } = de(), S = k, B = N(!1), i = be(), l = N(At(0));
|
|
1519
1519
|
async function y() {
|
|
1520
1520
|
B.value = !0;
|
|
1521
1521
|
try {
|
|
@@ -1537,7 +1537,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1537
1537
|
});
|
|
1538
1538
|
const C = N([]), A = N([]), V = N(new Array());
|
|
1539
1539
|
function n(t, o) {
|
|
1540
|
-
return o === "day" ?
|
|
1540
|
+
return o === "day" ? Tt(t) : tt(t);
|
|
1541
1541
|
}
|
|
1542
1542
|
function r(t, o) {
|
|
1543
1543
|
const f = t.reduce(
|
|
@@ -1558,8 +1558,8 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1558
1558
|
async function w() {
|
|
1559
1559
|
let t = await s.readStockAdjustment(
|
|
1560
1560
|
S.sku._id,
|
|
1561
|
-
|
|
1562
|
-
|
|
1561
|
+
Bt(new Date(l.value.startDate)).toISOString(),
|
|
1562
|
+
Dt(new Date(l.value.endDate)).toISOString()
|
|
1563
1563
|
);
|
|
1564
1564
|
C.value = t;
|
|
1565
1565
|
const o = t.filter(({ ref: f }) => f == null ? void 0 : f.startsWith("bill_")).map(({ ref: f }) => f);
|
|
@@ -1573,7 +1573,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1573
1573
|
t.length && (V.value = await $.findBillsById(t).catch((o) => {
|
|
1574
1574
|
var a;
|
|
1575
1575
|
console.error("Error on using latest bill API, retrying using legacy api", o);
|
|
1576
|
-
const f = ((a =
|
|
1576
|
+
const f = ((a = h.currentBusiness.value) == null ? void 0 : a._id) ?? "", p = d.currentLocation.doc._id;
|
|
1577
1577
|
return $.findBillsByBusinessId(f, [p], t);
|
|
1578
1578
|
}));
|
|
1579
1579
|
}
|
|
@@ -1616,7 +1616,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1616
1616
|
const x = a.cost;
|
|
1617
1617
|
if (!x) return p;
|
|
1618
1618
|
const U = {
|
|
1619
|
-
...
|
|
1619
|
+
...Vt(p, Math.max(p.precision, x.precision)),
|
|
1620
1620
|
currency: x.currency
|
|
1621
1621
|
};
|
|
1622
1622
|
return {
|
|
@@ -1627,13 +1627,13 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1627
1627
|
{
|
|
1628
1628
|
amount: 0,
|
|
1629
1629
|
precision: 0,
|
|
1630
|
-
currency: Me((f =
|
|
1630
|
+
currency: Me((f = h.currentCountry) == null ? void 0 : f.value)
|
|
1631
1631
|
}
|
|
1632
1632
|
);
|
|
1633
1633
|
return ke(o, !1, o.precision);
|
|
1634
1634
|
});
|
|
1635
1635
|
function R() {
|
|
1636
|
-
const { startDate: t, endDate: o } =
|
|
1636
|
+
const { startDate: t, endDate: o } = It(l.value);
|
|
1637
1637
|
t !== null && o !== null && (l.value = {
|
|
1638
1638
|
startDate: t,
|
|
1639
1639
|
endDate: o
|
|
@@ -1652,7 +1652,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1652
1652
|
}, p = o.amount, a = p.amount == 0 ? X.fromNumber(0) : X.divide([f, p]);
|
|
1653
1653
|
return {
|
|
1654
1654
|
...X.multiply([a, p]),
|
|
1655
|
-
currency: ((se = o.cost) == null ? void 0 : se.currency) || Me(((T =
|
|
1655
|
+
currency: ((se = o.cost) == null ? void 0 : se.currency) || Me(((T = h.currentCountry) == null ? void 0 : T.value) ?? Ct)
|
|
1656
1656
|
};
|
|
1657
1657
|
}), Y = H(() => {
|
|
1658
1658
|
var f;
|
|
@@ -1666,11 +1666,11 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1666
1666
|
amount: 0,
|
|
1667
1667
|
precision: 0
|
|
1668
1668
|
}),
|
|
1669
|
-
currency: Me((f =
|
|
1669
|
+
currency: Me((f = h.currentCountry) == null ? void 0 : f.value)
|
|
1670
1670
|
} : "No data";
|
|
1671
1671
|
});
|
|
1672
1672
|
function le() {
|
|
1673
|
-
const { startDate: t, endDate: o } =
|
|
1673
|
+
const { startDate: t, endDate: o } = jt(l.value);
|
|
1674
1674
|
t !== null && o !== null && (l.value = {
|
|
1675
1675
|
startDate: t,
|
|
1676
1676
|
endDate: o
|
|
@@ -1689,7 +1689,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1689
1689
|
"side-sheet-header": j(() => [
|
|
1690
1690
|
e("div", to, [
|
|
1691
1691
|
e("div", no, b(u(v)("inventory.stock.history.title", [t.sku.name])), 1),
|
|
1692
|
-
|
|
1692
|
+
g(f, {
|
|
1693
1693
|
variant: "tertiary",
|
|
1694
1694
|
"prepend-icon": "close",
|
|
1695
1695
|
onClick: o[0] || (o[0] = (q) => _.value = !1)
|
|
@@ -1702,7 +1702,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1702
1702
|
e("div", oo, [
|
|
1703
1703
|
e("div", so, [
|
|
1704
1704
|
e("div", ao, [
|
|
1705
|
-
|
|
1705
|
+
g(a, {
|
|
1706
1706
|
modelValue: l.value,
|
|
1707
1707
|
"onUpdate:modelValue": o[1] || (o[1] = (ee) => l.value = ee),
|
|
1708
1708
|
"show-predefined-range": "",
|
|
@@ -1711,7 +1711,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1711
1711
|
"z-index": 50
|
|
1712
1712
|
}, {
|
|
1713
1713
|
"trigger-button": j(({ opened: ee }) => [
|
|
1714
|
-
|
|
1714
|
+
g(p, {
|
|
1715
1715
|
"prepend-icon": "calendar_month",
|
|
1716
1716
|
focused: ee
|
|
1717
1717
|
}, {
|
|
@@ -1724,27 +1724,27 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1724
1724
|
_: 1
|
|
1725
1725
|
}, 8, ["modelValue"])
|
|
1726
1726
|
]),
|
|
1727
|
-
|
|
1727
|
+
g(f, {
|
|
1728
1728
|
variant: "tertiary",
|
|
1729
1729
|
onClick: o[2] || (o[2] = (ee) => R()),
|
|
1730
1730
|
"prepend-icon": "navigate_before"
|
|
1731
1731
|
}),
|
|
1732
|
-
|
|
1732
|
+
g(f, {
|
|
1733
1733
|
variant: "tertiary",
|
|
1734
1734
|
onClick: o[3] || (o[3] = (ee) => le()),
|
|
1735
1735
|
"prepend-icon": "navigate_next"
|
|
1736
1736
|
})
|
|
1737
1737
|
]),
|
|
1738
1738
|
B.value ? (F(), O("div", lo, [
|
|
1739
|
-
|
|
1740
|
-
|
|
1739
|
+
g(x),
|
|
1740
|
+
g(U, { size: "xl" }),
|
|
1741
1741
|
e("div", ro, b(u(v)("inventory.stock.history.loading")), 1),
|
|
1742
|
-
|
|
1743
|
-
|
|
1742
|
+
g(x),
|
|
1743
|
+
g(x)
|
|
1744
1744
|
])) : A.value && ((q = A.value) == null ? void 0 : q.length) > 0 ? (F(), O("div", io, [
|
|
1745
|
-
|
|
1745
|
+
g(ae, { variant: "outlined" }, {
|
|
1746
1746
|
default: j(() => [
|
|
1747
|
-
|
|
1747
|
+
g(W, { class: "flex flex-col gap-4" }, {
|
|
1748
1748
|
default: j(() => [
|
|
1749
1749
|
e("div", uo, [
|
|
1750
1750
|
e("div", co, b(u(v)("inventory.stock.history.summary.title")), 1)
|
|
@@ -1765,7 +1765,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1765
1765
|
"z-index": 50
|
|
1766
1766
|
}, {
|
|
1767
1767
|
default: j(() => [
|
|
1768
|
-
|
|
1768
|
+
g(z, {
|
|
1769
1769
|
name: "warning",
|
|
1770
1770
|
size: "sm"
|
|
1771
1771
|
})
|
|
@@ -1805,21 +1805,21 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1805
1805
|
])
|
|
1806
1806
|
]),
|
|
1807
1807
|
u(m).enableTotalCost ? (F(), O("div", Ro, [
|
|
1808
|
-
|
|
1808
|
+
g(T, { class: "w-full" }),
|
|
1809
1809
|
e("div", Oo, [
|
|
1810
1810
|
e("div", No, [
|
|
1811
|
-
|
|
1811
|
+
g(Xe, { "z-index": 50 }, {
|
|
1812
1812
|
default: j(() => [
|
|
1813
1813
|
e("div", Lo, [
|
|
1814
1814
|
ue(b(u(v)("inventory.stock.history.estimatedValue")) + " ", 1),
|
|
1815
|
-
|
|
1815
|
+
g(se, {
|
|
1816
1816
|
variant: "plain",
|
|
1817
1817
|
placement: "top",
|
|
1818
1818
|
content: `[${oe.value}] ${u(v)("inventory.stock.history.estimatedValueTooltip")}`,
|
|
1819
1819
|
"z-index": 50
|
|
1820
1820
|
}, {
|
|
1821
1821
|
default: j(() => [
|
|
1822
|
-
|
|
1822
|
+
g(z, {
|
|
1823
1823
|
name: "help",
|
|
1824
1824
|
size: "sm"
|
|
1825
1825
|
})
|
|
@@ -1832,7 +1832,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1832
1832
|
}),
|
|
1833
1833
|
e("div", zo, [
|
|
1834
1834
|
t.sku.valuation === u(We).Enum.FIFO ? (F(), O(Z, { key: 0 }, [
|
|
1835
|
-
|
|
1835
|
+
g(G, {
|
|
1836
1836
|
label: "FIFO",
|
|
1837
1837
|
compact: ""
|
|
1838
1838
|
}),
|
|
@@ -1851,11 +1851,11 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1851
1851
|
])
|
|
1852
1852
|
]),
|
|
1853
1853
|
e("div", Yo, [
|
|
1854
|
-
|
|
1854
|
+
g(Xe, { "z-index": 50 }, {
|
|
1855
1855
|
default: j(() => [
|
|
1856
1856
|
e("div", Ko, [
|
|
1857
1857
|
ue(b(u(v)("inventory.stock.history.costSold")) + " ", 1),
|
|
1858
|
-
|
|
1858
|
+
g(se, {
|
|
1859
1859
|
variant: "plain",
|
|
1860
1860
|
placement: "top",
|
|
1861
1861
|
"z-index": 50
|
|
@@ -1864,7 +1864,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1864
1864
|
e("div", Go, b(u(v)("inventory.stock.history.costSoldTooltip")), 1)
|
|
1865
1865
|
]),
|
|
1866
1866
|
default: j(() => [
|
|
1867
|
-
|
|
1867
|
+
g(z, {
|
|
1868
1868
|
name: "help",
|
|
1869
1869
|
size: "sm"
|
|
1870
1870
|
})
|
|
@@ -1898,17 +1898,17 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1898
1898
|
}, null, 8, ["record", "sku", "bills"])) : te("", !0)
|
|
1899
1899
|
], 64))), 128))
|
|
1900
1900
|
])) : (F(), O("div", qo, [
|
|
1901
|
-
|
|
1901
|
+
g(x),
|
|
1902
1902
|
e("div", null, [
|
|
1903
1903
|
e("img", {
|
|
1904
|
-
src: u(
|
|
1904
|
+
src: u(Xt),
|
|
1905
1905
|
alt: "List is empty"
|
|
1906
1906
|
}, null, 8, Xo)
|
|
1907
1907
|
]),
|
|
1908
1908
|
e("div", Jo, b(u(v)("inventory.stock.history.noRecords")), 1),
|
|
1909
1909
|
e("div", Qo, b(u(v)("inventory.stock.history.changeDateRange")), 1),
|
|
1910
|
-
|
|
1911
|
-
|
|
1910
|
+
g(x),
|
|
1911
|
+
g(x)
|
|
1912
1912
|
]))
|
|
1913
1913
|
])
|
|
1914
1914
|
];
|
|
@@ -1923,22 +1923,22 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1923
1923
|
}, ts = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ns = { class: "flex flex-col gap-8" }, os = { class: "flex flex-col" }, ss = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, as = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, hs = /* @__PURE__ */ ce({
|
|
1924
1924
|
__name: "StockView",
|
|
1925
1925
|
setup(k) {
|
|
1926
|
-
const { t:
|
|
1926
|
+
const { t: h } = de(), c = Pe(), s = pe(), $ = Re(), d = it(), m = _e(), v = nt(), S = Ut(), { columnDefs: B } = on(), i = Oe(), l = be();
|
|
1927
1927
|
s.watchLocation(V);
|
|
1928
1928
|
const y = H(
|
|
1929
1929
|
() => new Set(S.getAvailableItems(S.businessSubsidiaryId))
|
|
1930
1930
|
), C = N(!1);
|
|
1931
1931
|
async function A() {
|
|
1932
1932
|
i.open({
|
|
1933
|
-
title:
|
|
1934
|
-
message:
|
|
1933
|
+
title: h("inventory.stock.stock_balance.refreshBalance"),
|
|
1934
|
+
message: h("inventory.stock.stock_balance.refreshBalanceDescription"),
|
|
1935
1935
|
closeButton: !0,
|
|
1936
1936
|
primaryActions: {
|
|
1937
|
-
text:
|
|
1937
|
+
text: h("common.confirm"),
|
|
1938
1938
|
close: !0
|
|
1939
1939
|
},
|
|
1940
1940
|
secondaryActions: {
|
|
1941
|
-
text:
|
|
1941
|
+
text: h("common.close"),
|
|
1942
1942
|
close: !0,
|
|
1943
1943
|
variant: "tertiary"
|
|
1944
1944
|
}
|
|
@@ -1957,8 +1957,8 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1957
1957
|
await $.readStockBalance(), await $.readProductBalance(), await v.readStockEstimateBalance();
|
|
1958
1958
|
} catch (L) {
|
|
1959
1959
|
l.open({
|
|
1960
|
-
title:
|
|
1961
|
-
message:
|
|
1960
|
+
title: h("inventory.stock.error.title"),
|
|
1961
|
+
message: h("inventory.stock.error.message"),
|
|
1962
1962
|
type: "error"
|
|
1963
1963
|
}), console.error("error on fetch stock balance", L);
|
|
1964
1964
|
} finally {
|
|
@@ -1985,10 +1985,10 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
1985
1985
|
]
|
|
1986
1986
|
}), w = H(() => {
|
|
1987
1987
|
var le, _, t;
|
|
1988
|
-
const L = r.value ?
|
|
1988
|
+
const L = r.value ? Et.build(r.value) : null, Y = [];
|
|
1989
1989
|
for (const o of c.skus) {
|
|
1990
1990
|
let f = !0;
|
|
1991
|
-
if (S.isEnabled && D.value && y.value && f && (f = y.value.has(o._id)), L && f && (f =
|
|
1991
|
+
if (S.isEnabled && D.value && y.value && f && (f = y.value.has(o._id)), L && f && (f = Ht(
|
|
1992
1992
|
{
|
|
1993
1993
|
status: o.isInactive ? "Inactive" : "Active"
|
|
1994
1994
|
},
|
|
@@ -2013,19 +2013,19 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
2013
2013
|
}
|
|
2014
2014
|
}
|
|
2015
2015
|
return Y;
|
|
2016
|
-
}), M = N(""), D = N(!0), { breakpoints: E } =
|
|
2016
|
+
}), M = N(""), D = N(!0), { breakpoints: E } = Kt(), P = H(() => E.value.xs || E.value.sm), Q = H(() => P.value ? 10 : 20), J = Pt(), R = H(() => [
|
|
2017
2017
|
{
|
|
2018
|
-
label:
|
|
2018
|
+
label: h("inventory.stock.stock_balance.refreshBalance"),
|
|
2019
2019
|
value: "refresh-balance",
|
|
2020
2020
|
isPrimary: !0,
|
|
2021
2021
|
prependIcon: "calculate"
|
|
2022
2022
|
},
|
|
2023
2023
|
{
|
|
2024
|
-
label:
|
|
2024
|
+
label: h("inventory.common.refresh"),
|
|
2025
2025
|
value: "refresh"
|
|
2026
2026
|
},
|
|
2027
2027
|
{
|
|
2028
|
-
label:
|
|
2028
|
+
label: h("inventory.common.export"),
|
|
2029
2029
|
value: "export"
|
|
2030
2030
|
}
|
|
2031
2031
|
]);
|
|
@@ -2041,8 +2041,8 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
2041
2041
|
}
|
|
2042
2042
|
return (L, Y) => {
|
|
2043
2043
|
const le = I("FmSwitch"), _ = I("FmTable");
|
|
2044
|
-
return F(), K(
|
|
2045
|
-
title: u(
|
|
2044
|
+
return F(), K(Rt, {
|
|
2045
|
+
title: u(h)("inventory.stock.title"),
|
|
2046
2046
|
actions: R.value,
|
|
2047
2047
|
"onClick:action": oe
|
|
2048
2048
|
}, {
|
|
@@ -2058,7 +2058,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
2058
2058
|
}
|
|
2059
2059
|
])
|
|
2060
2060
|
}, [
|
|
2061
|
-
|
|
2061
|
+
g(Ot, {
|
|
2062
2062
|
searchable: "",
|
|
2063
2063
|
"change-location": "",
|
|
2064
2064
|
search: M.value,
|
|
@@ -2070,12 +2070,17 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
2070
2070
|
}, {
|
|
2071
2071
|
default: j(() => [
|
|
2072
2072
|
u(S).isEnabled ? (F(), O("div", es, [
|
|
2073
|
-
e("span", ts, b(u(
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2073
|
+
e("span", ts, b(u(h)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
|
|
2074
|
+
g(zt),
|
|
2075
|
+
g(lt, null, {
|
|
2076
|
+
default: j(() => [
|
|
2077
|
+
g(le, {
|
|
2078
|
+
modelValue: D.value,
|
|
2079
|
+
"onUpdate:modelValue": Y[0] || (Y[0] = (a) => D.value = a)
|
|
2080
|
+
}, null, 8, ["modelValue"])
|
|
2081
|
+
]),
|
|
2082
|
+
_: 1
|
|
2083
|
+
})
|
|
2079
2084
|
])) : te("", !0)
|
|
2080
2085
|
]),
|
|
2081
2086
|
_: 1
|
|
@@ -2091,7 +2096,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
2091
2096
|
"page-size": Q.value
|
|
2092
2097
|
}, {
|
|
2093
2098
|
"list-row": j((a) => [
|
|
2094
|
-
|
|
2099
|
+
g(Nt, {
|
|
2095
2100
|
row: a,
|
|
2096
2101
|
onRowClick: u(d).showSkuHistory
|
|
2097
2102
|
}, {
|
|
@@ -2101,25 +2106,25 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
2101
2106
|
e("div", ns, [
|
|
2102
2107
|
e("div", os, [
|
|
2103
2108
|
e("div", ss, [
|
|
2104
|
-
|
|
2109
|
+
g(u(qe), {
|
|
2105
2110
|
render: (se = (z = (U = x.code) == null ? void 0 : U.column) == null ? void 0 : z.columnDef) == null ? void 0 : se.cell,
|
|
2106
2111
|
props: (G = (T = x.code) == null ? void 0 : T.getContext) == null ? void 0 : G.call(T)
|
|
2107
2112
|
}, null, 8, ["render", "props"])
|
|
2108
2113
|
]),
|
|
2109
2114
|
e("div", as, [
|
|
2110
|
-
|
|
2115
|
+
g(u(qe), {
|
|
2111
2116
|
render: (re = (ae = (W = x.name) == null ? void 0 : W.column) == null ? void 0 : ae.columnDef) == null ? void 0 : re.cell,
|
|
2112
2117
|
props: (ee = (q = x.name) == null ? void 0 : q.getContext) == null ? void 0 : ee.call(q)
|
|
2113
2118
|
}, null, 8, ["render", "props"])
|
|
2114
2119
|
])
|
|
2115
2120
|
]),
|
|
2116
2121
|
e("div", null, [
|
|
2117
|
-
|
|
2122
|
+
g(Te, {
|
|
2118
2123
|
days: a.original.day
|
|
2119
2124
|
}, null, 8, ["days"])
|
|
2120
2125
|
]),
|
|
2121
2126
|
e("div", null, [
|
|
2122
|
-
|
|
2127
|
+
g(rt, {
|
|
2123
2128
|
class: "xs:w-[160px]",
|
|
2124
2129
|
unit: a.original.unit,
|
|
2125
2130
|
sku: a.original,
|
|
@@ -2136,7 +2141,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
|
|
|
2136
2141
|
_: 1
|
|
2137
2142
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
2138
2143
|
], 2),
|
|
2139
|
-
(F(), K(
|
|
2144
|
+
(F(), K(dt, { to: "body" }, [
|
|
2140
2145
|
(o = u(d).stockHistoryProps) != null && o.sku ? (F(), K(Zo, Ae(Ve({ key: 0 }, u(d).stockHistoryProps)), null, 16)) : te("", !0),
|
|
2141
2146
|
(f = u(d).convertSkuDialogProps) != null && f.sku ? (F(), K(kn, Ae(Ve({ key: 1 }, u(d).convertSkuDialogProps)), null, 16)) : te("", !0),
|
|
2142
2147
|
(p = u(d).adjustSkuDialogProps) != null && p.stock ? (F(), K(Vn, Ae(Ve({ key: 2 }, u(d).adjustSkuDialogProps)), null, 16)) : te("", !0)
|