@feedmepos/mf-inventory-portal 0.0.25-dev.45 → 0.0.25-dev.48
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-pkjhXf9g.js → App-z3cF2vOR.js} +54 -54
- package/dist/{ApprovalView-1a_56XYs.js → ApprovalView-3TqCsant.js} +2 -2
- package/dist/{BindingsDialog-DLu9QHGD.js → BindingsDialog-p0t1BImD.js} +2 -2
- package/dist/{BindingsPicker-DXmMOIwl.js → BindingsPicker-D2O9vrb-.js} +1 -1
- package/dist/{BindingsTable-CAUD4hZv.js → BindingsTable-YiH5giKF.js} +1 -1
- package/dist/{ClosingDraftView-DdooG5iI.js → ClosingDraftView-BDtJbp0c.js} +2 -2
- package/dist/{ClosingTemplateView-BD4XHuGK.js → ClosingTemplateView-DGr_mABm.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CX6E3y7e.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C4xIw22x.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DMBch-HK.js → FmUnitInput.vue_vue_type_script_setup_true_lang-IaN8x-cZ.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Bf416BWy.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BMOWjN8z.js} +1 -1
- package/dist/{IngredientGroupView-D8dTmPiL.js → IngredientGroupView-BML9pLXL.js} +1 -1
- package/dist/{IngredientsView-BqwnH9Ae.js → IngredientsView-zBM-140W.js} +4 -4
- package/dist/{IntegrationView-B9ihVgaE.js → IntegrationView-B6N3Jk7y.js} +569 -635
- package/dist/{InventoryBindingForm-7RQ9q3SN.js → InventoryBindingForm-DPOQUN3O.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bdmd5l0w.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BnNenp5W.js} +3 -3
- package/dist/{InventoryBindingSummary-CSF2fzjd.js → InventoryBindingSummary-Cfh7oeoL.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Dv-SSF1r.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DgPktdQY.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DyDwJIAd.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CrOTsKEc.js} +1 -1
- package/dist/{PublishView-DZwVo4uk.js → PublishView-dXx1GKmb.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-CnxE4Wfw.js → PurchaseOrderPrintPreview-DZM1BPnX.js} +1 -1
- package/dist/{ReceiveRequestView-zFdXAq6L.js → ReceiveRequestView-BFSVwoeR.js} +57 -57
- package/dist/{RecipeView-C2DZ6M6k.js → RecipeView-DHCJJeQ8.js} +3 -3
- package/dist/{StockView-DFM-trvP.js → StockView-CAM7J99l.js} +2027 -1994
- package/dist/{SupplierView-DHffdoW_.js → SupplierView-DZIp5gUF.js} +4 -4
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-E9HQg9pO.js +1605 -0
- package/dist/{TransferTemplateView-CHZPysze.js → TransferTemplateView-Brenq6bs.js} +7 -7
- package/dist/{UnitView-Dk6PMBes.js → UnitView-DqgK1JS-.js} +3 -3
- package/dist/{WarehouseView-7NkgjnAg.js → WarehouseView-DKx9cqNi.js} +1 -1
- package/dist/api/netsuite.d.ts +1 -1
- package/dist/{app-1AEJE-GS.js → app-DcP9Ie47.js} +21856 -20896
- package/dist/app.js +1 -1
- package/dist/{decimal-DDfoHLmD.js → decimal-CcU8ZP9G.js} +1 -1
- package/dist/{feature-Dpqq9nbO.js → feature-CMMaH6tc.js} +1 -1
- package/dist/{format-unit-display-RiOciSmt.js → format-unit-display-j4W6e0q7.js} +2 -2
- package/dist/index-BI7obD5h.js +77 -0
- package/dist/index-BgDKu-m1.js +12197 -0
- package/dist/{stock-Dulvtkjj.js → stock-BbT0pmws.js} +1 -1
- package/dist/stores/integration/index.d.ts +1 -0
- package/dist/stores/integration/netsuite.d.ts +1 -1
- package/dist/stores/inventory.d.ts +6 -0
- package/dist/stores/stock.d.ts +5 -0
- package/dist/stores/warehouse.d.ts +4 -7
- package/dist/{supplier-DAIl-nmu.js → supplier-D3UdV0GZ.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-C5P_xPWH.js → use-ingredient-select-dialog-nEfqry__.js} +1 -1
- package/dist/{use-inventory-binding-dialog-DrwdGL7H.js → use-inventory-binding-dialog-DmHGIstk.js} +1 -1
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +18 -16
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +2 -2
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +4 -4
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +1 -1
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +30 -24
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +30 -24
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +1 -1
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +12 -12
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +12 -12
- package/dist/views/transfer-template/composables/useTransferTemplateHelper.d.ts +3 -3
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +8 -14
- package/dist/{vue-i18n-uuPt2QY7.js → vue-i18n-BIOqWBa0.js} +359 -359
- package/package.json +2 -2
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DseAaTbl.js +0 -1615
- package/dist/index-CKWrNwz7.js +0 -35546
|
@@ -1,1615 +0,0 @@
|
|
|
1
|
-
import { W as Ye, u as Re, aL as N, a5 as Xe, a7 as Je, a8 as Ze, aM as et, d as Ue, e as je, au as F, T as Ve, aN as tt, Y as xe, K as _e, i as me, aO as Ke, ac as Se, f as Le, D as Q, h as V, b as Ge, a6 as rt, ar as Be, a0 as be, ai as Me } from "./app-1AEJE-GS.js";
|
|
2
|
-
import { ref as G, computed as W, h as x, defineComponent as De, onMounted as st, unref as u, openBlock as v, createElementBlock as w, createElementVNode as s, toDisplayString as _, createCommentVNode as A, resolveComponent as re, createVNode as K, watch as at, createBlock as Z, isRef as nt, withCtx as ue, Fragment as ae, normalizeClass as ge, createTextVNode as we, renderList as ve, resolveDynamicComponent as ot } from "vue";
|
|
3
|
-
import { F as lt } from "./decimal-DDfoHLmD.js";
|
|
4
|
-
import { b as ct, u as it, f as He, P as le } from "./format-unit-display-RiOciSmt.js";
|
|
5
|
-
import { useI18n as ze } from "@feedmepos/mf-common";
|
|
6
|
-
import { E as ut } from "./empty-placeholder-wf6-BWE8.js";
|
|
7
|
-
import { useDialog as Ae, useSnackbar as ke, useProxiedModel as dt } from "@feedmepos/ui-library";
|
|
8
|
-
import { u as Te } from "./feature-Dpqq9nbO.js";
|
|
9
|
-
const $e = Ye((m, d) => {
|
|
10
|
-
const n = Re();
|
|
11
|
-
return {
|
|
12
|
-
async readRequests(i) {
|
|
13
|
-
const h = i ?? n.currentLocationDBName, g = `${m.inventoryBackendUrl}/${h}/purchase-request`;
|
|
14
|
-
return await d.get(g);
|
|
15
|
-
},
|
|
16
|
-
async getPurchaseOrders({
|
|
17
|
-
start: i,
|
|
18
|
-
end: h
|
|
19
|
-
}) {
|
|
20
|
-
const g = n.currentLocationDBName, k = `${m.inventoryBackendUrl}/${g}/purchase-order`;
|
|
21
|
-
return await d.get(`${k}?start=${i}&end=${h}`);
|
|
22
|
-
},
|
|
23
|
-
async getLatestPurchaseOrderRequest(i) {
|
|
24
|
-
const h = n.currentLocationDBName, g = `${m.inventoryBackendUrl}/${h}/purchase-request/find-by-purchase-order-id`;
|
|
25
|
-
return await d.get(`${g}/${i}`);
|
|
26
|
-
},
|
|
27
|
-
async getPurchaseOrderById(i) {
|
|
28
|
-
const h = n.currentLocationDBName, g = `${m.inventoryBackendUrl}/${h}/purchase-order`;
|
|
29
|
-
return await d.get(`${g}/${i}`);
|
|
30
|
-
},
|
|
31
|
-
async processPurchaseOrder(i, h) {
|
|
32
|
-
const g = `${n.currentLocation.dbName} ${n.currentLocation.name}`;
|
|
33
|
-
console.log(`${g}: using legacy operate v1`);
|
|
34
|
-
const k = n.currentLocationDBName, f = h || k, c = `${m.inventoryBackendUrl}/${f}/purchase-order/run-operation`;
|
|
35
|
-
return await d.put(c, i);
|
|
36
|
-
},
|
|
37
|
-
async processPurchaseOrderV2(i, h) {
|
|
38
|
-
const g = `${n.currentLocation.dbName} ${n.currentLocation.name}`;
|
|
39
|
-
console.log(`${g}: using new operate v2`);
|
|
40
|
-
const k = n.currentLocationDBName, f = h || k, c = `${m.inventoryBackendUrl}/${f}/purchase-order/run-operation/v2`;
|
|
41
|
-
return await d.put(c, i);
|
|
42
|
-
},
|
|
43
|
-
async createPurchaseOrder(i) {
|
|
44
|
-
const h = n.currentLocationDBName, g = `${m.inventoryBackendUrl}/${h}/purchase-order`;
|
|
45
|
-
return await d.post(g, i);
|
|
46
|
-
},
|
|
47
|
-
async updatePurchaseOrder(i) {
|
|
48
|
-
const h = n.currentLocationDBName, g = `${m.inventoryBackendUrl}/${h}/purchase-order`;
|
|
49
|
-
return await d.put(g, i);
|
|
50
|
-
},
|
|
51
|
-
async importFromXilnex(i) {
|
|
52
|
-
const h = n.currentLocationDBName, g = `${m.inventoryBackendUrl}/${h}/purchase-order/import-from-xilnex`;
|
|
53
|
-
return await d.post(g, i);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}), Qe = {
|
|
57
|
-
[N.enum.confirmDraft]: {
|
|
58
|
-
primaryActions: {
|
|
59
|
-
text: "Confirm draft",
|
|
60
|
-
close: !0
|
|
61
|
-
},
|
|
62
|
-
title: "Confirm draft?",
|
|
63
|
-
message: "Purchase order cannot be changed after confirm draft.",
|
|
64
|
-
successMessage: "Purchase order draft has been confirmed"
|
|
65
|
-
},
|
|
66
|
-
[N.enum.cancelDraft]: {
|
|
67
|
-
primaryActions: {
|
|
68
|
-
text: "Cancel draft",
|
|
69
|
-
close: !0,
|
|
70
|
-
variant: "destructive"
|
|
71
|
-
},
|
|
72
|
-
title: "Cancel draft?",
|
|
73
|
-
message: "Purchase order cannot be changed after cancelled draft.",
|
|
74
|
-
successMessage: "Purchase order draft has been cancelled"
|
|
75
|
-
},
|
|
76
|
-
[N.enum.submitRequest]: {
|
|
77
|
-
primaryActions: {
|
|
78
|
-
text: "Submit request",
|
|
79
|
-
close: !0
|
|
80
|
-
},
|
|
81
|
-
title: "Confirm draft?",
|
|
82
|
-
message: "Purchase order cannot be changed after confirm draft.",
|
|
83
|
-
successMessage: "Purchase order draft has been submitted"
|
|
84
|
-
},
|
|
85
|
-
[N.enum.completeReceive]: {
|
|
86
|
-
primaryActions: {
|
|
87
|
-
text: "Mark received",
|
|
88
|
-
close: !0
|
|
89
|
-
},
|
|
90
|
-
title: "Mark as received",
|
|
91
|
-
message: "Purchase order cannot be changed after it has complete receiving.",
|
|
92
|
-
successMessage: "Purchase order has been marked as received"
|
|
93
|
-
},
|
|
94
|
-
[N.enum.approveRequest]: {
|
|
95
|
-
primaryActions: {
|
|
96
|
-
text: "Approve request",
|
|
97
|
-
close: !0
|
|
98
|
-
},
|
|
99
|
-
title: "Approve request?",
|
|
100
|
-
message: "Purchase order will be approved.",
|
|
101
|
-
successMessage: "Purchase order has been approved"
|
|
102
|
-
},
|
|
103
|
-
[N.enum.rejectRequest]: {
|
|
104
|
-
primaryActions: {
|
|
105
|
-
text: "Reject request",
|
|
106
|
-
close: !0,
|
|
107
|
-
variant: "destructive"
|
|
108
|
-
},
|
|
109
|
-
title: "Reject request?",
|
|
110
|
-
message: "Purchase order will be rejected.",
|
|
111
|
-
successMessage: "Purchase order has been rejected"
|
|
112
|
-
}
|
|
113
|
-
}, We = () => {
|
|
114
|
-
const m = Te(), d = $e();
|
|
115
|
-
return (n) => m.enablePoOperateV2 ? d.processPurchaseOrderV2(
|
|
116
|
-
{
|
|
117
|
-
operation: n.operation,
|
|
118
|
-
purchaseOrderId: n.purchaseOrder._id,
|
|
119
|
-
purchaseOrderRev: n.purchaseOrder._rev,
|
|
120
|
-
payload: Object.values(n.payloadV2).find((i) => i)
|
|
121
|
-
},
|
|
122
|
-
n.dbName
|
|
123
|
-
) : d.processPurchaseOrder(
|
|
124
|
-
{
|
|
125
|
-
operation: n.operation,
|
|
126
|
-
...n.payloadV1
|
|
127
|
-
},
|
|
128
|
-
n.dbName
|
|
129
|
-
);
|
|
130
|
-
};
|
|
131
|
-
var Ne = /* @__PURE__ */ ((m) => (m.RECEIVE_REQUEST = "receive/request", m.APPROVAL = "approval", m))(Ne || {});
|
|
132
|
-
const ye = G(), Oe = G();
|
|
133
|
-
function Xr(m, d) {
|
|
134
|
-
const n = Ae(), i = Re(), h = Te(), g = ct(), k = it(), f = G(!1), c = ke(), e = $e(), o = G(new Array()), a = G(
|
|
135
|
-
d != null && d.startDate && (d != null && d.endDate) ? d : Xe()
|
|
136
|
-
), y = We(), O = W(() => {
|
|
137
|
-
const p = new Date(a.value.startDate), t = new Date(a.value.endDate);
|
|
138
|
-
return {
|
|
139
|
-
start: Je(p).toISOString(),
|
|
140
|
-
end: Ze(t).toISOString()
|
|
141
|
-
};
|
|
142
|
-
}), T = G(new Array()), E = et(), H = G(null);
|
|
143
|
-
async function Y(p) {
|
|
144
|
-
function t(S) {
|
|
145
|
-
const P = {
|
|
146
|
-
mode: Ue.CREATE,
|
|
147
|
-
modelValue: p || void 0,
|
|
148
|
-
show: !0,
|
|
149
|
-
"onUpdate:show"(R) {
|
|
150
|
-
ye.value.show = R;
|
|
151
|
-
},
|
|
152
|
-
templateId: S,
|
|
153
|
-
lastClosingDate: H.value
|
|
154
|
-
};
|
|
155
|
-
ye.value = P;
|
|
156
|
-
}
|
|
157
|
-
let b;
|
|
158
|
-
h.mustUsePoTemplate && !(p != null && p.template) ? n.open({
|
|
159
|
-
title: "Create transfer",
|
|
160
|
-
message: "",
|
|
161
|
-
primaryActions: {
|
|
162
|
-
text: "Select a template",
|
|
163
|
-
close: !0
|
|
164
|
-
},
|
|
165
|
-
secondaryActions: {
|
|
166
|
-
text: "Outlet to Outlet",
|
|
167
|
-
variant: "secondary",
|
|
168
|
-
close: !0
|
|
169
|
-
}
|
|
170
|
-
}).onPrimary(async () => {
|
|
171
|
-
b = await g.getTemplateId(), b && t(b);
|
|
172
|
-
}).onSecondary(() => {
|
|
173
|
-
t(void 0);
|
|
174
|
-
}) : t(b);
|
|
175
|
-
}
|
|
176
|
-
function I(p) {
|
|
177
|
-
const t = {
|
|
178
|
-
mode: Ue.UPDATE,
|
|
179
|
-
modelValue: je(p),
|
|
180
|
-
show: !0,
|
|
181
|
-
"onUpdate:show"(b) {
|
|
182
|
-
ye.value.show = b;
|
|
183
|
-
},
|
|
184
|
-
lastClosingDate: H.value
|
|
185
|
-
};
|
|
186
|
-
ye.value = t;
|
|
187
|
-
}
|
|
188
|
-
async function J() {
|
|
189
|
-
o.value = [], f.value = !0;
|
|
190
|
-
try {
|
|
191
|
-
o.value = await e.getPurchaseOrders(O.value).then((b) => b.sort((S, P) => P._id.localeCompare(S._id)));
|
|
192
|
-
const p = await E.readLastClosing(!0), t = p == null ? void 0 : p._id;
|
|
193
|
-
t && (H.value = tt(t)), h.mustUsePoTemplate && await k.fetchTemplates();
|
|
194
|
-
} catch {
|
|
195
|
-
c.open({
|
|
196
|
-
title: "Something went wrong",
|
|
197
|
-
message: "Error at fetching purchase orders",
|
|
198
|
-
type: "error"
|
|
199
|
-
});
|
|
200
|
-
} finally {
|
|
201
|
-
f.value = !1;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
async function se() {
|
|
205
|
-
T.value = [], f.value = !0;
|
|
206
|
-
try {
|
|
207
|
-
T.value = await e.readRequests().then((p) => p.reverse());
|
|
208
|
-
} catch {
|
|
209
|
-
c.open({
|
|
210
|
-
title: "Something went wrong",
|
|
211
|
-
message: "Error at fetching purchase requests",
|
|
212
|
-
type: "error"
|
|
213
|
-
});
|
|
214
|
-
} finally {
|
|
215
|
-
f.value = !1;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
function B() {
|
|
219
|
-
switch (m) {
|
|
220
|
-
case "receive/request":
|
|
221
|
-
return J();
|
|
222
|
-
case "approval":
|
|
223
|
-
return se();
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
function ce(p, t) {
|
|
227
|
-
a.value = {
|
|
228
|
-
startDate: p,
|
|
229
|
-
endDate: t
|
|
230
|
-
}, B();
|
|
231
|
-
}
|
|
232
|
-
i.watchLocation(async (p) => {
|
|
233
|
-
if (!p) {
|
|
234
|
-
o.value = [];
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
await B();
|
|
238
|
-
});
|
|
239
|
-
const r = G(), l = G(Math.random().toString());
|
|
240
|
-
async function q(p, t) {
|
|
241
|
-
var R, M;
|
|
242
|
-
const b = Math.random().toString();
|
|
243
|
-
l.value = b;
|
|
244
|
-
const S = m === "receive/request" ? i.currentLocation : t == null ? void 0 : t.to, P = {
|
|
245
|
-
poRequest: t,
|
|
246
|
-
purchaseOrder: p,
|
|
247
|
-
transferTo: S == null ? void 0 : S.name,
|
|
248
|
-
transferToDbName: S == null ? void 0 : S.dbName,
|
|
249
|
-
show: !0,
|
|
250
|
-
canResubmit: !1,
|
|
251
|
-
canApprove: m === "approval",
|
|
252
|
-
"onUpdate:show"(U) {
|
|
253
|
-
r.value.show = U;
|
|
254
|
-
},
|
|
255
|
-
scope: m
|
|
256
|
-
};
|
|
257
|
-
if (r.value = P, !(t || p.status !== F.enum.REQUESTING)) {
|
|
258
|
-
try {
|
|
259
|
-
t = (await e.readRequests(
|
|
260
|
-
`${p.supplier.internal}_${p.supplier._id}`
|
|
261
|
-
)).find((X) => X.purchaseOrderId === p._id);
|
|
262
|
-
} catch {
|
|
263
|
-
console.error("Error at fetching po request to check");
|
|
264
|
-
}
|
|
265
|
-
b === l.value && (r.value.canResubmit = !t, r.value.transferTo = (R = t == null ? void 0 : t.to) == null ? void 0 : R.name, r.value.transferToDbName = (M = t == null ? void 0 : t.to) == null ? void 0 : M.dbName);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
async function $(p, t, b, S) {
|
|
269
|
-
f.value = !0;
|
|
270
|
-
try {
|
|
271
|
-
await y({
|
|
272
|
-
operation: t,
|
|
273
|
-
purchaseOrder: p,
|
|
274
|
-
payloadV2: {
|
|
275
|
-
confirmDraft: t === "confirmDraft" ? {
|
|
276
|
-
warehouseAutoReceive: h.autoReceiveWarehouse
|
|
277
|
-
} : void 0,
|
|
278
|
-
completeReceive: t === "completeReceive" ? {
|
|
279
|
-
warehouseAutoReceive: h.autoReceiveWarehouse
|
|
280
|
-
} : void 0,
|
|
281
|
-
submitRequest: t === "submitRequest" ? {
|
|
282
|
-
requestId: ""
|
|
283
|
-
// will be populated in backend
|
|
284
|
-
} : void 0
|
|
285
|
-
},
|
|
286
|
-
payloadV1: {
|
|
287
|
-
doc: p,
|
|
288
|
-
options: (
|
|
289
|
-
// auto receive for supplier to warehouse
|
|
290
|
-
(t === N.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
291
|
-
t === N.enum.completeReceive) && h.autoReceiveWarehouse ? {
|
|
292
|
-
autoReceive: !0
|
|
293
|
-
} : void 0
|
|
294
|
-
)
|
|
295
|
-
},
|
|
296
|
-
dbName: S
|
|
297
|
-
}), await new Promise((M) => setTimeout(M, 1e3));
|
|
298
|
-
const R = Re().currentLocationDBName.startsWith("restaurant_");
|
|
299
|
-
t === N.enum.confirmDraft && p.effectiveAt && R ? c.open({
|
|
300
|
-
title: "Success",
|
|
301
|
-
message: `${b}. The backdate will be reflected once your POS has received this change.`,
|
|
302
|
-
type: "success"
|
|
303
|
-
}) : c.open({
|
|
304
|
-
title: "Success",
|
|
305
|
-
message: b,
|
|
306
|
-
type: "success"
|
|
307
|
-
});
|
|
308
|
-
} catch (P) {
|
|
309
|
-
c.open({
|
|
310
|
-
title: "Something went wrong",
|
|
311
|
-
message: "Please try again.",
|
|
312
|
-
type: "error"
|
|
313
|
-
}), console.error("Error when submitting PO operation", t, p, P);
|
|
314
|
-
} finally {
|
|
315
|
-
f.value = !1, B();
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
async function ee(p, t, b) {
|
|
319
|
-
const S = Qe[t];
|
|
320
|
-
if (!S) {
|
|
321
|
-
c.open({
|
|
322
|
-
title: "Something went wrong",
|
|
323
|
-
message: `Cannot process order: ${Ve(t)}`,
|
|
324
|
-
type: "error"
|
|
325
|
-
});
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
const { successMessage: P, ...R } = S;
|
|
329
|
-
n.open({
|
|
330
|
-
title: R.title,
|
|
331
|
-
message: R.message,
|
|
332
|
-
primaryActions: R.primaryActions
|
|
333
|
-
}).onPrimary(() => {
|
|
334
|
-
$(p, t, P, b);
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
async function te() {
|
|
338
|
-
n.open({
|
|
339
|
-
title: "Upload Transfer",
|
|
340
|
-
primaryActions: {
|
|
341
|
-
text: "Xilnex transfer note",
|
|
342
|
-
close: !0
|
|
343
|
-
},
|
|
344
|
-
secondaryActions: {
|
|
345
|
-
text: "Cancel",
|
|
346
|
-
close: !0
|
|
347
|
-
}
|
|
348
|
-
}).onPrimary(() => {
|
|
349
|
-
const p = {
|
|
350
|
-
show: !0,
|
|
351
|
-
"onUpdate:show"(t) {
|
|
352
|
-
Oe.value.show = t;
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
Oe.value = p;
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
return {
|
|
359
|
-
purchaseOrders: o,
|
|
360
|
-
purchaseRequests: T,
|
|
361
|
-
updateDateRange: ce,
|
|
362
|
-
fetchData: B,
|
|
363
|
-
loading: f,
|
|
364
|
-
transferDialogProps: ye,
|
|
365
|
-
promptCreateTransferDialog: Y,
|
|
366
|
-
promptUpdateTransferDialog: I,
|
|
367
|
-
transferDetailsProps: r,
|
|
368
|
-
promptShowTransferDetails: q,
|
|
369
|
-
submitAction: ee,
|
|
370
|
-
xilnexImportDialogProps: Oe,
|
|
371
|
-
promptUploadTransferDialog: te
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
function mt(m, d) {
|
|
375
|
-
return d.reduce(
|
|
376
|
-
(i, h) => {
|
|
377
|
-
const g = h.received.find((k) => k.sku._id === m._id);
|
|
378
|
-
return g && (i = xe(i, g.amount)), i;
|
|
379
|
-
},
|
|
380
|
-
lt.toPrecision(_e(0), m.unit.precision)
|
|
381
|
-
);
|
|
382
|
-
}
|
|
383
|
-
function ft(m, d) {
|
|
384
|
-
const { name: n, address: i, regNo: h } = d.doc.profile, g = {
|
|
385
|
-
name: n,
|
|
386
|
-
registrationNumber: h,
|
|
387
|
-
line1: i == null ? void 0 : i.line1,
|
|
388
|
-
line2: i == null ? void 0 : i.line2,
|
|
389
|
-
postcode: i == null ? void 0 : i.postcode,
|
|
390
|
-
city: i == null ? void 0 : i.city,
|
|
391
|
-
state: i == null ? void 0 : i.state,
|
|
392
|
-
country: i == null ? void 0 : i.country
|
|
393
|
-
}, k = {
|
|
394
|
-
name: m.supplier.name,
|
|
395
|
-
registrationNumber: m.supplier.registrationNumber,
|
|
396
|
-
line1: m.supplier.address.line1,
|
|
397
|
-
line2: m.supplier.address.line2,
|
|
398
|
-
postcode: m.supplier.address.postcode,
|
|
399
|
-
city: m.supplier.address.city,
|
|
400
|
-
state: m.supplier.address.state,
|
|
401
|
-
country: m.supplier.address.country
|
|
402
|
-
}, f = m.items.map((a) => {
|
|
403
|
-
const { sku: y, measurement: O } = a, T = me(
|
|
404
|
-
mt(a.sku, m.deliveryOrder || []),
|
|
405
|
-
!1
|
|
406
|
-
);
|
|
407
|
-
return {
|
|
408
|
-
code: y.code,
|
|
409
|
-
description: y.name,
|
|
410
|
-
quantity: He(a.quantity, y.unit, a.measurement),
|
|
411
|
-
unit: (O == null ? void 0 : O.abbrev) || y.unit.abbrev,
|
|
412
|
-
received: T
|
|
413
|
-
};
|
|
414
|
-
}), c = m.deliveryOrder.map((a) => ({
|
|
415
|
-
createdAt: Ke(new Date(a.createdAt)),
|
|
416
|
-
ref: a.deliveryOrderNumber,
|
|
417
|
-
remark: a.remark || "",
|
|
418
|
-
items: a.received.map((y) => {
|
|
419
|
-
var O;
|
|
420
|
-
return {
|
|
421
|
-
code: y.sku.code,
|
|
422
|
-
description: y.sku.name,
|
|
423
|
-
quantity: me(y.amount),
|
|
424
|
-
unit: ((O = y.measurement) == null ? void 0 : O.abbrev) || y.sku.unit.abbrev
|
|
425
|
-
};
|
|
426
|
-
})
|
|
427
|
-
})), e = {
|
|
428
|
-
orderNumber: m.seqNumber.toString(),
|
|
429
|
-
createdAt: Se(m._id),
|
|
430
|
-
ref: m.ref || "",
|
|
431
|
-
remark: m.remark || "",
|
|
432
|
-
buyer: g,
|
|
433
|
-
supplier: k,
|
|
434
|
-
items: f,
|
|
435
|
-
status: m.status,
|
|
436
|
-
deliveryOrders: c
|
|
437
|
-
}, o = new URL(window.location.href);
|
|
438
|
-
o.pathname = o.hostname.includes("inventory.feedme") ? "/receive-request/print-preview" : "/inventory/receive-request/print-preview", o.searchParams.append("data", JSON.stringify(e)), window.open(o.href, "_blank", "noreferrer");
|
|
439
|
-
}
|
|
440
|
-
const de = {
|
|
441
|
-
submitRequest: {
|
|
442
|
-
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
443
|
-
color: "text-fm-color-typo-primary",
|
|
444
|
-
value: N.enum.submitRequest
|
|
445
|
-
},
|
|
446
|
-
confirmDraft: {
|
|
447
|
-
translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
|
|
448
|
-
color: "text-fm-color-typo-primary",
|
|
449
|
-
value: N.enum.confirmDraft
|
|
450
|
-
},
|
|
451
|
-
cancelDraft: {
|
|
452
|
-
translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
|
|
453
|
-
color: "text-fm-color-typo-error",
|
|
454
|
-
value: N.enum.cancelDraft
|
|
455
|
-
},
|
|
456
|
-
approveRequest: {
|
|
457
|
-
translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
|
|
458
|
-
color: "text-fm-color-typo-primary",
|
|
459
|
-
value: N.enum.approveRequest
|
|
460
|
-
},
|
|
461
|
-
rejectRequest: {
|
|
462
|
-
translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
|
|
463
|
-
color: "text-fm-color-typo-error",
|
|
464
|
-
value: N.enum.rejectRequest
|
|
465
|
-
},
|
|
466
|
-
processRequest: {
|
|
467
|
-
translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
|
|
468
|
-
color: "text-fm-color-typo-primary",
|
|
469
|
-
value: N.enum.processRequest
|
|
470
|
-
},
|
|
471
|
-
receiveStock: {
|
|
472
|
-
translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
|
|
473
|
-
color: "text-fm-color-typo-primary",
|
|
474
|
-
value: N.enum.receiveStock
|
|
475
|
-
},
|
|
476
|
-
completeReceive: {
|
|
477
|
-
translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
|
|
478
|
-
color: "text-fm-color-typo-primary",
|
|
479
|
-
value: N.enum.completeReceive
|
|
480
|
-
}
|
|
481
|
-
};
|
|
482
|
-
function Jr(m, d) {
|
|
483
|
-
const { t: n } = ze();
|
|
484
|
-
function i(e) {
|
|
485
|
-
switch (e.status) {
|
|
486
|
-
case "DRAFT":
|
|
487
|
-
return [
|
|
488
|
-
Q[V.Update],
|
|
489
|
-
Q[V.Details],
|
|
490
|
-
e.supplier.internal === "restaurant" || e.supplier.internal === "warehouse" ? de[N.enum.submitRequest] : de[N.enum.confirmDraft],
|
|
491
|
-
de[N.enum.cancelDraft],
|
|
492
|
-
Q[V.Print]
|
|
493
|
-
];
|
|
494
|
-
case "RECEIVING":
|
|
495
|
-
return [
|
|
496
|
-
de[N.enum.completeReceive],
|
|
497
|
-
Q[V.Details],
|
|
498
|
-
Q[V.Print]
|
|
499
|
-
];
|
|
500
|
-
case "REQUESTING":
|
|
501
|
-
return m === "receive/request" ? [Q[V.Details], Q[V.Print]] : [
|
|
502
|
-
de[N.enum.approveRequest],
|
|
503
|
-
de[N.enum.rejectRequest],
|
|
504
|
-
Q[V.Details],
|
|
505
|
-
Q[V.Print]
|
|
506
|
-
];
|
|
507
|
-
case "PROCESSING":
|
|
508
|
-
return [Q[V.Details], Q[V.Print]];
|
|
509
|
-
case "COMPLETE":
|
|
510
|
-
case "CANCEL":
|
|
511
|
-
default:
|
|
512
|
-
return [Q[V.Details], Q[V.Print]];
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
function h(e) {
|
|
516
|
-
return Object.values(N.enum).includes(e);
|
|
517
|
-
}
|
|
518
|
-
async function g(e, o, a) {
|
|
519
|
-
var O, T, E, H, Y, I;
|
|
520
|
-
const y = je(o);
|
|
521
|
-
if (e === V.Print) {
|
|
522
|
-
const J = (a == null ? void 0 : a.toInventoryLocation) ?? {
|
|
523
|
-
name: "",
|
|
524
|
-
type: "restaurant",
|
|
525
|
-
acceptRequest: !0,
|
|
526
|
-
dbName: "",
|
|
527
|
-
doc: {
|
|
528
|
-
_id: "",
|
|
529
|
-
businessId: "",
|
|
530
|
-
profile: {}
|
|
531
|
-
}
|
|
532
|
-
}, se = `${((O = a == null ? void 0 : a.netSuite) == null ? void 0 : O.id) ?? ""} ${((T = a == null ? void 0 : a.netSuite) == null ? void 0 : T.refNo) ?? ""}`.trim() || `${((E = y.netSuite) == null ? void 0 : E.id) ?? ""} ${((H = y.netSuite) == null ? void 0 : H.refNo) ?? ""}`.trim();
|
|
533
|
-
y.ref = [se ? `Netsuite: (${se})` : "", y.ref].filter((B) => B).join(" "), ft(y, J);
|
|
534
|
-
return;
|
|
535
|
-
}
|
|
536
|
-
if (e === V.Details) {
|
|
537
|
-
d.promptShowTransferDetails(y, a);
|
|
538
|
-
return;
|
|
539
|
-
}
|
|
540
|
-
if (e === V.Update) {
|
|
541
|
-
(Y = d.promptUpdateTransferDialog) == null || Y.call(d, y);
|
|
542
|
-
return;
|
|
543
|
-
}
|
|
544
|
-
if (h(e)) {
|
|
545
|
-
d.submitAction(o, e, (I = a == null ? void 0 : a.to) == null ? void 0 : I.dbName);
|
|
546
|
-
return;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
function k() {
|
|
550
|
-
return [
|
|
551
|
-
{
|
|
552
|
-
accessorKey: "seqNumber",
|
|
553
|
-
header: () => n("inventory.transfer.table.seqNo"),
|
|
554
|
-
enableSorting: !0,
|
|
555
|
-
size: 80,
|
|
556
|
-
sortUndefined: "last"
|
|
557
|
-
},
|
|
558
|
-
{
|
|
559
|
-
accessorKey: "_id",
|
|
560
|
-
header: () => n("inventory.transfer.table.createdAt"),
|
|
561
|
-
cell(e) {
|
|
562
|
-
return Se(`${e.getValue()}`);
|
|
563
|
-
},
|
|
564
|
-
enableSorting: !0
|
|
565
|
-
},
|
|
566
|
-
{
|
|
567
|
-
accessorKey: "supplier.name",
|
|
568
|
-
header: () => n("inventory.transfer.table.transferFrom"),
|
|
569
|
-
enableSorting: !0,
|
|
570
|
-
size: 200
|
|
571
|
-
},
|
|
572
|
-
{
|
|
573
|
-
accessorKey: "items.length",
|
|
574
|
-
header: () => n("inventory.transfer.table.noOfItems"),
|
|
575
|
-
enableSorting: !1,
|
|
576
|
-
meta: {
|
|
577
|
-
width: "10rem"
|
|
578
|
-
}
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
accessorKey: "ref",
|
|
582
|
-
header: () => n("inventory.transfer.table.reference"),
|
|
583
|
-
enableSorting: !1,
|
|
584
|
-
size: "auto"
|
|
585
|
-
},
|
|
586
|
-
{
|
|
587
|
-
accessorKey: "status",
|
|
588
|
-
header: () => n("inventory.transfer.table.status"),
|
|
589
|
-
cell(e) {
|
|
590
|
-
const o = n(`inventory.transfer.status.${e.getValue() ?? ""}`), a = `${e.getValue() ?? ""}`.toLocaleLowerCase("en-us");
|
|
591
|
-
return x(
|
|
592
|
-
"div",
|
|
593
|
-
{
|
|
594
|
-
class: "flex"
|
|
595
|
-
},
|
|
596
|
-
x(
|
|
597
|
-
"div",
|
|
598
|
-
{
|
|
599
|
-
class: `fm-status-badge fm-status-badge-${a}`
|
|
600
|
-
},
|
|
601
|
-
o
|
|
602
|
-
)
|
|
603
|
-
);
|
|
604
|
-
},
|
|
605
|
-
enableSorting: !0,
|
|
606
|
-
size: 200
|
|
607
|
-
},
|
|
608
|
-
{
|
|
609
|
-
id: "action",
|
|
610
|
-
cell(e) {
|
|
611
|
-
const o = e.row.original, a = i(o);
|
|
612
|
-
return Le(a, (y) => g(y, o));
|
|
613
|
-
},
|
|
614
|
-
enableSorting: !1,
|
|
615
|
-
size: 40,
|
|
616
|
-
meta: {
|
|
617
|
-
cellClass: "",
|
|
618
|
-
headerClass: ""
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
];
|
|
622
|
-
}
|
|
623
|
-
function f() {
|
|
624
|
-
return [
|
|
625
|
-
{
|
|
626
|
-
accessorKey: "purchaseOrder.seqNumber",
|
|
627
|
-
header: () => n("inventory.transfer.table.seqNo"),
|
|
628
|
-
enableSorting: !0,
|
|
629
|
-
size: 80,
|
|
630
|
-
sortUndefined: "last"
|
|
631
|
-
},
|
|
632
|
-
{
|
|
633
|
-
accessorKey: "purchaseOrder._id",
|
|
634
|
-
header: () => n("inventory.transfer.table.createdAt"),
|
|
635
|
-
cell(e) {
|
|
636
|
-
return Se(`${e.getValue()}`);
|
|
637
|
-
},
|
|
638
|
-
enableSorting: !0
|
|
639
|
-
},
|
|
640
|
-
{
|
|
641
|
-
accessorKey: "to.name",
|
|
642
|
-
header: () => n("inventory.transfer.table.transferTo"),
|
|
643
|
-
enableSorting: !1,
|
|
644
|
-
size: 200
|
|
645
|
-
},
|
|
646
|
-
{
|
|
647
|
-
accessorKey: "purchaseOrder.items.length",
|
|
648
|
-
header: () => n("inventory.transfer.table.noOfItems"),
|
|
649
|
-
enableSorting: !1
|
|
650
|
-
},
|
|
651
|
-
{
|
|
652
|
-
accessorKey: "purchaseOrder.ref",
|
|
653
|
-
header: () => n("inventory.transfer.table.reference"),
|
|
654
|
-
enableSorting: !1,
|
|
655
|
-
size: "auto"
|
|
656
|
-
},
|
|
657
|
-
{
|
|
658
|
-
accessorKey: "purchaseOrder.status",
|
|
659
|
-
header: () => n("inventory.transfer.table.status"),
|
|
660
|
-
cell(e) {
|
|
661
|
-
const o = n(`inventory.transfer.status.${e.getValue() ?? ""}`), a = `${e.getValue() ?? ""}`.toLocaleLowerCase("en-us");
|
|
662
|
-
return x(
|
|
663
|
-
"div",
|
|
664
|
-
{
|
|
665
|
-
class: "flex"
|
|
666
|
-
},
|
|
667
|
-
x(
|
|
668
|
-
"div",
|
|
669
|
-
{
|
|
670
|
-
class: `fm-status-badge fm-status-badge-${a}`
|
|
671
|
-
},
|
|
672
|
-
o
|
|
673
|
-
)
|
|
674
|
-
);
|
|
675
|
-
},
|
|
676
|
-
enableSorting: !0
|
|
677
|
-
},
|
|
678
|
-
{
|
|
679
|
-
id: "action",
|
|
680
|
-
cell(e) {
|
|
681
|
-
const o = e.row.original, a = o.purchaseOrder ? i(o.purchaseOrder) : [];
|
|
682
|
-
return Le(
|
|
683
|
-
a,
|
|
684
|
-
(y) => o.purchaseOrder ? g(y, o.purchaseOrder, o) : void 0
|
|
685
|
-
);
|
|
686
|
-
},
|
|
687
|
-
enableSorting: !1,
|
|
688
|
-
size: 40,
|
|
689
|
-
meta: {
|
|
690
|
-
cellClass: "",
|
|
691
|
-
headerClass: ""
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
];
|
|
695
|
-
}
|
|
696
|
-
const c = W(() => m === "receive/request" ? k() : f());
|
|
697
|
-
return {
|
|
698
|
-
get columnDefs() {
|
|
699
|
-
return c.value;
|
|
700
|
-
}
|
|
701
|
-
};
|
|
702
|
-
}
|
|
703
|
-
const pt = {
|
|
704
|
-
key: 0,
|
|
705
|
-
class: "flex flex-col gap-8"
|
|
706
|
-
}, vt = { class: "flex flex-col gap-4" }, yt = { class: "fm-typo-en-body-lg-600" }, ht = {
|
|
707
|
-
key: 0,
|
|
708
|
-
class: "flex flex-col gap-4"
|
|
709
|
-
}, bt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gt = { class: "fm-typo-en-body-lg-600" }, _t = { key: 0 }, St = { key: 1 }, wt = {
|
|
710
|
-
key: 1,
|
|
711
|
-
class: "flex flex-col gap-4"
|
|
712
|
-
}, Ot = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Rt = { class: "fm-typo-en-body-lg-600" }, xt = { key: 0 }, Nt = { key: 1 }, Dt = {
|
|
713
|
-
key: 2,
|
|
714
|
-
class: "flex flex-col gap-4"
|
|
715
|
-
}, At = { class: "fm-typo-en-body-lg-600" }, kt = {
|
|
716
|
-
key: 3,
|
|
717
|
-
class: "flex flex-col gap-4"
|
|
718
|
-
}, Tt = { class: "fm-typo-en-body-lg-600" }, $t = /* @__PURE__ */ De({
|
|
719
|
-
__name: "NetSuiteInfo",
|
|
720
|
-
props: {
|
|
721
|
-
transferType: {},
|
|
722
|
-
transferToDbName: {},
|
|
723
|
-
poRequest: {},
|
|
724
|
-
purchaseOrder: {},
|
|
725
|
-
isTransferBetweenOutlets: { type: Boolean },
|
|
726
|
-
scope: {}
|
|
727
|
-
},
|
|
728
|
-
setup(m) {
|
|
729
|
-
const d = m, n = Ge(), i = $e(), h = G(d.poRequest);
|
|
730
|
-
st(async () => {
|
|
731
|
-
var c;
|
|
732
|
-
if (!d.poRequest && ((c = d.purchaseOrder) != null && c._id)) {
|
|
733
|
-
const e = await i.getLatestPurchaseOrderRequest(d.purchaseOrder._id);
|
|
734
|
-
h.value = e;
|
|
735
|
-
}
|
|
736
|
-
});
|
|
737
|
-
const g = W(
|
|
738
|
-
() => {
|
|
739
|
-
var c, e, o, a, y, O;
|
|
740
|
-
return n.getSubsidiaryFullName(
|
|
741
|
-
((o = (e = (c = d.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : e.subsidiary) == null ? void 0 : o.id) || ((O = (y = (a = d.poRequest) == null ? void 0 : a.netSuite) == null ? void 0 : y.subsidiary) == null ? void 0 : O.id)
|
|
742
|
-
).fullName;
|
|
743
|
-
}
|
|
744
|
-
), k = W(() => {
|
|
745
|
-
var c, e, o, a, y, O, T, E, H, Y, I, J;
|
|
746
|
-
return (o = (e = (c = d.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : e.additionalInfo) != null && o.transactionnumber ? (O = (y = (a = d.purchaseOrder) == null ? void 0 : a.netSuite) == null ? void 0 : y.additionalInfo) == null ? void 0 : O.transactionnumber : (H = (E = (T = h.value) == null ? void 0 : T.netSuite) == null ? void 0 : E.additionalInfo) != null && H.transactionnumber ? (J = (I = (Y = h.value) == null ? void 0 : Y.netSuite) == null ? void 0 : I.additionalInfo) == null ? void 0 : J.transactionnumber : null;
|
|
747
|
-
}), f = W(() => {
|
|
748
|
-
var c, e, o, a, y, O;
|
|
749
|
-
return (e = (c = d.purchaseOrder) == null ? void 0 : c.deliveryFullfillment) != null && e.length && ((a = (o = d.purchaseOrder) == null ? void 0 : o.deliveryFullfillment) == null ? void 0 : a.length) > 0 ? (O = (y = d.purchaseOrder) == null ? void 0 : y.deliveryFullfillment) == null ? void 0 : O.map((T) => {
|
|
750
|
-
var E;
|
|
751
|
-
return (E = T.netSuite) == null ? void 0 : E.refNo;
|
|
752
|
-
}).join(", ") : "N/A";
|
|
753
|
-
});
|
|
754
|
-
return (c, e) => {
|
|
755
|
-
var o, a, y, O, T, E, H, Y, I, J, se, B, ce, r;
|
|
756
|
-
return u(n).isEnabled ? (v(), w("div", pt, [
|
|
757
|
-
s("div", vt, [
|
|
758
|
-
e[0] || (e[0] = s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
759
|
-
s("div", yt, _(g.value || "N/A"), 1)
|
|
760
|
-
]),
|
|
761
|
-
!c.isTransferBetweenOutlets && ((o = c.purchaseOrder) == null ? void 0 : o.status) !== u(F).Enum.REQUESTING && c.scope === u(Ne).RECEIVE_REQUEST ? (v(), w("div", ht, [
|
|
762
|
-
s("div", bt, " NetSuite " + _(c.transferType === u(le).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
763
|
-
s("div", gt, [
|
|
764
|
-
(y = (a = c.purchaseOrder) == null ? void 0 : a.netSuite) != null && y.id ? (v(), w("span", _t, _((T = (O = c.purchaseOrder) == null ? void 0 : O.netSuite) == null ? void 0 : T.refNo) + " (" + _((H = (E = c.purchaseOrder) == null ? void 0 : E.netSuite) == null ? void 0 : H.id) + ") ", 1)) : (v(), w("span", St, "N/A"))
|
|
765
|
-
])
|
|
766
|
-
])) : A("", !0),
|
|
767
|
-
!c.isTransferBetweenOutlets && h.value && ((Y = c.purchaseOrder) == null ? void 0 : Y.status) === u(F).Enum.REQUESTING || c.scope === u(Ne).APPROVAL ? (v(), w("div", wt, [
|
|
768
|
-
s("div", Ot, " (Request) NetSuite " + _(c.transferType === u(le).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
769
|
-
s("div", Rt, [
|
|
770
|
-
(J = (I = h.value) == null ? void 0 : I.netSuite) != null && J.id ? (v(), w("span", xt, _((B = (se = h.value) == null ? void 0 : se.netSuite) == null ? void 0 : B.refNo) + " (" + _((r = (ce = h.value) == null ? void 0 : ce.netSuite) == null ? void 0 : r.id) + ") ", 1)) : (v(), w("span", Nt, "N/A"))
|
|
771
|
-
])
|
|
772
|
-
])) : A("", !0),
|
|
773
|
-
k.value ? (v(), w("div", Dt, [
|
|
774
|
-
e[1] || (e[1] = s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
|
|
775
|
-
s("div", At, _(k.value), 1)
|
|
776
|
-
])) : A("", !0),
|
|
777
|
-
u(n).isEnabled && c.transferType === u(le).TRANSFER && !c.isTransferBetweenOutlets ? (v(), w("div", kt, [
|
|
778
|
-
e[2] || (e[2] = s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
779
|
-
s("div", Tt, _(f.value), 1)
|
|
780
|
-
])) : A("", !0)
|
|
781
|
-
])) : A("", !0);
|
|
782
|
-
};
|
|
783
|
-
}
|
|
784
|
-
}), Pt = {
|
|
785
|
-
key: 0,
|
|
786
|
-
class: "flex flex-row-reverse"
|
|
787
|
-
}, qt = /* @__PURE__ */ De({
|
|
788
|
-
__name: "NetSuiteSync",
|
|
789
|
-
props: {
|
|
790
|
-
poRequest: {},
|
|
791
|
-
purchaseOrder: {},
|
|
792
|
-
isTransferBetweenOutlets: { type: Boolean }
|
|
793
|
-
},
|
|
794
|
-
setup(m) {
|
|
795
|
-
const d = m, n = Ge(), i = ke(), h = Ae(), g = G(!1), k = W(() => {
|
|
796
|
-
var a, y, O, T;
|
|
797
|
-
let c = !0;
|
|
798
|
-
n.isEnabled || (c = !1);
|
|
799
|
-
const e = d.purchaseOrder, o = d.poRequest;
|
|
800
|
-
return e && ((a = e == null ? void 0 : e.supplier) != null && a.internal ? (!o && e.status == F.enum.DRAFT && (c = !1), o && !((y = o == null ? void 0 : o.netSuite) != null && y.id) && (c = !1), d.isTransferBetweenOutlets && (c = !1)) : ((e == null ? void 0 : e.status) !== F.enum.REQUESTING && e.supplier.internal && (c = !1), !o && !((O = e == null ? void 0 : e.netSuite) != null && O.id) && (c = !1), !o && ((T = e == null ? void 0 : e.netSuite) != null && T.id) && (e == null ? void 0 : e.status) == F.enum.REQUESTING && (c = !1))), c;
|
|
801
|
-
});
|
|
802
|
-
async function f() {
|
|
803
|
-
g.value || h.open({
|
|
804
|
-
title: "Sync with NetSuite",
|
|
805
|
-
contentComponent: x("div", [
|
|
806
|
-
x("p", "Are you sure you want to sync now?"),
|
|
807
|
-
x("br"),
|
|
808
|
-
x(
|
|
809
|
-
"p",
|
|
810
|
-
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
811
|
-
"Please wait a moment before syncing manually to avoid unnecessary actions."
|
|
812
|
-
)
|
|
813
|
-
]),
|
|
814
|
-
primaryActions: {
|
|
815
|
-
text: "Sync",
|
|
816
|
-
close: !0,
|
|
817
|
-
variant: "destructive"
|
|
818
|
-
},
|
|
819
|
-
secondaryActions: { text: "Not now", close: !0 }
|
|
820
|
-
}).onPrimary(async () => {
|
|
821
|
-
var c;
|
|
822
|
-
try {
|
|
823
|
-
g.value = !0;
|
|
824
|
-
const e = d.purchaseOrder, o = d.poRequest;
|
|
825
|
-
let a = "purchaseOrder";
|
|
826
|
-
if ((c = e == null ? void 0 : e.supplier) != null && c.internal && (a = "purchaseOrderRequest"), !(e != null && e._id)) {
|
|
827
|
-
i.open({
|
|
828
|
-
title: "Error",
|
|
829
|
-
message: "Invalid sync ID",
|
|
830
|
-
type: "error"
|
|
831
|
-
});
|
|
832
|
-
return;
|
|
833
|
-
}
|
|
834
|
-
await n.syncTransferOrder(a, e == null ? void 0 : e._id, o == null ? void 0 : o._id), i.open({
|
|
835
|
-
title: "Sync with NetSuite",
|
|
836
|
-
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
837
|
-
type: "success"
|
|
838
|
-
});
|
|
839
|
-
} catch {
|
|
840
|
-
i.open({
|
|
841
|
-
title: "Error",
|
|
842
|
-
message: "Failed to sync with NetSuite",
|
|
843
|
-
type: "error"
|
|
844
|
-
});
|
|
845
|
-
}
|
|
846
|
-
setTimeout(() => {
|
|
847
|
-
g.value = !1;
|
|
848
|
-
}, 5e3);
|
|
849
|
-
});
|
|
850
|
-
}
|
|
851
|
-
return (c, e) => {
|
|
852
|
-
const o = re("FmButton");
|
|
853
|
-
return k.value ? (v(), w("div", Pt, [
|
|
854
|
-
K(o, {
|
|
855
|
-
"prepend-icon": "sync",
|
|
856
|
-
variant: "secondary",
|
|
857
|
-
label: "Sync",
|
|
858
|
-
loading: g.value,
|
|
859
|
-
onClick: f,
|
|
860
|
-
"text-color": "primary",
|
|
861
|
-
"bg-color": "transparent",
|
|
862
|
-
"border-color": "primary"
|
|
863
|
-
}, null, 8, ["loading"])
|
|
864
|
-
])) : A("", !0);
|
|
865
|
-
};
|
|
866
|
-
}
|
|
867
|
-
}), Et = { class: "flex flex-col gap-16 w-full h-full" }, Ct = { class: "flex justify-between" }, It = { class: "fm-typo-en-body-lg-600" }, Ft = { class: "flex flex-col gap-8" }, Ut = { class: "flex flex-col gap-4" }, Lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Bt = { class: "flex gap-1" }, Mt = { class: "fm-typo-en-body-lg-600" }, jt = {
|
|
868
|
-
key: 0,
|
|
869
|
-
class: "flex flex-col gap-4"
|
|
870
|
-
}, Vt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Kt = { class: "fm-typo-en-body-lg-600" }, Gt = { class: "flex flex-col gap-4" }, Ht = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zt = { class: "fm-typo-en-body-lg-600" }, Qt = {
|
|
871
|
-
key: 1,
|
|
872
|
-
class: "flex flex-col gap-4"
|
|
873
|
-
}, Wt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yt = { class: "fm-typo-en-body-lg-600" }, Xt = {
|
|
874
|
-
key: 2,
|
|
875
|
-
class: "flex flex-col gap-4"
|
|
876
|
-
}, Jt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Zt = { class: "fm-typo-en-body-lg-600" }, er = {
|
|
877
|
-
key: 3,
|
|
878
|
-
class: "flex flex-col gap-4"
|
|
879
|
-
}, tr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rr = { class: "fm-typo-en-body-lg-600" }, sr = {
|
|
880
|
-
key: 4,
|
|
881
|
-
class: "flex flex-col gap-4"
|
|
882
|
-
}, ar = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, nr = { class: "fm-typo-en-body-lg-600" }, or = {
|
|
883
|
-
key: 0,
|
|
884
|
-
class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16 flex flex-col gap-8"
|
|
885
|
-
}, lr = { class: "flex gap-8 items-center" }, cr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, ir = { class: "flex flex-col gap-8" }, ur = { class: "flex gap-8 items-center" }, dr = { class: "flex-1 fm-typo-en-body-lg-600" }, mr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-4" }, fr = { class: "flex w-full gap-4" }, pr = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, vr = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, yr = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, hr = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, br = {
|
|
886
|
-
key: 0,
|
|
887
|
-
class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
888
|
-
}, gr = { class: "py-8" }, _r = { class: "flex justify-end gap-4 items-center" }, Sr = { class: "fm-typo-en-body-lg-600" }, wr = {
|
|
889
|
-
key: 1,
|
|
890
|
-
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
891
|
-
}, Or = {
|
|
892
|
-
key: 0,
|
|
893
|
-
class: "flex flex-col items-center gap-8 h-full"
|
|
894
|
-
}, Rr = ["src"], xr = { class: "fm-typo-en-body-lg-600" }, Nr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, Dr = {
|
|
895
|
-
key: 1,
|
|
896
|
-
class: "px-4 flex flex-col"
|
|
897
|
-
}, Ar = { class: "flex gap-12 content-stretch" }, kr = {
|
|
898
|
-
class: "flex flex-col w-24",
|
|
899
|
-
name: "circles"
|
|
900
|
-
}, Tr = { class: "flex-1 flex flex-col items-center" }, $r = { class: "flex-1 flex flex-col items-center" }, Pr = {
|
|
901
|
-
class: "py-12 flex flex-col gap-4",
|
|
902
|
-
name: "received-at header"
|
|
903
|
-
}, qr = { class: "fm-typo-en-body-lg-400" }, Er = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Cr = { class: "flex gap-12 content-stretch" }, Ir = {
|
|
904
|
-
class: "flex flex-col w-24",
|
|
905
|
-
name: "circles"
|
|
906
|
-
}, Fr = { class: "flex-1 flex flex-col items-center" }, Ur = {
|
|
907
|
-
class: "py-12 flex flex-col gap-4 flex-1",
|
|
908
|
-
name: "delivery details"
|
|
909
|
-
}, Lr = { class: "flex flex-col gap-8" }, Br = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Mr = { class: "flex flex-col gap-4" }, jr = { class: "flex gap-8 xs:flex-col" }, Zr = /* @__PURE__ */ De({
|
|
910
|
-
__name: "TransferDetails",
|
|
911
|
-
props: {
|
|
912
|
-
poRequest: {},
|
|
913
|
-
purchaseOrder: {},
|
|
914
|
-
transferTo: {},
|
|
915
|
-
transferToDbName: {},
|
|
916
|
-
show: { type: Boolean },
|
|
917
|
-
canResubmit: { type: Boolean },
|
|
918
|
-
canApprove: { type: Boolean },
|
|
919
|
-
scope: {}
|
|
920
|
-
},
|
|
921
|
-
emits: ["update:show", "submitted"],
|
|
922
|
-
setup(m, { emit: d }) {
|
|
923
|
-
const n = m, i = d, h = Ae(), g = ke(), k = Te(), { t: f } = ze(), c = W(
|
|
924
|
-
() => {
|
|
925
|
-
var r, l, q, $;
|
|
926
|
-
return ((l = (r = n.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : l.internal) === "restaurant" || (($ = (q = n.purchaseOrder) == null ? void 0 : q.supplier) == null ? void 0 : $.internal) === "warehouse" ? le.TRANSFER : le.PURCHASE;
|
|
927
|
-
}
|
|
928
|
-
), e = W(() => {
|
|
929
|
-
var r, l, q;
|
|
930
|
-
return c.value === le.TRANSFER && ((r = n.transferToDbName) == null ? void 0 : r.startsWith("restaurant")) && ((q = (l = n.purchaseOrder) == null ? void 0 : l.supplier) == null ? void 0 : q.internal) === "restaurant";
|
|
931
|
-
}), o = G(!1), a = G(""), y = G(!0), O = dt(n, "show"), T = W(() => [
|
|
932
|
-
{
|
|
933
|
-
label: f("inventory.transfer.receiveRequest.details.overview"),
|
|
934
|
-
value: "overview"
|
|
935
|
-
},
|
|
936
|
-
{
|
|
937
|
-
label: f("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
938
|
-
value: "deliveryHistory"
|
|
939
|
-
}
|
|
940
|
-
]), E = G(T.value[0]), H = We();
|
|
941
|
-
at(
|
|
942
|
-
() => n.show,
|
|
943
|
-
(r) => {
|
|
944
|
-
r && (E.value = T.value[0]);
|
|
945
|
-
}
|
|
946
|
-
);
|
|
947
|
-
async function Y(r, l, q) {
|
|
948
|
-
a.value = `${l}`, o.value = !0, y.value = !1;
|
|
949
|
-
try {
|
|
950
|
-
await H({
|
|
951
|
-
operation: l,
|
|
952
|
-
purchaseOrder: r,
|
|
953
|
-
payloadV2: {
|
|
954
|
-
confirmDraft: l === "confirmDraft" ? {
|
|
955
|
-
warehouseAutoReceive: k.autoReceiveWarehouse
|
|
956
|
-
} : void 0,
|
|
957
|
-
completeReceive: l === "completeReceive" ? {
|
|
958
|
-
warehouseAutoReceive: k.autoReceiveWarehouse
|
|
959
|
-
} : void 0,
|
|
960
|
-
submitRequest: l === "submitRequest" ? {
|
|
961
|
-
requestId: ""
|
|
962
|
-
// will be populated in backend
|
|
963
|
-
} : void 0
|
|
964
|
-
},
|
|
965
|
-
payloadV1: {
|
|
966
|
-
doc: r,
|
|
967
|
-
options: (
|
|
968
|
-
// auto receive for supplier to warehouse
|
|
969
|
-
(l === N.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
970
|
-
l === N.enum.completeReceive) && k.autoReceiveWarehouse ? {
|
|
971
|
-
autoReceive: !0
|
|
972
|
-
} : void 0
|
|
973
|
-
)
|
|
974
|
-
},
|
|
975
|
-
dbName: n.transferToDbName
|
|
976
|
-
}), await new Promise(($) => setTimeout($, 1e3)), g.open({
|
|
977
|
-
title: "Success",
|
|
978
|
-
message: q,
|
|
979
|
-
type: "success"
|
|
980
|
-
}), i("update:show", !1), i("submitted");
|
|
981
|
-
} catch ($) {
|
|
982
|
-
g.open({
|
|
983
|
-
title: "Something went wrong",
|
|
984
|
-
message: "Please try again.",
|
|
985
|
-
type: "error"
|
|
986
|
-
}), console.error("Error when submitting PO operation", l, r, $);
|
|
987
|
-
} finally {
|
|
988
|
-
a.value = "", o.value = !1, y.value = !0;
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
async function I(r) {
|
|
992
|
-
if (r === N.enum.receiveStock)
|
|
993
|
-
return;
|
|
994
|
-
const l = Qe[r];
|
|
995
|
-
if (!l) {
|
|
996
|
-
g.open({
|
|
997
|
-
title: "Something went wrong",
|
|
998
|
-
message: `Cannot process order: ${Ve(r)}`,
|
|
999
|
-
type: "error"
|
|
1000
|
-
});
|
|
1001
|
-
return;
|
|
1002
|
-
}
|
|
1003
|
-
const { successMessage: q, ...$ } = l;
|
|
1004
|
-
h.open({
|
|
1005
|
-
title: $.title,
|
|
1006
|
-
message: $.message,
|
|
1007
|
-
primaryActions: $.primaryActions
|
|
1008
|
-
}).onPrimary(() => {
|
|
1009
|
-
n.purchaseOrder && Y(n.purchaseOrder, r, q);
|
|
1010
|
-
});
|
|
1011
|
-
}
|
|
1012
|
-
const J = W(() => {
|
|
1013
|
-
var r, l;
|
|
1014
|
-
return ((r = n.purchaseOrder) == null ? void 0 : r.status) === F.enum.RECEIVING || ((l = n.purchaseOrder) == null ? void 0 : l.status) === F.enum.COMPLETE;
|
|
1015
|
-
}), se = W(() => {
|
|
1016
|
-
var te, p, t;
|
|
1017
|
-
const q = (((te = n.purchaseOrder) == null ? void 0 : te.deliveryOrder) ?? []).flatMap((b) => b.received ?? []).reduce(
|
|
1018
|
-
(b, S) => {
|
|
1019
|
-
const P = b[S.sku._id] ?? [];
|
|
1020
|
-
return b[S.sku._id] = [...P, S], b;
|
|
1021
|
-
},
|
|
1022
|
-
{}
|
|
1023
|
-
), $ = Object.entries(q).reduce(
|
|
1024
|
-
(b, [S, P]) => {
|
|
1025
|
-
const R = P.reduce((M, U) => {
|
|
1026
|
-
const X = rt(
|
|
1027
|
-
M,
|
|
1028
|
-
Math.max(M.precision, U.amount.precision)
|
|
1029
|
-
);
|
|
1030
|
-
return xe(X, U.amount);
|
|
1031
|
-
}, _e(0));
|
|
1032
|
-
return b[S] = R, b;
|
|
1033
|
-
},
|
|
1034
|
-
{}
|
|
1035
|
-
), ee = ((p = n.purchaseOrder) == null ? void 0 : p.items) ?? [];
|
|
1036
|
-
for (const b of ee)
|
|
1037
|
-
$[t = b.sku._id] ?? ($[t] = _e(0));
|
|
1038
|
-
return $;
|
|
1039
|
-
}), B = W(() => {
|
|
1040
|
-
var te, p;
|
|
1041
|
-
const r = ((te = n.purchaseOrder) == null ? void 0 : te.deliveryOrder) ?? [], l = ((p = n.purchaseOrder) == null ? void 0 : p.deliveryFullfillment) ?? [], q = [
|
|
1042
|
-
...r.map((t) => ({
|
|
1043
|
-
createdAt: t.createdAt,
|
|
1044
|
-
type: "grn",
|
|
1045
|
-
doc: t
|
|
1046
|
-
})),
|
|
1047
|
-
...l.map((t) => ({
|
|
1048
|
-
createdAt: t.createdAt,
|
|
1049
|
-
type: "fulfillment",
|
|
1050
|
-
doc: t
|
|
1051
|
-
}))
|
|
1052
|
-
];
|
|
1053
|
-
q.reverse().sort((t, b) => t.createdAt.localeCompare(b.createdAt));
|
|
1054
|
-
function $(t) {
|
|
1055
|
-
var S, P, R, M, U, X, ne;
|
|
1056
|
-
const b = l.findIndex((L) => L.id === t.fullfillmentId);
|
|
1057
|
-
return {
|
|
1058
|
-
header: "Received",
|
|
1059
|
-
date: Me(new Date(t.createdAt)),
|
|
1060
|
-
info: [
|
|
1061
|
-
{
|
|
1062
|
-
label: "Received by",
|
|
1063
|
-
values: [(S = t.createdBy) == null ? void 0 : S.name]
|
|
1064
|
-
},
|
|
1065
|
-
{
|
|
1066
|
-
label: "Received items",
|
|
1067
|
-
values: t.received.map((L) => {
|
|
1068
|
-
var oe;
|
|
1069
|
-
return x("div", [
|
|
1070
|
-
x(
|
|
1071
|
-
"div",
|
|
1072
|
-
{
|
|
1073
|
-
class: "flex gap-4"
|
|
1074
|
-
},
|
|
1075
|
-
[
|
|
1076
|
-
x(
|
|
1077
|
-
"div",
|
|
1078
|
-
{
|
|
1079
|
-
class: "flex flex-col"
|
|
1080
|
-
},
|
|
1081
|
-
[
|
|
1082
|
-
x(
|
|
1083
|
-
"span",
|
|
1084
|
-
{
|
|
1085
|
-
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
1086
|
-
},
|
|
1087
|
-
`${L.sku.name}`
|
|
1088
|
-
),
|
|
1089
|
-
x(
|
|
1090
|
-
"span",
|
|
1091
|
-
{
|
|
1092
|
-
class: "fm-typo-en-body-md-400"
|
|
1093
|
-
},
|
|
1094
|
-
`${L.sku.code} `
|
|
1095
|
-
)
|
|
1096
|
-
]
|
|
1097
|
-
),
|
|
1098
|
-
x(
|
|
1099
|
-
"div",
|
|
1100
|
-
{
|
|
1101
|
-
class: "ml-auto flex flex-col"
|
|
1102
|
-
},
|
|
1103
|
-
[
|
|
1104
|
-
x(
|
|
1105
|
-
"div",
|
|
1106
|
-
{
|
|
1107
|
-
class: "ml-auto flex gap-1"
|
|
1108
|
-
},
|
|
1109
|
-
[
|
|
1110
|
-
x(
|
|
1111
|
-
"span",
|
|
1112
|
-
{
|
|
1113
|
-
class: "fm-typo-en-body-lg-600 self-end"
|
|
1114
|
-
},
|
|
1115
|
-
me(L.amount, !1)
|
|
1116
|
-
),
|
|
1117
|
-
x(
|
|
1118
|
-
"span",
|
|
1119
|
-
{
|
|
1120
|
-
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1121
|
-
},
|
|
1122
|
-
((oe = L.measurement) == null ? void 0 : oe.abbrev) ?? L.sku.unit.abbrev
|
|
1123
|
-
)
|
|
1124
|
-
]
|
|
1125
|
-
),
|
|
1126
|
-
x(
|
|
1127
|
-
"div",
|
|
1128
|
-
{
|
|
1129
|
-
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1130
|
-
},
|
|
1131
|
-
`${L.cost ? `(${be(L.cost)})` : ""}`
|
|
1132
|
-
)
|
|
1133
|
-
]
|
|
1134
|
-
)
|
|
1135
|
-
]
|
|
1136
|
-
)
|
|
1137
|
-
]);
|
|
1138
|
-
})
|
|
1139
|
-
},
|
|
1140
|
-
t.deliveryOrderNumber ? {
|
|
1141
|
-
label: "Delivery order no.",
|
|
1142
|
-
values: [t.deliveryOrderNumber]
|
|
1143
|
-
} : null,
|
|
1144
|
-
t.remark ? {
|
|
1145
|
-
label: "Remark",
|
|
1146
|
-
values: [t.remark]
|
|
1147
|
-
} : null,
|
|
1148
|
-
b > -1 ? {
|
|
1149
|
-
label: "Fulfilment's sequence",
|
|
1150
|
-
values: [`${b + 1}`]
|
|
1151
|
-
} : null,
|
|
1152
|
-
(R = (P = l[b]) == null ? void 0 : P.netSuite) != null && R.refNo ? {
|
|
1153
|
-
label: "Fulfillment's ref no. (Netsuite)",
|
|
1154
|
-
values: [(U = (M = l[b]) == null ? void 0 : M.netSuite) == null ? void 0 : U.refNo]
|
|
1155
|
-
} : null,
|
|
1156
|
-
(X = t == null ? void 0 : t.netSuite) != null && X.refNo ? {
|
|
1157
|
-
label: "Item receipt (Netsuite)",
|
|
1158
|
-
values: [(ne = t == null ? void 0 : t.netSuite) == null ? void 0 : ne.refNo]
|
|
1159
|
-
} : null
|
|
1160
|
-
].filter((L) => L)
|
|
1161
|
-
};
|
|
1162
|
-
}
|
|
1163
|
-
function ee(t) {
|
|
1164
|
-
var S, P;
|
|
1165
|
-
const b = l.findIndex((R) => R.id === t.id);
|
|
1166
|
-
return {
|
|
1167
|
-
header: "Fulfillment",
|
|
1168
|
-
date: Me(new Date(t.createdAt)),
|
|
1169
|
-
info: [
|
|
1170
|
-
{
|
|
1171
|
-
label: "Sequence",
|
|
1172
|
-
values: [String(b + 1)]
|
|
1173
|
-
},
|
|
1174
|
-
{
|
|
1175
|
-
label: "Receiveable items",
|
|
1176
|
-
values: t.items.map((R) => {
|
|
1177
|
-
var M;
|
|
1178
|
-
return x("div", [
|
|
1179
|
-
x(
|
|
1180
|
-
"div",
|
|
1181
|
-
{
|
|
1182
|
-
class: "flex gap-4"
|
|
1183
|
-
},
|
|
1184
|
-
[
|
|
1185
|
-
x(
|
|
1186
|
-
"div",
|
|
1187
|
-
{
|
|
1188
|
-
class: "flex flex-col"
|
|
1189
|
-
},
|
|
1190
|
-
[
|
|
1191
|
-
x(
|
|
1192
|
-
"span",
|
|
1193
|
-
{
|
|
1194
|
-
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
1195
|
-
},
|
|
1196
|
-
`${R.sku.name}`
|
|
1197
|
-
),
|
|
1198
|
-
x(
|
|
1199
|
-
"span",
|
|
1200
|
-
{
|
|
1201
|
-
class: "fm-typo-en-body-md-400"
|
|
1202
|
-
},
|
|
1203
|
-
`${R.sku.code} `
|
|
1204
|
-
)
|
|
1205
|
-
]
|
|
1206
|
-
),
|
|
1207
|
-
x(
|
|
1208
|
-
"div",
|
|
1209
|
-
{
|
|
1210
|
-
class: "ml-auto flex flex-col"
|
|
1211
|
-
},
|
|
1212
|
-
[
|
|
1213
|
-
x(
|
|
1214
|
-
"div",
|
|
1215
|
-
{
|
|
1216
|
-
class: "ml-auto flex gap-1"
|
|
1217
|
-
},
|
|
1218
|
-
[
|
|
1219
|
-
x(
|
|
1220
|
-
"span",
|
|
1221
|
-
{
|
|
1222
|
-
class: "fm-typo-en-body-lg-600 self-end"
|
|
1223
|
-
},
|
|
1224
|
-
me(R.amount, !1)
|
|
1225
|
-
),
|
|
1226
|
-
x(
|
|
1227
|
-
"span",
|
|
1228
|
-
{
|
|
1229
|
-
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1230
|
-
},
|
|
1231
|
-
((M = R.measurement) == null ? void 0 : M.abbrev) ?? R.sku.unit.abbrev
|
|
1232
|
-
)
|
|
1233
|
-
]
|
|
1234
|
-
),
|
|
1235
|
-
x(
|
|
1236
|
-
"div",
|
|
1237
|
-
{
|
|
1238
|
-
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1239
|
-
},
|
|
1240
|
-
`${R.cost ? `(${be(R.cost)})` : ""}`
|
|
1241
|
-
)
|
|
1242
|
-
]
|
|
1243
|
-
)
|
|
1244
|
-
]
|
|
1245
|
-
)
|
|
1246
|
-
]);
|
|
1247
|
-
})
|
|
1248
|
-
},
|
|
1249
|
-
(S = t.netSuite) != null && S.refNo ? {
|
|
1250
|
-
label: "Ref no. (Netsuite)",
|
|
1251
|
-
values: [(P = t.netSuite) == null ? void 0 : P.refNo]
|
|
1252
|
-
} : null
|
|
1253
|
-
].filter((R) => R)
|
|
1254
|
-
};
|
|
1255
|
-
}
|
|
1256
|
-
return q.map((t) => {
|
|
1257
|
-
switch (t.type) {
|
|
1258
|
-
case "grn":
|
|
1259
|
-
return $(t.doc);
|
|
1260
|
-
case "fulfillment":
|
|
1261
|
-
return ee(t.doc);
|
|
1262
|
-
}
|
|
1263
|
-
});
|
|
1264
|
-
}), ce = W(() => {
|
|
1265
|
-
var l;
|
|
1266
|
-
const r = {
|
|
1267
|
-
..._e(0),
|
|
1268
|
-
currency: Be()
|
|
1269
|
-
};
|
|
1270
|
-
return ((l = n.purchaseOrder) == null ? void 0 : l.items.reduce((q, $) => ({
|
|
1271
|
-
...xe(q, $.totalCost ?? r),
|
|
1272
|
-
currency: Be()
|
|
1273
|
-
}), r)) ?? r;
|
|
1274
|
-
});
|
|
1275
|
-
return (r, l) => {
|
|
1276
|
-
var R, M;
|
|
1277
|
-
const q = re("FmButtonGroup"), $ = re("FmChip"), ee = re("FmMenuDivider"), te = re("FmCard"), p = re("FmIcon"), t = re("FmTooltip"), b = re("FmSpacer"), S = re("FmButton"), P = re("FmSideSheet");
|
|
1278
|
-
return v(), Z(P, {
|
|
1279
|
-
header: u(f)("inventory.transfer.receiveRequest.details.title") + ((R = r.purchaseOrder) != null && R.seqNumber ? ` #${(M = r.purchaseOrder) == null ? void 0 : M.seqNumber}` : ""),
|
|
1280
|
-
modelValue: u(O),
|
|
1281
|
-
"onUpdate:modelValue": l[9] || (l[9] = (U) => nt(O) ? O.value = U : null),
|
|
1282
|
-
"dismiss-away": y.value,
|
|
1283
|
-
"close-button": "",
|
|
1284
|
-
"max-width": 600
|
|
1285
|
-
}, {
|
|
1286
|
-
default: ue(() => {
|
|
1287
|
-
var U, X, ne, L, oe, fe, pe;
|
|
1288
|
-
return [
|
|
1289
|
-
s("div", Et, [
|
|
1290
|
-
s("div", null, [
|
|
1291
|
-
K(q, {
|
|
1292
|
-
items: T.value,
|
|
1293
|
-
modelValue: E.value,
|
|
1294
|
-
"onUpdate:modelValue": l[0] || (l[0] = (D) => E.value = D)
|
|
1295
|
-
}, null, 8, ["items", "modelValue"])
|
|
1296
|
-
]),
|
|
1297
|
-
E.value.value === "overview" ? (v(), w(ae, { key: 0 }, [
|
|
1298
|
-
s("div", null, [
|
|
1299
|
-
K(te, {
|
|
1300
|
-
variant: "outlined",
|
|
1301
|
-
class: "flex flex-col gap-8 px-12 py-16"
|
|
1302
|
-
}, {
|
|
1303
|
-
default: ue(() => {
|
|
1304
|
-
var D, C, j, z, ie, he, Pe, qe, Ee, Ce, Ie, Fe;
|
|
1305
|
-
return [
|
|
1306
|
-
s("div", Ct, [
|
|
1307
|
-
s("div", It, _(u(f)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
1308
|
-
s("div", null, [
|
|
1309
|
-
K($, {
|
|
1310
|
-
label: u(f)(`inventory.transfer.status.${(D = r.purchaseOrder) == null ? void 0 : D.status}`),
|
|
1311
|
-
class: ge(`fm-status-badge fm-status-badge-${(j = (C = r.purchaseOrder) == null ? void 0 : C.status) == null ? void 0 : j.toLocaleLowerCase("en-us")}`),
|
|
1312
|
-
compact: ""
|
|
1313
|
-
}, null, 8, ["label", "class"])
|
|
1314
|
-
])
|
|
1315
|
-
]),
|
|
1316
|
-
K(ee),
|
|
1317
|
-
s("div", Ft, [
|
|
1318
|
-
s("div", Ut, [
|
|
1319
|
-
s("div", Lt, [
|
|
1320
|
-
s("div", Bt, _(u(f)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1321
|
-
]),
|
|
1322
|
-
s("div", Mt, _(u(Se)(((z = r.purchaseOrder) == null ? void 0 : z._id) ?? "")), 1)
|
|
1323
|
-
]),
|
|
1324
|
-
(ie = r.purchaseOrder) != null && ie.effectiveAt ? (v(), w("div", jt, [
|
|
1325
|
-
s("div", Vt, _(u(f)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
1326
|
-
s("div", Kt, _(u(Ke)(new Date((he = r.purchaseOrder) == null ? void 0 : he.effectiveAt))), 1)
|
|
1327
|
-
])) : A("", !0),
|
|
1328
|
-
s("div", Gt, [
|
|
1329
|
-
s("div", Ht, _(u(f)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
1330
|
-
s("div", zt, _(u(f)(
|
|
1331
|
-
`inventory.transfer.receiveRequest.details.type.${c.value.toLocaleLowerCase("en-US")}`
|
|
1332
|
-
)), 1)
|
|
1333
|
-
]),
|
|
1334
|
-
(qe = (Pe = r.purchaseOrder) == null ? void 0 : Pe.supplier) != null && qe.name ? (v(), w("div", Qt, [
|
|
1335
|
-
s("div", Wt, _(u(f)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1336
|
-
s("div", Yt, _((Ce = (Ee = r.purchaseOrder) == null ? void 0 : Ee.supplier) == null ? void 0 : Ce.name), 1)
|
|
1337
|
-
])) : A("", !0),
|
|
1338
|
-
r.transferTo ? (v(), w("div", Xt, [
|
|
1339
|
-
s("div", Jt, _(u(f)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
1340
|
-
s("div", Zt, _(r.transferTo), 1)
|
|
1341
|
-
])) : A("", !0),
|
|
1342
|
-
(Ie = r.purchaseOrder) != null && Ie.ref ? (v(), w("div", er, [
|
|
1343
|
-
s("div", tr, _(u(f)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1344
|
-
s("div", rr, _(r.purchaseOrder.ref), 1)
|
|
1345
|
-
])) : A("", !0),
|
|
1346
|
-
(Fe = r.purchaseOrder) != null && Fe.remark ? (v(), w("div", sr, [
|
|
1347
|
-
s("div", ar, _(u(f)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1348
|
-
s("div", nr, _(r.purchaseOrder.remark), 1)
|
|
1349
|
-
])) : A("", !0)
|
|
1350
|
-
])
|
|
1351
|
-
];
|
|
1352
|
-
}),
|
|
1353
|
-
_: 1
|
|
1354
|
-
})
|
|
1355
|
-
]),
|
|
1356
|
-
(X = (U = r.purchaseOrder) == null ? void 0 : U.netSuite) != null && X.id ? A("", !0) : (v(), w("div", or, [
|
|
1357
|
-
s("div", lr, [
|
|
1358
|
-
l[10] || (l[10] = s("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
1359
|
-
s("div", null, [
|
|
1360
|
-
K(qt, {
|
|
1361
|
-
"po-request": r.poRequest,
|
|
1362
|
-
"purchase-order": r.purchaseOrder,
|
|
1363
|
-
"is-transfer-between-outlets": e.value
|
|
1364
|
-
}, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets"])
|
|
1365
|
-
])
|
|
1366
|
-
]),
|
|
1367
|
-
K(ee),
|
|
1368
|
-
K($t, {
|
|
1369
|
-
"po-request": r.poRequest,
|
|
1370
|
-
"purchase-order": r.purchaseOrder,
|
|
1371
|
-
"transfer-type": c.value,
|
|
1372
|
-
"transfer-to-db-name": r.transferToDbName,
|
|
1373
|
-
"is-transfer-between-outlets": e.value,
|
|
1374
|
-
scope: r.scope
|
|
1375
|
-
}, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
|
|
1376
|
-
])),
|
|
1377
|
-
s("div", cr, [
|
|
1378
|
-
s("div", ir, [
|
|
1379
|
-
s("div", ur, [
|
|
1380
|
-
s("span", dr, [
|
|
1381
|
-
we(_(J.value ? u(f)("inventory.transfer.receiveRequest.details.receivedItems") : u(f)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
|
|
1382
|
-
(L = (ne = r.purchaseOrder) == null ? void 0 : ne.netSuite) != null && L.missingItems && ((fe = (oe = r.purchaseOrder) == null ? void 0 : oe.netSuite) == null ? void 0 : fe.missingItems.length) > 0 ? (v(), Z(t, {
|
|
1383
|
-
key: 0,
|
|
1384
|
-
variant: "rich",
|
|
1385
|
-
placement: "top",
|
|
1386
|
-
"z-index": 51
|
|
1387
|
-
}, {
|
|
1388
|
-
content: ue(() => {
|
|
1389
|
-
var D, C;
|
|
1390
|
-
return [
|
|
1391
|
-
s("div", mr, [
|
|
1392
|
-
(v(!0), w(ae, null, ve((C = (D = r.purchaseOrder) == null ? void 0 : D.netSuite) == null ? void 0 : C.missingItems, (j, z) => (v(), w("div", {
|
|
1393
|
-
class: "flex justify-center align-middle",
|
|
1394
|
-
key: z
|
|
1395
|
-
}, [
|
|
1396
|
-
K(p, {
|
|
1397
|
-
name: "arrow_right",
|
|
1398
|
-
size: "sm"
|
|
1399
|
-
}),
|
|
1400
|
-
we(" " + _(`(${j.netSuiteId}) ${j.name}: ${j.reason}`), 1)
|
|
1401
|
-
]))), 128))
|
|
1402
|
-
])
|
|
1403
|
-
];
|
|
1404
|
-
}),
|
|
1405
|
-
default: ue(() => [
|
|
1406
|
-
K(p, {
|
|
1407
|
-
name: "error",
|
|
1408
|
-
color: "#ff2c2c",
|
|
1409
|
-
size: "sm"
|
|
1410
|
-
})
|
|
1411
|
-
]),
|
|
1412
|
-
_: 1
|
|
1413
|
-
})) : A("", !0)
|
|
1414
|
-
])
|
|
1415
|
-
]),
|
|
1416
|
-
K(ee),
|
|
1417
|
-
(v(!0), w(ae, null, ve(((pe = r.purchaseOrder) == null ? void 0 : pe.items) ?? [], (D) => {
|
|
1418
|
-
var C;
|
|
1419
|
-
return v(), w("div", {
|
|
1420
|
-
key: D.code,
|
|
1421
|
-
class: "flex flex-col"
|
|
1422
|
-
}, [
|
|
1423
|
-
s("div", fr, [
|
|
1424
|
-
s("div", pr, _(D.name), 1),
|
|
1425
|
-
s("div", vr, _(u(me)(se.value[D.sku._id], !1)) + "/" + _(u(He)(D.quantity, D.sku.unit, D.measurement)), 1)
|
|
1426
|
-
]),
|
|
1427
|
-
s("div", yr, [
|
|
1428
|
-
s("div", hr, _(D.code), 1),
|
|
1429
|
-
(C = D.totalCost) != null && C.amount && u(k).enableTotalCost ? (v(), w("div", br, " (" + _(u(be)(D.totalCost)) + ") ", 1)) : A("", !0)
|
|
1430
|
-
])
|
|
1431
|
-
]);
|
|
1432
|
-
}), 128)),
|
|
1433
|
-
+u(me)(ce.value) ? (v(), w(ae, { key: 0 }, [
|
|
1434
|
-
s("div", gr, [
|
|
1435
|
-
K(ee)
|
|
1436
|
-
]),
|
|
1437
|
-
s("div", _r, [
|
|
1438
|
-
l[11] || (l[11] = s("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
|
|
1439
|
-
s("div", Sr, _(u(be)(ce.value)), 1)
|
|
1440
|
-
])
|
|
1441
|
-
], 64)) : A("", !0)
|
|
1442
|
-
])
|
|
1443
|
-
])
|
|
1444
|
-
], 64)) : E.value.value === "deliveryHistory" ? (v(), w("div", wr, [
|
|
1445
|
-
B.value.length ? (v(), w("div", Dr, [
|
|
1446
|
-
(v(!0), w(ae, null, ve(B.value, (D, C) => (v(), w(ae, { key: C }, [
|
|
1447
|
-
s("div", Ar, [
|
|
1448
|
-
s("div", kr, [
|
|
1449
|
-
s("div", Tr, [
|
|
1450
|
-
s("div", {
|
|
1451
|
-
class: ge([
|
|
1452
|
-
{
|
|
1453
|
-
"bg-fm-color-primary": C !== 0,
|
|
1454
|
-
"bg-white": C === 0
|
|
1455
|
-
},
|
|
1456
|
-
"w-[2px] h-full"
|
|
1457
|
-
])
|
|
1458
|
-
}, null, 2)
|
|
1459
|
-
]),
|
|
1460
|
-
l[12] || (l[12] = s("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1461
|
-
s("div", $r, [
|
|
1462
|
-
s("div", {
|
|
1463
|
-
class: ge([
|
|
1464
|
-
{
|
|
1465
|
-
"bg-fm-color-primary": C < B.value.length - 1,
|
|
1466
|
-
"bg-white": C >= B.value.length - 1
|
|
1467
|
-
},
|
|
1468
|
-
"w-[2px] h-full"
|
|
1469
|
-
])
|
|
1470
|
-
}, null, 2)
|
|
1471
|
-
])
|
|
1472
|
-
]),
|
|
1473
|
-
s("div", Pr, [
|
|
1474
|
-
s("div", qr, _(D.header), 1),
|
|
1475
|
-
s("div", Er, _(D.date), 1)
|
|
1476
|
-
])
|
|
1477
|
-
]),
|
|
1478
|
-
s("div", Cr, [
|
|
1479
|
-
s("div", Ir, [
|
|
1480
|
-
s("div", Fr, [
|
|
1481
|
-
s("div", {
|
|
1482
|
-
class: ge([
|
|
1483
|
-
{
|
|
1484
|
-
"bg-fm-color-primary": C < B.value.length - 1,
|
|
1485
|
-
"bg-white": C >= B.value.length - 1
|
|
1486
|
-
},
|
|
1487
|
-
"w-[2px] h-full"
|
|
1488
|
-
])
|
|
1489
|
-
}, null, 2)
|
|
1490
|
-
])
|
|
1491
|
-
]),
|
|
1492
|
-
s("div", Ur, [
|
|
1493
|
-
K(te, {
|
|
1494
|
-
variant: "outlined",
|
|
1495
|
-
class: "py-12 px-16"
|
|
1496
|
-
}, {
|
|
1497
|
-
default: ue(() => [
|
|
1498
|
-
s("div", Lr, [
|
|
1499
|
-
(v(!0), w(ae, null, ve(D.info, (j, z) => (v(), w("div", {
|
|
1500
|
-
key: z,
|
|
1501
|
-
class: "flex flex-col gap-4"
|
|
1502
|
-
}, [
|
|
1503
|
-
s("div", Br, _(j == null ? void 0 : j.label), 1),
|
|
1504
|
-
s("div", Mr, [
|
|
1505
|
-
(v(!0), w(ae, null, ve(j == null ? void 0 : j.values, (ie, he) => (v(), w("div", {
|
|
1506
|
-
key: he,
|
|
1507
|
-
class: "fm-typo-en-body-lg-600"
|
|
1508
|
-
}, [
|
|
1509
|
-
typeof ie == "string" ? (v(), w(ae, { key: 0 }, [
|
|
1510
|
-
we(_(ie), 1)
|
|
1511
|
-
], 64)) : (v(), Z(ot(ie), { key: 1 }))
|
|
1512
|
-
]))), 128))
|
|
1513
|
-
])
|
|
1514
|
-
]))), 128))
|
|
1515
|
-
])
|
|
1516
|
-
]),
|
|
1517
|
-
_: 2
|
|
1518
|
-
}, 1024)
|
|
1519
|
-
])
|
|
1520
|
-
])
|
|
1521
|
-
], 64))), 128))
|
|
1522
|
-
])) : (v(), w("div", Or, [
|
|
1523
|
-
K(b),
|
|
1524
|
-
s("div", null, [
|
|
1525
|
-
s("img", {
|
|
1526
|
-
src: u(ut),
|
|
1527
|
-
alt: "List is empty"
|
|
1528
|
-
}, null, 8, Rr)
|
|
1529
|
-
]),
|
|
1530
|
-
s("div", xr, _(u(f)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
1531
|
-
s("div", Nr, _(u(f)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
|
|
1532
|
-
K(b),
|
|
1533
|
-
K(b)
|
|
1534
|
-
]))
|
|
1535
|
-
])) : A("", !0)
|
|
1536
|
-
])
|
|
1537
|
-
];
|
|
1538
|
-
}),
|
|
1539
|
-
"side-sheet-footer": ue(() => {
|
|
1540
|
-
var U, X, ne, L, oe, fe, pe, D, C, j;
|
|
1541
|
-
return [
|
|
1542
|
-
s("div", jr, [
|
|
1543
|
-
((U = r.purchaseOrder) == null ? void 0 : U.status) === u(F).enum.DRAFT && c.value === u(le).PURCHASE ? (v(), Z(S, {
|
|
1544
|
-
key: 0,
|
|
1545
|
-
label: u(f)("inventory.transfer.receiveRequest.actions.confirmDraft"),
|
|
1546
|
-
onClick: l[1] || (l[1] = (z) => I("confirmDraft")),
|
|
1547
|
-
loading: a.value === "confirmDraft",
|
|
1548
|
-
disabled: a.value !== "confirmDraft" && o.value
|
|
1549
|
-
}, null, 8, ["label", "loading", "disabled"])) : A("", !0),
|
|
1550
|
-
((X = r.purchaseOrder) == null ? void 0 : X.status) === u(F).enum.DRAFT && c.value === u(le).TRANSFER ? (v(), Z(S, {
|
|
1551
|
-
key: 1,
|
|
1552
|
-
label: u(f)("inventory.transfer.receiveRequest.actions.submitRequest"),
|
|
1553
|
-
onClick: l[2] || (l[2] = (z) => I("submitRequest")),
|
|
1554
|
-
loading: a.value === "submitRequest",
|
|
1555
|
-
disabled: a.value !== "submitRequest" && o.value
|
|
1556
|
-
}, null, 8, ["label", "loading", "disabled"])) : A("", !0),
|
|
1557
|
-
((ne = r.purchaseOrder) == null ? void 0 : ne.status) === u(F).enum.DRAFT ? (v(), Z(S, {
|
|
1558
|
-
key: 2,
|
|
1559
|
-
label: u(f)("inventory.transfer.receiveRequest.actions.cancelDraft"),
|
|
1560
|
-
onClick: l[3] || (l[3] = (z) => I("cancelDraft")),
|
|
1561
|
-
loading: a.value === "cancelDraft",
|
|
1562
|
-
disabled: a.value !== "cancelDraft" && o.value,
|
|
1563
|
-
variant: "destructive"
|
|
1564
|
-
}, null, 8, ["label", "loading", "disabled"])) : A("", !0),
|
|
1565
|
-
((L = r.purchaseOrder) == null ? void 0 : L.status) === u(F).enum.RECEIVING ? (v(), Z(S, {
|
|
1566
|
-
key: 3,
|
|
1567
|
-
label: u(f)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
1568
|
-
onClick: l[4] || (l[4] = (z) => I("completeReceive")),
|
|
1569
|
-
loading: a.value === "completeReceive",
|
|
1570
|
-
disabled: a.value !== "completeReceive" && o.value
|
|
1571
|
-
}, null, 8, ["label", "loading", "disabled"])) : A("", !0),
|
|
1572
|
-
r.canResubmit ? (v(), Z(S, {
|
|
1573
|
-
key: 4,
|
|
1574
|
-
label: u(f)("inventory.transfer.receiveRequest.actions.resubmitRequest"),
|
|
1575
|
-
onClick: l[5] || (l[5] = (z) => I("submitRequest")),
|
|
1576
|
-
loading: a.value === "submitRequest",
|
|
1577
|
-
disabled: a.value !== "submitRequest" && o.value
|
|
1578
|
-
}, null, 8, ["label", "loading", "disabled"])) : A("", !0),
|
|
1579
|
-
(((oe = r.purchaseOrder) == null ? void 0 : oe.status) === u(F).enum.REQUESTING || ((fe = r.purchaseOrder) == null ? void 0 : fe.status) === u(F).enum.PROCESSING) && r.canApprove ? (v(), Z(S, {
|
|
1580
|
-
key: 5,
|
|
1581
|
-
label: u(f)("inventory.transfer.approval.actions.approveRequest"),
|
|
1582
|
-
onClick: l[6] || (l[6] = (z) => I("approveRequest")),
|
|
1583
|
-
loading: a.value === "approveRequest",
|
|
1584
|
-
disabled: a.value !== "approveRequest" && o.value
|
|
1585
|
-
}, null, 8, ["label", "loading", "disabled"])) : A("", !0),
|
|
1586
|
-
((pe = r.purchaseOrder) == null ? void 0 : pe.status) === u(F).enum.REQUESTING && r.canApprove ? (v(), Z(S, {
|
|
1587
|
-
key: 6,
|
|
1588
|
-
label: u(f)("inventory.transfer.approval.actions.rejectRequest"),
|
|
1589
|
-
onClick: l[7] || (l[7] = (z) => I("rejectRequest")),
|
|
1590
|
-
loading: a.value === "rejectRequest",
|
|
1591
|
-
disabled: a.value !== "rejectRequest" && o.value,
|
|
1592
|
-
variant: "destructive"
|
|
1593
|
-
}, null, 8, ["label", "loading", "disabled"])) : A("", !0),
|
|
1594
|
-
((D = r.purchaseOrder) == null ? void 0 : D.status) !== u(F).enum.COMPLETE && ((C = r.purchaseOrder) == null ? void 0 : C.status) !== u(F).enum.CANCEL && (((j = r.purchaseOrder) == null ? void 0 : j.status) !== u(F).enum.REQUESTING || r.canApprove) ? (v(), Z(S, {
|
|
1595
|
-
key: 7,
|
|
1596
|
-
label: u(f)("common.close"),
|
|
1597
|
-
variant: "tertiary",
|
|
1598
|
-
onClick: l[8] || (l[8] = (z) => i("update:show", !1))
|
|
1599
|
-
}, null, 8, ["label"])) : A("", !0)
|
|
1600
|
-
])
|
|
1601
|
-
];
|
|
1602
|
-
}),
|
|
1603
|
-
_: 1
|
|
1604
|
-
}, 8, ["header", "modelValue", "dismiss-away"]);
|
|
1605
|
-
};
|
|
1606
|
-
}
|
|
1607
|
-
});
|
|
1608
|
-
export {
|
|
1609
|
-
Ne as P,
|
|
1610
|
-
Zr as _,
|
|
1611
|
-
Xr as a,
|
|
1612
|
-
Jr as b,
|
|
1613
|
-
mt as g,
|
|
1614
|
-
$e as u
|
|
1615
|
-
};
|