@feedmepos/mf-inventory-portal 1.1.5 → 1.1.6-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-CyCxXYWb.js → App-ZdPyRgoK.js} +1 -1
- package/dist/{ApprovalView-U_0mloUl.js → ApprovalView-VNUUoGaD.js} +12 -12
- package/dist/{BindingsDialog-MU1VXpRz.js → BindingsDialog-CqrwH8Le.js} +2 -2
- package/dist/{BindingsPicker-B0DtgYMV.js → BindingsPicker-CBrr3QOo.js} +1 -1
- package/dist/{BindingsTable-CSZw1l9L.js → BindingsTable-CM_qgGzX.js} +1 -1
- package/dist/{ClosingDraftView-DwUlj7ta.js → ClosingDraftView-EJxncQHK.js} +2 -2
- package/dist/ClosingTemplateView-P3-3w7LP.js +1908 -0
- package/dist/{DeliveryOrderPrintPreview-D7-jS3K1.js → DeliveryOrderPrintPreview-B_0diddC.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BnL2z9Or.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C_pIvqso.js} +16 -16
- package/dist/{FmMultiselectDialog-BTjE3FDA.js → FmMultiselectDialog-B3_QQAyt.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-D-hrdDvI.js → FmUnitInput.vue_vue_type_script_setup_true_lang-FPaLEdx0.js} +20 -20
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DqY-ppJ9.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BOMcifaU.js} +1 -1
- package/dist/{IngredientGroupView-R5cNGeUG.js → IngredientGroupView-C4qAQE49.js} +2 -2
- package/dist/{IngredientsView-BkRv5-9o.js → IngredientsView-BuUCuN_-.js} +4 -4
- package/dist/{IntegrationView-DJzLUlBA.js → IntegrationView-Ww16O2-h.js} +729 -766
- package/dist/{InventoryBindingForm-SBCpdUlA.js → InventoryBindingForm-BdGh-FcD.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DQ9-3Y3R.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DkqxNffc.js} +3 -3
- package/dist/{InventoryBindingSummary-DRJTEG5M.js → InventoryBindingSummary-immSfENb.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BTyKsubT.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-ChP4yc96.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Bn5b1Ur-.js → PremiumBadge.vue_vue_type_script_setup_true_lang-D-GMVZlu.js} +6 -6
- package/dist/{PublishView-ClOkwACw.js → PublishView-BYymYGs5.js} +22 -23
- package/dist/{PurchaseOrderPrintPreview-BV_-rfm2.js → PurchaseOrderPrintPreview-D3WKx7pj.js} +6 -6
- package/dist/{ReceiveRequestView-BEA8WYAJ.js → ReceiveRequestView-Ba5ONN7U.js} +122 -123
- package/dist/{RecipeView-CgS5UMwE.js → RecipeView-DoD3paRP.js} +3 -3
- package/dist/{StockView-DfNZOW1U.js → StockView-fO7PGIdp.js} +6 -6
- package/dist/{SupplierView-nAtRIngl.js → SupplierView-DNhVDIF0.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-0fKqK-Yg.js → TransferDetails.vue_vue_type_script_setup_true_lang-D4noOVzU.js} +812 -847
- package/dist/{TransferTemplateView-B7P8MaPd.js → TransferTemplateView-788yoUXj.js} +70 -70
- package/dist/{UnitView-B5bqeT_p.js → UnitView-iQCflI7n.js} +3 -3
- package/dist/{WarehouseView-yIhVXIOL.js → WarehouseView-ComVJ9Ub.js} +1 -1
- package/dist/api/adjustment-template.d.ts +2 -0
- package/dist/api/closing-template.d.ts +2 -0
- package/dist/api/netsuite.d.ts +0 -1
- package/dist/{app-CktPIZfH.js → app-DDQ8iM43.js} +32520 -30121
- package/dist/app.js +5 -5
- package/dist/components/TemplatePublishDialog.d.ts +13 -0
- package/dist/components/TemplatePublishDialog.vue.d.ts +12 -0
- package/dist/components/row-action.enum.d.ts +1 -0
- package/dist/{decimal-ClHMtypx.js → decimal-Cj3dpSJu.js} +1 -1
- package/dist/{format-unit-display--5ianNK1.js → format-unit-display-DBZ-CswW.js} +22 -22
- package/dist/{index-ynBWdY_c.js → index-DkQGplv5.js} +1 -1
- package/dist/{index-KMubbPxS.js → index-TCig0pJv.js} +1 -1
- package/dist/{stock-Bsrt9B9a.js → stock-cW_hYhb6.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-BXmGBQ24.js → supplier-CmLYcKmg.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-Pg9yaoJS.js → use-ingredient-select-dialog-J1mw_EQM.js} +1 -1
- package/dist/{use-inventory-binding-dialog-Deyh6NeE.js → use-inventory-binding-dialog-CgxQ2cgb.js} +1 -1
- package/dist/views/dev/components/TemplatePublishDialogTest.vue.d.ts +2 -0
- package/dist/views/receive-request/composables/fn.d.ts +3 -4
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +618 -1
- package/package.json +1 -1
- package/dist/ClosingTemplateView-DcUMrx5w.js +0 -1863
- package/dist/components/FmMultiselectDialogTemporary.vue.d.ts +0 -41
- package/dist/vue-i18n-Dybwy_8K.js +0 -2365
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import { a3 as
|
|
2
|
-
import { ref as M, computed as
|
|
3
|
-
import { F as
|
|
1
|
+
import { a3 as pt, u as me, aR as R, aS as Te, ay as ie, c as $e, b as Ae, a8 as vt, aa as yt, ab as ht, aT as bt, e as Xe, f as rt, a0 as Ke, aU as gt, a5 as st, T as nt, j as fe, aV as _t, aW as at, af as qe, h as Ze, i as J, D as ne, aX as ot, aY as it, aZ as Ee, aw as Je, a7 as Ne, am as Le, az as St, a_ as ke, Q as wt } from "./app-DDQ8iM43.js";
|
|
2
|
+
import { ref as M, computed as Z, h as T, defineComponent as he, reactive as Rt, onMounted as lt, resolveComponent as z, openBlock as g, createBlock as oe, withCtx as ae, createElementVNode as o, createVNode as I, unref as S, createElementBlock as x, toDisplayString as D, createCommentVNode as U, Fragment as se, renderList as ve, watch as Ot, isRef as xt, normalizeClass as De, createTextVNode as Be, resolveDynamicComponent as Nt } from "vue";
|
|
3
|
+
import { F as kt } from "./decimal-Cj3dpSJu.js";
|
|
4
4
|
import { useCoreStore as Pe, useI18n as ct } from "@feedmepos/mf-common";
|
|
5
|
-
import { useDialog as je, useSnackbar as Ce, components as et, FmButtonVariant as re, useProxiedModel as
|
|
6
|
-
import { b as
|
|
7
|
-
import { E as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { u as
|
|
10
|
-
import { u as
|
|
11
|
-
const Ie =
|
|
12
|
-
const
|
|
5
|
+
import { useDialog as je, useSnackbar as Ce, components as et, FmButtonVariant as re, useProxiedModel as Dt } from "@feedmepos/ui-library";
|
|
6
|
+
import { b as qt, u as Tt, P as ye, f as $t } from "./format-unit-display-DBZ-CswW.js";
|
|
7
|
+
import { E as At } from "./empty-placeholder-wf6-BWE8.js";
|
|
8
|
+
import { _ as Pt, F as Ct, a as It } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-FPaLEdx0.js";
|
|
9
|
+
import { u as Ft, R as tt } from "./usePromise-CbVUCxhj.js";
|
|
10
|
+
import { u as Et } from "./index-DkQGplv5.js";
|
|
11
|
+
const Ie = pt((m, e) => {
|
|
12
|
+
const a = me(), h = Pe();
|
|
13
13
|
return {
|
|
14
|
-
async readRequests(u, t,
|
|
15
|
-
const
|
|
16
|
-
return t &&
|
|
14
|
+
async readRequests(u, t, c) {
|
|
15
|
+
const i = u ?? a.currentLocationDBName, n = `${m.inventoryBackendUrl}/${i}/purchase-request`;
|
|
16
|
+
return t && c ? await e.get(`${n}?startDate=${t}&endDate=${c}`) : await e.get(n);
|
|
17
17
|
},
|
|
18
18
|
async readRequestById(u, t) {
|
|
19
|
-
const
|
|
20
|
-
return await e.get(
|
|
19
|
+
const c = t ?? a.currentLocationDBName, i = `${m.inventoryBackendUrl}/${c}/purchase-request/${u}`;
|
|
20
|
+
return await e.get(i);
|
|
21
21
|
},
|
|
22
22
|
async readRequestByIds(u, t) {
|
|
23
|
-
const
|
|
24
|
-
return await e.post(
|
|
23
|
+
const c = t ?? a.currentLocationDBName, i = `${m.inventoryBackendUrl}/${c}/purchase-request/find`;
|
|
24
|
+
return await e.post(i, { requestIds: u });
|
|
25
25
|
},
|
|
26
26
|
async getPurchaseOrders({
|
|
27
27
|
start: u,
|
|
28
28
|
end: t
|
|
29
29
|
}) {
|
|
30
|
-
const
|
|
31
|
-
return await e.get(`${
|
|
30
|
+
const c = a.currentLocationDBName, i = `${m.inventoryBackendUrl}/${c}/purchase-order`;
|
|
31
|
+
return await e.get(`${i}?start=${u}&end=${t}`);
|
|
32
32
|
},
|
|
33
33
|
async getLatestPurchaseOrderRequest(u) {
|
|
34
|
-
const t =
|
|
35
|
-
return await e.get(`${
|
|
34
|
+
const t = a.currentLocationDBName, c = `${m.inventoryBackendUrl}/${t}/purchase-request/find-by-purchase-order-id`;
|
|
35
|
+
return await e.get(`${c}/${u}`);
|
|
36
36
|
},
|
|
37
37
|
async getPurchaseOrderById(u) {
|
|
38
|
-
const t =
|
|
39
|
-
return await e.get(`${
|
|
38
|
+
const t = a.currentLocationDBName, c = `${m.inventoryBackendUrl}/${t}/purchase-order`;
|
|
39
|
+
return await e.get(`${c}/${u}`);
|
|
40
40
|
},
|
|
41
41
|
/**
|
|
42
42
|
* @deprecated Use `processPurchaseOrderV2` instead.
|
|
43
43
|
*/
|
|
44
44
|
async processPurchaseOrder(u, t) {
|
|
45
|
-
const
|
|
46
|
-
return await e.put(
|
|
45
|
+
const c = a.currentLocationDBName, i = t || c, n = `${m.inventoryBackendUrl}/${i}/purchase-order/run-operation`;
|
|
46
|
+
return await e.put(n, u);
|
|
47
47
|
},
|
|
48
48
|
async createPurchaseOrder(u) {
|
|
49
|
-
const t =
|
|
50
|
-
return await e.post(
|
|
49
|
+
const t = a.currentLocationDBName, c = `${m.inventoryBackendUrl}/${t}/purchase-order`;
|
|
50
|
+
return await e.post(c, u);
|
|
51
51
|
},
|
|
52
52
|
async updatePurchaseOrder(u) {
|
|
53
|
-
const t =
|
|
54
|
-
return await e.put(
|
|
53
|
+
const t = a.currentLocationDBName, c = `${m.inventoryBackendUrl}/${t}/purchase-order`;
|
|
54
|
+
return await e.put(c, u);
|
|
55
55
|
},
|
|
56
56
|
async importFromXilnex(u) {
|
|
57
|
-
const t =
|
|
58
|
-
return await e.post(
|
|
57
|
+
const t = a.currentLocationDBName, c = `${m.inventoryBackendUrl}/${t}/purchase-order/import-from-xilnex`;
|
|
58
|
+
return await e.post(c, u);
|
|
59
59
|
},
|
|
60
60
|
async processPurchaseOrderV2(u, t) {
|
|
61
|
-
const
|
|
62
|
-
return await e.put(
|
|
61
|
+
const c = a.currentLocationDBName, i = t || c, n = `${m.inventoryBackendUrl}/${i}/v2/purchase-order/run-operation`;
|
|
62
|
+
return await e.put(n, u);
|
|
63
63
|
},
|
|
64
64
|
async getWorkflowConfig() {
|
|
65
|
-
var
|
|
66
|
-
const t = `business_${(
|
|
67
|
-
return await e.get(
|
|
65
|
+
var i;
|
|
66
|
+
const t = `business_${(i = h.currentBusiness.value) == null ? void 0 : i._id}`, c = `${m.inventoryBackendUrl}/${t}/v2/purchase-order/workflow-config`;
|
|
67
|
+
return await e.get(c);
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
}), ut = {
|
|
71
|
-
[
|
|
71
|
+
[R.enum.confirmDraft]: {
|
|
72
72
|
primaryActions: {
|
|
73
73
|
text: "Confirm draft",
|
|
74
74
|
close: !0
|
|
@@ -77,7 +77,7 @@ const Ie = vt((d, e) => {
|
|
|
77
77
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
78
78
|
successMessage: "Purchase order draft has been confirmed"
|
|
79
79
|
},
|
|
80
|
-
[
|
|
80
|
+
[R.enum.cancelDraft]: {
|
|
81
81
|
primaryActions: {
|
|
82
82
|
text: "Cancel draft",
|
|
83
83
|
close: !0,
|
|
@@ -87,7 +87,7 @@ const Ie = vt((d, e) => {
|
|
|
87
87
|
message: "Purchase order cannot be changed after cancelled draft.",
|
|
88
88
|
successMessage: "Purchase order draft has been cancelled"
|
|
89
89
|
},
|
|
90
|
-
[
|
|
90
|
+
[R.enum.submitRequest]: {
|
|
91
91
|
primaryActions: {
|
|
92
92
|
text: "Submit request",
|
|
93
93
|
close: !0
|
|
@@ -96,7 +96,7 @@ const Ie = vt((d, e) => {
|
|
|
96
96
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
97
97
|
successMessage: "Purchase order draft has been submitted"
|
|
98
98
|
},
|
|
99
|
-
[
|
|
99
|
+
[R.enum.completeReceive]: {
|
|
100
100
|
primaryActions: {
|
|
101
101
|
text: "Mark received",
|
|
102
102
|
close: !0
|
|
@@ -105,7 +105,7 @@ const Ie = vt((d, e) => {
|
|
|
105
105
|
message: "Purchase order cannot be changed after it has complete receiving.",
|
|
106
106
|
successMessage: "Purchase order has been marked as received"
|
|
107
107
|
},
|
|
108
|
-
[
|
|
108
|
+
[R.enum.approveRequest]: {
|
|
109
109
|
primaryActions: {
|
|
110
110
|
text: "Accept request",
|
|
111
111
|
close: !0
|
|
@@ -114,7 +114,7 @@ const Ie = vt((d, e) => {
|
|
|
114
114
|
message: "Transfer out request will be accepted.",
|
|
115
115
|
successMessage: "Transfer out request has been approved"
|
|
116
116
|
},
|
|
117
|
-
[
|
|
117
|
+
[R.enum.rejectRequest]: {
|
|
118
118
|
primaryActions: {
|
|
119
119
|
text: "Reject request",
|
|
120
120
|
close: !0,
|
|
@@ -124,7 +124,7 @@ const Ie = vt((d, e) => {
|
|
|
124
124
|
message: "Purchase order will be rejected.",
|
|
125
125
|
successMessage: "Purchase order has been rejected"
|
|
126
126
|
},
|
|
127
|
-
[
|
|
127
|
+
[R.enum.processRequest]: {
|
|
128
128
|
primaryActions: {
|
|
129
129
|
text: "Process request",
|
|
130
130
|
close: !0,
|
|
@@ -134,121 +134,74 @@ const Ie = vt((d, e) => {
|
|
|
134
134
|
message: "Purchase order will be processed.",
|
|
135
135
|
successMessage: "Purchase order has been processed"
|
|
136
136
|
}
|
|
137
|
-
}
|
|
138
|
-
function ze(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
const o = e === ye.enum[2] ? l.id : l.sku._id;
|
|
143
|
-
r[o] || (r[o] = {
|
|
144
|
-
key: o,
|
|
145
|
-
total: l.quantity,
|
|
146
|
-
remaining: l.quantity,
|
|
147
|
-
received: he.fromNumber(0)
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
const u = d.deliveryOrder ?? [];
|
|
151
|
-
for (const l of u)
|
|
152
|
-
for (const o of l.received) {
|
|
153
|
-
const s = e === ye.enum[2] ? o.id : o.sku._id;
|
|
154
|
-
if (!r[s]) {
|
|
155
|
-
console.warn(`key ${s} not found in receivedMap`);
|
|
156
|
-
continue;
|
|
157
|
-
}
|
|
158
|
-
const v = ((t = r[s]) == null ? void 0 : t.received) ?? he.fromNumber(0);
|
|
159
|
-
r[s].received = he.add([v, o.amount]), r[s].remaining = he.subtract([
|
|
160
|
-
r[s].total,
|
|
161
|
-
r[s].received
|
|
162
|
-
]);
|
|
163
|
-
}
|
|
164
|
-
return r;
|
|
137
|
+
};
|
|
138
|
+
function ze(m) {
|
|
139
|
+
return Te.generatedPOReceivedMap({
|
|
140
|
+
purchaseOrder: m
|
|
141
|
+
});
|
|
165
142
|
}
|
|
166
|
-
function
|
|
167
|
-
return
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
} : d.received.amount === 0 ? {
|
|
171
|
-
isNoReceive: !0
|
|
172
|
-
} : d.received.amount > 0 && he.smallerThan({
|
|
173
|
-
a: d.received,
|
|
174
|
-
b: d.total
|
|
175
|
-
}) ? {
|
|
176
|
-
isPartialReceive: !0
|
|
177
|
-
} : d.received.amount > 0 && he.greaterThan({
|
|
178
|
-
a: d.received,
|
|
179
|
-
b: d.total
|
|
180
|
-
}) ? {
|
|
181
|
-
isOverReceive: !0
|
|
182
|
-
} : {};
|
|
143
|
+
function Lt(m) {
|
|
144
|
+
return Te.validatePOItemReceivedStatus({
|
|
145
|
+
dto: m
|
|
146
|
+
});
|
|
183
147
|
}
|
|
184
|
-
function
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
if (l || (e = !0, r = !1), o && (p = !0), e && p) break;
|
|
189
|
-
}
|
|
190
|
-
return {
|
|
191
|
-
partial: e && !r,
|
|
192
|
-
over: p
|
|
193
|
-
};
|
|
148
|
+
function dt(m) {
|
|
149
|
+
return Te.validatePOReceivedStatus({
|
|
150
|
+
receivedMap: m
|
|
151
|
+
});
|
|
194
152
|
}
|
|
195
|
-
function
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return "PARTIAL_RECEIVED";
|
|
205
|
-
break;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
return d;
|
|
153
|
+
function ft(m, e, a) {
|
|
154
|
+
if (!ie.safeParse(m).success)
|
|
155
|
+
throw new Error(`Invalid purchase order status: ${m}`);
|
|
156
|
+
const h = ie.parse(m);
|
|
157
|
+
return Te.orderStatusCombination({
|
|
158
|
+
status: h,
|
|
159
|
+
isPOPartialReceive: e,
|
|
160
|
+
isPOOverReceive: a
|
|
161
|
+
});
|
|
209
162
|
}
|
|
210
|
-
function
|
|
211
|
-
const
|
|
212
|
-
async function
|
|
213
|
-
const
|
|
214
|
-
return t.doc.supplier.internal && t.operation ===
|
|
163
|
+
function mt() {
|
|
164
|
+
const m = me(), e = Ie(), a = $e();
|
|
165
|
+
async function h(t, c) {
|
|
166
|
+
const i = m.currentLocationDBName;
|
|
167
|
+
return t.doc.supplier.internal && t.operation === R.enum.confirmDraft && (t.operation = R.enum.submitRequest), await e.processPurchaseOrder(t, c || i);
|
|
215
168
|
}
|
|
216
|
-
async function u(t,
|
|
217
|
-
const
|
|
218
|
-
return await e.processPurchaseOrderV2(t,
|
|
169
|
+
async function u(t, c) {
|
|
170
|
+
const i = m.currentLocationDBName;
|
|
171
|
+
return await e.processPurchaseOrderV2(t, c || i);
|
|
219
172
|
}
|
|
220
|
-
return (t) =>
|
|
173
|
+
return (t) => a.useOperatePurchaseOrderV2 ? u(t.operateV2, t.transferTo) : h(t.operate, t.transferTo);
|
|
221
174
|
}
|
|
222
|
-
var Me = /* @__PURE__ */ ((
|
|
223
|
-
const
|
|
224
|
-
function zs(
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
const t =
|
|
228
|
-
e != null && e.startDate && (e != null && e.endDate) ? e :
|
|
229
|
-
),
|
|
230
|
-
const k = new Date(
|
|
175
|
+
var Me = /* @__PURE__ */ ((m) => (m.RECEIVE_REQUEST = "receive/request", m.APPROVAL = "approval", m))(Me || {});
|
|
176
|
+
const Oe = M(), Ve = M();
|
|
177
|
+
function zs(m, e) {
|
|
178
|
+
const a = je(), h = me(), u = $e();
|
|
179
|
+
Ae();
|
|
180
|
+
const t = qt(), c = Tt(), i = M(!1), n = Ce(), y = Ie(), _ = M(new Array()), p = M(
|
|
181
|
+
e != null && e.startDate && (e != null && e.endDate) ? e : vt()
|
|
182
|
+
), f = Z(() => {
|
|
183
|
+
const k = new Date(p.value.startDate), A = new Date(p.value.endDate);
|
|
231
184
|
return {
|
|
232
|
-
start:
|
|
233
|
-
end:
|
|
185
|
+
start: yt(k).toISOString(),
|
|
186
|
+
end: ht(A).toISOString()
|
|
234
187
|
};
|
|
235
|
-
}),
|
|
188
|
+
}), l = M(new Array()), s = bt(), b = M(null);
|
|
236
189
|
async function O(k) {
|
|
237
|
-
function A(
|
|
238
|
-
const
|
|
190
|
+
function A(r) {
|
|
191
|
+
const d = {
|
|
239
192
|
mode: Xe.CREATE,
|
|
240
193
|
modelValue: k || void 0,
|
|
241
194
|
show: !0,
|
|
242
|
-
"onUpdate:show"(
|
|
243
|
-
|
|
195
|
+
"onUpdate:show"(w) {
|
|
196
|
+
Oe.value.show = w;
|
|
244
197
|
},
|
|
245
|
-
templateId:
|
|
246
|
-
lastClosingDate:
|
|
198
|
+
templateId: r,
|
|
199
|
+
lastClosingDate: b.value
|
|
247
200
|
};
|
|
248
|
-
|
|
201
|
+
Oe.value = d;
|
|
249
202
|
}
|
|
250
203
|
let H;
|
|
251
|
-
u.mustUsePoTemplate && !(k != null && k.template) ?
|
|
204
|
+
u.mustUsePoTemplate && !(k != null && k.template) ? a.open({
|
|
252
205
|
title: "Create transfer",
|
|
253
206
|
message: "",
|
|
254
207
|
primaryActions: {
|
|
@@ -266,74 +219,74 @@ function zs(d, e) {
|
|
|
266
219
|
A(void 0);
|
|
267
220
|
}) : A(H);
|
|
268
221
|
}
|
|
269
|
-
function
|
|
222
|
+
function N(k) {
|
|
270
223
|
const A = {
|
|
271
224
|
mode: Xe.UPDATE,
|
|
272
225
|
modelValue: rt(k),
|
|
273
226
|
show: !0,
|
|
274
227
|
"onUpdate:show"(H) {
|
|
275
|
-
|
|
228
|
+
Oe.value.show = H;
|
|
276
229
|
},
|
|
277
|
-
lastClosingDate:
|
|
230
|
+
lastClosingDate: b.value
|
|
278
231
|
};
|
|
279
|
-
|
|
232
|
+
Oe.value = A;
|
|
280
233
|
}
|
|
281
234
|
async function E() {
|
|
282
|
-
|
|
235
|
+
_.value = [], i.value = !0;
|
|
283
236
|
try {
|
|
284
|
-
|
|
285
|
-
const k = await
|
|
286
|
-
A && (
|
|
287
|
-
const H =
|
|
288
|
-
var
|
|
289
|
-
return ((
|
|
290
|
-
}).filter((
|
|
291
|
-
|
|
237
|
+
_.value = await y.getPurchaseOrders(f.value).then((r) => r.sort((d, w) => w._id.localeCompare(d._id)));
|
|
238
|
+
const k = await s.readCurrentLocationLastClosing(!0), A = k == null ? void 0 : k._id;
|
|
239
|
+
A && (b.value = gt(A)), await u.awaitFeatureLoaded(() => u.mustUsePoTemplate) && await c.fetchTemplates();
|
|
240
|
+
const H = _.value.map((r) => {
|
|
241
|
+
var d;
|
|
242
|
+
return ((d = r.request) == null ? void 0 : d.id) ?? "";
|
|
243
|
+
}).filter((r) => r);
|
|
244
|
+
l.value = await y.readRequestByIds(H);
|
|
292
245
|
} catch {
|
|
293
|
-
|
|
246
|
+
n.open({
|
|
294
247
|
title: "Something went wrong",
|
|
295
248
|
message: "Error at fetching purchase orders",
|
|
296
249
|
type: "error"
|
|
297
250
|
});
|
|
298
251
|
} finally {
|
|
299
|
-
|
|
252
|
+
i.value = !1;
|
|
300
253
|
}
|
|
301
254
|
}
|
|
302
|
-
async function
|
|
303
|
-
|
|
255
|
+
async function $() {
|
|
256
|
+
l.value = [], i.value = !0;
|
|
304
257
|
try {
|
|
305
|
-
|
|
258
|
+
l.value = await y.readRequests(
|
|
306
259
|
void 0,
|
|
307
|
-
|
|
308
|
-
|
|
260
|
+
f.value.start,
|
|
261
|
+
f.value.end
|
|
309
262
|
).then((k) => k.reverse());
|
|
310
263
|
} catch {
|
|
311
|
-
|
|
264
|
+
n.open({
|
|
312
265
|
title: "Something went wrong",
|
|
313
266
|
message: "Error at fetching purchase requests",
|
|
314
267
|
type: "error"
|
|
315
268
|
});
|
|
316
269
|
} finally {
|
|
317
|
-
|
|
270
|
+
i.value = !1;
|
|
318
271
|
}
|
|
319
272
|
}
|
|
320
273
|
function P() {
|
|
321
|
-
switch (
|
|
274
|
+
switch (m) {
|
|
322
275
|
case "receive/request":
|
|
323
276
|
return E();
|
|
324
277
|
case "approval":
|
|
325
|
-
return
|
|
278
|
+
return $();
|
|
326
279
|
}
|
|
327
280
|
}
|
|
328
281
|
function K(k, A) {
|
|
329
|
-
|
|
282
|
+
p.value = {
|
|
330
283
|
startDate: k,
|
|
331
284
|
endDate: A
|
|
332
285
|
}, P();
|
|
333
286
|
}
|
|
334
|
-
|
|
287
|
+
h.watchLocation(async (k) => {
|
|
335
288
|
if (!k) {
|
|
336
|
-
|
|
289
|
+
_.value = [];
|
|
337
290
|
return;
|
|
338
291
|
}
|
|
339
292
|
await P();
|
|
@@ -341,37 +294,37 @@ function zs(d, e) {
|
|
|
341
294
|
const G = M(), ce = M(Math.random().toString());
|
|
342
295
|
async function le(k, A) {
|
|
343
296
|
const H = Math.random().toString();
|
|
344
|
-
ce.value = H, A ?? (A =
|
|
345
|
-
(
|
|
297
|
+
ce.value = H, A ?? (A = l.value.computeFirst(
|
|
298
|
+
(w) => w.purchaseOrderId === k._id ? w : null
|
|
346
299
|
) ?? void 0);
|
|
347
|
-
const
|
|
300
|
+
const r = m === "receive/request" ? h.currentLocation : A == null ? void 0 : A.to, d = {
|
|
348
301
|
poRequest: A,
|
|
349
302
|
purchaseOrder: k,
|
|
350
|
-
transferTo:
|
|
351
|
-
transferToDbName:
|
|
303
|
+
transferTo: r == null ? void 0 : r.name,
|
|
304
|
+
transferToDbName: r == null ? void 0 : r.dbName,
|
|
352
305
|
show: !0,
|
|
353
306
|
canResubmit: !1,
|
|
354
|
-
canApprove:
|
|
355
|
-
"onUpdate:show"(
|
|
356
|
-
G.value.show =
|
|
307
|
+
canApprove: m === "approval",
|
|
308
|
+
"onUpdate:show"(w) {
|
|
309
|
+
G.value.show = w;
|
|
357
310
|
},
|
|
358
|
-
scope:
|
|
311
|
+
scope: m,
|
|
359
312
|
receivedMap: ze(k) ?? {}
|
|
360
313
|
};
|
|
361
|
-
G.value =
|
|
314
|
+
G.value = d;
|
|
362
315
|
}
|
|
363
|
-
async function
|
|
364
|
-
const
|
|
365
|
-
|
|
316
|
+
async function be(k, A, H, r) {
|
|
317
|
+
const d = mt();
|
|
318
|
+
i.value = !0;
|
|
366
319
|
try {
|
|
367
|
-
await
|
|
320
|
+
await d({
|
|
368
321
|
operate: {
|
|
369
322
|
operation: A,
|
|
370
323
|
doc: k,
|
|
371
324
|
options: (
|
|
372
325
|
// auto receive for supplier to warehouse
|
|
373
|
-
(A ===
|
|
374
|
-
A ===
|
|
326
|
+
(A === R.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
327
|
+
A === R.enum.completeReceive) && u.autoReceiveWarehouse ? {
|
|
375
328
|
autoReceive: !0
|
|
376
329
|
} : void 0
|
|
377
330
|
)
|
|
@@ -382,49 +335,49 @@ function zs(d, e) {
|
|
|
382
335
|
action: A,
|
|
383
336
|
payloads: []
|
|
384
337
|
},
|
|
385
|
-
transferTo:
|
|
338
|
+
transferTo: r
|
|
386
339
|
}), await new Promise((j) => setTimeout(j, 1e3));
|
|
387
340
|
const q = me().currentLocationDBName.startsWith("restaurant_");
|
|
388
|
-
A ===
|
|
341
|
+
A === R.enum.confirmDraft && k.effectiveAt && q ? n.open({
|
|
389
342
|
title: "Success",
|
|
390
343
|
message: `${H}. The backdate will be reflected once your POS has received this change.`,
|
|
391
344
|
type: "success"
|
|
392
|
-
}) :
|
|
345
|
+
}) : n.open({
|
|
393
346
|
title: "Success",
|
|
394
347
|
message: H,
|
|
395
348
|
type: "success"
|
|
396
349
|
});
|
|
397
|
-
} catch (
|
|
398
|
-
|
|
350
|
+
} catch (w) {
|
|
351
|
+
n.open({
|
|
399
352
|
title: "Something went wrong",
|
|
400
353
|
message: "Please try again.",
|
|
401
354
|
type: "error"
|
|
402
|
-
}), console.error("Error when submitting PO operation", A, k,
|
|
355
|
+
}), console.error("Error when submitting PO operation", A, k, w);
|
|
403
356
|
} finally {
|
|
404
|
-
|
|
357
|
+
i.value = !1, P();
|
|
405
358
|
}
|
|
406
359
|
}
|
|
407
360
|
async function Fe(k, A, H) {
|
|
408
|
-
const
|
|
409
|
-
if (!
|
|
410
|
-
|
|
361
|
+
const r = ut[A];
|
|
362
|
+
if (!r) {
|
|
363
|
+
n.open({
|
|
411
364
|
title: "Something went wrong",
|
|
412
365
|
message: `Cannot process order: ${Ke(A)}`,
|
|
413
366
|
type: "error"
|
|
414
367
|
});
|
|
415
368
|
return;
|
|
416
369
|
}
|
|
417
|
-
const { successMessage:
|
|
418
|
-
|
|
419
|
-
title:
|
|
420
|
-
message:
|
|
421
|
-
primaryActions:
|
|
370
|
+
const { successMessage: d, ...w } = r;
|
|
371
|
+
a.open({
|
|
372
|
+
title: w.title,
|
|
373
|
+
message: w.message,
|
|
374
|
+
primaryActions: w.primaryActions
|
|
422
375
|
}).onPrimary(() => {
|
|
423
|
-
|
|
376
|
+
be(k, A, d, H);
|
|
424
377
|
});
|
|
425
378
|
}
|
|
426
379
|
async function ue() {
|
|
427
|
-
|
|
380
|
+
a.open({
|
|
428
381
|
title: "Upload Transfer",
|
|
429
382
|
primaryActions: {
|
|
430
383
|
text: "Xilnex transfer note",
|
|
@@ -445,14 +398,14 @@ function zs(d, e) {
|
|
|
445
398
|
});
|
|
446
399
|
}
|
|
447
400
|
return {
|
|
448
|
-
purchaseOrders:
|
|
449
|
-
purchaseRequests:
|
|
401
|
+
purchaseOrders: _,
|
|
402
|
+
purchaseRequests: l,
|
|
450
403
|
updateDateRange: K,
|
|
451
404
|
fetchData: P,
|
|
452
|
-
loading:
|
|
453
|
-
transferDialogProps:
|
|
405
|
+
loading: i,
|
|
406
|
+
transferDialogProps: Oe,
|
|
454
407
|
promptCreateTransferDialog: O,
|
|
455
|
-
promptUpdateTransferDialog:
|
|
408
|
+
promptUpdateTransferDialog: N,
|
|
456
409
|
transferDetailsProps: G,
|
|
457
410
|
promptShowTransferDetails: le,
|
|
458
411
|
submitAction: Fe,
|
|
@@ -460,26 +413,26 @@ function zs(d, e) {
|
|
|
460
413
|
promptUploadTransferDialog: ue
|
|
461
414
|
};
|
|
462
415
|
}
|
|
463
|
-
function Bt(
|
|
416
|
+
function Bt(m, e) {
|
|
464
417
|
return e.reduce(
|
|
465
|
-
(
|
|
466
|
-
const t = u.received.find((
|
|
467
|
-
return t && (
|
|
418
|
+
(h, u) => {
|
|
419
|
+
const t = u.received.find((c) => c.sku._id === m._id);
|
|
420
|
+
return t && (h = st(h, t.amount)), h;
|
|
468
421
|
},
|
|
469
|
-
|
|
422
|
+
kt.toPrecision(nt(0), m.unit.precision)
|
|
470
423
|
);
|
|
471
424
|
}
|
|
472
|
-
function Vt(
|
|
473
|
-
const { po: e, currentLocation:
|
|
474
|
-
name:
|
|
475
|
-
registrationNumber:
|
|
476
|
-
line1:
|
|
477
|
-
line2:
|
|
478
|
-
postcode:
|
|
479
|
-
city:
|
|
480
|
-
state:
|
|
481
|
-
country:
|
|
482
|
-
},
|
|
425
|
+
function Vt(m) {
|
|
426
|
+
const { po: e, currentLocation: a, business: h, fulfilling: u, por: t } = m, { name: c, address: i, regNo: n } = a.doc.profile, y = {
|
|
427
|
+
name: c,
|
|
428
|
+
registrationNumber: n,
|
|
429
|
+
line1: i == null ? void 0 : i.line1,
|
|
430
|
+
line2: i == null ? void 0 : i.line2,
|
|
431
|
+
postcode: i == null ? void 0 : i.postcode,
|
|
432
|
+
city: i == null ? void 0 : i.city,
|
|
433
|
+
state: i == null ? void 0 : i.state,
|
|
434
|
+
country: i == null ? void 0 : i.country
|
|
435
|
+
}, _ = {
|
|
483
436
|
name: e.supplier.name,
|
|
484
437
|
phoneNumber: e.supplier.phoneNumber,
|
|
485
438
|
registrationNumber: e.supplier.registrationNumber,
|
|
@@ -489,26 +442,26 @@ function Vt(d) {
|
|
|
489
442
|
city: e.supplier.address.city,
|
|
490
443
|
state: e.supplier.address.state,
|
|
491
444
|
country: e.supplier.address.country
|
|
492
|
-
},
|
|
493
|
-
const { sku: P, measurement: K } =
|
|
494
|
-
Bt(
|
|
445
|
+
}, p = e.items.map(($) => {
|
|
446
|
+
const { sku: P, measurement: K } = $, G = fe(
|
|
447
|
+
Bt($.sku, e.deliveryOrder || []),
|
|
495
448
|
!1
|
|
496
449
|
);
|
|
497
450
|
return {
|
|
498
451
|
code: P.code,
|
|
499
452
|
description: P.name,
|
|
500
|
-
quantity: fe(
|
|
453
|
+
quantity: fe($.quantity, !1),
|
|
501
454
|
unit: (K == null ? void 0 : K.abbrev) || P.unit.abbrev,
|
|
502
455
|
received: G,
|
|
503
|
-
cost:
|
|
504
|
-
value:
|
|
456
|
+
cost: $.totalCost ? `${$.totalCost.currency} ${_t.toFormatString({
|
|
457
|
+
value: $.totalCost
|
|
505
458
|
})}` : void 0
|
|
506
459
|
};
|
|
507
|
-
}),
|
|
508
|
-
createdAt:
|
|
509
|
-
ref:
|
|
510
|
-
remark:
|
|
511
|
-
items:
|
|
460
|
+
}), f = e.deliveryOrder.map(($) => ({
|
|
461
|
+
createdAt: at(new Date($.createdAt)),
|
|
462
|
+
ref: $.deliveryOrderNumber,
|
|
463
|
+
remark: $.remark || "",
|
|
464
|
+
items: $.received.map((P) => {
|
|
512
465
|
var K;
|
|
513
466
|
return {
|
|
514
467
|
code: P.sku.code,
|
|
@@ -517,78 +470,78 @@ function Vt(d) {
|
|
|
517
470
|
unit: ((K = P.measurement) == null ? void 0 : K.abbrev) || P.sku.unit.abbrev
|
|
518
471
|
};
|
|
519
472
|
})
|
|
520
|
-
})),
|
|
473
|
+
})), l = [
|
|
521
474
|
// Production
|
|
522
475
|
"67ca5d2c80bd0e001c5bf5bc",
|
|
523
476
|
// Dev
|
|
524
477
|
"6880b36a3054c5001db19218"
|
|
525
478
|
];
|
|
526
|
-
let
|
|
527
|
-
if (e.supplier.internal ? (
|
|
528
|
-
const
|
|
529
|
-
|
|
479
|
+
let s = "Inventory Receive Note";
|
|
480
|
+
if (e.supplier.internal ? (s = "Inventory Transfer Note", l.includes((h == null ? void 0 : h._id) || "") && (s = "Stock Request")) : s = "Purchase Order", t) {
|
|
481
|
+
const $ = t.from.dbName;
|
|
482
|
+
a.dbName === $ || (s = "Inventory Receive Note");
|
|
530
483
|
}
|
|
531
484
|
const O = {
|
|
532
|
-
title:
|
|
533
|
-
businessName:
|
|
534
|
-
logo:
|
|
485
|
+
title: s,
|
|
486
|
+
businessName: h == null ? void 0 : h.name,
|
|
487
|
+
logo: h == null ? void 0 : h.thumbnail,
|
|
535
488
|
orderNumber: e.seqNumber.toString(),
|
|
536
|
-
createdAt:
|
|
489
|
+
createdAt: qe(e._id),
|
|
537
490
|
ref: e.ref || "",
|
|
538
491
|
remark: e.remark || "",
|
|
539
|
-
buyer:
|
|
540
|
-
supplier:
|
|
541
|
-
items:
|
|
492
|
+
buyer: y,
|
|
493
|
+
supplier: _,
|
|
494
|
+
items: p,
|
|
542
495
|
status: e.status,
|
|
543
|
-
deliveryOrders:
|
|
544
|
-
},
|
|
545
|
-
|
|
496
|
+
deliveryOrders: f
|
|
497
|
+
}, N = new URL(window.location.href), E = u && (e.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
|
|
498
|
+
N.pathname = N.hostname.includes("portal.feedme") ? `/inventory/${E}` : `/${E}`, N.searchParams.append("data", JSON.stringify(O)), window.open(N.href, "_blank", "noreferrer");
|
|
546
499
|
}
|
|
547
|
-
const
|
|
500
|
+
const Se = {
|
|
548
501
|
submitRequest: {
|
|
549
502
|
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
550
503
|
color: "text-fm-color-typo-primary",
|
|
551
|
-
value:
|
|
504
|
+
value: R.enum.submitRequest
|
|
552
505
|
},
|
|
553
506
|
confirmDraft: {
|
|
554
507
|
translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
|
|
555
508
|
color: "text-fm-color-typo-primary",
|
|
556
|
-
value:
|
|
509
|
+
value: R.enum.confirmDraft
|
|
557
510
|
},
|
|
558
511
|
cancelDraft: {
|
|
559
512
|
translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
|
|
560
513
|
color: "text-fm-color-typo-error",
|
|
561
|
-
value:
|
|
514
|
+
value: R.enum.cancelDraft
|
|
562
515
|
},
|
|
563
516
|
approveRequest: {
|
|
564
517
|
translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
|
|
565
518
|
color: "text-fm-color-typo-primary",
|
|
566
|
-
value:
|
|
519
|
+
value: R.enum.approveRequest
|
|
567
520
|
},
|
|
568
521
|
rejectRequest: {
|
|
569
522
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
|
|
570
523
|
color: "text-fm-color-typo-error",
|
|
571
|
-
value:
|
|
524
|
+
value: R.enum.rejectRequest
|
|
572
525
|
},
|
|
573
526
|
processRequest: {
|
|
574
527
|
translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
|
|
575
528
|
color: "text-fm-color-typo-primary",
|
|
576
|
-
value:
|
|
529
|
+
value: R.enum.processRequest
|
|
577
530
|
},
|
|
578
531
|
receiveStock: {
|
|
579
532
|
translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
|
|
580
533
|
color: "text-fm-color-typo-primary",
|
|
581
|
-
value:
|
|
534
|
+
value: R.enum.receiveStock
|
|
582
535
|
},
|
|
583
536
|
completeReceive: {
|
|
584
537
|
translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
|
|
585
538
|
color: "text-fm-color-typo-primary",
|
|
586
|
-
value:
|
|
539
|
+
value: R.enum.completeReceive
|
|
587
540
|
},
|
|
588
541
|
closeRequest: {
|
|
589
542
|
translationKey: "inventory.transfer.receiveRequest.actions.closeRequest",
|
|
590
543
|
color: "system-error-300",
|
|
591
|
-
value:
|
|
544
|
+
value: R.enum.closeRequest
|
|
592
545
|
},
|
|
593
546
|
approveDraft: {
|
|
594
547
|
translationKey: "",
|
|
@@ -603,73 +556,73 @@ const we = {
|
|
|
603
556
|
returnStock: {
|
|
604
557
|
translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
|
|
605
558
|
color: "text-fm-color-typo-primary",
|
|
606
|
-
value:
|
|
559
|
+
value: R.enum.returnStock
|
|
607
560
|
}
|
|
608
561
|
};
|
|
609
|
-
function Hs(
|
|
610
|
-
const
|
|
611
|
-
function
|
|
612
|
-
switch (
|
|
562
|
+
function Hs(m, e) {
|
|
563
|
+
const a = me(), h = Ae(), u = Pe(), { t } = ct();
|
|
564
|
+
function c(f) {
|
|
565
|
+
switch (f.status) {
|
|
613
566
|
case "DRAFT":
|
|
614
567
|
return [
|
|
615
|
-
ne[
|
|
616
|
-
ne[
|
|
617
|
-
|
|
618
|
-
|
|
568
|
+
ne[J.Update],
|
|
569
|
+
ne[J.Details],
|
|
570
|
+
f.supplier.internal === "restaurant" || f.supplier.internal === "warehouse" ? Se[R.enum.submitRequest] : Se[R.enum.confirmDraft],
|
|
571
|
+
Se[R.enum.cancelDraft]
|
|
619
572
|
];
|
|
620
573
|
case "RECEIVING":
|
|
621
574
|
return [
|
|
622
|
-
|
|
623
|
-
ne[
|
|
624
|
-
ne[
|
|
575
|
+
Se[R.enum.completeReceive],
|
|
576
|
+
ne[J.Details],
|
|
577
|
+
ne[J.Print]
|
|
625
578
|
];
|
|
626
579
|
case "REQUESTING":
|
|
627
|
-
return
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
ne[
|
|
580
|
+
return m === "receive/request" ? [ne[J.Details], ne[J.Print]] : [
|
|
581
|
+
Se[R.enum.approveRequest],
|
|
582
|
+
Se[R.enum.rejectRequest],
|
|
583
|
+
ne[J.Details]
|
|
631
584
|
// DefaultRowActions[RowActionEnum.Print]
|
|
632
585
|
];
|
|
633
586
|
case "PROCESSING":
|
|
634
|
-
return [ne[
|
|
587
|
+
return [ne[J.Details], ne[J.Print]];
|
|
635
588
|
case "COMPLETE":
|
|
636
589
|
case "CANCEL":
|
|
637
590
|
default:
|
|
638
|
-
return [ne[
|
|
591
|
+
return [ne[J.Details], ne[J.Print]];
|
|
639
592
|
}
|
|
640
593
|
}
|
|
641
|
-
function
|
|
642
|
-
return Object.values(
|
|
594
|
+
function i(f) {
|
|
595
|
+
return Object.values(R.enum).includes(f);
|
|
643
596
|
}
|
|
644
|
-
async function
|
|
645
|
-
var O,
|
|
646
|
-
const
|
|
647
|
-
if (
|
|
648
|
-
const G = (
|
|
649
|
-
((O =
|
|
650
|
-
po:
|
|
597
|
+
async function n(f, l, s) {
|
|
598
|
+
var O, N, E, $, P, K;
|
|
599
|
+
const b = rt(l);
|
|
600
|
+
if (f === J.Print) {
|
|
601
|
+
const G = (s == null ? void 0 : s.toInventoryLocation) ?? a.currentLocation;
|
|
602
|
+
((O = s == null ? void 0 : s.netSuite) != null && O.refNo || (N = b.netSuite) != null && N.refNo) && (b.ref = [((E = s == null ? void 0 : s.netSuite) == null ? void 0 : E.refNo) || (($ = b.netSuite) == null ? void 0 : $.refNo)].filter((ce) => ce).join(" ")), Vt({
|
|
603
|
+
po: b,
|
|
651
604
|
currentLocation: G,
|
|
652
605
|
business: u.currentBusiness.value,
|
|
653
|
-
fulfilling:
|
|
654
|
-
por:
|
|
606
|
+
fulfilling: m === "approval",
|
|
607
|
+
por: s
|
|
655
608
|
});
|
|
656
609
|
return;
|
|
657
610
|
}
|
|
658
|
-
if (
|
|
659
|
-
e.promptShowTransferDetails(
|
|
611
|
+
if (f === J.Details) {
|
|
612
|
+
e.promptShowTransferDetails(b, s);
|
|
660
613
|
return;
|
|
661
614
|
}
|
|
662
|
-
if (
|
|
663
|
-
(P = e.promptUpdateTransferDialog) == null || P.call(e,
|
|
615
|
+
if (f === J.Update) {
|
|
616
|
+
(P = e.promptUpdateTransferDialog) == null || P.call(e, b);
|
|
664
617
|
return;
|
|
665
618
|
}
|
|
666
|
-
if (
|
|
667
|
-
e.submitAction(
|
|
619
|
+
if (i(f)) {
|
|
620
|
+
e.submitAction(l, f, (K = s == null ? void 0 : s.to) == null ? void 0 : K.dbName);
|
|
668
621
|
return;
|
|
669
622
|
}
|
|
670
623
|
}
|
|
671
|
-
function
|
|
672
|
-
const
|
|
624
|
+
function y() {
|
|
625
|
+
const f = [
|
|
673
626
|
{
|
|
674
627
|
accessorKey: "seqNumber",
|
|
675
628
|
header: () => t("inventory.transfer.table.seqNo"),
|
|
@@ -680,8 +633,8 @@ function Hs(d, e) {
|
|
|
680
633
|
{
|
|
681
634
|
accessorKey: "_id",
|
|
682
635
|
header: () => t("inventory.transfer.table.createdAt"),
|
|
683
|
-
cell(
|
|
684
|
-
return
|
|
636
|
+
cell(l) {
|
|
637
|
+
return qe(`${l.getValue()}`);
|
|
685
638
|
},
|
|
686
639
|
enableSorting: !0
|
|
687
640
|
},
|
|
@@ -694,6 +647,19 @@ function Hs(d, e) {
|
|
|
694
647
|
{
|
|
695
648
|
accessorKey: "items.length",
|
|
696
649
|
header: () => t("inventory.transfer.table.noOfItems"),
|
|
650
|
+
cell: (l) => {
|
|
651
|
+
const s = l.row.original.version || "1", b = l.getValue();
|
|
652
|
+
return T("div", { class: "flex items-center gap-2" }, [
|
|
653
|
+
b,
|
|
654
|
+
s !== "1" ? T(
|
|
655
|
+
"div",
|
|
656
|
+
{
|
|
657
|
+
class: ["fm-status-badge", "fm-status-badge-draft"].join(" ")
|
|
658
|
+
},
|
|
659
|
+
`v${s}`
|
|
660
|
+
) : null
|
|
661
|
+
]);
|
|
662
|
+
},
|
|
697
663
|
enableSorting: !1,
|
|
698
664
|
meta: {
|
|
699
665
|
width: "10rem"
|
|
@@ -708,22 +674,22 @@ function Hs(d, e) {
|
|
|
708
674
|
{
|
|
709
675
|
accessorKey: "status",
|
|
710
676
|
header: () => t("inventory.transfer.table.status"),
|
|
711
|
-
cell(
|
|
712
|
-
const
|
|
713
|
-
`inventory.transfer.status.${
|
|
714
|
-
),
|
|
715
|
-
return
|
|
677
|
+
cell(l) {
|
|
678
|
+
const s = l.getValue(), b = ze(l.row.original), { partial: O, over: N } = dt(b), E = t(
|
|
679
|
+
`inventory.transfer.status.${ft(s ?? "", O, N)}`
|
|
680
|
+
), $ = `${s ?? ""}`.toLocaleLowerCase("en-us");
|
|
681
|
+
return T(
|
|
716
682
|
"div",
|
|
717
683
|
{
|
|
718
684
|
class: "flex"
|
|
719
685
|
},
|
|
720
|
-
|
|
686
|
+
T(
|
|
721
687
|
"div",
|
|
722
688
|
{
|
|
723
689
|
class: [
|
|
724
690
|
"fm-status-badge",
|
|
725
|
-
`fm-status-badge-${
|
|
726
|
-
|
|
691
|
+
`fm-status-badge-${$}`,
|
|
692
|
+
N && "fm-status-badge-error"
|
|
727
693
|
].filter(Boolean).join(" ")
|
|
728
694
|
},
|
|
729
695
|
`${E}`
|
|
@@ -735,9 +701,9 @@ function Hs(d, e) {
|
|
|
735
701
|
},
|
|
736
702
|
{
|
|
737
703
|
id: "action",
|
|
738
|
-
cell(
|
|
739
|
-
const
|
|
740
|
-
return
|
|
704
|
+
cell(l) {
|
|
705
|
+
const s = l.row.original, b = c(s);
|
|
706
|
+
return Ze(b, (O) => n(O, s));
|
|
741
707
|
},
|
|
742
708
|
enableSorting: !1,
|
|
743
709
|
size: 40,
|
|
@@ -747,15 +713,15 @@ function Hs(d, e) {
|
|
|
747
713
|
}
|
|
748
714
|
}
|
|
749
715
|
];
|
|
750
|
-
if (
|
|
751
|
-
const
|
|
716
|
+
if (h.isEnabled) {
|
|
717
|
+
const l = [
|
|
752
718
|
{
|
|
753
719
|
id: "netsuiteTransferOrder",
|
|
754
720
|
header: () => "NetSuite Order (ID)",
|
|
755
|
-
cell(
|
|
721
|
+
cell(s) {
|
|
756
722
|
var O;
|
|
757
|
-
const
|
|
758
|
-
return (O =
|
|
723
|
+
const b = s.row.original;
|
|
724
|
+
return (O = b.netSuite) != null && O.id ? `${b.netSuite.refNo} (${b.netSuite.id})` : "N/A";
|
|
759
725
|
},
|
|
760
726
|
enableSorting: !1,
|
|
761
727
|
size: 200,
|
|
@@ -767,9 +733,9 @@ function Hs(d, e) {
|
|
|
767
733
|
{
|
|
768
734
|
id: "netsuiteTransactionNumber",
|
|
769
735
|
header: () => "NetSuite Transaction No.",
|
|
770
|
-
cell(
|
|
771
|
-
var O,
|
|
772
|
-
return ((
|
|
736
|
+
cell(s) {
|
|
737
|
+
var O, N;
|
|
738
|
+
return ((N = (O = s.row.original.netSuite) == null ? void 0 : O.additionalInfo) == null ? void 0 : N.transactionnumber) ?? "N/A";
|
|
773
739
|
},
|
|
774
740
|
enableSorting: !1,
|
|
775
741
|
size: 200,
|
|
@@ -779,12 +745,12 @@ function Hs(d, e) {
|
|
|
779
745
|
}
|
|
780
746
|
}
|
|
781
747
|
];
|
|
782
|
-
|
|
748
|
+
f.splice(f.length - 1, 0, ...l);
|
|
783
749
|
}
|
|
784
|
-
return
|
|
750
|
+
return f;
|
|
785
751
|
}
|
|
786
|
-
function
|
|
787
|
-
const
|
|
752
|
+
function _() {
|
|
753
|
+
const f = [
|
|
788
754
|
{
|
|
789
755
|
accessorKey: "purchaseOrder.seqNumber",
|
|
790
756
|
header: () => t("inventory.transfer.table.seqNo"),
|
|
@@ -795,8 +761,8 @@ function Hs(d, e) {
|
|
|
795
761
|
{
|
|
796
762
|
accessorKey: "purchaseOrder._id",
|
|
797
763
|
header: () => t("inventory.transfer.table.createdAt"),
|
|
798
|
-
cell(
|
|
799
|
-
return
|
|
764
|
+
cell(l) {
|
|
765
|
+
return qe(`${l.getValue()}`);
|
|
800
766
|
},
|
|
801
767
|
enableSorting: !0
|
|
802
768
|
},
|
|
@@ -820,20 +786,20 @@ function Hs(d, e) {
|
|
|
820
786
|
{
|
|
821
787
|
accessorKey: "purchaseOrder.status",
|
|
822
788
|
header: () => t("inventory.transfer.table.status"),
|
|
823
|
-
cell(
|
|
824
|
-
var
|
|
825
|
-
const
|
|
826
|
-
return
|
|
789
|
+
cell(l) {
|
|
790
|
+
var $, P;
|
|
791
|
+
const s = l.row.original, b = l.getValue(), O = b === "RECEIVING" && (((P = ($ = s.purchaseOrder) == null ? void 0 : $.deliveryOrder) == null ? void 0 : P.length) ?? 0) > 0, N = t(O ? "inventory.transfer.status.PARTIAL_RECEIVED" : `inventory.transfer.status.${b ?? ""}`), E = O ? "partially_received" : `${b ?? ""}`.toLocaleLowerCase("en-us");
|
|
792
|
+
return T(
|
|
827
793
|
"div",
|
|
828
794
|
{
|
|
829
795
|
class: "flex"
|
|
830
796
|
},
|
|
831
|
-
|
|
797
|
+
T(
|
|
832
798
|
"div",
|
|
833
799
|
{
|
|
834
800
|
class: `fm-status-badge fm-status-badge-${E}`
|
|
835
801
|
},
|
|
836
|
-
|
|
802
|
+
N
|
|
837
803
|
)
|
|
838
804
|
);
|
|
839
805
|
},
|
|
@@ -841,14 +807,14 @@ function Hs(d, e) {
|
|
|
841
807
|
},
|
|
842
808
|
{
|
|
843
809
|
id: "action",
|
|
844
|
-
cell(
|
|
845
|
-
const
|
|
846
|
-
...
|
|
810
|
+
cell(l) {
|
|
811
|
+
const s = l.row.original, O = (s.purchaseOrder ? c(s.purchaseOrder) : []).map((N) => N.value === J.Print ? {
|
|
812
|
+
...N,
|
|
847
813
|
translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
|
|
848
|
-
} :
|
|
849
|
-
return
|
|
814
|
+
} : N);
|
|
815
|
+
return Ze(
|
|
850
816
|
O,
|
|
851
|
-
(
|
|
817
|
+
(N) => s.purchaseOrder ? n(N, s.purchaseOrder, s) : void 0
|
|
852
818
|
);
|
|
853
819
|
},
|
|
854
820
|
enableSorting: !1,
|
|
@@ -859,15 +825,15 @@ function Hs(d, e) {
|
|
|
859
825
|
}
|
|
860
826
|
}
|
|
861
827
|
];
|
|
862
|
-
if (
|
|
863
|
-
const
|
|
828
|
+
if (h.isEnabled) {
|
|
829
|
+
const l = [
|
|
864
830
|
{
|
|
865
831
|
id: "netsuiteTransferOrder",
|
|
866
832
|
header: () => "NetSuite Order (ID)",
|
|
867
|
-
cell(
|
|
833
|
+
cell(s) {
|
|
868
834
|
var O;
|
|
869
|
-
const
|
|
870
|
-
return (O =
|
|
835
|
+
const b = s.row.original;
|
|
836
|
+
return (O = b.netSuite) != null && O.id ? `${b.netSuite.refNo} (${b.netSuite.id})` : "N/A";
|
|
871
837
|
},
|
|
872
838
|
enableSorting: !1,
|
|
873
839
|
size: 200,
|
|
@@ -879,9 +845,9 @@ function Hs(d, e) {
|
|
|
879
845
|
{
|
|
880
846
|
id: "netsuiteTransactionNumber",
|
|
881
847
|
header: () => "NetSuite Transaction No.",
|
|
882
|
-
cell(
|
|
883
|
-
var O,
|
|
884
|
-
return ((
|
|
848
|
+
cell(s) {
|
|
849
|
+
var O, N;
|
|
850
|
+
return ((N = (O = s.row.original.netSuite) == null ? void 0 : O.additionalInfo) == null ? void 0 : N.transactionnumber) ?? "N/A";
|
|
885
851
|
},
|
|
886
852
|
enableSorting: !1,
|
|
887
853
|
size: 200,
|
|
@@ -891,148 +857,148 @@ function Hs(d, e) {
|
|
|
891
857
|
}
|
|
892
858
|
}
|
|
893
859
|
];
|
|
894
|
-
|
|
860
|
+
f.splice(f.length - 2, 0, ...l);
|
|
895
861
|
}
|
|
896
|
-
return
|
|
862
|
+
return f;
|
|
897
863
|
}
|
|
898
864
|
return {
|
|
899
|
-
columnDefs:
|
|
865
|
+
columnDefs: Z(() => m === "receive/request" ? y() : _())
|
|
900
866
|
};
|
|
901
867
|
}
|
|
902
|
-
const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Mt = { class: "flex flex-col gap-8" }, Kt = { class: "flex w-full justify-end gap-16" }, jt = /* @__PURE__ */
|
|
868
|
+
const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Mt = { class: "flex flex-col gap-8" }, Kt = { class: "flex w-full justify-end gap-16" }, jt = /* @__PURE__ */ he({
|
|
903
869
|
__name: "FulfillmentForm",
|
|
904
870
|
props: {
|
|
905
871
|
purchaseOrder: {},
|
|
906
872
|
confirm: { type: Function }
|
|
907
873
|
},
|
|
908
874
|
emits: ["update:show"],
|
|
909
|
-
setup(
|
|
910
|
-
const
|
|
875
|
+
setup(m, { emit: e }) {
|
|
876
|
+
const a = m, h = Rt({
|
|
911
877
|
id: "",
|
|
912
878
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
913
879
|
items: []
|
|
914
880
|
}), u = M(), t = e;
|
|
915
881
|
lt(() => {
|
|
916
|
-
|
|
917
|
-
id:
|
|
918
|
-
sku:
|
|
919
|
-
measurement:
|
|
920
|
-
amount:
|
|
882
|
+
a.purchaseOrder && (h.items = a.purchaseOrder.items.map((i) => ({
|
|
883
|
+
id: i.id,
|
|
884
|
+
sku: i.sku,
|
|
885
|
+
measurement: i.measurement,
|
|
886
|
+
amount: i.quantity ?? { amount: 1, precision: 0 }
|
|
921
887
|
})));
|
|
922
888
|
});
|
|
923
|
-
const
|
|
924
|
-
return (
|
|
925
|
-
const
|
|
926
|
-
return
|
|
889
|
+
const c = Z(() => h.items.length <= 10);
|
|
890
|
+
return (i, n) => {
|
|
891
|
+
const y = z("FmTable"), _ = z("FmButton"), p = z("FmForm");
|
|
892
|
+
return g(), oe(p, {
|
|
927
893
|
ref_key: "formRef",
|
|
928
894
|
ref: u,
|
|
929
895
|
class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
|
|
930
896
|
onValidationFailed: console.log,
|
|
931
|
-
onValidationSuccess:
|
|
897
|
+
onValidationSuccess: n[1] || (n[1] = () => a.confirm(h))
|
|
932
898
|
}, {
|
|
933
|
-
default:
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
I(
|
|
899
|
+
default: ae(() => [
|
|
900
|
+
n[2] || (n[2] = o("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
|
|
901
|
+
o("div", Ut, [
|
|
902
|
+
o("div", Mt, [
|
|
903
|
+
I(y, {
|
|
938
904
|
"column-defs": [
|
|
939
905
|
{
|
|
940
906
|
header: "Code",
|
|
941
|
-
cell: (
|
|
942
|
-
const
|
|
943
|
-
return
|
|
907
|
+
cell: (f) => {
|
|
908
|
+
const l = a.purchaseOrder.items.find((s) => s.id === f.row.original.id || s.sku._id === f.row.original.sku._id);
|
|
909
|
+
return T(
|
|
944
910
|
S(et).FmTooltip,
|
|
945
911
|
{
|
|
946
|
-
content:
|
|
912
|
+
content: l.code,
|
|
947
913
|
placement: "top",
|
|
948
914
|
variant: "plain",
|
|
949
915
|
zIndex: 50
|
|
950
916
|
},
|
|
951
|
-
|
|
917
|
+
T(
|
|
952
918
|
"span",
|
|
953
919
|
{
|
|
954
920
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
955
921
|
},
|
|
956
|
-
|
|
922
|
+
l.code
|
|
957
923
|
)
|
|
958
924
|
);
|
|
959
925
|
}
|
|
960
926
|
},
|
|
961
927
|
{
|
|
962
928
|
header: "Name",
|
|
963
|
-
cell: (
|
|
964
|
-
const
|
|
965
|
-
return
|
|
929
|
+
cell: (f) => {
|
|
930
|
+
const l = a.purchaseOrder.items.find((s) => s.id === f.row.original.id || s.sku._id === f.row.original.sku._id);
|
|
931
|
+
return T(
|
|
966
932
|
S(et).FmTooltip,
|
|
967
933
|
{
|
|
968
|
-
content:
|
|
934
|
+
content: l.name,
|
|
969
935
|
placement: "top",
|
|
970
936
|
variant: "plain",
|
|
971
937
|
zIndex: 50
|
|
972
938
|
},
|
|
973
|
-
|
|
939
|
+
T(
|
|
974
940
|
"span",
|
|
975
941
|
{
|
|
976
942
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
977
943
|
},
|
|
978
|
-
|
|
944
|
+
l.name
|
|
979
945
|
)
|
|
980
946
|
);
|
|
981
947
|
}
|
|
982
948
|
},
|
|
983
949
|
{
|
|
984
950
|
header: "Amount",
|
|
985
|
-
cell: (
|
|
986
|
-
const
|
|
951
|
+
cell: (f) => {
|
|
952
|
+
const l = f.row.original, s = a.purchaseOrder.items.find((O) => O.id === l.id || O.sku._id === l.sku._id), b = l.amount ?? {
|
|
987
953
|
amount: 1,
|
|
988
954
|
precision: 0
|
|
989
955
|
};
|
|
990
|
-
return
|
|
956
|
+
return T(Pt, {
|
|
991
957
|
style: {
|
|
992
958
|
flex: "1 1 0%"
|
|
993
959
|
},
|
|
994
960
|
modelValue: {
|
|
995
|
-
amount:
|
|
996
|
-
measurement:
|
|
961
|
+
amount: b,
|
|
962
|
+
measurement: l.measurement ?? null
|
|
997
963
|
},
|
|
998
|
-
key:
|
|
999
|
-
unit:
|
|
964
|
+
key: l.id ?? l.sku._id,
|
|
965
|
+
unit: l.sku.unit,
|
|
1000
966
|
"onUpdate:modelValue": (O) => {
|
|
1001
967
|
if (!O) return;
|
|
1002
|
-
const
|
|
1003
|
-
|
|
968
|
+
const N = h.items.find((E) => E.id === l.id || E.sku._id === l.sku._id);
|
|
969
|
+
N && (N.amount = O.amount);
|
|
1004
970
|
},
|
|
1005
971
|
disableUnit: !0,
|
|
1006
972
|
rules: [
|
|
1007
|
-
S(
|
|
973
|
+
S(Ct)(
|
|
1008
974
|
+S(fe)({ amount: 0, precision: 0 })
|
|
1009
975
|
),
|
|
1010
|
-
S(
|
|
976
|
+
S(It)(+S(fe)(s.quantity))
|
|
1011
977
|
],
|
|
1012
978
|
applyDefaultRules: !0
|
|
1013
979
|
});
|
|
1014
980
|
}
|
|
1015
981
|
}
|
|
1016
982
|
],
|
|
1017
|
-
"row-data":
|
|
1018
|
-
"hide-footer":
|
|
983
|
+
"row-data": h.items,
|
|
984
|
+
"hide-footer": c.value
|
|
1019
985
|
}, null, 8, ["column-defs", "row-data", "hide-footer"])
|
|
1020
986
|
])
|
|
1021
987
|
]),
|
|
1022
|
-
|
|
1023
|
-
I(
|
|
988
|
+
o("div", Kt, [
|
|
989
|
+
I(_, {
|
|
1024
990
|
class: "px-16",
|
|
1025
991
|
label: "Confirm",
|
|
1026
992
|
size: "md",
|
|
1027
993
|
variant: "primary",
|
|
1028
994
|
type: "submit"
|
|
1029
995
|
}),
|
|
1030
|
-
I(
|
|
996
|
+
I(_, {
|
|
1031
997
|
class: "px-16",
|
|
1032
998
|
label: "Cancel",
|
|
1033
999
|
size: "md",
|
|
1034
1000
|
variant: "secondary",
|
|
1035
|
-
onClick:
|
|
1001
|
+
onClick: n[0] || (n[0] = () => t("update:show", !1))
|
|
1036
1002
|
})
|
|
1037
1003
|
])
|
|
1038
1004
|
]),
|
|
@@ -1106,27 +1072,27 @@ const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1106
1072
|
}
|
|
1107
1073
|
};
|
|
1108
1074
|
function zt() {
|
|
1109
|
-
const
|
|
1075
|
+
const m = $e();
|
|
1110
1076
|
return {
|
|
1111
1077
|
ableToMarkReceived(e) {
|
|
1112
1078
|
if (!e || e.status !== ie.enum.RECEIVING)
|
|
1113
1079
|
return !1;
|
|
1114
|
-
const
|
|
1115
|
-
return `${e.supplier.internal}_${e.supplier._id}` !==
|
|
1080
|
+
const h = me().currentLocationDBName;
|
|
1081
|
+
return `${e.supplier.internal}_${e.supplier._id}` !== h;
|
|
1116
1082
|
},
|
|
1117
1083
|
ableToMarkApproved(e) {
|
|
1118
1084
|
return !(!e || (e == null ? void 0 : e.status) !== ie.enum.REQUESTING);
|
|
1119
1085
|
},
|
|
1120
|
-
ableToCreateFulfillment(e,
|
|
1121
|
-
var t,
|
|
1122
|
-
if (!
|
|
1086
|
+
ableToCreateFulfillment(e, a) {
|
|
1087
|
+
var t, c;
|
|
1088
|
+
if (!m.acceptRequireFulfillment || !e || !a || e.status !== ie.enum.PROCESSING || !a.processedAt)
|
|
1123
1089
|
return !1;
|
|
1124
|
-
const
|
|
1125
|
-
return !(
|
|
1090
|
+
const h = (t = a == null ? void 0 : a.from) == null ? void 0 : t.dbName, u = (c = a == null ? void 0 : a.to) == null ? void 0 : c.dbName;
|
|
1091
|
+
return !(h.startsWith("restaurant_") && u.startsWith("restaurant_"));
|
|
1126
1092
|
}
|
|
1127
1093
|
};
|
|
1128
1094
|
}
|
|
1129
|
-
const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */
|
|
1095
|
+
const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
|
|
1130
1096
|
__name: "NetSuiteSync",
|
|
1131
1097
|
props: {
|
|
1132
1098
|
poRequest: {},
|
|
@@ -1134,22 +1100,22 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1134
1100
|
isTransferBetweenOutlets: { type: Boolean },
|
|
1135
1101
|
scope: {}
|
|
1136
1102
|
},
|
|
1137
|
-
setup(
|
|
1138
|
-
const e =
|
|
1139
|
-
|
|
1140
|
-
var
|
|
1141
|
-
let
|
|
1142
|
-
|
|
1143
|
-
const
|
|
1144
|
-
return
|
|
1103
|
+
setup(m) {
|
|
1104
|
+
const e = m, a = Ae(), h = Ce(), u = je(), t = M(!1);
|
|
1105
|
+
Z(() => {
|
|
1106
|
+
var _, p, f, l;
|
|
1107
|
+
let i = !0;
|
|
1108
|
+
a.isEnabled || (i = !1);
|
|
1109
|
+
const n = e.purchaseOrder, y = e.poRequest;
|
|
1110
|
+
return n && ((_ = n == null ? void 0 : n.supplier) != null && _.internal ? (!y && n.status == ie.enum.DRAFT && (i = !1), y && !((p = y == null ? void 0 : y.netSuite) != null && p.id) && (i = !1), e.isTransferBetweenOutlets && (i = !1)) : ((n == null ? void 0 : n.status) !== ie.enum.REQUESTING && n.supplier.internal && (i = !1), !y && !((f = n == null ? void 0 : n.netSuite) != null && f.id) && (i = !1), !y && ((l = n == null ? void 0 : n.netSuite) != null && l.id) && (n == null ? void 0 : n.status) == ie.enum.REQUESTING && (i = !1))), i;
|
|
1145
1111
|
});
|
|
1146
|
-
async function
|
|
1112
|
+
async function c() {
|
|
1147
1113
|
t.value || u.open({
|
|
1148
1114
|
title: "Sync with NetSuite",
|
|
1149
|
-
contentComponent:
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1115
|
+
contentComponent: T("div", [
|
|
1116
|
+
T("p", "Are you sure you want to sync now?"),
|
|
1117
|
+
T("br"),
|
|
1118
|
+
T(
|
|
1153
1119
|
"p",
|
|
1154
1120
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1155
1121
|
"Please wait a moment before syncing manually to avoid unnecessary actions."
|
|
@@ -1162,20 +1128,20 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1162
1128
|
},
|
|
1163
1129
|
secondaryActions: { text: "Not now", close: !0 }
|
|
1164
1130
|
}).onPrimary(async () => {
|
|
1165
|
-
var
|
|
1131
|
+
var i, n, y;
|
|
1166
1132
|
try {
|
|
1167
1133
|
t.value = !0;
|
|
1168
|
-
const
|
|
1169
|
-
await
|
|
1170
|
-
|
|
1171
|
-
e.scope === "approval" ?
|
|
1172
|
-
),
|
|
1134
|
+
const _ = ((i = e.purchaseOrder) == null ? void 0 : i._id) || ((n = e.poRequest) == null ? void 0 : n.purchaseOrderId) || "", p = (y = e.poRequest) == null ? void 0 : y.to.dbName;
|
|
1135
|
+
await a.syncPurchaseOrder(
|
|
1136
|
+
_,
|
|
1137
|
+
e.scope === "approval" ? p : void 0
|
|
1138
|
+
), h.open({
|
|
1173
1139
|
title: "Sync with NetSuite",
|
|
1174
1140
|
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
1175
1141
|
type: "success"
|
|
1176
|
-
}), await new Promise((
|
|
1142
|
+
}), await new Promise((f) => setTimeout(f, 5e3)), t.value = !1;
|
|
1177
1143
|
} catch {
|
|
1178
|
-
|
|
1144
|
+
h.open({
|
|
1179
1145
|
title: "Error",
|
|
1180
1146
|
message: "Failed to sync with NetSuite",
|
|
1181
1147
|
type: "error"
|
|
@@ -1183,15 +1149,15 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1183
1149
|
}
|
|
1184
1150
|
});
|
|
1185
1151
|
}
|
|
1186
|
-
return (
|
|
1187
|
-
const
|
|
1188
|
-
return
|
|
1189
|
-
I(
|
|
1152
|
+
return (i, n) => {
|
|
1153
|
+
const y = z("FmButton");
|
|
1154
|
+
return g(), x("div", Ht, [
|
|
1155
|
+
I(y, {
|
|
1190
1156
|
"prepend-icon": "sync",
|
|
1191
1157
|
variant: "secondary",
|
|
1192
1158
|
label: "Sync",
|
|
1193
1159
|
loading: t.value,
|
|
1194
|
-
onClick:
|
|
1160
|
+
onClick: c,
|
|
1195
1161
|
"text-color": "primary",
|
|
1196
1162
|
"bg-color": "transparent",
|
|
1197
1163
|
"border-color": "primary"
|
|
@@ -1202,19 +1168,19 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1202
1168
|
}), Wt = {
|
|
1203
1169
|
key: 0,
|
|
1204
1170
|
class: "flex flex-col gap-8"
|
|
1205
|
-
},
|
|
1171
|
+
}, Yt = { class: "flex flex-col gap-4" }, Qt = { class: "fm-typo-en-body-lg-600" }, Xt = {
|
|
1206
1172
|
key: 0,
|
|
1207
1173
|
class: "flex flex-col gap-4"
|
|
1208
|
-
},
|
|
1174
|
+
}, Zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Jt = { class: "fm-typo-en-body-lg-600" }, er = { key: 0 }, tr = { key: 1 }, rr = {
|
|
1209
1175
|
key: 1,
|
|
1210
1176
|
class: "flex flex-col gap-4"
|
|
1211
|
-
}, sr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, nr = { class: "fm-typo-en-body-lg-600" },
|
|
1177
|
+
}, sr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, nr = { class: "fm-typo-en-body-lg-600" }, ar = { key: 0 }, or = { key: 1 }, ir = {
|
|
1212
1178
|
key: 2,
|
|
1213
1179
|
class: "flex flex-col gap-4"
|
|
1214
1180
|
}, lr = { class: "fm-typo-en-body-lg-600" }, cr = {
|
|
1215
1181
|
key: 3,
|
|
1216
1182
|
class: "flex flex-col gap-4"
|
|
1217
|
-
}, ur = { class: "fm-typo-en-body-lg-600" }, dr = /* @__PURE__ */
|
|
1183
|
+
}, ur = { class: "fm-typo-en-body-lg-600" }, dr = /* @__PURE__ */ he({
|
|
1218
1184
|
__name: "NetSuiteInfo",
|
|
1219
1185
|
props: {
|
|
1220
1186
|
transferType: {},
|
|
@@ -1224,100 +1190,100 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1224
1190
|
isTransferBetweenOutlets: { type: Boolean },
|
|
1225
1191
|
scope: {}
|
|
1226
1192
|
},
|
|
1227
|
-
setup(
|
|
1228
|
-
const e =
|
|
1193
|
+
setup(m) {
|
|
1194
|
+
const e = m, a = Ae(), h = Ie(), u = M(e.poRequest);
|
|
1229
1195
|
lt(async () => {
|
|
1230
|
-
var
|
|
1231
|
-
if (!e.poRequest && ((
|
|
1232
|
-
const
|
|
1233
|
-
u.value =
|
|
1196
|
+
var n;
|
|
1197
|
+
if (!e.poRequest && ((n = e.purchaseOrder) != null && n._id)) {
|
|
1198
|
+
const y = await h.getLatestPurchaseOrderRequest(e.purchaseOrder._id);
|
|
1199
|
+
u.value = y;
|
|
1234
1200
|
}
|
|
1235
1201
|
});
|
|
1236
|
-
const t =
|
|
1202
|
+
const t = Z(
|
|
1237
1203
|
() => {
|
|
1238
|
-
var
|
|
1239
|
-
return
|
|
1240
|
-
((
|
|
1204
|
+
var n, y, _, p, f, l;
|
|
1205
|
+
return a.getSubsidiaryFullName(
|
|
1206
|
+
((_ = (y = (n = e.purchaseOrder) == null ? void 0 : n.netSuite) == null ? void 0 : y.subsidiary) == null ? void 0 : _.id) || ((l = (f = (p = e.poRequest) == null ? void 0 : p.netSuite) == null ? void 0 : f.subsidiary) == null ? void 0 : l.id)
|
|
1241
1207
|
).fullName;
|
|
1242
1208
|
}
|
|
1243
|
-
),
|
|
1244
|
-
var
|
|
1245
|
-
return (
|
|
1246
|
-
}),
|
|
1247
|
-
var
|
|
1248
|
-
return (
|
|
1249
|
-
var
|
|
1250
|
-
return (
|
|
1209
|
+
), c = Z(() => {
|
|
1210
|
+
var n, y, _, p, f, l, s, b, O, N, E, $;
|
|
1211
|
+
return (_ = (y = (n = e.purchaseOrder) == null ? void 0 : n.netSuite) == null ? void 0 : y.additionalInfo) != null && _.transactionnumber ? (l = (f = (p = e.purchaseOrder) == null ? void 0 : p.netSuite) == null ? void 0 : f.additionalInfo) == null ? void 0 : l.transactionnumber : (O = (b = (s = u.value) == null ? void 0 : s.netSuite) == null ? void 0 : b.additionalInfo) != null && O.transactionnumber ? ($ = (E = (N = u.value) == null ? void 0 : N.netSuite) == null ? void 0 : E.additionalInfo) == null ? void 0 : $.transactionnumber : null;
|
|
1212
|
+
}), i = Z(() => {
|
|
1213
|
+
var n, y, _, p, f, l;
|
|
1214
|
+
return (y = (n = e.purchaseOrder) == null ? void 0 : n.deliveryFullfillment) != null && y.length && ((p = (_ = e.purchaseOrder) == null ? void 0 : _.deliveryFullfillment) == null ? void 0 : p.length) > 0 ? (l = (f = e.purchaseOrder) == null ? void 0 : f.deliveryFullfillment) == null ? void 0 : l.map((s) => {
|
|
1215
|
+
var b;
|
|
1216
|
+
return (b = s.netSuite) == null ? void 0 : b.refNo;
|
|
1251
1217
|
}).join(", ") : "N/A";
|
|
1252
1218
|
});
|
|
1253
|
-
return (
|
|
1254
|
-
var
|
|
1255
|
-
return S(
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1219
|
+
return (n, y) => {
|
|
1220
|
+
var _, p, f, l, s, b, O, N, E, $, P, K, G, ce, le, be;
|
|
1221
|
+
return S(a).isEnabled ? (g(), x("div", Wt, [
|
|
1222
|
+
o("div", Yt, [
|
|
1223
|
+
y[0] || (y[0] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
1224
|
+
o("div", Qt, D(t.value || "N/A"), 1)
|
|
1259
1225
|
]),
|
|
1260
|
-
!
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
(
|
|
1226
|
+
!n.isTransferBetweenOutlets && n.scope === S(Me).RECEIVE_REQUEST ? (g(), x("div", Xt, [
|
|
1227
|
+
o("div", Zt, " NetSuite " + D((p = (_ = n.purchaseOrder) == null ? void 0 : _.netSuite) != null && p.recordType ? S(ot)((l = (f = n.purchaseOrder) == null ? void 0 : f.netSuite) == null ? void 0 : l.recordType) : n.transferType === S(ye).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1228
|
+
o("div", Jt, [
|
|
1229
|
+
(b = (s = n.purchaseOrder) == null ? void 0 : s.netSuite) != null && b.id ? (g(), x("span", er, D((N = (O = n.purchaseOrder) == null ? void 0 : O.netSuite) == null ? void 0 : N.refNo) + " (" + D(($ = (E = n.purchaseOrder) == null ? void 0 : E.netSuite) == null ? void 0 : $.id) + ") ", 1)) : (g(), x("span", tr, "N/A"))
|
|
1264
1230
|
])
|
|
1265
1231
|
])) : U("", !0),
|
|
1266
|
-
!
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
(K = (P = u.value) == null ? void 0 : P.netSuite) != null && K.id ? (
|
|
1232
|
+
!n.isTransferBetweenOutlets && u.value || n.scope === S(Me).APPROVAL ? (g(), x("div", rr, [
|
|
1233
|
+
o("div", sr, " (Request) NetSuite " + D(n.transferType === S(ye).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1234
|
+
o("div", nr, [
|
|
1235
|
+
(K = (P = u.value) == null ? void 0 : P.netSuite) != null && K.id ? (g(), x("span", ar, D((ce = (G = u.value) == null ? void 0 : G.netSuite) == null ? void 0 : ce.refNo) + " (" + D((be = (le = u.value) == null ? void 0 : le.netSuite) == null ? void 0 : be.id) + ") ", 1)) : (g(), x("span", or, "N/A"))
|
|
1270
1236
|
])
|
|
1271
1237
|
])) : U("", !0),
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1238
|
+
c.value ? (g(), x("div", ir, [
|
|
1239
|
+
y[1] || (y[1] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
|
|
1240
|
+
o("div", lr, D(c.value), 1)
|
|
1275
1241
|
])) : U("", !0),
|
|
1276
|
-
S(
|
|
1277
|
-
|
|
1278
|
-
|
|
1242
|
+
S(a).isEnabled && n.transferType === S(ye).TRANSFER && !n.isTransferBetweenOutlets ? (g(), x("div", cr, [
|
|
1243
|
+
y[2] || (y[2] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
1244
|
+
o("div", ur, D(i.value), 1)
|
|
1279
1245
|
])) : U("", !0)
|
|
1280
1246
|
])) : U("", !0);
|
|
1281
1247
|
};
|
|
1282
1248
|
}
|
|
1283
|
-
}), fr = { class: "flex flex-row-reverse" }, mr = /* @__PURE__ */
|
|
1249
|
+
}), fr = { class: "flex flex-row-reverse" }, mr = /* @__PURE__ */ he({
|
|
1284
1250
|
__name: "NetSuiteLog",
|
|
1285
1251
|
props: {
|
|
1286
1252
|
netsuiteId: {},
|
|
1287
1253
|
purchaseOrderId: {}
|
|
1288
1254
|
},
|
|
1289
|
-
setup(
|
|
1290
|
-
const e = Ce(),
|
|
1291
|
-
async function
|
|
1292
|
-
const
|
|
1293
|
-
if (u &&
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1255
|
+
setup(m) {
|
|
1256
|
+
const e = Ce(), a = it();
|
|
1257
|
+
async function h(u, t) {
|
|
1258
|
+
const c = [];
|
|
1259
|
+
if (u && c.push(`body.message:*${u}*`), t) {
|
|
1260
|
+
const _ = t.replace(/:/g, "\\:");
|
|
1261
|
+
c.push(`${_}`);
|
|
1296
1262
|
}
|
|
1297
|
-
if (
|
|
1263
|
+
if (c.length === 0) {
|
|
1298
1264
|
e.open({
|
|
1299
1265
|
message: "Cannot open logs without valid filters.",
|
|
1300
1266
|
type: "error"
|
|
1301
1267
|
});
|
|
1302
1268
|
return;
|
|
1303
1269
|
}
|
|
1304
|
-
const
|
|
1270
|
+
const n = `attributes.pod:netsuite* AND (${c.join(" OR ")})`, { url: y } = await a.getLogs(n);
|
|
1305
1271
|
e.open(
|
|
1306
1272
|
{
|
|
1307
1273
|
message: "Opening NetSuite logs...",
|
|
1308
1274
|
type: "info"
|
|
1309
1275
|
},
|
|
1310
1276
|
800
|
|
1311
|
-
), await new Promise((
|
|
1277
|
+
), await new Promise((_) => setTimeout(_, 800)), window.open(y, "_blank");
|
|
1312
1278
|
}
|
|
1313
1279
|
return (u, t) => {
|
|
1314
|
-
const
|
|
1315
|
-
return
|
|
1316
|
-
I(
|
|
1280
|
+
const c = z("FmButton");
|
|
1281
|
+
return g(), x("div", fr, [
|
|
1282
|
+
I(c, {
|
|
1317
1283
|
"prepend-icon": "history",
|
|
1318
1284
|
variant: "secondary",
|
|
1319
1285
|
label: "Logs",
|
|
1320
|
-
onClick: t[0] || (t[0] = (
|
|
1286
|
+
onClick: t[0] || (t[0] = (i) => h(u.netsuiteId, u.purchaseOrderId)),
|
|
1321
1287
|
"text-color": "primary",
|
|
1322
1288
|
"bg-color": "transparent",
|
|
1323
1289
|
"border-color": "primary"
|
|
@@ -1328,74 +1294,74 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1328
1294
|
}), pr = { class: "flex flex-row-reverse" }, vr = { key: 0 }, yr = {
|
|
1329
1295
|
key: 1,
|
|
1330
1296
|
class: "w-[480px]"
|
|
1331
|
-
}, hr = { class: "fm-typo-en-body-md-400" }, br = { key: 0 }, gr = { key: 1 }, _r = { key: 1 }, Sr = /* @__PURE__ */
|
|
1297
|
+
}, hr = { class: "fm-typo-en-body-md-400" }, br = { key: 0 }, gr = { key: 1 }, _r = { key: 1 }, Sr = /* @__PURE__ */ he({
|
|
1332
1298
|
__name: "NetSuiteLatestInfo",
|
|
1333
1299
|
props: {
|
|
1334
1300
|
netsuiteId: {},
|
|
1335
1301
|
purchaseOrderId: {}
|
|
1336
1302
|
},
|
|
1337
|
-
setup(
|
|
1338
|
-
const e =
|
|
1339
|
-
async function
|
|
1340
|
-
if (!
|
|
1341
|
-
|
|
1303
|
+
setup(m) {
|
|
1304
|
+
const e = m, a = it(), h = M(!1), u = me(), t = M(!0), c = M(!1), i = M(null);
|
|
1305
|
+
async function n() {
|
|
1306
|
+
if (!i.value) {
|
|
1307
|
+
h.value = !0;
|
|
1342
1308
|
try {
|
|
1343
1309
|
t.value = !0;
|
|
1344
|
-
const
|
|
1310
|
+
const y = await a.getMoreInfo(
|
|
1345
1311
|
u.currentLocation.dbName,
|
|
1346
1312
|
e.purchaseOrderId
|
|
1347
1313
|
);
|
|
1348
|
-
|
|
1314
|
+
i.value = y, c.value = !1;
|
|
1349
1315
|
} catch {
|
|
1350
|
-
|
|
1316
|
+
c.value = !0;
|
|
1351
1317
|
} finally {
|
|
1352
1318
|
t.value = !1;
|
|
1353
1319
|
}
|
|
1354
1320
|
}
|
|
1355
1321
|
}
|
|
1356
|
-
return (
|
|
1357
|
-
const
|
|
1358
|
-
return
|
|
1359
|
-
I(
|
|
1360
|
-
modelValue:
|
|
1361
|
-
"onUpdate:modelValue":
|
|
1322
|
+
return (y, _) => {
|
|
1323
|
+
const p = z("FmButton"), f = z("FmLabel"), l = z("FmDialog");
|
|
1324
|
+
return g(), x("div", pr, [
|
|
1325
|
+
I(l, {
|
|
1326
|
+
modelValue: h.value,
|
|
1327
|
+
"onUpdate:modelValue": _[2] || (_[2] = (s) => h.value = s),
|
|
1362
1328
|
overlay: !0
|
|
1363
1329
|
}, {
|
|
1364
|
-
"dialog-button":
|
|
1365
|
-
I(
|
|
1330
|
+
"dialog-button": ae(() => [
|
|
1331
|
+
I(p, {
|
|
1366
1332
|
"prepend-icon": "info",
|
|
1367
1333
|
variant: "secondary",
|
|
1368
1334
|
label: "Latest Info",
|
|
1369
|
-
onClick:
|
|
1335
|
+
onClick: _[0] || (_[0] = (s) => n()),
|
|
1370
1336
|
"text-color": "primary",
|
|
1371
1337
|
"bg-color": "transparent",
|
|
1372
1338
|
"border-color": "primary"
|
|
1373
1339
|
})
|
|
1374
1340
|
]),
|
|
1375
|
-
"dialog-header":
|
|
1376
|
-
|
|
1341
|
+
"dialog-header": ae(() => _[3] || (_[3] = [
|
|
1342
|
+
o("div", null, "NetSuite latest info", -1)
|
|
1377
1343
|
])),
|
|
1378
|
-
"dialog-footer":
|
|
1379
|
-
I(
|
|
1344
|
+
"dialog-footer": ae(() => [
|
|
1345
|
+
I(p, {
|
|
1380
1346
|
class: "ml-auto sm:w-full xs:w-full",
|
|
1381
1347
|
label: "Close",
|
|
1382
1348
|
size: "md",
|
|
1383
1349
|
variant: "primary",
|
|
1384
|
-
onClick:
|
|
1350
|
+
onClick: _[1] || (_[1] = (s) => h.value = !1)
|
|
1385
1351
|
})
|
|
1386
1352
|
]),
|
|
1387
|
-
default:
|
|
1388
|
-
t.value ? (
|
|
1389
|
-
|
|
1390
|
-
key:
|
|
1353
|
+
default: ae(() => [
|
|
1354
|
+
t.value ? (g(), x("div", vr, "Loading...")) : (g(), x("div", yr, [
|
|
1355
|
+
c.value ? (g(), x("p", _r, "Something went wrong.")) : (g(!0), x(se, { key: 0 }, ve(i.value, (s, b) => (g(), x("div", {
|
|
1356
|
+
key: b,
|
|
1391
1357
|
class: "mb-2"
|
|
1392
1358
|
}, [
|
|
1393
|
-
|
|
1394
|
-
I(
|
|
1395
|
-
label: S(Ke)(
|
|
1359
|
+
o("div", null, [
|
|
1360
|
+
I(f, {
|
|
1361
|
+
label: S(Ke)(b)
|
|
1396
1362
|
}, null, 8, ["label"]),
|
|
1397
|
-
|
|
1398
|
-
Array.isArray(
|
|
1363
|
+
o("div", hr, [
|
|
1364
|
+
Array.isArray(s) ? (g(), x("span", br, D(s.length > 0 ? s.join(", ") : "N/A"), 1)) : (g(), x("span", gr, D(s), 1))
|
|
1399
1365
|
])
|
|
1400
1366
|
])
|
|
1401
1367
|
]))), 128))
|
|
@@ -1406,10 +1372,10 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1406
1372
|
]);
|
|
1407
1373
|
};
|
|
1408
1374
|
}
|
|
1409
|
-
}),
|
|
1375
|
+
}), wr = {
|
|
1410
1376
|
key: 0,
|
|
1411
1377
|
class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16 flex flex-col gap-8"
|
|
1412
|
-
},
|
|
1378
|
+
}, Rr = { class: "flex gap-8 items-center" }, Or = { class: "ml-auto" }, xr = { class: "flex gap-4" }, Nr = /* @__PURE__ */ he({
|
|
1413
1379
|
__name: "NetSuitePanel",
|
|
1414
1380
|
props: {
|
|
1415
1381
|
poRequest: {},
|
|
@@ -1418,29 +1384,29 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1418
1384
|
transferToDbName: {},
|
|
1419
1385
|
scope: {}
|
|
1420
1386
|
},
|
|
1421
|
-
setup(
|
|
1422
|
-
const e =
|
|
1423
|
-
var
|
|
1424
|
-
const t = ((
|
|
1425
|
-
return
|
|
1387
|
+
setup(m) {
|
|
1388
|
+
const e = m, a = Et(), h = Pe(), u = Z(() => {
|
|
1389
|
+
var n, y, _, p, f, l, s;
|
|
1390
|
+
const t = ((n = e.transferToDbName) == null ? void 0 : n.startsWith("restaurant")) && ((_ = (y = e.purchaseOrder) == null ? void 0 : y.supplier) == null ? void 0 : _.internal) === "restaurant", c = e.transferType === ye.PURCHASE, i = e.transferType === ye.TRANSFER;
|
|
1391
|
+
return c || i && !t || ((f = (p = e.purchaseOrder) == null ? void 0 : p.netSuite) == null ? void 0 : f.id) || ((s = (l = e.poRequest) == null ? void 0 : l.netSuite) == null ? void 0 : s.id);
|
|
1426
1392
|
});
|
|
1427
|
-
return (t,
|
|
1428
|
-
var
|
|
1429
|
-
const
|
|
1430
|
-
return S(
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
(
|
|
1393
|
+
return (t, c) => {
|
|
1394
|
+
var n, y, _, p, f, l, s, b, O, N;
|
|
1395
|
+
const i = z("FmMenuDivider");
|
|
1396
|
+
return S(a).isNetSuiteEnabled && u.value ? (g(), x("div", wr, [
|
|
1397
|
+
o("div", Rr, [
|
|
1398
|
+
c[0] || (c[0] = o("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
1399
|
+
o("div", Or, [
|
|
1400
|
+
o("div", xr, [
|
|
1401
|
+
(n = S(h).sessionUser.value) != null && n.role.isAdmin && ((_ = (y = e.purchaseOrder) == null ? void 0 : y.netSuite) != null && _.id) ? (g(), oe(Sr, {
|
|
1436
1402
|
key: 0,
|
|
1437
|
-
"netsuite-id": (
|
|
1438
|
-
"purchase-order-id": (
|
|
1403
|
+
"netsuite-id": (f = (p = t.purchaseOrder) == null ? void 0 : p.netSuite) == null ? void 0 : f.id,
|
|
1404
|
+
"purchase-order-id": (l = t.purchaseOrder) == null ? void 0 : l._id
|
|
1439
1405
|
}, null, 8, ["netsuite-id", "purchase-order-id"])) : U("", !0),
|
|
1440
|
-
(
|
|
1406
|
+
(s = S(h).sessionUser.value) != null && s.role.isAdmin ? (g(), oe(mr, {
|
|
1441
1407
|
key: 1,
|
|
1442
|
-
"netsuite-id": (O = (
|
|
1443
|
-
"purchase-order-id": (
|
|
1408
|
+
"netsuite-id": (O = (b = t.purchaseOrder) == null ? void 0 : b.netSuite) == null ? void 0 : O.id,
|
|
1409
|
+
"purchase-order-id": (N = t.purchaseOrder) == null ? void 0 : N._id
|
|
1444
1410
|
}, null, 8, ["netsuite-id", "purchase-order-id"])) : U("", !0),
|
|
1445
1411
|
I(Gt, {
|
|
1446
1412
|
"po-request": t.poRequest,
|
|
@@ -1451,7 +1417,7 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1451
1417
|
])
|
|
1452
1418
|
])
|
|
1453
1419
|
]),
|
|
1454
|
-
I(
|
|
1420
|
+
I(i),
|
|
1455
1421
|
I(dr, {
|
|
1456
1422
|
"po-request": t.poRequest,
|
|
1457
1423
|
"purchase-order": t.purchaseOrder,
|
|
@@ -1463,7 +1429,7 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1463
1429
|
])) : U("", !0);
|
|
1464
1430
|
};
|
|
1465
1431
|
}
|
|
1466
|
-
}), kr = { class: "flex flex-col gap-16 w-full h-full" }, Dr = { class: "flex justify-between" }, qr = { class: "fm-typo-en-body-lg-600" }, Tr = { class: "flex flex-col gap-8" },
|
|
1432
|
+
}), kr = { class: "flex flex-col gap-16 w-full h-full" }, Dr = { class: "flex justify-between" }, qr = { class: "fm-typo-en-body-lg-600" }, Tr = { class: "flex flex-col gap-8" }, $r = { class: "flex flex-col gap-4" }, Ar = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pr = { class: "flex gap-1" }, Cr = { class: "fm-typo-en-body-lg-600" }, Ir = {
|
|
1467
1433
|
key: 0,
|
|
1468
1434
|
class: "flex flex-col gap-4"
|
|
1469
1435
|
}, Fr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Er = { class: "fm-typo-en-body-lg-600" }, Lr = { class: "flex flex-col gap-4" }, Br = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vr = { class: "fm-typo-en-body-lg-600" }, Ur = {
|
|
@@ -1475,10 +1441,10 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1475
1441
|
}, zr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Hr = { class: "fm-typo-en-body-lg-600" }, Gr = {
|
|
1476
1442
|
key: 3,
|
|
1477
1443
|
class: "flex flex-col gap-4"
|
|
1478
|
-
}, Wr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1444
|
+
}, Wr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yr = { class: "fm-typo-en-body-lg-600" }, Qr = {
|
|
1479
1445
|
key: 4,
|
|
1480
1446
|
class: "flex flex-col gap-4"
|
|
1481
|
-
}, Xr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1447
|
+
}, Xr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Zr = { class: "fm-typo-en-body-lg-600" }, Jr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, es = { class: "flex flex-col gap-8" }, ts = { class: "flex gap-8 items-center" }, rs = { class: "flex-1 fm-typo-en-body-lg-600" }, ss = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-4" }, ns = { class: "flex w-full gap-4" }, as = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2 flex items-center gap-2" }, os = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, is = ["innerHTML"], ls = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, cs = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, us = {
|
|
1482
1448
|
key: 0,
|
|
1483
1449
|
class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1484
1450
|
}, ds = { class: "py-8" }, fs = { class: "flex justify-end gap-4 items-center" }, ms = { class: "fm-typo-en-body-lg-600" }, ps = {
|
|
@@ -1493,16 +1459,16 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1493
1459
|
}, _s = { class: "flex gap-12 content-stretch" }, Ss = {
|
|
1494
1460
|
class: "flex flex-col w-24",
|
|
1495
1461
|
name: "circles"
|
|
1496
|
-
},
|
|
1462
|
+
}, ws = { class: "flex-1 flex flex-col items-center" }, Rs = { class: "flex-1 flex flex-col items-center" }, Os = {
|
|
1497
1463
|
class: "py-12 flex flex-col gap-4",
|
|
1498
1464
|
name: "received-at header"
|
|
1499
|
-
},
|
|
1465
|
+
}, xs = { class: "fm-typo-en-body-lg-400" }, Ns = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ks = { class: "flex gap-12 content-stretch" }, Ds = {
|
|
1500
1466
|
class: "flex flex-col w-24",
|
|
1501
1467
|
name: "circles"
|
|
1502
1468
|
}, qs = { class: "flex-1 flex flex-col items-center" }, Ts = {
|
|
1503
1469
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
1504
1470
|
name: "delivery details"
|
|
1505
|
-
},
|
|
1471
|
+
}, $s = { class: "flex flex-col gap-8" }, As = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ps = { class: "flex flex-col gap-4" }, Cs = { class: "flex gap-8 xs:flex-col" }, Gs = /* @__PURE__ */ he({
|
|
1506
1472
|
__name: "TransferDetails",
|
|
1507
1473
|
props: {
|
|
1508
1474
|
poRequest: {},
|
|
@@ -1516,75 +1482,75 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1516
1482
|
receivedMap: {}
|
|
1517
1483
|
},
|
|
1518
1484
|
emits: ["update:show", "submitted"],
|
|
1519
|
-
setup(
|
|
1520
|
-
const
|
|
1485
|
+
setup(m, { emit: e }) {
|
|
1486
|
+
const a = m, h = e, u = je(), t = Ce(), c = $e(), i = me(), n = Pe(), y = Z(
|
|
1521
1487
|
() => {
|
|
1522
|
-
var
|
|
1488
|
+
var r, d;
|
|
1523
1489
|
return {
|
|
1524
|
-
id: ((
|
|
1525
|
-
name: ((
|
|
1490
|
+
id: ((r = n.sessionUser.value) == null ? void 0 : r.id) ?? "",
|
|
1491
|
+
name: ((d = n.sessionUser.value) == null ? void 0 : d.displayName) ?? ""
|
|
1526
1492
|
};
|
|
1527
1493
|
}
|
|
1528
|
-
),
|
|
1494
|
+
), _ = zt(), { t: p } = ct(), f = Z(
|
|
1529
1495
|
() => {
|
|
1530
|
-
var
|
|
1531
|
-
return ((
|
|
1496
|
+
var r, d, w, q;
|
|
1497
|
+
return ((d = (r = a.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : d.internal) === "restaurant" || ((q = (w = a.purchaseOrder) == null ? void 0 : w.supplier) == null ? void 0 : q.internal) === "warehouse" ? ye.TRANSFER : ye.PURCHASE;
|
|
1532
1498
|
}
|
|
1533
|
-
),
|
|
1534
|
-
if (!
|
|
1499
|
+
), l = M(!1), s = M(""), b = M(!0), O = Ie(), N = Ft(O.getWorkflowConfig), E = mt(), $ = Z(() => {
|
|
1500
|
+
if (!a.purchaseOrder)
|
|
1535
1501
|
return [];
|
|
1536
|
-
const
|
|
1537
|
-
if (
|
|
1502
|
+
const r = N.result.value;
|
|
1503
|
+
if (r.state === tt.loading)
|
|
1538
1504
|
return [];
|
|
1539
|
-
const
|
|
1540
|
-
user:
|
|
1541
|
-
executedAt:
|
|
1505
|
+
const d = {
|
|
1506
|
+
user: y.value,
|
|
1507
|
+
executedAt: i.locations.computeFirst(
|
|
1542
1508
|
(q) => {
|
|
1543
1509
|
var j;
|
|
1544
|
-
return q.dbName === ((j =
|
|
1510
|
+
return q.dbName === ((j = i._currentLocation) == null ? void 0 : j.dbName) ? q : null;
|
|
1545
1511
|
}
|
|
1546
1512
|
),
|
|
1547
|
-
purchaseOrderRequest:
|
|
1548
|
-
purchaseOrder:
|
|
1513
|
+
purchaseOrderRequest: a.poRequest,
|
|
1514
|
+
purchaseOrder: a.purchaseOrder
|
|
1549
1515
|
};
|
|
1550
|
-
let
|
|
1516
|
+
let w = [];
|
|
1551
1517
|
try {
|
|
1552
|
-
|
|
1553
|
-
...
|
|
1518
|
+
r.state === tt.error ? (console.error("Error fetching workflow config:", r.error), w = Ee.getAvailableActions({
|
|
1519
|
+
...d,
|
|
1554
1520
|
orderConfig: Ee.getDefaultConfig()
|
|
1555
1521
|
}).actions.filter(
|
|
1556
1522
|
(q) => (
|
|
1557
1523
|
// TODO: create receiveStock & processRequest dialog
|
|
1558
1524
|
// to create their payload
|
|
1559
|
-
q !==
|
|
1525
|
+
q !== R.enum.receiveStock && q !== R.enum.processRequest && q !== R.enum.closeRequest
|
|
1560
1526
|
)
|
|
1561
|
-
)) :
|
|
1562
|
-
...
|
|
1563
|
-
orderConfig:
|
|
1527
|
+
)) : w = Ee.getAvailableActions({
|
|
1528
|
+
...d,
|
|
1529
|
+
orderConfig: r.data
|
|
1564
1530
|
}).actions.filter(
|
|
1565
|
-
(q) => q !==
|
|
1531
|
+
(q) => q !== R.enum.receiveStock && q !== R.enum.processRequest && q !== R.enum.closeRequest
|
|
1566
1532
|
);
|
|
1567
1533
|
} catch (q) {
|
|
1568
1534
|
console.error("Error getting available actions:", q);
|
|
1569
1535
|
}
|
|
1570
|
-
return
|
|
1571
|
-
}), P =
|
|
1536
|
+
return a.scope === "approval" && (w = w.filter((q) => q !== R.enum.completeReceive)), w;
|
|
1537
|
+
}), P = Dt(a, "show"), K = Z(() => [
|
|
1572
1538
|
{
|
|
1573
|
-
label:
|
|
1539
|
+
label: p("inventory.transfer.receiveRequest.details.overview"),
|
|
1574
1540
|
value: "overview"
|
|
1575
1541
|
},
|
|
1576
1542
|
{
|
|
1577
|
-
label:
|
|
1543
|
+
label: p("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
1578
1544
|
value: "deliveryHistory"
|
|
1579
1545
|
}
|
|
1580
1546
|
]), G = M(K.value[0]);
|
|
1581
|
-
|
|
1582
|
-
() =>
|
|
1583
|
-
(
|
|
1584
|
-
|
|
1547
|
+
Ot(
|
|
1548
|
+
() => a.show,
|
|
1549
|
+
(r) => {
|
|
1550
|
+
r && (G.value = K.value[0]);
|
|
1585
1551
|
}
|
|
1586
1552
|
);
|
|
1587
|
-
async function ce(
|
|
1553
|
+
async function ce(r, d, w, q, j) {
|
|
1588
1554
|
return new Promise((W, ee) => {
|
|
1589
1555
|
u.open({
|
|
1590
1556
|
closeButton: !1,
|
|
@@ -1593,97 +1559,97 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1593
1559
|
primaryActions: q.primaryActions,
|
|
1594
1560
|
secondaryActions: { text: "No", close: !1 }
|
|
1595
1561
|
}).onPrimary(async () => {
|
|
1596
|
-
var L,
|
|
1597
|
-
const
|
|
1598
|
-
|
|
1562
|
+
var L, Y, Q, F;
|
|
1563
|
+
const v = [];
|
|
1564
|
+
w === R.enum.approveRequest ? (v.push({
|
|
1599
1565
|
action: "approveRequest",
|
|
1600
1566
|
payload: null
|
|
1601
|
-
}),
|
|
1567
|
+
}), d.fulfillment && v.push({
|
|
1602
1568
|
action: "processRequest",
|
|
1603
1569
|
payload: {
|
|
1604
1570
|
fulfillmentId: "",
|
|
1605
1571
|
deliveryOrderNumber: "",
|
|
1606
1572
|
deliveryRemark: null,
|
|
1607
|
-
items:
|
|
1608
|
-
createdBy:
|
|
1573
|
+
items: d.fulfillment.items,
|
|
1574
|
+
createdBy: y.value
|
|
1609
1575
|
}
|
|
1610
|
-
})) :
|
|
1576
|
+
})) : w === R.enum.processRequest ? d.fulfillment && v.push({
|
|
1611
1577
|
action: "processRequest",
|
|
1612
1578
|
payload: {
|
|
1613
1579
|
fulfillmentId: "",
|
|
1614
1580
|
deliveryOrderNumber: "",
|
|
1615
1581
|
deliveryRemark: null,
|
|
1616
|
-
items:
|
|
1617
|
-
createdBy:
|
|
1582
|
+
items: d.fulfillment.items,
|
|
1583
|
+
createdBy: y.value
|
|
1618
1584
|
}
|
|
1619
|
-
}) :
|
|
1585
|
+
}) : w === R.enum.rejectRequest ? v.push({
|
|
1620
1586
|
action: "rejectRequest",
|
|
1621
1587
|
payload: null
|
|
1622
|
-
}) :
|
|
1588
|
+
}) : w === R.enum.closeRequest && v.push({
|
|
1623
1589
|
action: "closeRequest",
|
|
1624
1590
|
payload: null
|
|
1625
1591
|
});
|
|
1626
1592
|
try {
|
|
1627
1593
|
await E({
|
|
1628
1594
|
operate: {
|
|
1629
|
-
operation:
|
|
1630
|
-
doc:
|
|
1631
|
-
options:
|
|
1595
|
+
operation: w,
|
|
1596
|
+
doc: r,
|
|
1597
|
+
options: d
|
|
1632
1598
|
},
|
|
1633
1599
|
operateV2: {
|
|
1634
|
-
_id: ((L =
|
|
1635
|
-
_rev: ((
|
|
1636
|
-
action:
|
|
1637
|
-
payloads:
|
|
1600
|
+
_id: ((L = a.purchaseOrder) == null ? void 0 : L._id) ?? "",
|
|
1601
|
+
_rev: ((Y = a.purchaseOrder) == null ? void 0 : Y._rev) ?? "",
|
|
1602
|
+
action: w,
|
|
1603
|
+
payloads: v
|
|
1638
1604
|
// add payload if action is receiveStock or processRequest
|
|
1639
1605
|
},
|
|
1640
|
-
transferTo: (F = (
|
|
1606
|
+
transferTo: (F = (Q = a.poRequest) == null ? void 0 : Q.to) == null ? void 0 : F.dbName
|
|
1641
1607
|
}).delayed(1e3), W("submitted");
|
|
1642
1608
|
} catch (te) {
|
|
1643
1609
|
ee(te);
|
|
1644
1610
|
}
|
|
1645
1611
|
}).onSecondary(() => {
|
|
1646
1612
|
W("cancelled");
|
|
1647
|
-
for (let
|
|
1613
|
+
for (let v = 0; v < j + 2; v++)
|
|
1648
1614
|
u.close();
|
|
1649
1615
|
}).onClose(() => {
|
|
1650
1616
|
});
|
|
1651
1617
|
});
|
|
1652
1618
|
}
|
|
1653
|
-
async function le(
|
|
1654
|
-
var j, W, ee,
|
|
1655
|
-
if (
|
|
1619
|
+
async function le(r) {
|
|
1620
|
+
var j, W, ee, v;
|
|
1621
|
+
if (r === R.enum.receiveStock)
|
|
1656
1622
|
return;
|
|
1657
|
-
const
|
|
1658
|
-
if (!
|
|
1623
|
+
const d = ut[r];
|
|
1624
|
+
if (!d) {
|
|
1659
1625
|
t.open({
|
|
1660
1626
|
title: "Something went wrong",
|
|
1661
|
-
message: `Cannot process order: ${Ke(
|
|
1627
|
+
message: `Cannot process order: ${Ke(r)}`,
|
|
1662
1628
|
type: "error"
|
|
1663
1629
|
});
|
|
1664
1630
|
return;
|
|
1665
1631
|
}
|
|
1666
|
-
const { successMessage:
|
|
1667
|
-
if (
|
|
1668
|
-
|
|
1632
|
+
const { successMessage: w, ...q } = d;
|
|
1633
|
+
if (a.purchaseOrder) {
|
|
1634
|
+
s.value = `${r}`, l.value = !0, b.value = !1;
|
|
1669
1635
|
const L = {};
|
|
1670
|
-
let
|
|
1671
|
-
if ((
|
|
1672
|
-
|
|
1636
|
+
let Y = 0;
|
|
1637
|
+
if ((r === R.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
1638
|
+
r === R.enum.completeReceive) && c.autoReceiveWarehouse)
|
|
1673
1639
|
L.autoReceive = !0;
|
|
1674
|
-
else if ((
|
|
1675
|
-
const
|
|
1676
|
-
if (
|
|
1640
|
+
else if ((r === R.enum.approveRequest || r === R.enum.processRequest) && c.acceptRequireFulfillment) {
|
|
1641
|
+
const Q = (W = (j = a.poRequest) == null ? void 0 : j.from) == null ? void 0 : W.dbName, F = (v = (ee = a.poRequest) == null ? void 0 : ee.to) == null ? void 0 : v.dbName;
|
|
1642
|
+
if (Q && F && (Q.startsWith("warehouse_") || F.startsWith("warehouse_"))) {
|
|
1677
1643
|
const te = await new Promise((B, de) => {
|
|
1678
1644
|
u.open({
|
|
1679
1645
|
closeButton: !1,
|
|
1680
1646
|
title: "Confirm transfer amount",
|
|
1681
1647
|
dialogComponent: jt,
|
|
1682
1648
|
dialogComponentProps: {
|
|
1683
|
-
purchaseOrder:
|
|
1649
|
+
purchaseOrder: a.purchaseOrder,
|
|
1684
1650
|
confirm: B,
|
|
1685
1651
|
"onUpdate:show": (pe) => {
|
|
1686
|
-
pe || (
|
|
1652
|
+
pe || (s.value = "", l.value = !1, b.value = !0, Y++, u.close()), de("cancelled");
|
|
1687
1653
|
}
|
|
1688
1654
|
}
|
|
1689
1655
|
});
|
|
@@ -1693,105 +1659,105 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1693
1659
|
}
|
|
1694
1660
|
try {
|
|
1695
1661
|
await ce(
|
|
1696
|
-
|
|
1662
|
+
a.purchaseOrder,
|
|
1697
1663
|
L,
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1664
|
+
r,
|
|
1665
|
+
d,
|
|
1666
|
+
Y
|
|
1701
1667
|
) === "submitted" && (t.open({
|
|
1702
1668
|
title: "Success",
|
|
1703
|
-
message:
|
|
1669
|
+
message: w,
|
|
1704
1670
|
type: "success"
|
|
1705
|
-
}),
|
|
1706
|
-
} catch (
|
|
1671
|
+
}), h("update:show", !1), h("submitted"));
|
|
1672
|
+
} catch (Q) {
|
|
1707
1673
|
t.open({
|
|
1708
1674
|
title: "Something went wrong",
|
|
1709
1675
|
message: "Please try again.",
|
|
1710
1676
|
type: "error"
|
|
1711
|
-
}), console.error("Error when submitting PO operation",
|
|
1677
|
+
}), console.error("Error when submitting PO operation", r, a.purchaseOrder, Q);
|
|
1712
1678
|
} finally {
|
|
1713
|
-
|
|
1679
|
+
s.value = "", l.value = !1, b.value = !0;
|
|
1714
1680
|
}
|
|
1715
1681
|
}
|
|
1716
1682
|
}
|
|
1717
|
-
const
|
|
1718
|
-
var
|
|
1719
|
-
return ((
|
|
1720
|
-
}), Fe =
|
|
1721
|
-
const
|
|
1722
|
-
if (!
|
|
1723
|
-
const
|
|
1724
|
-
return
|
|
1725
|
-
}), ue =
|
|
1683
|
+
const be = Z(() => {
|
|
1684
|
+
var r, d;
|
|
1685
|
+
return ((r = a.purchaseOrder) == null ? void 0 : r.status) === ie.enum.RECEIVING || ((d = a.purchaseOrder) == null ? void 0 : d.status) === ie.enum.COMPLETE;
|
|
1686
|
+
}), Fe = Z(() => {
|
|
1687
|
+
const r = a.purchaseOrder;
|
|
1688
|
+
if (!r) return;
|
|
1689
|
+
const d = ze(r), { partial: w, over: q } = dt(d);
|
|
1690
|
+
return p(`inventory.transfer.status.${ft(r.status, w, q)}`);
|
|
1691
|
+
}), ue = Z(() => {
|
|
1726
1692
|
var W, ee;
|
|
1727
|
-
const
|
|
1728
|
-
...
|
|
1729
|
-
createdAt:
|
|
1693
|
+
const r = ((W = a.purchaseOrder) == null ? void 0 : W.deliveryOrder) ?? [], d = ((ee = a.purchaseOrder) == null ? void 0 : ee.deliveryFullfillment) ?? [], w = [
|
|
1694
|
+
...r.map((v) => ({
|
|
1695
|
+
createdAt: v.createdAt,
|
|
1730
1696
|
type: "grn",
|
|
1731
|
-
doc:
|
|
1697
|
+
doc: v
|
|
1732
1698
|
})),
|
|
1733
|
-
...
|
|
1734
|
-
createdAt:
|
|
1699
|
+
...d.map((v) => ({
|
|
1700
|
+
createdAt: v.createdAt,
|
|
1735
1701
|
type: "fulfillment",
|
|
1736
|
-
doc:
|
|
1702
|
+
doc: v
|
|
1737
1703
|
}))
|
|
1738
1704
|
];
|
|
1739
|
-
|
|
1740
|
-
function q(
|
|
1741
|
-
var
|
|
1742
|
-
const L =
|
|
1743
|
-
(F = (
|
|
1705
|
+
w.reverse().sort((v, L) => v.createdAt.localeCompare(L.createdAt));
|
|
1706
|
+
function q(v) {
|
|
1707
|
+
var Q, F, te, B, de, pe, we, Re, V;
|
|
1708
|
+
const L = d.findIndex((C) => C.id === v.fullfillmentId), Y = [
|
|
1709
|
+
(F = (Q = d[L]) == null ? void 0 : Q.netSuite) != null && F.refNo ? {
|
|
1744
1710
|
label: "Fulfillment's ref no. (Netsuite)",
|
|
1745
|
-
values: [(B = (te =
|
|
1711
|
+
values: [(B = (te = d[L]) == null ? void 0 : te.netSuite) == null ? void 0 : B.refNo]
|
|
1746
1712
|
} : null,
|
|
1747
|
-
(de =
|
|
1713
|
+
(de = v == null ? void 0 : v.netSuite) != null && de.refNo ? {
|
|
1748
1714
|
label: "Netsuite ref no.",
|
|
1749
|
-
values: [(pe =
|
|
1715
|
+
values: [(pe = v == null ? void 0 : v.netSuite) == null ? void 0 : pe.refNo]
|
|
1750
1716
|
} : null,
|
|
1751
|
-
(
|
|
1717
|
+
(we = v == null ? void 0 : v.netSuite) != null && we.recordType ? {
|
|
1752
1718
|
label: "Netsuite Type",
|
|
1753
|
-
values: [
|
|
1719
|
+
values: [ot((Re = v == null ? void 0 : v.netSuite) == null ? void 0 : Re.recordType)]
|
|
1754
1720
|
} : null
|
|
1755
1721
|
];
|
|
1756
1722
|
return {
|
|
1757
1723
|
header: "Received",
|
|
1758
|
-
date: Le(new Date(
|
|
1724
|
+
date: Le(new Date(v.createdAt)),
|
|
1759
1725
|
info: [
|
|
1760
1726
|
{
|
|
1761
1727
|
label: "Adjustment date",
|
|
1762
1728
|
values: [
|
|
1763
|
-
|
|
1729
|
+
v.adjustment ? Le(new Date(St(v.adjustment))) : "-"
|
|
1764
1730
|
]
|
|
1765
1731
|
},
|
|
1766
1732
|
{
|
|
1767
1733
|
label: "Received by",
|
|
1768
|
-
values: [(V =
|
|
1734
|
+
values: [(V = v.createdBy) == null ? void 0 : V.name]
|
|
1769
1735
|
},
|
|
1770
1736
|
{
|
|
1771
1737
|
label: "Received items",
|
|
1772
|
-
values:
|
|
1738
|
+
values: v.received.map((C) => {
|
|
1773
1739
|
var X;
|
|
1774
|
-
return
|
|
1775
|
-
|
|
1740
|
+
return T("div", [
|
|
1741
|
+
T(
|
|
1776
1742
|
"div",
|
|
1777
1743
|
{
|
|
1778
1744
|
class: "flex gap-4"
|
|
1779
1745
|
},
|
|
1780
1746
|
[
|
|
1781
|
-
|
|
1747
|
+
T(
|
|
1782
1748
|
"div",
|
|
1783
1749
|
{
|
|
1784
1750
|
class: "flex flex-col"
|
|
1785
1751
|
},
|
|
1786
1752
|
[
|
|
1787
|
-
|
|
1753
|
+
T(
|
|
1788
1754
|
"span",
|
|
1789
1755
|
{
|
|
1790
1756
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
1791
1757
|
},
|
|
1792
1758
|
`${C.sku.name}`
|
|
1793
1759
|
),
|
|
1794
|
-
|
|
1760
|
+
T(
|
|
1795
1761
|
"span",
|
|
1796
1762
|
{
|
|
1797
1763
|
class: "fm-typo-en-body-md-400"
|
|
@@ -1800,26 +1766,26 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1800
1766
|
)
|
|
1801
1767
|
]
|
|
1802
1768
|
),
|
|
1803
|
-
|
|
1769
|
+
T(
|
|
1804
1770
|
"div",
|
|
1805
1771
|
{
|
|
1806
1772
|
class: "ml-auto flex flex-col"
|
|
1807
1773
|
},
|
|
1808
1774
|
[
|
|
1809
|
-
|
|
1775
|
+
T(
|
|
1810
1776
|
"div",
|
|
1811
1777
|
{
|
|
1812
1778
|
class: "ml-auto flex gap-1"
|
|
1813
1779
|
},
|
|
1814
1780
|
[
|
|
1815
|
-
|
|
1781
|
+
T(
|
|
1816
1782
|
"span",
|
|
1817
1783
|
{
|
|
1818
1784
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
1819
1785
|
},
|
|
1820
1786
|
fe(C.amount, !1)
|
|
1821
1787
|
),
|
|
1822
|
-
|
|
1788
|
+
T(
|
|
1823
1789
|
"span",
|
|
1824
1790
|
{
|
|
1825
1791
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
@@ -1828,12 +1794,12 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1828
1794
|
)
|
|
1829
1795
|
]
|
|
1830
1796
|
),
|
|
1831
|
-
|
|
1797
|
+
T(
|
|
1832
1798
|
"div",
|
|
1833
1799
|
{
|
|
1834
1800
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1835
1801
|
},
|
|
1836
|
-
`${C.cost ? `(${
|
|
1802
|
+
`${C.cost ? `(${Ne(C.cost)})` : ""}`
|
|
1837
1803
|
)
|
|
1838
1804
|
]
|
|
1839
1805
|
)
|
|
@@ -1842,28 +1808,28 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1842
1808
|
]);
|
|
1843
1809
|
})
|
|
1844
1810
|
},
|
|
1845
|
-
|
|
1811
|
+
v.deliveryOrderNumber ? {
|
|
1846
1812
|
label: "Delivery order no.",
|
|
1847
|
-
values: [
|
|
1813
|
+
values: [v.deliveryOrderNumber]
|
|
1848
1814
|
} : null,
|
|
1849
|
-
|
|
1815
|
+
v.remark ? {
|
|
1850
1816
|
label: "Remark",
|
|
1851
|
-
values: [
|
|
1817
|
+
values: [v.remark]
|
|
1852
1818
|
} : null,
|
|
1853
1819
|
L > -1 ? {
|
|
1854
1820
|
label: "Fulfilment's sequence",
|
|
1855
1821
|
values: [`${L + 1}`]
|
|
1856
1822
|
} : null,
|
|
1857
|
-
...
|
|
1823
|
+
...Y
|
|
1858
1824
|
].filter((C) => C)
|
|
1859
1825
|
};
|
|
1860
1826
|
}
|
|
1861
|
-
function j(
|
|
1862
|
-
var
|
|
1863
|
-
const L =
|
|
1827
|
+
function j(v) {
|
|
1828
|
+
var Y, Q;
|
|
1829
|
+
const L = d.findIndex((F) => F.id === v.id);
|
|
1864
1830
|
return {
|
|
1865
1831
|
header: "Fulfillment",
|
|
1866
|
-
date: Le(new Date(
|
|
1832
|
+
date: Le(new Date(v.createdAt)),
|
|
1867
1833
|
info: [
|
|
1868
1834
|
{
|
|
1869
1835
|
label: "Sequence",
|
|
@@ -1871,29 +1837,29 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1871
1837
|
},
|
|
1872
1838
|
{
|
|
1873
1839
|
label: "Receiveable items",
|
|
1874
|
-
values:
|
|
1840
|
+
values: v.items.map((F) => {
|
|
1875
1841
|
var te;
|
|
1876
|
-
return
|
|
1877
|
-
|
|
1842
|
+
return T("div", [
|
|
1843
|
+
T(
|
|
1878
1844
|
"div",
|
|
1879
1845
|
{
|
|
1880
1846
|
class: "flex gap-4"
|
|
1881
1847
|
},
|
|
1882
1848
|
[
|
|
1883
|
-
|
|
1849
|
+
T(
|
|
1884
1850
|
"div",
|
|
1885
1851
|
{
|
|
1886
1852
|
class: "flex flex-col"
|
|
1887
1853
|
},
|
|
1888
1854
|
[
|
|
1889
|
-
|
|
1855
|
+
T(
|
|
1890
1856
|
"span",
|
|
1891
1857
|
{
|
|
1892
1858
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
1893
1859
|
},
|
|
1894
1860
|
`${F.sku.name}`
|
|
1895
1861
|
),
|
|
1896
|
-
|
|
1862
|
+
T(
|
|
1897
1863
|
"span",
|
|
1898
1864
|
{
|
|
1899
1865
|
class: "fm-typo-en-body-md-400"
|
|
@@ -1902,26 +1868,26 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1902
1868
|
)
|
|
1903
1869
|
]
|
|
1904
1870
|
),
|
|
1905
|
-
|
|
1871
|
+
T(
|
|
1906
1872
|
"div",
|
|
1907
1873
|
{
|
|
1908
1874
|
class: "ml-auto flex flex-col"
|
|
1909
1875
|
},
|
|
1910
1876
|
[
|
|
1911
|
-
|
|
1877
|
+
T(
|
|
1912
1878
|
"div",
|
|
1913
1879
|
{
|
|
1914
1880
|
class: "ml-auto flex gap-1"
|
|
1915
1881
|
},
|
|
1916
1882
|
[
|
|
1917
|
-
|
|
1883
|
+
T(
|
|
1918
1884
|
"span",
|
|
1919
1885
|
{
|
|
1920
1886
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
1921
1887
|
},
|
|
1922
1888
|
fe(F.amount, !1)
|
|
1923
1889
|
),
|
|
1924
|
-
|
|
1890
|
+
T(
|
|
1925
1891
|
"span",
|
|
1926
1892
|
{
|
|
1927
1893
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
@@ -1930,12 +1896,12 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1930
1896
|
)
|
|
1931
1897
|
]
|
|
1932
1898
|
),
|
|
1933
|
-
|
|
1899
|
+
T(
|
|
1934
1900
|
"div",
|
|
1935
1901
|
{
|
|
1936
1902
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1937
1903
|
},
|
|
1938
|
-
`${F.cost ? `(${
|
|
1904
|
+
`${F.cost ? `(${Ne(F.cost)})` : ""}`
|
|
1939
1905
|
)
|
|
1940
1906
|
]
|
|
1941
1907
|
)
|
|
@@ -1944,116 +1910,116 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
1944
1910
|
]);
|
|
1945
1911
|
})
|
|
1946
1912
|
},
|
|
1947
|
-
(
|
|
1913
|
+
(Y = v.netSuite) != null && Y.refNo ? {
|
|
1948
1914
|
label: "Ref no. (Netsuite)",
|
|
1949
|
-
values: [(
|
|
1915
|
+
values: [(Q = v.netSuite) == null ? void 0 : Q.refNo]
|
|
1950
1916
|
} : null
|
|
1951
1917
|
].filter((F) => F)
|
|
1952
1918
|
};
|
|
1953
1919
|
}
|
|
1954
|
-
return
|
|
1955
|
-
switch (
|
|
1920
|
+
return w.map((v) => {
|
|
1921
|
+
switch (v.type) {
|
|
1956
1922
|
case "grn":
|
|
1957
|
-
return q(
|
|
1923
|
+
return q(v.doc);
|
|
1958
1924
|
case "fulfillment":
|
|
1959
|
-
return j(
|
|
1925
|
+
return j(v.doc);
|
|
1960
1926
|
}
|
|
1961
1927
|
});
|
|
1962
|
-
}), k =
|
|
1963
|
-
var
|
|
1964
|
-
const
|
|
1928
|
+
}), k = Z(() => {
|
|
1929
|
+
var d;
|
|
1930
|
+
const r = {
|
|
1965
1931
|
...nt(0),
|
|
1966
|
-
currency:
|
|
1932
|
+
currency: Je()
|
|
1967
1933
|
};
|
|
1968
|
-
return ((
|
|
1969
|
-
...st(
|
|
1970
|
-
currency:
|
|
1971
|
-
}),
|
|
1934
|
+
return ((d = a.purchaseOrder) == null ? void 0 : d.items.reduce((w, q) => ({
|
|
1935
|
+
...st(w, q.totalCost ?? r),
|
|
1936
|
+
currency: Je()
|
|
1937
|
+
}), r)) ?? r;
|
|
1972
1938
|
});
|
|
1973
|
-
function A(
|
|
1939
|
+
function A(r) {
|
|
1974
1940
|
var W;
|
|
1975
|
-
const
|
|
1976
|
-
return `<span class="${H(
|
|
1941
|
+
const w = (((W = a.purchaseOrder) == null ? void 0 : W.version) ?? ke.enum[1]) === ke.enum[2] ? r.id : r.sku._id, q = a.receivedMap[w];
|
|
1942
|
+
return `<span class="${H(r)} fm-typo-en-body-lg-600">${wt.toFormatString({ value: q.received })}</span>/${$t(r.quantity, r.sku.unit, r.measurement)}`;
|
|
1977
1943
|
}
|
|
1978
|
-
function H(
|
|
1944
|
+
function H(r) {
|
|
1979
1945
|
var L;
|
|
1980
|
-
const
|
|
1981
|
-
return W ? "text-fm-color-typo-tertiary" : j ? "text-fm-color-system-warning-300" : ee ? "text-fm-color-system-error-300" :
|
|
1946
|
+
const w = (((L = a.purchaseOrder) == null ? void 0 : L.version) ?? ke.enum[1]) === ke.enum[2] ? r.id : r.sku._id, q = a.receivedMap[w], { isPartialReceive: j, isNoReceive: W, isOverReceive: ee, isFullReceive: v } = Lt(q);
|
|
1947
|
+
return W ? "text-fm-color-typo-tertiary" : j ? "text-fm-color-system-warning-300" : ee ? "text-fm-color-system-error-300" : v ? "text-fm-color-system-success-300" : "";
|
|
1982
1948
|
}
|
|
1983
|
-
return (
|
|
1949
|
+
return (r, d) => {
|
|
1984
1950
|
var F, te;
|
|
1985
|
-
const
|
|
1986
|
-
return
|
|
1987
|
-
header: S(
|
|
1951
|
+
const w = z("FmButtonGroup"), q = z("FmChip"), j = z("FmMenuDivider"), W = z("FmCard"), ee = z("FmIcon"), v = z("FmTooltip"), L = z("FmSpacer"), Y = z("FmButton"), Q = z("FmSideSheet");
|
|
1952
|
+
return g(), oe(Q, {
|
|
1953
|
+
header: S(p)("inventory.transfer.receiveRequest.details.title") + ((F = r.purchaseOrder) != null && F.seqNumber ? ` #${(te = r.purchaseOrder) == null ? void 0 : te.seqNumber}` : ""),
|
|
1988
1954
|
modelValue: S(P),
|
|
1989
|
-
"onUpdate:modelValue":
|
|
1990
|
-
"dismiss-away":
|
|
1955
|
+
"onUpdate:modelValue": d[5] || (d[5] = (B) => xt(P) ? P.value = B : null),
|
|
1956
|
+
"dismiss-away": b.value,
|
|
1991
1957
|
"close-button": "",
|
|
1992
1958
|
"max-width": 600
|
|
1993
1959
|
}, {
|
|
1994
|
-
default:
|
|
1995
|
-
var B, de, pe,
|
|
1960
|
+
default: ae(() => {
|
|
1961
|
+
var B, de, pe, we, Re;
|
|
1996
1962
|
return [
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
I(
|
|
1963
|
+
o("div", kr, [
|
|
1964
|
+
o("div", null, [
|
|
1965
|
+
I(w, {
|
|
2000
1966
|
items: K.value,
|
|
2001
1967
|
modelValue: G.value,
|
|
2002
|
-
"onUpdate:modelValue":
|
|
1968
|
+
"onUpdate:modelValue": d[0] || (d[0] = (V) => G.value = V)
|
|
2003
1969
|
}, null, 8, ["items", "modelValue"])
|
|
2004
1970
|
]),
|
|
2005
|
-
G.value.value === "overview" ? (
|
|
2006
|
-
|
|
1971
|
+
G.value.value === "overview" ? (g(), x(se, { key: 0 }, [
|
|
1972
|
+
o("div", null, [
|
|
2007
1973
|
I(W, {
|
|
2008
1974
|
variant: "outlined",
|
|
2009
1975
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
2010
1976
|
}, {
|
|
2011
|
-
default:
|
|
2012
|
-
var V, C, X,
|
|
1977
|
+
default: ae(() => {
|
|
1978
|
+
var V, C, X, ge, _e, xe, He, Ge, We, Ye, Qe;
|
|
2013
1979
|
return [
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
1980
|
+
o("div", Dr, [
|
|
1981
|
+
o("div", qr, D(S(p)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
1982
|
+
o("div", null, [
|
|
2017
1983
|
I(q, {
|
|
2018
1984
|
label: Fe.value,
|
|
2019
|
-
class:
|
|
1985
|
+
class: De(`fm-status-badge fm-status-badge-${(C = (V = r.purchaseOrder) == null ? void 0 : V.status) == null ? void 0 : C.toLocaleLowerCase("en-us")}`),
|
|
2020
1986
|
compact: ""
|
|
2021
1987
|
}, null, 8, ["label", "class"])
|
|
2022
1988
|
])
|
|
2023
1989
|
]),
|
|
2024
1990
|
I(j),
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
1991
|
+
o("div", Tr, [
|
|
1992
|
+
o("div", $r, [
|
|
1993
|
+
o("div", Ar, [
|
|
1994
|
+
o("div", Pr, D(S(p)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
2029
1995
|
]),
|
|
2030
|
-
|
|
1996
|
+
o("div", Cr, D(S(qe)(((X = r.purchaseOrder) == null ? void 0 : X._id) ?? "")), 1)
|
|
2031
1997
|
]),
|
|
2032
|
-
(
|
|
2033
|
-
|
|
2034
|
-
|
|
1998
|
+
(ge = r.purchaseOrder) != null && ge.effectiveAt ? (g(), x("div", Ir, [
|
|
1999
|
+
o("div", Fr, D(S(p)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
2000
|
+
o("div", Er, D(S(at)(new Date((_e = r.purchaseOrder) == null ? void 0 : _e.effectiveAt))), 1)
|
|
2035
2001
|
])) : U("", !0),
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
`inventory.transfer.receiveRequest.details.type.${
|
|
2002
|
+
o("div", Lr, [
|
|
2003
|
+
o("div", Br, D(S(p)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
2004
|
+
o("div", Vr, D(S(p)(
|
|
2005
|
+
`inventory.transfer.receiveRequest.details.type.${f.value.toLocaleLowerCase("en-US")}`
|
|
2040
2006
|
)), 1)
|
|
2041
2007
|
]),
|
|
2042
|
-
(He = (
|
|
2043
|
-
|
|
2044
|
-
|
|
2008
|
+
(He = (xe = r.purchaseOrder) == null ? void 0 : xe.supplier) != null && He.name ? (g(), x("div", Ur, [
|
|
2009
|
+
o("div", Mr, D(S(p)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
2010
|
+
o("div", Kr, D((We = (Ge = r.purchaseOrder) == null ? void 0 : Ge.supplier) == null ? void 0 : We.name), 1)
|
|
2045
2011
|
])) : U("", !0),
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2012
|
+
r.transferTo ? (g(), x("div", jr, [
|
|
2013
|
+
o("div", zr, D(S(p)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
2014
|
+
o("div", Hr, D(r.transferTo), 1)
|
|
2049
2015
|
])) : U("", !0),
|
|
2050
|
-
(
|
|
2051
|
-
|
|
2052
|
-
|
|
2016
|
+
(Ye = r.purchaseOrder) != null && Ye.ref ? (g(), x("div", Gr, [
|
|
2017
|
+
o("div", Wr, D(S(p)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
2018
|
+
o("div", Yr, D(r.purchaseOrder.ref), 1)
|
|
2053
2019
|
])) : U("", !0),
|
|
2054
|
-
(
|
|
2055
|
-
|
|
2056
|
-
|
|
2020
|
+
(Qe = r.purchaseOrder) != null && Qe.remark ? (g(), x("div", Qr, [
|
|
2021
|
+
o("div", Xr, D(S(p)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
2022
|
+
o("div", Zr, D(r.purchaseOrder.remark), 1)
|
|
2057
2023
|
])) : U("", !0)
|
|
2058
2024
|
])
|
|
2059
2025
|
];
|
|
@@ -2061,31 +2027,31 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
2061
2027
|
_: 1
|
|
2062
2028
|
})
|
|
2063
2029
|
]),
|
|
2064
|
-
I(
|
|
2065
|
-
"po-request":
|
|
2066
|
-
purchaseOrder:
|
|
2067
|
-
transferType:
|
|
2068
|
-
transferToDbName:
|
|
2069
|
-
scope:
|
|
2030
|
+
I(Nr, {
|
|
2031
|
+
"po-request": r.poRequest,
|
|
2032
|
+
purchaseOrder: r.purchaseOrder,
|
|
2033
|
+
transferType: f.value,
|
|
2034
|
+
transferToDbName: r.transferToDbName,
|
|
2035
|
+
scope: r.scope
|
|
2070
2036
|
}, null, 8, ["po-request", "purchaseOrder", "transferType", "transferToDbName", "scope"]),
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
Be(D(
|
|
2076
|
-
(de = (B =
|
|
2037
|
+
o("div", Jr, [
|
|
2038
|
+
o("div", es, [
|
|
2039
|
+
o("div", ts, [
|
|
2040
|
+
o("span", rs, [
|
|
2041
|
+
Be(D(be.value ? S(p)("inventory.transfer.receiveRequest.details.receivedItems") : S(p)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
|
|
2042
|
+
(de = (B = r.purchaseOrder) == null ? void 0 : B.netSuite) != null && de.missingItems && ((we = (pe = r.purchaseOrder) == null ? void 0 : pe.netSuite) == null ? void 0 : we.missingItems.length) > 0 ? (g(), oe(v, {
|
|
2077
2043
|
key: 0,
|
|
2078
2044
|
variant: "rich",
|
|
2079
2045
|
placement: "top",
|
|
2080
2046
|
"z-index": 51
|
|
2081
2047
|
}, {
|
|
2082
|
-
content:
|
|
2048
|
+
content: ae(() => {
|
|
2083
2049
|
var V, C;
|
|
2084
2050
|
return [
|
|
2085
|
-
|
|
2086
|
-
(
|
|
2051
|
+
o("div", ss, [
|
|
2052
|
+
(g(!0), x(se, null, ve((C = (V = r.purchaseOrder) == null ? void 0 : V.netSuite) == null ? void 0 : C.missingItems, (X, ge) => (g(), x("div", {
|
|
2087
2053
|
class: "flex justify-center align-middle",
|
|
2088
|
-
key:
|
|
2054
|
+
key: ge
|
|
2089
2055
|
}, [
|
|
2090
2056
|
I(ee, {
|
|
2091
2057
|
name: "arrow_right",
|
|
@@ -2096,7 +2062,7 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
2096
2062
|
])
|
|
2097
2063
|
];
|
|
2098
2064
|
}),
|
|
2099
|
-
default:
|
|
2065
|
+
default: ae(() => [
|
|
2100
2066
|
I(ee, {
|
|
2101
2067
|
name: "error",
|
|
2102
2068
|
color: "#ff2c2c",
|
|
@@ -2108,45 +2074,45 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
2108
2074
|
])
|
|
2109
2075
|
]),
|
|
2110
2076
|
I(j),
|
|
2111
|
-
(
|
|
2077
|
+
(g(!0), x(se, null, ve(((Re = r.purchaseOrder) == null ? void 0 : Re.items) ?? [], (V) => {
|
|
2112
2078
|
var C;
|
|
2113
|
-
return
|
|
2079
|
+
return g(), x("div", {
|
|
2114
2080
|
key: V.code,
|
|
2115
2081
|
class: "flex flex-col"
|
|
2116
2082
|
}, [
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2083
|
+
o("div", ns, [
|
|
2084
|
+
o("div", as, D(V.name), 1),
|
|
2085
|
+
o("div", os, [
|
|
2086
|
+
o("span", {
|
|
2121
2087
|
innerHTML: A(V)
|
|
2122
2088
|
}, null, 8, is)
|
|
2123
2089
|
])
|
|
2124
2090
|
]),
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
(C = V.totalCost) != null && C.amount && S(
|
|
2091
|
+
o("div", ls, [
|
|
2092
|
+
o("div", cs, D(V.code), 1),
|
|
2093
|
+
(C = V.totalCost) != null && C.amount && S(c).enableTotalCost ? (g(), x("div", us, " (" + D(S(Ne)(V.totalCost)) + ") ", 1)) : U("", !0)
|
|
2128
2094
|
])
|
|
2129
2095
|
]);
|
|
2130
2096
|
}), 128)),
|
|
2131
|
-
+S(fe)(k.value) ? (
|
|
2132
|
-
|
|
2097
|
+
+S(fe)(k.value) ? (g(), x(se, { key: 0 }, [
|
|
2098
|
+
o("div", ds, [
|
|
2133
2099
|
I(j)
|
|
2134
2100
|
]),
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2101
|
+
o("div", fs, [
|
|
2102
|
+
d[6] || (d[6] = o("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
|
|
2103
|
+
o("div", ms, D(S(Ne)(k.value)), 1)
|
|
2138
2104
|
])
|
|
2139
2105
|
], 64)) : U("", !0)
|
|
2140
2106
|
])
|
|
2141
2107
|
])
|
|
2142
|
-
], 64)) : G.value.value === "deliveryHistory" ? (
|
|
2143
|
-
ue.value.length ? (
|
|
2144
|
-
(
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
class:
|
|
2108
|
+
], 64)) : G.value.value === "deliveryHistory" ? (g(), x("div", ps, [
|
|
2109
|
+
ue.value.length ? (g(), x("div", gs, [
|
|
2110
|
+
(g(!0), x(se, null, ve(ue.value, (V, C) => (g(), x(se, { key: C }, [
|
|
2111
|
+
o("div", _s, [
|
|
2112
|
+
o("div", Ss, [
|
|
2113
|
+
o("div", ws, [
|
|
2114
|
+
o("div", {
|
|
2115
|
+
class: De([
|
|
2150
2116
|
{
|
|
2151
2117
|
"bg-fm-color-primary": C !== 0,
|
|
2152
2118
|
"bg-white": C === 0
|
|
@@ -2155,10 +2121,10 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
2155
2121
|
])
|
|
2156
2122
|
}, null, 2)
|
|
2157
2123
|
]),
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
class:
|
|
2124
|
+
d[7] || (d[7] = o("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
2125
|
+
o("div", Rs, [
|
|
2126
|
+
o("div", {
|
|
2127
|
+
class: De([
|
|
2162
2128
|
{
|
|
2163
2129
|
"bg-fm-color-primary": C < ue.value.length - 1,
|
|
2164
2130
|
"bg-white": C >= ue.value.length - 1
|
|
@@ -2168,16 +2134,16 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
2168
2134
|
}, null, 2)
|
|
2169
2135
|
])
|
|
2170
2136
|
]),
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2137
|
+
o("div", Os, [
|
|
2138
|
+
o("div", xs, D(V.header), 1),
|
|
2139
|
+
o("div", Ns, D(V.date), 1)
|
|
2174
2140
|
])
|
|
2175
2141
|
]),
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
class:
|
|
2142
|
+
o("div", ks, [
|
|
2143
|
+
o("div", Ds, [
|
|
2144
|
+
o("div", qs, [
|
|
2145
|
+
o("div", {
|
|
2146
|
+
class: De([
|
|
2181
2147
|
{
|
|
2182
2148
|
"bg-fm-color-primary": C < ue.value.length - 1,
|
|
2183
2149
|
"bg-white": C >= ue.value.length - 1
|
|
@@ -2187,26 +2153,26 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
2187
2153
|
}, null, 2)
|
|
2188
2154
|
])
|
|
2189
2155
|
]),
|
|
2190
|
-
|
|
2156
|
+
o("div", Ts, [
|
|
2191
2157
|
I(W, {
|
|
2192
2158
|
variant: "outlined",
|
|
2193
2159
|
class: "py-12 px-16"
|
|
2194
2160
|
}, {
|
|
2195
|
-
default:
|
|
2196
|
-
|
|
2197
|
-
(
|
|
2198
|
-
key:
|
|
2161
|
+
default: ae(() => [
|
|
2162
|
+
o("div", $s, [
|
|
2163
|
+
(g(!0), x(se, null, ve(V.info, (X, ge) => (g(), x("div", {
|
|
2164
|
+
key: ge,
|
|
2199
2165
|
class: "flex flex-col gap-4"
|
|
2200
2166
|
}, [
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
(
|
|
2204
|
-
key:
|
|
2167
|
+
o("div", As, D(X == null ? void 0 : X.label), 1),
|
|
2168
|
+
o("div", Ps, [
|
|
2169
|
+
(g(!0), x(se, null, ve(X == null ? void 0 : X.values, (_e, xe) => (g(), x("div", {
|
|
2170
|
+
key: xe,
|
|
2205
2171
|
class: "fm-typo-en-body-lg-600"
|
|
2206
2172
|
}, [
|
|
2207
|
-
typeof
|
|
2208
|
-
Be(D(
|
|
2209
|
-
], 64)) : (
|
|
2173
|
+
typeof _e == "string" ? (g(), x(se, { key: 0 }, [
|
|
2174
|
+
Be(D(_e), 1)
|
|
2175
|
+
], 64)) : (g(), oe(Nt(_e), { key: 1 }))
|
|
2210
2176
|
]))), 128))
|
|
2211
2177
|
])
|
|
2212
2178
|
]))), 128))
|
|
@@ -2217,16 +2183,16 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
2217
2183
|
])
|
|
2218
2184
|
])
|
|
2219
2185
|
], 64))), 128))
|
|
2220
|
-
])) : (
|
|
2186
|
+
])) : (g(), x("div", vs, [
|
|
2221
2187
|
I(L),
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
src: S(
|
|
2188
|
+
o("div", null, [
|
|
2189
|
+
o("img", {
|
|
2190
|
+
src: S(At),
|
|
2225
2191
|
alt: "List is empty"
|
|
2226
2192
|
}, null, 8, ys)
|
|
2227
2193
|
]),
|
|
2228
|
-
|
|
2229
|
-
|
|
2194
|
+
o("div", hs, D(S(p)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
2195
|
+
o("div", bs, D(S(p)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
|
|
2230
2196
|
I(L),
|
|
2231
2197
|
I(L)
|
|
2232
2198
|
]))
|
|
@@ -2234,43 +2200,43 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
2234
2200
|
])
|
|
2235
2201
|
];
|
|
2236
2202
|
}),
|
|
2237
|
-
"side-sheet-footer":
|
|
2238
|
-
|
|
2239
|
-
(
|
|
2240
|
-
S(Ue)[B].available != !1 ? (
|
|
2203
|
+
"side-sheet-footer": ae(() => [
|
|
2204
|
+
o("div", Cs, [
|
|
2205
|
+
(g(!0), x(se, null, ve($.value, (B) => (g(), x(se, null, [
|
|
2206
|
+
S(Ue)[B].available != !1 ? (g(), oe(Y, {
|
|
2241
2207
|
key: B,
|
|
2242
|
-
label: S(
|
|
2208
|
+
label: S(p)(S(Ue)[B].translationKey),
|
|
2243
2209
|
onClick: (de) => le(B),
|
|
2244
|
-
loading:
|
|
2245
|
-
disabled:
|
|
2210
|
+
loading: s.value === B,
|
|
2211
|
+
disabled: s.value !== B && l.value,
|
|
2246
2212
|
variant: S(Ue)[B].buttonVariant
|
|
2247
2213
|
}, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : U("", !0)
|
|
2248
2214
|
], 64))), 256)),
|
|
2249
|
-
S(
|
|
2215
|
+
S(_).ableToMarkReceived(r.purchaseOrder) && !$.value.includes("completeReceive") ? (g(), oe(Y, {
|
|
2250
2216
|
key: 0,
|
|
2251
|
-
label: S(
|
|
2252
|
-
onClick:
|
|
2253
|
-
loading:
|
|
2254
|
-
disabled:
|
|
2217
|
+
label: S(p)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
2218
|
+
onClick: d[1] || (d[1] = (B) => le("completeReceive")),
|
|
2219
|
+
loading: s.value === "completeReceive",
|
|
2220
|
+
disabled: s.value !== "completeReceive" && l.value
|
|
2255
2221
|
}, null, 8, ["label", "loading", "disabled"])) : U("", !0),
|
|
2256
|
-
S(
|
|
2222
|
+
S(_).ableToMarkApproved(r.purchaseOrder) && r.canApprove && !$.value.includes("approveRequest") ? (g(), oe(Y, {
|
|
2257
2223
|
key: 1,
|
|
2258
|
-
label: S(
|
|
2259
|
-
onClick:
|
|
2260
|
-
loading:
|
|
2261
|
-
disabled:
|
|
2224
|
+
label: S(p)("inventory.transfer.approval.actions.approveRequest"),
|
|
2225
|
+
onClick: d[2] || (d[2] = (B) => le("approveRequest")),
|
|
2226
|
+
loading: s.value === "approveRequest",
|
|
2227
|
+
disabled: s.value !== "approveRequest" && l.value
|
|
2262
2228
|
}, null, 8, ["label", "loading", "disabled"])) : U("", !0),
|
|
2263
|
-
S(
|
|
2229
|
+
S(_).ableToCreateFulfillment(r.purchaseOrder, r.poRequest) && a.scope === "approval" ? (g(), oe(Y, {
|
|
2264
2230
|
key: 2,
|
|
2265
|
-
label: S(
|
|
2266
|
-
onClick:
|
|
2267
|
-
loading:
|
|
2268
|
-
disabled:
|
|
2231
|
+
label: S(p)("inventory.transfer.receiveRequest.actions.processRequest"),
|
|
2232
|
+
onClick: d[3] || (d[3] = (B) => le("processRequest")),
|
|
2233
|
+
loading: s.value === "processRequest",
|
|
2234
|
+
disabled: s.value !== "processRequest" && l.value
|
|
2269
2235
|
}, null, 8, ["label", "loading", "disabled"])) : U("", !0),
|
|
2270
|
-
I(
|
|
2271
|
-
label: S(
|
|
2236
|
+
I(Y, {
|
|
2237
|
+
label: S(p)("common.close"),
|
|
2272
2238
|
variant: "tertiary",
|
|
2273
|
-
onClick:
|
|
2239
|
+
onClick: d[4] || (d[4] = (B) => h("update:show", !1))
|
|
2274
2240
|
}, null, 8, ["label"])
|
|
2275
2241
|
])
|
|
2276
2242
|
]),
|
|
@@ -2280,7 +2246,6 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ ge({
|
|
|
2280
2246
|
}
|
|
2281
2247
|
});
|
|
2282
2248
|
export {
|
|
2283
|
-
he as F,
|
|
2284
2249
|
Me as P,
|
|
2285
2250
|
Gs as _,
|
|
2286
2251
|
zs as a,
|