@feedmepos/mf-inventory-portal 1.0.5-dev → 1.0.5
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-HiQFjdJ-.js → App-BC040Les.js} +1 -1
- package/dist/{ApprovalView-CynLDEVc.js → ApprovalView-DCvl3a_5.js} +2 -2
- package/dist/{BindingsDialog-Bnp9wpfo.js → BindingsDialog-CrVuhZqk.js} +2 -2
- package/dist/{BindingsPicker-d0mYW8dg.js → BindingsPicker-lmFa-poh.js} +5 -5
- package/dist/{BindingsTable-DTqY2ksc.js → BindingsTable-CT_lSIYf.js} +5 -5
- package/dist/{ClosingDraftView-CWioP0pS.js → ClosingDraftView-DRc0FjAS.js} +2 -2
- package/dist/{ClosingTemplateView-BQrAl5fV.js → ClosingTemplateView-C_X0J-M4.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-BDF8lY7Y.js → DeliveryOrderPrintPreview-BneNiMcQ.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BN_xp-N6.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BJWjd3-f.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BWUrzPyM.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CAEBtWpw.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-XhFhN0MD.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BhfVsV9p.js} +1 -1
- package/dist/{IngredientGroupView-CyjtkSE4.js → IngredientGroupView-NyW26_DP.js} +1 -1
- package/dist/{IngredientsView-DcTIYA5r.js → IngredientsView-BN1jydVe.js} +3 -3
- package/dist/IntegrationView-CVbR75fb.js +1197 -0
- package/dist/{InventoryBindingForm-dlNXDnnO.js → InventoryBindingForm-Bf52xXaz.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BeUd7kC6.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BLCgDC82.js} +3 -3
- package/dist/{InventoryBindingSummary-BPvSql2a.js → InventoryBindingSummary-BM48Xk8j.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DFofvMkD.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DYSoSSzj.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CaBtx2ad.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DjtXgvRo.js} +1 -1
- package/dist/{PublishView-4Mh9EtfQ.js → PublishView-C_c9fd-9.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-DFNVxR7Q.js → PurchaseOrderPrintPreview-CmIP1Zpp.js} +1 -1
- package/dist/{ReceiveRequestView-DGfyfwbS.js → ReceiveRequestView-DJknUS-e.js} +507 -498
- package/dist/{RecipeView-D-M9rodW.js → RecipeView-nzgPP4xb.js} +3 -3
- package/dist/{StockView-Dmy2nTn9.js → StockView-DERznopJ.js} +6 -6
- package/dist/{SupplierView-dwayUuSs.js → SupplierView-B03zhGGq.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DtrWgdXq.js → TransferDetails.vue_vue_type_script_setup_true_lang-D709Nkfi.js} +6 -6
- package/dist/{TransferTemplateView-zl-E8FWk.js → TransferTemplateView-HLrkeo9I.js} +6 -6
- package/dist/{UnitView-DlgkMRfA.js → UnitView-yMNF61nI.js} +3 -3
- package/dist/{WarehouseView-Cwm2w_Li.js → WarehouseView-Cl8O3zEO.js} +1 -1
- package/dist/api/closing.d.ts +1 -7
- package/dist/api/netsuite.d.ts +0 -82
- package/dist/api/stock.d.ts +12 -12
- package/dist/{app-7jcARtWe.js → app-ByZGP6to.js} +1993 -2053
- package/dist/app.js +1 -1
- package/dist/{decimal-Df15BvRp.js → decimal-C6ZIb15B.js} +1 -1
- package/dist/{format-unit-display-CEjqAYMQ.js → format-unit-display-Bixr5QQV.js} +2 -2
- package/dist/{index-D76OeHWL.js → index-3ud7W_2Y.js} +1 -1
- package/dist/index-CoqRZydm.js +84 -0
- package/dist/{stock-C2o7RYsv.js → stock-DpKjVgzG.js} +1 -1
- package/dist/stores/feature.d.ts +1 -4
- package/dist/stores/integration/index.d.ts +0 -1
- package/dist/stores/integration/netsuite.d.ts +0 -11
- package/dist/stores/inventory.d.ts +12 -12
- package/dist/stores/stock.d.ts +12 -12
- package/dist/{supplier-DX4BGHJ3.js → supplier-DfKwECUI.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-BQq-zLGA.js → use-ingredient-select-dialog-Cs5SmNLE.js} +1 -1
- package/dist/{use-inventory-binding-dialog-NM2fZkBw.js → use-inventory-binding-dialog-9RGXAtLh.js} +1 -1
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +40 -40
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +240 -240
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +32 -32
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +66 -66
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +66 -66
- package/dist/{vue-i18n-BRmzzMWS.js → vue-i18n-DR_smMg1.js} +392 -392
- package/package.json +2 -3
- package/dist/IntegrationView-Jeh9aw2u.js +0 -2148
- package/dist/index-D1mi5w82.js +0 -125
- package/dist/stores/integration/xilnex.d.ts +0 -12
- package/dist/views/integration/XilnexView.vue.d.ts +0 -2
- package/dist/views/integration/components/Xilnex/XilnexOpeningImport.vue.d.ts +0 -2
- package/dist/views/integration/components/Xilnex/XilnexProps.d.ts +0 -7
- package/dist/views/integration/components/Xilnex/XilnexSideSheet.vue.d.ts +0 -24
- package/dist/views/integration/components/Xilnex/importFn.d.ts +0 -16
- package/dist/views/integration/components/netsuite/AddLocationDialog.vue.d.ts +0 -1334
- package/dist/views/integration/components/netsuite/LocationConfigurationDialog.vue.d.ts +0 -174
- package/dist/views/integration/components/netsuite/LocationConfigurationDialogProps.d.ts +0 -16
- package/dist/views/integration/components/netsuite/NetSuiteLocationField.vue.d.ts +0 -71
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { reactive as yt, onMounted as Be, computed as q, h as j, defineComponent as le, openBlock as
|
|
2
|
-
import { J as Qe, b as ze, a0 as gt, c as Xe, m as Re, j as
|
|
3
|
-
import { u as Je, a as Zt, P as Ye, b as Wt, _ as Gt, g as Jt } from "./TransferDetails.vue_vue_type_script_setup_true_lang-
|
|
4
|
-
import { _ as
|
|
1
|
+
import { reactive as yt, onMounted as Be, watch as fe, computed as q, h as j, defineComponent as le, openBlock as k, createElementBlock as T, Fragment as ae, renderList as Ce, createElementVNode as l, toDisplayString as A, unref as t, resolveComponent as I, createVNode as d, withCtx as V, createCommentVNode as B, ref as E, createBlock as Q, normalizeClass as K, normalizeStyle as bt, createTextVNode as Fe, nextTick as $t, mergeProps as Ke, isRef as ke, createSlots as Dt, Teleport as It, normalizeProps as Tt, guardReactiveProps as Vt } from "vue";
|
|
2
|
+
import { J as Qe, b as ze, a0 as gt, c as Xe, m as Re, j as xe, a2 as Ze, L as Pt, ao as Rt, A as Ne, M as At, n as _t, a9 as We, G as de, ap as Et, a as Le, aq as qt, ar as Ut, as as Mt, H as ht, u as Ge, at as Ot, au as Nt, a1 as Bt, W as zt, av as Lt, E as kt, e as Pe, x as Ht, y as jt, z as Yt, aw as Oe, a3 as ct, B as Kt, _ as Qt, C as Xt, O as mt } from "./app-ByZGP6to.js";
|
|
3
|
+
import { u as Je, a as Zt, P as Ye, b as Wt, _ as Gt, g as Jt } from "./TransferDetails.vue_vue_type_script_setup_true_lang-D709Nkfi.js";
|
|
4
|
+
import { _ as xt, u as es, i as ts, e as ss } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DjtXgvRo.js";
|
|
5
5
|
import { u as os } from "./useTabStorage-BkIVScW_.js";
|
|
6
6
|
import { useDialog as Ct, useBreakpoints as et, components as pe, FmButtonVariant as as, useSnackbar as $e, useProxiedModel as St } from "@feedmepos/ui-library";
|
|
7
|
-
import { P as te, u as wt } from "./format-unit-display-
|
|
8
|
-
import { _ as ls, F as ns, a as rs, b as is } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
9
|
-
import { c as
|
|
7
|
+
import { P as te, u as wt } from "./format-unit-display-Bixr5QQV.js";
|
|
8
|
+
import { _ as ls, F as ns, a as rs, b as is } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CAEBtWpw.js";
|
|
9
|
+
import { c as ye, u as us, _ as ds } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BJWjd3-f.js";
|
|
10
10
|
import { useI18n as ce } from "@feedmepos/mf-common";
|
|
11
11
|
import { defineStore as cs } from "pinia";
|
|
12
|
-
import { u as tt } from "./supplier-
|
|
12
|
+
import { u as tt } from "./supplier-DfKwECUI.js";
|
|
13
13
|
import { _ as ms } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
14
|
-
import { u as ps } from "./vue-i18n-
|
|
14
|
+
import { u as ps } from "./vue-i18n-DR_smMg1.js";
|
|
15
15
|
import "./array-hChJVZLE.js";
|
|
16
|
-
|
|
17
|
-
const
|
|
16
|
+
cs("inventoryMultiSelectDialog", () => {
|
|
17
|
+
const v = Ct(), { t: _ } = ce();
|
|
18
18
|
return { multiSelect: async (g, e, u) => {
|
|
19
|
-
const
|
|
20
|
-
return
|
|
19
|
+
const x = u ?? ((s) => s), { promise: S, resolve: n } = Promise.withResolvers();
|
|
20
|
+
return v.open({
|
|
21
21
|
title: "Select items",
|
|
22
22
|
closeButton: !0,
|
|
23
23
|
contentComponent: Qe,
|
|
@@ -25,7 +25,7 @@ const fs = cs("inventoryMultiSelectDialog", () => {
|
|
|
25
25
|
modelValue: e ?? [],
|
|
26
26
|
items: g,
|
|
27
27
|
virtualScroll: !0,
|
|
28
|
-
onClose: () =>
|
|
28
|
+
onClose: () => n(null)
|
|
29
29
|
},
|
|
30
30
|
primaryActions: {
|
|
31
31
|
text: _("common.confirm"),
|
|
@@ -37,12 +37,12 @@ const fs = cs("inventoryMultiSelectDialog", () => {
|
|
|
37
37
|
variant: "tertiary"
|
|
38
38
|
}
|
|
39
39
|
}).onPrimary((s) => {
|
|
40
|
-
const a = s.map((m) =>
|
|
41
|
-
|
|
40
|
+
const a = s.map((m) => x(m));
|
|
41
|
+
n(a);
|
|
42
42
|
}), S;
|
|
43
43
|
}, singleSelect: async (g, e, u) => {
|
|
44
|
-
const
|
|
45
|
-
return
|
|
44
|
+
const x = u ?? ((s) => s), { promise: S, resolve: n } = Promise.withResolvers();
|
|
45
|
+
return v.open({
|
|
46
46
|
title: "Select items",
|
|
47
47
|
closeButton: !0,
|
|
48
48
|
contentComponent: Qe,
|
|
@@ -50,7 +50,7 @@ const fs = cs("inventoryMultiSelectDialog", () => {
|
|
|
50
50
|
modelValue: e ? [e] : [],
|
|
51
51
|
items: g,
|
|
52
52
|
virtualScroll: !0,
|
|
53
|
-
onClose: () =>
|
|
53
|
+
onClose: () => n(void 0),
|
|
54
54
|
singleSelect: !0
|
|
55
55
|
},
|
|
56
56
|
primaryActions: {
|
|
@@ -64,45 +64,54 @@ const fs = cs("inventoryMultiSelectDialog", () => {
|
|
|
64
64
|
}
|
|
65
65
|
}).onPrimary((s) => {
|
|
66
66
|
if (!s.length)
|
|
67
|
-
return
|
|
68
|
-
const a =
|
|
69
|
-
|
|
67
|
+
return n(null);
|
|
68
|
+
const a = x(s[0]);
|
|
69
|
+
n(a);
|
|
70
70
|
}), S;
|
|
71
71
|
} };
|
|
72
72
|
});
|
|
73
|
-
var Z = /* @__PURE__ */ ((
|
|
74
|
-
const
|
|
75
|
-
|
|
73
|
+
var Z = /* @__PURE__ */ ((v) => (v.Code = "Code", v.Name = "Name", v.TemplateName = "TemplateName", v.Amount = "Amount", v.Cost = "Cost", v.TotalCost = "TotalCost", v.Delete = "Delete", v))(Z || {});
|
|
74
|
+
const fs = () => (ce(), j(
|
|
75
|
+
xt,
|
|
76
76
|
{
|
|
77
77
|
zIndex: 50,
|
|
78
78
|
class: "whitespace-nowrap"
|
|
79
79
|
},
|
|
80
80
|
`Total (${_t()})`
|
|
81
81
|
));
|
|
82
|
-
function
|
|
83
|
-
const { t: _ } = ce(),
|
|
84
|
-
|
|
85
|
-
for (const
|
|
86
|
-
if (!
|
|
82
|
+
function vs(v) {
|
|
83
|
+
const { t: _ } = ce(), r = yt({}), { breakpoints: i } = et(), g = Xe(), e = ze();
|
|
84
|
+
Be(() => {
|
|
85
|
+
for (const n of v.items) {
|
|
86
|
+
if (!n.totalCost)
|
|
87
87
|
continue;
|
|
88
|
-
const s =
|
|
89
|
-
supplier:
|
|
90
|
-
}), a =
|
|
91
|
-
s ? n
|
|
88
|
+
const s = ye(n.sku, n.quantity, n.measurement, {
|
|
89
|
+
supplier: v.supplier
|
|
90
|
+
}), a = n.totalCost ?? gt.reset();
|
|
91
|
+
s ? r[n.sku._id] = s.amount !== a.amount || s.precision !== a.precision : r[n.sku._id] = !0;
|
|
92
|
+
}
|
|
93
|
+
}), fe([() => v.supplier], ([n]) => {
|
|
94
|
+
for (const s of v.items) {
|
|
95
|
+
if (!s.totalCost || r[s.sku._id] || !u(s.sku))
|
|
96
|
+
continue;
|
|
97
|
+
const a = ye(s.sku, s.quantity, s.measurement, {
|
|
98
|
+
supplier: n
|
|
99
|
+
});
|
|
100
|
+
v.updateItem({ ...s, totalCost: a });
|
|
92
101
|
}
|
|
93
102
|
});
|
|
94
|
-
function u(
|
|
103
|
+
function u(n) {
|
|
95
104
|
var a, m, c, p, F, h, $;
|
|
96
|
-
return !!(((m = (a =
|
|
105
|
+
return !!(((m = (a = n.defaultCost) == null ? void 0 : a.costPerUnit) == null ? void 0 : m.amount) ?? (($ = (h = (F = (p = (c = v.supplier) == null ? void 0 : c.supplyItems) == null ? void 0 : p.find((y) => y.skuId === n._id)) == null ? void 0 : F.defaultCost) == null ? void 0 : h.costPerUnit) == null ? void 0 : $.amount));
|
|
97
106
|
}
|
|
98
|
-
const
|
|
107
|
+
const x = [
|
|
99
108
|
{
|
|
100
109
|
id: "Code",
|
|
101
110
|
header: () => _("inventory.transfer.form.items.table.Code"),
|
|
102
111
|
accessorKey: "code",
|
|
103
112
|
size: 200,
|
|
104
|
-
cell(
|
|
105
|
-
const s =
|
|
113
|
+
cell(n) {
|
|
114
|
+
const s = n.row.original;
|
|
106
115
|
return e.isEnabled ? j(
|
|
107
116
|
pe.FmTooltip,
|
|
108
117
|
{
|
|
@@ -121,7 +130,7 @@ function ys(b) {
|
|
|
121
130
|
) : j(pe.FmTextField, {
|
|
122
131
|
modelValue: s.code,
|
|
123
132
|
"onUpdate:modelValue": (a) => {
|
|
124
|
-
|
|
133
|
+
v.updateItem({
|
|
125
134
|
...s,
|
|
126
135
|
code: a
|
|
127
136
|
});
|
|
@@ -137,8 +146,8 @@ function ys(b) {
|
|
|
137
146
|
id: "Name",
|
|
138
147
|
header: () => _("inventory.transfer.form.items.table.Name"),
|
|
139
148
|
minSize: 300,
|
|
140
|
-
cell(
|
|
141
|
-
const s =
|
|
149
|
+
cell(n) {
|
|
150
|
+
const s = n.row.original;
|
|
142
151
|
return e.isEnabled ? j(
|
|
143
152
|
pe.FmTooltip,
|
|
144
153
|
{
|
|
@@ -157,7 +166,7 @@ function ys(b) {
|
|
|
157
166
|
) : j(pe.FmTextField, {
|
|
158
167
|
modelValue: s.name,
|
|
159
168
|
"onUpdate:modelValue": (a) => {
|
|
160
|
-
|
|
169
|
+
v.updateItem({
|
|
161
170
|
...s,
|
|
162
171
|
name: a
|
|
163
172
|
});
|
|
@@ -174,8 +183,8 @@ function ys(b) {
|
|
|
174
183
|
header: () => _("inventory.transfer.form.items.table.Name"),
|
|
175
184
|
minSize: 300,
|
|
176
185
|
enableSorting: !1,
|
|
177
|
-
cell(
|
|
178
|
-
const s =
|
|
186
|
+
cell(n) {
|
|
187
|
+
const s = n.row.original, a = s.code, m = s.name;
|
|
179
188
|
return j(
|
|
180
189
|
pe.FmTooltip,
|
|
181
190
|
{ zIndex: 50 },
|
|
@@ -207,9 +216,9 @@ function ys(b) {
|
|
|
207
216
|
id: "Amount",
|
|
208
217
|
header: () => _("inventory.transfer.form.items.table.Amount"),
|
|
209
218
|
minSize: 200,
|
|
210
|
-
cell(
|
|
219
|
+
cell(n) {
|
|
211
220
|
var m, c, p, F;
|
|
212
|
-
const s =
|
|
221
|
+
const s = n.row.original, a = (p = (c = (m = v.template) == null ? void 0 : m.purchaseOrder) == null ? void 0 : c.items) == null ? void 0 : p.find(
|
|
213
222
|
(h) => h.sku._id === s.sku._id
|
|
214
223
|
);
|
|
215
224
|
return j(ls, {
|
|
@@ -229,29 +238,29 @@ function ys(b) {
|
|
|
229
238
|
quantity: h.amount,
|
|
230
239
|
measurement: h.measurement
|
|
231
240
|
};
|
|
232
|
-
g.enableTotalCost && ($.totalCost =
|
|
241
|
+
g.enableTotalCost && ($.totalCost = ye(
|
|
233
242
|
$.sku,
|
|
234
243
|
$.quantity,
|
|
235
244
|
$.measurement,
|
|
236
245
|
{
|
|
237
|
-
supplier:
|
|
246
|
+
supplier: v.supplier,
|
|
238
247
|
// NOTE: set undefined here if `manualTotalCost[updatedRow.sku._id] = false`, so that the function
|
|
239
248
|
// will return the auto calculated default cost instead of the manual total cost
|
|
240
|
-
manualTotalCost:
|
|
249
|
+
manualTotalCost: r[$.sku._id] ? $.totalCost : void 0
|
|
241
250
|
}
|
|
242
|
-
)),
|
|
251
|
+
)), v.updateItem($);
|
|
243
252
|
},
|
|
244
253
|
stepper: a == null ? void 0 : a.quantityStep,
|
|
245
254
|
disableUnit: !!a,
|
|
246
|
-
disabled:
|
|
255
|
+
disabled: v.disabled,
|
|
247
256
|
rules: [
|
|
248
257
|
ns(
|
|
249
|
-
+
|
|
258
|
+
+xe(
|
|
250
259
|
((F = s.quantity) == null ? void 0 : F.amount) === 0 ? { amount: 0, precision: 0 } : (a == null ? void 0 : a.minimumQuantity) ?? { amount: 0, precision: 0 }
|
|
251
260
|
)
|
|
252
261
|
),
|
|
253
262
|
rs(
|
|
254
|
-
a != null && a.maximumQuantity ? +
|
|
263
|
+
a != null && a.maximumQuantity ? +xe(a == null ? void 0 : a.maximumQuantity) : 1 / 0
|
|
255
264
|
),
|
|
256
265
|
...a != null && a.quantityStep ? [is(a.quantityStep)] : []
|
|
257
266
|
],
|
|
@@ -262,16 +271,16 @@ function ys(b) {
|
|
|
262
271
|
},
|
|
263
272
|
{
|
|
264
273
|
id: "Cost",
|
|
265
|
-
header:
|
|
274
|
+
header: fs,
|
|
266
275
|
size: 180,
|
|
267
|
-
cell(
|
|
268
|
-
const s =
|
|
269
|
-
return !
|
|
276
|
+
cell(n) {
|
|
277
|
+
const s = n.row.original, a = u(s.sku), m = i.value.xs || i.value.sm;
|
|
278
|
+
return !r[s.sku._id] && a ? j(
|
|
270
279
|
"div",
|
|
271
280
|
{
|
|
272
281
|
class: [
|
|
273
282
|
"flex gap-4 fm-typo-en-body-md-400 items-center",
|
|
274
|
-
|
|
283
|
+
v.disabled ? "text-fm-color-typo-disabled" : ""
|
|
275
284
|
],
|
|
276
285
|
key: s.sku._id
|
|
277
286
|
},
|
|
@@ -279,14 +288,14 @@ function ys(b) {
|
|
|
279
288
|
j(pe.FmButton, {
|
|
280
289
|
prependIcon: "edit",
|
|
281
290
|
variant: as.Tertiary,
|
|
282
|
-
disabled:
|
|
291
|
+
disabled: v.disabled,
|
|
283
292
|
onClick() {
|
|
284
|
-
|
|
293
|
+
v.updateItem({
|
|
285
294
|
...s,
|
|
286
|
-
totalCost:
|
|
287
|
-
supplier:
|
|
295
|
+
totalCost: ye(s.sku, s.quantity, s.measurement, {
|
|
296
|
+
supplier: v.supplier
|
|
288
297
|
})
|
|
289
|
-
}),
|
|
298
|
+
}), r[s.sku._id] = !0;
|
|
290
299
|
}
|
|
291
300
|
}),
|
|
292
301
|
j(
|
|
@@ -298,12 +307,12 @@ function ys(b) {
|
|
|
298
307
|
j(
|
|
299
308
|
"span",
|
|
300
309
|
m ? Ze(
|
|
301
|
-
|
|
302
|
-
supplier:
|
|
310
|
+
ye(s.sku, s.quantity, s.measurement, {
|
|
311
|
+
supplier: v.supplier
|
|
303
312
|
})
|
|
304
|
-
) :
|
|
305
|
-
|
|
306
|
-
supplier:
|
|
313
|
+
) : xe(
|
|
314
|
+
ye(s.sku, s.quantity, s.measurement, {
|
|
315
|
+
supplier: v.supplier
|
|
307
316
|
})
|
|
308
317
|
)
|
|
309
318
|
),
|
|
@@ -312,7 +321,7 @@ function ys(b) {
|
|
|
312
321
|
{
|
|
313
322
|
class: [
|
|
314
323
|
"fm-typo-en-body-sm-400",
|
|
315
|
-
|
|
324
|
+
v.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
|
|
316
325
|
]
|
|
317
326
|
},
|
|
318
327
|
_("inventory.transfer.form.items.autoCalculated")
|
|
@@ -323,10 +332,10 @@ function ys(b) {
|
|
|
323
332
|
) : j(
|
|
324
333
|
pe.FmTextField,
|
|
325
334
|
{
|
|
326
|
-
modelValue:
|
|
335
|
+
modelValue: xe(s.totalCost ?? { amount: 0, precision: 0 }),
|
|
327
336
|
key: s.sku._id,
|
|
328
337
|
"onUpdate:modelValue": (c) => {
|
|
329
|
-
|
|
338
|
+
v.updateItem({
|
|
330
339
|
...s,
|
|
331
340
|
totalCost: {
|
|
332
341
|
...Pt(+c),
|
|
@@ -343,7 +352,7 @@ function ys(b) {
|
|
|
343
352
|
{
|
|
344
353
|
class: [
|
|
345
354
|
"text-fm-typo-en-body-lg-400",
|
|
346
|
-
|
|
355
|
+
v.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
347
356
|
]
|
|
348
357
|
},
|
|
349
358
|
_t()
|
|
@@ -353,16 +362,16 @@ function ys(b) {
|
|
|
353
362
|
return a ? j(pe.FmButton, {
|
|
354
363
|
prependIcon: "close",
|
|
355
364
|
variant: "tertiary",
|
|
356
|
-
disabled:
|
|
365
|
+
disabled: v.disabled,
|
|
357
366
|
onClick() {
|
|
358
|
-
|
|
367
|
+
v.updateItem({
|
|
359
368
|
...s,
|
|
360
369
|
// NOTE: different from PO template, if a default cost is reenabled,
|
|
361
370
|
// the total cost will automatically assigned
|
|
362
|
-
totalCost:
|
|
363
|
-
supplier:
|
|
371
|
+
totalCost: ye(s.sku, s.quantity, s.measurement, {
|
|
372
|
+
supplier: v.supplier
|
|
364
373
|
})
|
|
365
|
-
}),
|
|
374
|
+
}), r[s.sku._id] = !1;
|
|
366
375
|
}
|
|
367
376
|
}) : null;
|
|
368
377
|
}
|
|
@@ -374,8 +383,8 @@ function ys(b) {
|
|
|
374
383
|
{
|
|
375
384
|
id: "Delete",
|
|
376
385
|
header: "",
|
|
377
|
-
cell(
|
|
378
|
-
const s =
|
|
386
|
+
cell(n) {
|
|
387
|
+
const s = n.row.original;
|
|
379
388
|
return j("div", { class: "flex justify-end" }, [
|
|
380
389
|
j(pe.FmButton, {
|
|
381
390
|
key: s.sku._id,
|
|
@@ -384,9 +393,9 @@ function ys(b) {
|
|
|
384
393
|
icon: "delete",
|
|
385
394
|
variant: "tertiary",
|
|
386
395
|
size: "md",
|
|
387
|
-
disabled:
|
|
396
|
+
disabled: v.disabled,
|
|
388
397
|
onClick: () => {
|
|
389
|
-
|
|
398
|
+
v.deleteItem(s);
|
|
390
399
|
}
|
|
391
400
|
})
|
|
392
401
|
]);
|
|
@@ -400,47 +409,47 @@ function ys(b) {
|
|
|
400
409
|
}
|
|
401
410
|
];
|
|
402
411
|
return {
|
|
403
|
-
columnDefs: q(() => g.enableTotalCost &&
|
|
404
|
-
(
|
|
412
|
+
columnDefs: q(() => g.enableTotalCost && v.transferType === te.PURCHASE ? x : x.filter(
|
|
413
|
+
(n) => n.id !== "Cost"
|
|
405
414
|
/* Cost */
|
|
406
415
|
))
|
|
407
416
|
};
|
|
408
417
|
}
|
|
409
|
-
const
|
|
418
|
+
const ys = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, bs = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, gs = { class: "w-[450px] xs:w-full flex" }, _s = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, hs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ft = /* @__PURE__ */ le({
|
|
410
419
|
__name: "SupplierPriceHistory",
|
|
411
420
|
props: {
|
|
412
421
|
prices: {}
|
|
413
422
|
},
|
|
414
|
-
setup(
|
|
423
|
+
setup(v) {
|
|
415
424
|
const _ = tt();
|
|
416
|
-
function
|
|
425
|
+
function r(i) {
|
|
417
426
|
return _.suppliers.find((g) => g._id === i);
|
|
418
427
|
}
|
|
419
|
-
return (i, g) => (
|
|
420
|
-
(
|
|
428
|
+
return (i, g) => (k(), T("div", ys, [
|
|
429
|
+
(k(!0), T(ae, null, Ce(Object.keys(i.prices), (e) => {
|
|
421
430
|
var u;
|
|
422
|
-
return
|
|
431
|
+
return k(), T("div", {
|
|
423
432
|
key: e,
|
|
424
433
|
class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
|
|
425
434
|
}, [
|
|
426
|
-
l("div",
|
|
427
|
-
l("div",
|
|
428
|
-
(
|
|
435
|
+
l("div", bs, A((u = r(e)) == null ? void 0 : u.name), 1),
|
|
436
|
+
l("div", gs, [
|
|
437
|
+
(k(!0), T(ae, null, Ce(i.prices[e].slice(0, 3), (x) => {
|
|
429
438
|
var S;
|
|
430
|
-
return
|
|
431
|
-
key:
|
|
439
|
+
return k(), T("div", {
|
|
440
|
+
key: x.date,
|
|
432
441
|
class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
|
|
433
442
|
}, [
|
|
434
|
-
l("div",
|
|
435
|
-
l("span", null, A(
|
|
443
|
+
l("div", _s, [
|
|
444
|
+
l("span", null, A(x.totalCost ? t(Ze)(x.totalCost) : "No data"), 1),
|
|
436
445
|
g[0] || (g[0] = l("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
|
|
437
|
-
l("span", null, A(t(
|
|
438
|
-
l("span", null, A(((S =
|
|
446
|
+
l("span", null, A(t(xe)(x.totalUnit, !1)), 1),
|
|
447
|
+
l("span", null, A(((S = x.measurement) == null ? void 0 : S.abbrev) ?? x.unit.abbrev), 1)
|
|
439
448
|
]),
|
|
440
|
-
l("div",
|
|
441
|
-
l("span", null, "(#" + A(
|
|
449
|
+
l("div", hs, [
|
|
450
|
+
l("span", null, "(#" + A(x.seqNumber) + ")", 1),
|
|
442
451
|
g[1] || (g[1] = l("span", null, A(" "), -1)),
|
|
443
|
-
l("span", null, A(t(We)(new Date(
|
|
452
|
+
l("span", null, A(t(We)(new Date(x.date))), 1)
|
|
444
453
|
])
|
|
445
454
|
]);
|
|
446
455
|
}), 128))
|
|
@@ -449,10 +458,10 @@ const bs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
449
458
|
}), 128))
|
|
450
459
|
]));
|
|
451
460
|
}
|
|
452
|
-
}), ks = { class: "flex flex-col gap-8 py-16" },
|
|
461
|
+
}), ks = { class: "flex flex-col gap-8 py-16" }, xs = { class: "flex items-center" }, Cs = { class: "flex-1 flex gap-1 items-center" }, Ss = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ws = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Fs = { class: "flex gap-8 w-full" }, $s = { class: "flex-1 flex flex-col gap-4" }, Ds = { class: "flex-1 flex flex-col gap-4" }, Is = { class: "flex gap-8 w-full" }, Ts = { class: "flex-1 flex flex-col gap-4" }, Vs = {
|
|
453
462
|
key: 0,
|
|
454
463
|
class: "flex-1 flex flex-col gap-4"
|
|
455
|
-
},
|
|
464
|
+
}, Ps = /* @__PURE__ */ le({
|
|
456
465
|
__name: "TransferItem",
|
|
457
466
|
props: {
|
|
458
467
|
cellByColId: {},
|
|
@@ -460,59 +469,59 @@ const bs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
460
469
|
showComparePrice: { type: Boolean },
|
|
461
470
|
row: {}
|
|
462
471
|
},
|
|
463
|
-
setup(
|
|
472
|
+
setup(v) {
|
|
464
473
|
const { t: _ } = ce();
|
|
465
|
-
return (
|
|
466
|
-
var u,
|
|
474
|
+
return (r, i) => {
|
|
475
|
+
var u, x, S, n, s, a, m, c, p, F, h, $, y, w, z, P, R, Y, O, U, L, X, b, C, H, ie, se;
|
|
467
476
|
const g = I("FmLabel"), e = I("FmSpacer");
|
|
468
|
-
return
|
|
469
|
-
l("div",
|
|
470
|
-
l("div",
|
|
471
|
-
l("span",
|
|
472
|
-
l("span",
|
|
477
|
+
return k(), T("div", ks, [
|
|
478
|
+
l("div", xs, [
|
|
479
|
+
l("div", Cs, [
|
|
480
|
+
l("span", Ss, " (" + A(r.row.original.sku.code) + ") ", 1),
|
|
481
|
+
l("span", ws, A(r.row.original.sku.name), 1)
|
|
473
482
|
]),
|
|
474
483
|
l("div", null, [
|
|
475
484
|
d(t(de), {
|
|
476
|
-
render: (S = (
|
|
477
|
-
props: (s = (
|
|
485
|
+
render: (S = (x = (u = r.cellByColId.Delete) == null ? void 0 : u.column) == null ? void 0 : x.columnDef) == null ? void 0 : S.cell,
|
|
486
|
+
props: (s = (n = r.cellByColId.Delete) == null ? void 0 : n.getContext) == null ? void 0 : s.call(n)
|
|
478
487
|
}, null, 8, ["render", "props"])
|
|
479
488
|
])
|
|
480
489
|
]),
|
|
481
|
-
l("div",
|
|
482
|
-
l("div",
|
|
490
|
+
l("div", Fs, [
|
|
491
|
+
l("div", $s, [
|
|
483
492
|
d(g, {
|
|
484
493
|
label: t(_)(`inventory.transfer.form.items.table.${t(Z).Code}`)
|
|
485
494
|
}, null, 8, ["label"]),
|
|
486
495
|
d(t(de), {
|
|
487
|
-
render: (c = (m = (a =
|
|
488
|
-
props: (F = (p =
|
|
496
|
+
render: (c = (m = (a = r.cellByColId[t(Z).Code]) == null ? void 0 : a.column) == null ? void 0 : m.columnDef) == null ? void 0 : c.cell,
|
|
497
|
+
props: (F = (p = r.cellByColId[t(Z).Code]) == null ? void 0 : p.getContext) == null ? void 0 : F.call(p)
|
|
489
498
|
}, null, 8, ["render", "props"]),
|
|
490
499
|
i[0] || (i[0] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
491
500
|
]),
|
|
492
|
-
l("div",
|
|
501
|
+
l("div", Ds, [
|
|
493
502
|
d(g, {
|
|
494
503
|
label: t(_)(`inventory.transfer.form.items.table.${t(Z).Name}`)
|
|
495
504
|
}, null, 8, ["label"]),
|
|
496
505
|
d(t(de), {
|
|
497
|
-
render: (
|
|
498
|
-
props: (z = (w =
|
|
506
|
+
render: (y = ($ = (h = r.cellByColId[t(Z).Name]) == null ? void 0 : h.column) == null ? void 0 : $.columnDef) == null ? void 0 : y.cell,
|
|
507
|
+
props: (z = (w = r.cellByColId[t(Z).Name]) == null ? void 0 : w.getContext) == null ? void 0 : z.call(w)
|
|
499
508
|
}, null, 8, ["render", "props"]),
|
|
500
509
|
i[1] || (i[1] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
501
510
|
])
|
|
502
511
|
]),
|
|
503
|
-
l("div",
|
|
504
|
-
l("div",
|
|
512
|
+
l("div", Is, [
|
|
513
|
+
l("div", Ts, [
|
|
505
514
|
d(g, {
|
|
506
515
|
label: t(_)(`inventory.transfer.form.items.table.${t(Z).Amount}`)
|
|
507
516
|
}, null, 8, ["label"]),
|
|
508
517
|
d(t(de), {
|
|
509
|
-
render: (Y = (R = (P =
|
|
510
|
-
props: (U = (O =
|
|
518
|
+
render: (Y = (R = (P = r.cellByColId[t(Z).Amount]) == null ? void 0 : P.column) == null ? void 0 : R.columnDef) == null ? void 0 : Y.cell,
|
|
519
|
+
props: (U = (O = r.cellByColId[t(Z).Amount]) == null ? void 0 : O.getContext) == null ? void 0 : U.call(O)
|
|
511
520
|
}, null, 8, ["render", "props"]),
|
|
512
521
|
i[2] || (i[2] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
513
522
|
]),
|
|
514
|
-
|
|
515
|
-
d(
|
|
523
|
+
r.cellByColId[t(Z).Cost] ? (k(), T("div", Vs, [
|
|
524
|
+
d(xt, { "z-index": 50 }, {
|
|
516
525
|
default: V(() => [
|
|
517
526
|
d(g, {
|
|
518
527
|
label: t(_)(`inventory.transfer.form.items.table.${t(Z).Cost}2`)
|
|
@@ -521,32 +530,32 @@ const bs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
521
530
|
_: 1
|
|
522
531
|
}),
|
|
523
532
|
d(t(de), {
|
|
524
|
-
render: (
|
|
525
|
-
props: (H = (C =
|
|
533
|
+
render: (b = (X = (L = r.cellByColId[t(Z).Cost]) == null ? void 0 : L.column) == null ? void 0 : X.columnDef) == null ? void 0 : b.cell,
|
|
534
|
+
props: (H = (C = r.cellByColId[t(Z).Cost]) == null ? void 0 : C.getContext) == null ? void 0 : H.call(C)
|
|
526
535
|
}, null, 8, ["render", "props"]),
|
|
527
536
|
i[3] || (i[3] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
528
537
|
])) : B("", !0)
|
|
529
538
|
]),
|
|
530
|
-
|
|
539
|
+
r.showComparePrice && Object.keys(r.comparePriceBySku[(ie = r.row.original.sku) == null ? void 0 : ie._id] ?? {}).length > 0 ? (k(), T(ae, { key: 0 }, [
|
|
531
540
|
d(e, { class: "h-8" }),
|
|
532
541
|
d(Ft, {
|
|
533
|
-
prices:
|
|
542
|
+
prices: r.comparePriceBySku[(se = r.row.original.sku) == null ? void 0 : se._id]
|
|
534
543
|
}, null, 8, ["prices"])
|
|
535
544
|
], 64)) : B("", !0)
|
|
536
545
|
]);
|
|
537
546
|
};
|
|
538
547
|
}
|
|
539
548
|
});
|
|
540
|
-
function
|
|
549
|
+
function Rs(v) {
|
|
541
550
|
const _ = q({
|
|
542
551
|
get() {
|
|
543
|
-
const e =
|
|
552
|
+
const e = v.getEffectiveAt();
|
|
544
553
|
return e ? new Date(e) : null;
|
|
545
554
|
},
|
|
546
555
|
set(e) {
|
|
547
|
-
|
|
556
|
+
v.setEffectiveAt((e == null ? void 0 : e.toISOString()) ?? null);
|
|
548
557
|
}
|
|
549
|
-
}),
|
|
558
|
+
}), r = q({
|
|
550
559
|
get() {
|
|
551
560
|
return !!_.value;
|
|
552
561
|
},
|
|
@@ -570,18 +579,18 @@ function As(b) {
|
|
|
570
579
|
});
|
|
571
580
|
return {
|
|
572
581
|
backdatePo: _,
|
|
573
|
-
backdateSwitch:
|
|
582
|
+
backdateSwitch: r,
|
|
574
583
|
backdateModel: i,
|
|
575
584
|
backdateTimeModel: g
|
|
576
585
|
};
|
|
577
586
|
}
|
|
578
|
-
const
|
|
587
|
+
const As = {
|
|
579
588
|
width: "24",
|
|
580
589
|
height: "24",
|
|
581
590
|
viewBox: "0 0 24 24",
|
|
582
591
|
fill: "none",
|
|
583
592
|
xmlns: "http://www.w3.org/2000/svg"
|
|
584
|
-
},
|
|
593
|
+
}, Es = ["fill"], qs = ["fill"], Us = ["stroke"], Ms = ["stroke"], Os = /* @__PURE__ */ le({
|
|
585
594
|
__name: "SparkIcon",
|
|
586
595
|
props: {
|
|
587
596
|
size: {
|
|
@@ -593,41 +602,41 @@ const Es = {
|
|
|
593
602
|
default: "#c7c7cc"
|
|
594
603
|
}
|
|
595
604
|
},
|
|
596
|
-
setup(
|
|
597
|
-
return (_,
|
|
605
|
+
setup(v) {
|
|
606
|
+
return (_, r) => (k(), T("svg", As, [
|
|
598
607
|
l("path", {
|
|
599
608
|
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",
|
|
600
|
-
fill:
|
|
601
|
-
}, null, 8,
|
|
609
|
+
fill: v.color
|
|
610
|
+
}, null, 8, Es),
|
|
602
611
|
l("path", {
|
|
603
612
|
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",
|
|
604
|
-
fill:
|
|
605
|
-
}, null, 8,
|
|
613
|
+
fill: v.color
|
|
614
|
+
}, null, 8, qs),
|
|
606
615
|
l("path", {
|
|
607
616
|
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",
|
|
608
|
-
stroke:
|
|
617
|
+
stroke: v.color,
|
|
609
618
|
"stroke-width": "1.5",
|
|
610
619
|
"stroke-linecap": "round",
|
|
611
620
|
"stroke-linejoin": "round"
|
|
612
|
-
}, null, 8,
|
|
621
|
+
}, null, 8, Us),
|
|
613
622
|
l("path", {
|
|
614
623
|
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",
|
|
615
|
-
stroke:
|
|
624
|
+
stroke: v.color,
|
|
616
625
|
"stroke-width": "1.5",
|
|
617
626
|
"stroke-linecap": "round",
|
|
618
627
|
"stroke-linejoin": "round"
|
|
619
|
-
}, null, 8,
|
|
628
|
+
}, null, 8, Ms)
|
|
620
629
|
]));
|
|
621
630
|
}
|
|
622
|
-
}),
|
|
631
|
+
}), Ns = { class: "flex gap-8 items-center" }, Bs = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, zs = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, Ls = { class: "flex items-center w-full" }, Hs = { class: "flex-1" }, js = { class: "fm-typo-en-title-sm-800" }, Ys = { class: "flex items-start gap-8" }, Ks = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Qs = { class: "flex gap-1" }, pt = /* @__PURE__ */ le({
|
|
623
632
|
__name: "ForecastStock",
|
|
624
633
|
props: {
|
|
625
634
|
disabled: { type: Boolean }
|
|
626
635
|
},
|
|
627
636
|
emits: ["update:poItems"],
|
|
628
|
-
setup(
|
|
629
|
-
const
|
|
630
|
-
async function
|
|
637
|
+
setup(v, { emit: _ }) {
|
|
638
|
+
const r = _, i = E(!1), g = E(7), e = es(), u = $e(), x = Le(), { t: S } = ce();
|
|
639
|
+
async function n() {
|
|
631
640
|
if (g.value < 1)
|
|
632
641
|
return;
|
|
633
642
|
i.value = !1, await e.readPurchaseOrder(g.value);
|
|
@@ -640,7 +649,7 @@ const Es = {
|
|
|
640
649
|
return;
|
|
641
650
|
}
|
|
642
651
|
const a = e.purchaseOrderForecast.skus.reduce((m, c) => {
|
|
643
|
-
const p =
|
|
652
|
+
const p = x.skus.find(($) => $._id === c.id);
|
|
644
653
|
if (m.find(($) => $.sku._id === c.id) || !p)
|
|
645
654
|
return m;
|
|
646
655
|
const h = {
|
|
@@ -654,11 +663,11 @@ const Es = {
|
|
|
654
663
|
};
|
|
655
664
|
return m.push(h), m;
|
|
656
665
|
}, s);
|
|
657
|
-
|
|
666
|
+
r("update:poItems", a);
|
|
658
667
|
}
|
|
659
668
|
return (s, a) => {
|
|
660
669
|
const m = I("FmButton"), c = I("FmIcon"), p = I("FmStepperField"), F = I("FmPopover");
|
|
661
|
-
return
|
|
670
|
+
return k(), Q(F, {
|
|
662
671
|
disabled: s.disabled,
|
|
663
672
|
class: "flex",
|
|
664
673
|
"show-popover": i.value,
|
|
@@ -674,24 +683,24 @@ const Es = {
|
|
|
674
683
|
disabled: s.disabled
|
|
675
684
|
}, {
|
|
676
685
|
default: V(() => [
|
|
677
|
-
l("div",
|
|
678
|
-
d(
|
|
686
|
+
l("div", Ns, [
|
|
687
|
+
d(Os, {
|
|
679
688
|
size: 24,
|
|
680
689
|
color: s.disabled ? "#c7c7cc" : "#ff7823"
|
|
681
690
|
}, null, 8, ["color"]),
|
|
682
|
-
l("div",
|
|
691
|
+
l("div", Bs, A(t(S)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
683
692
|
])
|
|
684
693
|
]),
|
|
685
694
|
_: 1
|
|
686
695
|
}, 8, ["text-color", "border-color", "disabled"])
|
|
687
696
|
]),
|
|
688
697
|
default: V(() => [
|
|
689
|
-
l("div",
|
|
690
|
-
l("div",
|
|
691
|
-
l("div",
|
|
698
|
+
l("div", zs, [
|
|
699
|
+
l("div", Ls, [
|
|
700
|
+
l("div", Hs, [
|
|
692
701
|
d(ms, { "z-index": 99 }, {
|
|
693
702
|
default: V(() => [
|
|
694
|
-
l("p",
|
|
703
|
+
l("p", js, A(t(S)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
695
704
|
]),
|
|
696
705
|
_: 1
|
|
697
706
|
})
|
|
@@ -710,18 +719,18 @@ const Es = {
|
|
|
710
719
|
rules: [t(Ne)(1)]
|
|
711
720
|
}, {
|
|
712
721
|
"helper-text": V(() => [
|
|
713
|
-
l("div",
|
|
722
|
+
l("div", Ys, [
|
|
714
723
|
d(c, {
|
|
715
724
|
name: "warning",
|
|
716
725
|
size: "sm",
|
|
717
726
|
class: "text-fm-color-system-warning-300"
|
|
718
727
|
}),
|
|
719
|
-
l("div",
|
|
728
|
+
l("div", Ks, A(t(S)("inventory.transfer.form.items.forecastStock.replace")), 1)
|
|
720
729
|
])
|
|
721
730
|
]),
|
|
722
731
|
_: 1
|
|
723
732
|
}, 8, ["modelValue", "label", "rules"]),
|
|
724
|
-
l("div",
|
|
733
|
+
l("div", Qs, [
|
|
725
734
|
a[4] || (a[4] = l("div", { class: "grow" }, null, -1)),
|
|
726
735
|
d(m, {
|
|
727
736
|
label: t(S)("common.cancel"),
|
|
@@ -730,7 +739,7 @@ const Es = {
|
|
|
730
739
|
}, null, 8, ["label"]),
|
|
731
740
|
d(m, {
|
|
732
741
|
label: t(S)("inventory.transfer.form.items.forecastStock.generate"),
|
|
733
|
-
onClick:
|
|
742
|
+
onClick: n
|
|
734
743
|
}, null, 8, ["label"])
|
|
735
744
|
])
|
|
736
745
|
])
|
|
@@ -740,16 +749,16 @@ const Es = {
|
|
|
740
749
|
};
|
|
741
750
|
}
|
|
742
751
|
});
|
|
743
|
-
function
|
|
744
|
-
const
|
|
745
|
-
|
|
752
|
+
function Xs() {
|
|
753
|
+
const v = $e(), _ = Je(), r = E(!1);
|
|
754
|
+
fe(r, (u) => {
|
|
746
755
|
u && (g.value = !0, i().finally(() => {
|
|
747
756
|
g.value = !1;
|
|
748
757
|
}));
|
|
749
758
|
});
|
|
750
759
|
async function i() {
|
|
751
760
|
try {
|
|
752
|
-
const { startDate: u, endDate:
|
|
761
|
+
const { startDate: u, endDate: x } = qt(6), s = (await _.getPurchaseOrders({ start: u, end: x })).filter(
|
|
753
762
|
(a) => {
|
|
754
763
|
var m, c;
|
|
755
764
|
return a.status === Ut.enum.COMPLETE && ((m = a.supplier) == null ? void 0 : m.internal) !== "warehouse" && ((c = a.supplier) == null ? void 0 : c.internal) !== "restaurant";
|
|
@@ -772,20 +781,20 @@ function Zs() {
|
|
|
772
781
|
}, {});
|
|
773
782
|
e.value = s;
|
|
774
783
|
} catch {
|
|
775
|
-
|
|
784
|
+
v.open({
|
|
776
785
|
title: "Something went wrong",
|
|
777
786
|
message: "Cannot retrieve supplier purchase history. Please try again."
|
|
778
|
-
}),
|
|
787
|
+
}), r.value = !1;
|
|
779
788
|
}
|
|
780
789
|
}
|
|
781
790
|
const g = E(!1), e = E({});
|
|
782
791
|
return {
|
|
783
|
-
comparePricesToggle:
|
|
792
|
+
comparePricesToggle: r,
|
|
784
793
|
comparePriceFetching: g,
|
|
785
794
|
comparePriceBySku: e
|
|
786
795
|
};
|
|
787
796
|
}
|
|
788
|
-
const
|
|
797
|
+
const Zs = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }, Gs = ["colspan"], Js = /* @__PURE__ */ le({
|
|
789
798
|
__name: "TransferItemTable",
|
|
790
799
|
props: {
|
|
791
800
|
templateItem: {},
|
|
@@ -795,30 +804,30 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
795
804
|
disabled: { type: Boolean }
|
|
796
805
|
},
|
|
797
806
|
emits: ["update:item"],
|
|
798
|
-
setup(
|
|
799
|
-
function _(
|
|
800
|
-
return
|
|
807
|
+
setup(v) {
|
|
808
|
+
function _(r) {
|
|
809
|
+
return r.column.columnDef.meta;
|
|
801
810
|
}
|
|
802
|
-
return (
|
|
811
|
+
return (r, i) => {
|
|
803
812
|
var g, e;
|
|
804
|
-
return
|
|
813
|
+
return k(), T(ae, null, [
|
|
805
814
|
l("tr", {
|
|
806
815
|
class: K(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
|
|
807
|
-
"bg-fm-color-neutral-gray-100":
|
|
816
|
+
"bg-fm-color-neutral-gray-100": r.row.getIsSelected()
|
|
808
817
|
}])
|
|
809
818
|
}, [
|
|
810
|
-
(
|
|
811
|
-
var
|
|
812
|
-
return
|
|
819
|
+
(k(!0), T(ae, null, Ce(r.row.getVisibleCells(), (u) => {
|
|
820
|
+
var x, S, n, s;
|
|
821
|
+
return k(), T("td", {
|
|
813
822
|
key: u.id,
|
|
814
|
-
class: K(["h-[56px] text-fm-color-typo-primary", ((
|
|
823
|
+
class: K(["h-[56px] text-fm-color-typo-primary", ((x = _(u)) == null ? void 0 : x.cellClass) ?? "px-16"]),
|
|
815
824
|
style: bt({
|
|
816
825
|
width: (S = _(u)) == null ? void 0 : S.width,
|
|
817
|
-
maxWidth: (
|
|
826
|
+
maxWidth: (n = _(u)) == null ? void 0 : n.maxWidth,
|
|
818
827
|
textAlign: ((s = _(u)) == null ? void 0 : s.textAlign) ?? "left"
|
|
819
828
|
})
|
|
820
829
|
}, [
|
|
821
|
-
l("span",
|
|
830
|
+
l("span", Zs, [
|
|
822
831
|
d(t(de), {
|
|
823
832
|
render: u.column.columnDef.cell,
|
|
824
833
|
props: u.getContext()
|
|
@@ -827,25 +836,25 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
827
836
|
], 6);
|
|
828
837
|
}), 128))
|
|
829
838
|
], 2),
|
|
830
|
-
|
|
839
|
+
r.showComparePrice && Object.keys(r.comparePriceBySku[(g = r.row.original.sku) == null ? void 0 : g._id] ?? {}).length > 0 ? (k(), T("tr", Ws, [
|
|
831
840
|
l("td", {
|
|
832
|
-
colspan:
|
|
841
|
+
colspan: r.row.getVisibleCells().length
|
|
833
842
|
}, [
|
|
834
843
|
d(Ft, {
|
|
835
|
-
prices:
|
|
844
|
+
prices: r.comparePriceBySku[(e = r.row.original.sku) == null ? void 0 : e._id]
|
|
836
845
|
}, null, 8, ["prices"])
|
|
837
|
-
], 8,
|
|
846
|
+
], 8, Gs)
|
|
838
847
|
])) : B("", !0)
|
|
839
848
|
], 64);
|
|
840
849
|
};
|
|
841
850
|
}
|
|
842
|
-
}),
|
|
851
|
+
}), eo = {
|
|
843
852
|
key: 0,
|
|
844
853
|
class: "flex flex-col gap-8"
|
|
845
|
-
},
|
|
854
|
+
}, to = { class: "flex flex-col gap-4" }, so = { class: "flex items-center gap-4" }, oo = {
|
|
846
855
|
key: 0,
|
|
847
856
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-error"
|
|
848
|
-
},
|
|
857
|
+
}, ao = /* @__PURE__ */ le({
|
|
849
858
|
__name: "NetSuiteField",
|
|
850
859
|
props: {
|
|
851
860
|
required: { type: Boolean },
|
|
@@ -856,8 +865,8 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
856
865
|
onChange: { type: Function }
|
|
857
866
|
},
|
|
858
867
|
emits: ["netsuite:ready"],
|
|
859
|
-
setup(
|
|
860
|
-
const
|
|
868
|
+
setup(v, { emit: _ }) {
|
|
869
|
+
const r = ze(), i = v, g = _, { t: e } = ps(), u = E(!1), x = E();
|
|
861
870
|
Be(() => {
|
|
862
871
|
var a, m, c, p;
|
|
863
872
|
let s = {
|
|
@@ -865,12 +874,12 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
865
874
|
subsidiary: { id: "", name: "" },
|
|
866
875
|
errors: []
|
|
867
876
|
};
|
|
868
|
-
if (!
|
|
877
|
+
if (!r.isEnabled || !i.required) {
|
|
869
878
|
g("netsuite:ready", s);
|
|
870
879
|
return;
|
|
871
880
|
}
|
|
872
881
|
try {
|
|
873
|
-
const F =
|
|
882
|
+
const F = r.currentLocationSubsidiary();
|
|
874
883
|
i.setting ? s = {
|
|
875
884
|
...i.setting,
|
|
876
885
|
subsidiary: {
|
|
@@ -884,42 +893,42 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
884
893
|
name: F.name
|
|
885
894
|
}
|
|
886
895
|
};
|
|
887
|
-
const h =
|
|
888
|
-
if (
|
|
889
|
-
const w =
|
|
890
|
-
|
|
896
|
+
const h = r.getAvailableItems(F.id), $ = i.items.filter((y) => {
|
|
897
|
+
if (y.measurement != null) {
|
|
898
|
+
const w = r.getAvailableMeasurements(
|
|
899
|
+
y.sku._id,
|
|
891
900
|
F.id
|
|
892
901
|
);
|
|
893
|
-
return h.includes(
|
|
902
|
+
return h.includes(y.sku._id) && w.includes(y.measurement.id);
|
|
894
903
|
}
|
|
895
|
-
return h.includes(
|
|
896
|
-
}).map((
|
|
904
|
+
return h.includes(y.sku._id);
|
|
905
|
+
}).map((y) => y.sku._id);
|
|
897
906
|
i.onChange(
|
|
898
|
-
i.items.filter((
|
|
907
|
+
i.items.filter((y) => $.includes(y.sku._id)),
|
|
899
908
|
s
|
|
900
909
|
);
|
|
901
910
|
} finally {
|
|
902
|
-
i.supplier.internal ?
|
|
911
|
+
i.supplier.internal ? x.value = r.getNetSuiteLocation(
|
|
903
912
|
`${i.supplier.internal}_${i.supplier._id}`
|
|
904
|
-
) :
|
|
905
|
-
const F = i.supplier.internal ?
|
|
906
|
-
!
|
|
913
|
+
) : x.value = r.getNetSuiteVendor(i.supplier._id);
|
|
914
|
+
const F = i.supplier.internal ? r.getLocationSubsidiary((a = x.value) == null ? void 0 : a.netSuiteId).id : (m = x.value) == null ? void 0 : m.subsidiaryId, h = i.supplier.internal ? (c = r.currentLocationSubsidiary()) == null ? void 0 : c.id : (p = r.currentVendorSubsidiary(i.supplier._id)) == null ? void 0 : p.id;
|
|
915
|
+
!r.isEnabled || F && r.isEnabled && F == h ? g("netsuite:ready", s) : u.value = !0;
|
|
907
916
|
}
|
|
908
917
|
});
|
|
909
918
|
const S = q(
|
|
910
|
-
() => i.supplier.internal ?
|
|
911
|
-
),
|
|
919
|
+
() => i.supplier.internal ? r.currentLocationSubsidiary() : r.currentVendorSubsidiary(i.supplier._id)
|
|
920
|
+
), n = q(() => {
|
|
912
921
|
var s, a;
|
|
913
|
-
return
|
|
914
|
-
location is ${(a =
|
|
922
|
+
return x.value == null ? `Cannot find the NetSuite location for "${i.supplier.name}"` : `The subsidiary of the request
|
|
923
|
+
location is ${(a = r.getLocationSubsidiary((s = x.value) == null ? void 0 : s.netSuiteId)) == null ? void 0 : a.fullName}`;
|
|
915
924
|
});
|
|
916
925
|
return (s, a) => {
|
|
917
926
|
const m = I("FmLabel"), c = I("FmIcon"), p = I("FmField"), F = I("FmTooltip");
|
|
918
|
-
return t(
|
|
927
|
+
return t(r).isEnabled && i.required ? (k(), T("div", eo, [
|
|
919
928
|
d(m, {
|
|
920
929
|
label: `NetSuite ${t(e)("inventory.transfer.form.netsuite.subsidiary")}`
|
|
921
930
|
}, null, 8, ["label"]),
|
|
922
|
-
l("div",
|
|
931
|
+
l("div", to, [
|
|
923
932
|
d(F, {
|
|
924
933
|
"z-index": 51,
|
|
925
934
|
placement: "left",
|
|
@@ -933,7 +942,7 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
933
942
|
default: V(() => {
|
|
934
943
|
var h;
|
|
935
944
|
return [
|
|
936
|
-
l("div",
|
|
945
|
+
l("div", so, [
|
|
937
946
|
d(c, {
|
|
938
947
|
name: "lock_outline",
|
|
939
948
|
size: "sm",
|
|
@@ -950,21 +959,21 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
950
959
|
]),
|
|
951
960
|
_: 1
|
|
952
961
|
}, 8, ["disabled"]),
|
|
953
|
-
u.value ? (
|
|
962
|
+
u.value ? (k(), T("div", oo, A(n.value), 1)) : B("", !0)
|
|
954
963
|
])
|
|
955
964
|
])) : B("", !0);
|
|
956
965
|
};
|
|
957
966
|
}
|
|
958
|
-
}),
|
|
967
|
+
}), lo = { class: "flex flex-col gap-4" }, no = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, ro = { class: "flex flex-col gap-16" }, io = { class: "flex flex-col gap-24" }, uo = { class: "flex flex-col gap-8" }, co = { class: "flex flex-col gap-4" }, mo = { class: "flex items-center gap-4" }, po = { class: "flex flex-col gap-8" }, fo = { class: "flex flex-col gap-4" }, vo = { class: "flex items-center gap-4" }, yo = {
|
|
959
968
|
key: 3,
|
|
960
969
|
class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col"
|
|
961
|
-
},
|
|
970
|
+
}, bo = {
|
|
962
971
|
key: 0,
|
|
963
972
|
class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
|
|
964
|
-
},
|
|
973
|
+
}, go = { class: "flex-1" }, _o = { class: "flex-1" }, ho = {
|
|
965
974
|
key: 1,
|
|
966
975
|
class: "flex items-center gap-4"
|
|
967
|
-
}, ko = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" },
|
|
976
|
+
}, ko = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, xo = { class: "flex flex-col gap-16" }, Co = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, So = { class: "flex gap-8" }, wo = { key: 0 }, Fo = /* @__PURE__ */ le({
|
|
968
977
|
__name: "TransferForm2",
|
|
969
978
|
props: {
|
|
970
979
|
modelValue: {},
|
|
@@ -975,17 +984,17 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
975
984
|
lastClosingDate: {}
|
|
976
985
|
},
|
|
977
986
|
emits: ["validation-success", "form:ready"],
|
|
978
|
-
setup(
|
|
979
|
-
const i =
|
|
987
|
+
setup(v, { expose: _, emit: r }) {
|
|
988
|
+
const i = v, g = r, e = ht(), { t: u } = ce(), x = Ge(), S = Le(), n = ze(), s = tt(), a = Xe(), m = wt(), { breakpoints: c } = et(), p = q(() => c.value.xs || c.value.sm), F = yt({
|
|
980
989
|
value: !1
|
|
981
990
|
}), h = E(!1), $ = q(
|
|
982
991
|
() => {
|
|
983
992
|
var o;
|
|
984
993
|
return ((o = i.modelValue) == null ? void 0 : o.templateDoc) ?? m.templates.find((f) => f._id === e.template);
|
|
985
994
|
}
|
|
986
|
-
),
|
|
987
|
-
|
|
988
|
-
o &&
|
|
995
|
+
), y = q(() => e.status === "DRAFT" || !e._rev);
|
|
996
|
+
fe($, (o) => {
|
|
997
|
+
o && y.value && (e.supplier = (o == null ? void 0 : o.purchaseOrder.supplier) ?? e.supplier);
|
|
989
998
|
}), Be(() => {
|
|
990
999
|
var o;
|
|
991
1000
|
try {
|
|
@@ -994,13 +1003,13 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
994
1003
|
} finally {
|
|
995
1004
|
h.value = !0;
|
|
996
1005
|
}
|
|
997
|
-
}),
|
|
1006
|
+
}), fe([h, F], ([o, f], [M, ne]) => {
|
|
998
1007
|
f.value && ne.value && g("form:ready");
|
|
999
1008
|
});
|
|
1000
1009
|
const w = q(
|
|
1001
|
-
() =>
|
|
1010
|
+
() => x.currentLocation.type === Ot.restaurant
|
|
1002
1011
|
);
|
|
1003
|
-
|
|
1012
|
+
x.watchLocation(async () => {
|
|
1004
1013
|
location && (e.supplier || (e.supplier = s.suppliers.find((o) => o) ?? e.supplier));
|
|
1005
1014
|
});
|
|
1006
1015
|
const z = Ct(), P = us(
|
|
@@ -1021,7 +1030,7 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1021
1030
|
o !== f && (e.supplier = o === te.PURCHASE ? P.locationOptionsTypePurchase.value[0] : P.locationOptionsTypeTransfer.value[0]);
|
|
1022
1031
|
}
|
|
1023
1032
|
});
|
|
1024
|
-
|
|
1033
|
+
fe(
|
|
1025
1034
|
() => {
|
|
1026
1035
|
var o;
|
|
1027
1036
|
return (o = i.modelValue) == null ? void 0 : o.template;
|
|
@@ -1056,26 +1065,26 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1056
1065
|
set(o) {
|
|
1057
1066
|
e.remark = o;
|
|
1058
1067
|
}
|
|
1059
|
-
}), { backdatePo: L, backdateSwitch: X, backdateModel:
|
|
1068
|
+
}), { backdatePo: L, backdateSwitch: X, backdateModel: b, backdateTimeModel: C } = Rs({
|
|
1060
1069
|
getEffectiveAt() {
|
|
1061
1070
|
return e.effectiveAt;
|
|
1062
1071
|
},
|
|
1063
1072
|
setEffectiveAt(o) {
|
|
1064
1073
|
e.effectiveAt = o;
|
|
1065
1074
|
}
|
|
1066
|
-
}), { comparePricesToggle: H, comparePriceFetching: ie, comparePriceBySku: se } =
|
|
1075
|
+
}), { comparePricesToggle: H, comparePriceFetching: ie, comparePriceBySku: se } = Xs(), be = E();
|
|
1067
1076
|
_({
|
|
1068
1077
|
validateInputs: () => {
|
|
1069
1078
|
var o, f;
|
|
1070
|
-
(f = (o =
|
|
1079
|
+
(f = (o = be.value) == null ? void 0 : o.validateInputs) == null || f.call(o);
|
|
1071
1080
|
},
|
|
1072
1081
|
resetInputsValidation: () => {
|
|
1073
1082
|
var o, f;
|
|
1074
|
-
(f = (o =
|
|
1083
|
+
(f = (o = be.value) == null ? void 0 : o.resetInputsValidation) == null || f.call(o);
|
|
1075
1084
|
},
|
|
1076
1085
|
resetInputs: () => {
|
|
1077
1086
|
var o, f;
|
|
1078
|
-
(f = (o =
|
|
1087
|
+
(f = (o = be.value) == null ? void 0 : o.resetInputs) == null || f.call(o);
|
|
1079
1088
|
}
|
|
1080
1089
|
});
|
|
1081
1090
|
const Se = q(() => ({
|
|
@@ -1088,7 +1097,7 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1088
1097
|
(f) => f.id ? f.id !== o.id : f.sku._id !== o.sku._id
|
|
1089
1098
|
);
|
|
1090
1099
|
}
|
|
1091
|
-
})), we =
|
|
1100
|
+
})), we = vs({
|
|
1092
1101
|
updateItem: (o) => Se.value.updateItem(o),
|
|
1093
1102
|
deleteItem: (o) => Se.value.deleteItem(o),
|
|
1094
1103
|
get supplier() {
|
|
@@ -1108,14 +1117,14 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1108
1117
|
}
|
|
1109
1118
|
}), Ae = q(() => we.columnDefs.value);
|
|
1110
1119
|
function Ee() {
|
|
1111
|
-
var
|
|
1112
|
-
const o = (Ue = (De = (
|
|
1120
|
+
var ve, De, Ue, Me, Ie;
|
|
1121
|
+
const o = (Ue = (De = (ve = $.value) == null ? void 0 : ve.purchaseOrder) == null ? void 0 : De.items) == null ? void 0 : Ue.groupBy((N) => N.sku._id), f = n.isEnabled ? n.getAvailableItems((Ie = (Me = e.netSuite) == null ? void 0 : Me.subsidiary) == null ? void 0 : Ie.id) : [], M = o != null && o.size ? S.skus.filter((N) => o.has(N._id)) : S.skus, ne = n.isEnabled ? M.filter((N) => {
|
|
1113
1122
|
var ee, G, oe, ue;
|
|
1114
1123
|
const W = (G = (ee = $.value) == null ? void 0 : ee.purchaseOrder) == null ? void 0 : G.items.find(
|
|
1115
1124
|
(me) => me.sku._id === N._id
|
|
1116
1125
|
);
|
|
1117
1126
|
if (W != null && W.measurement != null) {
|
|
1118
|
-
const me =
|
|
1127
|
+
const me = n.getAvailableMeasurements(
|
|
1119
1128
|
W.sku._id,
|
|
1120
1129
|
(ue = (oe = e.netSuite) == null ? void 0 : oe.subsidiary) == null ? void 0 : ue.id
|
|
1121
1130
|
);
|
|
@@ -1132,7 +1141,7 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1132
1141
|
disabled: !ne.includes(N._id)
|
|
1133
1142
|
};
|
|
1134
1143
|
}
|
|
1135
|
-
),
|
|
1144
|
+
), _e = re.filter((N) => {
|
|
1136
1145
|
var W;
|
|
1137
1146
|
return (W = e.items) == null ? void 0 : W.find((ee) => ee.sku._id === N.value._id);
|
|
1138
1147
|
}).map((N) => N.value);
|
|
@@ -1141,7 +1150,7 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1141
1150
|
closeButton: !0,
|
|
1142
1151
|
contentComponent: Qe,
|
|
1143
1152
|
contentComponentProps: {
|
|
1144
|
-
modelValue:
|
|
1153
|
+
modelValue: _e,
|
|
1145
1154
|
items: re,
|
|
1146
1155
|
virtualScroll: !0
|
|
1147
1156
|
},
|
|
@@ -1157,11 +1166,11 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1157
1166
|
}).onPrimary((N) => {
|
|
1158
1167
|
const W = e.items ?? [], ee = N.map((G) => {
|
|
1159
1168
|
var me, Te;
|
|
1160
|
-
const oe = W.find((
|
|
1169
|
+
const oe = W.find((he) => he.sku._id === G._id);
|
|
1161
1170
|
if (oe)
|
|
1162
1171
|
return oe;
|
|
1163
1172
|
const ue = ((Te = (me = $.value) == null ? void 0 : me.purchaseOrder.items) == null ? void 0 : Te.find(
|
|
1164
|
-
(
|
|
1173
|
+
(he) => he.sku._id === G._id
|
|
1165
1174
|
)) ?? {
|
|
1166
1175
|
sku: G,
|
|
1167
1176
|
code: G.code,
|
|
@@ -1171,7 +1180,7 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1171
1180
|
precision: 0
|
|
1172
1181
|
}
|
|
1173
1182
|
};
|
|
1174
|
-
return R.value == te.PURCHASE && (ue.totalCost =
|
|
1183
|
+
return R.value == te.PURCHASE && (ue.totalCost = ye(
|
|
1175
1184
|
ue.sku,
|
|
1176
1185
|
ue.quantity,
|
|
1177
1186
|
ue.measurement,
|
|
@@ -1195,16 +1204,16 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1195
1204
|
label: u("inventory.transfer.form.type.transfer"),
|
|
1196
1205
|
value: te.TRANSFER
|
|
1197
1206
|
}), o;
|
|
1198
|
-
}),
|
|
1207
|
+
}), ge = q(() => {
|
|
1199
1208
|
var o;
|
|
1200
1209
|
return (o = i.modelValue) == null ? void 0 : o.items.every((f) => f.quantity.amount <= 0);
|
|
1201
1210
|
});
|
|
1202
1211
|
return (o, f) => {
|
|
1203
1212
|
var me, Te;
|
|
1204
|
-
const M = I("FmChip"), ne = I("FmLabel"), re = I("FmIcon"),
|
|
1205
|
-
return
|
|
1206
|
-
l("div",
|
|
1207
|
-
(me = i.modelValue) != null && me.template ? (
|
|
1213
|
+
const M = I("FmChip"), ne = I("FmLabel"), re = I("FmIcon"), _e = I("FmField"), ve = I("FmTooltip"), De = I("FmSelect"), Ue = I("FmTextField"), Me = I("FmTextarea"), Ie = I("FmSwitch"), N = I("FmDatePicker"), W = I("FmTimePicker"), ee = I("FmFormGroup"), G = I("FmButton"), oe = I("FmTable"), ue = I("FmForm");
|
|
1214
|
+
return k(), T("div", lo, [
|
|
1215
|
+
l("div", no, [
|
|
1216
|
+
(me = i.modelValue) != null && me.template ? (k(), Q(M, {
|
|
1208
1217
|
key: 0,
|
|
1209
1218
|
variant: o.disabled ? "warning" : void 0,
|
|
1210
1219
|
label: `${t(u)("inventory.transfer.template.title")}: ${((Te = $.value) == null ? void 0 : Te.name) ?? t(u)("inventory.transfer.form.loading")}`,
|
|
@@ -1212,11 +1221,11 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1212
1221
|
compact: ""
|
|
1213
1222
|
}, null, 8, ["variant", "label"])) : B("", !0),
|
|
1214
1223
|
d(M, {
|
|
1215
|
-
label: t(
|
|
1224
|
+
label: t(x).currentLocation.name,
|
|
1216
1225
|
icon: "storefront",
|
|
1217
1226
|
compact: ""
|
|
1218
1227
|
}, null, 8, ["label"]),
|
|
1219
|
-
o.lastClosingDate ? (
|
|
1228
|
+
o.lastClosingDate ? (k(), Q(M, {
|
|
1220
1229
|
key: 1,
|
|
1221
1230
|
label: `${t(u)("inventory.transfer.form.lastClosing")}: ${t(We)(o.lastClosingDate)} ${t(Bt)(o.lastClosingDate)}`,
|
|
1222
1231
|
icon: "calendar_month",
|
|
@@ -1225,24 +1234,24 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1225
1234
|
]),
|
|
1226
1235
|
d(ue, {
|
|
1227
1236
|
ref_key: "formRef",
|
|
1228
|
-
ref:
|
|
1237
|
+
ref: be,
|
|
1229
1238
|
class: "flex flex-col gap-32",
|
|
1230
1239
|
disabled: o.disabled,
|
|
1231
1240
|
onValidationFailed: console.log,
|
|
1232
|
-
onValidationSuccess: f[14] || (f[14] = (
|
|
1241
|
+
onValidationSuccess: f[14] || (f[14] = (he) => g("validation-success"))
|
|
1233
1242
|
}, {
|
|
1234
1243
|
default: V(() => {
|
|
1235
|
-
var
|
|
1244
|
+
var he, st, ot, at, lt, nt, rt, it;
|
|
1236
1245
|
return [
|
|
1237
|
-
l("div",
|
|
1238
|
-
l("div",
|
|
1239
|
-
(
|
|
1240
|
-
l("div",
|
|
1246
|
+
l("div", ro, [
|
|
1247
|
+
l("div", io, [
|
|
1248
|
+
(he = i.modelValue) != null && he.template ? (k(), T(ae, { key: 0 }, [
|
|
1249
|
+
l("div", uo, [
|
|
1241
1250
|
d(ne, {
|
|
1242
1251
|
label: t(u)("inventory.transfer.form.type.title")
|
|
1243
1252
|
}, null, 8, ["label"]),
|
|
1244
|
-
l("div",
|
|
1245
|
-
d(
|
|
1253
|
+
l("div", co, [
|
|
1254
|
+
d(ve, {
|
|
1246
1255
|
"z-index": 51,
|
|
1247
1256
|
placement: "left",
|
|
1248
1257
|
disabled: o.disabled
|
|
@@ -1251,9 +1260,9 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1251
1260
|
Fe("This field is locked from template.")
|
|
1252
1261
|
])),
|
|
1253
1262
|
default: V(() => [
|
|
1254
|
-
d(
|
|
1263
|
+
d(_e, null, {
|
|
1255
1264
|
default: V(() => [
|
|
1256
|
-
l("div",
|
|
1265
|
+
l("div", mo, [
|
|
1257
1266
|
d(re, {
|
|
1258
1267
|
name: "lock_outline",
|
|
1259
1268
|
size: "sm",
|
|
@@ -1277,12 +1286,12 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1277
1286
|
}, null, 2)
|
|
1278
1287
|
])
|
|
1279
1288
|
]),
|
|
1280
|
-
l("div",
|
|
1289
|
+
l("div", po, [
|
|
1281
1290
|
d(ne, {
|
|
1282
1291
|
label: R.value === t(te).PURCHASE ? t(u)("inventory.transfer.form.purchaseFrom") : t(u)("inventory.transfer.form.transferFrom")
|
|
1283
1292
|
}, null, 8, ["label"]),
|
|
1284
|
-
l("div",
|
|
1285
|
-
d(
|
|
1293
|
+
l("div", fo, [
|
|
1294
|
+
d(ve, {
|
|
1286
1295
|
"z-index": 51,
|
|
1287
1296
|
placement: "left",
|
|
1288
1297
|
disabled: o.disabled
|
|
@@ -1291,11 +1300,11 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1291
1300
|
Fe("This field is locked from template.")
|
|
1292
1301
|
])),
|
|
1293
1302
|
default: V(() => [
|
|
1294
|
-
d(
|
|
1303
|
+
d(_e, null, {
|
|
1295
1304
|
default: V(() => {
|
|
1296
1305
|
var D;
|
|
1297
1306
|
return [
|
|
1298
|
-
l("div",
|
|
1307
|
+
l("div", vo, [
|
|
1299
1308
|
d(re, {
|
|
1300
1309
|
name: "lock_outline",
|
|
1301
1310
|
size: "sm",
|
|
@@ -1314,7 +1323,7 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1314
1323
|
}, 8, ["disabled"])
|
|
1315
1324
|
])
|
|
1316
1325
|
])
|
|
1317
|
-
], 64)) : (
|
|
1326
|
+
], 64)) : (k(), T(ae, { key: 1 }, [
|
|
1318
1327
|
d(De, {
|
|
1319
1328
|
label: t(u)("inventory.transfer.form.type.title"),
|
|
1320
1329
|
"label-mark": "required",
|
|
@@ -1377,7 +1386,7 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1377
1386
|
"onUpdate:modelValue": f[3] || (f[3] = (D) => U.value = D),
|
|
1378
1387
|
class: K([o.disabled ? "text-fm-color-typo-disabled " : ""])
|
|
1379
1388
|
}, null, 8, ["label", "modelValue", "class"]),
|
|
1380
|
-
h.value ? (
|
|
1389
|
+
h.value ? (k(), Q(ao, {
|
|
1381
1390
|
key: 2,
|
|
1382
1391
|
required: t(e).template != null,
|
|
1383
1392
|
disabled: o.disabled,
|
|
@@ -1391,7 +1400,7 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1391
1400
|
F.value = !0;
|
|
1392
1401
|
})
|
|
1393
1402
|
}, null, 8, ["required", "disabled", "supplier", "setting", "items", "onChange"])) : B("", !0),
|
|
1394
|
-
t(a).enableBackdatePo ? (
|
|
1403
|
+
t(a).enableBackdatePo ? (k(), T("div", yo, [
|
|
1395
1404
|
l("div", {
|
|
1396
1405
|
class: K([
|
|
1397
1406
|
"flex",
|
|
@@ -1402,7 +1411,7 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1402
1411
|
}, [
|
|
1403
1412
|
d(Ie, {
|
|
1404
1413
|
modelValue: t(X),
|
|
1405
|
-
"onUpdate:modelValue": f[5] || (f[5] = (D) =>
|
|
1414
|
+
"onUpdate:modelValue": f[5] || (f[5] = (D) => ke(X) ? X.value = D : null),
|
|
1406
1415
|
label: t(u)("inventory.transfer.form.backdate.title"),
|
|
1407
1416
|
sublabel: t(u)("inventory.transfer.form.backdate.subtitle"),
|
|
1408
1417
|
"label-placement": "right",
|
|
@@ -1411,28 +1420,28 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1411
1420
|
l("div", {
|
|
1412
1421
|
class: K({ hidden: p.value, "w-16": !p.value })
|
|
1413
1422
|
}, null, 2),
|
|
1414
|
-
t(X) ? (
|
|
1415
|
-
l("div",
|
|
1423
|
+
t(X) ? (k(), T("div", bo, [
|
|
1424
|
+
l("div", go, [
|
|
1416
1425
|
d(N, {
|
|
1417
|
-
modelValue: t(
|
|
1418
|
-
"onUpdate:modelValue": f[6] || (f[6] = (D) =>
|
|
1426
|
+
modelValue: t(b),
|
|
1427
|
+
"onUpdate:modelValue": f[6] || (f[6] = (D) => ke(b) ? b.value = D : null)
|
|
1419
1428
|
}, null, 8, ["modelValue"])
|
|
1420
1429
|
]),
|
|
1421
|
-
l("div",
|
|
1430
|
+
l("div", _o, [
|
|
1422
1431
|
d(W, {
|
|
1423
1432
|
modelValue: t(C),
|
|
1424
|
-
"onUpdate:modelValue": f[7] || (f[7] = (D) =>
|
|
1433
|
+
"onUpdate:modelValue": f[7] || (f[7] = (D) => ke(C) ? C.value = D : null)
|
|
1425
1434
|
}, null, 8, ["modelValue"])
|
|
1426
1435
|
])
|
|
1427
1436
|
])) : B("", !0)
|
|
1428
1437
|
], 2),
|
|
1429
|
-
t(L) ? (
|
|
1438
|
+
t(L) ? (k(), Q(ee, {
|
|
1430
1439
|
key: 0,
|
|
1431
1440
|
modelValue: t(L),
|
|
1432
|
-
"onUpdate:modelValue": f[8] || (f[8] = (D) =>
|
|
1441
|
+
"onUpdate:modelValue": f[8] || (f[8] = (D) => ke(L) ? L.value = D : null),
|
|
1433
1442
|
rules: [t(Lt)(new Date(o.lastClosingDate), /* @__PURE__ */ new Date())]
|
|
1434
1443
|
}, null, 8, ["modelValue", "rules"])) : B("", !0),
|
|
1435
|
-
w.value && !o.lastClosingDate ? (
|
|
1444
|
+
w.value && !o.lastClosingDate ? (k(), T("div", ho, [
|
|
1436
1445
|
d(re, {
|
|
1437
1446
|
name: "error",
|
|
1438
1447
|
size: "sm",
|
|
@@ -1443,7 +1452,7 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1443
1452
|
])) : B("", !0)
|
|
1444
1453
|
])
|
|
1445
1454
|
]),
|
|
1446
|
-
l("div",
|
|
1455
|
+
l("div", xo, [
|
|
1447
1456
|
d(ee, {
|
|
1448
1457
|
"model-value": t(e).items,
|
|
1449
1458
|
rules: [t(Ne)(1)]
|
|
@@ -1457,8 +1466,8 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1457
1466
|
}
|
|
1458
1467
|
])
|
|
1459
1468
|
}, [
|
|
1460
|
-
l("div",
|
|
1461
|
-
l("div",
|
|
1469
|
+
l("div", Co, A(t(u)("inventory.transfer.form.items.title")), 1),
|
|
1470
|
+
l("div", So, [
|
|
1462
1471
|
d(G, {
|
|
1463
1472
|
disabled: o.disabled,
|
|
1464
1473
|
label: t(u)("inventory.transfer.form.items.addItem"),
|
|
@@ -1470,7 +1479,7 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1470
1479
|
onClick: f[9] || (f[9] = (D) => Ee()),
|
|
1471
1480
|
size: "md"
|
|
1472
1481
|
}, null, 8, ["disabled", "label"]),
|
|
1473
|
-
t(e).template ? (
|
|
1482
|
+
t(e).template ? (k(), Q(ve, {
|
|
1474
1483
|
key: 0,
|
|
1475
1484
|
"z-index": 50
|
|
1476
1485
|
}, {
|
|
@@ -1484,28 +1493,28 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1484
1493
|
})
|
|
1485
1494
|
]),
|
|
1486
1495
|
_: 1
|
|
1487
|
-
})) : (
|
|
1496
|
+
})) : (k(), Q(pt, {
|
|
1488
1497
|
key: 1,
|
|
1489
1498
|
"onUpdate:poItems": f[11] || (f[11] = (D) => t(e).items = D),
|
|
1490
1499
|
disabled: o.disabled || !!t(e).template
|
|
1491
1500
|
}, null, 8, ["disabled"]))
|
|
1492
1501
|
])
|
|
1493
1502
|
], 2),
|
|
1494
|
-
R.value === t(te).PURCHASE &&
|
|
1503
|
+
R.value === t(te).PURCHASE && y.value && t(a).enableTotalCost && ((st = o.modelValue) != null && st.items.length) ? (k(), T("div", wo, [
|
|
1495
1504
|
d(Ie, {
|
|
1496
1505
|
label: t(ie) ? t(u)("inventory.transfer.form.items.fetchingData") : t(u)("inventory.transfer.form.items.comparePriceHistory"),
|
|
1497
1506
|
"prepend-icon": "compare_arrows",
|
|
1498
1507
|
"label-placement": "right",
|
|
1499
1508
|
"model-value": t(H),
|
|
1500
|
-
"onUpdate:modelValue": f[12] || (f[12] = (D) =>
|
|
1509
|
+
"onUpdate:modelValue": f[12] || (f[12] = (D) => ke(H) ? H.value = D : null),
|
|
1501
1510
|
disabled: t(ie) || o.disabled
|
|
1502
1511
|
}, null, 8, ["label", "model-value", "disabled"])
|
|
1503
1512
|
])) : B("", !0),
|
|
1504
1513
|
d(ee, {
|
|
1505
|
-
"model-value":
|
|
1506
|
-
rules: [() =>
|
|
1514
|
+
"model-value": ge.value,
|
|
1515
|
+
rules: [() => ge.value ? "Must have at least one non-zero item" : !0]
|
|
1507
1516
|
}, null, 8, ["model-value", "rules"]),
|
|
1508
|
-
(
|
|
1517
|
+
(k(), Q(oe, {
|
|
1509
1518
|
"column-defs": Ae.value,
|
|
1510
1519
|
"column-visibility": {
|
|
1511
1520
|
[t(Z).Code]: !(((ot = o.modelValue) == null ? void 0 : ot.template) ?? ((at = o.modelValue) == null ? void 0 : at.templateDoc)),
|
|
@@ -1520,7 +1529,7 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1520
1529
|
"table-row": V((D) => {
|
|
1521
1530
|
var J, Ve, ut, dt;
|
|
1522
1531
|
return [
|
|
1523
|
-
d(
|
|
1532
|
+
d(Js, {
|
|
1524
1533
|
"compare-price-by-sku": t(se),
|
|
1525
1534
|
"show-compare-price": R.value === t(te).PURCHASE && t(H),
|
|
1526
1535
|
row: D,
|
|
@@ -1533,12 +1542,12 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1533
1542
|
];
|
|
1534
1543
|
}),
|
|
1535
1544
|
"list-row": V((D) => [
|
|
1536
|
-
(
|
|
1545
|
+
(k(), Q(kt, {
|
|
1537
1546
|
row: D,
|
|
1538
1547
|
key: t(e).items.map((J) => J.sku._id).join(".")
|
|
1539
1548
|
}, {
|
|
1540
1549
|
default: V((J) => [
|
|
1541
|
-
d(
|
|
1550
|
+
d(Ps, {
|
|
1542
1551
|
"compare-price-by-sku": t(se),
|
|
1543
1552
|
"show-compare-price": R.value === t(te).PURCHASE && t(H),
|
|
1544
1553
|
row: D,
|
|
@@ -1558,7 +1567,7 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1558
1567
|
]);
|
|
1559
1568
|
};
|
|
1560
1569
|
}
|
|
1561
|
-
}),
|
|
1570
|
+
}), $o = { class: "flex items-center" }, Do = { class: "fm-typo-en-title-md-800" }, Io = { class: "flex gap-4" }, To = /* @__PURE__ */ le({
|
|
1562
1571
|
__name: "TransferDialog",
|
|
1563
1572
|
props: {
|
|
1564
1573
|
mode: {},
|
|
@@ -1568,16 +1577,16 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1568
1577
|
lastClosingDate: {}
|
|
1569
1578
|
},
|
|
1570
1579
|
emits: ["update:show", "submitted"],
|
|
1571
|
-
setup(
|
|
1580
|
+
setup(v, { expose: _, emit: r }) {
|
|
1572
1581
|
var X;
|
|
1573
|
-
const i =
|
|
1574
|
-
async function F(
|
|
1575
|
-
if (
|
|
1582
|
+
const i = v, g = r, e = Je(), u = wt(), x = $e(), S = tt(), n = Le(), s = Ge(), { t: a } = ce(), m = E(!1), c = E(!1), p = E(!1);
|
|
1583
|
+
async function F(b) {
|
|
1584
|
+
if (b) {
|
|
1576
1585
|
c.value = !1;
|
|
1577
1586
|
try {
|
|
1578
1587
|
await S.readSuppliers(), c.value = !0;
|
|
1579
1588
|
} catch {
|
|
1580
|
-
|
|
1589
|
+
x.open({
|
|
1581
1590
|
title: a("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
|
|
1582
1591
|
message: a("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
|
|
1583
1592
|
type: "error"
|
|
@@ -1620,12 +1629,12 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1620
1629
|
templateDoc: u.templates.find((C) => C._id === i.templateId)
|
|
1621
1630
|
};
|
|
1622
1631
|
}
|
|
1623
|
-
const $ = St(i, "show"),
|
|
1624
|
-
|
|
1632
|
+
const $ = St(i, "show"), y = E(i.modelValue ?? h()), w = E(((X = i.modelValue) == null ? void 0 : X._id) ?? `${Math.random()}`);
|
|
1633
|
+
fe(
|
|
1625
1634
|
() => i.show,
|
|
1626
|
-
(
|
|
1635
|
+
(b) => {
|
|
1627
1636
|
var C;
|
|
1628
|
-
|
|
1637
|
+
b && (p.value = !1, y.value = i.modelValue ?? h(), w.value = ((C = i.modelValue) == null ? void 0 : C._id) ?? `${Math.random()}`);
|
|
1629
1638
|
}
|
|
1630
1639
|
);
|
|
1631
1640
|
const z = q(() => !c.value || !p.value), P = q(() => {
|
|
@@ -1641,37 +1650,37 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1641
1650
|
}), R = E();
|
|
1642
1651
|
_({
|
|
1643
1652
|
validateInputs: () => {
|
|
1644
|
-
var
|
|
1645
|
-
(C = (
|
|
1653
|
+
var b, C;
|
|
1654
|
+
(C = (b = R.value) == null ? void 0 : b.validateInputs) == null || C.call(b);
|
|
1646
1655
|
},
|
|
1647
1656
|
resetInputsValidation: () => {
|
|
1648
|
-
var
|
|
1649
|
-
(C = (
|
|
1657
|
+
var b, C;
|
|
1658
|
+
(C = (b = R.value) == null ? void 0 : b.resetInputsValidation) == null || C.call(b);
|
|
1650
1659
|
},
|
|
1651
1660
|
resetInputs: () => {
|
|
1652
|
-
var
|
|
1653
|
-
(C = (
|
|
1661
|
+
var b, C;
|
|
1662
|
+
(C = (b = R.value) == null ? void 0 : b.resetInputs) == null || C.call(b);
|
|
1654
1663
|
}
|
|
1655
1664
|
});
|
|
1656
1665
|
async function Y() {
|
|
1657
|
-
const
|
|
1658
|
-
if (m.value = !0,
|
|
1659
|
-
|
|
1666
|
+
const b = y.value;
|
|
1667
|
+
if (m.value = !0, b.items = b.items.filter((C) => C.quantity.amount > 0), !b.items.length) {
|
|
1668
|
+
x.open({
|
|
1660
1669
|
title: "Cannot create order",
|
|
1661
1670
|
message: "There are no items with non-zero amount in your request.",
|
|
1662
1671
|
type: "error"
|
|
1663
1672
|
});
|
|
1664
1673
|
return;
|
|
1665
1674
|
}
|
|
1666
|
-
(
|
|
1675
|
+
(b.supplier.internal === "warehouse" || b.supplier.internal === "restaurant") && (b.items = b.items.map(({ totalCost: C, ...H }) => H));
|
|
1667
1676
|
try {
|
|
1668
|
-
await e.createPurchaseOrder(
|
|
1677
|
+
await e.createPurchaseOrder(b), await new Promise((C) => setTimeout(C, 1e3)), x.open({
|
|
1669
1678
|
title: a("inventory.transfer.receiveRequest.create.success"),
|
|
1670
1679
|
message: a("inventory.transfer.receiveRequest.create.successMessage"),
|
|
1671
1680
|
type: "success"
|
|
1672
1681
|
}), g("update:show", !1), g("submitted");
|
|
1673
1682
|
} catch (C) {
|
|
1674
|
-
|
|
1683
|
+
x.open({
|
|
1675
1684
|
title: a("inventory.transfer.receiveRequest.create.error.title"),
|
|
1676
1685
|
message: a("inventory.transfer.receiveRequest.create.error.message"),
|
|
1677
1686
|
type: "error"
|
|
@@ -1681,24 +1690,24 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1681
1690
|
}
|
|
1682
1691
|
}
|
|
1683
1692
|
async function O() {
|
|
1684
|
-
const
|
|
1685
|
-
if (m.value = !0,
|
|
1686
|
-
|
|
1693
|
+
const b = y.value;
|
|
1694
|
+
if (m.value = !0, b.items = b.items.filter((C) => C.quantity.amount > 0), !b.items.length) {
|
|
1695
|
+
x.open({
|
|
1687
1696
|
title: "Cannot create order",
|
|
1688
1697
|
message: "There are no items with non-zero amount in your request.",
|
|
1689
1698
|
type: "error"
|
|
1690
1699
|
});
|
|
1691
1700
|
return;
|
|
1692
1701
|
}
|
|
1693
|
-
(
|
|
1702
|
+
(b.supplier.internal === "warehouse" || b.supplier.internal === "restaurant") && (b.items = b.items.map(({ totalCost: C, ...H }) => H));
|
|
1694
1703
|
try {
|
|
1695
|
-
await e.updatePurchaseOrder(
|
|
1704
|
+
await e.updatePurchaseOrder(b), await new Promise((C) => setTimeout(C, 1e3)), x.open({
|
|
1696
1705
|
title: a("inventory.transfer.receiveRequest.update.success"),
|
|
1697
1706
|
message: a("inventory.transfer.receiveRequest.update.successMessage"),
|
|
1698
1707
|
type: "success"
|
|
1699
1708
|
}), g("update:show", !1), g("submitted");
|
|
1700
1709
|
} catch (C) {
|
|
1701
|
-
|
|
1710
|
+
x.open({
|
|
1702
1711
|
title: a("inventory.transfer.receiveRequest.update.error.title"),
|
|
1703
1712
|
message: a("inventory.transfer.receiveRequest.update.error.message"),
|
|
1704
1713
|
type: "error"
|
|
@@ -1716,41 +1725,41 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1716
1725
|
}
|
|
1717
1726
|
}
|
|
1718
1727
|
function L() {
|
|
1719
|
-
var
|
|
1720
|
-
(C = (
|
|
1728
|
+
var b, C;
|
|
1729
|
+
(C = (b = R.value) == null ? void 0 : b.validateInputs) == null || C.call(b);
|
|
1721
1730
|
}
|
|
1722
|
-
return (
|
|
1731
|
+
return (b, C) => {
|
|
1723
1732
|
const H = I("FmButton"), ie = I("FmSideSheet");
|
|
1724
|
-
return
|
|
1733
|
+
return k(), Q(ie, {
|
|
1725
1734
|
modelValue: t($),
|
|
1726
|
-
"onUpdate:modelValue": C[3] || (C[3] = (se) =>
|
|
1735
|
+
"onUpdate:modelValue": C[3] || (C[3] = (se) => ke($) ? $.value = se : null),
|
|
1727
1736
|
"dismiss-away": "",
|
|
1728
1737
|
"close-button": "",
|
|
1729
1738
|
"max-width": 900
|
|
1730
1739
|
}, {
|
|
1731
1740
|
"side-sheet-header": V(() => [
|
|
1732
|
-
l("div",
|
|
1733
|
-
l("div",
|
|
1741
|
+
l("div", $o, [
|
|
1742
|
+
l("div", Do, A(P.value), 1)
|
|
1734
1743
|
])
|
|
1735
1744
|
]),
|
|
1736
1745
|
default: V(() => [
|
|
1737
|
-
(
|
|
1746
|
+
(k(), Q(Fo, {
|
|
1738
1747
|
class: "w-full",
|
|
1739
1748
|
ref_key: "formRef",
|
|
1740
1749
|
ref: R,
|
|
1741
1750
|
"onForm:ready": C[0] || (C[0] = () => p.value = !0),
|
|
1742
1751
|
onValidationSuccess: U,
|
|
1743
|
-
modelValue:
|
|
1744
|
-
"onUpdate:modelValue": C[1] || (C[1] = (se) =>
|
|
1752
|
+
modelValue: y.value,
|
|
1753
|
+
"onUpdate:modelValue": C[1] || (C[1] = (se) => y.value = se),
|
|
1745
1754
|
disabled: m.value || z.value,
|
|
1746
1755
|
suppliers: t(S).suppliers,
|
|
1747
|
-
skus: t(
|
|
1756
|
+
skus: t(n).skus,
|
|
1748
1757
|
key: w.value,
|
|
1749
|
-
"last-closing-date":
|
|
1758
|
+
"last-closing-date": b.lastClosingDate
|
|
1750
1759
|
}, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
|
|
1751
1760
|
]),
|
|
1752
1761
|
"side-sheet-footer": V(() => [
|
|
1753
|
-
l("div",
|
|
1762
|
+
l("div", Io, [
|
|
1754
1763
|
d(H, {
|
|
1755
1764
|
loading: m.value,
|
|
1756
1765
|
disabled: z.value,
|
|
@@ -1770,17 +1779,17 @@ const Ws = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Gs = { key: 0 }
|
|
|
1770
1779
|
};
|
|
1771
1780
|
}
|
|
1772
1781
|
});
|
|
1773
|
-
function
|
|
1774
|
-
const [_,
|
|
1775
|
-
if (
|
|
1782
|
+
function Vo(v) {
|
|
1783
|
+
const [_, r, i, ...g] = Ht(v), e = i.map((n) => n.toLowerCase().trim().replace(/ /g, "_")), x = ["item_name", "transfer_quantity(uom)", "uom", "scanned_code"].filter((n) => !e.includes(n));
|
|
1784
|
+
if (x.length)
|
|
1776
1785
|
throw new Error(
|
|
1777
|
-
`Missing headers (${
|
|
1786
|
+
`Missing headers (${x.join()}). Excel file does not come from the template.`
|
|
1778
1787
|
);
|
|
1779
|
-
return g.map((
|
|
1788
|
+
return g.map((n, s) => {
|
|
1780
1789
|
const a = {};
|
|
1781
1790
|
for (const m in e) {
|
|
1782
1791
|
const c = e[m];
|
|
1783
|
-
Object.assign(a, { [c]:
|
|
1792
|
+
Object.assign(a, { [c]: n[m] });
|
|
1784
1793
|
}
|
|
1785
1794
|
return {
|
|
1786
1795
|
index: s,
|
|
@@ -1788,15 +1797,15 @@ function Po(b) {
|
|
|
1788
1797
|
};
|
|
1789
1798
|
});
|
|
1790
1799
|
}
|
|
1791
|
-
function
|
|
1792
|
-
const _ =
|
|
1800
|
+
function Po(v) {
|
|
1801
|
+
const _ = v.SheetNames;
|
|
1793
1802
|
try {
|
|
1794
1803
|
return _.reduce(
|
|
1795
1804
|
(i, g) => {
|
|
1796
|
-
const e = new Array(), u =
|
|
1805
|
+
const e = new Array(), u = v.Sheets[g], x = Le(), S = Vo(u), n = [];
|
|
1797
1806
|
for (const { index: a, data: m } of S) {
|
|
1798
1807
|
m.scanned_code === "" && e.push(`Row ${a + 1}: Scanned code is empty`), m.item_name === "" && e.push(`Row ${a + 1}: Item name is empty`), m.uom === "" && e.push(`Row ${a + 1}: UOM is empty`), m["transfer_quantity(uom)"] === "" && e.push(`Row ${a + 1}: Transfer quantity is empty`);
|
|
1799
|
-
const c =
|
|
1808
|
+
const c = x.skus.find((h) => h.code === m.scanned_code);
|
|
1800
1809
|
if (!c) {
|
|
1801
1810
|
e.push(`Row ${a + 1}: SKU not found`);
|
|
1802
1811
|
continue;
|
|
@@ -1811,7 +1820,7 @@ function Ro(b) {
|
|
|
1811
1820
|
}
|
|
1812
1821
|
F = h;
|
|
1813
1822
|
}
|
|
1814
|
-
|
|
1823
|
+
n.push({
|
|
1815
1824
|
sku: c,
|
|
1816
1825
|
code: m.scanned_code,
|
|
1817
1826
|
name: m.item_name,
|
|
@@ -1821,7 +1830,7 @@ function Ro(b) {
|
|
|
1821
1830
|
}
|
|
1822
1831
|
const s = {
|
|
1823
1832
|
type: "create",
|
|
1824
|
-
poItems:
|
|
1833
|
+
poItems: n,
|
|
1825
1834
|
excelSheetName: g,
|
|
1826
1835
|
errors: e
|
|
1827
1836
|
};
|
|
@@ -1832,20 +1841,20 @@ function Ro(b) {
|
|
|
1832
1841
|
importCreateResult: new Array()
|
|
1833
1842
|
}
|
|
1834
1843
|
);
|
|
1835
|
-
} catch (
|
|
1844
|
+
} catch (r) {
|
|
1836
1845
|
return {
|
|
1837
1846
|
invalidExcel: !0,
|
|
1838
|
-
invalidExcelMessage: (
|
|
1847
|
+
invalidExcelMessage: (r == null ? void 0 : r.message) ?? "Invalid excel",
|
|
1839
1848
|
importCreateResult: []
|
|
1840
1849
|
};
|
|
1841
1850
|
}
|
|
1842
1851
|
}
|
|
1843
|
-
const
|
|
1852
|
+
const Ro = exports.FfCalculator, Ao = { class: "flex flex-col flex-1" }, Eo = { class: "flex flex-col" }, qo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Uo = {
|
|
1844
1853
|
key: 0,
|
|
1845
1854
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
1846
|
-
},
|
|
1855
|
+
}, Mo = { key: 0 }, Oo = {
|
|
1847
1856
|
class: /* @__PURE__ */ K(["fm-typo-en-body-lg-600"])
|
|
1848
|
-
},
|
|
1857
|
+
}, No = { class: "flex-1" }, Bo = { class: "flex-auto line-clamp-2 text-ellipsis break-all fm-typo-en-body-sm-400" }, zo = { class: "flex-auto line-clamp-2 text-ellipsis break-all" }, Lo = { class: "text-fm-color-typo-primary" }, Ho = { class: "ml-auto" }, jo = { key: 0 }, Yo = /* @__PURE__ */ le({
|
|
1849
1858
|
__name: "XilnexResult",
|
|
1850
1859
|
props: {
|
|
1851
1860
|
type: {},
|
|
@@ -1853,32 +1862,32 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
1853
1862
|
items: {},
|
|
1854
1863
|
errors: {}
|
|
1855
1864
|
},
|
|
1856
|
-
setup(
|
|
1857
|
-
const _ =
|
|
1865
|
+
setup(v) {
|
|
1866
|
+
const _ = v, { t: r } = ce(), i = E(!1), g = () => {
|
|
1858
1867
|
_.errors.length && (i.value = !i.value);
|
|
1859
1868
|
};
|
|
1860
1869
|
return (e, u) => {
|
|
1861
|
-
var
|
|
1862
|
-
const
|
|
1863
|
-
return
|
|
1870
|
+
var n;
|
|
1871
|
+
const x = I("FmIcon"), S = I("FmTooltip");
|
|
1872
|
+
return k(), T("div", Ao, [
|
|
1864
1873
|
l("div", {
|
|
1865
1874
|
onClick: g,
|
|
1866
1875
|
class: K({
|
|
1867
1876
|
"cursor-pointer": e.errors.length
|
|
1868
1877
|
})
|
|
1869
1878
|
}, [
|
|
1870
|
-
l("div",
|
|
1871
|
-
l("div",
|
|
1879
|
+
l("div", Eo, [
|
|
1880
|
+
l("div", qo, [
|
|
1872
1881
|
l("div", {
|
|
1873
1882
|
class: K({
|
|
1874
1883
|
"text-fm-color-system-error-300": e.errors.length
|
|
1875
1884
|
})
|
|
1876
1885
|
}, [
|
|
1877
1886
|
Fe(A(e.name) + " ", 1),
|
|
1878
|
-
e.type === "create" ? (
|
|
1887
|
+
e.type === "create" ? (k(), T("span", Uo, "(" + A(t(r)("inventory.closing.template.import.new")) + ")", 1)) : B("", !0)
|
|
1879
1888
|
], 2),
|
|
1880
|
-
e.errors.length ? (
|
|
1881
|
-
d(
|
|
1889
|
+
e.errors.length ? (k(), T("div", Mo, [
|
|
1890
|
+
d(x, {
|
|
1882
1891
|
name: "error",
|
|
1883
1892
|
size: "sm",
|
|
1884
1893
|
color: "system-error-300"
|
|
@@ -1886,19 +1895,19 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
1886
1895
|
])) : B("", !0)
|
|
1887
1896
|
]),
|
|
1888
1897
|
u[0] || (u[0] = l("hr", { class: "my-2" }, null, -1)),
|
|
1889
|
-
l("div",
|
|
1890
|
-
(
|
|
1898
|
+
l("div", Oo, [
|
|
1899
|
+
(n = e.items) != null && n.length ? (k(!0), T(ae, { key: 0 }, Ce(e.items, (s, a) => (k(), T("div", {
|
|
1891
1900
|
key: a,
|
|
1892
1901
|
class: "flex gap-4 mt-2 items-center"
|
|
1893
1902
|
}, [
|
|
1894
|
-
l("div",
|
|
1903
|
+
l("div", No, [
|
|
1895
1904
|
d(S, {
|
|
1896
1905
|
content: s.code,
|
|
1897
1906
|
placement: "top",
|
|
1898
1907
|
"z-index": 51
|
|
1899
1908
|
}, {
|
|
1900
1909
|
default: V(() => [
|
|
1901
|
-
l("span",
|
|
1910
|
+
l("span", Bo, A(s.code), 1)
|
|
1902
1911
|
]),
|
|
1903
1912
|
_: 2
|
|
1904
1913
|
}, 1032, ["content"]),
|
|
@@ -1908,13 +1917,13 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
1908
1917
|
"z-index": 51
|
|
1909
1918
|
}, {
|
|
1910
1919
|
default: V(() => [
|
|
1911
|
-
l("span",
|
|
1920
|
+
l("span", zo, A(s.name), 1)
|
|
1912
1921
|
]),
|
|
1913
1922
|
_: 2
|
|
1914
1923
|
}, 1032, ["content"])
|
|
1915
1924
|
]),
|
|
1916
1925
|
l("div", null, [
|
|
1917
|
-
l("span",
|
|
1926
|
+
l("span", Lo, A(t(Ro).toFormatString({
|
|
1918
1927
|
value: s.quantity
|
|
1919
1928
|
})), 1),
|
|
1920
1929
|
Fe(" " + A(s.measurement ? s.measurement.abbrev : s.sku.unit.abbrev), 1)
|
|
@@ -1922,55 +1931,55 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
1922
1931
|
]))), 128)) : B("", !0)
|
|
1923
1932
|
])
|
|
1924
1933
|
]),
|
|
1925
|
-
l("div",
|
|
1926
|
-
e.errors.length ? (
|
|
1934
|
+
l("div", Ho, [
|
|
1935
|
+
e.errors.length ? (k(), Q(x, {
|
|
1927
1936
|
key: 0,
|
|
1928
1937
|
name: i.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
1929
1938
|
size: "md"
|
|
1930
1939
|
}, null, 8, ["name"])) : B("", !0)
|
|
1931
1940
|
])
|
|
1932
1941
|
], 2),
|
|
1933
|
-
i.value ? (
|
|
1942
|
+
i.value ? (k(), T("div", {
|
|
1934
1943
|
key: 0,
|
|
1935
1944
|
class: K(["flex flex-col gap-4 pl-8 fm-typo-en-body-sm-400", {
|
|
1936
1945
|
"text-fm-color-typo-secondary": !e.errors.length,
|
|
1937
1946
|
"text-fm-color-system-error-300": e.errors.length
|
|
1938
1947
|
}])
|
|
1939
1948
|
}, [
|
|
1940
|
-
e.errors.length ? (
|
|
1949
|
+
e.errors.length ? (k(), T("div", jo, [
|
|
1941
1950
|
l("ol", null, [
|
|
1942
|
-
(
|
|
1951
|
+
(k(!0), T(ae, null, Ce(e.errors, (s, a) => (k(), T("li", { key: a }, A(s), 1))), 128))
|
|
1943
1952
|
])
|
|
1944
1953
|
])) : B("", !0)
|
|
1945
1954
|
], 2)) : B("", !0)
|
|
1946
1955
|
]);
|
|
1947
1956
|
};
|
|
1948
1957
|
}
|
|
1949
|
-
}),
|
|
1958
|
+
}), Ko = { class: "flex flex-col gap-24" }, Qo = {
|
|
1950
1959
|
key: 0,
|
|
1951
1960
|
class: "flex items-center gap-8"
|
|
1952
|
-
},
|
|
1961
|
+
}, Xo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Zo = { class: "flex flex-col gap-8" }, Wo = { class: "line-clamp-2 text-ellipsis break-all" }, Go = {
|
|
1953
1962
|
key: 2,
|
|
1954
1963
|
class: "shrink-0"
|
|
1955
|
-
},
|
|
1964
|
+
}, Jo = {
|
|
1956
1965
|
key: 0,
|
|
1957
1966
|
class: "flex flex-col"
|
|
1958
|
-
},
|
|
1967
|
+
}, ea = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, ta = {
|
|
1959
1968
|
key: 0,
|
|
1960
1969
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
1961
|
-
},
|
|
1970
|
+
}, sa = { class: "fm-typo-en-body-lg-600" }, ft = "Transfer note", oa = /* @__PURE__ */ le({
|
|
1962
1971
|
__name: "XilnexImportForm",
|
|
1963
|
-
setup(
|
|
1964
|
-
const
|
|
1972
|
+
setup(v, { expose: _ }) {
|
|
1973
|
+
const r = E(null), i = $e(), g = E(!1), e = E(!1), u = ht(), x = E(!1), S = ze();
|
|
1965
1974
|
E([]);
|
|
1966
|
-
const
|
|
1975
|
+
const n = q({
|
|
1967
1976
|
get() {
|
|
1968
|
-
var
|
|
1969
|
-
return ((
|
|
1977
|
+
var y;
|
|
1978
|
+
return ((y = u.supplier) == null ? void 0 : y.name) ?? "";
|
|
1970
1979
|
},
|
|
1971
|
-
set(
|
|
1972
|
-
|
|
1973
|
-
name:
|
|
1980
|
+
set(y) {
|
|
1981
|
+
y && (u.supplier = {
|
|
1982
|
+
name: y,
|
|
1974
1983
|
registrationNumber: "",
|
|
1975
1984
|
_id: "xilnex",
|
|
1976
1985
|
internal: "restaurant",
|
|
@@ -1986,16 +1995,16 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
1986
1995
|
}
|
|
1987
1996
|
});
|
|
1988
1997
|
Be(async () => {
|
|
1989
|
-
const
|
|
1990
|
-
console.log(
|
|
1998
|
+
const y = await S.getNetSuiteLocations();
|
|
1999
|
+
console.log(y), x.value = !0;
|
|
1991
2000
|
});
|
|
1992
2001
|
const s = q({
|
|
1993
2002
|
get() {
|
|
1994
2003
|
return "";
|
|
1995
2004
|
},
|
|
1996
|
-
set(
|
|
1997
|
-
if (
|
|
1998
|
-
const w = u.effectiveAt ? new Date(u.effectiveAt) : /* @__PURE__ */ new Date(), [z, P, R] =
|
|
2005
|
+
set(y) {
|
|
2006
|
+
if (y) {
|
|
2007
|
+
const w = u.effectiveAt ? new Date(u.effectiveAt) : /* @__PURE__ */ new Date(), [z, P, R] = y.split("-");
|
|
1999
2008
|
w.setFullYear(parseInt(z)), w.setMonth(parseInt(P) - 1), w.setDate(parseInt(R)), u.effectiveAt = w.toISOString();
|
|
2000
2009
|
}
|
|
2001
2010
|
}
|
|
@@ -2003,39 +2012,39 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2003
2012
|
get() {
|
|
2004
2013
|
return null;
|
|
2005
2014
|
},
|
|
2006
|
-
set(
|
|
2007
|
-
if (
|
|
2008
|
-
const w = u.effectiveAt ? new Date(u.effectiveAt) : /* @__PURE__ */ new Date(), [z, P] =
|
|
2015
|
+
set(y) {
|
|
2016
|
+
if (y) {
|
|
2017
|
+
const w = u.effectiveAt ? new Date(u.effectiveAt) : /* @__PURE__ */ new Date(), [z, P] = y.split(":");
|
|
2009
2018
|
w.setMinutes(parseInt(z)), w.setSeconds(parseInt(P)), u.effectiveAt = w.toISOString();
|
|
2010
2019
|
}
|
|
2011
2020
|
}
|
|
2012
2021
|
}), m = E(new Array()), c = E([]), p = q(
|
|
2013
|
-
() => !!m.value.length || c.value.some((
|
|
2022
|
+
() => !!m.value.length || c.value.some((y) => y.errors.length)
|
|
2014
2023
|
), F = E();
|
|
2015
2024
|
_({
|
|
2016
2025
|
validateInputs: () => {
|
|
2017
|
-
var
|
|
2018
|
-
(w = (
|
|
2026
|
+
var y, w;
|
|
2027
|
+
(w = (y = F.value) == null ? void 0 : y.validateInputs) == null || w.call(y);
|
|
2019
2028
|
},
|
|
2020
2029
|
resetInputsValidation: () => {
|
|
2021
|
-
var
|
|
2022
|
-
(w = (
|
|
2030
|
+
var y, w;
|
|
2031
|
+
(w = (y = F.value) == null ? void 0 : y.resetInputsValidation) == null || w.call(y);
|
|
2023
2032
|
},
|
|
2024
2033
|
resetInputs: () => {
|
|
2025
|
-
var
|
|
2026
|
-
(w = (
|
|
2034
|
+
var y, w;
|
|
2035
|
+
(w = (y = F.value) == null ? void 0 : y.resetInputs) == null || w.call(y);
|
|
2027
2036
|
}
|
|
2028
2037
|
});
|
|
2029
2038
|
const { t: h } = ce();
|
|
2030
|
-
async function $(
|
|
2039
|
+
async function $(y) {
|
|
2031
2040
|
m.value = [], c.value = [];
|
|
2032
2041
|
try {
|
|
2033
2042
|
g.value = !0;
|
|
2034
2043
|
const [w] = await Promise.all([
|
|
2035
|
-
Yt(
|
|
2044
|
+
Yt(y),
|
|
2036
2045
|
// fake buffer
|
|
2037
2046
|
new Promise((P) => setTimeout(P, 1e3))
|
|
2038
|
-
]), z =
|
|
2047
|
+
]), z = Po(w);
|
|
2039
2048
|
if (z.invalidExcel) {
|
|
2040
2049
|
m.value.push(
|
|
2041
2050
|
z.invalidExcelMessage ?? h("inventory.ingredient.import.fileError.invalidExcel")
|
|
@@ -2060,19 +2069,19 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2060
2069
|
}), g.value = !1;
|
|
2061
2070
|
}
|
|
2062
2071
|
}
|
|
2063
|
-
return
|
|
2064
|
-
|
|
2065
|
-
}), (
|
|
2072
|
+
return fe(r, (y) => {
|
|
2073
|
+
y && $(y);
|
|
2074
|
+
}), (y, w) => {
|
|
2066
2075
|
const z = I("FmSelect"), P = I("FmDatePicker"), R = I("FmTimePicker"), Y = I("FmCircularProgress"), O = I("FmLabel"), U = I("FmIcon"), L = I("FmButton"), X = I("FmForm");
|
|
2067
|
-
return
|
|
2076
|
+
return k(), Q(X, {
|
|
2068
2077
|
ref_key: "formRef",
|
|
2069
2078
|
ref: F
|
|
2070
2079
|
}, {
|
|
2071
2080
|
default: V(() => [
|
|
2072
|
-
l("div",
|
|
2081
|
+
l("div", Ko, [
|
|
2073
2082
|
d(z, {
|
|
2074
|
-
modelValue:
|
|
2075
|
-
"onUpdate:modelValue": w[0] || (w[0] = (
|
|
2083
|
+
modelValue: n.value,
|
|
2084
|
+
"onUpdate:modelValue": w[0] || (w[0] = (b) => n.value = b),
|
|
2076
2085
|
label: "Transfer from",
|
|
2077
2086
|
searchable: "",
|
|
2078
2087
|
searchTarget: "label",
|
|
@@ -2089,46 +2098,46 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2089
2098
|
}, null, 8, ["modelValue", "rules"]),
|
|
2090
2099
|
d(P, {
|
|
2091
2100
|
modelValue: s.value,
|
|
2092
|
-
"onUpdate:modelValue": w[1] || (w[1] = (
|
|
2101
|
+
"onUpdate:modelValue": w[1] || (w[1] = (b) => s.value = b),
|
|
2093
2102
|
label: "Transfer date",
|
|
2094
2103
|
rules: [t(Re)()]
|
|
2095
2104
|
}, null, 8, ["modelValue", "rules"]),
|
|
2096
2105
|
d(R, {
|
|
2097
2106
|
modelValue: a.value,
|
|
2098
|
-
"onUpdate:modelValue": w[2] || (w[2] = (
|
|
2107
|
+
"onUpdate:modelValue": w[2] || (w[2] = (b) => a.value = b),
|
|
2099
2108
|
label: "Transfer time",
|
|
2100
2109
|
rules: [t(Re)()]
|
|
2101
2110
|
}, null, 8, ["modelValue", "rules"]),
|
|
2102
|
-
e.value ? (
|
|
2111
|
+
e.value ? (k(), T("div", Qo, [
|
|
2103
2112
|
l("div", null, [
|
|
2104
2113
|
d(Y, {
|
|
2105
2114
|
size: "md",
|
|
2106
2115
|
color: "neutral-gray-200"
|
|
2107
2116
|
})
|
|
2108
2117
|
]),
|
|
2109
|
-
l("div",
|
|
2110
|
-
])) : (
|
|
2118
|
+
l("div", Xo, A(t(h)("inventory.formField.loading")), 1)
|
|
2119
|
+
])) : (k(), T(ae, { key: 1 }, [
|
|
2111
2120
|
d(jt, {
|
|
2112
2121
|
"max-file-size": 5,
|
|
2113
2122
|
class: K({
|
|
2114
2123
|
"w-full": !0,
|
|
2115
|
-
"h-[200px]": !
|
|
2124
|
+
"h-[200px]": !r.value
|
|
2116
2125
|
}),
|
|
2117
2126
|
accept: ".xlsx,.xls",
|
|
2118
2127
|
label: ft,
|
|
2119
|
-
onFileUpload: w[3] || (w[3] = (
|
|
2128
|
+
onFileUpload: w[3] || (w[3] = (b) => r.value = b),
|
|
2120
2129
|
"button-label": t(h)("inventory.ingredient.import.selectFile")
|
|
2121
2130
|
}, Dt({ _: 2 }, [
|
|
2122
|
-
|
|
2131
|
+
r.value ? {
|
|
2123
2132
|
name: "default",
|
|
2124
|
-
fn: V(({ openFileDialog:
|
|
2133
|
+
fn: V(({ openFileDialog: b }) => [
|
|
2125
2134
|
d(O, null, {
|
|
2126
2135
|
default: V(() => [
|
|
2127
2136
|
Fe(A(ft))
|
|
2128
2137
|
]),
|
|
2129
2138
|
_: 1
|
|
2130
2139
|
}),
|
|
2131
|
-
l("div",
|
|
2140
|
+
l("div", Zo, [
|
|
2132
2141
|
l("div", {
|
|
2133
2142
|
class: K([
|
|
2134
2143
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
@@ -2139,11 +2148,11 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2139
2148
|
}
|
|
2140
2149
|
])
|
|
2141
2150
|
}, [
|
|
2142
|
-
g.value ? (
|
|
2151
|
+
g.value ? (k(), Q(Y, {
|
|
2143
2152
|
key: 0,
|
|
2144
2153
|
size: "md",
|
|
2145
2154
|
color: "neutral-gray-200"
|
|
2146
|
-
})) : (
|
|
2155
|
+
})) : (k(), Q(U, {
|
|
2147
2156
|
key: 1,
|
|
2148
2157
|
name: p.value ? "error" : "attach_file",
|
|
2149
2158
|
outline: "",
|
|
@@ -2158,19 +2167,19 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2158
2167
|
}
|
|
2159
2168
|
])
|
|
2160
2169
|
}, [
|
|
2161
|
-
l("div",
|
|
2170
|
+
l("div", Wo, A(r.value.name), 1)
|
|
2162
2171
|
], 2),
|
|
2163
|
-
g.value ? B("", !0) : (
|
|
2172
|
+
g.value ? B("", !0) : (k(), T("div", Go, [
|
|
2164
2173
|
d(L, {
|
|
2165
2174
|
label: t(h)("inventory.ingredient.import.replaceFile"),
|
|
2166
2175
|
variant: p.value ? "destructive" : "secondary",
|
|
2167
2176
|
"prepend-icon": p.value ? void 0 : "autorenew",
|
|
2168
|
-
onClick:
|
|
2177
|
+
onClick: b
|
|
2169
2178
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
2170
2179
|
]))
|
|
2171
2180
|
], 2),
|
|
2172
|
-
m.value.length ? (
|
|
2173
|
-
(
|
|
2181
|
+
m.value.length ? (k(), T("div", Jo, [
|
|
2182
|
+
(k(!0), T(ae, null, Ce(m.value, (C, H) => (k(), T("div", {
|
|
2174
2183
|
key: H,
|
|
2175
2184
|
class: "flex gap-8 items-center"
|
|
2176
2185
|
}, [
|
|
@@ -2179,7 +2188,7 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2179
2188
|
size: "sm",
|
|
2180
2189
|
color: "system-error-300"
|
|
2181
2190
|
}),
|
|
2182
|
-
l("div",
|
|
2191
|
+
l("div", ea, A(C), 1)
|
|
2183
2192
|
]))), 128))
|
|
2184
2193
|
])) : B("", !0)
|
|
2185
2194
|
])
|
|
@@ -2187,13 +2196,13 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2187
2196
|
key: "0"
|
|
2188
2197
|
} : void 0
|
|
2189
2198
|
]), 1032, ["class", "button-label"]),
|
|
2190
|
-
|
|
2191
|
-
l("div",
|
|
2192
|
-
(
|
|
2199
|
+
r.value ? (k(), T("div", ta, [
|
|
2200
|
+
l("div", sa, A(t(h)("inventory.ingredient.import.summary")), 1),
|
|
2201
|
+
(k(!0), T(ae, null, Ce(c.value, (b, C) => (k(), Q(Yo, {
|
|
2193
2202
|
key: C,
|
|
2194
2203
|
name: `Transfer Note ${C + 1}`,
|
|
2195
|
-
items:
|
|
2196
|
-
errors:
|
|
2204
|
+
items: b.poItems,
|
|
2205
|
+
errors: b.errors,
|
|
2197
2206
|
type: "create"
|
|
2198
2207
|
}, null, 8, ["name", "items", "errors"]))), 128))
|
|
2199
2208
|
])) : B("", !0)
|
|
@@ -2204,34 +2213,34 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2204
2213
|
}, 512);
|
|
2205
2214
|
};
|
|
2206
2215
|
}
|
|
2207
|
-
}),
|
|
2216
|
+
}), aa = { class: "w-[480px]" }, la = /* @__PURE__ */ le({
|
|
2208
2217
|
__name: "XilnexImportDialog",
|
|
2209
2218
|
props: {
|
|
2210
2219
|
show: { type: Boolean }
|
|
2211
2220
|
},
|
|
2212
2221
|
emits: ["update:show", "submitted"],
|
|
2213
|
-
setup(
|
|
2214
|
-
const i =
|
|
2222
|
+
setup(v, { expose: _, emit: r }) {
|
|
2223
|
+
const i = r, e = St(v, "show"), u = $e(), x = Je(), S = E(!1), n = E(), s = E();
|
|
2215
2224
|
_({
|
|
2216
2225
|
validateInputs: () => {
|
|
2217
2226
|
var c, p;
|
|
2218
|
-
(p = (c =
|
|
2227
|
+
(p = (c = n.value) == null ? void 0 : c.validateInputs) == null || p.call(c);
|
|
2219
2228
|
},
|
|
2220
2229
|
resetInputsValidation: () => {
|
|
2221
2230
|
var c, p;
|
|
2222
|
-
(p = (c =
|
|
2231
|
+
(p = (c = n.value) == null ? void 0 : c.resetInputsValidation) == null || p.call(c);
|
|
2223
2232
|
},
|
|
2224
2233
|
resetInputs: () => {
|
|
2225
2234
|
var c, p;
|
|
2226
|
-
(p = (c =
|
|
2235
|
+
(p = (c = n.value) == null ? void 0 : c.resetInputs) == null || p.call(c);
|
|
2227
2236
|
}
|
|
2228
2237
|
});
|
|
2229
2238
|
function a() {
|
|
2230
2239
|
var c, p;
|
|
2231
|
-
(p = (c =
|
|
2240
|
+
(p = (c = n.value) == null ? void 0 : c.validateInputs) == null || p.call(c);
|
|
2232
2241
|
}
|
|
2233
2242
|
async function m() {
|
|
2234
|
-
var p, F, h, $,
|
|
2243
|
+
var p, F, h, $, y;
|
|
2235
2244
|
if (!((F = (p = s.value) == null ? void 0 : p.supplier) != null && F.name)) {
|
|
2236
2245
|
u.open({
|
|
2237
2246
|
title: "Upload failed",
|
|
@@ -2240,7 +2249,7 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2240
2249
|
});
|
|
2241
2250
|
return;
|
|
2242
2251
|
}
|
|
2243
|
-
if (!((h = s.value) != null && h.items) || ((
|
|
2252
|
+
if (!((h = s.value) != null && h.items) || ((y = ($ = s.value) == null ? void 0 : $.items) == null ? void 0 : y.length) === 0) {
|
|
2244
2253
|
u.open({
|
|
2245
2254
|
title: "Upload failed",
|
|
2246
2255
|
message: "No data to upload",
|
|
@@ -2267,7 +2276,7 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2267
2276
|
}
|
|
2268
2277
|
S.value = !0;
|
|
2269
2278
|
try {
|
|
2270
|
-
await
|
|
2279
|
+
await x.importFromXilnex(s.value), i("update:show", !1);
|
|
2271
2280
|
} catch (w) {
|
|
2272
2281
|
await new Promise((z) => setTimeout(z, 1e3)), u.open({
|
|
2273
2282
|
title: "Upload failed",
|
|
@@ -2280,9 +2289,9 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2280
2289
|
}
|
|
2281
2290
|
return (c, p) => {
|
|
2282
2291
|
const F = I("FmSpacer"), h = I("FmButton"), $ = I("FmDialog");
|
|
2283
|
-
return
|
|
2292
|
+
return k(), Q($, {
|
|
2284
2293
|
modelValue: t(e),
|
|
2285
|
-
"onUpdate:modelValue": p[2] || (p[2] = (
|
|
2294
|
+
"onUpdate:modelValue": p[2] || (p[2] = (y) => ke(e) ? e.value = y : null),
|
|
2286
2295
|
overlay: !0,
|
|
2287
2296
|
"close-button": !1
|
|
2288
2297
|
}, {
|
|
@@ -2297,7 +2306,7 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2297
2306
|
label: "Cancel",
|
|
2298
2307
|
size: "md",
|
|
2299
2308
|
variant: "tertiary",
|
|
2300
|
-
onClick: p[1] || (p[1] = (
|
|
2309
|
+
onClick: p[1] || (p[1] = (y) => i("update:show", !1))
|
|
2301
2310
|
}, null, 8, ["disabled"]),
|
|
2302
2311
|
d(h, {
|
|
2303
2312
|
disabled: S.value,
|
|
@@ -2310,13 +2319,13 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2310
2319
|
}, null, 8, ["disabled", "loading"])
|
|
2311
2320
|
]),
|
|
2312
2321
|
default: V(() => [
|
|
2313
|
-
l("div",
|
|
2314
|
-
d(
|
|
2322
|
+
l("div", aa, [
|
|
2323
|
+
d(oa, {
|
|
2315
2324
|
ref_key: "formRef",
|
|
2316
|
-
ref:
|
|
2325
|
+
ref: n,
|
|
2317
2326
|
onValidationSuccess: m,
|
|
2318
2327
|
modelValue: s.value,
|
|
2319
|
-
"onUpdate:modelValue": p[0] || (p[0] = (
|
|
2328
|
+
"onUpdate:modelValue": p[0] || (p[0] = (y) => s.value = y)
|
|
2320
2329
|
}, null, 8, ["modelValue"])
|
|
2321
2330
|
])
|
|
2322
2331
|
]),
|
|
@@ -2324,20 +2333,20 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2324
2333
|
}, 8, ["modelValue"]);
|
|
2325
2334
|
};
|
|
2326
2335
|
}
|
|
2327
|
-
}),
|
|
2336
|
+
}), na = { class: "flex flex-col py-8" }, ra = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ia = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ua = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, da = {
|
|
2328
2337
|
key: 0,
|
|
2329
2338
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
|
|
2330
|
-
},
|
|
2339
|
+
}, ca = { class: "pt-8" }, vt = "ReceiveRequestViewSearchCriteria", $a = /* @__PURE__ */ le({
|
|
2331
2340
|
__name: "ReceiveRequestView",
|
|
2332
|
-
setup(
|
|
2333
|
-
const { t: _ } = ce(),
|
|
2341
|
+
setup(v) {
|
|
2342
|
+
const { t: _ } = ce(), r = $e();
|
|
2334
2343
|
Oe.object({
|
|
2335
2344
|
name: Oe.string().optional().nullable(),
|
|
2336
2345
|
startDate: Oe.string().optional().nullable(),
|
|
2337
2346
|
endDate: Oe.string().optional().nullable()
|
|
2338
2347
|
});
|
|
2339
2348
|
const i = q(
|
|
2340
|
-
() => !a._currentLocation ||
|
|
2349
|
+
() => !a._currentLocation || n.loading.value
|
|
2341
2350
|
), g = os(), e = Xe();
|
|
2342
2351
|
function u() {
|
|
2343
2352
|
const P = {
|
|
@@ -2352,22 +2361,22 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2352
2361
|
return P;
|
|
2353
2362
|
}
|
|
2354
2363
|
}
|
|
2355
|
-
function
|
|
2364
|
+
function x() {
|
|
2356
2365
|
g.setItem(vt, JSON.stringify(S.value));
|
|
2357
2366
|
}
|
|
2358
|
-
const S = E(u()),
|
|
2367
|
+
const S = E(u()), n = Zt(
|
|
2359
2368
|
Ye.RECEIVE_REQUEST,
|
|
2360
2369
|
S.value
|
|
2361
2370
|
), { columnDefs: s } = Wt(
|
|
2362
2371
|
Ye.RECEIVE_REQUEST,
|
|
2363
|
-
|
|
2372
|
+
n
|
|
2364
2373
|
), a = Ge();
|
|
2365
2374
|
async function m() {
|
|
2366
|
-
const P = `inventory-record_${mt(S.value.startDate).format("DD-MM-YYYY_HH-mm")}-${mt(S.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, R =
|
|
2375
|
+
const P = `inventory-record_${mt(S.value.startDate).format("DD-MM-YYYY_HH-mm")}-${mt(S.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, R = n.purchaseOrders.value.flatMap(
|
|
2367
2376
|
(O) => O.items.map((U) => {
|
|
2368
|
-
const L = new Date(ts(O._id) ?? ""), X = O.effectiveAt ? new Date(O.effectiveAt) : void 0,
|
|
2377
|
+
const L = new Date(ts(O._id) ?? ""), X = O.effectiveAt ? new Date(O.effectiveAt) : void 0, b = xe(
|
|
2369
2378
|
Jt(U.sku, O.deliveryOrder || [])
|
|
2370
|
-
), C =
|
|
2379
|
+
), C = xe(U.quantity);
|
|
2371
2380
|
return {
|
|
2372
2381
|
"SKU code": U.code,
|
|
2373
2382
|
"SKU name": U.name,
|
|
@@ -2376,7 +2385,7 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2376
2385
|
Date: L,
|
|
2377
2386
|
Status: O.status,
|
|
2378
2387
|
Reference: O.ref ?? "",
|
|
2379
|
-
"Received quantity":
|
|
2388
|
+
"Received quantity": b,
|
|
2380
2389
|
"Ordered quantity": C,
|
|
2381
2390
|
Unit: U.sku.unit.abbrev,
|
|
2382
2391
|
"Total cost": U.totalCost ? Ze(U.totalCost) : null
|
|
@@ -2402,41 +2411,41 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2402
2411
|
}
|
|
2403
2412
|
],
|
|
2404
2413
|
P
|
|
2405
|
-
),
|
|
2414
|
+
), r.open({
|
|
2406
2415
|
title: _("inventory.transfer.receiveRequest.export.success"),
|
|
2407
2416
|
message: _("inventory.transfer.receiveRequest.export.message", [P]),
|
|
2408
2417
|
type: "success"
|
|
2409
2418
|
});
|
|
2410
2419
|
}
|
|
2411
2420
|
const c = E(ct()), p = E("");
|
|
2412
|
-
|
|
2413
|
-
!P.startDate || !P.endDate || (S.value.startDate = P.startDate, S.value.endDate = P.endDate,
|
|
2421
|
+
fe([() => c.value], ([P]) => {
|
|
2422
|
+
!P.startDate || !P.endDate || (S.value.startDate = P.startDate, S.value.endDate = P.endDate, n.updateDateRange(
|
|
2414
2423
|
S.value.startDate,
|
|
2415
2424
|
S.value.endDate
|
|
2416
|
-
),
|
|
2417
|
-
}),
|
|
2418
|
-
|
|
2425
|
+
), x());
|
|
2426
|
+
}), fe([() => p.value], () => {
|
|
2427
|
+
x();
|
|
2419
2428
|
});
|
|
2420
2429
|
function F(P) {
|
|
2421
2430
|
if (P === "create") {
|
|
2422
2431
|
if (i.value) {
|
|
2423
|
-
|
|
2432
|
+
r.open({
|
|
2424
2433
|
title: "Loading data...",
|
|
2425
2434
|
message: "Please wait.",
|
|
2426
2435
|
type: "info"
|
|
2427
2436
|
});
|
|
2428
2437
|
return;
|
|
2429
2438
|
}
|
|
2430
|
-
return
|
|
2439
|
+
return n.promptCreateTransferDialog();
|
|
2431
2440
|
}
|
|
2432
2441
|
if (P === "upload" && e.enableXilnexTransferNote)
|
|
2433
|
-
return
|
|
2442
|
+
return n.promptUploadTransferDialog();
|
|
2434
2443
|
if (P === "refresh")
|
|
2435
|
-
return
|
|
2444
|
+
return n.fetchData();
|
|
2436
2445
|
if (P === "export")
|
|
2437
2446
|
return m();
|
|
2438
2447
|
}
|
|
2439
|
-
const { breakpoints: h } = et(), $ = q(() => h.value.xs || h.value.sm),
|
|
2448
|
+
const { breakpoints: h } = et(), $ = q(() => h.value.xs || h.value.sm), y = q(() => $.value ? 10 : 20), w = Kt(), z = q(() => [
|
|
2440
2449
|
{
|
|
2441
2450
|
label: _("inventory.transfer.receiveRequest.actions.create"),
|
|
2442
2451
|
value: "create",
|
|
@@ -2460,7 +2469,7 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2460
2469
|
]);
|
|
2461
2470
|
return (P, R) => {
|
|
2462
2471
|
const Y = I("FmTable");
|
|
2463
|
-
return
|
|
2472
|
+
return k(), Q(Qt, {
|
|
2464
2473
|
title: t(_)("inventory.transfer.receiveRequest.title2"),
|
|
2465
2474
|
actions: z.value,
|
|
2466
2475
|
"onClick:action": F
|
|
@@ -2486,48 +2495,48 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2486
2495
|
search: p.value,
|
|
2487
2496
|
"onUpdate:search": R[1] || (R[1] = (U) => p.value = U)
|
|
2488
2497
|
}, null, 8, ["date-range", "search"]),
|
|
2489
|
-
(
|
|
2498
|
+
(k(), Q(Y, {
|
|
2490
2499
|
style: bt(t(w).tableHeight),
|
|
2491
2500
|
"column-defs": t(s),
|
|
2492
|
-
"row-data": t(
|
|
2501
|
+
"row-data": t(n).purchaseOrders.value,
|
|
2493
2502
|
"search-value": p.value,
|
|
2494
2503
|
loading: i.value,
|
|
2495
|
-
onRowClick: R[2] || (R[2] = (U) => t(
|
|
2504
|
+
onRowClick: R[2] || (R[2] = (U) => t(n).promptShowTransferDetails(U.original)),
|
|
2496
2505
|
key: (O = t(a)._currentLocation) == null ? void 0 : O.dbName,
|
|
2497
|
-
"page-size":
|
|
2506
|
+
"page-size": y.value
|
|
2498
2507
|
}, {
|
|
2499
2508
|
"list-row": V((U) => [
|
|
2500
|
-
d(
|
|
2509
|
+
d(kt, {
|
|
2501
2510
|
row: U,
|
|
2502
|
-
onRowClick: t(
|
|
2511
|
+
onRowClick: t(n).promptShowTransferDetails
|
|
2503
2512
|
}, {
|
|
2504
2513
|
default: V((L) => {
|
|
2505
|
-
var X,
|
|
2514
|
+
var X, b, C, H, ie, se, be, Se, we, Ae, Ee, He, qe, ge, o, f, M, ne, re, _e;
|
|
2506
2515
|
return [
|
|
2507
|
-
l("div",
|
|
2508
|
-
l("div",
|
|
2516
|
+
l("div", na, [
|
|
2517
|
+
l("div", ra, [
|
|
2509
2518
|
d(t(de), {
|
|
2510
|
-
render: (C = (
|
|
2519
|
+
render: (C = (b = (X = L._id) == null ? void 0 : X.column) == null ? void 0 : b.columnDef) == null ? void 0 : C.cell,
|
|
2511
2520
|
props: (ie = (H = L._id) == null ? void 0 : H.getContext) == null ? void 0 : ie.call(H)
|
|
2512
2521
|
}, null, 8, ["render", "props"])
|
|
2513
2522
|
]),
|
|
2514
|
-
l("div",
|
|
2523
|
+
l("div", ia, [
|
|
2515
2524
|
d(t(de), {
|
|
2516
|
-
render: (Se = (
|
|
2525
|
+
render: (Se = (be = (se = L.supplier_name) == null ? void 0 : se.column) == null ? void 0 : be.columnDef) == null ? void 0 : Se.cell,
|
|
2517
2526
|
props: (Ae = (we = L.supplier_name) == null ? void 0 : we.getContext) == null ? void 0 : Ae.call(we)
|
|
2518
2527
|
}, null, 8, ["render", "props"])
|
|
2519
2528
|
]),
|
|
2520
|
-
l("div",
|
|
2521
|
-
U.original.ref ? (
|
|
2529
|
+
l("div", ua, A(U.original.items.map((ve) => `${ve.name}`).join(", ")), 1),
|
|
2530
|
+
U.original.ref ? (k(), T("div", da, [
|
|
2522
2531
|
d(t(de), {
|
|
2523
2532
|
render: (qe = (He = (Ee = L.ref) == null ? void 0 : Ee.column) == null ? void 0 : He.columnDef) == null ? void 0 : qe.cell,
|
|
2524
|
-
props: (o = (
|
|
2533
|
+
props: (o = (ge = L.ref) == null ? void 0 : ge.getContext) == null ? void 0 : o.call(ge)
|
|
2525
2534
|
}, null, 8, ["render", "props"])
|
|
2526
2535
|
])) : B("", !0),
|
|
2527
|
-
l("div",
|
|
2536
|
+
l("div", ca, [
|
|
2528
2537
|
d(t(de), {
|
|
2529
2538
|
render: (ne = (M = (f = L.status) == null ? void 0 : f.column) == null ? void 0 : M.columnDef) == null ? void 0 : ne.cell,
|
|
2530
|
-
props: (
|
|
2539
|
+
props: (_e = (re = L.status) == null ? void 0 : re.getContext) == null ? void 0 : _e.call(re)
|
|
2531
2540
|
}, null, 8, ["render", "props"])
|
|
2532
2541
|
])
|
|
2533
2542
|
])
|
|
@@ -2539,16 +2548,16 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2539
2548
|
_: 1
|
|
2540
2549
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
2541
2550
|
], 2),
|
|
2542
|
-
(
|
|
2543
|
-
d(
|
|
2544
|
-
onSubmitted: t(
|
|
2551
|
+
(k(), Q(It, { to: "body" }, [
|
|
2552
|
+
d(To, Ke(t(n).transferDialogProps.value, {
|
|
2553
|
+
onSubmitted: t(n).fetchData
|
|
2545
2554
|
}), null, 16, ["onSubmitted"]),
|
|
2546
2555
|
d(Gt, Ke({
|
|
2547
2556
|
scope: t(Ye).RECEIVE_REQUEST
|
|
2548
|
-
}, t(
|
|
2549
|
-
onSubmitted: t(
|
|
2557
|
+
}, t(n).transferDetailsProps.value, {
|
|
2558
|
+
onSubmitted: t(n).fetchData
|
|
2550
2559
|
}), null, 16, ["scope", "onSubmitted"]),
|
|
2551
|
-
d(
|
|
2560
|
+
d(la, Tt(Vt(t(n).xilnexImportDialogProps.value)), null, 16)
|
|
2552
2561
|
]))
|
|
2553
2562
|
];
|
|
2554
2563
|
}),
|
|
@@ -2558,5 +2567,5 @@ const Ao = exports.FfCalculator, Eo = { class: "flex flex-col flex-1" }, qo = {
|
|
|
2558
2567
|
}
|
|
2559
2568
|
});
|
|
2560
2569
|
export {
|
|
2561
|
-
|
|
2570
|
+
$a as default
|
|
2562
2571
|
};
|