@feedmepos/mf-inventory-portal 0.0.25-dev.1 → 0.0.25-dev.11
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-TRzHN9-F.js → App-CO-6e1yq.js} +35 -34
- package/dist/{ApprovalView-XuMTVxgh.js → ApprovalView-CibKgQlF.js} +18 -18
- package/dist/{BindingsDialog-B8WqnjnP.js → BindingsDialog-oWRH8tAd.js} +6 -6
- package/dist/{BindingsPicker-jlcu-d6r.js → BindingsPicker-CpM2ldne.js} +3 -3
- package/dist/{BindingsTable-B00mXBU7.js → BindingsTable-BA3ATsO3.js} +6 -6
- package/dist/{ClosingDraftView-CTzudiDa.js → ClosingDraftView-CS2v3zbm.js} +47 -47
- package/dist/ClosingTemplateView-BS8RaUgX.js +1859 -0
- package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js +34 -0
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-7qLOtuzy.js +211 -0
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-C8UXVANj.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Dn5wTNsE.js} +52 -52
- package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-Wv_HtVUG.js +51 -0
- package/dist/{IngredientGroupView-C5XpFU4A.js → IngredientGroupView-DLDfRzPQ.js} +1 -1
- package/dist/{IngredientsView-jP9q6wm1.js → IngredientsView-IpEhZhFt.js} +394 -382
- package/dist/{IntegrationView-DmX1Q9KM.js → IntegrationView-D8DFRPr1.js} +660 -623
- package/dist/{InventoryBindingForm-Doz0ISM5.js → InventoryBindingForm-9255LnDG.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CXntbRos.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BqlOlgnY.js} +55 -55
- package/dist/{InventoryBindingSummary-DDjzipz8.js → InventoryBindingSummary-BPEwj0Gs.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B8cFyxTY.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-E53iSENL.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DUDKXBlh.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CByTbk0u.js} +15 -15
- package/dist/{PublishView-BX7n6k7c.js → PublishView-SUyD0hW-.js} +7 -7
- package/dist/{PurchaseOrderPrintPreview-BjSoZs6d.js → PurchaseOrderPrintPreview-CSi_l2J8.js} +1 -1
- package/dist/{ReceiveRequestView-B7EWBCnW.js → ReceiveRequestView-DA7CofZ1.js} +238 -237
- package/dist/{RecipeView-DZo_HxRD.js → RecipeView-DYGIII7T.js} +32 -31
- package/dist/{index-qnLd0zOS.js → StockView-DjQlAXbi.js} +3577 -1764
- package/dist/{SupplierView-CSB0MJPt.js → SupplierView-CB8pq2dk.js} +12 -11
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-IxGRO3vL.js +1461 -0
- package/dist/TransferTemplateView-CjVir2Ql.js +1371 -0
- package/dist/{UnitView-DavK_R4W.js → UnitView-DD8sGjaR.js} +14 -14
- package/dist/{WarehouseView-DKH-C4Xd.js → WarehouseView-BE131osn.js} +332 -314
- package/dist/api/inventory.d.ts +7 -6
- package/dist/{app-U7r2BqkX.js → app-CbAke6dP.js} +27996 -28075
- package/dist/app.js +1 -1
- package/dist/components/FmAutocompleteTextField.vue.d.ts +31 -0
- package/dist/components/FmCustomAttribute.vue.d.ts +3 -8
- package/dist/components/FmLockableField.vue.d.ts +3 -0
- package/dist/components/FmMultiselectDialog.vue.d.ts +20 -3
- package/dist/components/FmMultiselectDialogProps.d.ts +2 -0
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +1 -1
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +1 -1
- package/dist/{decimal-8Rw9enBX.js → decimal-ITAjlTW6.js} +1 -1
- package/dist/feature-Dq5knPmf.js +1005 -0
- package/dist/{format-unit-display-BOmYRTQF.js → format-unit-display-D-Ho5ga9.js} +335 -328
- package/dist/helper/fuzzy.d.ts +10 -0
- package/dist/index-DpN0zX69.js +35546 -0
- package/dist/{stock-B0CPrhsD.js → stock-CjI4mNO9.js} +3 -3
- package/dist/stores/integration/netsuite.d.ts +5 -0
- package/dist/stores/inventory.d.ts +8 -8
- package/dist/stores/location.d.ts +100 -0
- package/dist/stores/warehouse.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/{supplier-B9AwIixA.js → supplier-DnImzKTa.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/use-ingredient-select-dialog-AgNLUJRC.js +51 -0
- package/dist/{use-inventory-binding-dialog-yq2U1BWY.js → use-inventory-binding-dialog-sJsbhbQI.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +24 -0
- package/dist/views/adjustment-template/wastage-template/table.d.ts +24 -0
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +8 -4
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +48 -24
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +1 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +36 -12
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -12
- package/dist/views/dev/components/AutocompleteTextField.vue.d.ts +2 -0
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +3 -3
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +2 -2
- package/dist/views/ingredients/composables/use-ingredient-select-dialog.d.ts +16 -0
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -1
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +25 -17
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +2 -2
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +1 -1
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +36 -24
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +36 -24
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations-2.d.ts +8 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +1 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +1 -2
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +36 -12
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +36 -12
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -0
- package/dist/{vue-i18n-Bl7GJEHh.js → vue-i18n-DYyu2tND.js} +283 -283
- package/package.json +5 -5
- package/dist/ClosingTemplateView-CH7km5d2.js +0 -1819
- package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-7BeCefaL.js +0 -142
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Dcc6Iujf.js +0 -286
- package/dist/StockView-CJy2REMR.js +0 -1817
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DA3f4VAd.js +0 -1327
- package/dist/TransferTemplateView-CRZXRX63.js +0 -1284
- package/dist/index-C2OSKtid.js +0 -29202
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { reactive as at, onMounted as Be, h as L, computed as q, defineComponent as pe, openBlock as S, createElementBlock as M, Fragment as ke, renderList as Ue, createElementVNode as
|
|
2
|
-
import { b as Ne,
|
|
3
|
-
import { u as rt, a as It, b as Vt, _ as Rt, g as At } from "./TransferDetails.vue_vue_type_script_setup_true_lang-
|
|
4
|
-
import { _ as it, u as qt, i as Mt, e as Ut } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { reactive as at, onMounted as Be, h as L, computed as q, defineComponent as pe, openBlock as S, createElementBlock as M, Fragment as ke, renderList as Ue, 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 _e, normalizeClass as J, normalizeStyle as ot, createTextVNode as Ee, nextTick as ct, mergeProps as Oe, isRef as Se, Teleport as mt } from "vue";
|
|
2
|
+
import { b as Ne, Z as pt, l as Ge, i as ye, O as ft, a0 as ze, K as vt, as as yt, A as Re, M as bt, m as lt, ab as Le, E as ie, at as gt, a as He, au as _t, av as kt, aw as ht, G as Ct, u as je, ax as xt, $ as St, T as wt, ay as Dt, B as nt, H as Ft, d as Fe, az as Ve, a5 as We, y as $t, _ as Tt, z as Pt, N as Je } from "./app-CbAke6dP.js";
|
|
3
|
+
import { u as rt, a as It, b as Vt, _ as Rt, g as At } from "./TransferDetails.vue_vue_type_script_setup_true_lang-IxGRO3vL.js";
|
|
4
|
+
import { _ as it, u as qt, i as Mt, e as Ut } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-CByTbk0u.js";
|
|
5
5
|
import { u as Et } from "./useTabStorage-BkIVScW_.js";
|
|
6
|
-
import { useBreakpoints as Ye, components as ve, FmButtonVariant as Ot, useSnackbar as
|
|
7
|
-
import { P as j, u as ut } from "./format-unit-display-
|
|
8
|
-
import { _ as zt, F as Lt, a as Xe, b as Ht } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
9
|
-
import {
|
|
6
|
+
import { useBreakpoints as Ye, components as ve, FmButtonVariant as Ot, useSnackbar as Ae, useDialog as Bt, useProxiedModel as Nt } from "@feedmepos/ui-library";
|
|
7
|
+
import { P as j, u as ut } from "./format-unit-display-D-Ho5ga9.js";
|
|
8
|
+
import { _ as zt, F as Lt, a as Xe, b as Ht } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-Dn5wTNsE.js";
|
|
9
|
+
import { u as qe } from "./feature-Dq5knPmf.js";
|
|
10
|
+
import { c as re, u as jt, _ as Yt } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-7qLOtuzy.js";
|
|
10
11
|
import { useI18n as he } from "@feedmepos/mf-common";
|
|
11
|
-
import { u as Ke } from "./supplier-
|
|
12
|
+
import { u as Ke } from "./supplier-DnImzKTa.js";
|
|
12
13
|
import { _ as Kt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
13
|
-
import { u as Qt } from "./vue-i18n-
|
|
14
|
+
import { u as Qt } from "./vue-i18n-DYyu2tND.js";
|
|
14
15
|
import "./array-hChJVZLE.js";
|
|
15
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 || {});
|
|
16
17
|
const et = () => {
|
|
@@ -25,20 +26,20 @@ const et = () => {
|
|
|
25
26
|
);
|
|
26
27
|
};
|
|
27
28
|
function Zt(m) {
|
|
28
|
-
const { t: y } = he(), n = at({}), { breakpoints: i } = Ye(), b =
|
|
29
|
+
const { t: y } = he(), n = at({}), { breakpoints: i } = Ye(), b = qe(), t = Ne();
|
|
29
30
|
Be(() => {
|
|
30
31
|
for (const u of m.items) {
|
|
31
32
|
if (!u.totalCost)
|
|
32
33
|
continue;
|
|
33
34
|
const a = re(u.sku, u.quantity, u.measurement, {
|
|
34
35
|
supplier: m.supplier
|
|
35
|
-
}),
|
|
36
|
-
a ? n[u.sku._id] = a.amount !==
|
|
36
|
+
}), o = u.totalCost ?? pt.reset();
|
|
37
|
+
a ? n[u.sku._id] = a.amount !== o.amount || a.precision !== o.precision : n[u.sku._id] = !0;
|
|
37
38
|
}
|
|
38
39
|
});
|
|
39
40
|
function f(u) {
|
|
40
|
-
var
|
|
41
|
-
return !!(((v = (
|
|
41
|
+
var o, v, k, h, _, x, D;
|
|
42
|
+
return !!(((v = (o = u.defaultCost) == null ? void 0 : o.costPerUnit) == null ? void 0 : v.amount) ?? ((D = (x = (_ = (h = (k = m.supplier) == null ? void 0 : k.supplyItems) == null ? void 0 : h.find((V) => V.skuId === u._id)) == null ? void 0 : _.defaultCost) == null ? void 0 : x.costPerUnit) == null ? void 0 : D.amount));
|
|
42
43
|
}
|
|
43
44
|
const g = [
|
|
44
45
|
{
|
|
@@ -65,10 +66,10 @@ function Zt(m) {
|
|
|
65
66
|
)
|
|
66
67
|
) : L(ve.FmTextField, {
|
|
67
68
|
modelValue: a.code,
|
|
68
|
-
"onUpdate:modelValue": (
|
|
69
|
+
"onUpdate:modelValue": (o) => {
|
|
69
70
|
m.updateItem({
|
|
70
71
|
...a,
|
|
71
|
-
code:
|
|
72
|
+
code: o
|
|
72
73
|
});
|
|
73
74
|
},
|
|
74
75
|
key: a.sku._id,
|
|
@@ -101,10 +102,10 @@ function Zt(m) {
|
|
|
101
102
|
)
|
|
102
103
|
) : L(ve.FmTextField, {
|
|
103
104
|
modelValue: a.name,
|
|
104
|
-
"onUpdate:modelValue": (
|
|
105
|
+
"onUpdate:modelValue": (o) => {
|
|
105
106
|
m.updateItem({
|
|
106
107
|
...a,
|
|
107
|
-
name:
|
|
108
|
+
name: o
|
|
108
109
|
});
|
|
109
110
|
},
|
|
110
111
|
key: a.sku._id,
|
|
@@ -120,7 +121,7 @@ function Zt(m) {
|
|
|
120
121
|
minSize: 200,
|
|
121
122
|
cell(u) {
|
|
122
123
|
var v, k, h;
|
|
123
|
-
const a = u.row.original,
|
|
124
|
+
const a = u.row.original, o = (h = (k = (v = m.template) == null ? void 0 : v.purchaseOrder) == null ? void 0 : k.items) == null ? void 0 : h.find(
|
|
124
125
|
(_) => _.sku._id === a.sku._id
|
|
125
126
|
);
|
|
126
127
|
return L(zt, {
|
|
@@ -146,22 +147,22 @@ function Zt(m) {
|
|
|
146
147
|
manualTotalCost: n[a.sku._id] ? x.totalCost : void 0
|
|
147
148
|
})), m.updateItem(x);
|
|
148
149
|
},
|
|
149
|
-
stepper:
|
|
150
|
-
disableUnit: !!
|
|
150
|
+
stepper: o == null ? void 0 : o.quantityStep,
|
|
151
|
+
disableUnit: !!o,
|
|
151
152
|
disabled: m.disabled,
|
|
152
153
|
rules: [
|
|
153
154
|
Lt(
|
|
154
155
|
+ye(
|
|
155
|
-
(
|
|
156
|
+
(o != null && o.minimumQuantity && (o == null ? void 0 : o.minimumQuantity.amount) > 0 ? o == null ? void 0 : o.minimumQuantity : void 0) ?? {
|
|
156
157
|
amount: 1,
|
|
157
158
|
precision: ft(a.sku.unit, a.measurement)
|
|
158
159
|
}
|
|
159
160
|
)
|
|
160
161
|
),
|
|
161
|
-
|
|
162
|
-
+ye(
|
|
162
|
+
o != null && o.maximumQuantity ? Xe(
|
|
163
|
+
+ye(o == null ? void 0 : o.maximumQuantity)
|
|
163
164
|
) : Xe(1 / 0),
|
|
164
|
-
...
|
|
165
|
+
...o != null && o.quantityStep ? [Ht(o.quantityStep)] : []
|
|
165
166
|
],
|
|
166
167
|
applyDefaultRules: !0
|
|
167
168
|
});
|
|
@@ -183,8 +184,8 @@ function Zt(m) {
|
|
|
183
184
|
header: et,
|
|
184
185
|
size: 180,
|
|
185
186
|
cell(u) {
|
|
186
|
-
const a = u.row.original,
|
|
187
|
-
return !n[a.sku._id] &&
|
|
187
|
+
const a = u.row.original, o = f(a.sku), v = i.value.xs || i.value.sm;
|
|
188
|
+
return !n[a.sku._id] && o ? L(
|
|
188
189
|
"div",
|
|
189
190
|
{
|
|
190
191
|
class: [
|
|
@@ -268,7 +269,7 @@ function Zt(m) {
|
|
|
268
269
|
) : null;
|
|
269
270
|
},
|
|
270
271
|
append() {
|
|
271
|
-
return
|
|
272
|
+
return o ? L(ve.FmButton, {
|
|
272
273
|
prependIcon: "close",
|
|
273
274
|
variant: "tertiary",
|
|
274
275
|
disabled: m.disabled,
|
|
@@ -322,7 +323,7 @@ function Zt(m) {
|
|
|
322
323
|
))
|
|
323
324
|
};
|
|
324
325
|
}
|
|
325
|
-
const Gt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" },
|
|
326
|
+
const Gt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, Wt = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, Jt = { class: "w-[450px] xs:w-full flex" }, Xt = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, es = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, dt = /* @__PURE__ */ pe({
|
|
326
327
|
__name: "SupplierPriceHistory",
|
|
327
328
|
props: {
|
|
328
329
|
prices: {}
|
|
@@ -339,24 +340,24 @@ const Gt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
339
340
|
key: t,
|
|
340
341
|
class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
|
|
341
342
|
}, [
|
|
342
|
-
|
|
343
|
-
|
|
343
|
+
l("div", Wt, U((f = n(t)) == null ? void 0 : f.name), 1),
|
|
344
|
+
l("div", Jt, [
|
|
344
345
|
(S(!0), M(ke, null, Ue(i.prices[t].slice(0, 3), (g) => {
|
|
345
346
|
var w;
|
|
346
347
|
return S(), M("div", {
|
|
347
348
|
key: g.date,
|
|
348
349
|
class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
|
|
349
350
|
}, [
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
b[0] || (b[0] =
|
|
353
|
-
|
|
354
|
-
|
|
351
|
+
l("div", Xt, [
|
|
352
|
+
l("span", null, U(g.totalCost ? e(ze)(g.totalCost) : "No data"), 1),
|
|
353
|
+
b[0] || (b[0] = l("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
|
|
354
|
+
l("span", null, U(e(ye)(g.totalUnit, !1)), 1),
|
|
355
|
+
l("span", null, U(((w = g.measurement) == null ? void 0 : w.abbrev) ?? g.unit.abbrev), 1)
|
|
355
356
|
]),
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
b[1] || (b[1] =
|
|
359
|
-
|
|
357
|
+
l("div", es, [
|
|
358
|
+
l("span", null, "(#" + U(g.seqNumber) + ")", 1),
|
|
359
|
+
b[1] || (b[1] = l("span", null, U(" "), -1)),
|
|
360
|
+
l("span", null, U(e(Le)(new Date(g.date))), 1)
|
|
360
361
|
])
|
|
361
362
|
]);
|
|
362
363
|
}), 128))
|
|
@@ -379,45 +380,45 @@ const Gt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
379
380
|
setup(m) {
|
|
380
381
|
const { t: y } = he();
|
|
381
382
|
return (n, i) => {
|
|
382
|
-
var f, g, w, u, a,
|
|
383
|
+
var f, g, w, u, a, o, v, k, h, _, x, D, V, z, ue, T, $, O, R, I, B, K, Q, p, c, H, oe;
|
|
383
384
|
const b = P("FmLabel"), t = P("FmSpacer");
|
|
384
385
|
return S(), M("div", ts, [
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
386
|
+
l("div", ss, [
|
|
387
|
+
l("div", as, [
|
|
388
|
+
l("span", os, " (" + U(n.row.original.sku.code) + ") ", 1),
|
|
389
|
+
l("span", ls, U(n.row.original.sku.name), 1)
|
|
389
390
|
]),
|
|
390
|
-
|
|
391
|
+
l("div", null, [
|
|
391
392
|
d(e(ie), {
|
|
392
393
|
render: (w = (g = (f = n.cellByColId.Delete) == null ? void 0 : f.column) == null ? void 0 : g.columnDef) == null ? void 0 : w.cell,
|
|
393
394
|
props: (a = (u = n.cellByColId.Delete) == null ? void 0 : u.getContext) == null ? void 0 : a.call(u)
|
|
394
395
|
}, null, 8, ["render", "props"])
|
|
395
396
|
])
|
|
396
397
|
]),
|
|
397
|
-
|
|
398
|
-
|
|
398
|
+
l("div", ns, [
|
|
399
|
+
l("div", rs, [
|
|
399
400
|
d(b, {
|
|
400
401
|
label: e(y)(`inventory.transfer.form.items.table.${e(Y).Code}`)
|
|
401
402
|
}, null, 8, ["label"]),
|
|
402
403
|
d(e(ie), {
|
|
403
|
-
render: (k = (v = (
|
|
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,
|
|
404
405
|
props: (_ = (h = n.cellByColId[e(Y).Code]) == null ? void 0 : h.getContext) == null ? void 0 : _.call(h)
|
|
405
406
|
}, null, 8, ["render", "props"]),
|
|
406
|
-
i[0] || (i[0] =
|
|
407
|
+
i[0] || (i[0] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
407
408
|
]),
|
|
408
|
-
|
|
409
|
+
l("div", is, [
|
|
409
410
|
d(b, {
|
|
410
411
|
label: e(y)(`inventory.transfer.form.items.table.${e(Y).Name}`)
|
|
411
412
|
}, null, 8, ["label"]),
|
|
412
413
|
d(e(ie), {
|
|
413
|
-
render: (V = (
|
|
414
|
+
render: (V = (D = (x = n.cellByColId[e(Y).Name]) == null ? void 0 : x.column) == null ? void 0 : D.columnDef) == null ? void 0 : V.cell,
|
|
414
415
|
props: (ue = (z = n.cellByColId[e(Y).Name]) == null ? void 0 : z.getContext) == null ? void 0 : ue.call(z)
|
|
415
416
|
}, null, 8, ["render", "props"]),
|
|
416
|
-
i[1] || (i[1] =
|
|
417
|
+
i[1] || (i[1] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
417
418
|
])
|
|
418
419
|
]),
|
|
419
|
-
|
|
420
|
-
|
|
420
|
+
l("div", us, [
|
|
421
|
+
l("div", ds, [
|
|
421
422
|
d(b, {
|
|
422
423
|
label: e(y)(`inventory.transfer.form.items.table.${e(Y).Amount}`)
|
|
423
424
|
}, null, 8, ["label"]),
|
|
@@ -425,11 +426,11 @@ const Gt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
425
426
|
render: (O = ($ = (T = n.cellByColId[e(Y).Amount]) == null ? void 0 : T.column) == null ? void 0 : $.columnDef) == null ? void 0 : O.cell,
|
|
426
427
|
props: (I = (R = n.cellByColId[e(Y).Amount]) == null ? void 0 : R.getContext) == null ? void 0 : I.call(R)
|
|
427
428
|
}, null, 8, ["render", "props"]),
|
|
428
|
-
i[2] || (i[2] =
|
|
429
|
+
i[2] || (i[2] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
429
430
|
]),
|
|
430
431
|
n.cellByColId[e(Y).Cost] ? (S(), M("div", cs, [
|
|
431
432
|
d(it, { "z-index": 50 }, {
|
|
432
|
-
default:
|
|
433
|
+
default: F(() => [
|
|
433
434
|
d(b, {
|
|
434
435
|
label: e(y)(`inventory.transfer.form.items.table.${e(Y).Cost}2`)
|
|
435
436
|
}, null, 8, ["label"])
|
|
@@ -440,7 +441,7 @@ const Gt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
440
441
|
render: (Q = (K = (B = n.cellByColId[e(Y).Cost]) == null ? void 0 : B.column) == null ? void 0 : K.columnDef) == null ? void 0 : Q.cell,
|
|
441
442
|
props: (c = (p = n.cellByColId[e(Y).Cost]) == null ? void 0 : p.getContext) == null ? void 0 : c.call(p)
|
|
442
443
|
}, null, 8, ["render", "props"]),
|
|
443
|
-
i[3] || (i[3] =
|
|
444
|
+
i[3] || (i[3] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
444
445
|
])) : G("", !0)
|
|
445
446
|
]),
|
|
446
447
|
n.showComparePrice && Object.keys(n.comparePriceBySku[(H = n.row.original.sku) == null ? void 0 : H._id] ?? {}).length > 0 ? (S(), M(ke, { key: 0 }, [
|
|
@@ -511,22 +512,22 @@ const fs = {
|
|
|
511
512
|
},
|
|
512
513
|
setup(m) {
|
|
513
514
|
return (y, n) => (S(), M("svg", fs, [
|
|
514
|
-
|
|
515
|
+
l("path", {
|
|
515
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",
|
|
516
517
|
fill: m.color
|
|
517
518
|
}, null, 8, vs),
|
|
518
|
-
|
|
519
|
+
l("path", {
|
|
519
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",
|
|
520
521
|
fill: m.color
|
|
521
522
|
}, null, 8, ys),
|
|
522
|
-
|
|
523
|
+
l("path", {
|
|
523
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",
|
|
524
525
|
stroke: m.color,
|
|
525
526
|
"stroke-width": "1.5",
|
|
526
527
|
"stroke-linecap": "round",
|
|
527
528
|
"stroke-linejoin": "round"
|
|
528
529
|
}, null, 8, bs),
|
|
529
|
-
|
|
530
|
+
l("path", {
|
|
530
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",
|
|
531
532
|
stroke: m.color,
|
|
532
533
|
"stroke-width": "1.5",
|
|
@@ -535,14 +536,14 @@ const fs = {
|
|
|
535
536
|
}, null, 8, gs)
|
|
536
537
|
]));
|
|
537
538
|
}
|
|
538
|
-
}), ks = { class: "flex gap-8 items-center" }, hs = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, Cs = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, xs = { class: "flex items-center w-full" }, Ss = { class: "flex-1" }, ws = { class: "fm-typo-en-title-sm-800" },
|
|
539
|
+
}), ks = { class: "flex gap-8 items-center" }, hs = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, Cs = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, xs = { class: "flex items-center w-full" }, Ss = { class: "flex-1" }, ws = { class: "fm-typo-en-title-sm-800" }, Ds = { class: "flex items-start gap-8" }, Fs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, $s = { class: "flex gap-1" }, tt = /* @__PURE__ */ pe({
|
|
539
540
|
__name: "ForecastStock",
|
|
540
541
|
props: {
|
|
541
542
|
disabled: { type: Boolean }
|
|
542
543
|
},
|
|
543
544
|
emits: ["update:poItems"],
|
|
544
545
|
setup(m, { emit: y }) {
|
|
545
|
-
const n = y, i = N(!1), b = N(7), t = qt(), f =
|
|
546
|
+
const n = y, i = N(!1), b = N(7), t = qt(), f = Ae(), g = He(), { t: w } = he();
|
|
546
547
|
async function u() {
|
|
547
548
|
if (b.value < 1)
|
|
548
549
|
return;
|
|
@@ -555,9 +556,9 @@ const fs = {
|
|
|
555
556
|
});
|
|
556
557
|
return;
|
|
557
558
|
}
|
|
558
|
-
const
|
|
559
|
-
const h = g.skus.find((
|
|
560
|
-
if (v.find((
|
|
559
|
+
const o = t.purchaseOrderForecast.skus.reduce((v, k) => {
|
|
560
|
+
const h = g.skus.find((D) => D._id === k.id);
|
|
561
|
+
if (v.find((D) => D.sku._id === k.id) || !h)
|
|
561
562
|
return v;
|
|
562
563
|
const x = {
|
|
563
564
|
sku: h,
|
|
@@ -570,17 +571,17 @@ const fs = {
|
|
|
570
571
|
};
|
|
571
572
|
return v.push(x), v;
|
|
572
573
|
}, a);
|
|
573
|
-
n("update:poItems",
|
|
574
|
+
n("update:poItems", o);
|
|
574
575
|
}
|
|
575
|
-
return (a,
|
|
576
|
+
return (a, o) => {
|
|
576
577
|
const v = P("FmButton"), k = P("FmIcon"), h = P("FmStepperField"), _ = P("FmPopover");
|
|
577
|
-
return S(),
|
|
578
|
+
return S(), W(_, {
|
|
578
579
|
disabled: a.disabled,
|
|
579
580
|
class: "flex",
|
|
580
581
|
"show-popover": i.value,
|
|
581
|
-
onPopoverChanged:
|
|
582
|
+
onPopoverChanged: o[3] || (o[3] = (x) => i.value = x)
|
|
582
583
|
}, {
|
|
583
|
-
"popover-button":
|
|
584
|
+
"popover-button": F(() => [
|
|
584
585
|
d(v, {
|
|
585
586
|
label: "unused",
|
|
586
587
|
variant: "secondary",
|
|
@@ -589,25 +590,25 @@ const fs = {
|
|
|
589
590
|
"border-color": a.disabled ? "disabled" : "primary",
|
|
590
591
|
disabled: a.disabled
|
|
591
592
|
}, {
|
|
592
|
-
default:
|
|
593
|
-
|
|
593
|
+
default: F(() => [
|
|
594
|
+
l("div", ks, [
|
|
594
595
|
d(_s, {
|
|
595
596
|
size: 24,
|
|
596
597
|
color: a.disabled ? "#c7c7cc" : "#ff7823"
|
|
597
598
|
}, null, 8, ["color"]),
|
|
598
|
-
|
|
599
|
+
l("div", hs, U(e(w)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
599
600
|
])
|
|
600
601
|
]),
|
|
601
602
|
_: 1
|
|
602
603
|
}, 8, ["text-color", "border-color", "disabled"])
|
|
603
604
|
]),
|
|
604
|
-
default:
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
605
|
+
default: F(() => [
|
|
606
|
+
l("div", Cs, [
|
|
607
|
+
l("div", xs, [
|
|
608
|
+
l("div", Ss, [
|
|
608
609
|
d(Kt, { "z-index": 99 }, {
|
|
609
|
-
default:
|
|
610
|
-
|
|
610
|
+
default: F(() => [
|
|
611
|
+
l("p", ws, U(e(w)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
611
612
|
]),
|
|
612
613
|
_: 1
|
|
613
614
|
})
|
|
@@ -616,33 +617,33 @@ const fs = {
|
|
|
616
617
|
icon: "close",
|
|
617
618
|
size: "md",
|
|
618
619
|
variant: "tertiary",
|
|
619
|
-
onClick:
|
|
620
|
+
onClick: o[0] || (o[0] = (x) => i.value = !1)
|
|
620
621
|
})
|
|
621
622
|
]),
|
|
622
623
|
d(h, {
|
|
623
624
|
modelValue: b.value,
|
|
624
|
-
"onUpdate:modelValue":
|
|
625
|
+
"onUpdate:modelValue": o[1] || (o[1] = (x) => b.value = x),
|
|
625
626
|
label: e(w)("inventory.transfer.form.items.forecastStock.days"),
|
|
626
627
|
rules: [e(Re)(1)]
|
|
627
628
|
}, {
|
|
628
|
-
"helper-text":
|
|
629
|
-
|
|
629
|
+
"helper-text": F(() => [
|
|
630
|
+
l("div", Ds, [
|
|
630
631
|
d(k, {
|
|
631
632
|
name: "warning",
|
|
632
633
|
size: "sm",
|
|
633
634
|
class: "text-fm-color-system-warning-300"
|
|
634
635
|
}),
|
|
635
|
-
|
|
636
|
+
l("div", Fs, U(e(w)("inventory.transfer.form.items.forecastStock.replace")), 1)
|
|
636
637
|
])
|
|
637
638
|
]),
|
|
638
639
|
_: 1
|
|
639
640
|
}, 8, ["modelValue", "label", "rules"]),
|
|
640
|
-
|
|
641
|
-
|
|
641
|
+
l("div", $s, [
|
|
642
|
+
o[4] || (o[4] = l("div", { class: "grow" }, null, -1)),
|
|
642
643
|
d(v, {
|
|
643
644
|
label: e(w)("common.cancel"),
|
|
644
645
|
variant: "tertiary",
|
|
645
|
-
onClick:
|
|
646
|
+
onClick: o[2] || (o[2] = (x) => i.value = !1)
|
|
646
647
|
}, null, 8, ["label"]),
|
|
647
648
|
d(v, {
|
|
648
649
|
label: e(w)("inventory.transfer.form.items.forecastStock.generate"),
|
|
@@ -657,7 +658,7 @@ const fs = {
|
|
|
657
658
|
}
|
|
658
659
|
});
|
|
659
660
|
function Ts() {
|
|
660
|
-
const m =
|
|
661
|
+
const m = Ae(), y = rt(), n = N(!1);
|
|
661
662
|
_e(n, (f) => {
|
|
662
663
|
f && (b.value = !0, i().finally(() => {
|
|
663
664
|
b.value = !1;
|
|
@@ -666,25 +667,25 @@ function Ts() {
|
|
|
666
667
|
async function i() {
|
|
667
668
|
try {
|
|
668
669
|
const { startDate: f, endDate: g } = _t(6), a = (await y.getPurchaseOrders({ start: f, end: g })).filter(
|
|
669
|
-
(
|
|
670
|
+
(o) => {
|
|
670
671
|
var v, k;
|
|
671
|
-
return
|
|
672
|
+
return o.status === kt.enum.COMPLETE && ((v = o.supplier) == null ? void 0 : v.internal) !== "warehouse" && ((k = o.supplier) == null ? void 0 : k.internal) !== "restaurant";
|
|
672
673
|
}
|
|
673
|
-
).reduce((
|
|
674
|
+
).reduce((o, v) => {
|
|
674
675
|
const k = new Date(ht(v._id)), h = v.supplier._id;
|
|
675
676
|
for (const _ of v.items) {
|
|
676
677
|
if (!_.totalCost) continue;
|
|
677
|
-
const x =
|
|
678
|
-
|
|
678
|
+
const x = o[_.sku._id] ?? {}, D = x[h] ?? [];
|
|
679
|
+
D.push({
|
|
679
680
|
date: k.toISOString(),
|
|
680
681
|
totalUnit: _.quantity,
|
|
681
682
|
totalCost: _.totalCost,
|
|
682
683
|
unit: _.sku.unit,
|
|
683
684
|
measurement: _.measurement,
|
|
684
685
|
seqNumber: v.seqNumber
|
|
685
|
-
}), x[h] =
|
|
686
|
+
}), x[h] = D, o[_.sku._id] = x;
|
|
686
687
|
}
|
|
687
|
-
return
|
|
688
|
+
return o;
|
|
688
689
|
}, {});
|
|
689
690
|
t.value = a;
|
|
690
691
|
} catch {
|
|
@@ -715,8 +716,8 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
715
716
|
return (n, i) => {
|
|
716
717
|
var b, t;
|
|
717
718
|
return S(), M(ke, null, [
|
|
718
|
-
|
|
719
|
-
class:
|
|
719
|
+
l("tr", {
|
|
720
|
+
class: J(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
|
|
720
721
|
"bg-fm-color-neutral-gray-100": n.row.getIsSelected()
|
|
721
722
|
}])
|
|
722
723
|
}, [
|
|
@@ -724,7 +725,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
724
725
|
var g, w, u, a;
|
|
725
726
|
return S(), M("td", {
|
|
726
727
|
key: f.id,
|
|
727
|
-
class:
|
|
728
|
+
class: J([
|
|
728
729
|
"h-[52px] px-16 text-fm-color-typo-primary",
|
|
729
730
|
((g = y(f)) == null ? void 0 : g.cellClass) ?? "px-16"
|
|
730
731
|
]),
|
|
@@ -734,7 +735,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
734
735
|
textAlign: ((a = y(f)) == null ? void 0 : a.textAlign) ?? "left"
|
|
735
736
|
})
|
|
736
737
|
}, [
|
|
737
|
-
|
|
738
|
+
l("span", Ps, [
|
|
738
739
|
d(e(ie), {
|
|
739
740
|
render: f.column.columnDef.cell,
|
|
740
741
|
props: f.getContext()
|
|
@@ -744,7 +745,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
744
745
|
}), 128))
|
|
745
746
|
], 2),
|
|
746
747
|
n.showComparePrice && Object.keys(n.comparePriceBySku[(b = n.row.original.sku) == null ? void 0 : b._id] ?? {}).length > 0 ? (S(), M("tr", Is, [
|
|
747
|
-
|
|
748
|
+
l("td", {
|
|
748
749
|
colspan: n.row.getVisibleCells().length
|
|
749
750
|
}, [
|
|
750
751
|
d(dt, {
|
|
@@ -775,7 +776,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
775
776
|
setup(m, { emit: y }) {
|
|
776
777
|
const n = Ne(), i = m, b = y, { t } = Qt(), f = N(!1), g = N();
|
|
777
778
|
Be(() => {
|
|
778
|
-
var
|
|
779
|
+
var o, v, k, h;
|
|
779
780
|
let a = {
|
|
780
781
|
id: "",
|
|
781
782
|
subsidiary: { id: "", name: "" },
|
|
@@ -800,7 +801,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
800
801
|
name: _.name
|
|
801
802
|
}
|
|
802
803
|
};
|
|
803
|
-
const x = n.getAvailableItems(_.id),
|
|
804
|
+
const x = n.getAvailableItems(_.id), D = i.items.filter((V) => {
|
|
804
805
|
if (V.measurement != null) {
|
|
805
806
|
const z = n.getAvailableMeasurements(
|
|
806
807
|
V.sku._id,
|
|
@@ -811,52 +812,52 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
811
812
|
return x.includes(V.sku._id);
|
|
812
813
|
}).map((V) => V.sku._id);
|
|
813
814
|
i.onChange(
|
|
814
|
-
i.items.filter((V) =>
|
|
815
|
+
i.items.filter((V) => D.includes(V.sku._id)),
|
|
815
816
|
a
|
|
816
817
|
);
|
|
817
818
|
} finally {
|
|
818
819
|
i.supplier.internal ? g.value = n.getNetSuiteLocation(
|
|
819
820
|
`${i.supplier.internal}_${i.supplier._id}`
|
|
820
821
|
) : g.value = n.getNetSuiteVendor(i.supplier._id);
|
|
821
|
-
const _ = i.supplier.internal ? n.getLocationSubsidiary((
|
|
822
|
+
const _ = i.supplier.internal ? n.getLocationSubsidiary((o = g.value) == null ? void 0 : o.netSuiteId).id : (v = g.value) == null ? void 0 : v.subsidiaryId, x = i.supplier.internal ? (k = n.currentLocationSubsidiary()) == null ? void 0 : k.id : (h = n.currentVendorSubsidiary(i.supplier._id)) == null ? void 0 : h.id;
|
|
822
823
|
!n.isEnabled || _ && n.isEnabled && _ == x ? b("netsuite:ready", a) : f.value = !0;
|
|
823
824
|
}
|
|
824
825
|
});
|
|
825
826
|
const w = q(
|
|
826
827
|
() => i.supplier.internal ? n.currentLocationSubsidiary() : n.currentVendorSubsidiary(i.supplier._id)
|
|
827
828
|
), u = q(() => {
|
|
828
|
-
var a,
|
|
829
|
+
var a, o;
|
|
829
830
|
return g.value == null ? `Cannot find the NetSuite location for "${i.supplier.name}"` : `The subsidiary of the request
|
|
830
|
-
location is ${(
|
|
831
|
+
location is ${(o = n.getLocationSubsidiary((a = g.value) == null ? void 0 : a.netSuiteId)) == null ? void 0 : o.fullName}`;
|
|
831
832
|
});
|
|
832
|
-
return (a,
|
|
833
|
+
return (a, o) => {
|
|
833
834
|
const v = P("FmLabel"), k = P("FmIcon"), h = P("FmField"), _ = P("FmTooltip");
|
|
834
835
|
return e(n).isEnabled && i.required ? (S(), M("div", As, [
|
|
835
836
|
d(v, {
|
|
836
837
|
label: `NetSuite ${e(t)("inventory.transfer.form.netsuite.subsidiary")}`
|
|
837
838
|
}, null, 8, ["label"]),
|
|
838
|
-
|
|
839
|
+
l("div", qs, [
|
|
839
840
|
d(_, {
|
|
840
841
|
"z-index": 51,
|
|
841
842
|
placement: "left",
|
|
842
843
|
disabled: a.disabled
|
|
843
844
|
}, {
|
|
844
|
-
content:
|
|
845
|
+
content: F(() => o[0] || (o[0] = [
|
|
845
846
|
Ee("This field is locked and based on the location of the request.")
|
|
846
847
|
])),
|
|
847
|
-
default:
|
|
848
|
+
default: F(() => [
|
|
848
849
|
d(h, null, {
|
|
849
|
-
default:
|
|
850
|
+
default: F(() => {
|
|
850
851
|
var x;
|
|
851
852
|
return [
|
|
852
|
-
|
|
853
|
+
l("div", Ms, [
|
|
853
854
|
d(k, {
|
|
854
855
|
name: "lock_outline",
|
|
855
856
|
size: "sm",
|
|
856
857
|
color: a.disabled ? "neutral-gray-200" : "neutral-gray-400"
|
|
857
858
|
}, null, 8, ["color"]),
|
|
858
|
-
|
|
859
|
-
class:
|
|
859
|
+
l("div", {
|
|
860
|
+
class: J([a.disabled ? "text-fm-color-typo-disabled" : ""])
|
|
860
861
|
}, U((x = w.value) == null ? void 0 : x.fullName), 3)
|
|
861
862
|
])
|
|
862
863
|
];
|
|
@@ -877,7 +878,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
877
878
|
}, Gs = {
|
|
878
879
|
key: 0,
|
|
879
880
|
class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
|
|
880
|
-
},
|
|
881
|
+
}, Ws = { class: "flex-1" }, Js = { class: "flex-1" }, Xs = {
|
|
881
882
|
key: 1,
|
|
882
883
|
class: "flex items-center gap-4"
|
|
883
884
|
}, ea = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, ta = { class: "flex flex-col gap-16" }, sa = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, aa = { class: "flex gap-8" }, oa = { key: 0 }, la = /* @__PURE__ */ pe({
|
|
@@ -892,15 +893,15 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
892
893
|
},
|
|
893
894
|
emits: ["validation-success", "form:ready"],
|
|
894
895
|
setup(m, { expose: y, emit: n }) {
|
|
895
|
-
const i = m, b = n, t = Ct(), { t: f } = he(), g = je(), w = He(), u = Ne(), a = Ke(),
|
|
896
|
+
const i = m, b = n, t = Ct(), { t: f } = he(), g = je(), w = He(), u = Ne(), a = Ke(), o = qe(), v = ut(), { breakpoints: k } = Ye(), h = q(() => k.value.xs || k.value.sm), _ = at({
|
|
896
897
|
value: !1
|
|
897
|
-
}), x = N(!1),
|
|
898
|
+
}), x = N(!1), D = q(
|
|
898
899
|
() => {
|
|
899
900
|
var s;
|
|
900
901
|
return ((s = i.modelValue) == null ? void 0 : s.templateDoc) ?? v.templates.find((r) => r._id === t.template);
|
|
901
902
|
}
|
|
902
903
|
), V = q(() => t.status === "DRAFT" || !t._rev);
|
|
903
|
-
_e(
|
|
904
|
+
_e(D, (s) => {
|
|
904
905
|
s && V.value && (t.supplier = (s == null ? void 0 : s.purchaseOrder.supplier) ?? t.supplier);
|
|
905
906
|
}), Be(() => {
|
|
906
907
|
var s;
|
|
@@ -908,7 +909,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
908
909
|
if (!t.template) return;
|
|
909
910
|
if (!t.items.length) {
|
|
910
911
|
let r = [];
|
|
911
|
-
(s =
|
|
912
|
+
(s = D.value) != null && s.purchaseOrder.items && (r = D.value.purchaseOrder.items.filter((E) => {
|
|
912
913
|
var Z;
|
|
913
914
|
return ((Z = E.quantity) == null ? void 0 : Z.amount) != 0;
|
|
914
915
|
})), t.items = r;
|
|
@@ -949,7 +950,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
949
950
|
return (s = i.modelValue) == null ? void 0 : s.template;
|
|
950
951
|
},
|
|
951
952
|
(s) => {
|
|
952
|
-
|
|
953
|
+
o.mustUsePoTemplate && !s && ct(() => {
|
|
953
954
|
var r, E;
|
|
954
955
|
t.supplier = ((E = (r = T.locationOptionsTypeTransfer.value) == null ? void 0 : r.filter(
|
|
955
956
|
(Z) => Z.internal === "restaurant"
|
|
@@ -960,7 +961,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
960
961
|
);
|
|
961
962
|
const O = q(() => {
|
|
962
963
|
let s = T.transferLocationOptions.value;
|
|
963
|
-
return
|
|
964
|
+
return o.mustUsePoTemplate && !t.template && (s = s.filter((r) => {
|
|
964
965
|
var E;
|
|
965
966
|
return (E = r.sublabel) == null ? void 0 : E.startsWith("restaurant");
|
|
966
967
|
})), s;
|
|
@@ -1017,7 +1018,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1017
1018
|
return $.value;
|
|
1018
1019
|
},
|
|
1019
1020
|
get template() {
|
|
1020
|
-
return
|
|
1021
|
+
return D.value;
|
|
1021
1022
|
},
|
|
1022
1023
|
get disabled() {
|
|
1023
1024
|
return i.disabled;
|
|
@@ -1028,9 +1029,9 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1028
1029
|
});
|
|
1029
1030
|
function Te() {
|
|
1030
1031
|
var ae, fe, xe, Ie, we;
|
|
1031
|
-
const s = new Set((xe = (fe = (ae =
|
|
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) : [], E = s.size ? w.skus.filter((A) => s.has(A._id)) : w.skus, Z = u.isEnabled ? E.filter((A) => {
|
|
1032
1033
|
var le, te, ce, ne;
|
|
1033
|
-
const ee = (te = (le =
|
|
1034
|
+
const ee = (te = (le = D.value) == null ? void 0 : le.purchaseOrder) == null ? void 0 : te.items.find(
|
|
1034
1035
|
(me) => me.sku._id === A._id
|
|
1035
1036
|
);
|
|
1036
1037
|
if (ee != null && ee.measurement != null) {
|
|
@@ -1055,7 +1056,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1055
1056
|
ue.open({
|
|
1056
1057
|
title: f("inventory.transfer.form.items.selectItem"),
|
|
1057
1058
|
closeButton: !0,
|
|
1058
|
-
contentComponent:
|
|
1059
|
+
contentComponent: Ft,
|
|
1059
1060
|
contentComponentProps: {
|
|
1060
1061
|
modelValue: be,
|
|
1061
1062
|
items: de,
|
|
@@ -1072,11 +1073,11 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1072
1073
|
}
|
|
1073
1074
|
}).onPrimary((A) => {
|
|
1074
1075
|
const ee = t.items ?? [], le = A.map((te) => {
|
|
1075
|
-
var me,
|
|
1076
|
+
var me, De;
|
|
1076
1077
|
const ce = ee.find((ge) => ge.sku._id === te._id);
|
|
1077
1078
|
if (ce)
|
|
1078
1079
|
return ce;
|
|
1079
|
-
const ne = ((
|
|
1080
|
+
const ne = ((De = (me = D.value) == null ? void 0 : me.purchaseOrder.items) == null ? void 0 : De.find(
|
|
1080
1081
|
(ge) => ge.sku._id === te._id
|
|
1081
1082
|
)) ?? {
|
|
1082
1083
|
sku: te,
|
|
@@ -1104,7 +1105,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1104
1105
|
}
|
|
1105
1106
|
const Pe = q(() => {
|
|
1106
1107
|
const s = [];
|
|
1107
|
-
return (!
|
|
1108
|
+
return (!o.mustUsePoTemplate || o.mustUsePoTemplate && t.template) && s.push({
|
|
1108
1109
|
label: f("inventory.transfer.form.type.purchase"),
|
|
1109
1110
|
value: j.PURCHASE
|
|
1110
1111
|
}), s.push({
|
|
@@ -1113,14 +1114,14 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1113
1114
|
}), s;
|
|
1114
1115
|
});
|
|
1115
1116
|
return (s, r) => {
|
|
1116
|
-
var me,
|
|
1117
|
+
var me, De;
|
|
1117
1118
|
const E = 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");
|
|
1118
1119
|
return S(), M("div", Os, [
|
|
1119
|
-
|
|
1120
|
-
(me = i.modelValue) != null && me.template ? (S(),
|
|
1120
|
+
l("div", Bs, [
|
|
1121
|
+
(me = i.modelValue) != null && me.template ? (S(), W(E, {
|
|
1121
1122
|
key: 0,
|
|
1122
1123
|
variant: s.disabled ? "warning" : void 0,
|
|
1123
|
-
label: `${e(f)("inventory.transfer.template.title")}: ${((
|
|
1124
|
+
label: `${e(f)("inventory.transfer.template.title")}: ${((De = D.value) == null ? void 0 : De.name) ?? e(f)("inventory.transfer.form.loading")}`,
|
|
1124
1125
|
icon: "summarize",
|
|
1125
1126
|
compact: ""
|
|
1126
1127
|
}, null, 8, ["variant", "label"])) : G("", !0),
|
|
@@ -1129,7 +1130,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1129
1130
|
icon: "storefront",
|
|
1130
1131
|
compact: ""
|
|
1131
1132
|
}, null, 8, ["label"]),
|
|
1132
|
-
s.lastClosingDate ? (S(),
|
|
1133
|
+
s.lastClosingDate ? (S(), W(E, {
|
|
1133
1134
|
key: 1,
|
|
1134
1135
|
label: `${e(f)("inventory.transfer.form.lastClosing")}: ${e(Le)(s.lastClosingDate)} ${e(St)(s.lastClosingDate)}`,
|
|
1135
1136
|
icon: "calendar_month",
|
|
@@ -1144,36 +1145,36 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1144
1145
|
onValidationFailed: console.log,
|
|
1145
1146
|
onValidationSuccess: r[13] || (r[13] = (ge) => b("validation-success"))
|
|
1146
1147
|
}, {
|
|
1147
|
-
default:
|
|
1148
|
+
default: F(() => {
|
|
1148
1149
|
var ge, Qe;
|
|
1149
1150
|
return [
|
|
1150
|
-
|
|
1151
|
-
|
|
1151
|
+
l("div", Ns, [
|
|
1152
|
+
l("div", zs, [
|
|
1152
1153
|
(ge = i.modelValue) != null && ge.template ? (S(), M(ke, { key: 0 }, [
|
|
1153
|
-
|
|
1154
|
+
l("div", Ls, [
|
|
1154
1155
|
d(Z, {
|
|
1155
1156
|
label: e(f)("inventory.transfer.form.type.title")
|
|
1156
1157
|
}, null, 8, ["label"]),
|
|
1157
|
-
|
|
1158
|
+
l("div", Hs, [
|
|
1158
1159
|
d(ae, {
|
|
1159
1160
|
"z-index": 51,
|
|
1160
1161
|
placement: "left",
|
|
1161
1162
|
disabled: s.disabled
|
|
1162
1163
|
}, {
|
|
1163
|
-
content:
|
|
1164
|
+
content: F(() => r[14] || (r[14] = [
|
|
1164
1165
|
Ee("This field is locked from template.")
|
|
1165
1166
|
])),
|
|
1166
|
-
default:
|
|
1167
|
+
default: F(() => [
|
|
1167
1168
|
d(be, null, {
|
|
1168
|
-
default:
|
|
1169
|
-
|
|
1169
|
+
default: F(() => [
|
|
1170
|
+
l("div", js, [
|
|
1170
1171
|
d(de, {
|
|
1171
1172
|
name: "lock_outline",
|
|
1172
1173
|
size: "sm",
|
|
1173
1174
|
color: s.disabled ? "neutral-gray-200" : "neutral-gray-400"
|
|
1174
1175
|
}, null, 8, ["color"]),
|
|
1175
|
-
|
|
1176
|
-
class:
|
|
1176
|
+
l("div", {
|
|
1177
|
+
class: J({ "text-fm-color-typo-disabled": s.disabled })
|
|
1177
1178
|
}, U(e(f)(`inventory.transfer.form.type.${$.value.toLocaleLowerCase("en-us")}`)), 3)
|
|
1178
1179
|
])
|
|
1179
1180
|
]),
|
|
@@ -1182,40 +1183,40 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1182
1183
|
]),
|
|
1183
1184
|
_: 1
|
|
1184
1185
|
}, 8, ["disabled"]),
|
|
1185
|
-
|
|
1186
|
-
class:
|
|
1186
|
+
l("div", {
|
|
1187
|
+
class: J([
|
|
1187
1188
|
"fm-typo-en-body-sm-400",
|
|
1188
1189
|
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
|
|
1189
1190
|
])
|
|
1190
1191
|
}, null, 2)
|
|
1191
1192
|
])
|
|
1192
1193
|
]),
|
|
1193
|
-
|
|
1194
|
+
l("div", Ys, [
|
|
1194
1195
|
d(Z, {
|
|
1195
1196
|
label: $.value === e(j).PURCHASE ? e(f)("inventory.transfer.form.purchaseFrom") : e(f)("inventory.transfer.form.transferFrom")
|
|
1196
1197
|
}, null, 8, ["label"]),
|
|
1197
|
-
|
|
1198
|
+
l("div", Ks, [
|
|
1198
1199
|
d(ae, {
|
|
1199
1200
|
"z-index": 51,
|
|
1200
1201
|
placement: "left",
|
|
1201
1202
|
disabled: s.disabled
|
|
1202
1203
|
}, {
|
|
1203
|
-
content:
|
|
1204
|
+
content: F(() => r[15] || (r[15] = [
|
|
1204
1205
|
Ee("This field is locked from template.")
|
|
1205
1206
|
])),
|
|
1206
|
-
default:
|
|
1207
|
+
default: F(() => [
|
|
1207
1208
|
d(be, null, {
|
|
1208
|
-
default:
|
|
1209
|
+
default: F(() => {
|
|
1209
1210
|
var C;
|
|
1210
1211
|
return [
|
|
1211
|
-
|
|
1212
|
+
l("div", Qs, [
|
|
1212
1213
|
d(de, {
|
|
1213
1214
|
name: "lock_outline",
|
|
1214
1215
|
size: "sm",
|
|
1215
1216
|
color: s.disabled ? "neutral-gray-200" : "neutral-gray-400"
|
|
1216
1217
|
}, null, 8, ["color"]),
|
|
1217
|
-
|
|
1218
|
-
class:
|
|
1218
|
+
l("div", {
|
|
1219
|
+
class: J({ "text-fm-color-typo-disabled": s.disabled })
|
|
1219
1220
|
}, U((C = O.value.find((se) => se.value === R.value)) == null ? void 0 : C.label), 3)
|
|
1220
1221
|
])
|
|
1221
1222
|
];
|
|
@@ -1236,9 +1237,9 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1236
1237
|
items: Pe.value,
|
|
1237
1238
|
rules: [e(Re)(1)(O.value)]
|
|
1238
1239
|
}, {
|
|
1239
|
-
default:
|
|
1240
|
-
|
|
1241
|
-
class:
|
|
1240
|
+
default: F(() => [
|
|
1241
|
+
l("span", {
|
|
1242
|
+
class: J([
|
|
1242
1243
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
1243
1244
|
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
1244
1245
|
])
|
|
@@ -1253,7 +1254,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1253
1254
|
"onUpdate:modelValue": r[1] || (r[1] = (C) => R.value = C),
|
|
1254
1255
|
items: O.value
|
|
1255
1256
|
}, {
|
|
1256
|
-
"menu-wrapper":
|
|
1257
|
+
"menu-wrapper": F((C) => {
|
|
1257
1258
|
var se, Ze;
|
|
1258
1259
|
return [
|
|
1259
1260
|
d(Yt, Oe(C, {
|
|
@@ -1262,11 +1263,11 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1262
1263
|
}), null, 16, ["items", "model-value"])
|
|
1263
1264
|
];
|
|
1264
1265
|
}),
|
|
1265
|
-
default:
|
|
1266
|
+
default: F(() => {
|
|
1266
1267
|
var C;
|
|
1267
1268
|
return [
|
|
1268
|
-
|
|
1269
|
-
class:
|
|
1269
|
+
l("span", {
|
|
1270
|
+
class: J([
|
|
1270
1271
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
1271
1272
|
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
1272
1273
|
])
|
|
@@ -1288,9 +1289,9 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1288
1289
|
"max-length": 240,
|
|
1289
1290
|
modelValue: I.value,
|
|
1290
1291
|
"onUpdate:modelValue": r[3] || (r[3] = (C) => I.value = C),
|
|
1291
|
-
class:
|
|
1292
|
+
class: J([s.disabled ? "text-fm-color-typo-disabled " : ""])
|
|
1292
1293
|
}, null, 8, ["label", "modelValue", "class"]),
|
|
1293
|
-
x.value ? (S(),
|
|
1294
|
+
x.value ? (S(), W(Es, {
|
|
1294
1295
|
key: 2,
|
|
1295
1296
|
required: e(t).template != null,
|
|
1296
1297
|
disabled: s.disabled,
|
|
@@ -1304,9 +1305,9 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1304
1305
|
_.value = !0;
|
|
1305
1306
|
})
|
|
1306
1307
|
}, null, 8, ["required", "disabled", "supplier", "setting", "items", "onChange"])) : G("", !0),
|
|
1307
|
-
e(
|
|
1308
|
-
|
|
1309
|
-
class:
|
|
1308
|
+
e(o).enableBackdatePo ? (S(), M("div", Zs, [
|
|
1309
|
+
l("div", {
|
|
1310
|
+
class: J([
|
|
1310
1311
|
"flex",
|
|
1311
1312
|
{
|
|
1312
1313
|
"flex-col": h.value
|
|
@@ -1321,17 +1322,17 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1321
1322
|
"label-placement": "right",
|
|
1322
1323
|
disabled: z.value && !s.lastClosingDate || s.disabled
|
|
1323
1324
|
}, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
|
|
1324
|
-
|
|
1325
|
-
class:
|
|
1325
|
+
l("div", {
|
|
1326
|
+
class: J({ hidden: h.value, "w-16": !h.value })
|
|
1326
1327
|
}, null, 2),
|
|
1327
1328
|
e(K) ? (S(), M("div", Gs, [
|
|
1328
|
-
|
|
1329
|
+
l("div", Ws, [
|
|
1329
1330
|
d(A, {
|
|
1330
1331
|
modelValue: e(Q),
|
|
1331
1332
|
"onUpdate:modelValue": r[6] || (r[6] = (C) => Se(Q) ? Q.value = C : null)
|
|
1332
1333
|
}, null, 8, ["modelValue"])
|
|
1333
1334
|
]),
|
|
1334
|
-
|
|
1335
|
+
l("div", Js, [
|
|
1335
1336
|
d(ee, {
|
|
1336
1337
|
modelValue: e(p),
|
|
1337
1338
|
"onUpdate:modelValue": r[7] || (r[7] = (C) => Se(p) ? p.value = C : null)
|
|
@@ -1339,11 +1340,11 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1339
1340
|
])
|
|
1340
1341
|
])) : G("", !0)
|
|
1341
1342
|
], 2),
|
|
1342
|
-
e(B) ? (S(),
|
|
1343
|
+
e(B) ? (S(), W(le, {
|
|
1343
1344
|
key: 0,
|
|
1344
1345
|
modelValue: e(B),
|
|
1345
1346
|
"onUpdate:modelValue": r[8] || (r[8] = (C) => Se(B) ? B.value = C : null),
|
|
1346
|
-
rules: [e(
|
|
1347
|
+
rules: [e(Dt)(new Date(s.lastClosingDate), /* @__PURE__ */ new Date())]
|
|
1347
1348
|
}, null, 8, ["modelValue", "rules"])) : G("", !0),
|
|
1348
1349
|
z.value && !s.lastClosingDate ? (S(), M("div", Xs, [
|
|
1349
1350
|
d(de, {
|
|
@@ -1351,18 +1352,18 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1351
1352
|
size: "sm",
|
|
1352
1353
|
class: "text-fm-color-typo-warning"
|
|
1353
1354
|
}),
|
|
1354
|
-
|
|
1355
|
+
l("span", ea, U(e(f)("inventory.transfer.form.backdate.error")), 1)
|
|
1355
1356
|
])) : G("", !0)
|
|
1356
1357
|
])) : G("", !0)
|
|
1357
1358
|
])
|
|
1358
1359
|
]),
|
|
1359
|
-
|
|
1360
|
+
l("div", ta, [
|
|
1360
1361
|
d(le, {
|
|
1361
1362
|
"model-value": e(t).items,
|
|
1362
1363
|
rules: [e(Re)(1)]
|
|
1363
1364
|
}, null, 8, ["model-value", "rules"]),
|
|
1364
|
-
|
|
1365
|
-
class:
|
|
1365
|
+
l("div", {
|
|
1366
|
+
class: J([
|
|
1366
1367
|
"flex gap-16",
|
|
1367
1368
|
{
|
|
1368
1369
|
"flex-col items-start": h.value,
|
|
@@ -1370,8 +1371,8 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1370
1371
|
}
|
|
1371
1372
|
])
|
|
1372
1373
|
}, [
|
|
1373
|
-
|
|
1374
|
-
|
|
1374
|
+
l("div", sa, U(e(f)("inventory.transfer.form.items.title")), 1),
|
|
1375
|
+
l("div", aa, [
|
|
1375
1376
|
d(te, {
|
|
1376
1377
|
disabled: s.disabled,
|
|
1377
1378
|
label: e(f)("inventory.transfer.form.items.addItem"),
|
|
@@ -1383,28 +1384,28 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1383
1384
|
onClick: r[9] || (r[9] = (C) => Te()),
|
|
1384
1385
|
size: "md"
|
|
1385
1386
|
}, null, 8, ["disabled", "label"]),
|
|
1386
|
-
e(t).template ? (S(),
|
|
1387
|
+
e(t).template ? (S(), W(ae, {
|
|
1387
1388
|
key: 0,
|
|
1388
1389
|
"z-index": 50
|
|
1389
1390
|
}, {
|
|
1390
|
-
content:
|
|
1391
|
-
|
|
1391
|
+
content: F(() => [
|
|
1392
|
+
l("div", null, U(e(f)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
|
|
1392
1393
|
]),
|
|
1393
|
-
default:
|
|
1394
|
+
default: F(() => [
|
|
1394
1395
|
d(tt, {
|
|
1395
1396
|
"onUpdate:poItems": r[10] || (r[10] = (C) => e(t).items = C),
|
|
1396
1397
|
disabled: ""
|
|
1397
1398
|
})
|
|
1398
1399
|
]),
|
|
1399
1400
|
_: 1
|
|
1400
|
-
})) : (S(),
|
|
1401
|
+
})) : (S(), W(tt, {
|
|
1401
1402
|
key: 1,
|
|
1402
1403
|
"onUpdate:poItems": r[11] || (r[11] = (C) => e(t).items = C),
|
|
1403
1404
|
disabled: s.disabled || !!e(t).template
|
|
1404
1405
|
}, null, 8, ["disabled"]))
|
|
1405
1406
|
])
|
|
1406
1407
|
], 2),
|
|
1407
|
-
$.value === e(j).PURCHASE && V.value && e(
|
|
1408
|
+
$.value === e(j).PURCHASE && V.value && e(o).enableTotalCost && ((Qe = s.modelValue) != null && Qe.items.length) ? (S(), M("div", oa, [
|
|
1408
1409
|
d(we, {
|
|
1409
1410
|
label: e(H) ? e(f)("inventory.transfer.form.items.fetchingData") : e(f)("inventory.transfer.form.items.comparePriceHistory"),
|
|
1410
1411
|
"prepend-icon": "compare_arrows",
|
|
@@ -1414,26 +1415,26 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1414
1415
|
disabled: e(H) || s.disabled
|
|
1415
1416
|
}, null, 8, ["label", "model-value", "disabled"])
|
|
1416
1417
|
])) : G("", !0),
|
|
1417
|
-
(S(),
|
|
1418
|
+
(S(), W(ce, {
|
|
1418
1419
|
"column-defs": Ce.value,
|
|
1419
1420
|
"row-data": e(t).items,
|
|
1420
1421
|
key: e(t).items.map((C) => C.sku._id).join("."),
|
|
1421
1422
|
"hide-footer": "",
|
|
1422
1423
|
"page-size": e(t).items.length
|
|
1423
1424
|
}, {
|
|
1424
|
-
"table-row":
|
|
1425
|
+
"table-row": F((C) => [
|
|
1425
1426
|
d(Rs, {
|
|
1426
1427
|
"compare-price-by-sku": e(oe),
|
|
1427
1428
|
"show-compare-price": $.value === e(j).PURCHASE && e(c),
|
|
1428
1429
|
row: C
|
|
1429
1430
|
}, null, 8, ["compare-price-by-sku", "show-compare-price", "row"])
|
|
1430
1431
|
]),
|
|
1431
|
-
"list-row":
|
|
1432
|
-
(S(),
|
|
1432
|
+
"list-row": F((C) => [
|
|
1433
|
+
(S(), W(nt, {
|
|
1433
1434
|
row: C,
|
|
1434
1435
|
key: e(t).items.map((se) => se.sku._id).join(".")
|
|
1435
1436
|
}, {
|
|
1436
|
-
default:
|
|
1437
|
+
default: F((se) => [
|
|
1437
1438
|
d(ms, {
|
|
1438
1439
|
"compare-price-by-sku": e(oe),
|
|
1439
1440
|
"show-compare-price": $.value === e(j).PURCHASE && e(c),
|
|
@@ -1466,7 +1467,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1466
1467
|
emits: ["update:show", "submitted"],
|
|
1467
1468
|
setup(m, { expose: y, emit: n }) {
|
|
1468
1469
|
var Q;
|
|
1469
|
-
const i = m, b = n, t = rt(), f = ut(), g =
|
|
1470
|
+
const i = m, b = n, t = rt(), f = ut(), g = Ae(), w = Ke(), u = He(), a = je(), o = qe(), { t: v } = he(), k = N(!1), h = N(!1), _ = N(!1);
|
|
1470
1471
|
async function x(p) {
|
|
1471
1472
|
if (p) {
|
|
1472
1473
|
h.value = !1;
|
|
@@ -1482,7 +1483,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1482
1483
|
}
|
|
1483
1484
|
}
|
|
1484
1485
|
a.watchLocation(x);
|
|
1485
|
-
function
|
|
1486
|
+
function D() {
|
|
1486
1487
|
return {
|
|
1487
1488
|
remark: void 0,
|
|
1488
1489
|
ref: void 0,
|
|
@@ -1516,21 +1517,21 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1516
1517
|
templateDoc: f.templates.find((c) => c._id === i.templateId)
|
|
1517
1518
|
};
|
|
1518
1519
|
}
|
|
1519
|
-
const V = Nt(i, "show"), z = N(i.modelValue ??
|
|
1520
|
+
const V = Nt(i, "show"), z = N(i.modelValue ?? D()), ue = N(((Q = i.modelValue) == null ? void 0 : Q._id) ?? `${Math.random()}`);
|
|
1520
1521
|
_e(
|
|
1521
1522
|
() => i.show,
|
|
1522
1523
|
(p) => {
|
|
1523
1524
|
var c;
|
|
1524
|
-
p && (_.value = !1, z.value = i.modelValue ??
|
|
1525
|
+
p && (_.value = !1, z.value = i.modelValue ?? D(), ue.value = ((c = i.modelValue) == null ? void 0 : c._id) ?? `${Math.random()}`);
|
|
1525
1526
|
}
|
|
1526
1527
|
);
|
|
1527
1528
|
const T = q(() => !h.value || !_.value), $ = q(() => {
|
|
1528
1529
|
switch (i.mode) {
|
|
1529
|
-
case
|
|
1530
|
+
case Fe.READ:
|
|
1530
1531
|
return "View transfer";
|
|
1531
|
-
case
|
|
1532
|
+
case Fe.CREATE:
|
|
1532
1533
|
return v("inventory.transfer.receiveRequest.create.title");
|
|
1533
|
-
case
|
|
1534
|
+
case Fe.UPDATE:
|
|
1534
1535
|
return v("inventory.transfer.receiveRequest.update.title");
|
|
1535
1536
|
}
|
|
1536
1537
|
return "";
|
|
@@ -1551,7 +1552,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1551
1552
|
});
|
|
1552
1553
|
async function R() {
|
|
1553
1554
|
const p = z.value;
|
|
1554
|
-
k.value = !0, (p.supplier.internal === "warehouse" || p.supplier.internal === "restaurant") && (p.items = p.items.map(({ totalCost: c, ...H }) => H)),
|
|
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) => ({
|
|
1555
1556
|
...c,
|
|
1556
1557
|
totalCost: re(c.sku, c.quantity, c.measurement)
|
|
1557
1558
|
})));
|
|
@@ -1573,7 +1574,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1573
1574
|
}
|
|
1574
1575
|
async function I() {
|
|
1575
1576
|
const p = z.value;
|
|
1576
|
-
k.value = !0, (p.supplier.internal === "warehouse" || p.supplier.internal === "restaurant") && (p.items = p.items.map(({ totalCost: c, ...H }) => H)),
|
|
1577
|
+
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) => ({
|
|
1577
1578
|
...c,
|
|
1578
1579
|
totalCost: re(c.sku, c.quantity, c.measurement)
|
|
1579
1580
|
})));
|
|
@@ -1595,9 +1596,9 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1595
1596
|
}
|
|
1596
1597
|
function B() {
|
|
1597
1598
|
switch (i.mode) {
|
|
1598
|
-
case
|
|
1599
|
+
case Fe.CREATE:
|
|
1599
1600
|
return R();
|
|
1600
|
-
case
|
|
1601
|
+
case Fe.UPDATE:
|
|
1601
1602
|
return I();
|
|
1602
1603
|
}
|
|
1603
1604
|
}
|
|
@@ -1607,20 +1608,20 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1607
1608
|
}
|
|
1608
1609
|
return (p, c) => {
|
|
1609
1610
|
const H = P("FmButton"), oe = P("FmSideSheet");
|
|
1610
|
-
return S(),
|
|
1611
|
+
return S(), W(oe, {
|
|
1611
1612
|
modelValue: e(V),
|
|
1612
1613
|
"onUpdate:modelValue": c[3] || (c[3] = (X) => Se(V) ? V.value = X : null),
|
|
1613
1614
|
"dismiss-away": "",
|
|
1614
1615
|
"close-button": "",
|
|
1615
1616
|
"max-width": 900
|
|
1616
1617
|
}, {
|
|
1617
|
-
"side-sheet-header":
|
|
1618
|
-
|
|
1619
|
-
|
|
1618
|
+
"side-sheet-header": F(() => [
|
|
1619
|
+
l("div", na, [
|
|
1620
|
+
l("div", ra, U($.value), 1)
|
|
1620
1621
|
])
|
|
1621
1622
|
]),
|
|
1622
|
-
default:
|
|
1623
|
-
(S(),
|
|
1623
|
+
default: F(() => [
|
|
1624
|
+
(S(), W(la, {
|
|
1624
1625
|
class: "w-full",
|
|
1625
1626
|
ref_key: "formRef",
|
|
1626
1627
|
ref: O,
|
|
@@ -1635,8 +1636,8 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1635
1636
|
"last-closing-date": p.lastClosingDate
|
|
1636
1637
|
}, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
|
|
1637
1638
|
]),
|
|
1638
|
-
"side-sheet-footer":
|
|
1639
|
-
|
|
1639
|
+
"side-sheet-footer": F(() => [
|
|
1640
|
+
l("div", ia, [
|
|
1640
1641
|
d(H, {
|
|
1641
1642
|
loading: k.value,
|
|
1642
1643
|
disabled: T.value,
|
|
@@ -1658,22 +1659,22 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1658
1659
|
}), da = { class: "flex flex-col py-8" }, ca = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ma = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, fa = {
|
|
1659
1660
|
key: 0,
|
|
1660
1661
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
|
|
1661
|
-
}, va = { class: "pt-8" }, st = "ReceiveRequestViewSearchCriteria",
|
|
1662
|
+
}, va = { class: "pt-8" }, st = "ReceiveRequestViewSearchCriteria", Ia = /* @__PURE__ */ pe({
|
|
1662
1663
|
__name: "ReceiveRequestView",
|
|
1663
1664
|
setup(m) {
|
|
1664
|
-
const { t: y } = he(), n =
|
|
1665
|
+
const { t: y } = he(), n = Ae();
|
|
1665
1666
|
Ve.object({
|
|
1666
1667
|
name: Ve.string().optional().nullable(),
|
|
1667
1668
|
startDate: Ve.string().optional().nullable(),
|
|
1668
1669
|
endDate: Ve.string().optional().nullable()
|
|
1669
1670
|
});
|
|
1670
1671
|
const i = q(
|
|
1671
|
-
() => !
|
|
1672
|
-
), b = Et(), t =
|
|
1672
|
+
() => !o._currentLocation || u.loading.value
|
|
1673
|
+
), b = Et(), t = qe();
|
|
1673
1674
|
function f() {
|
|
1674
1675
|
const T = {
|
|
1675
1676
|
name: "",
|
|
1676
|
-
...
|
|
1677
|
+
...We()
|
|
1677
1678
|
}, $ = b.getItem(st);
|
|
1678
1679
|
if (!$)
|
|
1679
1680
|
return T;
|
|
@@ -1686,9 +1687,9 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1686
1687
|
function g() {
|
|
1687
1688
|
b.setItem(st, JSON.stringify(w.value));
|
|
1688
1689
|
}
|
|
1689
|
-
const w = N(f()), u = It("receive/request", w.value), { columnDefs: a } = Vt("receive/request", u),
|
|
1690
|
+
const w = N(f()), u = It("receive/request", w.value), { columnDefs: a } = Vt("receive/request", u), o = je();
|
|
1690
1691
|
async function v() {
|
|
1691
|
-
const T = `inventory-record_${
|
|
1692
|
+
const T = `inventory-record_${Je(w.value.startDate).format("DD-MM-YYYY_HH-mm")}-${Je(w.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, $ = u.purchaseOrders.value.flatMap(
|
|
1692
1693
|
(R) => R.items.map((I) => {
|
|
1693
1694
|
const B = new Date(Mt(R._id) ?? ""), K = R.effectiveAt ? new Date(R.effectiveAt) : void 0, Q = ye(
|
|
1694
1695
|
At(I.sku, R.deliveryOrder || [])
|
|
@@ -1733,7 +1734,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1733
1734
|
type: "success"
|
|
1734
1735
|
});
|
|
1735
1736
|
}
|
|
1736
|
-
const k = N(
|
|
1737
|
+
const k = N(We()), h = N("");
|
|
1737
1738
|
_e([() => k.value], ([T]) => {
|
|
1738
1739
|
!T.startDate || !T.endDate || (w.value.startDate = T.startDate, w.value.endDate = T.endDate, u.updateDateRange(
|
|
1739
1740
|
w.value.startDate,
|
|
@@ -1759,7 +1760,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1759
1760
|
if (T === "export")
|
|
1760
1761
|
return v();
|
|
1761
1762
|
}
|
|
1762
|
-
const { breakpoints: x } = Ye(),
|
|
1763
|
+
const { breakpoints: x } = Ye(), D = q(() => x.value.xs || x.value.sm), V = q(() => D.value ? 10 : 20), z = $t(), ue = q(() => [
|
|
1763
1764
|
{
|
|
1764
1765
|
label: y("inventory.transfer.receiveRequest.actions.create"),
|
|
1765
1766
|
value: "create",
|
|
@@ -1777,20 +1778,20 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1777
1778
|
]);
|
|
1778
1779
|
return (T, $) => {
|
|
1779
1780
|
const O = P("FmTable");
|
|
1780
|
-
return S(),
|
|
1781
|
+
return S(), W(Tt, {
|
|
1781
1782
|
title: e(y)("inventory.transfer.receiveRequest.title2"),
|
|
1782
1783
|
actions: ue.value,
|
|
1783
1784
|
"onClick:action": _
|
|
1784
1785
|
}, {
|
|
1785
|
-
default:
|
|
1786
|
+
default: F(() => {
|
|
1786
1787
|
var R;
|
|
1787
1788
|
return [
|
|
1788
|
-
|
|
1789
|
-
class:
|
|
1789
|
+
l("div", {
|
|
1790
|
+
class: J([
|
|
1790
1791
|
"flex flex-col gap-8 max-h-full",
|
|
1791
1792
|
{
|
|
1792
|
-
"p-0":
|
|
1793
|
-
"px-24 ": !
|
|
1793
|
+
"p-0": D.value,
|
|
1794
|
+
"px-24 ": !D.value
|
|
1794
1795
|
}
|
|
1795
1796
|
])
|
|
1796
1797
|
}, [
|
|
@@ -1803,45 +1804,45 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1803
1804
|
search: h.value,
|
|
1804
1805
|
"onUpdate:search": $[1] || ($[1] = (I) => h.value = I)
|
|
1805
1806
|
}, null, 8, ["date-range", "search"]),
|
|
1806
|
-
(S(),
|
|
1807
|
+
(S(), W(O, {
|
|
1807
1808
|
style: ot(e(z).tableHeight),
|
|
1808
1809
|
"column-defs": e(a),
|
|
1809
1810
|
"row-data": e(u).purchaseOrders.value,
|
|
1810
1811
|
"search-value": h.value,
|
|
1811
1812
|
loading: i.value,
|
|
1812
1813
|
onRowClick: $[2] || ($[2] = (I) => e(u).promptShowTransferDetails(I.original)),
|
|
1813
|
-
key: (R = e(
|
|
1814
|
+
key: (R = e(o)._currentLocation) == null ? void 0 : R.dbName,
|
|
1814
1815
|
"page-size": V.value
|
|
1815
1816
|
}, {
|
|
1816
|
-
"list-row":
|
|
1817
|
+
"list-row": F((I) => [
|
|
1817
1818
|
d(nt, {
|
|
1818
1819
|
row: I,
|
|
1819
1820
|
onRowClick: e(u).promptShowTransferDetails
|
|
1820
1821
|
}, {
|
|
1821
|
-
default:
|
|
1822
|
+
default: F((B) => {
|
|
1822
1823
|
var K, Q, p, c, H, oe, X, $e, Ce, Te, Me, Pe, s, r, E, Z, de, be, ae, fe;
|
|
1823
1824
|
return [
|
|
1824
|
-
|
|
1825
|
-
|
|
1825
|
+
l("div", da, [
|
|
1826
|
+
l("div", ca, [
|
|
1826
1827
|
d(e(ie), {
|
|
1827
1828
|
render: (p = (Q = (K = B._id) == null ? void 0 : K.column) == null ? void 0 : Q.columnDef) == null ? void 0 : p.cell,
|
|
1828
1829
|
props: (H = (c = B._id) == null ? void 0 : c.getContext) == null ? void 0 : H.call(c)
|
|
1829
1830
|
}, null, 8, ["render", "props"])
|
|
1830
1831
|
]),
|
|
1831
|
-
|
|
1832
|
+
l("div", ma, [
|
|
1832
1833
|
d(e(ie), {
|
|
1833
1834
|
render: ($e = (X = (oe = B.supplier_name) == null ? void 0 : oe.column) == null ? void 0 : X.columnDef) == null ? void 0 : $e.cell,
|
|
1834
1835
|
props: (Te = (Ce = B.supplier_name) == null ? void 0 : Ce.getContext) == null ? void 0 : Te.call(Ce)
|
|
1835
1836
|
}, null, 8, ["render", "props"])
|
|
1836
1837
|
]),
|
|
1837
|
-
|
|
1838
|
+
l("div", pa, U(I.original.items.map((xe) => `${xe.name}`).join(", ")), 1),
|
|
1838
1839
|
I.original.ref ? (S(), M("div", fa, [
|
|
1839
1840
|
d(e(ie), {
|
|
1840
1841
|
render: (s = (Pe = (Me = B.ref) == null ? void 0 : Me.column) == null ? void 0 : Pe.columnDef) == null ? void 0 : s.cell,
|
|
1841
1842
|
props: (E = (r = B.ref) == null ? void 0 : r.getContext) == null ? void 0 : E.call(r)
|
|
1842
1843
|
}, null, 8, ["render", "props"])
|
|
1843
1844
|
])) : G("", !0),
|
|
1844
|
-
|
|
1845
|
+
l("div", va, [
|
|
1845
1846
|
d(e(ie), {
|
|
1846
1847
|
render: (be = (de = (Z = B.status) == null ? void 0 : Z.column) == null ? void 0 : de.columnDef) == null ? void 0 : be.cell,
|
|
1847
1848
|
props: (fe = (ae = B.status) == null ? void 0 : ae.getContext) == null ? void 0 : fe.call(ae)
|
|
@@ -1856,7 +1857,7 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1856
1857
|
_: 1
|
|
1857
1858
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
1858
1859
|
], 2),
|
|
1859
|
-
(S(),
|
|
1860
|
+
(S(), W(mt, { to: "body" }, [
|
|
1860
1861
|
d(ua, Oe(e(u).transferDialogProps.value, {
|
|
1861
1862
|
onSubmitted: e(u).fetchData
|
|
1862
1863
|
}), null, 16, ["onSubmitted"]),
|
|
@@ -1872,5 +1873,5 @@ const Ps = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }
|
|
|
1872
1873
|
}
|
|
1873
1874
|
});
|
|
1874
1875
|
export {
|
|
1875
|
-
|
|
1876
|
+
Ia as default
|
|
1876
1877
|
};
|