@feedmepos/mf-inventory-portal 0.0.25-dev.30 → 0.0.25-dev.32
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-CbGTNGMK.js → App-5mHsEh9k.js} +2 -2
- package/dist/{ApprovalView-C9hrKiel.js → ApprovalView-8j418xsu.js} +13 -13
- package/dist/{BindingsDialog-DIxrUmBp.js → BindingsDialog-mI12JwDT.js} +2 -2
- package/dist/{BindingsPicker-DT2fCUQ7.js → BindingsPicker-BiWsFvJ9.js} +5 -5
- package/dist/{BindingsTable-rpRrfxfm.js → BindingsTable-D0gpm1wp.js} +5 -5
- package/dist/{ClosingDraftView-aETdobNv.js → ClosingDraftView-CDw4t1Ry.js} +2 -2
- package/dist/{ClosingTemplateView-Cl-7Agfl.js → ClosingTemplateView-BVT7uVSl.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Ugss5lqQ.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-5lfzdCEF.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BZoFs1-5.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BiH1i5IX.js} +22 -22
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-uRrJNVoO.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BZ5jhZJ3.js} +1 -1
- package/dist/{IngredientGroupView-DCtkP28-.js → IngredientGroupView-CuOJ-lgG.js} +1 -1
- package/dist/{IngredientsView-C4jOCqij.js → IngredientsView-DQxuOeeA.js} +4 -4
- package/dist/{IntegrationView-DDAVjLV5.js → IntegrationView-dTWQ7Y0L.js} +1 -1
- package/dist/{InventoryBindingForm-CbM-0GcS.js → InventoryBindingForm-BqbgCls7.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-uGVP8nwi.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DNzrrq37.js} +3 -3
- package/dist/{InventoryBindingSummary-DOdGKen4.js → InventoryBindingSummary-D9JS8cpw.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CBu3pj-m.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-vCMIiBLz.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BPmKDzxI.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Dseg75Hj.js} +3 -3
- package/dist/{PublishView-BE8Fo2Go.js → PublishView-Pioi-3PK.js} +13 -13
- package/dist/{PurchaseOrderPrintPreview-DBEfp8uZ.js → PurchaseOrderPrintPreview-C06cZQBi.js} +1 -1
- package/dist/ReceiveRequestView-0LIDAdE4.js +2654 -0
- package/dist/{RecipeView-DTFpgZwH.js → RecipeView-dvtN4dem.js} +3 -3
- package/dist/{StockView-CF7VlY8S.js → StockView-LWjH0TiO.js} +7 -7
- package/dist/{SupplierView-BZ4rA2D1.js → SupplierView-By5AlMwB.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CidXuoBS.js → TransferDetails.vue_vue_type_script_setup_true_lang-BtdKFA4E.js} +423 -422
- package/dist/TransferTemplateView-GfTDTpDz.js +1524 -0
- package/dist/{UnitView-1lzQaH5U.js → UnitView-B_C9Hrmw.js} +3 -3
- package/dist/{WarehouseView-eRypQalS.js → WarehouseView-CGIrHlmN.js} +1 -1
- package/dist/api/netsuite.d.ts +4 -4
- package/dist/{app-d94DuF5R.js → app-PUG_dqk9.js} +6759 -6928
- package/dist/app.js +1 -1
- package/dist/components/FmMultiselectDialog.d.ts +6 -6
- package/dist/{decimal-BCeq_89w.js → decimal-BYRcDs02.js} +1 -1
- package/dist/{feature-BiSY0JBR.js → feature-CXJupSqw.js} +1 -1
- package/dist/{format-unit-display-x2P1kVbK.js → format-unit-display-uZsyeofT.js} +13 -13
- package/dist/{index-DnkQqb_5.js → index-BMnRochi.js} +2 -2
- package/dist/{stock-BHtAAvq5.js → stock-CvA-l-yz.js} +1 -1
- package/dist/stores/integration/netsuite.d.ts +4 -4
- package/dist/{supplier-BSiJWxYO.js → supplier-E13yRo0f.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-CvsCbtLc.js → use-ingredient-select-dialog-C57l6NFB.js} +1 -1
- package/dist/{use-inventory-binding-dialog-CmiGDFT9.js → use-inventory-binding-dialog-drEXHE4h.js} +1 -1
- package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +186 -200
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +4 -46
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +8 -116
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +2 -23
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +611 -653
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +611 -653
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -0
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItem.vue.d.ts +2 -270
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +4 -70
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +5 -35
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +24 -420
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +24 -420
- package/dist/views/transfer-template/composables/useTransferTemplateHelper.d.ts +305 -0
- package/dist/{vue-i18n-DC5cHFol.js → vue-i18n-C1ehwhFs.js} +209 -209
- package/package.json +3 -3
- package/dist/ReceiveRequestView-BmrpIRSM.js +0 -2895
- package/dist/TransferTemplateView-C7bYJLit.js +0 -1660
- package/dist/views/receive-request/components/transfer-form/components/TransferSubItemTable.vue.d.ts +0 -72
- package/dist/views/receive-request/components/transfer-form/helpers/calculate-sub-item-total.helper.d.ts +0 -4
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateSubItem.vue.d.ts +0 -74
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateSubItemTable.vue.d.ts +0 -92
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { W as it, u as Pe,
|
|
2
|
-
import { ref as
|
|
1
|
+
import { W as it, u as Pe, aL as k, 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 ee, h as Q, b as ze, a6 as pt, as as Ze, a0 as $e, ai as Me, aw as vt } from "./app-PUG_dqk9.js";
|
|
2
|
+
import { ref as K, computed as X, h as N, defineComponent as Qe, onMounted as yt, unref as o, openBlock as c, createElementBlock as _, createElementVNode as e, toDisplayString as m, createCommentVNode as D, resolveComponent as ue, createVNode as B, watch as ht, createBlock as te, isRef as gt, withCtx as _e, Fragment as se, 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-uZsyeofT.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-CXJupSqw.js";
|
|
8
|
+
import { F as xt } from "./decimal-BYRcDs02.js";
|
|
9
9
|
const Xe = it((p, v) => {
|
|
10
|
-
const
|
|
10
|
+
const u = Pe();
|
|
11
11
|
return {
|
|
12
12
|
async readRequests(n) {
|
|
13
|
-
const S = n ??
|
|
14
|
-
return await v.get(
|
|
13
|
+
const S = n ?? u.currentLocationDBName, R = `${p.inventoryBackendUrl}/${S}/purchase-request`;
|
|
14
|
+
return await v.get(R);
|
|
15
15
|
},
|
|
16
16
|
async getPurchaseOrders({
|
|
17
17
|
start: n,
|
|
18
18
|
end: S
|
|
19
19
|
}) {
|
|
20
|
-
const
|
|
21
|
-
return await v.get(`${
|
|
20
|
+
const R = u.currentLocationDBName, E = `${p.inventoryBackendUrl}/${R}/purchase-order`;
|
|
21
|
+
return await v.get(`${E}?start=${n}&end=${S}`);
|
|
22
22
|
},
|
|
23
23
|
async getLatestPurchaseOrderRequest(n, S) {
|
|
24
|
-
S ?? (S =
|
|
25
|
-
const
|
|
26
|
-
return await v.get(`${
|
|
24
|
+
S ?? (S = u.currentLocationDBName);
|
|
25
|
+
const R = `${p.inventoryBackendUrl}/${S}/purchase-request/find-by-purchase-order-id`;
|
|
26
|
+
return await v.get(`${R}/${n}`);
|
|
27
27
|
},
|
|
28
28
|
async getPurchaseOrderById(n, S) {
|
|
29
|
-
S ?? (S =
|
|
30
|
-
const
|
|
31
|
-
return await v.get(`${
|
|
29
|
+
S ?? (S = u.currentLocationDBName);
|
|
30
|
+
const R = `${p.inventoryBackendUrl}/${S}/purchase-order`;
|
|
31
|
+
return await v.get(`${R}/${n}`);
|
|
32
32
|
},
|
|
33
33
|
async processPurchaseOrder(n, S) {
|
|
34
|
-
const
|
|
35
|
-
return await v.put(
|
|
34
|
+
const R = u.currentLocationDBName, E = S || R, q = `${p.inventoryBackendUrl}/${E}/purchase-order/run-operation`;
|
|
35
|
+
return await v.put(q, n);
|
|
36
36
|
},
|
|
37
37
|
async createPurchaseOrder(n) {
|
|
38
|
-
const S =
|
|
39
|
-
return await v.post(
|
|
38
|
+
const S = u.currentLocationDBName, R = `${p.inventoryBackendUrl}/${S}/purchase-order`;
|
|
39
|
+
return await v.post(R, n);
|
|
40
40
|
},
|
|
41
41
|
async updatePurchaseOrder(n) {
|
|
42
|
-
const S =
|
|
43
|
-
return await v.put(
|
|
42
|
+
const S = u.currentLocationDBName, R = `${p.inventoryBackendUrl}/${S}/purchase-order`;
|
|
43
|
+
return await v.put(R, n);
|
|
44
44
|
},
|
|
45
45
|
async importFromXilnex(n) {
|
|
46
|
-
const S =
|
|
47
|
-
return await v.post(
|
|
46
|
+
const S = u.currentLocationDBName, R = `${p.inventoryBackendUrl}/${S}/purchase-order/import-from-xilnex`;
|
|
47
|
+
return await v.post(R, n);
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
}), ot = {
|
|
@@ -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 u = Ye(), n = Pe(), S = nt(), R = _t(), E = St(), q = K(!1), f = We(), r = Xe(), a = K(new Array()), d = K(
|
|
112
112
|
v != null && v.startDate && (v != null && v.endDate) ? v : ct()
|
|
113
|
-
),
|
|
114
|
-
const y = new Date(
|
|
113
|
+
), l = X(() => {
|
|
114
|
+
const y = new Date(d.value.startDate), h = new Date(d.value.endDate);
|
|
115
115
|
return {
|
|
116
116
|
start: ut(y).toISOString(),
|
|
117
117
|
end: dt(h).toISOString()
|
|
118
118
|
};
|
|
119
|
-
}), i =
|
|
120
|
-
function
|
|
119
|
+
}), i = 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
126
|
"onUpdate:show"(t) {
|
|
127
|
-
|
|
127
|
+
we.value.show = t;
|
|
128
128
|
},
|
|
129
129
|
lastClosingDate: U.value
|
|
130
130
|
};
|
|
131
|
-
|
|
131
|
+
we.value = h;
|
|
132
132
|
}
|
|
133
|
-
async function
|
|
133
|
+
async function T(y) {
|
|
134
134
|
function h(s) {
|
|
135
135
|
const x = {
|
|
136
136
|
mode: Be.CREATE,
|
|
137
137
|
modelValue: y || void 0,
|
|
138
138
|
show: !0,
|
|
139
|
-
"onUpdate:show"(
|
|
140
|
-
|
|
139
|
+
"onUpdate:show"(O) {
|
|
140
|
+
we.value.show = O;
|
|
141
141
|
},
|
|
142
142
|
templateId: s,
|
|
143
143
|
lastClosingDate: U.value
|
|
144
144
|
};
|
|
145
|
-
|
|
145
|
+
we.value = x;
|
|
146
146
|
}
|
|
147
147
|
let t;
|
|
148
|
-
S.mustUsePoTemplate && !(y != null && y.template) ?
|
|
148
|
+
S.mustUsePoTemplate && !(y != null && y.template) ? u.open({
|
|
149
149
|
title: "Create transfer",
|
|
150
150
|
message: "",
|
|
151
151
|
primaryActions: {
|
|
@@ -158,77 +158,77 @@ function Fr(p, v) {
|
|
|
158
158
|
close: !0
|
|
159
159
|
}
|
|
160
160
|
}).onPrimary(async () => {
|
|
161
|
-
t = await
|
|
161
|
+
t = await R.getTemplateId(), t && h(t);
|
|
162
162
|
}).onSecondary(() => {
|
|
163
163
|
h(void 0);
|
|
164
164
|
}) : h(t);
|
|
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
171
|
"onUpdate:show"(t) {
|
|
172
|
-
|
|
172
|
+
we.value.show = t;
|
|
173
173
|
},
|
|
174
174
|
lastClosingDate: U.value
|
|
175
175
|
};
|
|
176
|
-
|
|
176
|
+
we.value = h;
|
|
177
177
|
}
|
|
178
|
-
async function
|
|
179
|
-
a.value = [],
|
|
178
|
+
async function re() {
|
|
179
|
+
a.value = [], q.value = !0;
|
|
180
180
|
try {
|
|
181
|
-
a.value = await r.getPurchaseOrders(
|
|
181
|
+
a.value = await r.getPurchaseOrders(l.value).then((t) => t.sort((s, x) => x._id.localeCompare(s._id)));
|
|
182
182
|
const y = await F.readLastClosing(!0), h = y == null ? void 0 : y._id;
|
|
183
|
-
h && (U.value = mt(h)), S.mustUsePoTemplate && await
|
|
183
|
+
h && (U.value = mt(h)), S.mustUsePoTemplate && await E.fetchTemplates();
|
|
184
184
|
} catch {
|
|
185
|
-
|
|
185
|
+
f.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
|
-
i.value = [],
|
|
194
|
+
async function ae() {
|
|
195
|
+
i.value = [], q.value = !0;
|
|
196
196
|
try {
|
|
197
197
|
i.value = await r.readRequests().then((y) => y.reverse());
|
|
198
198
|
} catch {
|
|
199
|
-
|
|
199
|
+
f.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 Y() {
|
|
209
209
|
switch (p) {
|
|
210
210
|
case "receive/request":
|
|
211
|
-
return
|
|
211
|
+
return re();
|
|
212
212
|
case "approval":
|
|
213
|
-
return
|
|
213
|
+
return ae();
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
function de(y, h) {
|
|
217
|
-
|
|
217
|
+
d.value = {
|
|
218
218
|
startDate: y,
|
|
219
219
|
endDate: h
|
|
220
|
-
},
|
|
220
|
+
}, Y();
|
|
221
221
|
}
|
|
222
222
|
n.watchLocation(async (y) => {
|
|
223
223
|
if (!y) {
|
|
224
224
|
a.value = [];
|
|
225
225
|
return;
|
|
226
226
|
}
|
|
227
|
-
await
|
|
227
|
+
await Y();
|
|
228
228
|
});
|
|
229
|
-
const z =
|
|
229
|
+
const z = K(), Ce = K(Math.random().toString());
|
|
230
230
|
async function Ie(y, h) {
|
|
231
|
-
var
|
|
231
|
+
var O, P;
|
|
232
232
|
const t = Math.random().toString();
|
|
233
233
|
Ce.value = t;
|
|
234
234
|
const s = p === "receive/request" ? n.currentLocation : h == null ? void 0 : h.to, x = {
|
|
@@ -239,24 +239,24 @@ function Fr(p, v) {
|
|
|
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 = x, !(h || y.status !==
|
|
247
|
+
if (z.value = x, !(h || y.status !== j.enum.REQUESTING)) {
|
|
248
248
|
try {
|
|
249
249
|
h = (await r.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
|
-
t === Ce.value && (z.value.canResubmit = !h, z.value.transferTo = (
|
|
255
|
+
t === Ce.value && (z.value.canResubmit = !h, z.value.transferTo = (O = h == null ? void 0 : h.to) == null ? void 0 : O.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 ne(y, h, t, s) {
|
|
259
|
+
q.value = !0;
|
|
260
260
|
try {
|
|
261
261
|
await r.processPurchaseOrder(
|
|
262
262
|
{
|
|
@@ -271,30 +271,30 @@ function Fr(p, v) {
|
|
|
271
271
|
)
|
|
272
272
|
},
|
|
273
273
|
s
|
|
274
|
-
), await new Promise((
|
|
275
|
-
const
|
|
276
|
-
h === k.enum.confirmDraft && y.effectiveAt &&
|
|
274
|
+
), await new Promise((P) => setTimeout(P, 1e3));
|
|
275
|
+
const O = Pe().currentLocationDBName.startsWith("restaurant_");
|
|
276
|
+
h === k.enum.confirmDraft && y.effectiveAt && O ? f.open({
|
|
277
277
|
title: "Success",
|
|
278
278
|
message: `${t}. The backdate will be reflected once your POS has received this change.`,
|
|
279
279
|
type: "success"
|
|
280
|
-
}) :
|
|
280
|
+
}) : f.open({
|
|
281
281
|
title: "Success",
|
|
282
282
|
message: t,
|
|
283
283
|
type: "success"
|
|
284
284
|
});
|
|
285
285
|
} catch (x) {
|
|
286
|
-
|
|
286
|
+
f.open({
|
|
287
287
|
title: "Something went wrong",
|
|
288
288
|
message: "Please try again.",
|
|
289
289
|
type: "error"
|
|
290
290
|
}), console.error("Error when submitting PO operation", h, y, x);
|
|
291
291
|
} finally {
|
|
292
|
-
|
|
292
|
+
q.value = !1, Y();
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
async function Le(y, h, t, s) {
|
|
296
296
|
if (h === k.enum.returnStock)
|
|
297
|
-
return s ?
|
|
297
|
+
return s ? ne(
|
|
298
298
|
{
|
|
299
299
|
returnOrder: y,
|
|
300
300
|
purchaseOrder: s
|
|
@@ -304,24 +304,24 @@ function Fr(p, v) {
|
|
|
304
304
|
) : void 0;
|
|
305
305
|
const x = ot[h];
|
|
306
306
|
if (!x) {
|
|
307
|
-
|
|
307
|
+
f.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: O, ...P } = x;
|
|
315
|
+
u.open({
|
|
316
|
+
title: P.title,
|
|
317
|
+
message: P.message,
|
|
318
|
+
primaryActions: P.primaryActions
|
|
319
319
|
}).onPrimary(() => {
|
|
320
|
-
|
|
320
|
+
ne(y, h, O, t);
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
323
|
async function Fe() {
|
|
324
|
-
|
|
324
|
+
u.open({
|
|
325
325
|
title: "Upload Transfer",
|
|
326
326
|
primaryActions: {
|
|
327
327
|
text: "Xilnex transfer note",
|
|
@@ -345,12 +345,12 @@ function Fr(p, v) {
|
|
|
345
345
|
purchaseOrders: a,
|
|
346
346
|
purchaseRequests: i,
|
|
347
347
|
updateDateRange: de,
|
|
348
|
-
fetchData:
|
|
349
|
-
loading:
|
|
350
|
-
transferDialogProps:
|
|
351
|
-
promptCreateTransferDialog:
|
|
352
|
-
promptUpdateTransferDialog:
|
|
353
|
-
promptReturnTransferDialog:
|
|
348
|
+
fetchData: Y,
|
|
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,18 +358,18 @@ 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
363
|
(n, S) => {
|
|
364
|
-
const
|
|
365
|
-
return
|
|
364
|
+
const R = S.received.find((E) => E.sku._id === p._id);
|
|
365
|
+
return R && (n = Ke(n, R.amount)), n;
|
|
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:
|
|
371
|
+
const { name: u, address: n, regNo: S } = v.doc.profile, R = {
|
|
372
|
+
name: u,
|
|
373
373
|
registrationNumber: S,
|
|
374
374
|
line1: n == null ? void 0 : n.line1,
|
|
375
375
|
line2: n == null ? void 0 : n.line2,
|
|
@@ -377,7 +377,7 @@ function lt(p, v) {
|
|
|
377
377
|
city: n == null ? void 0 : n.city,
|
|
378
378
|
state: n == null ? void 0 : n.state,
|
|
379
379
|
country: n == null ? void 0 : n.country
|
|
380
|
-
},
|
|
380
|
+
}, E = {
|
|
381
381
|
name: p.supplier.name,
|
|
382
382
|
registrationNumber: p.supplier.registrationNumber,
|
|
383
383
|
line1: p.supplier.address.line1,
|
|
@@ -386,29 +386,29 @@ 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((d) => {
|
|
390
|
+
const { sku: l, measurement: i } = d, F = Oe(
|
|
391
|
+
Ot(d.sku, p.deliveryOrder || []),
|
|
392
392
|
!1
|
|
393
393
|
);
|
|
394
394
|
return {
|
|
395
|
-
code:
|
|
396
|
-
description:
|
|
397
|
-
quantity: Ge(
|
|
398
|
-
unit: (i == null ? void 0 : i.abbrev) ||
|
|
395
|
+
code: l.code,
|
|
396
|
+
description: l.name,
|
|
397
|
+
quantity: Ge(d.quantity, l.unit, d.measurement),
|
|
398
|
+
unit: (i == null ? void 0 : i.abbrev) || l.unit.abbrev,
|
|
399
399
|
received: F
|
|
400
400
|
};
|
|
401
|
-
}),
|
|
402
|
-
createdAt: rt(new Date(
|
|
403
|
-
ref:
|
|
404
|
-
remark:
|
|
405
|
-
items:
|
|
401
|
+
}), f = p.deliveryOrder.map((d) => ({
|
|
402
|
+
createdAt: rt(new Date(d.createdAt)),
|
|
403
|
+
ref: d.deliveryOrderNumber,
|
|
404
|
+
remark: d.remark || "",
|
|
405
|
+
items: d.received.map((l) => {
|
|
406
406
|
var i;
|
|
407
407
|
return {
|
|
408
|
-
code:
|
|
409
|
-
description:
|
|
410
|
-
quantity:
|
|
411
|
-
unit: ((i =
|
|
408
|
+
code: l.sku.code,
|
|
409
|
+
description: l.sku.name,
|
|
410
|
+
quantity: Oe(l.amount),
|
|
411
|
+
unit: ((i = l.measurement) == null ? void 0 : i.abbrev) || l.sku.unit.abbrev
|
|
412
412
|
};
|
|
413
413
|
})
|
|
414
414
|
})), r = {
|
|
@@ -416,11 +416,11 @@ function lt(p, v) {
|
|
|
416
416
|
createdAt: Ee(p._id),
|
|
417
417
|
ref: p.ref || "",
|
|
418
418
|
remark: p.remark || "",
|
|
419
|
-
buyer:
|
|
420
|
-
supplier:
|
|
421
|
-
items:
|
|
419
|
+
buyer: R,
|
|
420
|
+
supplier: E,
|
|
421
|
+
items: q,
|
|
422
422
|
status: p.status,
|
|
423
|
-
deliveryOrders:
|
|
423
|
+
deliveryOrders: f
|
|
424
424
|
}, a = new URL("https://inventory.feedme.cc");
|
|
425
425
|
a.pathname = a.hostname.includes("inventory.feedme") || a.hostname.includes("localhost") ? "/receive-request/print-preview" : "/inventory/receive-request/print-preview", a.searchParams.append("data", JSON.stringify(r)), window.open(a.href, "_blank", "noreferrer");
|
|
426
426
|
}
|
|
@@ -472,66 +472,67 @@ const xe = {
|
|
|
472
472
|
}
|
|
473
473
|
};
|
|
474
474
|
function Ur(p, v) {
|
|
475
|
-
const
|
|
475
|
+
const u = Pe(), { t: n } = at();
|
|
476
476
|
function S(a) {
|
|
477
477
|
switch (a.status) {
|
|
478
478
|
case "DRAFT":
|
|
479
479
|
return [
|
|
480
|
-
|
|
481
|
-
|
|
480
|
+
ee[Q.Update],
|
|
481
|
+
ee[Q.Details],
|
|
482
482
|
a.supplier.internal === "restaurant" || a.supplier.internal === "warehouse" ? xe[k.enum.submitRequest] : xe[k.enum.confirmDraft],
|
|
483
483
|
xe[k.enum.cancelDraft],
|
|
484
|
-
|
|
484
|
+
ee[Q.Print]
|
|
485
485
|
];
|
|
486
486
|
case "RECEIVING":
|
|
487
487
|
return [
|
|
488
488
|
xe[k.enum.completeReceive],
|
|
489
|
-
|
|
490
|
-
|
|
489
|
+
ee[Q.Details],
|
|
490
|
+
ee[Q.Print]
|
|
491
491
|
];
|
|
492
492
|
case "REQUESTING":
|
|
493
|
-
return p === "receive/request" ? [
|
|
493
|
+
return p === "receive/request" ? [ee[Q.Details], ee[Q.Print]] : [
|
|
494
494
|
xe[k.enum.approveRequest],
|
|
495
495
|
xe[k.enum.rejectRequest],
|
|
496
|
-
|
|
497
|
-
|
|
496
|
+
ee[Q.Details],
|
|
497
|
+
ee[Q.Print]
|
|
498
498
|
];
|
|
499
499
|
case "PROCESSING":
|
|
500
|
-
return [
|
|
500
|
+
return [ee[Q.Details], ee[Q.Print]];
|
|
501
501
|
case "COMPLETE":
|
|
502
502
|
case "CANCEL":
|
|
503
503
|
default:
|
|
504
|
-
return [
|
|
504
|
+
return [ee[Q.Details], ee[Q.Print]];
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function R(a) {
|
|
508
508
|
return Object.values(k.enum).includes(a);
|
|
509
509
|
}
|
|
510
|
-
async function
|
|
511
|
-
var F, U;
|
|
512
|
-
const i = tt(
|
|
510
|
+
async function E(a, d, l) {
|
|
511
|
+
var F, U, J, T, M, re;
|
|
512
|
+
const i = tt(d);
|
|
513
513
|
if (a === Q.Print) {
|
|
514
|
-
|
|
514
|
+
const ae = l ? u.locationByDbName[l.to.dbName] : u.currentLocation, Y = `${((F = l == null ? void 0 : l.netSuite) == null ? void 0 : F.id) ?? ""} ${((U = l == null ? void 0 : l.netSuite) == null ? void 0 : U.refNo) ?? ""}`.trim() || `${((J = i.netSuite) == null ? void 0 : J.id) ?? ""} ${((T = i.netSuite) == null ? void 0 : T.refNo) ?? ""}`.trim();
|
|
515
|
+
i.ref = [Y ? `Netsuite: (${Y})` : "", i.ref].filter((de) => de).join(" "), lt(i, ae ?? u.currentLocation);
|
|
515
516
|
return;
|
|
516
517
|
}
|
|
517
518
|
if (a === Q.Details) {
|
|
518
|
-
v.promptShowTransferDetails(i,
|
|
519
|
-
console.error("error on promptShowTransferDetails", { error:
|
|
519
|
+
v.promptShowTransferDetails(i, l).catch((ae) => {
|
|
520
|
+
console.error("error on promptShowTransferDetails", { error: ae, poRequest: l });
|
|
520
521
|
});
|
|
521
522
|
return;
|
|
522
523
|
}
|
|
523
524
|
if (a === Q.Update) {
|
|
524
|
-
(
|
|
525
|
+
(M = v.promptUpdateTransferDialog) == null || M.call(v, i);
|
|
525
526
|
return;
|
|
526
527
|
}
|
|
527
|
-
if (
|
|
528
|
-
v.submitAction(
|
|
529
|
-
console.error("error on po action", { action: a, error:
|
|
528
|
+
if (R(a) && a != k.enum.returnStock && a != k.enum.receiveStock) {
|
|
529
|
+
v.submitAction(d, a, (re = l == null ? void 0 : l.to) == null ? void 0 : re.dbName).then((ae) => {
|
|
530
|
+
console.error("error on po action", { action: a, error: ae });
|
|
530
531
|
});
|
|
531
532
|
return;
|
|
532
533
|
}
|
|
533
534
|
}
|
|
534
|
-
function
|
|
535
|
+
function q() {
|
|
535
536
|
return [
|
|
536
537
|
{
|
|
537
538
|
accessorKey: "seqNumber",
|
|
@@ -572,7 +573,7 @@ function Ur(p, v) {
|
|
|
572
573
|
accessorKey: "status",
|
|
573
574
|
header: () => n("inventory.transfer.table.status"),
|
|
574
575
|
cell(a) {
|
|
575
|
-
const
|
|
576
|
+
const d = n(`inventory.transfer.status.${a.getValue() ?? ""}`), l = `${a.getValue() ?? ""}`.toLocaleLowerCase("en-us");
|
|
576
577
|
return N(
|
|
577
578
|
"div",
|
|
578
579
|
{
|
|
@@ -581,9 +582,9 @@ function Ur(p, v) {
|
|
|
581
582
|
N(
|
|
582
583
|
"div",
|
|
583
584
|
{
|
|
584
|
-
class: `fm-status-badge fm-status-badge-${
|
|
585
|
+
class: `fm-status-badge fm-status-badge-${l}`
|
|
585
586
|
},
|
|
586
|
-
|
|
587
|
+
d
|
|
587
588
|
)
|
|
588
589
|
);
|
|
589
590
|
},
|
|
@@ -593,8 +594,8 @@ function Ur(p, v) {
|
|
|
593
594
|
{
|
|
594
595
|
id: "action",
|
|
595
596
|
cell(a) {
|
|
596
|
-
const
|
|
597
|
-
return Je(
|
|
597
|
+
const d = a.row.original, l = S(d);
|
|
598
|
+
return Je(l, (i) => E(i, d));
|
|
598
599
|
},
|
|
599
600
|
enableSorting: !1,
|
|
600
601
|
size: 40,
|
|
@@ -605,7 +606,7 @@ function Ur(p, v) {
|
|
|
605
606
|
}
|
|
606
607
|
];
|
|
607
608
|
}
|
|
608
|
-
function
|
|
609
|
+
function f() {
|
|
609
610
|
return [
|
|
610
611
|
{
|
|
611
612
|
accessorKey: "purchaseOrder.seqNumber",
|
|
@@ -643,7 +644,7 @@ function Ur(p, v) {
|
|
|
643
644
|
accessorKey: "purchaseOrder.status",
|
|
644
645
|
header: () => n("inventory.transfer.table.status"),
|
|
645
646
|
cell(a) {
|
|
646
|
-
const
|
|
647
|
+
const d = n(`inventory.transfer.status.${a.getValue() ?? ""}`), l = `${a.getValue() ?? ""}`.toLocaleLowerCase("en-us");
|
|
647
648
|
return N(
|
|
648
649
|
"div",
|
|
649
650
|
{
|
|
@@ -652,9 +653,9 @@ function Ur(p, v) {
|
|
|
652
653
|
N(
|
|
653
654
|
"div",
|
|
654
655
|
{
|
|
655
|
-
class: `fm-status-badge fm-status-badge-${
|
|
656
|
+
class: `fm-status-badge fm-status-badge-${l}`
|
|
656
657
|
},
|
|
657
|
-
|
|
658
|
+
d
|
|
658
659
|
)
|
|
659
660
|
);
|
|
660
661
|
},
|
|
@@ -663,16 +664,16 @@ function Ur(p, v) {
|
|
|
663
664
|
{
|
|
664
665
|
id: "action",
|
|
665
666
|
cell(a) {
|
|
666
|
-
const
|
|
667
|
+
const d = a.row.original, l = d.purchaseOrder ? S(d.purchaseOrder) : [];
|
|
667
668
|
return Je(
|
|
668
|
-
|
|
669
|
-
(i) =>
|
|
669
|
+
l,
|
|
670
|
+
(i) => d.purchaseOrder ? E(
|
|
670
671
|
i,
|
|
671
672
|
{
|
|
672
|
-
...
|
|
673
|
-
_rev:
|
|
673
|
+
...d.purchaseOrder,
|
|
674
|
+
_rev: d.purchaseOrder._rev ?? ""
|
|
674
675
|
},
|
|
675
|
-
|
|
676
|
+
d
|
|
676
677
|
) : void 0
|
|
677
678
|
);
|
|
678
679
|
},
|
|
@@ -685,23 +686,23 @@ function Ur(p, v) {
|
|
|
685
686
|
}
|
|
686
687
|
];
|
|
687
688
|
}
|
|
688
|
-
const r = X(() => p === "receive/request" ?
|
|
689
|
+
const r = X(() => p === "receive/request" ? q() : f());
|
|
689
690
|
return {
|
|
690
691
|
get columnDefs() {
|
|
691
692
|
return r.value;
|
|
692
693
|
}
|
|
693
694
|
};
|
|
694
695
|
}
|
|
695
|
-
const
|
|
696
|
+
const Rt = {
|
|
696
697
|
key: 0,
|
|
697
698
|
class: "flex flex-col gap-8"
|
|
698
699
|
}, kt = { class: "flex flex-col gap-4" }, Dt = { class: "fm-typo-en-body-lg-600" }, Nt = {
|
|
699
700
|
key: 0,
|
|
700
701
|
class: "flex flex-col gap-4"
|
|
701
|
-
}, At = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
702
|
+
}, 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
703
|
key: 1,
|
|
703
704
|
class: "flex flex-col gap-4"
|
|
704
|
-
},
|
|
705
|
+
}, 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
706
|
key: 2,
|
|
706
707
|
class: "flex flex-col gap-4"
|
|
707
708
|
}, Ut = { class: "fm-typo-en-body-lg-600" }, Bt = {
|
|
@@ -718,57 +719,57 @@ const Ot = {
|
|
|
718
719
|
scope: {}
|
|
719
720
|
},
|
|
720
721
|
setup(p) {
|
|
721
|
-
const v = p,
|
|
722
|
+
const v = p, u = ze(), n = Xe(), S = K(v.poRequest);
|
|
722
723
|
yt(async () => {
|
|
723
|
-
var
|
|
724
|
-
if (!v.poRequest && ((
|
|
724
|
+
var f;
|
|
725
|
+
if (!v.poRequest && ((f = v.purchaseOrder) != null && f._id)) {
|
|
725
726
|
const r = await n.getLatestPurchaseOrderRequest(v.purchaseOrder._id);
|
|
726
727
|
S.value = r;
|
|
727
728
|
}
|
|
728
729
|
});
|
|
729
|
-
const
|
|
730
|
+
const R = X(
|
|
730
731
|
() => {
|
|
731
|
-
var
|
|
732
|
-
return
|
|
733
|
-
((a = (r = (
|
|
732
|
+
var f, r, a, d, l, i;
|
|
733
|
+
return u.getSubsidiaryFullName(
|
|
734
|
+
((a = (r = (f = v.purchaseOrder) == null ? void 0 : f.netSuite) == null ? void 0 : r.subsidiary) == null ? void 0 : a.id) || ((i = (l = (d = v.poRequest) == null ? void 0 : d.netSuite) == null ? void 0 : l.subsidiary) == null ? void 0 : i.id)
|
|
734
735
|
).fullName;
|
|
735
736
|
}
|
|
736
|
-
),
|
|
737
|
-
var
|
|
738
|
-
return (a = (r = (
|
|
739
|
-
}),
|
|
740
|
-
var
|
|
741
|
-
return (r = (
|
|
737
|
+
), E = X(() => {
|
|
738
|
+
var f, r, a, d, l, i, F, U, J, T, M, re;
|
|
739
|
+
return (a = (r = (f = v.purchaseOrder) == null ? void 0 : f.netSuite) == null ? void 0 : r.additionalInfo) != null && a.transactionnumber ? (i = (l = (d = v.purchaseOrder) == null ? void 0 : d.netSuite) == null ? void 0 : l.additionalInfo) == null ? void 0 : i.transactionnumber : (J = (U = (F = S.value) == null ? void 0 : F.netSuite) == null ? void 0 : U.additionalInfo) != null && J.transactionnumber ? (re = (M = (T = S.value) == null ? void 0 : T.netSuite) == null ? void 0 : M.additionalInfo) == null ? void 0 : re.transactionnumber : null;
|
|
740
|
+
}), q = X(() => {
|
|
741
|
+
var f, r, a, d, l, i;
|
|
742
|
+
return (r = (f = v.purchaseOrder) == null ? void 0 : f.deliveryFullfillment) != null && r.length && ((d = (a = v.purchaseOrder) == null ? void 0 : a.deliveryFullfillment) == null ? void 0 : d.length) > 0 ? (i = (l = v.purchaseOrder) == null ? void 0 : l.deliveryFullfillment) == null ? void 0 : i.map((F) => {
|
|
742
743
|
var U;
|
|
743
744
|
return (U = F.netSuite) == null ? void 0 : U.refNo;
|
|
744
745
|
}).join(", ") : "N/A";
|
|
745
746
|
});
|
|
746
|
-
return (
|
|
747
|
-
var a,
|
|
748
|
-
return o(
|
|
747
|
+
return (f, r) => {
|
|
748
|
+
var a, d, l, i, F, U, J, T, M, re, ae, Y, de, z;
|
|
749
|
+
return o(u).isEnabled ? (c(), _("div", Rt, [
|
|
749
750
|
e("div", kt, [
|
|
750
751
|
r[0] || (r[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
751
|
-
e("div", Dt, m(
|
|
752
|
+
e("div", Dt, m(R.value || "N/A"), 1)
|
|
752
753
|
]),
|
|
753
|
-
!
|
|
754
|
-
e("div", At, " NetSuite " + m(
|
|
755
|
-
e("div",
|
|
756
|
-
(
|
|
754
|
+
!f.isTransferBetweenOutlets && ((a = f.purchaseOrder) == null ? void 0 : a.status) !== o(j).Enum.REQUESTING && f.scope === o(He).RECEIVE_REQUEST ? (c(), _("div", Nt, [
|
|
755
|
+
e("div", At, " NetSuite " + m(f.transferType === o(be).PURCHASE ? "purchase order" : "transfer order") + " (ID) ", 1),
|
|
756
|
+
e("div", Tt, [
|
|
757
|
+
(l = (d = f.purchaseOrder) == null ? void 0 : d.netSuite) != null && l.id ? (c(), _("span", $t, m((F = (i = f.purchaseOrder) == null ? void 0 : i.netSuite) == null ? void 0 : F.refNo) + " (" + m((J = (U = f.purchaseOrder) == null ? void 0 : U.netSuite) == null ? void 0 : J.id) + ") ", 1)) : (c(), _("span", Pt, "N/A"))
|
|
757
758
|
])
|
|
758
759
|
])) : D("", !0),
|
|
759
|
-
!
|
|
760
|
-
e("div",
|
|
760
|
+
!f.isTransferBetweenOutlets && S.value && ((T = f.purchaseOrder) == null ? void 0 : T.status) === o(j).Enum.REQUESTING || f.scope === o(He).APPROVAL ? (c(), _("div", Ct, [
|
|
761
|
+
e("div", qt, " (Request) NetSuite " + m(f.transferType === o(be).PURCHASE ? "Purchase order" : "Transfer order") + " (ID) ", 1),
|
|
761
762
|
e("div", Et, [
|
|
762
|
-
(
|
|
763
|
+
(re = (M = S.value) == null ? void 0 : M.netSuite) != null && re.id ? (c(), _("span", It, m((Y = (ae = S.value) == null ? void 0 : ae.netSuite) == null ? void 0 : Y.refNo) + " (" + m((z = (de = S.value) == null ? void 0 : de.netSuite) == null ? void 0 : z.id) + ") ", 1)) : (c(), _("span", Lt, "N/A"))
|
|
763
764
|
])
|
|
764
765
|
])) : D("", !0),
|
|
765
|
-
|
|
766
|
+
E.value ? (c(), _("div", Ft, [
|
|
766
767
|
r[1] || (r[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite transaction number ", -1)),
|
|
767
|
-
e("div", Ut, m(
|
|
768
|
+
e("div", Ut, m(E.value), 1)
|
|
768
769
|
])) : D("", !0),
|
|
769
|
-
o(
|
|
770
|
+
o(u).isEnabled && f.transferType === o(be).TRANSFER && !f.isTransferBetweenOutlets ? (c(), _("div", Bt, [
|
|
770
771
|
r[2] || (r[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
771
|
-
e("div", Mt, m(
|
|
772
|
+
e("div", Mt, m(q.value), 1)
|
|
772
773
|
])) : D("", !0)
|
|
773
774
|
])) : D("", !0);
|
|
774
775
|
};
|
|
@@ -784,15 +785,15 @@ const Ot = {
|
|
|
784
785
|
isTransferBetweenOutlets: { type: Boolean }
|
|
785
786
|
},
|
|
786
787
|
setup(p) {
|
|
787
|
-
const v = p,
|
|
788
|
-
var
|
|
789
|
-
let
|
|
790
|
-
|
|
788
|
+
const v = p, u = ze(), n = We(), S = Ye(), R = K(!1), E = X(() => {
|
|
789
|
+
var d, l, i, F;
|
|
790
|
+
let f = !0;
|
|
791
|
+
u.isEnabled || (f = !1);
|
|
791
792
|
const r = v.purchaseOrder, a = v.poRequest;
|
|
792
|
-
return r && ((
|
|
793
|
+
return r && ((d = r == null ? void 0 : r.supplier) != null && d.internal ? (!a && r.status == j.enum.DRAFT && (f = !1), a && !((l = a == null ? void 0 : a.netSuite) != null && l.id) && (f = !1), v.isTransferBetweenOutlets && (f = !1)) : ((r == null ? void 0 : r.status) !== j.enum.REQUESTING && r.supplier.internal && (f = !1), !a && !((i = r == null ? void 0 : r.netSuite) != null && i.id) && (f = !1), !a && ((F = r == null ? void 0 : r.netSuite) != null && F.id) && (r == null ? void 0 : r.status) == j.enum.REQUESTING && (f = !1))), f;
|
|
793
794
|
});
|
|
794
|
-
async function
|
|
795
|
-
|
|
795
|
+
async function q() {
|
|
796
|
+
R.value || S.open({
|
|
796
797
|
title: "Sync with NetSuite",
|
|
797
798
|
contentComponent: N("div", [
|
|
798
799
|
N("p", "Are you sure you want to sync now?"),
|
|
@@ -810,12 +811,12 @@ const Ot = {
|
|
|
810
811
|
},
|
|
811
812
|
secondaryActions: { text: "Not now", close: !0 }
|
|
812
813
|
}).onPrimary(async () => {
|
|
813
|
-
var
|
|
814
|
+
var f;
|
|
814
815
|
try {
|
|
815
|
-
|
|
816
|
+
R.value = !0;
|
|
816
817
|
const r = v.purchaseOrder, a = v.poRequest;
|
|
817
|
-
let
|
|
818
|
-
if ((
|
|
818
|
+
let d = "purchaseOrder";
|
|
819
|
+
if ((f = r == null ? void 0 : r.supplier) != null && f.internal && (d = "purchaseOrderRequest"), !(r != null && r._id)) {
|
|
819
820
|
n.open({
|
|
820
821
|
title: "Error",
|
|
821
822
|
message: "Invalid sync ID",
|
|
@@ -823,7 +824,7 @@ const Ot = {
|
|
|
823
824
|
});
|
|
824
825
|
return;
|
|
825
826
|
}
|
|
826
|
-
await
|
|
827
|
+
await u.syncTransferOrder(d, r == null ? void 0 : r._id, a == null ? void 0 : a._id), n.open({
|
|
827
828
|
title: "Sync with NetSuite",
|
|
828
829
|
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
829
830
|
type: "success"
|
|
@@ -836,19 +837,19 @@ const Ot = {
|
|
|
836
837
|
});
|
|
837
838
|
}
|
|
838
839
|
setTimeout(() => {
|
|
839
|
-
|
|
840
|
+
R.value = !1;
|
|
840
841
|
}, 5e3);
|
|
841
842
|
});
|
|
842
843
|
}
|
|
843
|
-
return (
|
|
844
|
-
const a =
|
|
845
|
-
return
|
|
844
|
+
return (f, r) => {
|
|
845
|
+
const a = ue("FmButton");
|
|
846
|
+
return E.value ? (c(), _("div", Vt, [
|
|
846
847
|
B(a, {
|
|
847
848
|
"prepend-icon": "sync",
|
|
848
849
|
variant: "secondary",
|
|
849
850
|
label: "Sync",
|
|
850
|
-
loading:
|
|
851
|
-
onClick:
|
|
851
|
+
loading: R.value,
|
|
852
|
+
onClick: q,
|
|
852
853
|
"text-color": "primary",
|
|
853
854
|
"bg-color": "transparent",
|
|
854
855
|
"border-color": "primary"
|
|
@@ -874,13 +875,13 @@ const Ot = {
|
|
|
874
875
|
}, vs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ys = { class: "fm-typo-en-body-lg-600" }, hs = {
|
|
875
876
|
key: 0,
|
|
876
877
|
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" },
|
|
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" }, Rs = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, ks = { 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
879
|
key: 0,
|
|
879
880
|
class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
880
|
-
},
|
|
881
|
+
}, Ts = { class: "py-8" }, $s = { class: "flex justify-end gap-4 items-center" }, Ps = { class: "fm-typo-en-body-lg-600" }, Cs = {
|
|
881
882
|
key: 1,
|
|
882
883
|
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
883
|
-
},
|
|
884
|
+
}, qs = {
|
|
884
885
|
key: 0,
|
|
885
886
|
class: "flex flex-col items-center gap-8 h-full"
|
|
886
887
|
}, 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 +920,7 @@ const Ot = {
|
|
|
919
920
|
}, gr = { class: "flex-1 flex flex-col items-center" }, br = {
|
|
920
921
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
921
922
|
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" },
|
|
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" }, Rr = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, kr = { 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
924
|
key: 0,
|
|
924
925
|
class: "line-clamp-1 fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
925
926
|
}, Ar = { class: "flex gap-8 xs:flex-col" }, Br = /* @__PURE__ */ Qe({
|
|
@@ -936,26 +937,26 @@ const Ot = {
|
|
|
936
937
|
},
|
|
937
938
|
emits: ["update:show", "submitted", "returnStock"],
|
|
938
939
|
setup(p, { emit: v }) {
|
|
939
|
-
const
|
|
940
|
+
const u = p, n = v, S = Ye(), R = We(), E = nt(), q = ze(), f = Pe(), { t: r } = at(), a = X(
|
|
940
941
|
() => {
|
|
941
|
-
var t, s, x,
|
|
942
|
-
return ((s = (t =
|
|
942
|
+
var t, s, x, O;
|
|
943
|
+
return ((s = (t = u.purchaseOrder) == null ? void 0 : t.supplier) == null ? void 0 : s.internal) === "restaurant" || ((O = (x = u.purchaseOrder) == null ? void 0 : x.supplier) == null ? void 0 : O.internal) === "warehouse" ? be.TRANSFER : be.PURCHASE;
|
|
943
944
|
}
|
|
944
|
-
),
|
|
945
|
+
), d = X(() => {
|
|
945
946
|
var t, s, x;
|
|
946
|
-
return a.value ===
|
|
947
|
-
}),
|
|
948
|
-
var s, x,
|
|
949
|
-
if (
|
|
950
|
-
if (!
|
|
951
|
-
const
|
|
952
|
-
(g = (
|
|
953
|
-
), L =
|
|
954
|
-
|
|
955
|
-
),
|
|
956
|
-
if ((L == null ? void 0 : L.id) !== (
|
|
947
|
+
return a.value === be.TRANSFER && ((t = u.transferToDbName) == null ? void 0 : t.startsWith("restaurant")) && ((x = (s = u.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : x.internal) === "restaurant";
|
|
948
|
+
}), l = K(!1), i = K(""), F = K(!0), U = Xe(), J = wt(u, "show"), T = K(null), M = K({}), re = X(() => T.value === null), ae = K(""), Y = X(() => {
|
|
949
|
+
var s, x, O, P, C, G, g, w, I;
|
|
950
|
+
if (!E.enableReturnStocks || !((x = (s = u.purchaseOrder) == null ? void 0 : s.supplier) != null && x.internal) || ((O = u.purchaseOrder) == null ? void 0 : O.status) !== j.enum.COMPLETE || !f.locationById[(C = (P = u.purchaseOrder) == null ? void 0 : P.supplier) == null ? void 0 : C._id]) return !1;
|
|
951
|
+
if (!q.isEnabled) {
|
|
952
|
+
const V = q.getNetSuiteLocation(
|
|
953
|
+
(g = (G = u.purchaseOrder) == null ? void 0 : G.supplier) == null ? void 0 : g._id
|
|
954
|
+
), L = q.getLocationSubsidiary(V == null ? void 0 : V.id), W = q.getNetSuiteLocation(
|
|
955
|
+
f.currentLocation.doc._id
|
|
956
|
+
), oe = q.getLocationSubsidiary(W == null ? void 0 : W.id);
|
|
957
|
+
if ((L == null ? void 0 : L.id) !== (oe == null ? void 0 : oe.id)) return !1;
|
|
957
958
|
}
|
|
958
|
-
return !!((I = (w =
|
|
959
|
+
return !!((I = (w = u.purchaseOrder) == null ? void 0 : w.deliveryOrder) != null && I.length);
|
|
959
960
|
}), de = X(() => {
|
|
960
961
|
const t = [
|
|
961
962
|
{
|
|
@@ -967,36 +968,36 @@ const Ot = {
|
|
|
967
968
|
value: "deliveryHistory"
|
|
968
969
|
}
|
|
969
970
|
];
|
|
970
|
-
return
|
|
971
|
+
return Y.value && t.push({
|
|
971
972
|
label: "Returns",
|
|
972
973
|
value: "returns"
|
|
973
974
|
}), t;
|
|
974
|
-
}), z =
|
|
975
|
+
}), z = K(de.value[0]);
|
|
975
976
|
async function Ce() {
|
|
976
|
-
var t, s, x,
|
|
977
|
-
|
|
977
|
+
var t, s, x, O, P;
|
|
978
|
+
T.value = null, M.value = {};
|
|
978
979
|
try {
|
|
979
|
-
const
|
|
980
|
-
for (const w of
|
|
981
|
-
const [I,
|
|
980
|
+
const C = ((t = u.purchaseOrder) == null ? void 0 : t.returnPoIds) ?? [], G = new Array(), g = `${(x = (s = u.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : x.internal}_${(P = (O = u.purchaseOrder) == null ? void 0 : O.supplier) == null ? void 0 : P._id}`;
|
|
981
|
+
for (const w of C) {
|
|
982
|
+
const [I, V] = await Promise.all([
|
|
982
983
|
U.getPurchaseOrderById(w, g),
|
|
983
984
|
U.getLatestPurchaseOrderRequest(w, g)
|
|
984
985
|
]);
|
|
985
|
-
|
|
986
|
+
G.push(I), V && (M.value[w] = V);
|
|
986
987
|
}
|
|
987
|
-
|
|
988
|
-
} catch (
|
|
989
|
-
console.error("error on fetching return orders",
|
|
988
|
+
G.sort((w, I) => I._id.localeCompare(w._id)), T.value = G;
|
|
989
|
+
} catch (C) {
|
|
990
|
+
console.error("error on fetching return orders", C), ae.value = `Something went wrong while retrieving returns. ${(C == null ? void 0 : C.message) ?? C}`, T.value = [];
|
|
990
991
|
}
|
|
991
992
|
}
|
|
992
993
|
ht(
|
|
993
|
-
() =>
|
|
994
|
+
() => u.show,
|
|
994
995
|
(t) => {
|
|
995
996
|
t && (z.value = de.value[0], Ce());
|
|
996
997
|
}
|
|
997
998
|
);
|
|
998
999
|
async function Ie(t, s, x) {
|
|
999
|
-
i.value = `${s}`,
|
|
1000
|
+
i.value = `${s}`, l.value = !0, F.value = !1;
|
|
1000
1001
|
try {
|
|
1001
1002
|
await U.processPurchaseOrder(
|
|
1002
1003
|
{
|
|
@@ -1005,82 +1006,82 @@ const Ot = {
|
|
|
1005
1006
|
options: (
|
|
1006
1007
|
// auto receive for supplier to warehouse
|
|
1007
1008
|
(s === k.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
1008
|
-
s === k.enum.completeReceive) &&
|
|
1009
|
+
s === k.enum.completeReceive) && E.autoReceiveWarehouse ? {
|
|
1009
1010
|
autoReceive: !0
|
|
1010
1011
|
} : void 0
|
|
1011
1012
|
)
|
|
1012
1013
|
},
|
|
1013
|
-
|
|
1014
|
-
), await new Promise((
|
|
1014
|
+
u.transferToDbName
|
|
1015
|
+
), await new Promise((O) => setTimeout(O, 1e3)), R.open({
|
|
1015
1016
|
title: "Success",
|
|
1016
1017
|
message: x,
|
|
1017
1018
|
type: "success"
|
|
1018
1019
|
}), n("update:show", !1), n("submitted");
|
|
1019
|
-
} catch (
|
|
1020
|
-
|
|
1020
|
+
} catch (O) {
|
|
1021
|
+
R.open({
|
|
1021
1022
|
title: "Something went wrong",
|
|
1022
1023
|
message: "Please try again.",
|
|
1023
1024
|
type: "error"
|
|
1024
|
-
}), console.error("Error when submitting PO operation", s, t,
|
|
1025
|
+
}), console.error("Error when submitting PO operation", s, t, O);
|
|
1025
1026
|
} finally {
|
|
1026
|
-
i.value = "",
|
|
1027
|
+
i.value = "", l.value = !1, F.value = !0;
|
|
1027
1028
|
}
|
|
1028
1029
|
}
|
|
1029
|
-
async function
|
|
1030
|
+
async function ne(t) {
|
|
1030
1031
|
if (t === k.enum.returnStock) {
|
|
1031
|
-
|
|
1032
|
+
u.purchaseOrder && n("returnStock", u.purchaseOrder), n("update:show", !1);
|
|
1032
1033
|
return;
|
|
1033
1034
|
}
|
|
1034
1035
|
if (t === k.enum.receiveStock)
|
|
1035
1036
|
return;
|
|
1036
1037
|
const s = ot[t];
|
|
1037
1038
|
if (!s) {
|
|
1038
|
-
|
|
1039
|
+
R.open({
|
|
1039
1040
|
title: "Something went wrong",
|
|
1040
1041
|
message: `Cannot process order: ${st(t)}`,
|
|
1041
1042
|
type: "error"
|
|
1042
1043
|
});
|
|
1043
1044
|
return;
|
|
1044
1045
|
}
|
|
1045
|
-
const { successMessage: x, ...
|
|
1046
|
+
const { successMessage: x, ...O } = s;
|
|
1046
1047
|
S.open({
|
|
1047
|
-
title:
|
|
1048
|
-
message:
|
|
1049
|
-
primaryActions:
|
|
1048
|
+
title: O.title,
|
|
1049
|
+
message: O.message,
|
|
1050
|
+
primaryActions: O.primaryActions
|
|
1050
1051
|
}).onPrimary(() => {
|
|
1051
|
-
|
|
1052
|
+
u.purchaseOrder && Ie(u.purchaseOrder, t, x);
|
|
1052
1053
|
});
|
|
1053
1054
|
}
|
|
1054
1055
|
const Le = X(() => {
|
|
1055
1056
|
var t, s;
|
|
1056
|
-
return ((t =
|
|
1057
|
+
return ((t = u.purchaseOrder) == null ? void 0 : t.status) === j.enum.RECEIVING || ((s = u.purchaseOrder) == null ? void 0 : s.status) === j.enum.COMPLETE;
|
|
1057
1058
|
}), Fe = X(() => {
|
|
1058
|
-
var
|
|
1059
|
-
const x = (((
|
|
1059
|
+
var C, G, g;
|
|
1060
|
+
const x = (((C = u.purchaseOrder) == null ? void 0 : C.deliveryOrder) ?? []).flatMap((w) => w.received ?? []).reduce(
|
|
1060
1061
|
(w, I) => {
|
|
1061
|
-
const
|
|
1062
|
-
return w[I.sku._id] = [...
|
|
1062
|
+
const V = w[I.sku._id] ?? [];
|
|
1063
|
+
return w[I.sku._id] = [...V, I], w;
|
|
1063
1064
|
},
|
|
1064
1065
|
{}
|
|
1065
|
-
),
|
|
1066
|
-
(w, [I,
|
|
1067
|
-
const L =
|
|
1068
|
-
const
|
|
1066
|
+
), O = Object.entries(x).reduce(
|
|
1067
|
+
(w, [I, V]) => {
|
|
1068
|
+
const L = V.reduce((W, oe) => {
|
|
1069
|
+
const le = pt(
|
|
1069
1070
|
W,
|
|
1070
|
-
Math.max(W.precision,
|
|
1071
|
+
Math.max(W.precision, oe.amount.precision)
|
|
1071
1072
|
);
|
|
1072
|
-
return Ke(
|
|
1073
|
-
},
|
|
1073
|
+
return Ke(le, oe.amount);
|
|
1074
|
+
}, qe(0));
|
|
1074
1075
|
return w[I] = L, w;
|
|
1075
1076
|
},
|
|
1076
1077
|
{}
|
|
1077
|
-
),
|
|
1078
|
-
for (const w of
|
|
1079
|
-
|
|
1080
|
-
return
|
|
1078
|
+
), P = ((G = u.purchaseOrder) == null ? void 0 : G.items) ?? [];
|
|
1079
|
+
for (const w of P)
|
|
1080
|
+
O[g = w.sku._id] ?? (O[g] = qe(0));
|
|
1081
|
+
return O;
|
|
1081
1082
|
}), y = X(() => {
|
|
1082
|
-
var
|
|
1083
|
-
const t = ((
|
|
1083
|
+
var C, G;
|
|
1084
|
+
const t = ((C = u.purchaseOrder) == null ? void 0 : C.deliveryOrder) ?? [], s = ((G = u.purchaseOrder) == null ? void 0 : G.deliveryFullfillment) ?? [], x = [
|
|
1084
1085
|
...t.map((g) => ({
|
|
1085
1086
|
createdAt: g.createdAt,
|
|
1086
1087
|
type: "grn",
|
|
@@ -1093,9 +1094,9 @@ const Ot = {
|
|
|
1093
1094
|
}))
|
|
1094
1095
|
];
|
|
1095
1096
|
x.reverse().sort((g, w) => g.createdAt.localeCompare(w.createdAt));
|
|
1096
|
-
function
|
|
1097
|
-
var I,
|
|
1098
|
-
const w = s.findIndex((
|
|
1097
|
+
function O(g) {
|
|
1098
|
+
var I, V, L, W, oe, le, me;
|
|
1099
|
+
const w = s.findIndex((H) => H.id === g.fullfillmentId);
|
|
1099
1100
|
return {
|
|
1100
1101
|
header: "Received",
|
|
1101
1102
|
date: Me(new Date(g.createdAt)),
|
|
@@ -1106,8 +1107,8 @@ const Ot = {
|
|
|
1106
1107
|
},
|
|
1107
1108
|
{
|
|
1108
1109
|
label: "Received items",
|
|
1109
|
-
values: g.received.map((
|
|
1110
|
-
var
|
|
1110
|
+
values: g.received.map((H) => {
|
|
1111
|
+
var pe;
|
|
1111
1112
|
return N("div", [
|
|
1112
1113
|
N(
|
|
1113
1114
|
"div",
|
|
@@ -1126,14 +1127,14 @@ const Ot = {
|
|
|
1126
1127
|
{
|
|
1127
1128
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
1128
1129
|
},
|
|
1129
|
-
`${
|
|
1130
|
+
`${H.sku.name}`
|
|
1130
1131
|
),
|
|
1131
1132
|
N(
|
|
1132
1133
|
"span",
|
|
1133
1134
|
{
|
|
1134
1135
|
class: "fm-typo-en-body-md-400"
|
|
1135
1136
|
},
|
|
1136
|
-
`${
|
|
1137
|
+
`${H.sku.code} `
|
|
1137
1138
|
)
|
|
1138
1139
|
]
|
|
1139
1140
|
),
|
|
@@ -1154,14 +1155,14 @@ const Ot = {
|
|
|
1154
1155
|
{
|
|
1155
1156
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
1156
1157
|
},
|
|
1157
|
-
|
|
1158
|
+
Oe(H.amount, !1)
|
|
1158
1159
|
),
|
|
1159
1160
|
N(
|
|
1160
1161
|
"span",
|
|
1161
1162
|
{
|
|
1162
1163
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1163
1164
|
},
|
|
1164
|
-
((
|
|
1165
|
+
((pe = H.measurement) == null ? void 0 : pe.abbrev) ?? H.sku.unit.abbrev
|
|
1165
1166
|
)
|
|
1166
1167
|
]
|
|
1167
1168
|
),
|
|
@@ -1170,7 +1171,7 @@ const Ot = {
|
|
|
1170
1171
|
{
|
|
1171
1172
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1172
1173
|
},
|
|
1173
|
-
`${
|
|
1174
|
+
`${H.cost ? `(${$e(H.cost)})` : ""}`
|
|
1174
1175
|
)
|
|
1175
1176
|
]
|
|
1176
1177
|
)
|
|
@@ -1191,19 +1192,19 @@ const Ot = {
|
|
|
1191
1192
|
label: "Fulfilment's sequence",
|
|
1192
1193
|
values: [`${w + 1}`]
|
|
1193
1194
|
} : null,
|
|
1194
|
-
(L = (
|
|
1195
|
+
(L = (V = s[w]) == null ? void 0 : V.netSuite) != null && L.refNo ? {
|
|
1195
1196
|
label: "Fulfillment's ref no. (Netsuite)",
|
|
1196
|
-
values: [(
|
|
1197
|
+
values: [(oe = (W = s[w]) == null ? void 0 : W.netSuite) == null ? void 0 : oe.refNo]
|
|
1197
1198
|
} : null,
|
|
1198
|
-
(
|
|
1199
|
+
(le = g == null ? void 0 : g.netSuite) != null && le.refNo ? {
|
|
1199
1200
|
label: "Item receipt (Netsuite)",
|
|
1200
|
-
values: [(
|
|
1201
|
+
values: [(me = g == null ? void 0 : g.netSuite) == null ? void 0 : me.refNo]
|
|
1201
1202
|
} : null
|
|
1202
|
-
].filter((
|
|
1203
|
+
].filter((H) => H)
|
|
1203
1204
|
};
|
|
1204
1205
|
}
|
|
1205
|
-
function
|
|
1206
|
-
var I,
|
|
1206
|
+
function P(g) {
|
|
1207
|
+
var I, V;
|
|
1207
1208
|
const w = s.findIndex((L) => L.id === g.id);
|
|
1208
1209
|
return {
|
|
1209
1210
|
header: "Fulfillment",
|
|
@@ -1263,7 +1264,7 @@ const Ot = {
|
|
|
1263
1264
|
{
|
|
1264
1265
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
1265
1266
|
},
|
|
1266
|
-
|
|
1267
|
+
Oe(L.amount, !1)
|
|
1267
1268
|
),
|
|
1268
1269
|
N(
|
|
1269
1270
|
"span",
|
|
@@ -1279,7 +1280,7 @@ const Ot = {
|
|
|
1279
1280
|
{
|
|
1280
1281
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1281
1282
|
},
|
|
1282
|
-
`${L.cost ? `(${
|
|
1283
|
+
`${L.cost ? `(${$e(L.cost)})` : ""}`
|
|
1283
1284
|
)
|
|
1284
1285
|
]
|
|
1285
1286
|
)
|
|
@@ -1290,7 +1291,7 @@ const Ot = {
|
|
|
1290
1291
|
},
|
|
1291
1292
|
(I = g.netSuite) != null && I.refNo ? {
|
|
1292
1293
|
label: "Ref no. (Netsuite)",
|
|
1293
|
-
values: [(
|
|
1294
|
+
values: [(V = g.netSuite) == null ? void 0 : V.refNo]
|
|
1294
1295
|
} : null
|
|
1295
1296
|
].filter((L) => L)
|
|
1296
1297
|
};
|
|
@@ -1298,35 +1299,35 @@ const Ot = {
|
|
|
1298
1299
|
return x.map((g) => {
|
|
1299
1300
|
switch (g.type) {
|
|
1300
1301
|
case "grn":
|
|
1301
|
-
return
|
|
1302
|
+
return O(g.doc);
|
|
1302
1303
|
case "fulfillment":
|
|
1303
|
-
return
|
|
1304
|
+
return P(g.doc);
|
|
1304
1305
|
}
|
|
1305
1306
|
});
|
|
1306
1307
|
}), h = X(() => {
|
|
1307
1308
|
var s;
|
|
1308
1309
|
const t = {
|
|
1309
|
-
|
|
1310
|
+
...qe(0),
|
|
1310
1311
|
currency: Ze()
|
|
1311
1312
|
};
|
|
1312
|
-
return ((s =
|
|
1313
|
-
...Ke(x,
|
|
1313
|
+
return ((s = u.purchaseOrder) == null ? void 0 : s.items.reduce((x, O) => ({
|
|
1314
|
+
...Ke(x, O.totalCost ?? t),
|
|
1314
1315
|
currency: Ze()
|
|
1315
1316
|
}), t)) ?? t;
|
|
1316
1317
|
});
|
|
1317
1318
|
return (t, s) => {
|
|
1318
|
-
var W,
|
|
1319
|
-
const x =
|
|
1320
|
-
return
|
|
1321
|
-
header: o(r)("inventory.transfer.receiveRequest.details.title") + ((W = t.purchaseOrder) != null && W.seqNumber ? ` #${(
|
|
1322
|
-
modelValue: o(
|
|
1323
|
-
"onUpdate:modelValue": s[11] || (s[11] = (
|
|
1319
|
+
var W, oe;
|
|
1320
|
+
const x = ue("FmButtonGroup"), O = ue("FmChip"), P = ue("FmMenuDivider"), C = ue("FmCard"), G = ue("FmIcon"), g = ue("FmTooltip"), w = ue("FmButton"), I = ue("FmSpacer"), V = ue("FmCircularProgress"), L = ue("FmSideSheet");
|
|
1321
|
+
return c(), te(L, {
|
|
1322
|
+
header: o(r)("inventory.transfer.receiveRequest.details.title") + ((W = t.purchaseOrder) != null && W.seqNumber ? ` #${(oe = t.purchaseOrder) == null ? void 0 : oe.seqNumber}` : ""),
|
|
1323
|
+
modelValue: o(J),
|
|
1324
|
+
"onUpdate:modelValue": s[11] || (s[11] = (le) => gt(J) ? J.value = le : null),
|
|
1324
1325
|
"dismiss-away": F.value,
|
|
1325
1326
|
"close-button": "",
|
|
1326
1327
|
"max-width": 600
|
|
1327
1328
|
}, {
|
|
1328
|
-
default:
|
|
1329
|
-
var
|
|
1329
|
+
default: _e(() => {
|
|
1330
|
+
var le, me, H, pe, Re, ke, De, Ne;
|
|
1330
1331
|
return [
|
|
1331
1332
|
e("div", Gt, [
|
|
1332
1333
|
e("div", null, [
|
|
@@ -1336,36 +1337,36 @@ const Ot = {
|
|
|
1336
1337
|
"onUpdate:modelValue": s[0] || (s[0] = (b) => z.value = b)
|
|
1337
1338
|
}, null, 8, ["items", "modelValue"])
|
|
1338
1339
|
]),
|
|
1339
|
-
z.value.value === "overview" ? (
|
|
1340
|
+
z.value.value === "overview" ? (c(), _(se, { key: 0 }, [
|
|
1340
1341
|
e("div", null, [
|
|
1341
|
-
B(
|
|
1342
|
+
B(C, {
|
|
1342
1343
|
variant: "outlined",
|
|
1343
1344
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1344
1345
|
}, {
|
|
1345
|
-
default:
|
|
1346
|
-
var b, A,
|
|
1346
|
+
default: _e(() => {
|
|
1347
|
+
var b, A, $, ie, ce, fe, ve, ye, Z, he, Ae, Te;
|
|
1347
1348
|
return [
|
|
1348
1349
|
e("div", Ht, [
|
|
1349
1350
|
e("div", zt, m(o(r)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
1350
1351
|
e("div", null, [
|
|
1351
|
-
B(
|
|
1352
|
+
B(O, {
|
|
1352
1353
|
label: o(r)(`inventory.transfer.status.${(b = t.purchaseOrder) == null ? void 0 : b.status}`),
|
|
1353
|
-
class:
|
|
1354
|
+
class: ge(`fm-status-badge fm-status-badge-${($ = (A = t.purchaseOrder) == null ? void 0 : A.status) == null ? void 0 : $.toLocaleLowerCase("en-us")}`),
|
|
1354
1355
|
compact: ""
|
|
1355
1356
|
}, null, 8, ["label", "class"])
|
|
1356
1357
|
])
|
|
1357
1358
|
]),
|
|
1358
|
-
B(
|
|
1359
|
+
B(P),
|
|
1359
1360
|
e("div", Qt, [
|
|
1360
1361
|
e("div", Yt, [
|
|
1361
1362
|
e("div", Wt, [
|
|
1362
1363
|
e("div", Xt, m(o(r)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1363
1364
|
]),
|
|
1364
|
-
e("div", Jt, m(o(Ee)(((
|
|
1365
|
+
e("div", Jt, m(o(Ee)(((ie = t.purchaseOrder) == null ? void 0 : ie._id) ?? "")), 1)
|
|
1365
1366
|
]),
|
|
1366
|
-
(
|
|
1367
|
+
(ce = t.purchaseOrder) != null && ce.effectiveAt ? (c(), _("div", Zt, [
|
|
1367
1368
|
e("div", es, m(o(r)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
1368
|
-
e("div", ts, m(o(rt)(new Date((
|
|
1369
|
+
e("div", ts, m(o(rt)(new Date((fe = t.purchaseOrder) == null ? void 0 : fe.effectiveAt))), 1)
|
|
1369
1370
|
])) : D("", !0),
|
|
1370
1371
|
e("div", ss, [
|
|
1371
1372
|
e("div", rs, m(o(r)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
@@ -1373,19 +1374,19 @@ const Ot = {
|
|
|
1373
1374
|
`inventory.transfer.receiveRequest.details.type.${a.value.toLocaleLowerCase("en-US")}`
|
|
1374
1375
|
)), 1)
|
|
1375
1376
|
]),
|
|
1376
|
-
(
|
|
1377
|
+
(ye = (ve = t.purchaseOrder) == null ? void 0 : ve.supplier) != null && ye.name ? (c(), _("div", ns, [
|
|
1377
1378
|
e("div", os, m(o(r)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1378
|
-
e("div", ls, m((
|
|
1379
|
+
e("div", ls, m((he = (Z = t.purchaseOrder) == null ? void 0 : Z.supplier) == null ? void 0 : he.name), 1)
|
|
1379
1380
|
])) : D("", !0),
|
|
1380
|
-
t.transferTo ? (
|
|
1381
|
+
t.transferTo ? (c(), _("div", is, [
|
|
1381
1382
|
e("div", cs, m(o(r)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
1382
1383
|
e("div", us, m(t.transferTo), 1)
|
|
1383
1384
|
])) : D("", !0),
|
|
1384
|
-
(Ae = t.purchaseOrder) != null && Ae.ref ? (
|
|
1385
|
+
(Ae = t.purchaseOrder) != null && Ae.ref ? (c(), _("div", ds, [
|
|
1385
1386
|
e("div", fs, m(o(r)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1386
1387
|
e("div", ms, m(t.purchaseOrder.ref), 1)
|
|
1387
1388
|
])) : D("", !0),
|
|
1388
|
-
(
|
|
1389
|
+
(Te = t.purchaseOrder) != null && Te.remark ? (c(), _("div", ps, [
|
|
1389
1390
|
e("div", vs, m(o(r)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1390
1391
|
e("div", ys, m(t.purchaseOrder.remark), 1)
|
|
1391
1392
|
])) : D("", !0)
|
|
@@ -1395,24 +1396,24 @@ const Ot = {
|
|
|
1395
1396
|
_: 1
|
|
1396
1397
|
})
|
|
1397
1398
|
]),
|
|
1398
|
-
|
|
1399
|
+
d.value ? D("", !0) : (c(), _("div", hs, [
|
|
1399
1400
|
e("div", gs, [
|
|
1400
1401
|
s[12] || (s[12] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
1401
1402
|
e("div", null, [
|
|
1402
1403
|
B(Kt, {
|
|
1403
1404
|
"po-request": t.poRequest,
|
|
1404
1405
|
"purchase-order": t.purchaseOrder,
|
|
1405
|
-
"is-transfer-between-outlets":
|
|
1406
|
+
"is-transfer-between-outlets": d.value
|
|
1406
1407
|
}, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets"])
|
|
1407
1408
|
])
|
|
1408
1409
|
]),
|
|
1409
|
-
B(
|
|
1410
|
+
B(P),
|
|
1410
1411
|
B(jt, {
|
|
1411
1412
|
"po-request": t.poRequest,
|
|
1412
1413
|
"purchase-order": t.purchaseOrder,
|
|
1413
1414
|
"transfer-type": a.value,
|
|
1414
1415
|
"transfer-to-db-name": t.transferToDbName,
|
|
1415
|
-
"is-transfer-between-outlets":
|
|
1416
|
+
"is-transfer-between-outlets": d.value,
|
|
1416
1417
|
scope: t.scope
|
|
1417
1418
|
}, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
|
|
1418
1419
|
])),
|
|
@@ -1421,31 +1422,31 @@ const Ot = {
|
|
|
1421
1422
|
e("div", Ss, [
|
|
1422
1423
|
e("span", ws, [
|
|
1423
1424
|
je(m(Le.value ? o(r)("inventory.transfer.receiveRequest.details.receivedItems") : o(r)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
|
|
1424
|
-
(
|
|
1425
|
+
(me = (le = t.purchaseOrder) == null ? void 0 : le.netSuite) != null && me.missingItems && ((pe = (H = t.purchaseOrder) == null ? void 0 : H.netSuite) == null ? void 0 : pe.missingItems.length) > 0 ? (c(), te(g, {
|
|
1425
1426
|
key: 0,
|
|
1426
1427
|
variant: "rich",
|
|
1427
1428
|
placement: "top",
|
|
1428
1429
|
"z-index": 51
|
|
1429
1430
|
}, {
|
|
1430
|
-
content:
|
|
1431
|
+
content: _e(() => {
|
|
1431
1432
|
var b, A;
|
|
1432
1433
|
return [
|
|
1433
1434
|
e("div", xs, [
|
|
1434
|
-
(
|
|
1435
|
+
(c(!0), _(se, null, Se((A = (b = t.purchaseOrder) == null ? void 0 : b.netSuite) == null ? void 0 : A.missingItems, ($, ie) => (c(), _("div", {
|
|
1435
1436
|
class: "flex justify-center align-middle",
|
|
1436
|
-
key:
|
|
1437
|
+
key: ie
|
|
1437
1438
|
}, [
|
|
1438
|
-
B(
|
|
1439
|
+
B(G, {
|
|
1439
1440
|
name: "arrow_right",
|
|
1440
1441
|
size: "sm"
|
|
1441
1442
|
}),
|
|
1442
|
-
je(" " + m(`(${
|
|
1443
|
+
je(" " + m(`(${$.netSuiteId}) ${$.name}: ${$.reason}`), 1)
|
|
1443
1444
|
]))), 128))
|
|
1444
1445
|
])
|
|
1445
1446
|
];
|
|
1446
1447
|
}),
|
|
1447
|
-
default:
|
|
1448
|
-
B(
|
|
1448
|
+
default: _e(() => [
|
|
1449
|
+
B(G, {
|
|
1449
1450
|
name: "error",
|
|
1450
1451
|
color: "#ff2c2c",
|
|
1451
1452
|
size: "sm"
|
|
@@ -1455,13 +1456,13 @@ const Ot = {
|
|
|
1455
1456
|
})) : D("", !0)
|
|
1456
1457
|
]),
|
|
1457
1458
|
e("div", null, [
|
|
1458
|
-
|
|
1459
|
+
Y.value && T.value != null && !((Re = T.value) != null && Re.length) ? (c(), te(w, {
|
|
1459
1460
|
key: 0,
|
|
1460
1461
|
label: "Return",
|
|
1461
1462
|
variant: "secondary",
|
|
1462
|
-
onClick: s[1] || (s[1] = (b) =>
|
|
1463
|
+
onClick: s[1] || (s[1] = (b) => ne("returnStock")),
|
|
1463
1464
|
loading: i.value === "returnStock",
|
|
1464
|
-
disabled: i.value !== "returnStock" &&
|
|
1465
|
+
disabled: i.value !== "returnStock" && l.value,
|
|
1465
1466
|
"prepend-icon": "undo",
|
|
1466
1467
|
"text-color": "primary",
|
|
1467
1468
|
"bg-color": "transparent",
|
|
@@ -1469,42 +1470,42 @@ const Ot = {
|
|
|
1469
1470
|
}, null, 8, ["loading", "disabled"])) : D("", !0)
|
|
1470
1471
|
])
|
|
1471
1472
|
]),
|
|
1472
|
-
B(
|
|
1473
|
-
(
|
|
1473
|
+
B(P),
|
|
1474
|
+
(c(!0), _(se, null, Se(((ke = t.purchaseOrder) == null ? void 0 : ke.items) ?? [], (b) => {
|
|
1474
1475
|
var A;
|
|
1475
|
-
return
|
|
1476
|
+
return c(), _("div", {
|
|
1476
1477
|
key: b.code,
|
|
1477
1478
|
class: "flex flex-col"
|
|
1478
1479
|
}, [
|
|
1479
|
-
e("div",
|
|
1480
|
-
e("div",
|
|
1481
|
-
e("div", ks, m(o(
|
|
1480
|
+
e("div", Os, [
|
|
1481
|
+
e("div", Rs, m(b.name), 1),
|
|
1482
|
+
e("div", ks, m(o(Oe)(Fe.value[b.sku._id], !1)) + "/" + m(o(Ge)(b.quantity, b.sku.unit, b.measurement)), 1)
|
|
1482
1483
|
]),
|
|
1483
1484
|
e("div", Ds, [
|
|
1484
1485
|
e("div", Ns, m(b.code), 1),
|
|
1485
|
-
(A = b.totalCost) != null && A.amount && o(
|
|
1486
|
+
(A = b.totalCost) != null && A.amount && o(E).enableTotalCost ? (c(), _("div", As, " (" + m(o($e)(b.totalCost)) + ") ", 1)) : D("", !0)
|
|
1486
1487
|
])
|
|
1487
1488
|
]);
|
|
1488
1489
|
}), 128)),
|
|
1489
|
-
+o(
|
|
1490
|
-
e("div", qs, [
|
|
1491
|
-
B(T)
|
|
1492
|
-
]),
|
|
1490
|
+
+o(Oe)(h.value) ? (c(), _(se, { key: 0 }, [
|
|
1493
1491
|
e("div", Ts, [
|
|
1492
|
+
B(P)
|
|
1493
|
+
]),
|
|
1494
|
+
e("div", $s, [
|
|
1494
1495
|
s[13] || (s[13] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
|
|
1495
|
-
e("div", Ps, m(o(
|
|
1496
|
+
e("div", Ps, m(o($e)(h.value)), 1)
|
|
1496
1497
|
])
|
|
1497
1498
|
], 64)) : D("", !0)
|
|
1498
1499
|
])
|
|
1499
1500
|
])
|
|
1500
|
-
], 64)) : z.value.value === "deliveryHistory" ? (
|
|
1501
|
-
y.value.length ? (
|
|
1502
|
-
(
|
|
1501
|
+
], 64)) : z.value.value === "deliveryHistory" ? (c(), _("div", Cs, [
|
|
1502
|
+
y.value.length ? (c(), _("div", Fs, [
|
|
1503
|
+
(c(!0), _(se, null, Se(y.value, (b, A) => (c(), _(se, { key: A }, [
|
|
1503
1504
|
e("div", Us, [
|
|
1504
1505
|
e("div", Bs, [
|
|
1505
1506
|
e("div", Ms, [
|
|
1506
1507
|
e("div", {
|
|
1507
|
-
class:
|
|
1508
|
+
class: ge([
|
|
1508
1509
|
{
|
|
1509
1510
|
"bg-fm-color-primary": A !== 0,
|
|
1510
1511
|
"bg-white": A === 0
|
|
@@ -1516,7 +1517,7 @@ const Ot = {
|
|
|
1516
1517
|
s[14] || (s[14] = e("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1517
1518
|
e("div", js, [
|
|
1518
1519
|
e("div", {
|
|
1519
|
-
class:
|
|
1520
|
+
class: ge([
|
|
1520
1521
|
{
|
|
1521
1522
|
"bg-fm-color-primary": A < y.value.length - 1,
|
|
1522
1523
|
"bg-white": A >= y.value.length - 1
|
|
@@ -1535,7 +1536,7 @@ const Ot = {
|
|
|
1535
1536
|
e("div", zs, [
|
|
1536
1537
|
e("div", Qs, [
|
|
1537
1538
|
e("div", {
|
|
1538
|
-
class:
|
|
1539
|
+
class: ge([
|
|
1539
1540
|
{
|
|
1540
1541
|
"bg-fm-color-primary": A < y.value.length - 1,
|
|
1541
1542
|
"bg-white": A >= y.value.length - 1
|
|
@@ -1546,25 +1547,25 @@ const Ot = {
|
|
|
1546
1547
|
])
|
|
1547
1548
|
]),
|
|
1548
1549
|
e("div", Ys, [
|
|
1549
|
-
B(
|
|
1550
|
+
B(C, {
|
|
1550
1551
|
variant: "outlined",
|
|
1551
1552
|
class: "py-12 px-16"
|
|
1552
1553
|
}, {
|
|
1553
|
-
default:
|
|
1554
|
+
default: _e(() => [
|
|
1554
1555
|
e("div", Ws, [
|
|
1555
|
-
(
|
|
1556
|
-
key:
|
|
1556
|
+
(c(!0), _(se, null, Se(b.info, ($, ie) => (c(), _("div", {
|
|
1557
|
+
key: ie,
|
|
1557
1558
|
class: "flex flex-col gap-4"
|
|
1558
1559
|
}, [
|
|
1559
|
-
e("div", Xs, m(
|
|
1560
|
+
e("div", Xs, m($ == null ? void 0 : $.label), 1),
|
|
1560
1561
|
e("div", Js, [
|
|
1561
|
-
(
|
|
1562
|
-
key:
|
|
1562
|
+
(c(!0), _(se, null, Se($ == null ? void 0 : $.values, (ce, fe) => (c(), _("div", {
|
|
1563
|
+
key: fe,
|
|
1563
1564
|
class: "fm-typo-en-body-lg-600"
|
|
1564
1565
|
}, [
|
|
1565
|
-
typeof
|
|
1566
|
-
je(m(
|
|
1567
|
-
], 64)) : (
|
|
1566
|
+
typeof ce == "string" ? (c(), _(se, { key: 0 }, [
|
|
1567
|
+
je(m(ce), 1)
|
|
1568
|
+
], 64)) : (c(), te(bt(ce), { key: 1 }))
|
|
1568
1569
|
]))), 128))
|
|
1569
1570
|
])
|
|
1570
1571
|
]))), 128))
|
|
@@ -1575,7 +1576,7 @@ const Ot = {
|
|
|
1575
1576
|
])
|
|
1576
1577
|
])
|
|
1577
1578
|
], 64))), 128))
|
|
1578
|
-
])) : (
|
|
1579
|
+
])) : (c(), _("div", qs, [
|
|
1579
1580
|
B(I),
|
|
1580
1581
|
e("div", null, [
|
|
1581
1582
|
e("img", {
|
|
@@ -1588,20 +1589,20 @@ const Ot = {
|
|
|
1588
1589
|
B(I),
|
|
1589
1590
|
B(I)
|
|
1590
1591
|
]))
|
|
1591
|
-
])) : z.value.value === "returns" &&
|
|
1592
|
-
|
|
1592
|
+
])) : z.value.value === "returns" && Y.value ? (c(), _("div", Zs, [
|
|
1593
|
+
re.value ? (c(), _("div", er, [
|
|
1593
1594
|
s[15] || (s[15] = e("div", { class: "h-80" }, null, -1)),
|
|
1594
|
-
B(
|
|
1595
|
+
B(V),
|
|
1595
1596
|
s[16] || (s[16] = e("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, "Loading...", -1))
|
|
1596
|
-
])) : (De =
|
|
1597
|
-
(
|
|
1597
|
+
])) : (De = T.value) != null && De.length ? (c(), _("div", nr, [
|
|
1598
|
+
(c(!0), _(se, null, Se(T.value, (b, A) => (c(), _(se, {
|
|
1598
1599
|
key: b._id
|
|
1599
1600
|
}, [
|
|
1600
1601
|
e("div", or, [
|
|
1601
1602
|
e("div", lr, [
|
|
1602
1603
|
e("div", ir, [
|
|
1603
1604
|
e("div", {
|
|
1604
|
-
class:
|
|
1605
|
+
class: ge([
|
|
1605
1606
|
{
|
|
1606
1607
|
"bg-fm-color-primary": A !== 0,
|
|
1607
1608
|
"bg-white": A === 0
|
|
@@ -1613,10 +1614,10 @@ const Ot = {
|
|
|
1613
1614
|
s[19] || (s[19] = e("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1614
1615
|
e("div", cr, [
|
|
1615
1616
|
e("div", {
|
|
1616
|
-
class:
|
|
1617
|
+
class: ge([
|
|
1617
1618
|
{
|
|
1618
|
-
"bg-fm-color-primary": A <
|
|
1619
|
-
"bg-white": A >=
|
|
1619
|
+
"bg-fm-color-primary": A < T.value.length - 1,
|
|
1620
|
+
"bg-white": A >= T.value.length - 1
|
|
1620
1621
|
},
|
|
1621
1622
|
"w-[2px] h-full"
|
|
1622
1623
|
])
|
|
@@ -1629,7 +1630,7 @@ const Ot = {
|
|
|
1629
1630
|
e("span", null, " Return #" + m(b.seqNumber), 1),
|
|
1630
1631
|
e("span", mr, [
|
|
1631
1632
|
e("span", {
|
|
1632
|
-
class:
|
|
1633
|
+
class: ge(`fm-status-badge fm-status-badge-${`${b.status}`.toLocaleLowerCase("en-us")}`)
|
|
1633
1634
|
}, m(o(r)(`inventory.transfer.status.${b.status}`)), 3)
|
|
1634
1635
|
])
|
|
1635
1636
|
]),
|
|
@@ -1643,22 +1644,22 @@ const Ot = {
|
|
|
1643
1644
|
"text-color": "primary",
|
|
1644
1645
|
"bg-color": "transparent",
|
|
1645
1646
|
"border-color": "primary",
|
|
1646
|
-
onClick: (
|
|
1647
|
-
var
|
|
1647
|
+
onClick: ($) => {
|
|
1648
|
+
var ie, ce, fe, ve, ye, Z, he, Ae, Te;
|
|
1648
1649
|
return o(lt)(
|
|
1649
1650
|
{
|
|
1650
1651
|
...b,
|
|
1651
1652
|
ref: [
|
|
1652
1653
|
b.ref,
|
|
1653
|
-
(
|
|
1654
|
+
(ce = (ie = M.value[b._id]) == null ? void 0 : ie.netSuite) != null && ce.refNo ? `Netsuite ${(ve = (fe = M.value[b._id]) == null ? void 0 : fe.netSuite) == null ? void 0 : ve.refNo} (${(Z = (ye = M.value[b._id]) == null ? void 0 : ye.netSuite) == null ? void 0 : Z.id})` : ""
|
|
1654
1655
|
].filter((Ue) => Ue == null ? void 0 : Ue.trim()).join()
|
|
1655
1656
|
},
|
|
1656
1657
|
{
|
|
1657
1658
|
doc: {
|
|
1658
1659
|
profile: {
|
|
1659
|
-
name: (
|
|
1660
|
+
name: (he = t.purchaseOrder) == null ? void 0 : he.supplier.name,
|
|
1660
1661
|
address: (Ae = t.purchaseOrder) == null ? void 0 : Ae.supplier.address,
|
|
1661
|
-
regNo: (
|
|
1662
|
+
regNo: (Te = t.purchaseOrder) == null ? void 0 : Te.supplier.registrationNumber
|
|
1662
1663
|
}
|
|
1663
1664
|
}
|
|
1664
1665
|
}
|
|
@@ -1672,10 +1673,10 @@ const Ot = {
|
|
|
1672
1673
|
e("div", hr, [
|
|
1673
1674
|
e("div", gr, [
|
|
1674
1675
|
e("div", {
|
|
1675
|
-
class:
|
|
1676
|
+
class: ge([
|
|
1676
1677
|
{
|
|
1677
|
-
"bg-fm-color-primary": A <
|
|
1678
|
-
"bg-white": A >=
|
|
1678
|
+
"bg-fm-color-primary": A < T.value.length - 1,
|
|
1679
|
+
"bg-white": A >= T.value.length - 1
|
|
1679
1680
|
},
|
|
1680
1681
|
"w-[2px] h-full"
|
|
1681
1682
|
])
|
|
@@ -1683,35 +1684,35 @@ const Ot = {
|
|
|
1683
1684
|
])
|
|
1684
1685
|
]),
|
|
1685
1686
|
e("div", br, [
|
|
1686
|
-
B(
|
|
1687
|
+
B(C, {
|
|
1687
1688
|
variant: "outlined",
|
|
1688
1689
|
class: "py-12 px-16"
|
|
1689
1690
|
}, {
|
|
1690
|
-
default:
|
|
1691
|
-
var
|
|
1691
|
+
default: _e(() => {
|
|
1692
|
+
var $, ie, ce, fe, ve, ye;
|
|
1692
1693
|
return [
|
|
1693
1694
|
e("div", _r, [
|
|
1694
|
-
(
|
|
1695
|
+
(ie = ($ = M.value[b._id]) == null ? void 0 : $.netSuite) != null && ie.id ? (c(), _(se, { key: 0 }, [
|
|
1695
1696
|
e("div", Sr, [
|
|
1696
1697
|
s[20] || (s[20] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Netsuite transfer order (ID) ", -1)),
|
|
1697
|
-
e("div", wr, m((
|
|
1698
|
+
e("div", wr, m((fe = (ce = M.value[b._id]) == null ? void 0 : ce.netSuite) == null ? void 0 : fe.refNo) + " (" + m((ye = (ve = M.value[b._id]) == null ? void 0 : ve.netSuite) == null ? void 0 : ye.id) + ") ", 1)
|
|
1698
1699
|
]),
|
|
1699
|
-
B(
|
|
1700
|
+
B(P)
|
|
1700
1701
|
], 64)) : D("", !0),
|
|
1701
1702
|
s[21] || (s[21] = e("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Returning items ", -1)),
|
|
1702
|
-
(
|
|
1703
|
-
var
|
|
1704
|
-
return
|
|
1705
|
-
key:
|
|
1703
|
+
(c(!0), _(se, null, Se((b == null ? void 0 : b.items) ?? [], (Z) => {
|
|
1704
|
+
var he;
|
|
1705
|
+
return c(), _("div", {
|
|
1706
|
+
key: Z.code,
|
|
1706
1707
|
class: "flex flex-col"
|
|
1707
1708
|
}, [
|
|
1708
1709
|
e("div", xr, [
|
|
1709
|
-
e("div",
|
|
1710
|
-
e("div",
|
|
1710
|
+
e("div", Or, m(Z.name), 1),
|
|
1711
|
+
e("div", Rr, m(o(Ge)(Z.quantity, Z.sku.unit, Z.measurement)), 1)
|
|
1711
1712
|
]),
|
|
1712
1713
|
e("div", kr, [
|
|
1713
|
-
e("div", Dr, m(
|
|
1714
|
-
(
|
|
1714
|
+
e("div", Dr, m(Z.code), 1),
|
|
1715
|
+
(he = Z.totalCost) != null && he.amount && o(E).enableTotalCost ? (c(), _("div", Nr, " (" + m(o($e)(Z.totalCost)) + ") ", 1)) : D("", !0)
|
|
1715
1716
|
])
|
|
1716
1717
|
]);
|
|
1717
1718
|
}), 128))
|
|
@@ -1723,7 +1724,7 @@ const Ot = {
|
|
|
1723
1724
|
])
|
|
1724
1725
|
])
|
|
1725
1726
|
], 64))), 128))
|
|
1726
|
-
])) : (
|
|
1727
|
+
])) : (c(), _("div", tr, [
|
|
1727
1728
|
s[17] || (s[17] = e("div", { class: "h-80" }, null, -1)),
|
|
1728
1729
|
e("div", null, [
|
|
1729
1730
|
e("img", {
|
|
@@ -1734,13 +1735,13 @@ const Ot = {
|
|
|
1734
1735
|
e("div", rr, m(o(r)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
1735
1736
|
s[18] || (s[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
1737
|
e("div", ar, [
|
|
1737
|
-
|
|
1738
|
+
Y.value && T.value != null && !((Ne = T.value) != null && Ne.length) ? (c(), te(w, {
|
|
1738
1739
|
key: 0,
|
|
1739
1740
|
label: "Create return request",
|
|
1740
1741
|
variant: "secondary",
|
|
1741
|
-
onClick: s[2] || (s[2] = (b) =>
|
|
1742
|
+
onClick: s[2] || (s[2] = (b) => ne("returnStock")),
|
|
1742
1743
|
loading: i.value === "returnStock",
|
|
1743
|
-
disabled: i.value !== "returnStock" &&
|
|
1744
|
+
disabled: i.value !== "returnStock" && l.value,
|
|
1744
1745
|
"prepend-icon": "undo",
|
|
1745
1746
|
"text-color": "primary",
|
|
1746
1747
|
"bg-color": "transparent",
|
|
@@ -1752,66 +1753,66 @@ const Ot = {
|
|
|
1752
1753
|
])
|
|
1753
1754
|
];
|
|
1754
1755
|
}),
|
|
1755
|
-
"side-sheet-footer":
|
|
1756
|
-
var
|
|
1756
|
+
"side-sheet-footer": _e(() => {
|
|
1757
|
+
var le, me, H, pe, Re, ke, De, Ne, b, A;
|
|
1757
1758
|
return [
|
|
1758
1759
|
e("div", Ar, [
|
|
1759
|
-
((
|
|
1760
|
+
((le = t.purchaseOrder) == null ? void 0 : le.status) === o(j).enum.DRAFT && a.value === o(be).PURCHASE ? (c(), te(w, {
|
|
1760
1761
|
key: 0,
|
|
1761
1762
|
label: o(r)("inventory.transfer.receiveRequest.actions.confirmDraft"),
|
|
1762
|
-
onClick: s[3] || (s[3] = (
|
|
1763
|
+
onClick: s[3] || (s[3] = ($) => ne("confirmDraft")),
|
|
1763
1764
|
loading: i.value === "confirmDraft",
|
|
1764
|
-
disabled: i.value !== "confirmDraft" &&
|
|
1765
|
+
disabled: i.value !== "confirmDraft" && l.value
|
|
1765
1766
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1766
|
-
((
|
|
1767
|
+
((me = t.purchaseOrder) == null ? void 0 : me.status) === o(j).enum.DRAFT && a.value === o(be).TRANSFER ? (c(), te(w, {
|
|
1767
1768
|
key: 1,
|
|
1768
1769
|
label: o(r)("inventory.transfer.receiveRequest.actions.submitRequest"),
|
|
1769
|
-
onClick: s[4] || (s[4] = (
|
|
1770
|
+
onClick: s[4] || (s[4] = ($) => ne("submitRequest")),
|
|
1770
1771
|
loading: i.value === "submitRequest",
|
|
1771
|
-
disabled: i.value !== "submitRequest" &&
|
|
1772
|
+
disabled: i.value !== "submitRequest" && l.value
|
|
1772
1773
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1773
|
-
((
|
|
1774
|
+
((H = t.purchaseOrder) == null ? void 0 : H.status) === o(j).enum.DRAFT ? (c(), te(w, {
|
|
1774
1775
|
key: 2,
|
|
1775
1776
|
label: o(r)("inventory.transfer.receiveRequest.actions.cancelDraft"),
|
|
1776
|
-
onClick: s[5] || (s[5] = (
|
|
1777
|
+
onClick: s[5] || (s[5] = ($) => ne("cancelDraft")),
|
|
1777
1778
|
loading: i.value === "cancelDraft",
|
|
1778
|
-
disabled: i.value !== "cancelDraft" &&
|
|
1779
|
+
disabled: i.value !== "cancelDraft" && l.value,
|
|
1779
1780
|
variant: "destructive"
|
|
1780
1781
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1781
|
-
((
|
|
1782
|
+
((pe = t.purchaseOrder) == null ? void 0 : pe.status) === o(j).enum.RECEIVING ? (c(), te(w, {
|
|
1782
1783
|
key: 3,
|
|
1783
1784
|
label: o(r)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
1784
|
-
onClick: s[6] || (s[6] = (
|
|
1785
|
+
onClick: s[6] || (s[6] = ($) => ne("completeReceive")),
|
|
1785
1786
|
loading: i.value === "completeReceive",
|
|
1786
|
-
disabled: i.value !== "completeReceive" &&
|
|
1787
|
+
disabled: i.value !== "completeReceive" && l.value
|
|
1787
1788
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1788
|
-
t.canResubmit ? (
|
|
1789
|
+
t.canResubmit ? (c(), te(w, {
|
|
1789
1790
|
key: 4,
|
|
1790
1791
|
label: o(r)("inventory.transfer.receiveRequest.actions.resubmitRequest"),
|
|
1791
|
-
onClick: s[7] || (s[7] = (
|
|
1792
|
+
onClick: s[7] || (s[7] = ($) => ne("submitRequest")),
|
|
1792
1793
|
loading: i.value === "submitRequest",
|
|
1793
|
-
disabled: i.value !== "submitRequest" &&
|
|
1794
|
+
disabled: i.value !== "submitRequest" && l.value
|
|
1794
1795
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1795
|
-
(((
|
|
1796
|
+
(((Re = t.purchaseOrder) == null ? void 0 : Re.status) === o(j).enum.REQUESTING || ((ke = t.purchaseOrder) == null ? void 0 : ke.status) === o(j).enum.PROCESSING) && t.canApprove ? (c(), te(w, {
|
|
1796
1797
|
key: 5,
|
|
1797
1798
|
label: o(r)("inventory.transfer.approval.actions.approveRequest"),
|
|
1798
|
-
onClick: s[8] || (s[8] = (
|
|
1799
|
+
onClick: s[8] || (s[8] = ($) => ne("approveRequest")),
|
|
1799
1800
|
loading: i.value === "approveRequest",
|
|
1800
|
-
disabled: i.value !== "approveRequest" &&
|
|
1801
|
+
disabled: i.value !== "approveRequest" && l.value
|
|
1801
1802
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1802
|
-
((De = t.purchaseOrder) == null ? void 0 : De.status) === o(
|
|
1803
|
+
((De = t.purchaseOrder) == null ? void 0 : De.status) === o(j).enum.REQUESTING && t.canApprove ? (c(), te(w, {
|
|
1803
1804
|
key: 6,
|
|
1804
1805
|
label: o(r)("inventory.transfer.approval.actions.rejectRequest"),
|
|
1805
|
-
onClick: s[9] || (s[9] = (
|
|
1806
|
+
onClick: s[9] || (s[9] = ($) => ne("rejectRequest")),
|
|
1806
1807
|
loading: i.value === "rejectRequest",
|
|
1807
|
-
disabled: i.value !== "rejectRequest" &&
|
|
1808
|
+
disabled: i.value !== "rejectRequest" && l.value,
|
|
1808
1809
|
variant: "destructive"
|
|
1809
1810
|
}, null, 8, ["label", "loading", "disabled"])) : D("", !0),
|
|
1810
|
-
((Ne = t.purchaseOrder) == null ? void 0 : Ne.status) !== o(
|
|
1811
|
+
((Ne = t.purchaseOrder) == null ? void 0 : Ne.status) !== o(j).enum.COMPLETE && ((b = t.purchaseOrder) == null ? void 0 : b.status) !== o(j).enum.CANCEL && (((A = t.purchaseOrder) == null ? void 0 : A.status) !== o(j).enum.REQUESTING || t.canApprove) ? (c(), te(w, {
|
|
1811
1812
|
key: 7,
|
|
1812
1813
|
label: o(r)("common.close"),
|
|
1813
1814
|
variant: "tertiary",
|
|
1814
|
-
onClick: s[10] || (s[10] = (
|
|
1815
|
+
onClick: s[10] || (s[10] = ($) => n("update:show", !1))
|
|
1815
1816
|
}, null, 8, ["label"])) : D("", !0)
|
|
1816
1817
|
])
|
|
1817
1818
|
];
|
|
@@ -1826,6 +1827,6 @@ export {
|
|
|
1826
1827
|
Br as _,
|
|
1827
1828
|
Fr as a,
|
|
1828
1829
|
Ur as b,
|
|
1829
|
-
|
|
1830
|
+
Ot as g,
|
|
1830
1831
|
Xe as u
|
|
1831
1832
|
};
|