@feedmepos/mf-inventory-portal 1.2.48 → 1.2.49
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-DPGaFV4B.js → App-w_Dbl-jn.js} +3 -3
- package/dist/{ApprovalView-833HS5kH.js → ApprovalView-CuOM9Ych.js} +5 -5
- package/dist/{BindingsDialog-ChODu5A1.js → BindingsDialog-DkMSnr51.js} +2 -2
- package/dist/{BindingsPicker-DvX4GyKv.js → BindingsPicker-DrXdWUTh.js} +2 -2
- package/dist/{BindingsTable-DNAiQ3jC.js → BindingsTable-Bj0eBYdU.js} +3 -3
- package/dist/{ClosingDraftView-BNmLpJEn.js → ClosingDraftView-D1oohB8Y.js} +9 -9
- package/dist/{ClosingHistoryView-BWCsFzL4.js → ClosingHistoryView-BCYNhLDg.js} +3 -3
- package/dist/{ClosingTemplateView-oZwROzRq.js → ClosingTemplateView-DIvZkCgT.js} +14 -14
- package/dist/{DeliveryOrderPrintPreview-CgF6Ah_t.js → DeliveryOrderPrintPreview-C83_a-LI.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-COu3S25S.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bmas1qkC.js} +4 -4
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Br-AzVal.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CQ_Er40u.js} +2 -2
- package/dist/{FmMultiselectDialog-nOXJfHcT.js → FmMultiselectDialog-BtvZkE6p.js} +1 -1
- package/dist/{FmMultiselectDialog-BcnuMvBx.js → FmMultiselectDialog-IU5C9o_F.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-B0TLNBD_.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BN9OeQF3.js} +3 -3
- package/dist/{ImportView-DiCAaSmP.js → ImportView-CRdvYxW3.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CjzJ3O5a.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-D6J1wcU6.js} +1 -1
- package/dist/{IngredientGroupView-DJ_gq48z.js → IngredientGroupView-DCdnjh-f.js} +5 -5
- package/dist/{IngredientsView-B2tdcbaR.js → IngredientsView-DhZadYV8.js} +14 -14
- package/dist/{IntegrationView-siGNamS4.js → IntegrationView-B_D6Sgj-.js} +12 -12
- package/dist/{InventoryBindingForm-CMH2losI.js → InventoryBindingForm-CM47I9t9.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-D68w7k0f.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BYKUWI9e.js} +4 -4
- package/dist/{InventoryBindingSummary-DAGsx_Mo.js → InventoryBindingSummary-BSuJMrFU.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cyl5cUO6.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-9TTwcC8s.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CNze8ZJ7.js → PremiumBadge.vue_vue_type_script_setup_true_lang-D2vWMBZF.js} +2 -2
- package/dist/{PublishView-D1AKbuKs.js → PublishView-DxhE5g9_.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-BzGcJK1f.js → PurchaseOrderPrintPreview-BzIwRI7z.js} +1 -1
- package/dist/{ReceiveRequestView-hvDCU729.js → ReceiveRequestView-C5wqi0jE.js} +18 -18
- package/dist/{RecipeView-BcnjGf_a.js → RecipeView-Azx2MoPR.js} +8 -8
- package/dist/{StockView-DdgYT4_P.js → StockView-D51RBHWQ.js} +15 -15
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DRPzgTm4.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-R0yauCbz.js} +1 -1
- package/dist/{SupplierView-LRNOgWQk.js → SupplierView-BeHjJ0xJ.js} +11 -11
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CQJJ3XRC.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DG1p3Rim.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-KBs8Dq8C.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-cPIomfPb.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-bP-1-mLN.js → TransferDetails.vue_vue_type_script_setup_true_lang-BZR_EozX.js} +994 -995
- package/dist/{TransferTemplateView-Dp2W2doS.js → TransferTemplateView-BwdhVKO4.js} +15 -15
- package/dist/{UnitView-N5l93VfY.js → UnitView-BT23dBtV.js} +6 -6
- package/dist/{WarehouseView-D7FGBKUP.js → WarehouseView-PWigQlHk.js} +5 -5
- package/dist/{WastageTemplateView-BmSNPRPI.js → WastageTemplateView-BGO19Pux.js} +14 -14
- package/dist/{app-CfCaSzjl.js → app-C0a15lwm.js} +23036 -14497
- package/dist/app.d.ts +1133 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-CJ4VCKvB.js → closing-template-C9jSN68K.js} +1 -1
- package/dist/{date2-BcmOfaME.js → date2-DND2dkpu.js} +1 -1
- package/dist/{dayjs.min-CiFpY16f.js → dayjs.min-CvewwBuM.js} +1 -1
- package/dist/{decimal-DtLL5qsA.js → decimal-C11049RC.js} +2 -2
- package/dist/{defineDeepModel-DBV1M6fx.js → defineDeepModel-BYmk9G2K.js} +1 -1
- package/dist/{duplicate-template-DjhY01M8.js → duplicate-template-CJLrmGdo.js} +1 -1
- package/dist/{feature-0OR7WTHu.js → feature-D2GGGVQh.js} +1411 -1262
- package/dist/{format-time-from-id-DATUhiz_.js → format-time-from-id-DuUqVP8F.js} +1 -1
- package/dist/{format-unit-display-9qQdeD4R.js → format-unit-display-BwBGMuCk.js} +10 -10
- package/dist/{import-export.helper-isWO7OKw.js → import-export.helper-ejk_vT2V.js} +5 -5
- package/dist/{index-CG0HXAUt.js → index-C9F5LU0v.js} +3 -3
- package/dist/{index-YLMXpUuG.js → index-Cy-YW3O0.js} +1 -1
- package/dist/{index-BvtrCC8o.js → index-D65a-5cn.js} +1 -1
- package/dist/locales/ja/common.json +7 -0
- package/dist/{lodash-D1GaTimh.js → lodash-DNLSknxF.js} +1 -1
- package/dist/{netsuite-C3C6Uju7.js → netsuite-TqUeqkqw.js} +3 -3
- package/dist/{purchase-order-template-C8k-zHLA.js → purchase-order-template-C7J9I7o4.js} +1 -1
- package/dist/{rules-DCfupVMX.js → rules-DQNuaKK6.js} +3 -3
- package/dist/{stock-AXiQCAeU.js → stock-1aynIWpi.js} +3 -3
- package/dist/{stock-BwYeYuFG.js → stock-bYU0NTHD.js} +1 -1
- package/dist/{supplier-p9r9OqFz.js → supplier-B72SAF3j.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-Cpmsu92V.js → use-ingredient-select-dialog-DO20RWUv.js} +2 -2
- package/dist/{use-inventory-binding-dialog-BPm1TXkw.js → use-inventory-binding-dialog-R2VQakMR.js} +2 -2
- package/dist/{use-template-enabled-locations-2-Batk5Jq7.js → use-template-enabled-locations-2-C7L_vyIF.js} +2 -2
- package/dist/{vue-i18n-Xu3ISvbS.js → vue-i18n-BLzLoy1U.js} +401 -401
- package/dist/{xlsx-DTdVIUTe.js → xlsx-DZcSBj-s.js} +1 -1
- package/dist/{xlsx.util-twnxgS4l.js → xlsx.util-DMCjqrHn.js} +1 -1
- package/package.json +2 -2
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { p as
|
|
2
|
-
import { ref as J, computed as Y, h as L, defineComponent as $e, reactive as
|
|
1
|
+
import { p as Ct, f as We } from "./format-time-from-id-DuUqVP8F.js";
|
|
2
|
+
import { ref as J, computed as Y, h as L, defineComponent as $e, reactive as Rt, onMounted as yt, resolveComponent as H, openBlock as l, createBlock as re, withCtx as ee, createElementVNode as e, createVNode as D, unref as v, createElementBlock as h, toDisplayString as y, createCommentVNode as U, Fragment as de, renderList as xe, createTextVNode as ke, normalizeClass as Me, watch as kt, isRef as Dt, resolveDynamicComponent as At } from "vue";
|
|
3
3
|
import { c as mt } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
|
|
4
4
|
import { R as ye, D as Se } from "./row-action.enum-BcW_L_nE.js";
|
|
5
|
-
import { o as
|
|
6
|
-
import { l as
|
|
7
|
-
import { F as
|
|
8
|
-
import { t as
|
|
9
|
-
import { u as Ue, F as
|
|
5
|
+
import { o as Nt, u as De, W as M, X as Ze, M as se, D as Ft, c as vt, v as it, Y as bt, t as Ge, J as Ce, A as Ye, s as qe, B as Pe } from "./app-C0a15lwm.js";
|
|
6
|
+
import { l as ht, d as gt, a as he, t as Qe, e as Ke } from "./rules-DQNuaKK6.js";
|
|
7
|
+
import { F as Tt } from "./decimal-C11049RC.js";
|
|
8
|
+
import { t as It, c as Pt, h as _t, a as He } from "./date2-DND2dkpu.js";
|
|
9
|
+
import { u as Ue, F as qt, a as st } from "./feature-D2GGGVQh.js";
|
|
10
10
|
import { useCoreStore as ct, useI18n as ut } from "@feedmepos/mf-common";
|
|
11
|
-
import { u as et, a as dt, S as we } from "./netsuite-
|
|
12
|
-
import { useDialog as tt, useSnackbar as Be, components as Je, FmButtonVariant as
|
|
13
|
-
import { F as
|
|
14
|
-
import { E as
|
|
15
|
-
import { u as
|
|
16
|
-
import { u as je, _ as
|
|
17
|
-
import { _ as
|
|
18
|
-
import { u as
|
|
19
|
-
import { c as
|
|
20
|
-
import { i as
|
|
11
|
+
import { u as et, a as dt, S as we } from "./netsuite-TqUeqkqw.js";
|
|
12
|
+
import { useDialog as tt, useSnackbar as Be, components as Je, FmButtonVariant as ge, useProxiedModel as Vt } from "@feedmepos/ui-library";
|
|
13
|
+
import { F as Ve } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
|
|
14
|
+
import { E as Et } from "./empty-placeholder-wf6-BWE8.js";
|
|
15
|
+
import { u as Lt, a as Mt, f as Ut } from "./format-unit-display-BwBGMuCk.js";
|
|
16
|
+
import { u as je, _ as Bt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-DG1p3Rim.js";
|
|
17
|
+
import { _ as jt, a as zt, b as Kt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BN9OeQF3.js";
|
|
18
|
+
import { u as Gt, R as pt } from "./usePromise-CbVUCxhj.js";
|
|
19
|
+
import { c as Ht } from "./index-C9F5LU0v.js";
|
|
20
|
+
import { i as Wt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CQ_Er40u.js";
|
|
21
21
|
import { F as ft } from "./form-mode.enum-BKiNVH6A.js";
|
|
22
|
-
import { d as St } from "./defineDeepModel-
|
|
23
|
-
import { u as
|
|
24
|
-
const
|
|
22
|
+
import { d as St } from "./defineDeepModel-BYmk9G2K.js";
|
|
23
|
+
import { u as Yt } from "./vue-i18n-BLzLoy1U.js";
|
|
24
|
+
const Qt = Nt((C, a) => {
|
|
25
25
|
const o = De();
|
|
26
26
|
return {
|
|
27
27
|
async getShipments({
|
|
28
28
|
start: f,
|
|
29
|
-
end:
|
|
29
|
+
end: b
|
|
30
30
|
}) {
|
|
31
|
-
const n = o.currentLocationDBName,
|
|
32
|
-
return await a.get(`${
|
|
31
|
+
const n = o.currentLocationDBName, A = `${C.inventoryBackendUrl}/${n}/shipments`;
|
|
32
|
+
return await a.get(`${A}?start=${f}&end=${b}`);
|
|
33
33
|
},
|
|
34
34
|
async getShipmentsByIds(f) {
|
|
35
35
|
if (f.length === 0)
|
|
36
36
|
return [];
|
|
37
|
-
const
|
|
37
|
+
const b = o.currentLocationDBName, n = `${C.inventoryBackendUrl}/${b}/shipments/get`;
|
|
38
38
|
return await a.post(n, { shipmentIds: f });
|
|
39
39
|
}
|
|
40
40
|
};
|
|
@@ -111,7 +111,7 @@ function Xe(C) {
|
|
|
111
111
|
purchaseOrder: C
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Jt(C) {
|
|
115
115
|
return Ze.validatePOItemReceivedStatus({
|
|
116
116
|
dto: C
|
|
117
117
|
});
|
|
@@ -122,9 +122,9 @@ function nt(C) {
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
function at(C, a, o) {
|
|
125
|
-
if (!
|
|
125
|
+
if (!se.safeParse(C).success)
|
|
126
126
|
throw new Error(`Invalid purchase order status: ${C}`);
|
|
127
|
-
const f =
|
|
127
|
+
const f = se.parse(C);
|
|
128
128
|
return Ze.orderStatusCombination({
|
|
129
129
|
status: f,
|
|
130
130
|
isPOPartialReceive: a,
|
|
@@ -133,46 +133,46 @@ function at(C, a, o) {
|
|
|
133
133
|
}
|
|
134
134
|
function Ot() {
|
|
135
135
|
const C = De(), a = je(), o = Ue();
|
|
136
|
-
async function f(n,
|
|
137
|
-
const
|
|
138
|
-
return n.doc.supplier.internal && n.operation === M.enum.confirmDraft && (n.operation = M.enum.submitRequest), await a.processPurchaseOrder(n,
|
|
136
|
+
async function f(n, A) {
|
|
137
|
+
const t = C.currentLocationDBName;
|
|
138
|
+
return n.doc.supplier.internal && n.operation === M.enum.confirmDraft && (n.operation = M.enum.submitRequest), await a.processPurchaseOrder(n, A || t);
|
|
139
139
|
}
|
|
140
|
-
async function
|
|
141
|
-
const
|
|
142
|
-
return await a.processPurchaseOrderV2(n,
|
|
140
|
+
async function b(n, A) {
|
|
141
|
+
const t = C.currentLocationDBName;
|
|
142
|
+
return await a.processPurchaseOrderV2(n, A || t);
|
|
143
143
|
}
|
|
144
|
-
return (n) => o.useOperatePurchaseOrderV2 ?
|
|
144
|
+
return (n) => o.useOperatePurchaseOrderV2 ? b(n.operateV2, n.transferTo) : f(n.operate, n.transferTo);
|
|
145
145
|
}
|
|
146
146
|
var lt = /* @__PURE__ */ ((C) => (C.RECEIVE_REQUEST = "receive/request", C.APPROVAL = "approval", C))(lt || {});
|
|
147
147
|
const ze = J(), rt = J();
|
|
148
148
|
function Yn(C, a) {
|
|
149
|
-
const o = tt(), f = De(),
|
|
149
|
+
const o = tt(), f = De(), b = Ue();
|
|
150
150
|
et();
|
|
151
|
-
const n =
|
|
152
|
-
a != null && a.startDate && (a != null && a.endDate) ? a :
|
|
153
|
-
),
|
|
154
|
-
const B = new Date(
|
|
151
|
+
const n = Lt(), A = Mt(), t = J(!1), c = Be(), S = je(), x = Qt(), u = J(new Array()), I = J(new Array()), N = J(
|
|
152
|
+
a != null && a.startDate && (a != null && a.endDate) ? a : Wt()
|
|
153
|
+
), w = Y(() => {
|
|
154
|
+
const B = new Date(N.value.startDate), q = new Date(N.value.endDate);
|
|
155
155
|
return {
|
|
156
|
-
start:
|
|
157
|
-
end:
|
|
156
|
+
start: It(B).toISOString(),
|
|
157
|
+
end: Pt(q).toISOString()
|
|
158
158
|
};
|
|
159
|
-
}),
|
|
160
|
-
async function
|
|
159
|
+
}), O = J(new Array()), r = Ft(), d = J(null);
|
|
160
|
+
async function i(B) {
|
|
161
161
|
function q(k) {
|
|
162
|
-
const
|
|
162
|
+
const _ = {
|
|
163
163
|
mode: ft.CREATE,
|
|
164
164
|
modelValue: B || void 0,
|
|
165
165
|
show: !0,
|
|
166
|
-
"onUpdate:show"(
|
|
167
|
-
ze.value.show =
|
|
166
|
+
"onUpdate:show"(F) {
|
|
167
|
+
ze.value.show = F;
|
|
168
168
|
},
|
|
169
169
|
templateId: k,
|
|
170
|
-
lastClosingDate:
|
|
170
|
+
lastClosingDate: d.value
|
|
171
171
|
};
|
|
172
|
-
ze.value =
|
|
172
|
+
ze.value = _;
|
|
173
173
|
}
|
|
174
174
|
let oe;
|
|
175
|
-
|
|
175
|
+
b.mustUsePoTemplate && !(B != null && B.template) ? o.open({
|
|
176
176
|
title: "Create transfer",
|
|
177
177
|
message: "",
|
|
178
178
|
primaryActions: {
|
|
@@ -190,7 +190,7 @@ function Yn(C, a) {
|
|
|
190
190
|
q(void 0);
|
|
191
191
|
}) : q(oe);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function g(B) {
|
|
194
194
|
const q = {
|
|
195
195
|
mode: ft.UPDATE,
|
|
196
196
|
modelValue: vt(B),
|
|
@@ -198,24 +198,24 @@ function Yn(C, a) {
|
|
|
198
198
|
"onUpdate:show"(oe) {
|
|
199
199
|
ze.value.show = oe;
|
|
200
200
|
},
|
|
201
|
-
lastClosingDate:
|
|
201
|
+
lastClosingDate: d.value
|
|
202
202
|
};
|
|
203
203
|
ze.value = q;
|
|
204
204
|
}
|
|
205
|
-
async function
|
|
206
|
-
|
|
205
|
+
async function $() {
|
|
206
|
+
u.value = [], I.value = [], t.value = !0;
|
|
207
207
|
try {
|
|
208
|
-
const B = await
|
|
209
|
-
|
|
210
|
-
const q = B.flatMap((W) => W.shipmentIds || []).filter(Boolean), oe = q.length > 0 ? await
|
|
211
|
-
|
|
212
|
-
const k = await
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
var
|
|
216
|
-
return ((
|
|
208
|
+
const B = await S.getPurchaseOrders(w.value);
|
|
209
|
+
u.value = B.sort((W, ce) => ce._id.localeCompare(W._id));
|
|
210
|
+
const q = B.flatMap((W) => W.shipmentIds || []).filter(Boolean), oe = q.length > 0 ? await x.getShipmentsByIds(q) : [];
|
|
211
|
+
I.value = oe;
|
|
212
|
+
const k = await r.readCurrentLocationLastClosing(!0), _ = k == null ? void 0 : k._id;
|
|
213
|
+
_ && (d.value = Ct(_)), await b.awaitFeatureLoaded(() => b.mustUsePoTemplate) && await A.fetchTemplates();
|
|
214
|
+
const F = u.value.map((W) => {
|
|
215
|
+
var ce;
|
|
216
|
+
return ((ce = W.request) == null ? void 0 : ce.id) ?? "";
|
|
217
217
|
}).filter((W) => W);
|
|
218
|
-
|
|
218
|
+
O.value = await S.readRequestByIds(F);
|
|
219
219
|
} catch {
|
|
220
220
|
c.open({
|
|
221
221
|
title: "Something went wrong",
|
|
@@ -223,16 +223,16 @@ function Yn(C, a) {
|
|
|
223
223
|
type: "error"
|
|
224
224
|
});
|
|
225
225
|
} finally {
|
|
226
|
-
|
|
226
|
+
t.value = !1;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
async function
|
|
230
|
-
|
|
229
|
+
async function K() {
|
|
230
|
+
O.value = [], t.value = !0;
|
|
231
231
|
try {
|
|
232
|
-
|
|
232
|
+
O.value = await S.readRequests(
|
|
233
233
|
void 0,
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
w.value.start,
|
|
235
|
+
w.value.end
|
|
236
236
|
).then((B) => B.reverse());
|
|
237
237
|
} catch {
|
|
238
238
|
c.open({
|
|
@@ -241,68 +241,68 @@ function Yn(C, a) {
|
|
|
241
241
|
type: "error"
|
|
242
242
|
});
|
|
243
243
|
} finally {
|
|
244
|
-
|
|
244
|
+
t.value = !1;
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
function R() {
|
|
248
248
|
switch (C) {
|
|
249
249
|
case "receive/request":
|
|
250
|
-
return
|
|
250
|
+
return $();
|
|
251
251
|
case "approval":
|
|
252
|
-
return
|
|
252
|
+
return K();
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
function
|
|
256
|
-
|
|
255
|
+
function X(B, q) {
|
|
256
|
+
N.value = {
|
|
257
257
|
startDate: B,
|
|
258
258
|
endDate: q
|
|
259
259
|
}, R();
|
|
260
260
|
}
|
|
261
261
|
f.watchLocation(async (B) => {
|
|
262
262
|
if (!B) {
|
|
263
|
-
|
|
263
|
+
u.value = [];
|
|
264
264
|
return;
|
|
265
265
|
}
|
|
266
266
|
await R();
|
|
267
267
|
});
|
|
268
|
-
const
|
|
269
|
-
async function
|
|
268
|
+
const j = J(), Q = J(Math.random().toString());
|
|
269
|
+
async function ve(B, q) {
|
|
270
270
|
const oe = Math.random().toString();
|
|
271
|
-
|
|
271
|
+
Q.value = oe, q ?? (q = O.value.computeFirst(
|
|
272
272
|
(W) => W.purchaseOrderId === B._id ? W : null
|
|
273
273
|
) ?? void 0);
|
|
274
|
-
const k = C === "receive/request" ? f.currentLocation : q == null ? void 0 : q.to,
|
|
274
|
+
const k = C === "receive/request" ? f.currentLocation : q == null ? void 0 : q.to, _ = C === "approval", F = {
|
|
275
275
|
poRequest: q,
|
|
276
276
|
purchaseOrder: {
|
|
277
277
|
...B,
|
|
278
|
-
status:
|
|
278
|
+
status: _ && (q != null && q.rejectedAt) ? se.Enum.REJECT : B.status
|
|
279
279
|
},
|
|
280
280
|
transferTo: k == null ? void 0 : k.name,
|
|
281
281
|
transferToDbName: k == null ? void 0 : k.dbName,
|
|
282
282
|
show: !0,
|
|
283
283
|
canResubmit: !1,
|
|
284
|
-
canApprove:
|
|
284
|
+
canApprove: _,
|
|
285
285
|
"onUpdate:show"(W) {
|
|
286
|
-
|
|
286
|
+
j.value.show = W;
|
|
287
287
|
},
|
|
288
288
|
scope: C,
|
|
289
289
|
receivedMap: Xe(B) ?? {},
|
|
290
|
-
shipments:
|
|
290
|
+
shipments: I.value
|
|
291
291
|
};
|
|
292
|
-
|
|
292
|
+
j.value = F;
|
|
293
293
|
}
|
|
294
|
-
async function
|
|
295
|
-
const
|
|
296
|
-
|
|
294
|
+
async function ie(B, q, oe, k) {
|
|
295
|
+
const _ = Ot();
|
|
296
|
+
t.value = !0;
|
|
297
297
|
try {
|
|
298
|
-
await
|
|
298
|
+
await _({
|
|
299
299
|
operate: {
|
|
300
300
|
operation: q,
|
|
301
301
|
doc: B,
|
|
302
302
|
options: (
|
|
303
303
|
// auto receive for supplier to warehouse
|
|
304
304
|
(q === M.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
305
|
-
q === M.enum.completeReceive) &&
|
|
305
|
+
q === M.enum.completeReceive) && b.autoReceiveWarehouse ? {
|
|
306
306
|
autoReceive: !0
|
|
307
307
|
} : void 0
|
|
308
308
|
)
|
|
@@ -314,7 +314,7 @@ function Yn(C, a) {
|
|
|
314
314
|
payloads: []
|
|
315
315
|
},
|
|
316
316
|
transferTo: k
|
|
317
|
-
}), await new Promise((
|
|
317
|
+
}), await new Promise((ce) => setTimeout(ce, 1e3));
|
|
318
318
|
const W = De().currentLocationDBName.startsWith("restaurant_");
|
|
319
319
|
q === M.enum.confirmDraft && B.effectiveAt && W ? c.open({
|
|
320
320
|
title: "Success",
|
|
@@ -325,17 +325,17 @@ function Yn(C, a) {
|
|
|
325
325
|
message: oe,
|
|
326
326
|
type: "success"
|
|
327
327
|
});
|
|
328
|
-
} catch (
|
|
328
|
+
} catch (F) {
|
|
329
329
|
c.open({
|
|
330
330
|
title: "Something went wrong",
|
|
331
331
|
message: "Please try again.",
|
|
332
332
|
type: "error"
|
|
333
|
-
}), console.error("Error when submitting PO operation", q, B,
|
|
333
|
+
}), console.error("Error when submitting PO operation", q, B, F);
|
|
334
334
|
} finally {
|
|
335
|
-
|
|
335
|
+
t.value = !1, R();
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
async function
|
|
338
|
+
async function Ae(B, q, oe) {
|
|
339
339
|
const k = xt[q];
|
|
340
340
|
if (!k) {
|
|
341
341
|
c.open({
|
|
@@ -345,16 +345,16 @@ function Yn(C, a) {
|
|
|
345
345
|
});
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
|
-
const { successMessage:
|
|
348
|
+
const { successMessage: _, ...F } = k;
|
|
349
349
|
o.open({
|
|
350
|
-
title:
|
|
351
|
-
message:
|
|
352
|
-
primaryActions:
|
|
350
|
+
title: F.title,
|
|
351
|
+
message: F.message,
|
|
352
|
+
primaryActions: F.primaryActions
|
|
353
353
|
}).onPrimary(() => {
|
|
354
|
-
|
|
354
|
+
ie(B, q, _, oe);
|
|
355
355
|
});
|
|
356
356
|
}
|
|
357
|
-
async function
|
|
357
|
+
async function Ne() {
|
|
358
358
|
o.open({
|
|
359
359
|
title: "Upload Transfer",
|
|
360
360
|
primaryActions: {
|
|
@@ -376,43 +376,43 @@ function Yn(C, a) {
|
|
|
376
376
|
});
|
|
377
377
|
}
|
|
378
378
|
return {
|
|
379
|
-
purchaseOrders:
|
|
380
|
-
shipments:
|
|
381
|
-
purchaseRequests:
|
|
382
|
-
updateDateRange:
|
|
379
|
+
purchaseOrders: u,
|
|
380
|
+
shipments: I,
|
|
381
|
+
purchaseRequests: O,
|
|
382
|
+
updateDateRange: X,
|
|
383
383
|
fetchData: R,
|
|
384
|
-
loading:
|
|
384
|
+
loading: t,
|
|
385
385
|
transferDialogProps: ze,
|
|
386
|
-
promptCreateTransferDialog:
|
|
387
|
-
promptUpdateTransferDialog:
|
|
388
|
-
transferDetailsProps:
|
|
389
|
-
promptShowTransferDetails:
|
|
390
|
-
submitAction:
|
|
386
|
+
promptCreateTransferDialog: i,
|
|
387
|
+
promptUpdateTransferDialog: g,
|
|
388
|
+
transferDetailsProps: j,
|
|
389
|
+
promptShowTransferDetails: ve,
|
|
390
|
+
submitAction: Ae,
|
|
391
391
|
xilnexImportDialogProps: rt,
|
|
392
|
-
promptUploadTransferDialog:
|
|
392
|
+
promptUploadTransferDialog: Ne
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function Xt(C, a) {
|
|
396
396
|
return a.reduce(
|
|
397
|
-
(f,
|
|
398
|
-
const n =
|
|
399
|
-
return n && (f =
|
|
397
|
+
(f, b) => {
|
|
398
|
+
const n = b.received.find((A) => A.sku._id === C._id);
|
|
399
|
+
return n && (f = ht(f, n.amount)), f;
|
|
400
400
|
},
|
|
401
|
-
|
|
401
|
+
Tt.toPrecision(gt(0), C.unit.precision)
|
|
402
402
|
);
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
const { po: a, currentLocation: o, business: f, fulfilling:
|
|
406
|
-
name:
|
|
407
|
-
legalName:
|
|
404
|
+
function Zt(C) {
|
|
405
|
+
const { po: a, currentLocation: o, business: f, fulfilling: b, por: n } = C, { name: A, address: t, regNo: c, legalName: S } = o.doc.profile, x = {
|
|
406
|
+
name: A,
|
|
407
|
+
legalName: S,
|
|
408
408
|
registrationNumber: c,
|
|
409
|
-
line1:
|
|
410
|
-
line2:
|
|
411
|
-
postcode:
|
|
412
|
-
city:
|
|
413
|
-
state:
|
|
414
|
-
country:
|
|
415
|
-
},
|
|
409
|
+
line1: t == null ? void 0 : t.line1,
|
|
410
|
+
line2: t == null ? void 0 : t.line2,
|
|
411
|
+
postcode: t == null ? void 0 : t.postcode,
|
|
412
|
+
city: t == null ? void 0 : t.city,
|
|
413
|
+
state: t == null ? void 0 : t.state,
|
|
414
|
+
country: t == null ? void 0 : t.country
|
|
415
|
+
}, u = {
|
|
416
416
|
name: a.supplier.name,
|
|
417
417
|
phoneNumber: a.supplier.phoneNumber,
|
|
418
418
|
registrationNumber: a.supplier.registrationNumber,
|
|
@@ -422,60 +422,60 @@ function Xt(C) {
|
|
|
422
422
|
city: a.supplier.address.city,
|
|
423
423
|
state: a.supplier.address.state,
|
|
424
424
|
country: a.supplier.address.country
|
|
425
|
-
},
|
|
426
|
-
const { sku:
|
|
427
|
-
|
|
425
|
+
}, I = a.items.map(($) => {
|
|
426
|
+
const { sku: K, measurement: R } = $, X = he(
|
|
427
|
+
Xt($.sku, a.deliveryOrder || []),
|
|
428
428
|
!1
|
|
429
429
|
);
|
|
430
430
|
return {
|
|
431
|
-
code:
|
|
432
|
-
description:
|
|
433
|
-
quantity: he(
|
|
434
|
-
unit: (R == null ? void 0 : R.abbrev) ||
|
|
435
|
-
received:
|
|
436
|
-
cost:
|
|
437
|
-
value:
|
|
431
|
+
code: K.code,
|
|
432
|
+
description: K.name,
|
|
433
|
+
quantity: he($.quantity, !1),
|
|
434
|
+
unit: (R == null ? void 0 : R.abbrev) || K.unit.abbrev,
|
|
435
|
+
received: X,
|
|
436
|
+
cost: $.totalCost ? `${$.totalCost.currency} ${qt.toFormatString({
|
|
437
|
+
value: $.totalCost
|
|
438
438
|
})}` : void 0
|
|
439
439
|
};
|
|
440
|
-
}),
|
|
441
|
-
createdAt: _t(new Date(
|
|
442
|
-
ref:
|
|
443
|
-
remark:
|
|
444
|
-
items:
|
|
440
|
+
}), N = a.deliveryOrder.map(($) => ({
|
|
441
|
+
createdAt: _t(new Date($.createdAt)),
|
|
442
|
+
ref: $.deliveryOrderNumber,
|
|
443
|
+
remark: $.remark || "",
|
|
444
|
+
items: $.received.map((K) => {
|
|
445
445
|
var R;
|
|
446
446
|
return {
|
|
447
|
-
code:
|
|
448
|
-
description:
|
|
449
|
-
quantity: he(
|
|
450
|
-
unit: ((R =
|
|
447
|
+
code: K.sku.code,
|
|
448
|
+
description: K.sku.name,
|
|
449
|
+
quantity: he(K.amount),
|
|
450
|
+
unit: ((R = K.measurement) == null ? void 0 : R.abbrev) || K.sku.unit.abbrev
|
|
451
451
|
};
|
|
452
452
|
})
|
|
453
|
-
})),
|
|
453
|
+
})), w = [
|
|
454
454
|
// Production
|
|
455
455
|
"67ca5d2c80bd0e001c5bf5bc",
|
|
456
456
|
// Dev
|
|
457
457
|
"6880b36a3054c5001db19218"
|
|
458
458
|
];
|
|
459
|
-
let
|
|
460
|
-
if (a.supplier.internal ? (
|
|
461
|
-
const
|
|
462
|
-
o.dbName ===
|
|
459
|
+
let O = "Inventory Receive Note";
|
|
460
|
+
if (a.supplier.internal ? (O = "Inventory Transfer Note", w.includes((f == null ? void 0 : f._id) || "") && (O = "Stock Request")) : O = "Purchase Order", n) {
|
|
461
|
+
const $ = n.from.dbName;
|
|
462
|
+
o.dbName === $ || (O = "Inventory Receive Note");
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
title:
|
|
464
|
+
const d = {
|
|
465
|
+
title: O,
|
|
466
466
|
businessName: f == null ? void 0 : f.name,
|
|
467
467
|
logo: f == null ? void 0 : f.thumbnail,
|
|
468
468
|
orderNumber: a.seqNumber.toString(),
|
|
469
469
|
createdAt: We(a._id),
|
|
470
470
|
ref: a.ref || "",
|
|
471
471
|
remark: a.remark || "",
|
|
472
|
-
buyer:
|
|
473
|
-
supplier:
|
|
474
|
-
items:
|
|
472
|
+
buyer: x,
|
|
473
|
+
supplier: u,
|
|
474
|
+
items: I,
|
|
475
475
|
status: a.status,
|
|
476
|
-
deliveryOrders:
|
|
477
|
-
},
|
|
478
|
-
|
|
476
|
+
deliveryOrders: N
|
|
477
|
+
}, i = new URL(window.location.href), g = b && (a.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
|
|
478
|
+
i.pathname = i.hostname.includes("portal.feedme") ? `/inventory/${g}` : `/${g}`, i.searchParams.append("data", JSON.stringify(d)), window.open(i.href, "_blank", "noreferrer");
|
|
479
479
|
}
|
|
480
480
|
const Le = {
|
|
481
481
|
submitRequest: {
|
|
@@ -539,20 +539,40 @@ const Le = {
|
|
|
539
539
|
value: M.enum.returnStock
|
|
540
540
|
}
|
|
541
541
|
};
|
|
542
|
+
function wt() {
|
|
543
|
+
const C = Ue();
|
|
544
|
+
return {
|
|
545
|
+
ableToMarkReceived(a) {
|
|
546
|
+
if (!a || a.status !== se.enum.RECEIVING || C.useOperatePurchaseOrderV2) return !1;
|
|
547
|
+
const f = De().currentLocationDBName;
|
|
548
|
+
return `${a.supplier.internal}_${a.supplier._id}` !== f;
|
|
549
|
+
},
|
|
550
|
+
ableToMarkApproved(a) {
|
|
551
|
+
return !(!a || (a == null ? void 0 : a.status) !== se.enum.REQUESTING);
|
|
552
|
+
},
|
|
553
|
+
ableToCreateFulfillment(a, o) {
|
|
554
|
+
var n, A;
|
|
555
|
+
if (!C.acceptRequireFulfillment || !a || !o || a.status !== se.enum.PROCESSING || !o.processedAt)
|
|
556
|
+
return !1;
|
|
557
|
+
const f = (n = o == null ? void 0 : o.from) == null ? void 0 : n.dbName, b = (A = o == null ? void 0 : o.to) == null ? void 0 : A.dbName;
|
|
558
|
+
return !(f.startsWith("restaurant_") && b.startsWith("restaurant_"));
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
}
|
|
542
562
|
function Qn(C, a, o) {
|
|
543
|
-
const f = De(),
|
|
544
|
-
function
|
|
545
|
-
switch (
|
|
563
|
+
const f = De(), b = et(), n = ct(), A = wt(), { t } = ut();
|
|
564
|
+
function c(w) {
|
|
565
|
+
switch (w.status) {
|
|
546
566
|
case "DRAFT":
|
|
547
567
|
return [
|
|
548
568
|
Se[ye.Update],
|
|
549
569
|
Se[ye.Details],
|
|
550
|
-
|
|
570
|
+
w.supplier.internal === "restaurant" || w.supplier.internal === "warehouse" ? Le[M.enum.submitRequest] : Le[M.enum.confirmDraft],
|
|
551
571
|
Le[M.enum.cancelDraft]
|
|
552
572
|
];
|
|
553
573
|
case "RECEIVING":
|
|
554
574
|
return [
|
|
555
|
-
Le[M.enum.completeReceive],
|
|
575
|
+
...A.ableToMarkReceived(w) ? [Le[M.enum.completeReceive]] : [],
|
|
556
576
|
Se[ye.Details],
|
|
557
577
|
Se[ye.Print]
|
|
558
578
|
];
|
|
@@ -571,82 +591,82 @@ function Qn(C, a, o) {
|
|
|
571
591
|
return [Se[ye.Details], Se[ye.Print]];
|
|
572
592
|
}
|
|
573
593
|
}
|
|
574
|
-
function
|
|
575
|
-
return Object.values(M.enum).includes(
|
|
594
|
+
function S(w) {
|
|
595
|
+
return Object.values(M.enum).includes(w);
|
|
576
596
|
}
|
|
577
|
-
async function
|
|
578
|
-
var
|
|
579
|
-
const
|
|
580
|
-
if (
|
|
581
|
-
const
|
|
582
|
-
if (
|
|
583
|
-
const
|
|
584
|
-
|
|
597
|
+
async function x(w, O, r) {
|
|
598
|
+
var i, g, $, K, R, X;
|
|
599
|
+
const d = vt(O);
|
|
600
|
+
if (w === ye.Print) {
|
|
601
|
+
const j = (r == null ? void 0 : r.toInventoryLocation) ?? f.currentLocation;
|
|
602
|
+
if (j.type === "restaurant") {
|
|
603
|
+
const Q = f.locationRestaurantFromCore(j.doc._id);
|
|
604
|
+
Q !== null && (j.doc = Q);
|
|
585
605
|
}
|
|
586
|
-
((
|
|
587
|
-
po:
|
|
588
|
-
currentLocation:
|
|
606
|
+
((i = r == null ? void 0 : r.netSuite) != null && i.refNo || (g = d.netSuite) != null && g.refNo) && (d.ref = [(($ = r == null ? void 0 : r.netSuite) == null ? void 0 : $.refNo) || ((K = d.netSuite) == null ? void 0 : K.refNo)].filter((Q) => Q).join(" ")), Zt({
|
|
607
|
+
po: d,
|
|
608
|
+
currentLocation: j,
|
|
589
609
|
business: n.currentBusiness.value,
|
|
590
610
|
fulfilling: C === "approval",
|
|
591
|
-
por:
|
|
611
|
+
por: r
|
|
592
612
|
});
|
|
593
613
|
return;
|
|
594
614
|
}
|
|
595
|
-
if (
|
|
596
|
-
a.promptShowTransferDetails(
|
|
615
|
+
if (w === ye.Details) {
|
|
616
|
+
a.promptShowTransferDetails(d, r);
|
|
597
617
|
return;
|
|
598
618
|
}
|
|
599
|
-
if (
|
|
600
|
-
(
|
|
619
|
+
if (w === ye.Update) {
|
|
620
|
+
(R = a.promptUpdateTransferDialog) == null || R.call(a, d);
|
|
601
621
|
return;
|
|
602
622
|
}
|
|
603
|
-
if (
|
|
604
|
-
a.submitAction(
|
|
623
|
+
if (S(w)) {
|
|
624
|
+
a.submitAction(O, w, (X = r == null ? void 0 : r.to) == null ? void 0 : X.dbName);
|
|
605
625
|
return;
|
|
606
626
|
}
|
|
607
627
|
}
|
|
608
|
-
function
|
|
609
|
-
var
|
|
610
|
-
const
|
|
628
|
+
function u() {
|
|
629
|
+
var O;
|
|
630
|
+
const w = [
|
|
611
631
|
{
|
|
612
632
|
accessorKey: "seqNumber",
|
|
613
|
-
header: () =>
|
|
633
|
+
header: () => t("inventory.transfer.table.seqNo"),
|
|
614
634
|
enableSorting: !0,
|
|
615
635
|
size: 80,
|
|
616
636
|
sortUndefined: "last"
|
|
617
637
|
},
|
|
618
638
|
{
|
|
619
639
|
accessorKey: "_id",
|
|
620
|
-
header: () =>
|
|
621
|
-
cell(
|
|
622
|
-
return We(`${
|
|
640
|
+
header: () => t("inventory.transfer.table.createdAt"),
|
|
641
|
+
cell(r) {
|
|
642
|
+
return We(`${r.getValue()}`);
|
|
623
643
|
},
|
|
624
644
|
enableSorting: !0
|
|
625
645
|
},
|
|
626
646
|
{
|
|
627
647
|
accessorKey: "supplier.name",
|
|
628
|
-
header: () =>
|
|
648
|
+
header: () => t("inventory.transfer.table.transferFrom"),
|
|
629
649
|
enableSorting: !0,
|
|
630
650
|
size: 200
|
|
631
651
|
},
|
|
632
652
|
{
|
|
633
653
|
accessorKey: "items.length",
|
|
634
|
-
header: () =>
|
|
635
|
-
cell: (
|
|
636
|
-
const
|
|
654
|
+
header: () => t("inventory.transfer.table.noOfItems"),
|
|
655
|
+
cell: (r) => {
|
|
656
|
+
const d = r.row.original.version || "1", i = r.getValue();
|
|
637
657
|
return L("div", { class: "flex items-center gap-2" }, [
|
|
638
|
-
|
|
639
|
-
|
|
658
|
+
i,
|
|
659
|
+
d !== "1" ? L(
|
|
640
660
|
"div",
|
|
641
661
|
{ class: "py-3" },
|
|
642
662
|
L(
|
|
643
|
-
|
|
663
|
+
Ve,
|
|
644
664
|
L(
|
|
645
665
|
"div",
|
|
646
666
|
{
|
|
647
667
|
class: ["fm-status-badge", "fm-status-badge-draft"].join(" ")
|
|
648
668
|
},
|
|
649
|
-
`v${
|
|
669
|
+
`v${d}`
|
|
650
670
|
)
|
|
651
671
|
)
|
|
652
672
|
) : null
|
|
@@ -659,16 +679,16 @@ function Qn(C, a, o) {
|
|
|
659
679
|
},
|
|
660
680
|
{
|
|
661
681
|
accessorKey: "ref",
|
|
662
|
-
header: () =>
|
|
682
|
+
header: () => t("inventory.transfer.table.reference"),
|
|
663
683
|
enableSorting: !1,
|
|
664
684
|
size: "auto"
|
|
665
685
|
},
|
|
666
|
-
...(
|
|
686
|
+
...(O = n.sessionUser.value) != null && O.role.isAdmin ? [
|
|
667
687
|
{
|
|
668
688
|
id: "statusForAdmin",
|
|
669
|
-
header: () => L(
|
|
670
|
-
cell(
|
|
671
|
-
return
|
|
689
|
+
header: () => L(Ve, {}, () => `${t("inventory.transfer.table.status")}`),
|
|
690
|
+
cell(r) {
|
|
691
|
+
return r.row.original.status;
|
|
672
692
|
},
|
|
673
693
|
enableSorting: !0,
|
|
674
694
|
size: 200
|
|
@@ -676,18 +696,18 @@ function Qn(C, a, o) {
|
|
|
676
696
|
] : [],
|
|
677
697
|
{
|
|
678
698
|
accessorKey: "status",
|
|
679
|
-
header: () =>
|
|
680
|
-
cell(
|
|
681
|
-
const
|
|
682
|
-
let
|
|
683
|
-
|
|
684
|
-
let
|
|
685
|
-
const
|
|
686
|
-
if (
|
|
687
|
-
const
|
|
688
|
-
if (
|
|
689
|
-
const
|
|
690
|
-
|
|
699
|
+
header: () => t("inventory.transfer.table.status"),
|
|
700
|
+
cell(r) {
|
|
701
|
+
const d = r.getValue(), i = Xe(r.row.original), { partial: g, over: $ } = nt(i), K = at(d ?? "", g, $);
|
|
702
|
+
let R = t(`inventory.transfer.status.${K}`), X = `${d ?? ""}`.toLocaleLowerCase("en-us");
|
|
703
|
+
K === se.enum.CLOSE && (R = `${t(`inventory.transfer.status.${se.enum.COMPLETE}`)}`), K === "PARTIAL_RECEIVED" && X === se.enum.PROCESSING.toLocaleLowerCase("en-us") && (X = se.enum.RECEIVING.toLocaleLowerCase("en-us"));
|
|
704
|
+
let j = null;
|
|
705
|
+
const Q = o.value.find((ve) => ve.ref === r.row.original._id);
|
|
706
|
+
if (Q != null && Q.milestones && Q.milestones.length > 0) {
|
|
707
|
+
const ve = Q.milestones[Q.milestones.length - 1];
|
|
708
|
+
if (ve.estimatedTime) {
|
|
709
|
+
const ie = new Date(ve.estimatedTime), Ae = ie.getDate().toString().padStart(2, "0");
|
|
710
|
+
j = `${ie.toLocaleString("en-US", { month: "short" })} ${Ae}`;
|
|
691
711
|
}
|
|
692
712
|
}
|
|
693
713
|
return L(
|
|
@@ -704,14 +724,14 @@ function Qn(C, a, o) {
|
|
|
704
724
|
{
|
|
705
725
|
class: [
|
|
706
726
|
"fm-status-badge",
|
|
707
|
-
`fm-status-badge-${
|
|
727
|
+
`fm-status-badge-${X}`,
|
|
708
728
|
$ && "fm-status-badge-error"
|
|
709
729
|
].filter(Boolean).join(" ")
|
|
710
730
|
},
|
|
711
|
-
`${
|
|
731
|
+
`${R}`
|
|
712
732
|
)
|
|
713
733
|
),
|
|
714
|
-
...
|
|
734
|
+
...j ? [
|
|
715
735
|
L(
|
|
716
736
|
"div",
|
|
717
737
|
{
|
|
@@ -726,7 +746,7 @@ function Qn(C, a, o) {
|
|
|
726
746
|
L(
|
|
727
747
|
"span",
|
|
728
748
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
729
|
-
|
|
749
|
+
j
|
|
730
750
|
)
|
|
731
751
|
]
|
|
732
752
|
)
|
|
@@ -739,9 +759,9 @@ function Qn(C, a, o) {
|
|
|
739
759
|
},
|
|
740
760
|
{
|
|
741
761
|
id: "action",
|
|
742
|
-
cell(
|
|
743
|
-
const
|
|
744
|
-
return mt(
|
|
762
|
+
cell(r) {
|
|
763
|
+
const d = r.row.original, i = c(d);
|
|
764
|
+
return mt(i, (g) => x(g, d));
|
|
745
765
|
},
|
|
746
766
|
enableSorting: !1,
|
|
747
767
|
size: 40,
|
|
@@ -751,19 +771,19 @@ function Qn(C, a, o) {
|
|
|
751
771
|
}
|
|
752
772
|
}
|
|
753
773
|
];
|
|
754
|
-
if (
|
|
755
|
-
const
|
|
774
|
+
if (b.isEnabled) {
|
|
775
|
+
const r = [
|
|
756
776
|
{
|
|
757
777
|
id: "netsuiteTransferOrder",
|
|
758
|
-
accessorFn: (
|
|
759
|
-
var
|
|
760
|
-
return (
|
|
778
|
+
accessorFn: (d) => {
|
|
779
|
+
var i;
|
|
780
|
+
return (i = d.netSuite) != null && i.id ? `${d.netSuite.refNo} (${d.netSuite.id})` : "N/A";
|
|
761
781
|
},
|
|
762
782
|
header: () => "NetSuite Order (ID)",
|
|
763
|
-
cell(
|
|
764
|
-
var
|
|
765
|
-
const
|
|
766
|
-
return (
|
|
783
|
+
cell(d) {
|
|
784
|
+
var g;
|
|
785
|
+
const i = d.row.original;
|
|
786
|
+
return (g = i.netSuite) != null && g.id ? `${i.netSuite.refNo} (${i.netSuite.id})` : "N/A";
|
|
767
787
|
},
|
|
768
788
|
enableSorting: !1,
|
|
769
789
|
size: 200,
|
|
@@ -774,14 +794,14 @@ function Qn(C, a, o) {
|
|
|
774
794
|
},
|
|
775
795
|
{
|
|
776
796
|
id: "netsuiteTransactionNumber",
|
|
777
|
-
accessorFn: (
|
|
778
|
-
var
|
|
779
|
-
return ((
|
|
797
|
+
accessorFn: (d) => {
|
|
798
|
+
var i, g;
|
|
799
|
+
return ((g = (i = d.netSuite) == null ? void 0 : i.additionalInfo) == null ? void 0 : g.transactionnumber) ?? "N/A";
|
|
780
800
|
},
|
|
781
801
|
header: () => "NetSuite Transaction No.",
|
|
782
|
-
cell(
|
|
783
|
-
var
|
|
784
|
-
return (($ = (
|
|
802
|
+
cell(d) {
|
|
803
|
+
var g, $;
|
|
804
|
+
return (($ = (g = d.row.original.netSuite) == null ? void 0 : g.additionalInfo) == null ? void 0 : $.transactionnumber) ?? "N/A";
|
|
785
805
|
},
|
|
786
806
|
enableSorting: !1,
|
|
787
807
|
size: 200,
|
|
@@ -791,51 +811,51 @@ function Qn(C, a, o) {
|
|
|
791
811
|
}
|
|
792
812
|
}
|
|
793
813
|
];
|
|
794
|
-
|
|
814
|
+
w.splice(w.length - 1, 0, ...r);
|
|
795
815
|
}
|
|
796
|
-
return
|
|
816
|
+
return w;
|
|
797
817
|
}
|
|
798
|
-
function
|
|
799
|
-
var
|
|
800
|
-
const
|
|
818
|
+
function I() {
|
|
819
|
+
var O;
|
|
820
|
+
const w = [
|
|
801
821
|
{
|
|
802
822
|
accessorKey: "purchaseOrder.seqNumber",
|
|
803
|
-
header: () =>
|
|
823
|
+
header: () => t("inventory.transfer.table.seqNo"),
|
|
804
824
|
enableSorting: !0,
|
|
805
825
|
size: 80,
|
|
806
826
|
sortUndefined: "last"
|
|
807
827
|
},
|
|
808
828
|
{
|
|
809
829
|
accessorKey: "purchaseOrder._id",
|
|
810
|
-
header: () =>
|
|
811
|
-
cell(
|
|
812
|
-
return We(`${
|
|
830
|
+
header: () => t("inventory.transfer.table.createdAt"),
|
|
831
|
+
cell(r) {
|
|
832
|
+
return We(`${r.getValue()}`);
|
|
813
833
|
},
|
|
814
834
|
enableSorting: !0
|
|
815
835
|
},
|
|
816
836
|
{
|
|
817
837
|
accessorKey: "to.name",
|
|
818
|
-
header: () =>
|
|
838
|
+
header: () => t("inventory.transfer.table.transferTo"),
|
|
819
839
|
enableSorting: !1,
|
|
820
840
|
size: 200
|
|
821
841
|
},
|
|
822
842
|
{
|
|
823
843
|
accessorKey: "purchaseOrder.items.length",
|
|
824
|
-
header: () =>
|
|
844
|
+
header: () => t("inventory.transfer.table.noOfItems"),
|
|
825
845
|
enableSorting: !1
|
|
826
846
|
},
|
|
827
847
|
{
|
|
828
848
|
accessorKey: "purchaseOrder.ref",
|
|
829
|
-
header: () =>
|
|
849
|
+
header: () => t("inventory.transfer.table.reference"),
|
|
830
850
|
enableSorting: !1,
|
|
831
851
|
size: "auto"
|
|
832
852
|
},
|
|
833
|
-
...(
|
|
853
|
+
...(O = n.sessionUser.value) != null && O.role.isAdmin ? [
|
|
834
854
|
{
|
|
835
855
|
id: "statusForAdmin",
|
|
836
|
-
header: () => L(
|
|
837
|
-
cell(
|
|
838
|
-
return
|
|
856
|
+
header: () => L(Ve, {}, () => `${t("inventory.transfer.table.status")}`),
|
|
857
|
+
cell(r) {
|
|
858
|
+
return r.row.original.status;
|
|
839
859
|
},
|
|
840
860
|
enableSorting: !0,
|
|
841
861
|
size: 200
|
|
@@ -843,17 +863,17 @@ function Qn(C, a, o) {
|
|
|
843
863
|
] : [],
|
|
844
864
|
{
|
|
845
865
|
accessorKey: "purchaseOrder.status",
|
|
846
|
-
header: () =>
|
|
847
|
-
cell(
|
|
848
|
-
const
|
|
849
|
-
if (!
|
|
866
|
+
header: () => t("inventory.transfer.table.status"),
|
|
867
|
+
cell(r) {
|
|
868
|
+
const d = r.row.original, i = r.getValue();
|
|
869
|
+
if (!d.purchaseOrder)
|
|
850
870
|
return L(Je.FmChip, {
|
|
851
871
|
label: "N/A",
|
|
852
872
|
compact: !0
|
|
853
873
|
});
|
|
854
|
-
const
|
|
855
|
-
let
|
|
856
|
-
return
|
|
874
|
+
const g = Xe(d.purchaseOrder), { partial: $, over: K } = nt(g), R = at(i ?? "", $, K);
|
|
875
|
+
let X = t(`inventory.transfer.status.${R}`), j = `${i ?? ""}`.toLocaleLowerCase("en-us");
|
|
876
|
+
return R === se.enum.CLOSE && (X = `${t(`inventory.transfer.status.${se.enum.COMPLETE}`)}`), R === "PARTIAL_RECEIVED" && j === se.enum.PROCESSING.toLocaleLowerCase("en-us") && (j = se.enum.RECEIVING.toLocaleLowerCase("en-us")), d.rejectedAt && (X = t("inventory.transfer.status.REJECT"), j = se.enum.REJECT.toLocaleLowerCase("en-us")), L(
|
|
857
877
|
"div",
|
|
858
878
|
{
|
|
859
879
|
class: "flex"
|
|
@@ -863,11 +883,11 @@ function Qn(C, a, o) {
|
|
|
863
883
|
{
|
|
864
884
|
class: [
|
|
865
885
|
"fm-status-badge",
|
|
866
|
-
`fm-status-badge-${
|
|
867
|
-
|
|
886
|
+
`fm-status-badge-${j}`,
|
|
887
|
+
K && "fm-status-badge-error"
|
|
868
888
|
].filter(Boolean).join(" ")
|
|
869
889
|
},
|
|
870
|
-
`${
|
|
890
|
+
`${X}`
|
|
871
891
|
)
|
|
872
892
|
);
|
|
873
893
|
},
|
|
@@ -875,14 +895,14 @@ function Qn(C, a, o) {
|
|
|
875
895
|
},
|
|
876
896
|
{
|
|
877
897
|
id: "action",
|
|
878
|
-
cell(
|
|
879
|
-
const
|
|
898
|
+
cell(r) {
|
|
899
|
+
const d = r.row.original, g = (d.purchaseOrder ? c(d.purchaseOrder) : []).map(($) => $.value === ye.Print ? {
|
|
880
900
|
...$,
|
|
881
901
|
translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
|
|
882
902
|
} : $);
|
|
883
903
|
return mt(
|
|
884
|
-
|
|
885
|
-
($) =>
|
|
904
|
+
g,
|
|
905
|
+
($) => d.purchaseOrder ? x($, d.purchaseOrder, d) : void 0
|
|
886
906
|
);
|
|
887
907
|
},
|
|
888
908
|
enableSorting: !1,
|
|
@@ -893,19 +913,19 @@ function Qn(C, a, o) {
|
|
|
893
913
|
}
|
|
894
914
|
}
|
|
895
915
|
];
|
|
896
|
-
if (
|
|
897
|
-
const
|
|
916
|
+
if (b.isEnabled) {
|
|
917
|
+
const r = [
|
|
898
918
|
{
|
|
899
919
|
id: "netsuiteTransferOrder",
|
|
900
|
-
accessorFn: (
|
|
901
|
-
var
|
|
902
|
-
return (
|
|
920
|
+
accessorFn: (d) => {
|
|
921
|
+
var i;
|
|
922
|
+
return (i = d.netSuite) != null && i.id ? `${d.netSuite.refNo} (${d.netSuite.id})` : "N/A";
|
|
903
923
|
},
|
|
904
924
|
header: () => "NetSuite Order (ID)",
|
|
905
|
-
cell(
|
|
906
|
-
var
|
|
907
|
-
const
|
|
908
|
-
return (
|
|
925
|
+
cell(d) {
|
|
926
|
+
var g;
|
|
927
|
+
const i = d.row.original;
|
|
928
|
+
return (g = i.netSuite) != null && g.id ? `${i.netSuite.refNo} (${i.netSuite.id})` : "N/A";
|
|
909
929
|
},
|
|
910
930
|
enableSorting: !1,
|
|
911
931
|
size: 200,
|
|
@@ -916,14 +936,14 @@ function Qn(C, a, o) {
|
|
|
916
936
|
},
|
|
917
937
|
{
|
|
918
938
|
id: "netsuiteTransactionNumber",
|
|
919
|
-
accessorFn: (
|
|
920
|
-
var
|
|
921
|
-
return ((
|
|
939
|
+
accessorFn: (d) => {
|
|
940
|
+
var i, g;
|
|
941
|
+
return ((g = (i = d.netSuite) == null ? void 0 : i.additionalInfo) == null ? void 0 : g.transactionnumber) ?? "N/A";
|
|
922
942
|
},
|
|
923
943
|
header: () => "NetSuite Transaction No.",
|
|
924
|
-
cell(
|
|
925
|
-
var
|
|
926
|
-
return (($ = (
|
|
944
|
+
cell(d) {
|
|
945
|
+
var g, $;
|
|
946
|
+
return (($ = (g = d.row.original.netSuite) == null ? void 0 : g.additionalInfo) == null ? void 0 : $.transactionnumber) ?? "N/A";
|
|
927
947
|
},
|
|
928
948
|
enableSorting: !1,
|
|
929
949
|
size: 200,
|
|
@@ -933,15 +953,15 @@ function Qn(C, a, o) {
|
|
|
933
953
|
}
|
|
934
954
|
}
|
|
935
955
|
];
|
|
936
|
-
|
|
956
|
+
w.splice(w.length - 2, 0, ...r);
|
|
937
957
|
}
|
|
938
|
-
return
|
|
958
|
+
return w;
|
|
939
959
|
}
|
|
940
960
|
return {
|
|
941
|
-
columnDefs: Y(() => C === "receive/request" ?
|
|
961
|
+
columnDefs: Y(() => C === "receive/request" ? u() : I())
|
|
942
962
|
};
|
|
943
963
|
}
|
|
944
|
-
const
|
|
964
|
+
const es = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, ts = { class: "flex flex-col gap-8" }, ss = { class: "flex w-full justify-end gap-16" }, rs = /* @__PURE__ */ $e({
|
|
945
965
|
__name: "FulfillmentForm",
|
|
946
966
|
props: {
|
|
947
967
|
purchaseOrder: {},
|
|
@@ -949,43 +969,43 @@ const Zt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
949
969
|
},
|
|
950
970
|
emits: ["update:show"],
|
|
951
971
|
setup(C, { emit: a }) {
|
|
952
|
-
const o = C, f =
|
|
972
|
+
const o = C, f = Rt({
|
|
953
973
|
id: "",
|
|
954
974
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
955
975
|
items: []
|
|
956
|
-
}),
|
|
976
|
+
}), b = J(), n = a;
|
|
957
977
|
yt(() => {
|
|
958
|
-
o.purchaseOrder && (f.items = o.purchaseOrder.items.map((
|
|
959
|
-
id:
|
|
960
|
-
sku:
|
|
961
|
-
measurement:
|
|
962
|
-
amount:
|
|
978
|
+
o.purchaseOrder && (f.items = o.purchaseOrder.items.map((t) => ({
|
|
979
|
+
id: t.id,
|
|
980
|
+
sku: t.sku,
|
|
981
|
+
measurement: t.measurement,
|
|
982
|
+
amount: t.quantity ?? { amount: 1, precision: 0 }
|
|
963
983
|
})));
|
|
964
984
|
});
|
|
965
|
-
const
|
|
966
|
-
return (
|
|
967
|
-
const
|
|
968
|
-
return
|
|
985
|
+
const A = Y(() => f.items.length <= 10);
|
|
986
|
+
return (t, c) => {
|
|
987
|
+
const S = H("FmTable"), x = H("FmButton"), u = H("FmForm");
|
|
988
|
+
return l(), re(u, {
|
|
969
989
|
ref_key: "formRef",
|
|
970
|
-
ref:
|
|
990
|
+
ref: b,
|
|
971
991
|
class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
|
|
972
992
|
onValidationFailed: console.log,
|
|
973
993
|
onValidationSuccess: c[1] || (c[1] = () => o.confirm(f))
|
|
974
994
|
}, {
|
|
975
|
-
default:
|
|
995
|
+
default: ee(() => [
|
|
976
996
|
c[2] || (c[2] = e("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
|
|
977
|
-
e("div",
|
|
978
|
-
e("div",
|
|
979
|
-
D(
|
|
997
|
+
e("div", es, [
|
|
998
|
+
e("div", ts, [
|
|
999
|
+
D(S, {
|
|
980
1000
|
"column-defs": [
|
|
981
1001
|
{
|
|
982
1002
|
header: "Code",
|
|
983
|
-
cell: (
|
|
984
|
-
const
|
|
1003
|
+
cell: (I) => {
|
|
1004
|
+
const N = o.purchaseOrder.items.find((w) => w.id === I.row.original.id || w.sku._id === I.row.original.sku._id);
|
|
985
1005
|
return L(
|
|
986
1006
|
v(Je).FmTooltip,
|
|
987
1007
|
{
|
|
988
|
-
content:
|
|
1008
|
+
content: N.code,
|
|
989
1009
|
placement: "top",
|
|
990
1010
|
variant: "plain",
|
|
991
1011
|
zIndex: 50
|
|
@@ -995,19 +1015,19 @@ const Zt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
995
1015
|
{
|
|
996
1016
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
997
1017
|
},
|
|
998
|
-
|
|
1018
|
+
N.code
|
|
999
1019
|
)
|
|
1000
1020
|
);
|
|
1001
1021
|
}
|
|
1002
1022
|
},
|
|
1003
1023
|
{
|
|
1004
1024
|
header: "Name",
|
|
1005
|
-
cell: (
|
|
1006
|
-
const
|
|
1025
|
+
cell: (I) => {
|
|
1026
|
+
const N = o.purchaseOrder.items.find((w) => w.id === I.row.original.id || w.sku._id === I.row.original.sku._id);
|
|
1007
1027
|
return L(
|
|
1008
1028
|
v(Je).FmTooltip,
|
|
1009
1029
|
{
|
|
1010
|
-
content:
|
|
1030
|
+
content: N.name,
|
|
1011
1031
|
placement: "top",
|
|
1012
1032
|
variant: "plain",
|
|
1013
1033
|
zIndex: 50
|
|
@@ -1017,39 +1037,39 @@ const Zt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1017
1037
|
{
|
|
1018
1038
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
1019
1039
|
},
|
|
1020
|
-
|
|
1040
|
+
N.name
|
|
1021
1041
|
)
|
|
1022
1042
|
);
|
|
1023
1043
|
}
|
|
1024
1044
|
},
|
|
1025
1045
|
{
|
|
1026
1046
|
header: "Amount",
|
|
1027
|
-
cell: (
|
|
1028
|
-
const
|
|
1047
|
+
cell: (I) => {
|
|
1048
|
+
const N = I.row.original, w = o.purchaseOrder.items.find((r) => r.id === N.id || r.sku._id === N.sku._id), O = N.amount ?? {
|
|
1029
1049
|
amount: 1,
|
|
1030
1050
|
precision: 0
|
|
1031
1051
|
};
|
|
1032
|
-
return L(
|
|
1052
|
+
return L(jt, {
|
|
1033
1053
|
style: {
|
|
1034
1054
|
flex: "1 1 0%"
|
|
1035
1055
|
},
|
|
1036
1056
|
modelValue: {
|
|
1037
|
-
amount:
|
|
1038
|
-
measurement:
|
|
1057
|
+
amount: O,
|
|
1058
|
+
measurement: N.measurement ?? null
|
|
1039
1059
|
},
|
|
1040
|
-
key:
|
|
1041
|
-
unit:
|
|
1042
|
-
"onUpdate:modelValue": (
|
|
1043
|
-
if (!
|
|
1044
|
-
const
|
|
1045
|
-
|
|
1060
|
+
key: N.id ?? N.sku._id,
|
|
1061
|
+
unit: N.sku.unit,
|
|
1062
|
+
"onUpdate:modelValue": (r) => {
|
|
1063
|
+
if (!r) return;
|
|
1064
|
+
const d = f.items.find((i) => i.id === N.id || i.sku._id === N.sku._id);
|
|
1065
|
+
d && (d.amount = r.amount);
|
|
1046
1066
|
},
|
|
1047
1067
|
disableUnit: !0,
|
|
1048
1068
|
rules: [
|
|
1049
|
-
v(
|
|
1069
|
+
v(zt)(
|
|
1050
1070
|
+v(he)({ amount: 0, precision: 0 })
|
|
1051
1071
|
),
|
|
1052
|
-
v(
|
|
1072
|
+
v(Kt)(+v(he)(w.quantity))
|
|
1053
1073
|
],
|
|
1054
1074
|
applyDefaultRules: !0
|
|
1055
1075
|
});
|
|
@@ -1057,19 +1077,19 @@ const Zt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1057
1077
|
}
|
|
1058
1078
|
],
|
|
1059
1079
|
"row-data": f.items,
|
|
1060
|
-
"hide-footer":
|
|
1080
|
+
"hide-footer": A.value
|
|
1061
1081
|
}, null, 8, ["column-defs", "row-data", "hide-footer"])
|
|
1062
1082
|
])
|
|
1063
1083
|
]),
|
|
1064
|
-
e("div",
|
|
1065
|
-
D(
|
|
1084
|
+
e("div", ss, [
|
|
1085
|
+
D(x, {
|
|
1066
1086
|
class: "px-16",
|
|
1067
1087
|
label: "Confirm",
|
|
1068
1088
|
size: "md",
|
|
1069
1089
|
variant: "primary",
|
|
1070
1090
|
type: "submit"
|
|
1071
1091
|
}),
|
|
1072
|
-
D(
|
|
1092
|
+
D(x, {
|
|
1073
1093
|
class: "px-16",
|
|
1074
1094
|
label: "Cancel",
|
|
1075
1095
|
size: "md",
|
|
@@ -1086,88 +1106,67 @@ const Zt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1086
1106
|
submitRequest: {
|
|
1087
1107
|
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
1088
1108
|
color: "primary",
|
|
1089
|
-
buttonVariant:
|
|
1109
|
+
buttonVariant: ge.Primary
|
|
1090
1110
|
},
|
|
1091
1111
|
confirmDraft: {
|
|
1092
1112
|
translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
|
|
1093
1113
|
color: "primary",
|
|
1094
|
-
buttonVariant:
|
|
1114
|
+
buttonVariant: ge.Primary
|
|
1095
1115
|
},
|
|
1096
1116
|
cancelDraft: {
|
|
1097
1117
|
translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
|
|
1098
1118
|
color: "system-error-300",
|
|
1099
|
-
buttonVariant:
|
|
1119
|
+
buttonVariant: ge.Destructive
|
|
1100
1120
|
},
|
|
1101
1121
|
approveDraft: {
|
|
1102
1122
|
translationKey: "inventory.transfer.receiveRequest.actions.approveDraft",
|
|
1103
1123
|
color: "primary",
|
|
1104
|
-
buttonVariant:
|
|
1124
|
+
buttonVariant: ge.Primary
|
|
1105
1125
|
},
|
|
1106
1126
|
rejectDraft: {
|
|
1107
1127
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectDraft",
|
|
1108
1128
|
color: "system-error-300",
|
|
1109
|
-
buttonVariant:
|
|
1129
|
+
buttonVariant: ge.Destructive
|
|
1110
1130
|
},
|
|
1111
1131
|
approveRequest: {
|
|
1112
1132
|
translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
|
|
1113
1133
|
color: "primary",
|
|
1114
|
-
buttonVariant:
|
|
1134
|
+
buttonVariant: ge.Primary
|
|
1115
1135
|
},
|
|
1116
1136
|
processRequest: {
|
|
1117
1137
|
translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
|
|
1118
1138
|
color: "primary",
|
|
1119
|
-
buttonVariant:
|
|
1139
|
+
buttonVariant: ge.Primary
|
|
1120
1140
|
},
|
|
1121
1141
|
receiveStock: {
|
|
1122
1142
|
translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
|
|
1123
1143
|
color: "primary",
|
|
1124
|
-
buttonVariant:
|
|
1144
|
+
buttonVariant: ge.Primary,
|
|
1125
1145
|
available: !1
|
|
1126
1146
|
},
|
|
1127
1147
|
completeReceive: {
|
|
1128
1148
|
translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
|
|
1129
1149
|
color: "primary",
|
|
1130
|
-
buttonVariant:
|
|
1150
|
+
buttonVariant: ge.Plain
|
|
1131
1151
|
},
|
|
1132
1152
|
rejectRequest: {
|
|
1133
1153
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
|
|
1134
1154
|
color: "system-error-300",
|
|
1135
|
-
buttonVariant:
|
|
1155
|
+
buttonVariant: ge.Destructive
|
|
1136
1156
|
},
|
|
1137
1157
|
closeRequest: {
|
|
1138
1158
|
translationKey: "inventory.transfer.receiveRequest.actions.closeRequest",
|
|
1139
1159
|
color: "system-error-300",
|
|
1140
|
-
buttonVariant:
|
|
1160
|
+
buttonVariant: ge.Destructive,
|
|
1141
1161
|
available: !1
|
|
1142
1162
|
},
|
|
1143
1163
|
returnStock: {
|
|
1144
1164
|
translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
|
|
1145
1165
|
color: "primary",
|
|
1146
|
-
buttonVariant:
|
|
1166
|
+
buttonVariant: ge.Primary,
|
|
1147
1167
|
available: !1
|
|
1148
1168
|
}
|
|
1149
|
-
}
|
|
1150
|
-
function rs() {
|
|
1151
|
-
const C = Ue();
|
|
1152
|
-
return {
|
|
1153
|
-
ableToMarkReceived(a) {
|
|
1154
|
-
if (!a || a.status !== te.enum.RECEIVING || C.useOperatePurchaseOrderV2) return !1;
|
|
1155
|
-
const f = De().currentLocationDBName;
|
|
1156
|
-
return `${a.supplier.internal}_${a.supplier._id}` !== f;
|
|
1157
|
-
},
|
|
1158
|
-
ableToMarkApproved(a) {
|
|
1159
|
-
return !(!a || (a == null ? void 0 : a.status) !== te.enum.REQUESTING);
|
|
1160
|
-
},
|
|
1161
|
-
ableToCreateFulfillment(a, o) {
|
|
1162
|
-
var n, g;
|
|
1163
|
-
if (!C.acceptRequireFulfillment || !a || !o || a.status !== te.enum.PROCESSING || !o.processedAt)
|
|
1164
|
-
return !1;
|
|
1165
|
-
const f = (n = o == null ? void 0 : o.from) == null ? void 0 : n.dbName, h = (g = o == null ? void 0 : o.to) == null ? void 0 : g.dbName;
|
|
1166
|
-
return !(f.startsWith("restaurant_") && h.startsWith("restaurant_"));
|
|
1167
|
-
}
|
|
1168
|
-
};
|
|
1169
|
-
}
|
|
1170
|
-
const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
1169
|
+
}, os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
1171
1170
|
__name: "NetSuiteSync",
|
|
1172
1171
|
props: {
|
|
1173
1172
|
poRequest: {},
|
|
@@ -1176,16 +1175,16 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1176
1175
|
scope: {}
|
|
1177
1176
|
},
|
|
1178
1177
|
setup(C) {
|
|
1179
|
-
const a = C, o = et(), f = Be(),
|
|
1178
|
+
const a = C, o = et(), f = Be(), b = tt(), n = J(!1);
|
|
1180
1179
|
Y(() => {
|
|
1181
|
-
var
|
|
1182
|
-
let
|
|
1183
|
-
o.isEnabled || (
|
|
1184
|
-
const c = a.purchaseOrder,
|
|
1185
|
-
return c && ((
|
|
1180
|
+
var x, u, I, N;
|
|
1181
|
+
let t = !0;
|
|
1182
|
+
o.isEnabled || (t = !1);
|
|
1183
|
+
const c = a.purchaseOrder, S = a.poRequest;
|
|
1184
|
+
return c && ((x = c == null ? void 0 : c.supplier) != null && x.internal ? (!S && c.status == se.enum.DRAFT && (t = !1), S && !((u = S == null ? void 0 : S.netSuite) != null && u.id) && (t = !1), a.isTransferBetweenOutlets && (t = !1)) : ((c == null ? void 0 : c.status) !== se.enum.REQUESTING && c.supplier.internal && (t = !1), !S && !((I = c == null ? void 0 : c.netSuite) != null && I.id) && (t = !1), !S && ((N = c == null ? void 0 : c.netSuite) != null && N.id) && (c == null ? void 0 : c.status) == se.enum.REQUESTING && (t = !1))), t;
|
|
1186
1185
|
});
|
|
1187
|
-
async function
|
|
1188
|
-
n.value ||
|
|
1186
|
+
async function A() {
|
|
1187
|
+
n.value || b.open({
|
|
1189
1188
|
title: "Sync with NetSuite",
|
|
1190
1189
|
contentComponent: L("div", [
|
|
1191
1190
|
L("p", "Are you sure you want to sync now?"),
|
|
@@ -1203,18 +1202,18 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1203
1202
|
},
|
|
1204
1203
|
secondaryActions: { text: "Not now", close: !0 }
|
|
1205
1204
|
}).onPrimary(async () => {
|
|
1206
|
-
var
|
|
1205
|
+
var t, c, S;
|
|
1207
1206
|
try {
|
|
1208
1207
|
n.value = !0;
|
|
1209
|
-
const
|
|
1208
|
+
const x = ((t = a.purchaseOrder) == null ? void 0 : t._id) || ((c = a.poRequest) == null ? void 0 : c.purchaseOrderId) || "", u = (S = a.poRequest) == null ? void 0 : S.to.dbName;
|
|
1210
1209
|
await o.syncPurchaseOrder(
|
|
1211
|
-
|
|
1212
|
-
a.scope === "approval" ?
|
|
1210
|
+
x,
|
|
1211
|
+
a.scope === "approval" ? u : void 0
|
|
1213
1212
|
), f.open({
|
|
1214
1213
|
title: "Sync with NetSuite",
|
|
1215
1214
|
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
1216
1215
|
type: "success"
|
|
1217
|
-
}), await new Promise((
|
|
1216
|
+
}), await new Promise((I) => setTimeout(I, 5e3)), n.value = !1;
|
|
1218
1217
|
} catch {
|
|
1219
1218
|
f.open({
|
|
1220
1219
|
title: "Error",
|
|
@@ -1224,15 +1223,15 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1224
1223
|
}
|
|
1225
1224
|
});
|
|
1226
1225
|
}
|
|
1227
|
-
return (
|
|
1228
|
-
const
|
|
1229
|
-
return
|
|
1230
|
-
D(
|
|
1226
|
+
return (t, c) => {
|
|
1227
|
+
const S = H("FmButton");
|
|
1228
|
+
return l(), h("div", os, [
|
|
1229
|
+
D(S, {
|
|
1231
1230
|
"prepend-icon": "sync",
|
|
1232
1231
|
variant: "secondary",
|
|
1233
1232
|
label: "Sync",
|
|
1234
1233
|
loading: n.value,
|
|
1235
|
-
onClick:
|
|
1234
|
+
onClick: A,
|
|
1236
1235
|
"text-color": "primary",
|
|
1237
1236
|
"bg-color": "transparent",
|
|
1238
1237
|
"border-color": "primary"
|
|
@@ -1249,7 +1248,7 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1249
1248
|
}, us = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ds = { class: "fm-typo-en-body-lg-600" }, ms = { key: 0 }, ps = { key: 1 }, fs = {
|
|
1250
1249
|
key: 1,
|
|
1251
1250
|
class: "flex flex-col gap-4"
|
|
1252
|
-
}, ys = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vs = { class: "fm-typo-en-body-lg-600" },
|
|
1251
|
+
}, ys = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vs = { class: "fm-typo-en-body-lg-600" }, bs = { key: 0 }, hs = { key: 1 }, gs = {
|
|
1253
1252
|
key: 2,
|
|
1254
1253
|
class: "flex flex-col gap-4"
|
|
1255
1254
|
}, _s = { class: "fm-typo-en-body-lg-600" }, Ss = {
|
|
@@ -1266,57 +1265,57 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1266
1265
|
scope: {}
|
|
1267
1266
|
},
|
|
1268
1267
|
setup(C) {
|
|
1269
|
-
const a = C, o = et(), f = je(),
|
|
1268
|
+
const a = C, o = et(), f = je(), b = J(a.poRequest);
|
|
1270
1269
|
yt(async () => {
|
|
1271
1270
|
var c;
|
|
1272
1271
|
if (!a.poRequest && ((c = a.purchaseOrder) != null && c._id)) {
|
|
1273
|
-
const
|
|
1274
|
-
|
|
1272
|
+
const S = await f.getLatestPurchaseOrderRequest(a.purchaseOrder._id);
|
|
1273
|
+
b.value = S;
|
|
1275
1274
|
}
|
|
1276
1275
|
});
|
|
1277
1276
|
const n = Y(
|
|
1278
1277
|
() => {
|
|
1279
|
-
var c,
|
|
1278
|
+
var c, S, x, u, I, N;
|
|
1280
1279
|
return o.getSubsidiaryFullName(
|
|
1281
|
-
((
|
|
1280
|
+
((x = (S = (c = a.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : S.subsidiary) == null ? void 0 : x.id) || ((N = (I = (u = a.poRequest) == null ? void 0 : u.netSuite) == null ? void 0 : I.subsidiary) == null ? void 0 : N.id)
|
|
1282
1281
|
).fullName;
|
|
1283
1282
|
}
|
|
1284
|
-
),
|
|
1285
|
-
var c,
|
|
1286
|
-
return (
|
|
1287
|
-
}),
|
|
1288
|
-
var c,
|
|
1289
|
-
return (
|
|
1290
|
-
var
|
|
1291
|
-
return (
|
|
1283
|
+
), A = Y(() => {
|
|
1284
|
+
var c, S, x, u, I, N, w, O, r, d, i, g;
|
|
1285
|
+
return (x = (S = (c = a.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : S.additionalInfo) != null && x.transactionnumber ? (N = (I = (u = a.purchaseOrder) == null ? void 0 : u.netSuite) == null ? void 0 : I.additionalInfo) == null ? void 0 : N.transactionnumber : (r = (O = (w = b.value) == null ? void 0 : w.netSuite) == null ? void 0 : O.additionalInfo) != null && r.transactionnumber ? (g = (i = (d = b.value) == null ? void 0 : d.netSuite) == null ? void 0 : i.additionalInfo) == null ? void 0 : g.transactionnumber : null;
|
|
1286
|
+
}), t = Y(() => {
|
|
1287
|
+
var c, S, x, u, I, N;
|
|
1288
|
+
return (S = (c = a.purchaseOrder) == null ? void 0 : c.deliveryFullfillment) != null && S.length && ((u = (x = a.purchaseOrder) == null ? void 0 : x.deliveryFullfillment) == null ? void 0 : u.length) > 0 ? (N = (I = a.purchaseOrder) == null ? void 0 : I.deliveryFullfillment) == null ? void 0 : N.map((w) => {
|
|
1289
|
+
var O;
|
|
1290
|
+
return (O = w.netSuite) == null ? void 0 : O.refNo;
|
|
1292
1291
|
}).join(", ") : "N/A";
|
|
1293
1292
|
});
|
|
1294
|
-
return (c,
|
|
1295
|
-
var
|
|
1296
|
-
return v(o).isEnabled ? (
|
|
1293
|
+
return (c, S) => {
|
|
1294
|
+
var x, u, I, N, w, O, r, d, i, g, $, K, R, X, j, Q;
|
|
1295
|
+
return v(o).isEnabled ? (l(), h("div", as, [
|
|
1297
1296
|
e("div", ls, [
|
|
1298
|
-
|
|
1297
|
+
S[0] || (S[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
1299
1298
|
e("div", is, y(n.value || "N/A"), 1)
|
|
1300
1299
|
]),
|
|
1301
|
-
!c.isTransferBetweenOutlets && c.scope === v(lt).RECEIVE_REQUEST ? (
|
|
1302
|
-
e("div", us, " NetSuite " + y((
|
|
1300
|
+
!c.isTransferBetweenOutlets && c.scope === v(lt).RECEIVE_REQUEST ? (l(), h("div", cs, [
|
|
1301
|
+
e("div", us, " NetSuite " + y((u = (x = c.purchaseOrder) == null ? void 0 : x.netSuite) != null && u.recordType ? v(bt)((N = (I = c.purchaseOrder) == null ? void 0 : I.netSuite) == null ? void 0 : N.recordType) : c.transferType === v(Ge).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1303
1302
|
e("div", ds, [
|
|
1304
|
-
(
|
|
1303
|
+
(O = (w = c.purchaseOrder) == null ? void 0 : w.netSuite) != null && O.id ? (l(), h("span", ms, y((d = (r = c.purchaseOrder) == null ? void 0 : r.netSuite) == null ? void 0 : d.refNo) + " (" + y((g = (i = c.purchaseOrder) == null ? void 0 : i.netSuite) == null ? void 0 : g.id) + ") ", 1)) : (l(), h("span", ps, "N/A"))
|
|
1305
1304
|
])
|
|
1306
1305
|
])) : U("", !0),
|
|
1307
|
-
!c.isTransferBetweenOutlets &&
|
|
1306
|
+
!c.isTransferBetweenOutlets && b.value || c.scope === v(lt).APPROVAL ? (l(), h("div", fs, [
|
|
1308
1307
|
e("div", ys, " (Request) NetSuite " + y(c.transferType === v(Ge).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1309
1308
|
e("div", vs, [
|
|
1310
|
-
(
|
|
1309
|
+
(K = ($ = b.value) == null ? void 0 : $.netSuite) != null && K.id ? (l(), h("span", bs, y((X = (R = b.value) == null ? void 0 : R.netSuite) == null ? void 0 : X.refNo) + " (" + y((Q = (j = b.value) == null ? void 0 : j.netSuite) == null ? void 0 : Q.id) + ") ", 1)) : (l(), h("span", hs, "N/A"))
|
|
1311
1310
|
])
|
|
1312
1311
|
])) : U("", !0),
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
e("div", _s, y(
|
|
1312
|
+
A.value ? (l(), h("div", gs, [
|
|
1313
|
+
S[1] || (S[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
|
|
1314
|
+
e("div", _s, y(A.value), 1)
|
|
1316
1315
|
])) : U("", !0),
|
|
1317
|
-
v(o).isEnabled && c.transferType === v(Ge).enum.transfer && !c.isTransferBetweenOutlets ? (
|
|
1318
|
-
|
|
1319
|
-
e("div", xs, y(
|
|
1316
|
+
v(o).isEnabled && c.transferType === v(Ge).enum.transfer && !c.isTransferBetweenOutlets ? (l(), h("div", Ss, [
|
|
1317
|
+
S[2] || (S[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
1318
|
+
e("div", xs, y(t.value), 1)
|
|
1320
1319
|
])) : U("", !0)
|
|
1321
1320
|
])) : U("", !0);
|
|
1322
1321
|
};
|
|
@@ -1329,36 +1328,36 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1329
1328
|
},
|
|
1330
1329
|
setup(C) {
|
|
1331
1330
|
const a = Be(), o = dt();
|
|
1332
|
-
async function f(
|
|
1333
|
-
const
|
|
1334
|
-
if (
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1331
|
+
async function f(b, n) {
|
|
1332
|
+
const A = [];
|
|
1333
|
+
if (b && A.push(`body.message:*${b}*`), n) {
|
|
1334
|
+
const x = n.replace(/:/g, "\\:");
|
|
1335
|
+
A.push(`${x}`);
|
|
1337
1336
|
}
|
|
1338
|
-
if (
|
|
1337
|
+
if (A.length === 0) {
|
|
1339
1338
|
a.open({
|
|
1340
1339
|
message: "Cannot open logs without valid filters.",
|
|
1341
1340
|
type: "error"
|
|
1342
1341
|
});
|
|
1343
1342
|
return;
|
|
1344
1343
|
}
|
|
1345
|
-
const c = `attributes.pod:netsuite* AND (${
|
|
1344
|
+
const c = `attributes.pod:netsuite* AND (${A.join(" OR ")})`, { url: S } = await o.getSyncLogs(c);
|
|
1346
1345
|
a.open(
|
|
1347
1346
|
{
|
|
1348
1347
|
message: "Opening NetSuite logs...",
|
|
1349
1348
|
type: "info"
|
|
1350
1349
|
},
|
|
1351
1350
|
800
|
|
1352
|
-
), await new Promise((
|
|
1351
|
+
), await new Promise((x) => setTimeout(x, 800)), window.open(S, "_blank");
|
|
1353
1352
|
}
|
|
1354
|
-
return (
|
|
1355
|
-
const
|
|
1356
|
-
return
|
|
1357
|
-
D(
|
|
1353
|
+
return (b, n) => {
|
|
1354
|
+
const A = H("FmButton");
|
|
1355
|
+
return l(), h("div", ws, [
|
|
1356
|
+
D(A, {
|
|
1358
1357
|
"prepend-icon": "history",
|
|
1359
1358
|
variant: "secondary",
|
|
1360
1359
|
label: "Logs",
|
|
1361
|
-
onClick: n[0] || (n[0] = (
|
|
1360
|
+
onClick: n[0] || (n[0] = (t) => f(b.netsuiteId, b.purchaseOrderId)),
|
|
1362
1361
|
"text-color": "primary",
|
|
1363
1362
|
"bg-color": "transparent",
|
|
1364
1363
|
"border-color": "primary"
|
|
@@ -1382,39 +1381,39 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1382
1381
|
purchaseOrderId: {}
|
|
1383
1382
|
},
|
|
1384
1383
|
setup(C) {
|
|
1385
|
-
const a = C, o = dt(), f = J(!1),
|
|
1386
|
-
async function
|
|
1387
|
-
if (!
|
|
1384
|
+
const a = C, o = dt(), f = J(!1), b = De(), n = J(!0), A = J(!1), t = J(!1), c = J(!1), S = J(null), x = J([]);
|
|
1385
|
+
async function u() {
|
|
1386
|
+
if (!S.value) {
|
|
1388
1387
|
f.value = !0;
|
|
1389
1388
|
try {
|
|
1390
1389
|
n.value = !0;
|
|
1391
|
-
const
|
|
1392
|
-
|
|
1390
|
+
const O = await o.getMoreInfo(
|
|
1391
|
+
b.currentLocation.dbName,
|
|
1393
1392
|
a.purchaseOrderId
|
|
1394
1393
|
);
|
|
1395
|
-
|
|
1394
|
+
S.value = O, A.value = !1;
|
|
1396
1395
|
} catch {
|
|
1397
|
-
|
|
1396
|
+
A.value = !0;
|
|
1398
1397
|
} finally {
|
|
1399
1398
|
n.value = !1;
|
|
1400
1399
|
}
|
|
1401
|
-
await
|
|
1400
|
+
await I();
|
|
1402
1401
|
}
|
|
1403
1402
|
}
|
|
1404
|
-
async function
|
|
1405
|
-
if (!(
|
|
1403
|
+
async function I() {
|
|
1404
|
+
if (!(x.value.length > 0))
|
|
1406
1405
|
try {
|
|
1407
|
-
|
|
1408
|
-
const
|
|
1409
|
-
|
|
1406
|
+
t.value = !0;
|
|
1407
|
+
const O = await o.getChangeLogs(a.netsuiteId);
|
|
1408
|
+
x.value = O, c.value = !1;
|
|
1410
1409
|
} catch {
|
|
1411
1410
|
c.value = !0;
|
|
1412
1411
|
} finally {
|
|
1413
|
-
|
|
1412
|
+
t.value = !1;
|
|
1414
1413
|
}
|
|
1415
1414
|
}
|
|
1416
|
-
function
|
|
1417
|
-
switch (
|
|
1415
|
+
function N(O) {
|
|
1416
|
+
switch (O) {
|
|
1418
1417
|
case we.Create:
|
|
1419
1418
|
return "text-green-600 bg-green-100";
|
|
1420
1419
|
case we.Set:
|
|
@@ -1427,8 +1426,8 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1427
1426
|
return "text-gray-600 bg-gray-100";
|
|
1428
1427
|
}
|
|
1429
1428
|
}
|
|
1430
|
-
function
|
|
1431
|
-
return new Date(
|
|
1429
|
+
function w(O) {
|
|
1430
|
+
return new Date(O).toLocaleDateString("en-US", {
|
|
1432
1431
|
year: "numeric",
|
|
1433
1432
|
month: "short",
|
|
1434
1433
|
day: "numeric",
|
|
@@ -1436,64 +1435,64 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1436
1435
|
minute: "2-digit"
|
|
1437
1436
|
});
|
|
1438
1437
|
}
|
|
1439
|
-
return (
|
|
1440
|
-
const
|
|
1441
|
-
return
|
|
1442
|
-
D(
|
|
1438
|
+
return (O, r) => {
|
|
1439
|
+
const d = H("FmButton"), i = H("FmLabel"), g = H("FmCircularProgress"), $ = H("FmIcon"), K = H("FmDialog");
|
|
1440
|
+
return l(), h("div", Cs, [
|
|
1441
|
+
D(K, {
|
|
1443
1442
|
modelValue: f.value,
|
|
1444
|
-
"onUpdate:modelValue":
|
|
1443
|
+
"onUpdate:modelValue": r[2] || (r[2] = (R) => f.value = R),
|
|
1445
1444
|
overlay: !0,
|
|
1446
1445
|
"max-width": 800
|
|
1447
1446
|
}, {
|
|
1448
|
-
"dialog-button":
|
|
1449
|
-
D(
|
|
1447
|
+
"dialog-button": ee(() => [
|
|
1448
|
+
D(d, {
|
|
1450
1449
|
"prepend-icon": "info",
|
|
1451
1450
|
variant: "secondary",
|
|
1452
1451
|
label: "Latest Info",
|
|
1453
|
-
onClick:
|
|
1452
|
+
onClick: r[0] || (r[0] = (R) => u()),
|
|
1454
1453
|
"text-color": "primary",
|
|
1455
1454
|
"bg-color": "transparent",
|
|
1456
1455
|
"border-color": "primary"
|
|
1457
1456
|
})
|
|
1458
1457
|
]),
|
|
1459
|
-
"dialog-header":
|
|
1458
|
+
"dialog-header": ee(() => r[3] || (r[3] = [
|
|
1460
1459
|
e("div", null, "NetSuite latest info", -1)
|
|
1461
1460
|
])),
|
|
1462
|
-
default:
|
|
1463
|
-
n.value ? (
|
|
1464
|
-
|
|
1461
|
+
default: ee(() => [
|
|
1462
|
+
n.value ? (l(), h("div", Rs, "Loading...")) : (l(), h("div", ks, [
|
|
1463
|
+
A.value ? (l(), h("p", Hs, "Something went wrong.")) : (l(), h(de, { key: 0 }, [
|
|
1465
1464
|
e("div", Ds, [
|
|
1466
|
-
|
|
1467
|
-
(
|
|
1468
|
-
key:
|
|
1465
|
+
r[4] || (r[4] = e("h3", { class: "fm-typo-en-body-lg-600 mb-4" }, "NetSuite Order Details", -1)),
|
|
1466
|
+
(l(!0), h(de, null, xe(S.value, (R, X) => (l(), h("div", {
|
|
1467
|
+
key: X,
|
|
1469
1468
|
class: "mb-2"
|
|
1470
1469
|
}, [
|
|
1471
1470
|
e("div", null, [
|
|
1472
|
-
D(
|
|
1473
|
-
label: v(it)(
|
|
1471
|
+
D(i, {
|
|
1472
|
+
label: v(it)(X)
|
|
1474
1473
|
}, null, 8, ["label"]),
|
|
1475
1474
|
e("div", As, [
|
|
1476
|
-
Array.isArray(R) ? (
|
|
1475
|
+
Array.isArray(R) ? (l(), h("span", Ns, y(R.length > 0 ? R.join(", ") : "N/A"), 1)) : (l(), h("span", Fs, y(R), 1))
|
|
1477
1476
|
])
|
|
1478
1477
|
])
|
|
1479
1478
|
]))), 128))
|
|
1480
1479
|
]),
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
D(
|
|
1480
|
+
t.value ? (l(), h("div", Ts, [
|
|
1481
|
+
r[5] || (r[5] = e("span", null, "Change Log Loading...", -1)),
|
|
1482
|
+
D(g, { size: "md" })
|
|
1484
1483
|
])) : U("", !0),
|
|
1485
|
-
!
|
|
1484
|
+
!t.value && x.value.length > 0 ? (l(), h("div", Is, [
|
|
1486
1485
|
e("h3", Ps, [
|
|
1487
|
-
D(
|
|
1486
|
+
D($, {
|
|
1488
1487
|
name: "error",
|
|
1489
1488
|
color: "#ff9500",
|
|
1490
1489
|
size: "sm"
|
|
1491
1490
|
}),
|
|
1492
|
-
|
|
1491
|
+
r[6] || (r[6] = ke(" Change Logs "))
|
|
1493
1492
|
]),
|
|
1494
1493
|
e("div", qs, [
|
|
1495
1494
|
e("table", Vs, [
|
|
1496
|
-
|
|
1495
|
+
r[7] || (r[7] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
|
|
1497
1496
|
e("tr", { class: "border-b border-fm-color-neutral-gray-200" }, [
|
|
1498
1497
|
e("th", {
|
|
1499
1498
|
class: "text-left p-3 fm-typo-en-body-md-600",
|
|
@@ -1510,16 +1509,16 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1510
1509
|
])
|
|
1511
1510
|
], -1)),
|
|
1512
1511
|
e("tbody", null, [
|
|
1513
|
-
(
|
|
1514
|
-
key:
|
|
1512
|
+
(l(!0), h(de, null, xe(x.value, (R, X) => (l(), h("tr", {
|
|
1513
|
+
key: X,
|
|
1515
1514
|
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
1516
1515
|
}, [
|
|
1517
|
-
e("td", Es, y(
|
|
1516
|
+
e("td", Es, y(w(R._dateiso8601)), 1),
|
|
1518
1517
|
e("td", Ls, y(R._rolename), 1),
|
|
1519
1518
|
e("td", Ms, y(R._employeename), 1),
|
|
1520
1519
|
e("td", Us, y(R._contextname), 1),
|
|
1521
1520
|
e("td", {
|
|
1522
|
-
class: Me(`p-3 fm-typo-en-body-sm-600 ${
|
|
1521
|
+
class: Me(`p-3 fm-typo-en-body-sm-600 ${N(Number(R.type) - 1)}`)
|
|
1523
1522
|
}, y(v(we)[Number(R.type) - 1]), 3),
|
|
1524
1523
|
e("td", Bs, y(R.lineid || ""), 1),
|
|
1525
1524
|
e("td", js, y(R._fieldname), 1),
|
|
@@ -1529,19 +1528,19 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1529
1528
|
])
|
|
1530
1529
|
])
|
|
1531
1530
|
])
|
|
1532
|
-
])) : (
|
|
1531
|
+
])) : (l(), h("div", Gs, r[8] || (r[8] = [
|
|
1533
1532
|
e("p", null, "No change logs available.", -1)
|
|
1534
1533
|
])))
|
|
1535
1534
|
], 64))
|
|
1536
1535
|
]))
|
|
1537
1536
|
]),
|
|
1538
|
-
"dialog-footer":
|
|
1539
|
-
D(
|
|
1537
|
+
"dialog-footer": ee(() => [
|
|
1538
|
+
D(d, {
|
|
1540
1539
|
class: "ml-auto sm:w-full xs:w-full",
|
|
1541
1540
|
label: "Close",
|
|
1542
1541
|
size: "md",
|
|
1543
1542
|
variant: "primary",
|
|
1544
|
-
onClick:
|
|
1543
|
+
onClick: r[1] || (r[1] = (R) => f.value = !1)
|
|
1545
1544
|
})
|
|
1546
1545
|
]),
|
|
1547
1546
|
_: 1
|
|
@@ -1562,56 +1561,56 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1562
1561
|
scope: {}
|
|
1563
1562
|
},
|
|
1564
1563
|
setup(C) {
|
|
1565
|
-
const a = C, o =
|
|
1566
|
-
return (
|
|
1567
|
-
var
|
|
1568
|
-
const
|
|
1569
|
-
return f.value ? (
|
|
1564
|
+
const a = C, o = Ht(), f = Y(() => o.isNetSuiteEnabled);
|
|
1565
|
+
return (b, n) => {
|
|
1566
|
+
var t, c;
|
|
1567
|
+
const A = H("FmMenuDivider");
|
|
1568
|
+
return f.value ? (l(), h("div", Ys, [
|
|
1570
1569
|
e("div", Qs, [
|
|
1571
1570
|
n[0] || (n[0] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
1572
1571
|
e("div", Js, [
|
|
1573
1572
|
e("div", Xs, [
|
|
1574
|
-
(c = (
|
|
1575
|
-
default:
|
|
1576
|
-
var
|
|
1573
|
+
(c = (t = a.purchaseOrder) == null ? void 0 : t.netSuite) != null && c.id ? (l(), re(Ve, { key: 0 }, {
|
|
1574
|
+
default: ee(() => {
|
|
1575
|
+
var S, x, u;
|
|
1577
1576
|
return [
|
|
1578
1577
|
D(Ws, {
|
|
1579
|
-
"netsuite-id": (
|
|
1580
|
-
"purchase-order-id": (
|
|
1578
|
+
"netsuite-id": (x = (S = b.purchaseOrder) == null ? void 0 : S.netSuite) == null ? void 0 : x.id,
|
|
1579
|
+
"purchase-order-id": (u = b.purchaseOrder) == null ? void 0 : u._id
|
|
1581
1580
|
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
1582
1581
|
];
|
|
1583
1582
|
}),
|
|
1584
1583
|
_: 1
|
|
1585
1584
|
})) : U("", !0),
|
|
1586
|
-
D(
|
|
1587
|
-
default:
|
|
1588
|
-
var
|
|
1585
|
+
D(Ve, null, {
|
|
1586
|
+
default: ee(() => {
|
|
1587
|
+
var S, x, u;
|
|
1589
1588
|
return [
|
|
1590
1589
|
D($s, {
|
|
1591
|
-
"netsuite-id": (
|
|
1592
|
-
"purchase-order-id": (
|
|
1590
|
+
"netsuite-id": (x = (S = b.purchaseOrder) == null ? void 0 : S.netSuite) == null ? void 0 : x.id,
|
|
1591
|
+
"purchase-order-id": (u = b.purchaseOrder) == null ? void 0 : u._id
|
|
1593
1592
|
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
1594
1593
|
];
|
|
1595
1594
|
}),
|
|
1596
1595
|
_: 1
|
|
1597
1596
|
}),
|
|
1598
1597
|
D(ns, {
|
|
1599
|
-
"po-request":
|
|
1600
|
-
"purchase-order":
|
|
1598
|
+
"po-request": b.poRequest,
|
|
1599
|
+
"purchase-order": b.purchaseOrder,
|
|
1601
1600
|
"is-transfer-between-outlets": !f.value,
|
|
1602
|
-
scope:
|
|
1601
|
+
scope: b.scope
|
|
1603
1602
|
}, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets", "scope"])
|
|
1604
1603
|
])
|
|
1605
1604
|
])
|
|
1606
1605
|
]),
|
|
1607
|
-
D(
|
|
1606
|
+
D(A),
|
|
1608
1607
|
D(Os, {
|
|
1609
|
-
"po-request":
|
|
1610
|
-
"purchase-order":
|
|
1611
|
-
"transfer-type":
|
|
1612
|
-
"transfer-to-db-name":
|
|
1608
|
+
"po-request": b.poRequest,
|
|
1609
|
+
"purchase-order": b.purchaseOrder,
|
|
1610
|
+
"transfer-type": b.transferType,
|
|
1611
|
+
"transfer-to-db-name": b.transferToDbName,
|
|
1613
1612
|
"is-transfer-between-outlets": !f.value,
|
|
1614
|
-
scope:
|
|
1613
|
+
scope: b.scope
|
|
1615
1614
|
}, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
|
|
1616
1615
|
])) : U("", !0);
|
|
1617
1616
|
};
|
|
@@ -1625,7 +1624,7 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1625
1624
|
}, mr = { class: "flex flex-col gap-4" }, pr = { class: "flex flex-col gap-4" }, fr = { class: "flex flex-col gap-4" }, yr = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, vr = {
|
|
1626
1625
|
key: 0,
|
|
1627
1626
|
class: "flex flex-col gap-4"
|
|
1628
|
-
},
|
|
1627
|
+
}, br = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, hr = /* @__PURE__ */ $e({
|
|
1629
1628
|
__name: "EditForm",
|
|
1630
1629
|
props: {
|
|
1631
1630
|
purchaseOrder: {},
|
|
@@ -1633,57 +1632,57 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1633
1632
|
},
|
|
1634
1633
|
emits: ["submitted"],
|
|
1635
1634
|
setup(C, { emit: a }) {
|
|
1636
|
-
|
|
1637
|
-
const o = Ue(), f = Be(),
|
|
1635
|
+
Yt();
|
|
1636
|
+
const o = Ue(), f = Be(), b = J(!1), n = C, A = a, t = St("deliveryOrder"), c = je(), S = Y(
|
|
1638
1637
|
() => {
|
|
1639
|
-
var
|
|
1640
|
-
return ((
|
|
1641
|
-
(
|
|
1638
|
+
var d;
|
|
1639
|
+
return ((d = n.purchaseOrder.deliveryFullfillment) == null ? void 0 : d.findIndex(
|
|
1640
|
+
(i) => n.deliveryOrder.fullfillmentId && i.id === n.deliveryOrder.fullfillmentId
|
|
1642
1641
|
)) ?? -1;
|
|
1643
1642
|
}
|
|
1644
|
-
),
|
|
1643
|
+
), x = o.enablePurchaseOrderReceiveWithCustomCost, u = o.enablePortalDeliveryOrderWrite, I = J({}), N = Y(() => n.purchaseOrder.items.map((d, i) => Y({
|
|
1645
1644
|
get: () => {
|
|
1646
|
-
var
|
|
1647
|
-
const
|
|
1648
|
-
return
|
|
1645
|
+
var $;
|
|
1646
|
+
const g = ($ = t.received[i]) == null ? void 0 : $.cost;
|
|
1647
|
+
return g ? +he(g) : 0;
|
|
1649
1648
|
},
|
|
1650
|
-
set: (
|
|
1651
|
-
|
|
1649
|
+
set: (g) => {
|
|
1650
|
+
t.received[i].cost = {
|
|
1652
1651
|
currency: Ce(),
|
|
1653
|
-
...Qe(
|
|
1652
|
+
...Qe(g, 4)
|
|
1654
1653
|
};
|
|
1655
1654
|
}
|
|
1656
|
-
}))),
|
|
1655
|
+
}))), w = Y(() => n.deliveryOrder.received.map((d, i) => Y({
|
|
1657
1656
|
get: () => {
|
|
1658
|
-
var
|
|
1659
|
-
const
|
|
1660
|
-
return
|
|
1657
|
+
var $;
|
|
1658
|
+
const g = ($ = t.received[i]) == null ? void 0 : $.amount;
|
|
1659
|
+
return g ? +he(g) : 0;
|
|
1661
1660
|
},
|
|
1662
|
-
set: (
|
|
1663
|
-
|
|
1661
|
+
set: (g) => {
|
|
1662
|
+
t.received[i].amount = Qe(g, 2);
|
|
1664
1663
|
}
|
|
1665
1664
|
})));
|
|
1666
|
-
function
|
|
1667
|
-
const
|
|
1668
|
-
if (
|
|
1669
|
-
const
|
|
1670
|
-
|
|
1671
|
-
currency:
|
|
1672
|
-
amount:
|
|
1673
|
-
precision:
|
|
1674
|
-
} :
|
|
1665
|
+
function O(d) {
|
|
1666
|
+
const i = !I.value[d];
|
|
1667
|
+
if (I.value[d] = i, i) {
|
|
1668
|
+
const g = n.deliveryOrder.received[d];
|
|
1669
|
+
g.cost ? t.received[d].cost = {
|
|
1670
|
+
currency: g.cost.currency,
|
|
1671
|
+
amount: g.cost.amount,
|
|
1672
|
+
precision: g.cost.precision
|
|
1673
|
+
} : t.received[d].cost = {
|
|
1675
1674
|
currency: Ce(),
|
|
1676
1675
|
amount: 0,
|
|
1677
1676
|
precision: 4
|
|
1678
1677
|
};
|
|
1679
1678
|
} else
|
|
1680
|
-
delete
|
|
1679
|
+
delete t.received[d].cost;
|
|
1681
1680
|
}
|
|
1682
|
-
function
|
|
1681
|
+
function r() {
|
|
1683
1682
|
c.updateDeliveryOrder({
|
|
1684
1683
|
deliveryOrder: {
|
|
1685
1684
|
...n.deliveryOrder,
|
|
1686
|
-
...
|
|
1685
|
+
...t
|
|
1687
1686
|
},
|
|
1688
1687
|
purchaseOrderId: n.purchaseOrder._id,
|
|
1689
1688
|
purchaseOrderRev: n.purchaseOrder._rev
|
|
@@ -1695,18 +1694,18 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1695
1694
|
type: "success"
|
|
1696
1695
|
},
|
|
1697
1696
|
1e4
|
|
1698
|
-
),
|
|
1697
|
+
), b.value = !1, A("submitted");
|
|
1699
1698
|
});
|
|
1700
1699
|
}
|
|
1701
|
-
return (
|
|
1702
|
-
const
|
|
1703
|
-
return
|
|
1704
|
-
modelValue:
|
|
1705
|
-
"onUpdate:modelValue":
|
|
1700
|
+
return (d, i) => {
|
|
1701
|
+
const g = H("FmButton"), $ = H("FmStepperField"), K = H("FmSwitch"), R = H("FmTextField"), X = H("FmDialog");
|
|
1702
|
+
return l(), re(X, {
|
|
1703
|
+
modelValue: b.value,
|
|
1704
|
+
"onUpdate:modelValue": i[1] || (i[1] = (j) => b.value = j),
|
|
1706
1705
|
overlay: !0
|
|
1707
1706
|
}, {
|
|
1708
|
-
"dialog-button":
|
|
1709
|
-
v(
|
|
1707
|
+
"dialog-button": ee(() => [
|
|
1708
|
+
v(u) ? (l(), re(g, {
|
|
1710
1709
|
key: 0,
|
|
1711
1710
|
variant: "plain",
|
|
1712
1711
|
label: "Edit",
|
|
@@ -1714,56 +1713,56 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1714
1713
|
"prepend-icon": "edit"
|
|
1715
1714
|
})) : U("", !0)
|
|
1716
1715
|
]),
|
|
1717
|
-
"dialog-header":
|
|
1716
|
+
"dialog-header": ee(() => [
|
|
1718
1717
|
e("div", null, "Received on " + y(v(He)(n.deliveryOrder.createdAt)), 1)
|
|
1719
1718
|
]),
|
|
1720
|
-
"dialog-footer":
|
|
1721
|
-
D(
|
|
1719
|
+
"dialog-footer": ee(() => [
|
|
1720
|
+
D(g, {
|
|
1722
1721
|
class: "ml-auto",
|
|
1723
1722
|
label: "Apply changes",
|
|
1724
1723
|
size: "md",
|
|
1725
1724
|
variant: "destructive",
|
|
1726
|
-
onClick:
|
|
1725
|
+
onClick: r
|
|
1727
1726
|
})
|
|
1728
1727
|
]),
|
|
1729
|
-
default:
|
|
1728
|
+
default: ee(() => [
|
|
1730
1729
|
e("div", null, [
|
|
1731
1730
|
e("div", er, [
|
|
1732
1731
|
e("div", tr, [
|
|
1733
|
-
|
|
1732
|
+
i[2] || (i[2] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Adjustment date", -1)),
|
|
1734
1733
|
e("div", sr, y(n.deliveryOrder.adjustment ? v(He)(new Date(v(Ye)(n.deliveryOrder.adjustment))) : "-"), 1)
|
|
1735
1734
|
]),
|
|
1736
1735
|
e("div", rr, [
|
|
1737
|
-
|
|
1738
|
-
(
|
|
1739
|
-
var
|
|
1740
|
-
return
|
|
1736
|
+
i[4] || (i[4] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received items", -1)),
|
|
1737
|
+
(l(!0), h(de, null, xe(n.deliveryOrder.received, (j, Q) => {
|
|
1738
|
+
var ve;
|
|
1739
|
+
return l(), h("div", { key: Q }, [
|
|
1741
1740
|
e("div", or, [
|
|
1742
1741
|
e("div", nr, [
|
|
1743
|
-
e("span", ar, y(
|
|
1744
|
-
e("span", lr, y(
|
|
1742
|
+
e("span", ar, y(j.sku.name), 1),
|
|
1743
|
+
e("span", lr, y(j.sku.code), 1)
|
|
1745
1744
|
]),
|
|
1746
1745
|
e("div", ir, [
|
|
1747
|
-
D(
|
|
1746
|
+
D($, {
|
|
1748
1747
|
label: "Receive Quantity",
|
|
1749
|
-
modelValue:
|
|
1750
|
-
"onUpdate:modelValue": (
|
|
1748
|
+
modelValue: w.value[Q].value,
|
|
1749
|
+
"onUpdate:modelValue": (ie) => w.value[Q].value = ie,
|
|
1751
1750
|
min: 0,
|
|
1752
|
-
"append-text": ((
|
|
1751
|
+
"append-text": ((ve = j.measurement) == null ? void 0 : ve.abbrev) ?? j.sku.unit.abbrev
|
|
1753
1752
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"]),
|
|
1754
|
-
e("div", cr, y(`${
|
|
1755
|
-
v(
|
|
1756
|
-
D(
|
|
1757
|
-
"model-value":
|
|
1758
|
-
"onUpdate:modelValue": (
|
|
1753
|
+
e("div", cr, y(`${j.cost ? `${v(Ke)(j.cost)}` : ""}`), 1),
|
|
1754
|
+
v(x) ? (l(), h("div", ur, [
|
|
1755
|
+
D(K, {
|
|
1756
|
+
"model-value": I.value[Q],
|
|
1757
|
+
"onUpdate:modelValue": (ie) => O(Q),
|
|
1759
1758
|
size: "sm"
|
|
1760
1759
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
1761
|
-
|
|
1760
|
+
i[3] || (i[3] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
1762
1761
|
])) : U("", !0),
|
|
1763
|
-
v(
|
|
1762
|
+
v(x) && I.value[Q] ? (l(), re($, {
|
|
1764
1763
|
key: 1,
|
|
1765
|
-
modelValue:
|
|
1766
|
-
"onUpdate:modelValue": (
|
|
1764
|
+
modelValue: N.value[Q].value,
|
|
1765
|
+
"onUpdate:modelValue": (ie) => N.value[Q].value = ie,
|
|
1767
1766
|
label: "Total Cost",
|
|
1768
1767
|
step: 1e-4,
|
|
1769
1768
|
min: 0,
|
|
@@ -1773,28 +1772,28 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1773
1772
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : U("", !0)
|
|
1774
1773
|
])
|
|
1775
1774
|
]),
|
|
1776
|
-
|
|
1775
|
+
Q < n.purchaseOrder.items.length - 1 ? (l(), h("div", dr)) : U("", !0)
|
|
1777
1776
|
]);
|
|
1778
1777
|
}), 128))
|
|
1779
1778
|
]),
|
|
1780
1779
|
e("div", mr, [
|
|
1781
|
-
|
|
1780
|
+
i[5] || (i[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
|
|
1782
1781
|
e("div", pr, [
|
|
1783
1782
|
D(R, {
|
|
1784
|
-
modelValue: v(
|
|
1785
|
-
"onUpdate:modelValue":
|
|
1783
|
+
modelValue: v(t).deliveryOrderNumber,
|
|
1784
|
+
"onUpdate:modelValue": i[0] || (i[0] = (j) => v(t).deliveryOrderNumber = j),
|
|
1786
1785
|
size: "md",
|
|
1787
1786
|
placeholder: n.deliveryOrder.deliveryOrderNumber
|
|
1788
1787
|
}, null, 8, ["modelValue", "placeholder"])
|
|
1789
1788
|
])
|
|
1790
1789
|
]),
|
|
1791
1790
|
e("div", fr, [
|
|
1792
|
-
|
|
1791
|
+
i[6] || (i[6] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
|
|
1793
1792
|
e("div", yr, y(n.deliveryOrder.remark || "N/A"), 1)
|
|
1794
1793
|
]),
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
e("div",
|
|
1794
|
+
S.value >= 0 ? (l(), h("div", vr, [
|
|
1795
|
+
i[7] || (i[7] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fulfilment's sequence ", -1)),
|
|
1796
|
+
e("div", br, y(S.value + 1), 1)
|
|
1798
1797
|
])) : U("", !0)
|
|
1799
1798
|
])
|
|
1800
1799
|
])
|
|
@@ -1827,109 +1826,109 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1827
1826
|
emits: ["submitted"],
|
|
1828
1827
|
setup(C, { emit: a }) {
|
|
1829
1828
|
var B, q, oe;
|
|
1830
|
-
const { t: o } = ut(), f = J(!1),
|
|
1829
|
+
const { t: o } = ut(), f = J(!1), b = ct(), n = C, A = a, t = St("", {
|
|
1831
1830
|
default: {
|
|
1832
1831
|
deliveryOrderNumber: "",
|
|
1833
1832
|
remark: "",
|
|
1834
1833
|
received: n.purchaseOrder.items.map((k) => ({
|
|
1835
1834
|
sku: k.sku,
|
|
1836
|
-
amount:
|
|
1835
|
+
amount: qe.fromNumber(0),
|
|
1837
1836
|
measurement: k.measurement
|
|
1838
1837
|
})),
|
|
1839
1838
|
createdBy: {
|
|
1840
|
-
id: ((B =
|
|
1841
|
-
name: ((q =
|
|
1839
|
+
id: ((B = b.sessionUser.value) == null ? void 0 : B.id) || "",
|
|
1840
|
+
name: ((q = b.sessionUser.value) == null ? void 0 : q.displayName) || ""
|
|
1842
1841
|
},
|
|
1843
1842
|
createdAt: ""
|
|
1844
1843
|
}
|
|
1845
|
-
}), c = je(),
|
|
1844
|
+
}), c = je(), S = tt(), x = Ue(), u = ((oe = n.purchaseOrder) == null ? void 0 : oe.supplier.internal) != null, I = u && x.enablePOSTransferRequireFulfillment, N = x.enablePortalDeliveryOrderWrite && (n.purchaseOrder.status === se.Enum.RECEIVING || n.purchaseOrder.status === se.Enum.COMPLETE) && (u ? !I : !0), w = x.enablePurchaseOrderReceiveWithCustomCost, O = x.enableBackdateReceive, r = J({}), d = Be(), i = Y({
|
|
1846
1845
|
get() {
|
|
1847
|
-
if (!
|
|
1848
|
-
const k = new Date(
|
|
1849
|
-
return `${
|
|
1846
|
+
if (!t.createdAt) return "";
|
|
1847
|
+
const k = new Date(t.createdAt), _ = k.getFullYear(), F = String(k.getMonth() + 1).padStart(2, "0"), W = String(k.getDate()).padStart(2, "0");
|
|
1848
|
+
return `${_}-${F}-${W}`;
|
|
1850
1849
|
},
|
|
1851
1850
|
set(k) {
|
|
1852
1851
|
if (k) {
|
|
1853
|
-
const
|
|
1854
|
-
|
|
1852
|
+
const _ = t.createdAt ? new Date(t.createdAt) : /* @__PURE__ */ new Date(), [F, W, ce] = k.split("-");
|
|
1853
|
+
_.setFullYear(parseInt(F)), _.setMonth(parseInt(W) - 1), _.setDate(parseInt(ce)), t.createdAt = _.toISOString();
|
|
1855
1854
|
}
|
|
1856
1855
|
}
|
|
1857
|
-
}),
|
|
1856
|
+
}), g = Y({
|
|
1858
1857
|
get() {
|
|
1859
|
-
if (!
|
|
1860
|
-
const k = new Date(
|
|
1861
|
-
return `${
|
|
1858
|
+
if (!t.createdAt) return "";
|
|
1859
|
+
const k = new Date(t.createdAt), _ = String(k.getHours()).padStart(2, "0"), F = String(k.getMinutes()).padStart(2, "0");
|
|
1860
|
+
return `${_}:${F}`;
|
|
1862
1861
|
},
|
|
1863
1862
|
set(k) {
|
|
1864
1863
|
if (k) {
|
|
1865
|
-
const
|
|
1866
|
-
|
|
1864
|
+
const _ = t.createdAt ? new Date(t.createdAt) : /* @__PURE__ */ new Date(), [F, W] = k.split(":");
|
|
1865
|
+
_.setHours(parseInt(F)), _.setMinutes(parseInt(W)), t.createdAt = _.toISOString();
|
|
1867
1866
|
}
|
|
1868
1867
|
}
|
|
1869
|
-
}),
|
|
1868
|
+
}), $ = Y(() => {
|
|
1870
1869
|
const k = Ye(n.purchaseOrder._id);
|
|
1871
1870
|
if (!k) return "";
|
|
1872
|
-
const
|
|
1873
|
-
return `${
|
|
1874
|
-
}),
|
|
1871
|
+
const _ = new Date(k), F = _.getFullYear(), W = String(_.getMonth() + 1).padStart(2, "0"), ce = String(_.getDate()).padStart(2, "0");
|
|
1872
|
+
return `${F}-${W}-${ce}`;
|
|
1873
|
+
}), K = Y(() => {
|
|
1875
1874
|
const k = Ye(n.purchaseOrder._id);
|
|
1876
1875
|
return k ? new Date(k) : null;
|
|
1877
1876
|
}), R = Y(() => {
|
|
1878
|
-
if (!
|
|
1879
|
-
if (/* @__PURE__ */ new Date(`${
|
|
1880
|
-
const
|
|
1881
|
-
return `Delivery date & time cannot be earlier than order creation (${
|
|
1877
|
+
if (!i.value || !g.value || !K.value) return null;
|
|
1878
|
+
if (/* @__PURE__ */ new Date(`${i.value}T${g.value}:00`) < K.value) {
|
|
1879
|
+
const _ = $.value, F = K.value.getHours(), W = K.value.getMinutes(), ce = F >= 12 ? "PM" : "AM", s = F % 12 || 12, m = `${String(s).padStart(2, "0")}:${String(W).padStart(2, "0")} ${ce}`;
|
|
1880
|
+
return `Delivery date & time cannot be earlier than order creation (${_} ${m})`;
|
|
1882
1881
|
}
|
|
1883
1882
|
return null;
|
|
1884
|
-
}),
|
|
1885
|
-
const
|
|
1886
|
-
return
|
|
1883
|
+
}), X = Y(() => R.value ? !1 : t.received.some((_) => {
|
|
1884
|
+
const F = _.amount;
|
|
1885
|
+
return F ? +he(F) > 0 : !1;
|
|
1887
1886
|
}));
|
|
1888
|
-
function
|
|
1889
|
-
|
|
1887
|
+
function j() {
|
|
1888
|
+
t.createdAt = "";
|
|
1890
1889
|
}
|
|
1891
|
-
const
|
|
1890
|
+
const Q = Y(() => n.purchaseOrder.items.map((k, _) => Y({
|
|
1892
1891
|
get: () => {
|
|
1893
1892
|
var W;
|
|
1894
|
-
const
|
|
1895
|
-
return
|
|
1893
|
+
const F = (W = t.received[_]) == null ? void 0 : W.amount;
|
|
1894
|
+
return F ? +he(F) : 0;
|
|
1896
1895
|
},
|
|
1897
|
-
set: (
|
|
1898
|
-
|
|
1896
|
+
set: (F) => {
|
|
1897
|
+
t.received[_].amount = Qe(F, 2);
|
|
1899
1898
|
}
|
|
1900
1899
|
})));
|
|
1901
|
-
function
|
|
1902
|
-
const
|
|
1903
|
-
if (
|
|
1904
|
-
const
|
|
1905
|
-
|
|
1906
|
-
currency:
|
|
1907
|
-
amount:
|
|
1900
|
+
function ve(k) {
|
|
1901
|
+
const _ = !r.value[k];
|
|
1902
|
+
if (r.value[k] = _, _) {
|
|
1903
|
+
const F = n.purchaseOrder.items[k];
|
|
1904
|
+
F.totalCost ? t.received[k].cost = {
|
|
1905
|
+
currency: F.totalCost.currency,
|
|
1906
|
+
amount: F.totalCost.amount,
|
|
1908
1907
|
precision: 4
|
|
1909
1908
|
// Standardize to 4 decimals
|
|
1910
|
-
} :
|
|
1909
|
+
} : t.received[k].cost = {
|
|
1911
1910
|
currency: Ce(),
|
|
1912
1911
|
amount: 0,
|
|
1913
1912
|
precision: 4
|
|
1914
1913
|
};
|
|
1915
1914
|
} else
|
|
1916
|
-
delete
|
|
1915
|
+
delete t.received[k].cost;
|
|
1917
1916
|
}
|
|
1918
|
-
const
|
|
1917
|
+
const ie = Y(() => n.purchaseOrder.items.map((k, _) => Y({
|
|
1919
1918
|
get: () => {
|
|
1920
1919
|
var W;
|
|
1921
|
-
const
|
|
1922
|
-
return
|
|
1920
|
+
const F = (W = t.received[_]) == null ? void 0 : W.cost;
|
|
1921
|
+
return F ? +he(F) : 0;
|
|
1923
1922
|
},
|
|
1924
|
-
set: (
|
|
1925
|
-
|
|
1923
|
+
set: (F) => {
|
|
1924
|
+
t.received[_].cost = {
|
|
1926
1925
|
currency: Ce(),
|
|
1927
|
-
...Qe(
|
|
1926
|
+
...Qe(F, 4)
|
|
1928
1927
|
};
|
|
1929
1928
|
}
|
|
1930
1929
|
})));
|
|
1931
|
-
function
|
|
1932
|
-
|
|
1930
|
+
function Ae() {
|
|
1931
|
+
S.open({
|
|
1933
1932
|
title: "Confirm Create Delivery Order",
|
|
1934
1933
|
message: `Are you sure you want to create delivery order for PO# ${n.purchaseOrder.seqNumber}?`,
|
|
1935
1934
|
primaryActions: {
|
|
@@ -1941,35 +1940,35 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1941
1940
|
text: "Cancel",
|
|
1942
1941
|
close: !0
|
|
1943
1942
|
}
|
|
1944
|
-
}).onPrimary(() =>
|
|
1943
|
+
}).onPrimary(() => Ne());
|
|
1945
1944
|
}
|
|
1946
|
-
function
|
|
1945
|
+
function Ne() {
|
|
1947
1946
|
c.createDeliveryOrder({
|
|
1948
|
-
deliveryOrder:
|
|
1947
|
+
deliveryOrder: t,
|
|
1949
1948
|
purchaseOrderId: n.purchaseOrder._id,
|
|
1950
1949
|
purchaseOrderRev: n.purchaseOrder._rev,
|
|
1951
1950
|
currency: Ce()
|
|
1952
1951
|
}).then(() => {
|
|
1953
|
-
|
|
1952
|
+
d.open(
|
|
1954
1953
|
{
|
|
1955
1954
|
title: "Success",
|
|
1956
1955
|
message: `New delivery order created for PO# ${n.purchaseOrder.seqNumber}`,
|
|
1957
1956
|
type: "success"
|
|
1958
1957
|
},
|
|
1959
1958
|
1e4
|
|
1960
|
-
), f.value = !1,
|
|
1959
|
+
), f.value = !1, A("submitted");
|
|
1961
1960
|
});
|
|
1962
1961
|
}
|
|
1963
|
-
return (k,
|
|
1964
|
-
const
|
|
1965
|
-
return
|
|
1962
|
+
return (k, _) => {
|
|
1963
|
+
const F = H("FmButton"), W = H("FmDatePicker"), ce = H("FmTimePicker"), s = H("FmIcon"), m = H("FmStepperField"), V = H("FmSwitch"), E = H("FmTextField"), G = H("FmDialog");
|
|
1964
|
+
return l(), re(G, {
|
|
1966
1965
|
modelValue: f.value,
|
|
1967
|
-
"onUpdate:modelValue":
|
|
1966
|
+
"onUpdate:modelValue": _[4] || (_[4] = (T) => f.value = T),
|
|
1968
1967
|
overlay: !0,
|
|
1969
1968
|
"min-width": 800
|
|
1970
1969
|
}, {
|
|
1971
|
-
"dialog-button":
|
|
1972
|
-
v(
|
|
1970
|
+
"dialog-button": ee(() => [
|
|
1971
|
+
v(N) ? (l(), re(F, {
|
|
1973
1972
|
key: 0,
|
|
1974
1973
|
variant: "primary",
|
|
1975
1974
|
label: "Create",
|
|
@@ -1978,57 +1977,57 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
1978
1977
|
class: "w-full"
|
|
1979
1978
|
})) : U("", !0)
|
|
1980
1979
|
]),
|
|
1981
|
-
"dialog-header":
|
|
1980
|
+
"dialog-header": ee(() => [
|
|
1982
1981
|
e("div", null, "Order #" + y(n.purchaseOrder.seqNumber) + " (New Delivery Order)", 1)
|
|
1983
1982
|
]),
|
|
1984
|
-
"dialog-footer":
|
|
1985
|
-
D(
|
|
1983
|
+
"dialog-footer": ee(() => [
|
|
1984
|
+
D(F, {
|
|
1986
1985
|
class: "ml-auto",
|
|
1987
1986
|
label: "Create",
|
|
1988
1987
|
size: "md",
|
|
1989
1988
|
variant: "destructive",
|
|
1990
|
-
disabled: !
|
|
1991
|
-
onClick:
|
|
1989
|
+
disabled: !X.value,
|
|
1990
|
+
onClick: Ae
|
|
1992
1991
|
}, null, 8, ["disabled"])
|
|
1993
1992
|
]),
|
|
1994
|
-
default:
|
|
1995
|
-
var
|
|
1993
|
+
default: ee(() => {
|
|
1994
|
+
var T;
|
|
1996
1995
|
return [
|
|
1997
1996
|
e("div", gr, [
|
|
1998
1997
|
e("div", _r, [
|
|
1999
|
-
|
|
2000
|
-
e("div", Sr, y((
|
|
1998
|
+
_[5] || (_[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received by", -1)),
|
|
1999
|
+
e("div", Sr, y((T = v(b).sessionUser.value) == null ? void 0 : T.displayName), 1)
|
|
2001
2000
|
]),
|
|
2002
|
-
v(
|
|
2001
|
+
v(O) ? (l(), h("div", xr, [
|
|
2003
2002
|
e("div", Or, [
|
|
2004
2003
|
e("div", wr, [
|
|
2005
|
-
|
|
2006
|
-
!
|
|
2004
|
+
_[6] || (_[6] = ke(" Delivery Date & Time ")),
|
|
2005
|
+
!i.value && !g.value ? (l(), h("div", $r, " Leave blank to use current date & time ")) : U("", !0)
|
|
2007
2006
|
]),
|
|
2008
|
-
|
|
2007
|
+
i.value || g.value ? (l(), re(F, {
|
|
2009
2008
|
key: 0,
|
|
2010
2009
|
variant: "tertiary",
|
|
2011
2010
|
label: "Clear",
|
|
2012
2011
|
"prepend-icon": "close",
|
|
2013
|
-
onClick:
|
|
2012
|
+
onClick: j
|
|
2014
2013
|
})) : U("", !0)
|
|
2015
2014
|
]),
|
|
2016
2015
|
e("div", Cr, [
|
|
2017
2016
|
e("div", Rr, [
|
|
2018
2017
|
D(W, {
|
|
2019
|
-
modelValue:
|
|
2020
|
-
"onUpdate:modelValue":
|
|
2018
|
+
modelValue: i.value,
|
|
2019
|
+
"onUpdate:modelValue": _[0] || (_[0] = (z) => i.value = z)
|
|
2021
2020
|
}, null, 8, ["modelValue"])
|
|
2022
2021
|
]),
|
|
2023
2022
|
e("div", kr, [
|
|
2024
|
-
D(
|
|
2025
|
-
modelValue:
|
|
2026
|
-
"onUpdate:modelValue":
|
|
2023
|
+
D(ce, {
|
|
2024
|
+
modelValue: g.value,
|
|
2025
|
+
"onUpdate:modelValue": _[1] || (_[1] = (z) => g.value = z)
|
|
2027
2026
|
}, null, 8, ["modelValue"])
|
|
2028
2027
|
])
|
|
2029
2028
|
]),
|
|
2030
|
-
R.value ? (
|
|
2031
|
-
D(
|
|
2029
|
+
R.value ? (l(), h("div", Dr, [
|
|
2030
|
+
D(s, {
|
|
2032
2031
|
name: "error",
|
|
2033
2032
|
class: "inline-block mr-1",
|
|
2034
2033
|
size: "sm"
|
|
@@ -2037,40 +2036,40 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2037
2036
|
])) : U("", !0)
|
|
2038
2037
|
])) : U("", !0),
|
|
2039
2038
|
e("div", Nr, [
|
|
2040
|
-
|
|
2041
|
-
(
|
|
2042
|
-
var
|
|
2043
|
-
return
|
|
2039
|
+
_[8] || (_[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
|
|
2040
|
+
(l(!0), h(de, null, xe(n.purchaseOrder.items, (z, p) => {
|
|
2041
|
+
var Z, ae, ne;
|
|
2042
|
+
return l(), h("div", { key: p }, [
|
|
2044
2043
|
e("div", Fr, [
|
|
2045
2044
|
e("div", Tr, [
|
|
2046
|
-
e("span", Ir, y(
|
|
2047
|
-
e("span", Pr, y(
|
|
2045
|
+
e("span", Ir, y(z.sku.name), 1),
|
|
2046
|
+
e("span", Pr, y(z.sku.code), 1)
|
|
2048
2047
|
]),
|
|
2049
2048
|
e("div", qr, [
|
|
2050
2049
|
D(m, {
|
|
2051
2050
|
label: "Receive Quantity",
|
|
2052
|
-
modelValue:
|
|
2053
|
-
"onUpdate:modelValue": (P) =>
|
|
2054
|
-
"helper-text": `${v(o)("inventory.transfer.receiveRequest.details.received")} ${v(
|
|
2051
|
+
modelValue: Q.value[p].value,
|
|
2052
|
+
"onUpdate:modelValue": (P) => Q.value[p].value = P,
|
|
2053
|
+
"helper-text": `${v(o)("inventory.transfer.receiveRequest.details.received")} ${v(qe).toFormatString(
|
|
2055
2054
|
{
|
|
2056
|
-
value: (
|
|
2055
|
+
value: (Z = k.receivedInfoMap[z.sku._id]) == null ? void 0 : Z.received
|
|
2057
2056
|
}
|
|
2058
|
-
)} ${((ae =
|
|
2057
|
+
)} ${((ae = z.measurement) == null ? void 0 : ae.abbrev) ?? z.sku.unit.abbrev}`,
|
|
2059
2058
|
min: 0,
|
|
2060
|
-
"append-text": ((ne =
|
|
2059
|
+
"append-text": ((ne = z.measurement) == null ? void 0 : ne.abbrev) ?? z.sku.unit.abbrev
|
|
2061
2060
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "helper-text", "append-text"]),
|
|
2062
|
-
v(
|
|
2061
|
+
v(w) ? (l(), h("div", Vr, [
|
|
2063
2062
|
D(V, {
|
|
2064
|
-
"model-value":
|
|
2065
|
-
"onUpdate:modelValue": (P) =>
|
|
2063
|
+
"model-value": r.value[p],
|
|
2064
|
+
"onUpdate:modelValue": (P) => ve(p),
|
|
2066
2065
|
size: "sm"
|
|
2067
2066
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2068
|
-
|
|
2067
|
+
_[7] || (_[7] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
2069
2068
|
])) : U("", !0),
|
|
2070
|
-
v(
|
|
2069
|
+
v(w) && r.value[p] ? (l(), re(m, {
|
|
2071
2070
|
key: 1,
|
|
2072
|
-
modelValue:
|
|
2073
|
-
"onUpdate:modelValue": (P) =>
|
|
2071
|
+
modelValue: ie.value[p].value,
|
|
2072
|
+
"onUpdate:modelValue": (P) => ie.value[p].value = P,
|
|
2074
2073
|
label: "Total Cost",
|
|
2075
2074
|
step: 1e-4,
|
|
2076
2075
|
min: 0,
|
|
@@ -2080,26 +2079,26 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2080
2079
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : U("", !0)
|
|
2081
2080
|
])
|
|
2082
2081
|
]),
|
|
2083
|
-
p < n.purchaseOrder.items.length - 1 ? (
|
|
2082
|
+
p < n.purchaseOrder.items.length - 1 ? (l(), h("div", Er)) : U("", !0)
|
|
2084
2083
|
]);
|
|
2085
2084
|
}), 128))
|
|
2086
2085
|
]),
|
|
2087
2086
|
e("div", Lr, [
|
|
2088
|
-
|
|
2087
|
+
_[9] || (_[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
|
|
2089
2088
|
e("div", Mr, [
|
|
2090
2089
|
D(E, {
|
|
2091
|
-
modelValue: v(
|
|
2092
|
-
"onUpdate:modelValue":
|
|
2090
|
+
modelValue: v(t).deliveryOrderNumber,
|
|
2091
|
+
"onUpdate:modelValue": _[2] || (_[2] = (z) => v(t).deliveryOrderNumber = z),
|
|
2093
2092
|
size: "md"
|
|
2094
2093
|
}, null, 8, ["modelValue"])
|
|
2095
2094
|
])
|
|
2096
2095
|
]),
|
|
2097
2096
|
e("div", Ur, [
|
|
2098
|
-
|
|
2097
|
+
_[10] || (_[10] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
|
|
2099
2098
|
e("div", Br, [
|
|
2100
2099
|
D(E, {
|
|
2101
|
-
modelValue: v(
|
|
2102
|
-
"onUpdate:modelValue":
|
|
2100
|
+
modelValue: v(t).remark,
|
|
2101
|
+
"onUpdate:modelValue": _[3] || (_[3] = (z) => v(t).remark = z),
|
|
2103
2102
|
size: "md"
|
|
2104
2103
|
}, null, 8, ["modelValue"])
|
|
2105
2104
|
])
|
|
@@ -2126,21 +2125,21 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2126
2125
|
netsuiteId: {}
|
|
2127
2126
|
},
|
|
2128
2127
|
setup(C) {
|
|
2129
|
-
const a = C, o = dt(), f = J(!1),
|
|
2130
|
-
async function
|
|
2131
|
-
if (!(
|
|
2128
|
+
const a = C, o = dt(), f = J(!1), b = J(!1), n = J(!1), A = J([]);
|
|
2129
|
+
async function t() {
|
|
2130
|
+
if (!(A.value.length > 0))
|
|
2132
2131
|
try {
|
|
2133
|
-
|
|
2134
|
-
const
|
|
2135
|
-
|
|
2132
|
+
b.value = !0;
|
|
2133
|
+
const x = await o.getChangeLogs(a.netsuiteId);
|
|
2134
|
+
A.value = x, n.value = !1;
|
|
2136
2135
|
} catch {
|
|
2137
2136
|
n.value = !0;
|
|
2138
2137
|
} finally {
|
|
2139
|
-
|
|
2138
|
+
b.value = !1;
|
|
2140
2139
|
}
|
|
2141
2140
|
}
|
|
2142
|
-
function c(
|
|
2143
|
-
switch (
|
|
2141
|
+
function c(x) {
|
|
2142
|
+
switch (x) {
|
|
2144
2143
|
case we.Create:
|
|
2145
2144
|
return "text-green-600 bg-green-100";
|
|
2146
2145
|
case we.Set:
|
|
@@ -2153,8 +2152,8 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2153
2152
|
return "text-gray-600 bg-gray-100";
|
|
2154
2153
|
}
|
|
2155
2154
|
}
|
|
2156
|
-
function
|
|
2157
|
-
return new Date(
|
|
2155
|
+
function S(x) {
|
|
2156
|
+
return new Date(x).toLocaleDateString("en-US", {
|
|
2158
2157
|
year: "numeric",
|
|
2159
2158
|
month: "short",
|
|
2160
2159
|
day: "numeric",
|
|
@@ -2162,46 +2161,46 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2162
2161
|
minute: "2-digit"
|
|
2163
2162
|
});
|
|
2164
2163
|
}
|
|
2165
|
-
return (
|
|
2166
|
-
const
|
|
2167
|
-
return
|
|
2168
|
-
D(
|
|
2164
|
+
return (x, u) => {
|
|
2165
|
+
const I = H("FmButton"), N = H("FmCircularProgress"), w = H("FmIcon"), O = H("FmDialog");
|
|
2166
|
+
return l(), h("div", zr, [
|
|
2167
|
+
D(O, {
|
|
2169
2168
|
modelValue: f.value,
|
|
2170
|
-
"onUpdate:modelValue":
|
|
2169
|
+
"onUpdate:modelValue": u[2] || (u[2] = (r) => f.value = r),
|
|
2171
2170
|
overlay: !0,
|
|
2172
2171
|
"max-width": 800
|
|
2173
2172
|
}, {
|
|
2174
|
-
"dialog-button":
|
|
2175
|
-
D(
|
|
2173
|
+
"dialog-button": ee(() => [
|
|
2174
|
+
D(I, {
|
|
2176
2175
|
"prepend-icon": "info",
|
|
2177
2176
|
variant: "secondary",
|
|
2178
2177
|
label: "NetSuite",
|
|
2179
|
-
onClick:
|
|
2178
|
+
onClick: u[0] || (u[0] = (r) => t()),
|
|
2180
2179
|
"text-color": "primary",
|
|
2181
2180
|
"bg-color": "transparent",
|
|
2182
2181
|
"border-color": "primary"
|
|
2183
2182
|
})
|
|
2184
2183
|
]),
|
|
2185
|
-
"dialog-header":
|
|
2184
|
+
"dialog-header": ee(() => u[3] || (u[3] = [
|
|
2186
2185
|
e("div", null, "NetSuite info", -1)
|
|
2187
2186
|
])),
|
|
2188
|
-
default:
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
D(
|
|
2187
|
+
default: ee(() => [
|
|
2188
|
+
b.value ? (l(), h("div", Kr, [
|
|
2189
|
+
u[4] || (u[4] = e("span", null, "Change Log Loading...", -1)),
|
|
2190
|
+
D(N, { size: "md" })
|
|
2192
2191
|
])) : U("", !0),
|
|
2193
|
-
!
|
|
2192
|
+
!b.value && A.value.length > 0 ? (l(), h("div", Gr, [
|
|
2194
2193
|
e("h3", Hr, [
|
|
2195
|
-
D(
|
|
2194
|
+
D(w, {
|
|
2196
2195
|
name: "error",
|
|
2197
2196
|
color: "#ff9500",
|
|
2198
2197
|
size: "sm"
|
|
2199
2198
|
}),
|
|
2200
|
-
|
|
2199
|
+
u[5] || (u[5] = ke(" Change Logs "))
|
|
2201
2200
|
]),
|
|
2202
2201
|
e("div", Wr, [
|
|
2203
2202
|
e("table", Yr, [
|
|
2204
|
-
|
|
2203
|
+
u[6] || (u[6] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
|
|
2205
2204
|
e("tr", { class: "border-b border-fm-color-neutral-gray-200" }, [
|
|
2206
2205
|
e("th", {
|
|
2207
2206
|
class: "text-left p-3 fm-typo-en-body-md-600",
|
|
@@ -2218,36 +2217,36 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2218
2217
|
])
|
|
2219
2218
|
], -1)),
|
|
2220
2219
|
e("tbody", null, [
|
|
2221
|
-
(
|
|
2222
|
-
key:
|
|
2220
|
+
(l(!0), h(de, null, xe(A.value, (r, d) => (l(), h("tr", {
|
|
2221
|
+
key: d,
|
|
2223
2222
|
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
2224
2223
|
}, [
|
|
2225
|
-
e("td", Qr, y(
|
|
2226
|
-
e("td", Jr, y(
|
|
2227
|
-
e("td", Xr, y(
|
|
2228
|
-
e("td", Zr, y(
|
|
2224
|
+
e("td", Qr, y(S(r._dateiso8601)), 1),
|
|
2225
|
+
e("td", Jr, y(r._rolename), 1),
|
|
2226
|
+
e("td", Xr, y(r._employeename), 1),
|
|
2227
|
+
e("td", Zr, y(r._contextname), 1),
|
|
2229
2228
|
e("td", {
|
|
2230
|
-
class: Me(`p-3 fm-typo-en-body-sm-600 ${c(Number(
|
|
2231
|
-
}, y(v(we)[Number(
|
|
2232
|
-
e("td", eo, y(
|
|
2233
|
-
e("td", to, y(
|
|
2234
|
-
e("td", so, y(
|
|
2235
|
-
e("td", ro, y(
|
|
2229
|
+
class: Me(`p-3 fm-typo-en-body-sm-600 ${c(Number(r.type) - 1)}`)
|
|
2230
|
+
}, y(v(we)[Number(r.type) - 1]), 3),
|
|
2231
|
+
e("td", eo, y(r.lineid || ""), 1),
|
|
2232
|
+
e("td", to, y(r._fieldname), 1),
|
|
2233
|
+
e("td", so, y(r.oldvalue || ""), 1),
|
|
2234
|
+
e("td", ro, y(r.newvalue || ""), 1)
|
|
2236
2235
|
]))), 128))
|
|
2237
2236
|
])
|
|
2238
2237
|
])
|
|
2239
2238
|
])
|
|
2240
|
-
])) : (
|
|
2239
|
+
])) : (l(), h("div", oo, u[7] || (u[7] = [
|
|
2241
2240
|
e("p", null, "No change logs available.", -1)
|
|
2242
2241
|
])))
|
|
2243
2242
|
]),
|
|
2244
|
-
"dialog-footer":
|
|
2245
|
-
D(
|
|
2243
|
+
"dialog-footer": ee(() => [
|
|
2244
|
+
D(I, {
|
|
2246
2245
|
class: "ml-auto sm:w-full xs:w-full",
|
|
2247
2246
|
label: "Close",
|
|
2248
2247
|
size: "md",
|
|
2249
2248
|
variant: "primary",
|
|
2250
|
-
onClick:
|
|
2249
|
+
onClick: u[1] || (u[1] = (r) => f.value = !1)
|
|
2251
2250
|
})
|
|
2252
2251
|
]),
|
|
2253
2252
|
_: 1
|
|
@@ -2258,7 +2257,7 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2258
2257
|
}), ao = { class: "flex flex-col w-full gap-3" }, lo = { class: "flex" }, io = { class: "fm-typo-en-title-md-600 text-fm-color-typo-primary" }, co = { class: "flex flex-col gap-16 w-full h-full" }, uo = { class: "flex justify-between" }, mo = { class: "fm-typo-en-body-lg-600" }, po = { class: "flex gap-2" }, fo = {
|
|
2259
2258
|
key: 0,
|
|
2260
2259
|
class: "flex items-center gap-1"
|
|
2261
|
-
}, yo = { class: "fm-typo-en-body-md-400" }, vo = { class: "flex flex-col gap-8" },
|
|
2260
|
+
}, yo = { class: "fm-typo-en-body-md-400" }, vo = { class: "flex flex-col gap-8" }, bo = { class: "flex flex-col gap-4" }, ho = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, go = { class: "flex gap-1" }, _o = { class: "fm-typo-en-body-lg-600" }, So = {
|
|
2262
2261
|
key: 0,
|
|
2263
2262
|
class: "flex flex-col gap-4"
|
|
2264
2263
|
}, xo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Oo = { class: "fm-typo-en-body-lg-600" }, wo = { class: "flex flex-col gap-4" }, $o = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Co = { class: "fm-typo-en-body-lg-600" }, Ro = {
|
|
@@ -2291,7 +2290,7 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2291
2290
|
}, un = { class: "flex-1 flex flex-col items-center" }, dn = { class: "h-40 w-40 bg-fm-color-primary rounded-full flex items-center justify-center" }, mn = { class: "flex-1 flex flex-col items-center" }, pn = { class: "flex w-full items-center gap-4" }, fn = {
|
|
2292
2291
|
class: "py-12 flex flex-col gap-4",
|
|
2293
2292
|
name: "received-at header"
|
|
2294
|
-
}, yn = { class: "fm-typo-en-body-lg-400" }, vn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" },
|
|
2293
|
+
}, yn = { class: "fm-typo-en-body-lg-400" }, vn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, bn = { class: "ml-auto flex gap-1" }, hn = { class: "flex gap-12 content-stretch" }, gn = {
|
|
2295
2294
|
class: "flex flex-col w-40",
|
|
2296
2295
|
name: "circles"
|
|
2297
2296
|
}, _n = { class: "flex-1 flex flex-col items-center" }, Sn = {
|
|
@@ -2313,86 +2312,86 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2313
2312
|
},
|
|
2314
2313
|
emits: ["update:show", "submitted"],
|
|
2315
2314
|
setup(C, { emit: a }) {
|
|
2316
|
-
const o = C, f = a,
|
|
2315
|
+
const o = C, f = a, b = tt(), n = Be(), A = Ue(), t = De(), c = ct(), S = Y(
|
|
2317
2316
|
() => {
|
|
2318
|
-
var
|
|
2317
|
+
var s, m;
|
|
2319
2318
|
return {
|
|
2320
|
-
id: ((
|
|
2319
|
+
id: ((s = c.sessionUser.value) == null ? void 0 : s.id) ?? "",
|
|
2321
2320
|
name: ((m = c.sessionUser.value) == null ? void 0 : m.displayName) ?? ""
|
|
2322
2321
|
};
|
|
2323
2322
|
}
|
|
2324
|
-
),
|
|
2323
|
+
), x = wt(), { t: u } = ut(), I = Y(
|
|
2325
2324
|
() => {
|
|
2326
|
-
var
|
|
2327
|
-
return ((m = (
|
|
2325
|
+
var s, m, V, E;
|
|
2326
|
+
return ((m = (s = o.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : m.internal) === "restaurant" || ((E = (V = o.purchaseOrder) == null ? void 0 : V.supplier) == null ? void 0 : E.internal) === "warehouse" ? Ge.enum.transfer : Ge.enum.purchase;
|
|
2328
2327
|
}
|
|
2329
|
-
),
|
|
2328
|
+
), N = Y(() => {
|
|
2330
2329
|
var V;
|
|
2331
|
-
const
|
|
2330
|
+
const s = (V = o.shipments) == null ? void 0 : V.find((E) => {
|
|
2332
2331
|
var G;
|
|
2333
2332
|
return E.ref === ((G = o.purchaseOrder) == null ? void 0 : G._id);
|
|
2334
2333
|
});
|
|
2335
2334
|
let m = null;
|
|
2336
|
-
if (
|
|
2337
|
-
const E =
|
|
2335
|
+
if (s != null && s.milestones && s.milestones.length > 0) {
|
|
2336
|
+
const E = s.milestones[s.milestones.length - 1];
|
|
2338
2337
|
if (E.estimatedTime) {
|
|
2339
|
-
const G = new Date(E.estimatedTime),
|
|
2340
|
-
m = `${G.toLocaleString("en-US", { month: "short" })} ${
|
|
2338
|
+
const G = new Date(E.estimatedTime), T = G.getDate().toString().padStart(2, "0");
|
|
2339
|
+
m = `${G.toLocaleString("en-US", { month: "short" })} ${T}`;
|
|
2341
2340
|
}
|
|
2342
2341
|
}
|
|
2343
2342
|
return m;
|
|
2344
|
-
}),
|
|
2343
|
+
}), w = J(!1), O = J(""), r = J(!0), d = je(), i = Gt(d.getWorkflowConfig), g = Ot(), $ = [
|
|
2345
2344
|
M.enum.receiveStock,
|
|
2346
2345
|
M.enum.processRequest,
|
|
2347
2346
|
M.enum.closeRequest
|
|
2348
|
-
],
|
|
2347
|
+
], K = Y(() => {
|
|
2349
2348
|
if (!o.purchaseOrder)
|
|
2350
2349
|
return [];
|
|
2351
|
-
const
|
|
2352
|
-
if (
|
|
2350
|
+
const s = i.result.value;
|
|
2351
|
+
if (s.state === pt.loading)
|
|
2353
2352
|
return [];
|
|
2354
2353
|
const m = {
|
|
2355
|
-
user:
|
|
2356
|
-
executedAt:
|
|
2357
|
-
(
|
|
2358
|
-
var
|
|
2359
|
-
return
|
|
2354
|
+
user: S.value,
|
|
2355
|
+
executedAt: t.locations.computeFirst(
|
|
2356
|
+
(T) => {
|
|
2357
|
+
var z;
|
|
2358
|
+
return T.dbName === ((z = t._currentLocation) == null ? void 0 : z.dbName) ? T : null;
|
|
2360
2359
|
}
|
|
2361
2360
|
),
|
|
2362
2361
|
purchaseOrderRequest: o.poRequest,
|
|
2363
2362
|
purchaseOrder: o.purchaseOrder
|
|
2364
|
-
}, E =
|
|
2363
|
+
}, E = A.useOperatePurchaseOrderV2 ? [...$, M.enum.completeReceive] : $;
|
|
2365
2364
|
let G = [];
|
|
2366
2365
|
try {
|
|
2367
|
-
|
|
2366
|
+
s.state === pt.error ? (console.error("Error fetching workflow config:", s.error), G = st.getAvailableActions({
|
|
2368
2367
|
...m,
|
|
2369
2368
|
orderConfig: st.getDefaultConfig()
|
|
2370
|
-
}).actions.filter((
|
|
2369
|
+
}).actions.filter((T) => !E.includes(T))) : G = st.getAvailableActions({
|
|
2371
2370
|
...m,
|
|
2372
|
-
orderConfig:
|
|
2373
|
-
}).actions.filter((
|
|
2374
|
-
} catch (
|
|
2375
|
-
console.error("Error getting available actions:",
|
|
2371
|
+
orderConfig: s.data
|
|
2372
|
+
}).actions.filter((T) => !E.includes(T));
|
|
2373
|
+
} catch (T) {
|
|
2374
|
+
console.error("Error getting available actions:", T);
|
|
2376
2375
|
}
|
|
2377
|
-
return o.scope === "approval" && (G = G.filter((
|
|
2378
|
-
}), R =
|
|
2376
|
+
return o.scope === "approval" && (G = G.filter((T) => T !== M.enum.completeReceive)), G;
|
|
2377
|
+
}), R = Vt(o, "show"), X = Y(() => [
|
|
2379
2378
|
{
|
|
2380
|
-
label:
|
|
2379
|
+
label: u("inventory.transfer.receiveRequest.details.overview"),
|
|
2381
2380
|
value: "overview"
|
|
2382
2381
|
},
|
|
2383
2382
|
{
|
|
2384
|
-
label:
|
|
2383
|
+
label: u("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
2385
2384
|
value: "deliveryHistory"
|
|
2386
2385
|
}
|
|
2387
|
-
]),
|
|
2388
|
-
|
|
2386
|
+
]), j = J(X.value[0]);
|
|
2387
|
+
kt(
|
|
2389
2388
|
() => o.show,
|
|
2390
|
-
(
|
|
2391
|
-
|
|
2389
|
+
(s) => {
|
|
2390
|
+
s && (j.value = X.value[0]);
|
|
2392
2391
|
}
|
|
2393
2392
|
);
|
|
2394
|
-
function
|
|
2395
|
-
return
|
|
2393
|
+
function Q(s) {
|
|
2394
|
+
return s.map((m) => ({
|
|
2396
2395
|
...m,
|
|
2397
2396
|
amount: {
|
|
2398
2397
|
...m.amount,
|
|
@@ -2400,16 +2399,16 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2400
2399
|
}
|
|
2401
2400
|
}));
|
|
2402
2401
|
}
|
|
2403
|
-
async function
|
|
2404
|
-
return new Promise((
|
|
2405
|
-
|
|
2402
|
+
async function ve(s, m, V, E, G) {
|
|
2403
|
+
return new Promise((T, z) => {
|
|
2404
|
+
b.open({
|
|
2406
2405
|
closeButton: !1,
|
|
2407
2406
|
title: E.title,
|
|
2408
2407
|
message: E.message,
|
|
2409
2408
|
primaryActions: E.primaryActions,
|
|
2410
2409
|
secondaryActions: { text: "No", close: !1 }
|
|
2411
2410
|
}).onPrimary(async () => {
|
|
2412
|
-
var
|
|
2411
|
+
var Z, ae, ne, P;
|
|
2413
2412
|
const p = [];
|
|
2414
2413
|
V === M.enum.approveRequest ? (p.push({
|
|
2415
2414
|
action: "approveRequest",
|
|
@@ -2420,8 +2419,8 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2420
2419
|
fulfillmentId: "",
|
|
2421
2420
|
deliveryOrderNumber: "",
|
|
2422
2421
|
deliveryRemark: null,
|
|
2423
|
-
items:
|
|
2424
|
-
createdBy:
|
|
2422
|
+
items: Q(m.fulfillment.items),
|
|
2423
|
+
createdBy: S.value
|
|
2425
2424
|
}
|
|
2426
2425
|
})) : V === M.enum.processRequest ? m.fulfillment && p.push({
|
|
2427
2426
|
action: "processRequest",
|
|
@@ -2429,8 +2428,8 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2429
2428
|
fulfillmentId: "",
|
|
2430
2429
|
deliveryOrderNumber: "",
|
|
2431
2430
|
deliveryRemark: null,
|
|
2432
|
-
items:
|
|
2433
|
-
createdBy:
|
|
2431
|
+
items: Q(m.fulfillment.items),
|
|
2432
|
+
createdBy: S.value
|
|
2434
2433
|
}
|
|
2435
2434
|
}) : V === M.enum.rejectRequest ? p.push({
|
|
2436
2435
|
action: "rejectRequest",
|
|
@@ -2440,78 +2439,78 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2440
2439
|
payload: null
|
|
2441
2440
|
});
|
|
2442
2441
|
try {
|
|
2443
|
-
await
|
|
2442
|
+
await g({
|
|
2444
2443
|
operate: {
|
|
2445
2444
|
operation: V,
|
|
2446
|
-
doc:
|
|
2445
|
+
doc: s,
|
|
2447
2446
|
options: m
|
|
2448
2447
|
},
|
|
2449
2448
|
operateV2: {
|
|
2450
|
-
_id: ((
|
|
2449
|
+
_id: ((Z = o.purchaseOrder) == null ? void 0 : Z._id) ?? "",
|
|
2451
2450
|
_rev: ((ae = o.purchaseOrder) == null ? void 0 : ae._rev) ?? "",
|
|
2452
2451
|
action: V,
|
|
2453
2452
|
payloads: p
|
|
2454
2453
|
// add payload if action is receiveStock or processRequest
|
|
2455
2454
|
},
|
|
2456
2455
|
transferTo: (P = (ne = o.poRequest) == null ? void 0 : ne.to) == null ? void 0 : P.dbName
|
|
2457
|
-
}).delayed(1e3),
|
|
2456
|
+
}).delayed(1e3), T("submitted");
|
|
2458
2457
|
} catch (me) {
|
|
2459
|
-
|
|
2458
|
+
z(me);
|
|
2460
2459
|
}
|
|
2461
2460
|
}).onSecondary(() => {
|
|
2462
|
-
|
|
2461
|
+
T("cancelled");
|
|
2463
2462
|
for (let p = 0; p < G + 2; p++)
|
|
2464
|
-
|
|
2463
|
+
b.close();
|
|
2465
2464
|
}).onClose(() => {
|
|
2466
2465
|
});
|
|
2467
2466
|
});
|
|
2468
2467
|
}
|
|
2469
|
-
async function
|
|
2470
|
-
var G,
|
|
2471
|
-
if (
|
|
2468
|
+
async function ie(s) {
|
|
2469
|
+
var G, T, z, p;
|
|
2470
|
+
if (s === M.enum.receiveStock)
|
|
2472
2471
|
return;
|
|
2473
|
-
const m = xt[
|
|
2472
|
+
const m = xt[s];
|
|
2474
2473
|
if (!m) {
|
|
2475
2474
|
n.open({
|
|
2476
2475
|
title: "Something went wrong",
|
|
2477
|
-
message: `Cannot process order: ${it(
|
|
2476
|
+
message: `Cannot process order: ${it(s)}`,
|
|
2478
2477
|
type: "error"
|
|
2479
2478
|
});
|
|
2480
2479
|
return;
|
|
2481
2480
|
}
|
|
2482
2481
|
const { successMessage: V, ...E } = m;
|
|
2483
2482
|
if (o.purchaseOrder) {
|
|
2484
|
-
|
|
2485
|
-
const
|
|
2483
|
+
O.value = `${s}`, w.value = !0, r.value = !1;
|
|
2484
|
+
const Z = {};
|
|
2486
2485
|
let ae = 0;
|
|
2487
|
-
if ((
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
else if ((
|
|
2491
|
-
const ne = (
|
|
2486
|
+
if ((s === M.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
2487
|
+
s === M.enum.completeReceive) && A.autoReceiveWarehouse)
|
|
2488
|
+
Z.autoReceive = !0;
|
|
2489
|
+
else if ((s === M.enum.approveRequest || s === M.enum.processRequest) && A.acceptRequireFulfillment) {
|
|
2490
|
+
const ne = (T = (G = o.poRequest) == null ? void 0 : G.from) == null ? void 0 : T.dbName, P = (p = (z = o.poRequest) == null ? void 0 : z.to) == null ? void 0 : p.dbName;
|
|
2492
2491
|
if (ne && P && (ne.startsWith("warehouse_") || P.startsWith("warehouse_"))) {
|
|
2493
|
-
const me = await new Promise((Oe,
|
|
2494
|
-
|
|
2492
|
+
const me = await new Promise((Oe, Fe) => {
|
|
2493
|
+
b.open({
|
|
2495
2494
|
closeButton: !1,
|
|
2496
2495
|
title: "Confirm transfer amount",
|
|
2497
|
-
dialogComponent:
|
|
2496
|
+
dialogComponent: rs,
|
|
2498
2497
|
dialogComponentProps: {
|
|
2499
2498
|
purchaseOrder: o.purchaseOrder,
|
|
2500
2499
|
confirm: Oe,
|
|
2501
|
-
"onUpdate:show": (
|
|
2502
|
-
|
|
2500
|
+
"onUpdate:show": (Te) => {
|
|
2501
|
+
Te || (O.value = "", w.value = !1, r.value = !0, ae++, b.close()), Fe("cancelled");
|
|
2503
2502
|
}
|
|
2504
2503
|
}
|
|
2505
2504
|
});
|
|
2506
2505
|
});
|
|
2507
|
-
|
|
2506
|
+
Z.fulfillment = me;
|
|
2508
2507
|
}
|
|
2509
2508
|
}
|
|
2510
2509
|
try {
|
|
2511
|
-
await
|
|
2510
|
+
await ve(
|
|
2512
2511
|
o.purchaseOrder,
|
|
2513
|
-
|
|
2514
|
-
|
|
2512
|
+
Z,
|
|
2513
|
+
s,
|
|
2515
2514
|
m,
|
|
2516
2515
|
ae
|
|
2517
2516
|
) === "submitted" && (n.open({
|
|
@@ -2524,28 +2523,28 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2524
2523
|
title: "Something went wrong",
|
|
2525
2524
|
message: "Please try again.",
|
|
2526
2525
|
type: "error"
|
|
2527
|
-
}), console.error("Error when submitting PO operation",
|
|
2526
|
+
}), console.error("Error when submitting PO operation", s, o.purchaseOrder, ne);
|
|
2528
2527
|
} finally {
|
|
2529
|
-
|
|
2528
|
+
O.value = "", w.value = !1, r.value = !0;
|
|
2530
2529
|
}
|
|
2531
2530
|
}
|
|
2532
2531
|
}
|
|
2533
|
-
const
|
|
2534
|
-
var
|
|
2535
|
-
return ((
|
|
2536
|
-
}),
|
|
2537
|
-
const
|
|
2538
|
-
if (!
|
|
2539
|
-
const { partial: m, over: V } = nt(
|
|
2540
|
-
let G =
|
|
2541
|
-
return E ===
|
|
2532
|
+
const Ae = Y(() => {
|
|
2533
|
+
var s, m;
|
|
2534
|
+
return ((s = o.purchaseOrder) == null ? void 0 : s.status) === se.enum.RECEIVING || ((m = o.purchaseOrder) == null ? void 0 : m.status) === se.enum.COMPLETE;
|
|
2535
|
+
}), Ne = Y(() => o.purchaseOrder ? Xe(o.purchaseOrder) : {}), B = Y(() => {
|
|
2536
|
+
const s = o.purchaseOrder;
|
|
2537
|
+
if (!s) return { status: "", statusClass: "" };
|
|
2538
|
+
const { partial: m, over: V } = nt(Ne.value), E = at(s.status, m, V);
|
|
2539
|
+
let G = u(`inventory.transfer.status.${E}`), T = `${s.status}`.toLocaleLowerCase("en-us");
|
|
2540
|
+
return E === se.enum.CLOSE && (G = `${u(`inventory.transfer.status.${se.enum.COMPLETE}`)}`), E === "PARTIAL_RECEIVED" && T === se.enum.PROCESSING.toLocaleLowerCase("en-us") && (T = se.enum.RECEIVING.toLocaleLowerCase("en-us")), {
|
|
2542
2541
|
status: G,
|
|
2543
|
-
statusClass: `fm-status-badge fm-status-badge-${
|
|
2542
|
+
statusClass: `fm-status-badge fm-status-badge-${T}`
|
|
2544
2543
|
};
|
|
2545
2544
|
}), q = Y(() => {
|
|
2546
|
-
var
|
|
2547
|
-
const
|
|
2548
|
-
...
|
|
2545
|
+
var T, z;
|
|
2546
|
+
const s = ((T = o.purchaseOrder) == null ? void 0 : T.deliveryOrder) ?? [], m = ((z = o.purchaseOrder) == null ? void 0 : z.deliveryFullfillment) ?? [], V = [
|
|
2547
|
+
...s.map((p) => ({
|
|
2549
2548
|
createdAt: p.createdAt,
|
|
2550
2549
|
type: "grn",
|
|
2551
2550
|
doc: p
|
|
@@ -2556,23 +2555,23 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2556
2555
|
doc: p
|
|
2557
2556
|
}))
|
|
2558
2557
|
];
|
|
2559
|
-
V.reverse().sort((p,
|
|
2558
|
+
V.reverse().sort((p, Z) => p.createdAt.localeCompare(Z.createdAt));
|
|
2560
2559
|
function E(p) {
|
|
2561
|
-
var ne, P, me, Oe,
|
|
2562
|
-
const
|
|
2563
|
-
(P = (ne = m[
|
|
2560
|
+
var ne, P, me, Oe, Fe, Te, te, le, pe, be, _e, Re;
|
|
2561
|
+
const Z = m.findIndex((ue) => ue.id === p.fullfillmentId), ae = [
|
|
2562
|
+
(P = (ne = m[Z]) == null ? void 0 : ne.netSuite) != null && P.id ? {
|
|
2564
2563
|
label: "Fulfillment's ref no. (Netsuite)",
|
|
2565
2564
|
values: [
|
|
2566
|
-
`${((Oe = (me = m[
|
|
2565
|
+
`${((Oe = (me = m[Z]) == null ? void 0 : me.netSuite) == null ? void 0 : Oe.refNo) ?? "N/A"} (${((Te = (Fe = m[Z]) == null ? void 0 : Fe.netSuite) == null ? void 0 : Te.id) ?? "-"})`
|
|
2567
2566
|
]
|
|
2568
2567
|
} : null,
|
|
2569
|
-
(
|
|
2568
|
+
(te = p == null ? void 0 : p.netSuite) != null && te.id ? {
|
|
2570
2569
|
label: "Netsuite ref no.",
|
|
2571
2570
|
values: [`${((le = p == null ? void 0 : p.netSuite) == null ? void 0 : le.refNo) ?? "N/A"} (${((pe = p == null ? void 0 : p.netSuite) == null ? void 0 : pe.id) ?? "-"})`]
|
|
2572
2571
|
} : null,
|
|
2573
|
-
(
|
|
2572
|
+
(be = p == null ? void 0 : p.netSuite) != null && be.recordType ? {
|
|
2574
2573
|
label: "Netsuite Type",
|
|
2575
|
-
values: [
|
|
2574
|
+
values: [bt((_e = p == null ? void 0 : p.netSuite) == null ? void 0 : _e.recordType)]
|
|
2576
2575
|
} : null
|
|
2577
2576
|
];
|
|
2578
2577
|
return {
|
|
@@ -2592,7 +2591,7 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2592
2591
|
},
|
|
2593
2592
|
{
|
|
2594
2593
|
label: "Received items",
|
|
2595
|
-
values: p.received.map((
|
|
2594
|
+
values: p.received.map((ue) => {
|
|
2596
2595
|
var fe;
|
|
2597
2596
|
return L("div", [
|
|
2598
2597
|
L(
|
|
@@ -2612,14 +2611,14 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2612
2611
|
{
|
|
2613
2612
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
2614
2613
|
},
|
|
2615
|
-
`${
|
|
2614
|
+
`${ue.sku.name}`
|
|
2616
2615
|
),
|
|
2617
2616
|
L(
|
|
2618
2617
|
"span",
|
|
2619
2618
|
{
|
|
2620
2619
|
class: "fm-typo-en-body-md-400"
|
|
2621
2620
|
},
|
|
2622
|
-
`${
|
|
2621
|
+
`${ue.sku.code} `
|
|
2623
2622
|
)
|
|
2624
2623
|
]
|
|
2625
2624
|
),
|
|
@@ -2640,14 +2639,14 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2640
2639
|
{
|
|
2641
2640
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
2642
2641
|
},
|
|
2643
|
-
he(
|
|
2642
|
+
he(ue.amount, !1)
|
|
2644
2643
|
),
|
|
2645
2644
|
L(
|
|
2646
2645
|
"span",
|
|
2647
2646
|
{
|
|
2648
2647
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
2649
2648
|
},
|
|
2650
|
-
((fe =
|
|
2649
|
+
((fe = ue.measurement) == null ? void 0 : fe.abbrev) ?? ue.sku.unit.abbrev
|
|
2651
2650
|
)
|
|
2652
2651
|
]
|
|
2653
2652
|
),
|
|
@@ -2656,7 +2655,7 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2656
2655
|
{
|
|
2657
2656
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
2658
2657
|
},
|
|
2659
|
-
`${
|
|
2658
|
+
`${ue.cost ? `(${Ke(ue.cost)})` : ""}`
|
|
2660
2659
|
)
|
|
2661
2660
|
]
|
|
2662
2661
|
)
|
|
@@ -2673,24 +2672,24 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2673
2672
|
label: "Remark",
|
|
2674
2673
|
values: [p.remark || "N/A"]
|
|
2675
2674
|
},
|
|
2676
|
-
|
|
2675
|
+
Z > -1 ? {
|
|
2677
2676
|
label: "Fulfilment's sequence",
|
|
2678
|
-
values: [`${
|
|
2677
|
+
values: [`${Z + 1}`]
|
|
2679
2678
|
} : null,
|
|
2680
2679
|
...ae
|
|
2681
|
-
].filter((
|
|
2680
|
+
].filter((ue) => !!ue)
|
|
2682
2681
|
};
|
|
2683
2682
|
}
|
|
2684
2683
|
function G(p) {
|
|
2685
2684
|
var ae, ne;
|
|
2686
|
-
const
|
|
2685
|
+
const Z = m.findIndex((P) => P.id === p.id);
|
|
2687
2686
|
return {
|
|
2688
2687
|
header: "Fulfillment",
|
|
2689
2688
|
date: He(new Date(p.createdAt)),
|
|
2690
2689
|
info: [
|
|
2691
2690
|
{
|
|
2692
2691
|
label: "Sequence",
|
|
2693
|
-
values: [String(
|
|
2692
|
+
values: [String(Z + 1)]
|
|
2694
2693
|
},
|
|
2695
2694
|
{
|
|
2696
2695
|
label: "Receiveable items",
|
|
@@ -2784,70 +2783,70 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2784
2783
|
});
|
|
2785
2784
|
}), oe = Y(() => {
|
|
2786
2785
|
var m;
|
|
2787
|
-
const
|
|
2786
|
+
const s = {
|
|
2788
2787
|
...gt(0),
|
|
2789
2788
|
currency: Ce()
|
|
2790
2789
|
};
|
|
2791
2790
|
return ((m = o.purchaseOrder) == null ? void 0 : m.items.reduce((V, E) => ({
|
|
2792
|
-
...
|
|
2791
|
+
...ht(V, E.totalCost ?? s),
|
|
2793
2792
|
currency: Ce()
|
|
2794
|
-
}),
|
|
2793
|
+
}), s)) ?? s;
|
|
2795
2794
|
});
|
|
2796
|
-
function k(
|
|
2797
|
-
var
|
|
2798
|
-
const V = (((
|
|
2799
|
-
return `<span class="${
|
|
2795
|
+
function k(s) {
|
|
2796
|
+
var T;
|
|
2797
|
+
const V = (((T = o.purchaseOrder) == null ? void 0 : T.version) ?? Pe.enum[1]) === Pe.enum[2] ? s.id : s.sku._id, E = o.receivedMap[V];
|
|
2798
|
+
return `<span class="${_(s)} fm-typo-en-body-lg-600">${qe.toFormatString({ value: E.received })}</span>/${Ut(s.quantity, s.sku.unit, s.measurement)}`;
|
|
2800
2799
|
}
|
|
2801
|
-
function
|
|
2802
|
-
var
|
|
2803
|
-
const V = (((
|
|
2804
|
-
return
|
|
2800
|
+
function _(s) {
|
|
2801
|
+
var Z;
|
|
2802
|
+
const V = (((Z = o.purchaseOrder) == null ? void 0 : Z.version) ?? Pe.enum[1]) === Pe.enum[2] ? s.id : s.sku._id, E = o.receivedMap[V], { isPartialReceive: G, isNoReceive: T, isOverReceive: z, isFullReceive: p } = Jt(E);
|
|
2803
|
+
return T ? "text-fm-color-typo-tertiary" : G ? "text-fm-color-system-warning-300" : z ? "text-fm-color-system-error-300" : p ? "text-fm-color-system-success-300" : "";
|
|
2805
2804
|
}
|
|
2806
|
-
const
|
|
2807
|
-
var
|
|
2808
|
-
return (
|
|
2809
|
-
var
|
|
2810
|
-
const
|
|
2811
|
-
(
|
|
2805
|
+
const F = Y(() => {
|
|
2806
|
+
var s, m, V;
|
|
2807
|
+
return (s = o.purchaseOrder) != null && s.itemsAtSubmission ? ((m = o.purchaseOrder) == null ? void 0 : m.version) === Pe.enum[2] ? o.purchaseOrder.items.reduce((E, G) => {
|
|
2808
|
+
var z, p;
|
|
2809
|
+
const T = (p = (z = o.purchaseOrder) == null ? void 0 : z.itemsAtSubmission) == null ? void 0 : p.find(
|
|
2810
|
+
(Z) => Z.id === G.id
|
|
2812
2811
|
);
|
|
2813
|
-
return
|
|
2814
|
-
originalAmount: Number(
|
|
2815
|
-
newAmount: Number(
|
|
2812
|
+
return T && T.quantity !== G.quantity && E.set(G.sku.code, {
|
|
2813
|
+
originalAmount: Number(qe.toFormatString({ value: T.quantity })),
|
|
2814
|
+
newAmount: Number(qe.toFormatString({ value: G.quantity }))
|
|
2816
2815
|
}), E;
|
|
2817
2816
|
}, /* @__PURE__ */ new Map()) : (V = o.purchaseOrder) == null ? void 0 : V.items.reduce((E, G) => {
|
|
2818
|
-
var
|
|
2819
|
-
const
|
|
2817
|
+
var Z, ae;
|
|
2818
|
+
const T = (ae = (Z = o.purchaseOrder) == null ? void 0 : Z.itemsAtSubmission) == null ? void 0 : ae.find(
|
|
2820
2819
|
(ne) => ne.sku._id === G.sku._id
|
|
2821
|
-
),
|
|
2822
|
-
return
|
|
2823
|
-
originalAmount:
|
|
2820
|
+
), z = T ? Number(qe.toFormatString({ value: T.quantity })) : 0, p = Number(qe.toFormatString({ value: G.quantity }));
|
|
2821
|
+
return T && z !== p && E.set(G.sku.code, {
|
|
2822
|
+
originalAmount: z,
|
|
2824
2823
|
newAmount: p
|
|
2825
2824
|
}), E;
|
|
2826
2825
|
}, /* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
|
|
2827
|
-
}), W = (
|
|
2826
|
+
}), W = (s) => {
|
|
2828
2827
|
var V, E;
|
|
2829
|
-
const m =
|
|
2830
|
-
return ((V = o.purchaseOrder) == null ? void 0 : V.version) ===
|
|
2831
|
-
},
|
|
2828
|
+
const m = F.value;
|
|
2829
|
+
return ((V = o.purchaseOrder) == null ? void 0 : V.version) === Pe.enum[2] ? m.has(s.id) : m.has((E = s.sku) == null ? void 0 : E.code);
|
|
2830
|
+
}, ce = (s) => {
|
|
2832
2831
|
var V, E;
|
|
2833
|
-
const m =
|
|
2834
|
-
return ((V = o.purchaseOrder) == null ? void 0 : V.version) ===
|
|
2832
|
+
const m = F.value;
|
|
2833
|
+
return ((V = o.purchaseOrder) == null ? void 0 : V.version) === Pe.enum[2] ? m.get(s.id) : m.get((E = s.sku) == null ? void 0 : E.code);
|
|
2835
2834
|
};
|
|
2836
|
-
return (
|
|
2837
|
-
const V = H("FmButton"), E = H("FmButtonGroup"), G = H("FmChip"),
|
|
2838
|
-
return
|
|
2835
|
+
return (s, m) => {
|
|
2836
|
+
const V = H("FmButton"), E = H("FmButtonGroup"), G = H("FmChip"), T = H("FmIcon"), z = H("FmMenuDivider"), p = H("FmCard"), Z = H("FmTooltip"), ae = H("FmSpacer"), ne = H("FmSideSheet");
|
|
2837
|
+
return l(), re(ne, {
|
|
2839
2838
|
modelValue: v(R),
|
|
2840
|
-
"onUpdate:modelValue": m[8] || (m[8] = (P) =>
|
|
2841
|
-
"dismiss-away":
|
|
2839
|
+
"onUpdate:modelValue": m[8] || (m[8] = (P) => Dt(R) ? R.value = P : null),
|
|
2840
|
+
"dismiss-away": r.value,
|
|
2842
2841
|
"max-width": 600,
|
|
2843
2842
|
"close-button": !1
|
|
2844
2843
|
}, {
|
|
2845
|
-
"side-sheet-header":
|
|
2844
|
+
"side-sheet-header": ee(() => {
|
|
2846
2845
|
var P, me;
|
|
2847
2846
|
return [
|
|
2848
2847
|
e("div", ao, [
|
|
2849
2848
|
e("div", lo, [
|
|
2850
|
-
e("div", io, y(v(
|
|
2849
|
+
e("div", io, y(v(u)("inventory.transfer.receiveRequest.details.title") + ((P = s.purchaseOrder) != null && P.seqNumber ? ` #${(me = s.purchaseOrder) == null ? void 0 : me.seqNumber}` : "")), 1),
|
|
2851
2850
|
D(V, {
|
|
2852
2851
|
class: "ml-auto -m-2",
|
|
2853
2852
|
variant: "tertiary",
|
|
@@ -2856,14 +2855,14 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2856
2855
|
})
|
|
2857
2856
|
]),
|
|
2858
2857
|
D(E, {
|
|
2859
|
-
items:
|
|
2860
|
-
modelValue:
|
|
2861
|
-
"onUpdate:modelValue": m[1] || (m[1] = (Oe) =>
|
|
2858
|
+
items: X.value,
|
|
2859
|
+
modelValue: j.value,
|
|
2860
|
+
"onUpdate:modelValue": m[1] || (m[1] = (Oe) => j.value = Oe)
|
|
2862
2861
|
}, null, 8, ["items", "modelValue"]),
|
|
2863
|
-
|
|
2862
|
+
s.purchaseOrder && j.value.value === "deliveryHistory" ? (l(), re(jr, {
|
|
2864
2863
|
key: 0,
|
|
2865
|
-
"purchase-order":
|
|
2866
|
-
"received-info-map":
|
|
2864
|
+
"purchase-order": s.purchaseOrder,
|
|
2865
|
+
"received-info-map": Ne.value,
|
|
2867
2866
|
onSubmitted: m[2] || (m[2] = () => {
|
|
2868
2867
|
f("update:show", !1), f("submitted");
|
|
2869
2868
|
})
|
|
@@ -2871,24 +2870,24 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2871
2870
|
])
|
|
2872
2871
|
];
|
|
2873
2872
|
}),
|
|
2874
|
-
default:
|
|
2875
|
-
var P, me, Oe,
|
|
2873
|
+
default: ee(() => {
|
|
2874
|
+
var P, me, Oe, Fe, Te;
|
|
2876
2875
|
return [
|
|
2877
2876
|
e("div", co, [
|
|
2878
|
-
|
|
2877
|
+
j.value.value === "overview" ? (l(), h(de, { key: 0 }, [
|
|
2879
2878
|
e("div", null, [
|
|
2880
2879
|
D(p, {
|
|
2881
2880
|
variant: "outlined",
|
|
2882
2881
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
2883
2882
|
}, {
|
|
2884
|
-
default:
|
|
2885
|
-
var
|
|
2883
|
+
default: ee(() => {
|
|
2884
|
+
var te, le, pe, be, _e, Re, ue, fe, Ie;
|
|
2886
2885
|
return [
|
|
2887
2886
|
e("div", uo, [
|
|
2888
|
-
e("div", mo, y(v(
|
|
2887
|
+
e("div", mo, y(v(u)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
2889
2888
|
e("div", po, [
|
|
2890
|
-
D(
|
|
2891
|
-
default:
|
|
2889
|
+
D(Ve, null, {
|
|
2890
|
+
default: ee(() => {
|
|
2892
2891
|
var Ee;
|
|
2893
2892
|
return [
|
|
2894
2893
|
ke(y((Ee = o.purchaseOrder) == null ? void 0 : Ee.status), 1)
|
|
@@ -2901,48 +2900,48 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2901
2900
|
class: Me(B.value.statusClass),
|
|
2902
2901
|
compact: ""
|
|
2903
2902
|
}, null, 8, ["label", "class"]),
|
|
2904
|
-
|
|
2905
|
-
D(
|
|
2903
|
+
N.value ? (l(), h("div", fo, [
|
|
2904
|
+
D(T, {
|
|
2906
2905
|
name: "local_shipping",
|
|
2907
2906
|
color: "#666666"
|
|
2908
2907
|
}),
|
|
2909
|
-
e("span", yo, y(
|
|
2908
|
+
e("span", yo, y(N.value), 1)
|
|
2910
2909
|
])) : U("", !0)
|
|
2911
2910
|
])
|
|
2912
2911
|
]),
|
|
2913
|
-
D(
|
|
2912
|
+
D(z),
|
|
2914
2913
|
e("div", vo, [
|
|
2915
|
-
e("div",
|
|
2916
|
-
e("div",
|
|
2917
|
-
e("div", go, y(v(
|
|
2914
|
+
e("div", bo, [
|
|
2915
|
+
e("div", ho, [
|
|
2916
|
+
e("div", go, y(v(u)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
2918
2917
|
]),
|
|
2919
|
-
e("div", _o, y(v(We)(((
|
|
2918
|
+
e("div", _o, y(v(We)(((te = s.purchaseOrder) == null ? void 0 : te._id) ?? "")), 1)
|
|
2920
2919
|
]),
|
|
2921
|
-
(le =
|
|
2922
|
-
e("div", xo, y(v(
|
|
2923
|
-
e("div", Oo, y(v(_t)(new Date((pe =
|
|
2920
|
+
(le = s.purchaseOrder) != null && le.effectiveAt ? (l(), h("div", So, [
|
|
2921
|
+
e("div", xo, y(v(u)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
2922
|
+
e("div", Oo, y(v(_t)(new Date((pe = s.purchaseOrder) == null ? void 0 : pe.effectiveAt))), 1)
|
|
2924
2923
|
])) : U("", !0),
|
|
2925
2924
|
e("div", wo, [
|
|
2926
|
-
e("div", $o, y(v(
|
|
2927
|
-
e("div", Co, y(v(
|
|
2928
|
-
`inventory.transfer.receiveRequest.details.type.${
|
|
2925
|
+
e("div", $o, y(v(u)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
2926
|
+
e("div", Co, y(v(u)(
|
|
2927
|
+
`inventory.transfer.receiveRequest.details.type.${I.value.toLocaleLowerCase("en-US")}`
|
|
2929
2928
|
)), 1)
|
|
2930
2929
|
]),
|
|
2931
|
-
(_e = (
|
|
2932
|
-
e("div", ko, y(v(
|
|
2933
|
-
e("div", Do, y((
|
|
2930
|
+
(_e = (be = s.purchaseOrder) == null ? void 0 : be.supplier) != null && _e.name ? (l(), h("div", Ro, [
|
|
2931
|
+
e("div", ko, y(v(u)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
2932
|
+
e("div", Do, y((ue = (Re = s.purchaseOrder) == null ? void 0 : Re.supplier) == null ? void 0 : ue.name), 1)
|
|
2934
2933
|
])) : U("", !0),
|
|
2935
|
-
|
|
2936
|
-
e("div", No, y(v(
|
|
2937
|
-
e("div", Fo, y(
|
|
2934
|
+
s.transferTo ? (l(), h("div", Ao, [
|
|
2935
|
+
e("div", No, y(v(u)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
2936
|
+
e("div", Fo, y(s.transferTo), 1)
|
|
2938
2937
|
])) : U("", !0),
|
|
2939
|
-
(fe =
|
|
2940
|
-
e("div", Io, y(v(
|
|
2941
|
-
e("div", Po, y(
|
|
2938
|
+
(fe = s.purchaseOrder) != null && fe.ref ? (l(), h("div", To, [
|
|
2939
|
+
e("div", Io, y(v(u)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
2940
|
+
e("div", Po, y(s.purchaseOrder.ref), 1)
|
|
2942
2941
|
])) : U("", !0),
|
|
2943
|
-
(
|
|
2944
|
-
e("div", Vo, y(v(
|
|
2945
|
-
e("div", Eo, y(
|
|
2942
|
+
(Ie = s.purchaseOrder) != null && Ie.remark ? (l(), h("div", qo, [
|
|
2943
|
+
e("div", Vo, y(v(u)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
2944
|
+
e("div", Eo, y(s.purchaseOrder.remark), 1)
|
|
2946
2945
|
])) : U("", !0)
|
|
2947
2946
|
])
|
|
2948
2947
|
];
|
|
@@ -2951,32 +2950,32 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2951
2950
|
})
|
|
2952
2951
|
]),
|
|
2953
2952
|
D(Zs, {
|
|
2954
|
-
"po-request":
|
|
2955
|
-
purchaseOrder:
|
|
2956
|
-
transferType:
|
|
2957
|
-
transferToDbName:
|
|
2958
|
-
scope:
|
|
2953
|
+
"po-request": s.poRequest,
|
|
2954
|
+
purchaseOrder: s.purchaseOrder,
|
|
2955
|
+
transferType: I.value,
|
|
2956
|
+
transferToDbName: s.transferToDbName,
|
|
2957
|
+
scope: s.scope
|
|
2959
2958
|
}, null, 8, ["po-request", "purchaseOrder", "transferType", "transferToDbName", "scope"]),
|
|
2960
2959
|
e("div", Lo, [
|
|
2961
2960
|
e("div", Mo, [
|
|
2962
2961
|
e("div", Uo, [
|
|
2963
2962
|
e("span", Bo, [
|
|
2964
|
-
ke(y(
|
|
2965
|
-
(me = (P =
|
|
2963
|
+
ke(y(Ae.value ? v(u)("inventory.transfer.receiveRequest.details.receivedItems") : v(u)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
|
|
2964
|
+
(me = (P = s.purchaseOrder) == null ? void 0 : P.netSuite) != null && me.missingItems && ((Fe = (Oe = s.purchaseOrder) == null ? void 0 : Oe.netSuite) == null ? void 0 : Fe.missingItems.length) > 0 ? (l(), re(Z, {
|
|
2966
2965
|
key: 0,
|
|
2967
2966
|
variant: "rich",
|
|
2968
2967
|
placement: "top",
|
|
2969
2968
|
"z-index": 51
|
|
2970
2969
|
}, {
|
|
2971
|
-
content:
|
|
2972
|
-
var
|
|
2970
|
+
content: ee(() => {
|
|
2971
|
+
var te, le;
|
|
2973
2972
|
return [
|
|
2974
2973
|
e("div", jo, [
|
|
2975
|
-
(
|
|
2974
|
+
(l(!0), h(de, null, xe((le = (te = s.purchaseOrder) == null ? void 0 : te.netSuite) == null ? void 0 : le.missingItems, (pe, be) => (l(), h("div", {
|
|
2976
2975
|
class: "flex justify-center align-middle",
|
|
2977
|
-
key:
|
|
2976
|
+
key: be
|
|
2978
2977
|
}, [
|
|
2979
|
-
D(
|
|
2978
|
+
D(T, {
|
|
2980
2979
|
name: "arrow_right",
|
|
2981
2980
|
size: "sm"
|
|
2982
2981
|
}),
|
|
@@ -2985,8 +2984,8 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2985
2984
|
])
|
|
2986
2985
|
];
|
|
2987
2986
|
}),
|
|
2988
|
-
default:
|
|
2989
|
-
D(
|
|
2987
|
+
default: ee(() => [
|
|
2988
|
+
D(T, {
|
|
2990
2989
|
name: "error",
|
|
2991
2990
|
color: "#ff2c2c",
|
|
2992
2991
|
size: "sm"
|
|
@@ -2996,34 +2995,34 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
2996
2995
|
})) : U("", !0)
|
|
2997
2996
|
])
|
|
2998
2997
|
]),
|
|
2999
|
-
D(
|
|
3000
|
-
(
|
|
2998
|
+
D(z),
|
|
2999
|
+
(l(!0), h(de, null, xe(((Te = s.purchaseOrder) == null ? void 0 : Te.items) ?? [], (te, le) => {
|
|
3001
3000
|
var pe;
|
|
3002
|
-
return
|
|
3001
|
+
return l(), h("div", {
|
|
3003
3002
|
key: le,
|
|
3004
3003
|
class: "flex flex-col"
|
|
3005
3004
|
}, [
|
|
3006
3005
|
e("div", zo, [
|
|
3007
3006
|
e("div", Ko, [
|
|
3008
|
-
ke(y(
|
|
3009
|
-
W(
|
|
3007
|
+
ke(y(te.name) + " ", 1),
|
|
3008
|
+
W(te) ? (l(), re(Z, {
|
|
3010
3009
|
key: 0,
|
|
3011
3010
|
variant: "rich",
|
|
3012
3011
|
placement: "top",
|
|
3013
3012
|
"z-index": 51
|
|
3014
3013
|
}, {
|
|
3015
|
-
content:
|
|
3016
|
-
var
|
|
3014
|
+
content: ee(() => {
|
|
3015
|
+
var be, _e;
|
|
3017
3016
|
return [
|
|
3018
3017
|
e("div", Go, [
|
|
3019
3018
|
m[9] || (m[9] = e("div", { class: "font-semibold" }, "Submission changes", -1)),
|
|
3020
|
-
e("div", null, "Original Amount: " + y((
|
|
3021
|
-
e("div", null, " New Amount: " + y((_e =
|
|
3019
|
+
e("div", null, "Original Amount: " + y((be = ce(te)) == null ? void 0 : be.originalAmount), 1),
|
|
3020
|
+
e("div", null, " New Amount: " + y((_e = ce(te)) == null ? void 0 : _e.newAmount), 1)
|
|
3022
3021
|
])
|
|
3023
3022
|
];
|
|
3024
3023
|
}),
|
|
3025
|
-
default:
|
|
3026
|
-
D(
|
|
3024
|
+
default: ee(() => [
|
|
3025
|
+
D(T, {
|
|
3027
3026
|
name: "error",
|
|
3028
3027
|
color: "#ff9500",
|
|
3029
3028
|
size: "sm"
|
|
@@ -3034,19 +3033,19 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
3034
3033
|
]),
|
|
3035
3034
|
e("div", Ho, [
|
|
3036
3035
|
e("span", {
|
|
3037
|
-
innerHTML: k(
|
|
3036
|
+
innerHTML: k(te)
|
|
3038
3037
|
}, null, 8, Wo)
|
|
3039
3038
|
])
|
|
3040
3039
|
]),
|
|
3041
3040
|
e("div", Yo, [
|
|
3042
|
-
e("div", Qo, y(
|
|
3043
|
-
(pe =
|
|
3041
|
+
e("div", Qo, y(te.code), 1),
|
|
3042
|
+
(pe = te.totalCost) != null && pe.amount && v(A).enableTotalCost ? (l(), h("div", Jo, " (" + y(v(Ke)(te.totalCost)) + ") ", 1)) : U("", !0)
|
|
3044
3043
|
])
|
|
3045
3044
|
]);
|
|
3046
3045
|
}), 128)),
|
|
3047
|
-
+v(he)(oe.value) ? (
|
|
3046
|
+
+v(he)(oe.value) ? (l(), h(de, { key: 0 }, [
|
|
3048
3047
|
e("div", Xo, [
|
|
3049
|
-
D(
|
|
3048
|
+
D(z)
|
|
3050
3049
|
]),
|
|
3051
3050
|
e("div", Zo, [
|
|
3052
3051
|
m[10] || (m[10] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
|
|
@@ -3055,11 +3054,11 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
3055
3054
|
], 64)) : U("", !0)
|
|
3056
3055
|
])
|
|
3057
3056
|
])
|
|
3058
|
-
], 64)) :
|
|
3059
|
-
q.value.length ? (
|
|
3060
|
-
(
|
|
3061
|
-
var pe,
|
|
3062
|
-
return
|
|
3057
|
+
], 64)) : j.value.value === "deliveryHistory" ? (l(), h("div", tn, [
|
|
3058
|
+
q.value.length ? (l(), h("div", an, [
|
|
3059
|
+
(l(!0), h(de, null, xe(q.value, (te, le) => {
|
|
3060
|
+
var pe, be, _e, Re, ue;
|
|
3061
|
+
return l(), h(de, { key: le }, [
|
|
3063
3062
|
e("div", ln, [
|
|
3064
3063
|
e("div", cn, [
|
|
3065
3064
|
e("div", un, [
|
|
@@ -3074,7 +3073,7 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
3074
3073
|
}, null, 2)
|
|
3075
3074
|
]),
|
|
3076
3075
|
e("div", dn, [
|
|
3077
|
-
|
|
3076
|
+
te.header === "Received" ? (l(), re(T, {
|
|
3078
3077
|
key: 0,
|
|
3079
3078
|
name: "local_shipping",
|
|
3080
3079
|
outline: "",
|
|
@@ -3095,38 +3094,38 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
3095
3094
|
]),
|
|
3096
3095
|
e("div", pn, [
|
|
3097
3096
|
e("div", fn, [
|
|
3098
|
-
e("div", yn, y(
|
|
3099
|
-
e("div", vn, y(
|
|
3097
|
+
e("div", yn, y(te.header), 1),
|
|
3098
|
+
e("div", vn, y(te.date), 1)
|
|
3100
3099
|
]),
|
|
3101
|
-
e("div",
|
|
3102
|
-
|
|
3100
|
+
e("div", bn, [
|
|
3101
|
+
te.header === "Received" && te.deliveryOrder && s.purchaseOrder ? (l(), re(hr, {
|
|
3103
3102
|
key: 0,
|
|
3104
|
-
deliveryOrder:
|
|
3105
|
-
purchaseOrder:
|
|
3103
|
+
deliveryOrder: te.deliveryOrder,
|
|
3104
|
+
purchaseOrder: s.purchaseOrder,
|
|
3106
3105
|
onSubmitted: m[3] || (m[3] = () => {
|
|
3107
3106
|
f("update:show", !1), f("submitted");
|
|
3108
3107
|
})
|
|
3109
3108
|
}, null, 8, ["deliveryOrder", "purchaseOrder"])) : U("", !0),
|
|
3110
|
-
(
|
|
3111
|
-
default:
|
|
3112
|
-
var fe,
|
|
3109
|
+
(be = (pe = te.deliveryOrder) == null ? void 0 : pe.netSuite) != null && be.id ? (l(), re(Ve, { key: 1 }, {
|
|
3110
|
+
default: ee(() => {
|
|
3111
|
+
var fe, Ie;
|
|
3113
3112
|
return [
|
|
3114
3113
|
D(no, {
|
|
3115
|
-
"netsuite-id": (
|
|
3114
|
+
"netsuite-id": (Ie = (fe = te.deliveryOrder) == null ? void 0 : fe.netSuite) == null ? void 0 : Ie.id
|
|
3116
3115
|
}, null, 8, ["netsuite-id"])
|
|
3117
3116
|
];
|
|
3118
3117
|
}),
|
|
3119
3118
|
_: 2
|
|
3120
3119
|
}, 1024)) : U("", !0),
|
|
3121
|
-
|
|
3120
|
+
s.purchaseOrder && ((_e = te.deliveryOrder) != null && _e.id) ? (l(), re(Bt, {
|
|
3122
3121
|
key: 2,
|
|
3123
|
-
"purchase-order-id": (Re =
|
|
3124
|
-
"delivery-order-id": (
|
|
3122
|
+
"purchase-order-id": (Re = s.purchaseOrder) == null ? void 0 : Re._id,
|
|
3123
|
+
"delivery-order-id": (ue = te.deliveryOrder) == null ? void 0 : ue.id
|
|
3125
3124
|
}, null, 8, ["purchase-order-id", "delivery-order-id"])) : U("", !0)
|
|
3126
3125
|
])
|
|
3127
3126
|
])
|
|
3128
3127
|
]),
|
|
3129
|
-
e("div",
|
|
3128
|
+
e("div", hn, [
|
|
3130
3129
|
e("div", gn, [
|
|
3131
3130
|
e("div", _n, [
|
|
3132
3131
|
e("div", {
|
|
@@ -3145,21 +3144,21 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
3145
3144
|
variant: "outlined",
|
|
3146
3145
|
class: "py-12 px-16"
|
|
3147
3146
|
}, {
|
|
3148
|
-
default:
|
|
3147
|
+
default: ee(() => [
|
|
3149
3148
|
e("div", xn, [
|
|
3150
|
-
(
|
|
3151
|
-
key:
|
|
3149
|
+
(l(!0), h(de, null, xe(te.info, (fe, Ie) => (l(), h("div", {
|
|
3150
|
+
key: Ie,
|
|
3152
3151
|
class: "flex flex-col gap-4"
|
|
3153
3152
|
}, [
|
|
3154
3153
|
e("div", On, y(fe == null ? void 0 : fe.label), 1),
|
|
3155
3154
|
e("div", wn, [
|
|
3156
|
-
(
|
|
3157
|
-
key:
|
|
3155
|
+
(l(!0), h(de, null, xe(fe == null ? void 0 : fe.values, (Ee, $t) => (l(), h("div", {
|
|
3156
|
+
key: $t,
|
|
3158
3157
|
class: "fm-typo-en-body-lg-600"
|
|
3159
3158
|
}, [
|
|
3160
|
-
typeof Ee == "string" ? (
|
|
3159
|
+
typeof Ee == "string" ? (l(), h(de, { key: 0 }, [
|
|
3161
3160
|
ke(y(Ee), 1)
|
|
3162
|
-
], 64)) : (
|
|
3161
|
+
], 64)) : (l(), re(At(Ee), { key: 1 }))
|
|
3163
3162
|
]))), 128))
|
|
3164
3163
|
])
|
|
3165
3164
|
]))), 128))
|
|
@@ -3171,16 +3170,16 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
3171
3170
|
])
|
|
3172
3171
|
], 64);
|
|
3173
3172
|
}), 128))
|
|
3174
|
-
])) : (
|
|
3173
|
+
])) : (l(), h("div", sn, [
|
|
3175
3174
|
D(ae),
|
|
3176
3175
|
e("div", null, [
|
|
3177
3176
|
e("img", {
|
|
3178
|
-
src: v(
|
|
3177
|
+
src: v(Et),
|
|
3179
3178
|
alt: "List is empty"
|
|
3180
3179
|
}, null, 8, rn)
|
|
3181
3180
|
]),
|
|
3182
|
-
e("div", on, y(v(
|
|
3183
|
-
e("div", nn, y(v(
|
|
3181
|
+
e("div", on, y(v(u)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
3182
|
+
e("div", nn, y(v(u)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
|
|
3184
3183
|
D(ae),
|
|
3185
3184
|
D(ae)
|
|
3186
3185
|
]))
|
|
@@ -3188,41 +3187,41 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
|
|
|
3188
3187
|
])
|
|
3189
3188
|
];
|
|
3190
3189
|
}),
|
|
3191
|
-
"side-sheet-footer":
|
|
3190
|
+
"side-sheet-footer": ee(() => [
|
|
3192
3191
|
e("div", $n, [
|
|
3193
|
-
(
|
|
3194
|
-
v(ot)[P].available != !1 ? (
|
|
3192
|
+
(l(!0), h(de, null, xe(K.value, (P) => (l(), h(de, null, [
|
|
3193
|
+
v(ot)[P].available != !1 ? (l(), re(V, {
|
|
3195
3194
|
key: P,
|
|
3196
|
-
label: v(
|
|
3197
|
-
onClick: (me) =>
|
|
3198
|
-
loading:
|
|
3199
|
-
disabled:
|
|
3195
|
+
label: v(u)(v(ot)[P].translationKey),
|
|
3196
|
+
onClick: (me) => ie(P),
|
|
3197
|
+
loading: O.value === P,
|
|
3198
|
+
disabled: O.value !== P && w.value,
|
|
3200
3199
|
variant: v(ot)[P].buttonVariant
|
|
3201
3200
|
}, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : U("", !0)
|
|
3202
3201
|
], 64))), 256)),
|
|
3203
|
-
v(
|
|
3202
|
+
v(x).ableToMarkReceived(s.purchaseOrder) && !K.value.includes("completeReceive") ? (l(), re(V, {
|
|
3204
3203
|
key: 0,
|
|
3205
|
-
label: v(
|
|
3206
|
-
onClick: m[4] || (m[4] = (P) =>
|
|
3207
|
-
loading:
|
|
3208
|
-
disabled:
|
|
3204
|
+
label: v(u)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
3205
|
+
onClick: m[4] || (m[4] = (P) => ie("completeReceive")),
|
|
3206
|
+
loading: O.value === "completeReceive",
|
|
3207
|
+
disabled: O.value !== "completeReceive" && w.value
|
|
3209
3208
|
}, null, 8, ["label", "loading", "disabled"])) : U("", !0),
|
|
3210
|
-
v(
|
|
3209
|
+
v(x).ableToMarkApproved(s.purchaseOrder) && s.canApprove && !K.value.includes("approveRequest") ? (l(), re(V, {
|
|
3211
3210
|
key: 1,
|
|
3212
|
-
label: v(
|
|
3213
|
-
onClick: m[5] || (m[5] = (P) =>
|
|
3214
|
-
loading:
|
|
3215
|
-
disabled:
|
|
3211
|
+
label: v(u)("inventory.transfer.approval.actions.approveRequest"),
|
|
3212
|
+
onClick: m[5] || (m[5] = (P) => ie("approveRequest")),
|
|
3213
|
+
loading: O.value === "approveRequest",
|
|
3214
|
+
disabled: O.value !== "approveRequest" && w.value
|
|
3216
3215
|
}, null, 8, ["label", "loading", "disabled"])) : U("", !0),
|
|
3217
|
-
v(
|
|
3216
|
+
v(x).ableToCreateFulfillment(s.purchaseOrder, s.poRequest) && o.scope === "approval" ? (l(), re(V, {
|
|
3218
3217
|
key: 2,
|
|
3219
|
-
label: v(
|
|
3220
|
-
onClick: m[6] || (m[6] = (P) =>
|
|
3221
|
-
loading:
|
|
3222
|
-
disabled:
|
|
3218
|
+
label: v(u)("inventory.transfer.receiveRequest.actions.processRequest"),
|
|
3219
|
+
onClick: m[6] || (m[6] = (P) => ie("processRequest")),
|
|
3220
|
+
loading: O.value === "processRequest",
|
|
3221
|
+
disabled: O.value !== "processRequest" && w.value
|
|
3223
3222
|
}, null, 8, ["label", "loading", "disabled"])) : U("", !0),
|
|
3224
3223
|
D(V, {
|
|
3225
|
-
label: v(
|
|
3224
|
+
label: v(u)("common.close"),
|
|
3226
3225
|
variant: "tertiary",
|
|
3227
3226
|
onClick: m[7] || (m[7] = (P) => f("update:show", !1))
|
|
3228
3227
|
}, null, 8, ["label"])
|
|
@@ -3237,6 +3236,6 @@ export {
|
|
|
3237
3236
|
lt as P,
|
|
3238
3237
|
Jn as _,
|
|
3239
3238
|
Qn as a,
|
|
3240
|
-
|
|
3239
|
+
Xt as g,
|
|
3241
3240
|
Yn as u
|
|
3242
3241
|
};
|