@feedmepos/mf-inventory-portal 1.0.37-dev.3 → 1.0.38
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-Dmd2G8R5.js → App-Bh_jIWxm.js} +1 -1
- package/dist/{ApprovalView-Dp3k5vDw.js → ApprovalView-U-Jo7wyv.js} +19 -19
- package/dist/{BindingsDialog-D80Yhk4v.js → BindingsDialog-CC0wt6a_.js} +4 -4
- package/dist/{BindingsPicker-BYRH73Mx.js → BindingsPicker-WL_1lOdc.js} +1 -1
- package/dist/{BindingsTable-CvblcQnI.js → BindingsTable-DJf1WJou.js} +4 -4
- package/dist/{ClosingDraftView-DiUIrHnf.js → ClosingDraftView-BI19VIT_.js} +26 -26
- package/dist/ClosingTemplateView-B6p83fs1.js +1804 -0
- package/dist/{DeliveryOrderPrintPreview-7DmbPXg9.js → DeliveryOrderPrintPreview-LANZdQE7.js} +4 -4
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C_QmBqHi.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bhz1nVO6.js} +11 -11
- package/dist/{FmMultiselectDialog-m2Wih5ZC.js → FmMultiselectDialog-B16LNSaK.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-C0Ky06__.js → FmUnitInput.vue_vue_type_script_setup_true_lang-pAmapm7v.js} +21 -21
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DLfxc861.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-D7wM9EQ2.js} +1 -1
- package/dist/{IngredientGroupView-Um-bP1SR.js → IngredientGroupView-Bi8657CZ.js} +2 -2
- package/dist/IngredientsView-CGEQ-GvW.js +1838 -0
- package/dist/{IntegrationView-DfBOpvo1.js → IntegrationView-mYS_UJlk.js} +76 -77
- package/dist/{InventoryBindingForm-sbgSzNep.js → InventoryBindingForm-D-Y-IDFl.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CYpXwzuu.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-ByFJ6s6U.js} +24 -24
- package/dist/{InventoryBindingSummary-BWdagbGS.js → InventoryBindingSummary-z6XljZ_R.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BvdA5Qfu.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-ihrVnPMe.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CBH7oYpv.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DhoXg0vX.js} +10 -10
- package/dist/{PublishView-CjX1ZmFe.js → PublishView-DB7j7FkK.js} +17 -17
- package/dist/{PurchaseOrderPrintPreview-M20PXH1Z.js → PurchaseOrderPrintPreview-CTQIzDKp.js} +12 -12
- package/dist/{ReceiveRequestView-CF9p1j-M.js → ReceiveRequestView-B2UDO9o9.js} +782 -797
- package/dist/{RecipeView-kVgJAZ9d.js → RecipeView-BIDDh0V9.js} +3 -3
- package/dist/{StockView-B9bSTjY4.js → StockView-BgzAJBdL.js} +6 -6
- package/dist/{SupplierView-uaW913cH.js → SupplierView-zS3HDy59.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Bwiv5v2m.js → TransferDetails.vue_vue_type_script_setup_true_lang-DhnPjxXG.js} +696 -691
- package/dist/{TransferTemplateView-BuHT8mNT.js → TransferTemplateView-DLS9QAGY.js} +83 -83
- package/dist/{UnitView-Db_ETZrB.js → UnitView-B8mfgqXO.js} +3 -3
- package/dist/{WarehouseView-2SJNm6XK.js → WarehouseView-D4yYBRSM.js} +1 -1
- package/dist/api/inventory.d.ts +0 -4
- package/dist/api/netsuite.d.ts +0 -7
- package/dist/{app-CoEB-VoH.js → app-BLo-E2P1.js} +61427 -61936
- package/dist/app.d.ts +0 -9
- package/dist/app.js +1 -1
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +0 -1
- package/dist/components/row-action.enum.d.ts +1 -2
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +0 -1
- package/dist/{decimal-B7itxUWP.js → decimal-u4mLA_2Z.js} +1 -1
- package/dist/format-unit-display-g_Tq_sk7.js +1230 -0
- package/dist/{index-YGLKr3WK.js → index-BbBtmjWx.js} +1 -1
- package/dist/{index-DfWaG7Tl.js → index-Bu2R1xRv.js} +1 -1
- package/dist/{stock-CCQ352Hu.js → stock-BxIuAFed.js} +1 -1
- package/dist/stores/integration/netsuite.d.ts +1 -7
- package/dist/stores/inventory.d.ts +0 -9
- package/dist/{supplier-BCwA2FHM.js → supplier-CQftkZPG.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-DOONV-IL.js → use-ingredient-select-dialog-C9I7bja9.js} +1 -1
- package/dist/{use-inventory-binding-dialog-BPM-7FrW.js → use-inventory-binding-dialog-s8nyBhfo.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +1 -4
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +0 -8
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +0 -24
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +0 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +1 -16
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +0 -12
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +0 -2
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +0 -1
- package/dist/views/integration/components/netsuite/InventoryTransferIngredientTable.vue.d.ts +0 -2
- package/dist/views/integration/components/netsuite/business/BusinessNetSuiteSideSheet.vue.d.ts +0 -4
- package/dist/views/receive-request/components/netsuite/NetSuiteLog.vue.d.ts +2 -2
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +0 -17
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +0 -2
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +0 -4
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +0 -1
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +0 -4
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +0 -24
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +0 -24
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +0 -2
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +0 -2
- package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +0 -2
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +0 -2
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +0 -1
- package/dist/views/transfer-template/composables/use-netsuite-custom-field.d.ts +0 -3
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +1 -16
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +0 -12
- package/dist/{vue-i18n-DZAYeut-.js → vue-i18n-C3CYm8Dg.js} +352 -352
- package/package.json +1 -1
- package/dist/ClosingTemplateView-BGyaxOv_.js +0 -1849
- package/dist/IngredientsView-BOYvD0VL.js +0 -1858
- package/dist/api/duplicate-template.d.ts +0 -5
- package/dist/format-unit-display-DswmXjqB.js +0 -1275
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { a3 as lt, u as de,
|
|
2
|
-
import { ref as
|
|
3
|
-
import { F as St } from "./decimal-
|
|
1
|
+
import { a3 as lt, u as de, aN as O, c as De, b as qe, a8 as ct, aa as ut, ab as dt, aO as mt, e as Ye, f as et, a0 as Ve, aP as ft, a5 as Le, T as ke, j as ie, aQ as pt, aR as tt, af as xe, h as Qe, i as J, D as re, aw as ue, aS as rt, aT as st, aU as Pe, a9 as yt, au as Xe, a7 as Oe, ak as Ie, ax as vt } from "./app-BLo-E2P1.js";
|
|
2
|
+
import { ref as M, computed as Z, h as A, defineComponent as pe, reactive as ht, onMounted as nt, resolveComponent as K, openBlock as b, createBlock as ae, withCtx as se, createElementVNode as n, createVNode as I, unref as h, createElementBlock as N, toDisplayString as k, createCommentVNode as V, Fragment as te, renderList as me, watch as bt, isRef as gt, normalizeClass as Ne, createTextVNode as Fe, resolveDynamicComponent as _t } from "vue";
|
|
3
|
+
import { F as St } from "./decimal-u4mLA_2Z.js";
|
|
4
4
|
import { useCoreStore as Ae, useI18n as at } from "@feedmepos/mf-common";
|
|
5
|
-
import { b as wt, u as Rt, P as fe, f as Ot } from "./format-unit-display-
|
|
5
|
+
import { b as wt, u as Rt, P as fe, f as Ot } from "./format-unit-display-g_Tq_sk7.js";
|
|
6
6
|
import { E as Nt } from "./empty-placeholder-wf6-BWE8.js";
|
|
7
7
|
import { useDialog as Me, useSnackbar as Te, components as Je, FmButtonVariant as ee, useProxiedModel as kt } from "@feedmepos/ui-library";
|
|
8
|
-
import { _ as xt, F as Dt, a as qt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
8
|
+
import { _ as xt, F as Dt, a as qt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-pAmapm7v.js";
|
|
9
9
|
import { u as At, R as Ze } from "./usePromise-CbVUCxhj.js";
|
|
10
|
-
import { u as Tt } from "./index-
|
|
10
|
+
import { u as Tt } from "./index-Bu2R1xRv.js";
|
|
11
11
|
const $e = lt((S, e) => {
|
|
12
|
-
const i = de(),
|
|
12
|
+
const i = de(), _ = Ae();
|
|
13
13
|
return {
|
|
14
|
-
async readRequests(
|
|
15
|
-
const
|
|
16
|
-
return t &&
|
|
14
|
+
async readRequests(d, t, l) {
|
|
15
|
+
const a = d ?? i.currentLocationDBName, s = `${S.inventoryBackendUrl}/${a}/purchase-request`;
|
|
16
|
+
return t && l ? await e.get(`${s}?startDate=${t}&endDate=${l}`) : await e.get(s);
|
|
17
17
|
},
|
|
18
|
-
async readRequestById(
|
|
19
|
-
const
|
|
20
|
-
return await e.get(
|
|
18
|
+
async readRequestById(d, t) {
|
|
19
|
+
const l = t ?? i.currentLocationDBName, a = `${S.inventoryBackendUrl}/${l}/purchase-request/${d}`;
|
|
20
|
+
return await e.get(a);
|
|
21
21
|
},
|
|
22
|
-
async readRequestByIds(
|
|
23
|
-
const
|
|
24
|
-
return await e.post(
|
|
22
|
+
async readRequestByIds(d, t) {
|
|
23
|
+
const l = t ?? i.currentLocationDBName, a = `${S.inventoryBackendUrl}/${l}/purchase-request/find`;
|
|
24
|
+
return await e.post(a, { requestIds: d });
|
|
25
25
|
},
|
|
26
26
|
async getPurchaseOrders({
|
|
27
|
-
start:
|
|
27
|
+
start: d,
|
|
28
28
|
end: t
|
|
29
29
|
}) {
|
|
30
|
-
const
|
|
31
|
-
return await e.get(`${
|
|
30
|
+
const l = i.currentLocationDBName, a = `${S.inventoryBackendUrl}/${l}/purchase-order`;
|
|
31
|
+
return await e.get(`${a}?start=${d}&end=${t}`);
|
|
32
32
|
},
|
|
33
|
-
async getLatestPurchaseOrderRequest(
|
|
34
|
-
const t = i.currentLocationDBName,
|
|
35
|
-
return await e.get(`${
|
|
33
|
+
async getLatestPurchaseOrderRequest(d) {
|
|
34
|
+
const t = i.currentLocationDBName, l = `${S.inventoryBackendUrl}/${t}/purchase-request/find-by-purchase-order-id`;
|
|
35
|
+
return await e.get(`${l}/${d}`);
|
|
36
36
|
},
|
|
37
|
-
async getPurchaseOrderById(
|
|
38
|
-
const t = i.currentLocationDBName,
|
|
39
|
-
return await e.get(`${
|
|
37
|
+
async getPurchaseOrderById(d) {
|
|
38
|
+
const t = i.currentLocationDBName, l = `${S.inventoryBackendUrl}/${t}/purchase-order`;
|
|
39
|
+
return await e.get(`${l}/${d}`);
|
|
40
40
|
},
|
|
41
41
|
/**
|
|
42
42
|
* @deprecated Use `processPurchaseOrderV2` instead.
|
|
43
43
|
*/
|
|
44
|
-
async processPurchaseOrder(
|
|
45
|
-
const
|
|
46
|
-
return await e.put(s,
|
|
44
|
+
async processPurchaseOrder(d, t) {
|
|
45
|
+
const l = i.currentLocationDBName, a = t || l, s = `${S.inventoryBackendUrl}/${a}/purchase-order/run-operation`;
|
|
46
|
+
return await e.put(s, d);
|
|
47
47
|
},
|
|
48
|
-
async createPurchaseOrder(
|
|
49
|
-
const t = i.currentLocationDBName,
|
|
50
|
-
return await e.post(
|
|
48
|
+
async createPurchaseOrder(d) {
|
|
49
|
+
const t = i.currentLocationDBName, l = `${S.inventoryBackendUrl}/${t}/purchase-order`;
|
|
50
|
+
return await e.post(l, d);
|
|
51
51
|
},
|
|
52
|
-
async updatePurchaseOrder(
|
|
53
|
-
const t = i.currentLocationDBName,
|
|
54
|
-
return await e.put(
|
|
52
|
+
async updatePurchaseOrder(d) {
|
|
53
|
+
const t = i.currentLocationDBName, l = `${S.inventoryBackendUrl}/${t}/purchase-order`;
|
|
54
|
+
return await e.put(l, d);
|
|
55
55
|
},
|
|
56
|
-
async importFromXilnex(
|
|
57
|
-
const t = i.currentLocationDBName,
|
|
58
|
-
return await e.post(
|
|
56
|
+
async importFromXilnex(d) {
|
|
57
|
+
const t = i.currentLocationDBName, l = `${S.inventoryBackendUrl}/${t}/purchase-order/import-from-xilnex`;
|
|
58
|
+
return await e.post(l, d);
|
|
59
59
|
},
|
|
60
|
-
async processPurchaseOrderV2(
|
|
61
|
-
const
|
|
62
|
-
return await e.put(s,
|
|
60
|
+
async processPurchaseOrderV2(d, t) {
|
|
61
|
+
const l = i.currentLocationDBName, a = t || l, s = `${S.inventoryBackendUrl}/${a}/v2/purchase-order/run-operation`;
|
|
62
|
+
return await e.put(s, d);
|
|
63
63
|
},
|
|
64
64
|
async getWorkflowConfig() {
|
|
65
|
-
var
|
|
66
|
-
const t = `business_${(
|
|
67
|
-
return await e.get(
|
|
65
|
+
var a;
|
|
66
|
+
const t = `business_${(a = _.currentBusiness.value) == null ? void 0 : a._id}`, l = `${S.inventoryBackendUrl}/${t}/v2/purchase-order/workflow-config`;
|
|
67
|
+
return await e.get(l);
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
}), ot = {
|
|
@@ -137,46 +137,46 @@ const $e = lt((S, e) => {
|
|
|
137
137
|
};
|
|
138
138
|
function it() {
|
|
139
139
|
const S = de(), e = $e(), i = De();
|
|
140
|
-
async function
|
|
141
|
-
const
|
|
142
|
-
return t.doc.supplier.internal && t.operation === O.enum.confirmDraft && (t.operation = O.enum.submitRequest), await e.processPurchaseOrder(t,
|
|
140
|
+
async function _(t, l) {
|
|
141
|
+
const a = S.currentLocationDBName;
|
|
142
|
+
return t.doc.supplier.internal && t.operation === O.enum.confirmDraft && (t.operation = O.enum.submitRequest), await e.processPurchaseOrder(t, l || a);
|
|
143
143
|
}
|
|
144
|
-
async function
|
|
145
|
-
const
|
|
146
|
-
return await e.processPurchaseOrderV2(t,
|
|
144
|
+
async function d(t, l) {
|
|
145
|
+
const a = S.currentLocationDBName;
|
|
146
|
+
return await e.processPurchaseOrderV2(t, l || a);
|
|
147
147
|
}
|
|
148
|
-
return (t) => i.useOperatePurchaseOrderV2 ?
|
|
148
|
+
return (t) => i.useOperatePurchaseOrderV2 ? d(t.operateV2, t.transferTo) : _(t.operate, t.transferTo);
|
|
149
149
|
}
|
|
150
150
|
var Ue = /* @__PURE__ */ ((S) => (S.RECEIVE_REQUEST = "receive/request", S.APPROVAL = "approval", S))(Ue || {});
|
|
151
|
-
const we =
|
|
151
|
+
const we = M(), Be = M();
|
|
152
152
|
function Bs(S, e) {
|
|
153
|
-
const i = Me(),
|
|
153
|
+
const i = Me(), _ = de(), d = De();
|
|
154
154
|
qe();
|
|
155
|
-
const t = wt(),
|
|
155
|
+
const t = wt(), l = Rt(), a = M(!1), s = Te(), y = $e(), g = M(new Array()), f = M(
|
|
156
156
|
e != null && e.startDate && (e != null && e.endDate) ? e : ct()
|
|
157
|
-
),
|
|
158
|
-
const
|
|
157
|
+
), c = Z(() => {
|
|
158
|
+
const x = new Date(f.value.startDate), r = new Date(f.value.endDate);
|
|
159
159
|
return {
|
|
160
|
-
start: ut(
|
|
160
|
+
start: ut(x).toISOString(),
|
|
161
161
|
end: dt(r).toISOString()
|
|
162
162
|
};
|
|
163
|
-
}),
|
|
164
|
-
async function x
|
|
163
|
+
}), u = M(new Array()), o = mt(), v = M(null);
|
|
164
|
+
async function D(x) {
|
|
165
165
|
function r(R) {
|
|
166
166
|
const w = {
|
|
167
167
|
mode: Ye.CREATE,
|
|
168
|
-
modelValue:
|
|
168
|
+
modelValue: x || void 0,
|
|
169
169
|
show: !0,
|
|
170
|
-
"onUpdate:show"(
|
|
171
|
-
we.value.show =
|
|
170
|
+
"onUpdate:show"(T) {
|
|
171
|
+
we.value.show = T;
|
|
172
172
|
},
|
|
173
173
|
templateId: R,
|
|
174
|
-
lastClosingDate:
|
|
174
|
+
lastClosingDate: v.value
|
|
175
175
|
};
|
|
176
176
|
we.value = w;
|
|
177
177
|
}
|
|
178
|
-
let
|
|
179
|
-
|
|
178
|
+
let m;
|
|
179
|
+
d.mustUsePoTemplate && !(x != null && x.template) ? i.open({
|
|
180
180
|
title: "Create transfer",
|
|
181
181
|
message: "",
|
|
182
182
|
primaryActions: {
|
|
@@ -189,34 +189,34 @@ function Bs(S, e) {
|
|
|
189
189
|
close: !0
|
|
190
190
|
}
|
|
191
191
|
}).onPrimary(async () => {
|
|
192
|
-
|
|
192
|
+
m = await t.getTemplateId(), m && r(m);
|
|
193
193
|
}).onSecondary(() => {
|
|
194
194
|
r(void 0);
|
|
195
|
-
}) : r(
|
|
195
|
+
}) : r(m);
|
|
196
196
|
}
|
|
197
|
-
function q(
|
|
197
|
+
function q(x) {
|
|
198
198
|
const r = {
|
|
199
199
|
mode: Ye.UPDATE,
|
|
200
|
-
modelValue: et(
|
|
200
|
+
modelValue: et(x),
|
|
201
201
|
show: !0,
|
|
202
|
-
"onUpdate:show"(
|
|
203
|
-
we.value.show =
|
|
202
|
+
"onUpdate:show"(m) {
|
|
203
|
+
we.value.show = m;
|
|
204
204
|
},
|
|
205
|
-
lastClosingDate:
|
|
205
|
+
lastClosingDate: v.value
|
|
206
206
|
};
|
|
207
207
|
we.value = r;
|
|
208
208
|
}
|
|
209
|
-
async function
|
|
210
|
-
|
|
209
|
+
async function Y() {
|
|
210
|
+
g.value = [], a.value = !0;
|
|
211
211
|
try {
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
r && (
|
|
215
|
-
const
|
|
212
|
+
g.value = await y.getPurchaseOrders(c.value).then((R) => R.sort((w, T) => T._id.localeCompare(w._id)));
|
|
213
|
+
const x = await o.readCurrentLocationLastClosing(!0), r = x == null ? void 0 : x._id;
|
|
214
|
+
r && (v.value = ft(r)), await d.awaitFeatureLoaded(() => d.mustUsePoTemplate) && await l.fetchTemplates();
|
|
215
|
+
const m = g.value.map((R) => {
|
|
216
216
|
var w;
|
|
217
217
|
return ((w = R.request) == null ? void 0 : w.id) ?? "";
|
|
218
218
|
}).filter((R) => R);
|
|
219
|
-
|
|
219
|
+
u.value = await y.readRequestByIds(m);
|
|
220
220
|
} catch {
|
|
221
221
|
s.open({
|
|
222
222
|
title: "Something went wrong",
|
|
@@ -224,17 +224,17 @@ function Bs(S, e) {
|
|
|
224
224
|
type: "error"
|
|
225
225
|
});
|
|
226
226
|
} finally {
|
|
227
|
-
|
|
227
|
+
a.value = !1;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
async function
|
|
231
|
-
|
|
230
|
+
async function C() {
|
|
231
|
+
u.value = [], a.value = !0;
|
|
232
232
|
try {
|
|
233
|
-
|
|
233
|
+
u.value = await y.readRequests(
|
|
234
234
|
void 0,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
).then((
|
|
235
|
+
c.value.start,
|
|
236
|
+
c.value.end
|
|
237
|
+
).then((x) => x.reverse());
|
|
238
238
|
} catch {
|
|
239
239
|
s.open({
|
|
240
240
|
title: "Something went wrong",
|
|
@@ -242,96 +242,96 @@ function Bs(S, e) {
|
|
|
242
242
|
type: "error"
|
|
243
243
|
});
|
|
244
244
|
} finally {
|
|
245
|
-
|
|
245
|
+
a.value = !1;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
function F() {
|
|
249
249
|
switch (S) {
|
|
250
250
|
case "receive/request":
|
|
251
|
-
return
|
|
251
|
+
return Y();
|
|
252
252
|
case "approval":
|
|
253
|
-
return
|
|
253
|
+
return C();
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
|
|
258
|
-
startDate:
|
|
256
|
+
function j(x, r) {
|
|
257
|
+
f.value = {
|
|
258
|
+
startDate: x,
|
|
259
259
|
endDate: r
|
|
260
260
|
}, F();
|
|
261
261
|
}
|
|
262
|
-
|
|
263
|
-
if (!
|
|
264
|
-
|
|
262
|
+
_.watchLocation(async (x) => {
|
|
263
|
+
if (!x) {
|
|
264
|
+
g.value = [];
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
267
|
await F();
|
|
268
268
|
});
|
|
269
|
-
const
|
|
270
|
-
async function oe(
|
|
271
|
-
const
|
|
272
|
-
le.value =
|
|
273
|
-
(
|
|
269
|
+
const H = M(), le = M(Math.random().toString());
|
|
270
|
+
async function oe(x, r) {
|
|
271
|
+
const m = Math.random().toString();
|
|
272
|
+
le.value = m, r ?? (r = u.value.computeFirst(
|
|
273
|
+
(T) => T.purchaseOrderId === x._id ? T : null
|
|
274
274
|
) ?? void 0);
|
|
275
|
-
const R = S === "receive/request" ?
|
|
275
|
+
const R = S === "receive/request" ? _.currentLocation : r == null ? void 0 : r.to, w = {
|
|
276
276
|
poRequest: r,
|
|
277
|
-
purchaseOrder:
|
|
277
|
+
purchaseOrder: x,
|
|
278
278
|
transferTo: R == null ? void 0 : R.name,
|
|
279
279
|
transferToDbName: R == null ? void 0 : R.dbName,
|
|
280
280
|
show: !0,
|
|
281
281
|
canResubmit: !1,
|
|
282
282
|
canApprove: S === "approval",
|
|
283
|
-
"onUpdate:show"(
|
|
284
|
-
|
|
283
|
+
"onUpdate:show"(T) {
|
|
284
|
+
H.value.show = T;
|
|
285
285
|
},
|
|
286
286
|
scope: S
|
|
287
287
|
};
|
|
288
|
-
|
|
288
|
+
H.value = w;
|
|
289
289
|
}
|
|
290
|
-
async function ye(
|
|
290
|
+
async function ye(x, r, m, R) {
|
|
291
291
|
const w = it();
|
|
292
|
-
|
|
292
|
+
a.value = !0;
|
|
293
293
|
try {
|
|
294
294
|
await w({
|
|
295
295
|
operate: {
|
|
296
296
|
operation: r,
|
|
297
|
-
doc:
|
|
297
|
+
doc: x,
|
|
298
298
|
options: (
|
|
299
299
|
// auto receive for supplier to warehouse
|
|
300
300
|
(r === O.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
301
|
-
r === O.enum.completeReceive) &&
|
|
301
|
+
r === O.enum.completeReceive) && d.autoReceiveWarehouse ? {
|
|
302
302
|
autoReceive: !0
|
|
303
303
|
} : void 0
|
|
304
304
|
)
|
|
305
305
|
},
|
|
306
306
|
operateV2: {
|
|
307
|
-
_id:
|
|
308
|
-
_rev:
|
|
307
|
+
_id: x._id,
|
|
308
|
+
_rev: x._rev ?? "",
|
|
309
309
|
action: r,
|
|
310
310
|
payloads: []
|
|
311
311
|
},
|
|
312
312
|
transferTo: R
|
|
313
|
-
}), await new Promise((
|
|
313
|
+
}), await new Promise((Q) => setTimeout(Q, 1e3));
|
|
314
314
|
const G = de().currentLocationDBName.startsWith("restaurant_");
|
|
315
|
-
r === O.enum.confirmDraft &&
|
|
315
|
+
r === O.enum.confirmDraft && x.effectiveAt && G ? s.open({
|
|
316
316
|
title: "Success",
|
|
317
|
-
message: `${
|
|
317
|
+
message: `${m}. The backdate will be reflected once your POS has received this change.`,
|
|
318
318
|
type: "success"
|
|
319
319
|
}) : s.open({
|
|
320
320
|
title: "Success",
|
|
321
|
-
message:
|
|
321
|
+
message: m,
|
|
322
322
|
type: "success"
|
|
323
323
|
});
|
|
324
|
-
} catch (
|
|
324
|
+
} catch (T) {
|
|
325
325
|
s.open({
|
|
326
326
|
title: "Something went wrong",
|
|
327
327
|
message: "Please try again.",
|
|
328
328
|
type: "error"
|
|
329
|
-
}), console.error("Error when submitting PO operation", r,
|
|
329
|
+
}), console.error("Error when submitting PO operation", r, x, T);
|
|
330
330
|
} finally {
|
|
331
|
-
|
|
331
|
+
a.value = !1, F();
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
|
-
async function Ce(
|
|
334
|
+
async function Ce(x, r, m) {
|
|
335
335
|
const R = ot[r];
|
|
336
336
|
if (!R) {
|
|
337
337
|
s.open({
|
|
@@ -341,13 +341,13 @@ function Bs(S, e) {
|
|
|
341
341
|
});
|
|
342
342
|
return;
|
|
343
343
|
}
|
|
344
|
-
const { successMessage: w,
|
|
344
|
+
const { successMessage: w, ...T } = R;
|
|
345
345
|
i.open({
|
|
346
|
-
title:
|
|
347
|
-
message:
|
|
348
|
-
primaryActions:
|
|
346
|
+
title: T.title,
|
|
347
|
+
message: T.message,
|
|
348
|
+
primaryActions: T.primaryActions
|
|
349
349
|
}).onPrimary(() => {
|
|
350
|
-
ye(
|
|
350
|
+
ye(x, r, w, m);
|
|
351
351
|
});
|
|
352
352
|
}
|
|
353
353
|
async function ce() {
|
|
@@ -362,25 +362,25 @@ function Bs(S, e) {
|
|
|
362
362
|
close: !0
|
|
363
363
|
}
|
|
364
364
|
}).onPrimary(() => {
|
|
365
|
-
const
|
|
365
|
+
const x = {
|
|
366
366
|
show: !0,
|
|
367
367
|
"onUpdate:show"(r) {
|
|
368
368
|
Be.value.show = r;
|
|
369
369
|
}
|
|
370
370
|
};
|
|
371
|
-
Be.value =
|
|
371
|
+
Be.value = x;
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
374
|
return {
|
|
375
|
-
purchaseOrders:
|
|
376
|
-
purchaseRequests:
|
|
377
|
-
updateDateRange:
|
|
375
|
+
purchaseOrders: g,
|
|
376
|
+
purchaseRequests: u,
|
|
377
|
+
updateDateRange: j,
|
|
378
378
|
fetchData: F,
|
|
379
|
-
loading:
|
|
379
|
+
loading: a,
|
|
380
380
|
transferDialogProps: we,
|
|
381
|
-
promptCreateTransferDialog:
|
|
381
|
+
promptCreateTransferDialog: D,
|
|
382
382
|
promptUpdateTransferDialog: q,
|
|
383
|
-
transferDetailsProps:
|
|
383
|
+
transferDetailsProps: H,
|
|
384
384
|
promptShowTransferDetails: oe,
|
|
385
385
|
submitAction: Ce,
|
|
386
386
|
xilnexImportDialogProps: Be,
|
|
@@ -389,24 +389,24 @@ function Bs(S, e) {
|
|
|
389
389
|
}
|
|
390
390
|
function $t(S, e) {
|
|
391
391
|
return e.reduce(
|
|
392
|
-
(
|
|
393
|
-
const t =
|
|
394
|
-
return t && (
|
|
392
|
+
(_, d) => {
|
|
393
|
+
const t = d.received.find((l) => l.sku._id === S._id);
|
|
394
|
+
return t && (_ = Le(_, t.amount)), _;
|
|
395
395
|
},
|
|
396
396
|
St.toPrecision(ke(0), S.unit.precision)
|
|
397
397
|
);
|
|
398
398
|
}
|
|
399
399
|
function Ct(S) {
|
|
400
|
-
const { po: e, currentLocation: i, business:
|
|
401
|
-
name:
|
|
400
|
+
const { po: e, currentLocation: i, business: _, fulfilling: d, por: t } = S, { name: l, address: a, regNo: s } = i.doc.profile, y = {
|
|
401
|
+
name: l,
|
|
402
402
|
registrationNumber: s,
|
|
403
|
-
line1:
|
|
404
|
-
line2:
|
|
405
|
-
postcode:
|
|
406
|
-
city:
|
|
407
|
-
state:
|
|
408
|
-
country:
|
|
409
|
-
},
|
|
403
|
+
line1: a == null ? void 0 : a.line1,
|
|
404
|
+
line2: a == null ? void 0 : a.line2,
|
|
405
|
+
postcode: a == null ? void 0 : a.postcode,
|
|
406
|
+
city: a == null ? void 0 : a.city,
|
|
407
|
+
state: a == null ? void 0 : a.state,
|
|
408
|
+
country: a == null ? void 0 : a.country
|
|
409
|
+
}, g = {
|
|
410
410
|
name: e.supplier.name,
|
|
411
411
|
phoneNumber: e.supplier.phoneNumber,
|
|
412
412
|
registrationNumber: e.supplier.registrationNumber,
|
|
@@ -416,60 +416,60 @@ function Ct(S) {
|
|
|
416
416
|
city: e.supplier.address.city,
|
|
417
417
|
state: e.supplier.address.state,
|
|
418
418
|
country: e.supplier.address.country
|
|
419
|
-
},
|
|
420
|
-
const { sku: F, measurement:
|
|
421
|
-
$t(
|
|
419
|
+
}, f = e.items.map((C) => {
|
|
420
|
+
const { sku: F, measurement: j } = C, H = ie(
|
|
421
|
+
$t(C.sku, e.deliveryOrder || []),
|
|
422
422
|
!1
|
|
423
423
|
);
|
|
424
424
|
return {
|
|
425
425
|
code: F.code,
|
|
426
426
|
description: F.name,
|
|
427
|
-
quantity: ie(
|
|
428
|
-
unit: (
|
|
429
|
-
received:
|
|
430
|
-
cost:
|
|
431
|
-
value:
|
|
427
|
+
quantity: ie(C.quantity, !1),
|
|
428
|
+
unit: (j == null ? void 0 : j.abbrev) || F.unit.abbrev,
|
|
429
|
+
received: H,
|
|
430
|
+
cost: C.totalCost ? `${C.totalCost.currency} ${pt.toFormatString({
|
|
431
|
+
value: C.totalCost
|
|
432
432
|
})}` : void 0
|
|
433
433
|
};
|
|
434
|
-
}),
|
|
435
|
-
createdAt: tt(new Date(
|
|
436
|
-
ref:
|
|
437
|
-
remark:
|
|
438
|
-
items:
|
|
439
|
-
var
|
|
434
|
+
}), c = e.deliveryOrder.map((C) => ({
|
|
435
|
+
createdAt: tt(new Date(C.createdAt)),
|
|
436
|
+
ref: C.deliveryOrderNumber,
|
|
437
|
+
remark: C.remark || "",
|
|
438
|
+
items: C.received.map((F) => {
|
|
439
|
+
var j;
|
|
440
440
|
return {
|
|
441
441
|
code: F.sku.code,
|
|
442
442
|
description: F.sku.name,
|
|
443
443
|
quantity: ie(F.amount),
|
|
444
|
-
unit: ((
|
|
444
|
+
unit: ((j = F.measurement) == null ? void 0 : j.abbrev) || F.sku.unit.abbrev
|
|
445
445
|
};
|
|
446
446
|
})
|
|
447
|
-
})),
|
|
447
|
+
})), u = [
|
|
448
448
|
// Production
|
|
449
449
|
"67ca5d2c80bd0e001c5bf5bc",
|
|
450
450
|
// Dev
|
|
451
451
|
"6880b36a3054c5001db19218"
|
|
452
452
|
];
|
|
453
|
-
let
|
|
454
|
-
if (e.supplier.internal ? (
|
|
455
|
-
const
|
|
456
|
-
i.dbName ===
|
|
453
|
+
let o = "Inventory Receive Note";
|
|
454
|
+
if (e.supplier.internal ? (o = "Inventory Transfer Note", u.includes((_ == null ? void 0 : _._id) || "") && (o = "Stock Request")) : o = "Purchase Order", t) {
|
|
455
|
+
const C = t.from.dbName;
|
|
456
|
+
i.dbName === C || (o = "Inventory Receive Note");
|
|
457
457
|
}
|
|
458
|
-
const
|
|
459
|
-
title:
|
|
460
|
-
businessName:
|
|
461
|
-
logo:
|
|
458
|
+
const D = {
|
|
459
|
+
title: o,
|
|
460
|
+
businessName: _ == null ? void 0 : _.name,
|
|
461
|
+
logo: _ == null ? void 0 : _.thumbnail,
|
|
462
462
|
orderNumber: e.seqNumber.toString(),
|
|
463
463
|
createdAt: xe(e._id),
|
|
464
464
|
ref: e.ref || "",
|
|
465
465
|
remark: e.remark || "",
|
|
466
466
|
buyer: y,
|
|
467
|
-
supplier:
|
|
468
|
-
items:
|
|
467
|
+
supplier: g,
|
|
468
|
+
items: f,
|
|
469
469
|
status: e.status,
|
|
470
|
-
deliveryOrders:
|
|
471
|
-
}, q = new URL(window.location.href),
|
|
472
|
-
q.pathname = q.hostname.includes("portal.feedme") ? `/inventory/${
|
|
470
|
+
deliveryOrders: c
|
|
471
|
+
}, q = new URL(window.location.href), Y = d && (e.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
|
|
472
|
+
q.pathname = q.hostname.includes("portal.feedme") ? `/inventory/${Y}` : `/${Y}`, q.searchParams.append("data", JSON.stringify(D)), window.open(q.href, "_blank", "noreferrer");
|
|
473
473
|
}
|
|
474
474
|
const be = {
|
|
475
475
|
submitRequest: {
|
|
@@ -534,69 +534,69 @@ const be = {
|
|
|
534
534
|
}
|
|
535
535
|
};
|
|
536
536
|
function Es(S, e) {
|
|
537
|
-
const i = de(),
|
|
538
|
-
function
|
|
539
|
-
switch (
|
|
537
|
+
const i = de(), _ = qe(), d = Ae(), { t } = at();
|
|
538
|
+
function l(c) {
|
|
539
|
+
switch (c.status) {
|
|
540
540
|
case "DRAFT":
|
|
541
541
|
return [
|
|
542
|
-
re[
|
|
543
|
-
re[
|
|
544
|
-
|
|
542
|
+
re[J.Update],
|
|
543
|
+
re[J.Details],
|
|
544
|
+
c.supplier.internal === "restaurant" || c.supplier.internal === "warehouse" ? be[O.enum.submitRequest] : be[O.enum.confirmDraft],
|
|
545
545
|
be[O.enum.cancelDraft]
|
|
546
546
|
];
|
|
547
547
|
case "RECEIVING":
|
|
548
548
|
return [
|
|
549
549
|
be[O.enum.completeReceive],
|
|
550
|
-
re[
|
|
551
|
-
re[
|
|
550
|
+
re[J.Details],
|
|
551
|
+
re[J.Print]
|
|
552
552
|
];
|
|
553
553
|
case "REQUESTING":
|
|
554
|
-
return S === "receive/request" ? [re[
|
|
554
|
+
return S === "receive/request" ? [re[J.Details], re[J.Print]] : [
|
|
555
555
|
be[O.enum.approveRequest],
|
|
556
556
|
be[O.enum.rejectRequest],
|
|
557
|
-
re[
|
|
557
|
+
re[J.Details]
|
|
558
558
|
// DefaultRowActions[RowActionEnum.Print]
|
|
559
559
|
];
|
|
560
560
|
case "PROCESSING":
|
|
561
|
-
return [re[
|
|
561
|
+
return [re[J.Details], re[J.Print]];
|
|
562
562
|
case "COMPLETE":
|
|
563
563
|
case "CANCEL":
|
|
564
564
|
default:
|
|
565
|
-
return [re[
|
|
565
|
+
return [re[J.Details], re[J.Print]];
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
function
|
|
569
|
-
return Object.values(O.enum).includes(
|
|
568
|
+
function a(c) {
|
|
569
|
+
return Object.values(O.enum).includes(c);
|
|
570
570
|
}
|
|
571
|
-
async function s(
|
|
572
|
-
var
|
|
573
|
-
const
|
|
574
|
-
if (
|
|
575
|
-
const
|
|
576
|
-
((
|
|
577
|
-
po:
|
|
578
|
-
currentLocation:
|
|
579
|
-
business:
|
|
571
|
+
async function s(c, u, o) {
|
|
572
|
+
var D, q, Y, C, F, j;
|
|
573
|
+
const v = et(u);
|
|
574
|
+
if (c === J.Print) {
|
|
575
|
+
const H = (o == null ? void 0 : o.toInventoryLocation) ?? i.currentLocation;
|
|
576
|
+
((D = o == null ? void 0 : o.netSuite) != null && D.refNo || (q = v.netSuite) != null && q.refNo) && (v.ref = [((Y = o == null ? void 0 : o.netSuite) == null ? void 0 : Y.refNo) || ((C = v.netSuite) == null ? void 0 : C.refNo)].filter((le) => le).join(" ")), Ct({
|
|
577
|
+
po: v,
|
|
578
|
+
currentLocation: H,
|
|
579
|
+
business: d.currentBusiness.value,
|
|
580
580
|
fulfilling: S === "approval",
|
|
581
|
-
por:
|
|
581
|
+
por: o
|
|
582
582
|
});
|
|
583
583
|
return;
|
|
584
584
|
}
|
|
585
|
-
if (
|
|
586
|
-
e.promptShowTransferDetails(
|
|
585
|
+
if (c === J.Details) {
|
|
586
|
+
e.promptShowTransferDetails(v, o);
|
|
587
587
|
return;
|
|
588
588
|
}
|
|
589
|
-
if (
|
|
590
|
-
(F = e.promptUpdateTransferDialog) == null || F.call(e,
|
|
589
|
+
if (c === J.Update) {
|
|
590
|
+
(F = e.promptUpdateTransferDialog) == null || F.call(e, v);
|
|
591
591
|
return;
|
|
592
592
|
}
|
|
593
|
-
if (
|
|
594
|
-
e.submitAction(
|
|
593
|
+
if (a(c)) {
|
|
594
|
+
e.submitAction(u, c, (j = o == null ? void 0 : o.to) == null ? void 0 : j.dbName);
|
|
595
595
|
return;
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
function y() {
|
|
599
|
-
const
|
|
599
|
+
const c = [
|
|
600
600
|
{
|
|
601
601
|
accessorKey: "seqNumber",
|
|
602
602
|
header: () => t("inventory.transfer.table.seqNo"),
|
|
@@ -607,8 +607,8 @@ function Es(S, e) {
|
|
|
607
607
|
{
|
|
608
608
|
accessorKey: "_id",
|
|
609
609
|
header: () => t("inventory.transfer.table.createdAt"),
|
|
610
|
-
cell(
|
|
611
|
-
return xe(`${
|
|
610
|
+
cell(u) {
|
|
611
|
+
return xe(`${u.getValue()}`);
|
|
612
612
|
},
|
|
613
613
|
enableSorting: !0
|
|
614
614
|
},
|
|
@@ -635,8 +635,8 @@ function Es(S, e) {
|
|
|
635
635
|
{
|
|
636
636
|
accessorKey: "status",
|
|
637
637
|
header: () => t("inventory.transfer.table.status"),
|
|
638
|
-
cell(
|
|
639
|
-
const
|
|
638
|
+
cell(u) {
|
|
639
|
+
const o = t(`inventory.transfer.status.${u.getValue() ?? ""}`), v = `${u.getValue() ?? ""}`.toLocaleLowerCase("en-us");
|
|
640
640
|
return A(
|
|
641
641
|
"div",
|
|
642
642
|
{
|
|
@@ -645,9 +645,9 @@ function Es(S, e) {
|
|
|
645
645
|
A(
|
|
646
646
|
"div",
|
|
647
647
|
{
|
|
648
|
-
class: `fm-status-badge fm-status-badge-${
|
|
648
|
+
class: `fm-status-badge fm-status-badge-${v}`
|
|
649
649
|
},
|
|
650
|
-
|
|
650
|
+
o
|
|
651
651
|
)
|
|
652
652
|
);
|
|
653
653
|
},
|
|
@@ -656,9 +656,9 @@ function Es(S, e) {
|
|
|
656
656
|
},
|
|
657
657
|
{
|
|
658
658
|
id: "action",
|
|
659
|
-
cell(
|
|
660
|
-
const
|
|
661
|
-
return Qe(
|
|
659
|
+
cell(u) {
|
|
660
|
+
const o = u.row.original, v = l(o);
|
|
661
|
+
return Qe(v, (D) => s(D, o));
|
|
662
662
|
},
|
|
663
663
|
enableSorting: !1,
|
|
664
664
|
size: 40,
|
|
@@ -668,15 +668,15 @@ function Es(S, e) {
|
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
670
|
];
|
|
671
|
-
if (
|
|
672
|
-
const
|
|
671
|
+
if (_.isEnabled) {
|
|
672
|
+
const u = [
|
|
673
673
|
{
|
|
674
674
|
id: "netsuiteTransferOrder",
|
|
675
675
|
header: () => "NetSuite Order (ID)",
|
|
676
|
-
cell(
|
|
677
|
-
var
|
|
678
|
-
const
|
|
679
|
-
return (
|
|
676
|
+
cell(o) {
|
|
677
|
+
var D;
|
|
678
|
+
const v = o.row.original;
|
|
679
|
+
return (D = v.netSuite) != null && D.id ? `${v.netSuite.refNo} (${v.netSuite.id})` : "N/A";
|
|
680
680
|
},
|
|
681
681
|
enableSorting: !1,
|
|
682
682
|
size: 200,
|
|
@@ -688,9 +688,9 @@ function Es(S, e) {
|
|
|
688
688
|
{
|
|
689
689
|
id: "netsuiteTransactionNumber",
|
|
690
690
|
header: () => "NetSuite Transaction No.",
|
|
691
|
-
cell(
|
|
692
|
-
var
|
|
693
|
-
return ((q = (
|
|
691
|
+
cell(o) {
|
|
692
|
+
var D, q;
|
|
693
|
+
return ((q = (D = o.row.original.netSuite) == null ? void 0 : D.additionalInfo) == null ? void 0 : q.transactionnumber) ?? "N/A";
|
|
694
694
|
},
|
|
695
695
|
enableSorting: !1,
|
|
696
696
|
size: 200,
|
|
@@ -700,12 +700,12 @@ function Es(S, e) {
|
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
702
|
];
|
|
703
|
-
|
|
703
|
+
c.splice(c.length - 2, 0, ...u);
|
|
704
704
|
}
|
|
705
|
-
return
|
|
705
|
+
return c;
|
|
706
706
|
}
|
|
707
|
-
function
|
|
708
|
-
const
|
|
707
|
+
function g() {
|
|
708
|
+
const c = [
|
|
709
709
|
{
|
|
710
710
|
accessorKey: "purchaseOrder.seqNumber",
|
|
711
711
|
header: () => t("inventory.transfer.table.seqNo"),
|
|
@@ -716,8 +716,8 @@ function Es(S, e) {
|
|
|
716
716
|
{
|
|
717
717
|
accessorKey: "purchaseOrder._id",
|
|
718
718
|
header: () => t("inventory.transfer.table.createdAt"),
|
|
719
|
-
cell(
|
|
720
|
-
return xe(`${
|
|
719
|
+
cell(u) {
|
|
720
|
+
return xe(`${u.getValue()}`);
|
|
721
721
|
},
|
|
722
722
|
enableSorting: !0
|
|
723
723
|
},
|
|
@@ -741,8 +741,8 @@ function Es(S, e) {
|
|
|
741
741
|
{
|
|
742
742
|
accessorKey: "purchaseOrder.status",
|
|
743
743
|
header: () => t("inventory.transfer.table.status"),
|
|
744
|
-
cell(
|
|
745
|
-
const
|
|
744
|
+
cell(u) {
|
|
745
|
+
const o = t(`inventory.transfer.status.${u.getValue() ?? ""}`), v = `${u.getValue() ?? ""}`.toLocaleLowerCase("en-us");
|
|
746
746
|
return A(
|
|
747
747
|
"div",
|
|
748
748
|
{
|
|
@@ -751,9 +751,9 @@ function Es(S, e) {
|
|
|
751
751
|
A(
|
|
752
752
|
"div",
|
|
753
753
|
{
|
|
754
|
-
class: `fm-status-badge fm-status-badge-${
|
|
754
|
+
class: `fm-status-badge fm-status-badge-${v}`
|
|
755
755
|
},
|
|
756
|
-
|
|
756
|
+
o
|
|
757
757
|
)
|
|
758
758
|
);
|
|
759
759
|
},
|
|
@@ -761,14 +761,14 @@ function Es(S, e) {
|
|
|
761
761
|
},
|
|
762
762
|
{
|
|
763
763
|
id: "action",
|
|
764
|
-
cell(
|
|
765
|
-
const
|
|
764
|
+
cell(u) {
|
|
765
|
+
const o = u.row.original, D = (o.purchaseOrder ? l(o.purchaseOrder) : []).map((q) => q.value === J.Print ? {
|
|
766
766
|
...q,
|
|
767
767
|
translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
|
|
768
768
|
} : q);
|
|
769
769
|
return Qe(
|
|
770
|
-
|
|
771
|
-
(q) =>
|
|
770
|
+
D,
|
|
771
|
+
(q) => o.purchaseOrder ? s(q, o.purchaseOrder, o) : void 0
|
|
772
772
|
);
|
|
773
773
|
},
|
|
774
774
|
enableSorting: !1,
|
|
@@ -779,15 +779,15 @@ function Es(S, e) {
|
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
781
|
];
|
|
782
|
-
if (
|
|
783
|
-
const
|
|
782
|
+
if (_.isEnabled) {
|
|
783
|
+
const u = [
|
|
784
784
|
{
|
|
785
785
|
id: "netsuiteTransferOrder",
|
|
786
786
|
header: () => "NetSuite Order (ID)",
|
|
787
|
-
cell(
|
|
788
|
-
var
|
|
789
|
-
const
|
|
790
|
-
return (
|
|
787
|
+
cell(o) {
|
|
788
|
+
var D;
|
|
789
|
+
const v = o.row.original;
|
|
790
|
+
return (D = v.netSuite) != null && D.id ? `${v.netSuite.refNo} (${v.netSuite.id})` : "N/A";
|
|
791
791
|
},
|
|
792
792
|
enableSorting: !1,
|
|
793
793
|
size: 200,
|
|
@@ -799,9 +799,9 @@ function Es(S, e) {
|
|
|
799
799
|
{
|
|
800
800
|
id: "netsuiteTransactionNumber",
|
|
801
801
|
header: () => "NetSuite Transaction No.",
|
|
802
|
-
cell(
|
|
803
|
-
var
|
|
804
|
-
return ((q = (
|
|
802
|
+
cell(o) {
|
|
803
|
+
var D, q;
|
|
804
|
+
return ((q = (D = o.row.original.netSuite) == null ? void 0 : D.additionalInfo) == null ? void 0 : q.transactionnumber) ?? "N/A";
|
|
805
805
|
},
|
|
806
806
|
enableSorting: !1,
|
|
807
807
|
size: 200,
|
|
@@ -811,12 +811,12 @@ function Es(S, e) {
|
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
813
|
];
|
|
814
|
-
|
|
814
|
+
c.splice(c.length - 2, 0, ...u);
|
|
815
815
|
}
|
|
816
|
-
return
|
|
816
|
+
return c;
|
|
817
817
|
}
|
|
818
818
|
return {
|
|
819
|
-
columnDefs:
|
|
819
|
+
columnDefs: Z(() => S === "receive/request" ? y() : g())
|
|
820
820
|
};
|
|
821
821
|
}
|
|
822
822
|
const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, It = { class: "flex flex-col gap-8" }, Ft = { class: "flex w-full justify-end gap-16" }, Bt = /* @__PURE__ */ pe({
|
|
@@ -827,43 +827,41 @@ const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
827
827
|
},
|
|
828
828
|
emits: ["update:show"],
|
|
829
829
|
setup(S, { emit: e }) {
|
|
830
|
-
const i = S,
|
|
830
|
+
const i = S, _ = ht({
|
|
831
831
|
id: "",
|
|
832
832
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
833
833
|
items: []
|
|
834
|
-
}),
|
|
835
|
-
nt(() => {
|
|
836
|
-
i.purchaseOrder && (
|
|
837
|
-
id:
|
|
838
|
-
sku:
|
|
839
|
-
measurement:
|
|
840
|
-
amount:
|
|
834
|
+
}), d = M(), t = e;
|
|
835
|
+
return nt(() => {
|
|
836
|
+
i.purchaseOrder && (_.items = i.purchaseOrder.items.map((l) => ({
|
|
837
|
+
id: l.id,
|
|
838
|
+
sku: l.sku,
|
|
839
|
+
measurement: l.measurement,
|
|
840
|
+
amount: l.quantity ?? { amount: 1, precision: 0 }
|
|
841
841
|
})));
|
|
842
|
-
})
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
const y = z("FmTable"), _ = z("FmButton"), p = z("FmForm");
|
|
846
|
-
return h(), ae(p, {
|
|
842
|
+
}), (l, a) => {
|
|
843
|
+
const s = K("FmTable"), y = K("FmButton"), g = K("FmForm");
|
|
844
|
+
return b(), ae(g, {
|
|
847
845
|
ref_key: "formRef",
|
|
848
|
-
ref:
|
|
846
|
+
ref: d,
|
|
849
847
|
class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
|
|
850
848
|
onValidationFailed: console.log,
|
|
851
|
-
onValidationSuccess:
|
|
849
|
+
onValidationSuccess: a[1] || (a[1] = () => i.confirm(_))
|
|
852
850
|
}, {
|
|
853
851
|
default: se(() => [
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
I(
|
|
852
|
+
a[2] || (a[2] = n("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
|
|
853
|
+
n("div", Pt, [
|
|
854
|
+
n("div", It, [
|
|
855
|
+
I(s, {
|
|
858
856
|
"column-defs": [
|
|
859
857
|
{
|
|
860
858
|
header: "Code",
|
|
861
|
-
cell: (
|
|
862
|
-
const
|
|
859
|
+
cell: (f) => {
|
|
860
|
+
const c = i.purchaseOrder.items.find((u) => u.id === f.row.original.id || u.sku._id === f.row.original.sku._id);
|
|
863
861
|
return A(
|
|
864
|
-
|
|
862
|
+
h(Je).FmTooltip,
|
|
865
863
|
{
|
|
866
|
-
content:
|
|
864
|
+
content: c.code,
|
|
867
865
|
placement: "top",
|
|
868
866
|
variant: "plain",
|
|
869
867
|
zIndex: 50
|
|
@@ -873,19 +871,19 @@ const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
873
871
|
{
|
|
874
872
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
875
873
|
},
|
|
876
|
-
|
|
874
|
+
c.code
|
|
877
875
|
)
|
|
878
876
|
);
|
|
879
877
|
}
|
|
880
878
|
},
|
|
881
879
|
{
|
|
882
880
|
header: "Name",
|
|
883
|
-
cell: (
|
|
884
|
-
const
|
|
881
|
+
cell: (f) => {
|
|
882
|
+
const c = i.purchaseOrder.items.find((u) => u.id === f.row.original.id || u.sku._id === f.row.original.sku._id);
|
|
885
883
|
return A(
|
|
886
|
-
|
|
884
|
+
h(Je).FmTooltip,
|
|
887
885
|
{
|
|
888
|
-
content:
|
|
886
|
+
content: c.name,
|
|
889
887
|
placement: "top",
|
|
890
888
|
variant: "plain",
|
|
891
889
|
zIndex: 50
|
|
@@ -895,15 +893,15 @@ const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
895
893
|
{
|
|
896
894
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
897
895
|
},
|
|
898
|
-
|
|
896
|
+
c.name
|
|
899
897
|
)
|
|
900
898
|
);
|
|
901
899
|
}
|
|
902
900
|
},
|
|
903
901
|
{
|
|
904
902
|
header: "Amount",
|
|
905
|
-
cell: (
|
|
906
|
-
const
|
|
903
|
+
cell: (f) => {
|
|
904
|
+
const c = f.row.original, u = i.purchaseOrder.items.find((v) => v.id === c.id || v.sku._id === c.sku._id), o = c.amount ?? {
|
|
907
905
|
amount: 1,
|
|
908
906
|
precision: 0
|
|
909
907
|
};
|
|
@@ -912,47 +910,47 @@ const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
912
910
|
flex: "1 1 0%"
|
|
913
911
|
},
|
|
914
912
|
modelValue: {
|
|
915
|
-
amount:
|
|
916
|
-
measurement:
|
|
913
|
+
amount: o,
|
|
914
|
+
measurement: c.measurement ?? null
|
|
917
915
|
},
|
|
918
|
-
key:
|
|
919
|
-
unit:
|
|
920
|
-
"onUpdate:modelValue": (
|
|
921
|
-
if (!
|
|
922
|
-
const
|
|
923
|
-
|
|
916
|
+
key: c.id ?? c.sku._id,
|
|
917
|
+
unit: c.sku.unit,
|
|
918
|
+
"onUpdate:modelValue": (v) => {
|
|
919
|
+
if (!v) return;
|
|
920
|
+
const D = _.items.find((q) => q.id === c.id || q.sku._id === c.sku._id);
|
|
921
|
+
D && (D.amount = v.amount);
|
|
924
922
|
},
|
|
925
923
|
disableUnit: !0,
|
|
926
924
|
rules: [
|
|
927
|
-
|
|
928
|
-
+
|
|
925
|
+
h(Dt)(
|
|
926
|
+
+h(ie)({ amount: 0, precision: 0 })
|
|
929
927
|
),
|
|
930
|
-
|
|
928
|
+
h(qt)(+h(ie)(u.quantity))
|
|
931
929
|
],
|
|
932
930
|
applyDefaultRules: !0
|
|
933
931
|
});
|
|
934
932
|
}
|
|
935
933
|
}
|
|
936
934
|
],
|
|
937
|
-
"row-data":
|
|
938
|
-
"hide-footer":
|
|
939
|
-
}, null, 8, ["column-defs", "row-data"
|
|
935
|
+
"row-data": _.items,
|
|
936
|
+
"hide-footer": !0
|
|
937
|
+
}, null, 8, ["column-defs", "row-data"])
|
|
940
938
|
])
|
|
941
939
|
]),
|
|
942
|
-
|
|
943
|
-
I(
|
|
940
|
+
n("div", Ft, [
|
|
941
|
+
I(y, {
|
|
944
942
|
class: "px-16",
|
|
945
943
|
label: "Confirm",
|
|
946
944
|
size: "md",
|
|
947
945
|
variant: "primary",
|
|
948
946
|
type: "submit"
|
|
949
947
|
}),
|
|
950
|
-
I(
|
|
948
|
+
I(y, {
|
|
951
949
|
class: "px-16",
|
|
952
950
|
label: "Cancel",
|
|
953
951
|
size: "md",
|
|
954
952
|
variant: "secondary",
|
|
955
|
-
onClick:
|
|
953
|
+
onClick: a[0] || (a[0] = () => t("update:show", !1))
|
|
956
954
|
})
|
|
957
955
|
])
|
|
958
956
|
]),
|
|
@@ -1031,18 +1029,18 @@ function Et() {
|
|
|
1031
1029
|
ableToMarkReceived(e) {
|
|
1032
1030
|
if (!e || e.status !== ue.enum.RECEIVING)
|
|
1033
1031
|
return !1;
|
|
1034
|
-
const
|
|
1035
|
-
return `${e.supplier.internal}_${e.supplier._id}` !==
|
|
1032
|
+
const _ = de().currentLocationDBName;
|
|
1033
|
+
return `${e.supplier.internal}_${e.supplier._id}` !== _;
|
|
1036
1034
|
},
|
|
1037
1035
|
ableToMarkApproved(e) {
|
|
1038
1036
|
return !(!e || (e == null ? void 0 : e.status) !== ue.enum.REQUESTING);
|
|
1039
1037
|
},
|
|
1040
1038
|
ableToCreateFulfillment(e, i) {
|
|
1041
|
-
var t,
|
|
1039
|
+
var t, l;
|
|
1042
1040
|
if (!S.acceptRequireFulfillment || !e || !i || e.status !== ue.enum.PROCESSING || !i.processedAt)
|
|
1043
1041
|
return !1;
|
|
1044
|
-
const
|
|
1045
|
-
return !(
|
|
1042
|
+
const _ = (t = i == null ? void 0 : i.from) == null ? void 0 : t.dbName, d = (l = i == null ? void 0 : i.to) == null ? void 0 : l.dbName;
|
|
1043
|
+
return !(_.startsWith("restaurant_") && d.startsWith("restaurant_"));
|
|
1046
1044
|
}
|
|
1047
1045
|
};
|
|
1048
1046
|
}
|
|
@@ -1055,16 +1053,16 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1055
1053
|
scope: {}
|
|
1056
1054
|
},
|
|
1057
1055
|
setup(S) {
|
|
1058
|
-
const e = S, i = qe(),
|
|
1059
|
-
|
|
1060
|
-
var
|
|
1061
|
-
let
|
|
1062
|
-
i.isEnabled || (
|
|
1056
|
+
const e = S, i = qe(), _ = Te(), d = Me(), t = M(!1);
|
|
1057
|
+
Z(() => {
|
|
1058
|
+
var g, f, c, u;
|
|
1059
|
+
let a = !0;
|
|
1060
|
+
i.isEnabled || (a = !1);
|
|
1063
1061
|
const s = e.purchaseOrder, y = e.poRequest;
|
|
1064
|
-
return s && ((
|
|
1062
|
+
return s && ((g = s == null ? void 0 : s.supplier) != null && g.internal ? (!y && s.status == ue.enum.DRAFT && (a = !1), y && !((f = y == null ? void 0 : y.netSuite) != null && f.id) && (a = !1), e.isTransferBetweenOutlets && (a = !1)) : ((s == null ? void 0 : s.status) !== ue.enum.REQUESTING && s.supplier.internal && (a = !1), !y && !((c = s == null ? void 0 : s.netSuite) != null && c.id) && (a = !1), !y && ((u = s == null ? void 0 : s.netSuite) != null && u.id) && (s == null ? void 0 : s.status) == ue.enum.REQUESTING && (a = !1))), a;
|
|
1065
1063
|
});
|
|
1066
|
-
async function
|
|
1067
|
-
t.value ||
|
|
1064
|
+
async function l() {
|
|
1065
|
+
t.value || d.open({
|
|
1068
1066
|
title: "Sync with NetSuite",
|
|
1069
1067
|
contentComponent: A("div", [
|
|
1070
1068
|
A("p", "Are you sure you want to sync now?"),
|
|
@@ -1082,20 +1080,20 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1082
1080
|
},
|
|
1083
1081
|
secondaryActions: { text: "Not now", close: !0 }
|
|
1084
1082
|
}).onPrimary(async () => {
|
|
1085
|
-
var
|
|
1083
|
+
var a, s, y;
|
|
1086
1084
|
try {
|
|
1087
1085
|
t.value = !0;
|
|
1088
|
-
const
|
|
1086
|
+
const g = ((a = e.purchaseOrder) == null ? void 0 : a._id) || ((s = e.poRequest) == null ? void 0 : s.purchaseOrderId) || "", f = (y = e.poRequest) == null ? void 0 : y.to.dbName;
|
|
1089
1087
|
await i.syncPurchaseOrder(
|
|
1090
|
-
|
|
1091
|
-
e.scope === "approval" ?
|
|
1092
|
-
),
|
|
1088
|
+
g,
|
|
1089
|
+
e.scope === "approval" ? f : void 0
|
|
1090
|
+
), _.open({
|
|
1093
1091
|
title: "Sync with NetSuite",
|
|
1094
1092
|
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
1095
1093
|
type: "success"
|
|
1096
|
-
}), await new Promise((
|
|
1094
|
+
}), await new Promise((c) => setTimeout(c, 5e3)), t.value = !1;
|
|
1097
1095
|
} catch {
|
|
1098
|
-
|
|
1096
|
+
_.open({
|
|
1099
1097
|
title: "Error",
|
|
1100
1098
|
message: "Failed to sync with NetSuite",
|
|
1101
1099
|
type: "error"
|
|
@@ -1103,15 +1101,15 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1103
1101
|
}
|
|
1104
1102
|
});
|
|
1105
1103
|
}
|
|
1106
|
-
return (
|
|
1107
|
-
const y =
|
|
1108
|
-
return
|
|
1104
|
+
return (a, s) => {
|
|
1105
|
+
const y = K("FmButton");
|
|
1106
|
+
return b(), N("div", Lt, [
|
|
1109
1107
|
I(y, {
|
|
1110
1108
|
"prepend-icon": "sync",
|
|
1111
1109
|
variant: "secondary",
|
|
1112
1110
|
label: "Sync",
|
|
1113
1111
|
loading: t.value,
|
|
1114
|
-
onClick:
|
|
1112
|
+
onClick: l,
|
|
1115
1113
|
"text-color": "primary",
|
|
1116
1114
|
"bg-color": "transparent",
|
|
1117
1115
|
"border-color": "primary"
|
|
@@ -1125,7 +1123,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1125
1123
|
}, Mt = { class: "flex flex-col gap-4" }, jt = { class: "fm-typo-en-body-lg-600" }, Kt = {
|
|
1126
1124
|
key: 0,
|
|
1127
1125
|
class: "flex flex-col gap-4"
|
|
1128
|
-
}, zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ht = { class: "fm-typo-en-body-lg-600" },
|
|
1126
|
+
}, zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ht = { class: "fm-typo-en-body-lg-600" }, Gt = { key: 0 }, Wt = { key: 1 }, Yt = {
|
|
1129
1127
|
key: 1,
|
|
1130
1128
|
class: "flex flex-col gap-4"
|
|
1131
1129
|
}, Qt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xt = { class: "fm-typo-en-body-lg-600" }, Jt = { key: 0 }, Zt = { key: 1 }, er = {
|
|
@@ -1145,59 +1143,59 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1145
1143
|
scope: {}
|
|
1146
1144
|
},
|
|
1147
1145
|
setup(S) {
|
|
1148
|
-
const e = S, i = qe(),
|
|
1146
|
+
const e = S, i = qe(), _ = $e(), d = M(e.poRequest);
|
|
1149
1147
|
nt(async () => {
|
|
1150
1148
|
var s;
|
|
1151
1149
|
if (!e.poRequest && ((s = e.purchaseOrder) != null && s._id)) {
|
|
1152
|
-
const y = await
|
|
1153
|
-
|
|
1150
|
+
const y = await _.getLatestPurchaseOrderRequest(e.purchaseOrder._id);
|
|
1151
|
+
d.value = y;
|
|
1154
1152
|
}
|
|
1155
1153
|
});
|
|
1156
|
-
const t =
|
|
1154
|
+
const t = Z(
|
|
1157
1155
|
() => {
|
|
1158
|
-
var s, y,
|
|
1156
|
+
var s, y, g, f, c, u;
|
|
1159
1157
|
return i.getSubsidiaryFullName(
|
|
1160
|
-
((
|
|
1158
|
+
((g = (y = (s = e.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : y.subsidiary) == null ? void 0 : g.id) || ((u = (c = (f = e.poRequest) == null ? void 0 : f.netSuite) == null ? void 0 : c.subsidiary) == null ? void 0 : u.id)
|
|
1161
1159
|
).fullName;
|
|
1162
1160
|
}
|
|
1163
|
-
),
|
|
1164
|
-
var s, y,
|
|
1165
|
-
return (
|
|
1166
|
-
}),
|
|
1167
|
-
var s, y,
|
|
1168
|
-
return (y = (s = e.purchaseOrder) == null ? void 0 : s.deliveryFullfillment) != null && y.length && ((
|
|
1169
|
-
var
|
|
1170
|
-
return (
|
|
1161
|
+
), l = Z(() => {
|
|
1162
|
+
var s, y, g, f, c, u, o, v, D, q, Y, C;
|
|
1163
|
+
return (g = (y = (s = e.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : y.additionalInfo) != null && g.transactionnumber ? (u = (c = (f = e.purchaseOrder) == null ? void 0 : f.netSuite) == null ? void 0 : c.additionalInfo) == null ? void 0 : u.transactionnumber : (D = (v = (o = d.value) == null ? void 0 : o.netSuite) == null ? void 0 : v.additionalInfo) != null && D.transactionnumber ? (C = (Y = (q = d.value) == null ? void 0 : q.netSuite) == null ? void 0 : Y.additionalInfo) == null ? void 0 : C.transactionnumber : null;
|
|
1164
|
+
}), a = Z(() => {
|
|
1165
|
+
var s, y, g, f, c, u;
|
|
1166
|
+
return (y = (s = e.purchaseOrder) == null ? void 0 : s.deliveryFullfillment) != null && y.length && ((f = (g = e.purchaseOrder) == null ? void 0 : g.deliveryFullfillment) == null ? void 0 : f.length) > 0 ? (u = (c = e.purchaseOrder) == null ? void 0 : c.deliveryFullfillment) == null ? void 0 : u.map((o) => {
|
|
1167
|
+
var v;
|
|
1168
|
+
return (v = o.netSuite) == null ? void 0 : v.refNo;
|
|
1171
1169
|
}).join(", ") : "N/A";
|
|
1172
1170
|
});
|
|
1173
1171
|
return (s, y) => {
|
|
1174
|
-
var
|
|
1175
|
-
return
|
|
1176
|
-
|
|
1177
|
-
y[0] || (y[0] =
|
|
1178
|
-
|
|
1172
|
+
var g, f, c, u, o, v, D, q, Y, C, F, j, H, le, oe, ye;
|
|
1173
|
+
return h(i).isEnabled ? (b(), N("div", Vt, [
|
|
1174
|
+
n("div", Mt, [
|
|
1175
|
+
y[0] || (y[0] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
1176
|
+
n("div", jt, k(t.value || "N/A"), 1)
|
|
1179
1177
|
]),
|
|
1180
|
-
!s.isTransferBetweenOutlets && s.scope ===
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
(
|
|
1178
|
+
!s.isTransferBetweenOutlets && s.scope === h(Ue).RECEIVE_REQUEST ? (b(), N("div", Kt, [
|
|
1179
|
+
n("div", zt, " NetSuite " + k((f = (g = s.purchaseOrder) == null ? void 0 : g.netSuite) != null && f.recordType ? h(rt)((u = (c = s.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : u.recordType) : s.transferType === h(fe).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1180
|
+
n("div", Ht, [
|
|
1181
|
+
(v = (o = s.purchaseOrder) == null ? void 0 : o.netSuite) != null && v.id ? (b(), N("span", Gt, k((q = (D = s.purchaseOrder) == null ? void 0 : D.netSuite) == null ? void 0 : q.refNo) + " (" + k((C = (Y = s.purchaseOrder) == null ? void 0 : Y.netSuite) == null ? void 0 : C.id) + ") ", 1)) : (b(), N("span", Wt, "N/A"))
|
|
1184
1182
|
])
|
|
1185
|
-
])) :
|
|
1186
|
-
!s.isTransferBetweenOutlets &&
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
(
|
|
1183
|
+
])) : V("", !0),
|
|
1184
|
+
!s.isTransferBetweenOutlets && d.value || s.scope === h(Ue).APPROVAL ? (b(), N("div", Yt, [
|
|
1185
|
+
n("div", Qt, " (Request) NetSuite " + k(s.transferType === h(fe).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1186
|
+
n("div", Xt, [
|
|
1187
|
+
(j = (F = d.value) == null ? void 0 : F.netSuite) != null && j.id ? (b(), N("span", Jt, k((le = (H = d.value) == null ? void 0 : H.netSuite) == null ? void 0 : le.refNo) + " (" + k((ye = (oe = d.value) == null ? void 0 : oe.netSuite) == null ? void 0 : ye.id) + ") ", 1)) : (b(), N("span", Zt, "N/A"))
|
|
1190
1188
|
])
|
|
1191
|
-
])) :
|
|
1192
|
-
|
|
1193
|
-
y[1] || (y[1] =
|
|
1194
|
-
|
|
1195
|
-
])) :
|
|
1196
|
-
|
|
1197
|
-
y[2] || (y[2] =
|
|
1198
|
-
|
|
1199
|
-
])) :
|
|
1200
|
-
])) :
|
|
1189
|
+
])) : V("", !0),
|
|
1190
|
+
l.value ? (b(), N("div", er, [
|
|
1191
|
+
y[1] || (y[1] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
|
|
1192
|
+
n("div", tr, k(l.value), 1)
|
|
1193
|
+
])) : V("", !0),
|
|
1194
|
+
h(i).isEnabled && s.transferType === h(fe).TRANSFER && !s.isTransferBetweenOutlets ? (b(), N("div", rr, [
|
|
1195
|
+
y[2] || (y[2] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
1196
|
+
n("div", sr, k(a.value), 1)
|
|
1197
|
+
])) : V("", !0)
|
|
1198
|
+
])) : V("", !0);
|
|
1201
1199
|
};
|
|
1202
1200
|
}
|
|
1203
1201
|
}), ar = { class: "flex flex-row-reverse" }, or = /* @__PURE__ */ pe({
|
|
@@ -1208,29 +1206,36 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1208
1206
|
},
|
|
1209
1207
|
setup(S) {
|
|
1210
1208
|
const e = Te(), i = st();
|
|
1211
|
-
async function
|
|
1212
|
-
|
|
1213
|
-
if (t) {
|
|
1214
|
-
const
|
|
1215
|
-
|
|
1209
|
+
async function _(d, t) {
|
|
1210
|
+
const l = [];
|
|
1211
|
+
if (d && l.push(`body.message:*${d}*`), t) {
|
|
1212
|
+
const g = t.replace(/:/g, "\\:");
|
|
1213
|
+
l.push(`${g}`);
|
|
1214
|
+
}
|
|
1215
|
+
if (l.length === 0) {
|
|
1216
|
+
e.open({
|
|
1217
|
+
message: "Cannot open logs without valid filters.",
|
|
1218
|
+
type: "error"
|
|
1219
|
+
});
|
|
1220
|
+
return;
|
|
1216
1221
|
}
|
|
1217
|
-
const { url:
|
|
1222
|
+
const s = `attributes.pod:netsuite* AND (${l.join(" OR ")})`, { url: y } = await i.getLogs(s);
|
|
1218
1223
|
e.open(
|
|
1219
1224
|
{
|
|
1220
1225
|
message: "Opening NetSuite logs...",
|
|
1221
1226
|
type: "info"
|
|
1222
1227
|
},
|
|
1223
1228
|
800
|
|
1224
|
-
), await new Promise((
|
|
1229
|
+
), await new Promise((g) => setTimeout(g, 800)), window.open(y, "_blank");
|
|
1225
1230
|
}
|
|
1226
|
-
return (
|
|
1227
|
-
const
|
|
1228
|
-
return
|
|
1229
|
-
I(
|
|
1231
|
+
return (d, t) => {
|
|
1232
|
+
const l = K("FmButton");
|
|
1233
|
+
return b(), N("div", ar, [
|
|
1234
|
+
I(l, {
|
|
1230
1235
|
"prepend-icon": "history",
|
|
1231
1236
|
variant: "secondary",
|
|
1232
1237
|
label: "Logs",
|
|
1233
|
-
onClick: t[0] || (t[0] = (
|
|
1238
|
+
onClick: t[0] || (t[0] = (a) => _(d.netsuiteId, d.purchaseOrderId)),
|
|
1234
1239
|
"text-color": "primary",
|
|
1235
1240
|
"bg-color": "transparent",
|
|
1236
1241
|
"border-color": "primary"
|
|
@@ -1248,67 +1253,67 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1248
1253
|
purchaseOrderId: {}
|
|
1249
1254
|
},
|
|
1250
1255
|
setup(S) {
|
|
1251
|
-
const e = S, i = st(),
|
|
1256
|
+
const e = S, i = st(), _ = M(!1), d = de(), t = M(!0), l = M(!1), a = M(null);
|
|
1252
1257
|
async function s() {
|
|
1253
|
-
if (!
|
|
1254
|
-
|
|
1258
|
+
if (!a.value) {
|
|
1259
|
+
_.value = !0;
|
|
1255
1260
|
try {
|
|
1256
1261
|
t.value = !0;
|
|
1257
1262
|
const y = await i.getMoreInfo(
|
|
1258
|
-
|
|
1263
|
+
d.currentLocation.dbName,
|
|
1259
1264
|
e.purchaseOrderId
|
|
1260
1265
|
);
|
|
1261
|
-
|
|
1266
|
+
a.value = y, l.value = !1;
|
|
1262
1267
|
} catch {
|
|
1263
|
-
|
|
1268
|
+
l.value = !0;
|
|
1264
1269
|
} finally {
|
|
1265
1270
|
t.value = !1;
|
|
1266
1271
|
}
|
|
1267
1272
|
}
|
|
1268
1273
|
}
|
|
1269
|
-
return (y,
|
|
1270
|
-
const
|
|
1271
|
-
return
|
|
1272
|
-
I(
|
|
1273
|
-
modelValue:
|
|
1274
|
-
"onUpdate:modelValue":
|
|
1274
|
+
return (y, g) => {
|
|
1275
|
+
const f = K("FmButton"), c = K("FmLabel"), u = K("FmDialog");
|
|
1276
|
+
return b(), N("div", ir, [
|
|
1277
|
+
I(u, {
|
|
1278
|
+
modelValue: _.value,
|
|
1279
|
+
"onUpdate:modelValue": g[2] || (g[2] = (o) => _.value = o),
|
|
1275
1280
|
overlay: !0
|
|
1276
1281
|
}, {
|
|
1277
1282
|
"dialog-button": se(() => [
|
|
1278
|
-
I(
|
|
1283
|
+
I(f, {
|
|
1279
1284
|
"prepend-icon": "info",
|
|
1280
1285
|
variant: "secondary",
|
|
1281
1286
|
label: "Latest Info",
|
|
1282
|
-
onClick:
|
|
1287
|
+
onClick: g[0] || (g[0] = (o) => s()),
|
|
1283
1288
|
"text-color": "primary",
|
|
1284
1289
|
"bg-color": "transparent",
|
|
1285
1290
|
"border-color": "primary"
|
|
1286
1291
|
})
|
|
1287
1292
|
]),
|
|
1288
|
-
"dialog-header": se(() =>
|
|
1289
|
-
|
|
1293
|
+
"dialog-header": se(() => g[3] || (g[3] = [
|
|
1294
|
+
n("div", null, "NetSuite latest info", -1)
|
|
1290
1295
|
])),
|
|
1291
1296
|
"dialog-footer": se(() => [
|
|
1292
|
-
I(
|
|
1297
|
+
I(f, {
|
|
1293
1298
|
class: "ml-auto sm:w-full xs:w-full",
|
|
1294
1299
|
label: "Close",
|
|
1295
1300
|
size: "md",
|
|
1296
1301
|
variant: "primary",
|
|
1297
|
-
onClick:
|
|
1302
|
+
onClick: g[1] || (g[1] = (o) => _.value = !1)
|
|
1298
1303
|
})
|
|
1299
1304
|
]),
|
|
1300
1305
|
default: se(() => [
|
|
1301
|
-
t.value ? (
|
|
1302
|
-
|
|
1303
|
-
key:
|
|
1306
|
+
t.value ? (b(), N("div", lr, "Loading...")) : (b(), N("div", cr, [
|
|
1307
|
+
l.value ? (b(), N("p", fr, "Something went wrong.")) : (b(!0), N(te, { key: 0 }, me(a.value, (o, v) => (b(), N("div", {
|
|
1308
|
+
key: v,
|
|
1304
1309
|
class: "mb-2"
|
|
1305
1310
|
}, [
|
|
1306
|
-
|
|
1307
|
-
I(
|
|
1308
|
-
label:
|
|
1311
|
+
n("div", null, [
|
|
1312
|
+
I(c, {
|
|
1313
|
+
label: h(Ve)(v)
|
|
1309
1314
|
}, null, 8, ["label"]),
|
|
1310
|
-
|
|
1311
|
-
Array.isArray(
|
|
1315
|
+
n("div", ur, [
|
|
1316
|
+
Array.isArray(o) ? (b(), N("span", dr, k(o.length > 0 ? o.join(", ") : "N/A"), 1)) : (b(), N("span", mr, k(o), 1))
|
|
1312
1317
|
])
|
|
1313
1318
|
])
|
|
1314
1319
|
]))), 128))
|
|
@@ -1332,48 +1337,48 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1332
1337
|
scope: {}
|
|
1333
1338
|
},
|
|
1334
1339
|
setup(S) {
|
|
1335
|
-
const e = S, i = Tt(),
|
|
1336
|
-
var s, y,
|
|
1337
|
-
const t = ((s = e.transferToDbName) == null ? void 0 : s.startsWith("restaurant")) && ((
|
|
1338
|
-
return
|
|
1340
|
+
const e = S, i = Tt(), _ = Ae(), d = Z(() => {
|
|
1341
|
+
var s, y, g, f, c, u, o;
|
|
1342
|
+
const t = ((s = e.transferToDbName) == null ? void 0 : s.startsWith("restaurant")) && ((g = (y = e.purchaseOrder) == null ? void 0 : y.supplier) == null ? void 0 : g.internal) === "restaurant", l = e.transferType === fe.PURCHASE, a = e.transferType === fe.TRANSFER;
|
|
1343
|
+
return l || a && !t || ((c = (f = e.purchaseOrder) == null ? void 0 : f.netSuite) == null ? void 0 : c.id) || ((o = (u = e.poRequest) == null ? void 0 : u.netSuite) == null ? void 0 : o.id);
|
|
1339
1344
|
});
|
|
1340
|
-
return (t,
|
|
1341
|
-
var s, y,
|
|
1342
|
-
const
|
|
1343
|
-
return
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
(s =
|
|
1345
|
+
return (t, l) => {
|
|
1346
|
+
var s, y, g, f, c, u, o, v, D, q;
|
|
1347
|
+
const a = K("FmMenuDivider");
|
|
1348
|
+
return h(i).isNetSuiteEnabled && d.value ? (b(), N("div", yr, [
|
|
1349
|
+
n("div", vr, [
|
|
1350
|
+
l[0] || (l[0] = n("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
1351
|
+
n("div", hr, [
|
|
1352
|
+
n("div", br, [
|
|
1353
|
+
(s = h(_).sessionUser.value) != null && s.role.isAdmin && ((g = (y = e.purchaseOrder) == null ? void 0 : y.netSuite) != null && g.id) ? (b(), ae(pr, {
|
|
1349
1354
|
key: 0,
|
|
1350
|
-
"netsuite-id": (
|
|
1351
|
-
"purchase-order-id": (
|
|
1352
|
-
}, null, 8, ["netsuite-id", "purchase-order-id"])) :
|
|
1353
|
-
(
|
|
1355
|
+
"netsuite-id": (c = (f = t.purchaseOrder) == null ? void 0 : f.netSuite) == null ? void 0 : c.id,
|
|
1356
|
+
"purchase-order-id": (u = t.purchaseOrder) == null ? void 0 : u._id
|
|
1357
|
+
}, null, 8, ["netsuite-id", "purchase-order-id"])) : V("", !0),
|
|
1358
|
+
(o = h(_).sessionUser.value) != null && o.role.isAdmin ? (b(), ae(or, {
|
|
1354
1359
|
key: 1,
|
|
1355
|
-
"netsuite-id": (
|
|
1356
|
-
"purchase-order-id": (
|
|
1357
|
-
}, null, 8, ["netsuite-id", "purchase-order-id"])) :
|
|
1360
|
+
"netsuite-id": (D = (v = t.purchaseOrder) == null ? void 0 : v.netSuite) == null ? void 0 : D.id,
|
|
1361
|
+
"purchase-order-id": (q = t.purchaseOrder) == null ? void 0 : q._id
|
|
1362
|
+
}, null, 8, ["netsuite-id", "purchase-order-id"])) : V("", !0),
|
|
1358
1363
|
I(Ut, {
|
|
1359
1364
|
"po-request": t.poRequest,
|
|
1360
1365
|
"purchase-order": t.purchaseOrder,
|
|
1361
|
-
"is-transfer-between-outlets": !
|
|
1366
|
+
"is-transfer-between-outlets": !d.value,
|
|
1362
1367
|
scope: t.scope
|
|
1363
1368
|
}, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets", "scope"])
|
|
1364
1369
|
])
|
|
1365
1370
|
])
|
|
1366
1371
|
]),
|
|
1367
|
-
I(
|
|
1372
|
+
I(a),
|
|
1368
1373
|
I(nr, {
|
|
1369
1374
|
"po-request": t.poRequest,
|
|
1370
1375
|
"purchase-order": t.purchaseOrder,
|
|
1371
1376
|
"transfer-type": t.transferType,
|
|
1372
1377
|
"transfer-to-db-name": t.transferToDbName,
|
|
1373
|
-
"is-transfer-between-outlets": !
|
|
1378
|
+
"is-transfer-between-outlets": !d.value,
|
|
1374
1379
|
scope: t.scope
|
|
1375
1380
|
}, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
|
|
1376
|
-
])) :
|
|
1381
|
+
])) : V("", !0);
|
|
1377
1382
|
};
|
|
1378
1383
|
}
|
|
1379
1384
|
}), _r = { class: "flex flex-col gap-16 w-full h-full" }, Sr = { class: "flex justify-between" }, wr = { class: "fm-typo-en-body-lg-600" }, Rr = { class: "flex flex-col gap-8" }, Or = { class: "flex flex-col gap-4" }, Nr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, kr = { class: "flex gap-1" }, xr = { class: "fm-typo-en-body-lg-600" }, Dr = {
|
|
@@ -1391,7 +1396,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1391
1396
|
}, Vr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mr = { class: "fm-typo-en-body-lg-600" }, jr = {
|
|
1392
1397
|
key: 4,
|
|
1393
1398
|
class: "flex flex-col gap-4"
|
|
1394
|
-
}, Kr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zr = { class: "fm-typo-en-body-lg-600" }, Hr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" },
|
|
1399
|
+
}, Kr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zr = { class: "fm-typo-en-body-lg-600" }, Hr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Gr = { class: "flex flex-col gap-8" }, Wr = { class: "flex gap-8 items-center" }, Yr = { class: "flex-1 fm-typo-en-body-lg-600" }, Qr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-4" }, Xr = { class: "flex w-full gap-4" }, Jr = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, Zr = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, es = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, ts = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, rs = {
|
|
1395
1400
|
key: 0,
|
|
1396
1401
|
class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1397
1402
|
}, ss = { class: "py-8" }, ns = { class: "flex justify-end gap-4 items-center" }, as = { class: "fm-typo-en-body-lg-600" }, os = {
|
|
@@ -1429,31 +1434,31 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1429
1434
|
},
|
|
1430
1435
|
emits: ["update:show", "submitted"],
|
|
1431
1436
|
setup(S, { emit: e }) {
|
|
1432
|
-
const i = S,
|
|
1437
|
+
const i = S, _ = e, d = Me(), t = Te(), l = De(), a = de(), s = Ae(), y = Z(
|
|
1433
1438
|
() => {
|
|
1434
|
-
var r,
|
|
1439
|
+
var r, m;
|
|
1435
1440
|
return {
|
|
1436
1441
|
id: ((r = s.sessionUser.value) == null ? void 0 : r.id) ?? "",
|
|
1437
|
-
name: ((
|
|
1442
|
+
name: ((m = s.sessionUser.value) == null ? void 0 : m.displayName) ?? ""
|
|
1438
1443
|
};
|
|
1439
1444
|
}
|
|
1440
|
-
),
|
|
1445
|
+
), g = Et(), { t: f } = at(), c = Z(
|
|
1441
1446
|
() => {
|
|
1442
|
-
var r,
|
|
1443
|
-
return ((
|
|
1447
|
+
var r, m, R, w;
|
|
1448
|
+
return ((m = (r = i.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : m.internal) === "restaurant" || ((w = (R = i.purchaseOrder) == null ? void 0 : R.supplier) == null ? void 0 : w.internal) === "warehouse" ? fe.TRANSFER : fe.PURCHASE;
|
|
1444
1449
|
}
|
|
1445
|
-
),
|
|
1450
|
+
), u = M(!1), o = M(""), v = M(!0), D = $e(), q = At(D.getWorkflowConfig), Y = it(), C = Z(() => {
|
|
1446
1451
|
if (!i.purchaseOrder)
|
|
1447
1452
|
return [];
|
|
1448
1453
|
const r = q.result.value;
|
|
1449
1454
|
if (r.state === Ze.loading)
|
|
1450
1455
|
return [];
|
|
1451
|
-
const
|
|
1456
|
+
const m = {
|
|
1452
1457
|
user: y.value,
|
|
1453
|
-
executedAt:
|
|
1458
|
+
executedAt: a.locations.computeFirst(
|
|
1454
1459
|
(w) => {
|
|
1455
|
-
var
|
|
1456
|
-
return w.dbName === ((
|
|
1460
|
+
var T;
|
|
1461
|
+
return w.dbName === ((T = a._currentLocation) == null ? void 0 : T.dbName) ? w : null;
|
|
1457
1462
|
}
|
|
1458
1463
|
),
|
|
1459
1464
|
purchaseOrderRequest: i.poRequest,
|
|
@@ -1462,7 +1467,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1462
1467
|
let R = [];
|
|
1463
1468
|
try {
|
|
1464
1469
|
r.state === Ze.error ? (console.error("Error fetching workflow config:", r.error), R = Pe.getAvailableActions({
|
|
1465
|
-
...
|
|
1470
|
+
...m,
|
|
1466
1471
|
orderConfig: Pe.getDefaultConfig()
|
|
1467
1472
|
}).actions.filter(
|
|
1468
1473
|
(w) => (
|
|
@@ -1471,7 +1476,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1471
1476
|
w !== O.enum.receiveStock && w !== O.enum.processRequest && w !== O.enum.closeRequest
|
|
1472
1477
|
)
|
|
1473
1478
|
)) : R = Pe.getAvailableActions({
|
|
1474
|
-
...
|
|
1479
|
+
...m,
|
|
1475
1480
|
orderConfig: r.data
|
|
1476
1481
|
}).actions.filter(
|
|
1477
1482
|
(w) => w !== O.enum.receiveStock && w !== O.enum.processRequest && w !== O.enum.closeRequest
|
|
@@ -1480,94 +1485,94 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1480
1485
|
console.error("Error getting available actions:", w);
|
|
1481
1486
|
}
|
|
1482
1487
|
return i.scope === "approval" && (R = R.filter((w) => w !== O.enum.completeReceive)), R;
|
|
1483
|
-
}), F = kt(i, "show"),
|
|
1488
|
+
}), F = kt(i, "show"), j = Z(() => [
|
|
1484
1489
|
{
|
|
1485
|
-
label:
|
|
1490
|
+
label: f("inventory.transfer.receiveRequest.details.overview"),
|
|
1486
1491
|
value: "overview"
|
|
1487
1492
|
},
|
|
1488
1493
|
{
|
|
1489
|
-
label:
|
|
1494
|
+
label: f("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
1490
1495
|
value: "deliveryHistory"
|
|
1491
1496
|
}
|
|
1492
|
-
]),
|
|
1497
|
+
]), H = M(j.value[0]);
|
|
1493
1498
|
bt(
|
|
1494
1499
|
() => i.show,
|
|
1495
1500
|
(r) => {
|
|
1496
|
-
r && (
|
|
1501
|
+
r && (H.value = j.value[0]);
|
|
1497
1502
|
}
|
|
1498
1503
|
);
|
|
1499
|
-
async function le(r,
|
|
1500
|
-
return new Promise((G,
|
|
1501
|
-
|
|
1504
|
+
async function le(r, m, R, w, T) {
|
|
1505
|
+
return new Promise((G, Q) => {
|
|
1506
|
+
d.open({
|
|
1502
1507
|
closeButton: !1,
|
|
1503
1508
|
title: w.title,
|
|
1504
1509
|
message: w.message,
|
|
1505
1510
|
primaryActions: w.primaryActions,
|
|
1506
1511
|
secondaryActions: { text: "No", close: !1 }
|
|
1507
1512
|
}).onPrimary(async () => {
|
|
1508
|
-
var
|
|
1509
|
-
const
|
|
1510
|
-
R === O.enum.approveRequest ? (
|
|
1513
|
+
var $, B, z, E;
|
|
1514
|
+
const p = [];
|
|
1515
|
+
R === O.enum.approveRequest ? (p.push({
|
|
1511
1516
|
action: "approveRequest",
|
|
1512
1517
|
payload: null
|
|
1513
|
-
}),
|
|
1518
|
+
}), m.fulfillment && p.push({
|
|
1514
1519
|
action: "processRequest",
|
|
1515
1520
|
payload: {
|
|
1516
1521
|
fulfillmentId: "",
|
|
1517
1522
|
deliveryOrderNumber: "",
|
|
1518
1523
|
deliveryRemark: null,
|
|
1519
|
-
items:
|
|
1524
|
+
items: m.fulfillment.items,
|
|
1520
1525
|
createdBy: y.value
|
|
1521
1526
|
}
|
|
1522
|
-
})) : R === O.enum.processRequest ?
|
|
1527
|
+
})) : R === O.enum.processRequest ? m.fulfillment && p.push({
|
|
1523
1528
|
action: "processRequest",
|
|
1524
1529
|
payload: {
|
|
1525
1530
|
fulfillmentId: "",
|
|
1526
1531
|
deliveryOrderNumber: "",
|
|
1527
1532
|
deliveryRemark: null,
|
|
1528
|
-
items:
|
|
1533
|
+
items: m.fulfillment.items,
|
|
1529
1534
|
createdBy: y.value
|
|
1530
1535
|
}
|
|
1531
|
-
}) : R === O.enum.rejectRequest ?
|
|
1536
|
+
}) : R === O.enum.rejectRequest ? p.push({
|
|
1532
1537
|
action: "rejectRequest",
|
|
1533
1538
|
payload: null
|
|
1534
|
-
}) : R === O.enum.closeRequest &&
|
|
1539
|
+
}) : R === O.enum.closeRequest && p.push({
|
|
1535
1540
|
action: "closeRequest",
|
|
1536
1541
|
payload: null
|
|
1537
1542
|
});
|
|
1538
1543
|
try {
|
|
1539
|
-
await
|
|
1544
|
+
await Y({
|
|
1540
1545
|
operate: {
|
|
1541
1546
|
operation: R,
|
|
1542
1547
|
doc: r,
|
|
1543
|
-
options:
|
|
1548
|
+
options: m
|
|
1544
1549
|
},
|
|
1545
1550
|
operateV2: {
|
|
1546
|
-
_id: ((
|
|
1551
|
+
_id: (($ = i.purchaseOrder) == null ? void 0 : $._id) ?? "",
|
|
1547
1552
|
_rev: ((B = i.purchaseOrder) == null ? void 0 : B._rev) ?? "",
|
|
1548
1553
|
action: R,
|
|
1549
|
-
payloads:
|
|
1554
|
+
payloads: p
|
|
1550
1555
|
// add payload if action is receiveStock or processRequest
|
|
1551
1556
|
},
|
|
1552
|
-
transferTo: (E = (
|
|
1557
|
+
transferTo: (E = (z = i.poRequest) == null ? void 0 : z.to) == null ? void 0 : E.dbName
|
|
1553
1558
|
}).delayed(1e3), G("submitted");
|
|
1554
|
-
} catch (
|
|
1555
|
-
X
|
|
1559
|
+
} catch (X) {
|
|
1560
|
+
Q(X);
|
|
1556
1561
|
}
|
|
1557
1562
|
}).onSecondary(() => {
|
|
1558
1563
|
G("cancelled");
|
|
1559
|
-
for (let
|
|
1560
|
-
|
|
1564
|
+
for (let p = 0; p < T + 2; p++)
|
|
1565
|
+
d.close();
|
|
1561
1566
|
}).onClose(() => {
|
|
1562
1567
|
});
|
|
1563
1568
|
});
|
|
1564
1569
|
}
|
|
1565
1570
|
async function oe(r) {
|
|
1566
|
-
var w,
|
|
1571
|
+
var w, T, G, Q;
|
|
1567
1572
|
if (r === O.enum.receiveStock)
|
|
1568
1573
|
return;
|
|
1569
|
-
const
|
|
1570
|
-
if (!
|
|
1574
|
+
const m = ot[r];
|
|
1575
|
+
if (!m) {
|
|
1571
1576
|
t.open({
|
|
1572
1577
|
title: "Something went wrong",
|
|
1573
1578
|
message: `Cannot process order: ${Ve(r)}`,
|
|
@@ -1575,46 +1580,46 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1575
1580
|
});
|
|
1576
1581
|
return;
|
|
1577
1582
|
}
|
|
1578
|
-
const { successMessage: R } =
|
|
1583
|
+
const { successMessage: R } = m;
|
|
1579
1584
|
if (i.purchaseOrder) {
|
|
1580
|
-
|
|
1581
|
-
const
|
|
1582
|
-
let
|
|
1585
|
+
o.value = `${r}`, u.value = !0, v.value = !1;
|
|
1586
|
+
const p = {};
|
|
1587
|
+
let $ = 0;
|
|
1583
1588
|
if ((r === O.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
1584
|
-
r === O.enum.completeReceive) &&
|
|
1585
|
-
|
|
1586
|
-
else if ((r === O.enum.approveRequest || r === O.enum.processRequest) &&
|
|
1587
|
-
const B = (
|
|
1588
|
-
if (B &&
|
|
1589
|
-
const E = await new Promise((
|
|
1590
|
-
|
|
1589
|
+
r === O.enum.completeReceive) && l.autoReceiveWarehouse)
|
|
1590
|
+
p.autoReceive = !0;
|
|
1591
|
+
else if ((r === O.enum.approveRequest || r === O.enum.processRequest) && l.acceptRequireFulfillment) {
|
|
1592
|
+
const B = (T = (w = i.poRequest) == null ? void 0 : w.from) == null ? void 0 : T.dbName, z = (Q = (G = i.poRequest) == null ? void 0 : G.to) == null ? void 0 : Q.dbName;
|
|
1593
|
+
if (B && z && (B.startsWith("warehouse_") || z.startsWith("warehouse_"))) {
|
|
1594
|
+
const E = await new Promise((X, L) => {
|
|
1595
|
+
d.open({
|
|
1591
1596
|
closeButton: !1,
|
|
1592
1597
|
title: "Confirm transfer amount",
|
|
1593
1598
|
dialogComponent: Bt,
|
|
1594
1599
|
dialogComponentProps: {
|
|
1595
1600
|
purchaseOrder: i.purchaseOrder,
|
|
1596
|
-
confirm:
|
|
1601
|
+
confirm: X,
|
|
1597
1602
|
"onUpdate:show": (ne) => {
|
|
1598
|
-
ne || (
|
|
1603
|
+
ne || (o.value = "", u.value = !1, v.value = !0, $++, d.close()), L("cancelled");
|
|
1599
1604
|
}
|
|
1600
1605
|
}
|
|
1601
1606
|
});
|
|
1602
1607
|
});
|
|
1603
|
-
|
|
1608
|
+
p.fulfillment = E;
|
|
1604
1609
|
}
|
|
1605
1610
|
}
|
|
1606
1611
|
try {
|
|
1607
1612
|
await le(
|
|
1608
1613
|
i.purchaseOrder,
|
|
1609
|
-
|
|
1614
|
+
p,
|
|
1610
1615
|
r,
|
|
1611
|
-
|
|
1612
|
-
|
|
1616
|
+
m,
|
|
1617
|
+
$
|
|
1613
1618
|
) === "submitted" && (t.open({
|
|
1614
1619
|
title: "Success",
|
|
1615
1620
|
message: R,
|
|
1616
1621
|
type: "success"
|
|
1617
|
-
}),
|
|
1622
|
+
}), _("update:show", !1), _("submitted"));
|
|
1618
1623
|
} catch (B) {
|
|
1619
1624
|
t.open({
|
|
1620
1625
|
title: "Something went wrong",
|
|
@@ -1622,86 +1627,86 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1622
1627
|
type: "error"
|
|
1623
1628
|
}), console.error("Error when submitting PO operation", r, i.purchaseOrder, B);
|
|
1624
1629
|
} finally {
|
|
1625
|
-
|
|
1630
|
+
o.value = "", u.value = !1, v.value = !0;
|
|
1626
1631
|
}
|
|
1627
1632
|
}
|
|
1628
1633
|
}
|
|
1629
|
-
const ye =
|
|
1630
|
-
var r,
|
|
1631
|
-
return ((r = i.purchaseOrder) == null ? void 0 : r.status) === ue.enum.RECEIVING || ((
|
|
1632
|
-
}), Ce =
|
|
1633
|
-
var G,
|
|
1634
|
-
const R = (((G = i.purchaseOrder) == null ? void 0 : G.deliveryOrder) ?? []).flatMap((
|
|
1635
|
-
(
|
|
1636
|
-
const
|
|
1637
|
-
return
|
|
1634
|
+
const ye = Z(() => {
|
|
1635
|
+
var r, m;
|
|
1636
|
+
return ((r = i.purchaseOrder) == null ? void 0 : r.status) === ue.enum.RECEIVING || ((m = i.purchaseOrder) == null ? void 0 : m.status) === ue.enum.COMPLETE;
|
|
1637
|
+
}), Ce = Z(() => {
|
|
1638
|
+
var G, Q, p;
|
|
1639
|
+
const R = (((G = i.purchaseOrder) == null ? void 0 : G.deliveryOrder) ?? []).flatMap(($) => $.received ?? []).reduce(
|
|
1640
|
+
($, B) => {
|
|
1641
|
+
const z = $[B.sku._id] ?? [];
|
|
1642
|
+
return $[B.sku._id] = [...z, B], $;
|
|
1638
1643
|
},
|
|
1639
1644
|
{}
|
|
1640
1645
|
), w = Object.entries(R).reduce(
|
|
1641
|
-
(
|
|
1642
|
-
const E =
|
|
1646
|
+
($, [B, z]) => {
|
|
1647
|
+
const E = z.reduce((X, L) => {
|
|
1643
1648
|
const ne = yt(
|
|
1644
|
-
|
|
1645
|
-
Math.max(
|
|
1649
|
+
X,
|
|
1650
|
+
Math.max(X.precision, L.amount.precision)
|
|
1646
1651
|
);
|
|
1647
1652
|
return Le(ne, L.amount);
|
|
1648
1653
|
}, ke(0));
|
|
1649
|
-
return
|
|
1654
|
+
return $[B] = E, $;
|
|
1650
1655
|
},
|
|
1651
1656
|
{}
|
|
1652
|
-
),
|
|
1653
|
-
for (const
|
|
1654
|
-
w[
|
|
1657
|
+
), T = ((Q = i.purchaseOrder) == null ? void 0 : Q.items) ?? [];
|
|
1658
|
+
for (const $ of T)
|
|
1659
|
+
w[p = $.sku._id] ?? (w[p] = ke(0));
|
|
1655
1660
|
return w;
|
|
1656
|
-
}), ce =
|
|
1657
|
-
var G,
|
|
1658
|
-
const r = ((G = i.purchaseOrder) == null ? void 0 : G.deliveryOrder) ?? [],
|
|
1659
|
-
...r.map((
|
|
1660
|
-
createdAt:
|
|
1661
|
+
}), ce = Z(() => {
|
|
1662
|
+
var G, Q;
|
|
1663
|
+
const r = ((G = i.purchaseOrder) == null ? void 0 : G.deliveryOrder) ?? [], m = ((Q = i.purchaseOrder) == null ? void 0 : Q.deliveryFullfillment) ?? [], R = [
|
|
1664
|
+
...r.map((p) => ({
|
|
1665
|
+
createdAt: p.createdAt,
|
|
1661
1666
|
type: "grn",
|
|
1662
|
-
doc:
|
|
1667
|
+
doc: p
|
|
1663
1668
|
})),
|
|
1664
|
-
...
|
|
1665
|
-
createdAt:
|
|
1669
|
+
...m.map((p) => ({
|
|
1670
|
+
createdAt: p.createdAt,
|
|
1666
1671
|
type: "fulfillment",
|
|
1667
|
-
doc:
|
|
1672
|
+
doc: p
|
|
1668
1673
|
}))
|
|
1669
1674
|
];
|
|
1670
|
-
R.reverse().sort((
|
|
1671
|
-
function w(
|
|
1672
|
-
var
|
|
1673
|
-
const
|
|
1674
|
-
(E = (
|
|
1675
|
+
R.reverse().sort((p, $) => p.createdAt.localeCompare($.createdAt));
|
|
1676
|
+
function w(p) {
|
|
1677
|
+
var z, E, X, L, ne, ge, _e, Se, U;
|
|
1678
|
+
const $ = m.findIndex((P) => P.id === p.fullfillmentId), B = [
|
|
1679
|
+
(E = (z = m[$]) == null ? void 0 : z.netSuite) != null && E.refNo ? {
|
|
1675
1680
|
label: "Fulfillment's ref no. (Netsuite)",
|
|
1676
|
-
values: [(L = (
|
|
1681
|
+
values: [(L = (X = m[$]) == null ? void 0 : X.netSuite) == null ? void 0 : L.refNo]
|
|
1677
1682
|
} : null,
|
|
1678
|
-
(ne =
|
|
1683
|
+
(ne = p == null ? void 0 : p.netSuite) != null && ne.refNo ? {
|
|
1679
1684
|
label: "Netsuite ref no.",
|
|
1680
|
-
values: [(ge =
|
|
1685
|
+
values: [(ge = p == null ? void 0 : p.netSuite) == null ? void 0 : ge.refNo]
|
|
1681
1686
|
} : null,
|
|
1682
|
-
(_e =
|
|
1687
|
+
(_e = p == null ? void 0 : p.netSuite) != null && _e.recordType ? {
|
|
1683
1688
|
label: "Netsuite Type",
|
|
1684
|
-
values: [rt((Se =
|
|
1689
|
+
values: [rt((Se = p == null ? void 0 : p.netSuite) == null ? void 0 : Se.recordType)]
|
|
1685
1690
|
} : null
|
|
1686
1691
|
];
|
|
1687
1692
|
return {
|
|
1688
1693
|
header: "Received",
|
|
1689
|
-
date: Ie(new Date(
|
|
1694
|
+
date: Ie(new Date(p.createdAt)),
|
|
1690
1695
|
info: [
|
|
1691
1696
|
{
|
|
1692
1697
|
label: "Adjustment date",
|
|
1693
1698
|
values: [
|
|
1694
|
-
|
|
1699
|
+
p.adjustment ? Ie(new Date(vt(p.adjustment))) : "-"
|
|
1695
1700
|
]
|
|
1696
1701
|
},
|
|
1697
1702
|
{
|
|
1698
1703
|
label: "Received by",
|
|
1699
|
-
values: [(U =
|
|
1704
|
+
values: [(U = p.createdBy) == null ? void 0 : U.name]
|
|
1700
1705
|
},
|
|
1701
1706
|
{
|
|
1702
1707
|
label: "Received items",
|
|
1703
|
-
values:
|
|
1704
|
-
var
|
|
1708
|
+
values: p.received.map((P) => {
|
|
1709
|
+
var W;
|
|
1705
1710
|
return A("div", [
|
|
1706
1711
|
A(
|
|
1707
1712
|
"div",
|
|
@@ -1755,7 +1760,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1755
1760
|
{
|
|
1756
1761
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1757
1762
|
},
|
|
1758
|
-
((
|
|
1763
|
+
((W = P.measurement) == null ? void 0 : W.abbrev) ?? P.sku.unit.abbrev
|
|
1759
1764
|
)
|
|
1760
1765
|
]
|
|
1761
1766
|
),
|
|
@@ -1773,37 +1778,37 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1773
1778
|
]);
|
|
1774
1779
|
})
|
|
1775
1780
|
},
|
|
1776
|
-
|
|
1781
|
+
p.deliveryOrderNumber ? {
|
|
1777
1782
|
label: "Delivery order no.",
|
|
1778
|
-
values: [
|
|
1783
|
+
values: [p.deliveryOrderNumber]
|
|
1779
1784
|
} : null,
|
|
1780
|
-
|
|
1785
|
+
p.remark ? {
|
|
1781
1786
|
label: "Remark",
|
|
1782
|
-
values: [
|
|
1787
|
+
values: [p.remark]
|
|
1783
1788
|
} : null,
|
|
1784
|
-
|
|
1789
|
+
$ > -1 ? {
|
|
1785
1790
|
label: "Fulfilment's sequence",
|
|
1786
|
-
values: [`${
|
|
1791
|
+
values: [`${$ + 1}`]
|
|
1787
1792
|
} : null,
|
|
1788
1793
|
...B
|
|
1789
1794
|
].filter((P) => P)
|
|
1790
1795
|
};
|
|
1791
1796
|
}
|
|
1792
|
-
function
|
|
1793
|
-
var B,
|
|
1794
|
-
const
|
|
1797
|
+
function T(p) {
|
|
1798
|
+
var B, z;
|
|
1799
|
+
const $ = m.findIndex((E) => E.id === p.id);
|
|
1795
1800
|
return {
|
|
1796
1801
|
header: "Fulfillment",
|
|
1797
|
-
date: Ie(new Date(
|
|
1802
|
+
date: Ie(new Date(p.createdAt)),
|
|
1798
1803
|
info: [
|
|
1799
1804
|
{
|
|
1800
1805
|
label: "Sequence",
|
|
1801
|
-
values: [String(
|
|
1806
|
+
values: [String($ + 1)]
|
|
1802
1807
|
},
|
|
1803
1808
|
{
|
|
1804
1809
|
label: "Receiveable items",
|
|
1805
|
-
values:
|
|
1806
|
-
var
|
|
1810
|
+
values: p.items.map((E) => {
|
|
1811
|
+
var X;
|
|
1807
1812
|
return A("div", [
|
|
1808
1813
|
A(
|
|
1809
1814
|
"div",
|
|
@@ -1857,7 +1862,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1857
1862
|
{
|
|
1858
1863
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1859
1864
|
},
|
|
1860
|
-
((
|
|
1865
|
+
((X = E.measurement) == null ? void 0 : X.abbrev) ?? E.sku.unit.abbrev
|
|
1861
1866
|
)
|
|
1862
1867
|
]
|
|
1863
1868
|
),
|
|
@@ -1875,107 +1880,107 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1875
1880
|
]);
|
|
1876
1881
|
})
|
|
1877
1882
|
},
|
|
1878
|
-
(B =
|
|
1883
|
+
(B = p.netSuite) != null && B.refNo ? {
|
|
1879
1884
|
label: "Ref no. (Netsuite)",
|
|
1880
|
-
values: [(
|
|
1885
|
+
values: [(z = p.netSuite) == null ? void 0 : z.refNo]
|
|
1881
1886
|
} : null
|
|
1882
1887
|
].filter((E) => E)
|
|
1883
1888
|
};
|
|
1884
1889
|
}
|
|
1885
|
-
return R.map((
|
|
1886
|
-
switch (
|
|
1890
|
+
return R.map((p) => {
|
|
1891
|
+
switch (p.type) {
|
|
1887
1892
|
case "grn":
|
|
1888
|
-
return w(
|
|
1893
|
+
return w(p.doc);
|
|
1889
1894
|
case "fulfillment":
|
|
1890
|
-
return
|
|
1895
|
+
return T(p.doc);
|
|
1891
1896
|
}
|
|
1892
1897
|
});
|
|
1893
|
-
}),
|
|
1894
|
-
var
|
|
1898
|
+
}), x = Z(() => {
|
|
1899
|
+
var m;
|
|
1895
1900
|
const r = {
|
|
1896
1901
|
...ke(0),
|
|
1897
1902
|
currency: Xe()
|
|
1898
1903
|
};
|
|
1899
|
-
return ((
|
|
1904
|
+
return ((m = i.purchaseOrder) == null ? void 0 : m.items.reduce((R, w) => ({
|
|
1900
1905
|
...Le(R, w.totalCost ?? r),
|
|
1901
1906
|
currency: Xe()
|
|
1902
1907
|
}), r)) ?? r;
|
|
1903
1908
|
});
|
|
1904
|
-
return (r,
|
|
1905
|
-
var E,
|
|
1906
|
-
const R =
|
|
1907
|
-
return
|
|
1908
|
-
header:
|
|
1909
|
-
modelValue:
|
|
1910
|
-
"onUpdate:modelValue":
|
|
1911
|
-
"dismiss-away":
|
|
1909
|
+
return (r, m) => {
|
|
1910
|
+
var E, X;
|
|
1911
|
+
const R = K("FmButtonGroup"), w = K("FmChip"), T = K("FmMenuDivider"), G = K("FmCard"), Q = K("FmIcon"), p = K("FmTooltip"), $ = K("FmSpacer"), B = K("FmButton"), z = K("FmSideSheet");
|
|
1912
|
+
return b(), ae(z, {
|
|
1913
|
+
header: h(f)("inventory.transfer.receiveRequest.details.title") + ((E = r.purchaseOrder) != null && E.seqNumber ? ` #${(X = r.purchaseOrder) == null ? void 0 : X.seqNumber}` : ""),
|
|
1914
|
+
modelValue: h(F),
|
|
1915
|
+
"onUpdate:modelValue": m[5] || (m[5] = (L) => gt(F) ? F.value = L : null),
|
|
1916
|
+
"dismiss-away": v.value,
|
|
1912
1917
|
"close-button": "",
|
|
1913
1918
|
"max-width": 600
|
|
1914
1919
|
}, {
|
|
1915
1920
|
default: se(() => {
|
|
1916
1921
|
var L, ne, ge, _e, Se;
|
|
1917
1922
|
return [
|
|
1918
|
-
|
|
1919
|
-
|
|
1923
|
+
n("div", _r, [
|
|
1924
|
+
n("div", null, [
|
|
1920
1925
|
I(R, {
|
|
1921
|
-
items:
|
|
1922
|
-
modelValue:
|
|
1923
|
-
"onUpdate:modelValue":
|
|
1926
|
+
items: j.value,
|
|
1927
|
+
modelValue: H.value,
|
|
1928
|
+
"onUpdate:modelValue": m[0] || (m[0] = (U) => H.value = U)
|
|
1924
1929
|
}, null, 8, ["items", "modelValue"])
|
|
1925
1930
|
]),
|
|
1926
|
-
|
|
1927
|
-
|
|
1931
|
+
H.value.value === "overview" ? (b(), N(te, { key: 0 }, [
|
|
1932
|
+
n("div", null, [
|
|
1928
1933
|
I(G, {
|
|
1929
1934
|
variant: "outlined",
|
|
1930
1935
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1931
1936
|
}, {
|
|
1932
1937
|
default: se(() => {
|
|
1933
|
-
var U, P,
|
|
1938
|
+
var U, P, W, ve, he, Re, je, Ke, ze, He, Ge, We;
|
|
1934
1939
|
return [
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1940
|
+
n("div", Sr, [
|
|
1941
|
+
n("div", wr, k(h(f)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
1942
|
+
n("div", null, [
|
|
1938
1943
|
I(w, {
|
|
1939
|
-
label:
|
|
1940
|
-
class: Ne(`fm-status-badge fm-status-badge-${(
|
|
1944
|
+
label: h(f)(`inventory.transfer.status.${(U = r.purchaseOrder) == null ? void 0 : U.status}`),
|
|
1945
|
+
class: Ne(`fm-status-badge fm-status-badge-${(W = (P = r.purchaseOrder) == null ? void 0 : P.status) == null ? void 0 : W.toLocaleLowerCase("en-us")}`),
|
|
1941
1946
|
compact: ""
|
|
1942
1947
|
}, null, 8, ["label", "class"])
|
|
1943
1948
|
])
|
|
1944
1949
|
]),
|
|
1945
|
-
I(
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
+
I(T),
|
|
1951
|
+
n("div", Rr, [
|
|
1952
|
+
n("div", Or, [
|
|
1953
|
+
n("div", Nr, [
|
|
1954
|
+
n("div", kr, k(h(f)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1950
1955
|
]),
|
|
1951
|
-
|
|
1956
|
+
n("div", xr, k(h(xe)(((ve = r.purchaseOrder) == null ? void 0 : ve._id) ?? "")), 1)
|
|
1952
1957
|
]),
|
|
1953
|
-
(he = r.purchaseOrder) != null && he.effectiveAt ? (
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
])) :
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
`inventory.transfer.receiveRequest.details.type.${
|
|
1958
|
+
(he = r.purchaseOrder) != null && he.effectiveAt ? (b(), N("div", Dr, [
|
|
1959
|
+
n("div", qr, k(h(f)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
1960
|
+
n("div", Ar, k(h(tt)(new Date((Re = r.purchaseOrder) == null ? void 0 : Re.effectiveAt))), 1)
|
|
1961
|
+
])) : V("", !0),
|
|
1962
|
+
n("div", Tr, [
|
|
1963
|
+
n("div", $r, k(h(f)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
1964
|
+
n("div", Cr, k(h(f)(
|
|
1965
|
+
`inventory.transfer.receiveRequest.details.type.${c.value.toLocaleLowerCase("en-US")}`
|
|
1961
1966
|
)), 1)
|
|
1962
1967
|
]),
|
|
1963
|
-
(Ke = (je = r.purchaseOrder) == null ? void 0 : je.supplier) != null && Ke.name ? (
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
])) :
|
|
1967
|
-
r.transferTo ? (
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
])) :
|
|
1971
|
-
(
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
])) :
|
|
1975
|
-
(
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
])) :
|
|
1968
|
+
(Ke = (je = r.purchaseOrder) == null ? void 0 : je.supplier) != null && Ke.name ? (b(), N("div", Pr, [
|
|
1969
|
+
n("div", Ir, k(h(f)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1970
|
+
n("div", Fr, k((He = (ze = r.purchaseOrder) == null ? void 0 : ze.supplier) == null ? void 0 : He.name), 1)
|
|
1971
|
+
])) : V("", !0),
|
|
1972
|
+
r.transferTo ? (b(), N("div", Br, [
|
|
1973
|
+
n("div", Er, k(h(f)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
1974
|
+
n("div", Lr, k(r.transferTo), 1)
|
|
1975
|
+
])) : V("", !0),
|
|
1976
|
+
(Ge = r.purchaseOrder) != null && Ge.ref ? (b(), N("div", Ur, [
|
|
1977
|
+
n("div", Vr, k(h(f)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1978
|
+
n("div", Mr, k(r.purchaseOrder.ref), 1)
|
|
1979
|
+
])) : V("", !0),
|
|
1980
|
+
(We = r.purchaseOrder) != null && We.remark ? (b(), N("div", jr, [
|
|
1981
|
+
n("div", Kr, k(h(f)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1982
|
+
n("div", zr, k(r.purchaseOrder.remark), 1)
|
|
1983
|
+
])) : V("", !0)
|
|
1979
1984
|
])
|
|
1980
1985
|
];
|
|
1981
1986
|
}),
|
|
@@ -1985,16 +1990,16 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
1985
1990
|
I(gr, {
|
|
1986
1991
|
"po-request": r.poRequest,
|
|
1987
1992
|
purchaseOrder: r.purchaseOrder,
|
|
1988
|
-
transferType:
|
|
1993
|
+
transferType: c.value,
|
|
1989
1994
|
transferToDbName: r.transferToDbName,
|
|
1990
1995
|
scope: r.scope
|
|
1991
1996
|
}, null, 8, ["po-request", "purchaseOrder", "transferType", "transferToDbName", "scope"]),
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
Fe(k(ye.value ?
|
|
1997
|
-
(ne = (L = r.purchaseOrder) == null ? void 0 : L.netSuite) != null && ne.missingItems && ((_e = (ge = r.purchaseOrder) == null ? void 0 : ge.netSuite) == null ? void 0 : _e.missingItems.length) > 0 ? (
|
|
1997
|
+
n("div", Hr, [
|
|
1998
|
+
n("div", Gr, [
|
|
1999
|
+
n("div", Wr, [
|
|
2000
|
+
n("span", Yr, [
|
|
2001
|
+
Fe(k(ye.value ? h(f)("inventory.transfer.receiveRequest.details.receivedItems") : h(f)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
|
|
2002
|
+
(ne = (L = r.purchaseOrder) == null ? void 0 : L.netSuite) != null && ne.missingItems && ((_e = (ge = r.purchaseOrder) == null ? void 0 : ge.netSuite) == null ? void 0 : _e.missingItems.length) > 0 ? (b(), ae(p, {
|
|
1998
2003
|
key: 0,
|
|
1999
2004
|
variant: "rich",
|
|
2000
2005
|
placement: "top",
|
|
@@ -2003,66 +2008,66 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
2003
2008
|
content: se(() => {
|
|
2004
2009
|
var U, P;
|
|
2005
2010
|
return [
|
|
2006
|
-
|
|
2007
|
-
(
|
|
2011
|
+
n("div", Qr, [
|
|
2012
|
+
(b(!0), N(te, null, me((P = (U = r.purchaseOrder) == null ? void 0 : U.netSuite) == null ? void 0 : P.missingItems, (W, ve) => (b(), N("div", {
|
|
2008
2013
|
class: "flex justify-center align-middle",
|
|
2009
2014
|
key: ve
|
|
2010
2015
|
}, [
|
|
2011
|
-
I(
|
|
2016
|
+
I(Q, {
|
|
2012
2017
|
name: "arrow_right",
|
|
2013
2018
|
size: "sm"
|
|
2014
2019
|
}),
|
|
2015
|
-
Fe(" " + k(`(${
|
|
2020
|
+
Fe(" " + k(`(${W.netSuiteId}) ${W.name}: ${W.reason}`), 1)
|
|
2016
2021
|
]))), 128))
|
|
2017
2022
|
])
|
|
2018
2023
|
];
|
|
2019
2024
|
}),
|
|
2020
2025
|
default: se(() => [
|
|
2021
|
-
I(
|
|
2026
|
+
I(Q, {
|
|
2022
2027
|
name: "error",
|
|
2023
2028
|
color: "#ff2c2c",
|
|
2024
2029
|
size: "sm"
|
|
2025
2030
|
})
|
|
2026
2031
|
]),
|
|
2027
2032
|
_: 1
|
|
2028
|
-
})) :
|
|
2033
|
+
})) : V("", !0)
|
|
2029
2034
|
])
|
|
2030
2035
|
]),
|
|
2031
|
-
I(
|
|
2032
|
-
(
|
|
2036
|
+
I(T),
|
|
2037
|
+
(b(!0), N(te, null, me(((Se = r.purchaseOrder) == null ? void 0 : Se.items) ?? [], (U) => {
|
|
2033
2038
|
var P;
|
|
2034
|
-
return
|
|
2039
|
+
return b(), N("div", {
|
|
2035
2040
|
key: U.code,
|
|
2036
2041
|
class: "flex flex-col"
|
|
2037
2042
|
}, [
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2043
|
+
n("div", Xr, [
|
|
2044
|
+
n("div", Jr, k(U.name), 1),
|
|
2045
|
+
n("div", Zr, k(h(ie)(Ce.value[U.sku._id], !1)) + "/" + k(h(Ot)(U.quantity, U.sku.unit, U.measurement)), 1)
|
|
2041
2046
|
]),
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
(P = U.totalCost) != null && P.amount &&
|
|
2047
|
+
n("div", es, [
|
|
2048
|
+
n("div", ts, k(U.code), 1),
|
|
2049
|
+
(P = U.totalCost) != null && P.amount && h(l).enableTotalCost ? (b(), N("div", rs, " (" + k(h(Oe)(U.totalCost)) + ") ", 1)) : V("", !0)
|
|
2045
2050
|
])
|
|
2046
2051
|
]);
|
|
2047
2052
|
}), 128)),
|
|
2048
|
-
+
|
|
2049
|
-
|
|
2050
|
-
I(
|
|
2053
|
+
+h(ie)(x.value) ? (b(), N(te, { key: 0 }, [
|
|
2054
|
+
n("div", ss, [
|
|
2055
|
+
I(T)
|
|
2051
2056
|
]),
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2057
|
+
n("div", ns, [
|
|
2058
|
+
m[6] || (m[6] = n("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
|
|
2059
|
+
n("div", as, k(h(Oe)(x.value)), 1)
|
|
2055
2060
|
])
|
|
2056
|
-
], 64)) :
|
|
2061
|
+
], 64)) : V("", !0)
|
|
2057
2062
|
])
|
|
2058
2063
|
])
|
|
2059
|
-
], 64)) :
|
|
2060
|
-
ce.value.length ? (
|
|
2061
|
-
(
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2064
|
+
], 64)) : H.value.value === "deliveryHistory" ? (b(), N("div", os, [
|
|
2065
|
+
ce.value.length ? (b(), N("div", ds, [
|
|
2066
|
+
(b(!0), N(te, null, me(ce.value, (U, P) => (b(), N(te, { key: P }, [
|
|
2067
|
+
n("div", ms, [
|
|
2068
|
+
n("div", fs, [
|
|
2069
|
+
n("div", ps, [
|
|
2070
|
+
n("div", {
|
|
2066
2071
|
class: Ne([
|
|
2067
2072
|
{
|
|
2068
2073
|
"bg-fm-color-primary": P !== 0,
|
|
@@ -2072,9 +2077,9 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
2072
2077
|
])
|
|
2073
2078
|
}, null, 2)
|
|
2074
2079
|
]),
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2080
|
+
m[7] || (m[7] = n("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
2081
|
+
n("div", ys, [
|
|
2082
|
+
n("div", {
|
|
2078
2083
|
class: Ne([
|
|
2079
2084
|
{
|
|
2080
2085
|
"bg-fm-color-primary": P < ce.value.length - 1,
|
|
@@ -2085,15 +2090,15 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
2085
2090
|
}, null, 2)
|
|
2086
2091
|
])
|
|
2087
2092
|
]),
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2093
|
+
n("div", vs, [
|
|
2094
|
+
n("div", hs, k(U.header), 1),
|
|
2095
|
+
n("div", bs, k(U.date), 1)
|
|
2091
2096
|
])
|
|
2092
2097
|
]),
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2098
|
+
n("div", gs, [
|
|
2099
|
+
n("div", _s, [
|
|
2100
|
+
n("div", Ss, [
|
|
2101
|
+
n("div", {
|
|
2097
2102
|
class: Ne([
|
|
2098
2103
|
{
|
|
2099
2104
|
"bg-fm-color-primary": P < ce.value.length - 1,
|
|
@@ -2104,26 +2109,26 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
2104
2109
|
}, null, 2)
|
|
2105
2110
|
])
|
|
2106
2111
|
]),
|
|
2107
|
-
|
|
2112
|
+
n("div", ws, [
|
|
2108
2113
|
I(G, {
|
|
2109
2114
|
variant: "outlined",
|
|
2110
2115
|
class: "py-12 px-16"
|
|
2111
2116
|
}, {
|
|
2112
2117
|
default: se(() => [
|
|
2113
|
-
|
|
2114
|
-
(
|
|
2118
|
+
n("div", Rs, [
|
|
2119
|
+
(b(!0), N(te, null, me(U.info, (W, ve) => (b(), N("div", {
|
|
2115
2120
|
key: ve,
|
|
2116
2121
|
class: "flex flex-col gap-4"
|
|
2117
2122
|
}, [
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
(
|
|
2123
|
+
n("div", Os, k(W == null ? void 0 : W.label), 1),
|
|
2124
|
+
n("div", Ns, [
|
|
2125
|
+
(b(!0), N(te, null, me(W == null ? void 0 : W.values, (he, Re) => (b(), N("div", {
|
|
2121
2126
|
key: Re,
|
|
2122
2127
|
class: "fm-typo-en-body-lg-600"
|
|
2123
2128
|
}, [
|
|
2124
|
-
typeof he == "string" ? (
|
|
2129
|
+
typeof he == "string" ? (b(), N(te, { key: 0 }, [
|
|
2125
2130
|
Fe(k(he), 1)
|
|
2126
|
-
], 64)) : (
|
|
2131
|
+
], 64)) : (b(), ae(_t(he), { key: 1 }))
|
|
2127
2132
|
]))), 128))
|
|
2128
2133
|
])
|
|
2129
2134
|
]))), 128))
|
|
@@ -2134,60 +2139,60 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
|
|
|
2134
2139
|
])
|
|
2135
2140
|
])
|
|
2136
2141
|
], 64))), 128))
|
|
2137
|
-
])) : (
|
|
2138
|
-
I(
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
src:
|
|
2142
|
+
])) : (b(), N("div", is, [
|
|
2143
|
+
I($),
|
|
2144
|
+
n("div", null, [
|
|
2145
|
+
n("img", {
|
|
2146
|
+
src: h(Nt),
|
|
2142
2147
|
alt: "List is empty"
|
|
2143
2148
|
}, null, 8, ls)
|
|
2144
2149
|
]),
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
I(
|
|
2148
|
-
I(
|
|
2150
|
+
n("div", cs, k(h(f)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
2151
|
+
n("div", us, k(h(f)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
|
|
2152
|
+
I($),
|
|
2153
|
+
I($)
|
|
2149
2154
|
]))
|
|
2150
|
-
])) :
|
|
2155
|
+
])) : V("", !0)
|
|
2151
2156
|
])
|
|
2152
2157
|
];
|
|
2153
2158
|
}),
|
|
2154
2159
|
"side-sheet-footer": se(() => [
|
|
2155
|
-
|
|
2156
|
-
(
|
|
2157
|
-
|
|
2160
|
+
n("div", ks, [
|
|
2161
|
+
(b(!0), N(te, null, me(C.value, (L) => (b(), N(te, null, [
|
|
2162
|
+
h(Ee)[L].available != !1 ? (b(), ae(B, {
|
|
2158
2163
|
key: L,
|
|
2159
|
-
label:
|
|
2164
|
+
label: h(f)(h(Ee)[L].translationKey),
|
|
2160
2165
|
onClick: (ne) => oe(L),
|
|
2161
|
-
loading:
|
|
2162
|
-
disabled:
|
|
2163
|
-
variant:
|
|
2164
|
-
}, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) :
|
|
2166
|
+
loading: o.value === L,
|
|
2167
|
+
disabled: o.value !== L && u.value,
|
|
2168
|
+
variant: h(Ee)[L].buttonVariant
|
|
2169
|
+
}, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : V("", !0)
|
|
2165
2170
|
], 64))), 256)),
|
|
2166
|
-
|
|
2171
|
+
h(g).ableToMarkReceived(r.purchaseOrder) && !C.value.includes("completeReceive") ? (b(), ae(B, {
|
|
2167
2172
|
key: 0,
|
|
2168
|
-
label:
|
|
2169
|
-
onClick:
|
|
2170
|
-
loading:
|
|
2171
|
-
disabled:
|
|
2172
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
2173
|
-
|
|
2173
|
+
label: h(f)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
2174
|
+
onClick: m[1] || (m[1] = (L) => oe("completeReceive")),
|
|
2175
|
+
loading: o.value === "completeReceive",
|
|
2176
|
+
disabled: o.value !== "completeReceive" && u.value
|
|
2177
|
+
}, null, 8, ["label", "loading", "disabled"])) : V("", !0),
|
|
2178
|
+
h(g).ableToMarkApproved(r.purchaseOrder) && r.canApprove && !C.value.includes("approveRequest") ? (b(), ae(B, {
|
|
2174
2179
|
key: 1,
|
|
2175
|
-
label:
|
|
2176
|
-
onClick:
|
|
2177
|
-
loading:
|
|
2178
|
-
disabled:
|
|
2179
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
2180
|
-
|
|
2180
|
+
label: h(f)("inventory.transfer.approval.actions.approveRequest"),
|
|
2181
|
+
onClick: m[2] || (m[2] = (L) => oe("approveRequest")),
|
|
2182
|
+
loading: o.value === "approveRequest",
|
|
2183
|
+
disabled: o.value !== "approveRequest" && u.value
|
|
2184
|
+
}, null, 8, ["label", "loading", "disabled"])) : V("", !0),
|
|
2185
|
+
h(g).ableToCreateFulfillment(r.purchaseOrder, r.poRequest) && i.scope === "approval" ? (b(), ae(B, {
|
|
2181
2186
|
key: 2,
|
|
2182
|
-
label:
|
|
2183
|
-
onClick:
|
|
2184
|
-
loading:
|
|
2185
|
-
disabled:
|
|
2186
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
2187
|
+
label: h(f)("inventory.transfer.receiveRequest.actions.processRequest"),
|
|
2188
|
+
onClick: m[3] || (m[3] = (L) => oe("processRequest")),
|
|
2189
|
+
loading: o.value === "processRequest",
|
|
2190
|
+
disabled: o.value !== "processRequest" && u.value
|
|
2191
|
+
}, null, 8, ["label", "loading", "disabled"])) : V("", !0),
|
|
2187
2192
|
I(B, {
|
|
2188
|
-
label:
|
|
2193
|
+
label: h(f)("common.close"),
|
|
2189
2194
|
variant: "tertiary",
|
|
2190
|
-
onClick:
|
|
2195
|
+
onClick: m[4] || (m[4] = (L) => _("update:show", !1))
|
|
2191
2196
|
}, null, 8, ["label"])
|
|
2192
2197
|
])
|
|
2193
2198
|
]),
|