@feedmepos/mf-inventory-portal 1.0.21-dev.1 → 1.0.22-dev.1
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-Cpk0Wu_0.js → App-DKpBoETt.js} +2 -2
- package/dist/{ApprovalView-p1iGWSs1.js → ApprovalView-DUELMVOt.js} +2 -2
- package/dist/{BindingsDialog-Cs9FB1Kc.js → BindingsDialog-BbwaoH1V.js} +2 -2
- package/dist/{BindingsPicker-5WKT-tQj.js → BindingsPicker-Co91nBu5.js} +1 -1
- package/dist/{BindingsTable-C3Ln6H4O.js → BindingsTable-CfGpcJbV.js} +1 -1
- package/dist/{ClosingDraftView-D27NM_bF.js → ClosingDraftView-CtDu4gYg.js} +2 -2
- package/dist/{ClosingTemplateView-CUwLknJZ.js → ClosingTemplateView-9ugr-E5Y.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-CuMyAMbl.js → DeliveryOrderPrintPreview-D4wDJKJM.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-F4PeKtAh.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C6_Ua9qb.js} +3 -3
- package/dist/{FmMultiselectDialog-BX7To_wd.js → FmMultiselectDialog-fRcvT8PM.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-sLBOIq41.js → FmUnitInput.vue_vue_type_script_setup_true_lang-4xfely-0.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DiJVdFoO.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DCLepeXM.js} +1 -1
- package/dist/{IngredientGroupView-RLmE4LdD.js → IngredientGroupView-BKMbP_tk.js} +2 -2
- package/dist/{IngredientsView-CHIkVwR2.js → IngredientsView-DZ6GaNmh.js} +5 -5
- package/dist/{IntegrationView-xhCjaXot.js → IntegrationView-Cdxe3ek6.js} +5 -5
- package/dist/{InventoryBindingForm-DUlMGem9.js → InventoryBindingForm-Df2xDcAe.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bfa05ZZF.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-uEO5JKUW.js} +3 -3
- package/dist/{InventoryBindingSummary-COU4urVr.js → InventoryBindingSummary-tR7tgq-a.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CCz5uOEd.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CPk_7mxH.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CbrcfUMT.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DV0sQIh_.js} +37 -37
- package/dist/{PublishView-BfXYT0Ni.js → PublishView-CZKgIE-X.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-SNTFMjxx.js → PurchaseOrderPrintPreview-DSluQZDi.js} +1 -1
- package/dist/ReceiveRequestView-Ldz7vr1u.js +2644 -0
- package/dist/{RecipeView-QtT5VCWT.js → RecipeView-CUJIeaWu.js} +4 -4
- package/dist/{StockView-BnfsJgSc.js → StockView-CBtAZjjj.js} +7 -7
- package/dist/{SupplierView-i3_6ei6J.js → SupplierView-Bjb0ygav.js} +482 -480
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BgezEhA2.js → TransferDetails.vue_vue_type_script_setup_true_lang-B0tt7ir6.js} +6 -6
- package/dist/{TransferTemplateView-e7mXYh9Y.js → TransferTemplateView-DN8G_xl8.js} +195 -194
- package/dist/{UnitView-Qq-6ZCju.js → UnitView-C2hi87bo.js} +3 -3
- package/dist/WarehouseView-DSpjmL-N.js +1034 -0
- package/dist/api/stock-estimate.d.ts +1 -1
- package/dist/{app-CNZ_QiI6.js → app-OXMxNgrT.js} +255 -253
- package/dist/app.js +1 -1
- package/dist/{decimal-Dn4Zx4WR.js → decimal-BHadyOEY.js} +1 -1
- package/dist/{feature-CA3VBtrB.js → feature-B9uo-iYZ.js} +394 -387
- package/dist/{format-unit-display-CYO2Ov4U.js → format-unit-display-Cji-r-K6.js} +2 -2
- package/dist/{index-CAf_Z_AY.js → index-B5xhf4x0.js} +1 -1
- package/dist/{index-CAWhMkMX.js → index-B72H3Oxs.js} +2 -2
- package/dist/{stock-7Lb1t4WF.js → stock-BpE4s385.js} +1 -1
- package/dist/stores/integration/netsuite.d.ts +4 -0
- package/dist/stores/stock-estimate.d.ts +1 -1
- package/dist/{supplier-BSvtp7BZ.js → supplier-CB_uu-6p.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/types/forecast.d.ts +6 -0
- package/dist/{use-ingredient-select-dialog-BlULowJ-.js → use-ingredient-select-dialog-C9dRsaoW.js} +1 -1
- package/dist/{use-inventory-binding-dialog-Cx_fu8cj.js → use-inventory-binding-dialog-BNHELUOB.js} +1 -1
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +9 -0
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +2 -0
- package/dist/{vue-i18n-0nfW4sZc.js → vue-i18n-DsGf7G_F.js} +158 -158
- package/package.json +2 -2
- package/dist/ReceiveRequestView-CprLhACC.js +0 -2578
- package/dist/WarehouseView-D-7KEkr9.js +0 -1032
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineComponent as ne, onMounted as ke, computed as B, ref as W, watch as we, inject as Ze, resolveComponent as A, openBlock as V, createElementBlock as G, createElementVNode as t, createVNode as m, withCtx as N, renderSlot as Ae, withDirectives as Pe, normalizeClass as le, vModelText as Ue, reactive as et, h as Z, toDisplayString as D, unref as e, createCommentVNode as oe, Fragment as ve, normalizeStyle as ge, renderList as He, createBlock as se, mergeProps as je, mergeModels as Be, useModel as tt, isRef as Qe, Teleport as st, normalizeProps as ot, guardReactiveProps as lt } from "vue";
|
|
2
|
-
import { J as Ge, aD as he, t as Le, I as nt, aE as at, aF as rt, i as ee, aG as it, a as We, P as Ee, l as xe, X as ye, Q as ce, A as _e, M as ut, E as Y, u as Ke, b as dt, ah as mt, $ as pt, C as Ye, d as ie, aH as fe, ae as ct, a6 as ft, z as yt, h as Ne, _ as vt, B as bt } from "./app-
|
|
2
|
+
import { J as Ge, aD as he, t as Le, I as nt, aE as at, aF as rt, i as ee, aG as it, a as We, P as Ee, l as xe, X as ye, Q as ce, A as _e, M as ut, E as Y, u as Ke, b as dt, ah as mt, $ as pt, C as Ye, d as ie, aH as fe, ae as ct, a6 as ft, z as yt, h as Ne, _ as vt, B as bt } from "./app-OXMxNgrT.js";
|
|
3
3
|
import { useI18n as re } from "@feedmepos/mf-common";
|
|
4
|
-
import { P as K, a as ht, f as gt, t as xt, b as qe, u as _t } from "./format-unit-display-
|
|
4
|
+
import { P as K, a as ht, f as gt, t as xt, b as qe, u as _t } from "./format-unit-display-Cji-r-K6.js";
|
|
5
5
|
import { components as ae, useSnackbar as kt, useProxiedModel as Je, useBreakpoints as wt } from "@feedmepos/ui-library";
|
|
6
6
|
import { storeToRefs as ze } from "pinia";
|
|
7
|
-
import { _ as Tt, b as Ft, F as Ct, a as It } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
8
|
-
import { u as be } from "./feature-
|
|
9
|
-
import { c as St, u as Mt, _ as Ot } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-
|
|
10
|
-
import { u as $t } from "./supplier-
|
|
11
|
-
import { u as Dt } from "./use-ingredient-select-dialog-
|
|
7
|
+
import { _ as Tt, b as Ft, F as Ct, a as It } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-4xfely-0.js";
|
|
8
|
+
import { u as be } from "./feature-B9uo-iYZ.js";
|
|
9
|
+
import { c as St, u as Mt, _ as Ot } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C6_Ua9qb.js";
|
|
10
|
+
import { u as $t } from "./supplier-CB_uu-6p.js";
|
|
11
|
+
import { u as Dt } from "./use-ingredient-select-dialog-C9dRsaoW.js";
|
|
12
12
|
const Vt = { class: "flex flex-col" }, Rt = { class: "flex flex-col" }, At = { class: "flex-1" }, Pt = { class: "flex items-center" }, Ut = { class: "flex-1" }, Bt = { class: "flex-1" }, Lt = /* @__PURE__ */ ne({
|
|
13
13
|
__name: "FmMinMaxInput",
|
|
14
14
|
props: {
|
|
@@ -65,8 +65,8 @@ const Vt = { class: "flex flex-col" }, Rt = { class: "flex flex-col" }, At = { c
|
|
|
65
65
|
+ee(r),
|
|
66
66
|
r.precision
|
|
67
67
|
);
|
|
68
|
-
},
|
|
69
|
-
we([
|
|
68
|
+
}, p = W(o(x.min)), k = W(o(x.max));
|
|
69
|
+
we([p, k], ([h, i]) => {
|
|
70
70
|
const _ = x ?? {}, r = a(h), y = a(i), C = u.value;
|
|
71
71
|
if (h !== "" && r === !0) {
|
|
72
72
|
const w = Le(+h, C);
|
|
@@ -80,9 +80,9 @@ const Vt = { class: "flex flex-col" }, Rt = { class: "flex flex-col" }, At = { c
|
|
|
80
80
|
_.max = null;
|
|
81
81
|
x.min = _.min, x.max = _.max;
|
|
82
82
|
});
|
|
83
|
-
const
|
|
83
|
+
const c = Symbol.for("fm:form-state"), s = Ze(c, null), d = B(() => g.disabled ?? (s == null ? void 0 : s.getDisabled()) ?? !1), S = W(), T = W(), b = W(!1), F = W(!1), $ = B(() => b.value || F.value), L = B(() => [...[
|
|
84
84
|
function() {
|
|
85
|
-
return typeof a(
|
|
85
|
+
return typeof a(p.value) == "string" || typeof a(k.value) == "string" ? "Must be a number" : !0;
|
|
86
86
|
},
|
|
87
87
|
function(_) {
|
|
88
88
|
return !_ || !_.min || !_.max ? !0 : +ee(_.min) > +ee(_.max) ? "Min must be less than or equal to max" : !0;
|
|
@@ -109,17 +109,17 @@ const Vt = { class: "flex flex-col" }, Rt = { class: "flex flex-col" }, At = { c
|
|
|
109
109
|
Pe(t("input", {
|
|
110
110
|
type: "text",
|
|
111
111
|
ref_key: "minInputRef",
|
|
112
|
-
ref:
|
|
112
|
+
ref: S,
|
|
113
113
|
onFocus: i[0] || (i[0] = () => b.value = !0),
|
|
114
114
|
onBlur: i[1] || (i[1] = () => b.value = !1),
|
|
115
|
-
"onUpdate:modelValue": i[2] || (i[2] = (C) =>
|
|
115
|
+
"onUpdate:modelValue": i[2] || (i[2] = (C) => p.value = C),
|
|
116
116
|
class: le({
|
|
117
117
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
118
|
-
"text-fm-color-typo-primary": !
|
|
119
|
-
"text-fm-color-typo-disabled":
|
|
118
|
+
"text-fm-color-typo-primary": !d.value,
|
|
119
|
+
"text-fm-color-typo-disabled": d.value
|
|
120
120
|
})
|
|
121
121
|
}, null, 34), [
|
|
122
|
-
[Ue,
|
|
122
|
+
[Ue, p.value]
|
|
123
123
|
])
|
|
124
124
|
]),
|
|
125
125
|
i[7] || (i[7] = t("div", { class: "block h-32 mx-4 w-[1px] bg-fm-color-neutral-gray-200" }, null, -1)),
|
|
@@ -128,14 +128,14 @@ const Vt = { class: "flex flex-col" }, Rt = { class: "flex flex-col" }, At = { c
|
|
|
128
128
|
Pe(t("input", {
|
|
129
129
|
type: "text",
|
|
130
130
|
ref_key: "maxInputRef",
|
|
131
|
-
ref:
|
|
132
|
-
onFocus: i[3] || (i[3] = () =>
|
|
133
|
-
onBlur: i[4] || (i[4] = () =>
|
|
131
|
+
ref: T,
|
|
132
|
+
onFocus: i[3] || (i[3] = () => F.value = !0),
|
|
133
|
+
onBlur: i[4] || (i[4] = () => F.value = !1),
|
|
134
134
|
"onUpdate:modelValue": i[5] || (i[5] = (C) => k.value = C),
|
|
135
135
|
class: le({
|
|
136
136
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
137
|
-
"text-fm-color-typo-primary": !
|
|
138
|
-
"text-fm-color-typo-disabled":
|
|
137
|
+
"text-fm-color-typo-primary": !d.value,
|
|
138
|
+
"text-fm-color-typo-disabled": d.value
|
|
139
139
|
})
|
|
140
140
|
}, null, 34), [
|
|
141
141
|
[Ue, k.value]
|
|
@@ -172,38 +172,38 @@ function Nt(f, g) {
|
|
|
172
172
|
function qt(f) {
|
|
173
173
|
const g = it(f), x = ee(f);
|
|
174
174
|
return function(u) {
|
|
175
|
-
const o = !(u != null && u.min) || g(u.min) === !0,
|
|
176
|
-
return !o && !
|
|
175
|
+
const o = !(u != null && u.min) || g(u.min) === !0, p = !(u != null && u.max) || g(u.max) === !0;
|
|
176
|
+
return !o && !p ? `Min & max must be a multiple of ${x}` : o ? p ? !0 : `Max must be a multiple of ${x}` : `Min must be a multiple of ${x}`;
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
179
|
var H = /* @__PURE__ */ ((f) => (f.Code = "Code", f.Name = "Name", f.DefaultAmount = "DefaultAmount", f.Limit = "Limit", f.Step = "Step", f.Cost = "Cost", f.Delete = "Delete", f))(H || {});
|
|
180
180
|
function zt(f, g = {}) {
|
|
181
181
|
const { t: x } = re(), a = We(), u = be(), o = et({});
|
|
182
182
|
ke(() => {
|
|
183
|
-
for (const
|
|
184
|
-
if (!
|
|
183
|
+
for (const c of f.items) {
|
|
184
|
+
if (!c.totalCost)
|
|
185
185
|
continue;
|
|
186
|
-
const s = St(
|
|
186
|
+
const s = St(c.sku, c.quantity, c.measurement, {
|
|
187
187
|
supplier: f.supplier
|
|
188
|
-
}),
|
|
189
|
-
s ? o[
|
|
188
|
+
}), d = c.totalCost ?? Ee.reset();
|
|
189
|
+
s ? o[c.sku._id] = s.amount !== d.amount || s.precision !== d.precision : o[c.sku._id] = !0;
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
|
-
const
|
|
192
|
+
const p = [
|
|
193
193
|
{
|
|
194
194
|
id: "Code",
|
|
195
195
|
header: () => x("inventory.transfer.form.items.table.Code"),
|
|
196
196
|
accessorKey: "code",
|
|
197
197
|
size: 180,
|
|
198
|
-
cell(
|
|
199
|
-
const s =
|
|
198
|
+
cell(c) {
|
|
199
|
+
const s = c.row.original;
|
|
200
200
|
return Z("div", [
|
|
201
201
|
Z(ae.FmTextField, {
|
|
202
202
|
modelValue: s.code,
|
|
203
|
-
"onUpdate:modelValue": (
|
|
203
|
+
"onUpdate:modelValue": (d) => {
|
|
204
204
|
f.updateItem({
|
|
205
205
|
...s,
|
|
206
|
-
code:
|
|
206
|
+
code: d
|
|
207
207
|
});
|
|
208
208
|
},
|
|
209
209
|
helperText: s.sku.code,
|
|
@@ -219,15 +219,15 @@ function zt(f, g = {}) {
|
|
|
219
219
|
id: "Name",
|
|
220
220
|
header: () => x("inventory.transfer.form.items.table.Name"),
|
|
221
221
|
minSize: 300,
|
|
222
|
-
cell(
|
|
223
|
-
const s =
|
|
222
|
+
cell(c) {
|
|
223
|
+
const s = c.row.original;
|
|
224
224
|
return Z("div", [
|
|
225
225
|
Z(ae.FmTextField, {
|
|
226
226
|
modelValue: s.name,
|
|
227
|
-
"onUpdate:modelValue": (
|
|
227
|
+
"onUpdate:modelValue": (d) => {
|
|
228
228
|
f.updateItem({
|
|
229
229
|
...s,
|
|
230
|
-
name:
|
|
230
|
+
name: d
|
|
231
231
|
});
|
|
232
232
|
},
|
|
233
233
|
helperText: s.sku.name,
|
|
@@ -243,12 +243,12 @@ function zt(f, g = {}) {
|
|
|
243
243
|
id: "DefaultAmount",
|
|
244
244
|
header: () => x("inventory.transfer.form.items.table.DefaultAmount"),
|
|
245
245
|
minSize: 200,
|
|
246
|
-
cell(
|
|
247
|
-
var
|
|
248
|
-
const s =
|
|
246
|
+
cell(c) {
|
|
247
|
+
var F;
|
|
248
|
+
const s = c.row.original, d = a.skuById[s.sku._id], S = a.unitById[(F = d.unit) == null ? void 0 : F._id], T = S.measurements.find(($) => {
|
|
249
249
|
var L;
|
|
250
250
|
return ((L = s.measurement) == null ? void 0 : L.id) === $.id;
|
|
251
|
-
}), b = s.sku.unit._id !==
|
|
251
|
+
}), b = s.sku.unit._id !== d.unit._id || !S || s.measurement && !T;
|
|
252
252
|
return Z(Tt, {
|
|
253
253
|
style: {
|
|
254
254
|
flex: "1 1 0%"
|
|
@@ -256,11 +256,11 @@ function zt(f, g = {}) {
|
|
|
256
256
|
modelValue: {
|
|
257
257
|
amount: s.quantity ?? { amount: 1, precision: 0 },
|
|
258
258
|
// NOTE: leave this reading from row.sku.unit and row.measurement instead,
|
|
259
|
-
measurement: s.measurement ?? (s.sku.unit._id !==
|
|
259
|
+
measurement: s.measurement ?? (s.sku.unit._id !== d.unit._id ? { ...s.sku.unit, id: "", conversion: { amount: 1, precision: 0 } } : null)
|
|
260
260
|
},
|
|
261
261
|
disabled: f.disabled,
|
|
262
262
|
key: s.sku._id,
|
|
263
|
-
unit:
|
|
263
|
+
unit: S,
|
|
264
264
|
"onUpdate:modelValue": ($) => {
|
|
265
265
|
$ && f.updateItem({
|
|
266
266
|
...s,
|
|
@@ -298,8 +298,8 @@ function zt(f, g = {}) {
|
|
|
298
298
|
header: () => "Limit",
|
|
299
299
|
// TODO: i18n,
|
|
300
300
|
minSize: 280,
|
|
301
|
-
cell(
|
|
302
|
-
const s =
|
|
301
|
+
cell(c) {
|
|
302
|
+
const s = c.row.original;
|
|
303
303
|
return Z(Lt, {
|
|
304
304
|
style: {
|
|
305
305
|
flex: "1 1 0%"
|
|
@@ -311,9 +311,9 @@ function zt(f, g = {}) {
|
|
|
311
311
|
disabled: f.disabled,
|
|
312
312
|
key: s.sku._id,
|
|
313
313
|
unit: s.sku.unit,
|
|
314
|
-
"onUpdate:modelValue": (
|
|
315
|
-
const
|
|
316
|
-
|
|
314
|
+
"onUpdate:modelValue": (d) => {
|
|
315
|
+
const S = { ...s };
|
|
316
|
+
d != null && d.min ? S.minimumQuantity = d.min : S.minimumQuantity = null, d != null && d.max ? S.maximumQuantity = d.max : S.maximumQuantity = null, f.updateItem(S);
|
|
317
317
|
},
|
|
318
318
|
rules: [
|
|
319
319
|
Et({ max: !1 }),
|
|
@@ -335,15 +335,15 @@ function zt(f, g = {}) {
|
|
|
335
335
|
id: "Step",
|
|
336
336
|
header: () => x("inventory.transfer.form.items.table.Step"),
|
|
337
337
|
minSize: 100,
|
|
338
|
-
cell(
|
|
339
|
-
const s =
|
|
338
|
+
cell(c) {
|
|
339
|
+
const s = c.row.original;
|
|
340
340
|
return Z(ae.FmTextField, {
|
|
341
341
|
modelValue: ee(s.quantityStep ?? Ee.reset(), !1),
|
|
342
342
|
key: s.sku._id,
|
|
343
|
-
"onUpdate:modelValue": (
|
|
343
|
+
"onUpdate:modelValue": (d) => {
|
|
344
344
|
f.updateItem({
|
|
345
345
|
...s,
|
|
346
|
-
quantityStep: ce(+
|
|
346
|
+
quantityStep: ce(+d)
|
|
347
347
|
});
|
|
348
348
|
},
|
|
349
349
|
rules: [
|
|
@@ -360,8 +360,8 @@ function zt(f, g = {}) {
|
|
|
360
360
|
{
|
|
361
361
|
id: "Delete",
|
|
362
362
|
header: "",
|
|
363
|
-
cell(
|
|
364
|
-
const s =
|
|
363
|
+
cell(c) {
|
|
364
|
+
const s = c.row.original;
|
|
365
365
|
return Z("div", { class: "flex items-center" }, [
|
|
366
366
|
u.usePurchaseOrderV2 ? Z(
|
|
367
367
|
ae.FmTooltip,
|
|
@@ -379,7 +379,7 @@ function zt(f, g = {}) {
|
|
|
379
379
|
size: "md",
|
|
380
380
|
disabled: f.disabled,
|
|
381
381
|
onClick: async () => {
|
|
382
|
-
const
|
|
382
|
+
const d = {
|
|
383
383
|
id: crypto.randomUUID(),
|
|
384
384
|
sku: s.sku,
|
|
385
385
|
code: s.sku.code,
|
|
@@ -388,7 +388,7 @@ function zt(f, g = {}) {
|
|
|
388
388
|
quantityStep: ce(1),
|
|
389
389
|
minimumQuantity: ce(1)
|
|
390
390
|
};
|
|
391
|
-
f.duplicateItem(
|
|
391
|
+
f.duplicateItem(d);
|
|
392
392
|
}
|
|
393
393
|
});
|
|
394
394
|
},
|
|
@@ -421,14 +421,14 @@ function zt(f, g = {}) {
|
|
|
421
421
|
];
|
|
422
422
|
return {
|
|
423
423
|
columnDefs: B(() => {
|
|
424
|
-
const
|
|
424
|
+
const c = be(), s = [...p];
|
|
425
425
|
if (Object.keys(g).length > 0)
|
|
426
|
-
for (const [
|
|
427
|
-
|
|
428
|
-
...
|
|
429
|
-
id:
|
|
426
|
+
for (const [d, S] of Object.entries(g))
|
|
427
|
+
s.splice(Number(d), 0, {
|
|
428
|
+
...S,
|
|
429
|
+
id: d
|
|
430
430
|
});
|
|
431
|
-
return
|
|
431
|
+
return c.enableTotalCost && f.transferType === K.PURCHASE ? s : s.filter((d) => d.id !== "Cost");
|
|
432
432
|
})
|
|
433
433
|
};
|
|
434
434
|
}
|
|
@@ -447,7 +447,7 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
447
447
|
return a;
|
|
448
448
|
}
|
|
449
449
|
return (a, u) => {
|
|
450
|
-
var
|
|
450
|
+
var p, k, c, s, d, S, T, b, F, $, L, h, i, _, r, y, C, w, v, te, J, E, P, l, n, I, R, j, q, M;
|
|
451
451
|
const o = A("FmLabel");
|
|
452
452
|
return V(), G("div", Ht, [
|
|
453
453
|
t("div", jt, [
|
|
@@ -457,8 +457,8 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
457
457
|
]),
|
|
458
458
|
t("div", null, [
|
|
459
459
|
m(e(Y), {
|
|
460
|
-
render: (
|
|
461
|
-
props: (
|
|
460
|
+
render: (c = (k = (p = a.cellByColId.Delete) == null ? void 0 : p.column) == null ? void 0 : k.columnDef) == null ? void 0 : c.cell,
|
|
461
|
+
props: (d = (s = a.cellByColId.Delete) == null ? void 0 : s.getContext) == null ? void 0 : d.call(s)
|
|
462
462
|
}, null, 8, ["render", "props"])
|
|
463
463
|
])
|
|
464
464
|
]),
|
|
@@ -468,8 +468,8 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
468
468
|
label: e(g)(`inventory.transfer.form.items.table.${e(H).Code}`)
|
|
469
469
|
}, null, 8, ["label"]),
|
|
470
470
|
m(e(Y), {
|
|
471
|
-
render: (b = (
|
|
472
|
-
props: ($ = (
|
|
471
|
+
render: (b = (T = (S = a.cellByColId[e(H).Code]) == null ? void 0 : S.column) == null ? void 0 : T.columnDef) == null ? void 0 : b.cell,
|
|
472
|
+
props: ($ = (F = a.cellByColId[e(H).Code]) == null ? void 0 : F.getContext) == null ? void 0 : $.call(F)
|
|
473
473
|
}, null, 8, ["render", "props"]),
|
|
474
474
|
u[0] || (u[0] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
475
475
|
]),
|
|
@@ -513,7 +513,7 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
513
513
|
}, null, 8, ["label"]),
|
|
514
514
|
m(e(Y), {
|
|
515
515
|
render: (j = (R = (I = a.cellByColId[e(H).Limit]) == null ? void 0 : I.column) == null ? void 0 : R.columnDef) == null ? void 0 : j.cell,
|
|
516
|
-
props: (
|
|
516
|
+
props: (M = (q = a.cellByColId[e(H).Limit]) == null ? void 0 : q.getContext) == null ? void 0 : M.call(q)
|
|
517
517
|
}, null, 8, ["render", "props"]),
|
|
518
518
|
u[4] || (u[4] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
519
519
|
])
|
|
@@ -539,13 +539,13 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
539
539
|
style: ge({ backgroundColor: x.errorMessage ? "#ffd6d6" : void 0 })
|
|
540
540
|
}, [
|
|
541
541
|
(V(!0), G(ve, null, He(x.row.getVisibleCells(), (u) => {
|
|
542
|
-
var o,
|
|
542
|
+
var o, p, k, c, s;
|
|
543
543
|
return V(), G("td", {
|
|
544
544
|
key: u.id,
|
|
545
545
|
class: le(["text-fm-color-typo-primary", ((o = g(u)) == null ? void 0 : o.cellClass) ?? "px-16", "py-2"]),
|
|
546
546
|
style: ge({
|
|
547
|
-
width: (
|
|
548
|
-
maxWidth: (
|
|
547
|
+
width: (p = g(u)) != null && p.width ? (k = g(u)) == null ? void 0 : k.width : u.column.getSize() !== 0 ? `${u.column.getSize()}px` : void 0,
|
|
548
|
+
maxWidth: (c = g(u)) == null ? void 0 : c.maxWidth,
|
|
549
549
|
textAlign: ((s = g(u)) == null ? void 0 : s.textAlign) ?? "left"
|
|
550
550
|
})
|
|
551
551
|
}, [
|
|
@@ -574,14 +574,14 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
574
574
|
},
|
|
575
575
|
emits: ["update:disabled"],
|
|
576
576
|
setup(f, { expose: g, emit: x }) {
|
|
577
|
-
const a = f, u = x, o = Ge(), { t:
|
|
577
|
+
const a = f, u = x, o = Ge(), { t: p } = re(), k = W({}), c = Ke(), s = We(), d = $t(), S = be(), T = dt();
|
|
578
578
|
we(
|
|
579
579
|
() => o.purchaseOrder.items.length,
|
|
580
580
|
() => {
|
|
581
581
|
k.value = {};
|
|
582
582
|
}
|
|
583
|
-
),
|
|
584
|
-
location && (o.purchaseOrder.supplier || (o.purchaseOrder.supplier =
|
|
583
|
+
), c.watchLocation(async () => {
|
|
584
|
+
location && (o.purchaseOrder.supplier || (o.purchaseOrder.supplier = d.suppliers.find((l) => l) ?? o.purchaseOrder.supplier));
|
|
585
585
|
});
|
|
586
586
|
const b = Mt(
|
|
587
587
|
() => o.purchaseOrder,
|
|
@@ -591,7 +591,7 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
591
591
|
supplier: l.supplier ?? (o == null ? void 0 : o.purchaseOrder.supplier)
|
|
592
592
|
};
|
|
593
593
|
}
|
|
594
|
-
),
|
|
594
|
+
), F = B({
|
|
595
595
|
get() {
|
|
596
596
|
var l, n;
|
|
597
597
|
return typeof ((n = (l = o.purchaseOrder) == null ? void 0 : l.supplier) == null ? void 0 : n.internal) == "string" ? K.TRANSFER : K.PURCHASE;
|
|
@@ -611,7 +611,7 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
611
611
|
}
|
|
612
612
|
});
|
|
613
613
|
async function h() {
|
|
614
|
-
const l = await
|
|
614
|
+
const l = await T.checkCustomFieldCodes({
|
|
615
615
|
beforeStart: async () => {
|
|
616
616
|
u("update:disabled", !0);
|
|
617
617
|
},
|
|
@@ -696,7 +696,7 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
696
696
|
return a.disabled;
|
|
697
697
|
}
|
|
698
698
|
},
|
|
699
|
-
|
|
699
|
+
T.transferTemplateColumnDefs({
|
|
700
700
|
onUpdate: (l, n, I, R) => {
|
|
701
701
|
if (l < 0 || l >= o.purchaseOrder.items.length) return;
|
|
702
702
|
const j = o.purchaseOrder.items[l];
|
|
@@ -711,22 +711,22 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
711
711
|
})
|
|
712
712
|
), J = B(() => te.columnDefs.value), { promptSelectIngredients: E } = Dt();
|
|
713
713
|
async function P() {
|
|
714
|
-
const n = s.skus.map((
|
|
715
|
-
label:
|
|
716
|
-
sublabel:
|
|
717
|
-
value:
|
|
718
|
-
})).filter((
|
|
714
|
+
const n = s.skus.map((M) => ({
|
|
715
|
+
label: M.name,
|
|
716
|
+
sublabel: M.code,
|
|
717
|
+
value: M
|
|
718
|
+
})).filter((M) => {
|
|
719
719
|
var U;
|
|
720
|
-
return (U = o.purchaseOrder.items) == null ? void 0 : U.find((z) => z.sku._id ===
|
|
721
|
-
}).map((
|
|
722
|
-
n.map((
|
|
723
|
-
(
|
|
724
|
-
const U = s.skuById[
|
|
720
|
+
return (U = o.purchaseOrder.items) == null ? void 0 : U.find((z) => z.sku._id === M.value._id);
|
|
721
|
+
}).map((M) => M.value), I = o.purchaseOrder.items ?? [], R = await E(
|
|
722
|
+
n.map((M) => M._id),
|
|
723
|
+
(M) => {
|
|
724
|
+
const U = s.skuById[M], z = I.find((Q) => Q.sku._id === U._id);
|
|
725
725
|
if (z)
|
|
726
726
|
return z;
|
|
727
727
|
const X = { amount: 1, precision: ye(U.unit) };
|
|
728
728
|
return {
|
|
729
|
-
id:
|
|
729
|
+
id: S.usePurchaseOrderV2 ? crypto.randomUUID() : void 0,
|
|
730
730
|
sku: U,
|
|
731
731
|
code: U.code,
|
|
732
732
|
name: U.name,
|
|
@@ -741,20 +741,20 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
741
741
|
}
|
|
742
742
|
);
|
|
743
743
|
if (!R) return;
|
|
744
|
-
const j = R.map((
|
|
745
|
-
for (const
|
|
746
|
-
const U = I.filter((z) => z.sku._id ===
|
|
744
|
+
const j = R.map((M) => M.sku._id), q = [];
|
|
745
|
+
for (const M of j) {
|
|
746
|
+
const U = I.filter((z) => z.sku._id === M);
|
|
747
747
|
if (U.length > 0)
|
|
748
748
|
q.push(...U);
|
|
749
749
|
else {
|
|
750
|
-
const z = R.find((X) => X.sku._id ===
|
|
750
|
+
const z = R.find((X) => X.sku._id === M);
|
|
751
751
|
z && q.push(z);
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
|
-
q.sort((
|
|
754
|
+
q.sort((M, U) => M.sku.code.localeCompare(U.sku.code)), o.purchaseOrder.items = q;
|
|
755
755
|
}
|
|
756
756
|
return (l, n) => {
|
|
757
|
-
const I = A("FmTextField"), R = A("FmSelect"), j = A("FmTextarea"), q = A("FmButton"),
|
|
757
|
+
const I = A("FmTextField"), R = A("FmSelect"), j = A("FmTextarea"), q = A("FmButton"), M = A("FmTable"), U = A("FmFormGroup"), z = A("FmForm");
|
|
758
758
|
return V(), se(z, {
|
|
759
759
|
ref_key: "formRef",
|
|
760
760
|
ref: w,
|
|
@@ -767,28 +767,28 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
767
767
|
t("div", is, [
|
|
768
768
|
t("div", us, [
|
|
769
769
|
m(I, {
|
|
770
|
-
label: e(
|
|
770
|
+
label: e(p)("inventory.transfer.form.name"),
|
|
771
771
|
"label-mark": "required",
|
|
772
772
|
modelValue: e(o).name,
|
|
773
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
773
|
+
"onUpdate:modelValue": n[0] || (n[0] = (O) => e(o).name = O),
|
|
774
774
|
rules: [e(xe)()]
|
|
775
775
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
776
776
|
m(R, {
|
|
777
|
-
label: e(
|
|
778
|
-
"model-value":
|
|
779
|
-
"onUpdate:modelValue": n[1] || (n[1] = (
|
|
777
|
+
label: e(p)("inventory.transfer.form.type.title"),
|
|
778
|
+
"model-value": F.value,
|
|
779
|
+
"onUpdate:modelValue": n[1] || (n[1] = (O) => F.value = O),
|
|
780
780
|
items: [
|
|
781
781
|
{
|
|
782
|
-
label: e(
|
|
782
|
+
label: e(p)("inventory.transfer.form.type.purchase"),
|
|
783
783
|
value: e(K).PURCHASE,
|
|
784
784
|
disabled: !e(b).locationOptionsTypePurchase.value.length,
|
|
785
|
-
sublabel: e(b).locationOptionsTypePurchase.value.length ? void 0 : e(
|
|
785
|
+
sublabel: e(b).locationOptionsTypePurchase.value.length ? void 0 : e(p)("inventory.transfer.form.noSupplierAvailable")
|
|
786
786
|
},
|
|
787
787
|
{
|
|
788
|
-
label: e(
|
|
788
|
+
label: e(p)("inventory.transfer.form.type.transfer"),
|
|
789
789
|
value: e(K).TRANSFER,
|
|
790
790
|
disabled: !e(b).locationOptionsTypeTransfer.value.length,
|
|
791
|
-
sublabel: e(b).locationOptionsTypeTransfer.value.length ? void 0 : e(
|
|
791
|
+
sublabel: e(b).locationOptionsTypeTransfer.value.length ? void 0 : e(p)("inventory.transfer.form.noLocationAvailable")
|
|
792
792
|
}
|
|
793
793
|
],
|
|
794
794
|
rules: [e(_e)(1)($.value)]
|
|
@@ -799,50 +799,50 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
799
799
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
800
800
|
l.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
801
801
|
])
|
|
802
|
-
}, D(e(pt)(
|
|
802
|
+
}, D(e(pt)(F.value)), 3)
|
|
803
803
|
]),
|
|
804
804
|
_: 1
|
|
805
805
|
}, 8, ["label", "model-value", "items", "rules"]),
|
|
806
806
|
m(R, {
|
|
807
|
-
label:
|
|
807
|
+
label: F.value === e(K).PURCHASE ? e(p)("inventory.transfer.form.purchaseFrom") : e(p)("inventory.transfer.form.transferFrom"),
|
|
808
808
|
modelValue: L.value,
|
|
809
|
-
"onUpdate:modelValue": n[2] || (n[2] = (
|
|
809
|
+
"onUpdate:modelValue": n[2] || (n[2] = (O) => L.value = O),
|
|
810
810
|
items: $.value
|
|
811
811
|
}, {
|
|
812
|
-
"menu-wrapper": N((
|
|
812
|
+
"menu-wrapper": N((O) => {
|
|
813
813
|
var Q;
|
|
814
814
|
return [
|
|
815
|
-
m(Ot, je(
|
|
815
|
+
m(Ot, je(O, {
|
|
816
816
|
items: $.value,
|
|
817
817
|
"model-value": (Q = l.modelValue.purchaseOrder.supplier) == null ? void 0 : Q._id
|
|
818
818
|
}), null, 16, ["items", "model-value"])
|
|
819
819
|
];
|
|
820
820
|
}),
|
|
821
821
|
default: N(() => {
|
|
822
|
-
var
|
|
822
|
+
var O;
|
|
823
823
|
return [
|
|
824
824
|
t("span", {
|
|
825
825
|
class: le([
|
|
826
826
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
827
827
|
l.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
828
828
|
])
|
|
829
|
-
}, D((
|
|
829
|
+
}, D((O = $.value.find((Q) => Q.value === L.value)) == null ? void 0 : O.label), 3)
|
|
830
830
|
];
|
|
831
831
|
}),
|
|
832
832
|
_: 1
|
|
833
833
|
}, 8, ["label", "modelValue", "items"]),
|
|
834
834
|
m(I, {
|
|
835
|
-
label: e(
|
|
835
|
+
label: e(p)("inventory.transfer.form.reference"),
|
|
836
836
|
"label-mark": "optional",
|
|
837
837
|
modelValue: e(o).purchaseOrder.ref,
|
|
838
|
-
"onUpdate:modelValue": n[3] || (n[3] = (
|
|
838
|
+
"onUpdate:modelValue": n[3] || (n[3] = (O) => e(o).purchaseOrder.ref = O)
|
|
839
839
|
}, null, 8, ["label", "modelValue"]),
|
|
840
840
|
m(j, {
|
|
841
|
-
label: e(
|
|
841
|
+
label: e(p)("inventory.transfer.form.remark"),
|
|
842
842
|
"label-mark": "optional",
|
|
843
843
|
"max-length": 240,
|
|
844
844
|
modelValue: C.value,
|
|
845
|
-
"onUpdate:modelValue": n[4] || (n[4] = (
|
|
845
|
+
"onUpdate:modelValue": n[4] || (n[4] = (O) => C.value = O),
|
|
846
846
|
class: le({ "text-fm-color-typo-disabled": l.disabled })
|
|
847
847
|
}, null, 8, ["label", "modelValue", "class"])
|
|
848
848
|
])
|
|
@@ -859,7 +859,7 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
859
859
|
onClick: e(i)
|
|
860
860
|
}, null, 8, ["disabled", "onClick"])
|
|
861
861
|
]),
|
|
862
|
-
m(
|
|
862
|
+
m(M, {
|
|
863
863
|
"column-defs": e(_),
|
|
864
864
|
"row-data": e(r),
|
|
865
865
|
"shrink-at": 9999,
|
|
@@ -878,47 +878,48 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
878
878
|
]),
|
|
879
879
|
t("div", cs, [
|
|
880
880
|
t("div", fs, [
|
|
881
|
-
t("div", ys, D(e(
|
|
882
|
-
|
|
881
|
+
t("div", ys, D(e(p)("inventory.transfer.form.items.title")), 1),
|
|
882
|
+
e(T).isEnabled ? (V(), se(q, {
|
|
883
|
+
key: 0,
|
|
883
884
|
label: "Check NetSuite",
|
|
884
885
|
"prepend-icon": "troubleshoot",
|
|
885
886
|
variant: "secondary",
|
|
886
887
|
onClick: h,
|
|
887
888
|
size: "md"
|
|
888
|
-
}),
|
|
889
|
+
})) : oe("", !0),
|
|
889
890
|
m(q, {
|
|
890
891
|
disabled: l.disabled,
|
|
891
|
-
label: e(
|
|
892
|
+
label: e(p)("inventory.transfer.form.items.addItem"),
|
|
892
893
|
"prepend-icon": "add",
|
|
893
894
|
variant: "plain",
|
|
894
895
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
895
|
-
onClick: n[5] || (n[5] = (
|
|
896
|
+
onClick: n[5] || (n[5] = (O) => P()),
|
|
896
897
|
size: "md"
|
|
897
898
|
}, null, 8, ["disabled", "label"])
|
|
898
899
|
]),
|
|
899
|
-
(V(), se(
|
|
900
|
+
(V(), se(M, {
|
|
900
901
|
"column-defs": J.value,
|
|
901
902
|
"row-data": e(o).purchaseOrder.items,
|
|
902
|
-
key: e(o).purchaseOrder.items.map((
|
|
903
|
+
key: e(o).purchaseOrder.items.map((O) => O.sku._id).join("."),
|
|
903
904
|
"hide-footer": "",
|
|
904
905
|
"page-size": e(o).purchaseOrder.items.length
|
|
905
906
|
}, {
|
|
906
|
-
"table-row": N((
|
|
907
|
+
"table-row": N((O) => [
|
|
907
908
|
m(rs, {
|
|
908
|
-
row:
|
|
909
|
-
errorMessage: k.value[
|
|
909
|
+
row: O,
|
|
910
|
+
errorMessage: k.value[O.index],
|
|
910
911
|
"onUpdate:item": n[6] || (n[6] = (Q) => v.value.updateItem(Q)),
|
|
911
912
|
disabled: l.disabled
|
|
912
913
|
}, null, 8, ["row", "errorMessage", "disabled"])
|
|
913
914
|
]),
|
|
914
|
-
"list-row": N((
|
|
915
|
+
"list-row": N((O) => [
|
|
915
916
|
(V(), se(Ye, {
|
|
916
|
-
row:
|
|
917
|
+
row: O,
|
|
917
918
|
key: e(o).purchaseOrder.items.map((Q) => Q.sku._id).join(".")
|
|
918
919
|
}, {
|
|
919
920
|
default: N((Q) => [
|
|
920
921
|
m(os, {
|
|
921
|
-
row:
|
|
922
|
+
row: O,
|
|
922
923
|
"cell-by-col-id": Q,
|
|
923
924
|
"onUpdate:item": n[7] || (n[7] = (ue) => v.value.updateItem(ue)),
|
|
924
925
|
disabled: l.disabled
|
|
@@ -953,7 +954,7 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
953
954
|
emits: /* @__PURE__ */ Be(["update:show", "submitted"], ["update:disabled"]),
|
|
954
955
|
setup(f, { expose: g, emit: x }) {
|
|
955
956
|
var _;
|
|
956
|
-
const a = f, u = x, o = ht(),
|
|
957
|
+
const a = f, u = x, o = ht(), p = kt(), { t: k } = re(), c = Je(a, "show");
|
|
957
958
|
function s() {
|
|
958
959
|
return {
|
|
959
960
|
_id: "",
|
|
@@ -984,15 +985,15 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
984
985
|
}
|
|
985
986
|
};
|
|
986
987
|
}
|
|
987
|
-
const
|
|
988
|
+
const d = W(a.modelValue ?? s()), S = W(((_ = a.modelValue) == null ? void 0 : _._id) ?? `${Math.random()}`);
|
|
988
989
|
we(
|
|
989
990
|
() => a.show,
|
|
990
991
|
(r) => {
|
|
991
992
|
var y;
|
|
992
|
-
r && (
|
|
993
|
+
r && (d.value = a.modelValue ?? s(), S.value = ((y = a.modelValue) == null ? void 0 : y._id) ?? `${Math.random()}`);
|
|
993
994
|
}
|
|
994
995
|
);
|
|
995
|
-
const
|
|
996
|
+
const T = tt(f, "disabled"), b = B(() => {
|
|
996
997
|
switch (a.mode) {
|
|
997
998
|
case ie.READ:
|
|
998
999
|
return "";
|
|
@@ -1002,66 +1003,66 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1002
1003
|
return k("inventory.transfer.template.update.title");
|
|
1003
1004
|
}
|
|
1004
1005
|
return "";
|
|
1005
|
-
}),
|
|
1006
|
+
}), F = W();
|
|
1006
1007
|
g({
|
|
1007
1008
|
validateInputs: () => {
|
|
1008
1009
|
var r, y;
|
|
1009
|
-
(y = (r =
|
|
1010
|
+
(y = (r = F.value) == null ? void 0 : r.validateInputs) == null || y.call(r);
|
|
1010
1011
|
},
|
|
1011
1012
|
resetInputsValidation: () => {
|
|
1012
1013
|
var r, y;
|
|
1013
|
-
(y = (r =
|
|
1014
|
+
(y = (r = F.value) == null ? void 0 : r.resetInputsValidation) == null || y.call(r);
|
|
1014
1015
|
},
|
|
1015
1016
|
resetInputs: () => {
|
|
1016
1017
|
var r, y;
|
|
1017
|
-
(y = (r =
|
|
1018
|
+
(y = (r = F.value) == null ? void 0 : r.resetInputs) == null || y.call(r);
|
|
1018
1019
|
}
|
|
1019
1020
|
});
|
|
1020
1021
|
async function $() {
|
|
1021
1022
|
var y, C;
|
|
1022
|
-
const r =
|
|
1023
|
+
const r = d.value;
|
|
1023
1024
|
if (r) {
|
|
1024
|
-
|
|
1025
|
+
T.value = !0, (((y = r.purchaseOrder.supplier) == null ? void 0 : y.internal) === fe.enum.warehouse || ((C = r.purchaseOrder.supplier) == null ? void 0 : C.internal) === fe.enum.restaurant) && (r.purchaseOrder.items = r.purchaseOrder.items.map(
|
|
1025
1026
|
({ totalCost: w, ...v }) => v
|
|
1026
1027
|
));
|
|
1027
1028
|
try {
|
|
1028
|
-
await o.createTemplate(r), await new Promise((w) => setTimeout(w, 1e3)),
|
|
1029
|
+
await o.createTemplate(r), await new Promise((w) => setTimeout(w, 1e3)), p.open({
|
|
1029
1030
|
title: k("inventory.transfer.template.create.success"),
|
|
1030
1031
|
message: k("inventory.transfer.template.create.successMessage"),
|
|
1031
1032
|
type: "success"
|
|
1032
1033
|
}), u("update:show", !1), u("submitted");
|
|
1033
1034
|
} catch (w) {
|
|
1034
|
-
|
|
1035
|
+
p.open({
|
|
1035
1036
|
title: k("inventory.transfer.template.create.error"),
|
|
1036
1037
|
message: k("inventory.transfer.template.create.errorMessage"),
|
|
1037
1038
|
type: "error"
|
|
1038
1039
|
}), console.error("Error in creating transfer template", w);
|
|
1039
1040
|
} finally {
|
|
1040
|
-
|
|
1041
|
+
T.value = !1;
|
|
1041
1042
|
}
|
|
1042
1043
|
}
|
|
1043
1044
|
}
|
|
1044
1045
|
async function L() {
|
|
1045
1046
|
var y, C;
|
|
1046
|
-
const r =
|
|
1047
|
+
const r = d.value;
|
|
1047
1048
|
if (r) {
|
|
1048
|
-
|
|
1049
|
+
T.value = !0, (((y = r.purchaseOrder.supplier) == null ? void 0 : y.internal) === fe.enum.warehouse || ((C = r.purchaseOrder.supplier) == null ? void 0 : C.internal) === fe.enum.restaurant) && (r.purchaseOrder.items = r.purchaseOrder.items.map(
|
|
1049
1050
|
({ totalCost: w, ...v }) => v
|
|
1050
1051
|
));
|
|
1051
1052
|
try {
|
|
1052
|
-
await o.updateTemplate(r), await new Promise((w) => setTimeout(w, 1e3)),
|
|
1053
|
+
await o.updateTemplate(r), await new Promise((w) => setTimeout(w, 1e3)), p.open({
|
|
1053
1054
|
title: k("inventory.transfer.template.update.success"),
|
|
1054
1055
|
message: k("inventory.transfer.template.update.successMessage"),
|
|
1055
1056
|
type: "success"
|
|
1056
1057
|
}), u("update:show", !1), u("submitted");
|
|
1057
1058
|
} catch (w) {
|
|
1058
|
-
|
|
1059
|
+
p.open({
|
|
1059
1060
|
title: k("inventory.transfer.template.update.error"),
|
|
1060
1061
|
message: k("inventory.transfer.template.update.errorMessage"),
|
|
1061
1062
|
type: "error"
|
|
1062
1063
|
}), console.error("Error in updating transfer template", w);
|
|
1063
1064
|
} finally {
|
|
1064
|
-
|
|
1065
|
+
T.value = !1;
|
|
1065
1066
|
}
|
|
1066
1067
|
}
|
|
1067
1068
|
}
|
|
@@ -1075,13 +1076,13 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1075
1076
|
}
|
|
1076
1077
|
function i() {
|
|
1077
1078
|
var r, y;
|
|
1078
|
-
(y = (r =
|
|
1079
|
+
(y = (r = F.value) == null ? void 0 : r.validateInputs) == null || y.call(r);
|
|
1079
1080
|
}
|
|
1080
1081
|
return (r, y) => {
|
|
1081
1082
|
const C = A("FmButton"), w = A("FmSideSheet");
|
|
1082
1083
|
return V(), se(w, {
|
|
1083
|
-
modelValue: e(
|
|
1084
|
-
"onUpdate:modelValue": y[3] || (y[3] = (v) => Qe(
|
|
1084
|
+
modelValue: e(c),
|
|
1085
|
+
"onUpdate:modelValue": y[3] || (y[3] = (v) => Qe(c) ? c.value = v : null),
|
|
1085
1086
|
"dismiss-away": "",
|
|
1086
1087
|
"close-button": "",
|
|
1087
1088
|
"max-width": 1200
|
|
@@ -1095,24 +1096,24 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1095
1096
|
(V(), se(vs, {
|
|
1096
1097
|
class: "w-full",
|
|
1097
1098
|
ref_key: "formRef",
|
|
1098
|
-
ref:
|
|
1099
|
+
ref: F,
|
|
1099
1100
|
onValidationSuccess: h,
|
|
1100
|
-
"model-value":
|
|
1101
|
-
"onUpdate:modelValue": y[0] || (y[0] = (v) =>
|
|
1102
|
-
disabled:
|
|
1103
|
-
"onUpdate:disabled": y[1] || (y[1] = (v) =>
|
|
1104
|
-
key:
|
|
1101
|
+
"model-value": d.value,
|
|
1102
|
+
"onUpdate:modelValue": y[0] || (y[0] = (v) => d.value = v),
|
|
1103
|
+
disabled: T.value,
|
|
1104
|
+
"onUpdate:disabled": y[1] || (y[1] = (v) => T.value = v),
|
|
1105
|
+
key: S.value
|
|
1105
1106
|
}, null, 8, ["model-value", "disabled"]))
|
|
1106
1107
|
]),
|
|
1107
1108
|
"side-sheet-footer": N(() => [
|
|
1108
1109
|
t("div", gs, [
|
|
1109
1110
|
m(C, {
|
|
1110
|
-
loading:
|
|
1111
|
+
loading: T.value,
|
|
1111
1112
|
label: e(k)("common.save"),
|
|
1112
1113
|
onClick: i
|
|
1113
1114
|
}, null, 8, ["loading", "label"]),
|
|
1114
1115
|
m(C, {
|
|
1115
|
-
disabled:
|
|
1116
|
+
disabled: T.value,
|
|
1116
1117
|
variant: "tertiary",
|
|
1117
1118
|
label: e(k)("common.close"),
|
|
1118
1119
|
onClick: y[2] || (y[2] = (v) => u("update:show", !1))
|
|
@@ -1146,26 +1147,26 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1146
1147
|
},
|
|
1147
1148
|
emits: ["update:show", "action:edit"],
|
|
1148
1149
|
setup(f, { emit: g }) {
|
|
1149
|
-
const x = f, a = g, u = be(), { t: o } = re(),
|
|
1150
|
-
var
|
|
1151
|
-
return (
|
|
1150
|
+
const x = f, a = g, u = be(), { t: o } = re(), p = B(() => {
|
|
1151
|
+
var T;
|
|
1152
|
+
return (T = x.template) == null ? void 0 : T.purchaseOrder;
|
|
1152
1153
|
}), k = [
|
|
1153
1154
|
{ accessorKey: "name", header: () => "Name" },
|
|
1154
1155
|
{ accessorKey: "type", header: () => "Type" }
|
|
1155
|
-
],
|
|
1156
|
+
], c = W(""), s = B(
|
|
1156
1157
|
() => {
|
|
1157
|
-
var
|
|
1158
|
-
return ((b = (
|
|
1158
|
+
var T, b, F, $;
|
|
1159
|
+
return ((b = (T = p.value) == null ? void 0 : T.supplier) == null ? void 0 : b.internal) === "restaurant" || (($ = (F = p.value) == null ? void 0 : F.supplier) == null ? void 0 : $.internal) === "warehouse" ? K.TRANSFER : K.PURCHASE;
|
|
1159
1160
|
}
|
|
1160
|
-
),
|
|
1161
|
-
return (
|
|
1161
|
+
), d = W(!0), S = Je(x, "show");
|
|
1162
|
+
return (T, b) => {
|
|
1162
1163
|
var y;
|
|
1163
|
-
const
|
|
1164
|
+
const F = A("FmMenuDivider"), $ = A("FmCard"), L = A("FmIcon"), h = A("FmTextField"), i = A("FmTable"), _ = A("FmButton"), r = A("FmSideSheet");
|
|
1164
1165
|
return V(), se(r, {
|
|
1165
|
-
header: e(o)("inventory.transfer.template.details.view", { template: (y =
|
|
1166
|
-
modelValue: e(
|
|
1167
|
-
"onUpdate:modelValue": b[2] || (b[2] = (C) => Qe(
|
|
1168
|
-
"dismiss-away":
|
|
1166
|
+
header: e(o)("inventory.transfer.template.details.view", { template: (y = T.template) == null ? void 0 : y.name }),
|
|
1167
|
+
modelValue: e(S),
|
|
1168
|
+
"onUpdate:modelValue": b[2] || (b[2] = (C) => Qe(S) ? S.value = C : null),
|
|
1169
|
+
"dismiss-away": d.value,
|
|
1169
1170
|
"close-button": "",
|
|
1170
1171
|
"max-width": 500
|
|
1171
1172
|
}, {
|
|
@@ -1187,25 +1188,25 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1187
1188
|
`inventory.transfer.receiveRequest.details.type.${s.value.toLocaleLowerCase("en-US")}`
|
|
1188
1189
|
)), 1)
|
|
1189
1190
|
]),
|
|
1190
|
-
m(
|
|
1191
|
+
m(F),
|
|
1191
1192
|
t("div", Fs, [
|
|
1192
1193
|
t("div", Cs, [
|
|
1193
1194
|
t("div", Is, [
|
|
1194
1195
|
t("div", Ss, D(e(o)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1195
1196
|
]),
|
|
1196
|
-
t("div", Ms, D(e(ct)(((v =
|
|
1197
|
+
t("div", Ms, D(e(ct)(((v = T.template) == null ? void 0 : v._id) ?? "")), 1)
|
|
1197
1198
|
]),
|
|
1198
|
-
(J = (te =
|
|
1199
|
+
(J = (te = p.value) == null ? void 0 : te.supplier) != null && J.name ? (V(), G("div", Os, [
|
|
1199
1200
|
t("div", $s, D(e(o)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1200
|
-
t("div", Ds, D((P = (E =
|
|
1201
|
+
t("div", Ds, D((P = (E = p.value) == null ? void 0 : E.supplier) == null ? void 0 : P.name), 1)
|
|
1201
1202
|
])) : oe("", !0),
|
|
1202
|
-
(l =
|
|
1203
|
+
(l = p.value) != null && l.ref ? (V(), G("div", Vs, [
|
|
1203
1204
|
t("div", Rs, D(e(o)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1204
|
-
t("div", As, D(
|
|
1205
|
+
t("div", As, D(p.value.ref), 1)
|
|
1205
1206
|
])) : oe("", !0),
|
|
1206
|
-
(n =
|
|
1207
|
+
(n = p.value) != null && n.remark ? (V(), G("div", Ps, [
|
|
1207
1208
|
t("div", Us, D(e(o)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1208
|
-
t("div", Bs, D(
|
|
1209
|
+
t("div", Bs, D(p.value.remark), 1)
|
|
1209
1210
|
])) : oe("", !0)
|
|
1210
1211
|
])
|
|
1211
1212
|
];
|
|
@@ -1216,7 +1217,7 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1216
1217
|
t("div", Ls, [
|
|
1217
1218
|
t("div", Es, [
|
|
1218
1219
|
t("div", Ns, D(e(o)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
1219
|
-
(V(!0), G(ve, null, He(((C =
|
|
1220
|
+
(V(!0), G(ve, null, He(((C = p.value) == null ? void 0 : C.items) ?? [], (v) => (V(), G("div", {
|
|
1220
1221
|
key: v.code,
|
|
1221
1222
|
class: "flex flex-col"
|
|
1222
1223
|
}, [
|
|
@@ -1249,8 +1250,8 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1249
1250
|
], -1)),
|
|
1250
1251
|
t("div", Ys, [
|
|
1251
1252
|
m(h, {
|
|
1252
|
-
modelValue:
|
|
1253
|
-
"onUpdate:modelValue": b[0] || (b[0] = (v) =>
|
|
1253
|
+
modelValue: c.value,
|
|
1254
|
+
"onUpdate:modelValue": b[0] || (b[0] = (v) => c.value = v),
|
|
1254
1255
|
placeholder: "Filter locations",
|
|
1255
1256
|
"prepend-icon": "search"
|
|
1256
1257
|
}, null, 8, ["modelValue"]),
|
|
@@ -1258,7 +1259,7 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1258
1259
|
"hide-footer": "",
|
|
1259
1260
|
style: { height: "500px" },
|
|
1260
1261
|
"column-defs": k,
|
|
1261
|
-
"search-value":
|
|
1262
|
+
"search-value": c.value,
|
|
1262
1263
|
"row-data": ((w = x.template) == null ? void 0 : w.locations) ?? [{ name: "All locations" }]
|
|
1263
1264
|
}, null, 8, ["search-value", "row-data"])
|
|
1264
1265
|
])
|
|
@@ -1282,17 +1283,17 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1282
1283
|
}), Zs = { class: "flex-1 flex flex-col gap-8" }, eo = { class: "flex flex-col" }, to = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, so = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, oo = { class: "fm-typo-en-body-lg-400" }, lo = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, no = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, ho = /* @__PURE__ */ ne({
|
|
1283
1284
|
__name: "TransferTemplateView",
|
|
1284
1285
|
setup(f) {
|
|
1285
|
-
const { t: g } = re(), { createTemplate: x, viewTemplate: a, importTemplates: u, exportTemplates: o } = qe(), { templateDialogProps:
|
|
1286
|
-
ke(
|
|
1286
|
+
const { t: g } = re(), { createTemplate: x, viewTemplate: a, importTemplates: u, exportTemplates: o } = qe(), { templateDialogProps: p, templateDetailsProps: k } = ze(qe()), c = _t(), { loading: s, templates: d } = ze(c), S = W(!1), T = yt(), b = Ke(), { breakpoints: F } = wt();
|
|
1287
|
+
ke(c.fetchTemplates);
|
|
1287
1288
|
const $ = B(
|
|
1288
|
-
() =>
|
|
1289
|
-
), L = B(() =>
|
|
1289
|
+
() => S.value || s.value || !b._currentLocation
|
|
1290
|
+
), L = B(() => d.value), h = W(""), i = B(() => F.value.xs || F.value.sm), _ = B(() => i.value ? 10 : 20);
|
|
1290
1291
|
function r(w) {
|
|
1291
1292
|
switch (w) {
|
|
1292
1293
|
case Ne.Add:
|
|
1293
1294
|
return x();
|
|
1294
1295
|
case "refresh":
|
|
1295
|
-
return
|
|
1296
|
+
return c.fetchTemplates();
|
|
1296
1297
|
case "import":
|
|
1297
1298
|
return u();
|
|
1298
1299
|
case "export":
|
|
@@ -1351,8 +1352,8 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1351
1352
|
"onUpdate:search": v[0] || (v[0] = (E) => h.value = E)
|
|
1352
1353
|
}, null, 8, ["search"]),
|
|
1353
1354
|
(V(), se(te, {
|
|
1354
|
-
style: ge(e(
|
|
1355
|
-
"column-defs": e(
|
|
1355
|
+
style: ge(e(T).tableHeight),
|
|
1356
|
+
"column-defs": e(c).columnDefs,
|
|
1356
1357
|
"row-data": L.value,
|
|
1357
1358
|
"search-value": h.value,
|
|
1358
1359
|
loading: $.value,
|
|
@@ -1366,7 +1367,7 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1366
1367
|
onRowClick: (P) => e(a)(P)
|
|
1367
1368
|
}, {
|
|
1368
1369
|
default: N((P) => {
|
|
1369
|
-
var l, n, I, R, j, q,
|
|
1370
|
+
var l, n, I, R, j, q, M, U, z, X, O, Q, ue, de, Te, Fe, Ce, Ie, Se, Me, me, Oe, $e, De, Ve, pe, Re;
|
|
1370
1371
|
return [
|
|
1371
1372
|
t("div", Zs, [
|
|
1372
1373
|
t("div", eo, [
|
|
@@ -1378,13 +1379,13 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1378
1379
|
]),
|
|
1379
1380
|
t("div", so, [
|
|
1380
1381
|
m(e(Y), {
|
|
1381
|
-
render: (U = (
|
|
1382
|
+
render: (U = (M = (q = P.name) == null ? void 0 : q.column) == null ? void 0 : M.columnDef) == null ? void 0 : U.cell,
|
|
1382
1383
|
props: (X = (z = P.name) == null ? void 0 : z.getContext) == null ? void 0 : X.call(z)
|
|
1383
1384
|
}, null, 8, ["render", "props"])
|
|
1384
1385
|
]),
|
|
1385
1386
|
t("div", oo, [
|
|
1386
1387
|
m(e(Y), {
|
|
1387
|
-
render: (ue = (Q = (
|
|
1388
|
+
render: (ue = (Q = (O = P.supplier) == null ? void 0 : O.column) == null ? void 0 : Q.columnDef) == null ? void 0 : ue.cell,
|
|
1388
1389
|
props: (Te = (de = P.supplier) == null ? void 0 : de.getContext) == null ? void 0 : Te.call(de)
|
|
1389
1390
|
}, null, 8, ["render", "props"])
|
|
1390
1391
|
]),
|
|
@@ -1418,8 +1419,8 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1418
1419
|
}, 8, ["title", "actions"]),
|
|
1419
1420
|
(V(), se(st, { to: "body" }, [
|
|
1420
1421
|
m(Xs, ot(lt(e(k))), null, 16),
|
|
1421
|
-
m(xs, je(e(
|
|
1422
|
-
onSubmitted: v[2] || (v[2] = (J) => e(
|
|
1422
|
+
m(xs, je(e(p), {
|
|
1423
|
+
onSubmitted: v[2] || (v[2] = (J) => e(c).fetchTemplates())
|
|
1423
1424
|
}), null, 16)
|
|
1424
1425
|
]))
|
|
1425
1426
|
], 64);
|