@feedmepos/mf-inventory-portal 1.2.37 → 1.2.38
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-CeK_qF8S.js → App-CONrAP7y.js} +3 -3
- package/dist/{ApprovalView-CRoApvXP.js → ApprovalView-Cn9_7xk9.js} +5 -5
- package/dist/{BindingsDialog-D7oWgao5.js → BindingsDialog-L7mP6sx9.js} +2 -2
- package/dist/{BindingsPicker-DtBK6IiY.js → BindingsPicker-DZqBMDUg.js} +2 -2
- package/dist/{BindingsTable-DA78EnRr.js → BindingsTable-DHkFDwiH.js} +3 -3
- package/dist/{ClosingDraftView-QwoDNdEG.js → ClosingDraftView-BtSmlj0J.js} +8 -8
- package/dist/{ClosingHistoryView-B0iTuNfi.js → ClosingHistoryView-j83Wuxis.js} +3 -3
- package/dist/{ClosingTemplateView-DcrA94z5.js → ClosingTemplateView-ZubBNFCd.js} +14 -14
- package/dist/{DeliveryOrderPrintPreview-Dq-J4tR9.js → DeliveryOrderPrintPreview-DfS2E2tl.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Cof8Bfgq.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CoO6g5B9.js} +5 -5
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CUThFhNX.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DnMjbyPc.js} +2 -2
- package/dist/{FmMultiselectDialog-BGlvWlXa.js → FmMultiselectDialog-8_qMKCPt.js} +2 -2
- package/dist/{FmMultiselectDialog-Bb9NanTO.js → FmMultiselectDialog-vj94RVLU.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CElIKa2q.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Dihv3KTq.js} +3 -3
- package/dist/{ImportView-DONs_LxT.js → ImportView--0ZbHtb9.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BHpy10sR.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-Bosdu_28.js} +1 -1
- package/dist/{IngredientGroupView-B2PGNVgs.js → IngredientGroupView-D937cHah.js} +5 -5
- package/dist/{IngredientsView-Csg56tMS.js → IngredientsView-BNdvTpOT.js} +14 -14
- package/dist/{IntegrationView-DTuA2HWr.js → IntegrationView-Dm3Eur8-.js} +12 -12
- package/dist/{InventoryBindingForm-DEM4GIWm.js → InventoryBindingForm-rBhW4Snl.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CiVFTeH2.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Cvpi7GQx.js} +4 -4
- package/dist/{InventoryBindingSummary-25VjoY2Y.js → InventoryBindingSummary-emUM5QuA.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DXcXbuB4.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DFW-jg1P.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-06C-wQA_.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BOxIYl0Z.js} +2 -2
- package/dist/{PublishView-DlJ9F6qG.js → PublishView-CXRBcsxc.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-BZ8Ed5WE.js → PurchaseOrderPrintPreview-BvjDpyrq.js} +1 -1
- package/dist/{ReceiveRequestView-CcUNprOo.js → ReceiveRequestView-TwL3yVCN.js} +20 -20
- package/dist/{RecipeView-CRZ8J2aX.js → RecipeView-dggwqURE.js} +8 -8
- package/dist/{StockView-BmAN2RBF.js → StockView-Cml9AuXX.js} +305 -300
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DHQ9rh_K.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BTZa1E_o.js} +1 -1
- package/dist/{SupplierView-Ql7Uv9o7.js → SupplierView-CnD2QpE7.js} +11 -11
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CvmQnM4U.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DIbaHfbR.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-RqkogK9x.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DeD1jiXL.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Cc9kamH1.js → TransferDetails.vue_vue_type_script_setup_true_lang-Y0eaTjgd.js} +14 -14
- package/dist/{TransferTemplateView-6dljfxf0.js → TransferTemplateView-DytfORlu.js} +15 -15
- package/dist/{UnitView-D_mpHVCT.js → UnitView-ZUo-3Em1.js} +6 -6
- package/dist/{WarehouseView-PMFDsSw7.js → WarehouseView-DlZirt8V.js} +5 -5
- package/dist/{WastageTemplateView-DFTPlXGn.js → WastageTemplateView-5Qvs2GZC.js} +14 -14
- package/dist/{app-_CU3F6R4.js → app-xCn1wZY9.js} +4499 -4432
- package/dist/app.js +1 -1
- package/dist/{closing-template-BhS-0jIz.js → closing-template-DS8zFVJt.js} +1 -1
- package/dist/{date2-C6uzhgPn.js → date2-hHwvNr68.js} +1 -1
- package/dist/{dayjs.min-CozQIYEl.js → dayjs.min-PqgQ_K75.js} +1 -1
- package/dist/{decimal-BBdSv1Ja.js → decimal-DOCxaZjf.js} +2 -2
- package/dist/{defineDeepModel-BfzQJIm7.js → defineDeepModel-CTlh0zvq.js} +1 -1
- package/dist/{duplicate-template-DaXBJZ_C.js → duplicate-template-F8fz-36_.js} +1 -1
- package/dist/{feature-BmvwVQ_c.js → feature-UnTx1VJG.js} +2 -2
- package/dist/{format-time-from-id-DH9qF8CS.js → format-time-from-id-DTsuaGJG.js} +1 -1
- package/dist/{format-unit-display-QpP6LDiw.js → format-unit-display-DS3MzSfd.js} +10 -10
- package/dist/{import-export.helper-BOEHkn5c.js → import-export.helper-BAUfb01o.js} +5 -5
- package/dist/{index-D6s0-V2x.js → index-BX9ig-2t.js} +1 -1
- package/dist/{index-BAo9VZMM.js → index-CYZHYBBP.js} +1 -1
- package/dist/{index-D_UER6mr.js → index-D_kOnYds.js} +3 -3
- package/dist/{lodash-Cx9lFAWb.js → lodash-Cqi23PoA.js} +1 -1
- package/dist/{netsuite-B_4zkdtB.js → netsuite-Cg_AEH3H.js} +3 -3
- package/dist/{purchase-order-template-D1R5xTSO.js → purchase-order-template-Dh3D_2Tz.js} +1 -1
- package/dist/{rules-B7jgIAf1.js → rules-C_FnXd1e.js} +3 -3
- package/dist/{stock-3JD69pdx.js → stock-BPdGitCC.js} +3 -3
- package/dist/{stock-Bqg8PTKL.js → stock-DJDm1iIR.js} +1 -1
- package/dist/supplier-BtZVHCAl.js +78 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-A0HrT795.js → use-ingredient-select-dialog-n26Kr4C5.js} +2 -2
- package/dist/{use-inventory-binding-dialog-DoEc5HD3.js → use-inventory-binding-dialog-kkpC2Tzi.js} +2 -2
- package/dist/{use-template-enabled-locations-2-D3xMfpEA.js → use-template-enabled-locations-2-4ou70XAL.js} +2 -2
- package/dist/{vue-i18n-reLqSmov.js → vue-i18n-A7TH-x17.js} +158 -158
- package/dist/{xlsx-DE1KAgq6.js → xlsx-DRYtBAdX.js} +1 -1
- package/dist/{xlsx.util-B0UlDwd3.js → xlsx.util-DGBUU4BN.js} +1 -1
- package/package.json +1 -1
- package/dist/supplier-CGzWOPkE.js +0 -78
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { defineComponent as ue, ref as O, computed as P, resolveComponent as U, openBlock as
|
|
1
|
+
import { defineComponent as ue, ref as O, computed as P, resolveComponent as U, openBlock as $, createBlock as z, withCtx as T, createElementVNode as e, normalizeClass as _e, toDisplayString as v, createVNode as y, createElementBlock as Y, Fragment as oe, renderList as ie, unref as a, h as ye, watch as xe, isRef as je, createCommentVNode as te, reactive as nt, mergeModels as qe, useModel as pt, onMounted as Le, createTextVNode as de, normalizeStyle as ot, Teleport as ft, normalizeProps as Te, mergeProps as He } from "vue";
|
|
2
2
|
import { F as ze, u as vt, _ as yt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
|
|
3
|
-
import { u as
|
|
4
|
-
import { u as Me } from "./stock-
|
|
3
|
+
import { u as be, c as De, a as Be, F as Xe, E as _t, B as ne, t as kt, o as bt, z as gt, s as Q, h as Ee, i as ht, e as xt } from "./app-xCn1wZY9.js";
|
|
4
|
+
import { u as Me } from "./stock-BPdGitCC.js";
|
|
5
5
|
import { c as St, _ as Ft, F as Je } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
6
|
-
import { g as Se } from "./decimal-
|
|
7
|
-
import { d as pe } from "./dayjs.min-
|
|
8
|
-
import { e as wt, u as st, i as at, _ as Qe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-
|
|
9
|
-
import { _ as Ne, S as Pe, g as lt, a as
|
|
10
|
-
import { _ as
|
|
6
|
+
import { g as Se } from "./decimal-DOCxaZjf.js";
|
|
7
|
+
import { d as pe } from "./dayjs.min-PqgQ_K75.js";
|
|
8
|
+
import { e as wt, u as st, i as at, _ as Qe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BOxIYl0Z.js";
|
|
9
|
+
import { _ as Ne, S as Pe, g as lt, a as $t } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BTZa1E_o.js";
|
|
10
|
+
import { _ as At } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
11
11
|
import { useI18n as ce, useCoreStore as Ge } from "@feedmepos/mf-common";
|
|
12
|
-
import { useSnackbar as
|
|
12
|
+
import { useSnackbar as ge, useDialog as Ie, useProxiedModel as Ue, useBreakpoints as Vt } from "@feedmepos/ui-library";
|
|
13
13
|
import { defineStore as Ct } from "pinia";
|
|
14
|
-
import { g as Ye, a as ve, f as jt, t as
|
|
15
|
-
import { u as
|
|
16
|
-
import { u as Tt } from "./use-inventory-binding-dialog-
|
|
17
|
-
import { a as it } from "./FmMultiselectDialog-
|
|
18
|
-
import { _ as Ht } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-
|
|
19
|
-
import { a as Et, b as Pt, f as ut, t as Rt, c as Ot, p as Nt, n as Yt, d as Lt } from "./date2-
|
|
20
|
-
import { i as zt, _ as Gt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
14
|
+
import { g as Ye, a as ve, f as jt, t as Ae, h as Ve, A as Dt, M as Bt, d as ke, i as Mt, j as Ze, k as rt, l as Ke, R as It, e as we, m as Ut } from "./rules-C_FnXd1e.js";
|
|
15
|
+
import { u as he } from "./stock-DJDm1iIR.js";
|
|
16
|
+
import { u as Tt } from "./use-inventory-binding-dialog-kkpC2Tzi.js";
|
|
17
|
+
import { a as it } from "./FmMultiselectDialog-8_qMKCPt.js";
|
|
18
|
+
import { _ as Ht } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DFW-jg1P.js";
|
|
19
|
+
import { a as Et, b as Pt, f as ut, t as Rt, c as Ot, p as Nt, n as Yt, d as Lt } from "./date2-hHwvNr68.js";
|
|
20
|
+
import { i as zt, _ as Gt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DnMjbyPc.js";
|
|
21
21
|
import { E as Kt } from "./empty-placeholder-wf6-BWE8.js";
|
|
22
|
-
import { F as Re, u as Wt } from "./feature-
|
|
23
|
-
import { u as qt } from "./netsuite-
|
|
22
|
+
import { F as Re, u as Wt } from "./feature-UnTx1VJG.js";
|
|
23
|
+
import { u as qt } from "./netsuite-Cg_AEH3H.js";
|
|
24
24
|
import { N as Xt, H as Jt } from "./app-uBuHtW8m.js";
|
|
25
|
-
var
|
|
25
|
+
var $e = /* @__PURE__ */ ((k) => (k.History = "History", k.Convert = "Convert", k.Adjust = "Adjust", k))($e || {});
|
|
26
26
|
const Qt = [
|
|
27
27
|
{
|
|
28
28
|
translationKey: "inventory.stock.action.history",
|
|
@@ -51,7 +51,7 @@ const Qt = [
|
|
|
51
51
|
}
|
|
52
52
|
];
|
|
53
53
|
async function en(k) {
|
|
54
|
-
const d = `${(
|
|
54
|
+
const d = `${(be().currentLocation.name || "").replace(
|
|
55
55
|
/ /g,
|
|
56
56
|
"_"
|
|
57
57
|
)}_${pe().format("DD_MM_YYYY_HHmm")}.xlsx`;
|
|
@@ -136,7 +136,7 @@ const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ u
|
|
|
136
136
|
];
|
|
137
137
|
});
|
|
138
138
|
function m({ value: j }) {
|
|
139
|
-
return
|
|
139
|
+
return a(A).type === "unit" ? j === null : j === a(A).measurement;
|
|
140
140
|
}
|
|
141
141
|
const i = P(
|
|
142
142
|
() => {
|
|
@@ -146,14 +146,14 @@ const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ u
|
|
|
146
146
|
), F = O(!1);
|
|
147
147
|
return (j, w) => {
|
|
148
148
|
const u = U("FmIcon"), b = U("FmMenuItem"), C = U("FmMenu");
|
|
149
|
-
return
|
|
149
|
+
return $(), z(C, {
|
|
150
150
|
"stop-click-propagation": "",
|
|
151
151
|
onMenuChanged: w[0] || (w[0] = (B) => F.value = B)
|
|
152
152
|
}, {
|
|
153
153
|
"menu-button": T(() => [
|
|
154
154
|
e("button", {
|
|
155
155
|
type: "button",
|
|
156
|
-
class:
|
|
156
|
+
class: _e([
|
|
157
157
|
"w-full text-left flex items-center gap-8 cursor-pointer fm-corner-radius-sm px-8 py-4 border bg-white",
|
|
158
158
|
F.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
|
|
159
159
|
])
|
|
@@ -166,7 +166,7 @@ const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ u
|
|
|
166
166
|
], 2)
|
|
167
167
|
]),
|
|
168
168
|
default: T(() => [
|
|
169
|
-
(
|
|
169
|
+
($(!0), Y(oe, null, ie(S.value, (B) => ($(), z(b, {
|
|
170
170
|
key: B.value ?? 0,
|
|
171
171
|
label: B.label,
|
|
172
172
|
"model-value": m(B),
|
|
@@ -181,15 +181,15 @@ const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ u
|
|
|
181
181
|
__name: "StockHeaderPreview",
|
|
182
182
|
setup(k) {
|
|
183
183
|
const { t: g } = ce();
|
|
184
|
-
return (d, o) => (
|
|
184
|
+
return (d, o) => ($(), z(At, null, {
|
|
185
185
|
default: T(() => [
|
|
186
|
-
e("div", nn, v(
|
|
186
|
+
e("div", nn, v(a(g)("inventory.stock.prediction.daysRemaining")), 1)
|
|
187
187
|
]),
|
|
188
188
|
_: 1
|
|
189
189
|
}));
|
|
190
190
|
}
|
|
191
191
|
}), dt = Ct("stockActions", () => {
|
|
192
|
-
const k = O(!1), g =
|
|
192
|
+
const k = O(!1), g = be(), d = Me(), o = st(), A = ge(), S = Ie(), { t: m } = ce();
|
|
193
193
|
async function i() {
|
|
194
194
|
if (g._currentLocation) {
|
|
195
195
|
k.value = !0;
|
|
@@ -208,7 +208,7 @@ const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ u
|
|
|
208
208
|
}
|
|
209
209
|
const F = O();
|
|
210
210
|
async function j(D) {
|
|
211
|
-
var x, _,
|
|
211
|
+
var x, _, V;
|
|
212
212
|
if (!!!((_ = (x = D.convert) == null ? void 0 : x.inventoryBindings) != null && _.length)) {
|
|
213
213
|
S.open({
|
|
214
214
|
title: m("inventory.stock.error.convert.title"),
|
|
@@ -217,7 +217,7 @@ const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ u
|
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
219
|
const l = {
|
|
220
|
-
maxCount: ((
|
|
220
|
+
maxCount: ((V = d.productBalance.find(({ id: H }) => H === D._id)) == null ? void 0 : V.count) || 0,
|
|
221
221
|
sku: D,
|
|
222
222
|
show: !0,
|
|
223
223
|
"onUpdate:show"(H) {
|
|
@@ -231,7 +231,7 @@ const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ u
|
|
|
231
231
|
}
|
|
232
232
|
const w = O();
|
|
233
233
|
async function u(D) {
|
|
234
|
-
const
|
|
234
|
+
const s = {
|
|
235
235
|
stock: D,
|
|
236
236
|
show: !0,
|
|
237
237
|
"onUpdate:show"(t) {
|
|
@@ -241,29 +241,29 @@ const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ u
|
|
|
241
241
|
i();
|
|
242
242
|
}
|
|
243
243
|
};
|
|
244
|
-
w.value =
|
|
244
|
+
w.value = s;
|
|
245
245
|
}
|
|
246
246
|
const b = O();
|
|
247
247
|
async function C(D) {
|
|
248
|
-
const
|
|
248
|
+
const s = {
|
|
249
249
|
sku: D,
|
|
250
250
|
show: !0,
|
|
251
251
|
"onUpdate:show"(t) {
|
|
252
252
|
b.value.show = t;
|
|
253
253
|
}
|
|
254
254
|
};
|
|
255
|
-
b.value =
|
|
255
|
+
b.value = s;
|
|
256
256
|
}
|
|
257
|
-
function B(D,
|
|
258
|
-
const t = De(
|
|
257
|
+
function B(D, s) {
|
|
258
|
+
const t = De(s);
|
|
259
259
|
switch (D) {
|
|
260
|
-
case
|
|
260
|
+
case $e.History:
|
|
261
261
|
C(t);
|
|
262
262
|
return;
|
|
263
|
-
case
|
|
263
|
+
case $e.Convert:
|
|
264
264
|
j(t);
|
|
265
265
|
return;
|
|
266
|
-
case
|
|
266
|
+
case $e.Adjust:
|
|
267
267
|
u(t);
|
|
268
268
|
return;
|
|
269
269
|
}
|
|
@@ -279,7 +279,7 @@ const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ u
|
|
|
279
279
|
});
|
|
280
280
|
function sn() {
|
|
281
281
|
var S;
|
|
282
|
-
const k =
|
|
282
|
+
const k = be(), g = dt(), d = Ge(), { t: o } = ce();
|
|
283
283
|
return {
|
|
284
284
|
columnDefs: [
|
|
285
285
|
{
|
|
@@ -414,7 +414,7 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
|
|
|
414
414
|
},
|
|
415
415
|
emits: ["update:show", "submitted"],
|
|
416
416
|
setup(k, { expose: g, emit: d }) {
|
|
417
|
-
const o = k, A = d, S = Tt(), m = Be(), i =
|
|
417
|
+
const o = k, A = d, S = Tt(), m = Be(), i = he(), F = ge(), { t: j } = ce(), w = O(0), u = O(null), b = P(() => m.skus), C = P(
|
|
418
418
|
() => {
|
|
419
419
|
var p, n;
|
|
420
420
|
return (((n = (p = o.sku) == null ? void 0 : p.convert) == null ? void 0 : n.inventoryBindings) ?? []).filter(
|
|
@@ -432,8 +432,8 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
|
|
|
432
432
|
xe([() => o.show], ([p]) => {
|
|
433
433
|
p && (w.value = 0);
|
|
434
434
|
});
|
|
435
|
-
function
|
|
436
|
-
N(o.sku,
|
|
435
|
+
function s() {
|
|
436
|
+
N(o.sku, Ae(w.value), u.value);
|
|
437
437
|
}
|
|
438
438
|
function t(p) {
|
|
439
439
|
if (u.value)
|
|
@@ -470,10 +470,10 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
|
|
|
470
470
|
const M = m.skus.find((me) => me._id === f.id), I = ((le = f.measurement) == null ? void 0 : le.abbrev) ?? ((re = M == null ? void 0 : M.unit) == null ? void 0 : re.abbrev), G = (Z = o.sku.convert) != null && Z.measurement ? o.sku.unit.measurements.find((me) => {
|
|
471
471
|
var We;
|
|
472
472
|
return me.id === ((We = o.sku.convert) == null ? void 0 : We.measurement);
|
|
473
|
-
}) ?? null : null,
|
|
473
|
+
}) ?? null : null, se = Ye(o.sku.unit, G), E = l(`${w.value}`) === !0 ? ve(
|
|
474
474
|
jt(
|
|
475
475
|
f.amount,
|
|
476
|
-
|
|
476
|
+
Ae(+w.value, se)
|
|
477
477
|
),
|
|
478
478
|
!1
|
|
479
479
|
) : "0", W = (fe = (ae = u.value) == null ? void 0 : ae.find((me) => me.id === (M == null ? void 0 : M._id))) == null ? void 0 : fe.amount, q = W ? ve(W, !1) : null;
|
|
@@ -483,19 +483,19 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
|
|
|
483
483
|
abbrev: I
|
|
484
484
|
};
|
|
485
485
|
});
|
|
486
|
-
}),
|
|
486
|
+
}), V = O();
|
|
487
487
|
g({
|
|
488
488
|
validateInputs: () => {
|
|
489
489
|
var p, n;
|
|
490
|
-
(n = (p =
|
|
490
|
+
(n = (p = V.value) == null ? void 0 : p.validateInputs) == null || n.call(p);
|
|
491
491
|
},
|
|
492
492
|
resetInputsValidation: () => {
|
|
493
493
|
var p, n;
|
|
494
|
-
(n = (p =
|
|
494
|
+
(n = (p = V.value) == null ? void 0 : p.resetInputsValidation) == null || n.call(p);
|
|
495
495
|
},
|
|
496
496
|
resetInputs: () => {
|
|
497
497
|
var p, n;
|
|
498
|
-
(n = (p =
|
|
498
|
+
(n = (p = V.value) == null ? void 0 : p.resetInputs) == null || n.call(p);
|
|
499
499
|
}
|
|
500
500
|
});
|
|
501
501
|
const H = Ue(o, "show");
|
|
@@ -531,7 +531,7 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
|
|
|
531
531
|
function K(p, n, r) {
|
|
532
532
|
const h = +n;
|
|
533
533
|
let c = r;
|
|
534
|
-
n.length > 0 && isFinite(h) ? c = r.map((f) => (f.id !== p || (f.amount =
|
|
534
|
+
n.length > 0 && isFinite(h) ? c = r.map((f) => (f.id !== p || (f.amount = ke(h)), f)) : c = r.map((f) => (f.id !== p || (f.amount = { amount: 0, precision: 0 }), f)), u.value = c;
|
|
535
535
|
}
|
|
536
536
|
function R(p) {
|
|
537
537
|
const n = b.value.find((r) => r._id === p);
|
|
@@ -578,32 +578,32 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
|
|
|
578
578
|
p || (u.value = null, w.value = 0);
|
|
579
579
|
}
|
|
580
580
|
), (p, n) => {
|
|
581
|
-
const r = U("FmTextField"), h = U("FmForm"), c = U("FmCard"), f = U("FmSwitch"), M = U("FmFormGroup"), I = U("FmSelect"), G = U("FmButton"),
|
|
582
|
-
return
|
|
581
|
+
const r = U("FmTextField"), h = U("FmForm"), c = U("FmCard"), f = U("FmSwitch"), M = U("FmFormGroup"), I = U("FmSelect"), G = U("FmButton"), se = U("FmSideSheet");
|
|
582
|
+
return $(), z(se, {
|
|
583
583
|
"dismiss-away": "",
|
|
584
|
-
modelValue:
|
|
584
|
+
modelValue: a(H),
|
|
585
585
|
"onUpdate:modelValue": n[3] || (n[3] = (E) => je(H) ? H.value = E : null),
|
|
586
586
|
"max-width": 500
|
|
587
587
|
}, {
|
|
588
588
|
"side-sheet-header": T(() => [
|
|
589
589
|
e("div", ln, [
|
|
590
|
-
e("div", rn, v(
|
|
590
|
+
e("div", rn, v(a(j)("inventory.stock.convert.title", { name: p.sku.name })), 1)
|
|
591
591
|
])
|
|
592
592
|
]),
|
|
593
593
|
default: T(() => [
|
|
594
594
|
e("div", un, [
|
|
595
595
|
y(h, {
|
|
596
596
|
ref_key: "formRef",
|
|
597
|
-
ref:
|
|
598
|
-
onValidationSuccess:
|
|
597
|
+
ref: V,
|
|
598
|
+
onValidationSuccess: s
|
|
599
599
|
}, {
|
|
600
600
|
default: T(() => [
|
|
601
601
|
y(r, {
|
|
602
602
|
disabled: D.value,
|
|
603
603
|
"model-value": w.value,
|
|
604
604
|
"onUpdate:modelValue": n[0] || (n[0] = (E) => w.value = E),
|
|
605
|
-
label:
|
|
606
|
-
rules: [t, l,
|
|
605
|
+
label: a(j)("inventory.stock.convert.amount"),
|
|
606
|
+
rules: [t, l, a(Ve)(0)],
|
|
607
607
|
"append-text": x.value,
|
|
608
608
|
"helper-text": u.value ? void 0 : `Max ${p.maxCount} ${x.value}`
|
|
609
609
|
}, null, 8, ["disabled", "model-value", "label", "rules", "append-text", "helper-text"])
|
|
@@ -616,10 +616,10 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
|
|
|
616
616
|
}, {
|
|
617
617
|
default: T(() => [
|
|
618
618
|
e("div", cn, [
|
|
619
|
-
e("div", dn, v(
|
|
620
|
-
(
|
|
619
|
+
e("div", dn, v(a(j)("inventory.stock.convert.deductionSummary")), 1),
|
|
620
|
+
($(!0), Y(oe, null, ie(_.value, (E) => {
|
|
621
621
|
var W, q;
|
|
622
|
-
return
|
|
622
|
+
return $(), Y("div", {
|
|
623
623
|
key: (W = E.sku) == null ? void 0 : W._id,
|
|
624
624
|
class: "flex items-center"
|
|
625
625
|
}, [
|
|
@@ -638,26 +638,26 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
|
|
|
638
638
|
value: "",
|
|
639
639
|
modelValue: B.value,
|
|
640
640
|
"onUpdate:modelValue": n[1] || (n[1] = (E) => B.value = E),
|
|
641
|
-
label:
|
|
641
|
+
label: a(j)("inventory.stock.convert.overrideDeduction"),
|
|
642
642
|
"label-placement": "right"
|
|
643
643
|
}, null, 8, ["modelValue", "label"]),
|
|
644
|
-
B.value ? (
|
|
644
|
+
B.value ? ($(), Y(oe, { key: 0 }, [
|
|
645
645
|
y(M, {
|
|
646
646
|
modelValue: u.value,
|
|
647
|
-
rules: [
|
|
647
|
+
rules: [a(Dt)(1, "Must have at least one ingredient binding")]
|
|
648
648
|
}, null, 8, ["modelValue", "rules"]),
|
|
649
649
|
e("div", vn, [
|
|
650
|
-
e("div", yn, v(
|
|
651
|
-
(
|
|
650
|
+
e("div", yn, v(a(j)("inventory.stock.convert.ingredients")), 1),
|
|
651
|
+
($(!0), Y(oe, null, ie(u.value, (E) => ($(), z(M, {
|
|
652
652
|
key: E.id,
|
|
653
653
|
disabled: D.value,
|
|
654
|
-
modelValue: +
|
|
654
|
+
modelValue: +a(ve)(E.amount ?? { amount: 1, precision: 0 }),
|
|
655
655
|
rules: [
|
|
656
|
-
|
|
656
|
+
a(Bt)(
|
|
657
657
|
b.value.find((W) => W._id === E.id).unit,
|
|
658
658
|
E.measurement
|
|
659
659
|
),
|
|
660
|
-
|
|
660
|
+
a(Ve)(0)
|
|
661
661
|
]
|
|
662
662
|
}, {
|
|
663
663
|
default: T(({ invalid: W }) => {
|
|
@@ -668,7 +668,7 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
|
|
|
668
668
|
y(r, {
|
|
669
669
|
class: "xs:col-span-2",
|
|
670
670
|
disabled: D.value,
|
|
671
|
-
modelValue: +
|
|
671
|
+
modelValue: +a(ve)(
|
|
672
672
|
E.amount ?? { amount: 1, precision: 0 }
|
|
673
673
|
),
|
|
674
674
|
"onUpdate:modelValue": (Z) => K(E.id, Z, u.value ?? []),
|
|
@@ -701,12 +701,12 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
|
|
|
701
701
|
e("div", null, [
|
|
702
702
|
y(G, {
|
|
703
703
|
icon: "link",
|
|
704
|
-
label:
|
|
704
|
+
label: a(j)("inventory.stock.convert.linkIngredient"),
|
|
705
705
|
variant: "plain",
|
|
706
706
|
onClick: J
|
|
707
707
|
}, null, 8, ["label"])
|
|
708
708
|
])
|
|
709
|
-
], 64)) :
|
|
709
|
+
], 64)) : te("", !0)
|
|
710
710
|
])
|
|
711
711
|
]),
|
|
712
712
|
_: 1
|
|
@@ -717,10 +717,10 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
|
|
|
717
717
|
e("div", bn, [
|
|
718
718
|
y(G, {
|
|
719
719
|
loading: D.value,
|
|
720
|
-
label:
|
|
720
|
+
label: a(j)("inventory.stock.convert.convertButton"),
|
|
721
721
|
onClick: n[2] || (n[2] = (E) => {
|
|
722
722
|
var W, q;
|
|
723
|
-
return (q = (W =
|
|
723
|
+
return (q = (W = V.value) == null ? void 0 : W.validateInputs) == null ? void 0 : q.call(W);
|
|
724
724
|
})
|
|
725
725
|
}, null, 8, ["loading", "label"])
|
|
726
726
|
])
|
|
@@ -731,34 +731,34 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
|
|
|
731
731
|
}
|
|
732
732
|
});
|
|
733
733
|
function Fe(k, g) {
|
|
734
|
-
const d =
|
|
734
|
+
const d = Ae(k, g);
|
|
735
735
|
return { ...d, amount: -d.amount };
|
|
736
736
|
}
|
|
737
737
|
function tt(k, g) {
|
|
738
|
-
return
|
|
738
|
+
return Ae(Math.abs(k), g);
|
|
739
739
|
}
|
|
740
740
|
const Oe = {
|
|
741
|
-
[
|
|
741
|
+
[ne.enum.DAMAGE]: {
|
|
742
742
|
label: "Damage",
|
|
743
743
|
toAdjustmentAmount: Fe
|
|
744
744
|
},
|
|
745
|
-
[
|
|
745
|
+
[ne.enum.WASTAGE]: {
|
|
746
746
|
label: "Wastage",
|
|
747
747
|
toAdjustmentAmount: Fe
|
|
748
748
|
},
|
|
749
|
-
[
|
|
749
|
+
[ne.enum.THEFT]: {
|
|
750
750
|
label: "Theft",
|
|
751
751
|
toAdjustmentAmount: Fe
|
|
752
752
|
},
|
|
753
|
-
[
|
|
753
|
+
[ne.enum.LOSE]: {
|
|
754
754
|
label: "Lose",
|
|
755
755
|
toAdjustmentAmount: Fe
|
|
756
756
|
},
|
|
757
|
-
[
|
|
757
|
+
[ne.enum.EXTRA]: {
|
|
758
758
|
label: "Extra",
|
|
759
759
|
toAdjustmentAmount: tt
|
|
760
760
|
},
|
|
761
|
-
[
|
|
761
|
+
[ne.enum.PURCHASE]: {
|
|
762
762
|
label: "Purchase",
|
|
763
763
|
toAdjustmentAmount: tt
|
|
764
764
|
}
|
|
@@ -777,7 +777,7 @@ const Oe = {
|
|
|
777
777
|
}))
|
|
778
778
|
), i = P(() => lt(d.modelValue.doc.unit, !0)), F = P({
|
|
779
779
|
get() {
|
|
780
|
-
return d.modelValue.type ??
|
|
780
|
+
return d.modelValue.type ?? ne.enum.PURCHASE;
|
|
781
781
|
},
|
|
782
782
|
set(t) {
|
|
783
783
|
const l = {
|
|
@@ -798,7 +798,7 @@ const Oe = {
|
|
|
798
798
|
set(t) {
|
|
799
799
|
const l = {
|
|
800
800
|
...d.modelValue
|
|
801
|
-
}, x =
|
|
801
|
+
}, x = ke(t);
|
|
802
802
|
l.amount = Oe[F.value].toAdjustmentAmount(
|
|
803
803
|
t,
|
|
804
804
|
x.precision
|
|
@@ -814,7 +814,7 @@ const Oe = {
|
|
|
814
814
|
const l = {
|
|
815
815
|
...d.modelValue
|
|
816
816
|
};
|
|
817
|
-
l.measurement = ((_ = (x = d.modelValue.doc.unit) == null ? void 0 : x.measurements) == null ? void 0 : _.find((
|
|
817
|
+
l.measurement = ((_ = (x = d.modelValue.doc.unit) == null ? void 0 : x.measurements) == null ? void 0 : _.find((V) => V.id === t)) ?? null, o("update:modelValue", l);
|
|
818
818
|
}
|
|
819
819
|
}), u = P({
|
|
820
820
|
get() {
|
|
@@ -837,10 +837,10 @@ const Oe = {
|
|
|
837
837
|
() => Ke(b.value, C.value)
|
|
838
838
|
), D = P(
|
|
839
839
|
() => Se(B.value, d.modelValue.doc.unit)
|
|
840
|
-
),
|
|
840
|
+
), s = P(() => C.value.amount < 0);
|
|
841
841
|
return (t, l) => {
|
|
842
|
-
const x = U("FmButton"), _ = U("FmSelect"),
|
|
843
|
-
return
|
|
842
|
+
const x = U("FmButton"), _ = U("FmSelect"), V = U("FmTextarea"), H = U("FmCard");
|
|
843
|
+
return $(), z(H, {
|
|
844
844
|
variant: "outlined",
|
|
845
845
|
class: "grid grid-cols-2 gap-8 p-16"
|
|
846
846
|
}, {
|
|
@@ -860,19 +860,19 @@ const Oe = {
|
|
|
860
860
|
items: m.value,
|
|
861
861
|
modelValue: F.value,
|
|
862
862
|
"onUpdate:modelValue": l[1] || (l[1] = (N) => F.value = N),
|
|
863
|
-
rules: [
|
|
863
|
+
rules: [a(It)()],
|
|
864
864
|
"label-mark": "required"
|
|
865
865
|
}, null, 8, ["disabled", "items", "modelValue", "rules"]),
|
|
866
866
|
y(Ht, {
|
|
867
867
|
disabled: t.disabled,
|
|
868
868
|
label: "Amount",
|
|
869
|
-
step: +
|
|
869
|
+
step: +a(ve)({
|
|
870
870
|
amount: 1,
|
|
871
|
-
precision:
|
|
871
|
+
precision: a(Ye)(t.modelValue.doc.unit, t.modelValue.measurement)
|
|
872
872
|
}),
|
|
873
873
|
modelValue: j.value,
|
|
874
874
|
"onUpdate:modelValue": l[2] || (l[2] = (N) => j.value = N),
|
|
875
|
-
rules: [
|
|
875
|
+
rules: [a(Ve)(0)]
|
|
876
876
|
}, null, 8, ["disabled", "step", "modelValue", "rules"]),
|
|
877
877
|
y(_, {
|
|
878
878
|
disabled: t.disabled,
|
|
@@ -881,7 +881,7 @@ const Oe = {
|
|
|
881
881
|
modelValue: w.value,
|
|
882
882
|
"onUpdate:modelValue": l[3] || (l[3] = (N) => w.value = N)
|
|
883
883
|
}, null, 8, ["disabled", "items", "modelValue"]),
|
|
884
|
-
y(
|
|
884
|
+
y(V, {
|
|
885
885
|
class: "col-span-2",
|
|
886
886
|
disabled: t.disabled,
|
|
887
887
|
label: "Remark",
|
|
@@ -890,9 +890,9 @@ const Oe = {
|
|
|
890
890
|
"label-mark": "optional"
|
|
891
891
|
}, null, 8, ["disabled", "modelValue"]),
|
|
892
892
|
e("div", Sn, [
|
|
893
|
-
e("div", Fn, v(
|
|
893
|
+
e("div", Fn, v(a(A)("inventory.stock.stock_adjustment.stockAfter")), 1),
|
|
894
894
|
e("div", {
|
|
895
|
-
class:
|
|
895
|
+
class: _e(["fm-typo-en-body-lg-600", s.value ? "text-red-700" : "text-green-700"])
|
|
896
896
|
}, v(D.value), 3)
|
|
897
897
|
])
|
|
898
898
|
]),
|
|
@@ -900,7 +900,7 @@ const Oe = {
|
|
|
900
900
|
});
|
|
901
901
|
};
|
|
902
902
|
}
|
|
903
|
-
}), wn = { class: "flex items-center" },
|
|
903
|
+
}), wn = { class: "flex items-center" }, $n = { class: "fm-typo-en-title-md-800" }, An = { class: "flex items-center" }, Vn = { class: "fm-typo-en-title-sm-800 flex-1" }, Cn = { class: "flex gap-8" }, jn = /* @__PURE__ */ ue({
|
|
904
904
|
__name: "AdjustSkuDialog",
|
|
905
905
|
props: {
|
|
906
906
|
stock: {},
|
|
@@ -908,7 +908,7 @@ const Oe = {
|
|
|
908
908
|
},
|
|
909
909
|
emits: ["update:show", "submitted"],
|
|
910
910
|
setup(k, { expose: g, emit: d }) {
|
|
911
|
-
const o = k, A = d, S = Be(), m = Ie(), i =
|
|
911
|
+
const o = k, A = d, S = Be(), m = Ie(), i = he(), F = ge(), j = O(!1), { t: w } = ce();
|
|
912
912
|
function u() {
|
|
913
913
|
D(De(B));
|
|
914
914
|
}
|
|
@@ -932,11 +932,11 @@ const Oe = {
|
|
|
932
932
|
adjustments: [
|
|
933
933
|
{
|
|
934
934
|
id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
|
|
935
|
-
type:
|
|
935
|
+
type: ne.enum.PURCHASE,
|
|
936
936
|
doc: o.stock,
|
|
937
937
|
measurement: null,
|
|
938
938
|
remark: "",
|
|
939
|
-
amount:
|
|
939
|
+
amount: ke(1)
|
|
940
940
|
}
|
|
941
941
|
]
|
|
942
942
|
});
|
|
@@ -944,11 +944,11 @@ const Oe = {
|
|
|
944
944
|
l && (B.remark = "", B.adjustments = [
|
|
945
945
|
{
|
|
946
946
|
id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
|
|
947
|
-
type:
|
|
947
|
+
type: ne.enum.PURCHASE,
|
|
948
948
|
doc: o.stock,
|
|
949
949
|
measurement: null,
|
|
950
950
|
remark: "",
|
|
951
|
-
amount:
|
|
951
|
+
amount: ke(1)
|
|
952
952
|
}
|
|
953
953
|
]);
|
|
954
954
|
});
|
|
@@ -957,13 +957,13 @@ const Oe = {
|
|
|
957
957
|
try {
|
|
958
958
|
await i.adjustSku({
|
|
959
959
|
remark: l.remark,
|
|
960
|
-
adjustments: l.adjustments.map(({ doc: x, remark: _, type:
|
|
960
|
+
adjustments: l.adjustments.map(({ doc: x, remark: _, type: V, amount: H, measurement: N }) => ({
|
|
961
961
|
id: x._id,
|
|
962
962
|
amount: H,
|
|
963
963
|
measurement: N,
|
|
964
964
|
remark: _,
|
|
965
965
|
doc: x,
|
|
966
|
-
type:
|
|
966
|
+
type: V
|
|
967
967
|
}))
|
|
968
968
|
}), A("update:show", !1), A("submitted");
|
|
969
969
|
} catch (x) {
|
|
@@ -976,12 +976,12 @@ const Oe = {
|
|
|
976
976
|
j.value = !1;
|
|
977
977
|
}
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function s() {
|
|
980
980
|
const l = S.skus.map((_) => ({
|
|
981
981
|
label: _.name,
|
|
982
982
|
sublabel: _.code,
|
|
983
983
|
value: _._id
|
|
984
|
-
})), x = l.filter((_) => B.adjustments.find((
|
|
984
|
+
})), x = l.filter((_) => B.adjustments.find((V) => V.doc._id === _.value)).map((_) => _.value);
|
|
985
985
|
m.open({
|
|
986
986
|
title: "Select ingredients",
|
|
987
987
|
contentComponent: it,
|
|
@@ -1003,13 +1003,13 @@ const Oe = {
|
|
|
1003
1003
|
}
|
|
1004
1004
|
}).onPrimary((_) => {
|
|
1005
1005
|
B.adjustments = _.map(
|
|
1006
|
-
(
|
|
1006
|
+
(V) => B.adjustments.find((H) => H.doc._id === V) ?? {
|
|
1007
1007
|
id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
|
|
1008
|
-
type:
|
|
1009
|
-
doc: S.skus.find((H) => H._id ===
|
|
1008
|
+
type: ne.enum.PURCHASE,
|
|
1009
|
+
doc: S.skus.find((H) => H._id === V),
|
|
1010
1010
|
measurement: null,
|
|
1011
1011
|
remark: "",
|
|
1012
|
-
amount:
|
|
1012
|
+
amount: ke(1)
|
|
1013
1013
|
}
|
|
1014
1014
|
);
|
|
1015
1015
|
});
|
|
@@ -1018,16 +1018,16 @@ const Oe = {
|
|
|
1018
1018
|
B.adjustments.splice(l, 1);
|
|
1019
1019
|
}
|
|
1020
1020
|
return (l, x) => {
|
|
1021
|
-
const _ = U("FmTextarea"),
|
|
1022
|
-
return
|
|
1023
|
-
modelValue:
|
|
1021
|
+
const _ = U("FmTextarea"), V = U("FmButton"), H = U("FmForm"), N = U("FmSideSheet");
|
|
1022
|
+
return $(), z(N, {
|
|
1023
|
+
modelValue: a(C),
|
|
1024
1024
|
"onUpdate:modelValue": x[2] || (x[2] = (K) => je(C) ? C.value = K : null),
|
|
1025
1025
|
"dismiss-away": "",
|
|
1026
1026
|
"max-width": 500
|
|
1027
1027
|
}, {
|
|
1028
1028
|
"side-sheet-header": T(() => [
|
|
1029
1029
|
e("div", wn, [
|
|
1030
|
-
e("div",
|
|
1030
|
+
e("div", $n, v(a(w)("inventory.stock.adjust.title")), 1)
|
|
1031
1031
|
])
|
|
1032
1032
|
]),
|
|
1033
1033
|
default: T(() => [
|
|
@@ -1039,20 +1039,20 @@ const Oe = {
|
|
|
1039
1039
|
}, {
|
|
1040
1040
|
default: T(() => [
|
|
1041
1041
|
y(_, {
|
|
1042
|
-
label:
|
|
1042
|
+
label: a(w)("inventory.stock.adjust.remark"),
|
|
1043
1043
|
modelValue: B.remark,
|
|
1044
1044
|
"onUpdate:modelValue": x[0] || (x[0] = (K) => B.remark = K)
|
|
1045
1045
|
}, null, 8, ["label", "modelValue"]),
|
|
1046
|
-
e("div",
|
|
1047
|
-
e("div", Vn, v(
|
|
1048
|
-
y(
|
|
1046
|
+
e("div", An, [
|
|
1047
|
+
e("div", Vn, v(a(w)("inventory.stock.adjust.adjustedItems")), 1),
|
|
1048
|
+
y(V, {
|
|
1049
1049
|
"prepend-icon": "add",
|
|
1050
1050
|
variant: "tertiary",
|
|
1051
1051
|
size: "md",
|
|
1052
|
-
onClick:
|
|
1052
|
+
onClick: s
|
|
1053
1053
|
})
|
|
1054
1054
|
]),
|
|
1055
|
-
(
|
|
1055
|
+
($(!0), Y(oe, null, ie(B.adjustments, (K, R) => ($(), z(mt, {
|
|
1056
1056
|
key: K.id,
|
|
1057
1057
|
modelValue: B.adjustments[R],
|
|
1058
1058
|
"onUpdate:modelValue": (X) => B.adjustments[R] = X,
|
|
@@ -1064,8 +1064,8 @@ const Oe = {
|
|
|
1064
1064
|
]),
|
|
1065
1065
|
"side-sheet-footer": T(() => [
|
|
1066
1066
|
e("div", Cn, [
|
|
1067
|
-
y(
|
|
1068
|
-
label:
|
|
1067
|
+
y(V, {
|
|
1068
|
+
label: a(w)("inventory.stock.adjust.adjustButton"),
|
|
1069
1069
|
loading: j.value,
|
|
1070
1070
|
onClick: x[1] || (x[1] = (K) => {
|
|
1071
1071
|
var R, X;
|
|
@@ -1085,7 +1085,7 @@ const Oe = {
|
|
|
1085
1085
|
},
|
|
1086
1086
|
emits: ["update:show", "submitted"],
|
|
1087
1087
|
setup(k, { emit: g }) {
|
|
1088
|
-
const d = k, o = g, { t: A } = ce(), S = Be(), m =
|
|
1088
|
+
const d = k, o = g, { t: A } = ce(), S = Be(), m = he(), i = Ie(), F = ge(), j = Ue(d, "show"), w = O(!1), u = nt({
|
|
1089
1089
|
remark: "",
|
|
1090
1090
|
effectiveAt: /* @__PURE__ */ new Date(),
|
|
1091
1091
|
adjustments: []
|
|
@@ -1094,8 +1094,8 @@ const Oe = {
|
|
|
1094
1094
|
if (b.value && C.value) {
|
|
1095
1095
|
const _ = pe(`${b.value} ${C.value}`, "YYYY-MM-DD HH:mm");
|
|
1096
1096
|
if (_.isValid()) {
|
|
1097
|
-
const
|
|
1098
|
-
_.isAfter(
|
|
1097
|
+
const V = pe();
|
|
1098
|
+
_.isAfter(V) ? u.effectiveAt = V.toDate() : u.effectiveAt = _.toDate();
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
1101
|
});
|
|
@@ -1105,10 +1105,10 @@ const Oe = {
|
|
|
1105
1105
|
function D() {
|
|
1106
1106
|
B();
|
|
1107
1107
|
}
|
|
1108
|
-
const
|
|
1108
|
+
const s = P(() => {
|
|
1109
1109
|
const _ = {};
|
|
1110
|
-
return S.skus.forEach((
|
|
1111
|
-
_[
|
|
1110
|
+
return S.skus.forEach((V) => {
|
|
1111
|
+
_[V._id] = V;
|
|
1112
1112
|
}), _;
|
|
1113
1113
|
});
|
|
1114
1114
|
function t() {
|
|
@@ -1116,13 +1116,13 @@ const Oe = {
|
|
|
1116
1116
|
label: H.name,
|
|
1117
1117
|
sublabel: H.code,
|
|
1118
1118
|
value: H._id
|
|
1119
|
-
})),
|
|
1119
|
+
})), V = u.adjustments.map((H) => H.doc._id);
|
|
1120
1120
|
i.open({
|
|
1121
1121
|
title: A("inventory.stock.adjust.selectIngredients"),
|
|
1122
1122
|
contentComponent: it,
|
|
1123
1123
|
contentComponentProps: {
|
|
1124
1124
|
items: _,
|
|
1125
|
-
modelValue:
|
|
1125
|
+
modelValue: V,
|
|
1126
1126
|
virtualScroll: !0
|
|
1127
1127
|
},
|
|
1128
1128
|
overlay: !0,
|
|
@@ -1141,11 +1141,11 @@ const Oe = {
|
|
|
1141
1141
|
u.adjustments = H.map(
|
|
1142
1142
|
(N) => u.adjustments.find((K) => K.doc._id === N) ?? {
|
|
1143
1143
|
id: "",
|
|
1144
|
-
type:
|
|
1145
|
-
doc:
|
|
1144
|
+
type: ne.enum.PURCHASE,
|
|
1145
|
+
doc: s.value[N],
|
|
1146
1146
|
measurement: null,
|
|
1147
1147
|
remark: "",
|
|
1148
|
-
amount:
|
|
1148
|
+
amount: ke(1)
|
|
1149
1149
|
}
|
|
1150
1150
|
);
|
|
1151
1151
|
});
|
|
@@ -1173,12 +1173,12 @@ const Oe = {
|
|
|
1173
1173
|
doc: H,
|
|
1174
1174
|
type: K
|
|
1175
1175
|
})
|
|
1176
|
-
),
|
|
1176
|
+
), V = {
|
|
1177
1177
|
remark: u.remark,
|
|
1178
1178
|
adjustments: _,
|
|
1179
1179
|
effectiveAt: u.effectiveAt.toISOString()
|
|
1180
1180
|
};
|
|
1181
|
-
await m.adjustSku(De(
|
|
1181
|
+
await m.adjustSku(De(V)), o("submitted"), o("update:show", !1);
|
|
1182
1182
|
} catch (_) {
|
|
1183
1183
|
F.open({
|
|
1184
1184
|
title: A("inventory.stock.adjust.error.title"),
|
|
@@ -1189,53 +1189,53 @@ const Oe = {
|
|
|
1189
1189
|
w.value = !1;
|
|
1190
1190
|
}
|
|
1191
1191
|
}
|
|
1192
|
-
return (_,
|
|
1192
|
+
return (_, V) => {
|
|
1193
1193
|
const H = U("FmTextarea"), N = U("FmDatePicker"), K = U("FmTimePicker"), R = U("FmButton"), X = U("FmSideSheet");
|
|
1194
|
-
return
|
|
1195
|
-
modelValue:
|
|
1196
|
-
"onUpdate:modelValue":
|
|
1194
|
+
return $(), z(X, {
|
|
1195
|
+
modelValue: a(j),
|
|
1196
|
+
"onUpdate:modelValue": V[4] || (V[4] = (L) => je(j) ? j.value = L : null),
|
|
1197
1197
|
"dismiss-away": "",
|
|
1198
1198
|
"max-width": 560,
|
|
1199
1199
|
onAfterEnter: D
|
|
1200
1200
|
}, {
|
|
1201
1201
|
"side-sheet-header": T(() => [
|
|
1202
1202
|
e("div", Dn, [
|
|
1203
|
-
e("div", Bn, v(
|
|
1203
|
+
e("div", Bn, v(a(A)("inventory.stock.stock_adjustment.title")), 1)
|
|
1204
1204
|
])
|
|
1205
1205
|
]),
|
|
1206
1206
|
default: T(() => [
|
|
1207
1207
|
e("div", Mn, [
|
|
1208
1208
|
y(H, {
|
|
1209
|
-
label:
|
|
1209
|
+
label: a(A)("inventory.stock.adjust.remark"),
|
|
1210
1210
|
modelValue: u.remark,
|
|
1211
|
-
"onUpdate:modelValue":
|
|
1211
|
+
"onUpdate:modelValue": V[0] || (V[0] = (L) => u.remark = L),
|
|
1212
1212
|
"label-mark": "optional"
|
|
1213
1213
|
}, null, 8, ["label", "modelValue"]),
|
|
1214
1214
|
e("div", In, [
|
|
1215
|
-
e("label", Un, v(
|
|
1215
|
+
e("label", Un, v(a(A)("inventory.stock.stock_adjustment.effectiveAt")), 1),
|
|
1216
1216
|
e("div", Tn, [
|
|
1217
1217
|
e("div", Hn, [
|
|
1218
1218
|
y(N, {
|
|
1219
1219
|
class: "w-full",
|
|
1220
1220
|
modelValue: b.value,
|
|
1221
|
-
"onUpdate:modelValue":
|
|
1221
|
+
"onUpdate:modelValue": V[1] || (V[1] = (L) => b.value = L),
|
|
1222
1222
|
clearable: !1,
|
|
1223
|
-
max:
|
|
1223
|
+
max: a(pe)().format("YYYY-MM-DD")
|
|
1224
1224
|
}, null, 8, ["modelValue", "max"])
|
|
1225
1225
|
]),
|
|
1226
1226
|
e("div", En, [
|
|
1227
1227
|
y(K, {
|
|
1228
1228
|
class: "w-full",
|
|
1229
1229
|
modelValue: C.value,
|
|
1230
|
-
"onUpdate:modelValue":
|
|
1230
|
+
"onUpdate:modelValue": V[2] || (V[2] = (L) => C.value = L),
|
|
1231
1231
|
format: "HH:mm"
|
|
1232
1232
|
}, null, 8, ["modelValue"])
|
|
1233
1233
|
])
|
|
1234
1234
|
]),
|
|
1235
|
-
e("div", Pn, v(
|
|
1235
|
+
e("div", Pn, v(a(A)("inventory.stock.stock_adjustment.immediateHint")), 1)
|
|
1236
1236
|
]),
|
|
1237
1237
|
e("div", Rn, [
|
|
1238
|
-
e("div", On, v(
|
|
1238
|
+
e("div", On, v(a(A)("inventory.stock.adjust.adjustedItems")), 1),
|
|
1239
1239
|
y(R, {
|
|
1240
1240
|
"prepend-icon": "add",
|
|
1241
1241
|
variant: "tertiary",
|
|
@@ -1243,7 +1243,7 @@ const Oe = {
|
|
|
1243
1243
|
onClick: t
|
|
1244
1244
|
})
|
|
1245
1245
|
]),
|
|
1246
|
-
(
|
|
1246
|
+
($(!0), Y(oe, null, ie(u.adjustments, (L, ee) => ($(), z(mt, {
|
|
1247
1247
|
key: L.id,
|
|
1248
1248
|
modelValue: u.adjustments[ee],
|
|
1249
1249
|
"onUpdate:modelValue": (J) => u.adjustments[ee] = J,
|
|
@@ -1254,14 +1254,14 @@ const Oe = {
|
|
|
1254
1254
|
"side-sheet-footer": T(() => [
|
|
1255
1255
|
e("div", Nn, [
|
|
1256
1256
|
y(R, {
|
|
1257
|
-
label:
|
|
1257
|
+
label: a(A)("common.confirm"),
|
|
1258
1258
|
loading: w.value,
|
|
1259
1259
|
onClick: x
|
|
1260
1260
|
}, null, 8, ["label", "loading"]),
|
|
1261
1261
|
y(R, {
|
|
1262
|
-
label:
|
|
1262
|
+
label: a(A)("common.close"),
|
|
1263
1263
|
variant: "tertiary",
|
|
1264
|
-
onClick:
|
|
1264
|
+
onClick: V[3] || (V[3] = (L) => o("update:show", !1))
|
|
1265
1265
|
}, null, 8, ["label"])
|
|
1266
1266
|
])
|
|
1267
1267
|
]),
|
|
@@ -1281,7 +1281,7 @@ const Oe = {
|
|
|
1281
1281
|
return await g.post(S, m);
|
|
1282
1282
|
},
|
|
1283
1283
|
async findBillsById(d) {
|
|
1284
|
-
const A =
|
|
1284
|
+
const A = be().currentLocationDBName, S = `${k.inventoryBackendUrl}/${A}/bill/search`, m = {
|
|
1285
1285
|
ids: d
|
|
1286
1286
|
};
|
|
1287
1287
|
return await g.post(S, m);
|
|
@@ -1299,63 +1299,63 @@ const Oe = {
|
|
|
1299
1299
|
}),
|
|
1300
1300
|
emits: /* @__PURE__ */ qe(["refreshHistory"], ["update:modelValue"]),
|
|
1301
1301
|
setup(k, { emit: g }) {
|
|
1302
|
-
const d = k, o = g, A =
|
|
1302
|
+
const d = k, o = g, A = he(), S = pt(k, "modelValue"), m = O(!1), i = O(!1), F = O(!1), j = O({
|
|
1303
1303
|
_id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
|
|
1304
1304
|
skus: []
|
|
1305
1305
|
}), w = O();
|
|
1306
1306
|
Le(async () => {
|
|
1307
1307
|
m.value = !0;
|
|
1308
|
-
const
|
|
1309
|
-
if (!
|
|
1310
|
-
j.value =
|
|
1308
|
+
const s = await A.readSingleAdjustment(d.adjustmentId);
|
|
1309
|
+
if (!s) throw new Error("Adjustment not found");
|
|
1310
|
+
j.value = s, m.value = !1;
|
|
1311
1311
|
});
|
|
1312
1312
|
async function u() {
|
|
1313
1313
|
var t, l;
|
|
1314
1314
|
if ((l = (t = w == null ? void 0 : w.value) == null ? void 0 : t.validateInputs) == null || l.call(t), !i.value) return;
|
|
1315
|
-
const
|
|
1315
|
+
const s = {};
|
|
1316
1316
|
Object.keys(S.value || {}).forEach((x) => {
|
|
1317
1317
|
var _;
|
|
1318
|
-
Object.keys(((_ = S.value) == null ? void 0 : _[x]) || {}).forEach((
|
|
1318
|
+
Object.keys(((_ = S.value) == null ? void 0 : _[x]) || {}).forEach((V) => {
|
|
1319
1319
|
var N, K;
|
|
1320
|
-
const H = (K = (N = S.value) == null ? void 0 : N[x]) == null ? void 0 : K[Number(
|
|
1321
|
-
H && C(H.amount) > 0 && (
|
|
1320
|
+
const H = (K = (N = S.value) == null ? void 0 : N[x]) == null ? void 0 : K[Number(V)];
|
|
1321
|
+
H && C(H.amount) > 0 && (s[x] || (s[x] = []), s[x].push(H));
|
|
1322
1322
|
});
|
|
1323
1323
|
}), await A.revertWastageAdjustment({
|
|
1324
1324
|
targetWastageAdjustmentId: d.adjustmentId,
|
|
1325
|
-
amountsGoingToAdjust:
|
|
1325
|
+
amountsGoingToAdjust: s
|
|
1326
1326
|
}), o("refreshHistory"), F.value = !1, S.value = {};
|
|
1327
1327
|
}
|
|
1328
|
-
function b(
|
|
1328
|
+
function b(s, t, l) {
|
|
1329
1329
|
return P({
|
|
1330
1330
|
get: () => {
|
|
1331
|
-
var _,
|
|
1332
|
-
const x = (H = (
|
|
1331
|
+
var _, V, H;
|
|
1332
|
+
const x = (H = (V = (_ = S.value) == null ? void 0 : _[s]) == null ? void 0 : V[t]) == null ? void 0 : H.amount;
|
|
1333
1333
|
return x ? C(x, !0) : 0;
|
|
1334
1334
|
},
|
|
1335
1335
|
set: (x) => {
|
|
1336
1336
|
S.value || (S.value = {});
|
|
1337
1337
|
const _ = { ...S.value };
|
|
1338
|
-
_[
|
|
1338
|
+
_[s] || (_[s] = {}), _[s][t] = {
|
|
1339
1339
|
amount: Re.fromNumber(x),
|
|
1340
|
-
type:
|
|
1340
|
+
type: ne.Enum.WASTAGE,
|
|
1341
1341
|
measurement: l
|
|
1342
1342
|
}, S.value = _;
|
|
1343
1343
|
}
|
|
1344
1344
|
});
|
|
1345
1345
|
}
|
|
1346
|
-
function C(
|
|
1347
|
-
const l = Number(Re.toFormatString({ value:
|
|
1346
|
+
function C(s, t = !0) {
|
|
1347
|
+
const l = Number(Re.toFormatString({ value: s }));
|
|
1348
1348
|
return t ? Math.abs(l) : l;
|
|
1349
1349
|
}
|
|
1350
|
-
function B(
|
|
1351
|
-
return t.measurement ? t.measurement.abbrev :
|
|
1350
|
+
function B(s, t) {
|
|
1351
|
+
return t.measurement ? t.measurement.abbrev : s.sku.unit.abbrev;
|
|
1352
1352
|
}
|
|
1353
|
-
function D(
|
|
1354
|
-
return t === 0 ? "N/A" : (
|
|
1353
|
+
function D(s, t) {
|
|
1354
|
+
return t === 0 ? "N/A" : (s + t).toString();
|
|
1355
1355
|
}
|
|
1356
|
-
return (
|
|
1357
|
-
const l = U("FmIcon"), x = U("FmStepperField"), _ = U("FmCard"),
|
|
1358
|
-
return
|
|
1356
|
+
return (s, t) => {
|
|
1357
|
+
const l = U("FmIcon"), x = U("FmStepperField"), _ = U("FmCard"), V = U("FmForm"), H = U("FmSpacer"), N = U("FmButton"), K = U("FmDialog");
|
|
1358
|
+
return $(), z(K, {
|
|
1359
1359
|
modelValue: F.value,
|
|
1360
1360
|
"onUpdate:modelValue": t[4] || (t[4] = (R) => F.value = R),
|
|
1361
1361
|
overlay: !0
|
|
@@ -1402,7 +1402,7 @@ const Oe = {
|
|
|
1402
1402
|
])
|
|
1403
1403
|
]),
|
|
1404
1404
|
default: T(() => [
|
|
1405
|
-
m.value ? (
|
|
1405
|
+
m.value ? ($(), Y("div", zn)) : ($(), z(V, {
|
|
1406
1406
|
key: 1,
|
|
1407
1407
|
ref_key: "formRef",
|
|
1408
1408
|
ref: w,
|
|
@@ -1418,11 +1418,11 @@ const Oe = {
|
|
|
1418
1418
|
e("p", Gn, [
|
|
1419
1419
|
t[6] || (t[6] = e("b", null, "Date:", -1)),
|
|
1420
1420
|
t[7] || (t[7] = e("br", null, null, -1)),
|
|
1421
|
-
de(" " + v(
|
|
1421
|
+
de(" " + v(a(Et)(a(gt)(j.value._id))), 1)
|
|
1422
1422
|
]),
|
|
1423
1423
|
e("div", Kn, [
|
|
1424
|
-
(
|
|
1425
|
-
(
|
|
1424
|
+
($(!0), Y(oe, null, ie(j.value.skus, (R, X) => ($(), Y(oe, { key: X }, [
|
|
1425
|
+
($(!0), Y(oe, null, ie(R.amounts, (L, ee) => ($(), z(_, {
|
|
1426
1426
|
key: ee,
|
|
1427
1427
|
variant: "outlined",
|
|
1428
1428
|
class: "p-2"
|
|
@@ -1439,7 +1439,7 @@ const Oe = {
|
|
|
1439
1439
|
]),
|
|
1440
1440
|
e("div", Jn, [
|
|
1441
1441
|
t[9] || (t[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
|
|
1442
|
-
e("span", null, v(
|
|
1442
|
+
e("span", null, v(a(Re).toFormatString({ value: L.amount })) + " " + v(B(R, L)), 1)
|
|
1443
1443
|
]),
|
|
1444
1444
|
y(x, {
|
|
1445
1445
|
"model-value": b(R.sku._id, ee).value,
|
|
@@ -1450,7 +1450,7 @@ const Oe = {
|
|
|
1450
1450
|
"append-text": B(R, L),
|
|
1451
1451
|
rules: [
|
|
1452
1452
|
(J) => J <= C(L.amount) || `Cannot be more than ${C(L.amount)}`,
|
|
1453
|
-
|
|
1453
|
+
a(Ve)(-1)
|
|
1454
1454
|
]
|
|
1455
1455
|
}, null, 8, ["model-value", "onUpdate:modelValue", "helper-text", "append-text", "rules"]),
|
|
1456
1456
|
e("div", Qn, [
|
|
@@ -1481,7 +1481,7 @@ const Oe = {
|
|
|
1481
1481
|
key: 1,
|
|
1482
1482
|
class: "t-system text-fsecondary"
|
|
1483
1483
|
}, mo = {
|
|
1484
|
-
key:
|
|
1484
|
+
key: 3,
|
|
1485
1485
|
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"
|
|
1486
1486
|
}, po = {
|
|
1487
1487
|
key: 1,
|
|
@@ -1504,20 +1504,20 @@ const Oe = {
|
|
|
1504
1504
|
});
|
|
1505
1505
|
const i = P(() => {
|
|
1506
1506
|
var D;
|
|
1507
|
-
const w = d.record.adjustments, u = d.sku, b = {}, B = w.flatMap((
|
|
1507
|
+
const w = d.record.adjustments, u = d.sku, b = {}, B = w.flatMap((s) => {
|
|
1508
1508
|
var t;
|
|
1509
|
-
return ((t =
|
|
1510
|
-
}).flatMap((
|
|
1511
|
-
for (const
|
|
1512
|
-
const t =
|
|
1513
|
-
b[D =
|
|
1509
|
+
return ((t = s.skus) == null ? void 0 : t.filter((l) => l.sku._id === u._id)) ?? [];
|
|
1510
|
+
}).flatMap((s) => s.amounts);
|
|
1511
|
+
for (const s of B) {
|
|
1512
|
+
const t = s.measurement ? rt(s.measurement.conversion, s.amount) : s.amount;
|
|
1513
|
+
b[D = s.type] ?? (b[D] = { amount: 0, precision: 0 }), b[s.type] = Ke(t, b[s.type]);
|
|
1514
1514
|
}
|
|
1515
1515
|
return Object.entries(b).reduce(
|
|
1516
|
-
(
|
|
1516
|
+
(s, [t, l]) => (s[t] = /// comment, because without it formatter makes code uglier
|
|
1517
1517
|
`${Q.toFormatString({
|
|
1518
1518
|
value: l,
|
|
1519
1519
|
precision: 4
|
|
1520
|
-
})} ${u.unit.abbrev}`,
|
|
1520
|
+
})} ${u.unit.abbrev}`, s),
|
|
1521
1521
|
{}
|
|
1522
1522
|
);
|
|
1523
1523
|
}), { t: F } = ce(), j = P(() => d.record.adjustmentsByTime.map(({ date: w, adjustments: u }) => ({
|
|
@@ -1526,27 +1526,28 @@ const Oe = {
|
|
|
1526
1526
|
(b) => {
|
|
1527
1527
|
var C, B;
|
|
1528
1528
|
return ((B = (C = b.skus) == null ? void 0 : C.map) == null ? void 0 : B.call(C, (D) => {
|
|
1529
|
-
var
|
|
1529
|
+
var s, t;
|
|
1530
1530
|
return {
|
|
1531
1531
|
...D,
|
|
1532
1532
|
ref: b.ref,
|
|
1533
1533
|
backdateFrom: b.effectiveAt != null ? at(b._id) : null,
|
|
1534
|
-
toBalance: (t = (
|
|
1534
|
+
toBalance: (t = (s = b.skus) == null ? void 0 : s[0]) == null ? void 0 : t.toBalance,
|
|
1535
1535
|
adjustmentId: b._id
|
|
1536
1536
|
};
|
|
1537
1537
|
})) ?? [];
|
|
1538
1538
|
}
|
|
1539
1539
|
).flatMap((b) => {
|
|
1540
1540
|
var D;
|
|
1541
|
-
const C = (D = d.bills.find((
|
|
1542
|
-
return b.amounts.map((
|
|
1541
|
+
const C = (D = d.bills.find((s) => s._id === b.ref)) == null ? void 0 : D.seqNumber, B = C ? F("inventory.stock.record.bill", [C]) : "";
|
|
1542
|
+
return b.amounts.map((s) => {
|
|
1543
1543
|
var t;
|
|
1544
1544
|
return {
|
|
1545
|
-
amount: `${Q.toFormatString({ value:
|
|
1545
|
+
amount: `${Q.toFormatString({ value: s.amount, precision: 4 })} ${((t = s.measurement) == null ? void 0 : t.abbrev) ?? b.sku.unit.abbrev}`,
|
|
1546
1546
|
backdateFrom: b.backdateFrom,
|
|
1547
|
-
name:
|
|
1548
|
-
|
|
1549
|
-
|
|
1547
|
+
name: s.type,
|
|
1548
|
+
billRemark: B,
|
|
1549
|
+
remark: s.remark || "",
|
|
1550
|
+
cost: s.cost,
|
|
1550
1551
|
toBalance: Q.toFormatString({
|
|
1551
1552
|
value: b.toBalance ?? Q.fromNumber(0),
|
|
1552
1553
|
precision: 4
|
|
@@ -1559,7 +1560,7 @@ const Oe = {
|
|
|
1559
1560
|
})));
|
|
1560
1561
|
return (w, u) => {
|
|
1561
1562
|
const b = U("FmIcon"), C = U("FmTooltip"), B = U("FmCard");
|
|
1562
|
-
return
|
|
1563
|
+
return $(), z(B, { variant: "outlined" }, {
|
|
1563
1564
|
default: T(() => [
|
|
1564
1565
|
e("div", no, [
|
|
1565
1566
|
e("div", {
|
|
@@ -1573,14 +1574,14 @@ const Oe = {
|
|
|
1573
1574
|
size: "md"
|
|
1574
1575
|
}, null, 8, ["name"])
|
|
1575
1576
|
]),
|
|
1576
|
-
(
|
|
1577
|
-
key:
|
|
1577
|
+
($(!0), Y(oe, null, ie(i.value, (D, s) => ($(), Y("div", {
|
|
1578
|
+
key: s,
|
|
1578
1579
|
class: "flex flex-row py-1",
|
|
1579
1580
|
style: { "font-size": "0.8rem" }
|
|
1580
1581
|
}, [
|
|
1581
|
-
e("div", so, v(
|
|
1582
|
+
e("div", so, v(a(F)(`inventory.inventoryAdjustment.type.${s}`)), 1),
|
|
1582
1583
|
e("div", {
|
|
1583
|
-
class:
|
|
1584
|
+
class: _e({
|
|
1584
1585
|
"text-fm-color-typo-error": D.startsWith("-"),
|
|
1585
1586
|
"text-fm-color-typo-success": !D.startsWith("-"),
|
|
1586
1587
|
"ml-auto": !0
|
|
@@ -1597,28 +1598,28 @@ const Oe = {
|
|
|
1597
1598
|
transition: "max-height 0.2s ease-out"
|
|
1598
1599
|
})
|
|
1599
1600
|
}, [
|
|
1600
|
-
j.value.length ? (
|
|
1601
|
-
(
|
|
1601
|
+
j.value.length ? ($(), Y("hr", ao)) : te("", !0),
|
|
1602
|
+
($(!0), Y(oe, null, ie(j.value, (D) => ($(), Y("div", {
|
|
1602
1603
|
key: D.time,
|
|
1603
1604
|
class: "flex gap-1 w-full"
|
|
1604
1605
|
}, [
|
|
1605
1606
|
e("div", lo, v(D.time), 1),
|
|
1606
1607
|
e("div", ro, [
|
|
1607
|
-
(
|
|
1608
|
-
key:
|
|
1608
|
+
($(!0), Y(oe, null, ie(D.adjustments, (s) => ($(), Y("div", {
|
|
1609
|
+
key: s.name,
|
|
1609
1610
|
class: "flex gap-1"
|
|
1610
1611
|
}, [
|
|
1611
1612
|
e("div", io, [
|
|
1612
|
-
de(v(
|
|
1613
|
-
|
|
1613
|
+
de(v(a(F)(`inventory.inventoryAdjustment.type.${s.name}`)) + " ", 1),
|
|
1614
|
+
s.backdateFrom ? ($(), z(C, {
|
|
1614
1615
|
key: 0,
|
|
1615
1616
|
variant: "plain",
|
|
1616
1617
|
placement: "top",
|
|
1617
1618
|
"z-index": 50
|
|
1618
1619
|
}, {
|
|
1619
1620
|
content: T(() => [
|
|
1620
|
-
e("div", uo, v(
|
|
1621
|
-
|
|
1621
|
+
e("div", uo, v(a(F)("inventory.stock.record.backdate", [
|
|
1622
|
+
a(ut)(new Date(s.backdateFrom))
|
|
1622
1623
|
])), 1)
|
|
1623
1624
|
]),
|
|
1624
1625
|
default: T(() => [
|
|
@@ -1629,23 +1630,27 @@ const Oe = {
|
|
|
1629
1630
|
})
|
|
1630
1631
|
]),
|
|
1631
1632
|
_: 2
|
|
1632
|
-
}, 1024)) :
|
|
1633
|
-
|
|
1634
|
-
|
|
1633
|
+
}, 1024)) : te("", !0),
|
|
1634
|
+
s.billRemark ? ($(), Y("span", co, " # " + v(s.billRemark), 1)) : te("", !0),
|
|
1635
|
+
s.remark ? ($(), Y("span", {
|
|
1636
|
+
key: 2,
|
|
1637
|
+
class: _e(s.billRemark ? "text-xs text-gray-400" : "")
|
|
1638
|
+
}, v(s.billRemark ? `(${s.remark})` : `# ${s.remark}`), 3)) : te("", !0),
|
|
1639
|
+
s.name === a(ne).Enum.CLOSING ? ($(), Y("span", mo, " Actual Balance: " + v(s.toBalance) + " " + v(s.baseUnit), 1)) : te("", !0)
|
|
1635
1640
|
]),
|
|
1636
1641
|
e("div", {
|
|
1637
|
-
class:
|
|
1638
|
-
"text-fm-color-typo-error":
|
|
1639
|
-
"text-fm-color-typo-success": !
|
|
1642
|
+
class: _e({
|
|
1643
|
+
"text-fm-color-typo-error": s.amount.startsWith("-"),
|
|
1644
|
+
"text-fm-color-typo-success": !s.amount.startsWith("-"),
|
|
1640
1645
|
"ml-auto": !0
|
|
1641
1646
|
})
|
|
1642
|
-
}, v(
|
|
1643
|
-
|
|
1647
|
+
}, v(s.amount), 3),
|
|
1648
|
+
s.name === a(ne).Enum.WASTAGE ? ($(), z(to, {
|
|
1644
1649
|
key: 0,
|
|
1645
|
-
adjustmentId:
|
|
1650
|
+
adjustmentId: s.adjustmentId,
|
|
1646
1651
|
onRefreshHistory: u[1] || (u[1] = (t) => w.$emit("refreshHistory"))
|
|
1647
|
-
}, null, 8, ["adjustmentId"])) :
|
|
1648
|
-
|
|
1652
|
+
}, null, 8, ["adjustmentId"])) : te("", !0),
|
|
1653
|
+
s.cost ? ($(), Y("div", po, " (" + v(a(we)(s.cost, !1, s.cost.precision)) + ") ", 1)) : te("", !0)
|
|
1649
1654
|
]))), 128))
|
|
1650
1655
|
])
|
|
1651
1656
|
]))), 128))
|
|
@@ -1659,7 +1664,7 @@ const Oe = {
|
|
|
1659
1664
|
});
|
|
1660
1665
|
function vo(k, g) {
|
|
1661
1666
|
var S;
|
|
1662
|
-
const d = Object.keys(
|
|
1667
|
+
const d = Object.keys(ne.enum).reduce(
|
|
1663
1668
|
(m, i) => (m[i] = { amount: 0, precision: 0 }, m),
|
|
1664
1669
|
{}
|
|
1665
1670
|
);
|
|
@@ -1705,7 +1710,7 @@ function yo(k, g) {
|
|
|
1705
1710
|
for (const S of A) {
|
|
1706
1711
|
const m = S.amounts;
|
|
1707
1712
|
for (const i of m) {
|
|
1708
|
-
if (i.type !==
|
|
1713
|
+
if (i.type !== ne.Enum.SALES)
|
|
1709
1714
|
continue;
|
|
1710
1715
|
const F = i.measurement ? Q.multiply([i.measurement.conversion, i.amount]) : i.amount;
|
|
1711
1716
|
d ?? (d = Q.fromNumber(0)), d = Q.add([d, F]);
|
|
@@ -1722,7 +1727,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
1722
1727
|
}, So = { class: "fm-typo-en-body-lg-400 translate-x-4" }, Fo = {
|
|
1723
1728
|
key: 1,
|
|
1724
1729
|
class: "flex flex-col gap-12"
|
|
1725
|
-
}, wo = { class: "pb-16" },
|
|
1730
|
+
}, wo = { class: "pb-16" }, $o = { class: "fm-typo-cn-body-lg-600" }, Ao = {
|
|
1726
1731
|
class: "grid gap-12 fm-typo-en-body-md-400",
|
|
1727
1732
|
style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
|
|
1728
1733
|
}, Vo = { class: "flex flex-col gap-1" }, Co = { class: "text-fm-color-typo-secondary" }, jo = { class: "font-bold" }, Do = { class: "flex flex-col gap-1" }, Bo = { class: "text-fm-color-typo-secondary flex" }, Mo = { class: "font-bold" }, Io = { class: "flex flex-col gap-1" }, Uo = { class: "text-fm-color-typo-secondary" }, To = { class: "font-bold" }, Ho = { class: "flex flex-col gap-1" }, Eo = { class: "text-fm-color-typo-secondary" }, Po = { class: "font-bold" }, Ro = { class: "flex flex-col gap-1" }, Oo = { class: "text-fm-color-typo-secondary" }, No = { class: "font-bold" }, Yo = { class: "flex flex-col gap-1" }, Lo = { class: "text-fm-color-typo-secondary" }, zo = { class: "font-bold" }, Go = { class: "flex flex-col gap-1" }, Ko = { class: "text-fm-color-typo-secondary" }, Wo = { class: "font-bold" }, qo = { class: "flex flex-col gap-1" }, Xo = { class: "text-fm-color-typo-secondary" }, Jo = { class: "font-bold" }, Qo = { class: "flex flex-col gap-1" }, Zo = { class: "text-fm-color-typo-secondary" }, es = { class: "font-bold" }, ts = {
|
|
@@ -1739,7 +1744,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
1739
1744
|
},
|
|
1740
1745
|
emits: ["update:show"],
|
|
1741
1746
|
setup(k) {
|
|
1742
|
-
const g = Ge(), d = Me(), o =
|
|
1747
|
+
const g = Ge(), d = Me(), o = he(), A = Ln(), S = be(), m = Wt(), { t: i } = ce(), F = k, j = O(!1), w = ge(), u = O(zt(0));
|
|
1743
1748
|
async function b() {
|
|
1744
1749
|
j.value = !0;
|
|
1745
1750
|
try {
|
|
@@ -1760,7 +1765,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
1760
1765
|
b();
|
|
1761
1766
|
});
|
|
1762
1767
|
const C = O([]), B = O([]), D = O(new Array());
|
|
1763
|
-
function
|
|
1768
|
+
function s(n, r) {
|
|
1764
1769
|
return r === "day" ? Lt(n) : ut(n);
|
|
1765
1770
|
}
|
|
1766
1771
|
function t(n, r) {
|
|
@@ -1769,7 +1774,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
1769
1774
|
const M = f.effectiveAt ?? at(f._id);
|
|
1770
1775
|
if (!M)
|
|
1771
1776
|
return c;
|
|
1772
|
-
const I =
|
|
1777
|
+
const I = s(new Date(M), r);
|
|
1773
1778
|
return c[I] ?? (c[I] = []), c[I].push(f), c;
|
|
1774
1779
|
},
|
|
1775
1780
|
{}
|
|
@@ -1804,7 +1809,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
1804
1809
|
const _ = P(() => {
|
|
1805
1810
|
const n = C.value, r = F.sku;
|
|
1806
1811
|
return vo(n, r);
|
|
1807
|
-
}),
|
|
1812
|
+
}), V = P(() => {
|
|
1808
1813
|
const n = C.value, r = F.sku;
|
|
1809
1814
|
return yo(n, r);
|
|
1810
1815
|
}), H = P(() => {
|
|
@@ -1864,7 +1869,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
1864
1869
|
});
|
|
1865
1870
|
}
|
|
1866
1871
|
const X = P(() => i("inventory.ingredient.valuationMethod.WAVG")), L = P(() => {
|
|
1867
|
-
var I, G,
|
|
1872
|
+
var I, G, se, E;
|
|
1868
1873
|
const n = [...C.value].reverse().computeFirst((W) => {
|
|
1869
1874
|
var q, le;
|
|
1870
1875
|
return (le = (q = W.skus) == null ? void 0 : q.find) == null ? void 0 : le.call(q, (re) => re.sku._id === F.sku._id);
|
|
@@ -1876,7 +1881,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
1876
1881
|
}, c = r.amount, f = c.amount == 0 ? Q.fromNumber(0) : Q.divide([h, c]);
|
|
1877
1882
|
return {
|
|
1878
1883
|
...Q.multiply([f, c]),
|
|
1879
|
-
currency: ((
|
|
1884
|
+
currency: ((se = r.cost) == null ? void 0 : se.currency) || Ee(((E = g.currentCountry) == null ? void 0 : E.value) ?? ht)
|
|
1880
1885
|
};
|
|
1881
1886
|
}), ee = P(() => {
|
|
1882
1887
|
var h;
|
|
@@ -1902,17 +1907,17 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
1902
1907
|
}
|
|
1903
1908
|
const p = Ue(F, "show");
|
|
1904
1909
|
return (n, r) => {
|
|
1905
|
-
const h = U("FmButton"), c = U("FmField"), f = U("FmDateRangePicker"), M = U("FmSpacer"), I = U("FmCircularProgress"), G = U("FmIcon"),
|
|
1906
|
-
return
|
|
1910
|
+
const h = U("FmButton"), c = U("FmField"), f = U("FmDateRangePicker"), M = U("FmSpacer"), I = U("FmCircularProgress"), G = U("FmIcon"), se = U("FmTooltip"), E = U("FmMenuDivider"), W = U("FmChip"), q = U("FmCardSection"), le = U("FmCard"), re = U("FmSideSheet");
|
|
1911
|
+
return $(), z(re, {
|
|
1907
1912
|
"dismiss-away": "",
|
|
1908
|
-
modelValue:
|
|
1913
|
+
modelValue: a(p),
|
|
1909
1914
|
"onUpdate:modelValue": r[4] || (r[4] = (Z) => je(p) ? p.value = Z : null),
|
|
1910
1915
|
"close-button": !1,
|
|
1911
1916
|
"max-width": 560
|
|
1912
1917
|
}, {
|
|
1913
1918
|
"side-sheet-header": T(() => [
|
|
1914
1919
|
e("div", _o, [
|
|
1915
|
-
e("div", ko, v(
|
|
1920
|
+
e("div", ko, v(a(i)("inventory.stock.history.title", [n.sku.name])), 1),
|
|
1916
1921
|
y(h, {
|
|
1917
1922
|
variant: "tertiary",
|
|
1918
1923
|
"prepend-icon": "close",
|
|
@@ -1959,33 +1964,33 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
1959
1964
|
"prepend-icon": "navigate_next"
|
|
1960
1965
|
})
|
|
1961
1966
|
]),
|
|
1962
|
-
j.value ? (
|
|
1967
|
+
j.value ? ($(), Y("div", xo, [
|
|
1963
1968
|
y(M),
|
|
1964
1969
|
y(I, { size: "xl" }),
|
|
1965
|
-
e("div", So, v(
|
|
1970
|
+
e("div", So, v(a(i)("inventory.stock.history.loading")), 1),
|
|
1966
1971
|
y(M),
|
|
1967
1972
|
y(M)
|
|
1968
|
-
])) : B.value && ((Z = B.value) == null ? void 0 : Z.length) > 0 ? (
|
|
1973
|
+
])) : B.value && ((Z = B.value) == null ? void 0 : Z.length) > 0 ? ($(), Y("div", Fo, [
|
|
1969
1974
|
y(le, { variant: "outlined" }, {
|
|
1970
1975
|
default: T(() => [
|
|
1971
1976
|
y(q, { class: "flex flex-col gap-4" }, {
|
|
1972
1977
|
default: T(() => [
|
|
1973
1978
|
e("div", wo, [
|
|
1974
|
-
e("div",
|
|
1979
|
+
e("div", $o, v(a(i)("inventory.stock.history.summary.title")), 1)
|
|
1975
1980
|
]),
|
|
1976
|
-
e("div",
|
|
1981
|
+
e("div", Ao, [
|
|
1977
1982
|
e("div", Vo, [
|
|
1978
|
-
e("div", Co, v(
|
|
1983
|
+
e("div", Co, v(a(i)("inventory.stock.history.summary.totalPurchase")), 1),
|
|
1979
1984
|
e("div", jo, v(_.value.PURCHASE), 1)
|
|
1980
1985
|
]),
|
|
1981
1986
|
e("div", Do, [
|
|
1982
1987
|
e("div", Bo, [
|
|
1983
|
-
de(v(
|
|
1984
|
-
|
|
1988
|
+
de(v(a(i)("inventory.stock.history.summary.totalSales")) + " ", 1),
|
|
1989
|
+
V.value != null ? ($(), z(se, {
|
|
1985
1990
|
key: 0,
|
|
1986
1991
|
variant: "plain",
|
|
1987
1992
|
placement: "top",
|
|
1988
|
-
content: `Before: ${
|
|
1993
|
+
content: `Before: ${V.value}`,
|
|
1989
1994
|
"z-index": 50
|
|
1990
1995
|
}, {
|
|
1991
1996
|
default: T(() => [
|
|
@@ -1995,51 +2000,51 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
1995
2000
|
})
|
|
1996
2001
|
]),
|
|
1997
2002
|
_: 1
|
|
1998
|
-
}, 8, ["content"])) :
|
|
2003
|
+
}, 8, ["content"])) : te("", !0)
|
|
1999
2004
|
]),
|
|
2000
2005
|
e("div", Mo, v(_.value.SALES), 1)
|
|
2001
2006
|
]),
|
|
2002
2007
|
e("div", Io, [
|
|
2003
|
-
e("div", Uo, v(
|
|
2008
|
+
e("div", Uo, v(a(i)("inventory.stock.history.summary.totalLose")), 1),
|
|
2004
2009
|
e("div", To, v(_.value.LOSE), 1)
|
|
2005
2010
|
]),
|
|
2006
2011
|
e("div", Ho, [
|
|
2007
|
-
e("div", Eo, v(
|
|
2012
|
+
e("div", Eo, v(a(i)("inventory.stock.history.summary.totalRequest")), 1),
|
|
2008
2013
|
e("div", Po, v(_.value.REQUEST), 1)
|
|
2009
2014
|
]),
|
|
2010
2015
|
e("div", Ro, [
|
|
2011
|
-
e("div", Oo, v(
|
|
2016
|
+
e("div", Oo, v(a(i)("inventory.stock.history.summary.totalReceive")), 1),
|
|
2012
2017
|
e("div", No, v(_.value.RECEIVE), 1)
|
|
2013
2018
|
]),
|
|
2014
2019
|
e("div", Yo, [
|
|
2015
|
-
e("div", Lo, v(
|
|
2020
|
+
e("div", Lo, v(a(i)("inventory.stock.history.summary.totalConvert")), 1),
|
|
2016
2021
|
e("div", zo, v(_.value.CONVERT), 1)
|
|
2017
2022
|
]),
|
|
2018
2023
|
e("div", Go, [
|
|
2019
|
-
e("div", Ko, v(
|
|
2024
|
+
e("div", Ko, v(a(i)("inventory.stock.history.summary.totalDamage")), 1),
|
|
2020
2025
|
e("div", Wo, v(_.value.DAMAGE), 1)
|
|
2021
2026
|
]),
|
|
2022
2027
|
e("div", qo, [
|
|
2023
|
-
e("div", Xo, v(
|
|
2028
|
+
e("div", Xo, v(a(i)("inventory.stock.history.summary.openingBalance")), 1),
|
|
2024
2029
|
e("div", Jo, v(H.value), 1)
|
|
2025
2030
|
]),
|
|
2026
2031
|
e("div", Qo, [
|
|
2027
|
-
e("div", Zo, v(
|
|
2032
|
+
e("div", Zo, v(a(i)("inventory.stock.history.summary.lastStockBalance")), 1),
|
|
2028
2033
|
e("div", es, v(N.value), 1)
|
|
2029
2034
|
])
|
|
2030
2035
|
]),
|
|
2031
|
-
|
|
2036
|
+
a(m).enableTotalCost ? ($(), Y("div", ts, [
|
|
2032
2037
|
y(E, { class: "w-full" }),
|
|
2033
2038
|
e("div", ns, [
|
|
2034
2039
|
e("div", os, [
|
|
2035
2040
|
y(Qe, { "z-index": 50 }, {
|
|
2036
2041
|
default: T(() => [
|
|
2037
2042
|
e("div", ss, [
|
|
2038
|
-
de(v(
|
|
2039
|
-
y(
|
|
2043
|
+
de(v(a(i)("inventory.stock.history.estimatedValue")) + " ", 1),
|
|
2044
|
+
y(se, {
|
|
2040
2045
|
variant: "plain",
|
|
2041
2046
|
placement: "top",
|
|
2042
|
-
content: `[${X.value}] ${
|
|
2047
|
+
content: `[${X.value}] ${a(i)("inventory.stock.history.estimatedValueTooltip")}`,
|
|
2043
2048
|
"z-index": 50
|
|
2044
2049
|
}, {
|
|
2045
2050
|
default: T(() => [
|
|
@@ -2055,18 +2060,18 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
2055
2060
|
_: 1
|
|
2056
2061
|
}),
|
|
2057
2062
|
e("div", as, [
|
|
2058
|
-
n.sku.valuation ===
|
|
2063
|
+
n.sku.valuation === a(xt).Enum.FIFO ? ($(), Y(oe, { key: 0 }, [
|
|
2059
2064
|
y(W, {
|
|
2060
2065
|
label: "FIFO",
|
|
2061
2066
|
compact: ""
|
|
2062
2067
|
}),
|
|
2063
|
-
de(" " + v(typeof ee.value != "string" ?
|
|
2068
|
+
de(" " + v(typeof ee.value != "string" ? a(we)(
|
|
2064
2069
|
ee.value,
|
|
2065
2070
|
!1,
|
|
2066
2071
|
ee.value.precision
|
|
2067
2072
|
) : ee.value), 1)
|
|
2068
|
-
], 64)) : (
|
|
2069
|
-
de(v(typeof L.value != "string" ?
|
|
2073
|
+
], 64)) : ($(), Y(oe, { key: 1 }, [
|
|
2074
|
+
de(v(typeof L.value != "string" ? a(we)(
|
|
2070
2075
|
L.value,
|
|
2071
2076
|
!1,
|
|
2072
2077
|
L.value.precision
|
|
@@ -2078,14 +2083,14 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
2078
2083
|
y(Qe, { "z-index": 50 }, {
|
|
2079
2084
|
default: T(() => [
|
|
2080
2085
|
e("div", rs, [
|
|
2081
|
-
de(v(
|
|
2082
|
-
y(
|
|
2086
|
+
de(v(a(i)("inventory.stock.history.costSold")) + " ", 1),
|
|
2087
|
+
y(se, {
|
|
2083
2088
|
variant: "plain",
|
|
2084
2089
|
placement: "top",
|
|
2085
2090
|
"z-index": 50
|
|
2086
2091
|
}, {
|
|
2087
2092
|
content: T(() => [
|
|
2088
|
-
e("div", is, v(
|
|
2093
|
+
e("div", is, v(a(i)("inventory.stock.history.costSoldTooltip")), 1)
|
|
2089
2094
|
]),
|
|
2090
2095
|
default: T(() => [
|
|
2091
2096
|
y(G, {
|
|
@@ -2102,7 +2107,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
2102
2107
|
e("div", us, v(K.value), 1)
|
|
2103
2108
|
])
|
|
2104
2109
|
])
|
|
2105
|
-
])) :
|
|
2110
|
+
])) : te("", !0)
|
|
2106
2111
|
]),
|
|
2107
2112
|
_: 1
|
|
2108
2113
|
})
|
|
@@ -2110,27 +2115,27 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
2110
2115
|
_: 1
|
|
2111
2116
|
}),
|
|
2112
2117
|
r[5] || (r[5] = e("div", null, null, -1)),
|
|
2113
|
-
(
|
|
2118
|
+
($(!0), Y(oe, null, ie(B.value, (ae) => ($(), Y(oe, {
|
|
2114
2119
|
key: ae.date
|
|
2115
2120
|
}, [
|
|
2116
|
-
n.sku ? (
|
|
2121
|
+
n.sku ? ($(), z(fo, {
|
|
2117
2122
|
key: 0,
|
|
2118
2123
|
record: ae,
|
|
2119
2124
|
sku: n.sku,
|
|
2120
2125
|
bills: D.value,
|
|
2121
2126
|
onRefreshHistory: b
|
|
2122
|
-
}, null, 8, ["record", "sku", "bills"])) :
|
|
2127
|
+
}, null, 8, ["record", "sku", "bills"])) : te("", !0)
|
|
2123
2128
|
], 64))), 128))
|
|
2124
|
-
])) : (
|
|
2129
|
+
])) : ($(), Y("div", cs, [
|
|
2125
2130
|
y(M),
|
|
2126
2131
|
e("div", null, [
|
|
2127
2132
|
e("img", {
|
|
2128
|
-
src:
|
|
2133
|
+
src: a(Kt),
|
|
2129
2134
|
alt: "List is empty"
|
|
2130
2135
|
}, null, 8, ds)
|
|
2131
2136
|
]),
|
|
2132
|
-
e("div", ms, v(
|
|
2133
|
-
e("div", ps, v(
|
|
2137
|
+
e("div", ms, v(a(i)("inventory.stock.history.noRecords")), 1),
|
|
2138
|
+
e("div", ps, v(a(i)("inventory.stock.history.changeDateRange")), 1),
|
|
2134
2139
|
y(M),
|
|
2135
2140
|
y(M)
|
|
2136
2141
|
]))
|
|
@@ -2147,7 +2152,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
2147
2152
|
}, ys = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _s = { class: "flex flex-col gap-8" }, ks = { class: "flex flex-col" }, bs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gs = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, zs = /* @__PURE__ */ ue({
|
|
2148
2153
|
__name: "StockView",
|
|
2149
2154
|
setup(k) {
|
|
2150
|
-
const { t: g } = ce(), d = Be(), o =
|
|
2155
|
+
const { t: g } = ce(), d = Be(), o = be(), A = Me(), S = dt(), m = he(), i = st(), F = qt(), { columnDefs: j } = sn(), w = Ie(), u = ge();
|
|
2151
2156
|
o.watchLocation(D);
|
|
2152
2157
|
const b = P(
|
|
2153
2158
|
() => new Set(F.getAvailableItems(F.businessSubsidiaryId))
|
|
@@ -2190,7 +2195,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
2190
2195
|
}
|
|
2191
2196
|
}
|
|
2192
2197
|
}
|
|
2193
|
-
const
|
|
2198
|
+
const s = P(() => [
|
|
2194
2199
|
{
|
|
2195
2200
|
type: "string",
|
|
2196
2201
|
key: "status",
|
|
@@ -2224,7 +2229,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
2224
2229
|
)) == null ? void 0 : r.balance, G = i.inventoryForecast.skus.find(
|
|
2225
2230
|
(E) => E.id === c._id
|
|
2226
2231
|
);
|
|
2227
|
-
const
|
|
2232
|
+
const se = {
|
|
2228
2233
|
...c,
|
|
2229
2234
|
balance: I ?? {
|
|
2230
2235
|
amount: 0,
|
|
@@ -2233,11 +2238,11 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
2233
2238
|
day: (G == null ? void 0 : G.depletionDays) ?? void 0,
|
|
2234
2239
|
trackingUnitAbbrev: M ? ((h = c.unit.measurements.find((E) => E.id === M)) == null ? void 0 : h.abbrev) ?? "" : c.unit.abbrev
|
|
2235
2240
|
};
|
|
2236
|
-
p.push(
|
|
2241
|
+
p.push(se);
|
|
2237
2242
|
}
|
|
2238
2243
|
}
|
|
2239
2244
|
return p;
|
|
2240
|
-
}), x = O(""), _ = O(!0), { breakpoints:
|
|
2245
|
+
}), x = O(""), _ = O(!0), { breakpoints: V } = Vt(), H = P(() => V.value.xs || V.value.sm), N = P(() => H.value ? 10 : 20), K = vt(), R = P(() => [
|
|
2241
2246
|
{
|
|
2242
2247
|
label: g("inventory.stock.stock_balance.refreshBalance"),
|
|
2243
2248
|
value: "refresh-balance",
|
|
@@ -2275,8 +2280,8 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
2275
2280
|
}
|
|
2276
2281
|
return (J, p) => {
|
|
2277
2282
|
const n = U("FmSwitch"), r = U("FmTable");
|
|
2278
|
-
return
|
|
2279
|
-
title:
|
|
2283
|
+
return $(), z(yt, {
|
|
2284
|
+
title: a(g)("inventory.stock.title"),
|
|
2280
2285
|
actions: R.value,
|
|
2281
2286
|
"onClick:action": ee
|
|
2282
2287
|
}, {
|
|
@@ -2284,7 +2289,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
2284
2289
|
var h, c, f, M;
|
|
2285
2290
|
return [
|
|
2286
2291
|
e("div", {
|
|
2287
|
-
class:
|
|
2292
|
+
class: _e([
|
|
2288
2293
|
"flex flex-col gap-8 max-h-full",
|
|
2289
2294
|
{
|
|
2290
2295
|
"p-0": H.value,
|
|
@@ -2299,14 +2304,14 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
2299
2304
|
"onUpdate:search": p[1] || (p[1] = (I) => x.value = I),
|
|
2300
2305
|
"hide-filter-options": !0,
|
|
2301
2306
|
filterable: "",
|
|
2302
|
-
"filter-attributes":
|
|
2307
|
+
"filter-attributes": s.value,
|
|
2303
2308
|
filter: t.value,
|
|
2304
2309
|
"onUpdate:filter": p[2] || (p[2] = (I) => t.value = I)
|
|
2305
2310
|
}, {
|
|
2306
2311
|
default: T(() => [
|
|
2307
|
-
|
|
2308
|
-
e("span", ys, v(
|
|
2309
|
-
y(
|
|
2312
|
+
a(F).isEnabled ? ($(), Y("div", vs, [
|
|
2313
|
+
e("span", ys, v(a(g)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
|
|
2314
|
+
y($t),
|
|
2310
2315
|
y(ze, null, {
|
|
2311
2316
|
default: T(() => [
|
|
2312
2317
|
y(n, {
|
|
@@ -2316,38 +2321,38 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
2316
2321
|
]),
|
|
2317
2322
|
_: 1
|
|
2318
2323
|
})
|
|
2319
|
-
])) :
|
|
2324
|
+
])) : te("", !0)
|
|
2320
2325
|
]),
|
|
2321
2326
|
_: 1
|
|
2322
2327
|
}, 8, ["search", "filter-attributes", "filter"]),
|
|
2323
|
-
(
|
|
2324
|
-
style: ot(
|
|
2325
|
-
"column-defs":
|
|
2328
|
+
($(), z(r, {
|
|
2329
|
+
style: ot(a(K).tableHeight),
|
|
2330
|
+
"column-defs": a(j),
|
|
2326
2331
|
"row-data": l.value,
|
|
2327
2332
|
"search-value": x.value,
|
|
2328
|
-
loading: C.value || !
|
|
2329
|
-
key: (h =
|
|
2330
|
-
onRowClick: p[3] || (p[3] = (I) =>
|
|
2333
|
+
loading: C.value || !a(o)._currentLocation,
|
|
2334
|
+
key: (h = a(o)._currentLocation) == null ? void 0 : h.dbName,
|
|
2335
|
+
onRowClick: p[3] || (p[3] = (I) => a(S).showSkuHistory(I.original)),
|
|
2331
2336
|
"page-size": N.value
|
|
2332
2337
|
}, {
|
|
2333
2338
|
"list-row": T((I) => [
|
|
2334
2339
|
y(Ft, {
|
|
2335
2340
|
row: I,
|
|
2336
|
-
onRowClick:
|
|
2341
|
+
onRowClick: a(S).showSkuHistory
|
|
2337
2342
|
}, {
|
|
2338
2343
|
default: T((G) => {
|
|
2339
|
-
var
|
|
2344
|
+
var se, E, W, q, le, re, Z, ae, fe, me;
|
|
2340
2345
|
return [
|
|
2341
2346
|
e("div", _s, [
|
|
2342
2347
|
e("div", ks, [
|
|
2343
2348
|
e("div", bs, [
|
|
2344
|
-
y(
|
|
2345
|
-
render: (W = (E = (
|
|
2349
|
+
y(a(Je), {
|
|
2350
|
+
render: (W = (E = (se = G.code) == null ? void 0 : se.column) == null ? void 0 : E.columnDef) == null ? void 0 : W.cell,
|
|
2346
2351
|
props: (le = (q = G.code) == null ? void 0 : q.getContext) == null ? void 0 : le.call(q)
|
|
2347
2352
|
}, null, 8, ["render", "props"])
|
|
2348
2353
|
]),
|
|
2349
2354
|
e("div", gs, [
|
|
2350
|
-
y(
|
|
2355
|
+
y(a(Je), {
|
|
2351
2356
|
render: (ae = (Z = (re = G.name) == null ? void 0 : re.column) == null ? void 0 : Z.columnDef) == null ? void 0 : ae.cell,
|
|
2352
2357
|
props: (me = (fe = G.name) == null ? void 0 : fe.getContext) == null ? void 0 : me.call(fe)
|
|
2353
2358
|
}, null, 8, ["render", "props"])
|
|
@@ -2376,16 +2381,16 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
|
|
|
2376
2381
|
_: 1
|
|
2377
2382
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
2378
2383
|
], 2),
|
|
2379
|
-
(
|
|
2380
|
-
(c =
|
|
2381
|
-
(f =
|
|
2382
|
-
(M =
|
|
2383
|
-
X.value ? (
|
|
2384
|
+
($(), z(ft, { to: "body" }, [
|
|
2385
|
+
(c = a(S).stockHistoryProps) != null && c.sku ? ($(), z(fs, Te(He({ key: 0 }, a(S).stockHistoryProps)), null, 16)) : te("", !0),
|
|
2386
|
+
(f = a(S).convertSkuDialogProps) != null && f.sku ? ($(), z(gn, Te(He({ key: 1 }, a(S).convertSkuDialogProps)), null, 16)) : te("", !0),
|
|
2387
|
+
(M = a(S).adjustSkuDialogProps) != null && M.stock ? ($(), z(jn, Te(He({ key: 2 }, a(S).adjustSkuDialogProps)), null, 16)) : te("", !0),
|
|
2388
|
+
X.value ? ($(), z(Yn, {
|
|
2384
2389
|
key: 3,
|
|
2385
2390
|
show: X.value,
|
|
2386
2391
|
"onUpdate:show": p[4] || (p[4] = (I) => X.value = I),
|
|
2387
2392
|
onSubmitted: p[5] || (p[5] = (I) => D())
|
|
2388
|
-
}, null, 8, ["show"])) :
|
|
2393
|
+
}, null, 8, ["show"])) : te("", !0)
|
|
2389
2394
|
]))
|
|
2390
2395
|
];
|
|
2391
2396
|
}),
|