@feedmepos/mf-inventory-portal 0.0.25-dev.31 → 0.0.25-dev.33
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-9X9XkRz2.js → App-BHIdSSIe.js} +2 -2
- package/dist/{ApprovalView-CoIwMOje.js → ApprovalView-BHsPq9fp.js} +2 -2
- package/dist/{BindingsDialog-B3ul7-vn.js → BindingsDialog-CcA_m9fC.js} +2 -2
- package/dist/{BindingsPicker-CWMHp2sY.js → BindingsPicker-UttPVr0V.js} +1 -1
- package/dist/{BindingsTable-BqST2NOr.js → BindingsTable-CQKt-n8j.js} +1 -1
- package/dist/{ClosingDraftView-CeN0MagA.js → ClosingDraftView-tYyeEBsI.js} +2 -2
- package/dist/{ClosingTemplateView-BmTacXGq.js → ClosingTemplateView-CjFaTKSv.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CigELrfY.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B544ZjAk.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Bp2oPPMX.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D6LxuLjN.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CbTEp_-D.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-hU74c6gB.js} +1 -1
- package/dist/{IngredientGroupView-DPpznEXs.js → IngredientGroupView-CjMBtQnL.js} +1 -1
- package/dist/{IngredientsView-D2RCvzFX.js → IngredientsView-Dr6lDeAa.js} +4 -4
- package/dist/{IntegrationView-Qxv2pvF6.js → IntegrationView-ltFLmByt.js} +1 -1
- package/dist/{InventoryBindingForm-Do7ElpgS.js → InventoryBindingForm-BVtDX2SX.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-veh3riBN.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CUykd8am.js} +3 -3
- package/dist/{InventoryBindingSummary-By58hpzm.js → InventoryBindingSummary-CvzXOSPU.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Dx3lo70J.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DNs_wg0e.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-E3HiIawC.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BCwv6pd5.js} +1 -1
- package/dist/{PublishView-C7Sk1xx_.js → PublishView-Cq_ylGgc.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-Dm6VK50g.js → PurchaseOrderPrintPreview-CYCmhU-e.js} +1 -1
- package/dist/{ReceiveRequestView-OjIHRXR0.js → ReceiveRequestView-LnqepR2e.js} +9 -9
- package/dist/{RecipeView-DvUxMPcE.js → RecipeView-CMs6Qt9A.js} +3 -3
- package/dist/{StockView-BmWtH5o7.js → StockView-e-PcQAKr.js} +7 -7
- package/dist/{SupplierView-CSRJiF0L.js → SupplierView-CeXmu4st.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BQ1zIGI5.js → TransferDetails.vue_vue_type_script_setup_true_lang-DW_wzTB0.js} +658 -646
- package/dist/{TransferTemplateView-DVZ-l-Qd.js → TransferTemplateView-_jXDAlSR.js} +7 -7
- package/dist/{UnitView-KxXsoPf-.js → UnitView-CYqpDvJJ.js} +3 -3
- package/dist/{WarehouseView-pP_XFBL6.js → WarehouseView-Ce8XkGoe.js} +1 -1
- package/dist/api/purchase-order.d.ts +4 -1
- package/dist/{app-qP-te2rC.js → app-mT4U5kNO.js} +3019 -2994
- package/dist/app.js +1 -1
- package/dist/{decimal-CNwkFnUQ.js → decimal-B7ZVTj3Q.js} +1 -1
- package/dist/{feature-D4R2fV5-.js → feature-BdqR6_vW.js} +1 -1
- package/dist/{format-unit-display-BmyzOzt2.js → format-unit-display-DgTlT1cC.js} +2 -2
- package/dist/{index-B6w232vo.js → index-BO9UatRG.js} +2 -2
- package/dist/{stock-XRT7HXo1.js → stock-CtxeFyYM.js} +1 -1
- package/dist/{supplier-BcKjL7Tk.js → supplier-Bz2bTujX.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-BjX2siCb.js → use-ingredient-select-dialog-q3WmGGOm.js} +1 -1
- package/dist/{use-inventory-binding-dialog-BypYql87.js → use-inventory-binding-dialog-D246fGyU.js} +1 -1
- package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +178 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +730 -11
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +556 -21
- package/dist/{vue-i18n-BRVI-fYl.js → vue-i18n-iWMdXkLq.js} +321 -321
- package/package.json +3 -3
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { W as it, u as Pe, aL as
|
|
2
|
-
import { ref as
|
|
1
|
+
import { W as it, u as Pe, aL as R, a5 as ct, a7 as ut, a8 as dt, am as ft, d as Be, e as tt, av as j, T as st, aM as mt, Y as Ke, K as qe, i as Oe, aN as rt, ac as Ee, f as Je, D as te, h as Q, b as ze, a6 as pt, as as Ze, a0 as $e, ai as Me, aw as vt } from "./app-mT4U5kNO.js";
|
|
2
|
+
import { ref as K, computed as X, h as N, defineComponent as Qe, onMounted as yt, unref as n, openBlock as c, createElementBlock as _, createElementVNode as e, toDisplayString as m, createCommentVNode as D, resolveComponent as ce, createVNode as B, watch as ht, createBlock as se, isRef as gt, withCtx as _e, Fragment as re, normalizeClass as ge, createTextVNode as je, renderList as Se, resolveDynamicComponent as bt } from "vue";
|
|
3
3
|
import { useI18n as at } from "@feedmepos/mf-common";
|
|
4
|
-
import { b as _t, u as St, f as Ge, P as
|
|
4
|
+
import { b as _t, u as St, f as Ge, P as be } from "./format-unit-display-DgTlT1cC.js";
|
|
5
5
|
import { E as et } from "./empty-placeholder-wf6-BWE8.js";
|
|
6
6
|
import { useDialog as Ye, useSnackbar as We, useProxiedModel as wt } from "@feedmepos/ui-library";
|
|
7
|
-
import { u as nt } from "./feature-
|
|
8
|
-
import { F as xt } from "./decimal-
|
|
7
|
+
import { u as nt } from "./feature-BdqR6_vW.js";
|
|
8
|
+
import { F as xt } from "./decimal-B7ZVTj3Q.js";
|
|
9
9
|
const Xe = it((p, v) => {
|
|
10
|
-
const
|
|
10
|
+
const a = Pe();
|
|
11
11
|
return {
|
|
12
|
-
async readRequests(
|
|
13
|
-
const
|
|
14
|
-
return await v.get(
|
|
12
|
+
async readRequests(i) {
|
|
13
|
+
const w = i ?? a.currentLocationDBName, x = `${p.inventoryBackendUrl}/${w}/purchase-request`;
|
|
14
|
+
return await v.get(x);
|
|
15
15
|
},
|
|
16
16
|
async getPurchaseOrders({
|
|
17
|
-
start:
|
|
18
|
-
end:
|
|
17
|
+
start: i,
|
|
18
|
+
end: w
|
|
19
19
|
}) {
|
|
20
|
-
const
|
|
21
|
-
return await v.get(`${
|
|
20
|
+
const x = a.currentLocationDBName, L = `${p.inventoryBackendUrl}/${x}/purchase-order`;
|
|
21
|
+
return await v.get(`${L}?start=${i}&end=${w}`);
|
|
22
22
|
},
|
|
23
|
-
async getLatestPurchaseOrderRequest(
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
return await v.get(`${
|
|
23
|
+
async getLatestPurchaseOrderRequest(i, w) {
|
|
24
|
+
w ?? (w = a.currentLocationDBName);
|
|
25
|
+
const x = `${p.inventoryBackendUrl}/${w}/purchase-request/find-by-purchase-order-id`;
|
|
26
|
+
return await v.get(`${x}/${i}`);
|
|
27
27
|
},
|
|
28
|
-
async getPurchaseOrderById(
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
return await v.get(`${
|
|
28
|
+
async getPurchaseOrderById(i, w) {
|
|
29
|
+
w ?? (w = a.currentLocationDBName);
|
|
30
|
+
const x = `${p.inventoryBackendUrl}/${w}/purchase-order`;
|
|
31
|
+
return await v.get(`${x}/${i}`);
|
|
32
32
|
},
|
|
33
|
-
async processPurchaseOrder(
|
|
34
|
-
const
|
|
35
|
-
return await v.put(
|
|
33
|
+
async processPurchaseOrder(i, w) {
|
|
34
|
+
const x = a.currentLocationDBName, L = w || x, q = `${p.inventoryBackendUrl}/${L}/purchase-order/run-operation`;
|
|
35
|
+
return await v.put(q, i);
|
|
36
36
|
},
|
|
37
|
-
async createPurchaseOrder(
|
|
38
|
-
const
|
|
39
|
-
return await v.post(
|
|
37
|
+
async createPurchaseOrder(i) {
|
|
38
|
+
const w = a.currentLocationDBName, x = `${p.inventoryBackendUrl}/${w}/purchase-order`;
|
|
39
|
+
return await v.post(x, i);
|
|
40
40
|
},
|
|
41
|
-
async updatePurchaseOrder(
|
|
42
|
-
const
|
|
43
|
-
return await v.put(
|
|
41
|
+
async updatePurchaseOrder(i) {
|
|
42
|
+
const w = a.currentLocationDBName, x = `${p.inventoryBackendUrl}/${w}/purchase-order`;
|
|
43
|
+
return await v.put(x, i);
|
|
44
44
|
},
|
|
45
|
-
async importFromXilnex(
|
|
46
|
-
const
|
|
47
|
-
return await v.post(
|
|
45
|
+
async importFromXilnex(i) {
|
|
46
|
+
const w = a.currentLocationDBName, x = `${p.inventoryBackendUrl}/${w}/purchase-order/import-from-xilnex`;
|
|
47
|
+
return await v.post(x, i);
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
}), ot = {
|
|
51
|
-
[
|
|
51
|
+
[R.enum.confirmDraft]: {
|
|
52
52
|
primaryActions: {
|
|
53
53
|
text: "Confirm draft",
|
|
54
54
|
close: !0
|
|
@@ -57,7 +57,7 @@ const Xe = it((p, v) => {
|
|
|
57
57
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
58
58
|
successMessage: "Purchase order draft has been confirmed"
|
|
59
59
|
},
|
|
60
|
-
[
|
|
60
|
+
[R.enum.cancelDraft]: {
|
|
61
61
|
primaryActions: {
|
|
62
62
|
text: "Cancel draft",
|
|
63
63
|
close: !0,
|
|
@@ -67,7 +67,7 @@ const Xe = it((p, v) => {
|
|
|
67
67
|
message: "Purchase order cannot be changed after cancelled draft.",
|
|
68
68
|
successMessage: "Purchase order draft has been cancelled"
|
|
69
69
|
},
|
|
70
|
-
[
|
|
70
|
+
[R.enum.submitRequest]: {
|
|
71
71
|
primaryActions: {
|
|
72
72
|
text: "Submit request",
|
|
73
73
|
close: !0
|
|
@@ -76,7 +76,7 @@ const Xe = it((p, v) => {
|
|
|
76
76
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
77
77
|
successMessage: "Purchase order draft has been submitted"
|
|
78
78
|
},
|
|
79
|
-
[
|
|
79
|
+
[R.enum.completeReceive]: {
|
|
80
80
|
primaryActions: {
|
|
81
81
|
text: "Mark received",
|
|
82
82
|
close: !0
|
|
@@ -85,7 +85,7 @@ const Xe = it((p, v) => {
|
|
|
85
85
|
message: "Purchase order cannot be changed after it has complete receiving.",
|
|
86
86
|
successMessage: "Purchase order has been marked as received"
|
|
87
87
|
},
|
|
88
|
-
[
|
|
88
|
+
[R.enum.approveRequest]: {
|
|
89
89
|
primaryActions: {
|
|
90
90
|
text: "Approve request",
|
|
91
91
|
close: !0
|
|
@@ -94,7 +94,7 @@ const Xe = it((p, v) => {
|
|
|
94
94
|
message: "Purchase order will be approved.",
|
|
95
95
|
successMessage: "Purchase order has been approved"
|
|
96
96
|
},
|
|
97
|
-
[
|
|
97
|
+
[R.enum.rejectRequest]: {
|
|
98
98
|
primaryActions: {
|
|
99
99
|
text: "Reject request",
|
|
100
100
|
close: !0,
|
|
@@ -106,46 +106,46 @@ const Xe = it((p, v) => {
|
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
var He = /* @__PURE__ */ ((p) => (p.RECEIVE_REQUEST = "receive/request", p.APPROVAL = "approval", p))(He || {});
|
|
109
|
-
const
|
|
109
|
+
const we = K(), Ve = K();
|
|
110
110
|
function Fr(p, v) {
|
|
111
|
-
const
|
|
111
|
+
const a = Ye(), i = Pe(), w = nt(), x = _t(), L = St(), q = K(!1), u = We(), t = Xe(), o = K(new Array()), l = K(
|
|
112
112
|
v != null && v.startDate && (v != null && v.endDate) ? v : ct()
|
|
113
|
-
),
|
|
114
|
-
const y = new Date(
|
|
113
|
+
), d = X(() => {
|
|
114
|
+
const y = new Date(l.value.startDate), h = new Date(l.value.endDate);
|
|
115
115
|
return {
|
|
116
116
|
start: ut(y).toISOString(),
|
|
117
117
|
end: dt(h).toISOString()
|
|
118
118
|
};
|
|
119
|
-
}),
|
|
120
|
-
function
|
|
119
|
+
}), f = K(new Array()), F = ft(), U = K(null);
|
|
120
|
+
function J(y) {
|
|
121
121
|
const h = {
|
|
122
122
|
mode: Be.CREATE,
|
|
123
123
|
modelValue: void 0,
|
|
124
124
|
returnFrom: y,
|
|
125
125
|
show: !0,
|
|
126
|
-
"onUpdate:show"(
|
|
127
|
-
|
|
126
|
+
"onUpdate:show"(s) {
|
|
127
|
+
we.value.show = s;
|
|
128
128
|
},
|
|
129
129
|
lastClosingDate: U.value
|
|
130
130
|
};
|
|
131
|
-
|
|
131
|
+
we.value = h;
|
|
132
132
|
}
|
|
133
|
-
async function
|
|
134
|
-
function h(
|
|
135
|
-
const
|
|
133
|
+
async function T(y) {
|
|
134
|
+
function h(r) {
|
|
135
|
+
const O = {
|
|
136
136
|
mode: Be.CREATE,
|
|
137
137
|
modelValue: y || void 0,
|
|
138
138
|
show: !0,
|
|
139
|
-
"onUpdate:show"(
|
|
140
|
-
|
|
139
|
+
"onUpdate:show"(k) {
|
|
140
|
+
we.value.show = k;
|
|
141
141
|
},
|
|
142
|
-
templateId:
|
|
142
|
+
templateId: r,
|
|
143
143
|
lastClosingDate: U.value
|
|
144
144
|
};
|
|
145
|
-
|
|
145
|
+
we.value = O;
|
|
146
146
|
}
|
|
147
|
-
let
|
|
148
|
-
|
|
147
|
+
let s;
|
|
148
|
+
w.mustUsePoTemplate && !(y != null && y.template) ? a.open({
|
|
149
149
|
title: "Create transfer",
|
|
150
150
|
message: "",
|
|
151
151
|
primaryActions: {
|
|
@@ -158,170 +158,170 @@ function Fr(p, v) {
|
|
|
158
158
|
close: !0
|
|
159
159
|
}
|
|
160
160
|
}).onPrimary(async () => {
|
|
161
|
-
|
|
161
|
+
s = await x.getTemplateId(), s && h(s);
|
|
162
162
|
}).onSecondary(() => {
|
|
163
163
|
h(void 0);
|
|
164
|
-
}) : h(
|
|
164
|
+
}) : h(s);
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function M(y) {
|
|
167
167
|
const h = {
|
|
168
168
|
mode: Be.UPDATE,
|
|
169
169
|
modelValue: tt(y),
|
|
170
170
|
show: !0,
|
|
171
|
-
"onUpdate:show"(
|
|
172
|
-
|
|
171
|
+
"onUpdate:show"(s) {
|
|
172
|
+
we.value.show = s;
|
|
173
173
|
},
|
|
174
174
|
lastClosingDate: U.value
|
|
175
175
|
};
|
|
176
|
-
|
|
176
|
+
we.value = h;
|
|
177
177
|
}
|
|
178
|
-
async function
|
|
179
|
-
|
|
178
|
+
async function Y() {
|
|
179
|
+
o.value = [], q.value = !0;
|
|
180
180
|
try {
|
|
181
|
-
|
|
181
|
+
o.value = await t.getPurchaseOrders(d.value).then((s) => s.sort((r, O) => O._id.localeCompare(r._id)));
|
|
182
182
|
const y = await F.readLastClosing(!0), h = y == null ? void 0 : y._id;
|
|
183
|
-
h && (U.value = mt(h)),
|
|
183
|
+
h && (U.value = mt(h)), w.mustUsePoTemplate && await L.fetchTemplates();
|
|
184
184
|
} catch {
|
|
185
|
-
|
|
185
|
+
u.open({
|
|
186
186
|
title: "Something went wrong",
|
|
187
187
|
message: "Error at fetching purchase orders",
|
|
188
188
|
type: "error"
|
|
189
189
|
});
|
|
190
190
|
} finally {
|
|
191
|
-
|
|
191
|
+
q.value = !1;
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
async function
|
|
195
|
-
|
|
194
|
+
async function de() {
|
|
195
|
+
f.value = [], q.value = !0;
|
|
196
196
|
try {
|
|
197
|
-
|
|
197
|
+
f.value = await t.readRequests().then((y) => y.reverse());
|
|
198
198
|
} catch {
|
|
199
|
-
|
|
199
|
+
u.open({
|
|
200
200
|
title: "Something went wrong",
|
|
201
201
|
message: "Error at fetching purchase requests",
|
|
202
202
|
type: "error"
|
|
203
203
|
});
|
|
204
204
|
} finally {
|
|
205
|
-
|
|
205
|
+
q.value = !1;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function Z() {
|
|
209
209
|
switch (p) {
|
|
210
210
|
case "receive/request":
|
|
211
|
-
return
|
|
211
|
+
return Y();
|
|
212
212
|
case "approval":
|
|
213
|
-
return
|
|
213
|
+
return de();
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
|
|
216
|
+
function fe(y, h) {
|
|
217
|
+
l.value = {
|
|
218
218
|
startDate: y,
|
|
219
219
|
endDate: h
|
|
220
|
-
},
|
|
220
|
+
}, Z();
|
|
221
221
|
}
|
|
222
|
-
|
|
222
|
+
i.watchLocation(async (y) => {
|
|
223
223
|
if (!y) {
|
|
224
|
-
|
|
224
|
+
o.value = [];
|
|
225
225
|
return;
|
|
226
226
|
}
|
|
227
|
-
await
|
|
227
|
+
await Z();
|
|
228
228
|
});
|
|
229
|
-
const z =
|
|
229
|
+
const z = K(), Ce = K(Math.random().toString());
|
|
230
230
|
async function Ie(y, h) {
|
|
231
|
-
var
|
|
232
|
-
const
|
|
233
|
-
Ce.value =
|
|
234
|
-
const
|
|
231
|
+
var k, P;
|
|
232
|
+
const s = Math.random().toString();
|
|
233
|
+
Ce.value = s;
|
|
234
|
+
const r = p === "receive/request" ? i.currentLocation : h == null ? void 0 : h.to, O = {
|
|
235
235
|
poRequest: h,
|
|
236
236
|
purchaseOrder: y,
|
|
237
|
-
transferTo:
|
|
238
|
-
transferToDbName:
|
|
237
|
+
transferTo: r == null ? void 0 : r.name,
|
|
238
|
+
transferToDbName: r == null ? void 0 : r.dbName,
|
|
239
239
|
show: !0,
|
|
240
240
|
canResubmit: !1,
|
|
241
241
|
canApprove: p === "approval",
|
|
242
|
-
"onUpdate:show"(
|
|
243
|
-
z.value.show =
|
|
242
|
+
"onUpdate:show"(C) {
|
|
243
|
+
z.value.show = C;
|
|
244
244
|
},
|
|
245
245
|
scope: p
|
|
246
246
|
};
|
|
247
|
-
if (z.value =
|
|
247
|
+
if (z.value = O, !(h || y.status !== j.enum.REQUESTING)) {
|
|
248
248
|
try {
|
|
249
|
-
h = (await
|
|
249
|
+
h = (await t.readRequests(
|
|
250
250
|
`${y.supplier.internal}_${y.supplier._id}`
|
|
251
|
-
)).find((
|
|
251
|
+
)).find((G) => G.purchaseOrderId === y._id);
|
|
252
252
|
} catch {
|
|
253
253
|
console.error("Error at fetching po request to check");
|
|
254
254
|
}
|
|
255
|
-
|
|
255
|
+
s === Ce.value && (z.value.canResubmit = !h, z.value.transferTo = (k = h == null ? void 0 : h.to) == null ? void 0 : k.name, z.value.transferToDbName = (P = h == null ? void 0 : h.to) == null ? void 0 : P.dbName);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
async function
|
|
259
|
-
|
|
258
|
+
async function ae(y, h, s, r) {
|
|
259
|
+
q.value = !0;
|
|
260
260
|
try {
|
|
261
|
-
await
|
|
261
|
+
await t.processPurchaseOrder(
|
|
262
262
|
{
|
|
263
263
|
operation: h,
|
|
264
264
|
doc: y,
|
|
265
265
|
options: (
|
|
266
266
|
// auto receive for supplier to warehouse
|
|
267
|
-
(h ===
|
|
268
|
-
h ===
|
|
267
|
+
(h === R.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
268
|
+
h === R.enum.completeReceive) && w.autoReceiveWarehouse ? {
|
|
269
269
|
autoReceive: !0
|
|
270
270
|
} : void 0
|
|
271
271
|
)
|
|
272
272
|
},
|
|
273
|
-
|
|
274
|
-
), await new Promise((
|
|
275
|
-
const
|
|
276
|
-
h ===
|
|
273
|
+
r
|
|
274
|
+
), await new Promise((P) => setTimeout(P, 1e3));
|
|
275
|
+
const k = Pe().currentLocationDBName.startsWith("restaurant_");
|
|
276
|
+
h === R.enum.confirmDraft && y.effectiveAt && k ? u.open({
|
|
277
277
|
title: "Success",
|
|
278
|
-
message: `${
|
|
278
|
+
message: `${s}. The backdate will be reflected once your POS has received this change.`,
|
|
279
279
|
type: "success"
|
|
280
|
-
}) :
|
|
280
|
+
}) : u.open({
|
|
281
281
|
title: "Success",
|
|
282
|
-
message:
|
|
282
|
+
message: s,
|
|
283
283
|
type: "success"
|
|
284
284
|
});
|
|
285
|
-
} catch (
|
|
286
|
-
|
|
285
|
+
} catch (O) {
|
|
286
|
+
u.open({
|
|
287
287
|
title: "Something went wrong",
|
|
288
288
|
message: "Please try again.",
|
|
289
289
|
type: "error"
|
|
290
|
-
}), console.error("Error when submitting PO operation", h, y,
|
|
290
|
+
}), console.error("Error when submitting PO operation", h, y, O);
|
|
291
291
|
} finally {
|
|
292
|
-
|
|
292
|
+
q.value = !1, Z();
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
async function Le(y, h,
|
|
296
|
-
if (h ===
|
|
297
|
-
return
|
|
295
|
+
async function Le(y, h, s, r) {
|
|
296
|
+
if (h === R.enum.returnStock)
|
|
297
|
+
return r ? ae(
|
|
298
298
|
{
|
|
299
299
|
returnOrder: y,
|
|
300
|
-
purchaseOrder:
|
|
300
|
+
purchaseOrder: r
|
|
301
301
|
},
|
|
302
302
|
h,
|
|
303
303
|
"Transfer order successfully created."
|
|
304
304
|
) : void 0;
|
|
305
|
-
const
|
|
306
|
-
if (!
|
|
307
|
-
|
|
305
|
+
const O = ot[h];
|
|
306
|
+
if (!O) {
|
|
307
|
+
u.open({
|
|
308
308
|
title: "Something went wrong",
|
|
309
309
|
message: `Cannot process order: ${st(h)}`,
|
|
310
310
|
type: "error"
|
|
311
311
|
});
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
|
-
const { successMessage:
|
|
315
|
-
|
|
316
|
-
title:
|
|
317
|
-
message:
|
|
318
|
-
primaryActions:
|
|
314
|
+
const { successMessage: k, ...P } = O;
|
|
315
|
+
a.open({
|
|
316
|
+
title: P.title,
|
|
317
|
+
message: P.message,
|
|
318
|
+
primaryActions: P.primaryActions
|
|
319
319
|
}).onPrimary(() => {
|
|
320
|
-
|
|
320
|
+
ae(y, h, k, s);
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
323
|
async function Fe() {
|
|
324
|
-
|
|
324
|
+
a.open({
|
|
325
325
|
title: "Upload Transfer",
|
|
326
326
|
primaryActions: {
|
|
327
327
|
text: "Xilnex transfer note",
|
|
@@ -342,15 +342,15 @@ function Fr(p, v) {
|
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
344
|
return {
|
|
345
|
-
purchaseOrders:
|
|
346
|
-
purchaseRequests:
|
|
347
|
-
updateDateRange:
|
|
348
|
-
fetchData:
|
|
349
|
-
loading:
|
|
350
|
-
transferDialogProps:
|
|
351
|
-
promptCreateTransferDialog:
|
|
352
|
-
promptUpdateTransferDialog:
|
|
353
|
-
promptReturnTransferDialog:
|
|
345
|
+
purchaseOrders: o,
|
|
346
|
+
purchaseRequests: f,
|
|
347
|
+
updateDateRange: fe,
|
|
348
|
+
fetchData: Z,
|
|
349
|
+
loading: q,
|
|
350
|
+
transferDialogProps: we,
|
|
351
|
+
promptCreateTransferDialog: T,
|
|
352
|
+
promptUpdateTransferDialog: M,
|
|
353
|
+
promptReturnTransferDialog: J,
|
|
354
354
|
transferDetailsProps: z,
|
|
355
355
|
promptShowTransferDetails: Ie,
|
|
356
356
|
submitAction: Le,
|
|
@@ -358,26 +358,26 @@ function Fr(p, v) {
|
|
|
358
358
|
promptUploadTransferDialog: Fe
|
|
359
359
|
};
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function Ot(p, v) {
|
|
362
362
|
return v.reduce(
|
|
363
|
-
(
|
|
364
|
-
const
|
|
365
|
-
return
|
|
363
|
+
(i, w) => {
|
|
364
|
+
const x = w.received.find((L) => L.sku._id === p._id);
|
|
365
|
+
return x && (i = Ke(i, x.amount)), i;
|
|
366
366
|
},
|
|
367
|
-
xt.toPrecision(
|
|
367
|
+
xt.toPrecision(qe(0), p.unit.precision)
|
|
368
368
|
);
|
|
369
369
|
}
|
|
370
370
|
function lt(p, v) {
|
|
371
|
-
const { name:
|
|
372
|
-
name:
|
|
373
|
-
registrationNumber:
|
|
374
|
-
line1:
|
|
375
|
-
line2:
|
|
376
|
-
postcode:
|
|
377
|
-
city:
|
|
378
|
-
state:
|
|
379
|
-
country:
|
|
380
|
-
},
|
|
371
|
+
const { name: a, address: i, regNo: w } = v.doc.profile, x = {
|
|
372
|
+
name: a,
|
|
373
|
+
registrationNumber: w,
|
|
374
|
+
line1: i == null ? void 0 : i.line1,
|
|
375
|
+
line2: i == null ? void 0 : i.line2,
|
|
376
|
+
postcode: i == null ? void 0 : i.postcode,
|
|
377
|
+
city: i == null ? void 0 : i.city,
|
|
378
|
+
state: i == null ? void 0 : i.state,
|
|
379
|
+
country: i == null ? void 0 : i.country
|
|
380
|
+
}, L = {
|
|
381
381
|
name: p.supplier.name,
|
|
382
382
|
registrationNumber: p.supplier.registrationNumber,
|
|
383
383
|
line1: p.supplier.address.line1,
|
|
@@ -386,177 +386,189 @@ function lt(p, v) {
|
|
|
386
386
|
city: p.supplier.address.city,
|
|
387
387
|
state: p.supplier.address.state,
|
|
388
388
|
country: p.supplier.address.country
|
|
389
|
-
},
|
|
390
|
-
const { sku:
|
|
391
|
-
|
|
389
|
+
}, q = p.items.map((l) => {
|
|
390
|
+
const { sku: d, measurement: f } = l, F = Oe(
|
|
391
|
+
Ot(l.sku, p.deliveryOrder || []),
|
|
392
392
|
!1
|
|
393
393
|
);
|
|
394
394
|
return {
|
|
395
|
-
code:
|
|
396
|
-
description:
|
|
397
|
-
quantity: Ge(
|
|
398
|
-
unit: (
|
|
395
|
+
code: d.code,
|
|
396
|
+
description: d.name,
|
|
397
|
+
quantity: Ge(l.quantity, d.unit, l.measurement),
|
|
398
|
+
unit: (f == null ? void 0 : f.abbrev) || d.unit.abbrev,
|
|
399
399
|
received: F
|
|
400
400
|
};
|
|
401
|
-
}),
|
|
402
|
-
createdAt: rt(new Date(
|
|
403
|
-
ref:
|
|
404
|
-
remark:
|
|
405
|
-
items:
|
|
406
|
-
var
|
|
401
|
+
}), u = p.deliveryOrder.map((l) => ({
|
|
402
|
+
createdAt: rt(new Date(l.createdAt)),
|
|
403
|
+
ref: l.deliveryOrderNumber,
|
|
404
|
+
remark: l.remark || "",
|
|
405
|
+
items: l.received.map((d) => {
|
|
406
|
+
var f;
|
|
407
407
|
return {
|
|
408
|
-
code:
|
|
409
|
-
description:
|
|
410
|
-
quantity:
|
|
411
|
-
unit: ((
|
|
408
|
+
code: d.sku.code,
|
|
409
|
+
description: d.sku.name,
|
|
410
|
+
quantity: Oe(d.amount),
|
|
411
|
+
unit: ((f = d.measurement) == null ? void 0 : f.abbrev) || d.sku.unit.abbrev
|
|
412
412
|
};
|
|
413
413
|
})
|
|
414
|
-
})),
|
|
414
|
+
})), t = {
|
|
415
415
|
orderNumber: p.seqNumber.toString(),
|
|
416
416
|
createdAt: Ee(p._id),
|
|
417
417
|
ref: p.ref || "",
|
|
418
418
|
remark: p.remark || "",
|
|
419
|
-
buyer:
|
|
420
|
-
supplier:
|
|
421
|
-
items:
|
|
419
|
+
buyer: x,
|
|
420
|
+
supplier: L,
|
|
421
|
+
items: q,
|
|
422
422
|
status: p.status,
|
|
423
|
-
deliveryOrders:
|
|
424
|
-
},
|
|
425
|
-
|
|
423
|
+
deliveryOrders: u
|
|
424
|
+
}, o = new URL("https://inventory.feedme.cc");
|
|
425
|
+
o.pathname = o.hostname.includes("inventory.feedme") || o.hostname.includes("localhost") ? "/receive-request/print-preview" : "/inventory/receive-request/print-preview", o.searchParams.append("data", JSON.stringify(t)), window.open(o.href, "_blank", "noreferrer");
|
|
426
426
|
}
|
|
427
427
|
const xe = {
|
|
428
428
|
submitRequest: {
|
|
429
429
|
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
430
430
|
color: "text-fm-color-typo-primary",
|
|
431
|
-
value:
|
|
431
|
+
value: R.enum.submitRequest
|
|
432
432
|
},
|
|
433
433
|
confirmDraft: {
|
|
434
434
|
translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
|
|
435
435
|
color: "text-fm-color-typo-primary",
|
|
436
|
-
value:
|
|
436
|
+
value: R.enum.confirmDraft
|
|
437
437
|
},
|
|
438
438
|
cancelDraft: {
|
|
439
439
|
translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
|
|
440
440
|
color: "text-fm-color-typo-error",
|
|
441
|
-
value:
|
|
441
|
+
value: R.enum.cancelDraft
|
|
442
442
|
},
|
|
443
443
|
approveRequest: {
|
|
444
444
|
translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
|
|
445
445
|
color: "text-fm-color-typo-primary",
|
|
446
|
-
value:
|
|
446
|
+
value: R.enum.approveRequest
|
|
447
447
|
},
|
|
448
448
|
rejectRequest: {
|
|
449
449
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
|
|
450
450
|
color: "text-fm-color-typo-error",
|
|
451
|
-
value:
|
|
451
|
+
value: R.enum.rejectRequest
|
|
452
452
|
},
|
|
453
453
|
processRequest: {
|
|
454
454
|
translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
|
|
455
455
|
color: "text-fm-color-typo-primary",
|
|
456
|
-
value:
|
|
456
|
+
value: R.enum.processRequest
|
|
457
457
|
},
|
|
458
458
|
receiveStock: {
|
|
459
459
|
translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
|
|
460
460
|
color: "text-fm-color-typo-primary",
|
|
461
|
-
value:
|
|
461
|
+
value: R.enum.receiveStock
|
|
462
462
|
},
|
|
463
463
|
completeReceive: {
|
|
464
464
|
translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
|
|
465
465
|
color: "text-fm-color-typo-primary",
|
|
466
|
-
value:
|
|
466
|
+
value: R.enum.completeReceive
|
|
467
467
|
},
|
|
468
468
|
returnStock: {
|
|
469
469
|
translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
|
|
470
470
|
color: "text-fm-color-typo-primary",
|
|
471
|
-
value:
|
|
471
|
+
value: R.enum.returnStock
|
|
472
472
|
}
|
|
473
473
|
};
|
|
474
474
|
function Ur(p, v) {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
475
|
+
Pe();
|
|
476
|
+
const { t: a } = at();
|
|
477
|
+
function i(t) {
|
|
478
|
+
switch (t.status) {
|
|
478
479
|
case "DRAFT":
|
|
479
480
|
return [
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
xe[
|
|
484
|
-
|
|
481
|
+
te[Q.Update],
|
|
482
|
+
te[Q.Details],
|
|
483
|
+
t.supplier.internal === "restaurant" || t.supplier.internal === "warehouse" ? xe[R.enum.submitRequest] : xe[R.enum.confirmDraft],
|
|
484
|
+
xe[R.enum.cancelDraft],
|
|
485
|
+
te[Q.Print]
|
|
485
486
|
];
|
|
486
487
|
case "RECEIVING":
|
|
487
488
|
return [
|
|
488
|
-
xe[
|
|
489
|
-
|
|
490
|
-
|
|
489
|
+
xe[R.enum.completeReceive],
|
|
490
|
+
te[Q.Details],
|
|
491
|
+
te[Q.Print]
|
|
491
492
|
];
|
|
492
493
|
case "REQUESTING":
|
|
493
|
-
return p === "receive/request" ? [
|
|
494
|
-
xe[
|
|
495
|
-
xe[
|
|
496
|
-
|
|
497
|
-
|
|
494
|
+
return p === "receive/request" ? [te[Q.Details], te[Q.Print]] : [
|
|
495
|
+
xe[R.enum.approveRequest],
|
|
496
|
+
xe[R.enum.rejectRequest],
|
|
497
|
+
te[Q.Details],
|
|
498
|
+
te[Q.Print]
|
|
498
499
|
];
|
|
499
500
|
case "PROCESSING":
|
|
500
|
-
return [
|
|
501
|
+
return [te[Q.Details], te[Q.Print]];
|
|
501
502
|
case "COMPLETE":
|
|
502
503
|
case "CANCEL":
|
|
503
504
|
default:
|
|
504
|
-
return [
|
|
505
|
+
return [te[Q.Details], te[Q.Print]];
|
|
505
506
|
}
|
|
506
507
|
}
|
|
507
|
-
function
|
|
508
|
-
return Object.values(
|
|
508
|
+
function w(t) {
|
|
509
|
+
return Object.values(R.enum).includes(t);
|
|
509
510
|
}
|
|
510
|
-
async function
|
|
511
|
-
var F, U;
|
|
512
|
-
const
|
|
513
|
-
if (
|
|
514
|
-
|
|
511
|
+
async function x(t, o, l) {
|
|
512
|
+
var f, F, U, J, T, M;
|
|
513
|
+
const d = tt(o);
|
|
514
|
+
if (t === Q.Print) {
|
|
515
|
+
const Y = (l == null ? void 0 : l.toInventoryLocation) ?? {
|
|
516
|
+
name: "",
|
|
517
|
+
type: "restaurant",
|
|
518
|
+
acceptRequest: !0,
|
|
519
|
+
dbName: "",
|
|
520
|
+
doc: {
|
|
521
|
+
_id: "",
|
|
522
|
+
businessId: "",
|
|
523
|
+
profile: {}
|
|
524
|
+
}
|
|
525
|
+
}, de = `${((f = l == null ? void 0 : l.netSuite) == null ? void 0 : f.id) ?? ""} ${((F = l == null ? void 0 : l.netSuite) == null ? void 0 : F.refNo) ?? ""}`.trim() || `${((U = d.netSuite) == null ? void 0 : U.id) ?? ""} ${((J = d.netSuite) == null ? void 0 : J.refNo) ?? ""}`.trim();
|
|
526
|
+
d.ref = [de ? `Netsuite: (${de})` : "", d.ref].filter((Z) => Z).join(" "), lt(d, Y);
|
|
515
527
|
return;
|
|
516
528
|
}
|
|
517
|
-
if (
|
|
518
|
-
v.promptShowTransferDetails(
|
|
519
|
-
console.error("error on promptShowTransferDetails", { error: Y, poRequest:
|
|
529
|
+
if (t === Q.Details) {
|
|
530
|
+
v.promptShowTransferDetails(d, l).catch((Y) => {
|
|
531
|
+
console.error("error on promptShowTransferDetails", { error: Y, poRequest: l });
|
|
520
532
|
});
|
|
521
533
|
return;
|
|
522
534
|
}
|
|
523
|
-
if (
|
|
524
|
-
(
|
|
535
|
+
if (t === Q.Update) {
|
|
536
|
+
(T = v.promptUpdateTransferDialog) == null || T.call(v, d);
|
|
525
537
|
return;
|
|
526
538
|
}
|
|
527
|
-
if (
|
|
528
|
-
v.submitAction(
|
|
529
|
-
console.error("error on po action", { action:
|
|
539
|
+
if (w(t) && t != R.enum.returnStock && t != R.enum.receiveStock) {
|
|
540
|
+
v.submitAction(o, t, (M = l == null ? void 0 : l.to) == null ? void 0 : M.dbName).then((Y) => {
|
|
541
|
+
console.error("error on po action", { action: t, error: Y });
|
|
530
542
|
});
|
|
531
543
|
return;
|
|
532
544
|
}
|
|
533
545
|
}
|
|
534
|
-
function
|
|
546
|
+
function L() {
|
|
535
547
|
return [
|
|
536
548
|
{
|
|
537
549
|
accessorKey: "seqNumber",
|
|
538
|
-
header: () =>
|
|
550
|
+
header: () => a("inventory.transfer.table.seqNo"),
|
|
539
551
|
enableSorting: !0,
|
|
540
552
|
size: 80,
|
|
541
553
|
sortUndefined: "last"
|
|
542
554
|
},
|
|
543
555
|
{
|
|
544
556
|
accessorKey: "_id",
|
|
545
|
-
header: () =>
|
|
546
|
-
cell(
|
|
547
|
-
return Ee(`${
|
|
557
|
+
header: () => a("inventory.transfer.table.createdAt"),
|
|
558
|
+
cell(t) {
|
|
559
|
+
return Ee(`${t.getValue()}`);
|
|
548
560
|
},
|
|
549
561
|
enableSorting: !0
|
|
550
562
|
},
|
|
551
563
|
{
|
|
552
564
|
accessorKey: "supplier.name",
|
|
553
|
-
header: () =>
|
|
565
|
+
header: () => a("inventory.transfer.table.transferFrom"),
|
|
554
566
|
enableSorting: !0,
|
|
555
567
|
size: 200
|
|
556
568
|
},
|
|
557
569
|
{
|
|
558
570
|
accessorKey: "items.length",
|
|
559
|
-
header: () =>
|
|
571
|
+
header: () => a("inventory.transfer.table.noOfItems"),
|
|
560
572
|
enableSorting: !1,
|
|
561
573
|
meta: {
|
|
562
574
|
width: "10rem"
|
|
@@ -564,15 +576,15 @@ function Ur(p, v) {
|
|
|
564
576
|
},
|
|
565
577
|
{
|
|
566
578
|
accessorKey: "ref",
|
|
567
|
-
header: () =>
|
|
579
|
+
header: () => a("inventory.transfer.table.reference"),
|
|
568
580
|
enableSorting: !1,
|
|
569
581
|
size: "auto"
|
|
570
582
|
},
|
|
571
583
|
{
|
|
572
584
|
accessorKey: "status",
|
|
573
|
-
header: () =>
|
|
574
|
-
cell(
|
|
575
|
-
const
|
|
585
|
+
header: () => a("inventory.transfer.table.status"),
|
|
586
|
+
cell(t) {
|
|
587
|
+
const o = a(`inventory.transfer.status.${t.getValue() ?? ""}`), l = `${t.getValue() ?? ""}`.toLocaleLowerCase("en-us");
|
|
576
588
|
return N(
|
|
577
589
|
"div",
|
|
578
590
|
{
|
|
@@ -581,9 +593,9 @@ function Ur(p, v) {
|
|
|
581
593
|
N(
|
|
582
594
|
"div",
|
|
583
595
|
{
|
|
584
|
-
class: `fm-status-badge fm-status-badge-${
|
|
596
|
+
class: `fm-status-badge fm-status-badge-${l}`
|
|
585
597
|
},
|
|
586
|
-
|
|
598
|
+
o
|
|
587
599
|
)
|
|
588
600
|
);
|
|
589
601
|
},
|
|
@@ -592,9 +604,9 @@ function Ur(p, v) {
|
|
|
592
604
|
},
|
|
593
605
|
{
|
|
594
606
|
id: "action",
|
|
595
|
-
cell(
|
|
596
|
-
const
|
|
597
|
-
return Je(
|
|
607
|
+
cell(t) {
|
|
608
|
+
const o = t.row.original, l = i(o);
|
|
609
|
+
return Je(l, (d) => x(d, o));
|
|
598
610
|
},
|
|
599
611
|
enableSorting: !1,
|
|
600
612
|
size: 40,
|
|
@@ -605,45 +617,45 @@ function Ur(p, v) {
|
|
|
605
617
|
}
|
|
606
618
|
];
|
|
607
619
|
}
|
|
608
|
-
function
|
|
620
|
+
function q() {
|
|
609
621
|
return [
|
|
610
622
|
{
|
|
611
623
|
accessorKey: "purchaseOrder.seqNumber",
|
|
612
|
-
header: () =>
|
|
624
|
+
header: () => a("inventory.transfer.table.seqNo"),
|
|
613
625
|
enableSorting: !0,
|
|
614
626
|
size: 80,
|
|
615
627
|
sortUndefined: "last"
|
|
616
628
|
},
|
|
617
629
|
{
|
|
618
630
|
accessorKey: "purchaseOrder._id",
|
|
619
|
-
header: () =>
|
|
620
|
-
cell(
|
|
621
|
-
return Ee(`${
|
|
631
|
+
header: () => a("inventory.transfer.table.createdAt"),
|
|
632
|
+
cell(t) {
|
|
633
|
+
return Ee(`${t.getValue()}`);
|
|
622
634
|
},
|
|
623
635
|
enableSorting: !0
|
|
624
636
|
},
|
|
625
637
|
{
|
|
626
638
|
accessorKey: "to.name",
|
|
627
|
-
header: () =>
|
|
639
|
+
header: () => a("inventory.transfer.table.transferTo"),
|
|
628
640
|
enableSorting: !1,
|
|
629
641
|
size: 200
|
|
630
642
|
},
|
|
631
643
|
{
|
|
632
644
|
accessorKey: "purchaseOrder.items.length",
|
|
633
|
-
header: () =>
|
|
645
|
+
header: () => a("inventory.transfer.table.noOfItems"),
|
|
634
646
|
enableSorting: !1
|
|
635
647
|
},
|
|
636
648
|
{
|
|
637
649
|
accessorKey: "purchaseOrder.ref",
|
|
638
|
-
header: () =>
|
|
650
|
+
header: () => a("inventory.transfer.table.reference"),
|
|
639
651
|
enableSorting: !1,
|
|
640
652
|
size: "auto"
|
|
641
653
|
},
|
|
642
654
|
{
|
|
643
655
|
accessorKey: "purchaseOrder.status",
|
|
644
|
-
header: () =>
|
|
645
|
-
cell(
|
|
646
|
-
const
|
|
656
|
+
header: () => a("inventory.transfer.table.status"),
|
|
657
|
+
cell(t) {
|
|
658
|
+
const o = a(`inventory.transfer.status.${t.getValue() ?? ""}`), l = `${t.getValue() ?? ""}`.toLocaleLowerCase("en-us");
|
|
647
659
|
return N(
|
|
648
660
|
"div",
|
|
649
661
|
{
|
|
@@ -652,9 +664,9 @@ function Ur(p, v) {
|
|
|
652
664
|
N(
|
|
653
665
|
"div",
|
|
654
666
|
{
|
|
655
|
-
class: `fm-status-badge fm-status-badge-${
|
|
667
|
+
class: `fm-status-badge fm-status-badge-${l}`
|
|
656
668
|
},
|
|
657
|
-
|
|
669
|
+
o
|
|
658
670
|
)
|
|
659
671
|
);
|
|
660
672
|
},
|
|
@@ -662,17 +674,17 @@ function Ur(p, v) {
|
|
|
662
674
|
},
|
|
663
675
|
{
|
|
664
676
|
id: "action",
|
|
665
|
-
cell(
|
|
666
|
-
const
|
|
677
|
+
cell(t) {
|
|
678
|
+
const o = t.row.original, l = o.purchaseOrder ? i(o.purchaseOrder) : [];
|
|
667
679
|
return Je(
|
|
668
|
-
|
|
669
|
-
(
|
|
670
|
-
|
|
680
|
+
l,
|
|
681
|
+
(d) => o.purchaseOrder ? x(
|
|
682
|
+
d,
|
|
671
683
|
{
|
|
672
|
-
...
|
|
673
|
-
_rev:
|
|
684
|
+
...o.purchaseOrder,
|
|
685
|
+
_rev: o.purchaseOrder._rev ?? ""
|
|
674
686
|
},
|
|
675
|
-
|
|
687
|
+
o
|
|
676
688
|
) : void 0
|
|
677
689
|
);
|
|
678
690
|
},
|
|
@@ -685,23 +697,23 @@ function Ur(p, v) {
|
|
|
685
697
|
}
|
|
686
698
|
];
|
|
687
699
|
}
|
|
688
|
-
const
|
|
700
|
+
const u = X(() => p === "receive/request" ? L() : q());
|
|
689
701
|
return {
|
|
690
702
|
get columnDefs() {
|
|
691
|
-
return
|
|
703
|
+
return u.value;
|
|
692
704
|
}
|
|
693
705
|
};
|
|
694
706
|
}
|
|
695
|
-
const
|
|
707
|
+
const kt = {
|
|
696
708
|
key: 0,
|
|
697
709
|
class: "flex flex-col gap-8"
|
|
698
|
-
},
|
|
710
|
+
}, Rt = { class: "flex flex-col gap-4" }, Dt = { class: "fm-typo-en-body-lg-600" }, Nt = {
|
|
699
711
|
key: 0,
|
|
700
712
|
class: "flex flex-col gap-4"
|
|
701
|
-
}, At = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
713
|
+
}, At = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Tt = { class: "fm-typo-en-body-lg-600" }, $t = { key: 0 }, Pt = { key: 1 }, Ct = {
|
|
702
714
|
key: 1,
|
|
703
715
|
class: "flex flex-col gap-4"
|
|
704
|
-
},
|
|
716
|
+
}, qt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Et = { class: "fm-typo-en-body-lg-600" }, It = { key: 0 }, Lt = { key: 1 }, Ft = {
|
|
705
717
|
key: 2,
|
|
706
718
|
class: "flex flex-col gap-4"
|
|
707
719
|
}, Ut = { class: "fm-typo-en-body-lg-600" }, Bt = {
|
|
@@ -718,57 +730,57 @@ const Ot = {
|
|
|
718
730
|
scope: {}
|
|
719
731
|
},
|
|
720
732
|
setup(p) {
|
|
721
|
-
const v = p,
|
|
733
|
+
const v = p, a = ze(), i = Xe(), w = K(v.poRequest);
|
|
722
734
|
yt(async () => {
|
|
723
|
-
var
|
|
724
|
-
if (!v.poRequest && ((
|
|
725
|
-
const
|
|
726
|
-
|
|
735
|
+
var u;
|
|
736
|
+
if (!v.poRequest && ((u = v.purchaseOrder) != null && u._id)) {
|
|
737
|
+
const t = await i.getLatestPurchaseOrderRequest(v.purchaseOrder._id);
|
|
738
|
+
w.value = t;
|
|
727
739
|
}
|
|
728
740
|
});
|
|
729
|
-
const
|
|
741
|
+
const x = X(
|
|
730
742
|
() => {
|
|
731
|
-
var
|
|
732
|
-
return
|
|
733
|
-
((
|
|
743
|
+
var u, t, o, l, d, f;
|
|
744
|
+
return a.getSubsidiaryFullName(
|
|
745
|
+
((o = (t = (u = v.purchaseOrder) == null ? void 0 : u.netSuite) == null ? void 0 : t.subsidiary) == null ? void 0 : o.id) || ((f = (d = (l = v.poRequest) == null ? void 0 : l.netSuite) == null ? void 0 : d.subsidiary) == null ? void 0 : f.id)
|
|
734
746
|
).fullName;
|
|
735
747
|
}
|
|
736
|
-
),
|
|
737
|
-
var
|
|
738
|
-
return (
|
|
739
|
-
}),
|
|
740
|
-
var
|
|
741
|
-
return (
|
|
748
|
+
), L = X(() => {
|
|
749
|
+
var u, t, o, l, d, f, F, U, J, T, M, Y;
|
|
750
|
+
return (o = (t = (u = v.purchaseOrder) == null ? void 0 : u.netSuite) == null ? void 0 : t.additionalInfo) != null && o.transactionnumber ? (f = (d = (l = v.purchaseOrder) == null ? void 0 : l.netSuite) == null ? void 0 : d.additionalInfo) == null ? void 0 : f.transactionnumber : (J = (U = (F = w.value) == null ? void 0 : F.netSuite) == null ? void 0 : U.additionalInfo) != null && J.transactionnumber ? (Y = (M = (T = w.value) == null ? void 0 : T.netSuite) == null ? void 0 : M.additionalInfo) == null ? void 0 : Y.transactionnumber : null;
|
|
751
|
+
}), q = X(() => {
|
|
752
|
+
var u, t, o, l, d, f;
|
|
753
|
+
return (t = (u = v.purchaseOrder) == null ? void 0 : u.deliveryFullfillment) != null && t.length && ((l = (o = v.purchaseOrder) == null ? void 0 : o.deliveryFullfillment) == null ? void 0 : l.length) > 0 ? (f = (d = v.purchaseOrder) == null ? void 0 : d.deliveryFullfillment) == null ? void 0 : f.map((F) => {
|
|
742
754
|
var U;
|
|
743
755
|
return (U = F.netSuite) == null ? void 0 : U.refNo;
|
|
744
756
|
}).join(", ") : "N/A";
|
|
745
757
|
});
|
|
746
|
-
return (
|
|
747
|
-
var
|
|
748
|
-
return
|
|
749
|
-
e("div",
|
|
750
|
-
|
|
751
|
-
e("div", Dt, m(
|
|
758
|
+
return (u, t) => {
|
|
759
|
+
var o, l, d, f, F, U, J, T, M, Y, de, Z, fe, z;
|
|
760
|
+
return n(a).isEnabled ? (c(), _("div", kt, [
|
|
761
|
+
e("div", Rt, [
|
|
762
|
+
t[0] || (t[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
763
|
+
e("div", Dt, m(x.value || "N/A"), 1)
|
|
752
764
|
]),
|
|
753
|
-
!
|
|
754
|
-
e("div", At, " NetSuite " + m(
|
|
755
|
-
e("div",
|
|
756
|
-
(
|
|
765
|
+
!u.isTransferBetweenOutlets && ((o = u.purchaseOrder) == null ? void 0 : o.status) !== n(j).Enum.REQUESTING && u.scope === n(He).RECEIVE_REQUEST ? (c(), _("div", Nt, [
|
|
766
|
+
e("div", At, " NetSuite " + m(u.transferType === n(be).PURCHASE ? "purchase order" : "transfer order") + " (ID) ", 1),
|
|
767
|
+
e("div", Tt, [
|
|
768
|
+
(d = (l = u.purchaseOrder) == null ? void 0 : l.netSuite) != null && d.id ? (c(), _("span", $t, m((F = (f = u.purchaseOrder) == null ? void 0 : f.netSuite) == null ? void 0 : F.refNo) + " (" + m((J = (U = u.purchaseOrder) == null ? void 0 : U.netSuite) == null ? void 0 : J.id) + ") ", 1)) : (c(), _("span", Pt, "N/A"))
|
|
757
769
|
])
|
|
758
770
|
])) : D("", !0),
|
|
759
|
-
!
|
|
760
|
-
e("div",
|
|
771
|
+
!u.isTransferBetweenOutlets && w.value && ((T = u.purchaseOrder) == null ? void 0 : T.status) === n(j).Enum.REQUESTING || u.scope === n(He).APPROVAL ? (c(), _("div", Ct, [
|
|
772
|
+
e("div", qt, " (Request) NetSuite " + m(u.transferType === n(be).PURCHASE ? "Purchase order" : "Transfer order") + " (ID) ", 1),
|
|
761
773
|
e("div", Et, [
|
|
762
|
-
(
|
|
774
|
+
(Y = (M = w.value) == null ? void 0 : M.netSuite) != null && Y.id ? (c(), _("span", It, m((Z = (de = w.value) == null ? void 0 : de.netSuite) == null ? void 0 : Z.refNo) + " (" + m((z = (fe = w.value) == null ? void 0 : fe.netSuite) == null ? void 0 : z.id) + ") ", 1)) : (c(), _("span", Lt, "N/A"))
|
|
763
775
|
])
|
|
764
776
|
])) : D("", !0),
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
e("div", Ut, m(
|
|
777
|
+
L.value ? (c(), _("div", Ft, [
|
|
778
|
+
t[1] || (t[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite transaction number ", -1)),
|
|
779
|
+
e("div", Ut, m(L.value), 1)
|
|
768
780
|
])) : D("", !0),
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
e("div", Mt, m(
|
|
781
|
+
n(a).isEnabled && u.transferType === n(be).TRANSFER && !u.isTransferBetweenOutlets ? (c(), _("div", Bt, [
|
|
782
|
+
t[2] || (t[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
783
|
+
e("div", Mt, m(q.value), 1)
|
|
772
784
|
])) : D("", !0)
|
|
773
785
|
])) : D("", !0);
|
|
774
786
|
};
|
|
@@ -784,15 +796,15 @@ const Ot = {
|
|
|
784
796
|
isTransferBetweenOutlets: { type: Boolean }
|
|
785
797
|
},
|
|
786
798
|
setup(p) {
|
|
787
|
-
const v = p,
|
|
788
|
-
var
|
|
789
|
-
let
|
|
790
|
-
|
|
791
|
-
const
|
|
792
|
-
return
|
|
799
|
+
const v = p, a = ze(), i = We(), w = Ye(), x = K(!1), L = X(() => {
|
|
800
|
+
var l, d, f, F;
|
|
801
|
+
let u = !0;
|
|
802
|
+
a.isEnabled || (u = !1);
|
|
803
|
+
const t = v.purchaseOrder, o = v.poRequest;
|
|
804
|
+
return t && ((l = t == null ? void 0 : t.supplier) != null && l.internal ? (!o && t.status == j.enum.DRAFT && (u = !1), o && !((d = o == null ? void 0 : o.netSuite) != null && d.id) && (u = !1), v.isTransferBetweenOutlets && (u = !1)) : ((t == null ? void 0 : t.status) !== j.enum.REQUESTING && t.supplier.internal && (u = !1), !o && !((f = t == null ? void 0 : t.netSuite) != null && f.id) && (u = !1), !o && ((F = t == null ? void 0 : t.netSuite) != null && F.id) && (t == null ? void 0 : t.status) == j.enum.REQUESTING && (u = !1))), u;
|
|
793
805
|
});
|
|
794
|
-
async function
|
|
795
|
-
|
|
806
|
+
async function q() {
|
|
807
|
+
x.value || w.open({
|
|
796
808
|
title: "Sync with NetSuite",
|
|
797
809
|
contentComponent: N("div", [
|
|
798
810
|
N("p", "Are you sure you want to sync now?"),
|
|
@@ -810,45 +822,45 @@ const Ot = {
|
|
|
810
822
|
},
|
|
811
823
|
secondaryActions: { text: "Not now", close: !0 }
|
|
812
824
|
}).onPrimary(async () => {
|
|
813
|
-
var
|
|
825
|
+
var u;
|
|
814
826
|
try {
|
|
815
|
-
|
|
816
|
-
const
|
|
817
|
-
let
|
|
818
|
-
if ((
|
|
819
|
-
|
|
827
|
+
x.value = !0;
|
|
828
|
+
const t = v.purchaseOrder, o = v.poRequest;
|
|
829
|
+
let l = "purchaseOrder";
|
|
830
|
+
if ((u = t == null ? void 0 : t.supplier) != null && u.internal && (l = "purchaseOrderRequest"), !(t != null && t._id)) {
|
|
831
|
+
i.open({
|
|
820
832
|
title: "Error",
|
|
821
833
|
message: "Invalid sync ID",
|
|
822
834
|
type: "error"
|
|
823
835
|
});
|
|
824
836
|
return;
|
|
825
837
|
}
|
|
826
|
-
await
|
|
838
|
+
await a.syncTransferOrder(l, t == null ? void 0 : t._id, o == null ? void 0 : o._id), i.open({
|
|
827
839
|
title: "Sync with NetSuite",
|
|
828
840
|
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
829
841
|
type: "success"
|
|
830
842
|
});
|
|
831
843
|
} catch {
|
|
832
|
-
|
|
844
|
+
i.open({
|
|
833
845
|
title: "Error",
|
|
834
846
|
message: "Failed to sync with NetSuite",
|
|
835
847
|
type: "error"
|
|
836
848
|
});
|
|
837
849
|
}
|
|
838
850
|
setTimeout(() => {
|
|
839
|
-
|
|
851
|
+
x.value = !1;
|
|
840
852
|
}, 5e3);
|
|
841
853
|
});
|
|
842
854
|
}
|
|
843
|
-
return (
|
|
844
|
-
const
|
|
845
|
-
return
|
|
846
|
-
B(
|
|
855
|
+
return (u, t) => {
|
|
856
|
+
const o = ce("FmButton");
|
|
857
|
+
return L.value ? (c(), _("div", Vt, [
|
|
858
|
+
B(o, {
|
|
847
859
|
"prepend-icon": "sync",
|
|
848
860
|
variant: "secondary",
|
|
849
861
|
label: "Sync",
|
|
850
|
-
loading:
|
|
851
|
-
onClick:
|
|
862
|
+
loading: x.value,
|
|
863
|
+
onClick: q,
|
|
852
864
|
"text-color": "primary",
|
|
853
865
|
"bg-color": "transparent",
|
|
854
866
|
"border-color": "primary"
|
|
@@ -874,13 +886,13 @@ const Ot = {
|
|
|
874
886
|
}, vs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ys = { class: "fm-typo-en-body-lg-600" }, hs = {
|
|
875
887
|
key: 0,
|
|
876
888
|
class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16 flex flex-col gap-8"
|
|
877
|
-
}, gs = { class: "flex gap-8 items-center" }, bs = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, _s = { class: "flex flex-col gap-8" }, Ss = { class: "flex gap-8 items-center" }, ws = { class: "flex-1 fm-typo-en-body-lg-600" }, xs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-4" },
|
|
889
|
+
}, gs = { class: "flex gap-8 items-center" }, bs = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, _s = { class: "flex flex-col gap-8" }, Ss = { class: "flex gap-8 items-center" }, ws = { class: "flex-1 fm-typo-en-body-lg-600" }, xs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-4" }, Os = { class: "flex w-full gap-4" }, ks = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, Rs = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, Ds = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Ns = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, As = {
|
|
878
890
|
key: 0,
|
|
879
891
|
class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
880
|
-
},
|
|
892
|
+
}, Ts = { class: "py-8" }, $s = { class: "flex justify-end gap-4 items-center" }, Ps = { class: "fm-typo-en-body-lg-600" }, Cs = {
|
|
881
893
|
key: 1,
|
|
882
894
|
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
883
|
-
},
|
|
895
|
+
}, qs = {
|
|
884
896
|
key: 0,
|
|
885
897
|
class: "flex flex-col items-center gap-8 h-full"
|
|
886
898
|
}, Es = ["src"], Is = { class: "fm-typo-en-body-lg-600" }, Ls = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, Fs = {
|
|
@@ -919,7 +931,7 @@ const Ot = {
|
|
|
919
931
|
}, gr = { class: "flex-1 flex flex-col items-center" }, br = {
|
|
920
932
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
921
933
|
name: "delivery details"
|
|
922
|
-
}, _r = { class: "flex flex-col gap-8" }, Sr = { class: "flex flex-col gap-4" }, wr = { class: "fm-typo-en-body-lg-600" }, xr = { class: "flex w-full gap-4" },
|
|
934
|
+
}, _r = { class: "flex flex-col gap-8" }, Sr = { class: "flex flex-col gap-4" }, wr = { class: "fm-typo-en-body-lg-600" }, xr = { class: "flex w-full gap-4" }, Or = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, kr = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, Rr = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Dr = { class: "grow fm-typo-en-body-md-400 text-fm-color-typo-secondary line-clamp-1" }, Nr = {
|
|
923
935
|
key: 0,
|
|
924
936
|
class: "line-clamp-1 fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
925
937
|
}, Ar = { class: "flex gap-8 xs:flex-col" }, Br = /* @__PURE__ */ Qe({
|
|
@@ -936,178 +948,178 @@ const Ot = {
|
|
|
936
948
|
},
|
|
937
949
|
emits: ["update:show", "submitted", "returnStock"],
|
|
938
950
|
setup(p, { emit: v }) {
|
|
939
|
-
const
|
|
951
|
+
const a = p, i = v, w = Ye(), x = We(), L = nt(), q = ze(), u = Pe(), { t } = at(), o = X(
|
|
940
952
|
() => {
|
|
941
|
-
var
|
|
942
|
-
return ((
|
|
953
|
+
var s, r, O, k;
|
|
954
|
+
return ((r = (s = a.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : r.internal) === "restaurant" || ((k = (O = a.purchaseOrder) == null ? void 0 : O.supplier) == null ? void 0 : k.internal) === "warehouse" ? be.TRANSFER : be.PURCHASE;
|
|
943
955
|
}
|
|
944
|
-
),
|
|
945
|
-
var
|
|
946
|
-
return
|
|
947
|
-
}),
|
|
948
|
-
var
|
|
949
|
-
if (
|
|
950
|
-
if (!
|
|
951
|
-
const
|
|
952
|
-
(g = (
|
|
953
|
-
),
|
|
954
|
-
|
|
955
|
-
),
|
|
956
|
-
if ((
|
|
956
|
+
), l = X(() => {
|
|
957
|
+
var s, r, O;
|
|
958
|
+
return o.value === be.TRANSFER && ((s = a.transferToDbName) == null ? void 0 : s.startsWith("restaurant")) && ((O = (r = a.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : O.internal) === "restaurant";
|
|
959
|
+
}), d = K(!1), f = K(""), F = K(!0), U = Xe(), J = wt(a, "show"), T = K(null), M = K({}), Y = X(() => T.value === null), de = K(""), Z = X(() => {
|
|
960
|
+
var r, O, k, P, C, G, g, S, E;
|
|
961
|
+
if (!L.enableReturnStocks || !((O = (r = a.purchaseOrder) == null ? void 0 : r.supplier) != null && O.internal) || ((k = a.purchaseOrder) == null ? void 0 : k.status) !== j.enum.COMPLETE || !u.locationById[(C = (P = a.purchaseOrder) == null ? void 0 : P.supplier) == null ? void 0 : C._id]) return !1;
|
|
962
|
+
if (!q.isEnabled) {
|
|
963
|
+
const V = q.getNetSuiteLocation(
|
|
964
|
+
(g = (G = a.purchaseOrder) == null ? void 0 : G.supplier) == null ? void 0 : g._id
|
|
965
|
+
), I = q.getLocationSubsidiary(V == null ? void 0 : V.id), W = q.getNetSuiteLocation(
|
|
966
|
+
u.currentLocation.doc._id
|
|
967
|
+
), ne = q.getLocationSubsidiary(W == null ? void 0 : W.id);
|
|
968
|
+
if ((I == null ? void 0 : I.id) !== (ne == null ? void 0 : ne.id)) return !1;
|
|
957
969
|
}
|
|
958
|
-
return !!((
|
|
959
|
-
}),
|
|
960
|
-
const
|
|
970
|
+
return !!((E = (S = a.purchaseOrder) == null ? void 0 : S.deliveryOrder) != null && E.length);
|
|
971
|
+
}), fe = X(() => {
|
|
972
|
+
const s = [
|
|
961
973
|
{
|
|
962
|
-
label:
|
|
974
|
+
label: t("inventory.transfer.receiveRequest.details.overview"),
|
|
963
975
|
value: "overview"
|
|
964
976
|
},
|
|
965
977
|
{
|
|
966
|
-
label:
|
|
978
|
+
label: t("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
967
979
|
value: "deliveryHistory"
|
|
968
980
|
}
|
|
969
981
|
];
|
|
970
|
-
return
|
|
982
|
+
return Z.value && s.push({
|
|
971
983
|
label: "Returns",
|
|
972
984
|
value: "returns"
|
|
973
|
-
}),
|
|
974
|
-
}), z =
|
|
985
|
+
}), s;
|
|
986
|
+
}), z = K(fe.value[0]);
|
|
975
987
|
async function Ce() {
|
|
976
|
-
var
|
|
977
|
-
|
|
988
|
+
var s, r, O, k, P;
|
|
989
|
+
T.value = null, M.value = {};
|
|
978
990
|
try {
|
|
979
|
-
const
|
|
980
|
-
for (const
|
|
981
|
-
const [
|
|
982
|
-
U.getPurchaseOrderById(
|
|
983
|
-
U.getLatestPurchaseOrderRequest(
|
|
991
|
+
const C = ((s = a.purchaseOrder) == null ? void 0 : s.returnPoIds) ?? [], G = new Array(), g = `${(O = (r = a.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : O.internal}_${(P = (k = a.purchaseOrder) == null ? void 0 : k.supplier) == null ? void 0 : P._id}`;
|
|
992
|
+
for (const S of C) {
|
|
993
|
+
const [E, V] = await Promise.all([
|
|
994
|
+
U.getPurchaseOrderById(S, g),
|
|
995
|
+
U.getLatestPurchaseOrderRequest(S, g)
|
|
984
996
|
]);
|
|
985
|
-
|
|
997
|
+
G.push(E), V && (M.value[S] = V);
|
|
986
998
|
}
|
|
987
|
-
|
|
988
|
-
} catch (
|
|
989
|
-
console.error("error on fetching return orders",
|
|
999
|
+
G.sort((S, E) => E._id.localeCompare(S._id)), T.value = G;
|
|
1000
|
+
} catch (C) {
|
|
1001
|
+
console.error("error on fetching return orders", C), de.value = `Something went wrong while retrieving returns. ${(C == null ? void 0 : C.message) ?? C}`, T.value = [];
|
|
990
1002
|
}
|
|
991
1003
|
}
|
|
992
1004
|
ht(
|
|
993
|
-
() =>
|
|
994
|
-
(
|
|
995
|
-
|
|
1005
|
+
() => a.show,
|
|
1006
|
+
(s) => {
|
|
1007
|
+
s && (z.value = fe.value[0], Ce());
|
|
996
1008
|
}
|
|
997
1009
|
);
|
|
998
|
-
async function Ie(
|
|
999
|
-
|
|
1010
|
+
async function Ie(s, r, O) {
|
|
1011
|
+
f.value = `${r}`, d.value = !0, F.value = !1;
|
|
1000
1012
|
try {
|
|
1001
1013
|
await U.processPurchaseOrder(
|
|
1002
1014
|
{
|
|
1003
|
-
operation:
|
|
1004
|
-
doc:
|
|
1015
|
+
operation: r,
|
|
1016
|
+
doc: s,
|
|
1005
1017
|
options: (
|
|
1006
1018
|
// auto receive for supplier to warehouse
|
|
1007
|
-
(
|
|
1008
|
-
|
|
1019
|
+
(r === R.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
1020
|
+
r === R.enum.completeReceive) && L.autoReceiveWarehouse ? {
|
|
1009
1021
|
autoReceive: !0
|
|
1010
1022
|
} : void 0
|
|
1011
1023
|
)
|
|
1012
1024
|
},
|
|
1013
|
-
|
|
1014
|
-
), await new Promise((
|
|
1025
|
+
a.transferToDbName
|
|
1026
|
+
), await new Promise((k) => setTimeout(k, 1e3)), x.open({
|
|
1015
1027
|
title: "Success",
|
|
1016
|
-
message:
|
|
1028
|
+
message: O,
|
|
1017
1029
|
type: "success"
|
|
1018
|
-
}),
|
|
1019
|
-
} catch (
|
|
1020
|
-
|
|
1030
|
+
}), i("update:show", !1), i("submitted");
|
|
1031
|
+
} catch (k) {
|
|
1032
|
+
x.open({
|
|
1021
1033
|
title: "Something went wrong",
|
|
1022
1034
|
message: "Please try again.",
|
|
1023
1035
|
type: "error"
|
|
1024
|
-
}), console.error("Error when submitting PO operation",
|
|
1036
|
+
}), console.error("Error when submitting PO operation", r, s, k);
|
|
1025
1037
|
} finally {
|
|
1026
|
-
|
|
1038
|
+
f.value = "", d.value = !1, F.value = !0;
|
|
1027
1039
|
}
|
|
1028
1040
|
}
|
|
1029
|
-
async function
|
|
1030
|
-
if (
|
|
1031
|
-
|
|
1041
|
+
async function ae(s) {
|
|
1042
|
+
if (s === R.enum.returnStock) {
|
|
1043
|
+
a.purchaseOrder && i("returnStock", a.purchaseOrder), i("update:show", !1);
|
|
1032
1044
|
return;
|
|
1033
1045
|
}
|
|
1034
|
-
if (
|
|
1046
|
+
if (s === R.enum.receiveStock)
|
|
1035
1047
|
return;
|
|
1036
|
-
const
|
|
1037
|
-
if (!
|
|
1038
|
-
|
|
1048
|
+
const r = ot[s];
|
|
1049
|
+
if (!r) {
|
|
1050
|
+
x.open({
|
|
1039
1051
|
title: "Something went wrong",
|
|
1040
|
-
message: `Cannot process order: ${st(
|
|
1052
|
+
message: `Cannot process order: ${st(s)}`,
|
|
1041
1053
|
type: "error"
|
|
1042
1054
|
});
|
|
1043
1055
|
return;
|
|
1044
1056
|
}
|
|
1045
|
-
const { successMessage:
|
|
1046
|
-
|
|
1047
|
-
title:
|
|
1048
|
-
message:
|
|
1049
|
-
primaryActions:
|
|
1057
|
+
const { successMessage: O, ...k } = r;
|
|
1058
|
+
w.open({
|
|
1059
|
+
title: k.title,
|
|
1060
|
+
message: k.message,
|
|
1061
|
+
primaryActions: k.primaryActions
|
|
1050
1062
|
}).onPrimary(() => {
|
|
1051
|
-
|
|
1063
|
+
a.purchaseOrder && Ie(a.purchaseOrder, s, O);
|
|
1052
1064
|
});
|
|
1053
1065
|
}
|
|
1054
1066
|
const Le = X(() => {
|
|
1055
|
-
var
|
|
1056
|
-
return ((
|
|
1067
|
+
var s, r;
|
|
1068
|
+
return ((s = a.purchaseOrder) == null ? void 0 : s.status) === j.enum.RECEIVING || ((r = a.purchaseOrder) == null ? void 0 : r.status) === j.enum.COMPLETE;
|
|
1057
1069
|
}), Fe = X(() => {
|
|
1058
|
-
var
|
|
1059
|
-
const
|
|
1060
|
-
(
|
|
1061
|
-
const
|
|
1062
|
-
return
|
|
1070
|
+
var C, G, g;
|
|
1071
|
+
const O = (((C = a.purchaseOrder) == null ? void 0 : C.deliveryOrder) ?? []).flatMap((S) => S.received ?? []).reduce(
|
|
1072
|
+
(S, E) => {
|
|
1073
|
+
const V = S[E.sku._id] ?? [];
|
|
1074
|
+
return S[E.sku._id] = [...V, E], S;
|
|
1063
1075
|
},
|
|
1064
1076
|
{}
|
|
1065
|
-
),
|
|
1066
|
-
(
|
|
1067
|
-
const
|
|
1068
|
-
const
|
|
1077
|
+
), k = Object.entries(O).reduce(
|
|
1078
|
+
(S, [E, V]) => {
|
|
1079
|
+
const I = V.reduce((W, ne) => {
|
|
1080
|
+
const oe = pt(
|
|
1069
1081
|
W,
|
|
1070
|
-
Math.max(W.precision,
|
|
1082
|
+
Math.max(W.precision, ne.amount.precision)
|
|
1071
1083
|
);
|
|
1072
|
-
return Ke(
|
|
1073
|
-
},
|
|
1074
|
-
return
|
|
1084
|
+
return Ke(oe, ne.amount);
|
|
1085
|
+
}, qe(0));
|
|
1086
|
+
return S[E] = I, S;
|
|
1075
1087
|
},
|
|
1076
1088
|
{}
|
|
1077
|
-
),
|
|
1078
|
-
for (const
|
|
1079
|
-
|
|
1080
|
-
return
|
|
1089
|
+
), P = ((G = a.purchaseOrder) == null ? void 0 : G.items) ?? [];
|
|
1090
|
+
for (const S of P)
|
|
1091
|
+
k[g = S.sku._id] ?? (k[g] = qe(0));
|
|
1092
|
+
return k;
|
|
1081
1093
|
}), y = X(() => {
|
|
1082
|
-
var
|
|
1083
|
-
const
|
|
1084
|
-
...
|
|
1094
|
+
var C, G;
|
|
1095
|
+
const s = ((C = a.purchaseOrder) == null ? void 0 : C.deliveryOrder) ?? [], r = ((G = a.purchaseOrder) == null ? void 0 : G.deliveryFullfillment) ?? [], O = [
|
|
1096
|
+
...s.map((g) => ({
|
|
1085
1097
|
createdAt: g.createdAt,
|
|
1086
1098
|
type: "grn",
|
|
1087
1099
|
doc: g
|
|
1088
1100
|
})),
|
|
1089
|
-
...
|
|
1101
|
+
...r.map((g) => ({
|
|
1090
1102
|
createdAt: g.createdAt,
|
|
1091
1103
|
type: "fulfillment",
|
|
1092
1104
|
doc: g
|
|
1093
1105
|
}))
|
|
1094
1106
|
];
|
|
1095
|
-
|
|
1096
|
-
function
|
|
1097
|
-
var
|
|
1098
|
-
const
|
|
1107
|
+
O.reverse().sort((g, S) => g.createdAt.localeCompare(S.createdAt));
|
|
1108
|
+
function k(g) {
|
|
1109
|
+
var E, V, I, W, ne, oe, me;
|
|
1110
|
+
const S = r.findIndex((H) => H.id === g.fullfillmentId);
|
|
1099
1111
|
return {
|
|
1100
1112
|
header: "Received",
|
|
1101
1113
|
date: Me(new Date(g.createdAt)),
|
|
1102
1114
|
info: [
|
|
1103
1115
|
{
|
|
1104
1116
|
label: "Received by",
|
|
1105
|
-
values: [(
|
|
1117
|
+
values: [(E = g.createdBy) == null ? void 0 : E.name]
|
|
1106
1118
|
},
|
|
1107
1119
|
{
|
|
1108
1120
|
label: "Received items",
|
|
1109
|
-
values: g.received.map((
|
|
1110
|
-
var
|
|
1121
|
+
values: g.received.map((H) => {
|
|
1122
|
+
var pe;
|
|
1111
1123
|
return N("div", [
|
|
1112
1124
|
N(
|
|
1113
1125
|
"div",
|
|
@@ -1126,14 +1138,14 @@ const Ot = {
|
|
|
1126
1138
|
{
|
|
1127
1139
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
1128
1140
|
},
|
|
1129
|
-
`${
|
|
1141
|
+
`${H.sku.name}`
|
|
1130
1142
|
),
|
|
1131
1143
|
N(
|
|
1132
1144
|
"span",
|
|
1133
1145
|
{
|
|
1134
1146
|
class: "fm-typo-en-body-md-400"
|
|
1135
1147
|
},
|
|
1136
|
-
`${
|
|
1148
|
+
`${H.sku.code} `
|
|
1137
1149
|
)
|
|
1138
1150
|
]
|
|
1139
1151
|
),
|
|
@@ -1154,14 +1166,14 @@ const Ot = {
|
|
|
1154
1166
|
{
|
|
1155
1167
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
1156
1168
|
},
|
|
1157
|
-
|
|
1169
|
+
Oe(H.amount, !1)
|
|
1158
1170
|
),
|
|
1159
1171
|
N(
|
|
1160
1172
|
"span",
|
|
1161
1173
|
{
|
|
1162
1174
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1163
1175
|
},
|
|
1164
|
-
((
|
|
1176
|
+
((pe = H.measurement) == null ? void 0 : pe.abbrev) ?? H.sku.unit.abbrev
|
|
1165
1177
|
)
|
|
1166
1178
|
]
|
|
1167
1179
|
),
|
|
@@ -1170,7 +1182,7 @@ const Ot = {
|
|
|
1170
1182
|
{
|
|
1171
1183
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1172
1184
|
},
|
|
1173
|
-
`${
|
|
1185
|
+
`${H.cost ? `(${$e(H.cost)})` : ""}`
|
|
1174
1186
|
)
|
|
1175
1187
|
]
|
|
1176
1188
|
)
|
|
@@ -1187,35 +1199,35 @@ const Ot = {
|
|
|
1187
1199
|
label: "Remark",
|
|
1188
1200
|
values: [g.remark]
|
|
1189
1201
|
} : null,
|
|
1190
|
-
|
|
1202
|
+
S > -1 ? {
|
|
1191
1203
|
label: "Fulfilment's sequence",
|
|
1192
|
-
values: [`${
|
|
1204
|
+
values: [`${S + 1}`]
|
|
1193
1205
|
} : null,
|
|
1194
|
-
(
|
|
1206
|
+
(I = (V = r[S]) == null ? void 0 : V.netSuite) != null && I.refNo ? {
|
|
1195
1207
|
label: "Fulfillment's ref no. (Netsuite)",
|
|
1196
|
-
values: [(
|
|
1208
|
+
values: [(ne = (W = r[S]) == null ? void 0 : W.netSuite) == null ? void 0 : ne.refNo]
|
|
1197
1209
|
} : null,
|
|
1198
|
-
(
|
|
1210
|
+
(oe = g == null ? void 0 : g.netSuite) != null && oe.refNo ? {
|
|
1199
1211
|
label: "Item receipt (Netsuite)",
|
|
1200
|
-
values: [(
|
|
1212
|
+
values: [(me = g == null ? void 0 : g.netSuite) == null ? void 0 : me.refNo]
|
|
1201
1213
|
} : null
|
|
1202
|
-
].filter((
|
|
1214
|
+
].filter((H) => H)
|
|
1203
1215
|
};
|
|
1204
1216
|
}
|
|
1205
|
-
function
|
|
1206
|
-
var
|
|
1207
|
-
const
|
|
1217
|
+
function P(g) {
|
|
1218
|
+
var E, V;
|
|
1219
|
+
const S = r.findIndex((I) => I.id === g.id);
|
|
1208
1220
|
return {
|
|
1209
1221
|
header: "Fulfillment",
|
|
1210
1222
|
date: Me(new Date(g.createdAt)),
|
|
1211
1223
|
info: [
|
|
1212
1224
|
{
|
|
1213
1225
|
label: "Sequence",
|
|
1214
|
-
values: [String(
|
|
1226
|
+
values: [String(S + 1)]
|
|
1215
1227
|
},
|
|
1216
1228
|
{
|
|
1217
1229
|
label: "Receiveable items",
|
|
1218
|
-
values: g.items.map((
|
|
1230
|
+
values: g.items.map((I) => {
|
|
1219
1231
|
var W;
|
|
1220
1232
|
return N("div", [
|
|
1221
1233
|
N(
|
|
@@ -1235,14 +1247,14 @@ const Ot = {
|
|
|
1235
1247
|
{
|
|
1236
1248
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
1237
1249
|
},
|
|
1238
|
-
`${
|
|
1250
|
+
`${I.sku.name}`
|
|
1239
1251
|
),
|
|
1240
1252
|
N(
|
|
1241
1253
|
"span",
|
|
1242
1254
|
{
|
|
1243
1255
|
class: "fm-typo-en-body-md-400"
|
|
1244
1256
|
},
|
|
1245
|
-
`${
|
|
1257
|
+
`${I.sku.code} `
|
|
1246
1258
|
)
|
|
1247
1259
|
]
|
|
1248
1260
|
),
|
|
@@ -1263,14 +1275,14 @@ const Ot = {
|
|
|
1263
1275
|
{
|
|
1264
1276
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
1265
1277
|
},
|
|
1266
|
-
|
|
1278
|
+
Oe(I.amount, !1)
|
|
1267
1279
|
),
|
|
1268
1280
|
N(
|
|
1269
1281
|
"span",
|
|
1270
1282
|
{
|
|
1271
1283
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1272
1284
|
},
|
|
1273
|
-
((W =
|
|
1285
|
+
((W = I.measurement) == null ? void 0 : W.abbrev) ?? I.sku.unit.abbrev
|
|
1274
1286
|
)
|
|
1275
1287
|
]
|
|
1276
1288
|
),
|
|
@@ -1279,7 +1291,7 @@ const Ot = {
|
|
|
1279
1291
|
{
|
|
1280
1292
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1281
1293
|
},
|
|
1282
|
-
`${
|
|
1294
|
+
`${I.cost ? `(${$e(I.cost)})` : ""}`
|
|
1283
1295
|
)
|
|
1284
1296
|
]
|
|
1285
1297
|
)
|
|
@@ -1288,106 +1300,106 @@ const Ot = {
|
|
|
1288
1300
|
]);
|
|
1289
1301
|
})
|
|
1290
1302
|
},
|
|
1291
|
-
(
|
|
1303
|
+
(E = g.netSuite) != null && E.refNo ? {
|
|
1292
1304
|
label: "Ref no. (Netsuite)",
|
|
1293
|
-
values: [(
|
|
1305
|
+
values: [(V = g.netSuite) == null ? void 0 : V.refNo]
|
|
1294
1306
|
} : null
|
|
1295
|
-
].filter((
|
|
1307
|
+
].filter((I) => I)
|
|
1296
1308
|
};
|
|
1297
1309
|
}
|
|
1298
|
-
return
|
|
1310
|
+
return O.map((g) => {
|
|
1299
1311
|
switch (g.type) {
|
|
1300
1312
|
case "grn":
|
|
1301
|
-
return
|
|
1313
|
+
return k(g.doc);
|
|
1302
1314
|
case "fulfillment":
|
|
1303
|
-
return
|
|
1315
|
+
return P(g.doc);
|
|
1304
1316
|
}
|
|
1305
1317
|
});
|
|
1306
1318
|
}), h = X(() => {
|
|
1307
|
-
var
|
|
1308
|
-
const
|
|
1309
|
-
|
|
1319
|
+
var r;
|
|
1320
|
+
const s = {
|
|
1321
|
+
...qe(0),
|
|
1310
1322
|
currency: Ze()
|
|
1311
1323
|
};
|
|
1312
|
-
return ((
|
|
1313
|
-
...Ke(
|
|
1324
|
+
return ((r = a.purchaseOrder) == null ? void 0 : r.items.reduce((O, k) => ({
|
|
1325
|
+
...Ke(O, k.totalCost ?? s),
|
|
1314
1326
|
currency: Ze()
|
|
1315
|
-
}),
|
|
1327
|
+
}), s)) ?? s;
|
|
1316
1328
|
});
|
|
1317
|
-
return (
|
|
1318
|
-
var W,
|
|
1319
|
-
const
|
|
1320
|
-
return
|
|
1321
|
-
header:
|
|
1322
|
-
modelValue:
|
|
1323
|
-
"onUpdate:modelValue":
|
|
1329
|
+
return (s, r) => {
|
|
1330
|
+
var W, ne;
|
|
1331
|
+
const O = ce("FmButtonGroup"), k = ce("FmChip"), P = ce("FmMenuDivider"), C = ce("FmCard"), G = ce("FmIcon"), g = ce("FmTooltip"), S = ce("FmButton"), E = ce("FmSpacer"), V = ce("FmCircularProgress"), I = ce("FmSideSheet");
|
|
1332
|
+
return c(), se(I, {
|
|
1333
|
+
header: n(t)("inventory.transfer.receiveRequest.details.title") + ((W = s.purchaseOrder) != null && W.seqNumber ? ` #${(ne = s.purchaseOrder) == null ? void 0 : ne.seqNumber}` : ""),
|
|
1334
|
+
modelValue: n(J),
|
|
1335
|
+
"onUpdate:modelValue": r[11] || (r[11] = (oe) => gt(J) ? J.value = oe : null),
|
|
1324
1336
|
"dismiss-away": F.value,
|
|
1325
1337
|
"close-button": "",
|
|
1326
1338
|
"max-width": 600
|
|
1327
1339
|
}, {
|
|
1328
|
-
default:
|
|
1329
|
-
var
|
|
1340
|
+
default: _e(() => {
|
|
1341
|
+
var oe, me, H, pe, ke, Re, De, Ne;
|
|
1330
1342
|
return [
|
|
1331
1343
|
e("div", Gt, [
|
|
1332
1344
|
e("div", null, [
|
|
1333
|
-
B(
|
|
1334
|
-
items:
|
|
1345
|
+
B(O, {
|
|
1346
|
+
items: fe.value,
|
|
1335
1347
|
modelValue: z.value,
|
|
1336
|
-
"onUpdate:modelValue":
|
|
1348
|
+
"onUpdate:modelValue": r[0] || (r[0] = (b) => z.value = b)
|
|
1337
1349
|
}, null, 8, ["items", "modelValue"])
|
|
1338
1350
|
]),
|
|
1339
|
-
z.value.value === "overview" ? (
|
|
1351
|
+
z.value.value === "overview" ? (c(), _(re, { key: 0 }, [
|
|
1340
1352
|
e("div", null, [
|
|
1341
|
-
B(
|
|
1353
|
+
B(C, {
|
|
1342
1354
|
variant: "outlined",
|
|
1343
1355
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1344
1356
|
}, {
|
|
1345
|
-
default:
|
|
1346
|
-
var b, A,
|
|
1357
|
+
default: _e(() => {
|
|
1358
|
+
var b, A, $, le, ie, ue, ve, ye, ee, he, Ae, Te;
|
|
1347
1359
|
return [
|
|
1348
1360
|
e("div", Ht, [
|
|
1349
|
-
e("div", zt, m(
|
|
1361
|
+
e("div", zt, m(n(t)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
1350
1362
|
e("div", null, [
|
|
1351
|
-
B(
|
|
1352
|
-
label:
|
|
1353
|
-
class:
|
|
1363
|
+
B(k, {
|
|
1364
|
+
label: n(t)(`inventory.transfer.status.${(b = s.purchaseOrder) == null ? void 0 : b.status}`),
|
|
1365
|
+
class: ge(`fm-status-badge fm-status-badge-${($ = (A = s.purchaseOrder) == null ? void 0 : A.status) == null ? void 0 : $.toLocaleLowerCase("en-us")}`),
|
|
1354
1366
|
compact: ""
|
|
1355
1367
|
}, null, 8, ["label", "class"])
|
|
1356
1368
|
])
|
|
1357
1369
|
]),
|
|
1358
|
-
B(
|
|
1370
|
+
B(P),
|
|
1359
1371
|
e("div", Qt, [
|
|
1360
1372
|
e("div", Yt, [
|
|
1361
1373
|
e("div", Wt, [
|
|
1362
|
-
e("div", Xt, m(
|
|
1374
|
+
e("div", Xt, m(n(t)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1363
1375
|
]),
|
|
1364
|
-
e("div", Jt, m(
|
|
1376
|
+
e("div", Jt, m(n(Ee)(((le = s.purchaseOrder) == null ? void 0 : le._id) ?? "")), 1)
|
|
1365
1377
|
]),
|
|
1366
|
-
(
|
|
1367
|
-
e("div", es, m(
|
|
1368
|
-
e("div", ts, m(
|
|
1378
|
+
(ie = s.purchaseOrder) != null && ie.effectiveAt ? (c(), _("div", Zt, [
|
|
1379
|
+
e("div", es, m(n(t)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
1380
|
+
e("div", ts, m(n(rt)(new Date((ue = s.purchaseOrder) == null ? void 0 : ue.effectiveAt))), 1)
|
|
1369
1381
|
])) : D("", !0),
|
|
1370
1382
|
e("div", ss, [
|
|
1371
|
-
e("div", rs, m(
|
|
1372
|
-
e("div", as, m(
|
|
1373
|
-
`inventory.transfer.receiveRequest.details.type.${
|
|
1383
|
+
e("div", rs, m(n(t)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
1384
|
+
e("div", as, m(n(t)(
|
|
1385
|
+
`inventory.transfer.receiveRequest.details.type.${o.value.toLocaleLowerCase("en-US")}`
|
|
1374
1386
|
)), 1)
|
|
1375
1387
|
]),
|
|
1376
|
-
(
|
|
1377
|
-
e("div", os, m(
|
|
1378
|
-
e("div", ls, m((
|
|
1388
|
+
(ye = (ve = s.purchaseOrder) == null ? void 0 : ve.supplier) != null && ye.name ? (c(), _("div", ns, [
|
|
1389
|
+
e("div", os, m(n(t)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1390
|
+
e("div", ls, m((he = (ee = s.purchaseOrder) == null ? void 0 : ee.supplier) == null ? void 0 : he.name), 1)
|
|
1379
1391
|
])) : D("", !0),
|
|
1380
|
-
|
|
1381
|
-
e("div", cs, m(
|
|
1382
|
-
e("div", us, m(
|
|
1392
|
+
s.transferTo ? (c(), _("div", is, [
|
|
1393
|
+
e("div", cs, m(n(t)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
1394
|
+
e("div", us, m(s.transferTo), 1)
|
|
1383
1395
|
])) : D("", !0),
|
|
1384
|
-
(Ae =
|
|
1385
|
-
e("div", fs, m(
|
|
1386
|
-
e("div", ms, m(
|
|
1396
|
+
(Ae = s.purchaseOrder) != null && Ae.ref ? (c(), _("div", ds, [
|
|
1397
|
+
e("div", fs, m(n(t)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1398
|
+
e("div", ms, m(s.purchaseOrder.ref), 1)
|
|
1387
1399
|
])) : D("", !0),
|
|
1388
|
-
(
|
|
1389
|
-
e("div", vs, m(
|
|
1390
|
-
e("div", ys, m(
|
|
1400
|
+
(Te = s.purchaseOrder) != null && Te.remark ? (c(), _("div", ps, [
|
|
1401
|
+
e("div", vs, m(n(t)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1402
|
+
e("div", ys, m(s.purchaseOrder.remark), 1)
|
|
1391
1403
|
])) : D("", !0)
|
|
1392
1404
|
])
|
|
1393
1405
|
];
|
|
@@ -1395,57 +1407,57 @@ const Ot = {
|
|
|
1395
1407
|
_: 1
|
|
1396
1408
|
})
|
|
1397
1409
|
]),
|
|
1398
|
-
|
|
1410
|
+
l.value ? D("", !0) : (c(), _("div", hs, [
|
|
1399
1411
|
e("div", gs, [
|
|
1400
|
-
|
|
1412
|
+
r[12] || (r[12] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
1401
1413
|
e("div", null, [
|
|
1402
1414
|
B(Kt, {
|
|
1403
|
-
"po-request":
|
|
1404
|
-
"purchase-order":
|
|
1405
|
-
"is-transfer-between-outlets":
|
|
1415
|
+
"po-request": s.poRequest,
|
|
1416
|
+
"purchase-order": s.purchaseOrder,
|
|
1417
|
+
"is-transfer-between-outlets": l.value
|
|
1406
1418
|
}, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets"])
|
|
1407
1419
|
])
|
|
1408
1420
|
]),
|
|
1409
|
-
B(
|
|
1421
|
+
B(P),
|
|
1410
1422
|
B(jt, {
|
|
1411
|
-
"po-request":
|
|
1412
|
-
"purchase-order":
|
|
1413
|
-
"transfer-type":
|
|
1414
|
-
"transfer-to-db-name":
|
|
1415
|
-
"is-transfer-between-outlets":
|
|
1416
|
-
scope:
|
|
1423
|
+
"po-request": s.poRequest,
|
|
1424
|
+
"purchase-order": s.purchaseOrder,
|
|
1425
|
+
"transfer-type": o.value,
|
|
1426
|
+
"transfer-to-db-name": s.transferToDbName,
|
|
1427
|
+
"is-transfer-between-outlets": l.value,
|
|
1428
|
+
scope: s.scope
|
|
1417
1429
|
}, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
|
|
1418
1430
|
])),
|
|
1419
1431
|
e("div", bs, [
|
|
1420
1432
|
e("div", _s, [
|
|
1421
1433
|
e("div", Ss, [
|
|
1422
1434
|
e("span", ws, [
|
|
1423
|
-
je(m(Le.value ?
|
|
1424
|
-
(
|
|
1435
|
+
je(m(Le.value ? n(t)("inventory.transfer.receiveRequest.details.receivedItems") : n(t)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
|
|
1436
|
+
(me = (oe = s.purchaseOrder) == null ? void 0 : oe.netSuite) != null && me.missingItems && ((pe = (H = s.purchaseOrder) == null ? void 0 : H.netSuite) == null ? void 0 : pe.missingItems.length) > 0 ? (c(), se(g, {
|
|
1425
1437
|
key: 0,
|
|
1426
1438
|
variant: "rich",
|
|
1427
1439
|
placement: "top",
|
|
1428
1440
|
"z-index": 51
|
|
1429
1441
|
}, {
|
|
1430
|
-
content:
|
|
1442
|
+
content: _e(() => {
|
|
1431
1443
|
var b, A;
|
|
1432
1444
|
return [
|
|
1433
1445
|
e("div", xs, [
|
|
1434
|
-
(
|
|
1446
|
+
(c(!0), _(re, null, Se((A = (b = s.purchaseOrder) == null ? void 0 : b.netSuite) == null ? void 0 : A.missingItems, ($, le) => (c(), _("div", {
|
|
1435
1447
|
class: "flex justify-center align-middle",
|
|
1436
|
-
key:
|
|
1448
|
+
key: le
|
|
1437
1449
|
}, [
|
|
1438
|
-
B(
|
|
1450
|
+
B(G, {
|
|
1439
1451
|
name: "arrow_right",
|
|
1440
1452
|
size: "sm"
|
|
1441
1453
|
}),
|
|
1442
|
-
je(" " + m(`(${
|
|
1454
|
+
je(" " + m(`(${$.netSuiteId}) ${$.name}: ${$.reason}`), 1)
|
|
1443
1455
|
]))), 128))
|
|
1444
1456
|
])
|
|
1445
1457
|
];
|
|
1446
1458
|
}),
|
|
1447
|
-
default:
|
|
1448
|
-
B(
|
|
1459
|
+
default: _e(() => [
|
|
1460
|
+
B(G, {
|
|
1449
1461
|
name: "error",
|
|
1450
1462
|
color: "#ff2c2c",
|
|
1451
1463
|
size: "sm"
|
|
@@ -1455,13 +1467,13 @@ const Ot = {
|
|
|
1455
1467
|
})) : D("", !0)
|
|
1456
1468
|
]),
|
|
1457
1469
|
e("div", null, [
|
|
1458
|
-
|
|
1470
|
+
Z.value && T.value != null && !((ke = T.value) != null && ke.length) ? (c(), se(S, {
|
|
1459
1471
|
key: 0,
|
|
1460
1472
|
label: "Return",
|
|
1461
1473
|
variant: "secondary",
|
|
1462
|
-
onClick:
|
|
1463
|
-
loading:
|
|
1464
|
-
disabled:
|
|
1474
|
+
onClick: r[1] || (r[1] = (b) => ae("returnStock")),
|
|
1475
|
+
loading: f.value === "returnStock",
|
|
1476
|
+
disabled: f.value !== "returnStock" && d.value,
|
|
1465
1477
|
"prepend-icon": "undo",
|
|
1466
1478
|
"text-color": "primary",
|
|
1467
1479
|
"bg-color": "transparent",
|
|
@@ -1469,42 +1481,42 @@ const Ot = {
|
|
|
1469
1481
|
}, null, 8, ["loading", "disabled"])) : D("", !0)
|
|
1470
1482
|
])
|
|
1471
1483
|
]),
|
|
1472
|
-
B(
|
|
1473
|
-
(
|
|
1484
|
+
B(P),
|
|
1485
|
+
(c(!0), _(re, null, Se(((Re = s.purchaseOrder) == null ? void 0 : Re.items) ?? [], (b) => {
|
|
1474
1486
|
var A;
|
|
1475
|
-
return
|
|
1487
|
+
return c(), _("div", {
|
|
1476
1488
|
key: b.code,
|
|
1477
1489
|
class: "flex flex-col"
|
|
1478
1490
|
}, [
|
|
1479
|
-
e("div",
|
|
1480
|
-
e("div",
|
|
1481
|
-
e("div",
|
|
1491
|
+
e("div", Os, [
|
|
1492
|
+
e("div", ks, m(b.name), 1),
|
|
1493
|
+
e("div", Rs, m(n(Oe)(Fe.value[b.sku._id], !1)) + "/" + m(n(Ge)(b.quantity, b.sku.unit, b.measurement)), 1)
|
|
1482
1494
|
]),
|
|
1483
1495
|
e("div", Ds, [
|
|
1484
1496
|
e("div", Ns, m(b.code), 1),
|
|
1485
|
-
(A = b.totalCost) != null && A.amount &&
|
|
1497
|
+
(A = b.totalCost) != null && A.amount && n(L).enableTotalCost ? (c(), _("div", As, " (" + m(n($e)(b.totalCost)) + ") ", 1)) : D("", !0)
|
|
1486
1498
|
])
|
|
1487
1499
|
]);
|
|
1488
1500
|
}), 128)),
|
|
1489
|
-
+
|
|
1490
|
-
e("div", qs, [
|
|
1491
|
-
B(T)
|
|
1492
|
-
]),
|
|
1501
|
+
+n(Oe)(h.value) ? (c(), _(re, { key: 0 }, [
|
|
1493
1502
|
e("div", Ts, [
|
|
1494
|
-
|
|
1495
|
-
|
|
1503
|
+
B(P)
|
|
1504
|
+
]),
|
|
1505
|
+
e("div", $s, [
|
|
1506
|
+
r[13] || (r[13] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
|
|
1507
|
+
e("div", Ps, m(n($e)(h.value)), 1)
|
|
1496
1508
|
])
|
|
1497
1509
|
], 64)) : D("", !0)
|
|
1498
1510
|
])
|
|
1499
1511
|
])
|
|
1500
|
-
], 64)) : z.value.value === "deliveryHistory" ? (
|
|
1501
|
-
y.value.length ? (
|
|
1502
|
-
(
|
|
1512
|
+
], 64)) : z.value.value === "deliveryHistory" ? (c(), _("div", Cs, [
|
|
1513
|
+
y.value.length ? (c(), _("div", Fs, [
|
|
1514
|
+
(c(!0), _(re, null, Se(y.value, (b, A) => (c(), _(re, { key: A }, [
|
|
1503
1515
|
e("div", Us, [
|
|
1504
1516
|
e("div", Bs, [
|
|
1505
1517
|
e("div", Ms, [
|
|
1506
1518
|
e("div", {
|
|
1507
|
-
class:
|
|
1519
|
+
class: ge([
|
|
1508
1520
|
{
|
|
1509
1521
|
"bg-fm-color-primary": A !== 0,
|
|
1510
1522
|
"bg-white": A === 0
|
|
@@ -1513,10 +1525,10 @@ const Ot = {
|
|
|
1513
1525
|
])
|
|
1514
1526
|
}, null, 2)
|
|
1515
1527
|
]),
|
|
1516
|
-
|
|
1528
|
+
r[14] || (r[14] = e("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1517
1529
|
e("div", js, [
|
|
1518
1530
|
e("div", {
|
|
1519
|
-
class:
|
|
1531
|
+
class: ge([
|
|
1520
1532
|
{
|
|
1521
1533
|
"bg-fm-color-primary": A < y.value.length - 1,
|
|
1522
1534
|
"bg-white": A >= y.value.length - 1
|
|
@@ -1535,7 +1547,7 @@ const Ot = {
|
|
|
1535
1547
|
e("div", zs, [
|
|
1536
1548
|
e("div", Qs, [
|
|
1537
1549
|
e("div", {
|
|
1538
|
-
class:
|
|
1550
|
+
class: ge([
|
|
1539
1551
|
{
|
|
1540
1552
|
"bg-fm-color-primary": A < y.value.length - 1,
|
|
1541
1553
|
"bg-white": A >= y.value.length - 1
|
|
@@ -1546,25 +1558,25 @@ const Ot = {
|
|
|
1546
1558
|
])
|
|
1547
1559
|
]),
|
|
1548
1560
|
e("div", Ys, [
|
|
1549
|
-
B(
|
|
1561
|
+
B(C, {
|
|
1550
1562
|
variant: "outlined",
|
|
1551
1563
|
class: "py-12 px-16"
|
|
1552
1564
|
}, {
|
|
1553
|
-
default:
|
|
1565
|
+
default: _e(() => [
|
|
1554
1566
|
e("div", Ws, [
|
|
1555
|
-
(
|
|
1556
|
-
key:
|
|
1567
|
+
(c(!0), _(re, null, Se(b.info, ($, le) => (c(), _("div", {
|
|
1568
|
+
key: le,
|
|
1557
1569
|
class: "flex flex-col gap-4"
|
|
1558
1570
|
}, [
|
|
1559
|
-
e("div", Xs, m(
|
|
1571
|
+
e("div", Xs, m($ == null ? void 0 : $.label), 1),
|
|
1560
1572
|
e("div", Js, [
|
|
1561
|
-
(
|
|
1562
|
-
key:
|
|
1573
|
+
(c(!0), _(re, null, Se($ == null ? void 0 : $.values, (ie, ue) => (c(), _("div", {
|
|
1574
|
+
key: ue,
|
|
1563
1575
|
class: "fm-typo-en-body-lg-600"
|
|
1564
1576
|
}, [
|
|
1565
|
-
typeof
|
|
1566
|
-
je(m(
|
|
1567
|
-
], 64)) : (
|
|
1577
|
+
typeof ie == "string" ? (c(), _(re, { key: 0 }, [
|
|
1578
|
+
je(m(ie), 1)
|
|
1579
|
+
], 64)) : (c(), se(bt(ie), { key: 1 }))
|
|
1568
1580
|
]))), 128))
|
|
1569
1581
|
])
|
|
1570
1582
|
]))), 128))
|
|
@@ -1575,33 +1587,33 @@ const Ot = {
|
|
|
1575
1587
|
])
|
|
1576
1588
|
])
|
|
1577
1589
|
], 64))), 128))
|
|
1578
|
-
])) : (
|
|
1579
|
-
B(
|
|
1590
|
+
])) : (c(), _("div", qs, [
|
|
1591
|
+
B(E),
|
|
1580
1592
|
e("div", null, [
|
|
1581
1593
|
e("img", {
|
|
1582
|
-
src:
|
|
1594
|
+
src: n(et),
|
|
1583
1595
|
alt: "List is empty"
|
|
1584
1596
|
}, null, 8, Es)
|
|
1585
1597
|
]),
|
|
1586
|
-
e("div", Is, m(
|
|
1587
|
-
e("div", Ls, m(
|
|
1588
|
-
B(
|
|
1589
|
-
B(
|
|
1598
|
+
e("div", Is, m(n(t)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
1599
|
+
e("div", Ls, m(n(t)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
|
|
1600
|
+
B(E),
|
|
1601
|
+
B(E)
|
|
1590
1602
|
]))
|
|
1591
|
-
])) : z.value.value === "returns" &&
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
B(
|
|
1595
|
-
|
|
1596
|
-
])) : (De =
|
|
1597
|
-
(
|
|
1603
|
+
])) : z.value.value === "returns" && Z.value ? (c(), _("div", Zs, [
|
|
1604
|
+
Y.value ? (c(), _("div", er, [
|
|
1605
|
+
r[15] || (r[15] = e("div", { class: "h-80" }, null, -1)),
|
|
1606
|
+
B(V),
|
|
1607
|
+
r[16] || (r[16] = e("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, "Loading...", -1))
|
|
1608
|
+
])) : (De = T.value) != null && De.length ? (c(), _("div", nr, [
|
|
1609
|
+
(c(!0), _(re, null, Se(T.value, (b, A) => (c(), _(re, {
|
|
1598
1610
|
key: b._id
|
|
1599
1611
|
}, [
|
|
1600
1612
|
e("div", or, [
|
|
1601
1613
|
e("div", lr, [
|
|
1602
1614
|
e("div", ir, [
|
|
1603
1615
|
e("div", {
|
|
1604
|
-
class:
|
|
1616
|
+
class: ge([
|
|
1605
1617
|
{
|
|
1606
1618
|
"bg-fm-color-primary": A !== 0,
|
|
1607
1619
|
"bg-white": A === 0
|
|
@@ -1610,13 +1622,13 @@ const Ot = {
|
|
|
1610
1622
|
])
|
|
1611
1623
|
}, null, 2)
|
|
1612
1624
|
]),
|
|
1613
|
-
|
|
1625
|
+
r[19] || (r[19] = e("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1614
1626
|
e("div", cr, [
|
|
1615
1627
|
e("div", {
|
|
1616
|
-
class:
|
|
1628
|
+
class: ge([
|
|
1617
1629
|
{
|
|
1618
|
-
"bg-fm-color-primary": A <
|
|
1619
|
-
"bg-white": A >=
|
|
1630
|
+
"bg-fm-color-primary": A < T.value.length - 1,
|
|
1631
|
+
"bg-white": A >= T.value.length - 1
|
|
1620
1632
|
},
|
|
1621
1633
|
"w-[2px] h-full"
|
|
1622
1634
|
])
|
|
@@ -1629,36 +1641,36 @@ const Ot = {
|
|
|
1629
1641
|
e("span", null, " Return #" + m(b.seqNumber), 1),
|
|
1630
1642
|
e("span", mr, [
|
|
1631
1643
|
e("span", {
|
|
1632
|
-
class:
|
|
1633
|
-
}, m(
|
|
1644
|
+
class: ge(`fm-status-badge fm-status-badge-${`${b.status}`.toLocaleLowerCase("en-us")}`)
|
|
1645
|
+
}, m(n(t)(`inventory.transfer.status.${b.status}`)), 3)
|
|
1634
1646
|
])
|
|
1635
1647
|
]),
|
|
1636
|
-
e("div", pr, m(
|
|
1648
|
+
e("div", pr, m(n(Me)(n(vt)(b._id))), 1)
|
|
1637
1649
|
]),
|
|
1638
1650
|
e("div", vr, [
|
|
1639
|
-
B(
|
|
1651
|
+
B(S, {
|
|
1640
1652
|
variant: "secondary",
|
|
1641
1653
|
label: "Print",
|
|
1642
1654
|
"prepend-icon": "print",
|
|
1643
1655
|
"text-color": "primary",
|
|
1644
1656
|
"bg-color": "transparent",
|
|
1645
1657
|
"border-color": "primary",
|
|
1646
|
-
onClick: (
|
|
1647
|
-
var
|
|
1648
|
-
return
|
|
1658
|
+
onClick: ($) => {
|
|
1659
|
+
var le, ie, ue, ve, ye, ee, he, Ae, Te;
|
|
1660
|
+
return n(lt)(
|
|
1649
1661
|
{
|
|
1650
1662
|
...b,
|
|
1651
1663
|
ref: [
|
|
1652
1664
|
b.ref,
|
|
1653
|
-
(
|
|
1665
|
+
(ie = (le = M.value[b._id]) == null ? void 0 : le.netSuite) != null && ie.refNo ? `Netsuite ${(ve = (ue = M.value[b._id]) == null ? void 0 : ue.netSuite) == null ? void 0 : ve.refNo} (${(ee = (ye = M.value[b._id]) == null ? void 0 : ye.netSuite) == null ? void 0 : ee.id})` : ""
|
|
1654
1666
|
].filter((Ue) => Ue == null ? void 0 : Ue.trim()).join()
|
|
1655
1667
|
},
|
|
1656
1668
|
{
|
|
1657
1669
|
doc: {
|
|
1658
1670
|
profile: {
|
|
1659
|
-
name: (
|
|
1660
|
-
address: (Ae =
|
|
1661
|
-
regNo: (
|
|
1671
|
+
name: (he = s.purchaseOrder) == null ? void 0 : he.supplier.name,
|
|
1672
|
+
address: (Ae = s.purchaseOrder) == null ? void 0 : Ae.supplier.address,
|
|
1673
|
+
regNo: (Te = s.purchaseOrder) == null ? void 0 : Te.supplier.registrationNumber
|
|
1662
1674
|
}
|
|
1663
1675
|
}
|
|
1664
1676
|
}
|
|
@@ -1672,10 +1684,10 @@ const Ot = {
|
|
|
1672
1684
|
e("div", hr, [
|
|
1673
1685
|
e("div", gr, [
|
|
1674
1686
|
e("div", {
|
|
1675
|
-
class:
|
|
1687
|
+
class: ge([
|
|
1676
1688
|
{
|
|
1677
|
-
"bg-fm-color-primary": A <
|
|
1678
|
-
"bg-white": A >=
|
|
1689
|
+
"bg-fm-color-primary": A < T.value.length - 1,
|
|
1690
|
+
"bg-white": A >= T.value.length - 1
|
|
1679
1691
|
},
|
|
1680
1692
|
"w-[2px] h-full"
|
|
1681
1693
|
])
|
|
@@ -1683,35 +1695,35 @@ const Ot = {
|
|
|
1683
1695
|
])
|
|
1684
1696
|
]),
|
|
1685
1697
|
e("div", br, [
|
|
1686
|
-
B(
|
|
1698
|
+
B(C, {
|
|
1687
1699
|
variant: "outlined",
|
|
1688
1700
|
class: "py-12 px-16"
|
|
1689
1701
|
}, {
|
|
1690
|
-
default:
|
|
1691
|
-
var
|
|
1702
|
+
default: _e(() => {
|
|
1703
|
+
var $, le, ie, ue, ve, ye;
|
|
1692
1704
|
return [
|
|
1693
1705
|
e("div", _r, [
|
|
1694
|
-
(
|
|
1706
|
+
(le = ($ = M.value[b._id]) == null ? void 0 : $.netSuite) != null && le.id ? (c(), _(re, { key: 0 }, [
|
|
1695
1707
|
e("div", Sr, [
|
|
1696
|
-
|
|
1697
|
-
e("div", wr, m((
|
|
1708
|
+
r[20] || (r[20] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Netsuite transfer order (ID) ", -1)),
|
|
1709
|
+
e("div", wr, m((ue = (ie = M.value[b._id]) == null ? void 0 : ie.netSuite) == null ? void 0 : ue.refNo) + " (" + m((ye = (ve = M.value[b._id]) == null ? void 0 : ve.netSuite) == null ? void 0 : ye.id) + ") ", 1)
|
|
1698
1710
|
]),
|
|
1699
|
-
B(
|
|
1711
|
+
B(P)
|
|
1700
1712
|
], 64)) : D("", !0),
|
|
1701
|
-
|
|
1702
|
-
(
|
|
1703
|
-
var
|
|
1704
|
-
return
|
|
1705
|
-
key:
|
|
1713
|
+
r[21] || (r[21] = e("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Returning items ", -1)),
|
|
1714
|
+
(c(!0), _(re, null, Se((b == null ? void 0 : b.items) ?? [], (ee) => {
|
|
1715
|
+
var he;
|
|
1716
|
+
return c(), _("div", {
|
|
1717
|
+
key: ee.code,
|
|
1706
1718
|
class: "flex flex-col"
|
|
1707
1719
|
}, [
|
|
1708
1720
|
e("div", xr, [
|
|
1709
|
-
e("div",
|
|
1710
|
-
e("div",
|
|
1721
|
+
e("div", Or, m(ee.name), 1),
|
|
1722
|
+
e("div", kr, m(n(Ge)(ee.quantity, ee.sku.unit, ee.measurement)), 1)
|
|
1711
1723
|
]),
|
|
1712
|
-
e("div",
|
|
1713
|
-
e("div", Dr, m(
|
|
1714
|
-
(
|
|
1724
|
+
e("div", Rr, [
|
|
1725
|
+
e("div", Dr, m(ee.code), 1),
|
|
1726
|
+
(he = ee.totalCost) != null && he.amount && n(L).enableTotalCost ? (c(), _("div", Nr, " (" + m(n($e)(ee.totalCost)) + ") ", 1)) : D("", !0)
|
|
1715
1727
|
])
|
|
1716
1728
|
]);
|
|
1717
1729
|
}), 128))
|
|
@@ -1723,24 +1735,24 @@ const Ot = {
|
|
|
1723
1735
|
])
|
|
1724
1736
|
])
|
|
1725
1737
|
], 64))), 128))
|
|
1726
|
-
])) : (
|
|
1727
|
-
|
|
1738
|
+
])) : (c(), _("div", tr, [
|
|
1739
|
+
r[17] || (r[17] = e("div", { class: "h-80" }, null, -1)),
|
|
1728
1740
|
e("div", null, [
|
|
1729
1741
|
e("img", {
|
|
1730
|
-
src:
|
|
1742
|
+
src: n(et),
|
|
1731
1743
|
alt: "List is empty"
|
|
1732
1744
|
}, null, 8, sr)
|
|
1733
1745
|
]),
|
|
1734
|
-
e("div", rr, m(
|
|
1735
|
-
|
|
1746
|
+
e("div", rr, m(n(t)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
1747
|
+
r[18] || (r[18] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, " You may view return request history here. ", -1)),
|
|
1736
1748
|
e("div", ar, [
|
|
1737
|
-
|
|
1749
|
+
Z.value && T.value != null && !((Ne = T.value) != null && Ne.length) ? (c(), se(S, {
|
|
1738
1750
|
key: 0,
|
|
1739
1751
|
label: "Create return request",
|
|
1740
1752
|
variant: "secondary",
|
|
1741
|
-
onClick:
|
|
1742
|
-
loading:
|
|
1743
|
-
disabled:
|
|
1753
|
+
onClick: r[2] || (r[2] = (b) => ae("returnStock")),
|
|
1754
|
+
loading: f.value === "returnStock",
|
|
1755
|
+
disabled: f.value !== "returnStock" && d.value,
|
|
1744
1756
|
"prepend-icon": "undo",
|
|
1745
1757
|
"text-color": "primary",
|
|
1746
1758
|
"bg-color": "transparent",
|
|
@@ -1752,66 +1764,66 @@ const Ot = {
|
|
|
1752
1764
|
])
|
|
1753
1765
|
];
|
|
1754
1766
|
}),
|
|
1755
|
-
"side-sheet-footer":
|
|
1756
|
-
var
|
|
1767
|
+
"side-sheet-footer": _e(() => {
|
|
1768
|
+
var oe, me, H, pe, ke, Re, De, Ne, b, A;
|
|
1757
1769
|
return [
|
|
1758
1770
|
e("div", Ar, [
|
|
1759
|
-
((
|
|
1771
|
+
((oe = s.purchaseOrder) == null ? void 0 : oe.status) === n(j).enum.DRAFT && o.value === n(be).PURCHASE ? (c(), se(S, {
|
|
1760
1772
|
key: 0,
|
|
1761
|
-
label:
|
|
1762
|
-
onClick:
|
|
1763
|
-
loading:
|
|
1764
|
-
disabled:
|
|
1773
|
+
label: n(t)("inventory.transfer.receiveRequest.actions.confirmDraft"),
|
|
1774
|
+
onClick: r[3] || (r[3] = ($) => ae("confirmDraft")),
|
|
1775
|
+
loading: f.value === "confirmDraft",
|
|
1776
|
+
disabled: f.value !== "confirmDraft" && d.value
|
|
1765
1777
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1766
|
-
((
|
|
1778
|
+
((me = s.purchaseOrder) == null ? void 0 : me.status) === n(j).enum.DRAFT && o.value === n(be).TRANSFER ? (c(), se(S, {
|
|
1767
1779
|
key: 1,
|
|
1768
|
-
label:
|
|
1769
|
-
onClick:
|
|
1770
|
-
loading:
|
|
1771
|
-
disabled:
|
|
1780
|
+
label: n(t)("inventory.transfer.receiveRequest.actions.submitRequest"),
|
|
1781
|
+
onClick: r[4] || (r[4] = ($) => ae("submitRequest")),
|
|
1782
|
+
loading: f.value === "submitRequest",
|
|
1783
|
+
disabled: f.value !== "submitRequest" && d.value
|
|
1772
1784
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1773
|
-
((
|
|
1785
|
+
((H = s.purchaseOrder) == null ? void 0 : H.status) === n(j).enum.DRAFT ? (c(), se(S, {
|
|
1774
1786
|
key: 2,
|
|
1775
|
-
label:
|
|
1776
|
-
onClick:
|
|
1777
|
-
loading:
|
|
1778
|
-
disabled:
|
|
1787
|
+
label: n(t)("inventory.transfer.receiveRequest.actions.cancelDraft"),
|
|
1788
|
+
onClick: r[5] || (r[5] = ($) => ae("cancelDraft")),
|
|
1789
|
+
loading: f.value === "cancelDraft",
|
|
1790
|
+
disabled: f.value !== "cancelDraft" && d.value,
|
|
1779
1791
|
variant: "destructive"
|
|
1780
1792
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1781
|
-
((
|
|
1793
|
+
((pe = s.purchaseOrder) == null ? void 0 : pe.status) === n(j).enum.RECEIVING ? (c(), se(S, {
|
|
1782
1794
|
key: 3,
|
|
1783
|
-
label:
|
|
1784
|
-
onClick:
|
|
1785
|
-
loading:
|
|
1786
|
-
disabled:
|
|
1795
|
+
label: n(t)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
1796
|
+
onClick: r[6] || (r[6] = ($) => ae("completeReceive")),
|
|
1797
|
+
loading: f.value === "completeReceive",
|
|
1798
|
+
disabled: f.value !== "completeReceive" && d.value
|
|
1787
1799
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1788
|
-
|
|
1800
|
+
s.canResubmit ? (c(), se(S, {
|
|
1789
1801
|
key: 4,
|
|
1790
|
-
label:
|
|
1791
|
-
onClick:
|
|
1792
|
-
loading:
|
|
1793
|
-
disabled:
|
|
1802
|
+
label: n(t)("inventory.transfer.receiveRequest.actions.resubmitRequest"),
|
|
1803
|
+
onClick: r[7] || (r[7] = ($) => ae("submitRequest")),
|
|
1804
|
+
loading: f.value === "submitRequest",
|
|
1805
|
+
disabled: f.value !== "submitRequest" && d.value
|
|
1794
1806
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1795
|
-
(((
|
|
1807
|
+
(((ke = s.purchaseOrder) == null ? void 0 : ke.status) === n(j).enum.REQUESTING || ((Re = s.purchaseOrder) == null ? void 0 : Re.status) === n(j).enum.PROCESSING) && s.canApprove ? (c(), se(S, {
|
|
1796
1808
|
key: 5,
|
|
1797
|
-
label:
|
|
1798
|
-
onClick:
|
|
1799
|
-
loading:
|
|
1800
|
-
disabled:
|
|
1809
|
+
label: n(t)("inventory.transfer.approval.actions.approveRequest"),
|
|
1810
|
+
onClick: r[8] || (r[8] = ($) => ae("approveRequest")),
|
|
1811
|
+
loading: f.value === "approveRequest",
|
|
1812
|
+
disabled: f.value !== "approveRequest" && d.value
|
|
1801
1813
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1802
|
-
((De =
|
|
1814
|
+
((De = s.purchaseOrder) == null ? void 0 : De.status) === n(j).enum.REQUESTING && s.canApprove ? (c(), se(S, {
|
|
1803
1815
|
key: 6,
|
|
1804
|
-
label:
|
|
1805
|
-
onClick:
|
|
1806
|
-
loading:
|
|
1807
|
-
disabled:
|
|
1816
|
+
label: n(t)("inventory.transfer.approval.actions.rejectRequest"),
|
|
1817
|
+
onClick: r[9] || (r[9] = ($) => ae("rejectRequest")),
|
|
1818
|
+
loading: f.value === "rejectRequest",
|
|
1819
|
+
disabled: f.value !== "rejectRequest" && d.value,
|
|
1808
1820
|
variant: "destructive"
|
|
1809
1821
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1810
|
-
((Ne =
|
|
1822
|
+
((Ne = s.purchaseOrder) == null ? void 0 : Ne.status) !== n(j).enum.COMPLETE && ((b = s.purchaseOrder) == null ? void 0 : b.status) !== n(j).enum.CANCEL && (((A = s.purchaseOrder) == null ? void 0 : A.status) !== n(j).enum.REQUESTING || s.canApprove) ? (c(), se(S, {
|
|
1811
1823
|
key: 7,
|
|
1812
|
-
label:
|
|
1824
|
+
label: n(t)("common.close"),
|
|
1813
1825
|
variant: "tertiary",
|
|
1814
|
-
onClick:
|
|
1826
|
+
onClick: r[10] || (r[10] = ($) => i("update:show", !1))
|
|
1815
1827
|
}, null, 8, ["label"])) : D("", !0)
|
|
1816
1828
|
])
|
|
1817
1829
|
];
|
|
@@ -1826,6 +1838,6 @@ export {
|
|
|
1826
1838
|
Br as _,
|
|
1827
1839
|
Fr as a,
|
|
1828
1840
|
Ur as b,
|
|
1829
|
-
|
|
1841
|
+
Ot as g,
|
|
1830
1842
|
Xe as u
|
|
1831
1843
|
};
|