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