@feedmepos/mf-inventory-portal 0.0.25-dev.11 → 0.0.25-dev.12
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-CO-6e1yq.js → App-PehI6qSK.js} +2 -2
- package/dist/ApprovalView-a6tbFyO2.js +140 -0
- package/dist/{BindingsDialog-oWRH8tAd.js → BindingsDialog-BNco1Vhd.js} +2 -2
- package/dist/{BindingsPicker-CpM2ldne.js → BindingsPicker-Dns2kFS-.js} +1 -1
- package/dist/{BindingsTable-BA3ATsO3.js → BindingsTable-DTrXzYzr.js} +1 -1
- package/dist/{ClosingDraftView-CS2v3zbm.js → ClosingDraftView-BXBkI6WL.js} +2 -2
- package/dist/{ClosingTemplateView-BS8RaUgX.js → ClosingTemplateView-BiAGOmVg.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-7qLOtuzy.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-IlN0Uj04.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Dn5wTNsE.js → FmUnitInput.vue_vue_type_script_setup_true_lang-JDL6LVAb.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Wv_HtVUG.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DR5ewA1c.js} +1 -1
- package/dist/{IngredientGroupView-DLDfRzPQ.js → IngredientGroupView-Bci0qysG.js} +1 -1
- package/dist/{IngredientsView-IpEhZhFt.js → IngredientsView-Dpc_GncE.js} +4 -4
- package/dist/{IntegrationView-D8DFRPr1.js → IntegrationView-DCWg-DR4.js} +1 -1
- package/dist/{InventoryBindingForm-9255LnDG.js → InventoryBindingForm-BwwF-2NM.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BqlOlgnY.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-1BVSUfuT.js} +3 -3
- package/dist/{InventoryBindingSummary-BPEwj0Gs.js → InventoryBindingSummary-DgoHed7T.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-E53iSENL.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Bu4Dw_6P.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CByTbk0u.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CW7-Eu69.js} +1 -1
- package/dist/{PublishView-SUyD0hW-.js → PublishView-DVYBAYBI.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-CSi_l2J8.js → PurchaseOrderPrintPreview-Dp2v_J3o.js} +1 -1
- package/dist/{ReceiveRequestView-DA7CofZ1.js → ReceiveRequestView-DVq8tkzd.js} +388 -380
- package/dist/{RecipeView-DYGIII7T.js → RecipeView-Cv5EH2Ah.js} +3 -3
- package/dist/{StockView-DjQlAXbi.js → StockView-B7x9Pywp.js} +7 -7
- package/dist/{SupplierView-CB8pq2dk.js → SupplierView-BgyqCgOQ.js} +4 -4
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-ByAN3s-h.js +1494 -0
- package/dist/{TransferTemplateView-CjVir2Ql.js → TransferTemplateView-C30bwI6y.js} +7 -7
- package/dist/{UnitView-DD8sGjaR.js → UnitView-IUEnJvH0.js} +3 -3
- package/dist/{WarehouseView-BE131osn.js → WarehouseView-Bcwta2ui.js} +1 -1
- package/dist/api/purchase-order.d.ts +1 -0
- package/dist/{app-CbAke6dP.js → app-BKrf9Qul.js} +10 -10
- package/dist/app.js +1 -1
- package/dist/{decimal-ITAjlTW6.js → decimal-pm1D555G.js} +1 -1
- package/dist/{feature-Dq5knPmf.js → feature-IIGwFZ6m.js} +1 -1
- package/dist/{format-unit-display-D-Ho5ga9.js → format-unit-display-DAzCcqoK.js} +2 -2
- package/dist/{index-DpN0zX69.js → index-phCfzXTb.js} +2 -2
- package/dist/{stock-CjI4mNO9.js → stock-B9Im7AGF.js} +1 -1
- package/dist/{supplier-DnImzKTa.js → supplier-D5z7EqEg.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-AgNLUJRC.js → use-ingredient-select-dialog-QJXtuwbP.js} +1 -1
- package/dist/{use-inventory-binding-dialog-sJsbhbQI.js → use-inventory-binding-dialog-DbK__hMV.js} +1 -1
- package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +2 -0
- package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +2 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +6 -2
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +2 -2
- package/dist/{vue-i18n-DYyu2tND.js → vue-i18n-sbiTSWWp.js} +221 -221
- package/package.json +3 -3
- package/dist/ApprovalView-CibKgQlF.js +0 -138
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-IxGRO3vL.js +0 -1461
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { b as
|
|
3
|
-
import { u as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { u as
|
|
6
|
-
import { useBreakpoints as
|
|
7
|
-
import { P as j, u as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { u as
|
|
10
|
-
import { c as re, u as
|
|
11
|
-
import { useI18n as
|
|
12
|
-
import { u as Ke } from "./supplier-
|
|
1
|
+
import { reactive as ot, onMounted as Ne, h as L, computed as E, defineComponent as pe, openBlock as S, createElementBlock as q, Fragment as ke, renderList as Me, createElementVNode as l, toDisplayString as U, unref as e, resolveComponent as P, createVNode as d, withCtx as F, createCommentVNode as G, ref as N, createBlock as W, watch as ge, normalizeClass as J, normalizeStyle as lt, createTextVNode as Oe, nextTick as mt, mergeProps as Be, isRef as Se, Teleport as pt } from "vue";
|
|
2
|
+
import { b as ze, Z as ft, l as We, i as ye, O as vt, a0 as Le, K as yt, as as bt, A as Ve, M as _t, m as nt, ab as He, E as ie, at as gt, a as je, au as kt, av as Ct, aw as ht, G as xt, u as Ye, ax as St, $ as wt, T as Dt, ay as Ft, B as rt, H as $t, d as Fe, az as Re, a5 as Je, y as Tt, _ as Pt, z as It, N as Xe } from "./app-BKrf9Qul.js";
|
|
3
|
+
import { u as it, a as Rt, P as Ue, b as Vt, _ as At, g as Et } from "./TransferDetails.vue_vue_type_script_setup_true_lang-ByAN3s-h.js";
|
|
4
|
+
import { _ as ut, u as qt, i as Ut, e as Mt } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-CW7-Eu69.js";
|
|
5
|
+
import { u as Ot } from "./useTabStorage-BkIVScW_.js";
|
|
6
|
+
import { useBreakpoints as Qe, components as ve, FmButtonVariant as Bt, useSnackbar as Ae, useDialog as Nt, useProxiedModel as zt } from "@feedmepos/ui-library";
|
|
7
|
+
import { P as j, u as dt } from "./format-unit-display-DAzCcqoK.js";
|
|
8
|
+
import { _ as Lt, F as Ht, a as et, b as jt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-JDL6LVAb.js";
|
|
9
|
+
import { u as Ee } from "./feature-IIGwFZ6m.js";
|
|
10
|
+
import { c as re, u as Yt, _ as Qt } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-IlN0Uj04.js";
|
|
11
|
+
import { useI18n as Ce } from "@feedmepos/mf-common";
|
|
12
|
+
import { u as Ke } from "./supplier-D5z7EqEg.js";
|
|
13
13
|
import { _ as Kt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
14
|
-
import { u as
|
|
14
|
+
import { u as Zt } from "./vue-i18n-sbiTSWWp.js";
|
|
15
15
|
import "./array-hChJVZLE.js";
|
|
16
16
|
var Y = /* @__PURE__ */ ((m) => (m.Code = "Code", m.Name = "Name", m.Amount = "Amount", m.Cost = "Cost", m.TotalCost = "TotalCost", m.Delete = "Delete", m))(Y || {});
|
|
17
|
-
const
|
|
18
|
-
const { t: m } =
|
|
17
|
+
const tt = () => {
|
|
18
|
+
const { t: m } = Ce();
|
|
19
19
|
return L(
|
|
20
|
-
|
|
20
|
+
ut,
|
|
21
21
|
{
|
|
22
22
|
zIndex: 50,
|
|
23
23
|
class: "whitespace-nowrap"
|
|
24
24
|
},
|
|
25
|
-
m("inventory.transfer.form.items.table.Cost", [
|
|
25
|
+
m("inventory.transfer.form.items.table.Cost", [nt()])
|
|
26
26
|
);
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
const { t: y } =
|
|
30
|
-
|
|
28
|
+
function Gt(m) {
|
|
29
|
+
const { t: y } = Ce(), n = ot({}), { breakpoints: i } = Qe(), b = Ee(), t = ze();
|
|
30
|
+
Ne(() => {
|
|
31
31
|
for (const u of m.items) {
|
|
32
32
|
if (!u.totalCost)
|
|
33
33
|
continue;
|
|
34
34
|
const a = re(u.sku, u.quantity, u.measurement, {
|
|
35
35
|
supplier: m.supplier
|
|
36
|
-
}), o = u.totalCost ??
|
|
36
|
+
}), o = u.totalCost ?? ft.reset();
|
|
37
37
|
a ? n[u.sku._id] = a.amount !== o.amount || a.precision !== o.precision : n[u.sku._id] = !0;
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
function f(u) {
|
|
41
|
-
var o, v, k,
|
|
42
|
-
return !!(((v = (o = u.defaultCost) == null ? void 0 : o.costPerUnit) == null ? void 0 : v.amount) ?? ((D = (x = (
|
|
41
|
+
var o, v, k, C, g, x, D;
|
|
42
|
+
return !!(((v = (o = u.defaultCost) == null ? void 0 : o.costPerUnit) == null ? void 0 : v.amount) ?? ((D = (x = (g = (C = (k = m.supplier) == null ? void 0 : k.supplyItems) == null ? void 0 : C.find((R) => R.skuId === u._id)) == null ? void 0 : g.defaultCost) == null ? void 0 : x.costPerUnit) == null ? void 0 : D.amount));
|
|
43
43
|
}
|
|
44
|
-
const
|
|
44
|
+
const _ = [
|
|
45
45
|
{
|
|
46
46
|
id: "Code",
|
|
47
47
|
header: () => y("inventory.transfer.form.items.table.Code"),
|
|
@@ -73,7 +73,7 @@ function Zt(m) {
|
|
|
73
73
|
});
|
|
74
74
|
},
|
|
75
75
|
key: a.sku._id,
|
|
76
|
-
rules: [
|
|
76
|
+
rules: [We()],
|
|
77
77
|
labelMark: "required"
|
|
78
78
|
});
|
|
79
79
|
},
|
|
@@ -109,7 +109,7 @@ function Zt(m) {
|
|
|
109
109
|
});
|
|
110
110
|
},
|
|
111
111
|
key: a.sku._id,
|
|
112
|
-
rules: [
|
|
112
|
+
rules: [We()],
|
|
113
113
|
labelMark: "required"
|
|
114
114
|
});
|
|
115
115
|
},
|
|
@@ -120,11 +120,11 @@ function Zt(m) {
|
|
|
120
120
|
header: () => y("inventory.transfer.form.items.table.Amount"),
|
|
121
121
|
minSize: 200,
|
|
122
122
|
cell(u) {
|
|
123
|
-
var v, k,
|
|
124
|
-
const a = u.row.original, o = (
|
|
125
|
-
(
|
|
123
|
+
var v, k, C;
|
|
124
|
+
const a = u.row.original, o = (C = (k = (v = m.template) == null ? void 0 : v.purchaseOrder) == null ? void 0 : k.items) == null ? void 0 : C.find(
|
|
125
|
+
(g) => g.sku._id === a.sku._id
|
|
126
126
|
);
|
|
127
|
-
return L(
|
|
127
|
+
return L(Lt, {
|
|
128
128
|
style: {
|
|
129
129
|
flex: "1 1 0%"
|
|
130
130
|
},
|
|
@@ -134,11 +134,11 @@ function Zt(m) {
|
|
|
134
134
|
},
|
|
135
135
|
key: a.sku._id,
|
|
136
136
|
unit: a.sku.unit,
|
|
137
|
-
"onUpdate:modelValue": (
|
|
137
|
+
"onUpdate:modelValue": (g) => {
|
|
138
138
|
const x = {
|
|
139
139
|
...a,
|
|
140
|
-
quantity:
|
|
141
|
-
measurement:
|
|
140
|
+
quantity: g.amount,
|
|
141
|
+
measurement: g.measurement
|
|
142
142
|
};
|
|
143
143
|
b.enableTotalCost && (x.totalCost = re(a.sku, a.quantity, a.measurement, {
|
|
144
144
|
supplier: m.supplier,
|
|
@@ -151,18 +151,18 @@ function Zt(m) {
|
|
|
151
151
|
disableUnit: !!o,
|
|
152
152
|
disabled: m.disabled,
|
|
153
153
|
rules: [
|
|
154
|
-
|
|
154
|
+
Ht(
|
|
155
155
|
+ye(
|
|
156
156
|
(o != null && o.minimumQuantity && (o == null ? void 0 : o.minimumQuantity.amount) > 0 ? o == null ? void 0 : o.minimumQuantity : void 0) ?? {
|
|
157
157
|
amount: 1,
|
|
158
|
-
precision:
|
|
158
|
+
precision: vt(a.sku.unit, a.measurement)
|
|
159
159
|
}
|
|
160
160
|
)
|
|
161
161
|
),
|
|
162
|
-
o != null && o.maximumQuantity ?
|
|
162
|
+
o != null && o.maximumQuantity ? et(
|
|
163
163
|
+ye(o == null ? void 0 : o.maximumQuantity)
|
|
164
|
-
) :
|
|
165
|
-
...o != null && o.quantityStep ? [
|
|
164
|
+
) : et(1 / 0),
|
|
165
|
+
...o != null && o.quantityStep ? [jt(o.quantityStep)] : []
|
|
166
166
|
],
|
|
167
167
|
applyDefaultRules: !0
|
|
168
168
|
});
|
|
@@ -171,7 +171,7 @@ function Zt(m) {
|
|
|
171
171
|
},
|
|
172
172
|
b.mustUseDefaultCost ? {
|
|
173
173
|
id: "TotalCost",
|
|
174
|
-
header:
|
|
174
|
+
header: tt,
|
|
175
175
|
size: 180,
|
|
176
176
|
accessorFn: (u) => {
|
|
177
177
|
const a = re(u.sku, u.quantity, u.measurement, {
|
|
@@ -181,7 +181,7 @@ function Zt(m) {
|
|
|
181
181
|
}
|
|
182
182
|
} : {
|
|
183
183
|
id: "Cost",
|
|
184
|
-
header:
|
|
184
|
+
header: tt,
|
|
185
185
|
size: 180,
|
|
186
186
|
cell(u) {
|
|
187
187
|
const a = u.row.original, o = f(a.sku), v = i.value.xs || i.value.sm;
|
|
@@ -197,7 +197,7 @@ function Zt(m) {
|
|
|
197
197
|
[
|
|
198
198
|
L(ve.FmButton, {
|
|
199
199
|
prependIcon: "edit",
|
|
200
|
-
variant:
|
|
200
|
+
variant: Bt.Tertiary,
|
|
201
201
|
disabled: m.disabled,
|
|
202
202
|
onClick() {
|
|
203
203
|
m.updateItem({
|
|
@@ -216,7 +216,7 @@ function Zt(m) {
|
|
|
216
216
|
[
|
|
217
217
|
L(
|
|
218
218
|
"span",
|
|
219
|
-
v ?
|
|
219
|
+
v ? Le(
|
|
220
220
|
re(a.sku, a.quantity, a.measurement, {
|
|
221
221
|
supplier: m.supplier
|
|
222
222
|
})
|
|
@@ -248,12 +248,12 @@ function Zt(m) {
|
|
|
248
248
|
m.updateItem({
|
|
249
249
|
...a,
|
|
250
250
|
totalCost: {
|
|
251
|
-
...
|
|
252
|
-
currency:
|
|
251
|
+
...yt(+k),
|
|
252
|
+
currency: bt()
|
|
253
253
|
}
|
|
254
254
|
});
|
|
255
255
|
},
|
|
256
|
-
rules: [
|
|
256
|
+
rules: [Ve(0), _t(2)]
|
|
257
257
|
},
|
|
258
258
|
{
|
|
259
259
|
prepend() {
|
|
@@ -265,7 +265,7 @@ function Zt(m) {
|
|
|
265
265
|
m.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
266
266
|
]
|
|
267
267
|
},
|
|
268
|
-
|
|
268
|
+
nt()
|
|
269
269
|
) : null;
|
|
270
270
|
},
|
|
271
271
|
append() {
|
|
@@ -317,13 +317,13 @@ function Zt(m) {
|
|
|
317
317
|
}
|
|
318
318
|
];
|
|
319
319
|
return {
|
|
320
|
-
columnDefs:
|
|
320
|
+
columnDefs: E(() => b.enableTotalCost && (b.mustUseDefaultCost || m.transferType === j.PURCHASE) ? _ : _.filter(
|
|
321
321
|
(u) => u.id !== "Cost"
|
|
322
322
|
/* Cost */
|
|
323
323
|
))
|
|
324
324
|
};
|
|
325
325
|
}
|
|
326
|
-
const
|
|
326
|
+
const Wt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, Jt = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, Xt = { class: "w-[450px] xs:w-full flex" }, es = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, ts = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ct = /* @__PURE__ */ pe({
|
|
327
327
|
__name: "SupplierPriceHistory",
|
|
328
328
|
props: {
|
|
329
329
|
prices: {}
|
|
@@ -333,31 +333,31 @@ const Gt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
333
333
|
function n(i) {
|
|
334
334
|
return y.suppliers.find((b) => b._id === i);
|
|
335
335
|
}
|
|
336
|
-
return (i, b) => (S(),
|
|
337
|
-
(S(!0),
|
|
336
|
+
return (i, b) => (S(), q("div", Wt, [
|
|
337
|
+
(S(!0), q(ke, null, Me(Object.keys(i.prices), (t) => {
|
|
338
338
|
var f;
|
|
339
|
-
return S(),
|
|
339
|
+
return S(), q("div", {
|
|
340
340
|
key: t,
|
|
341
341
|
class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
|
|
342
342
|
}, [
|
|
343
|
-
l("div",
|
|
344
|
-
l("div",
|
|
345
|
-
(S(!0),
|
|
343
|
+
l("div", Jt, U((f = n(t)) == null ? void 0 : f.name), 1),
|
|
344
|
+
l("div", Xt, [
|
|
345
|
+
(S(!0), q(ke, null, Me(i.prices[t].slice(0, 3), (_) => {
|
|
346
346
|
var w;
|
|
347
|
-
return S(),
|
|
348
|
-
key:
|
|
347
|
+
return S(), q("div", {
|
|
348
|
+
key: _.date,
|
|
349
349
|
class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
|
|
350
350
|
}, [
|
|
351
|
-
l("div",
|
|
352
|
-
l("span", null, U(
|
|
351
|
+
l("div", es, [
|
|
352
|
+
l("span", null, U(_.totalCost ? e(Le)(_.totalCost) : "No data"), 1),
|
|
353
353
|
b[0] || (b[0] = l("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
|
|
354
|
-
l("span", null, U(e(ye)(
|
|
355
|
-
l("span", null, U(((w =
|
|
354
|
+
l("span", null, U(e(ye)(_.totalUnit, !1)), 1),
|
|
355
|
+
l("span", null, U(((w = _.measurement) == null ? void 0 : w.abbrev) ?? _.unit.abbrev), 1)
|
|
356
356
|
]),
|
|
357
|
-
l("div",
|
|
358
|
-
l("span", null, "(#" + U(
|
|
357
|
+
l("div", ts, [
|
|
358
|
+
l("span", null, "(#" + U(_.seqNumber) + ")", 1),
|
|
359
359
|
b[1] || (b[1] = l("span", null, U(" "), -1)),
|
|
360
|
-
l("span", null, U(e(
|
|
360
|
+
l("span", null, U(e(He)(new Date(_.date))), 1)
|
|
361
361
|
])
|
|
362
362
|
]);
|
|
363
363
|
}), 128))
|
|
@@ -366,10 +366,10 @@ const Gt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
366
366
|
}), 128))
|
|
367
367
|
]));
|
|
368
368
|
}
|
|
369
|
-
}),
|
|
369
|
+
}), ss = { class: "flex flex-col gap-8 py-16" }, as = { class: "flex items-center" }, os = { class: "flex-1 flex gap-1 items-center" }, ls = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ns = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, rs = { class: "flex gap-8 w-full" }, is = { class: "flex-1 flex flex-col gap-4" }, us = { class: "flex-1 flex flex-col gap-4" }, ds = { class: "flex gap-8 w-full" }, cs = { class: "flex-1 flex flex-col gap-4" }, ms = {
|
|
370
370
|
key: 0,
|
|
371
371
|
class: "flex-1 flex flex-col gap-4"
|
|
372
|
-
},
|
|
372
|
+
}, ps = /* @__PURE__ */ pe({
|
|
373
373
|
__name: "TransferItem",
|
|
374
374
|
props: {
|
|
375
375
|
cellByColId: {},
|
|
@@ -378,58 +378,58 @@ const Gt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
378
378
|
row: {}
|
|
379
379
|
},
|
|
380
380
|
setup(m) {
|
|
381
|
-
const { t: y } =
|
|
381
|
+
const { t: y } = Ce();
|
|
382
382
|
return (n, i) => {
|
|
383
|
-
var f,
|
|
383
|
+
var f, _, w, u, a, o, v, k, C, g, x, D, R, z, ue, T, $, O, V, I, B, Q, K, p, c, H, oe;
|
|
384
384
|
const b = P("FmLabel"), t = P("FmSpacer");
|
|
385
|
-
return S(),
|
|
386
|
-
l("div",
|
|
387
|
-
l("div",
|
|
388
|
-
l("span",
|
|
389
|
-
l("span",
|
|
385
|
+
return S(), q("div", ss, [
|
|
386
|
+
l("div", as, [
|
|
387
|
+
l("div", os, [
|
|
388
|
+
l("span", ls, " (" + U(n.row.original.sku.code) + ") ", 1),
|
|
389
|
+
l("span", ns, U(n.row.original.sku.name), 1)
|
|
390
390
|
]),
|
|
391
391
|
l("div", null, [
|
|
392
392
|
d(e(ie), {
|
|
393
|
-
render: (w = (
|
|
393
|
+
render: (w = (_ = (f = n.cellByColId.Delete) == null ? void 0 : f.column) == null ? void 0 : _.columnDef) == null ? void 0 : w.cell,
|
|
394
394
|
props: (a = (u = n.cellByColId.Delete) == null ? void 0 : u.getContext) == null ? void 0 : a.call(u)
|
|
395
395
|
}, null, 8, ["render", "props"])
|
|
396
396
|
])
|
|
397
397
|
]),
|
|
398
|
-
l("div",
|
|
399
|
-
l("div",
|
|
398
|
+
l("div", rs, [
|
|
399
|
+
l("div", is, [
|
|
400
400
|
d(b, {
|
|
401
401
|
label: e(y)(`inventory.transfer.form.items.table.${e(Y).Code}`)
|
|
402
402
|
}, null, 8, ["label"]),
|
|
403
403
|
d(e(ie), {
|
|
404
404
|
render: (k = (v = (o = n.cellByColId[e(Y).Code]) == null ? void 0 : o.column) == null ? void 0 : v.columnDef) == null ? void 0 : k.cell,
|
|
405
|
-
props: (
|
|
405
|
+
props: (g = (C = n.cellByColId[e(Y).Code]) == null ? void 0 : C.getContext) == null ? void 0 : g.call(C)
|
|
406
406
|
}, null, 8, ["render", "props"]),
|
|
407
407
|
i[0] || (i[0] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
408
408
|
]),
|
|
409
|
-
l("div",
|
|
409
|
+
l("div", us, [
|
|
410
410
|
d(b, {
|
|
411
411
|
label: e(y)(`inventory.transfer.form.items.table.${e(Y).Name}`)
|
|
412
412
|
}, null, 8, ["label"]),
|
|
413
413
|
d(e(ie), {
|
|
414
|
-
render: (
|
|
414
|
+
render: (R = (D = (x = n.cellByColId[e(Y).Name]) == null ? void 0 : x.column) == null ? void 0 : D.columnDef) == null ? void 0 : R.cell,
|
|
415
415
|
props: (ue = (z = n.cellByColId[e(Y).Name]) == null ? void 0 : z.getContext) == null ? void 0 : ue.call(z)
|
|
416
416
|
}, null, 8, ["render", "props"]),
|
|
417
417
|
i[1] || (i[1] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
418
418
|
])
|
|
419
419
|
]),
|
|
420
|
-
l("div",
|
|
421
|
-
l("div",
|
|
420
|
+
l("div", ds, [
|
|
421
|
+
l("div", cs, [
|
|
422
422
|
d(b, {
|
|
423
423
|
label: e(y)(`inventory.transfer.form.items.table.${e(Y).Amount}`)
|
|
424
424
|
}, null, 8, ["label"]),
|
|
425
425
|
d(e(ie), {
|
|
426
426
|
render: (O = ($ = (T = n.cellByColId[e(Y).Amount]) == null ? void 0 : T.column) == null ? void 0 : $.columnDef) == null ? void 0 : O.cell,
|
|
427
|
-
props: (I = (
|
|
427
|
+
props: (I = (V = n.cellByColId[e(Y).Amount]) == null ? void 0 : V.getContext) == null ? void 0 : I.call(V)
|
|
428
428
|
}, null, 8, ["render", "props"]),
|
|
429
429
|
i[2] || (i[2] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
430
430
|
]),
|
|
431
|
-
n.cellByColId[e(Y).Cost] ? (S(),
|
|
432
|
-
d(
|
|
431
|
+
n.cellByColId[e(Y).Cost] ? (S(), q("div", ms, [
|
|
432
|
+
d(ut, { "z-index": 50 }, {
|
|
433
433
|
default: F(() => [
|
|
434
434
|
d(b, {
|
|
435
435
|
label: e(y)(`inventory.transfer.form.items.table.${e(Y).Cost}2`)
|
|
@@ -438,15 +438,15 @@ const Gt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
438
438
|
_: 1
|
|
439
439
|
}),
|
|
440
440
|
d(e(ie), {
|
|
441
|
-
render: (
|
|
441
|
+
render: (K = (Q = (B = n.cellByColId[e(Y).Cost]) == null ? void 0 : B.column) == null ? void 0 : Q.columnDef) == null ? void 0 : K.cell,
|
|
442
442
|
props: (c = (p = n.cellByColId[e(Y).Cost]) == null ? void 0 : p.getContext) == null ? void 0 : c.call(p)
|
|
443
443
|
}, null, 8, ["render", "props"]),
|
|
444
444
|
i[3] || (i[3] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
445
445
|
])) : G("", !0)
|
|
446
446
|
]),
|
|
447
|
-
n.showComparePrice && Object.keys(n.comparePriceBySku[(H = n.row.original.sku) == null ? void 0 : H._id] ?? {}).length > 0 ? (S(),
|
|
447
|
+
n.showComparePrice && Object.keys(n.comparePriceBySku[(H = n.row.original.sku) == null ? void 0 : H._id] ?? {}).length > 0 ? (S(), q(ke, { key: 0 }, [
|
|
448
448
|
d(t, { class: "h-8" }),
|
|
449
|
-
d(
|
|
449
|
+
d(ct, {
|
|
450
450
|
prices: n.comparePriceBySku[(oe = n.row.original.sku) == null ? void 0 : oe._id]
|
|
451
451
|
}, null, 8, ["prices"])
|
|
452
452
|
], 64)) : G("", !0)
|
|
@@ -454,8 +454,8 @@ const Gt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
454
454
|
};
|
|
455
455
|
}
|
|
456
456
|
});
|
|
457
|
-
function
|
|
458
|
-
const y =
|
|
457
|
+
function fs(m) {
|
|
458
|
+
const y = E({
|
|
459
459
|
get() {
|
|
460
460
|
const t = m.getEffectiveAt();
|
|
461
461
|
return t ? new Date(t) : null;
|
|
@@ -463,21 +463,21 @@ function ps(m) {
|
|
|
463
463
|
set(t) {
|
|
464
464
|
m.setEffectiveAt((t == null ? void 0 : t.toISOString()) ?? null);
|
|
465
465
|
}
|
|
466
|
-
}), n =
|
|
466
|
+
}), n = E({
|
|
467
467
|
get() {
|
|
468
468
|
return !!y.value;
|
|
469
469
|
},
|
|
470
470
|
set(t) {
|
|
471
471
|
t ? y.value = /* @__PURE__ */ new Date() : y.value = null;
|
|
472
472
|
}
|
|
473
|
-
}), i =
|
|
473
|
+
}), i = E({
|
|
474
474
|
get() {
|
|
475
|
-
return y.value === null ? "" :
|
|
475
|
+
return y.value === null ? "" : He(y.value);
|
|
476
476
|
},
|
|
477
477
|
set(t) {
|
|
478
478
|
t ? y.value = /* @__PURE__ */ new Date(`${t} ${b.value}`) : y.value = null;
|
|
479
479
|
}
|
|
480
|
-
}), b =
|
|
480
|
+
}), b = E({
|
|
481
481
|
get() {
|
|
482
482
|
return y.value === null ? "" : gt(y.value);
|
|
483
483
|
},
|
|
@@ -492,13 +492,13 @@ function ps(m) {
|
|
|
492
492
|
backdateTimeModel: b
|
|
493
493
|
};
|
|
494
494
|
}
|
|
495
|
-
const
|
|
495
|
+
const vs = {
|
|
496
496
|
width: "24",
|
|
497
497
|
height: "24",
|
|
498
498
|
viewBox: "0 0 24 24",
|
|
499
499
|
fill: "none",
|
|
500
500
|
xmlns: "http://www.w3.org/2000/svg"
|
|
501
|
-
},
|
|
501
|
+
}, ys = ["fill"], bs = ["fill"], _s = ["stroke"], gs = ["stroke"], ks = /* @__PURE__ */ pe({
|
|
502
502
|
__name: "SparkIcon",
|
|
503
503
|
props: {
|
|
504
504
|
size: {
|
|
@@ -511,22 +511,22 @@ const fs = {
|
|
|
511
511
|
}
|
|
512
512
|
},
|
|
513
513
|
setup(m) {
|
|
514
|
-
return (y, n) => (S(),
|
|
514
|
+
return (y, n) => (S(), q("svg", vs, [
|
|
515
515
|
l("path", {
|
|
516
516
|
d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
|
|
517
517
|
fill: m.color
|
|
518
|
-
}, null, 8,
|
|
518
|
+
}, null, 8, ys),
|
|
519
519
|
l("path", {
|
|
520
520
|
d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
|
|
521
521
|
fill: m.color
|
|
522
|
-
}, null, 8,
|
|
522
|
+
}, null, 8, bs),
|
|
523
523
|
l("path", {
|
|
524
524
|
d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
|
|
525
525
|
stroke: m.color,
|
|
526
526
|
"stroke-width": "1.5",
|
|
527
527
|
"stroke-linecap": "round",
|
|
528
528
|
"stroke-linejoin": "round"
|
|
529
|
-
}, null, 8,
|
|
529
|
+
}, null, 8, _s),
|
|
530
530
|
l("path", {
|
|
531
531
|
d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
|
|
532
532
|
stroke: m.color,
|
|
@@ -536,14 +536,14 @@ const fs = {
|
|
|
536
536
|
}, null, 8, gs)
|
|
537
537
|
]));
|
|
538
538
|
}
|
|
539
|
-
}),
|
|
539
|
+
}), Cs = { class: "flex gap-8 items-center" }, hs = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, xs = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, Ss = { class: "flex items-center w-full" }, ws = { class: "flex-1" }, Ds = { class: "fm-typo-en-title-sm-800" }, Fs = { class: "flex items-start gap-8" }, $s = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ts = { class: "flex gap-1" }, st = /* @__PURE__ */ pe({
|
|
540
540
|
__name: "ForecastStock",
|
|
541
541
|
props: {
|
|
542
542
|
disabled: { type: Boolean }
|
|
543
543
|
},
|
|
544
544
|
emits: ["update:poItems"],
|
|
545
545
|
setup(m, { emit: y }) {
|
|
546
|
-
const n = y, i = N(!1), b = N(7), t = qt(), f = Ae(),
|
|
546
|
+
const n = y, i = N(!1), b = N(7), t = qt(), f = Ae(), _ = je(), { t: w } = Ce();
|
|
547
547
|
async function u() {
|
|
548
548
|
if (b.value < 1)
|
|
549
549
|
return;
|
|
@@ -557,13 +557,13 @@ const fs = {
|
|
|
557
557
|
return;
|
|
558
558
|
}
|
|
559
559
|
const o = t.purchaseOrderForecast.skus.reduce((v, k) => {
|
|
560
|
-
const
|
|
561
|
-
if (v.find((D) => D.sku._id === k.id) || !
|
|
560
|
+
const C = _.skus.find((D) => D._id === k.id);
|
|
561
|
+
if (v.find((D) => D.sku._id === k.id) || !C)
|
|
562
562
|
return v;
|
|
563
563
|
const x = {
|
|
564
|
-
sku:
|
|
565
|
-
code:
|
|
566
|
-
name:
|
|
564
|
+
sku: C,
|
|
565
|
+
code: C.code,
|
|
566
|
+
name: C.name,
|
|
567
567
|
quantity: {
|
|
568
568
|
amount: k.amount,
|
|
569
569
|
precision: 0
|
|
@@ -574,8 +574,8 @@ const fs = {
|
|
|
574
574
|
n("update:poItems", o);
|
|
575
575
|
}
|
|
576
576
|
return (a, o) => {
|
|
577
|
-
const v = P("FmButton"), k = P("FmIcon"),
|
|
578
|
-
return S(), W(
|
|
577
|
+
const v = P("FmButton"), k = P("FmIcon"), C = P("FmStepperField"), g = P("FmPopover");
|
|
578
|
+
return S(), W(g, {
|
|
579
579
|
disabled: a.disabled,
|
|
580
580
|
class: "flex",
|
|
581
581
|
"show-popover": i.value,
|
|
@@ -591,8 +591,8 @@ const fs = {
|
|
|
591
591
|
disabled: a.disabled
|
|
592
592
|
}, {
|
|
593
593
|
default: F(() => [
|
|
594
|
-
l("div",
|
|
595
|
-
d(
|
|
594
|
+
l("div", Cs, [
|
|
595
|
+
d(ks, {
|
|
596
596
|
size: 24,
|
|
597
597
|
color: a.disabled ? "#c7c7cc" : "#ff7823"
|
|
598
598
|
}, null, 8, ["color"]),
|
|
@@ -603,12 +603,12 @@ const fs = {
|
|
|
603
603
|
}, 8, ["text-color", "border-color", "disabled"])
|
|
604
604
|
]),
|
|
605
605
|
default: F(() => [
|
|
606
|
-
l("div",
|
|
607
|
-
l("div",
|
|
608
|
-
l("div",
|
|
606
|
+
l("div", xs, [
|
|
607
|
+
l("div", Ss, [
|
|
608
|
+
l("div", ws, [
|
|
609
609
|
d(Kt, { "z-index": 99 }, {
|
|
610
610
|
default: F(() => [
|
|
611
|
-
l("p",
|
|
611
|
+
l("p", Ds, U(e(w)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
612
612
|
]),
|
|
613
613
|
_: 1
|
|
614
614
|
})
|
|
@@ -620,25 +620,25 @@ const fs = {
|
|
|
620
620
|
onClick: o[0] || (o[0] = (x) => i.value = !1)
|
|
621
621
|
})
|
|
622
622
|
]),
|
|
623
|
-
d(
|
|
623
|
+
d(C, {
|
|
624
624
|
modelValue: b.value,
|
|
625
625
|
"onUpdate:modelValue": o[1] || (o[1] = (x) => b.value = x),
|
|
626
626
|
label: e(w)("inventory.transfer.form.items.forecastStock.days"),
|
|
627
|
-
rules: [e(
|
|
627
|
+
rules: [e(Ve)(1)]
|
|
628
628
|
}, {
|
|
629
629
|
"helper-text": F(() => [
|
|
630
|
-
l("div",
|
|
630
|
+
l("div", Fs, [
|
|
631
631
|
d(k, {
|
|
632
632
|
name: "warning",
|
|
633
633
|
size: "sm",
|
|
634
634
|
class: "text-fm-color-system-warning-300"
|
|
635
635
|
}),
|
|
636
|
-
l("div",
|
|
636
|
+
l("div", $s, U(e(w)("inventory.transfer.form.items.forecastStock.replace")), 1)
|
|
637
637
|
])
|
|
638
638
|
]),
|
|
639
639
|
_: 1
|
|
640
640
|
}, 8, ["modelValue", "label", "rules"]),
|
|
641
|
-
l("div",
|
|
641
|
+
l("div", Ts, [
|
|
642
642
|
o[4] || (o[4] = l("div", { class: "grow" }, null, -1)),
|
|
643
643
|
d(v, {
|
|
644
644
|
label: e(w)("common.cancel"),
|
|
@@ -657,33 +657,33 @@ const fs = {
|
|
|
657
657
|
};
|
|
658
658
|
}
|
|
659
659
|
});
|
|
660
|
-
function
|
|
661
|
-
const m = Ae(), y =
|
|
662
|
-
|
|
660
|
+
function Ps() {
|
|
661
|
+
const m = Ae(), y = it(), n = N(!1);
|
|
662
|
+
ge(n, (f) => {
|
|
663
663
|
f && (b.value = !0, i().finally(() => {
|
|
664
664
|
b.value = !1;
|
|
665
665
|
}));
|
|
666
666
|
});
|
|
667
667
|
async function i() {
|
|
668
668
|
try {
|
|
669
|
-
const { startDate: f, endDate:
|
|
669
|
+
const { startDate: f, endDate: _ } = kt(6), a = (await y.getPurchaseOrders({ start: f, end: _ })).filter(
|
|
670
670
|
(o) => {
|
|
671
671
|
var v, k;
|
|
672
|
-
return o.status ===
|
|
672
|
+
return o.status === Ct.enum.COMPLETE && ((v = o.supplier) == null ? void 0 : v.internal) !== "warehouse" && ((k = o.supplier) == null ? void 0 : k.internal) !== "restaurant";
|
|
673
673
|
}
|
|
674
674
|
).reduce((o, v) => {
|
|
675
|
-
const k = new Date(ht(v._id)),
|
|
676
|
-
for (const
|
|
677
|
-
if (!
|
|
678
|
-
const x = o[
|
|
675
|
+
const k = new Date(ht(v._id)), C = v.supplier._id;
|
|
676
|
+
for (const g of v.items) {
|
|
677
|
+
if (!g.totalCost) continue;
|
|
678
|
+
const x = o[g.sku._id] ?? {}, D = x[C] ?? [];
|
|
679
679
|
D.push({
|
|
680
680
|
date: k.toISOString(),
|
|
681
|
-
totalUnit:
|
|
682
|
-
totalCost:
|
|
683
|
-
unit:
|
|
684
|
-
measurement:
|
|
681
|
+
totalUnit: g.quantity,
|
|
682
|
+
totalCost: g.totalCost,
|
|
683
|
+
unit: g.sku.unit,
|
|
684
|
+
measurement: g.measurement,
|
|
685
685
|
seqNumber: v.seqNumber
|
|
686
|
-
}), x[
|
|
686
|
+
}), x[C] = D, o[g.sku._id] = x;
|
|
687
687
|
}
|
|
688
688
|
return o;
|
|
689
689
|
}, {});
|
|
@@ -702,7 +702,7 @@ function Ts() {
|
|
|
702
702
|
comparePriceBySku: t
|
|
703
703
|
};
|
|
704
704
|
}
|
|
705
|
-
const
|
|
705
|
+
const Is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Rs = { key: 0 }, Vs = ["colspan"], As = /* @__PURE__ */ pe({
|
|
706
706
|
__name: "TransferItemTable",
|
|
707
707
|
props: {
|
|
708
708
|
row: {},
|
|
@@ -715,27 +715,27 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
715
715
|
}
|
|
716
716
|
return (n, i) => {
|
|
717
717
|
var b, t;
|
|
718
|
-
return S(),
|
|
718
|
+
return S(), q(ke, null, [
|
|
719
719
|
l("tr", {
|
|
720
720
|
class: J(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
|
|
721
721
|
"bg-fm-color-neutral-gray-100": n.row.getIsSelected()
|
|
722
722
|
}])
|
|
723
723
|
}, [
|
|
724
|
-
(S(!0),
|
|
725
|
-
var
|
|
726
|
-
return S(),
|
|
724
|
+
(S(!0), q(ke, null, Me(n.row.getVisibleCells(), (f) => {
|
|
725
|
+
var _, w, u, a;
|
|
726
|
+
return S(), q("td", {
|
|
727
727
|
key: f.id,
|
|
728
728
|
class: J([
|
|
729
729
|
"h-[52px] px-16 text-fm-color-typo-primary",
|
|
730
|
-
((
|
|
730
|
+
((_ = y(f)) == null ? void 0 : _.cellClass) ?? "px-16"
|
|
731
731
|
]),
|
|
732
|
-
style:
|
|
732
|
+
style: lt({
|
|
733
733
|
width: (w = y(f)) == null ? void 0 : w.width,
|
|
734
734
|
maxWidth: (u = y(f)) == null ? void 0 : u.maxWidth,
|
|
735
735
|
textAlign: ((a = y(f)) == null ? void 0 : a.textAlign) ?? "left"
|
|
736
736
|
})
|
|
737
737
|
}, [
|
|
738
|
-
l("span",
|
|
738
|
+
l("span", Is, [
|
|
739
739
|
d(e(ie), {
|
|
740
740
|
render: f.column.columnDef.cell,
|
|
741
741
|
props: f.getContext()
|
|
@@ -744,11 +744,11 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
744
744
|
], 6);
|
|
745
745
|
}), 128))
|
|
746
746
|
], 2),
|
|
747
|
-
n.showComparePrice && Object.keys(n.comparePriceBySku[(b = n.row.original.sku) == null ? void 0 : b._id] ?? {}).length > 0 ? (S(),
|
|
747
|
+
n.showComparePrice && Object.keys(n.comparePriceBySku[(b = n.row.original.sku) == null ? void 0 : b._id] ?? {}).length > 0 ? (S(), q("tr", Rs, [
|
|
748
748
|
l("td", {
|
|
749
749
|
colspan: n.row.getVisibleCells().length
|
|
750
750
|
}, [
|
|
751
|
-
d(
|
|
751
|
+
d(ct, {
|
|
752
752
|
prices: n.comparePriceBySku[(t = n.row.original.sku) == null ? void 0 : t._id]
|
|
753
753
|
}, null, 8, ["prices"])
|
|
754
754
|
], 8, Vs)
|
|
@@ -756,13 +756,13 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
756
756
|
], 64);
|
|
757
757
|
};
|
|
758
758
|
}
|
|
759
|
-
}),
|
|
759
|
+
}), Es = {
|
|
760
760
|
key: 0,
|
|
761
761
|
class: "flex flex-col gap-8"
|
|
762
|
-
}, qs = { class: "flex flex-col gap-4" },
|
|
762
|
+
}, qs = { class: "flex flex-col gap-4" }, Us = { class: "flex items-center gap-4" }, Ms = {
|
|
763
763
|
key: 0,
|
|
764
764
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-error"
|
|
765
|
-
},
|
|
765
|
+
}, Os = /* @__PURE__ */ pe({
|
|
766
766
|
__name: "NetSuiteField",
|
|
767
767
|
props: {
|
|
768
768
|
required: { type: Boolean },
|
|
@@ -774,9 +774,9 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
774
774
|
},
|
|
775
775
|
emits: ["netsuite:ready"],
|
|
776
776
|
setup(m, { emit: y }) {
|
|
777
|
-
const n =
|
|
778
|
-
|
|
779
|
-
var o, v, k,
|
|
777
|
+
const n = ze(), i = m, b = y, { t } = Zt(), f = N(!1), _ = N();
|
|
778
|
+
Ne(() => {
|
|
779
|
+
var o, v, k, C;
|
|
780
780
|
let a = {
|
|
781
781
|
id: "",
|
|
782
782
|
subsidiary: { id: "", name: "" },
|
|
@@ -787,70 +787,70 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
787
787
|
return;
|
|
788
788
|
}
|
|
789
789
|
try {
|
|
790
|
-
const
|
|
790
|
+
const g = n.currentLocationSubsidiary();
|
|
791
791
|
i.setting ? a = {
|
|
792
792
|
...i.setting,
|
|
793
793
|
subsidiary: {
|
|
794
|
-
id:
|
|
795
|
-
name:
|
|
794
|
+
id: g.id || "",
|
|
795
|
+
name: g.name
|
|
796
796
|
}
|
|
797
797
|
} : a = {
|
|
798
798
|
...a,
|
|
799
799
|
subsidiary: {
|
|
800
|
-
id:
|
|
801
|
-
name:
|
|
800
|
+
id: g.id || "",
|
|
801
|
+
name: g.name
|
|
802
802
|
}
|
|
803
803
|
};
|
|
804
|
-
const x = n.getAvailableItems(
|
|
805
|
-
if (
|
|
804
|
+
const x = n.getAvailableItems(g.id), D = i.items.filter((R) => {
|
|
805
|
+
if (R.measurement != null) {
|
|
806
806
|
const z = n.getAvailableMeasurements(
|
|
807
|
-
|
|
808
|
-
|
|
807
|
+
R.sku._id,
|
|
808
|
+
g.id
|
|
809
809
|
);
|
|
810
|
-
return x.includes(
|
|
810
|
+
return x.includes(R.sku._id) && z.includes(R.measurement.id);
|
|
811
811
|
}
|
|
812
|
-
return x.includes(
|
|
813
|
-
}).map((
|
|
812
|
+
return x.includes(R.sku._id);
|
|
813
|
+
}).map((R) => R.sku._id);
|
|
814
814
|
i.onChange(
|
|
815
|
-
i.items.filter((
|
|
815
|
+
i.items.filter((R) => D.includes(R.sku._id)),
|
|
816
816
|
a
|
|
817
817
|
);
|
|
818
818
|
} finally {
|
|
819
|
-
i.supplier.internal ?
|
|
819
|
+
i.supplier.internal ? _.value = n.getNetSuiteLocation(
|
|
820
820
|
`${i.supplier.internal}_${i.supplier._id}`
|
|
821
|
-
) :
|
|
822
|
-
const
|
|
823
|
-
!n.isEnabled ||
|
|
821
|
+
) : _.value = n.getNetSuiteVendor(i.supplier._id);
|
|
822
|
+
const g = i.supplier.internal ? n.getLocationSubsidiary((o = _.value) == null ? void 0 : o.netSuiteId).id : (v = _.value) == null ? void 0 : v.subsidiaryId, x = i.supplier.internal ? (k = n.currentLocationSubsidiary()) == null ? void 0 : k.id : (C = n.currentVendorSubsidiary(i.supplier._id)) == null ? void 0 : C.id;
|
|
823
|
+
!n.isEnabled || g && n.isEnabled && g == x ? b("netsuite:ready", a) : f.value = !0;
|
|
824
824
|
}
|
|
825
825
|
});
|
|
826
|
-
const w =
|
|
826
|
+
const w = E(
|
|
827
827
|
() => i.supplier.internal ? n.currentLocationSubsidiary() : n.currentVendorSubsidiary(i.supplier._id)
|
|
828
|
-
), u =
|
|
828
|
+
), u = E(() => {
|
|
829
829
|
var a, o;
|
|
830
|
-
return
|
|
831
|
-
location is ${(o = n.getLocationSubsidiary((a =
|
|
830
|
+
return _.value == null ? `Cannot find the NetSuite location for "${i.supplier.name}"` : `The subsidiary of the request
|
|
831
|
+
location is ${(o = n.getLocationSubsidiary((a = _.value) == null ? void 0 : a.netSuiteId)) == null ? void 0 : o.fullName}`;
|
|
832
832
|
});
|
|
833
833
|
return (a, o) => {
|
|
834
|
-
const v = P("FmLabel"), k = P("FmIcon"),
|
|
835
|
-
return e(n).isEnabled && i.required ? (S(),
|
|
834
|
+
const v = P("FmLabel"), k = P("FmIcon"), C = P("FmField"), g = P("FmTooltip");
|
|
835
|
+
return e(n).isEnabled && i.required ? (S(), q("div", Es, [
|
|
836
836
|
d(v, {
|
|
837
837
|
label: `NetSuite ${e(t)("inventory.transfer.form.netsuite.subsidiary")}`
|
|
838
838
|
}, null, 8, ["label"]),
|
|
839
839
|
l("div", qs, [
|
|
840
|
-
d(
|
|
840
|
+
d(g, {
|
|
841
841
|
"z-index": 51,
|
|
842
842
|
placement: "left",
|
|
843
843
|
disabled: a.disabled
|
|
844
844
|
}, {
|
|
845
845
|
content: F(() => o[0] || (o[0] = [
|
|
846
|
-
|
|
846
|
+
Oe("This field is locked and based on the location of the request.")
|
|
847
847
|
])),
|
|
848
848
|
default: F(() => [
|
|
849
|
-
d(
|
|
849
|
+
d(C, null, {
|
|
850
850
|
default: F(() => {
|
|
851
851
|
var x;
|
|
852
852
|
return [
|
|
853
|
-
l("div",
|
|
853
|
+
l("div", Us, [
|
|
854
854
|
d(k, {
|
|
855
855
|
name: "lock_outline",
|
|
856
856
|
size: "sm",
|
|
@@ -867,21 +867,21 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
867
867
|
]),
|
|
868
868
|
_: 1
|
|
869
869
|
}, 8, ["disabled"]),
|
|
870
|
-
f.value ? (S(),
|
|
870
|
+
f.value ? (S(), q("div", Ms, U(u.value), 1)) : G("", !0)
|
|
871
871
|
])
|
|
872
872
|
])) : G("", !0);
|
|
873
873
|
};
|
|
874
874
|
}
|
|
875
|
-
}),
|
|
875
|
+
}), Bs = { class: "flex flex-col gap-4" }, Ns = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, zs = { class: "flex flex-col gap-16" }, Ls = { class: "flex flex-col gap-24" }, Hs = { class: "flex flex-col gap-8" }, js = { class: "flex flex-col gap-4" }, Ys = { class: "flex items-center gap-4" }, Qs = { class: "flex flex-col gap-8" }, Ks = { class: "flex flex-col gap-4" }, Zs = { class: "flex items-center gap-4" }, Gs = {
|
|
876
876
|
key: 3,
|
|
877
877
|
class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col"
|
|
878
|
-
},
|
|
878
|
+
}, Ws = {
|
|
879
879
|
key: 0,
|
|
880
880
|
class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
|
|
881
|
-
},
|
|
881
|
+
}, Js = { class: "flex-1" }, Xs = { class: "flex-1" }, ea = {
|
|
882
882
|
key: 1,
|
|
883
883
|
class: "flex items-center gap-4"
|
|
884
|
-
},
|
|
884
|
+
}, ta = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, sa = { class: "flex flex-col gap-16" }, aa = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, oa = { class: "flex gap-8" }, la = { key: 0 }, na = /* @__PURE__ */ pe({
|
|
885
885
|
__name: "TransferForm2",
|
|
886
886
|
props: {
|
|
887
887
|
modelValue: {},
|
|
@@ -893,100 +893,100 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
893
893
|
},
|
|
894
894
|
emits: ["validation-success", "form:ready"],
|
|
895
895
|
setup(m, { expose: y, emit: n }) {
|
|
896
|
-
const i = m, b = n, t =
|
|
896
|
+
const i = m, b = n, t = xt(), { t: f } = Ce(), _ = Ye(), w = je(), u = ze(), a = Ke(), o = Ee(), v = dt(), { breakpoints: k } = Qe(), C = E(() => k.value.xs || k.value.sm), g = ot({
|
|
897
897
|
value: !1
|
|
898
|
-
}), x = N(!1), D =
|
|
898
|
+
}), x = N(!1), D = E(
|
|
899
899
|
() => {
|
|
900
900
|
var s;
|
|
901
901
|
return ((s = i.modelValue) == null ? void 0 : s.templateDoc) ?? v.templates.find((r) => r._id === t.template);
|
|
902
902
|
}
|
|
903
|
-
),
|
|
904
|
-
|
|
905
|
-
s &&
|
|
906
|
-
}),
|
|
903
|
+
), R = E(() => t.status === "DRAFT" || !t._rev);
|
|
904
|
+
ge(D, (s) => {
|
|
905
|
+
s && R.value && (t.supplier = (s == null ? void 0 : s.purchaseOrder.supplier) ?? t.supplier);
|
|
906
|
+
}), Ne(() => {
|
|
907
907
|
var s;
|
|
908
908
|
try {
|
|
909
909
|
if (!t.template) return;
|
|
910
910
|
if (!t.items.length) {
|
|
911
911
|
let r = [];
|
|
912
|
-
(s = D.value) != null && s.purchaseOrder.items && (r = D.value.purchaseOrder.items.filter((
|
|
912
|
+
(s = D.value) != null && s.purchaseOrder.items && (r = D.value.purchaseOrder.items.filter((M) => {
|
|
913
913
|
var Z;
|
|
914
|
-
return ((Z =
|
|
914
|
+
return ((Z = M.quantity) == null ? void 0 : Z.amount) != 0;
|
|
915
915
|
})), t.items = r;
|
|
916
916
|
}
|
|
917
917
|
} finally {
|
|
918
918
|
x.value = !0;
|
|
919
919
|
}
|
|
920
|
-
}),
|
|
920
|
+
}), ge([x, g], ([s, r], [M, Z]) => {
|
|
921
921
|
r.value && Z.value && b("form:ready");
|
|
922
922
|
});
|
|
923
|
-
const z =
|
|
924
|
-
() =>
|
|
923
|
+
const z = E(
|
|
924
|
+
() => _.currentLocation.type === St.restaurant
|
|
925
925
|
);
|
|
926
|
-
|
|
926
|
+
_.watchLocation(async () => {
|
|
927
927
|
location && (t.supplier || (t.supplier = a.suppliers.find((s) => s) ?? t.supplier));
|
|
928
928
|
});
|
|
929
|
-
const ue =
|
|
929
|
+
const ue = Nt(), T = Yt(
|
|
930
930
|
() => t,
|
|
931
931
|
(s) => {
|
|
932
932
|
Object.assign(t, s);
|
|
933
933
|
},
|
|
934
934
|
!0,
|
|
935
935
|
!0
|
|
936
|
-
), $ =
|
|
936
|
+
), $ = E({
|
|
937
937
|
get() {
|
|
938
938
|
var s;
|
|
939
939
|
return typeof ((s = t == null ? void 0 : t.supplier) == null ? void 0 : s.internal) == "string" ? j.TRANSFER : j.PURCHASE;
|
|
940
940
|
},
|
|
941
941
|
set(s) {
|
|
942
|
-
var
|
|
943
|
-
const r = typeof ((
|
|
942
|
+
var M;
|
|
943
|
+
const r = typeof ((M = t == null ? void 0 : t.supplier) == null ? void 0 : M.internal) == "string" ? j.TRANSFER : j.PURCHASE;
|
|
944
944
|
s !== r && (t.supplier = s === j.PURCHASE ? T.locationOptionsTypePurchase.value[0] : T.locationOptionsTypeTransfer.value[0]);
|
|
945
945
|
}
|
|
946
946
|
});
|
|
947
|
-
|
|
947
|
+
ge(
|
|
948
948
|
() => {
|
|
949
949
|
var s;
|
|
950
950
|
return (s = i.modelValue) == null ? void 0 : s.template;
|
|
951
951
|
},
|
|
952
952
|
(s) => {
|
|
953
|
-
o.mustUsePoTemplate && !s &&
|
|
954
|
-
var r,
|
|
955
|
-
t.supplier = ((
|
|
953
|
+
o.mustUsePoTemplate && !s && mt(() => {
|
|
954
|
+
var r, M;
|
|
955
|
+
t.supplier = ((M = (r = T.locationOptionsTypeTransfer.value) == null ? void 0 : r.filter(
|
|
956
956
|
(Z) => Z.internal === "restaurant"
|
|
957
|
-
)) == null ? void 0 :
|
|
957
|
+
)) == null ? void 0 : M[0]) ?? t.supplier;
|
|
958
958
|
});
|
|
959
959
|
},
|
|
960
960
|
{ immediate: !0 }
|
|
961
961
|
);
|
|
962
|
-
const O =
|
|
962
|
+
const O = E(() => {
|
|
963
963
|
let s = T.transferLocationOptions.value;
|
|
964
964
|
return o.mustUsePoTemplate && !t.template && (s = s.filter((r) => {
|
|
965
|
-
var
|
|
966
|
-
return (
|
|
965
|
+
var M;
|
|
966
|
+
return (M = r.sublabel) == null ? void 0 : M.startsWith("restaurant");
|
|
967
967
|
})), s;
|
|
968
|
-
}),
|
|
968
|
+
}), V = E({
|
|
969
969
|
get() {
|
|
970
970
|
return t.supplier._id;
|
|
971
971
|
},
|
|
972
972
|
set(s) {
|
|
973
973
|
T.transferLocationModel.value = s;
|
|
974
974
|
}
|
|
975
|
-
}), I =
|
|
975
|
+
}), I = E({
|
|
976
976
|
get() {
|
|
977
977
|
return t.remark ?? void 0;
|
|
978
978
|
},
|
|
979
979
|
set(s) {
|
|
980
980
|
t.remark = s;
|
|
981
981
|
}
|
|
982
|
-
}), { backdatePo: B, backdateSwitch:
|
|
982
|
+
}), { backdatePo: B, backdateSwitch: Q, backdateModel: K, backdateTimeModel: p } = fs({
|
|
983
983
|
getEffectiveAt() {
|
|
984
984
|
return t.effectiveAt;
|
|
985
985
|
},
|
|
986
986
|
setEffectiveAt(s) {
|
|
987
987
|
t.effectiveAt = s;
|
|
988
988
|
}
|
|
989
|
-
}), { comparePricesToggle: c, comparePriceFetching: H, comparePriceBySku: oe } =
|
|
989
|
+
}), { comparePricesToggle: c, comparePriceFetching: H, comparePriceBySku: oe } = Ps(), X = N();
|
|
990
990
|
y({
|
|
991
991
|
validateInputs: () => {
|
|
992
992
|
var s, r;
|
|
@@ -1001,7 +1001,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1001
1001
|
(r = (s = X.value) == null ? void 0 : s.resetInputs) == null || r.call(s);
|
|
1002
1002
|
}
|
|
1003
1003
|
});
|
|
1004
|
-
const $e =
|
|
1004
|
+
const $e = Gt({
|
|
1005
1005
|
updateItem: (s) => {
|
|
1006
1006
|
t.items = t.items.map((r) => r.sku._id !== s.sku._id ? r : s);
|
|
1007
1007
|
},
|
|
@@ -1023,13 +1023,13 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1023
1023
|
get disabled() {
|
|
1024
1024
|
return i.disabled;
|
|
1025
1025
|
}
|
|
1026
|
-
}),
|
|
1026
|
+
}), he = E(() => {
|
|
1027
1027
|
let s = $e.columnDefs.value;
|
|
1028
1028
|
return u.isEnabled && $.value === j.TRANSFER && (s = s.filter((r) => r.id !== Y.TotalCost)), s;
|
|
1029
1029
|
});
|
|
1030
1030
|
function Te() {
|
|
1031
1031
|
var ae, fe, xe, Ie, we;
|
|
1032
|
-
const s = new Set((xe = (fe = (ae = D.value) == null ? void 0 : ae.purchaseOrder) == null ? void 0 : fe.items) == null ? void 0 : xe.map((A) => A.sku._id)), r = u.isEnabled ? u.getAvailableItems((we = (Ie = t.netSuite) == null ? void 0 : Ie.subsidiary) == null ? void 0 : we.id) : [],
|
|
1032
|
+
const s = new Set((xe = (fe = (ae = D.value) == null ? void 0 : ae.purchaseOrder) == null ? void 0 : fe.items) == null ? void 0 : xe.map((A) => A.sku._id)), r = u.isEnabled ? u.getAvailableItems((we = (Ie = t.netSuite) == null ? void 0 : Ie.subsidiary) == null ? void 0 : we.id) : [], M = s.size ? w.skus.filter((A) => s.has(A._id)) : w.skus, Z = u.isEnabled ? M.filter((A) => {
|
|
1033
1033
|
var le, te, ce, ne;
|
|
1034
1034
|
const ee = (te = (le = D.value) == null ? void 0 : le.purchaseOrder) == null ? void 0 : te.items.find(
|
|
1035
1035
|
(me) => me.sku._id === A._id
|
|
@@ -1042,7 +1042,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1042
1042
|
return r.includes(ee.sku._id) && me.includes(ee.measurement.id);
|
|
1043
1043
|
}
|
|
1044
1044
|
return r.includes(A._id);
|
|
1045
|
-
}).map((A) => A._id) :
|
|
1045
|
+
}).map((A) => A._id) : M.map((A) => A._id), de = M.map(
|
|
1046
1046
|
(A) => ({
|
|
1047
1047
|
label: A.name,
|
|
1048
1048
|
sublabel: A.code,
|
|
@@ -1056,7 +1056,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1056
1056
|
ue.open({
|
|
1057
1057
|
title: f("inventory.transfer.form.items.selectItem"),
|
|
1058
1058
|
closeButton: !0,
|
|
1059
|
-
contentComponent:
|
|
1059
|
+
contentComponent: $t,
|
|
1060
1060
|
contentComponentProps: {
|
|
1061
1061
|
modelValue: be,
|
|
1062
1062
|
items: de,
|
|
@@ -1074,11 +1074,11 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1074
1074
|
}).onPrimary((A) => {
|
|
1075
1075
|
const ee = t.items ?? [], le = A.map((te) => {
|
|
1076
1076
|
var me, De;
|
|
1077
|
-
const ce = ee.find((
|
|
1077
|
+
const ce = ee.find((_e) => _e.sku._id === te._id);
|
|
1078
1078
|
if (ce)
|
|
1079
1079
|
return ce;
|
|
1080
1080
|
const ne = ((De = (me = D.value) == null ? void 0 : me.purchaseOrder.items) == null ? void 0 : De.find(
|
|
1081
|
-
(
|
|
1081
|
+
(_e) => _e.sku._id === te._id
|
|
1082
1082
|
)) ?? {
|
|
1083
1083
|
sku: te,
|
|
1084
1084
|
code: te.code,
|
|
@@ -1100,10 +1100,10 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1100
1100
|
le.sort((te, ce) => te.sku.code.localeCompare(ce.sku.code)), t.items = le;
|
|
1101
1101
|
});
|
|
1102
1102
|
}
|
|
1103
|
-
function
|
|
1103
|
+
function qe(s) {
|
|
1104
1104
|
return s;
|
|
1105
1105
|
}
|
|
1106
|
-
const Pe =
|
|
1106
|
+
const Pe = E(() => {
|
|
1107
1107
|
const s = [];
|
|
1108
1108
|
return (!o.mustUsePoTemplate || o.mustUsePoTemplate && t.template) && s.push({
|
|
1109
1109
|
label: f("inventory.transfer.form.type.purchase"),
|
|
@@ -1115,24 +1115,24 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1115
1115
|
});
|
|
1116
1116
|
return (s, r) => {
|
|
1117
1117
|
var me, De;
|
|
1118
|
-
const
|
|
1119
|
-
return S(),
|
|
1120
|
-
l("div",
|
|
1121
|
-
(me = i.modelValue) != null && me.template ? (S(), W(
|
|
1118
|
+
const M = P("FmChip"), Z = P("FmLabel"), de = P("FmIcon"), be = P("FmField"), ae = P("FmTooltip"), fe = P("FmSelect"), xe = P("FmTextField"), Ie = P("FmTextarea"), we = P("FmSwitch"), A = P("FmDatePicker"), ee = P("FmTimePicker"), le = P("FmFormGroup"), te = P("FmButton"), ce = P("FmTable"), ne = P("FmForm");
|
|
1119
|
+
return S(), q("div", Bs, [
|
|
1120
|
+
l("div", Ns, [
|
|
1121
|
+
(me = i.modelValue) != null && me.template ? (S(), W(M, {
|
|
1122
1122
|
key: 0,
|
|
1123
1123
|
variant: s.disabled ? "warning" : void 0,
|
|
1124
1124
|
label: `${e(f)("inventory.transfer.template.title")}: ${((De = D.value) == null ? void 0 : De.name) ?? e(f)("inventory.transfer.form.loading")}`,
|
|
1125
1125
|
icon: "summarize",
|
|
1126
1126
|
compact: ""
|
|
1127
1127
|
}, null, 8, ["variant", "label"])) : G("", !0),
|
|
1128
|
-
d(
|
|
1129
|
-
label: e(
|
|
1128
|
+
d(M, {
|
|
1129
|
+
label: e(_).currentLocation.name,
|
|
1130
1130
|
icon: "storefront",
|
|
1131
1131
|
compact: ""
|
|
1132
1132
|
}, null, 8, ["label"]),
|
|
1133
|
-
s.lastClosingDate ? (S(), W(
|
|
1133
|
+
s.lastClosingDate ? (S(), W(M, {
|
|
1134
1134
|
key: 1,
|
|
1135
|
-
label: `${e(f)("inventory.transfer.form.lastClosing")}: ${e(
|
|
1135
|
+
label: `${e(f)("inventory.transfer.form.lastClosing")}: ${e(He)(s.lastClosingDate)} ${e(wt)(s.lastClosingDate)}`,
|
|
1136
1136
|
icon: "calendar_month",
|
|
1137
1137
|
compact: ""
|
|
1138
1138
|
}, null, 8, ["label"])) : G("", !0)
|
|
@@ -1143,31 +1143,31 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1143
1143
|
class: "flex flex-col gap-32",
|
|
1144
1144
|
disabled: s.disabled,
|
|
1145
1145
|
onValidationFailed: console.log,
|
|
1146
|
-
onValidationSuccess: r[13] || (r[13] = (
|
|
1146
|
+
onValidationSuccess: r[13] || (r[13] = (_e) => b("validation-success"))
|
|
1147
1147
|
}, {
|
|
1148
1148
|
default: F(() => {
|
|
1149
|
-
var
|
|
1149
|
+
var _e, Ze;
|
|
1150
1150
|
return [
|
|
1151
|
-
l("div",
|
|
1152
|
-
l("div",
|
|
1153
|
-
(
|
|
1154
|
-
l("div",
|
|
1151
|
+
l("div", zs, [
|
|
1152
|
+
l("div", Ls, [
|
|
1153
|
+
(_e = i.modelValue) != null && _e.template ? (S(), q(ke, { key: 0 }, [
|
|
1154
|
+
l("div", Hs, [
|
|
1155
1155
|
d(Z, {
|
|
1156
1156
|
label: e(f)("inventory.transfer.form.type.title")
|
|
1157
1157
|
}, null, 8, ["label"]),
|
|
1158
|
-
l("div",
|
|
1158
|
+
l("div", js, [
|
|
1159
1159
|
d(ae, {
|
|
1160
1160
|
"z-index": 51,
|
|
1161
1161
|
placement: "left",
|
|
1162
1162
|
disabled: s.disabled
|
|
1163
1163
|
}, {
|
|
1164
1164
|
content: F(() => r[14] || (r[14] = [
|
|
1165
|
-
|
|
1165
|
+
Oe("This field is locked from template.")
|
|
1166
1166
|
])),
|
|
1167
1167
|
default: F(() => [
|
|
1168
1168
|
d(be, null, {
|
|
1169
1169
|
default: F(() => [
|
|
1170
|
-
l("div",
|
|
1170
|
+
l("div", Ys, [
|
|
1171
1171
|
d(de, {
|
|
1172
1172
|
name: "lock_outline",
|
|
1173
1173
|
size: "sm",
|
|
@@ -1191,7 +1191,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1191
1191
|
}, null, 2)
|
|
1192
1192
|
])
|
|
1193
1193
|
]),
|
|
1194
|
-
l("div",
|
|
1194
|
+
l("div", Qs, [
|
|
1195
1195
|
d(Z, {
|
|
1196
1196
|
label: $.value === e(j).PURCHASE ? e(f)("inventory.transfer.form.purchaseFrom") : e(f)("inventory.transfer.form.transferFrom")
|
|
1197
1197
|
}, null, 8, ["label"]),
|
|
@@ -1202,14 +1202,14 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1202
1202
|
disabled: s.disabled
|
|
1203
1203
|
}, {
|
|
1204
1204
|
content: F(() => r[15] || (r[15] = [
|
|
1205
|
-
|
|
1205
|
+
Oe("This field is locked from template.")
|
|
1206
1206
|
])),
|
|
1207
1207
|
default: F(() => [
|
|
1208
1208
|
d(be, null, {
|
|
1209
1209
|
default: F(() => {
|
|
1210
|
-
var
|
|
1210
|
+
var h;
|
|
1211
1211
|
return [
|
|
1212
|
-
l("div",
|
|
1212
|
+
l("div", Zs, [
|
|
1213
1213
|
d(de, {
|
|
1214
1214
|
name: "lock_outline",
|
|
1215
1215
|
size: "sm",
|
|
@@ -1217,7 +1217,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1217
1217
|
}, null, 8, ["color"]),
|
|
1218
1218
|
l("div", {
|
|
1219
1219
|
class: J({ "text-fm-color-typo-disabled": s.disabled })
|
|
1220
|
-
}, U((
|
|
1220
|
+
}, U((h = O.value.find((se) => se.value === V.value)) == null ? void 0 : h.label), 3)
|
|
1221
1221
|
])
|
|
1222
1222
|
];
|
|
1223
1223
|
}),
|
|
@@ -1228,14 +1228,14 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1228
1228
|
}, 8, ["disabled"])
|
|
1229
1229
|
])
|
|
1230
1230
|
])
|
|
1231
|
-
], 64)) : (S(),
|
|
1231
|
+
], 64)) : (S(), q(ke, { key: 1 }, [
|
|
1232
1232
|
d(fe, {
|
|
1233
1233
|
label: e(f)("inventory.transfer.form.type.title"),
|
|
1234
1234
|
"label-mark": "required",
|
|
1235
1235
|
modelValue: $.value,
|
|
1236
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
1236
|
+
"onUpdate:modelValue": r[0] || (r[0] = (h) => $.value = h),
|
|
1237
1237
|
items: Pe.value,
|
|
1238
|
-
rules: [e(
|
|
1238
|
+
rules: [e(Ve)(1)(O.value)]
|
|
1239
1239
|
}, {
|
|
1240
1240
|
default: F(() => [
|
|
1241
1241
|
l("span", {
|
|
@@ -1243,35 +1243,35 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1243
1243
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
1244
1244
|
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
1245
1245
|
])
|
|
1246
|
-
}, U(e(
|
|
1246
|
+
}, U(e(Dt)($.value)), 3)
|
|
1247
1247
|
]),
|
|
1248
1248
|
_: 1
|
|
1249
1249
|
}, 8, ["label", "modelValue", "items", "rules"]),
|
|
1250
1250
|
d(fe, {
|
|
1251
1251
|
label: $.value === e(j).PURCHASE ? e(f)("inventory.transfer.form.purchaseFrom") : e(f)("inventory.transfer.form.transferFrom"),
|
|
1252
1252
|
"label-mark": "required",
|
|
1253
|
-
modelValue:
|
|
1254
|
-
"onUpdate:modelValue": r[1] || (r[1] = (
|
|
1253
|
+
modelValue: V.value,
|
|
1254
|
+
"onUpdate:modelValue": r[1] || (r[1] = (h) => V.value = h),
|
|
1255
1255
|
items: O.value
|
|
1256
1256
|
}, {
|
|
1257
|
-
"menu-wrapper": F((
|
|
1258
|
-
var se,
|
|
1257
|
+
"menu-wrapper": F((h) => {
|
|
1258
|
+
var se, Ge;
|
|
1259
1259
|
return [
|
|
1260
|
-
d(
|
|
1260
|
+
d(Qt, Be(h, {
|
|
1261
1261
|
items: O.value,
|
|
1262
|
-
"model-value": (
|
|
1262
|
+
"model-value": (Ge = (se = s.modelValue) == null ? void 0 : se.supplier) == null ? void 0 : Ge._id
|
|
1263
1263
|
}), null, 16, ["items", "model-value"])
|
|
1264
1264
|
];
|
|
1265
1265
|
}),
|
|
1266
1266
|
default: F(() => {
|
|
1267
|
-
var
|
|
1267
|
+
var h;
|
|
1268
1268
|
return [
|
|
1269
1269
|
l("span", {
|
|
1270
1270
|
class: J([
|
|
1271
1271
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
1272
1272
|
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
1273
1273
|
])
|
|
1274
|
-
}, U((
|
|
1274
|
+
}, U((h = O.value.find((se) => se.value === V.value)) == null ? void 0 : h.label), 3)
|
|
1275
1275
|
];
|
|
1276
1276
|
}),
|
|
1277
1277
|
_: 1
|
|
@@ -1281,61 +1281,61 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1281
1281
|
label: e(f)("inventory.transfer.form.reference"),
|
|
1282
1282
|
"label-mark": "optional",
|
|
1283
1283
|
modelValue: e(t).ref,
|
|
1284
|
-
"onUpdate:modelValue": r[2] || (r[2] = (
|
|
1284
|
+
"onUpdate:modelValue": r[2] || (r[2] = (h) => e(t).ref = h)
|
|
1285
1285
|
}, null, 8, ["label", "modelValue"]),
|
|
1286
1286
|
d(Ie, {
|
|
1287
1287
|
label: e(f)("inventory.transfer.form.remark"),
|
|
1288
1288
|
"label-mark": "optional",
|
|
1289
1289
|
"max-length": 240,
|
|
1290
1290
|
modelValue: I.value,
|
|
1291
|
-
"onUpdate:modelValue": r[3] || (r[3] = (
|
|
1291
|
+
"onUpdate:modelValue": r[3] || (r[3] = (h) => I.value = h),
|
|
1292
1292
|
class: J([s.disabled ? "text-fm-color-typo-disabled " : ""])
|
|
1293
1293
|
}, null, 8, ["label", "modelValue", "class"]),
|
|
1294
|
-
x.value ? (S(), W(
|
|
1294
|
+
x.value ? (S(), W(Os, {
|
|
1295
1295
|
key: 2,
|
|
1296
1296
|
required: e(t).template != null,
|
|
1297
1297
|
disabled: s.disabled,
|
|
1298
1298
|
supplier: e(t).supplier,
|
|
1299
1299
|
setting: e(t).netSuite,
|
|
1300
1300
|
items: e(t).items,
|
|
1301
|
-
onChange: (
|
|
1302
|
-
e(t).items =
|
|
1301
|
+
onChange: (h, se) => {
|
|
1302
|
+
e(t).items = h, e(t).netSuite = se;
|
|
1303
1303
|
},
|
|
1304
|
-
"onNetsuite:ready": r[4] || (r[4] = (
|
|
1305
|
-
|
|
1304
|
+
"onNetsuite:ready": r[4] || (r[4] = (h) => {
|
|
1305
|
+
g.value = !0;
|
|
1306
1306
|
})
|
|
1307
1307
|
}, null, 8, ["required", "disabled", "supplier", "setting", "items", "onChange"])) : G("", !0),
|
|
1308
|
-
e(o).enableBackdatePo ? (S(),
|
|
1308
|
+
e(o).enableBackdatePo ? (S(), q("div", Gs, [
|
|
1309
1309
|
l("div", {
|
|
1310
1310
|
class: J([
|
|
1311
1311
|
"flex",
|
|
1312
1312
|
{
|
|
1313
|
-
"flex-col":
|
|
1313
|
+
"flex-col": C.value
|
|
1314
1314
|
}
|
|
1315
1315
|
])
|
|
1316
1316
|
}, [
|
|
1317
1317
|
d(we, {
|
|
1318
|
-
modelValue: e(
|
|
1319
|
-
"onUpdate:modelValue": r[5] || (r[5] = (
|
|
1318
|
+
modelValue: e(Q),
|
|
1319
|
+
"onUpdate:modelValue": r[5] || (r[5] = (h) => Se(Q) ? Q.value = h : null),
|
|
1320
1320
|
label: e(f)("inventory.transfer.form.backdate.title"),
|
|
1321
1321
|
sublabel: e(f)("inventory.transfer.form.backdate.subtitle"),
|
|
1322
1322
|
"label-placement": "right",
|
|
1323
1323
|
disabled: z.value && !s.lastClosingDate || s.disabled
|
|
1324
1324
|
}, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
|
|
1325
1325
|
l("div", {
|
|
1326
|
-
class: J({ hidden:
|
|
1326
|
+
class: J({ hidden: C.value, "w-16": !C.value })
|
|
1327
1327
|
}, null, 2),
|
|
1328
|
-
e(
|
|
1329
|
-
l("div",
|
|
1328
|
+
e(Q) ? (S(), q("div", Ws, [
|
|
1329
|
+
l("div", Js, [
|
|
1330
1330
|
d(A, {
|
|
1331
|
-
modelValue: e(
|
|
1332
|
-
"onUpdate:modelValue": r[6] || (r[6] = (
|
|
1331
|
+
modelValue: e(K),
|
|
1332
|
+
"onUpdate:modelValue": r[6] || (r[6] = (h) => Se(K) ? K.value = h : null)
|
|
1333
1333
|
}, null, 8, ["modelValue"])
|
|
1334
1334
|
]),
|
|
1335
|
-
l("div",
|
|
1335
|
+
l("div", Xs, [
|
|
1336
1336
|
d(ee, {
|
|
1337
1337
|
modelValue: e(p),
|
|
1338
|
-
"onUpdate:modelValue": r[7] || (r[7] = (
|
|
1338
|
+
"onUpdate:modelValue": r[7] || (r[7] = (h) => Se(p) ? p.value = h : null)
|
|
1339
1339
|
}, null, 8, ["modelValue"])
|
|
1340
1340
|
])
|
|
1341
1341
|
])) : G("", !0)
|
|
@@ -1343,36 +1343,36 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1343
1343
|
e(B) ? (S(), W(le, {
|
|
1344
1344
|
key: 0,
|
|
1345
1345
|
modelValue: e(B),
|
|
1346
|
-
"onUpdate:modelValue": r[8] || (r[8] = (
|
|
1347
|
-
rules: [e(
|
|
1346
|
+
"onUpdate:modelValue": r[8] || (r[8] = (h) => Se(B) ? B.value = h : null),
|
|
1347
|
+
rules: [e(Ft)(new Date(s.lastClosingDate), /* @__PURE__ */ new Date())]
|
|
1348
1348
|
}, null, 8, ["modelValue", "rules"])) : G("", !0),
|
|
1349
|
-
z.value && !s.lastClosingDate ? (S(),
|
|
1349
|
+
z.value && !s.lastClosingDate ? (S(), q("div", ea, [
|
|
1350
1350
|
d(de, {
|
|
1351
1351
|
name: "error",
|
|
1352
1352
|
size: "sm",
|
|
1353
1353
|
class: "text-fm-color-typo-warning"
|
|
1354
1354
|
}),
|
|
1355
|
-
l("span",
|
|
1355
|
+
l("span", ta, U(e(f)("inventory.transfer.form.backdate.error")), 1)
|
|
1356
1356
|
])) : G("", !0)
|
|
1357
1357
|
])) : G("", !0)
|
|
1358
1358
|
])
|
|
1359
1359
|
]),
|
|
1360
|
-
l("div",
|
|
1360
|
+
l("div", sa, [
|
|
1361
1361
|
d(le, {
|
|
1362
1362
|
"model-value": e(t).items,
|
|
1363
|
-
rules: [e(
|
|
1363
|
+
rules: [e(Ve)(1)]
|
|
1364
1364
|
}, null, 8, ["model-value", "rules"]),
|
|
1365
1365
|
l("div", {
|
|
1366
1366
|
class: J([
|
|
1367
1367
|
"flex gap-16",
|
|
1368
1368
|
{
|
|
1369
|
-
"flex-col items-start":
|
|
1370
|
-
"items-center": !
|
|
1369
|
+
"flex-col items-start": C.value,
|
|
1370
|
+
"items-center": !C.value
|
|
1371
1371
|
}
|
|
1372
1372
|
])
|
|
1373
1373
|
}, [
|
|
1374
|
-
l("div",
|
|
1375
|
-
l("div",
|
|
1374
|
+
l("div", aa, U(e(f)("inventory.transfer.form.items.title")), 1),
|
|
1375
|
+
l("div", oa, [
|
|
1376
1376
|
d(te, {
|
|
1377
1377
|
disabled: s.disabled,
|
|
1378
1378
|
label: e(f)("inventory.transfer.form.items.addItem"),
|
|
@@ -1381,7 +1381,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1381
1381
|
"text-color": "primary",
|
|
1382
1382
|
"bg-color": "transparent",
|
|
1383
1383
|
"border-color": "primary",
|
|
1384
|
-
onClick: r[9] || (r[9] = (
|
|
1384
|
+
onClick: r[9] || (r[9] = (h) => Te()),
|
|
1385
1385
|
size: "md"
|
|
1386
1386
|
}, null, 8, ["disabled", "label"]),
|
|
1387
1387
|
e(t).template ? (S(), W(ae, {
|
|
@@ -1392,53 +1392,53 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1392
1392
|
l("div", null, U(e(f)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
|
|
1393
1393
|
]),
|
|
1394
1394
|
default: F(() => [
|
|
1395
|
-
d(
|
|
1396
|
-
"onUpdate:poItems": r[10] || (r[10] = (
|
|
1395
|
+
d(st, {
|
|
1396
|
+
"onUpdate:poItems": r[10] || (r[10] = (h) => e(t).items = h),
|
|
1397
1397
|
disabled: ""
|
|
1398
1398
|
})
|
|
1399
1399
|
]),
|
|
1400
1400
|
_: 1
|
|
1401
|
-
})) : (S(), W(
|
|
1401
|
+
})) : (S(), W(st, {
|
|
1402
1402
|
key: 1,
|
|
1403
|
-
"onUpdate:poItems": r[11] || (r[11] = (
|
|
1403
|
+
"onUpdate:poItems": r[11] || (r[11] = (h) => e(t).items = h),
|
|
1404
1404
|
disabled: s.disabled || !!e(t).template
|
|
1405
1405
|
}, null, 8, ["disabled"]))
|
|
1406
1406
|
])
|
|
1407
1407
|
], 2),
|
|
1408
|
-
$.value === e(j).PURCHASE &&
|
|
1408
|
+
$.value === e(j).PURCHASE && R.value && e(o).enableTotalCost && ((Ze = s.modelValue) != null && Ze.items.length) ? (S(), q("div", la, [
|
|
1409
1409
|
d(we, {
|
|
1410
1410
|
label: e(H) ? e(f)("inventory.transfer.form.items.fetchingData") : e(f)("inventory.transfer.form.items.comparePriceHistory"),
|
|
1411
1411
|
"prepend-icon": "compare_arrows",
|
|
1412
1412
|
"label-placement": "right",
|
|
1413
1413
|
"model-value": e(c),
|
|
1414
|
-
"onUpdate:modelValue": r[12] || (r[12] = (
|
|
1414
|
+
"onUpdate:modelValue": r[12] || (r[12] = (h) => Se(c) ? c.value = h : null),
|
|
1415
1415
|
disabled: e(H) || s.disabled
|
|
1416
1416
|
}, null, 8, ["label", "model-value", "disabled"])
|
|
1417
1417
|
])) : G("", !0),
|
|
1418
1418
|
(S(), W(ce, {
|
|
1419
|
-
"column-defs":
|
|
1419
|
+
"column-defs": he.value,
|
|
1420
1420
|
"row-data": e(t).items,
|
|
1421
|
-
key: e(t).items.map((
|
|
1421
|
+
key: e(t).items.map((h) => h.sku._id).join("."),
|
|
1422
1422
|
"hide-footer": "",
|
|
1423
1423
|
"page-size": e(t).items.length
|
|
1424
1424
|
}, {
|
|
1425
|
-
"table-row": F((
|
|
1426
|
-
d(
|
|
1425
|
+
"table-row": F((h) => [
|
|
1426
|
+
d(As, {
|
|
1427
1427
|
"compare-price-by-sku": e(oe),
|
|
1428
1428
|
"show-compare-price": $.value === e(j).PURCHASE && e(c),
|
|
1429
|
-
row:
|
|
1429
|
+
row: h
|
|
1430
1430
|
}, null, 8, ["compare-price-by-sku", "show-compare-price", "row"])
|
|
1431
1431
|
]),
|
|
1432
|
-
"list-row": F((
|
|
1433
|
-
(S(), W(
|
|
1434
|
-
row:
|
|
1432
|
+
"list-row": F((h) => [
|
|
1433
|
+
(S(), W(rt, {
|
|
1434
|
+
row: h,
|
|
1435
1435
|
key: e(t).items.map((se) => se.sku._id).join(".")
|
|
1436
1436
|
}, {
|
|
1437
1437
|
default: F((se) => [
|
|
1438
|
-
d(
|
|
1438
|
+
d(ps, {
|
|
1439
1439
|
"compare-price-by-sku": e(oe),
|
|
1440
1440
|
"show-compare-price": $.value === e(j).PURCHASE && e(c),
|
|
1441
|
-
row:
|
|
1441
|
+
row: h,
|
|
1442
1442
|
"cell-by-col-id": se
|
|
1443
1443
|
}, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "cell-by-col-id"])
|
|
1444
1444
|
]),
|
|
@@ -1455,7 +1455,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1455
1455
|
]);
|
|
1456
1456
|
};
|
|
1457
1457
|
}
|
|
1458
|
-
}),
|
|
1458
|
+
}), ra = { class: "flex items-center" }, ia = { class: "fm-typo-en-title-md-800" }, ua = { class: "flex gap-4" }, da = /* @__PURE__ */ pe({
|
|
1459
1459
|
__name: "TransferDialog",
|
|
1460
1460
|
props: {
|
|
1461
1461
|
mode: {},
|
|
@@ -1466,15 +1466,15 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1466
1466
|
},
|
|
1467
1467
|
emits: ["update:show", "submitted"],
|
|
1468
1468
|
setup(m, { expose: y, emit: n }) {
|
|
1469
|
-
var
|
|
1470
|
-
const i = m, b = n, t =
|
|
1469
|
+
var K;
|
|
1470
|
+
const i = m, b = n, t = it(), f = dt(), _ = Ae(), w = Ke(), u = je(), a = Ye(), o = Ee(), { t: v } = Ce(), k = N(!1), C = N(!1), g = N(!1);
|
|
1471
1471
|
async function x(p) {
|
|
1472
1472
|
if (p) {
|
|
1473
|
-
|
|
1473
|
+
C.value = !1;
|
|
1474
1474
|
try {
|
|
1475
|
-
await w.readSuppliers(),
|
|
1475
|
+
await w.readSuppliers(), C.value = !0;
|
|
1476
1476
|
} catch {
|
|
1477
|
-
|
|
1477
|
+
_.open({
|
|
1478
1478
|
title: v("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
|
|
1479
1479
|
message: v("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
|
|
1480
1480
|
type: "error"
|
|
@@ -1517,15 +1517,15 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1517
1517
|
templateDoc: f.templates.find((c) => c._id === i.templateId)
|
|
1518
1518
|
};
|
|
1519
1519
|
}
|
|
1520
|
-
const
|
|
1521
|
-
|
|
1520
|
+
const R = zt(i, "show"), z = N(i.modelValue ?? D()), ue = N(((K = i.modelValue) == null ? void 0 : K._id) ?? `${Math.random()}`);
|
|
1521
|
+
ge(
|
|
1522
1522
|
() => i.show,
|
|
1523
1523
|
(p) => {
|
|
1524
1524
|
var c;
|
|
1525
|
-
p && (
|
|
1525
|
+
p && (g.value = !1, z.value = i.modelValue ?? D(), ue.value = ((c = i.modelValue) == null ? void 0 : c._id) ?? `${Math.random()}`);
|
|
1526
1526
|
}
|
|
1527
1527
|
);
|
|
1528
|
-
const T =
|
|
1528
|
+
const T = E(() => !C.value || !g.value), $ = E(() => {
|
|
1529
1529
|
switch (i.mode) {
|
|
1530
1530
|
case Fe.READ:
|
|
1531
1531
|
return "View transfer";
|
|
@@ -1550,20 +1550,20 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1550
1550
|
(c = (p = O.value) == null ? void 0 : p.resetInputs) == null || c.call(p);
|
|
1551
1551
|
}
|
|
1552
1552
|
});
|
|
1553
|
-
async function
|
|
1553
|
+
async function V() {
|
|
1554
1554
|
const p = z.value;
|
|
1555
1555
|
k.value = !0, (p.supplier.internal === "warehouse" || p.supplier.internal === "restaurant") && (p.items = p.items.map(({ totalCost: c, ...H }) => H)), o.mustUseDefaultCost && (p.items = p.items.map((c) => ({
|
|
1556
1556
|
...c,
|
|
1557
1557
|
totalCost: re(c.sku, c.quantity, c.measurement)
|
|
1558
1558
|
})));
|
|
1559
1559
|
try {
|
|
1560
|
-
await t.createPurchaseOrder(p), await new Promise((c) => setTimeout(c, 1e3)),
|
|
1560
|
+
await t.createPurchaseOrder(p), await new Promise((c) => setTimeout(c, 1e3)), _.open({
|
|
1561
1561
|
title: v("inventory.transfer.receiveRequest.create.success"),
|
|
1562
1562
|
message: v("inventory.transfer.receiveRequest.create.successMessage"),
|
|
1563
1563
|
type: "success"
|
|
1564
1564
|
}), b("update:show", !1), b("submitted");
|
|
1565
1565
|
} catch (c) {
|
|
1566
|
-
|
|
1566
|
+
_.open({
|
|
1567
1567
|
title: v("inventory.transfer.receiveRequest.create.error.title"),
|
|
1568
1568
|
message: v("inventory.transfer.receiveRequest.create.error.message"),
|
|
1569
1569
|
type: "error"
|
|
@@ -1579,13 +1579,13 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1579
1579
|
totalCost: re(c.sku, c.quantity, c.measurement)
|
|
1580
1580
|
})));
|
|
1581
1581
|
try {
|
|
1582
|
-
await t.updatePurchaseOrder(p), await new Promise((c) => setTimeout(c, 1e3)),
|
|
1582
|
+
await t.updatePurchaseOrder(p), await new Promise((c) => setTimeout(c, 1e3)), _.open({
|
|
1583
1583
|
title: v("inventory.transfer.receiveRequest.update.success"),
|
|
1584
1584
|
message: v("inventory.transfer.receiveRequest.update.successMessage"),
|
|
1585
1585
|
type: "success"
|
|
1586
1586
|
}), b("update:show", !1), b("submitted");
|
|
1587
1587
|
} catch (c) {
|
|
1588
|
-
|
|
1588
|
+
_.open({
|
|
1589
1589
|
title: v("inventory.transfer.receiveRequest.update.error.title"),
|
|
1590
1590
|
message: v("inventory.transfer.receiveRequest.update.error.message"),
|
|
1591
1591
|
type: "error"
|
|
@@ -1597,35 +1597,35 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1597
1597
|
function B() {
|
|
1598
1598
|
switch (i.mode) {
|
|
1599
1599
|
case Fe.CREATE:
|
|
1600
|
-
return
|
|
1600
|
+
return V();
|
|
1601
1601
|
case Fe.UPDATE:
|
|
1602
1602
|
return I();
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
1605
|
-
function
|
|
1605
|
+
function Q() {
|
|
1606
1606
|
var p, c;
|
|
1607
1607
|
(c = (p = O.value) == null ? void 0 : p.validateInputs) == null || c.call(p);
|
|
1608
1608
|
}
|
|
1609
1609
|
return (p, c) => {
|
|
1610
1610
|
const H = P("FmButton"), oe = P("FmSideSheet");
|
|
1611
1611
|
return S(), W(oe, {
|
|
1612
|
-
modelValue: e(
|
|
1613
|
-
"onUpdate:modelValue": c[3] || (c[3] = (X) => Se(
|
|
1612
|
+
modelValue: e(R),
|
|
1613
|
+
"onUpdate:modelValue": c[3] || (c[3] = (X) => Se(R) ? R.value = X : null),
|
|
1614
1614
|
"dismiss-away": "",
|
|
1615
1615
|
"close-button": "",
|
|
1616
1616
|
"max-width": 900
|
|
1617
1617
|
}, {
|
|
1618
1618
|
"side-sheet-header": F(() => [
|
|
1619
|
-
l("div",
|
|
1620
|
-
l("div",
|
|
1619
|
+
l("div", ra, [
|
|
1620
|
+
l("div", ia, U($.value), 1)
|
|
1621
1621
|
])
|
|
1622
1622
|
]),
|
|
1623
1623
|
default: F(() => [
|
|
1624
|
-
(S(), W(
|
|
1624
|
+
(S(), W(na, {
|
|
1625
1625
|
class: "w-full",
|
|
1626
1626
|
ref_key: "formRef",
|
|
1627
1627
|
ref: O,
|
|
1628
|
-
"onForm:ready": c[0] || (c[0] = () =>
|
|
1628
|
+
"onForm:ready": c[0] || (c[0] = () => g.value = !0),
|
|
1629
1629
|
onValidationSuccess: B,
|
|
1630
1630
|
modelValue: z.value,
|
|
1631
1631
|
"onUpdate:modelValue": c[1] || (c[1] = (X) => z.value = X),
|
|
@@ -1637,12 +1637,12 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1637
1637
|
}, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
|
|
1638
1638
|
]),
|
|
1639
1639
|
"side-sheet-footer": F(() => [
|
|
1640
|
-
l("div",
|
|
1640
|
+
l("div", ua, [
|
|
1641
1641
|
d(H, {
|
|
1642
1642
|
loading: k.value,
|
|
1643
1643
|
disabled: T.value,
|
|
1644
1644
|
label: e(v)("common.save"),
|
|
1645
|
-
onClick:
|
|
1645
|
+
onClick: Q
|
|
1646
1646
|
}, null, 8, ["loading", "disabled", "label"]),
|
|
1647
1647
|
d(H, {
|
|
1648
1648
|
disabled: T.value,
|
|
@@ -1656,26 +1656,26 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1656
1656
|
}, 8, ["modelValue"]);
|
|
1657
1657
|
};
|
|
1658
1658
|
}
|
|
1659
|
-
}),
|
|
1659
|
+
}), ca = { class: "flex flex-col py-8" }, ma = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pa = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, fa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, va = {
|
|
1660
1660
|
key: 0,
|
|
1661
1661
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
|
|
1662
|
-
},
|
|
1662
|
+
}, ya = { class: "pt-8" }, at = "ReceiveRequestViewSearchCriteria", Ra = /* @__PURE__ */ pe({
|
|
1663
1663
|
__name: "ReceiveRequestView",
|
|
1664
1664
|
setup(m) {
|
|
1665
|
-
const { t: y } =
|
|
1666
|
-
|
|
1667
|
-
name:
|
|
1668
|
-
startDate:
|
|
1669
|
-
endDate:
|
|
1665
|
+
const { t: y } = Ce(), n = Ae();
|
|
1666
|
+
Re.object({
|
|
1667
|
+
name: Re.string().optional().nullable(),
|
|
1668
|
+
startDate: Re.string().optional().nullable(),
|
|
1669
|
+
endDate: Re.string().optional().nullable()
|
|
1670
1670
|
});
|
|
1671
|
-
const i =
|
|
1671
|
+
const i = E(
|
|
1672
1672
|
() => !o._currentLocation || u.loading.value
|
|
1673
|
-
), b =
|
|
1673
|
+
), b = Ot(), t = Ee();
|
|
1674
1674
|
function f() {
|
|
1675
1675
|
const T = {
|
|
1676
1676
|
name: "",
|
|
1677
|
-
...
|
|
1678
|
-
}, $ = b.getItem(
|
|
1677
|
+
...Je()
|
|
1678
|
+
}, $ = b.getItem(at);
|
|
1679
1679
|
if (!$)
|
|
1680
1680
|
return T;
|
|
1681
1681
|
try {
|
|
@@ -1684,28 +1684,34 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1684
1684
|
return T;
|
|
1685
1685
|
}
|
|
1686
1686
|
}
|
|
1687
|
-
function
|
|
1688
|
-
b.setItem(
|
|
1687
|
+
function _() {
|
|
1688
|
+
b.setItem(at, JSON.stringify(w.value));
|
|
1689
1689
|
}
|
|
1690
|
-
const w = N(f()), u =
|
|
1690
|
+
const w = N(f()), u = Rt(
|
|
1691
|
+
Ue.RECEIVE_REQUEST,
|
|
1692
|
+
w.value
|
|
1693
|
+
), { columnDefs: a } = Vt(
|
|
1694
|
+
Ue.RECEIVE_REQUEST,
|
|
1695
|
+
u
|
|
1696
|
+
), o = Ye();
|
|
1691
1697
|
async function v() {
|
|
1692
|
-
const T = `inventory-record_${
|
|
1693
|
-
(
|
|
1694
|
-
const B = new Date(
|
|
1695
|
-
|
|
1698
|
+
const T = `inventory-record_${Xe(w.value.startDate).format("DD-MM-YYYY_HH-mm")}-${Xe(w.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, $ = u.purchaseOrders.value.flatMap(
|
|
1699
|
+
(V) => V.items.map((I) => {
|
|
1700
|
+
const B = new Date(Ut(V._id) ?? ""), Q = V.effectiveAt ? new Date(V.effectiveAt) : void 0, K = ye(
|
|
1701
|
+
Et(I.sku, V.deliveryOrder || [])
|
|
1696
1702
|
), p = ye(I.quantity);
|
|
1697
1703
|
return {
|
|
1698
1704
|
"SKU code": I.code,
|
|
1699
1705
|
"SKU name": I.name,
|
|
1700
|
-
"PO #":
|
|
1701
|
-
"Effective at":
|
|
1706
|
+
"PO #": V.seqNumber,
|
|
1707
|
+
"Effective at": Q,
|
|
1702
1708
|
Date: B,
|
|
1703
|
-
Status:
|
|
1704
|
-
Reference:
|
|
1705
|
-
"Received quantity":
|
|
1709
|
+
Status: V.status,
|
|
1710
|
+
Reference: V.ref ?? "",
|
|
1711
|
+
"Received quantity": K,
|
|
1706
1712
|
"Ordered quantity": p,
|
|
1707
1713
|
Unit: I.sku.unit.abbrev,
|
|
1708
|
-
"Total cost": I.totalCost ?
|
|
1714
|
+
"Total cost": I.totalCost ? Le(I.totalCost) : null
|
|
1709
1715
|
};
|
|
1710
1716
|
})
|
|
1711
1717
|
), O = [
|
|
@@ -1719,7 +1725,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1719
1725
|
"Ordered quantity",
|
|
1720
1726
|
"Unit"
|
|
1721
1727
|
];
|
|
1722
|
-
t.enableBackdatePo && O.insert("Effective at", 4), t.enableTotalCost && O.push("Total cost"), await
|
|
1728
|
+
t.enableBackdatePo && O.insert("Effective at", 4), t.enableTotalCost && O.push("Total cost"), await Mt(
|
|
1723
1729
|
[
|
|
1724
1730
|
{
|
|
1725
1731
|
name: "purchases",
|
|
@@ -1734,16 +1740,16 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1734
1740
|
type: "success"
|
|
1735
1741
|
});
|
|
1736
1742
|
}
|
|
1737
|
-
const k = N(
|
|
1738
|
-
|
|
1743
|
+
const k = N(Je()), C = N("");
|
|
1744
|
+
ge([() => k.value], ([T]) => {
|
|
1739
1745
|
!T.startDate || !T.endDate || (w.value.startDate = T.startDate, w.value.endDate = T.endDate, u.updateDateRange(
|
|
1740
1746
|
w.value.startDate,
|
|
1741
1747
|
w.value.endDate
|
|
1742
|
-
),
|
|
1743
|
-
}),
|
|
1744
|
-
|
|
1748
|
+
), _());
|
|
1749
|
+
}), ge([() => C.value], () => {
|
|
1750
|
+
_();
|
|
1745
1751
|
});
|
|
1746
|
-
function
|
|
1752
|
+
function g(T) {
|
|
1747
1753
|
if (T === "create") {
|
|
1748
1754
|
if (i.value) {
|
|
1749
1755
|
n.open({
|
|
@@ -1760,7 +1766,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1760
1766
|
if (T === "export")
|
|
1761
1767
|
return v();
|
|
1762
1768
|
}
|
|
1763
|
-
const { breakpoints: x } =
|
|
1769
|
+
const { breakpoints: x } = Qe(), D = E(() => x.value.xs || x.value.sm), R = E(() => D.value ? 10 : 20), z = Tt(), ue = E(() => [
|
|
1764
1770
|
{
|
|
1765
1771
|
label: y("inventory.transfer.receiveRequest.actions.create"),
|
|
1766
1772
|
value: "create",
|
|
@@ -1778,13 +1784,13 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1778
1784
|
]);
|
|
1779
1785
|
return (T, $) => {
|
|
1780
1786
|
const O = P("FmTable");
|
|
1781
|
-
return S(), W(
|
|
1787
|
+
return S(), W(Pt, {
|
|
1782
1788
|
title: e(y)("inventory.transfer.receiveRequest.title2"),
|
|
1783
1789
|
actions: ue.value,
|
|
1784
|
-
"onClick:action":
|
|
1790
|
+
"onClick:action": g
|
|
1785
1791
|
}, {
|
|
1786
1792
|
default: F(() => {
|
|
1787
|
-
var
|
|
1793
|
+
var V;
|
|
1788
1794
|
return [
|
|
1789
1795
|
l("div", {
|
|
1790
1796
|
class: J([
|
|
@@ -1795,54 +1801,54 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1795
1801
|
}
|
|
1796
1802
|
])
|
|
1797
1803
|
}, [
|
|
1798
|
-
d(
|
|
1804
|
+
d(It, {
|
|
1799
1805
|
"date-range-query": "",
|
|
1800
1806
|
"date-range": k.value,
|
|
1801
1807
|
"onUpdate:dateRange": $[0] || ($[0] = (I) => k.value = I),
|
|
1802
1808
|
searchable: "",
|
|
1803
1809
|
"change-location": "",
|
|
1804
|
-
search:
|
|
1805
|
-
"onUpdate:search": $[1] || ($[1] = (I) =>
|
|
1810
|
+
search: C.value,
|
|
1811
|
+
"onUpdate:search": $[1] || ($[1] = (I) => C.value = I)
|
|
1806
1812
|
}, null, 8, ["date-range", "search"]),
|
|
1807
1813
|
(S(), W(O, {
|
|
1808
|
-
style:
|
|
1814
|
+
style: lt(e(z).tableHeight),
|
|
1809
1815
|
"column-defs": e(a),
|
|
1810
1816
|
"row-data": e(u).purchaseOrders.value,
|
|
1811
|
-
"search-value":
|
|
1817
|
+
"search-value": C.value,
|
|
1812
1818
|
loading: i.value,
|
|
1813
1819
|
onRowClick: $[2] || ($[2] = (I) => e(u).promptShowTransferDetails(I.original)),
|
|
1814
|
-
key: (
|
|
1815
|
-
"page-size":
|
|
1820
|
+
key: (V = e(o)._currentLocation) == null ? void 0 : V.dbName,
|
|
1821
|
+
"page-size": R.value
|
|
1816
1822
|
}, {
|
|
1817
1823
|
"list-row": F((I) => [
|
|
1818
|
-
d(
|
|
1824
|
+
d(rt, {
|
|
1819
1825
|
row: I,
|
|
1820
1826
|
onRowClick: e(u).promptShowTransferDetails
|
|
1821
1827
|
}, {
|
|
1822
1828
|
default: F((B) => {
|
|
1823
|
-
var
|
|
1829
|
+
var Q, K, p, c, H, oe, X, $e, he, Te, qe, Pe, s, r, M, Z, de, be, ae, fe;
|
|
1824
1830
|
return [
|
|
1825
|
-
l("div",
|
|
1826
|
-
l("div",
|
|
1831
|
+
l("div", ca, [
|
|
1832
|
+
l("div", ma, [
|
|
1827
1833
|
d(e(ie), {
|
|
1828
|
-
render: (p = (
|
|
1834
|
+
render: (p = (K = (Q = B._id) == null ? void 0 : Q.column) == null ? void 0 : K.columnDef) == null ? void 0 : p.cell,
|
|
1829
1835
|
props: (H = (c = B._id) == null ? void 0 : c.getContext) == null ? void 0 : H.call(c)
|
|
1830
1836
|
}, null, 8, ["render", "props"])
|
|
1831
1837
|
]),
|
|
1832
|
-
l("div",
|
|
1838
|
+
l("div", pa, [
|
|
1833
1839
|
d(e(ie), {
|
|
1834
1840
|
render: ($e = (X = (oe = B.supplier_name) == null ? void 0 : oe.column) == null ? void 0 : X.columnDef) == null ? void 0 : $e.cell,
|
|
1835
|
-
props: (Te = (
|
|
1841
|
+
props: (Te = (he = B.supplier_name) == null ? void 0 : he.getContext) == null ? void 0 : Te.call(he)
|
|
1836
1842
|
}, null, 8, ["render", "props"])
|
|
1837
1843
|
]),
|
|
1838
|
-
l("div",
|
|
1839
|
-
I.original.ref ? (S(),
|
|
1844
|
+
l("div", fa, U(I.original.items.map((xe) => `${xe.name}`).join(", ")), 1),
|
|
1845
|
+
I.original.ref ? (S(), q("div", va, [
|
|
1840
1846
|
d(e(ie), {
|
|
1841
|
-
render: (s = (Pe = (
|
|
1842
|
-
props: (
|
|
1847
|
+
render: (s = (Pe = (qe = B.ref) == null ? void 0 : qe.column) == null ? void 0 : Pe.columnDef) == null ? void 0 : s.cell,
|
|
1848
|
+
props: (M = (r = B.ref) == null ? void 0 : r.getContext) == null ? void 0 : M.call(r)
|
|
1843
1849
|
}, null, 8, ["render", "props"])
|
|
1844
1850
|
])) : G("", !0),
|
|
1845
|
-
l("div",
|
|
1851
|
+
l("div", ya, [
|
|
1846
1852
|
d(e(ie), {
|
|
1847
1853
|
render: (be = (de = (Z = B.status) == null ? void 0 : Z.column) == null ? void 0 : de.columnDef) == null ? void 0 : be.cell,
|
|
1848
1854
|
props: (fe = (ae = B.status) == null ? void 0 : ae.getContext) == null ? void 0 : fe.call(ae)
|
|
@@ -1857,13 +1863,15 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1857
1863
|
_: 1
|
|
1858
1864
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
1859
1865
|
], 2),
|
|
1860
|
-
(S(), W(
|
|
1861
|
-
d(
|
|
1866
|
+
(S(), W(pt, { to: "body" }, [
|
|
1867
|
+
d(da, Be(e(u).transferDialogProps.value, {
|
|
1862
1868
|
onSubmitted: e(u).fetchData
|
|
1863
1869
|
}), null, 16, ["onSubmitted"]),
|
|
1864
|
-
d(
|
|
1870
|
+
d(At, Be({
|
|
1871
|
+
scope: e(Ue).RECEIVE_REQUEST
|
|
1872
|
+
}, e(u).transferDetailsProps.value, {
|
|
1865
1873
|
onSubmitted: e(u).fetchData
|
|
1866
|
-
}), null, 16, ["onSubmitted"])
|
|
1874
|
+
}), null, 16, ["scope", "onSubmitted"])
|
|
1867
1875
|
]))
|
|
1868
1876
|
];
|
|
1869
1877
|
}),
|
|
@@ -1873,5 +1881,5 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1873
1881
|
}
|
|
1874
1882
|
});
|
|
1875
1883
|
export {
|
|
1876
|
-
|
|
1884
|
+
Ra as default
|
|
1877
1885
|
};
|