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