@feedmepos/mf-inventory-portal 0.0.25-dev.32 → 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-5mHsEh9k.js → App-BHIdSSIe.js} +2 -2
- package/dist/{ApprovalView-8j418xsu.js → ApprovalView-BHsPq9fp.js} +2 -2
- package/dist/{BindingsDialog-mI12JwDT.js → BindingsDialog-CcA_m9fC.js} +2 -2
- package/dist/{BindingsPicker-BiWsFvJ9.js → BindingsPicker-UttPVr0V.js} +1 -1
- package/dist/{BindingsTable-D0gpm1wp.js → BindingsTable-CQKt-n8j.js} +1 -1
- package/dist/{ClosingDraftView-CDw4t1Ry.js → ClosingDraftView-tYyeEBsI.js} +2 -2
- package/dist/{ClosingTemplateView-BVT7uVSl.js → ClosingTemplateView-CjFaTKSv.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-5lfzdCEF.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B544ZjAk.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BiH1i5IX.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D6LxuLjN.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BZ5jhZJ3.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-hU74c6gB.js} +1 -1
- package/dist/{IngredientGroupView-CuOJ-lgG.js → IngredientGroupView-CjMBtQnL.js} +1 -1
- package/dist/{IngredientsView-DQxuOeeA.js → IngredientsView-Dr6lDeAa.js} +4 -4
- package/dist/{IntegrationView-dTWQ7Y0L.js → IntegrationView-ltFLmByt.js} +1 -1
- package/dist/{InventoryBindingForm-BqbgCls7.js → InventoryBindingForm-BVtDX2SX.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DNzrrq37.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CUykd8am.js} +3 -3
- package/dist/{InventoryBindingSummary-D9JS8cpw.js → InventoryBindingSummary-CvzXOSPU.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-vCMIiBLz.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DNs_wg0e.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Dseg75Hj.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BCwv6pd5.js} +1 -1
- package/dist/{PublishView-Pioi-3PK.js → PublishView-Cq_ylGgc.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-C06cZQBi.js → PurchaseOrderPrintPreview-CYCmhU-e.js} +1 -1
- package/dist/{ReceiveRequestView-0LIDAdE4.js → ReceiveRequestView-LnqepR2e.js} +9 -9
- package/dist/{RecipeView-dvtN4dem.js → RecipeView-CMs6Qt9A.js} +3 -3
- package/dist/{StockView-LWjH0TiO.js → StockView-e-PcQAKr.js} +7 -7
- package/dist/{SupplierView-By5AlMwB.js → SupplierView-CeXmu4st.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BtdKFA4E.js → TransferDetails.vue_vue_type_script_setup_true_lang-DW_wzTB0.js} +557 -546
- package/dist/{TransferTemplateView-GfTDTpDz.js → TransferTemplateView-_jXDAlSR.js} +7 -7
- package/dist/{UnitView-B_C9Hrmw.js → UnitView-CYqpDvJJ.js} +3 -3
- package/dist/{WarehouseView-CGIrHlmN.js → WarehouseView-Ce8XkGoe.js} +1 -1
- package/dist/api/purchase-order.d.ts +4 -1
- package/dist/{app-PUG_dqk9.js → app-mT4U5kNO.js} +10 -10
- package/dist/app.js +1 -1
- package/dist/{decimal-BYRcDs02.js → decimal-B7ZVTj3Q.js} +1 -1
- package/dist/{feature-CXJupSqw.js → feature-BdqR6_vW.js} +1 -1
- package/dist/{format-unit-display-uZsyeofT.js → format-unit-display-DgTlT1cC.js} +2 -2
- package/dist/{index-BMnRochi.js → index-BO9UatRG.js} +2 -2
- package/dist/{stock-CvA-l-yz.js → stock-CtxeFyYM.js} +1 -1
- package/dist/{supplier-E13yRo0f.js → supplier-Bz2bTujX.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-C57l6NFB.js → use-ingredient-select-dialog-q3WmGGOm.js} +1 -1
- package/dist/{use-inventory-binding-dialog-drEXHE4h.js → use-inventory-binding-dialog-D246fGyU.js} +1 -1
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +187 -2
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +4 -3
- package/dist/{vue-i18n-C1ehwhFs.js → vue-i18n-iWMdXkLq.js} +261 -261
- package/package.json +3 -3
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { W as it, u as Pe, aL as
|
|
2
|
-
import { ref as K, computed as X, h as N, defineComponent as Qe, onMounted as yt, unref 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 be } from "./format-unit-display-
|
|
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(q,
|
|
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,
|
|
@@ -108,44 +108,44 @@ const Xe = it((p, v) => {
|
|
|
108
108
|
var He = /* @__PURE__ */ ((p) => (p.RECEIVE_REQUEST = "receive/request", p.APPROVAL = "approval", p))(He || {});
|
|
109
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
|
-
}),
|
|
119
|
+
}), f = K(new Array()), F = ft(), U = K(null);
|
|
120
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
|
-
we.value.show =
|
|
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
133
|
async function T(y) {
|
|
134
|
-
function h(
|
|
135
|
-
const
|
|
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
|
-
we.value.show =
|
|
139
|
+
"onUpdate:show"(k) {
|
|
140
|
+
we.value.show = k;
|
|
141
141
|
},
|
|
142
|
-
templateId:
|
|
142
|
+
templateId: r,
|
|
143
143
|
lastClosingDate: U.value
|
|
144
144
|
};
|
|
145
|
-
we.value =
|
|
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,31 +158,31 @@ 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
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
|
-
we.value.show =
|
|
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"
|
|
@@ -191,12 +191,12 @@ function Fr(p, v) {
|
|
|
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"
|
|
@@ -205,37 +205,37 @@ function Fr(p, v) {
|
|
|
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
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",
|
|
@@ -244,84 +244,84 @@ function Fr(p, v) {
|
|
|
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
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
|
|
258
|
+
async function ae(y, h, s, r) {
|
|
259
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
|
-
|
|
273
|
+
r
|
|
274
274
|
), await new Promise((P) => setTimeout(P, 1e3));
|
|
275
|
-
const
|
|
276
|
-
h ===
|
|
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
|
-
q.value = !1,
|
|
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
|
-
|
|
314
|
+
const { successMessage: k, ...P } = O;
|
|
315
|
+
a.open({
|
|
316
316
|
title: P.title,
|
|
317
317
|
message: P.message,
|
|
318
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,10 +342,10 @@ function Fr(p, v) {
|
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
344
|
return {
|
|
345
|
-
purchaseOrders:
|
|
346
|
-
purchaseRequests:
|
|
347
|
-
updateDateRange:
|
|
348
|
-
fetchData:
|
|
345
|
+
purchaseOrders: o,
|
|
346
|
+
purchaseRequests: f,
|
|
347
|
+
updateDateRange: fe,
|
|
348
|
+
fetchData: Z,
|
|
349
349
|
loading: q,
|
|
350
350
|
transferDialogProps: we,
|
|
351
351
|
promptCreateTransferDialog: T,
|
|
@@ -360,24 +360,24 @@ function Fr(p, v) {
|
|
|
360
360
|
}
|
|
361
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
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,178 +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
|
-
}, q = p.items.map((
|
|
390
|
-
const { sku:
|
|
391
|
-
Ot(
|
|
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: Oe(
|
|
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:
|
|
419
|
+
buyer: x,
|
|
420
|
+
supplier: L,
|
|
421
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, J, T, M
|
|
512
|
-
const
|
|
513
|
-
if (
|
|
514
|
-
const
|
|
515
|
-
|
|
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);
|
|
516
527
|
return;
|
|
517
528
|
}
|
|
518
|
-
if (
|
|
519
|
-
v.promptShowTransferDetails(
|
|
520
|
-
console.error("error on promptShowTransferDetails", { error:
|
|
529
|
+
if (t === Q.Details) {
|
|
530
|
+
v.promptShowTransferDetails(d, l).catch((Y) => {
|
|
531
|
+
console.error("error on promptShowTransferDetails", { error: Y, poRequest: l });
|
|
521
532
|
});
|
|
522
533
|
return;
|
|
523
534
|
}
|
|
524
|
-
if (
|
|
525
|
-
(
|
|
535
|
+
if (t === Q.Update) {
|
|
536
|
+
(T = v.promptUpdateTransferDialog) == null || T.call(v, d);
|
|
526
537
|
return;
|
|
527
538
|
}
|
|
528
|
-
if (
|
|
529
|
-
v.submitAction(
|
|
530
|
-
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 });
|
|
531
542
|
});
|
|
532
543
|
return;
|
|
533
544
|
}
|
|
534
545
|
}
|
|
535
|
-
function
|
|
546
|
+
function L() {
|
|
536
547
|
return [
|
|
537
548
|
{
|
|
538
549
|
accessorKey: "seqNumber",
|
|
539
|
-
header: () =>
|
|
550
|
+
header: () => a("inventory.transfer.table.seqNo"),
|
|
540
551
|
enableSorting: !0,
|
|
541
552
|
size: 80,
|
|
542
553
|
sortUndefined: "last"
|
|
543
554
|
},
|
|
544
555
|
{
|
|
545
556
|
accessorKey: "_id",
|
|
546
|
-
header: () =>
|
|
547
|
-
cell(
|
|
548
|
-
return Ee(`${
|
|
557
|
+
header: () => a("inventory.transfer.table.createdAt"),
|
|
558
|
+
cell(t) {
|
|
559
|
+
return Ee(`${t.getValue()}`);
|
|
549
560
|
},
|
|
550
561
|
enableSorting: !0
|
|
551
562
|
},
|
|
552
563
|
{
|
|
553
564
|
accessorKey: "supplier.name",
|
|
554
|
-
header: () =>
|
|
565
|
+
header: () => a("inventory.transfer.table.transferFrom"),
|
|
555
566
|
enableSorting: !0,
|
|
556
567
|
size: 200
|
|
557
568
|
},
|
|
558
569
|
{
|
|
559
570
|
accessorKey: "items.length",
|
|
560
|
-
header: () =>
|
|
571
|
+
header: () => a("inventory.transfer.table.noOfItems"),
|
|
561
572
|
enableSorting: !1,
|
|
562
573
|
meta: {
|
|
563
574
|
width: "10rem"
|
|
@@ -565,15 +576,15 @@ function Ur(p, v) {
|
|
|
565
576
|
},
|
|
566
577
|
{
|
|
567
578
|
accessorKey: "ref",
|
|
568
|
-
header: () =>
|
|
579
|
+
header: () => a("inventory.transfer.table.reference"),
|
|
569
580
|
enableSorting: !1,
|
|
570
581
|
size: "auto"
|
|
571
582
|
},
|
|
572
583
|
{
|
|
573
584
|
accessorKey: "status",
|
|
574
|
-
header: () =>
|
|
575
|
-
cell(
|
|
576
|
-
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");
|
|
577
588
|
return N(
|
|
578
589
|
"div",
|
|
579
590
|
{
|
|
@@ -584,7 +595,7 @@ function Ur(p, v) {
|
|
|
584
595
|
{
|
|
585
596
|
class: `fm-status-badge fm-status-badge-${l}`
|
|
586
597
|
},
|
|
587
|
-
|
|
598
|
+
o
|
|
588
599
|
)
|
|
589
600
|
);
|
|
590
601
|
},
|
|
@@ -593,9 +604,9 @@ function Ur(p, v) {
|
|
|
593
604
|
},
|
|
594
605
|
{
|
|
595
606
|
id: "action",
|
|
596
|
-
cell(
|
|
597
|
-
const
|
|
598
|
-
return Je(l, (
|
|
607
|
+
cell(t) {
|
|
608
|
+
const o = t.row.original, l = i(o);
|
|
609
|
+
return Je(l, (d) => x(d, o));
|
|
599
610
|
},
|
|
600
611
|
enableSorting: !1,
|
|
601
612
|
size: 40,
|
|
@@ -606,45 +617,45 @@ function Ur(p, v) {
|
|
|
606
617
|
}
|
|
607
618
|
];
|
|
608
619
|
}
|
|
609
|
-
function
|
|
620
|
+
function q() {
|
|
610
621
|
return [
|
|
611
622
|
{
|
|
612
623
|
accessorKey: "purchaseOrder.seqNumber",
|
|
613
|
-
header: () =>
|
|
624
|
+
header: () => a("inventory.transfer.table.seqNo"),
|
|
614
625
|
enableSorting: !0,
|
|
615
626
|
size: 80,
|
|
616
627
|
sortUndefined: "last"
|
|
617
628
|
},
|
|
618
629
|
{
|
|
619
630
|
accessorKey: "purchaseOrder._id",
|
|
620
|
-
header: () =>
|
|
621
|
-
cell(
|
|
622
|
-
return Ee(`${
|
|
631
|
+
header: () => a("inventory.transfer.table.createdAt"),
|
|
632
|
+
cell(t) {
|
|
633
|
+
return Ee(`${t.getValue()}`);
|
|
623
634
|
},
|
|
624
635
|
enableSorting: !0
|
|
625
636
|
},
|
|
626
637
|
{
|
|
627
638
|
accessorKey: "to.name",
|
|
628
|
-
header: () =>
|
|
639
|
+
header: () => a("inventory.transfer.table.transferTo"),
|
|
629
640
|
enableSorting: !1,
|
|
630
641
|
size: 200
|
|
631
642
|
},
|
|
632
643
|
{
|
|
633
644
|
accessorKey: "purchaseOrder.items.length",
|
|
634
|
-
header: () =>
|
|
645
|
+
header: () => a("inventory.transfer.table.noOfItems"),
|
|
635
646
|
enableSorting: !1
|
|
636
647
|
},
|
|
637
648
|
{
|
|
638
649
|
accessorKey: "purchaseOrder.ref",
|
|
639
|
-
header: () =>
|
|
650
|
+
header: () => a("inventory.transfer.table.reference"),
|
|
640
651
|
enableSorting: !1,
|
|
641
652
|
size: "auto"
|
|
642
653
|
},
|
|
643
654
|
{
|
|
644
655
|
accessorKey: "purchaseOrder.status",
|
|
645
|
-
header: () =>
|
|
646
|
-
cell(
|
|
647
|
-
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");
|
|
648
659
|
return N(
|
|
649
660
|
"div",
|
|
650
661
|
{
|
|
@@ -655,7 +666,7 @@ function Ur(p, v) {
|
|
|
655
666
|
{
|
|
656
667
|
class: `fm-status-badge fm-status-badge-${l}`
|
|
657
668
|
},
|
|
658
|
-
|
|
669
|
+
o
|
|
659
670
|
)
|
|
660
671
|
);
|
|
661
672
|
},
|
|
@@ -663,17 +674,17 @@ function Ur(p, v) {
|
|
|
663
674
|
},
|
|
664
675
|
{
|
|
665
676
|
id: "action",
|
|
666
|
-
cell(
|
|
667
|
-
const
|
|
677
|
+
cell(t) {
|
|
678
|
+
const o = t.row.original, l = o.purchaseOrder ? i(o.purchaseOrder) : [];
|
|
668
679
|
return Je(
|
|
669
680
|
l,
|
|
670
|
-
(
|
|
671
|
-
|
|
681
|
+
(d) => o.purchaseOrder ? x(
|
|
682
|
+
d,
|
|
672
683
|
{
|
|
673
|
-
...
|
|
674
|
-
_rev:
|
|
684
|
+
...o.purchaseOrder,
|
|
685
|
+
_rev: o.purchaseOrder._rev ?? ""
|
|
675
686
|
},
|
|
676
|
-
|
|
687
|
+
o
|
|
677
688
|
) : void 0
|
|
678
689
|
);
|
|
679
690
|
},
|
|
@@ -686,17 +697,17 @@ function Ur(p, v) {
|
|
|
686
697
|
}
|
|
687
698
|
];
|
|
688
699
|
}
|
|
689
|
-
const
|
|
700
|
+
const u = X(() => p === "receive/request" ? L() : q());
|
|
690
701
|
return {
|
|
691
702
|
get columnDefs() {
|
|
692
|
-
return
|
|
703
|
+
return u.value;
|
|
693
704
|
}
|
|
694
705
|
};
|
|
695
706
|
}
|
|
696
|
-
const
|
|
707
|
+
const kt = {
|
|
697
708
|
key: 0,
|
|
698
709
|
class: "flex flex-col gap-8"
|
|
699
|
-
},
|
|
710
|
+
}, Rt = { class: "flex flex-col gap-4" }, Dt = { class: "fm-typo-en-body-lg-600" }, Nt = {
|
|
700
711
|
key: 0,
|
|
701
712
|
class: "flex flex-col gap-4"
|
|
702
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 = {
|
|
@@ -719,56 +730,56 @@ const Rt = {
|
|
|
719
730
|
scope: {}
|
|
720
731
|
},
|
|
721
732
|
setup(p) {
|
|
722
|
-
const v = p,
|
|
733
|
+
const v = p, a = ze(), i = Xe(), w = K(v.poRequest);
|
|
723
734
|
yt(async () => {
|
|
724
|
-
var
|
|
725
|
-
if (!v.poRequest && ((
|
|
726
|
-
const
|
|
727
|
-
|
|
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;
|
|
728
739
|
}
|
|
729
740
|
});
|
|
730
|
-
const
|
|
741
|
+
const x = X(
|
|
731
742
|
() => {
|
|
732
|
-
var
|
|
733
|
-
return
|
|
734
|
-
((
|
|
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)
|
|
735
746
|
).fullName;
|
|
736
747
|
}
|
|
737
|
-
),
|
|
738
|
-
var
|
|
739
|
-
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;
|
|
740
751
|
}), q = X(() => {
|
|
741
|
-
var
|
|
742
|
-
return (
|
|
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) => {
|
|
743
754
|
var U;
|
|
744
755
|
return (U = F.netSuite) == null ? void 0 : U.refNo;
|
|
745
756
|
}).join(", ") : "N/A";
|
|
746
757
|
});
|
|
747
|
-
return (
|
|
748
|
-
var
|
|
749
|
-
return
|
|
750
|
-
e("div",
|
|
751
|
-
|
|
752
|
-
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)
|
|
753
764
|
]),
|
|
754
|
-
!
|
|
755
|
-
e("div", At, " NetSuite " + m(
|
|
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),
|
|
756
767
|
e("div", Tt, [
|
|
757
|
-
(
|
|
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"))
|
|
758
769
|
])
|
|
759
770
|
])) : D("", !0),
|
|
760
|
-
!
|
|
761
|
-
e("div", qt, " (Request) NetSuite " + m(
|
|
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),
|
|
762
773
|
e("div", Et, [
|
|
763
|
-
(
|
|
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"))
|
|
764
775
|
])
|
|
765
776
|
])) : D("", !0),
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
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)
|
|
769
780
|
])) : D("", !0),
|
|
770
|
-
|
|
771
|
-
|
|
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)),
|
|
772
783
|
e("div", Mt, m(q.value), 1)
|
|
773
784
|
])) : D("", !0)
|
|
774
785
|
])) : D("", !0);
|
|
@@ -785,15 +796,15 @@ const Rt = {
|
|
|
785
796
|
isTransferBetweenOutlets: { type: Boolean }
|
|
786
797
|
},
|
|
787
798
|
setup(p) {
|
|
788
|
-
const v = p,
|
|
789
|
-
var
|
|
790
|
-
let
|
|
791
|
-
|
|
792
|
-
const
|
|
793
|
-
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;
|
|
794
805
|
});
|
|
795
806
|
async function q() {
|
|
796
|
-
|
|
807
|
+
x.value || w.open({
|
|
797
808
|
title: "Sync with NetSuite",
|
|
798
809
|
contentComponent: N("div", [
|
|
799
810
|
N("p", "Are you sure you want to sync now?"),
|
|
@@ -811,44 +822,44 @@ const Rt = {
|
|
|
811
822
|
},
|
|
812
823
|
secondaryActions: { text: "Not now", close: !0 }
|
|
813
824
|
}).onPrimary(async () => {
|
|
814
|
-
var
|
|
825
|
+
var u;
|
|
815
826
|
try {
|
|
816
|
-
|
|
817
|
-
const
|
|
818
|
-
let
|
|
819
|
-
if ((
|
|
820
|
-
|
|
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({
|
|
821
832
|
title: "Error",
|
|
822
833
|
message: "Invalid sync ID",
|
|
823
834
|
type: "error"
|
|
824
835
|
});
|
|
825
836
|
return;
|
|
826
837
|
}
|
|
827
|
-
await
|
|
838
|
+
await a.syncTransferOrder(l, t == null ? void 0 : t._id, o == null ? void 0 : o._id), i.open({
|
|
828
839
|
title: "Sync with NetSuite",
|
|
829
840
|
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
830
841
|
type: "success"
|
|
831
842
|
});
|
|
832
843
|
} catch {
|
|
833
|
-
|
|
844
|
+
i.open({
|
|
834
845
|
title: "Error",
|
|
835
846
|
message: "Failed to sync with NetSuite",
|
|
836
847
|
type: "error"
|
|
837
848
|
});
|
|
838
849
|
}
|
|
839
850
|
setTimeout(() => {
|
|
840
|
-
|
|
851
|
+
x.value = !1;
|
|
841
852
|
}, 5e3);
|
|
842
853
|
});
|
|
843
854
|
}
|
|
844
|
-
return (
|
|
845
|
-
const
|
|
846
|
-
return
|
|
847
|
-
B(
|
|
855
|
+
return (u, t) => {
|
|
856
|
+
const o = ce("FmButton");
|
|
857
|
+
return L.value ? (c(), _("div", Vt, [
|
|
858
|
+
B(o, {
|
|
848
859
|
"prepend-icon": "sync",
|
|
849
860
|
variant: "secondary",
|
|
850
861
|
label: "Sync",
|
|
851
|
-
loading:
|
|
862
|
+
loading: x.value,
|
|
852
863
|
onClick: q,
|
|
853
864
|
"text-color": "primary",
|
|
854
865
|
"bg-color": "transparent",
|
|
@@ -875,7 +886,7 @@ const Rt = {
|
|
|
875
886
|
}, vs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ys = { class: "fm-typo-en-body-lg-600" }, hs = {
|
|
876
887
|
key: 0,
|
|
877
888
|
class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16 flex flex-col gap-8"
|
|
878
|
-
}, 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" },
|
|
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 = {
|
|
879
890
|
key: 0,
|
|
880
891
|
class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
881
892
|
}, Ts = { class: "py-8" }, $s = { class: "flex justify-end gap-4 items-center" }, Ps = { class: "fm-typo-en-body-lg-600" }, Cs = {
|
|
@@ -920,7 +931,7 @@ const Rt = {
|
|
|
920
931
|
}, gr = { class: "flex-1 flex flex-col items-center" }, br = {
|
|
921
932
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
922
933
|
name: "delivery details"
|
|
923
|
-
}, _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" },
|
|
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 = {
|
|
924
935
|
key: 0,
|
|
925
936
|
class: "line-clamp-1 fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
926
937
|
}, Ar = { class: "flex gap-8 xs:flex-col" }, Br = /* @__PURE__ */ Qe({
|
|
@@ -937,173 +948,173 @@ const Rt = {
|
|
|
937
948
|
},
|
|
938
949
|
emits: ["update:show", "submitted", "returnStock"],
|
|
939
950
|
setup(p, { emit: v }) {
|
|
940
|
-
const
|
|
951
|
+
const a = p, i = v, w = Ye(), x = We(), L = nt(), q = ze(), u = Pe(), { t } = at(), o = X(
|
|
941
952
|
() => {
|
|
942
|
-
var
|
|
943
|
-
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;
|
|
944
955
|
}
|
|
945
|
-
),
|
|
946
|
-
var
|
|
947
|
-
return
|
|
948
|
-
}),
|
|
949
|
-
var
|
|
950
|
-
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;
|
|
951
962
|
if (!q.isEnabled) {
|
|
952
963
|
const V = q.getNetSuiteLocation(
|
|
953
|
-
(g = (G =
|
|
954
|
-
),
|
|
955
|
-
|
|
956
|
-
),
|
|
957
|
-
if ((
|
|
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;
|
|
958
969
|
}
|
|
959
|
-
return !!((
|
|
960
|
-
}),
|
|
961
|
-
const
|
|
970
|
+
return !!((E = (S = a.purchaseOrder) == null ? void 0 : S.deliveryOrder) != null && E.length);
|
|
971
|
+
}), fe = X(() => {
|
|
972
|
+
const s = [
|
|
962
973
|
{
|
|
963
|
-
label:
|
|
974
|
+
label: t("inventory.transfer.receiveRequest.details.overview"),
|
|
964
975
|
value: "overview"
|
|
965
976
|
},
|
|
966
977
|
{
|
|
967
|
-
label:
|
|
978
|
+
label: t("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
968
979
|
value: "deliveryHistory"
|
|
969
980
|
}
|
|
970
981
|
];
|
|
971
|
-
return
|
|
982
|
+
return Z.value && s.push({
|
|
972
983
|
label: "Returns",
|
|
973
984
|
value: "returns"
|
|
974
|
-
}),
|
|
975
|
-
}), z = K(
|
|
985
|
+
}), s;
|
|
986
|
+
}), z = K(fe.value[0]);
|
|
976
987
|
async function Ce() {
|
|
977
|
-
var
|
|
988
|
+
var s, r, O, k, P;
|
|
978
989
|
T.value = null, M.value = {};
|
|
979
990
|
try {
|
|
980
|
-
const C = ((
|
|
981
|
-
for (const
|
|
982
|
-
const [
|
|
983
|
-
U.getPurchaseOrderById(
|
|
984
|
-
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)
|
|
985
996
|
]);
|
|
986
|
-
G.push(
|
|
997
|
+
G.push(E), V && (M.value[S] = V);
|
|
987
998
|
}
|
|
988
|
-
G.sort((
|
|
999
|
+
G.sort((S, E) => E._id.localeCompare(S._id)), T.value = G;
|
|
989
1000
|
} catch (C) {
|
|
990
|
-
console.error("error on fetching return orders", 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 = [];
|
|
991
1002
|
}
|
|
992
1003
|
}
|
|
993
1004
|
ht(
|
|
994
|
-
() =>
|
|
995
|
-
(
|
|
996
|
-
|
|
1005
|
+
() => a.show,
|
|
1006
|
+
(s) => {
|
|
1007
|
+
s && (z.value = fe.value[0], Ce());
|
|
997
1008
|
}
|
|
998
1009
|
);
|
|
999
|
-
async function Ie(
|
|
1000
|
-
|
|
1010
|
+
async function Ie(s, r, O) {
|
|
1011
|
+
f.value = `${r}`, d.value = !0, F.value = !1;
|
|
1001
1012
|
try {
|
|
1002
1013
|
await U.processPurchaseOrder(
|
|
1003
1014
|
{
|
|
1004
|
-
operation:
|
|
1005
|
-
doc:
|
|
1015
|
+
operation: r,
|
|
1016
|
+
doc: s,
|
|
1006
1017
|
options: (
|
|
1007
1018
|
// auto receive for supplier to warehouse
|
|
1008
|
-
(
|
|
1009
|
-
|
|
1019
|
+
(r === R.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
1020
|
+
r === R.enum.completeReceive) && L.autoReceiveWarehouse ? {
|
|
1010
1021
|
autoReceive: !0
|
|
1011
1022
|
} : void 0
|
|
1012
1023
|
)
|
|
1013
1024
|
},
|
|
1014
|
-
|
|
1015
|
-
), await new Promise((
|
|
1025
|
+
a.transferToDbName
|
|
1026
|
+
), await new Promise((k) => setTimeout(k, 1e3)), x.open({
|
|
1016
1027
|
title: "Success",
|
|
1017
|
-
message:
|
|
1028
|
+
message: O,
|
|
1018
1029
|
type: "success"
|
|
1019
|
-
}),
|
|
1020
|
-
} catch (
|
|
1021
|
-
|
|
1030
|
+
}), i("update:show", !1), i("submitted");
|
|
1031
|
+
} catch (k) {
|
|
1032
|
+
x.open({
|
|
1022
1033
|
title: "Something went wrong",
|
|
1023
1034
|
message: "Please try again.",
|
|
1024
1035
|
type: "error"
|
|
1025
|
-
}), console.error("Error when submitting PO operation",
|
|
1036
|
+
}), console.error("Error when submitting PO operation", r, s, k);
|
|
1026
1037
|
} finally {
|
|
1027
|
-
|
|
1038
|
+
f.value = "", d.value = !1, F.value = !0;
|
|
1028
1039
|
}
|
|
1029
1040
|
}
|
|
1030
|
-
async function
|
|
1031
|
-
if (
|
|
1032
|
-
|
|
1041
|
+
async function ae(s) {
|
|
1042
|
+
if (s === R.enum.returnStock) {
|
|
1043
|
+
a.purchaseOrder && i("returnStock", a.purchaseOrder), i("update:show", !1);
|
|
1033
1044
|
return;
|
|
1034
1045
|
}
|
|
1035
|
-
if (
|
|
1046
|
+
if (s === R.enum.receiveStock)
|
|
1036
1047
|
return;
|
|
1037
|
-
const
|
|
1038
|
-
if (!
|
|
1039
|
-
|
|
1048
|
+
const r = ot[s];
|
|
1049
|
+
if (!r) {
|
|
1050
|
+
x.open({
|
|
1040
1051
|
title: "Something went wrong",
|
|
1041
|
-
message: `Cannot process order: ${st(
|
|
1052
|
+
message: `Cannot process order: ${st(s)}`,
|
|
1042
1053
|
type: "error"
|
|
1043
1054
|
});
|
|
1044
1055
|
return;
|
|
1045
1056
|
}
|
|
1046
|
-
const { successMessage:
|
|
1047
|
-
|
|
1048
|
-
title:
|
|
1049
|
-
message:
|
|
1050
|
-
primaryActions:
|
|
1057
|
+
const { successMessage: O, ...k } = r;
|
|
1058
|
+
w.open({
|
|
1059
|
+
title: k.title,
|
|
1060
|
+
message: k.message,
|
|
1061
|
+
primaryActions: k.primaryActions
|
|
1051
1062
|
}).onPrimary(() => {
|
|
1052
|
-
|
|
1063
|
+
a.purchaseOrder && Ie(a.purchaseOrder, s, O);
|
|
1053
1064
|
});
|
|
1054
1065
|
}
|
|
1055
1066
|
const Le = X(() => {
|
|
1056
|
-
var
|
|
1057
|
-
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;
|
|
1058
1069
|
}), Fe = X(() => {
|
|
1059
1070
|
var C, G, g;
|
|
1060
|
-
const
|
|
1061
|
-
(
|
|
1062
|
-
const V =
|
|
1063
|
-
return
|
|
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;
|
|
1064
1075
|
},
|
|
1065
1076
|
{}
|
|
1066
|
-
),
|
|
1067
|
-
(
|
|
1068
|
-
const
|
|
1069
|
-
const
|
|
1077
|
+
), k = Object.entries(O).reduce(
|
|
1078
|
+
(S, [E, V]) => {
|
|
1079
|
+
const I = V.reduce((W, ne) => {
|
|
1080
|
+
const oe = pt(
|
|
1070
1081
|
W,
|
|
1071
|
-
Math.max(W.precision,
|
|
1082
|
+
Math.max(W.precision, ne.amount.precision)
|
|
1072
1083
|
);
|
|
1073
|
-
return Ke(
|
|
1084
|
+
return Ke(oe, ne.amount);
|
|
1074
1085
|
}, qe(0));
|
|
1075
|
-
return
|
|
1086
|
+
return S[E] = I, S;
|
|
1076
1087
|
},
|
|
1077
1088
|
{}
|
|
1078
|
-
), P = ((G =
|
|
1079
|
-
for (const
|
|
1080
|
-
|
|
1081
|
-
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;
|
|
1082
1093
|
}), y = X(() => {
|
|
1083
1094
|
var C, G;
|
|
1084
|
-
const
|
|
1085
|
-
...
|
|
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) => ({
|
|
1086
1097
|
createdAt: g.createdAt,
|
|
1087
1098
|
type: "grn",
|
|
1088
1099
|
doc: g
|
|
1089
1100
|
})),
|
|
1090
|
-
...
|
|
1101
|
+
...r.map((g) => ({
|
|
1091
1102
|
createdAt: g.createdAt,
|
|
1092
1103
|
type: "fulfillment",
|
|
1093
1104
|
doc: g
|
|
1094
1105
|
}))
|
|
1095
1106
|
];
|
|
1096
|
-
|
|
1097
|
-
function
|
|
1098
|
-
var
|
|
1099
|
-
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);
|
|
1100
1111
|
return {
|
|
1101
1112
|
header: "Received",
|
|
1102
1113
|
date: Me(new Date(g.createdAt)),
|
|
1103
1114
|
info: [
|
|
1104
1115
|
{
|
|
1105
1116
|
label: "Received by",
|
|
1106
|
-
values: [(
|
|
1117
|
+
values: [(E = g.createdBy) == null ? void 0 : E.name]
|
|
1107
1118
|
},
|
|
1108
1119
|
{
|
|
1109
1120
|
label: "Received items",
|
|
@@ -1188,15 +1199,15 @@ const Rt = {
|
|
|
1188
1199
|
label: "Remark",
|
|
1189
1200
|
values: [g.remark]
|
|
1190
1201
|
} : null,
|
|
1191
|
-
|
|
1202
|
+
S > -1 ? {
|
|
1192
1203
|
label: "Fulfilment's sequence",
|
|
1193
|
-
values: [`${
|
|
1204
|
+
values: [`${S + 1}`]
|
|
1194
1205
|
} : null,
|
|
1195
|
-
(
|
|
1206
|
+
(I = (V = r[S]) == null ? void 0 : V.netSuite) != null && I.refNo ? {
|
|
1196
1207
|
label: "Fulfillment's ref no. (Netsuite)",
|
|
1197
|
-
values: [(
|
|
1208
|
+
values: [(ne = (W = r[S]) == null ? void 0 : W.netSuite) == null ? void 0 : ne.refNo]
|
|
1198
1209
|
} : null,
|
|
1199
|
-
(
|
|
1210
|
+
(oe = g == null ? void 0 : g.netSuite) != null && oe.refNo ? {
|
|
1200
1211
|
label: "Item receipt (Netsuite)",
|
|
1201
1212
|
values: [(me = g == null ? void 0 : g.netSuite) == null ? void 0 : me.refNo]
|
|
1202
1213
|
} : null
|
|
@@ -1204,19 +1215,19 @@ const Rt = {
|
|
|
1204
1215
|
};
|
|
1205
1216
|
}
|
|
1206
1217
|
function P(g) {
|
|
1207
|
-
var
|
|
1208
|
-
const
|
|
1218
|
+
var E, V;
|
|
1219
|
+
const S = r.findIndex((I) => I.id === g.id);
|
|
1209
1220
|
return {
|
|
1210
1221
|
header: "Fulfillment",
|
|
1211
1222
|
date: Me(new Date(g.createdAt)),
|
|
1212
1223
|
info: [
|
|
1213
1224
|
{
|
|
1214
1225
|
label: "Sequence",
|
|
1215
|
-
values: [String(
|
|
1226
|
+
values: [String(S + 1)]
|
|
1216
1227
|
},
|
|
1217
1228
|
{
|
|
1218
1229
|
label: "Receiveable items",
|
|
1219
|
-
values: g.items.map((
|
|
1230
|
+
values: g.items.map((I) => {
|
|
1220
1231
|
var W;
|
|
1221
1232
|
return N("div", [
|
|
1222
1233
|
N(
|
|
@@ -1236,14 +1247,14 @@ const Rt = {
|
|
|
1236
1247
|
{
|
|
1237
1248
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
1238
1249
|
},
|
|
1239
|
-
`${
|
|
1250
|
+
`${I.sku.name}`
|
|
1240
1251
|
),
|
|
1241
1252
|
N(
|
|
1242
1253
|
"span",
|
|
1243
1254
|
{
|
|
1244
1255
|
class: "fm-typo-en-body-md-400"
|
|
1245
1256
|
},
|
|
1246
|
-
`${
|
|
1257
|
+
`${I.sku.code} `
|
|
1247
1258
|
)
|
|
1248
1259
|
]
|
|
1249
1260
|
),
|
|
@@ -1264,14 +1275,14 @@ const Rt = {
|
|
|
1264
1275
|
{
|
|
1265
1276
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
1266
1277
|
},
|
|
1267
|
-
Oe(
|
|
1278
|
+
Oe(I.amount, !1)
|
|
1268
1279
|
),
|
|
1269
1280
|
N(
|
|
1270
1281
|
"span",
|
|
1271
1282
|
{
|
|
1272
1283
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1273
1284
|
},
|
|
1274
|
-
((W =
|
|
1285
|
+
((W = I.measurement) == null ? void 0 : W.abbrev) ?? I.sku.unit.abbrev
|
|
1275
1286
|
)
|
|
1276
1287
|
]
|
|
1277
1288
|
),
|
|
@@ -1280,7 +1291,7 @@ const Rt = {
|
|
|
1280
1291
|
{
|
|
1281
1292
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1282
1293
|
},
|
|
1283
|
-
`${
|
|
1294
|
+
`${I.cost ? `(${$e(I.cost)})` : ""}`
|
|
1284
1295
|
)
|
|
1285
1296
|
]
|
|
1286
1297
|
)
|
|
@@ -1289,69 +1300,69 @@ const Rt = {
|
|
|
1289
1300
|
]);
|
|
1290
1301
|
})
|
|
1291
1302
|
},
|
|
1292
|
-
(
|
|
1303
|
+
(E = g.netSuite) != null && E.refNo ? {
|
|
1293
1304
|
label: "Ref no. (Netsuite)",
|
|
1294
1305
|
values: [(V = g.netSuite) == null ? void 0 : V.refNo]
|
|
1295
1306
|
} : null
|
|
1296
|
-
].filter((
|
|
1307
|
+
].filter((I) => I)
|
|
1297
1308
|
};
|
|
1298
1309
|
}
|
|
1299
|
-
return
|
|
1310
|
+
return O.map((g) => {
|
|
1300
1311
|
switch (g.type) {
|
|
1301
1312
|
case "grn":
|
|
1302
|
-
return
|
|
1313
|
+
return k(g.doc);
|
|
1303
1314
|
case "fulfillment":
|
|
1304
1315
|
return P(g.doc);
|
|
1305
1316
|
}
|
|
1306
1317
|
});
|
|
1307
1318
|
}), h = X(() => {
|
|
1308
|
-
var
|
|
1309
|
-
const
|
|
1319
|
+
var r;
|
|
1320
|
+
const s = {
|
|
1310
1321
|
...qe(0),
|
|
1311
1322
|
currency: Ze()
|
|
1312
1323
|
};
|
|
1313
|
-
return ((
|
|
1314
|
-
...Ke(
|
|
1324
|
+
return ((r = a.purchaseOrder) == null ? void 0 : r.items.reduce((O, k) => ({
|
|
1325
|
+
...Ke(O, k.totalCost ?? s),
|
|
1315
1326
|
currency: Ze()
|
|
1316
|
-
}),
|
|
1327
|
+
}), s)) ?? s;
|
|
1317
1328
|
});
|
|
1318
|
-
return (
|
|
1319
|
-
var W,
|
|
1320
|
-
const
|
|
1321
|
-
return c(),
|
|
1322
|
-
header:
|
|
1323
|
-
modelValue:
|
|
1324
|
-
"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),
|
|
1325
1336
|
"dismiss-away": F.value,
|
|
1326
1337
|
"close-button": "",
|
|
1327
1338
|
"max-width": 600
|
|
1328
1339
|
}, {
|
|
1329
1340
|
default: _e(() => {
|
|
1330
|
-
var
|
|
1341
|
+
var oe, me, H, pe, ke, Re, De, Ne;
|
|
1331
1342
|
return [
|
|
1332
1343
|
e("div", Gt, [
|
|
1333
1344
|
e("div", null, [
|
|
1334
|
-
B(
|
|
1335
|
-
items:
|
|
1345
|
+
B(O, {
|
|
1346
|
+
items: fe.value,
|
|
1336
1347
|
modelValue: z.value,
|
|
1337
|
-
"onUpdate:modelValue":
|
|
1348
|
+
"onUpdate:modelValue": r[0] || (r[0] = (b) => z.value = b)
|
|
1338
1349
|
}, null, 8, ["items", "modelValue"])
|
|
1339
1350
|
]),
|
|
1340
|
-
z.value.value === "overview" ? (c(), _(
|
|
1351
|
+
z.value.value === "overview" ? (c(), _(re, { key: 0 }, [
|
|
1341
1352
|
e("div", null, [
|
|
1342
1353
|
B(C, {
|
|
1343
1354
|
variant: "outlined",
|
|
1344
1355
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1345
1356
|
}, {
|
|
1346
1357
|
default: _e(() => {
|
|
1347
|
-
var b, A, $,
|
|
1358
|
+
var b, A, $, le, ie, ue, ve, ye, ee, he, Ae, Te;
|
|
1348
1359
|
return [
|
|
1349
1360
|
e("div", Ht, [
|
|
1350
|
-
e("div", zt, m(
|
|
1361
|
+
e("div", zt, m(n(t)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
1351
1362
|
e("div", null, [
|
|
1352
|
-
B(
|
|
1353
|
-
label:
|
|
1354
|
-
class: ge(`fm-status-badge fm-status-badge-${($ = (A =
|
|
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")}`),
|
|
1355
1366
|
compact: ""
|
|
1356
1367
|
}, null, 8, ["label", "class"])
|
|
1357
1368
|
])
|
|
@@ -1360,35 +1371,35 @@ const Rt = {
|
|
|
1360
1371
|
e("div", Qt, [
|
|
1361
1372
|
e("div", Yt, [
|
|
1362
1373
|
e("div", Wt, [
|
|
1363
|
-
e("div", Xt, m(
|
|
1374
|
+
e("div", Xt, m(n(t)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1364
1375
|
]),
|
|
1365
|
-
e("div", Jt, m(
|
|
1376
|
+
e("div", Jt, m(n(Ee)(((le = s.purchaseOrder) == null ? void 0 : le._id) ?? "")), 1)
|
|
1366
1377
|
]),
|
|
1367
|
-
(
|
|
1368
|
-
e("div", es, m(
|
|
1369
|
-
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)
|
|
1370
1381
|
])) : D("", !0),
|
|
1371
1382
|
e("div", ss, [
|
|
1372
|
-
e("div", rs, m(
|
|
1373
|
-
e("div", as, m(
|
|
1374
|
-
`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")}`
|
|
1375
1386
|
)), 1)
|
|
1376
1387
|
]),
|
|
1377
|
-
(ye = (ve =
|
|
1378
|
-
e("div", os, m(
|
|
1379
|
-
e("div", ls, m((he = (
|
|
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)
|
|
1380
1391
|
])) : D("", !0),
|
|
1381
|
-
|
|
1382
|
-
e("div", cs, m(
|
|
1383
|
-
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)
|
|
1384
1395
|
])) : D("", !0),
|
|
1385
|
-
(Ae =
|
|
1386
|
-
e("div", fs, m(
|
|
1387
|
-
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)
|
|
1388
1399
|
])) : D("", !0),
|
|
1389
|
-
(Te =
|
|
1390
|
-
e("div", vs, m(
|
|
1391
|
-
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)
|
|
1392
1403
|
])) : D("", !0)
|
|
1393
1404
|
])
|
|
1394
1405
|
];
|
|
@@ -1396,33 +1407,33 @@ const Rt = {
|
|
|
1396
1407
|
_: 1
|
|
1397
1408
|
})
|
|
1398
1409
|
]),
|
|
1399
|
-
|
|
1410
|
+
l.value ? D("", !0) : (c(), _("div", hs, [
|
|
1400
1411
|
e("div", gs, [
|
|
1401
|
-
|
|
1412
|
+
r[12] || (r[12] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
1402
1413
|
e("div", null, [
|
|
1403
1414
|
B(Kt, {
|
|
1404
|
-
"po-request":
|
|
1405
|
-
"purchase-order":
|
|
1406
|
-
"is-transfer-between-outlets":
|
|
1415
|
+
"po-request": s.poRequest,
|
|
1416
|
+
"purchase-order": s.purchaseOrder,
|
|
1417
|
+
"is-transfer-between-outlets": l.value
|
|
1407
1418
|
}, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets"])
|
|
1408
1419
|
])
|
|
1409
1420
|
]),
|
|
1410
1421
|
B(P),
|
|
1411
1422
|
B(jt, {
|
|
1412
|
-
"po-request":
|
|
1413
|
-
"purchase-order":
|
|
1414
|
-
"transfer-type":
|
|
1415
|
-
"transfer-to-db-name":
|
|
1416
|
-
"is-transfer-between-outlets":
|
|
1417
|
-
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
|
|
1418
1429
|
}, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
|
|
1419
1430
|
])),
|
|
1420
1431
|
e("div", bs, [
|
|
1421
1432
|
e("div", _s, [
|
|
1422
1433
|
e("div", Ss, [
|
|
1423
1434
|
e("span", ws, [
|
|
1424
|
-
je(m(Le.value ?
|
|
1425
|
-
(me = (
|
|
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, {
|
|
1426
1437
|
key: 0,
|
|
1427
1438
|
variant: "rich",
|
|
1428
1439
|
placement: "top",
|
|
@@ -1432,9 +1443,9 @@ const Rt = {
|
|
|
1432
1443
|
var b, A;
|
|
1433
1444
|
return [
|
|
1434
1445
|
e("div", xs, [
|
|
1435
|
-
(c(!0), _(
|
|
1446
|
+
(c(!0), _(re, null, Se((A = (b = s.purchaseOrder) == null ? void 0 : b.netSuite) == null ? void 0 : A.missingItems, ($, le) => (c(), _("div", {
|
|
1436
1447
|
class: "flex justify-center align-middle",
|
|
1437
|
-
key:
|
|
1448
|
+
key: le
|
|
1438
1449
|
}, [
|
|
1439
1450
|
B(G, {
|
|
1440
1451
|
name: "arrow_right",
|
|
@@ -1456,13 +1467,13 @@ const Rt = {
|
|
|
1456
1467
|
})) : D("", !0)
|
|
1457
1468
|
]),
|
|
1458
1469
|
e("div", null, [
|
|
1459
|
-
|
|
1470
|
+
Z.value && T.value != null && !((ke = T.value) != null && ke.length) ? (c(), se(S, {
|
|
1460
1471
|
key: 0,
|
|
1461
1472
|
label: "Return",
|
|
1462
1473
|
variant: "secondary",
|
|
1463
|
-
onClick:
|
|
1464
|
-
loading:
|
|
1465
|
-
disabled:
|
|
1474
|
+
onClick: r[1] || (r[1] = (b) => ae("returnStock")),
|
|
1475
|
+
loading: f.value === "returnStock",
|
|
1476
|
+
disabled: f.value !== "returnStock" && d.value,
|
|
1466
1477
|
"prepend-icon": "undo",
|
|
1467
1478
|
"text-color": "primary",
|
|
1468
1479
|
"bg-color": "transparent",
|
|
@@ -1471,36 +1482,36 @@ const Rt = {
|
|
|
1471
1482
|
])
|
|
1472
1483
|
]),
|
|
1473
1484
|
B(P),
|
|
1474
|
-
(c(!0), _(
|
|
1485
|
+
(c(!0), _(re, null, Se(((Re = s.purchaseOrder) == null ? void 0 : Re.items) ?? [], (b) => {
|
|
1475
1486
|
var A;
|
|
1476
1487
|
return c(), _("div", {
|
|
1477
1488
|
key: b.code,
|
|
1478
1489
|
class: "flex flex-col"
|
|
1479
1490
|
}, [
|
|
1480
1491
|
e("div", Os, [
|
|
1481
|
-
e("div",
|
|
1482
|
-
e("div",
|
|
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)
|
|
1483
1494
|
]),
|
|
1484
1495
|
e("div", Ds, [
|
|
1485
1496
|
e("div", Ns, m(b.code), 1),
|
|
1486
|
-
(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)
|
|
1487
1498
|
])
|
|
1488
1499
|
]);
|
|
1489
1500
|
}), 128)),
|
|
1490
|
-
+
|
|
1501
|
+
+n(Oe)(h.value) ? (c(), _(re, { key: 0 }, [
|
|
1491
1502
|
e("div", Ts, [
|
|
1492
1503
|
B(P)
|
|
1493
1504
|
]),
|
|
1494
1505
|
e("div", $s, [
|
|
1495
|
-
|
|
1496
|
-
e("div", Ps, m(
|
|
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)
|
|
1497
1508
|
])
|
|
1498
1509
|
], 64)) : D("", !0)
|
|
1499
1510
|
])
|
|
1500
1511
|
])
|
|
1501
1512
|
], 64)) : z.value.value === "deliveryHistory" ? (c(), _("div", Cs, [
|
|
1502
1513
|
y.value.length ? (c(), _("div", Fs, [
|
|
1503
|
-
(c(!0), _(
|
|
1514
|
+
(c(!0), _(re, null, Se(y.value, (b, A) => (c(), _(re, { key: A }, [
|
|
1504
1515
|
e("div", Us, [
|
|
1505
1516
|
e("div", Bs, [
|
|
1506
1517
|
e("div", Ms, [
|
|
@@ -1514,7 +1525,7 @@ const Rt = {
|
|
|
1514
1525
|
])
|
|
1515
1526
|
}, null, 2)
|
|
1516
1527
|
]),
|
|
1517
|
-
|
|
1528
|
+
r[14] || (r[14] = e("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1518
1529
|
e("div", js, [
|
|
1519
1530
|
e("div", {
|
|
1520
1531
|
class: ge([
|
|
@@ -1553,19 +1564,19 @@ const Rt = {
|
|
|
1553
1564
|
}, {
|
|
1554
1565
|
default: _e(() => [
|
|
1555
1566
|
e("div", Ws, [
|
|
1556
|
-
(c(!0), _(
|
|
1557
|
-
key:
|
|
1567
|
+
(c(!0), _(re, null, Se(b.info, ($, le) => (c(), _("div", {
|
|
1568
|
+
key: le,
|
|
1558
1569
|
class: "flex flex-col gap-4"
|
|
1559
1570
|
}, [
|
|
1560
1571
|
e("div", Xs, m($ == null ? void 0 : $.label), 1),
|
|
1561
1572
|
e("div", Js, [
|
|
1562
|
-
(c(!0), _(
|
|
1563
|
-
key:
|
|
1573
|
+
(c(!0), _(re, null, Se($ == null ? void 0 : $.values, (ie, ue) => (c(), _("div", {
|
|
1574
|
+
key: ue,
|
|
1564
1575
|
class: "fm-typo-en-body-lg-600"
|
|
1565
1576
|
}, [
|
|
1566
|
-
typeof
|
|
1567
|
-
je(m(
|
|
1568
|
-
], 64)) : (c(),
|
|
1577
|
+
typeof ie == "string" ? (c(), _(re, { key: 0 }, [
|
|
1578
|
+
je(m(ie), 1)
|
|
1579
|
+
], 64)) : (c(), se(bt(ie), { key: 1 }))
|
|
1569
1580
|
]))), 128))
|
|
1570
1581
|
])
|
|
1571
1582
|
]))), 128))
|
|
@@ -1577,25 +1588,25 @@ const Rt = {
|
|
|
1577
1588
|
])
|
|
1578
1589
|
], 64))), 128))
|
|
1579
1590
|
])) : (c(), _("div", qs, [
|
|
1580
|
-
B(
|
|
1591
|
+
B(E),
|
|
1581
1592
|
e("div", null, [
|
|
1582
1593
|
e("img", {
|
|
1583
|
-
src:
|
|
1594
|
+
src: n(et),
|
|
1584
1595
|
alt: "List is empty"
|
|
1585
1596
|
}, null, 8, Es)
|
|
1586
1597
|
]),
|
|
1587
|
-
e("div", Is, m(
|
|
1588
|
-
e("div", Ls, m(
|
|
1589
|
-
B(
|
|
1590
|
-
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)
|
|
1591
1602
|
]))
|
|
1592
|
-
])) : z.value.value === "returns" &&
|
|
1593
|
-
|
|
1594
|
-
|
|
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)),
|
|
1595
1606
|
B(V),
|
|
1596
|
-
|
|
1607
|
+
r[16] || (r[16] = e("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, "Loading...", -1))
|
|
1597
1608
|
])) : (De = T.value) != null && De.length ? (c(), _("div", nr, [
|
|
1598
|
-
(c(!0), _(
|
|
1609
|
+
(c(!0), _(re, null, Se(T.value, (b, A) => (c(), _(re, {
|
|
1599
1610
|
key: b._id
|
|
1600
1611
|
}, [
|
|
1601
1612
|
e("div", or, [
|
|
@@ -1611,7 +1622,7 @@ const Rt = {
|
|
|
1611
1622
|
])
|
|
1612
1623
|
}, null, 2)
|
|
1613
1624
|
]),
|
|
1614
|
-
|
|
1625
|
+
r[19] || (r[19] = e("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1615
1626
|
e("div", cr, [
|
|
1616
1627
|
e("div", {
|
|
1617
1628
|
class: ge([
|
|
@@ -1631,13 +1642,13 @@ const Rt = {
|
|
|
1631
1642
|
e("span", mr, [
|
|
1632
1643
|
e("span", {
|
|
1633
1644
|
class: ge(`fm-status-badge fm-status-badge-${`${b.status}`.toLocaleLowerCase("en-us")}`)
|
|
1634
|
-
}, m(
|
|
1645
|
+
}, m(n(t)(`inventory.transfer.status.${b.status}`)), 3)
|
|
1635
1646
|
])
|
|
1636
1647
|
]),
|
|
1637
|
-
e("div", pr, m(
|
|
1648
|
+
e("div", pr, m(n(Me)(n(vt)(b._id))), 1)
|
|
1638
1649
|
]),
|
|
1639
1650
|
e("div", vr, [
|
|
1640
|
-
B(
|
|
1651
|
+
B(S, {
|
|
1641
1652
|
variant: "secondary",
|
|
1642
1653
|
label: "Print",
|
|
1643
1654
|
"prepend-icon": "print",
|
|
@@ -1645,21 +1656,21 @@ const Rt = {
|
|
|
1645
1656
|
"bg-color": "transparent",
|
|
1646
1657
|
"border-color": "primary",
|
|
1647
1658
|
onClick: ($) => {
|
|
1648
|
-
var
|
|
1649
|
-
return
|
|
1659
|
+
var le, ie, ue, ve, ye, ee, he, Ae, Te;
|
|
1660
|
+
return n(lt)(
|
|
1650
1661
|
{
|
|
1651
1662
|
...b,
|
|
1652
1663
|
ref: [
|
|
1653
1664
|
b.ref,
|
|
1654
|
-
(
|
|
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})` : ""
|
|
1655
1666
|
].filter((Ue) => Ue == null ? void 0 : Ue.trim()).join()
|
|
1656
1667
|
},
|
|
1657
1668
|
{
|
|
1658
1669
|
doc: {
|
|
1659
1670
|
profile: {
|
|
1660
|
-
name: (he =
|
|
1661
|
-
address: (Ae =
|
|
1662
|
-
regNo: (Te =
|
|
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
|
|
1663
1674
|
}
|
|
1664
1675
|
}
|
|
1665
1676
|
}
|
|
@@ -1689,30 +1700,30 @@ const Rt = {
|
|
|
1689
1700
|
class: "py-12 px-16"
|
|
1690
1701
|
}, {
|
|
1691
1702
|
default: _e(() => {
|
|
1692
|
-
var $,
|
|
1703
|
+
var $, le, ie, ue, ve, ye;
|
|
1693
1704
|
return [
|
|
1694
1705
|
e("div", _r, [
|
|
1695
|
-
(
|
|
1706
|
+
(le = ($ = M.value[b._id]) == null ? void 0 : $.netSuite) != null && le.id ? (c(), _(re, { key: 0 }, [
|
|
1696
1707
|
e("div", Sr, [
|
|
1697
|
-
|
|
1698
|
-
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)
|
|
1699
1710
|
]),
|
|
1700
1711
|
B(P)
|
|
1701
1712
|
], 64)) : D("", !0),
|
|
1702
|
-
|
|
1703
|
-
(c(!0), _(
|
|
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) => {
|
|
1704
1715
|
var he;
|
|
1705
1716
|
return c(), _("div", {
|
|
1706
|
-
key:
|
|
1717
|
+
key: ee.code,
|
|
1707
1718
|
class: "flex flex-col"
|
|
1708
1719
|
}, [
|
|
1709
1720
|
e("div", xr, [
|
|
1710
|
-
e("div", Or, m(
|
|
1711
|
-
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)
|
|
1712
1723
|
]),
|
|
1713
|
-
e("div",
|
|
1714
|
-
e("div", Dr, m(
|
|
1715
|
-
(he =
|
|
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)
|
|
1716
1727
|
])
|
|
1717
1728
|
]);
|
|
1718
1729
|
}), 128))
|
|
@@ -1725,23 +1736,23 @@ const Rt = {
|
|
|
1725
1736
|
])
|
|
1726
1737
|
], 64))), 128))
|
|
1727
1738
|
])) : (c(), _("div", tr, [
|
|
1728
|
-
|
|
1739
|
+
r[17] || (r[17] = e("div", { class: "h-80" }, null, -1)),
|
|
1729
1740
|
e("div", null, [
|
|
1730
1741
|
e("img", {
|
|
1731
|
-
src:
|
|
1742
|
+
src: n(et),
|
|
1732
1743
|
alt: "List is empty"
|
|
1733
1744
|
}, null, 8, sr)
|
|
1734
1745
|
]),
|
|
1735
|
-
e("div", rr, m(
|
|
1736
|
-
|
|
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)),
|
|
1737
1748
|
e("div", ar, [
|
|
1738
|
-
|
|
1749
|
+
Z.value && T.value != null && !((Ne = T.value) != null && Ne.length) ? (c(), se(S, {
|
|
1739
1750
|
key: 0,
|
|
1740
1751
|
label: "Create return request",
|
|
1741
1752
|
variant: "secondary",
|
|
1742
|
-
onClick:
|
|
1743
|
-
loading:
|
|
1744
|
-
disabled:
|
|
1753
|
+
onClick: r[2] || (r[2] = (b) => ae("returnStock")),
|
|
1754
|
+
loading: f.value === "returnStock",
|
|
1755
|
+
disabled: f.value !== "returnStock" && d.value,
|
|
1745
1756
|
"prepend-icon": "undo",
|
|
1746
1757
|
"text-color": "primary",
|
|
1747
1758
|
"bg-color": "transparent",
|
|
@@ -1754,65 +1765,65 @@ const Rt = {
|
|
|
1754
1765
|
];
|
|
1755
1766
|
}),
|
|
1756
1767
|
"side-sheet-footer": _e(() => {
|
|
1757
|
-
var
|
|
1768
|
+
var oe, me, H, pe, ke, Re, De, Ne, b, A;
|
|
1758
1769
|
return [
|
|
1759
1770
|
e("div", Ar, [
|
|
1760
|
-
((
|
|
1771
|
+
((oe = s.purchaseOrder) == null ? void 0 : oe.status) === n(j).enum.DRAFT && o.value === n(be).PURCHASE ? (c(), se(S, {
|
|
1761
1772
|
key: 0,
|
|
1762
|
-
label:
|
|
1763
|
-
onClick:
|
|
1764
|
-
loading:
|
|
1765
|
-
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
|
|
1766
1777
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1767
|
-
((me =
|
|
1778
|
+
((me = s.purchaseOrder) == null ? void 0 : me.status) === n(j).enum.DRAFT && o.value === n(be).TRANSFER ? (c(), se(S, {
|
|
1768
1779
|
key: 1,
|
|
1769
|
-
label:
|
|
1770
|
-
onClick:
|
|
1771
|
-
loading:
|
|
1772
|
-
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
|
|
1773
1784
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1774
|
-
((H =
|
|
1785
|
+
((H = s.purchaseOrder) == null ? void 0 : H.status) === n(j).enum.DRAFT ? (c(), se(S, {
|
|
1775
1786
|
key: 2,
|
|
1776
|
-
label:
|
|
1777
|
-
onClick:
|
|
1778
|
-
loading:
|
|
1779
|
-
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,
|
|
1780
1791
|
variant: "destructive"
|
|
1781
1792
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1782
|
-
((pe =
|
|
1793
|
+
((pe = s.purchaseOrder) == null ? void 0 : pe.status) === n(j).enum.RECEIVING ? (c(), se(S, {
|
|
1783
1794
|
key: 3,
|
|
1784
|
-
label:
|
|
1785
|
-
onClick:
|
|
1786
|
-
loading:
|
|
1787
|
-
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
|
|
1788
1799
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1789
|
-
|
|
1800
|
+
s.canResubmit ? (c(), se(S, {
|
|
1790
1801
|
key: 4,
|
|
1791
|
-
label:
|
|
1792
|
-
onClick:
|
|
1793
|
-
loading:
|
|
1794
|
-
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
|
|
1795
1806
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1796
|
-
(((
|
|
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, {
|
|
1797
1808
|
key: 5,
|
|
1798
|
-
label:
|
|
1799
|
-
onClick:
|
|
1800
|
-
loading:
|
|
1801
|
-
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
|
|
1802
1813
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1803
|
-
((De =
|
|
1814
|
+
((De = s.purchaseOrder) == null ? void 0 : De.status) === n(j).enum.REQUESTING && s.canApprove ? (c(), se(S, {
|
|
1804
1815
|
key: 6,
|
|
1805
|
-
label:
|
|
1806
|
-
onClick:
|
|
1807
|
-
loading:
|
|
1808
|
-
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,
|
|
1809
1820
|
variant: "destructive"
|
|
1810
1821
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1811
|
-
((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, {
|
|
1812
1823
|
key: 7,
|
|
1813
|
-
label:
|
|
1824
|
+
label: n(t)("common.close"),
|
|
1814
1825
|
variant: "tertiary",
|
|
1815
|
-
onClick:
|
|
1826
|
+
onClick: r[10] || (r[10] = ($) => i("update:show", !1))
|
|
1816
1827
|
}, null, 8, ["label"])) : D("", !0)
|
|
1817
1828
|
])
|
|
1818
1829
|
];
|