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