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