@feedmepos/mf-inventory-portal 1.2.0-dev.3 → 1.2.0-dev.4
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-CvnYXQ_H.js → App-B23hTt8P.js} +1 -1
- package/dist/{ApprovalView-Brt_cfLI.js → ApprovalView-BDlbBg8N.js} +2 -2
- package/dist/{BindingsDialog-BBCRbm60.js → BindingsDialog-De55nslG.js} +2 -2
- package/dist/{BindingsPicker-D3cfis0-.js → BindingsPicker-Dzq-QKnj.js} +1 -1
- package/dist/{BindingsTable-BuHEtiqI.js → BindingsTable-BkZVEDqh.js} +1 -1
- package/dist/{ClosingDraftView-fLxuV9T9.js → ClosingDraftView-Uu-1KA0k.js} +2 -2
- package/dist/{ClosingTemplateView-BJRZQ_9d.js → ClosingTemplateView-fmm3ZqYc.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-CKLGVFoJ.js → DeliveryOrderPrintPreview-DxhaGpb0.js} +1 -1
- package/dist/FmAdminBadge-P98dVu_i.js +34 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-6h2ZF1IM.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CoKsh-hs.js} +3 -3
- package/dist/{FmMultiselectDialog-uEoXq-hv.js → FmMultiselectDialog-Cn8-Sd9S.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CSNDv3kk.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D56QhrTV.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CeZBz1eT.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DOaUhZjQ.js} +1 -1
- package/dist/{IngredientGroupView-BhsEp63p.js → IngredientGroupView-j5LbaClZ.js} +2 -2
- package/dist/{IngredientsView-D3aehOrb.js → IngredientsView-y-JGogdT.js} +4 -4
- package/dist/{IntegrationView-Ds4_pk0y.js → IntegrationView-BooM88Uh.js} +3 -3
- package/dist/{InventoryBindingForm-CVaSaP-L.js → InventoryBindingForm-DOM5HcgN.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DsJObBbP.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B7QPYtZP.js} +3 -3
- package/dist/{InventoryBindingSummary-4dCMV0Je.js → InventoryBindingSummary-CnJHhG_U.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BWTfN1Nc.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DOfNI7E2.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-lKPfAldc.js → PremiumBadge.vue_vue_type_script_setup_true_lang-D1Iqw5DF.js} +1 -1
- package/dist/{PublishView-BW1IjgqP.js → PublishView-Xq1JT1BI.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-DupzzHHn.js → PurchaseOrderPrintPreview-BkS4Q1YJ.js} +1 -1
- package/dist/{ReceiveRequestView-CZMDH6oI.js → ReceiveRequestView-CKE_si_R.js} +8 -8
- package/dist/{RecipeView-BJ1JyMWl.js → RecipeView-muNNMb4o.js} +3 -3
- package/dist/{StockView-C0h2udKi.js → StockView-BMDBAEPn.js} +327 -321
- package/dist/{SupplierView-nRrJO3aS.js → SupplierView-BS4lKS85.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CWXS6_zv.js → TransferDetails.vue_vue_type_script_setup_true_lang-B8tk0rVh.js} +778 -752
- package/dist/{TransferTemplateView-BmGAvcDy.js → TransferTemplateView-C7mzg1Yt.js} +6 -6
- package/dist/{UnitView-CFayjoeC.js → UnitView-BOfWrYoc.js} +3 -3
- package/dist/{WarehouseView-Dw74JEJ4.js → WarehouseView-CbHfwxXJ.js} +1 -1
- package/dist/{app-Cjc33Hak.js → app-D0rTMX1S.js} +191 -191
- package/dist/app.js +1 -1
- package/dist/components/FmAdminBadge.vue.d.ts +39 -0
- package/dist/{decimal-DkctM_2I.js → decimal-BL0xwFU9.js} +1 -1
- package/dist/{format-unit-display-BWs5lTJP.js → format-unit-display-D4XPYOff.js} +2 -2
- package/dist/{index-IbY1gBGq.js → index-BWDn1UVH.js} +1 -1
- package/dist/{index-C64jubVC.js → index-BWjTZvhM.js} +1 -1
- package/dist/{stock-BhsZeZQ6.js → stock-sYtaHuhh.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-D-CggzHd.js → supplier-B8VC44Gc.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-C03zsmuo.js → use-ingredient-select-dialog-DnYfVhkU.js} +1 -1
- package/dist/{use-inventory-binding-dialog-D3Chc97P.js → use-inventory-binding-dialog-D3blZbxh.js} +1 -1
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +6 -2
- package/package.json +3 -3
|
@@ -1,73 +1,74 @@
|
|
|
1
|
-
import { a3 as
|
|
2
|
-
import { ref as G, computed as ee, h as
|
|
3
|
-
import { F as
|
|
4
|
-
import { useCoreStore as
|
|
5
|
-
import { useDialog as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { u as Et } from "./
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { a3 as vt, u as me, aS as x, aT as Pe, aA as M, c as Ie, b as Fe, ab as yt, ad as ht, ae as bt, aU as gt, e as tt, f as at, a0 as We, aV as _t, a8 as ot, T as it, j as fe, a6 as St, aW as lt, ai as qe, h as rt, i as te, D as oe, aX as ct, aY as ut, aZ as Ve, ay as st, aa as Ae, a4 as Ue, a5 as wt, a_ as Ce, Q as Rt } from "./app-D0rTMX1S.js";
|
|
2
|
+
import { ref as G, computed as ee, h as C, defineComponent as he, reactive as Ot, onMounted as dt, resolveComponent as W, openBlock as g, createBlock as ie, withCtx as re, createElementVNode as o, createVNode as I, unref as w, createElementBlock as N, toDisplayString as k, createCommentVNode as U, Fragment as ae, renderList as ve, watch as Nt, isRef as xt, createTextVNode as $e, normalizeClass as De, resolveDynamicComponent as kt } from "vue";
|
|
3
|
+
import { F as At } from "./decimal-BL0xwFU9.js";
|
|
4
|
+
import { useCoreStore as Ee, useI18n as ft } from "@feedmepos/mf-common";
|
|
5
|
+
import { useDialog as Ye, useSnackbar as Le, components as je, FmButtonVariant as ne, useProxiedModel as Ct } from "@feedmepos/ui-library";
|
|
6
|
+
import { F as Ne } from "./FmAdminBadge-P98dVu_i.js";
|
|
7
|
+
import { b as $t, u as Dt, P as ye, f as qt } from "./format-unit-display-D4XPYOff.js";
|
|
8
|
+
import { E as Tt } from "./empty-placeholder-wf6-BWE8.js";
|
|
9
|
+
import { _ as Pt, F as It, a as Ft } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-D56QhrTV.js";
|
|
10
|
+
import { u as Et, R as nt } from "./usePromise-CbVUCxhj.js";
|
|
11
|
+
import { u as Lt } from "./index-BWjTZvhM.js";
|
|
12
|
+
const Be = vt((y, t) => {
|
|
13
|
+
const a = me(), _ = Ee();
|
|
13
14
|
return {
|
|
14
|
-
async readRequests(
|
|
15
|
-
const i =
|
|
16
|
-
return e &&
|
|
15
|
+
async readRequests(l, e, c) {
|
|
16
|
+
const i = l ?? a.currentLocationDBName, s = `${y.inventoryBackendUrl}/${i}/purchase-request`;
|
|
17
|
+
return e && c ? await t.get(`${s}?startDate=${e}&endDate=${c}`) : await t.get(s);
|
|
17
18
|
},
|
|
18
|
-
async readRequestById(
|
|
19
|
-
const
|
|
19
|
+
async readRequestById(l, e) {
|
|
20
|
+
const c = e ?? a.currentLocationDBName, i = `${y.inventoryBackendUrl}/${c}/purchase-request/${l}`;
|
|
20
21
|
return await t.get(i);
|
|
21
22
|
},
|
|
22
|
-
async readRequestByIds(
|
|
23
|
-
const
|
|
24
|
-
return await t.post(i, { requestIds:
|
|
23
|
+
async readRequestByIds(l, e) {
|
|
24
|
+
const c = e ?? a.currentLocationDBName, i = `${y.inventoryBackendUrl}/${c}/purchase-request/find`;
|
|
25
|
+
return await t.post(i, { requestIds: l });
|
|
25
26
|
},
|
|
26
27
|
async getPurchaseOrders({
|
|
27
|
-
start:
|
|
28
|
+
start: l,
|
|
28
29
|
end: e
|
|
29
30
|
}) {
|
|
30
|
-
const
|
|
31
|
-
return await t.get(`${i}?start=${
|
|
31
|
+
const c = a.currentLocationDBName, i = `${y.inventoryBackendUrl}/${c}/purchase-order`;
|
|
32
|
+
return await t.get(`${i}?start=${l}&end=${e}`);
|
|
32
33
|
},
|
|
33
|
-
async getLatestPurchaseOrderRequest(
|
|
34
|
-
const e = a.currentLocationDBName,
|
|
35
|
-
return await t.get(`${
|
|
34
|
+
async getLatestPurchaseOrderRequest(l) {
|
|
35
|
+
const e = a.currentLocationDBName, c = `${y.inventoryBackendUrl}/${e}/purchase-request/find-by-purchase-order-id`;
|
|
36
|
+
return await t.get(`${c}/${l}`);
|
|
36
37
|
},
|
|
37
|
-
async getPurchaseOrderById(
|
|
38
|
-
const e = a.currentLocationDBName,
|
|
39
|
-
return await t.get(`${
|
|
38
|
+
async getPurchaseOrderById(l) {
|
|
39
|
+
const e = a.currentLocationDBName, c = `${y.inventoryBackendUrl}/${e}/purchase-order`;
|
|
40
|
+
return await t.get(`${c}/${l}`);
|
|
40
41
|
},
|
|
41
42
|
/**
|
|
42
43
|
* @deprecated Use `processPurchaseOrderV2` instead.
|
|
43
44
|
*/
|
|
44
|
-
async processPurchaseOrder(
|
|
45
|
-
const
|
|
46
|
-
return await t.put(
|
|
45
|
+
async processPurchaseOrder(l, e) {
|
|
46
|
+
const c = a.currentLocationDBName, i = e || c, s = `${y.inventoryBackendUrl}/${i}/purchase-order/run-operation`;
|
|
47
|
+
return await t.put(s, l);
|
|
47
48
|
},
|
|
48
|
-
async createPurchaseOrder(
|
|
49
|
-
const e = a.currentLocationDBName,
|
|
50
|
-
return await t.post(
|
|
49
|
+
async createPurchaseOrder(l) {
|
|
50
|
+
const e = a.currentLocationDBName, c = `${y.inventoryBackendUrl}/${e}/purchase-order`;
|
|
51
|
+
return await t.post(c, l);
|
|
51
52
|
},
|
|
52
|
-
async updatePurchaseOrder(
|
|
53
|
-
const e = a.currentLocationDBName,
|
|
54
|
-
return await t.put(
|
|
53
|
+
async updatePurchaseOrder(l) {
|
|
54
|
+
const e = a.currentLocationDBName, c = `${y.inventoryBackendUrl}/${e}/purchase-order`;
|
|
55
|
+
return await t.put(c, l);
|
|
55
56
|
},
|
|
56
|
-
async importFromXilnex(
|
|
57
|
-
const e = a.currentLocationDBName,
|
|
58
|
-
return await t.post(
|
|
57
|
+
async importFromXilnex(l) {
|
|
58
|
+
const e = a.currentLocationDBName, c = `${y.inventoryBackendUrl}/${e}/purchase-order/import-from-xilnex`;
|
|
59
|
+
return await t.post(c, l);
|
|
59
60
|
},
|
|
60
|
-
async processPurchaseOrderV2(
|
|
61
|
-
const
|
|
62
|
-
return await t.put(
|
|
61
|
+
async processPurchaseOrderV2(l, e) {
|
|
62
|
+
const c = a.currentLocationDBName, i = e || c, s = `${y.inventoryBackendUrl}/${i}/v2/purchase-order/run-operation`;
|
|
63
|
+
return await t.put(s, l);
|
|
63
64
|
},
|
|
64
65
|
async getWorkflowConfig() {
|
|
65
66
|
var i;
|
|
66
|
-
const e = `business_${(i = _.currentBusiness.value) == null ? void 0 : i._id}`,
|
|
67
|
-
return await t.get(
|
|
67
|
+
const e = `business_${(i = _.currentBusiness.value) == null ? void 0 : i._id}`, c = `${y.inventoryBackendUrl}/${e}/v2/purchase-order/workflow-config`;
|
|
68
|
+
return await t.get(c);
|
|
68
69
|
}
|
|
69
70
|
};
|
|
70
|
-
}),
|
|
71
|
+
}), mt = {
|
|
71
72
|
[x.enum.confirmDraft]: {
|
|
72
73
|
primaryActions: {
|
|
73
74
|
text: "Confirm draft",
|
|
@@ -135,73 +136,73 @@ const Ee = pt((p, t) => {
|
|
|
135
136
|
successMessage: "Purchase order has been processed"
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
|
-
function
|
|
139
|
-
return
|
|
140
|
-
purchaseOrder:
|
|
139
|
+
function Te(y) {
|
|
140
|
+
return Pe.generatedPOReceivedMap({
|
|
141
|
+
purchaseOrder: y
|
|
141
142
|
});
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
-
return
|
|
145
|
-
dto:
|
|
144
|
+
function Bt(y) {
|
|
145
|
+
return Pe.validatePOItemReceivedStatus({
|
|
146
|
+
dto: y
|
|
146
147
|
});
|
|
147
148
|
}
|
|
148
|
-
function
|
|
149
|
-
return
|
|
150
|
-
receivedMap:
|
|
149
|
+
function ze(y) {
|
|
150
|
+
return Pe.validatePOReceivedStatus({
|
|
151
|
+
receivedMap: y
|
|
151
152
|
});
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
-
if (!M.safeParse(
|
|
155
|
-
throw new Error(`Invalid purchase order status: ${
|
|
156
|
-
const _ = M.parse(
|
|
157
|
-
return
|
|
154
|
+
function Ge(y, t, a) {
|
|
155
|
+
if (!M.safeParse(y).success)
|
|
156
|
+
throw new Error(`Invalid purchase order status: ${y}`);
|
|
157
|
+
const _ = M.parse(y);
|
|
158
|
+
return Pe.orderStatusCombination({
|
|
158
159
|
status: _,
|
|
159
160
|
isPOPartialReceive: t,
|
|
160
161
|
isPOOverReceive: a
|
|
161
162
|
});
|
|
162
163
|
}
|
|
163
|
-
function
|
|
164
|
-
const
|
|
165
|
-
async function _(e,
|
|
166
|
-
const i =
|
|
167
|
-
return e.doc.supplier.internal && e.operation === x.enum.confirmDraft && (e.operation = x.enum.submitRequest), await t.processPurchaseOrder(e,
|
|
164
|
+
function pt() {
|
|
165
|
+
const y = me(), t = Be(), a = Ie();
|
|
166
|
+
async function _(e, c) {
|
|
167
|
+
const i = y.currentLocationDBName;
|
|
168
|
+
return e.doc.supplier.internal && e.operation === x.enum.confirmDraft && (e.operation = x.enum.submitRequest), await t.processPurchaseOrder(e, c || i);
|
|
168
169
|
}
|
|
169
|
-
async function
|
|
170
|
-
const i =
|
|
171
|
-
return await t.processPurchaseOrderV2(e,
|
|
170
|
+
async function l(e, c) {
|
|
171
|
+
const i = y.currentLocationDBName;
|
|
172
|
+
return await t.processPurchaseOrderV2(e, c || i);
|
|
172
173
|
}
|
|
173
|
-
return (e) => a.useOperatePurchaseOrderV2 ?
|
|
174
|
+
return (e) => a.useOperatePurchaseOrderV2 ? l(e.operateV2, e.transferTo) : _(e.operate, e.transferTo);
|
|
174
175
|
}
|
|
175
|
-
var
|
|
176
|
-
const Oe = G(),
|
|
177
|
-
function
|
|
178
|
-
const a =
|
|
179
|
-
|
|
180
|
-
const e =
|
|
181
|
-
t != null && t.startDate && (t != null && t.endDate) ? t :
|
|
182
|
-
),
|
|
183
|
-
const A = new Date(
|
|
176
|
+
var He = /* @__PURE__ */ ((y) => (y.RECEIVE_REQUEST = "receive/request", y.APPROVAL = "approval", y))(He || {});
|
|
177
|
+
const Oe = G(), Me = G();
|
|
178
|
+
function Ys(y, t) {
|
|
179
|
+
const a = Ye(), _ = me(), l = Ie();
|
|
180
|
+
Fe();
|
|
181
|
+
const e = $t(), c = Dt(), i = G(!1), s = Le(), v = Be(), b = G(new Array()), m = G(
|
|
182
|
+
t != null && t.startDate && (t != null && t.endDate) ? t : yt()
|
|
183
|
+
), p = ee(() => {
|
|
184
|
+
const A = new Date(m.value.startDate), T = new Date(m.value.endDate);
|
|
184
185
|
return {
|
|
185
|
-
start:
|
|
186
|
-
end:
|
|
186
|
+
start: ht(A).toISOString(),
|
|
187
|
+
end: bt(T).toISOString()
|
|
187
188
|
};
|
|
188
|
-
}), d = G(new Array()),
|
|
189
|
-
async function
|
|
189
|
+
}), d = G(new Array()), n = gt(), u = G(null);
|
|
190
|
+
async function S(A) {
|
|
190
191
|
function T(r) {
|
|
191
192
|
const f = {
|
|
192
|
-
mode:
|
|
193
|
+
mode: tt.CREATE,
|
|
193
194
|
modelValue: A || void 0,
|
|
194
195
|
show: !0,
|
|
195
196
|
"onUpdate:show"(O) {
|
|
196
197
|
Oe.value.show = O;
|
|
197
198
|
},
|
|
198
199
|
templateId: r,
|
|
199
|
-
lastClosingDate:
|
|
200
|
+
lastClosingDate: u.value
|
|
200
201
|
};
|
|
201
202
|
Oe.value = f;
|
|
202
203
|
}
|
|
203
204
|
let Y;
|
|
204
|
-
|
|
205
|
+
l.mustUsePoTemplate && !(A != null && A.template) ? a.open({
|
|
205
206
|
title: "Create transfer",
|
|
206
207
|
message: "",
|
|
207
208
|
primaryActions: {
|
|
@@ -219,31 +220,31 @@ function Hs(p, t) {
|
|
|
219
220
|
T(void 0);
|
|
220
221
|
}) : T(Y);
|
|
221
222
|
}
|
|
222
|
-
function
|
|
223
|
+
function R(A) {
|
|
223
224
|
const T = {
|
|
224
|
-
mode:
|
|
225
|
-
modelValue:
|
|
225
|
+
mode: tt.UPDATE,
|
|
226
|
+
modelValue: at(A),
|
|
226
227
|
show: !0,
|
|
227
228
|
"onUpdate:show"(Y) {
|
|
228
229
|
Oe.value.show = Y;
|
|
229
230
|
},
|
|
230
|
-
lastClosingDate:
|
|
231
|
+
lastClosingDate: u.value
|
|
231
232
|
};
|
|
232
233
|
Oe.value = T;
|
|
233
234
|
}
|
|
234
235
|
async function D() {
|
|
235
|
-
|
|
236
|
+
b.value = [], i.value = !0;
|
|
236
237
|
try {
|
|
237
|
-
|
|
238
|
-
const A = await
|
|
239
|
-
T && (
|
|
240
|
-
const Y =
|
|
238
|
+
b.value = await v.getPurchaseOrders(p.value).then((r) => r.sort((f, O) => O._id.localeCompare(f._id)));
|
|
239
|
+
const A = await n.readCurrentLocationLastClosing(!0), T = A == null ? void 0 : A._id;
|
|
240
|
+
T && (u.value = _t(T)), await l.awaitFeatureLoaded(() => l.mustUsePoTemplate) && await c.fetchTemplates();
|
|
241
|
+
const Y = b.value.map((r) => {
|
|
241
242
|
var f;
|
|
242
243
|
return ((f = r.request) == null ? void 0 : f.id) ?? "";
|
|
243
244
|
}).filter((r) => r);
|
|
244
|
-
d.value = await
|
|
245
|
+
d.value = await v.readRequestByIds(Y);
|
|
245
246
|
} catch {
|
|
246
|
-
|
|
247
|
+
s.open({
|
|
247
248
|
title: "Something went wrong",
|
|
248
249
|
message: "Error at fetching purchase orders",
|
|
249
250
|
type: "error"
|
|
@@ -255,13 +256,13 @@ function Hs(p, t) {
|
|
|
255
256
|
async function q() {
|
|
256
257
|
d.value = [], i.value = !0;
|
|
257
258
|
try {
|
|
258
|
-
d.value = await
|
|
259
|
+
d.value = await v.readRequests(
|
|
259
260
|
void 0,
|
|
260
|
-
|
|
261
|
-
|
|
261
|
+
p.value.start,
|
|
262
|
+
p.value.end
|
|
262
263
|
).then((A) => A.reverse());
|
|
263
264
|
} catch {
|
|
264
|
-
|
|
265
|
+
s.open({
|
|
265
266
|
title: "Something went wrong",
|
|
266
267
|
message: "Error at fetching purchase requests",
|
|
267
268
|
type: "error"
|
|
@@ -271,7 +272,7 @@ function Hs(p, t) {
|
|
|
271
272
|
}
|
|
272
273
|
}
|
|
273
274
|
function P() {
|
|
274
|
-
switch (
|
|
275
|
+
switch (y) {
|
|
275
276
|
case "receive/request":
|
|
276
277
|
return D();
|
|
277
278
|
case "approval":
|
|
@@ -279,14 +280,14 @@ function Hs(p, t) {
|
|
|
279
280
|
}
|
|
280
281
|
}
|
|
281
282
|
function E(A, T) {
|
|
282
|
-
|
|
283
|
+
m.value = {
|
|
283
284
|
startDate: A,
|
|
284
285
|
endDate: T
|
|
285
286
|
}, P();
|
|
286
287
|
}
|
|
287
288
|
_.watchLocation(async (A) => {
|
|
288
289
|
if (!A) {
|
|
289
|
-
|
|
290
|
+
b.value = [];
|
|
290
291
|
return;
|
|
291
292
|
}
|
|
292
293
|
await P();
|
|
@@ -297,24 +298,24 @@ function Hs(p, t) {
|
|
|
297
298
|
ce.value = Y, T ?? (T = d.value.computeFirst(
|
|
298
299
|
(O) => O.purchaseOrderId === A._id ? O : null
|
|
299
300
|
) ?? void 0);
|
|
300
|
-
const r =
|
|
301
|
+
const r = y === "receive/request" ? _.currentLocation : T == null ? void 0 : T.to, f = {
|
|
301
302
|
poRequest: T,
|
|
302
303
|
purchaseOrder: A,
|
|
303
304
|
transferTo: r == null ? void 0 : r.name,
|
|
304
305
|
transferToDbName: r == null ? void 0 : r.dbName,
|
|
305
306
|
show: !0,
|
|
306
307
|
canResubmit: !1,
|
|
307
|
-
canApprove:
|
|
308
|
+
canApprove: y === "approval",
|
|
308
309
|
"onUpdate:show"(O) {
|
|
309
310
|
z.value.show = O;
|
|
310
311
|
},
|
|
311
|
-
scope:
|
|
312
|
-
receivedMap:
|
|
312
|
+
scope: y,
|
|
313
|
+
receivedMap: Te(A) ?? {}
|
|
313
314
|
};
|
|
314
315
|
z.value = f;
|
|
315
316
|
}
|
|
316
317
|
async function be(A, T, Y, r) {
|
|
317
|
-
const f =
|
|
318
|
+
const f = pt();
|
|
318
319
|
i.value = !0;
|
|
319
320
|
try {
|
|
320
321
|
await f({
|
|
@@ -324,7 +325,7 @@ function Hs(p, t) {
|
|
|
324
325
|
options: (
|
|
325
326
|
// auto receive for supplier to warehouse
|
|
326
327
|
(T === x.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
327
|
-
T === x.enum.completeReceive) &&
|
|
328
|
+
T === x.enum.completeReceive) && l.autoReceiveWarehouse ? {
|
|
328
329
|
autoReceive: !0
|
|
329
330
|
} : void 0
|
|
330
331
|
)
|
|
@@ -337,18 +338,18 @@ function Hs(p, t) {
|
|
|
337
338
|
},
|
|
338
339
|
transferTo: r
|
|
339
340
|
}), await new Promise((B) => setTimeout(B, 1e3));
|
|
340
|
-
const
|
|
341
|
-
T === x.enum.confirmDraft && A.effectiveAt &&
|
|
341
|
+
const $ = me().currentLocationDBName.startsWith("restaurant_");
|
|
342
|
+
T === x.enum.confirmDraft && A.effectiveAt && $ ? s.open({
|
|
342
343
|
title: "Success",
|
|
343
344
|
message: `${Y}. The backdate will be reflected once your POS has received this change.`,
|
|
344
345
|
type: "success"
|
|
345
|
-
}) :
|
|
346
|
+
}) : s.open({
|
|
346
347
|
title: "Success",
|
|
347
348
|
message: Y,
|
|
348
349
|
type: "success"
|
|
349
350
|
});
|
|
350
351
|
} catch (O) {
|
|
351
|
-
|
|
352
|
+
s.open({
|
|
352
353
|
title: "Something went wrong",
|
|
353
354
|
message: "Please try again.",
|
|
354
355
|
type: "error"
|
|
@@ -357,12 +358,12 @@ function Hs(p, t) {
|
|
|
357
358
|
i.value = !1, P();
|
|
358
359
|
}
|
|
359
360
|
}
|
|
360
|
-
async function
|
|
361
|
-
const r =
|
|
361
|
+
async function xe(A, T, Y) {
|
|
362
|
+
const r = mt[T];
|
|
362
363
|
if (!r) {
|
|
363
|
-
|
|
364
|
+
s.open({
|
|
364
365
|
title: "Something went wrong",
|
|
365
|
-
message: `Cannot process order: ${
|
|
366
|
+
message: `Cannot process order: ${We(T)}`,
|
|
366
367
|
type: "error"
|
|
367
368
|
});
|
|
368
369
|
return;
|
|
@@ -391,48 +392,48 @@ function Hs(p, t) {
|
|
|
391
392
|
const A = {
|
|
392
393
|
show: !0,
|
|
393
394
|
"onUpdate:show"(T) {
|
|
394
|
-
|
|
395
|
+
Me.value.show = T;
|
|
395
396
|
}
|
|
396
397
|
};
|
|
397
|
-
|
|
398
|
+
Me.value = A;
|
|
398
399
|
});
|
|
399
400
|
}
|
|
400
401
|
return {
|
|
401
|
-
purchaseOrders:
|
|
402
|
+
purchaseOrders: b,
|
|
402
403
|
purchaseRequests: d,
|
|
403
404
|
updateDateRange: E,
|
|
404
405
|
fetchData: P,
|
|
405
406
|
loading: i,
|
|
406
407
|
transferDialogProps: Oe,
|
|
407
|
-
promptCreateTransferDialog:
|
|
408
|
-
promptUpdateTransferDialog:
|
|
408
|
+
promptCreateTransferDialog: S,
|
|
409
|
+
promptUpdateTransferDialog: R,
|
|
409
410
|
transferDetailsProps: z,
|
|
410
411
|
promptShowTransferDetails: le,
|
|
411
|
-
submitAction:
|
|
412
|
-
xilnexImportDialogProps:
|
|
412
|
+
submitAction: xe,
|
|
413
|
+
xilnexImportDialogProps: Me,
|
|
413
414
|
promptUploadTransferDialog: ue
|
|
414
415
|
};
|
|
415
416
|
}
|
|
416
|
-
function
|
|
417
|
+
function Vt(y, t) {
|
|
417
418
|
return t.reduce(
|
|
418
|
-
(_,
|
|
419
|
-
const e =
|
|
420
|
-
return e && (_ =
|
|
419
|
+
(_, l) => {
|
|
420
|
+
const e = l.received.find((c) => c.sku._id === y._id);
|
|
421
|
+
return e && (_ = ot(_, e.amount)), _;
|
|
421
422
|
},
|
|
422
|
-
|
|
423
|
+
At.toPrecision(it(0), y.unit.precision)
|
|
423
424
|
);
|
|
424
425
|
}
|
|
425
|
-
function
|
|
426
|
-
const { po: t, currentLocation: a, business: _, fulfilling:
|
|
427
|
-
name:
|
|
428
|
-
registrationNumber:
|
|
426
|
+
function Ut(y) {
|
|
427
|
+
const { po: t, currentLocation: a, business: _, fulfilling: l, por: e } = y, { name: c, address: i, regNo: s } = a.doc.profile, v = {
|
|
428
|
+
name: c,
|
|
429
|
+
registrationNumber: s,
|
|
429
430
|
line1: i == null ? void 0 : i.line1,
|
|
430
431
|
line2: i == null ? void 0 : i.line2,
|
|
431
432
|
postcode: i == null ? void 0 : i.postcode,
|
|
432
433
|
city: i == null ? void 0 : i.city,
|
|
433
434
|
state: i == null ? void 0 : i.state,
|
|
434
435
|
country: i == null ? void 0 : i.country
|
|
435
|
-
},
|
|
436
|
+
}, b = {
|
|
436
437
|
name: t.supplier.name,
|
|
437
438
|
phoneNumber: t.supplier.phoneNumber,
|
|
438
439
|
registrationNumber: t.supplier.registrationNumber,
|
|
@@ -442,9 +443,9 @@ function Vt(p) {
|
|
|
442
443
|
city: t.supplier.address.city,
|
|
443
444
|
state: t.supplier.address.state,
|
|
444
445
|
country: t.supplier.address.country
|
|
445
|
-
},
|
|
446
|
+
}, m = t.items.map((q) => {
|
|
446
447
|
const { sku: P, measurement: E } = q, z = fe(
|
|
447
|
-
|
|
448
|
+
Vt(q.sku, t.deliveryOrder || []),
|
|
448
449
|
!1
|
|
449
450
|
);
|
|
450
451
|
return {
|
|
@@ -453,12 +454,12 @@ function Vt(p) {
|
|
|
453
454
|
quantity: fe(q.quantity, !1),
|
|
454
455
|
unit: (E == null ? void 0 : E.abbrev) || P.unit.abbrev,
|
|
455
456
|
received: z,
|
|
456
|
-
cost: q.totalCost ? `${q.totalCost.currency} ${
|
|
457
|
+
cost: q.totalCost ? `${q.totalCost.currency} ${St.toFormatString({
|
|
457
458
|
value: q.totalCost
|
|
458
459
|
})}` : void 0
|
|
459
460
|
};
|
|
460
|
-
}),
|
|
461
|
-
createdAt:
|
|
461
|
+
}), p = t.deliveryOrder.map((q) => ({
|
|
462
|
+
createdAt: lt(new Date(q.createdAt)),
|
|
462
463
|
ref: q.deliveryOrderNumber,
|
|
463
464
|
remark: q.remark || "",
|
|
464
465
|
items: q.received.map((P) => {
|
|
@@ -476,26 +477,26 @@ function Vt(p) {
|
|
|
476
477
|
// Dev
|
|
477
478
|
"6880b36a3054c5001db19218"
|
|
478
479
|
];
|
|
479
|
-
let
|
|
480
|
-
if (t.supplier.internal ? (
|
|
480
|
+
let n = "Inventory Receive Note";
|
|
481
|
+
if (t.supplier.internal ? (n = "Inventory Transfer Note", d.includes((_ == null ? void 0 : _._id) || "") && (n = "Stock Request")) : n = "Purchase Order", e) {
|
|
481
482
|
const q = e.from.dbName;
|
|
482
|
-
a.dbName === q || (
|
|
483
|
+
a.dbName === q || (n = "Inventory Receive Note");
|
|
483
484
|
}
|
|
484
|
-
const
|
|
485
|
-
title:
|
|
485
|
+
const S = {
|
|
486
|
+
title: n,
|
|
486
487
|
businessName: _ == null ? void 0 : _.name,
|
|
487
488
|
logo: _ == null ? void 0 : _.thumbnail,
|
|
488
489
|
orderNumber: t.seqNumber.toString(),
|
|
489
|
-
createdAt:
|
|
490
|
+
createdAt: qe(t._id),
|
|
490
491
|
ref: t.ref || "",
|
|
491
492
|
remark: t.remark || "",
|
|
492
|
-
buyer:
|
|
493
|
-
supplier:
|
|
494
|
-
items:
|
|
493
|
+
buyer: v,
|
|
494
|
+
supplier: b,
|
|
495
|
+
items: m,
|
|
495
496
|
status: t.status,
|
|
496
|
-
deliveryOrders:
|
|
497
|
-
},
|
|
498
|
-
|
|
497
|
+
deliveryOrders: p
|
|
498
|
+
}, R = new URL(window.location.href), D = l && (t.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
|
|
499
|
+
R.pathname = R.hostname.includes("portal.feedme") ? `/inventory/${D}` : `/${D}`, R.searchParams.append("data", JSON.stringify(S)), window.open(R.href, "_blank", "noreferrer");
|
|
499
500
|
}
|
|
500
501
|
const Se = {
|
|
501
502
|
submitRequest: {
|
|
@@ -559,71 +560,71 @@ const Se = {
|
|
|
559
560
|
value: x.enum.returnStock
|
|
560
561
|
}
|
|
561
562
|
};
|
|
562
|
-
function
|
|
563
|
-
const a = me(), _ =
|
|
564
|
-
function
|
|
565
|
-
switch (
|
|
563
|
+
function Qs(y, t) {
|
|
564
|
+
const a = me(), _ = Fe(), l = Ee(), { t: e } = ft();
|
|
565
|
+
function c(p) {
|
|
566
|
+
switch (p.status) {
|
|
566
567
|
case "DRAFT":
|
|
567
568
|
return [
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
569
|
+
oe[te.Update],
|
|
570
|
+
oe[te.Details],
|
|
571
|
+
p.supplier.internal === "restaurant" || p.supplier.internal === "warehouse" ? Se[x.enum.submitRequest] : Se[x.enum.confirmDraft],
|
|
571
572
|
Se[x.enum.cancelDraft]
|
|
572
573
|
];
|
|
573
574
|
case "RECEIVING":
|
|
574
575
|
return [
|
|
575
576
|
Se[x.enum.completeReceive],
|
|
576
|
-
|
|
577
|
-
|
|
577
|
+
oe[te.Details],
|
|
578
|
+
oe[te.Print]
|
|
578
579
|
];
|
|
579
580
|
case "REQUESTING":
|
|
580
|
-
return
|
|
581
|
+
return y === "receive/request" ? [oe[te.Details], oe[te.Print]] : [
|
|
581
582
|
Se[x.enum.approveRequest],
|
|
582
583
|
Se[x.enum.rejectRequest],
|
|
583
|
-
|
|
584
|
+
oe[te.Details]
|
|
584
585
|
// DefaultRowActions[RowActionEnum.Print]
|
|
585
586
|
];
|
|
586
587
|
case "PROCESSING":
|
|
587
|
-
return [
|
|
588
|
+
return [oe[te.Details], oe[te.Print]];
|
|
588
589
|
case "COMPLETE":
|
|
589
590
|
case "CANCEL":
|
|
590
591
|
default:
|
|
591
|
-
return [
|
|
592
|
+
return [oe[te.Details], oe[te.Print]];
|
|
592
593
|
}
|
|
593
594
|
}
|
|
594
|
-
function i(
|
|
595
|
-
return Object.values(x.enum).includes(
|
|
595
|
+
function i(p) {
|
|
596
|
+
return Object.values(x.enum).includes(p);
|
|
596
597
|
}
|
|
597
|
-
async function
|
|
598
|
-
var
|
|
599
|
-
const
|
|
600
|
-
if (
|
|
601
|
-
const z = (
|
|
602
|
-
((
|
|
603
|
-
po:
|
|
598
|
+
async function s(p, d, n) {
|
|
599
|
+
var S, R, D, q, P, E;
|
|
600
|
+
const u = at(d);
|
|
601
|
+
if (p === te.Print) {
|
|
602
|
+
const z = (n == null ? void 0 : n.toInventoryLocation) ?? a.currentLocation;
|
|
603
|
+
((S = n == null ? void 0 : n.netSuite) != null && S.refNo || (R = u.netSuite) != null && R.refNo) && (u.ref = [((D = n == null ? void 0 : n.netSuite) == null ? void 0 : D.refNo) || ((q = u.netSuite) == null ? void 0 : q.refNo)].filter((ce) => ce).join(" ")), Ut({
|
|
604
|
+
po: u,
|
|
604
605
|
currentLocation: z,
|
|
605
|
-
business:
|
|
606
|
-
fulfilling:
|
|
607
|
-
por:
|
|
606
|
+
business: l.currentBusiness.value,
|
|
607
|
+
fulfilling: y === "approval",
|
|
608
|
+
por: n
|
|
608
609
|
});
|
|
609
610
|
return;
|
|
610
611
|
}
|
|
611
|
-
if (
|
|
612
|
-
t.promptShowTransferDetails(
|
|
612
|
+
if (p === te.Details) {
|
|
613
|
+
t.promptShowTransferDetails(u, n);
|
|
613
614
|
return;
|
|
614
615
|
}
|
|
615
|
-
if (
|
|
616
|
-
(P = t.promptUpdateTransferDialog) == null || P.call(t,
|
|
616
|
+
if (p === te.Update) {
|
|
617
|
+
(P = t.promptUpdateTransferDialog) == null || P.call(t, u);
|
|
617
618
|
return;
|
|
618
619
|
}
|
|
619
|
-
if (i(
|
|
620
|
-
t.submitAction(d,
|
|
620
|
+
if (i(p)) {
|
|
621
|
+
t.submitAction(d, p, (E = n == null ? void 0 : n.to) == null ? void 0 : E.dbName);
|
|
621
622
|
return;
|
|
622
623
|
}
|
|
623
624
|
}
|
|
624
|
-
function
|
|
625
|
+
function v() {
|
|
625
626
|
var d;
|
|
626
|
-
const
|
|
627
|
+
const p = [
|
|
627
628
|
{
|
|
628
629
|
accessorKey: "seqNumber",
|
|
629
630
|
header: () => e("inventory.transfer.table.seqNo"),
|
|
@@ -634,8 +635,8 @@ function Ws(p, t) {
|
|
|
634
635
|
{
|
|
635
636
|
accessorKey: "_id",
|
|
636
637
|
header: () => e("inventory.transfer.table.createdAt"),
|
|
637
|
-
cell(
|
|
638
|
-
return
|
|
638
|
+
cell(n) {
|
|
639
|
+
return qe(`${n.getValue()}`);
|
|
639
640
|
},
|
|
640
641
|
enableSorting: !0
|
|
641
642
|
},
|
|
@@ -648,17 +649,17 @@ function Ws(p, t) {
|
|
|
648
649
|
{
|
|
649
650
|
accessorKey: "items.length",
|
|
650
651
|
header: () => e("inventory.transfer.table.noOfItems"),
|
|
651
|
-
cell: (
|
|
652
|
-
var
|
|
653
|
-
const
|
|
654
|
-
return
|
|
655
|
-
|
|
656
|
-
|
|
652
|
+
cell: (n) => {
|
|
653
|
+
var R;
|
|
654
|
+
const u = n.row.original.version || "1", S = n.getValue();
|
|
655
|
+
return C("div", { class: "flex items-center gap-2" }, [
|
|
656
|
+
S,
|
|
657
|
+
u !== "1" && ((R = l.sessionUser.value) != null && R.role.isAdmin) ? C(
|
|
657
658
|
"div",
|
|
658
659
|
{
|
|
659
660
|
class: ["fm-status-badge", "fm-status-badge-draft"].join(" ")
|
|
660
661
|
},
|
|
661
|
-
`v${
|
|
662
|
+
`v${u}`
|
|
662
663
|
) : null
|
|
663
664
|
]);
|
|
664
665
|
},
|
|
@@ -673,12 +674,12 @@ function Ws(p, t) {
|
|
|
673
674
|
enableSorting: !1,
|
|
674
675
|
size: "auto"
|
|
675
676
|
},
|
|
676
|
-
...(d =
|
|
677
|
+
...(d = l.sessionUser.value) != null && d.role.isAdmin ? [
|
|
677
678
|
{
|
|
678
679
|
id: "statusForAdmin",
|
|
679
|
-
header: () => `${e("inventory.transfer.table.status")}
|
|
680
|
-
cell(
|
|
681
|
-
return
|
|
680
|
+
header: () => C(Ne, {}, () => `${e("inventory.transfer.table.status")}`),
|
|
681
|
+
cell(n) {
|
|
682
|
+
return n.row.original.status;
|
|
682
683
|
},
|
|
683
684
|
enableSorting: !0,
|
|
684
685
|
size: 200
|
|
@@ -687,15 +688,15 @@ function Ws(p, t) {
|
|
|
687
688
|
{
|
|
688
689
|
accessorKey: "status",
|
|
689
690
|
header: () => e("inventory.transfer.table.status"),
|
|
690
|
-
cell(
|
|
691
|
-
const
|
|
692
|
-
let P = e(`inventory.transfer.status.${q}`), E = `${
|
|
693
|
-
return q === M.enum.CLOSE && (P = `${e(`inventory.transfer.status.${M.enum.COMPLETE}`)}`), q === "PARTIAL_RECEIVED" && E === M.enum.PROCESSING.toLocaleLowerCase("en-us") && (E = M.enum.RECEIVING.toLocaleLowerCase("en-us")),
|
|
691
|
+
cell(n) {
|
|
692
|
+
const u = n.getValue(), S = Te(n.row.original), { partial: R, over: D } = ze(S), q = Ge(u ?? "", R, D);
|
|
693
|
+
let P = e(`inventory.transfer.status.${q}`), E = `${u ?? ""}`.toLocaleLowerCase("en-us");
|
|
694
|
+
return q === M.enum.CLOSE && (P = `${e(`inventory.transfer.status.${M.enum.COMPLETE}`)}`), q === "PARTIAL_RECEIVED" && E === M.enum.PROCESSING.toLocaleLowerCase("en-us") && (E = M.enum.RECEIVING.toLocaleLowerCase("en-us")), C(
|
|
694
695
|
"div",
|
|
695
696
|
{
|
|
696
697
|
class: "flex"
|
|
697
698
|
},
|
|
698
|
-
|
|
699
|
+
C(
|
|
699
700
|
"div",
|
|
700
701
|
{
|
|
701
702
|
class: [
|
|
@@ -713,9 +714,9 @@ function Ws(p, t) {
|
|
|
713
714
|
},
|
|
714
715
|
{
|
|
715
716
|
id: "action",
|
|
716
|
-
cell(
|
|
717
|
-
const
|
|
718
|
-
return
|
|
717
|
+
cell(n) {
|
|
718
|
+
const u = n.row.original, S = c(u);
|
|
719
|
+
return rt(S, (R) => s(R, u));
|
|
719
720
|
},
|
|
720
721
|
enableSorting: !1,
|
|
721
722
|
size: 40,
|
|
@@ -726,18 +727,18 @@ function Ws(p, t) {
|
|
|
726
727
|
}
|
|
727
728
|
];
|
|
728
729
|
if (_.isEnabled) {
|
|
729
|
-
const
|
|
730
|
+
const n = [
|
|
730
731
|
{
|
|
731
732
|
id: "netsuiteTransferOrder",
|
|
732
|
-
accessorFn: (
|
|
733
|
-
var
|
|
734
|
-
return (
|
|
733
|
+
accessorFn: (u) => {
|
|
734
|
+
var S;
|
|
735
|
+
return (S = u.netSuite) != null && S.id ? `${u.netSuite.refNo} (${u.netSuite.id})` : "N/A";
|
|
735
736
|
},
|
|
736
737
|
header: () => "NetSuite Order (ID)",
|
|
737
|
-
cell(
|
|
738
|
-
var
|
|
739
|
-
const
|
|
740
|
-
return (
|
|
738
|
+
cell(u) {
|
|
739
|
+
var R;
|
|
740
|
+
const S = u.row.original;
|
|
741
|
+
return (R = S.netSuite) != null && R.id ? `${S.netSuite.refNo} (${S.netSuite.id})` : "N/A";
|
|
741
742
|
},
|
|
742
743
|
enableSorting: !1,
|
|
743
744
|
size: 200,
|
|
@@ -748,14 +749,14 @@ function Ws(p, t) {
|
|
|
748
749
|
},
|
|
749
750
|
{
|
|
750
751
|
id: "netsuiteTransactionNumber",
|
|
751
|
-
accessorFn: (
|
|
752
|
-
var
|
|
753
|
-
return ((
|
|
752
|
+
accessorFn: (u) => {
|
|
753
|
+
var S, R;
|
|
754
|
+
return ((R = (S = u.netSuite) == null ? void 0 : S.additionalInfo) == null ? void 0 : R.transactionnumber) ?? "N/A";
|
|
754
755
|
},
|
|
755
756
|
header: () => "NetSuite Transaction No.",
|
|
756
|
-
cell(
|
|
757
|
-
var
|
|
758
|
-
return ((D = (
|
|
757
|
+
cell(u) {
|
|
758
|
+
var R, D;
|
|
759
|
+
return ((D = (R = u.row.original.netSuite) == null ? void 0 : R.additionalInfo) == null ? void 0 : D.transactionnumber) ?? "N/A";
|
|
759
760
|
},
|
|
760
761
|
enableSorting: !1,
|
|
761
762
|
size: 200,
|
|
@@ -765,13 +766,13 @@ function Ws(p, t) {
|
|
|
765
766
|
}
|
|
766
767
|
}
|
|
767
768
|
];
|
|
768
|
-
|
|
769
|
+
p.splice(p.length - 1, 0, ...n);
|
|
769
770
|
}
|
|
770
|
-
return
|
|
771
|
+
return p;
|
|
771
772
|
}
|
|
772
|
-
function
|
|
773
|
+
function b() {
|
|
773
774
|
var d;
|
|
774
|
-
const
|
|
775
|
+
const p = [
|
|
775
776
|
{
|
|
776
777
|
accessorKey: "purchaseOrder.seqNumber",
|
|
777
778
|
header: () => e("inventory.transfer.table.seqNo"),
|
|
@@ -782,8 +783,8 @@ function Ws(p, t) {
|
|
|
782
783
|
{
|
|
783
784
|
accessorKey: "purchaseOrder._id",
|
|
784
785
|
header: () => e("inventory.transfer.table.createdAt"),
|
|
785
|
-
cell(
|
|
786
|
-
return
|
|
786
|
+
cell(n) {
|
|
787
|
+
return qe(`${n.getValue()}`);
|
|
787
788
|
},
|
|
788
789
|
enableSorting: !0
|
|
789
790
|
},
|
|
@@ -804,12 +805,12 @@ function Ws(p, t) {
|
|
|
804
805
|
enableSorting: !1,
|
|
805
806
|
size: "auto"
|
|
806
807
|
},
|
|
807
|
-
...(d =
|
|
808
|
+
...(d = l.sessionUser.value) != null && d.role.isAdmin ? [
|
|
808
809
|
{
|
|
809
810
|
id: "statusForAdmin",
|
|
810
|
-
header: () => `${e("inventory.transfer.table.status")}
|
|
811
|
-
cell(
|
|
812
|
-
return
|
|
811
|
+
header: () => C(Ne, {}, () => `${e("inventory.transfer.table.status")}`),
|
|
812
|
+
cell(n) {
|
|
813
|
+
return n.row.original.status;
|
|
813
814
|
},
|
|
814
815
|
enableSorting: !0,
|
|
815
816
|
size: 200
|
|
@@ -818,21 +819,21 @@ function Ws(p, t) {
|
|
|
818
819
|
{
|
|
819
820
|
accessorKey: "purchaseOrder.status",
|
|
820
821
|
header: () => e("inventory.transfer.table.status"),
|
|
821
|
-
cell(
|
|
822
|
-
const
|
|
823
|
-
if (!
|
|
824
|
-
return
|
|
822
|
+
cell(n) {
|
|
823
|
+
const u = n.row.original, S = n.getValue();
|
|
824
|
+
if (!u.purchaseOrder)
|
|
825
|
+
return C(je.FmChip, {
|
|
825
826
|
label: "N/A",
|
|
826
827
|
compact: !0
|
|
827
828
|
});
|
|
828
|
-
const
|
|
829
|
-
let E = e(`inventory.transfer.status.${P}`), z = `${
|
|
830
|
-
return P === M.enum.CLOSE && (E = `${e(`inventory.transfer.status.${M.enum.COMPLETE}`)}`), P === "PARTIAL_RECEIVED" && z === M.enum.PROCESSING.toLocaleLowerCase("en-us") && (z = M.enum.RECEIVING.toLocaleLowerCase("en-us")),
|
|
829
|
+
const R = Te(u.purchaseOrder), { partial: D, over: q } = ze(R), P = Ge(S ?? "", D, q);
|
|
830
|
+
let E = e(`inventory.transfer.status.${P}`), z = `${S ?? ""}`.toLocaleLowerCase("en-us");
|
|
831
|
+
return P === M.enum.CLOSE && (E = `${e(`inventory.transfer.status.${M.enum.COMPLETE}`)}`), P === "PARTIAL_RECEIVED" && z === M.enum.PROCESSING.toLocaleLowerCase("en-us") && (z = M.enum.RECEIVING.toLocaleLowerCase("en-us")), C(
|
|
831
832
|
"div",
|
|
832
833
|
{
|
|
833
834
|
class: "flex"
|
|
834
835
|
},
|
|
835
|
-
|
|
836
|
+
C(
|
|
836
837
|
"div",
|
|
837
838
|
{
|
|
838
839
|
class: [
|
|
@@ -849,14 +850,14 @@ function Ws(p, t) {
|
|
|
849
850
|
},
|
|
850
851
|
{
|
|
851
852
|
id: "action",
|
|
852
|
-
cell(
|
|
853
|
-
const
|
|
853
|
+
cell(n) {
|
|
854
|
+
const u = n.row.original, R = (u.purchaseOrder ? c(u.purchaseOrder) : []).map((D) => D.value === te.Print ? {
|
|
854
855
|
...D,
|
|
855
856
|
translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
|
|
856
857
|
} : D);
|
|
857
|
-
return
|
|
858
|
-
|
|
859
|
-
(D) =>
|
|
858
|
+
return rt(
|
|
859
|
+
R,
|
|
860
|
+
(D) => u.purchaseOrder ? s(D, u.purchaseOrder, u) : void 0
|
|
860
861
|
);
|
|
861
862
|
},
|
|
862
863
|
enableSorting: !1,
|
|
@@ -868,18 +869,18 @@ function Ws(p, t) {
|
|
|
868
869
|
}
|
|
869
870
|
];
|
|
870
871
|
if (_.isEnabled) {
|
|
871
|
-
const
|
|
872
|
+
const n = [
|
|
872
873
|
{
|
|
873
874
|
id: "netsuiteTransferOrder",
|
|
874
|
-
accessorFn: (
|
|
875
|
-
var
|
|
876
|
-
return (
|
|
875
|
+
accessorFn: (u) => {
|
|
876
|
+
var S;
|
|
877
|
+
return (S = u.netSuite) != null && S.id ? `${u.netSuite.refNo} (${u.netSuite.id})` : "N/A";
|
|
877
878
|
},
|
|
878
879
|
header: () => "NetSuite Order (ID)",
|
|
879
|
-
cell(
|
|
880
|
-
var
|
|
881
|
-
const
|
|
882
|
-
return (
|
|
880
|
+
cell(u) {
|
|
881
|
+
var R;
|
|
882
|
+
const S = u.row.original;
|
|
883
|
+
return (R = S.netSuite) != null && R.id ? `${S.netSuite.refNo} (${S.netSuite.id})` : "N/A";
|
|
883
884
|
},
|
|
884
885
|
enableSorting: !1,
|
|
885
886
|
size: 200,
|
|
@@ -890,14 +891,14 @@ function Ws(p, t) {
|
|
|
890
891
|
},
|
|
891
892
|
{
|
|
892
893
|
id: "netsuiteTransactionNumber",
|
|
893
|
-
accessorFn: (
|
|
894
|
-
var
|
|
895
|
-
return ((
|
|
894
|
+
accessorFn: (u) => {
|
|
895
|
+
var S, R;
|
|
896
|
+
return ((R = (S = u.netSuite) == null ? void 0 : S.additionalInfo) == null ? void 0 : R.transactionnumber) ?? "N/A";
|
|
896
897
|
},
|
|
897
898
|
header: () => "NetSuite Transaction No.",
|
|
898
|
-
cell(
|
|
899
|
-
var
|
|
900
|
-
return ((D = (
|
|
899
|
+
cell(u) {
|
|
900
|
+
var R, D;
|
|
901
|
+
return ((D = (R = u.row.original.netSuite) == null ? void 0 : R.additionalInfo) == null ? void 0 : D.transactionnumber) ?? "N/A";
|
|
901
902
|
},
|
|
902
903
|
enableSorting: !1,
|
|
903
904
|
size: 200,
|
|
@@ -907,28 +908,28 @@ function Ws(p, t) {
|
|
|
907
908
|
}
|
|
908
909
|
}
|
|
909
910
|
];
|
|
910
|
-
|
|
911
|
+
p.splice(p.length - 2, 0, ...n);
|
|
911
912
|
}
|
|
912
|
-
return
|
|
913
|
+
return p;
|
|
913
914
|
}
|
|
914
915
|
return {
|
|
915
|
-
columnDefs: ee(() =>
|
|
916
|
+
columnDefs: ee(() => y === "receive/request" ? v() : b())
|
|
916
917
|
};
|
|
917
918
|
}
|
|
918
|
-
const
|
|
919
|
+
const Mt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Kt = { class: "flex flex-col gap-8" }, jt = { class: "flex w-full justify-end gap-16" }, zt = /* @__PURE__ */ he({
|
|
919
920
|
__name: "FulfillmentForm",
|
|
920
921
|
props: {
|
|
921
922
|
purchaseOrder: {},
|
|
922
923
|
confirm: { type: Function }
|
|
923
924
|
},
|
|
924
925
|
emits: ["update:show"],
|
|
925
|
-
setup(
|
|
926
|
-
const a =
|
|
926
|
+
setup(y, { emit: t }) {
|
|
927
|
+
const a = y, _ = Ot({
|
|
927
928
|
id: "",
|
|
928
929
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
929
930
|
items: []
|
|
930
|
-
}),
|
|
931
|
-
|
|
931
|
+
}), l = G(), e = t;
|
|
932
|
+
dt(() => {
|
|
932
933
|
a.purchaseOrder && (_.items = a.purchaseOrder.items.map((i) => ({
|
|
933
934
|
id: i.id,
|
|
934
935
|
sku: i.sku,
|
|
@@ -936,35 +937,35 @@ const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
936
937
|
amount: i.quantity ?? { amount: 1, precision: 0 }
|
|
937
938
|
})));
|
|
938
939
|
});
|
|
939
|
-
const
|
|
940
|
-
return (i,
|
|
941
|
-
const
|
|
942
|
-
return g(), ie(
|
|
940
|
+
const c = ee(() => _.items.length <= 10);
|
|
941
|
+
return (i, s) => {
|
|
942
|
+
const v = W("FmTable"), b = W("FmButton"), m = W("FmForm");
|
|
943
|
+
return g(), ie(m, {
|
|
943
944
|
ref_key: "formRef",
|
|
944
|
-
ref:
|
|
945
|
+
ref: l,
|
|
945
946
|
class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
|
|
946
947
|
onValidationFailed: console.log,
|
|
947
|
-
onValidationSuccess:
|
|
948
|
+
onValidationSuccess: s[1] || (s[1] = () => a.confirm(_))
|
|
948
949
|
}, {
|
|
949
|
-
default:
|
|
950
|
-
|
|
951
|
-
o("div",
|
|
952
|
-
o("div",
|
|
953
|
-
|
|
950
|
+
default: re(() => [
|
|
951
|
+
s[2] || (s[2] = o("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
|
|
952
|
+
o("div", Mt, [
|
|
953
|
+
o("div", Kt, [
|
|
954
|
+
I(v, {
|
|
954
955
|
"column-defs": [
|
|
955
956
|
{
|
|
956
957
|
header: "Code",
|
|
957
|
-
cell: (
|
|
958
|
-
const d = a.purchaseOrder.items.find((
|
|
959
|
-
return
|
|
960
|
-
|
|
958
|
+
cell: (p) => {
|
|
959
|
+
const d = a.purchaseOrder.items.find((n) => n.id === p.row.original.id || n.sku._id === p.row.original.sku._id);
|
|
960
|
+
return C(
|
|
961
|
+
w(je).FmTooltip,
|
|
961
962
|
{
|
|
962
963
|
content: d.code,
|
|
963
964
|
placement: "top",
|
|
964
965
|
variant: "plain",
|
|
965
966
|
zIndex: 50
|
|
966
967
|
},
|
|
967
|
-
|
|
968
|
+
C(
|
|
968
969
|
"span",
|
|
969
970
|
{
|
|
970
971
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
@@ -976,17 +977,17 @@ const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
976
977
|
},
|
|
977
978
|
{
|
|
978
979
|
header: "Name",
|
|
979
|
-
cell: (
|
|
980
|
-
const d = a.purchaseOrder.items.find((
|
|
981
|
-
return
|
|
982
|
-
|
|
980
|
+
cell: (p) => {
|
|
981
|
+
const d = a.purchaseOrder.items.find((n) => n.id === p.row.original.id || n.sku._id === p.row.original.sku._id);
|
|
982
|
+
return C(
|
|
983
|
+
w(je).FmTooltip,
|
|
983
984
|
{
|
|
984
985
|
content: d.name,
|
|
985
986
|
placement: "top",
|
|
986
987
|
variant: "plain",
|
|
987
988
|
zIndex: 50
|
|
988
989
|
},
|
|
989
|
-
|
|
990
|
+
C(
|
|
990
991
|
"span",
|
|
991
992
|
{
|
|
992
993
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
@@ -998,32 +999,32 @@ const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
998
999
|
},
|
|
999
1000
|
{
|
|
1000
1001
|
header: "Amount",
|
|
1001
|
-
cell: (
|
|
1002
|
-
const d =
|
|
1002
|
+
cell: (p) => {
|
|
1003
|
+
const d = p.row.original, n = a.purchaseOrder.items.find((S) => S.id === d.id || S.sku._id === d.sku._id), u = d.amount ?? {
|
|
1003
1004
|
amount: 1,
|
|
1004
1005
|
precision: 0
|
|
1005
1006
|
};
|
|
1006
|
-
return
|
|
1007
|
+
return C(Pt, {
|
|
1007
1008
|
style: {
|
|
1008
1009
|
flex: "1 1 0%"
|
|
1009
1010
|
},
|
|
1010
1011
|
modelValue: {
|
|
1011
|
-
amount:
|
|
1012
|
+
amount: u,
|
|
1012
1013
|
measurement: d.measurement ?? null
|
|
1013
1014
|
},
|
|
1014
1015
|
key: d.id ?? d.sku._id,
|
|
1015
1016
|
unit: d.sku.unit,
|
|
1016
|
-
"onUpdate:modelValue": (
|
|
1017
|
-
if (!
|
|
1018
|
-
const
|
|
1019
|
-
|
|
1017
|
+
"onUpdate:modelValue": (S) => {
|
|
1018
|
+
if (!S) return;
|
|
1019
|
+
const R = _.items.find((D) => D.id === d.id || D.sku._id === d.sku._id);
|
|
1020
|
+
R && (R.amount = S.amount);
|
|
1020
1021
|
},
|
|
1021
1022
|
disableUnit: !0,
|
|
1022
1023
|
rules: [
|
|
1023
|
-
|
|
1024
|
-
+
|
|
1024
|
+
w(It)(
|
|
1025
|
+
+w(fe)({ amount: 0, precision: 0 })
|
|
1025
1026
|
),
|
|
1026
|
-
|
|
1027
|
+
w(Ft)(+w(fe)(n.quantity))
|
|
1027
1028
|
],
|
|
1028
1029
|
applyDefaultRules: !0
|
|
1029
1030
|
});
|
|
@@ -1031,24 +1032,24 @@ const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1031
1032
|
}
|
|
1032
1033
|
],
|
|
1033
1034
|
"row-data": _.items,
|
|
1034
|
-
"hide-footer":
|
|
1035
|
+
"hide-footer": c.value
|
|
1035
1036
|
}, null, 8, ["column-defs", "row-data", "hide-footer"])
|
|
1036
1037
|
])
|
|
1037
1038
|
]),
|
|
1038
|
-
o("div",
|
|
1039
|
-
|
|
1039
|
+
o("div", jt, [
|
|
1040
|
+
I(b, {
|
|
1040
1041
|
class: "px-16",
|
|
1041
1042
|
label: "Confirm",
|
|
1042
1043
|
size: "md",
|
|
1043
1044
|
variant: "primary",
|
|
1044
1045
|
type: "submit"
|
|
1045
1046
|
}),
|
|
1046
|
-
|
|
1047
|
+
I(b, {
|
|
1047
1048
|
class: "px-16",
|
|
1048
1049
|
label: "Cancel",
|
|
1049
1050
|
size: "md",
|
|
1050
1051
|
variant: "secondary",
|
|
1051
|
-
onClick:
|
|
1052
|
+
onClick: s[0] || (s[0] = () => e("update:show", !1))
|
|
1052
1053
|
})
|
|
1053
1054
|
])
|
|
1054
1055
|
]),
|
|
@@ -1056,73 +1057,73 @@ const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1056
1057
|
}, 8, ["onValidationFailed"]);
|
|
1057
1058
|
};
|
|
1058
1059
|
}
|
|
1059
|
-
}),
|
|
1060
|
+
}), Ke = {
|
|
1060
1061
|
submitRequest: {
|
|
1061
1062
|
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
1062
1063
|
color: "primary",
|
|
1063
|
-
buttonVariant:
|
|
1064
|
+
buttonVariant: ne.Primary
|
|
1064
1065
|
},
|
|
1065
1066
|
confirmDraft: {
|
|
1066
1067
|
translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
|
|
1067
1068
|
color: "primary",
|
|
1068
|
-
buttonVariant:
|
|
1069
|
+
buttonVariant: ne.Primary
|
|
1069
1070
|
},
|
|
1070
1071
|
cancelDraft: {
|
|
1071
1072
|
translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
|
|
1072
1073
|
color: "system-error-300",
|
|
1073
|
-
buttonVariant:
|
|
1074
|
+
buttonVariant: ne.Destructive
|
|
1074
1075
|
},
|
|
1075
1076
|
approveDraft: {
|
|
1076
1077
|
translationKey: "inventory.transfer.receiveRequest.actions.approveDraft",
|
|
1077
1078
|
color: "primary",
|
|
1078
|
-
buttonVariant:
|
|
1079
|
+
buttonVariant: ne.Primary
|
|
1079
1080
|
},
|
|
1080
1081
|
rejectDraft: {
|
|
1081
1082
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectDraft",
|
|
1082
1083
|
color: "system-error-300",
|
|
1083
|
-
buttonVariant:
|
|
1084
|
+
buttonVariant: ne.Destructive
|
|
1084
1085
|
},
|
|
1085
1086
|
approveRequest: {
|
|
1086
1087
|
translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
|
|
1087
1088
|
color: "primary",
|
|
1088
|
-
buttonVariant:
|
|
1089
|
+
buttonVariant: ne.Primary
|
|
1089
1090
|
},
|
|
1090
1091
|
processRequest: {
|
|
1091
1092
|
translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
|
|
1092
1093
|
color: "primary",
|
|
1093
|
-
buttonVariant:
|
|
1094
|
+
buttonVariant: ne.Primary
|
|
1094
1095
|
},
|
|
1095
1096
|
receiveStock: {
|
|
1096
1097
|
translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
|
|
1097
1098
|
color: "primary",
|
|
1098
|
-
buttonVariant:
|
|
1099
|
+
buttonVariant: ne.Primary,
|
|
1099
1100
|
available: !1
|
|
1100
1101
|
},
|
|
1101
1102
|
completeReceive: {
|
|
1102
1103
|
translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
|
|
1103
1104
|
color: "primary",
|
|
1104
|
-
buttonVariant:
|
|
1105
|
+
buttonVariant: ne.Plain
|
|
1105
1106
|
},
|
|
1106
1107
|
rejectRequest: {
|
|
1107
1108
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
|
|
1108
1109
|
color: "system-error-300",
|
|
1109
|
-
buttonVariant:
|
|
1110
|
+
buttonVariant: ne.Destructive
|
|
1110
1111
|
},
|
|
1111
1112
|
closeRequest: {
|
|
1112
1113
|
translationKey: "inventory.transfer.receiveRequest.actions.closeRequest",
|
|
1113
1114
|
color: "system-error-300",
|
|
1114
|
-
buttonVariant:
|
|
1115
|
+
buttonVariant: ne.Destructive,
|
|
1115
1116
|
available: !1
|
|
1116
1117
|
},
|
|
1117
1118
|
returnStock: {
|
|
1118
1119
|
translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
|
|
1119
1120
|
color: "primary",
|
|
1120
|
-
buttonVariant:
|
|
1121
|
+
buttonVariant: ne.Primary,
|
|
1121
1122
|
available: !1
|
|
1122
1123
|
}
|
|
1123
1124
|
};
|
|
1124
|
-
function
|
|
1125
|
-
const
|
|
1125
|
+
function Gt() {
|
|
1126
|
+
const y = Ie();
|
|
1126
1127
|
return {
|
|
1127
1128
|
ableToMarkReceived(t) {
|
|
1128
1129
|
if (!t || t.status !== M.enum.RECEIVING)
|
|
@@ -1134,15 +1135,15 @@ function zt() {
|
|
|
1134
1135
|
return !(!t || (t == null ? void 0 : t.status) !== M.enum.REQUESTING);
|
|
1135
1136
|
},
|
|
1136
1137
|
ableToCreateFulfillment(t, a) {
|
|
1137
|
-
var e,
|
|
1138
|
-
if (!
|
|
1138
|
+
var e, c;
|
|
1139
|
+
if (!y.acceptRequireFulfillment || !t || !a || t.status !== M.enum.PROCESSING || !a.processedAt)
|
|
1139
1140
|
return !1;
|
|
1140
|
-
const _ = (e = a == null ? void 0 : a.from) == null ? void 0 : e.dbName,
|
|
1141
|
-
return !(_.startsWith("restaurant_") &&
|
|
1141
|
+
const _ = (e = a == null ? void 0 : a.from) == null ? void 0 : e.dbName, l = (c = a == null ? void 0 : a.to) == null ? void 0 : c.dbName;
|
|
1142
|
+
return !(_.startsWith("restaurant_") && l.startsWith("restaurant_"));
|
|
1142
1143
|
}
|
|
1143
1144
|
};
|
|
1144
1145
|
}
|
|
1145
|
-
const
|
|
1146
|
+
const Ht = { class: "flex flex-row-reverse" }, Wt = /* @__PURE__ */ he({
|
|
1146
1147
|
__name: "NetSuiteSync",
|
|
1147
1148
|
props: {
|
|
1148
1149
|
poRequest: {},
|
|
@@ -1150,22 +1151,22 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1150
1151
|
isTransferBetweenOutlets: { type: Boolean },
|
|
1151
1152
|
scope: {}
|
|
1152
1153
|
},
|
|
1153
|
-
setup(
|
|
1154
|
-
const t =
|
|
1154
|
+
setup(y) {
|
|
1155
|
+
const t = y, a = Fe(), _ = Le(), l = Ye(), e = G(!1);
|
|
1155
1156
|
ee(() => {
|
|
1156
|
-
var
|
|
1157
|
+
var b, m, p, d;
|
|
1157
1158
|
let i = !0;
|
|
1158
1159
|
a.isEnabled || (i = !1);
|
|
1159
|
-
const
|
|
1160
|
-
return
|
|
1160
|
+
const s = t.purchaseOrder, v = t.poRequest;
|
|
1161
|
+
return s && ((b = s == null ? void 0 : s.supplier) != null && b.internal ? (!v && s.status == M.enum.DRAFT && (i = !1), v && !((m = v == null ? void 0 : v.netSuite) != null && m.id) && (i = !1), t.isTransferBetweenOutlets && (i = !1)) : ((s == null ? void 0 : s.status) !== M.enum.REQUESTING && s.supplier.internal && (i = !1), !v && !((p = s == null ? void 0 : s.netSuite) != null && p.id) && (i = !1), !v && ((d = s == null ? void 0 : s.netSuite) != null && d.id) && (s == null ? void 0 : s.status) == M.enum.REQUESTING && (i = !1))), i;
|
|
1161
1162
|
});
|
|
1162
|
-
async function
|
|
1163
|
-
e.value ||
|
|
1163
|
+
async function c() {
|
|
1164
|
+
e.value || l.open({
|
|
1164
1165
|
title: "Sync with NetSuite",
|
|
1165
|
-
contentComponent:
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1166
|
+
contentComponent: C("div", [
|
|
1167
|
+
C("p", "Are you sure you want to sync now?"),
|
|
1168
|
+
C("br"),
|
|
1169
|
+
C(
|
|
1169
1170
|
"p",
|
|
1170
1171
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1171
1172
|
"Please wait a moment before syncing manually to avoid unnecessary actions."
|
|
@@ -1178,18 +1179,18 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1178
1179
|
},
|
|
1179
1180
|
secondaryActions: { text: "Not now", close: !0 }
|
|
1180
1181
|
}).onPrimary(async () => {
|
|
1181
|
-
var i,
|
|
1182
|
+
var i, s, v;
|
|
1182
1183
|
try {
|
|
1183
1184
|
e.value = !0;
|
|
1184
|
-
const
|
|
1185
|
+
const b = ((i = t.purchaseOrder) == null ? void 0 : i._id) || ((s = t.poRequest) == null ? void 0 : s.purchaseOrderId) || "", m = (v = t.poRequest) == null ? void 0 : v.to.dbName;
|
|
1185
1186
|
await a.syncPurchaseOrder(
|
|
1186
|
-
|
|
1187
|
-
t.scope === "approval" ?
|
|
1187
|
+
b,
|
|
1188
|
+
t.scope === "approval" ? m : void 0
|
|
1188
1189
|
), _.open({
|
|
1189
1190
|
title: "Sync with NetSuite",
|
|
1190
1191
|
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
1191
1192
|
type: "success"
|
|
1192
|
-
}), await new Promise((
|
|
1193
|
+
}), await new Promise((p) => setTimeout(p, 5e3)), e.value = !1;
|
|
1193
1194
|
} catch {
|
|
1194
1195
|
_.open({
|
|
1195
1196
|
title: "Error",
|
|
@@ -1199,15 +1200,15 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1199
1200
|
}
|
|
1200
1201
|
});
|
|
1201
1202
|
}
|
|
1202
|
-
return (i,
|
|
1203
|
-
const
|
|
1204
|
-
return g(), N("div",
|
|
1205
|
-
|
|
1203
|
+
return (i, s) => {
|
|
1204
|
+
const v = W("FmButton");
|
|
1205
|
+
return g(), N("div", Ht, [
|
|
1206
|
+
I(v, {
|
|
1206
1207
|
"prepend-icon": "sync",
|
|
1207
1208
|
variant: "secondary",
|
|
1208
1209
|
label: "Sync",
|
|
1209
1210
|
loading: e.value,
|
|
1210
|
-
onClick:
|
|
1211
|
+
onClick: c,
|
|
1211
1212
|
"text-color": "primary",
|
|
1212
1213
|
"bg-color": "transparent",
|
|
1213
1214
|
"border-color": "primary"
|
|
@@ -1215,22 +1216,22 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1215
1216
|
]);
|
|
1216
1217
|
};
|
|
1217
1218
|
}
|
|
1218
|
-
}),
|
|
1219
|
+
}), Yt = {
|
|
1219
1220
|
key: 0,
|
|
1220
1221
|
class: "flex flex-col gap-8"
|
|
1221
|
-
},
|
|
1222
|
+
}, Qt = { class: "flex flex-col gap-4" }, Xt = { class: "fm-typo-en-body-lg-600" }, Zt = {
|
|
1222
1223
|
key: 0,
|
|
1223
1224
|
class: "flex flex-col gap-4"
|
|
1224
|
-
},
|
|
1225
|
+
}, Jt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, er = { class: "fm-typo-en-body-lg-600" }, tr = { key: 0 }, rr = { key: 1 }, sr = {
|
|
1225
1226
|
key: 1,
|
|
1226
1227
|
class: "flex flex-col gap-4"
|
|
1227
|
-
},
|
|
1228
|
+
}, nr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ar = { class: "fm-typo-en-body-lg-600" }, or = { key: 0 }, ir = { key: 1 }, lr = {
|
|
1228
1229
|
key: 2,
|
|
1229
1230
|
class: "flex flex-col gap-4"
|
|
1230
|
-
},
|
|
1231
|
+
}, cr = { class: "fm-typo-en-body-lg-600" }, ur = {
|
|
1231
1232
|
key: 3,
|
|
1232
1233
|
class: "flex flex-col gap-4"
|
|
1233
|
-
},
|
|
1234
|
+
}, dr = { class: "fm-typo-en-body-lg-600" }, fr = /* @__PURE__ */ he({
|
|
1234
1235
|
__name: "NetSuiteInfo",
|
|
1235
1236
|
props: {
|
|
1236
1237
|
transferType: {},
|
|
@@ -1240,100 +1241,100 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1240
1241
|
isTransferBetweenOutlets: { type: Boolean },
|
|
1241
1242
|
scope: {}
|
|
1242
1243
|
},
|
|
1243
|
-
setup(
|
|
1244
|
-
const t =
|
|
1245
|
-
|
|
1246
|
-
var
|
|
1247
|
-
if (!t.poRequest && ((
|
|
1248
|
-
const
|
|
1249
|
-
|
|
1244
|
+
setup(y) {
|
|
1245
|
+
const t = y, a = Fe(), _ = Be(), l = G(t.poRequest);
|
|
1246
|
+
dt(async () => {
|
|
1247
|
+
var s;
|
|
1248
|
+
if (!t.poRequest && ((s = t.purchaseOrder) != null && s._id)) {
|
|
1249
|
+
const v = await _.getLatestPurchaseOrderRequest(t.purchaseOrder._id);
|
|
1250
|
+
l.value = v;
|
|
1250
1251
|
}
|
|
1251
1252
|
});
|
|
1252
1253
|
const e = ee(
|
|
1253
1254
|
() => {
|
|
1254
|
-
var
|
|
1255
|
+
var s, v, b, m, p, d;
|
|
1255
1256
|
return a.getSubsidiaryFullName(
|
|
1256
|
-
((
|
|
1257
|
+
((b = (v = (s = t.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : v.subsidiary) == null ? void 0 : b.id) || ((d = (p = (m = t.poRequest) == null ? void 0 : m.netSuite) == null ? void 0 : p.subsidiary) == null ? void 0 : d.id)
|
|
1257
1258
|
).fullName;
|
|
1258
1259
|
}
|
|
1259
|
-
),
|
|
1260
|
-
var
|
|
1261
|
-
return (
|
|
1260
|
+
), c = ee(() => {
|
|
1261
|
+
var s, v, b, m, p, d, n, u, S, R, D, q;
|
|
1262
|
+
return (b = (v = (s = t.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : v.additionalInfo) != null && b.transactionnumber ? (d = (p = (m = t.purchaseOrder) == null ? void 0 : m.netSuite) == null ? void 0 : p.additionalInfo) == null ? void 0 : d.transactionnumber : (S = (u = (n = l.value) == null ? void 0 : n.netSuite) == null ? void 0 : u.additionalInfo) != null && S.transactionnumber ? (q = (D = (R = l.value) == null ? void 0 : R.netSuite) == null ? void 0 : D.additionalInfo) == null ? void 0 : q.transactionnumber : null;
|
|
1262
1263
|
}), i = ee(() => {
|
|
1263
|
-
var
|
|
1264
|
-
return (
|
|
1265
|
-
var
|
|
1266
|
-
return (
|
|
1264
|
+
var s, v, b, m, p, d;
|
|
1265
|
+
return (v = (s = t.purchaseOrder) == null ? void 0 : s.deliveryFullfillment) != null && v.length && ((m = (b = t.purchaseOrder) == null ? void 0 : b.deliveryFullfillment) == null ? void 0 : m.length) > 0 ? (d = (p = t.purchaseOrder) == null ? void 0 : p.deliveryFullfillment) == null ? void 0 : d.map((n) => {
|
|
1266
|
+
var u;
|
|
1267
|
+
return (u = n.netSuite) == null ? void 0 : u.refNo;
|
|
1267
1268
|
}).join(", ") : "N/A";
|
|
1268
1269
|
});
|
|
1269
|
-
return (
|
|
1270
|
-
var
|
|
1271
|
-
return
|
|
1272
|
-
o("div",
|
|
1273
|
-
|
|
1274
|
-
o("div",
|
|
1270
|
+
return (s, v) => {
|
|
1271
|
+
var b, m, p, d, n, u, S, R, D, q, P, E, z, ce, le, be;
|
|
1272
|
+
return w(a).isEnabled ? (g(), N("div", Yt, [
|
|
1273
|
+
o("div", Qt, [
|
|
1274
|
+
v[0] || (v[0] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
1275
|
+
o("div", Xt, k(e.value || "N/A"), 1)
|
|
1275
1276
|
]),
|
|
1276
|
-
!
|
|
1277
|
-
o("div",
|
|
1278
|
-
o("div",
|
|
1279
|
-
(
|
|
1277
|
+
!s.isTransferBetweenOutlets && s.scope === w(He).RECEIVE_REQUEST ? (g(), N("div", Zt, [
|
|
1278
|
+
o("div", Jt, " NetSuite " + k((m = (b = s.purchaseOrder) == null ? void 0 : b.netSuite) != null && m.recordType ? w(ct)((d = (p = s.purchaseOrder) == null ? void 0 : p.netSuite) == null ? void 0 : d.recordType) : s.transferType === w(ye).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1279
|
+
o("div", er, [
|
|
1280
|
+
(u = (n = s.purchaseOrder) == null ? void 0 : n.netSuite) != null && u.id ? (g(), N("span", tr, k((R = (S = s.purchaseOrder) == null ? void 0 : S.netSuite) == null ? void 0 : R.refNo) + " (" + k((q = (D = s.purchaseOrder) == null ? void 0 : D.netSuite) == null ? void 0 : q.id) + ") ", 1)) : (g(), N("span", rr, "N/A"))
|
|
1280
1281
|
])
|
|
1281
1282
|
])) : U("", !0),
|
|
1282
|
-
!
|
|
1283
|
-
o("div",
|
|
1284
|
-
o("div",
|
|
1285
|
-
(E = (P =
|
|
1283
|
+
!s.isTransferBetweenOutlets && l.value || s.scope === w(He).APPROVAL ? (g(), N("div", sr, [
|
|
1284
|
+
o("div", nr, " (Request) NetSuite " + k(s.transferType === w(ye).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1285
|
+
o("div", ar, [
|
|
1286
|
+
(E = (P = l.value) == null ? void 0 : P.netSuite) != null && E.id ? (g(), N("span", or, k((ce = (z = l.value) == null ? void 0 : z.netSuite) == null ? void 0 : ce.refNo) + " (" + k((be = (le = l.value) == null ? void 0 : le.netSuite) == null ? void 0 : be.id) + ") ", 1)) : (g(), N("span", ir, "N/A"))
|
|
1286
1287
|
])
|
|
1287
1288
|
])) : U("", !0),
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
o("div",
|
|
1289
|
+
c.value ? (g(), N("div", lr, [
|
|
1290
|
+
v[1] || (v[1] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
|
|
1291
|
+
o("div", cr, k(c.value), 1)
|
|
1291
1292
|
])) : U("", !0),
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
o("div",
|
|
1293
|
+
w(a).isEnabled && s.transferType === w(ye).TRANSFER && !s.isTransferBetweenOutlets ? (g(), N("div", ur, [
|
|
1294
|
+
v[2] || (v[2] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
1295
|
+
o("div", dr, k(i.value), 1)
|
|
1295
1296
|
])) : U("", !0)
|
|
1296
1297
|
])) : U("", !0);
|
|
1297
1298
|
};
|
|
1298
1299
|
}
|
|
1299
|
-
}),
|
|
1300
|
+
}), mr = { class: "flex flex-row-reverse" }, pr = /* @__PURE__ */ he({
|
|
1300
1301
|
__name: "NetSuiteLog",
|
|
1301
1302
|
props: {
|
|
1302
1303
|
netsuiteId: {},
|
|
1303
1304
|
purchaseOrderId: {}
|
|
1304
1305
|
},
|
|
1305
|
-
setup(
|
|
1306
|
-
const t =
|
|
1307
|
-
async function _(
|
|
1308
|
-
const
|
|
1309
|
-
if (
|
|
1310
|
-
const
|
|
1311
|
-
|
|
1306
|
+
setup(y) {
|
|
1307
|
+
const t = Le(), a = ut();
|
|
1308
|
+
async function _(l, e) {
|
|
1309
|
+
const c = [];
|
|
1310
|
+
if (l && c.push(`body.message:*${l}*`), e) {
|
|
1311
|
+
const b = e.replace(/:/g, "\\:");
|
|
1312
|
+
c.push(`${b}`);
|
|
1312
1313
|
}
|
|
1313
|
-
if (
|
|
1314
|
+
if (c.length === 0) {
|
|
1314
1315
|
t.open({
|
|
1315
1316
|
message: "Cannot open logs without valid filters.",
|
|
1316
1317
|
type: "error"
|
|
1317
1318
|
});
|
|
1318
1319
|
return;
|
|
1319
1320
|
}
|
|
1320
|
-
const
|
|
1321
|
+
const s = `attributes.pod:netsuite* AND (${c.join(" OR ")})`, { url: v } = await a.getLogs(s);
|
|
1321
1322
|
t.open(
|
|
1322
1323
|
{
|
|
1323
1324
|
message: "Opening NetSuite logs...",
|
|
1324
1325
|
type: "info"
|
|
1325
1326
|
},
|
|
1326
1327
|
800
|
|
1327
|
-
), await new Promise((
|
|
1328
|
+
), await new Promise((b) => setTimeout(b, 800)), window.open(v, "_blank");
|
|
1328
1329
|
}
|
|
1329
|
-
return (
|
|
1330
|
-
const
|
|
1331
|
-
return g(), N("div",
|
|
1332
|
-
|
|
1330
|
+
return (l, e) => {
|
|
1331
|
+
const c = W("FmButton");
|
|
1332
|
+
return g(), N("div", mr, [
|
|
1333
|
+
I(c, {
|
|
1333
1334
|
"prepend-icon": "history",
|
|
1334
1335
|
variant: "secondary",
|
|
1335
1336
|
label: "Logs",
|
|
1336
|
-
onClick: e[0] || (e[0] = (i) => _(
|
|
1337
|
+
onClick: e[0] || (e[0] = (i) => _(l.netsuiteId, l.purchaseOrderId)),
|
|
1337
1338
|
"text-color": "primary",
|
|
1338
1339
|
"bg-color": "transparent",
|
|
1339
1340
|
"border-color": "primary"
|
|
@@ -1341,77 +1342,77 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1341
1342
|
]);
|
|
1342
1343
|
};
|
|
1343
1344
|
}
|
|
1344
|
-
}),
|
|
1345
|
+
}), vr = { class: "flex flex-row-reverse" }, yr = { key: 0 }, hr = {
|
|
1345
1346
|
key: 1,
|
|
1346
1347
|
class: "w-[480px]"
|
|
1347
|
-
},
|
|
1348
|
+
}, br = { class: "fm-typo-en-body-md-400" }, gr = { key: 0 }, _r = { key: 1 }, Sr = { key: 1 }, wr = /* @__PURE__ */ he({
|
|
1348
1349
|
__name: "NetSuiteLatestInfo",
|
|
1349
1350
|
props: {
|
|
1350
1351
|
netsuiteId: {},
|
|
1351
1352
|
purchaseOrderId: {}
|
|
1352
1353
|
},
|
|
1353
|
-
setup(
|
|
1354
|
-
const t =
|
|
1355
|
-
async function
|
|
1354
|
+
setup(y) {
|
|
1355
|
+
const t = y, a = ut(), _ = G(!1), l = me(), e = G(!0), c = G(!1), i = G(null);
|
|
1356
|
+
async function s() {
|
|
1356
1357
|
if (!i.value) {
|
|
1357
1358
|
_.value = !0;
|
|
1358
1359
|
try {
|
|
1359
1360
|
e.value = !0;
|
|
1360
|
-
const
|
|
1361
|
-
|
|
1361
|
+
const v = await a.getMoreInfo(
|
|
1362
|
+
l.currentLocation.dbName,
|
|
1362
1363
|
t.purchaseOrderId
|
|
1363
1364
|
);
|
|
1364
|
-
i.value =
|
|
1365
|
+
i.value = v, c.value = !1;
|
|
1365
1366
|
} catch {
|
|
1366
|
-
|
|
1367
|
+
c.value = !0;
|
|
1367
1368
|
} finally {
|
|
1368
1369
|
e.value = !1;
|
|
1369
1370
|
}
|
|
1370
1371
|
}
|
|
1371
1372
|
}
|
|
1372
|
-
return (
|
|
1373
|
-
const
|
|
1374
|
-
return g(), N("div",
|
|
1375
|
-
|
|
1373
|
+
return (v, b) => {
|
|
1374
|
+
const m = W("FmButton"), p = W("FmLabel"), d = W("FmDialog");
|
|
1375
|
+
return g(), N("div", vr, [
|
|
1376
|
+
I(d, {
|
|
1376
1377
|
modelValue: _.value,
|
|
1377
|
-
"onUpdate:modelValue":
|
|
1378
|
+
"onUpdate:modelValue": b[2] || (b[2] = (n) => _.value = n),
|
|
1378
1379
|
overlay: !0
|
|
1379
1380
|
}, {
|
|
1380
|
-
"dialog-button":
|
|
1381
|
-
|
|
1381
|
+
"dialog-button": re(() => [
|
|
1382
|
+
I(m, {
|
|
1382
1383
|
"prepend-icon": "info",
|
|
1383
1384
|
variant: "secondary",
|
|
1384
1385
|
label: "Latest Info",
|
|
1385
|
-
onClick:
|
|
1386
|
+
onClick: b[0] || (b[0] = (n) => s()),
|
|
1386
1387
|
"text-color": "primary",
|
|
1387
1388
|
"bg-color": "transparent",
|
|
1388
1389
|
"border-color": "primary"
|
|
1389
1390
|
})
|
|
1390
1391
|
]),
|
|
1391
|
-
"dialog-header":
|
|
1392
|
+
"dialog-header": re(() => b[3] || (b[3] = [
|
|
1392
1393
|
o("div", null, "NetSuite latest info", -1)
|
|
1393
1394
|
])),
|
|
1394
|
-
"dialog-footer":
|
|
1395
|
-
|
|
1395
|
+
"dialog-footer": re(() => [
|
|
1396
|
+
I(m, {
|
|
1396
1397
|
class: "ml-auto sm:w-full xs:w-full",
|
|
1397
1398
|
label: "Close",
|
|
1398
1399
|
size: "md",
|
|
1399
1400
|
variant: "primary",
|
|
1400
|
-
onClick:
|
|
1401
|
+
onClick: b[1] || (b[1] = (n) => _.value = !1)
|
|
1401
1402
|
})
|
|
1402
1403
|
]),
|
|
1403
|
-
default:
|
|
1404
|
-
e.value ? (g(), N("div",
|
|
1405
|
-
|
|
1406
|
-
key:
|
|
1404
|
+
default: re(() => [
|
|
1405
|
+
e.value ? (g(), N("div", yr, "Loading...")) : (g(), N("div", hr, [
|
|
1406
|
+
c.value ? (g(), N("p", Sr, "Something went wrong.")) : (g(!0), N(ae, { key: 0 }, ve(i.value, (n, u) => (g(), N("div", {
|
|
1407
|
+
key: u,
|
|
1407
1408
|
class: "mb-2"
|
|
1408
1409
|
}, [
|
|
1409
1410
|
o("div", null, [
|
|
1410
|
-
|
|
1411
|
-
label:
|
|
1411
|
+
I(p, {
|
|
1412
|
+
label: w(We)(u)
|
|
1412
1413
|
}, null, 8, ["label"]),
|
|
1413
|
-
o("div",
|
|
1414
|
-
Array.isArray(
|
|
1414
|
+
o("div", br, [
|
|
1415
|
+
Array.isArray(n) ? (g(), N("span", gr, k(n.length > 0 ? n.join(", ") : "N/A"), 1)) : (g(), N("span", _r, k(n), 1))
|
|
1415
1416
|
])
|
|
1416
1417
|
])
|
|
1417
1418
|
]))), 128))
|
|
@@ -1422,10 +1423,10 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1422
1423
|
]);
|
|
1423
1424
|
};
|
|
1424
1425
|
}
|
|
1425
|
-
}),
|
|
1426
|
+
}), Rr = {
|
|
1426
1427
|
key: 0,
|
|
1427
1428
|
class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16 flex flex-col gap-8"
|
|
1428
|
-
},
|
|
1429
|
+
}, Or = { class: "flex gap-8 items-center" }, Nr = { class: "ml-auto" }, xr = { class: "flex gap-4" }, kr = /* @__PURE__ */ he({
|
|
1429
1430
|
__name: "NetSuitePanel",
|
|
1430
1431
|
props: {
|
|
1431
1432
|
poRequest: {},
|
|
@@ -1434,91 +1435,106 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1434
1435
|
transferToDbName: {},
|
|
1435
1436
|
scope: {}
|
|
1436
1437
|
},
|
|
1437
|
-
setup(
|
|
1438
|
-
const t =
|
|
1439
|
-
var
|
|
1440
|
-
const e = ((
|
|
1441
|
-
return
|
|
1438
|
+
setup(y) {
|
|
1439
|
+
const t = y, a = Lt(), _ = Ee(), l = ee(() => {
|
|
1440
|
+
var s, v, b, m, p, d, n;
|
|
1441
|
+
const e = ((s = t.transferToDbName) == null ? void 0 : s.startsWith("restaurant")) && ((b = (v = t.purchaseOrder) == null ? void 0 : v.supplier) == null ? void 0 : b.internal) === "restaurant", c = t.transferType === ye.PURCHASE, i = t.transferType === ye.TRANSFER;
|
|
1442
|
+
return c || i && !e || ((p = (m = t.purchaseOrder) == null ? void 0 : m.netSuite) == null ? void 0 : p.id) || ((n = (d = t.poRequest) == null ? void 0 : d.netSuite) == null ? void 0 : n.id);
|
|
1442
1443
|
});
|
|
1443
|
-
return (e,
|
|
1444
|
-
var n, h, S, v, m, d, s, l, b, w;
|
|
1444
|
+
return (e, c) => {
|
|
1445
1445
|
const i = W("FmMenuDivider");
|
|
1446
|
-
return
|
|
1447
|
-
o("div",
|
|
1448
|
-
|
|
1449
|
-
o("div",
|
|
1450
|
-
o("div",
|
|
1451
|
-
(
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1446
|
+
return w(a).isNetSuiteEnabled && l.value ? (g(), N("div", Rr, [
|
|
1447
|
+
o("div", Or, [
|
|
1448
|
+
c[0] || (c[0] = o("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
1449
|
+
o("div", Nr, [
|
|
1450
|
+
o("div", xr, [
|
|
1451
|
+
I(Ne, null, {
|
|
1452
|
+
default: re(() => {
|
|
1453
|
+
var s, v, b, m, p, d;
|
|
1454
|
+
return [
|
|
1455
|
+
(s = w(_).sessionUser.value) != null && s.role.isAdmin && ((b = (v = t.purchaseOrder) == null ? void 0 : v.netSuite) != null && b.id) ? (g(), ie(wr, {
|
|
1456
|
+
key: 0,
|
|
1457
|
+
"netsuite-id": (p = (m = e.purchaseOrder) == null ? void 0 : m.netSuite) == null ? void 0 : p.id,
|
|
1458
|
+
"purchase-order-id": (d = e.purchaseOrder) == null ? void 0 : d._id
|
|
1459
|
+
}, null, 8, ["netsuite-id", "purchase-order-id"])) : U("", !0)
|
|
1460
|
+
];
|
|
1461
|
+
}),
|
|
1462
|
+
_: 1
|
|
1463
|
+
}),
|
|
1464
|
+
I(Ne, null, {
|
|
1465
|
+
default: re(() => {
|
|
1466
|
+
var s, v, b, m;
|
|
1467
|
+
return [
|
|
1468
|
+
(s = w(_).sessionUser.value) != null && s.role.isAdmin ? (g(), ie(pr, {
|
|
1469
|
+
key: 0,
|
|
1470
|
+
"netsuite-id": (b = (v = e.purchaseOrder) == null ? void 0 : v.netSuite) == null ? void 0 : b.id,
|
|
1471
|
+
"purchase-order-id": (m = e.purchaseOrder) == null ? void 0 : m._id
|
|
1472
|
+
}, null, 8, ["netsuite-id", "purchase-order-id"])) : U("", !0)
|
|
1473
|
+
];
|
|
1474
|
+
}),
|
|
1475
|
+
_: 1
|
|
1476
|
+
}),
|
|
1477
|
+
I(Wt, {
|
|
1462
1478
|
"po-request": e.poRequest,
|
|
1463
1479
|
"purchase-order": e.purchaseOrder,
|
|
1464
|
-
"is-transfer-between-outlets": !
|
|
1480
|
+
"is-transfer-between-outlets": !l.value,
|
|
1465
1481
|
scope: e.scope
|
|
1466
1482
|
}, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets", "scope"])
|
|
1467
1483
|
])
|
|
1468
1484
|
])
|
|
1469
1485
|
]),
|
|
1470
|
-
|
|
1471
|
-
|
|
1486
|
+
I(i),
|
|
1487
|
+
I(fr, {
|
|
1472
1488
|
"po-request": e.poRequest,
|
|
1473
1489
|
"purchase-order": e.purchaseOrder,
|
|
1474
1490
|
"transfer-type": e.transferType,
|
|
1475
1491
|
"transfer-to-db-name": e.transferToDbName,
|
|
1476
|
-
"is-transfer-between-outlets": !
|
|
1492
|
+
"is-transfer-between-outlets": !l.value,
|
|
1477
1493
|
scope: e.scope
|
|
1478
1494
|
}, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
|
|
1479
1495
|
])) : U("", !0);
|
|
1480
1496
|
};
|
|
1481
1497
|
}
|
|
1482
|
-
}),
|
|
1498
|
+
}), Ar = { class: "flex flex-col gap-16 w-full h-full" }, Cr = { class: "flex justify-between" }, $r = { class: "fm-typo-en-body-lg-600" }, Dr = { class: "flex gap-2" }, qr = { key: 0 }, Tr = { class: "flex flex-col gap-8" }, Pr = { class: "flex flex-col gap-4" }, Ir = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fr = { class: "flex gap-1" }, Er = { class: "fm-typo-en-body-lg-600" }, Lr = {
|
|
1483
1499
|
key: 0,
|
|
1484
1500
|
class: "flex flex-col gap-4"
|
|
1485
|
-
},
|
|
1501
|
+
}, Br = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vr = { class: "fm-typo-en-body-lg-600" }, Ur = { class: "flex flex-col gap-4" }, Mr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Kr = { class: "fm-typo-en-body-lg-600" }, jr = {
|
|
1486
1502
|
key: 1,
|
|
1487
1503
|
class: "flex flex-col gap-4"
|
|
1488
|
-
},
|
|
1504
|
+
}, zr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Gr = { class: "fm-typo-en-body-lg-600" }, Hr = {
|
|
1489
1505
|
key: 2,
|
|
1490
1506
|
class: "flex flex-col gap-4"
|
|
1491
|
-
},
|
|
1507
|
+
}, Wr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yr = { class: "fm-typo-en-body-lg-600" }, Qr = {
|
|
1492
1508
|
key: 3,
|
|
1493
1509
|
class: "flex flex-col gap-4"
|
|
1494
|
-
},
|
|
1510
|
+
}, Xr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Zr = { class: "fm-typo-en-body-lg-600" }, Jr = {
|
|
1495
1511
|
key: 4,
|
|
1496
1512
|
class: "flex flex-col gap-4"
|
|
1497
|
-
},
|
|
1513
|
+
}, es = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ts = { class: "fm-typo-en-body-lg-600" }, rs = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, ss = { class: "flex flex-col gap-8" }, ns = { class: "flex gap-8 items-center" }, as = { class: "flex-1 fm-typo-en-body-lg-600" }, os = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-4" }, is = { class: "flex w-full gap-4" }, ls = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2 flex items-center gap-2" }, cs = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, us = ["innerHTML"], ds = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, fs = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, ms = {
|
|
1498
1514
|
key: 0,
|
|
1499
1515
|
class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1500
|
-
},
|
|
1516
|
+
}, ps = { class: "py-8" }, vs = { class: "flex justify-end gap-4 items-center" }, ys = { class: "fm-typo-en-body-lg-600" }, hs = {
|
|
1501
1517
|
key: 1,
|
|
1502
1518
|
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
1503
|
-
},
|
|
1519
|
+
}, bs = {
|
|
1504
1520
|
key: 0,
|
|
1505
1521
|
class: "flex flex-col items-center gap-8 h-full"
|
|
1506
|
-
},
|
|
1522
|
+
}, gs = ["src"], _s = { class: "fm-typo-en-body-lg-600" }, Ss = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, ws = {
|
|
1507
1523
|
key: 1,
|
|
1508
1524
|
class: "px-4 flex flex-col"
|
|
1509
|
-
},
|
|
1525
|
+
}, Rs = { class: "flex gap-12 content-stretch" }, Os = {
|
|
1510
1526
|
class: "flex flex-col w-24",
|
|
1511
1527
|
name: "circles"
|
|
1512
|
-
},
|
|
1528
|
+
}, Ns = { class: "flex-1 flex flex-col items-center" }, xs = { class: "flex-1 flex flex-col items-center" }, ks = {
|
|
1513
1529
|
class: "py-12 flex flex-col gap-4",
|
|
1514
1530
|
name: "received-at header"
|
|
1515
|
-
},
|
|
1531
|
+
}, As = { class: "fm-typo-en-body-lg-400" }, Cs = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, $s = { class: "flex gap-12 content-stretch" }, Ds = {
|
|
1516
1532
|
class: "flex flex-col w-24",
|
|
1517
1533
|
name: "circles"
|
|
1518
|
-
},
|
|
1534
|
+
}, qs = { class: "flex-1 flex flex-col items-center" }, Ts = {
|
|
1519
1535
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
1520
1536
|
name: "delivery details"
|
|
1521
|
-
},
|
|
1537
|
+
}, Ps = { class: "flex flex-col gap-8" }, Is = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Fs = { class: "flex flex-col gap-4" }, Es = { class: "flex gap-8 xs:flex-col" }, Xs = /* @__PURE__ */ he({
|
|
1522
1538
|
__name: "TransferDetails",
|
|
1523
1539
|
props: {
|
|
1524
1540
|
poRequest: {},
|
|
@@ -1532,32 +1548,32 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1532
1548
|
receivedMap: {}
|
|
1533
1549
|
},
|
|
1534
1550
|
emits: ["update:show", "submitted"],
|
|
1535
|
-
setup(
|
|
1536
|
-
const a =
|
|
1551
|
+
setup(y, { emit: t }) {
|
|
1552
|
+
const a = y, _ = t, l = Ye(), e = Le(), c = Ie(), i = me(), s = Ee(), v = ee(
|
|
1537
1553
|
() => {
|
|
1538
1554
|
var r, f;
|
|
1539
1555
|
return {
|
|
1540
|
-
id: ((r =
|
|
1541
|
-
name: ((f =
|
|
1556
|
+
id: ((r = s.sessionUser.value) == null ? void 0 : r.id) ?? "",
|
|
1557
|
+
name: ((f = s.sessionUser.value) == null ? void 0 : f.displayName) ?? ""
|
|
1542
1558
|
};
|
|
1543
1559
|
}
|
|
1544
|
-
),
|
|
1560
|
+
), b = Gt(), { t: m } = ft(), p = ee(
|
|
1545
1561
|
() => {
|
|
1546
|
-
var r, f, O,
|
|
1547
|
-
return ((f = (r = a.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : f.internal) === "restaurant" || ((
|
|
1562
|
+
var r, f, O, $;
|
|
1563
|
+
return ((f = (r = a.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : f.internal) === "restaurant" || (($ = (O = a.purchaseOrder) == null ? void 0 : O.supplier) == null ? void 0 : $.internal) === "warehouse" ? ye.TRANSFER : ye.PURCHASE;
|
|
1548
1564
|
}
|
|
1549
|
-
), d = G(!1),
|
|
1565
|
+
), d = G(!1), n = G(""), u = G(!0), S = Be(), R = Et(S.getWorkflowConfig), D = pt(), q = ee(() => {
|
|
1550
1566
|
if (!a.purchaseOrder)
|
|
1551
1567
|
return [];
|
|
1552
|
-
const r =
|
|
1553
|
-
if (r.state ===
|
|
1568
|
+
const r = R.result.value;
|
|
1569
|
+
if (r.state === nt.loading)
|
|
1554
1570
|
return [];
|
|
1555
1571
|
const f = {
|
|
1556
|
-
user:
|
|
1572
|
+
user: v.value,
|
|
1557
1573
|
executedAt: i.locations.computeFirst(
|
|
1558
|
-
(
|
|
1574
|
+
($) => {
|
|
1559
1575
|
var B;
|
|
1560
|
-
return
|
|
1576
|
+
return $.dbName === ((B = i._currentLocation) == null ? void 0 : B.dbName) ? $ : null;
|
|
1561
1577
|
}
|
|
1562
1578
|
),
|
|
1563
1579
|
purchaseOrderRequest: a.poRequest,
|
|
@@ -1565,77 +1581,77 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1565
1581
|
};
|
|
1566
1582
|
let O = [];
|
|
1567
1583
|
try {
|
|
1568
|
-
r.state ===
|
|
1584
|
+
r.state === nt.error ? (console.error("Error fetching workflow config:", r.error), O = Ve.getAvailableActions({
|
|
1569
1585
|
...f,
|
|
1570
|
-
orderConfig:
|
|
1586
|
+
orderConfig: Ve.getDefaultConfig()
|
|
1571
1587
|
}).actions.filter(
|
|
1572
|
-
(
|
|
1588
|
+
($) => (
|
|
1573
1589
|
// TODO: create receiveStock & processRequest dialog
|
|
1574
1590
|
// to create their payload
|
|
1575
|
-
|
|
1591
|
+
$ !== x.enum.receiveStock && $ !== x.enum.processRequest && $ !== x.enum.closeRequest
|
|
1576
1592
|
)
|
|
1577
|
-
)) : O =
|
|
1593
|
+
)) : O = Ve.getAvailableActions({
|
|
1578
1594
|
...f,
|
|
1579
1595
|
orderConfig: r.data
|
|
1580
1596
|
}).actions.filter(
|
|
1581
|
-
(
|
|
1597
|
+
($) => $ !== x.enum.receiveStock && $ !== x.enum.processRequest && $ !== x.enum.closeRequest
|
|
1582
1598
|
);
|
|
1583
|
-
} catch (
|
|
1584
|
-
console.error("Error getting available actions:",
|
|
1599
|
+
} catch ($) {
|
|
1600
|
+
console.error("Error getting available actions:", $);
|
|
1585
1601
|
}
|
|
1586
|
-
return a.scope === "approval" && (O = O.filter((
|
|
1587
|
-
}), P =
|
|
1602
|
+
return a.scope === "approval" && (O = O.filter(($) => $ !== x.enum.completeReceive)), O;
|
|
1603
|
+
}), P = Ct(a, "show"), E = ee(() => [
|
|
1588
1604
|
{
|
|
1589
|
-
label:
|
|
1605
|
+
label: m("inventory.transfer.receiveRequest.details.overview"),
|
|
1590
1606
|
value: "overview"
|
|
1591
1607
|
},
|
|
1592
1608
|
{
|
|
1593
|
-
label:
|
|
1609
|
+
label: m("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
1594
1610
|
value: "deliveryHistory"
|
|
1595
1611
|
}
|
|
1596
1612
|
]), z = G(E.value[0]);
|
|
1597
|
-
|
|
1613
|
+
Nt(
|
|
1598
1614
|
() => a.show,
|
|
1599
1615
|
(r) => {
|
|
1600
1616
|
r && (z.value = E.value[0]);
|
|
1601
1617
|
}
|
|
1602
1618
|
);
|
|
1603
|
-
async function ce(r, f, O,
|
|
1619
|
+
async function ce(r, f, O, $, B) {
|
|
1604
1620
|
return new Promise((H, Q) => {
|
|
1605
|
-
|
|
1621
|
+
l.open({
|
|
1606
1622
|
closeButton: !1,
|
|
1607
|
-
title:
|
|
1608
|
-
message:
|
|
1609
|
-
primaryActions:
|
|
1623
|
+
title: $.title,
|
|
1624
|
+
message: $.message,
|
|
1625
|
+
primaryActions: $.primaryActions,
|
|
1610
1626
|
secondaryActions: { text: "No", close: !1 }
|
|
1611
1627
|
}).onPrimary(async () => {
|
|
1612
1628
|
var V, X, Z, L;
|
|
1613
|
-
const
|
|
1614
|
-
O === x.enum.approveRequest ? (
|
|
1629
|
+
const h = [];
|
|
1630
|
+
O === x.enum.approveRequest ? (h.push({
|
|
1615
1631
|
action: "approveRequest",
|
|
1616
1632
|
payload: null
|
|
1617
|
-
}), f.fulfillment &&
|
|
1633
|
+
}), f.fulfillment && h.push({
|
|
1618
1634
|
action: "processRequest",
|
|
1619
1635
|
payload: {
|
|
1620
1636
|
fulfillmentId: "",
|
|
1621
1637
|
deliveryOrderNumber: "",
|
|
1622
1638
|
deliveryRemark: null,
|
|
1623
1639
|
items: f.fulfillment.items,
|
|
1624
|
-
createdBy:
|
|
1640
|
+
createdBy: v.value
|
|
1625
1641
|
}
|
|
1626
|
-
})) : O === x.enum.processRequest ? f.fulfillment &&
|
|
1642
|
+
})) : O === x.enum.processRequest ? f.fulfillment && h.push({
|
|
1627
1643
|
action: "processRequest",
|
|
1628
1644
|
payload: {
|
|
1629
1645
|
fulfillmentId: "",
|
|
1630
1646
|
deliveryOrderNumber: "",
|
|
1631
1647
|
deliveryRemark: null,
|
|
1632
1648
|
items: f.fulfillment.items,
|
|
1633
|
-
createdBy:
|
|
1649
|
+
createdBy: v.value
|
|
1634
1650
|
}
|
|
1635
|
-
}) : O === x.enum.rejectRequest ?
|
|
1651
|
+
}) : O === x.enum.rejectRequest ? h.push({
|
|
1636
1652
|
action: "rejectRequest",
|
|
1637
1653
|
payload: null
|
|
1638
|
-
}) : O === x.enum.closeRequest &&
|
|
1654
|
+
}) : O === x.enum.closeRequest && h.push({
|
|
1639
1655
|
action: "closeRequest",
|
|
1640
1656
|
payload: null
|
|
1641
1657
|
});
|
|
@@ -1650,61 +1666,61 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1650
1666
|
_id: ((V = a.purchaseOrder) == null ? void 0 : V._id) ?? "",
|
|
1651
1667
|
_rev: ((X = a.purchaseOrder) == null ? void 0 : X._rev) ?? "",
|
|
1652
1668
|
action: O,
|
|
1653
|
-
payloads:
|
|
1669
|
+
payloads: h
|
|
1654
1670
|
// add payload if action is receiveStock or processRequest
|
|
1655
1671
|
},
|
|
1656
1672
|
transferTo: (L = (Z = a.poRequest) == null ? void 0 : Z.to) == null ? void 0 : L.dbName
|
|
1657
1673
|
}).delayed(1e3), H("submitted");
|
|
1658
|
-
} catch (
|
|
1659
|
-
Q(
|
|
1674
|
+
} catch (se) {
|
|
1675
|
+
Q(se);
|
|
1660
1676
|
}
|
|
1661
1677
|
}).onSecondary(() => {
|
|
1662
1678
|
H("cancelled");
|
|
1663
|
-
for (let
|
|
1664
|
-
|
|
1679
|
+
for (let h = 0; h < B + 2; h++)
|
|
1680
|
+
l.close();
|
|
1665
1681
|
}).onClose(() => {
|
|
1666
1682
|
});
|
|
1667
1683
|
});
|
|
1668
1684
|
}
|
|
1669
1685
|
async function le(r) {
|
|
1670
|
-
var B, H, Q,
|
|
1686
|
+
var B, H, Q, h;
|
|
1671
1687
|
if (r === x.enum.receiveStock)
|
|
1672
1688
|
return;
|
|
1673
|
-
const f =
|
|
1689
|
+
const f = mt[r];
|
|
1674
1690
|
if (!f) {
|
|
1675
1691
|
e.open({
|
|
1676
1692
|
title: "Something went wrong",
|
|
1677
|
-
message: `Cannot process order: ${
|
|
1693
|
+
message: `Cannot process order: ${We(r)}`,
|
|
1678
1694
|
type: "error"
|
|
1679
1695
|
});
|
|
1680
1696
|
return;
|
|
1681
1697
|
}
|
|
1682
|
-
const { successMessage: O,
|
|
1698
|
+
const { successMessage: O, ...$ } = f;
|
|
1683
1699
|
if (a.purchaseOrder) {
|
|
1684
|
-
|
|
1700
|
+
n.value = `${r}`, d.value = !0, u.value = !1;
|
|
1685
1701
|
const V = {};
|
|
1686
1702
|
let X = 0;
|
|
1687
1703
|
if ((r === x.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
1688
|
-
r === x.enum.completeReceive) &&
|
|
1704
|
+
r === x.enum.completeReceive) && c.autoReceiveWarehouse)
|
|
1689
1705
|
V.autoReceive = !0;
|
|
1690
|
-
else if ((r === x.enum.approveRequest || r === x.enum.processRequest) &&
|
|
1691
|
-
const Z = (H = (B = a.poRequest) == null ? void 0 : B.from) == null ? void 0 : H.dbName, L = (
|
|
1706
|
+
else if ((r === x.enum.approveRequest || r === x.enum.processRequest) && c.acceptRequireFulfillment) {
|
|
1707
|
+
const Z = (H = (B = a.poRequest) == null ? void 0 : B.from) == null ? void 0 : H.dbName, L = (h = (Q = a.poRequest) == null ? void 0 : Q.to) == null ? void 0 : h.dbName;
|
|
1692
1708
|
if (Z && L && (Z.startsWith("warehouse_") || L.startsWith("warehouse_"))) {
|
|
1693
|
-
const
|
|
1694
|
-
|
|
1709
|
+
const se = await new Promise((K, de) => {
|
|
1710
|
+
l.open({
|
|
1695
1711
|
closeButton: !1,
|
|
1696
1712
|
title: "Confirm transfer amount",
|
|
1697
|
-
dialogComponent:
|
|
1713
|
+
dialogComponent: zt,
|
|
1698
1714
|
dialogComponentProps: {
|
|
1699
1715
|
purchaseOrder: a.purchaseOrder,
|
|
1700
1716
|
confirm: K,
|
|
1701
1717
|
"onUpdate:show": (pe) => {
|
|
1702
|
-
pe || (
|
|
1718
|
+
pe || (n.value = "", d.value = !1, u.value = !0, X++, l.close()), de("cancelled");
|
|
1703
1719
|
}
|
|
1704
1720
|
}
|
|
1705
1721
|
});
|
|
1706
1722
|
});
|
|
1707
|
-
V.fulfillment =
|
|
1723
|
+
V.fulfillment = se;
|
|
1708
1724
|
}
|
|
1709
1725
|
}
|
|
1710
1726
|
try {
|
|
@@ -1726,134 +1742,134 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1726
1742
|
type: "error"
|
|
1727
1743
|
}), console.error("Error when submitting PO operation", r, a.purchaseOrder, Z);
|
|
1728
1744
|
} finally {
|
|
1729
|
-
|
|
1745
|
+
n.value = "", d.value = !1, u.value = !0;
|
|
1730
1746
|
}
|
|
1731
1747
|
}
|
|
1732
1748
|
}
|
|
1733
1749
|
const be = ee(() => {
|
|
1734
1750
|
var r, f;
|
|
1735
1751
|
return ((r = a.purchaseOrder) == null ? void 0 : r.status) === M.enum.RECEIVING || ((f = a.purchaseOrder) == null ? void 0 : f.status) === M.enum.COMPLETE;
|
|
1736
|
-
}),
|
|
1752
|
+
}), xe = ee(() => {
|
|
1737
1753
|
const r = a.purchaseOrder;
|
|
1738
1754
|
if (!r) return { status: "", statusClass: "" };
|
|
1739
|
-
const f =
|
|
1740
|
-
let H =
|
|
1741
|
-
return B === M.enum.CLOSE && (H = `${
|
|
1755
|
+
const f = Te(r), { partial: O, over: $ } = ze(f), B = Ge(r.status, O, $);
|
|
1756
|
+
let H = m(`inventory.transfer.status.${B}`), Q = `${r.status}`.toLocaleLowerCase("en-us");
|
|
1757
|
+
return B === M.enum.CLOSE && (H = `${m(`inventory.transfer.status.${M.enum.COMPLETE}`)}`), B === "PARTIAL_RECEIVED" && Q === M.enum.PROCESSING.toLocaleLowerCase("en-us") && (Q = M.enum.RECEIVING.toLocaleLowerCase("en-us")), {
|
|
1742
1758
|
status: H,
|
|
1743
1759
|
statusClass: `fm-status-badge fm-status-badge-${Q}`
|
|
1744
1760
|
};
|
|
1745
1761
|
}), ue = ee(() => {
|
|
1746
1762
|
var H, Q;
|
|
1747
1763
|
const r = ((H = a.purchaseOrder) == null ? void 0 : H.deliveryOrder) ?? [], f = ((Q = a.purchaseOrder) == null ? void 0 : Q.deliveryFullfillment) ?? [], O = [
|
|
1748
|
-
...r.map((
|
|
1749
|
-
createdAt:
|
|
1764
|
+
...r.map((h) => ({
|
|
1765
|
+
createdAt: h.createdAt,
|
|
1750
1766
|
type: "grn",
|
|
1751
|
-
doc:
|
|
1767
|
+
doc: h
|
|
1752
1768
|
})),
|
|
1753
|
-
...f.map((
|
|
1754
|
-
createdAt:
|
|
1769
|
+
...f.map((h) => ({
|
|
1770
|
+
createdAt: h.createdAt,
|
|
1755
1771
|
type: "fulfillment",
|
|
1756
|
-
doc:
|
|
1772
|
+
doc: h
|
|
1757
1773
|
}))
|
|
1758
1774
|
];
|
|
1759
|
-
O.reverse().sort((
|
|
1760
|
-
function
|
|
1761
|
-
var Z, L,
|
|
1762
|
-
const V = f.findIndex((
|
|
1775
|
+
O.reverse().sort((h, V) => h.createdAt.localeCompare(V.createdAt));
|
|
1776
|
+
function $(h) {
|
|
1777
|
+
var Z, L, se, K, de, pe, we, Re, j;
|
|
1778
|
+
const V = f.findIndex((F) => F.id === h.fullfillmentId), X = [
|
|
1763
1779
|
(L = (Z = f[V]) == null ? void 0 : Z.netSuite) != null && L.refNo ? {
|
|
1764
1780
|
label: "Fulfillment's ref no. (Netsuite)",
|
|
1765
|
-
values: [(K = (
|
|
1781
|
+
values: [(K = (se = f[V]) == null ? void 0 : se.netSuite) == null ? void 0 : K.refNo]
|
|
1766
1782
|
} : null,
|
|
1767
|
-
(de =
|
|
1783
|
+
(de = h == null ? void 0 : h.netSuite) != null && de.refNo ? {
|
|
1768
1784
|
label: "Netsuite ref no.",
|
|
1769
|
-
values: [(pe =
|
|
1785
|
+
values: [(pe = h == null ? void 0 : h.netSuite) == null ? void 0 : pe.refNo]
|
|
1770
1786
|
} : null,
|
|
1771
|
-
(we =
|
|
1787
|
+
(we = h == null ? void 0 : h.netSuite) != null && we.recordType ? {
|
|
1772
1788
|
label: "Netsuite Type",
|
|
1773
|
-
values: [
|
|
1789
|
+
values: [ct((Re = h == null ? void 0 : h.netSuite) == null ? void 0 : Re.recordType)]
|
|
1774
1790
|
} : null
|
|
1775
1791
|
];
|
|
1776
1792
|
return {
|
|
1777
1793
|
header: "Received",
|
|
1778
|
-
date:
|
|
1794
|
+
date: Ue(new Date(h.createdAt)),
|
|
1779
1795
|
info: [
|
|
1780
1796
|
{
|
|
1781
1797
|
label: "Adjustment date",
|
|
1782
1798
|
values: [
|
|
1783
|
-
|
|
1799
|
+
h.adjustment ? Ue(new Date(wt(h.adjustment))) : "-"
|
|
1784
1800
|
]
|
|
1785
1801
|
},
|
|
1786
1802
|
{
|
|
1787
1803
|
label: "Received by",
|
|
1788
|
-
values: [(j =
|
|
1804
|
+
values: [(j = h.createdBy) == null ? void 0 : j.name]
|
|
1789
1805
|
},
|
|
1790
1806
|
{
|
|
1791
1807
|
label: "Received items",
|
|
1792
|
-
values:
|
|
1808
|
+
values: h.received.map((F) => {
|
|
1793
1809
|
var J;
|
|
1794
|
-
return
|
|
1795
|
-
|
|
1810
|
+
return C("div", [
|
|
1811
|
+
C(
|
|
1796
1812
|
"div",
|
|
1797
1813
|
{
|
|
1798
1814
|
class: "flex gap-4"
|
|
1799
1815
|
},
|
|
1800
1816
|
[
|
|
1801
|
-
|
|
1817
|
+
C(
|
|
1802
1818
|
"div",
|
|
1803
1819
|
{
|
|
1804
1820
|
class: "flex flex-col"
|
|
1805
1821
|
},
|
|
1806
1822
|
[
|
|
1807
|
-
|
|
1823
|
+
C(
|
|
1808
1824
|
"span",
|
|
1809
1825
|
{
|
|
1810
1826
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
1811
1827
|
},
|
|
1812
|
-
`${
|
|
1828
|
+
`${F.sku.name}`
|
|
1813
1829
|
),
|
|
1814
|
-
|
|
1830
|
+
C(
|
|
1815
1831
|
"span",
|
|
1816
1832
|
{
|
|
1817
1833
|
class: "fm-typo-en-body-md-400"
|
|
1818
1834
|
},
|
|
1819
|
-
`${
|
|
1835
|
+
`${F.sku.code} `
|
|
1820
1836
|
)
|
|
1821
1837
|
]
|
|
1822
1838
|
),
|
|
1823
|
-
|
|
1839
|
+
C(
|
|
1824
1840
|
"div",
|
|
1825
1841
|
{
|
|
1826
1842
|
class: "ml-auto flex flex-col"
|
|
1827
1843
|
},
|
|
1828
1844
|
[
|
|
1829
|
-
|
|
1845
|
+
C(
|
|
1830
1846
|
"div",
|
|
1831
1847
|
{
|
|
1832
1848
|
class: "ml-auto flex gap-1"
|
|
1833
1849
|
},
|
|
1834
1850
|
[
|
|
1835
|
-
|
|
1851
|
+
C(
|
|
1836
1852
|
"span",
|
|
1837
1853
|
{
|
|
1838
1854
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
1839
1855
|
},
|
|
1840
|
-
fe(
|
|
1856
|
+
fe(F.amount, !1)
|
|
1841
1857
|
),
|
|
1842
|
-
|
|
1858
|
+
C(
|
|
1843
1859
|
"span",
|
|
1844
1860
|
{
|
|
1845
1861
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1846
1862
|
},
|
|
1847
|
-
((J =
|
|
1863
|
+
((J = F.measurement) == null ? void 0 : J.abbrev) ?? F.sku.unit.abbrev
|
|
1848
1864
|
)
|
|
1849
1865
|
]
|
|
1850
1866
|
),
|
|
1851
|
-
|
|
1867
|
+
C(
|
|
1852
1868
|
"div",
|
|
1853
1869
|
{
|
|
1854
1870
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1855
1871
|
},
|
|
1856
|
-
`${
|
|
1872
|
+
`${F.cost ? `(${Ae(F.cost)})` : ""}`
|
|
1857
1873
|
)
|
|
1858
1874
|
]
|
|
1859
1875
|
)
|
|
@@ -1862,28 +1878,28 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1862
1878
|
]);
|
|
1863
1879
|
})
|
|
1864
1880
|
},
|
|
1865
|
-
|
|
1881
|
+
h.deliveryOrderNumber ? {
|
|
1866
1882
|
label: "Delivery order no.",
|
|
1867
|
-
values: [
|
|
1883
|
+
values: [h.deliveryOrderNumber]
|
|
1868
1884
|
} : null,
|
|
1869
|
-
|
|
1885
|
+
h.remark ? {
|
|
1870
1886
|
label: "Remark",
|
|
1871
|
-
values: [
|
|
1887
|
+
values: [h.remark]
|
|
1872
1888
|
} : null,
|
|
1873
1889
|
V > -1 ? {
|
|
1874
1890
|
label: "Fulfilment's sequence",
|
|
1875
1891
|
values: [`${V + 1}`]
|
|
1876
1892
|
} : null,
|
|
1877
1893
|
...X
|
|
1878
|
-
].filter((
|
|
1894
|
+
].filter((F) => F)
|
|
1879
1895
|
};
|
|
1880
1896
|
}
|
|
1881
|
-
function B(
|
|
1897
|
+
function B(h) {
|
|
1882
1898
|
var X, Z;
|
|
1883
|
-
const V = f.findIndex((L) => L.id ===
|
|
1899
|
+
const V = f.findIndex((L) => L.id === h.id);
|
|
1884
1900
|
return {
|
|
1885
1901
|
header: "Fulfillment",
|
|
1886
|
-
date:
|
|
1902
|
+
date: Ue(new Date(h.createdAt)),
|
|
1887
1903
|
info: [
|
|
1888
1904
|
{
|
|
1889
1905
|
label: "Sequence",
|
|
@@ -1891,29 +1907,29 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1891
1907
|
},
|
|
1892
1908
|
{
|
|
1893
1909
|
label: "Receiveable items",
|
|
1894
|
-
values:
|
|
1895
|
-
var
|
|
1896
|
-
return
|
|
1897
|
-
|
|
1910
|
+
values: h.items.map((L) => {
|
|
1911
|
+
var se;
|
|
1912
|
+
return C("div", [
|
|
1913
|
+
C(
|
|
1898
1914
|
"div",
|
|
1899
1915
|
{
|
|
1900
1916
|
class: "flex gap-4"
|
|
1901
1917
|
},
|
|
1902
1918
|
[
|
|
1903
|
-
|
|
1919
|
+
C(
|
|
1904
1920
|
"div",
|
|
1905
1921
|
{
|
|
1906
1922
|
class: "flex flex-col"
|
|
1907
1923
|
},
|
|
1908
1924
|
[
|
|
1909
|
-
|
|
1925
|
+
C(
|
|
1910
1926
|
"span",
|
|
1911
1927
|
{
|
|
1912
1928
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
1913
1929
|
},
|
|
1914
1930
|
`${L.sku.name}`
|
|
1915
1931
|
),
|
|
1916
|
-
|
|
1932
|
+
C(
|
|
1917
1933
|
"span",
|
|
1918
1934
|
{
|
|
1919
1935
|
class: "fm-typo-en-body-md-400"
|
|
@@ -1922,40 +1938,40 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1922
1938
|
)
|
|
1923
1939
|
]
|
|
1924
1940
|
),
|
|
1925
|
-
|
|
1941
|
+
C(
|
|
1926
1942
|
"div",
|
|
1927
1943
|
{
|
|
1928
1944
|
class: "ml-auto flex flex-col"
|
|
1929
1945
|
},
|
|
1930
1946
|
[
|
|
1931
|
-
|
|
1947
|
+
C(
|
|
1932
1948
|
"div",
|
|
1933
1949
|
{
|
|
1934
1950
|
class: "ml-auto flex gap-1"
|
|
1935
1951
|
},
|
|
1936
1952
|
[
|
|
1937
|
-
|
|
1953
|
+
C(
|
|
1938
1954
|
"span",
|
|
1939
1955
|
{
|
|
1940
1956
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
1941
1957
|
},
|
|
1942
1958
|
fe(L.amount, !1)
|
|
1943
1959
|
),
|
|
1944
|
-
|
|
1960
|
+
C(
|
|
1945
1961
|
"span",
|
|
1946
1962
|
{
|
|
1947
1963
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1948
1964
|
},
|
|
1949
|
-
((
|
|
1965
|
+
((se = L.measurement) == null ? void 0 : se.abbrev) ?? L.sku.unit.abbrev
|
|
1950
1966
|
)
|
|
1951
1967
|
]
|
|
1952
1968
|
),
|
|
1953
|
-
|
|
1969
|
+
C(
|
|
1954
1970
|
"div",
|
|
1955
1971
|
{
|
|
1956
1972
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1957
1973
|
},
|
|
1958
|
-
`${L.cost ? `(${
|
|
1974
|
+
`${L.cost ? `(${Ae(L.cost)})` : ""}`
|
|
1959
1975
|
)
|
|
1960
1976
|
]
|
|
1961
1977
|
)
|
|
@@ -1964,117 +1980,127 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
1964
1980
|
]);
|
|
1965
1981
|
})
|
|
1966
1982
|
},
|
|
1967
|
-
(X =
|
|
1983
|
+
(X = h.netSuite) != null && X.refNo ? {
|
|
1968
1984
|
label: "Ref no. (Netsuite)",
|
|
1969
|
-
values: [(Z =
|
|
1985
|
+
values: [(Z = h.netSuite) == null ? void 0 : Z.refNo]
|
|
1970
1986
|
} : null
|
|
1971
1987
|
].filter((L) => L)
|
|
1972
1988
|
};
|
|
1973
1989
|
}
|
|
1974
|
-
return O.map((
|
|
1975
|
-
switch (
|
|
1990
|
+
return O.map((h) => {
|
|
1991
|
+
switch (h.type) {
|
|
1976
1992
|
case "grn":
|
|
1977
|
-
return
|
|
1993
|
+
return $(h.doc);
|
|
1978
1994
|
case "fulfillment":
|
|
1979
|
-
return B(
|
|
1995
|
+
return B(h.doc);
|
|
1980
1996
|
}
|
|
1981
1997
|
});
|
|
1982
1998
|
}), A = ee(() => {
|
|
1983
1999
|
var f;
|
|
1984
2000
|
const r = {
|
|
1985
|
-
...
|
|
1986
|
-
currency:
|
|
2001
|
+
...it(0),
|
|
2002
|
+
currency: st()
|
|
1987
2003
|
};
|
|
1988
|
-
return ((f = a.purchaseOrder) == null ? void 0 : f.items.reduce((O,
|
|
1989
|
-
...
|
|
1990
|
-
currency:
|
|
2004
|
+
return ((f = a.purchaseOrder) == null ? void 0 : f.items.reduce((O, $) => ({
|
|
2005
|
+
...ot(O, $.totalCost ?? r),
|
|
2006
|
+
currency: st()
|
|
1991
2007
|
}), r)) ?? r;
|
|
1992
2008
|
});
|
|
1993
2009
|
function T(r) {
|
|
1994
2010
|
var H;
|
|
1995
|
-
const O = (((H = a.purchaseOrder) == null ? void 0 : H.version) ??
|
|
1996
|
-
return `<span class="${Y(r)} fm-typo-en-body-lg-600">${
|
|
2011
|
+
const O = (((H = a.purchaseOrder) == null ? void 0 : H.version) ?? Ce.enum[1]) === Ce.enum[2] ? r.id : r.sku._id, $ = a.receivedMap[O];
|
|
2012
|
+
return `<span class="${Y(r)} fm-typo-en-body-lg-600">${Rt.toFormatString({ value: $.received })}</span>/${qt(r.quantity, r.sku.unit, r.measurement)}`;
|
|
1997
2013
|
}
|
|
1998
2014
|
function Y(r) {
|
|
1999
2015
|
var V;
|
|
2000
|
-
const O = (((V = a.purchaseOrder) == null ? void 0 : V.version) ??
|
|
2001
|
-
return H ? "text-fm-color-typo-tertiary" : B ? "text-fm-color-system-warning-300" : Q ? "text-fm-color-system-error-300" :
|
|
2016
|
+
const O = (((V = a.purchaseOrder) == null ? void 0 : V.version) ?? Ce.enum[1]) === Ce.enum[2] ? r.id : r.sku._id, $ = a.receivedMap[O], { isPartialReceive: B, isNoReceive: H, isOverReceive: Q, isFullReceive: h } = Bt($);
|
|
2017
|
+
return H ? "text-fm-color-typo-tertiary" : B ? "text-fm-color-system-warning-300" : Q ? "text-fm-color-system-error-300" : h ? "text-fm-color-system-success-300" : "";
|
|
2002
2018
|
}
|
|
2003
2019
|
return (r, f) => {
|
|
2004
|
-
var L,
|
|
2005
|
-
const O = W("FmButtonGroup"),
|
|
2020
|
+
var L, se;
|
|
2021
|
+
const O = W("FmButtonGroup"), $ = W("FmChip"), B = W("FmMenuDivider"), H = W("FmCard"), Q = W("FmIcon"), h = W("FmTooltip"), V = W("FmSpacer"), X = W("FmButton"), Z = W("FmSideSheet");
|
|
2006
2022
|
return g(), ie(Z, {
|
|
2007
|
-
header:
|
|
2008
|
-
modelValue:
|
|
2009
|
-
"onUpdate:modelValue": f[5] || (f[5] = (K) =>
|
|
2010
|
-
"dismiss-away":
|
|
2023
|
+
header: w(m)("inventory.transfer.receiveRequest.details.title") + ((L = r.purchaseOrder) != null && L.seqNumber ? ` #${(se = r.purchaseOrder) == null ? void 0 : se.seqNumber}` : ""),
|
|
2024
|
+
modelValue: w(P),
|
|
2025
|
+
"onUpdate:modelValue": f[5] || (f[5] = (K) => xt(P) ? P.value = K : null),
|
|
2026
|
+
"dismiss-away": u.value,
|
|
2011
2027
|
"close-button": "",
|
|
2012
2028
|
"max-width": 600
|
|
2013
2029
|
}, {
|
|
2014
|
-
default:
|
|
2030
|
+
default: re(() => {
|
|
2015
2031
|
var K, de, pe, we, Re;
|
|
2016
2032
|
return [
|
|
2017
|
-
o("div",
|
|
2033
|
+
o("div", Ar, [
|
|
2018
2034
|
o("div", null, [
|
|
2019
|
-
|
|
2035
|
+
I(O, {
|
|
2020
2036
|
items: E.value,
|
|
2021
2037
|
modelValue: z.value,
|
|
2022
2038
|
"onUpdate:modelValue": f[0] || (f[0] = (j) => z.value = j)
|
|
2023
2039
|
}, null, 8, ["items", "modelValue"])
|
|
2024
2040
|
]),
|
|
2025
|
-
z.value.value === "overview" ? (g(), N(
|
|
2041
|
+
z.value.value === "overview" ? (g(), N(ae, { key: 0 }, [
|
|
2026
2042
|
o("div", null, [
|
|
2027
|
-
|
|
2043
|
+
I(H, {
|
|
2028
2044
|
variant: "outlined",
|
|
2029
2045
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
2030
2046
|
}, {
|
|
2031
|
-
default:
|
|
2032
|
-
var j,
|
|
2047
|
+
default: re(() => {
|
|
2048
|
+
var j, F, J, ge, _e, ke, Qe, Xe, Ze, Je;
|
|
2033
2049
|
return [
|
|
2034
|
-
o("div",
|
|
2035
|
-
o("div",
|
|
2036
|
-
o("div",
|
|
2037
|
-
(j =
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2050
|
+
o("div", Cr, [
|
|
2051
|
+
o("div", $r, k(w(m)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
2052
|
+
o("div", Dr, [
|
|
2053
|
+
(j = w(s).sessionUser.value) != null && j.role.isAdmin ? (g(), N("div", qr, [
|
|
2054
|
+
I(Ne, null, {
|
|
2055
|
+
default: re(() => {
|
|
2056
|
+
var et;
|
|
2057
|
+
return [
|
|
2058
|
+
$e(k((et = a.purchaseOrder) == null ? void 0 : et.status), 1)
|
|
2059
|
+
];
|
|
2060
|
+
}),
|
|
2061
|
+
_: 1
|
|
2062
|
+
})
|
|
2063
|
+
])) : U("", !0),
|
|
2064
|
+
I($, {
|
|
2065
|
+
label: xe.value.status,
|
|
2066
|
+
class: De(xe.value.statusClass),
|
|
2041
2067
|
compact: ""
|
|
2042
2068
|
}, null, 8, ["label", "class"])
|
|
2043
2069
|
])
|
|
2044
2070
|
]),
|
|
2045
|
-
|
|
2046
|
-
o("div",
|
|
2047
|
-
o("div",
|
|
2048
|
-
o("div",
|
|
2049
|
-
o("div",
|
|
2071
|
+
I(B),
|
|
2072
|
+
o("div", Tr, [
|
|
2073
|
+
o("div", Pr, [
|
|
2074
|
+
o("div", Ir, [
|
|
2075
|
+
o("div", Fr, k(w(m)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
2050
2076
|
]),
|
|
2051
|
-
o("div",
|
|
2077
|
+
o("div", Er, k(w(qe)(((F = r.purchaseOrder) == null ? void 0 : F._id) ?? "")), 1)
|
|
2052
2078
|
]),
|
|
2053
|
-
(
|
|
2054
|
-
o("div",
|
|
2055
|
-
o("div",
|
|
2079
|
+
(J = r.purchaseOrder) != null && J.effectiveAt ? (g(), N("div", Lr, [
|
|
2080
|
+
o("div", Br, k(w(m)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
2081
|
+
o("div", Vr, k(w(lt)(new Date((ge = r.purchaseOrder) == null ? void 0 : ge.effectiveAt))), 1)
|
|
2056
2082
|
])) : U("", !0),
|
|
2057
|
-
o("div",
|
|
2058
|
-
o("div",
|
|
2059
|
-
o("div",
|
|
2060
|
-
`inventory.transfer.receiveRequest.details.type.${
|
|
2083
|
+
o("div", Ur, [
|
|
2084
|
+
o("div", Mr, k(w(m)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
2085
|
+
o("div", Kr, k(w(m)(
|
|
2086
|
+
`inventory.transfer.receiveRequest.details.type.${p.value.toLocaleLowerCase("en-US")}`
|
|
2061
2087
|
)), 1)
|
|
2062
2088
|
]),
|
|
2063
|
-
(
|
|
2064
|
-
o("div",
|
|
2065
|
-
o("div",
|
|
2089
|
+
(ke = (_e = r.purchaseOrder) == null ? void 0 : _e.supplier) != null && ke.name ? (g(), N("div", jr, [
|
|
2090
|
+
o("div", zr, k(w(m)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
2091
|
+
o("div", Gr, k((Xe = (Qe = r.purchaseOrder) == null ? void 0 : Qe.supplier) == null ? void 0 : Xe.name), 1)
|
|
2066
2092
|
])) : U("", !0),
|
|
2067
|
-
r.transferTo ? (g(), N("div",
|
|
2068
|
-
o("div",
|
|
2069
|
-
o("div",
|
|
2093
|
+
r.transferTo ? (g(), N("div", Hr, [
|
|
2094
|
+
o("div", Wr, k(w(m)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
2095
|
+
o("div", Yr, k(r.transferTo), 1)
|
|
2070
2096
|
])) : U("", !0),
|
|
2071
|
-
(Ze = r.purchaseOrder) != null && Ze.ref ? (g(), N("div",
|
|
2072
|
-
o("div",
|
|
2073
|
-
o("div",
|
|
2097
|
+
(Ze = r.purchaseOrder) != null && Ze.ref ? (g(), N("div", Qr, [
|
|
2098
|
+
o("div", Xr, k(w(m)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
2099
|
+
o("div", Zr, k(r.purchaseOrder.ref), 1)
|
|
2074
2100
|
])) : U("", !0),
|
|
2075
|
-
(Je = r.purchaseOrder) != null && Je.remark ? (g(), N("div",
|
|
2076
|
-
o("div",
|
|
2077
|
-
o("div",
|
|
2101
|
+
(Je = r.purchaseOrder) != null && Je.remark ? (g(), N("div", Jr, [
|
|
2102
|
+
o("div", es, k(w(m)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
2103
|
+
o("div", ts, k(r.purchaseOrder.remark), 1)
|
|
2078
2104
|
])) : U("", !0)
|
|
2079
2105
|
])
|
|
2080
2106
|
];
|
|
@@ -2082,43 +2108,43 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
2082
2108
|
_: 1
|
|
2083
2109
|
})
|
|
2084
2110
|
]),
|
|
2085
|
-
|
|
2111
|
+
I(kr, {
|
|
2086
2112
|
"po-request": r.poRequest,
|
|
2087
2113
|
purchaseOrder: r.purchaseOrder,
|
|
2088
|
-
transferType:
|
|
2114
|
+
transferType: p.value,
|
|
2089
2115
|
transferToDbName: r.transferToDbName,
|
|
2090
2116
|
scope: r.scope
|
|
2091
2117
|
}, null, 8, ["po-request", "purchaseOrder", "transferType", "transferToDbName", "scope"]),
|
|
2092
|
-
o("div",
|
|
2093
|
-
o("div",
|
|
2094
|
-
o("div",
|
|
2095
|
-
o("span",
|
|
2096
|
-
|
|
2097
|
-
(de = (K = r.purchaseOrder) == null ? void 0 : K.netSuite) != null && de.missingItems && ((we = (pe = r.purchaseOrder) == null ? void 0 : pe.netSuite) == null ? void 0 : we.missingItems.length) > 0 ? (g(), ie(
|
|
2118
|
+
o("div", rs, [
|
|
2119
|
+
o("div", ss, [
|
|
2120
|
+
o("div", ns, [
|
|
2121
|
+
o("span", as, [
|
|
2122
|
+
$e(k(be.value ? w(m)("inventory.transfer.receiveRequest.details.receivedItems") : w(m)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
|
|
2123
|
+
(de = (K = r.purchaseOrder) == null ? void 0 : K.netSuite) != null && de.missingItems && ((we = (pe = r.purchaseOrder) == null ? void 0 : pe.netSuite) == null ? void 0 : we.missingItems.length) > 0 ? (g(), ie(h, {
|
|
2098
2124
|
key: 0,
|
|
2099
2125
|
variant: "rich",
|
|
2100
2126
|
placement: "top",
|
|
2101
2127
|
"z-index": 51
|
|
2102
2128
|
}, {
|
|
2103
|
-
content:
|
|
2104
|
-
var j,
|
|
2129
|
+
content: re(() => {
|
|
2130
|
+
var j, F;
|
|
2105
2131
|
return [
|
|
2106
|
-
o("div",
|
|
2107
|
-
(g(!0), N(
|
|
2132
|
+
o("div", os, [
|
|
2133
|
+
(g(!0), N(ae, null, ve((F = (j = r.purchaseOrder) == null ? void 0 : j.netSuite) == null ? void 0 : F.missingItems, (J, ge) => (g(), N("div", {
|
|
2108
2134
|
class: "flex justify-center align-middle",
|
|
2109
2135
|
key: ge
|
|
2110
2136
|
}, [
|
|
2111
|
-
|
|
2137
|
+
I(Q, {
|
|
2112
2138
|
name: "arrow_right",
|
|
2113
2139
|
size: "sm"
|
|
2114
2140
|
}),
|
|
2115
|
-
|
|
2141
|
+
$e(" " + k(`(${J.netSuiteId}) ${J.name}: ${J.reason}`), 1)
|
|
2116
2142
|
]))), 128))
|
|
2117
2143
|
])
|
|
2118
2144
|
];
|
|
2119
2145
|
}),
|
|
2120
|
-
default:
|
|
2121
|
-
|
|
2146
|
+
default: re(() => [
|
|
2147
|
+
I(Q, {
|
|
2122
2148
|
name: "error",
|
|
2123
2149
|
color: "#ff2c2c",
|
|
2124
2150
|
size: "sm"
|
|
@@ -2128,106 +2154,106 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
2128
2154
|
})) : U("", !0)
|
|
2129
2155
|
])
|
|
2130
2156
|
]),
|
|
2131
|
-
|
|
2132
|
-
(g(!0), N(
|
|
2133
|
-
var
|
|
2157
|
+
I(B),
|
|
2158
|
+
(g(!0), N(ae, null, ve(((Re = r.purchaseOrder) == null ? void 0 : Re.items) ?? [], (j) => {
|
|
2159
|
+
var F;
|
|
2134
2160
|
return g(), N("div", {
|
|
2135
2161
|
key: j.code,
|
|
2136
2162
|
class: "flex flex-col"
|
|
2137
2163
|
}, [
|
|
2138
|
-
o("div",
|
|
2139
|
-
o("div",
|
|
2140
|
-
o("div",
|
|
2164
|
+
o("div", is, [
|
|
2165
|
+
o("div", ls, k(j.name), 1),
|
|
2166
|
+
o("div", cs, [
|
|
2141
2167
|
o("span", {
|
|
2142
2168
|
innerHTML: T(j)
|
|
2143
|
-
}, null, 8,
|
|
2169
|
+
}, null, 8, us)
|
|
2144
2170
|
])
|
|
2145
2171
|
]),
|
|
2146
|
-
o("div",
|
|
2147
|
-
o("div",
|
|
2148
|
-
(
|
|
2172
|
+
o("div", ds, [
|
|
2173
|
+
o("div", fs, k(j.code), 1),
|
|
2174
|
+
(F = j.totalCost) != null && F.amount && w(c).enableTotalCost ? (g(), N("div", ms, " (" + k(w(Ae)(j.totalCost)) + ") ", 1)) : U("", !0)
|
|
2149
2175
|
])
|
|
2150
2176
|
]);
|
|
2151
2177
|
}), 128)),
|
|
2152
|
-
+
|
|
2153
|
-
o("div", ms, [
|
|
2154
|
-
F(B)
|
|
2155
|
-
]),
|
|
2178
|
+
+w(fe)(A.value) ? (g(), N(ae, { key: 0 }, [
|
|
2156
2179
|
o("div", ps, [
|
|
2180
|
+
I(B)
|
|
2181
|
+
]),
|
|
2182
|
+
o("div", vs, [
|
|
2157
2183
|
f[6] || (f[6] = o("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
|
|
2158
|
-
o("div",
|
|
2184
|
+
o("div", ys, k(w(Ae)(A.value)), 1)
|
|
2159
2185
|
])
|
|
2160
2186
|
], 64)) : U("", !0)
|
|
2161
2187
|
])
|
|
2162
2188
|
])
|
|
2163
|
-
], 64)) : z.value.value === "deliveryHistory" ? (g(), N("div",
|
|
2164
|
-
ue.value.length ? (g(), N("div",
|
|
2165
|
-
(g(!0), N(
|
|
2166
|
-
o("div",
|
|
2167
|
-
o("div",
|
|
2168
|
-
o("div",
|
|
2189
|
+
], 64)) : z.value.value === "deliveryHistory" ? (g(), N("div", hs, [
|
|
2190
|
+
ue.value.length ? (g(), N("div", ws, [
|
|
2191
|
+
(g(!0), N(ae, null, ve(ue.value, (j, F) => (g(), N(ae, { key: F }, [
|
|
2192
|
+
o("div", Rs, [
|
|
2193
|
+
o("div", Os, [
|
|
2194
|
+
o("div", Ns, [
|
|
2169
2195
|
o("div", {
|
|
2170
|
-
class:
|
|
2196
|
+
class: De([
|
|
2171
2197
|
{
|
|
2172
|
-
"bg-fm-color-primary":
|
|
2173
|
-
"bg-white":
|
|
2198
|
+
"bg-fm-color-primary": F !== 0,
|
|
2199
|
+
"bg-white": F === 0
|
|
2174
2200
|
},
|
|
2175
2201
|
"w-[2px] h-full"
|
|
2176
2202
|
])
|
|
2177
2203
|
}, null, 2)
|
|
2178
2204
|
]),
|
|
2179
2205
|
f[7] || (f[7] = o("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
2180
|
-
o("div",
|
|
2206
|
+
o("div", xs, [
|
|
2181
2207
|
o("div", {
|
|
2182
|
-
class:
|
|
2208
|
+
class: De([
|
|
2183
2209
|
{
|
|
2184
|
-
"bg-fm-color-primary":
|
|
2185
|
-
"bg-white":
|
|
2210
|
+
"bg-fm-color-primary": F < ue.value.length - 1,
|
|
2211
|
+
"bg-white": F >= ue.value.length - 1
|
|
2186
2212
|
},
|
|
2187
2213
|
"w-[2px] h-full"
|
|
2188
2214
|
])
|
|
2189
2215
|
}, null, 2)
|
|
2190
2216
|
])
|
|
2191
2217
|
]),
|
|
2192
|
-
o("div",
|
|
2193
|
-
o("div",
|
|
2194
|
-
o("div",
|
|
2218
|
+
o("div", ks, [
|
|
2219
|
+
o("div", As, k(j.header), 1),
|
|
2220
|
+
o("div", Cs, k(j.date), 1)
|
|
2195
2221
|
])
|
|
2196
2222
|
]),
|
|
2197
|
-
o("div",
|
|
2198
|
-
o("div",
|
|
2199
|
-
o("div",
|
|
2223
|
+
o("div", $s, [
|
|
2224
|
+
o("div", Ds, [
|
|
2225
|
+
o("div", qs, [
|
|
2200
2226
|
o("div", {
|
|
2201
|
-
class:
|
|
2227
|
+
class: De([
|
|
2202
2228
|
{
|
|
2203
|
-
"bg-fm-color-primary":
|
|
2204
|
-
"bg-white":
|
|
2229
|
+
"bg-fm-color-primary": F < ue.value.length - 1,
|
|
2230
|
+
"bg-white": F >= ue.value.length - 1
|
|
2205
2231
|
},
|
|
2206
2232
|
"w-[2px] h-full"
|
|
2207
2233
|
])
|
|
2208
2234
|
}, null, 2)
|
|
2209
2235
|
])
|
|
2210
2236
|
]),
|
|
2211
|
-
o("div",
|
|
2212
|
-
|
|
2237
|
+
o("div", Ts, [
|
|
2238
|
+
I(H, {
|
|
2213
2239
|
variant: "outlined",
|
|
2214
2240
|
class: "py-12 px-16"
|
|
2215
2241
|
}, {
|
|
2216
|
-
default:
|
|
2217
|
-
o("div",
|
|
2218
|
-
(g(!0), N(
|
|
2242
|
+
default: re(() => [
|
|
2243
|
+
o("div", Ps, [
|
|
2244
|
+
(g(!0), N(ae, null, ve(j.info, (J, ge) => (g(), N("div", {
|
|
2219
2245
|
key: ge,
|
|
2220
2246
|
class: "flex flex-col gap-4"
|
|
2221
2247
|
}, [
|
|
2222
|
-
o("div",
|
|
2223
|
-
o("div",
|
|
2224
|
-
(g(!0), N(
|
|
2225
|
-
key:
|
|
2248
|
+
o("div", Is, k(J == null ? void 0 : J.label), 1),
|
|
2249
|
+
o("div", Fs, [
|
|
2250
|
+
(g(!0), N(ae, null, ve(J == null ? void 0 : J.values, (_e, ke) => (g(), N("div", {
|
|
2251
|
+
key: ke,
|
|
2226
2252
|
class: "fm-typo-en-body-lg-600"
|
|
2227
2253
|
}, [
|
|
2228
|
-
typeof _e == "string" ? (g(), N(
|
|
2229
|
-
|
|
2230
|
-
], 64)) : (g(), ie(
|
|
2254
|
+
typeof _e == "string" ? (g(), N(ae, { key: 0 }, [
|
|
2255
|
+
$e(k(_e), 1)
|
|
2256
|
+
], 64)) : (g(), ie(kt(_e), { key: 1 }))
|
|
2231
2257
|
]))), 128))
|
|
2232
2258
|
])
|
|
2233
2259
|
]))), 128))
|
|
@@ -2238,58 +2264,58 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
2238
2264
|
])
|
|
2239
2265
|
])
|
|
2240
2266
|
], 64))), 128))
|
|
2241
|
-
])) : (g(), N("div",
|
|
2242
|
-
|
|
2267
|
+
])) : (g(), N("div", bs, [
|
|
2268
|
+
I(V),
|
|
2243
2269
|
o("div", null, [
|
|
2244
2270
|
o("img", {
|
|
2245
|
-
src:
|
|
2271
|
+
src: w(Tt),
|
|
2246
2272
|
alt: "List is empty"
|
|
2247
|
-
}, null, 8,
|
|
2273
|
+
}, null, 8, gs)
|
|
2248
2274
|
]),
|
|
2249
|
-
o("div",
|
|
2250
|
-
o("div",
|
|
2251
|
-
|
|
2252
|
-
|
|
2275
|
+
o("div", _s, k(w(m)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
2276
|
+
o("div", Ss, k(w(m)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
|
|
2277
|
+
I(V),
|
|
2278
|
+
I(V)
|
|
2253
2279
|
]))
|
|
2254
2280
|
])) : U("", !0)
|
|
2255
2281
|
])
|
|
2256
2282
|
];
|
|
2257
2283
|
}),
|
|
2258
|
-
"side-sheet-footer":
|
|
2259
|
-
o("div",
|
|
2260
|
-
(g(!0), N(
|
|
2261
|
-
|
|
2284
|
+
"side-sheet-footer": re(() => [
|
|
2285
|
+
o("div", Es, [
|
|
2286
|
+
(g(!0), N(ae, null, ve(q.value, (K) => (g(), N(ae, null, [
|
|
2287
|
+
w(Ke)[K].available != !1 ? (g(), ie(X, {
|
|
2262
2288
|
key: K,
|
|
2263
|
-
label:
|
|
2289
|
+
label: w(m)(w(Ke)[K].translationKey),
|
|
2264
2290
|
onClick: (de) => le(K),
|
|
2265
|
-
loading:
|
|
2266
|
-
disabled:
|
|
2267
|
-
variant:
|
|
2291
|
+
loading: n.value === K,
|
|
2292
|
+
disabled: n.value !== K && d.value,
|
|
2293
|
+
variant: w(Ke)[K].buttonVariant
|
|
2268
2294
|
}, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : U("", !0)
|
|
2269
2295
|
], 64))), 256)),
|
|
2270
|
-
|
|
2296
|
+
w(b).ableToMarkReceived(r.purchaseOrder) && !q.value.includes("completeReceive") ? (g(), ie(X, {
|
|
2271
2297
|
key: 0,
|
|
2272
|
-
label:
|
|
2298
|
+
label: w(m)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
2273
2299
|
onClick: f[1] || (f[1] = (K) => le("completeReceive")),
|
|
2274
|
-
loading:
|
|
2275
|
-
disabled:
|
|
2300
|
+
loading: n.value === "completeReceive",
|
|
2301
|
+
disabled: n.value !== "completeReceive" && d.value
|
|
2276
2302
|
}, null, 8, ["label", "loading", "disabled"])) : U("", !0),
|
|
2277
|
-
|
|
2303
|
+
w(b).ableToMarkApproved(r.purchaseOrder) && r.canApprove && !q.value.includes("approveRequest") ? (g(), ie(X, {
|
|
2278
2304
|
key: 1,
|
|
2279
|
-
label:
|
|
2305
|
+
label: w(m)("inventory.transfer.approval.actions.approveRequest"),
|
|
2280
2306
|
onClick: f[2] || (f[2] = (K) => le("approveRequest")),
|
|
2281
|
-
loading:
|
|
2282
|
-
disabled:
|
|
2307
|
+
loading: n.value === "approveRequest",
|
|
2308
|
+
disabled: n.value !== "approveRequest" && d.value
|
|
2283
2309
|
}, null, 8, ["label", "loading", "disabled"])) : U("", !0),
|
|
2284
|
-
|
|
2310
|
+
w(b).ableToCreateFulfillment(r.purchaseOrder, r.poRequest) && a.scope === "approval" ? (g(), ie(X, {
|
|
2285
2311
|
key: 2,
|
|
2286
|
-
label:
|
|
2312
|
+
label: w(m)("inventory.transfer.receiveRequest.actions.processRequest"),
|
|
2287
2313
|
onClick: f[3] || (f[3] = (K) => le("processRequest")),
|
|
2288
|
-
loading:
|
|
2289
|
-
disabled:
|
|
2314
|
+
loading: n.value === "processRequest",
|
|
2315
|
+
disabled: n.value !== "processRequest" && d.value
|
|
2290
2316
|
}, null, 8, ["label", "loading", "disabled"])) : U("", !0),
|
|
2291
|
-
|
|
2292
|
-
label:
|
|
2317
|
+
I(X, {
|
|
2318
|
+
label: w(m)("common.close"),
|
|
2293
2319
|
variant: "tertiary",
|
|
2294
2320
|
onClick: f[4] || (f[4] = (K) => _("update:show", !1))
|
|
2295
2321
|
}, null, 8, ["label"])
|
|
@@ -2301,10 +2327,10 @@ const Gt = { class: "flex flex-row-reverse" }, Ht = /* @__PURE__ */ he({
|
|
|
2301
2327
|
}
|
|
2302
2328
|
});
|
|
2303
2329
|
export {
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2330
|
+
He as P,
|
|
2331
|
+
Xs as _,
|
|
2332
|
+
Ys as a,
|
|
2333
|
+
Qs as b,
|
|
2334
|
+
Vt as g,
|
|
2335
|
+
Be as u
|
|
2310
2336
|
};
|