@feedmepos/mf-inventory-portal 0.0.23-dev.12 → 0.0.23-dev.14
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-DASBZyvh.js → App-C6g4MWwq.js} +3 -3
- package/dist/{ApprovalView-DHF6ZNbm.js → ApprovalView-BK8XFPbW.js} +4 -4
- package/dist/{BindingsDialog-D9qKxyAg.js → BindingsDialog-Dyt5XjYv.js} +2 -2
- package/dist/{BindingsPicker-CeBoqXz8.js → BindingsPicker-Oc6mY2X8.js} +2 -2
- package/dist/{BindingsTable-Dd5xRj10.js → BindingsTable-Bd3XOxR2.js} +4 -4
- package/dist/ClosingDraftView-ByE3m27z.js +939 -0
- package/dist/{ClosingTemplateView-CSXAdVxc.js → ClosingTemplateView-CMwTAa6I.js} +10 -10
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BST01iWL.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C8Svc7L9.js} +4 -4
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BH2P7EWu.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-6-Um-FOb.js} +2 -2
- package/dist/{FmMultiselectDialog-CS4NySsZ.js → FmMultiselectDialog-D8iilrSP.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-C7jj8lh2.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D5hUkg2Q.js} +2 -2
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-B_bOROW1.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-Cd9aCR0V.js} +1 -1
- package/dist/{IngredientGroupView-D8YdtFuI.js → IngredientGroupView-D5Y8HnMX.js} +5 -5
- package/dist/{IngredientsView-Dwi7AdEC.js → IngredientsView-Bw49qYtR.js} +9 -9
- package/dist/{IntegrationView-cRXTwH66.js → IntegrationView-BxaJS_Ic.js} +4 -4
- package/dist/{InventoryBindingForm-Bn8LLL7Z.js → InventoryBindingForm-a9nsrEgo.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-jXdc2zeS.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Dj3ykTHY.js} +5 -5
- package/dist/{InventoryBindingSummary-eUAU5Z7o.js → InventoryBindingSummary-BdvlBlBa.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DP9gkO9u.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BIFLCYHD.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DjdvK5YG.js → PremiumBadge.vue_vue_type_script_setup_true_lang-gqJ2wFO2.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-RsvtuTgm.js → PurchaseOrderPrintPreview-DsWVxI5o.js} +1 -1
- package/dist/{ReceiveRequestView-BVYXX41L.js → ReceiveRequestView-C7I6nYFr.js} +18 -18
- package/dist/{RecipeView-BFj61pLR.js → RecipeView-DNf5Pdsx.js} +7 -7
- package/dist/{StockView-B8DHNq-I.js → StockView-BvtciIRT.js} +13 -13
- package/dist/{SupplierView-DE5glObY.js → SupplierView-Co0xIPuQ.js} +10 -10
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CAR2rHAz.js → TransferDetails.vue_vue_type_script_setup_true_lang-WlrPIph9.js} +321 -320
- package/dist/{TransferTemplateView-DaY-24XT.js → TransferTemplateView-BWuxHMCo.js} +14 -14
- package/dist/{UnitView-Bqh-DD8a.js → UnitView-DV1gTkKx.js} +5 -5
- package/dist/{WarehouseView-KOZF8E0j.js → WarehouseView-1nJhKxZf.js} +4 -4
- package/dist/api/netsuite.d.ts +1 -1
- package/dist/{app-CCmjyIGj.js → app-BxXrau2Y.js} +8 -8
- package/dist/app.js +1 -1
- package/dist/{date2-Bts8EH96.js → date2-BiwqC0aG.js} +1 -1
- package/dist/{dayjs.min-Bwx_xAqf.js → dayjs.min-BG6ShXQ2.js} +1 -1
- package/dist/{decimal-Cw3aj2HA.js → decimal-E0BNizw5.js} +1 -1
- package/dist/{defineDeepModel-DF4IooaB.js → defineDeepModel-35Pm_1zc.js} +1 -1
- package/dist/{feature-DUVlpk0T.js → feature-DEUGLUcC.js} +1 -1
- package/dist/{format-time-from-id-DRL6XFTy.js → format-time-from-id-C-CoKHdr.js} +1 -1
- package/dist/{format-unit-display-h-7i16En.js → format-unit-display-BTpv4xQq.js} +8 -8
- package/dist/{fuzzy-Csk59ocn.js → fuzzy-DnuAv442.js} +1 -1
- package/dist/{index-C49C9tXF.js → index-C-Tfi09A.js} +1 -1
- package/dist/{index-BUdfAMv8.js → index-CvuJB9Kj.js} +1 -1
- package/dist/{index-rrLxN15a.js → index-DAeQwHBr.js} +1 -1
- package/dist/{netsuite-Cgj-Fs7U.js → netsuite-B_j6HAOr.js} +44 -43
- package/dist/{rules-CSQd5FJv.js → rules-DQHD3_tG.js} +2 -2
- package/dist/{stock-DOndmj1b.js → stock-UdvZOkMj.js} +2 -2
- package/dist/stores/integration/netsuite.d.ts +1 -1
- package/dist/{supplier-Bv3Jvn8o.js → supplier-DPLyaiL4.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-inventory-binding-dialog-C7br2QA4.js → use-inventory-binding-dialog-D5f_LR61.js} +2 -2
- package/dist/{use-template-enabled-locations-2-eX5uS542.js → use-template-enabled-locations-2-C7I0IWxW.js} +2 -2
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +6 -2
- package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +4 -1
- package/dist/{xlsx-wOJHnWy6.js → xlsx-CtEy_Z3G.js} +1 -1
- package/dist/{xlsx.util-C4ZYbcNA.js → xlsx.util-CNlpT1T7.js} +1 -1
- package/package.json +3 -3
- package/dist/ClosingDraftView-TbFoEdiB.js +0 -767
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { ref as B, computed as V, h as ee, defineComponent as We, resolveComponent as te, openBlock as y, createBlock as J, unref as n, isRef as Je, withCtx as pe, createElementVNode as r, createElementBlock as
|
|
2
|
-
import { i as Ze } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { k as Xe, u as be, G as
|
|
4
|
-
import { t as tt, b as rt, h as Be, d as Ie } from "./date2-
|
|
1
|
+
import { ref as B, computed as V, h as ee, defineComponent as We, resolveComponent as te, openBlock as y, createBlock as J, unref as n, isRef as Je, withCtx as pe, createElementVNode as r, createElementBlock as D, createVNode as Q, createCommentVNode as N, Fragment as re, toDisplayString as v, normalizeClass as ve, renderList as ye } from "vue";
|
|
2
|
+
import { i as Ze } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-6-Um-FOb.js";
|
|
3
|
+
import { k as Xe, u as be, G as w, r as et, c as Le, y as U, s as je, w as $e } from "./app-BxXrau2Y.js";
|
|
4
|
+
import { t as tt, b as rt, h as Be, d as Ie } from "./date2-BiwqC0aG.js";
|
|
5
5
|
import { F as Fe } from "./form-mode.enum-BKiNVH6A.js";
|
|
6
6
|
import { useDialog as Ke, useSnackbar as Ve, useProxiedModel as st } from "@feedmepos/ui-library";
|
|
7
|
-
import { p as at, f as ge } from "./format-time-from-id-
|
|
8
|
-
import { u as Ge } from "./feature-
|
|
9
|
-
import { b as nt, u as ot, f as He, P as se } from "./format-unit-display-
|
|
10
|
-
import { c as
|
|
7
|
+
import { p as at, f as ge } from "./format-time-from-id-C-CoKHdr.js";
|
|
8
|
+
import { u as Ge } from "./feature-DEUGLUcC.js";
|
|
9
|
+
import { b as nt, u as ot, f as He, P as se } from "./format-unit-display-BTpv4xQq.js";
|
|
10
|
+
import { c as Me } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
11
11
|
import { D as j, R as I } from "./row-action.enum-7rGLGZ5v.js";
|
|
12
|
-
import { i as Oe, c as he, a as le, k as lt, j as
|
|
13
|
-
import { F as it } from "./decimal-
|
|
12
|
+
import { i as Oe, c as he, a as le, k as lt, j as Ue } from "./rules-DQHD3_tG.js";
|
|
13
|
+
import { F as it } from "./decimal-E0BNizw5.js";
|
|
14
14
|
import { useI18n as ze } from "@feedmepos/mf-common";
|
|
15
15
|
import { E as ct } from "./empty-placeholder-wf6-BWE8.js";
|
|
16
|
-
import { u as ut } from "./netsuite-
|
|
17
|
-
const
|
|
18
|
-
const
|
|
16
|
+
import { u as ut } from "./netsuite-B_j6HAOr.js";
|
|
17
|
+
const Ye = Xe((m, _) => {
|
|
18
|
+
const u = be();
|
|
19
19
|
return {
|
|
20
20
|
async readRequests(s) {
|
|
21
|
-
const
|
|
22
|
-
return await
|
|
21
|
+
const R = s ?? u.currentLocationDBName, S = `${m.inventoryBackendUrl}/${R}/purchase-request`;
|
|
22
|
+
return await _.get(S);
|
|
23
23
|
},
|
|
24
24
|
async getPurchaseOrders({
|
|
25
25
|
start: s,
|
|
26
|
-
end:
|
|
26
|
+
end: R
|
|
27
27
|
}) {
|
|
28
|
-
const S =
|
|
29
|
-
return await
|
|
28
|
+
const S = u.currentLocationDBName, q = `${m.inventoryBackendUrl}/${S}/purchase-order`;
|
|
29
|
+
return await _.get(`${q}?start=${s}&end=${R}`);
|
|
30
30
|
},
|
|
31
31
|
async getPurchaseOrderById(s) {
|
|
32
|
-
const
|
|
33
|
-
return await
|
|
32
|
+
const R = u.currentLocationDBName, S = `${m.inventoryBackendUrl}/${R}/purchase-order`;
|
|
33
|
+
return await _.get(`${S}/${s}`);
|
|
34
34
|
},
|
|
35
|
-
async processPurchaseOrder(s,
|
|
36
|
-
const S =
|
|
37
|
-
return await
|
|
35
|
+
async processPurchaseOrder(s, R) {
|
|
36
|
+
const S = u.currentLocationDBName, q = R || S, $ = `${m.inventoryBackendUrl}/${q}/purchase-order/run-operation`;
|
|
37
|
+
return await _.put($, s);
|
|
38
38
|
},
|
|
39
39
|
async createPurchaseOrder(s) {
|
|
40
|
-
const
|
|
41
|
-
return await
|
|
40
|
+
const R = u.currentLocationDBName, S = `${m.inventoryBackendUrl}/${R}/purchase-order`;
|
|
41
|
+
return await _.post(S, s);
|
|
42
42
|
},
|
|
43
43
|
async updatePurchaseOrder(s) {
|
|
44
|
-
const
|
|
45
|
-
return await
|
|
44
|
+
const R = u.currentLocationDBName, S = `${m.inventoryBackendUrl}/${R}/purchase-order`;
|
|
45
|
+
return await _.put(S, s);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
}),
|
|
49
|
-
[
|
|
48
|
+
}), Qe = {
|
|
49
|
+
[w.enum.confirmDraft]: {
|
|
50
50
|
primaryActions: {
|
|
51
51
|
text: "Confirm draft",
|
|
52
52
|
close: !0
|
|
@@ -55,7 +55,7 @@ const Qe = Xe((m, R) => {
|
|
|
55
55
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
56
56
|
successMessage: "Purchase order draft has been confirmed"
|
|
57
57
|
},
|
|
58
|
-
[
|
|
58
|
+
[w.enum.cancelDraft]: {
|
|
59
59
|
primaryActions: {
|
|
60
60
|
text: "Cancel draft",
|
|
61
61
|
close: !0,
|
|
@@ -65,7 +65,7 @@ const Qe = Xe((m, R) => {
|
|
|
65
65
|
message: "Purchase order cannot be changed after cancelled draft.",
|
|
66
66
|
successMessage: "Purchase order draft has been cancelled"
|
|
67
67
|
},
|
|
68
|
-
[
|
|
68
|
+
[w.enum.submitRequest]: {
|
|
69
69
|
primaryActions: {
|
|
70
70
|
text: "Submit request",
|
|
71
71
|
close: !0
|
|
@@ -74,7 +74,7 @@ const Qe = Xe((m, R) => {
|
|
|
74
74
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
75
75
|
successMessage: "Purchase order draft has been submitted"
|
|
76
76
|
},
|
|
77
|
-
[
|
|
77
|
+
[w.enum.completeReceive]: {
|
|
78
78
|
primaryActions: {
|
|
79
79
|
text: "Mark received",
|
|
80
80
|
close: !0
|
|
@@ -83,7 +83,7 @@ const Qe = Xe((m, R) => {
|
|
|
83
83
|
message: "Purchase order cannot be changed after it has complete receiving.",
|
|
84
84
|
successMessage: "Purchase order has been marked as received"
|
|
85
85
|
},
|
|
86
|
-
[
|
|
86
|
+
[w.enum.approveRequest]: {
|
|
87
87
|
primaryActions: {
|
|
88
88
|
text: "Approve request",
|
|
89
89
|
close: !0
|
|
@@ -92,7 +92,7 @@ const Qe = Xe((m, R) => {
|
|
|
92
92
|
message: "Purchase order will be approved.",
|
|
93
93
|
successMessage: "Purchase order has been approved"
|
|
94
94
|
},
|
|
95
|
-
[
|
|
95
|
+
[w.enum.rejectRequest]: {
|
|
96
96
|
primaryActions: {
|
|
97
97
|
text: "Reject request",
|
|
98
98
|
close: !0,
|
|
@@ -103,19 +103,19 @@ const Qe = Xe((m, R) => {
|
|
|
103
103
|
successMessage: "Purchase order has been rejected"
|
|
104
104
|
}
|
|
105
105
|
}, me = B();
|
|
106
|
-
function Br(m,
|
|
107
|
-
const
|
|
108
|
-
|
|
106
|
+
function Br(m, _) {
|
|
107
|
+
const u = Ke(), s = be(), R = Ge(), S = nt(), q = ot(), $ = B(!1), d = Ve(), F = Ye(), i = B(new Array()), p = B(
|
|
108
|
+
_ != null && _.startDate && (_ != null && _.endDate) ? _ : Ze()
|
|
109
109
|
), h = V(() => {
|
|
110
|
-
const f = new Date(p.value.startDate),
|
|
110
|
+
const f = new Date(p.value.startDate), c = new Date(p.value.endDate);
|
|
111
111
|
return {
|
|
112
112
|
start: tt(f).toISOString(),
|
|
113
|
-
end: rt(
|
|
113
|
+
end: rt(c).toISOString()
|
|
114
114
|
};
|
|
115
|
-
}), g = B(new Array()),
|
|
115
|
+
}), g = B(new Array()), O = et(), G = B(null);
|
|
116
116
|
async function Se(f) {
|
|
117
|
-
let
|
|
118
|
-
if (
|
|
117
|
+
let c;
|
|
118
|
+
if (R.mustUsePoTemplate && !(f != null && f.template) && (c = await S.getTemplateId(), !c))
|
|
119
119
|
return;
|
|
120
120
|
const t = {
|
|
121
121
|
mode: Fe.CREATE,
|
|
@@ -124,13 +124,13 @@ function Br(m, R) {
|
|
|
124
124
|
"onUpdate:show"(e) {
|
|
125
125
|
me.value.show = e;
|
|
126
126
|
},
|
|
127
|
-
templateId:
|
|
127
|
+
templateId: c,
|
|
128
128
|
lastClosingDate: G.value
|
|
129
129
|
};
|
|
130
130
|
me.value = t;
|
|
131
131
|
}
|
|
132
132
|
function ie(f) {
|
|
133
|
-
const
|
|
133
|
+
const c = {
|
|
134
134
|
mode: Fe.UPDATE,
|
|
135
135
|
modelValue: Le(f),
|
|
136
136
|
show: !0,
|
|
@@ -139,14 +139,14 @@ function Br(m, R) {
|
|
|
139
139
|
},
|
|
140
140
|
lastClosingDate: G.value
|
|
141
141
|
};
|
|
142
|
-
me.value =
|
|
142
|
+
me.value = c;
|
|
143
143
|
}
|
|
144
|
-
async function
|
|
145
|
-
|
|
144
|
+
async function _e() {
|
|
145
|
+
i.value = [], $.value = !0;
|
|
146
146
|
try {
|
|
147
|
-
|
|
148
|
-
const f = await
|
|
149
|
-
|
|
147
|
+
i.value = await F.getPurchaseOrders(h.value).then((t) => t.sort((e, a) => a._id.localeCompare(e._id)));
|
|
148
|
+
const f = await O.readLastClosing(!0), c = f == null ? void 0 : f._id;
|
|
149
|
+
c && (G.value = at(c)), R.mustUsePoTemplate && await q.fetchTemplates();
|
|
150
150
|
} catch {
|
|
151
151
|
d.open({
|
|
152
152
|
title: "Something went wrong",
|
|
@@ -160,7 +160,7 @@ function Br(m, R) {
|
|
|
160
160
|
async function W() {
|
|
161
161
|
g.value = [], $.value = !0;
|
|
162
162
|
try {
|
|
163
|
-
g.value = await
|
|
163
|
+
g.value = await F.readRequests().then((f) => f.reverse());
|
|
164
164
|
} catch {
|
|
165
165
|
d.open({
|
|
166
166
|
title: "Something went wrong",
|
|
@@ -174,71 +174,71 @@ function Br(m, R) {
|
|
|
174
174
|
function ae() {
|
|
175
175
|
switch (m) {
|
|
176
176
|
case "receive/request":
|
|
177
|
-
return
|
|
177
|
+
return _e();
|
|
178
178
|
case "approval":
|
|
179
179
|
return W();
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function we(f, c) {
|
|
183
183
|
p.value = {
|
|
184
184
|
startDate: f,
|
|
185
|
-
endDate:
|
|
185
|
+
endDate: c
|
|
186
186
|
}, ae();
|
|
187
187
|
}
|
|
188
188
|
s.watchLocation(async (f) => {
|
|
189
189
|
if (!f) {
|
|
190
|
-
|
|
190
|
+
i.value = [];
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
193
|
await ae();
|
|
194
194
|
});
|
|
195
195
|
const Z = B(), fe = B(Math.random().toString());
|
|
196
|
-
async function X(f,
|
|
197
|
-
var o,
|
|
196
|
+
async function X(f, c) {
|
|
197
|
+
var o, P;
|
|
198
198
|
const t = Math.random().toString();
|
|
199
199
|
fe.value = t;
|
|
200
|
-
const e = m === "receive/request" ? s.currentLocation :
|
|
201
|
-
poRequest:
|
|
200
|
+
const e = m === "receive/request" ? s.currentLocation : c == null ? void 0 : c.to, a = {
|
|
201
|
+
poRequest: c,
|
|
202
202
|
purchaseOrder: f,
|
|
203
203
|
transferTo: e == null ? void 0 : e.name,
|
|
204
204
|
transferToDbName: e == null ? void 0 : e.dbName,
|
|
205
205
|
show: !0,
|
|
206
206
|
canResubmit: !1,
|
|
207
207
|
canApprove: m === "approval",
|
|
208
|
-
"onUpdate:show"(
|
|
209
|
-
Z.value.show =
|
|
208
|
+
"onUpdate:show"(A) {
|
|
209
|
+
Z.value.show = A;
|
|
210
210
|
}
|
|
211
211
|
};
|
|
212
|
-
if (Z.value = a, !(
|
|
212
|
+
if (Z.value = a, !(c || f.status !== U.enum.REQUESTING)) {
|
|
213
213
|
try {
|
|
214
|
-
|
|
214
|
+
c = (await F.readRequests(
|
|
215
215
|
`${f.supplier.internal}_${f.supplier._id}`
|
|
216
216
|
)).find((M) => M.purchaseOrderId === f._id);
|
|
217
217
|
} catch {
|
|
218
218
|
console.error("Error at fetching po request to check");
|
|
219
219
|
}
|
|
220
|
-
t === fe.value && (Z.value.canResubmit = !
|
|
220
|
+
t === fe.value && (Z.value.canResubmit = !c, Z.value.transferTo = (o = c == null ? void 0 : c.to) == null ? void 0 : o.name, Z.value.transferToDbName = (P = c == null ? void 0 : c.to) == null ? void 0 : P.dbName);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
async function ne(f,
|
|
223
|
+
async function ne(f, c, t, e) {
|
|
224
224
|
$.value = !0;
|
|
225
225
|
try {
|
|
226
|
-
await
|
|
226
|
+
await F.processPurchaseOrder(
|
|
227
227
|
{
|
|
228
|
-
operation:
|
|
228
|
+
operation: c,
|
|
229
229
|
doc: f,
|
|
230
230
|
options: (
|
|
231
231
|
// auto receive for supplier to warehouse
|
|
232
|
-
(
|
|
233
|
-
|
|
232
|
+
(c === w.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
233
|
+
c === w.enum.completeReceive) && R.autoReceiveWarehouse ? {
|
|
234
234
|
autoReceive: !0
|
|
235
235
|
} : void 0
|
|
236
236
|
)
|
|
237
237
|
},
|
|
238
238
|
e
|
|
239
|
-
), await new Promise((
|
|
239
|
+
), await new Promise((P) => setTimeout(P, 1e3));
|
|
240
240
|
const o = be().currentLocationDBName.startsWith("restaurant_");
|
|
241
|
-
|
|
241
|
+
c === w.enum.confirmDraft && f.effectiveAt && o ? d.open({
|
|
242
242
|
title: "Success",
|
|
243
243
|
message: `${t}. The backdate will be reflected once your POS has received this change.`,
|
|
244
244
|
type: "success"
|
|
@@ -252,34 +252,34 @@ function Br(m, R) {
|
|
|
252
252
|
title: "Something went wrong",
|
|
253
253
|
message: "Please try again.",
|
|
254
254
|
type: "error"
|
|
255
|
-
}), console.error("Error when submitting PO operation",
|
|
255
|
+
}), console.error("Error when submitting PO operation", c, f, a);
|
|
256
256
|
} finally {
|
|
257
257
|
$.value = !1, ae();
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
async function
|
|
261
|
-
const e =
|
|
260
|
+
async function Re(f, c, t) {
|
|
261
|
+
const e = Qe[c];
|
|
262
262
|
if (!e) {
|
|
263
263
|
d.open({
|
|
264
264
|
title: "Something went wrong",
|
|
265
|
-
message: `Cannot process order: ${je(
|
|
265
|
+
message: `Cannot process order: ${je(c)}`,
|
|
266
266
|
type: "error"
|
|
267
267
|
});
|
|
268
268
|
return;
|
|
269
269
|
}
|
|
270
270
|
const { successMessage: a, ...o } = e;
|
|
271
|
-
|
|
271
|
+
u.open({
|
|
272
272
|
title: o.title,
|
|
273
273
|
message: o.message,
|
|
274
274
|
primaryActions: o.primaryActions
|
|
275
275
|
}).onPrimary(() => {
|
|
276
|
-
ne(f,
|
|
276
|
+
ne(f, c, a, t);
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
279
|
return {
|
|
280
|
-
purchaseOrders:
|
|
280
|
+
purchaseOrders: i,
|
|
281
281
|
purchaseRequests: g,
|
|
282
|
-
updateDateRange:
|
|
282
|
+
updateDateRange: we,
|
|
283
283
|
fetchData: ae,
|
|
284
284
|
loading: $,
|
|
285
285
|
transferDialogProps: me,
|
|
@@ -287,29 +287,29 @@ function Br(m, R) {
|
|
|
287
287
|
promptUpdateTransferDialog: ie,
|
|
288
288
|
transferDetailsProps: Z,
|
|
289
289
|
promptShowTransferDetails: X,
|
|
290
|
-
submitAction:
|
|
290
|
+
submitAction: Re
|
|
291
291
|
};
|
|
292
292
|
}
|
|
293
|
-
function dt(m,
|
|
294
|
-
return
|
|
295
|
-
(s,
|
|
296
|
-
const S =
|
|
293
|
+
function dt(m, _) {
|
|
294
|
+
return _.reduce(
|
|
295
|
+
(s, R) => {
|
|
296
|
+
const S = R.received.find((q) => q.sku._id === m._id);
|
|
297
297
|
return S && (s = Oe(s, S.amount)), s;
|
|
298
298
|
},
|
|
299
299
|
it.toPrecision(he(0), m.unit.precision)
|
|
300
300
|
);
|
|
301
301
|
}
|
|
302
|
-
function mt(m,
|
|
303
|
-
const { name:
|
|
304
|
-
name:
|
|
305
|
-
registrationNumber:
|
|
302
|
+
function mt(m, _) {
|
|
303
|
+
const { name: u, address: s, regNo: R } = _.doc.profile, S = {
|
|
304
|
+
name: u,
|
|
305
|
+
registrationNumber: R,
|
|
306
306
|
line1: s == null ? void 0 : s.line1,
|
|
307
307
|
line2: s == null ? void 0 : s.line2,
|
|
308
308
|
postcode: s == null ? void 0 : s.postcode,
|
|
309
309
|
city: s == null ? void 0 : s.city,
|
|
310
310
|
state: s == null ? void 0 : s.state,
|
|
311
311
|
country: s == null ? void 0 : s.country
|
|
312
|
-
},
|
|
312
|
+
}, q = {
|
|
313
313
|
name: m.supplier.name,
|
|
314
314
|
registrationNumber: m.supplier.registrationNumber,
|
|
315
315
|
line1: m.supplier.address.line1,
|
|
@@ -319,7 +319,7 @@ function mt(m, R) {
|
|
|
319
319
|
state: m.supplier.address.state,
|
|
320
320
|
country: m.supplier.address.country
|
|
321
321
|
}, $ = m.items.map((p) => {
|
|
322
|
-
const { sku: h, measurement: g } = p,
|
|
322
|
+
const { sku: h, measurement: g } = p, O = le(
|
|
323
323
|
dt(p.sku, m.deliveryOrder || []),
|
|
324
324
|
!1
|
|
325
325
|
);
|
|
@@ -328,7 +328,7 @@ function mt(m, R) {
|
|
|
328
328
|
description: h.name,
|
|
329
329
|
quantity: He(p.quantity, h.unit, p.measurement),
|
|
330
330
|
unit: (g == null ? void 0 : g.abbrev) || h.unit.abbrev,
|
|
331
|
-
received:
|
|
331
|
+
received: O
|
|
332
332
|
};
|
|
333
333
|
}), d = m.deliveryOrder.map((p) => ({
|
|
334
334
|
createdAt: Be(new Date(p.createdAt)),
|
|
@@ -343,83 +343,83 @@ function mt(m, R) {
|
|
|
343
343
|
unit: ((g = h.measurement) == null ? void 0 : g.abbrev) || h.sku.unit.abbrev
|
|
344
344
|
};
|
|
345
345
|
})
|
|
346
|
-
})),
|
|
346
|
+
})), F = {
|
|
347
347
|
orderNumber: m.seqNumber.toString(),
|
|
348
348
|
createdAt: ge(m._id),
|
|
349
349
|
ref: m.ref || "",
|
|
350
350
|
remark: m.remark || "",
|
|
351
351
|
buyer: S,
|
|
352
|
-
supplier:
|
|
352
|
+
supplier: q,
|
|
353
353
|
items: $,
|
|
354
354
|
status: m.status,
|
|
355
355
|
deliveryOrders: d
|
|
356
|
-
},
|
|
357
|
-
|
|
356
|
+
}, i = new URL(window.location.href);
|
|
357
|
+
i.pathname = i.hostname.includes("inventory.feedme") ? "/receive-request/print-preview" : "/inventory/receive-request/print-preview", i.searchParams.append("data", JSON.stringify(F)), window.open(i.href, "_blank", "noreferrer");
|
|
358
358
|
}
|
|
359
359
|
const oe = {
|
|
360
360
|
submitRequest: {
|
|
361
361
|
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
362
362
|
color: "text-fm-color-typo-primary",
|
|
363
|
-
value:
|
|
363
|
+
value: w.enum.submitRequest
|
|
364
364
|
},
|
|
365
365
|
confirmDraft: {
|
|
366
366
|
translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
|
|
367
367
|
color: "text-fm-color-typo-primary",
|
|
368
|
-
value:
|
|
368
|
+
value: w.enum.confirmDraft
|
|
369
369
|
},
|
|
370
370
|
cancelDraft: {
|
|
371
371
|
translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
|
|
372
372
|
color: "text-fm-color-typo-error",
|
|
373
|
-
value:
|
|
373
|
+
value: w.enum.cancelDraft
|
|
374
374
|
},
|
|
375
375
|
approveRequest: {
|
|
376
376
|
translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
|
|
377
377
|
color: "text-fm-color-typo-primary",
|
|
378
|
-
value:
|
|
378
|
+
value: w.enum.approveRequest
|
|
379
379
|
},
|
|
380
380
|
rejectRequest: {
|
|
381
381
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
|
|
382
382
|
color: "text-fm-color-typo-error",
|
|
383
|
-
value:
|
|
383
|
+
value: w.enum.rejectRequest
|
|
384
384
|
},
|
|
385
385
|
processRequest: {
|
|
386
386
|
translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
|
|
387
387
|
color: "text-fm-color-typo-primary",
|
|
388
|
-
value:
|
|
388
|
+
value: w.enum.processRequest
|
|
389
389
|
},
|
|
390
390
|
receiveStock: {
|
|
391
391
|
translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
|
|
392
392
|
color: "text-fm-color-typo-primary",
|
|
393
|
-
value:
|
|
393
|
+
value: w.enum.receiveStock
|
|
394
394
|
},
|
|
395
395
|
completeReceive: {
|
|
396
396
|
translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
|
|
397
397
|
color: "text-fm-color-typo-primary",
|
|
398
|
-
value:
|
|
398
|
+
value: w.enum.completeReceive
|
|
399
399
|
}
|
|
400
400
|
};
|
|
401
|
-
function Kr(m,
|
|
402
|
-
const
|
|
403
|
-
function
|
|
404
|
-
switch (
|
|
401
|
+
function Kr(m, _) {
|
|
402
|
+
const u = be(), { t: s } = ze();
|
|
403
|
+
function R(i) {
|
|
404
|
+
switch (i.status) {
|
|
405
405
|
case "DRAFT":
|
|
406
406
|
return [
|
|
407
407
|
j[I.Update],
|
|
408
408
|
j[I.Details],
|
|
409
|
-
|
|
410
|
-
oe[
|
|
409
|
+
i.supplier.internal === "restaurant" || i.supplier.internal === "warehouse" ? oe[w.enum.submitRequest] : oe[w.enum.confirmDraft],
|
|
410
|
+
oe[w.enum.cancelDraft],
|
|
411
411
|
j[I.Print]
|
|
412
412
|
];
|
|
413
413
|
case "RECEIVING":
|
|
414
414
|
return [
|
|
415
|
-
oe[
|
|
415
|
+
oe[w.enum.completeReceive],
|
|
416
416
|
j[I.Details],
|
|
417
417
|
j[I.Print]
|
|
418
418
|
];
|
|
419
419
|
case "REQUESTING":
|
|
420
420
|
return m === "receive/request" ? [j[I.Details], j[I.Print]] : [
|
|
421
|
-
oe[
|
|
422
|
-
oe[
|
|
421
|
+
oe[w.enum.approveRequest],
|
|
422
|
+
oe[w.enum.rejectRequest],
|
|
423
423
|
j[I.Details],
|
|
424
424
|
j[I.Print]
|
|
425
425
|
];
|
|
@@ -431,26 +431,26 @@ function Kr(m, R) {
|
|
|
431
431
|
return [j[I.Details], j[I.Print]];
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
function S(
|
|
435
|
-
return Object.values(
|
|
434
|
+
function S(i) {
|
|
435
|
+
return Object.values(w.enum).includes(i);
|
|
436
436
|
}
|
|
437
|
-
async function
|
|
438
|
-
var
|
|
437
|
+
async function q(i, p, h) {
|
|
438
|
+
var O, G;
|
|
439
439
|
const g = Le(p);
|
|
440
|
-
if (
|
|
441
|
-
mt(g,
|
|
440
|
+
if (i === I.Print) {
|
|
441
|
+
mt(g, u.currentLocation);
|
|
442
442
|
return;
|
|
443
443
|
}
|
|
444
|
-
if (
|
|
445
|
-
|
|
444
|
+
if (i === I.Details) {
|
|
445
|
+
_.promptShowTransferDetails(g, h);
|
|
446
446
|
return;
|
|
447
447
|
}
|
|
448
|
-
if (
|
|
449
|
-
(
|
|
448
|
+
if (i === I.Update) {
|
|
449
|
+
(O = _.promptUpdateTransferDialog) == null || O.call(_, g);
|
|
450
450
|
return;
|
|
451
451
|
}
|
|
452
|
-
if (S(
|
|
453
|
-
|
|
452
|
+
if (S(i)) {
|
|
453
|
+
_.submitAction(p, i, (G = h == null ? void 0 : h.to) == null ? void 0 : G.dbName);
|
|
454
454
|
return;
|
|
455
455
|
}
|
|
456
456
|
}
|
|
@@ -466,8 +466,8 @@ function Kr(m, R) {
|
|
|
466
466
|
{
|
|
467
467
|
accessorKey: "_id",
|
|
468
468
|
header: () => s("inventory.transfer.table.createdAt"),
|
|
469
|
-
cell(
|
|
470
|
-
return ge(`${
|
|
469
|
+
cell(i) {
|
|
470
|
+
return ge(`${i.getValue()}`);
|
|
471
471
|
},
|
|
472
472
|
enableSorting: !0
|
|
473
473
|
},
|
|
@@ -494,8 +494,8 @@ function Kr(m, R) {
|
|
|
494
494
|
{
|
|
495
495
|
accessorKey: "status",
|
|
496
496
|
header: () => s("inventory.transfer.table.status"),
|
|
497
|
-
cell(
|
|
498
|
-
const p = s(`inventory.transfer.status.${
|
|
497
|
+
cell(i) {
|
|
498
|
+
const p = s(`inventory.transfer.status.${i.getValue() ?? ""}`), h = `${i.getValue() ?? ""}`.toLocaleLowerCase("en-us");
|
|
499
499
|
return ee(
|
|
500
500
|
"div",
|
|
501
501
|
{
|
|
@@ -515,9 +515,9 @@ function Kr(m, R) {
|
|
|
515
515
|
},
|
|
516
516
|
{
|
|
517
517
|
id: "action",
|
|
518
|
-
cell(
|
|
519
|
-
const p =
|
|
520
|
-
return
|
|
518
|
+
cell(i) {
|
|
519
|
+
const p = i.row.original, h = R(p);
|
|
520
|
+
return Me(h, (g) => q(g, p));
|
|
521
521
|
},
|
|
522
522
|
enableSorting: !1,
|
|
523
523
|
size: 40,
|
|
@@ -540,8 +540,8 @@ function Kr(m, R) {
|
|
|
540
540
|
{
|
|
541
541
|
accessorKey: "purchaseOrder._id",
|
|
542
542
|
header: () => s("inventory.transfer.table.createdAt"),
|
|
543
|
-
cell(
|
|
544
|
-
return ge(`${
|
|
543
|
+
cell(i) {
|
|
544
|
+
return ge(`${i.getValue()}`);
|
|
545
545
|
},
|
|
546
546
|
enableSorting: !0
|
|
547
547
|
},
|
|
@@ -565,8 +565,8 @@ function Kr(m, R) {
|
|
|
565
565
|
{
|
|
566
566
|
accessorKey: "purchaseOrder.status",
|
|
567
567
|
header: () => s("inventory.transfer.table.status"),
|
|
568
|
-
cell(
|
|
569
|
-
const p = s(`inventory.transfer.status.${
|
|
568
|
+
cell(i) {
|
|
569
|
+
const p = s(`inventory.transfer.status.${i.getValue() ?? ""}`), h = `${i.getValue() ?? ""}`.toLocaleLowerCase("en-us");
|
|
570
570
|
return ee(
|
|
571
571
|
"div",
|
|
572
572
|
{
|
|
@@ -585,11 +585,11 @@ function Kr(m, R) {
|
|
|
585
585
|
},
|
|
586
586
|
{
|
|
587
587
|
id: "action",
|
|
588
|
-
cell(
|
|
589
|
-
const p =
|
|
590
|
-
return
|
|
588
|
+
cell(i) {
|
|
589
|
+
const p = i.row.original, h = p.purchaseOrder ? R(p.purchaseOrder) : [];
|
|
590
|
+
return Me(
|
|
591
591
|
h,
|
|
592
|
-
(g) => p.purchaseOrder ?
|
|
592
|
+
(g) => p.purchaseOrder ? q(g, p.purchaseOrder, p) : void 0
|
|
593
593
|
);
|
|
594
594
|
},
|
|
595
595
|
enableSorting: !1,
|
|
@@ -601,32 +601,32 @@ function Kr(m, R) {
|
|
|
601
601
|
}
|
|
602
602
|
];
|
|
603
603
|
}
|
|
604
|
-
const
|
|
604
|
+
const F = V(() => m === "receive/request" ? $() : d());
|
|
605
605
|
return {
|
|
606
606
|
get columnDefs() {
|
|
607
|
-
return
|
|
607
|
+
return F.value;
|
|
608
608
|
}
|
|
609
609
|
};
|
|
610
610
|
}
|
|
611
611
|
const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
612
612
|
key: 0,
|
|
613
613
|
class: "flex flex-row-reverse"
|
|
614
|
-
}, vt = { class: "flex justify-between" }, yt = { class: "fm-typo-en-body-lg-600" }, ht = { class: "flex flex-col gap-8" }, bt = { class: "flex flex-col gap-4" }, gt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, St = { class: "flex gap-1" },
|
|
614
|
+
}, vt = { class: "flex justify-between" }, yt = { class: "fm-typo-en-body-lg-600" }, ht = { class: "flex flex-col gap-8" }, bt = { class: "flex flex-col gap-4" }, gt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, St = { class: "flex gap-1" }, _t = { class: "fm-typo-en-body-lg-600" }, wt = {
|
|
615
615
|
key: 0,
|
|
616
616
|
class: "flex flex-col gap-4"
|
|
617
|
-
},
|
|
617
|
+
}, Rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ot = { class: "fm-typo-en-body-lg-600" }, Dt = { class: "flex flex-col gap-4" }, kt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, At = { class: "fm-typo-en-body-lg-600" }, xt = {
|
|
618
618
|
key: 1,
|
|
619
619
|
class: "flex flex-col gap-4"
|
|
620
620
|
}, Nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, qt = { class: "fm-typo-en-body-lg-600" }, Pt = {
|
|
621
621
|
key: 2,
|
|
622
622
|
class: "flex flex-col gap-4"
|
|
623
|
-
},
|
|
623
|
+
}, Ct = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Tt = { class: "fm-typo-en-body-lg-600" }, Et = {
|
|
624
624
|
key: 3,
|
|
625
625
|
class: "flex flex-col gap-4"
|
|
626
626
|
}, $t = { class: "fm-typo-en-body-lg-600" }, It = {
|
|
627
627
|
key: 4,
|
|
628
628
|
class: "flex flex-col gap-4"
|
|
629
|
-
}, Ft = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
629
|
+
}, Ft = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mt = { class: "fm-typo-en-body-lg-600" }, Ut = {
|
|
630
630
|
key: 5,
|
|
631
631
|
class: "flex flex-col gap-4"
|
|
632
632
|
}, Lt = { class: "fm-typo-en-body-lg-600" }, jt = {
|
|
@@ -635,7 +635,7 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
635
635
|
}, Bt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Kt = { class: "fm-typo-en-body-lg-600" }, Vt = {
|
|
636
636
|
key: 7,
|
|
637
637
|
class: "flex flex-col gap-4"
|
|
638
|
-
}, Gt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ht = { class: "fm-typo-en-body-lg-600" }, zt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" },
|
|
638
|
+
}, Gt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ht = { class: "fm-typo-en-body-lg-600" }, zt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Yt = { class: "flex flex-col gap-8" }, Qt = { class: "fm-typo-en-body-lg-600" }, Wt = { class: "flex w-full gap-4" }, Jt = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, Zt = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, Xt = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, er = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, tr = {
|
|
639
639
|
key: 0,
|
|
640
640
|
class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
641
641
|
}, rr = { class: "py-8" }, sr = { class: "flex justify-end gap-4 items-center" }, ar = { class: "fm-typo-en-body-lg-600" }, nr = {
|
|
@@ -656,10 +656,10 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
656
656
|
}, yr = { class: "fm-typo-en-body-lg-400" }, hr = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, br = { class: "flex gap-12 content-stretch" }, gr = {
|
|
657
657
|
class: "flex flex-col w-24",
|
|
658
658
|
name: "circles"
|
|
659
|
-
}, Sr = { class: "flex-1 flex flex-col items-center" },
|
|
659
|
+
}, Sr = { class: "flex-1 flex flex-col items-center" }, _r = {
|
|
660
660
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
661
661
|
name: "delivery details"
|
|
662
|
-
},
|
|
662
|
+
}, wr = { class: "flex flex-col gap-8" }, Rr = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Or = { class: "flex flex-col gap-4" }, Dr = { class: "flex gap-8 xs:flex-col" }, Vr = /* @__PURE__ */ We({
|
|
663
663
|
__name: "TransferDetails",
|
|
664
664
|
props: {
|
|
665
665
|
poRequest: {},
|
|
@@ -671,15 +671,15 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
671
671
|
canApprove: { type: Boolean }
|
|
672
672
|
},
|
|
673
673
|
emits: ["update:show", "submitted"],
|
|
674
|
-
setup(m, { emit:
|
|
675
|
-
const
|
|
674
|
+
setup(m, { emit: _ }) {
|
|
675
|
+
const u = m, s = _, R = Ke(), S = Ve(), q = ut(), $ = Ge(), { t: d } = ze(), F = V(
|
|
676
676
|
() => {
|
|
677
677
|
var t, e, a, o;
|
|
678
|
-
return ((e = (t =
|
|
678
|
+
return ((e = (t = u.purchaseOrder) == null ? void 0 : t.supplier) == null ? void 0 : e.internal) === "restaurant" || ((o = (a = u.purchaseOrder) == null ? void 0 : a.supplier) == null ? void 0 : o.internal) === "warehouse" ? se.TRANSFER : se.PURCHASE;
|
|
679
679
|
}
|
|
680
|
-
),
|
|
680
|
+
), i = V(() => {
|
|
681
681
|
var t, e, a;
|
|
682
|
-
return
|
|
682
|
+
return F.value === se.TRANSFER && ((t = u.transferToDbName) == null ? void 0 : t.startsWith("restaurant")) && ((a = (e = u.purchaseOrder) == null ? void 0 : e.supplier) == null ? void 0 : a.internal) === "restaurant";
|
|
683
683
|
}), p = [
|
|
684
684
|
{
|
|
685
685
|
label: d("inventory.transfer.receiveRequest.details.overview"),
|
|
@@ -689,9 +689,9 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
689
689
|
label: d("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
690
690
|
value: "deliveryHistory"
|
|
691
691
|
}
|
|
692
|
-
], h = B(p[0]), g = B(!1),
|
|
693
|
-
async function
|
|
694
|
-
|
|
692
|
+
], h = B(p[0]), g = B(!1), O = B(""), G = B(!0), Se = Ye(), ie = st(u, "show");
|
|
693
|
+
async function _e(t, e, a) {
|
|
694
|
+
O.value = e, g.value = !0, G.value = !1;
|
|
695
695
|
try {
|
|
696
696
|
await Se.processPurchaseOrder(
|
|
697
697
|
{
|
|
@@ -699,13 +699,13 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
699
699
|
doc: t,
|
|
700
700
|
options: (
|
|
701
701
|
// auto receive for supplier to warehouse
|
|
702
|
-
(e ===
|
|
703
|
-
e ===
|
|
702
|
+
(e === w.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
703
|
+
e === w.enum.completeReceive) && $.autoReceiveWarehouse ? {
|
|
704
704
|
autoReceive: !0
|
|
705
705
|
} : void 0
|
|
706
706
|
)
|
|
707
707
|
},
|
|
708
|
-
|
|
708
|
+
u.transferToDbName
|
|
709
709
|
), await new Promise((o) => setTimeout(o, 1e3)), S.open({
|
|
710
710
|
title: "Success",
|
|
711
711
|
message: a,
|
|
@@ -718,11 +718,11 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
718
718
|
type: "error"
|
|
719
719
|
}), console.error("Error when submitting PO operation", e, t, o);
|
|
720
720
|
} finally {
|
|
721
|
-
|
|
721
|
+
O.value = "", g.value = !1, G.value = !0;
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
724
|
async function W(t) {
|
|
725
|
-
const e =
|
|
725
|
+
const e = Qe[t];
|
|
726
726
|
if (!e) {
|
|
727
727
|
S.open({
|
|
728
728
|
title: "Something went wrong",
|
|
@@ -732,57 +732,57 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
732
732
|
return;
|
|
733
733
|
}
|
|
734
734
|
const { successMessage: a, ...o } = e;
|
|
735
|
-
|
|
735
|
+
R.open({
|
|
736
736
|
title: o.title,
|
|
737
737
|
message: o.message,
|
|
738
738
|
primaryActions: o.primaryActions
|
|
739
739
|
}).onPrimary(() => {
|
|
740
|
-
|
|
740
|
+
u.purchaseOrder && _e(u.purchaseOrder, t, a);
|
|
741
741
|
});
|
|
742
742
|
}
|
|
743
743
|
const ae = V(() => {
|
|
744
744
|
var t, e;
|
|
745
|
-
return ((t =
|
|
746
|
-
}),
|
|
745
|
+
return ((t = u.purchaseOrder) == null ? void 0 : t.status) === U.enum.RECEIVING || ((e = u.purchaseOrder) == null ? void 0 : e.status) === U.enum.COMPLETE;
|
|
746
|
+
}), we = V(
|
|
747
747
|
() => {
|
|
748
|
-
var t, e, a, o,
|
|
749
|
-
return
|
|
750
|
-
((a = (e = (t =
|
|
748
|
+
var t, e, a, o, P, A;
|
|
749
|
+
return q.getLocationSubsidiary(
|
|
750
|
+
((a = (e = (t = u.purchaseOrder) == null ? void 0 : t.netSuite) == null ? void 0 : e.subsidiary) == null ? void 0 : a.id) || ((A = (P = (o = u.poRequest) == null ? void 0 : o.netSuite) == null ? void 0 : P.subsidiary) == null ? void 0 : A.id)
|
|
751
751
|
).fullName;
|
|
752
752
|
}
|
|
753
753
|
), Z = V(() => {
|
|
754
|
-
var t, e, a, o,
|
|
755
|
-
return (e = (t =
|
|
754
|
+
var t, e, a, o, P, A;
|
|
755
|
+
return (e = (t = u.purchaseOrder) == null ? void 0 : t.deliveryFullfillment) != null && e.length && ((o = (a = u.purchaseOrder) == null ? void 0 : a.deliveryFullfillment) == null ? void 0 : o.length) > 0 ? (A = (P = u.purchaseOrder) == null ? void 0 : P.deliveryFullfillment) == null ? void 0 : A.map((M) => {
|
|
756
756
|
var l;
|
|
757
757
|
return (l = M.netSuite) == null ? void 0 : l.refNo;
|
|
758
758
|
}).join(", ") : "-";
|
|
759
759
|
}), fe = V(() => {
|
|
760
|
-
var
|
|
761
|
-
const a = (((
|
|
762
|
-
(
|
|
763
|
-
const K =
|
|
764
|
-
return
|
|
760
|
+
var A, M, l;
|
|
761
|
+
const a = (((A = u.purchaseOrder) == null ? void 0 : A.deliveryOrder) ?? []).flatMap((x) => x.received ?? []).reduce(
|
|
762
|
+
(x, L) => {
|
|
763
|
+
const K = x[L.sku._id] ?? [];
|
|
764
|
+
return x[L.sku._id] = [...K, L], x;
|
|
765
765
|
},
|
|
766
766
|
{}
|
|
767
767
|
), o = Object.entries(a).reduce(
|
|
768
|
-
(
|
|
769
|
-
const
|
|
770
|
-
const
|
|
768
|
+
(x, [L, K]) => {
|
|
769
|
+
const k = K.reduce((b, C) => {
|
|
770
|
+
const T = lt(
|
|
771
771
|
b,
|
|
772
|
-
Math.max(b.precision,
|
|
772
|
+
Math.max(b.precision, C.amount.precision)
|
|
773
773
|
);
|
|
774
|
-
return Oe(
|
|
774
|
+
return Oe(T, C.amount);
|
|
775
775
|
}, he(0));
|
|
776
|
-
return
|
|
776
|
+
return x[L] = k, x;
|
|
777
777
|
},
|
|
778
778
|
{}
|
|
779
|
-
),
|
|
780
|
-
for (const
|
|
781
|
-
o[l =
|
|
779
|
+
), P = ((M = u.purchaseOrder) == null ? void 0 : M.items) ?? [];
|
|
780
|
+
for (const x of P)
|
|
781
|
+
o[l = x.sku._id] ?? (o[l] = he(0));
|
|
782
782
|
return o;
|
|
783
783
|
}), X = V(() => {
|
|
784
|
-
var
|
|
785
|
-
const t = ((
|
|
784
|
+
var A, M;
|
|
785
|
+
const t = ((A = u.purchaseOrder) == null ? void 0 : A.deliveryOrder) ?? [], e = ((M = u.purchaseOrder) == null ? void 0 : M.deliveryFullfillment) ?? [], a = [
|
|
786
786
|
...t.map((l) => ({
|
|
787
787
|
createdAt: l.createdAt,
|
|
788
788
|
type: "grn",
|
|
@@ -794,10 +794,10 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
794
794
|
doc: l
|
|
795
795
|
}))
|
|
796
796
|
];
|
|
797
|
-
a.reverse().sort((l,
|
|
797
|
+
a.reverse().sort((l, x) => l.createdAt.localeCompare(x.createdAt));
|
|
798
798
|
function o(l) {
|
|
799
|
-
var L, K,
|
|
800
|
-
const
|
|
799
|
+
var L, K, k, b, C, T, H;
|
|
800
|
+
const x = e.findIndex((E) => E.id === l.fullfillmentId);
|
|
801
801
|
return {
|
|
802
802
|
header: "Received",
|
|
803
803
|
date: Ie(new Date(l.createdAt)),
|
|
@@ -821,44 +821,44 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
821
821
|
label: "Remark",
|
|
822
822
|
values: [l.remark]
|
|
823
823
|
} : null,
|
|
824
|
-
|
|
824
|
+
x > -1 ? {
|
|
825
825
|
label: "Fulfilment's sequence",
|
|
826
|
-
values: [`${
|
|
826
|
+
values: [`${x + 1}`]
|
|
827
827
|
} : null,
|
|
828
|
-
(
|
|
828
|
+
(k = (K = e[x]) == null ? void 0 : K.netSuite) != null && k.refNo ? {
|
|
829
829
|
label: "Fulfillment's ref no. (Netsuite)",
|
|
830
|
-
values: [(
|
|
830
|
+
values: [(C = (b = e[x]) == null ? void 0 : b.netSuite) == null ? void 0 : C.refNo]
|
|
831
831
|
} : null,
|
|
832
|
-
(
|
|
832
|
+
(T = l == null ? void 0 : l.netSuite) != null && T.refNo ? {
|
|
833
833
|
label: "Item receipt (Netsuite)",
|
|
834
834
|
values: [(H = l == null ? void 0 : l.netSuite) == null ? void 0 : H.refNo]
|
|
835
835
|
} : null
|
|
836
836
|
].filter((E) => E)
|
|
837
837
|
};
|
|
838
838
|
}
|
|
839
|
-
function
|
|
839
|
+
function P(l) {
|
|
840
840
|
var L, K;
|
|
841
|
-
const
|
|
841
|
+
const x = e.findIndex((k) => k.id === l.id);
|
|
842
842
|
return {
|
|
843
843
|
header: "Fulfillment",
|
|
844
844
|
date: Ie(new Date(l.createdAt)),
|
|
845
845
|
info: [
|
|
846
846
|
{
|
|
847
847
|
label: "Sequence",
|
|
848
|
-
values: [String(
|
|
848
|
+
values: [String(x + 1)]
|
|
849
849
|
},
|
|
850
850
|
{
|
|
851
851
|
label: "Receiveable items",
|
|
852
|
-
values: l.items.map((
|
|
852
|
+
values: l.items.map((k) => {
|
|
853
853
|
var b;
|
|
854
|
-
return `(${
|
|
854
|
+
return `(${k.sku.code}) ${k.sku.name}: ${le(k.amount, !1)} ${((b = k.measurement) == null ? void 0 : b.abbrev) ?? k.sku.unit.abbrev}`;
|
|
855
855
|
})
|
|
856
856
|
},
|
|
857
857
|
(L = l.netSuite) != null && L.refNo ? {
|
|
858
858
|
label: "Ref no. (Netsuite)",
|
|
859
859
|
values: [(K = l.netSuite) == null ? void 0 : K.refNo]
|
|
860
860
|
} : null
|
|
861
|
-
].filter((
|
|
861
|
+
].filter((k) => k)
|
|
862
862
|
};
|
|
863
863
|
}
|
|
864
864
|
return a.map((l) => {
|
|
@@ -866,18 +866,18 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
866
866
|
case "grn":
|
|
867
867
|
return o(l.doc);
|
|
868
868
|
case "fulfillment":
|
|
869
|
-
return
|
|
869
|
+
return P(l.doc);
|
|
870
870
|
}
|
|
871
871
|
});
|
|
872
|
-
}), ne = B(!1),
|
|
873
|
-
var o, A,
|
|
872
|
+
}), ne = B(!1), Re = V(() => {
|
|
873
|
+
var o, P, A, M;
|
|
874
874
|
let t = !0;
|
|
875
|
-
|
|
876
|
-
const e =
|
|
877
|
-
return e && ((e == null ? void 0 : e.
|
|
875
|
+
q.isEnabled || (t = !1);
|
|
876
|
+
const e = u.purchaseOrder, a = u.poRequest;
|
|
877
|
+
return e && ((o = e == null ? void 0 : e.supplier) != null && o.internal ? (a && ((P = a == null ? void 0 : a.netSuite) != null && P.id || (t = !1)), i.value && (t = !1), console.log(t)) : ((e == null ? void 0 : e.status) !== U.enum.REQUESTING && e.supplier.internal && (t = !1), !a && !((A = e == null ? void 0 : e.netSuite) != null && A.id) && (t = !1), !a && ((M = e == null ? void 0 : e.netSuite) != null && M.id) && (e == null ? void 0 : e.status) == U.enum.REQUESTING && (t = !1))), t;
|
|
878
878
|
});
|
|
879
879
|
async function f() {
|
|
880
|
-
ne.value ||
|
|
880
|
+
ne.value || R.open({
|
|
881
881
|
title: "Sync with NetSuite",
|
|
882
882
|
contentComponent: ee("div", [
|
|
883
883
|
ee("p", "Are you sure you want to sync now?"),
|
|
@@ -895,11 +895,12 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
895
895
|
},
|
|
896
896
|
secondaryActions: { text: "Not now", close: !0 }
|
|
897
897
|
}).onPrimary(async () => {
|
|
898
|
-
var t
|
|
898
|
+
var t;
|
|
899
899
|
try {
|
|
900
900
|
ne.value = !0;
|
|
901
|
-
const
|
|
902
|
-
|
|
901
|
+
const e = u.purchaseOrder, a = u.poRequest;
|
|
902
|
+
let o = "purchaseOrder";
|
|
903
|
+
if ((t = e == null ? void 0 : e.supplier) != null && t.internal && (o = "purchaseOrderRequest"), !(e != null && e._id)) {
|
|
903
904
|
S.open({
|
|
904
905
|
title: "Error",
|
|
905
906
|
message: "Invalid sync ID",
|
|
@@ -907,7 +908,7 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
907
908
|
});
|
|
908
909
|
return;
|
|
909
910
|
}
|
|
910
|
-
await
|
|
911
|
+
await q.syncTransferOrder(o, e == null ? void 0 : e._id, a == null ? void 0 : a._id), S.open({
|
|
911
912
|
title: "Sync with NetSuite",
|
|
912
913
|
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
913
914
|
type: "success"
|
|
@@ -924,113 +925,113 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
924
925
|
}, 5e3);
|
|
925
926
|
});
|
|
926
927
|
}
|
|
927
|
-
const
|
|
928
|
+
const c = V(() => {
|
|
928
929
|
var e;
|
|
929
930
|
const t = {
|
|
930
931
|
...he(0),
|
|
931
932
|
currency: $e()
|
|
932
933
|
};
|
|
933
|
-
return ((e =
|
|
934
|
+
return ((e = u.purchaseOrder) == null ? void 0 : e.items.reduce((a, o) => ({
|
|
934
935
|
...Oe(a, o.totalCost ?? t),
|
|
935
936
|
currency: $e()
|
|
936
937
|
}), t)) ?? t;
|
|
937
938
|
});
|
|
938
939
|
return (t, e) => {
|
|
939
940
|
var L, K;
|
|
940
|
-
const a = te("FmButton"), o = te("FmButtonGroup"),
|
|
941
|
-
return y(), J(
|
|
941
|
+
const a = te("FmButton"), o = te("FmButtonGroup"), P = te("FmChip"), A = te("FmMenuDivider"), M = te("FmCard"), l = te("FmSpacer"), x = te("FmSideSheet");
|
|
942
|
+
return y(), J(x, {
|
|
942
943
|
header: n(d)("inventory.transfer.receiveRequest.details.title") + ((L = t.purchaseOrder) != null && L.seqNumber ? ` #${(K = t.purchaseOrder) == null ? void 0 : K.seqNumber}` : ""),
|
|
943
944
|
modelValue: n(ie),
|
|
944
|
-
"onUpdate:modelValue": e[9] || (e[9] = (
|
|
945
|
+
"onUpdate:modelValue": e[9] || (e[9] = (k) => Je(ie) ? ie.value = k : null),
|
|
945
946
|
"dismiss-away": G.value,
|
|
946
947
|
"close-button": "",
|
|
947
948
|
"max-width": 600
|
|
948
949
|
}, {
|
|
949
950
|
default: pe(() => {
|
|
950
|
-
var
|
|
951
|
+
var k;
|
|
951
952
|
return [
|
|
952
953
|
r("div", ft, [
|
|
953
|
-
|
|
954
|
-
|
|
954
|
+
Re.value ? (y(), D("div", pt, [
|
|
955
|
+
Q(a, {
|
|
955
956
|
"prepend-icon": "sync",
|
|
956
957
|
variant: "primary",
|
|
957
958
|
label: "NetSuite",
|
|
958
959
|
loading: ne.value,
|
|
959
960
|
onClick: f
|
|
960
961
|
}, null, 8, ["loading"])
|
|
961
|
-
])) :
|
|
962
|
+
])) : N("", !0),
|
|
962
963
|
r("div", null, [
|
|
963
|
-
|
|
964
|
+
Q(o, {
|
|
964
965
|
items: p,
|
|
965
966
|
modelValue: h.value,
|
|
966
967
|
"onUpdate:modelValue": e[0] || (e[0] = (b) => h.value = b)
|
|
967
968
|
}, null, 8, ["modelValue"])
|
|
968
969
|
]),
|
|
969
|
-
h.value.value === "overview" ? (y(),
|
|
970
|
+
h.value.value === "overview" ? (y(), D(re, { key: 1 }, [
|
|
970
971
|
r("div", null, [
|
|
971
|
-
|
|
972
|
+
Q(M, {
|
|
972
973
|
variant: "outlined",
|
|
973
974
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
974
975
|
}, {
|
|
975
976
|
default: pe(() => {
|
|
976
|
-
var b,
|
|
977
|
+
var b, C, T, H, E, z, ce, ue, de, Y, De, ke, Ae, xe, Ne, qe, Pe, Ce, Te, Ee;
|
|
977
978
|
return [
|
|
978
979
|
r("div", vt, [
|
|
979
980
|
r("div", yt, v(n(d)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
980
981
|
r("div", null, [
|
|
981
|
-
|
|
982
|
+
Q(P, {
|
|
982
983
|
label: n(d)(`inventory.transfer.status.${(b = t.purchaseOrder) == null ? void 0 : b.status}`),
|
|
983
|
-
class: ve(`fm-status-badge fm-status-badge-${(
|
|
984
|
+
class: ve(`fm-status-badge fm-status-badge-${(T = (C = t.purchaseOrder) == null ? void 0 : C.status) == null ? void 0 : T.toLocaleLowerCase("en-us")}`),
|
|
984
985
|
compact: ""
|
|
985
986
|
}, null, 8, ["label", "class"])
|
|
986
987
|
])
|
|
987
988
|
]),
|
|
988
|
-
|
|
989
|
+
Q(A),
|
|
989
990
|
r("div", ht, [
|
|
990
991
|
r("div", bt, [
|
|
991
992
|
r("div", gt, [
|
|
992
993
|
r("div", St, v(n(d)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
993
994
|
]),
|
|
994
|
-
r("div",
|
|
995
|
+
r("div", _t, v(n(ge)(((H = t.purchaseOrder) == null ? void 0 : H._id) ?? "")), 1)
|
|
995
996
|
]),
|
|
996
|
-
(E = t.purchaseOrder) != null && E.effectiveAt ? (y(),
|
|
997
|
-
r("div",
|
|
997
|
+
(E = t.purchaseOrder) != null && E.effectiveAt ? (y(), D("div", wt, [
|
|
998
|
+
r("div", Rt, v(n(d)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
998
999
|
r("div", Ot, v(n(Be)(new Date((z = t.purchaseOrder) == null ? void 0 : z.effectiveAt))), 1)
|
|
999
|
-
])) :
|
|
1000
|
+
])) : N("", !0),
|
|
1000
1001
|
r("div", Dt, [
|
|
1001
1002
|
r("div", kt, v(n(d)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
1002
1003
|
r("div", At, v(n(d)(
|
|
1003
|
-
`inventory.transfer.receiveRequest.details.type.${
|
|
1004
|
+
`inventory.transfer.receiveRequest.details.type.${F.value.toLocaleLowerCase("en-US")}`
|
|
1004
1005
|
)), 1)
|
|
1005
1006
|
]),
|
|
1006
|
-
(ue = (ce = t.purchaseOrder) == null ? void 0 : ce.supplier) != null && ue.name ? (y(),
|
|
1007
|
+
(ue = (ce = t.purchaseOrder) == null ? void 0 : ce.supplier) != null && ue.name ? (y(), D("div", xt, [
|
|
1007
1008
|
r("div", Nt, v(n(d)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1008
|
-
r("div", qt, v((
|
|
1009
|
-
])) :
|
|
1010
|
-
t.transferTo ? (y(),
|
|
1011
|
-
r("div",
|
|
1012
|
-
r("div",
|
|
1013
|
-
])) :
|
|
1014
|
-
n(
|
|
1009
|
+
r("div", qt, v((Y = (de = t.purchaseOrder) == null ? void 0 : de.supplier) == null ? void 0 : Y.name), 1)
|
|
1010
|
+
])) : N("", !0),
|
|
1011
|
+
t.transferTo ? (y(), D("div", Pt, [
|
|
1012
|
+
r("div", Ct, v(n(d)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
1013
|
+
r("div", Tt, v(t.transferTo), 1)
|
|
1014
|
+
])) : N("", !0),
|
|
1015
|
+
n(q).isEnabled ? (y(), D("div", Et, [
|
|
1015
1016
|
e[10] || (e[10] = r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite subsidiary ", -1)),
|
|
1016
|
-
r("div", $t, v(
|
|
1017
|
-
])) :
|
|
1018
|
-
n(
|
|
1019
|
-
r("div", Ft, " NetSuite " + v(
|
|
1020
|
-
r("div",
|
|
1021
|
-
])) :
|
|
1022
|
-
n(
|
|
1017
|
+
r("div", $t, v(we.value || "-"), 1)
|
|
1018
|
+
])) : N("", !0),
|
|
1019
|
+
n(q).isEnabled && !i.value ? (y(), D("div", It, [
|
|
1020
|
+
r("div", Ft, " NetSuite " + v(F.value === n(se).PURCHASE ? "Purchase order" : "Transfer order") + " (ID) ", 1),
|
|
1021
|
+
r("div", Mt, v(t.poRequest ? (ke = (De = t.poRequest) == null ? void 0 : De.netSuite) == null ? void 0 : ke.refNo : (xe = (Ae = t.purchaseOrder) == null ? void 0 : Ae.netSuite) == null ? void 0 : xe.refNo) + " (" + v(t.poRequest ? (qe = (Ne = t.poRequest) == null ? void 0 : Ne.netSuite) == null ? void 0 : qe.id : (Ce = (Pe = t.purchaseOrder) == null ? void 0 : Pe.netSuite) == null ? void 0 : Ce.id) + ") ", 1)
|
|
1022
|
+
])) : N("", !0),
|
|
1023
|
+
n(q).isEnabled && F.value === n(se).TRANSFER && !i.value ? (y(), D("div", Ut, [
|
|
1023
1024
|
e[11] || (e[11] = r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
1024
1025
|
r("div", Lt, v(Z.value), 1)
|
|
1025
|
-
])) :
|
|
1026
|
-
(
|
|
1026
|
+
])) : N("", !0),
|
|
1027
|
+
(Te = t.purchaseOrder) != null && Te.ref ? (y(), D("div", jt, [
|
|
1027
1028
|
r("div", Bt, v(n(d)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1028
1029
|
r("div", Kt, v(t.purchaseOrder.ref), 1)
|
|
1029
|
-
])) :
|
|
1030
|
-
(Ee = t.purchaseOrder) != null && Ee.remark ? (y(),
|
|
1030
|
+
])) : N("", !0),
|
|
1031
|
+
(Ee = t.purchaseOrder) != null && Ee.remark ? (y(), D("div", Vt, [
|
|
1031
1032
|
r("div", Gt, v(n(d)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1032
1033
|
r("div", Ht, v(t.purchaseOrder.remark), 1)
|
|
1033
|
-
])) :
|
|
1034
|
+
])) : N("", !0)
|
|
1034
1035
|
])
|
|
1035
1036
|
];
|
|
1036
1037
|
}),
|
|
@@ -1038,9 +1039,9 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
1038
1039
|
})
|
|
1039
1040
|
]),
|
|
1040
1041
|
r("div", zt, [
|
|
1041
|
-
r("div",
|
|
1042
|
-
r("div",
|
|
1043
|
-
(y(!0),
|
|
1042
|
+
r("div", Yt, [
|
|
1043
|
+
r("div", Qt, v(ae.value ? n(d)("inventory.transfer.receiveRequest.details.receivedItems") : n(d)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
1044
|
+
(y(!0), D(re, null, ye(((k = t.purchaseOrder) == null ? void 0 : k.items) ?? [], (b) => (y(), D("div", {
|
|
1044
1045
|
key: b.code,
|
|
1045
1046
|
class: "flex flex-col"
|
|
1046
1047
|
}, [
|
|
@@ -1050,32 +1051,32 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
1050
1051
|
]),
|
|
1051
1052
|
r("div", Xt, [
|
|
1052
1053
|
r("div", er, v(b.code), 1),
|
|
1053
|
-
b.totalCost && n($).enableTotalCost ? (y(),
|
|
1054
|
+
b.totalCost && n($).enableTotalCost ? (y(), D("div", tr, " (" + v(n(Ue)(b.totalCost)) + ") ", 1)) : N("", !0)
|
|
1054
1055
|
])
|
|
1055
1056
|
]))), 128)),
|
|
1056
|
-
+n(le)(
|
|
1057
|
+
+n(le)(c.value) ? (y(), D(re, { key: 0 }, [
|
|
1057
1058
|
r("div", rr, [
|
|
1058
|
-
|
|
1059
|
+
Q(A)
|
|
1059
1060
|
]),
|
|
1060
1061
|
r("div", sr, [
|
|
1061
1062
|
e[12] || (e[12] = r("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
|
|
1062
|
-
r("div", ar, v(n(
|
|
1063
|
+
r("div", ar, v(n(Ue)(c.value)), 1)
|
|
1063
1064
|
])
|
|
1064
|
-
], 64)) :
|
|
1065
|
+
], 64)) : N("", !0)
|
|
1065
1066
|
])
|
|
1066
1067
|
])
|
|
1067
|
-
], 64)) :
|
|
1068
|
-
h.value.value === "deliveryHistory" ? (y(),
|
|
1069
|
-
X.value.length ? (y(),
|
|
1070
|
-
(y(!0),
|
|
1068
|
+
], 64)) : N("", !0),
|
|
1069
|
+
h.value.value === "deliveryHistory" ? (y(), D("div", nr, [
|
|
1070
|
+
X.value.length ? (y(), D("div", ur, [
|
|
1071
|
+
(y(!0), D(re, null, ye(X.value, (b, C) => (y(), D(re, { key: C }, [
|
|
1071
1072
|
r("div", dr, [
|
|
1072
1073
|
r("div", mr, [
|
|
1073
1074
|
r("div", fr, [
|
|
1074
1075
|
r("div", {
|
|
1075
1076
|
class: ve([
|
|
1076
1077
|
{
|
|
1077
|
-
"bg-fm-color-primary":
|
|
1078
|
-
"bg-white":
|
|
1078
|
+
"bg-fm-color-primary": C !== 0,
|
|
1079
|
+
"bg-white": C === 0
|
|
1079
1080
|
},
|
|
1080
1081
|
"w-[2px] h-full"
|
|
1081
1082
|
])
|
|
@@ -1086,8 +1087,8 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
1086
1087
|
r("div", {
|
|
1087
1088
|
class: ve([
|
|
1088
1089
|
{
|
|
1089
|
-
"bg-fm-color-primary":
|
|
1090
|
-
"bg-white":
|
|
1090
|
+
"bg-fm-color-primary": C < X.value.length - 1,
|
|
1091
|
+
"bg-white": C >= X.value.length - 1
|
|
1091
1092
|
},
|
|
1092
1093
|
"w-[2px] h-full"
|
|
1093
1094
|
])
|
|
@@ -1105,28 +1106,28 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
1105
1106
|
r("div", {
|
|
1106
1107
|
class: ve([
|
|
1107
1108
|
{
|
|
1108
|
-
"bg-fm-color-primary":
|
|
1109
|
-
"bg-white":
|
|
1109
|
+
"bg-fm-color-primary": C < X.value.length - 1,
|
|
1110
|
+
"bg-white": C >= X.value.length - 1
|
|
1110
1111
|
},
|
|
1111
1112
|
"w-[2px] h-full"
|
|
1112
1113
|
])
|
|
1113
1114
|
}, null, 2)
|
|
1114
1115
|
])
|
|
1115
1116
|
]),
|
|
1116
|
-
r("div",
|
|
1117
|
-
|
|
1117
|
+
r("div", _r, [
|
|
1118
|
+
Q(M, {
|
|
1118
1119
|
variant: "outlined",
|
|
1119
1120
|
class: "py-12 px-16"
|
|
1120
1121
|
}, {
|
|
1121
1122
|
default: pe(() => [
|
|
1122
|
-
r("div",
|
|
1123
|
-
(y(!0),
|
|
1123
|
+
r("div", wr, [
|
|
1124
|
+
(y(!0), D(re, null, ye(b.info, (T, H) => (y(), D("div", {
|
|
1124
1125
|
key: H,
|
|
1125
1126
|
class: "flex flex-col gap-4"
|
|
1126
1127
|
}, [
|
|
1127
|
-
r("div",
|
|
1128
|
+
r("div", Rr, v(T == null ? void 0 : T.label), 1),
|
|
1128
1129
|
r("div", Or, [
|
|
1129
|
-
(y(!0),
|
|
1130
|
+
(y(!0), D(re, null, ye(T == null ? void 0 : T.values, (E, z) => (y(), D("div", {
|
|
1130
1131
|
key: z,
|
|
1131
1132
|
class: "fm-typo-en-body-lg-600"
|
|
1132
1133
|
}, v(E), 1))), 128))
|
|
@@ -1139,8 +1140,8 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
1139
1140
|
])
|
|
1140
1141
|
])
|
|
1141
1142
|
], 64))), 128))
|
|
1142
|
-
])) : (y(),
|
|
1143
|
-
|
|
1143
|
+
])) : (y(), D("div", or, [
|
|
1144
|
+
Q(l),
|
|
1144
1145
|
r("div", null, [
|
|
1145
1146
|
r("img", {
|
|
1146
1147
|
src: n(ct),
|
|
@@ -1149,74 +1150,74 @@ const ft = { class: "flex flex-col gap-16 w-full h-full" }, pt = {
|
|
|
1149
1150
|
]),
|
|
1150
1151
|
r("div", ir, v(n(d)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
1151
1152
|
r("div", cr, v(n(d)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
|
|
1152
|
-
|
|
1153
|
-
|
|
1153
|
+
Q(l),
|
|
1154
|
+
Q(l)
|
|
1154
1155
|
]))
|
|
1155
|
-
])) :
|
|
1156
|
+
])) : N("", !0)
|
|
1156
1157
|
])
|
|
1157
1158
|
];
|
|
1158
1159
|
}),
|
|
1159
1160
|
"side-sheet-footer": pe(() => {
|
|
1160
|
-
var
|
|
1161
|
+
var k, b, C, T, H, E, z, ce, ue, de;
|
|
1161
1162
|
return [
|
|
1162
1163
|
r("div", Dr, [
|
|
1163
|
-
((
|
|
1164
|
+
((k = t.purchaseOrder) == null ? void 0 : k.status) === n(U).enum.DRAFT && F.value === n(se).PURCHASE ? (y(), J(a, {
|
|
1164
1165
|
key: 0,
|
|
1165
1166
|
label: n(d)("inventory.transfer.receiveRequest.actions.confirmDraft"),
|
|
1166
|
-
onClick: e[1] || (e[1] = (
|
|
1167
|
-
loading:
|
|
1168
|
-
disabled:
|
|
1169
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
1170
|
-
((b = t.purchaseOrder) == null ? void 0 : b.status) === n(
|
|
1167
|
+
onClick: e[1] || (e[1] = (Y) => W("confirmDraft")),
|
|
1168
|
+
loading: O.value === "confirmDraft",
|
|
1169
|
+
disabled: O.value !== "confirmDraft" && g.value
|
|
1170
|
+
}, null, 8, ["label", "loading", "disabled"])) : N("", !0),
|
|
1171
|
+
((b = t.purchaseOrder) == null ? void 0 : b.status) === n(U).enum.DRAFT && F.value === n(se).TRANSFER ? (y(), J(a, {
|
|
1171
1172
|
key: 1,
|
|
1172
1173
|
label: n(d)("inventory.transfer.receiveRequest.actions.submitRequest"),
|
|
1173
|
-
onClick: e[2] || (e[2] = (
|
|
1174
|
-
loading:
|
|
1175
|
-
disabled:
|
|
1176
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
1177
|
-
((
|
|
1174
|
+
onClick: e[2] || (e[2] = (Y) => W("submitRequest")),
|
|
1175
|
+
loading: O.value === "submitRequest",
|
|
1176
|
+
disabled: O.value !== "submitRequest" && g.value
|
|
1177
|
+
}, null, 8, ["label", "loading", "disabled"])) : N("", !0),
|
|
1178
|
+
((C = t.purchaseOrder) == null ? void 0 : C.status) === n(U).enum.DRAFT ? (y(), J(a, {
|
|
1178
1179
|
key: 2,
|
|
1179
1180
|
label: n(d)("inventory.transfer.receiveRequest.actions.cancelDraft"),
|
|
1180
|
-
onClick: e[3] || (e[3] = (
|
|
1181
|
-
loading:
|
|
1182
|
-
disabled:
|
|
1181
|
+
onClick: e[3] || (e[3] = (Y) => W("cancelDraft")),
|
|
1182
|
+
loading: O.value === "cancelDraft",
|
|
1183
|
+
disabled: O.value !== "cancelDraft" && g.value,
|
|
1183
1184
|
variant: "destructive"
|
|
1184
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
1185
|
-
((
|
|
1185
|
+
}, null, 8, ["label", "loading", "disabled"])) : N("", !0),
|
|
1186
|
+
((T = t.purchaseOrder) == null ? void 0 : T.status) === n(U).enum.RECEIVING ? (y(), J(a, {
|
|
1186
1187
|
key: 3,
|
|
1187
1188
|
label: n(d)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
1188
|
-
onClick: e[4] || (e[4] = (
|
|
1189
|
-
loading:
|
|
1190
|
-
disabled:
|
|
1191
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
1189
|
+
onClick: e[4] || (e[4] = (Y) => W("completeReceive")),
|
|
1190
|
+
loading: O.value === "completeReceive",
|
|
1191
|
+
disabled: O.value !== "completeReceive" && g.value
|
|
1192
|
+
}, null, 8, ["label", "loading", "disabled"])) : N("", !0),
|
|
1192
1193
|
t.canResubmit ? (y(), J(a, {
|
|
1193
1194
|
key: 4,
|
|
1194
1195
|
label: n(d)("inventory.transfer.receiveRequest.actions.resubmitRequest"),
|
|
1195
|
-
onClick: e[5] || (e[5] = (
|
|
1196
|
-
loading:
|
|
1197
|
-
disabled:
|
|
1198
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
1199
|
-
(((H = t.purchaseOrder) == null ? void 0 : H.status) === n(
|
|
1196
|
+
onClick: e[5] || (e[5] = (Y) => W("submitRequest")),
|
|
1197
|
+
loading: O.value === "submitRequest",
|
|
1198
|
+
disabled: O.value !== "submitRequest" && g.value
|
|
1199
|
+
}, null, 8, ["label", "loading", "disabled"])) : N("", !0),
|
|
1200
|
+
(((H = t.purchaseOrder) == null ? void 0 : H.status) === n(U).enum.REQUESTING || ((E = t.purchaseOrder) == null ? void 0 : E.status) === n(U).enum.PROCESSING) && t.canApprove ? (y(), J(a, {
|
|
1200
1201
|
key: 5,
|
|
1201
1202
|
label: n(d)("inventory.transfer.approval.actions.approveRequest"),
|
|
1202
|
-
onClick: e[6] || (e[6] = (
|
|
1203
|
-
loading:
|
|
1204
|
-
disabled:
|
|
1205
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
1206
|
-
((z = t.purchaseOrder) == null ? void 0 : z.status) === n(
|
|
1203
|
+
onClick: e[6] || (e[6] = (Y) => W("approveRequest")),
|
|
1204
|
+
loading: O.value === "approveRequest",
|
|
1205
|
+
disabled: O.value !== "approveRequest" && g.value
|
|
1206
|
+
}, null, 8, ["label", "loading", "disabled"])) : N("", !0),
|
|
1207
|
+
((z = t.purchaseOrder) == null ? void 0 : z.status) === n(U).enum.REQUESTING && t.canApprove ? (y(), J(a, {
|
|
1207
1208
|
key: 6,
|
|
1208
1209
|
label: n(d)("inventory.transfer.approval.actions.rejectRequest"),
|
|
1209
|
-
onClick: e[7] || (e[7] = (
|
|
1210
|
-
loading:
|
|
1211
|
-
disabled:
|
|
1210
|
+
onClick: e[7] || (e[7] = (Y) => W("rejectRequest")),
|
|
1211
|
+
loading: O.value === "rejectRequest",
|
|
1212
|
+
disabled: O.value !== "rejectRequest" && g.value,
|
|
1212
1213
|
variant: "destructive"
|
|
1213
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
1214
|
-
((ce = t.purchaseOrder) == null ? void 0 : ce.status) !== n(
|
|
1214
|
+
}, null, 8, ["label", "loading", "disabled"])) : N("", !0),
|
|
1215
|
+
((ce = t.purchaseOrder) == null ? void 0 : ce.status) !== n(U).enum.COMPLETE && ((ue = t.purchaseOrder) == null ? void 0 : ue.status) !== n(U).enum.CANCEL && (((de = t.purchaseOrder) == null ? void 0 : de.status) !== n(U).enum.REQUESTING || t.canApprove) ? (y(), J(a, {
|
|
1215
1216
|
key: 7,
|
|
1216
1217
|
label: n(d)("common.close"),
|
|
1217
1218
|
variant: "tertiary",
|
|
1218
|
-
onClick: e[8] || (e[8] = (
|
|
1219
|
-
}, null, 8, ["label"])) :
|
|
1219
|
+
onClick: e[8] || (e[8] = (Y) => s("update:show", !1))
|
|
1220
|
+
}, null, 8, ["label"])) : N("", !0)
|
|
1220
1221
|
])
|
|
1221
1222
|
];
|
|
1222
1223
|
}),
|
|
@@ -1230,5 +1231,5 @@ export {
|
|
|
1230
1231
|
Br as a,
|
|
1231
1232
|
Kr as b,
|
|
1232
1233
|
dt as g,
|
|
1233
|
-
|
|
1234
|
+
Ye as u
|
|
1234
1235
|
};
|