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