@feedmepos/mf-inventory-portal 0.0.22-dev.34 → 0.0.22-dev.37
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/{ApprovalView-2pX2IV1F.js → ApprovalView-Dco0PkEf.js} +8 -8
- package/dist/{BindingsDialog-EyImpE9g.js → BindingsDialog-DrCU_kIA.js} +9 -9
- package/dist/{BindingsPicker-CbBNBcWW.js → BindingsPicker-BMIIrlG6.js} +17 -17
- package/dist/{BindingsTable-CJeV7Dd2.js → BindingsTable-BHRmkL1P.js} +1 -1
- package/dist/{ClosingTemplateView-BDEooji1.js → ClosingTemplateView-kiej8Nah.js} +15 -15
- package/dist/FmDroppableField-Bl7A98it.js +152 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DZtc5R4Z.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DQw4pBwH.js} +25 -25
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-z-BBBTkh.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DBh79EM_.js} +20 -20
- package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-3OkJNtvH.js +51 -0
- package/dist/IngredientsView-m44wAwSR.js +1611 -0
- package/dist/{IntegrationView-1lXCciJp.js → IntegrationView-B4gCx21K.js} +71 -71
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Bgd922-L.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D1frNXtV.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Bexig132.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Dbs29jm_.js} +16 -16
- package/dist/{PurchaseOrderPrintPreview-036mLqRD.js → PurchaseOrderPrintPreview-lKu0y_xw.js} +7 -7
- package/dist/ReceiveRequestView-DflWKxgq.js +4053 -0
- package/dist/{RecipeView-BuiA-2uY.js → RecipeView-DfsXdlPn.js} +30 -29
- package/dist/StockView-BSeSpxkV.js +7762 -0
- package/dist/{SupplierView-Ck5hH5gT.js → SupplierView-DPWh1si_.js} +11 -11
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DFDc3P3S.js → TransferDetails.vue_vue_type_script_setup_true_lang-Dt1lRW3W.js} +260 -262
- package/dist/TransferTemplateView-DGOT4oZN.js +2054 -0
- package/dist/{UnitView-DB2hQFMC.js → UnitView-X9bCqAWe.js} +16 -16
- package/dist/{WarehouseView-CFJiuhpx.js → WarehouseView-BphA-Peq.js} +20 -20
- package/dist/api/bill.d.ts +84 -238
- package/dist/api/purchase-order-template.d.ts +4 -2
- package/dist/{app-Z9P39kGh.js → app-DZiCiBV7.js} +18175 -18188
- package/dist/app.js +2 -2
- package/dist/{decimal-DIe_fFDH.js → decimal-Bx1Y3uW1.js} +1 -1
- package/dist/defineDeepModel-4XZbatJF.js +13 -0
- package/dist/format-time-from-id-CFJvgP70.js +15 -0
- package/dist/helper/xlsx.util.d.ts +7 -0
- package/dist/purchase-order-transaction-type-Ds7YRAAp.js +348 -0
- package/dist/stores/inventory.d.ts +63 -0
- package/dist/stores/location.d.ts +89 -0
- package/dist/stores/netsuite.d.ts +1 -0
- package/dist/stores/supplier.d.ts +120 -3
- package/dist/stores/warehouse.d.ts +7 -4
- package/dist/supplier-BhJT8KOX.js +70 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-template-enabled-locations-2-CeSeHnX0.js → use-template-enabled-locations-2-BrEPVOpT.js} +1 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +2 -2
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +2 -2
- package/dist/views/ingredients/composables/use-ingredient-form.d.ts +2 -2
- package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +44 -0
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +42 -34
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +75 -51
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +75 -51
- package/dist/views/recipe/composables/use-recipe-form.d.ts +2 -2
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +42 -119
- package/dist/views/stock/composables/use-stock-action.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImport.vue.d.ts +2 -0
- package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItem.vue.d.ts +12 -0
- package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItemProps.d.ts +9 -0
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +10 -6
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +1850 -5
- package/dist/views/transfer-template/helpers/import-export.helper.d.ts +76 -0
- package/dist/views/transfer-template/helpers/remove-deleted-skus.helper.d.ts +1 -230
- package/dist/views/unit/composables/use-unit-form.d.ts +2 -2
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +14 -8
- package/dist/{xlsx-DrDljHnF.js → xlsx-B9lpxKgq.js} +651 -651
- package/dist/xlsx.util-DP5wVnRT.js +78 -0
- package/package.json +1 -1
- package/dist/IngredientsView-BvKaI0nb.js +0 -1755
- package/dist/ReceiveRequestView-BGlxEJkh.js +0 -1626
- package/dist/StockView-BKX6NX-g.js +0 -1909
- package/dist/TransferTemplateView-ByYEje9E.js +0 -1237
- package/dist/defineDeepModel-DH8vhBpR.js +0 -13
- package/dist/format-time-from-id-CAjL4U2X.js +0 -15
- package/dist/purchase-order-transaction-type-BJDnbhdk.js +0 -338
- package/dist/supplier-wJJ7ATk2.js +0 -69
- package/dist/xlsx.util-BwF0vRjF.js +0 -109
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { ref as U, computed as Y, h as ce, defineComponent as Ue, resolveComponent as X, openBlock as v, createBlock as V, unref as
|
|
2
|
-
import { i as je } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import {
|
|
4
|
-
import { F as ke, D as
|
|
5
|
-
import { useDialog as
|
|
6
|
-
import { p as We, f as pe } from "./format-time-from-id-
|
|
7
|
-
import { b as Je, u as Xe, f as $e, P as me } from "./purchase-order-transaction-type-
|
|
8
|
-
import { c as
|
|
9
|
-
import { F as Ze } from "./decimal-
|
|
1
|
+
import { ref as U, computed as Y, h as ce, defineComponent as Ue, resolveComponent as X, openBlock as v, createBlock as V, unref as l, isRef as Le, withCtx as ie, createElementVNode as e, createVNode as z, createElementBlock as x, Fragment as ee, toDisplayString as y, normalizeClass as ue, createCommentVNode as P, renderList as de } from "vue";
|
|
2
|
+
import { i as je } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DBh79EM_.js";
|
|
3
|
+
import { n as Be, i as fe, ap as w, O as Ke, P as Ve, aq as Ge, c as xe, ab as I, w as qe, b as Pe, B as Ce, l as be, a as le, ar as Ne, N as He, G as ze, ad as Ye, Y as De } from "./app-DZiCiBV7.js";
|
|
4
|
+
import { F as ke, D as C, R as q } from "./row-action.enum-PMKMRrZR.js";
|
|
5
|
+
import { useDialog as Te, useSnackbar as Ee, useProxiedModel as Qe } from "@feedmepos/ui-library";
|
|
6
|
+
import { p as We, f as pe } from "./format-time-from-id-CFJvgP70.js";
|
|
7
|
+
import { b as Je, u as Xe, f as $e, P as me } from "./purchase-order-transaction-type-Ds7YRAAp.js";
|
|
8
|
+
import { c as Ae } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
9
|
+
import { F as Ze } from "./decimal-Bx1Y3uW1.js";
|
|
10
10
|
import { useI18n as Fe } from "@feedmepos/mf-common";
|
|
11
11
|
import { E as et } from "./empty-placeholder-wf6-BWE8.js";
|
|
12
|
-
const Ie = Be((u,
|
|
12
|
+
const Ie = Be((u, _) => {
|
|
13
13
|
const p = fe();
|
|
14
14
|
return {
|
|
15
15
|
async readRequests(r) {
|
|
16
16
|
const R = r ?? p.currentLocationDBName, O = `${u.inventoryBackendUrl}/${R}/purchase-request`;
|
|
17
|
-
return await
|
|
17
|
+
return await _.get(O);
|
|
18
18
|
},
|
|
19
19
|
async getPurchaseOrders({
|
|
20
20
|
start: r,
|
|
21
21
|
end: R
|
|
22
22
|
}) {
|
|
23
|
-
const O = p.currentLocationDBName,
|
|
24
|
-
return await
|
|
23
|
+
const O = p.currentLocationDBName, N = `${u.inventoryBackendUrl}/${O}/purchase-order`;
|
|
24
|
+
return await _.get(`${N}?start=${r}&end=${R}`);
|
|
25
25
|
},
|
|
26
26
|
async getPurchaseOrderById(r) {
|
|
27
27
|
const R = p.currentLocationDBName, O = `${u.inventoryBackendUrl}/${R}/purchase-order`;
|
|
28
|
-
return await
|
|
28
|
+
return await _.get(`${O}/${r}`);
|
|
29
29
|
},
|
|
30
30
|
async processPurchaseOrder(r, R) {
|
|
31
|
-
const O = p.currentLocationDBName,
|
|
32
|
-
return await
|
|
31
|
+
const O = p.currentLocationDBName, N = R || O, T = `${u.inventoryBackendUrl}/${N}/purchase-order/run-operation`;
|
|
32
|
+
return await _.put(T, r);
|
|
33
33
|
},
|
|
34
34
|
async createPurchaseOrder(r) {
|
|
35
35
|
const R = p.currentLocationDBName, O = `${u.inventoryBackendUrl}/${R}/purchase-order`;
|
|
36
|
-
return await
|
|
36
|
+
return await _.post(O, r);
|
|
37
37
|
},
|
|
38
38
|
async updatePurchaseOrder(r) {
|
|
39
39
|
const R = p.currentLocationDBName, O = `${u.inventoryBackendUrl}/${R}/purchase-order`;
|
|
40
|
-
return await
|
|
40
|
+
return await _.put(O, r);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
}), Me = {
|
|
44
|
-
[
|
|
44
|
+
[w.enum.confirmDraft]: {
|
|
45
45
|
primaryActions: {
|
|
46
46
|
text: "Confirm draft",
|
|
47
47
|
close: !0
|
|
@@ -50,7 +50,7 @@ const Ie = Be((u, g) => {
|
|
|
50
50
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
51
51
|
successMessage: "Purchase order draft has been confirmed"
|
|
52
52
|
},
|
|
53
|
-
[
|
|
53
|
+
[w.enum.cancelDraft]: {
|
|
54
54
|
primaryActions: {
|
|
55
55
|
text: "Cancel draft",
|
|
56
56
|
close: !0,
|
|
@@ -60,7 +60,7 @@ const Ie = Be((u, g) => {
|
|
|
60
60
|
message: "Purchase order cannot be changed after cancelled draft.",
|
|
61
61
|
successMessage: "Purchase order draft has been cancelled"
|
|
62
62
|
},
|
|
63
|
-
[
|
|
63
|
+
[w.enum.submitRequest]: {
|
|
64
64
|
primaryActions: {
|
|
65
65
|
text: "Submit request",
|
|
66
66
|
close: !0
|
|
@@ -69,7 +69,7 @@ const Ie = Be((u, g) => {
|
|
|
69
69
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
70
70
|
successMessage: "Purchase order draft has been submitted"
|
|
71
71
|
},
|
|
72
|
-
[
|
|
72
|
+
[w.enum.completeReceive]: {
|
|
73
73
|
primaryActions: {
|
|
74
74
|
text: "Mark received",
|
|
75
75
|
close: !0
|
|
@@ -78,7 +78,7 @@ const Ie = Be((u, g) => {
|
|
|
78
78
|
message: "Purchase order cannot be changed after it has complete receiving.",
|
|
79
79
|
successMessage: "Purchase order has been marked as received"
|
|
80
80
|
},
|
|
81
|
-
[
|
|
81
|
+
[w.enum.approveRequest]: {
|
|
82
82
|
primaryActions: {
|
|
83
83
|
text: "Approve request",
|
|
84
84
|
close: !0
|
|
@@ -87,7 +87,7 @@ const Ie = Be((u, g) => {
|
|
|
87
87
|
message: "Purchase order will be approved.",
|
|
88
88
|
successMessage: "Purchase order has been approved"
|
|
89
89
|
},
|
|
90
|
-
[
|
|
90
|
+
[w.enum.rejectRequest]: {
|
|
91
91
|
primaryActions: {
|
|
92
92
|
text: "Reject request",
|
|
93
93
|
close: !0,
|
|
@@ -98,52 +98,50 @@ const Ie = Be((u, g) => {
|
|
|
98
98
|
successMessage: "Purchase order has been rejected"
|
|
99
99
|
}
|
|
100
100
|
}, oe = U();
|
|
101
|
-
function Rr(u,
|
|
102
|
-
const p =
|
|
103
|
-
|
|
101
|
+
function Rr(u, _) {
|
|
102
|
+
const p = Te(), r = fe(), R = Pe(), O = Je(), N = Xe(), T = U(!1), i = Ee(), M = Ie(), c = U(new Array()), d = U(
|
|
103
|
+
_ != null && _.startDate && (_ != null && _.endDate) ? _ : je()
|
|
104
104
|
), m = Y(() => {
|
|
105
|
-
const t = new Date(d.value.startDate),
|
|
105
|
+
const t = new Date(d.value.startDate), n = new Date(d.value.endDate);
|
|
106
106
|
return {
|
|
107
107
|
start: Ke(t).toISOString(),
|
|
108
|
-
end: Ve(
|
|
108
|
+
end: Ve(n).toISOString()
|
|
109
109
|
};
|
|
110
110
|
}), f = U(new Array()), L = Ge(), G = U(null);
|
|
111
111
|
async function re(t) {
|
|
112
|
-
let
|
|
113
|
-
if (R.mustUsePoTemplate && !(t != null && t.template) && (
|
|
114
|
-
C.templates.value
|
|
115
|
-
), !l))
|
|
112
|
+
let n;
|
|
113
|
+
if (R.mustUsePoTemplate && !(t != null && t.template) && (n = await O.getTemplateId(), !n))
|
|
116
114
|
return;
|
|
117
|
-
const
|
|
115
|
+
const h = {
|
|
118
116
|
mode: ke.CREATE,
|
|
119
117
|
modelValue: t || void 0,
|
|
120
118
|
show: !0,
|
|
121
|
-
"onUpdate:show"(
|
|
122
|
-
oe.value.show =
|
|
119
|
+
"onUpdate:show"(g) {
|
|
120
|
+
oe.value.show = g;
|
|
123
121
|
},
|
|
124
|
-
templateId:
|
|
122
|
+
templateId: n,
|
|
125
123
|
lastClosingDate: G.value
|
|
126
124
|
};
|
|
127
|
-
oe.value =
|
|
125
|
+
oe.value = h;
|
|
128
126
|
}
|
|
129
127
|
function ve(t) {
|
|
130
|
-
const
|
|
128
|
+
const n = {
|
|
131
129
|
mode: ke.UPDATE,
|
|
132
|
-
modelValue:
|
|
130
|
+
modelValue: xe(t),
|
|
133
131
|
show: !0,
|
|
134
|
-
"onUpdate:show"(
|
|
135
|
-
oe.value.show =
|
|
132
|
+
"onUpdate:show"(h) {
|
|
133
|
+
oe.value.show = h;
|
|
136
134
|
},
|
|
137
135
|
lastClosingDate: G.value
|
|
138
136
|
};
|
|
139
|
-
oe.value =
|
|
137
|
+
oe.value = n;
|
|
140
138
|
}
|
|
141
139
|
async function B() {
|
|
142
|
-
c.value = [],
|
|
140
|
+
c.value = [], T.value = !0;
|
|
143
141
|
try {
|
|
144
|
-
c.value = await M.getPurchaseOrders(m.value).then((
|
|
145
|
-
const t = await L.readLastClosing(!0),
|
|
146
|
-
|
|
142
|
+
c.value = await M.getPurchaseOrders(m.value).then((h) => h.sort((g, o) => o._id.localeCompare(g._id)));
|
|
143
|
+
const t = await L.readLastClosing(!0), n = t == null ? void 0 : t._id;
|
|
144
|
+
n && (G.value = We(n)), R.mustUsePoTemplate && await N.fetchTemplates();
|
|
147
145
|
} catch {
|
|
148
146
|
i.open({
|
|
149
147
|
title: "Something went wrong",
|
|
@@ -151,11 +149,11 @@ function Rr(u, g) {
|
|
|
151
149
|
type: "error"
|
|
152
150
|
});
|
|
153
151
|
} finally {
|
|
154
|
-
|
|
152
|
+
T.value = !1;
|
|
155
153
|
}
|
|
156
154
|
}
|
|
157
155
|
async function ye() {
|
|
158
|
-
f.value = [],
|
|
156
|
+
f.value = [], T.value = !0;
|
|
159
157
|
try {
|
|
160
158
|
f.value = await M.readRequests().then((t) => t.reverse());
|
|
161
159
|
} catch {
|
|
@@ -165,7 +163,7 @@ function Rr(u, g) {
|
|
|
165
163
|
type: "error"
|
|
166
164
|
});
|
|
167
165
|
} finally {
|
|
168
|
-
|
|
166
|
+
T.value = !1;
|
|
169
167
|
}
|
|
170
168
|
}
|
|
171
169
|
function Z() {
|
|
@@ -176,10 +174,10 @@ function Rr(u, g) {
|
|
|
176
174
|
return ye();
|
|
177
175
|
}
|
|
178
176
|
}
|
|
179
|
-
function he(t,
|
|
177
|
+
function he(t, n) {
|
|
180
178
|
d.value = {
|
|
181
179
|
startDate: t,
|
|
182
|
-
endDate:
|
|
180
|
+
endDate: n
|
|
183
181
|
}, Z();
|
|
184
182
|
}
|
|
185
183
|
r.watchLocation(async (t) => {
|
|
@@ -190,15 +188,15 @@ function Rr(u, g) {
|
|
|
190
188
|
await Z();
|
|
191
189
|
});
|
|
192
190
|
const H = U(), K = U(Math.random().toString());
|
|
193
|
-
async function s(t,
|
|
194
|
-
var
|
|
195
|
-
const
|
|
196
|
-
K.value =
|
|
197
|
-
const
|
|
198
|
-
poRequest:
|
|
191
|
+
async function s(t, n) {
|
|
192
|
+
var b, S;
|
|
193
|
+
const h = Math.random().toString();
|
|
194
|
+
K.value = h;
|
|
195
|
+
const g = u === "receive/request" ? r.currentLocation : n == null ? void 0 : n.to, o = {
|
|
196
|
+
poRequest: n,
|
|
199
197
|
purchaseOrder: t,
|
|
200
|
-
transferTo:
|
|
201
|
-
transferToDbName:
|
|
198
|
+
transferTo: g == null ? void 0 : g.name,
|
|
199
|
+
transferToDbName: g == null ? void 0 : g.dbName,
|
|
202
200
|
show: !0,
|
|
203
201
|
canResubmit: !1,
|
|
204
202
|
canApprove: u === "approval",
|
|
@@ -206,71 +204,71 @@ function Rr(u, g) {
|
|
|
206
204
|
H.value.show = k;
|
|
207
205
|
}
|
|
208
206
|
};
|
|
209
|
-
if (H.value =
|
|
207
|
+
if (H.value = o, !(n || t.status !== I.enum.REQUESTING)) {
|
|
210
208
|
try {
|
|
211
|
-
|
|
209
|
+
n = (await M.readRequests(
|
|
212
210
|
`${t.supplier.internal}_${t.supplier._id}`
|
|
213
211
|
)).find(($) => $.purchaseOrderId === t._id);
|
|
214
212
|
} catch {
|
|
215
213
|
console.error("Error at fetching po request to check");
|
|
216
214
|
}
|
|
217
|
-
|
|
215
|
+
h === K.value && (H.value.canResubmit = !n, H.value.transferTo = (b = n == null ? void 0 : n.to) == null ? void 0 : b.name, H.value.transferToDbName = (S = n == null ? void 0 : n.to) == null ? void 0 : S.dbName);
|
|
218
216
|
}
|
|
219
217
|
}
|
|
220
|
-
async function a(t,
|
|
221
|
-
|
|
218
|
+
async function a(t, n, h, g) {
|
|
219
|
+
T.value = !0;
|
|
222
220
|
try {
|
|
223
221
|
await M.processPurchaseOrder(
|
|
224
222
|
{
|
|
225
|
-
operation:
|
|
223
|
+
operation: n,
|
|
226
224
|
doc: t,
|
|
227
225
|
options: (
|
|
228
226
|
// auto receive for supplier to warehouse
|
|
229
|
-
(
|
|
230
|
-
|
|
227
|
+
(n === w.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
228
|
+
n === w.enum.completeReceive) && R.autoReceiveWarehouse ? {
|
|
231
229
|
autoReceive: !0
|
|
232
230
|
} : void 0
|
|
233
231
|
)
|
|
234
232
|
},
|
|
235
|
-
|
|
233
|
+
g
|
|
236
234
|
), await new Promise((S) => setTimeout(S, 1e3));
|
|
237
|
-
const
|
|
238
|
-
|
|
235
|
+
const b = fe().currentLocationDBName.startsWith("restaurant_");
|
|
236
|
+
n === w.enum.confirmDraft && t.effectiveAt && b ? i.open({
|
|
239
237
|
title: "Success",
|
|
240
|
-
message: `${
|
|
238
|
+
message: `${h}. The backdate will be reflected once your POS has received this change.`,
|
|
241
239
|
type: "success"
|
|
242
240
|
}) : i.open({
|
|
243
241
|
title: "Success",
|
|
244
|
-
message:
|
|
242
|
+
message: h,
|
|
245
243
|
type: "success"
|
|
246
244
|
});
|
|
247
|
-
} catch (
|
|
245
|
+
} catch (o) {
|
|
248
246
|
i.open({
|
|
249
247
|
title: "Something went wrong",
|
|
250
248
|
message: "Please try again.",
|
|
251
249
|
type: "error"
|
|
252
|
-
}), console.error("Error when submitting PO operation",
|
|
250
|
+
}), console.error("Error when submitting PO operation", n, t, o);
|
|
253
251
|
} finally {
|
|
254
|
-
|
|
252
|
+
T.value = !1, Z();
|
|
255
253
|
}
|
|
256
254
|
}
|
|
257
|
-
async function
|
|
258
|
-
const
|
|
259
|
-
if (!
|
|
255
|
+
async function A(t, n, h) {
|
|
256
|
+
const g = Me[n];
|
|
257
|
+
if (!g) {
|
|
260
258
|
i.open({
|
|
261
259
|
title: "Something went wrong",
|
|
262
|
-
message: `Cannot process order: ${qe(
|
|
260
|
+
message: `Cannot process order: ${qe(n)}`,
|
|
263
261
|
type: "error"
|
|
264
262
|
});
|
|
265
263
|
return;
|
|
266
264
|
}
|
|
267
|
-
const { successMessage:
|
|
265
|
+
const { successMessage: o, ...b } = g;
|
|
268
266
|
p.open({
|
|
269
|
-
title:
|
|
270
|
-
message:
|
|
271
|
-
primaryActions:
|
|
267
|
+
title: b.title,
|
|
268
|
+
message: b.message,
|
|
269
|
+
primaryActions: b.primaryActions
|
|
272
270
|
}).onPrimary(() => {
|
|
273
|
-
a(t,
|
|
271
|
+
a(t, n, o, h);
|
|
274
272
|
});
|
|
275
273
|
}
|
|
276
274
|
return {
|
|
@@ -278,26 +276,26 @@ function Rr(u, g) {
|
|
|
278
276
|
purchaseRequests: f,
|
|
279
277
|
updateDateRange: he,
|
|
280
278
|
fetchData: Z,
|
|
281
|
-
loading:
|
|
279
|
+
loading: T,
|
|
282
280
|
transferDialogProps: oe,
|
|
283
281
|
promptCreateTransferDialog: re,
|
|
284
282
|
promptUpdateTransferDialog: ve,
|
|
285
283
|
transferDetailsProps: H,
|
|
286
284
|
promptShowTransferDetails: s,
|
|
287
|
-
submitAction:
|
|
285
|
+
submitAction: A
|
|
288
286
|
};
|
|
289
287
|
}
|
|
290
|
-
function tt(u,
|
|
291
|
-
return
|
|
288
|
+
function tt(u, _) {
|
|
289
|
+
return _.reduce(
|
|
292
290
|
(r, R) => {
|
|
293
|
-
const O = R.received.find((
|
|
291
|
+
const O = R.received.find((N) => N.sku._id === u._id);
|
|
294
292
|
return O && (r = Ce(r, O.amount)), r;
|
|
295
293
|
},
|
|
296
294
|
Ze.toPrecision(be(0), u.unit.precision)
|
|
297
295
|
);
|
|
298
296
|
}
|
|
299
|
-
function rt(u,
|
|
300
|
-
const { name: p, address: r, regNo: R } =
|
|
297
|
+
function rt(u, _) {
|
|
298
|
+
const { name: p, address: r, regNo: R } = _.doc.profile, O = {
|
|
301
299
|
name: p,
|
|
302
300
|
registrationNumber: R,
|
|
303
301
|
line1: r == null ? void 0 : r.line1,
|
|
@@ -306,7 +304,7 @@ function rt(u, g) {
|
|
|
306
304
|
city: r == null ? void 0 : r.city,
|
|
307
305
|
state: r == null ? void 0 : r.state,
|
|
308
306
|
country: r == null ? void 0 : r.country
|
|
309
|
-
},
|
|
307
|
+
}, N = {
|
|
310
308
|
name: u.supplier.name,
|
|
311
309
|
registrationNumber: u.supplier.registrationNumber,
|
|
312
310
|
line1: u.supplier.address.line1,
|
|
@@ -315,7 +313,7 @@ function rt(u, g) {
|
|
|
315
313
|
city: u.supplier.address.city,
|
|
316
314
|
state: u.supplier.address.state,
|
|
317
315
|
country: u.supplier.address.country
|
|
318
|
-
},
|
|
316
|
+
}, T = u.items.map((d) => {
|
|
319
317
|
const { sku: m, measurement: f } = d, L = le(
|
|
320
318
|
tt(d.sku, u.deliveryOrder || []),
|
|
321
319
|
!1
|
|
@@ -328,7 +326,7 @@ function rt(u, g) {
|
|
|
328
326
|
received: L
|
|
329
327
|
};
|
|
330
328
|
}), i = u.deliveryOrder.map((d) => ({
|
|
331
|
-
createdAt:
|
|
329
|
+
createdAt: Ne(new Date(d.createdAt)),
|
|
332
330
|
ref: d.deliveryOrderNumber,
|
|
333
331
|
remark: d.remark || "",
|
|
334
332
|
items: d.received.map((m) => {
|
|
@@ -346,8 +344,8 @@ function rt(u, g) {
|
|
|
346
344
|
ref: u.ref || "",
|
|
347
345
|
remark: u.remark || "",
|
|
348
346
|
buyer: O,
|
|
349
|
-
supplier:
|
|
350
|
-
items:
|
|
347
|
+
supplier: N,
|
|
348
|
+
items: T,
|
|
351
349
|
status: u.status,
|
|
352
350
|
deliveryOrders: i
|
|
353
351
|
}, c = new URL(window.location.href);
|
|
@@ -357,111 +355,111 @@ const te = {
|
|
|
357
355
|
submitRequest: {
|
|
358
356
|
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
359
357
|
color: "text-fm-color-typo-primary",
|
|
360
|
-
value:
|
|
358
|
+
value: w.enum.submitRequest
|
|
361
359
|
},
|
|
362
360
|
confirmDraft: {
|
|
363
361
|
translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
|
|
364
362
|
color: "text-fm-color-typo-primary",
|
|
365
|
-
value:
|
|
363
|
+
value: w.enum.confirmDraft
|
|
366
364
|
},
|
|
367
365
|
cancelDraft: {
|
|
368
366
|
translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
|
|
369
367
|
color: "text-fm-color-typo-error",
|
|
370
|
-
value:
|
|
368
|
+
value: w.enum.cancelDraft
|
|
371
369
|
},
|
|
372
370
|
approveRequest: {
|
|
373
371
|
translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
|
|
374
372
|
color: "text-fm-color-typo-primary",
|
|
375
|
-
value:
|
|
373
|
+
value: w.enum.approveRequest
|
|
376
374
|
},
|
|
377
375
|
rejectRequest: {
|
|
378
376
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
|
|
379
377
|
color: "text-fm-color-typo-error",
|
|
380
|
-
value:
|
|
378
|
+
value: w.enum.rejectRequest
|
|
381
379
|
},
|
|
382
380
|
processRequest: {
|
|
383
381
|
translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
|
|
384
382
|
color: "text-fm-color-typo-primary",
|
|
385
|
-
value:
|
|
383
|
+
value: w.enum.processRequest
|
|
386
384
|
},
|
|
387
385
|
receiveStock: {
|
|
388
386
|
translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
|
|
389
387
|
color: "text-fm-color-typo-primary",
|
|
390
|
-
value:
|
|
388
|
+
value: w.enum.receiveStock
|
|
391
389
|
},
|
|
392
390
|
completeReceive: {
|
|
393
391
|
translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
|
|
394
392
|
color: "text-fm-color-typo-primary",
|
|
395
|
-
value:
|
|
393
|
+
value: w.enum.completeReceive
|
|
396
394
|
}
|
|
397
395
|
};
|
|
398
|
-
function Or(u,
|
|
396
|
+
function Or(u, _) {
|
|
399
397
|
const p = fe(), { t: r } = Fe();
|
|
400
398
|
function R(c) {
|
|
401
399
|
switch (c.status) {
|
|
402
400
|
case "DRAFT":
|
|
403
401
|
return [
|
|
404
|
-
c.supplier.internal === "restaurant" || c.supplier.internal === "warehouse" ? te[
|
|
405
|
-
te[
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
402
|
+
c.supplier.internal === "restaurant" || c.supplier.internal === "warehouse" ? te[w.enum.submitRequest] : te[w.enum.confirmDraft],
|
|
403
|
+
te[w.enum.cancelDraft],
|
|
404
|
+
C[q.Update],
|
|
405
|
+
C[q.Details],
|
|
406
|
+
C[q.Print]
|
|
409
407
|
];
|
|
410
408
|
case "RECEIVING":
|
|
411
409
|
return [
|
|
412
|
-
te[
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
410
|
+
te[w.enum.completeReceive],
|
|
411
|
+
C[q.Update],
|
|
412
|
+
C[q.Details],
|
|
413
|
+
C[q.Print]
|
|
416
414
|
];
|
|
417
415
|
case "REQUESTING":
|
|
418
416
|
return u === "receive/request" ? [
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
417
|
+
C[q.Update],
|
|
418
|
+
C[q.Details],
|
|
419
|
+
C[q.Print]
|
|
422
420
|
] : [
|
|
423
|
-
te[
|
|
424
|
-
te[
|
|
425
|
-
|
|
426
|
-
|
|
421
|
+
te[w.enum.approveRequest],
|
|
422
|
+
te[w.enum.rejectRequest],
|
|
423
|
+
C[q.Details],
|
|
424
|
+
C[q.Print]
|
|
427
425
|
];
|
|
428
426
|
case "PROCESSING":
|
|
429
|
-
return [
|
|
427
|
+
return [C[q.Details], C[q.Print]];
|
|
430
428
|
case "COMPLETE":
|
|
431
429
|
return [
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
430
|
+
C[q.Update],
|
|
431
|
+
C[q.Details],
|
|
432
|
+
C[q.Print]
|
|
435
433
|
];
|
|
436
434
|
case "CANCEL":
|
|
437
435
|
default:
|
|
438
|
-
return [
|
|
436
|
+
return [C[q.Details], C[q.Print]];
|
|
439
437
|
}
|
|
440
438
|
}
|
|
441
439
|
function O(c) {
|
|
442
|
-
return Object.values(
|
|
440
|
+
return Object.values(w.enum).includes(c);
|
|
443
441
|
}
|
|
444
|
-
async function
|
|
442
|
+
async function N(c, d, m) {
|
|
445
443
|
var L, G;
|
|
446
|
-
const f =
|
|
444
|
+
const f = xe(d);
|
|
447
445
|
if (c === q.Print) {
|
|
448
446
|
rt(f, p.currentLocation);
|
|
449
447
|
return;
|
|
450
448
|
}
|
|
451
449
|
if (c === q.Details) {
|
|
452
|
-
|
|
450
|
+
_.promptShowTransferDetails(f, m);
|
|
453
451
|
return;
|
|
454
452
|
}
|
|
455
453
|
if (c === q.Update) {
|
|
456
|
-
(L =
|
|
454
|
+
(L = _.promptUpdateTransferDialog) == null || L.call(_, f);
|
|
457
455
|
return;
|
|
458
456
|
}
|
|
459
457
|
if (O(c)) {
|
|
460
|
-
|
|
458
|
+
_.submitAction(d, c, (G = m == null ? void 0 : m.to) == null ? void 0 : G.dbName);
|
|
461
459
|
return;
|
|
462
460
|
}
|
|
463
461
|
}
|
|
464
|
-
function
|
|
462
|
+
function T() {
|
|
465
463
|
return [
|
|
466
464
|
{
|
|
467
465
|
accessorKey: "seqNumber",
|
|
@@ -524,7 +522,7 @@ function Or(u, g) {
|
|
|
524
522
|
id: "action",
|
|
525
523
|
cell(c) {
|
|
526
524
|
const d = c.row.original, m = R(d);
|
|
527
|
-
return
|
|
525
|
+
return Ae(m, (f) => N(f, d));
|
|
528
526
|
},
|
|
529
527
|
enableSorting: !1,
|
|
530
528
|
size: 40,
|
|
@@ -594,9 +592,9 @@ function Or(u, g) {
|
|
|
594
592
|
id: "action",
|
|
595
593
|
cell(c) {
|
|
596
594
|
const d = c.row.original, m = d.purchaseOrder ? R(d.purchaseOrder) : [];
|
|
597
|
-
return
|
|
595
|
+
return Ae(
|
|
598
596
|
m,
|
|
599
|
-
(f) => d.purchaseOrder ?
|
|
597
|
+
(f) => d.purchaseOrder ? N(f, d.purchaseOrder, d) : void 0
|
|
600
598
|
);
|
|
601
599
|
},
|
|
602
600
|
enableSorting: !1,
|
|
@@ -608,7 +606,7 @@ function Or(u, g) {
|
|
|
608
606
|
}
|
|
609
607
|
];
|
|
610
608
|
}
|
|
611
|
-
const M = Y(() => u === "receive/request" ?
|
|
609
|
+
const M = Y(() => u === "receive/request" ? T() : i());
|
|
612
610
|
return {
|
|
613
611
|
get columnDefs() {
|
|
614
612
|
return M.value;
|
|
@@ -630,16 +628,16 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
630
628
|
}, St = { class: "fm-typo-en-body-lg-600" }, Dt = {
|
|
631
629
|
key: 4,
|
|
632
630
|
class: "flex flex-col gap-4"
|
|
633
|
-
}, kt = { class: "fm-typo-en-body-lg-600" },
|
|
631
|
+
}, kt = { class: "fm-typo-en-body-lg-600" }, At = {
|
|
634
632
|
key: 5,
|
|
635
633
|
class: "flex flex-col gap-4"
|
|
636
|
-
},
|
|
634
|
+
}, xt = { class: "fm-typo-en-body-lg-600" }, qt = {
|
|
637
635
|
key: 6,
|
|
638
636
|
class: "flex flex-col gap-4"
|
|
639
|
-
}, Pt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ct = { class: "fm-typo-en-body-lg-600" },
|
|
637
|
+
}, Pt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ct = { class: "fm-typo-en-body-lg-600" }, Nt = {
|
|
640
638
|
key: 7,
|
|
641
639
|
class: "flex flex-col gap-4"
|
|
642
|
-
},
|
|
640
|
+
}, Tt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Et = { class: "fm-typo-en-body-lg-600" }, $t = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Ft = { class: "flex flex-col gap-8" }, It = { class: "fm-typo-en-body-lg-600" }, Mt = { class: "flex w-full gap-4" }, Ut = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, Lt = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, jt = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Bt = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, Kt = {
|
|
643
641
|
key: 0,
|
|
644
642
|
class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
645
643
|
}, Vt = {
|
|
@@ -675,11 +673,11 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
675
673
|
canApprove: { type: Boolean }
|
|
676
674
|
},
|
|
677
675
|
emits: ["update:show", "submitted"],
|
|
678
|
-
setup(u, { emit:
|
|
679
|
-
const p = u, r =
|
|
676
|
+
setup(u, { emit: _ }) {
|
|
677
|
+
const p = u, r = _, R = Te(), O = Ee(), N = Ye(), T = Pe(), { t: i } = Fe(), M = Y(
|
|
680
678
|
() => {
|
|
681
|
-
var s, a,
|
|
682
|
-
return ((a = (s = p.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : a.internal) === "restaurant" || ((t = (
|
|
679
|
+
var s, a, A, t;
|
|
680
|
+
return ((a = (s = p.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : a.internal) === "restaurant" || ((t = (A = p.purchaseOrder) == null ? void 0 : A.supplier) == null ? void 0 : t.internal) === "warehouse" ? me.TRANSFER : me.PURCHASE;
|
|
683
681
|
}
|
|
684
682
|
), c = [
|
|
685
683
|
{
|
|
@@ -691,7 +689,7 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
691
689
|
value: "deliveryHistory"
|
|
692
690
|
}
|
|
693
691
|
], d = U(c[0]), m = U(!1), f = U(""), L = U(!0), G = Ie(), re = Qe(p, "show");
|
|
694
|
-
async function ve(s, a,
|
|
692
|
+
async function ve(s, a, A) {
|
|
695
693
|
f.value = a, m.value = !0, L.value = !1;
|
|
696
694
|
try {
|
|
697
695
|
await G.processPurchaseOrder(
|
|
@@ -700,8 +698,8 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
700
698
|
doc: s,
|
|
701
699
|
options: (
|
|
702
700
|
// auto receive for supplier to warehouse
|
|
703
|
-
(a ===
|
|
704
|
-
a ===
|
|
701
|
+
(a === w.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
702
|
+
a === w.enum.completeReceive) && T.autoReceiveWarehouse ? {
|
|
705
703
|
autoReceive: !0
|
|
706
704
|
} : void 0
|
|
707
705
|
)
|
|
@@ -709,7 +707,7 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
709
707
|
p.transferToDbName
|
|
710
708
|
), await new Promise((t) => setTimeout(t, 1e3)), O.open({
|
|
711
709
|
title: "Success",
|
|
712
|
-
message:
|
|
710
|
+
message: A,
|
|
713
711
|
type: "success"
|
|
714
712
|
}), r("update:show", !1), r("submitted");
|
|
715
713
|
} catch (t) {
|
|
@@ -732,13 +730,13 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
732
730
|
});
|
|
733
731
|
return;
|
|
734
732
|
}
|
|
735
|
-
const { successMessage:
|
|
733
|
+
const { successMessage: A, ...t } = a;
|
|
736
734
|
R.open({
|
|
737
735
|
title: t.title,
|
|
738
736
|
message: t.message,
|
|
739
737
|
primaryActions: t.primaryActions
|
|
740
738
|
}).onPrimary(() => {
|
|
741
|
-
p.purchaseOrder && ve(p.purchaseOrder, s,
|
|
739
|
+
p.purchaseOrder && ve(p.purchaseOrder, s, A);
|
|
742
740
|
});
|
|
743
741
|
}
|
|
744
742
|
const ye = Y(() => {
|
|
@@ -746,27 +744,27 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
746
744
|
return ((s = p.purchaseOrder) == null ? void 0 : s.status) === I.enum.RECEIVING || ((a = p.purchaseOrder) == null ? void 0 : a.status) === I.enum.COMPLETE;
|
|
747
745
|
}), Z = Y(
|
|
748
746
|
() => {
|
|
749
|
-
var s, a,
|
|
750
|
-
return
|
|
751
|
-
((a = (s = p.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : a.subsidiary.id) || ((
|
|
747
|
+
var s, a, A, t, n, h;
|
|
748
|
+
return N.getLocationSubsidiary(
|
|
749
|
+
((A = (a = (s = p.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : a.subsidiary) == null ? void 0 : A.id) || ((h = (n = (t = p.poRequest) == null ? void 0 : t.netSuite) == null ? void 0 : n.subsidiary) == null ? void 0 : h.id)
|
|
752
750
|
).fullName;
|
|
753
751
|
}
|
|
754
752
|
), he = Y(() => {
|
|
755
|
-
var s, a,
|
|
756
|
-
return (a = (s = p.purchaseOrder) == null ? void 0 : s.deliveryFullfillment) != null && a.length && ((t = (
|
|
757
|
-
var
|
|
758
|
-
return (
|
|
753
|
+
var s, a, A, t, n, h;
|
|
754
|
+
return (a = (s = p.purchaseOrder) == null ? void 0 : s.deliveryFullfillment) != null && a.length && ((t = (A = p.purchaseOrder) == null ? void 0 : A.deliveryFullfillment) == null ? void 0 : t.length) > 0 ? (h = (n = p.purchaseOrder) == null ? void 0 : n.deliveryFullfillment) == null ? void 0 : h.map((g) => {
|
|
755
|
+
var o;
|
|
756
|
+
return (o = g.netSuite) == null ? void 0 : o.refNo;
|
|
759
757
|
}).join(", ") : "-";
|
|
760
758
|
}), H = Y(() => {
|
|
761
|
-
var
|
|
762
|
-
const
|
|
763
|
-
(
|
|
764
|
-
const k =
|
|
765
|
-
return
|
|
759
|
+
var h, g, o;
|
|
760
|
+
const A = (((h = p.purchaseOrder) == null ? void 0 : h.deliveryOrder) ?? []).flatMap((b) => b.received ?? []).reduce(
|
|
761
|
+
(b, S) => {
|
|
762
|
+
const k = b[S.sku._id] ?? [];
|
|
763
|
+
return b[S.sku._id] = [...k, S], b;
|
|
766
764
|
},
|
|
767
765
|
{}
|
|
768
|
-
), t = Object.entries(
|
|
769
|
-
(
|
|
766
|
+
), t = Object.entries(A).reduce(
|
|
767
|
+
(b, [S, k]) => {
|
|
770
768
|
const $ = k.reduce((D, E) => {
|
|
771
769
|
const F = He(
|
|
772
770
|
D,
|
|
@@ -774,74 +772,74 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
774
772
|
);
|
|
775
773
|
return Ce(F, E.amount);
|
|
776
774
|
}, be(0));
|
|
777
|
-
return
|
|
775
|
+
return b[S] = $, b;
|
|
778
776
|
},
|
|
779
777
|
{}
|
|
780
|
-
),
|
|
781
|
-
for (const
|
|
782
|
-
t[
|
|
778
|
+
), n = ((g = p.purchaseOrder) == null ? void 0 : g.items) ?? [];
|
|
779
|
+
for (const b of n)
|
|
780
|
+
t[o = b.sku._id] ?? (t[o] = be(0));
|
|
783
781
|
return t;
|
|
784
782
|
}), K = Y(() => {
|
|
785
|
-
var
|
|
786
|
-
const s = ((
|
|
787
|
-
...s.map((
|
|
788
|
-
createdAt:
|
|
783
|
+
var h, g;
|
|
784
|
+
const s = ((h = p.purchaseOrder) == null ? void 0 : h.deliveryOrder) ?? [], a = ((g = p.purchaseOrder) == null ? void 0 : g.deliveryFullfillment) ?? [], A = [
|
|
785
|
+
...s.map((o) => ({
|
|
786
|
+
createdAt: o.createdAt,
|
|
789
787
|
type: "grn",
|
|
790
|
-
doc:
|
|
788
|
+
doc: o
|
|
791
789
|
})),
|
|
792
|
-
...a.map((
|
|
793
|
-
createdAt:
|
|
790
|
+
...a.map((o) => ({
|
|
791
|
+
createdAt: o.createdAt,
|
|
794
792
|
type: "fulfillment",
|
|
795
|
-
doc:
|
|
793
|
+
doc: o
|
|
796
794
|
}))
|
|
797
795
|
];
|
|
798
|
-
|
|
799
|
-
function t(
|
|
796
|
+
A.reverse().sort((o, b) => o.createdAt.localeCompare(b.createdAt));
|
|
797
|
+
function t(o) {
|
|
800
798
|
var S;
|
|
801
|
-
const
|
|
799
|
+
const b = a.findIndex((k) => k.id === o.fullfillmentId);
|
|
802
800
|
return {
|
|
803
801
|
header: "Received",
|
|
804
|
-
date: De(new Date(
|
|
802
|
+
date: De(new Date(o.createdAt)),
|
|
805
803
|
info: [
|
|
806
804
|
{
|
|
807
805
|
label: "Received by",
|
|
808
|
-
values: [(S =
|
|
806
|
+
values: [(S = o.createdBy) == null ? void 0 : S.name]
|
|
809
807
|
},
|
|
810
808
|
{
|
|
811
809
|
label: "Received items",
|
|
812
|
-
values:
|
|
810
|
+
values: o.received.map((k) => {
|
|
813
811
|
var $;
|
|
814
812
|
return `(${k.sku.code}) ${k.sku.name}: ${le(k.amount, !1)} ${(($ = k.measurement) == null ? void 0 : $.abbrev) ?? k.sku.unit.abbrev}`;
|
|
815
813
|
})
|
|
816
814
|
},
|
|
817
|
-
|
|
815
|
+
o.deliveryOrderNumber ? {
|
|
818
816
|
label: "Delivery order no.",
|
|
819
|
-
values: [
|
|
817
|
+
values: [o.deliveryOrderNumber]
|
|
820
818
|
} : null,
|
|
821
|
-
|
|
819
|
+
o.remark ? {
|
|
822
820
|
label: "Remark",
|
|
823
|
-
values: [
|
|
821
|
+
values: [o.remark]
|
|
824
822
|
} : null,
|
|
825
|
-
|
|
823
|
+
b > -1 ? {
|
|
826
824
|
label: "Fulfilment",
|
|
827
|
-
values: [`${
|
|
825
|
+
values: [`${b}`]
|
|
828
826
|
} : null
|
|
829
827
|
].filter((k) => k)
|
|
830
828
|
};
|
|
831
829
|
}
|
|
832
|
-
function
|
|
833
|
-
const
|
|
830
|
+
function n(o) {
|
|
831
|
+
const b = a.findIndex((S) => S.id === o.id);
|
|
834
832
|
return {
|
|
835
833
|
header: "Fulfillment",
|
|
836
|
-
date: De(new Date(
|
|
834
|
+
date: De(new Date(o.createdAt)),
|
|
837
835
|
info: [
|
|
838
836
|
{
|
|
839
837
|
label: "Sequence",
|
|
840
|
-
values: [String(
|
|
838
|
+
values: [String(b + 1)]
|
|
841
839
|
},
|
|
842
840
|
{
|
|
843
841
|
label: "Receiveable items",
|
|
844
|
-
values:
|
|
842
|
+
values: o.items.map((S) => {
|
|
845
843
|
var k;
|
|
846
844
|
return `(${S.sku.code}) ${S.sku.name}: ${le(S.amount, !1)} ${((k = S.measurement) == null ? void 0 : k.abbrev) ?? S.sku.unit.abbrev}`;
|
|
847
845
|
})
|
|
@@ -849,21 +847,21 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
849
847
|
]
|
|
850
848
|
};
|
|
851
849
|
}
|
|
852
|
-
return
|
|
853
|
-
switch (
|
|
850
|
+
return A.map((o) => {
|
|
851
|
+
switch (o.type) {
|
|
854
852
|
case "grn":
|
|
855
|
-
return t(
|
|
853
|
+
return t(o.doc);
|
|
856
854
|
case "fulfillment":
|
|
857
|
-
return
|
|
855
|
+
return n(o.doc);
|
|
858
856
|
}
|
|
859
857
|
});
|
|
860
858
|
});
|
|
861
859
|
return (s, a) => {
|
|
862
860
|
var S, k;
|
|
863
|
-
const
|
|
864
|
-
return v(), V(
|
|
865
|
-
header:
|
|
866
|
-
modelValue:
|
|
861
|
+
const A = X("FmButtonGroup"), t = X("FmChip"), n = X("FmMenuDivider"), h = X("FmCard"), g = X("FmSpacer"), o = X("FmButton"), b = X("FmSideSheet");
|
|
862
|
+
return v(), V(b, {
|
|
863
|
+
header: l(i)("inventory.transfer.receiveRequest.details.title") + ((S = s.purchaseOrder) != null && S.seqNumber ? ` #${(k = s.purchaseOrder) == null ? void 0 : k.seqNumber}` : ""),
|
|
864
|
+
modelValue: l(re),
|
|
867
865
|
"onUpdate:modelValue": a[9] || (a[9] = ($) => Le(re) ? re.value = $ : null),
|
|
868
866
|
"dismiss-away": L.value,
|
|
869
867
|
"close-button": "",
|
|
@@ -874,15 +872,15 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
874
872
|
return [
|
|
875
873
|
e("div", st, [
|
|
876
874
|
e("div", null, [
|
|
877
|
-
z(
|
|
875
|
+
z(A, {
|
|
878
876
|
items: c,
|
|
879
877
|
modelValue: d.value,
|
|
880
878
|
"onUpdate:modelValue": a[0] || (a[0] = (D) => d.value = D)
|
|
881
879
|
}, null, 8, ["modelValue"])
|
|
882
880
|
]),
|
|
883
|
-
d.value.value === "overview" ? (v(),
|
|
881
|
+
d.value.value === "overview" ? (v(), x(ee, { key: 0 }, [
|
|
884
882
|
e("div", null, [
|
|
885
|
-
z(
|
|
883
|
+
z(h, {
|
|
886
884
|
variant: "outlined",
|
|
887
885
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
888
886
|
}, {
|
|
@@ -890,59 +888,59 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
890
888
|
var D, E, F, Q, W, J, se, ae, ne, j, ge, _e, we, Re, Oe, Se;
|
|
891
889
|
return [
|
|
892
890
|
e("div", at, [
|
|
893
|
-
e("div", nt, y(
|
|
891
|
+
e("div", nt, y(l(i)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
894
892
|
e("div", null, [
|
|
895
893
|
z(t, {
|
|
896
|
-
label:
|
|
894
|
+
label: l(i)(`inventory.transfer.status.${(D = s.purchaseOrder) == null ? void 0 : D.status}`),
|
|
897
895
|
class: ue(`fm-status-badge fm-status-badge-${(F = (E = s.purchaseOrder) == null ? void 0 : E.status) == null ? void 0 : F.toLocaleLowerCase("en-us")}`),
|
|
898
896
|
compact: ""
|
|
899
897
|
}, null, 8, ["label", "class"])
|
|
900
898
|
])
|
|
901
899
|
]),
|
|
902
|
-
z(
|
|
900
|
+
z(n),
|
|
903
901
|
e("div", ot, [
|
|
904
902
|
e("div", lt, [
|
|
905
903
|
e("div", ct, [
|
|
906
|
-
e("div", it, y(
|
|
904
|
+
e("div", it, y(l(i)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
907
905
|
]),
|
|
908
|
-
e("div", ut, y(
|
|
906
|
+
e("div", ut, y(l(pe)(((Q = s.purchaseOrder) == null ? void 0 : Q._id) ?? "")), 1)
|
|
909
907
|
]),
|
|
910
|
-
(W = s.purchaseOrder) != null && W.effectiveAt ? (v(),
|
|
911
|
-
e("div", mt, y(
|
|
912
|
-
e("div", ft, y(
|
|
908
|
+
(W = s.purchaseOrder) != null && W.effectiveAt ? (v(), x("div", dt, [
|
|
909
|
+
e("div", mt, y(l(i)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
910
|
+
e("div", ft, y(l(Ne)(new Date((J = s.purchaseOrder) == null ? void 0 : J.effectiveAt))), 1)
|
|
913
911
|
])) : P("", !0),
|
|
914
912
|
e("div", pt, [
|
|
915
|
-
e("div", vt, y(
|
|
916
|
-
e("div", yt, y(
|
|
913
|
+
e("div", vt, y(l(i)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
914
|
+
e("div", yt, y(l(i)(
|
|
917
915
|
`inventory.transfer.receiveRequest.details.type.${M.value.toLocaleLowerCase("en-US")}`
|
|
918
916
|
)), 1)
|
|
919
917
|
]),
|
|
920
|
-
(ae = (se = s.purchaseOrder) == null ? void 0 : se.supplier) != null && ae.name ? (v(),
|
|
921
|
-
e("div", bt, y(
|
|
918
|
+
(ae = (se = s.purchaseOrder) == null ? void 0 : se.supplier) != null && ae.name ? (v(), x("div", ht, [
|
|
919
|
+
e("div", bt, y(l(i)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
922
920
|
e("div", gt, y((j = (ne = s.purchaseOrder) == null ? void 0 : ne.supplier) == null ? void 0 : j.name), 1)
|
|
923
921
|
])) : P("", !0),
|
|
924
|
-
s.transferTo ? (v(),
|
|
925
|
-
e("div", wt, y(
|
|
922
|
+
s.transferTo ? (v(), x("div", _t, [
|
|
923
|
+
e("div", wt, y(l(i)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
926
924
|
e("div", Rt, y(s.transferTo), 1)
|
|
927
925
|
])) : P("", !0),
|
|
928
|
-
|
|
926
|
+
l(N).isEnabled ? (v(), x("div", Ot, [
|
|
929
927
|
a[10] || (a[10] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Subsidiary ", -1)),
|
|
930
|
-
e("div", St, y(Z.value), 1)
|
|
928
|
+
e("div", St, y(Z.value || "-"), 1)
|
|
931
929
|
])) : P("", !0),
|
|
932
|
-
|
|
930
|
+
l(N).isEnabled ? (v(), x("div", Dt, [
|
|
933
931
|
a[11] || (a[11] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transfer Order ", -1)),
|
|
934
932
|
e("div", kt, y(((_e = (ge = s.purchaseOrder) == null ? void 0 : ge.netSuite) == null ? void 0 : _e.id) || ((Re = (we = s.poRequest) == null ? void 0 : we.netSuite) == null ? void 0 : Re.id) || "-"), 1)
|
|
935
933
|
])) : P("", !0),
|
|
936
|
-
|
|
934
|
+
l(N).isEnabled ? (v(), x("div", At, [
|
|
937
935
|
a[12] || (a[12] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Fulfilment IDs ", -1)),
|
|
938
|
-
e("div",
|
|
936
|
+
e("div", xt, y(he.value), 1)
|
|
939
937
|
])) : P("", !0),
|
|
940
|
-
(Oe = s.purchaseOrder) != null && Oe.ref ? (v(),
|
|
941
|
-
e("div", Pt, y(
|
|
938
|
+
(Oe = s.purchaseOrder) != null && Oe.ref ? (v(), x("div", qt, [
|
|
939
|
+
e("div", Pt, y(l(i)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
942
940
|
e("div", Ct, y(s.purchaseOrder.ref), 1)
|
|
943
941
|
])) : P("", !0),
|
|
944
|
-
(Se = s.purchaseOrder) != null && Se.remark ? (v(),
|
|
945
|
-
e("div",
|
|
942
|
+
(Se = s.purchaseOrder) != null && Se.remark ? (v(), x("div", Nt, [
|
|
943
|
+
e("div", Tt, y(l(i)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
946
944
|
e("div", Et, y(s.purchaseOrder.remark), 1)
|
|
947
945
|
])) : P("", !0)
|
|
948
946
|
])
|
|
@@ -953,26 +951,26 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
953
951
|
]),
|
|
954
952
|
e("div", $t, [
|
|
955
953
|
e("div", Ft, [
|
|
956
|
-
e("div", It, y(ye.value ?
|
|
957
|
-
(v(!0),
|
|
954
|
+
e("div", It, y(ye.value ? l(i)("inventory.transfer.receiveRequest.details.receivedItems") : l(i)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
955
|
+
(v(!0), x(ee, null, de((($ = s.purchaseOrder) == null ? void 0 : $.items) ?? [], (D) => (v(), x("div", {
|
|
958
956
|
key: D.code,
|
|
959
957
|
class: "flex flex-col"
|
|
960
958
|
}, [
|
|
961
959
|
e("div", Mt, [
|
|
962
960
|
e("div", Ut, y(D.name), 1),
|
|
963
|
-
e("div", Lt, y(
|
|
961
|
+
e("div", Lt, y(l(le)(H.value[D.sku._id], !1)) + "/" + y(l($e)(D.quantity, D.sku.unit, D.measurement)), 1)
|
|
964
962
|
]),
|
|
965
963
|
e("div", jt, [
|
|
966
964
|
e("div", Bt, y(D.code), 1),
|
|
967
|
-
D.totalCost &&
|
|
965
|
+
D.totalCost && l(T).enableTotalCost ? (v(), x("div", Kt, " (" + y(l(ze)(D.totalCost)) + ") ", 1)) : P("", !0)
|
|
968
966
|
])
|
|
969
967
|
]))), 128))
|
|
970
968
|
])
|
|
971
969
|
])
|
|
972
970
|
], 64)) : P("", !0),
|
|
973
|
-
d.value.value === "deliveryHistory" ? (v(),
|
|
974
|
-
K.value.length ? (v(),
|
|
975
|
-
(v(!0),
|
|
971
|
+
d.value.value === "deliveryHistory" ? (v(), x("div", Vt, [
|
|
972
|
+
K.value.length ? (v(), x("div", Qt, [
|
|
973
|
+
(v(!0), x(ee, null, de(K.value, (D, E) => (v(), x(ee, { key: E }, [
|
|
976
974
|
e("div", Wt, [
|
|
977
975
|
e("div", Jt, [
|
|
978
976
|
e("div", Xt, [
|
|
@@ -1019,19 +1017,19 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
1019
1017
|
])
|
|
1020
1018
|
]),
|
|
1021
1019
|
e("div", or, [
|
|
1022
|
-
z(
|
|
1020
|
+
z(h, {
|
|
1023
1021
|
variant: "outlined",
|
|
1024
1022
|
class: "py-12 px-16"
|
|
1025
1023
|
}, {
|
|
1026
1024
|
default: ie(() => [
|
|
1027
1025
|
e("div", lr, [
|
|
1028
|
-
(v(!0),
|
|
1026
|
+
(v(!0), x(ee, null, de(D.info, (F, Q) => (v(), x("div", {
|
|
1029
1027
|
key: Q,
|
|
1030
1028
|
class: "flex flex-col gap-4"
|
|
1031
1029
|
}, [
|
|
1032
1030
|
e("div", cr, y(F == null ? void 0 : F.label), 1),
|
|
1033
1031
|
e("div", ir, [
|
|
1034
|
-
(v(!0),
|
|
1032
|
+
(v(!0), x(ee, null, de(F == null ? void 0 : F.values, (W, J) => (v(), x("div", {
|
|
1035
1033
|
key: J,
|
|
1036
1034
|
class: "fm-typo-en-body-lg-600"
|
|
1037
1035
|
}, y(W), 1))), 128))
|
|
@@ -1044,18 +1042,18 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
1044
1042
|
])
|
|
1045
1043
|
])
|
|
1046
1044
|
], 64))), 128))
|
|
1047
|
-
])) : (v(),
|
|
1048
|
-
z(
|
|
1045
|
+
])) : (v(), x("div", Gt, [
|
|
1046
|
+
z(g),
|
|
1049
1047
|
e("div", null, [
|
|
1050
1048
|
e("img", {
|
|
1051
|
-
src:
|
|
1049
|
+
src: l(et),
|
|
1052
1050
|
alt: "List is empty"
|
|
1053
1051
|
}, null, 8, Ht)
|
|
1054
1052
|
]),
|
|
1055
|
-
e("div", zt, y(
|
|
1056
|
-
e("div", Yt, y(
|
|
1057
|
-
z(
|
|
1058
|
-
z(
|
|
1053
|
+
e("div", zt, y(l(i)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
1054
|
+
e("div", Yt, y(l(i)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
|
|
1055
|
+
z(g),
|
|
1056
|
+
z(g)
|
|
1059
1057
|
]))
|
|
1060
1058
|
])) : P("", !0)
|
|
1061
1059
|
])
|
|
@@ -1065,60 +1063,60 @@ const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex
|
|
|
1065
1063
|
var $, D, E, F, Q, W, J, se, ae, ne;
|
|
1066
1064
|
return [
|
|
1067
1065
|
e("div", ur, [
|
|
1068
|
-
(($ = s.purchaseOrder) == null ? void 0 : $.status) ===
|
|
1066
|
+
(($ = s.purchaseOrder) == null ? void 0 : $.status) === l(I).enum.DRAFT && M.value === l(me).PURCHASE ? (v(), V(o, {
|
|
1069
1067
|
key: 0,
|
|
1070
|
-
label:
|
|
1068
|
+
label: l(i)("inventory.transfer.receiveRequest.actions.confirmDraft"),
|
|
1071
1069
|
onClick: a[1] || (a[1] = (j) => B("confirmDraft")),
|
|
1072
1070
|
loading: f.value === "confirmDraft",
|
|
1073
1071
|
disabled: f.value !== "confirmDraft" && m.value
|
|
1074
1072
|
}, null, 8, ["label", "loading", "disabled"])) : P("", !0),
|
|
1075
|
-
((D = s.purchaseOrder) == null ? void 0 : D.status) ===
|
|
1073
|
+
((D = s.purchaseOrder) == null ? void 0 : D.status) === l(I).enum.DRAFT && M.value === l(me).TRANSFER ? (v(), V(o, {
|
|
1076
1074
|
key: 1,
|
|
1077
|
-
label:
|
|
1075
|
+
label: l(i)("inventory.transfer.receiveRequest.actions.submitRequest"),
|
|
1078
1076
|
onClick: a[2] || (a[2] = (j) => B("submitRequest")),
|
|
1079
1077
|
loading: f.value === "submitRequest",
|
|
1080
1078
|
disabled: f.value !== "submitRequest" && m.value
|
|
1081
1079
|
}, null, 8, ["label", "loading", "disabled"])) : P("", !0),
|
|
1082
|
-
((E = s.purchaseOrder) == null ? void 0 : E.status) ===
|
|
1080
|
+
((E = s.purchaseOrder) == null ? void 0 : E.status) === l(I).enum.DRAFT ? (v(), V(o, {
|
|
1083
1081
|
key: 2,
|
|
1084
|
-
label:
|
|
1082
|
+
label: l(i)("inventory.transfer.receiveRequest.actions.cancelDraft"),
|
|
1085
1083
|
onClick: a[3] || (a[3] = (j) => B("cancelDraft")),
|
|
1086
1084
|
loading: f.value === "cancelDraft",
|
|
1087
1085
|
disabled: f.value !== "cancelDraft" && m.value,
|
|
1088
1086
|
variant: "destructive"
|
|
1089
1087
|
}, null, 8, ["label", "loading", "disabled"])) : P("", !0),
|
|
1090
|
-
((F = s.purchaseOrder) == null ? void 0 : F.status) ===
|
|
1088
|
+
((F = s.purchaseOrder) == null ? void 0 : F.status) === l(I).enum.RECEIVING ? (v(), V(o, {
|
|
1091
1089
|
key: 3,
|
|
1092
|
-
label:
|
|
1090
|
+
label: l(i)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
1093
1091
|
onClick: a[4] || (a[4] = (j) => B("completeReceive")),
|
|
1094
1092
|
loading: f.value === "completeReceive",
|
|
1095
1093
|
disabled: f.value !== "completeReceive" && m.value
|
|
1096
1094
|
}, null, 8, ["label", "loading", "disabled"])) : P("", !0),
|
|
1097
|
-
s.canResubmit ? (v(), V(
|
|
1095
|
+
s.canResubmit ? (v(), V(o, {
|
|
1098
1096
|
key: 4,
|
|
1099
|
-
label:
|
|
1097
|
+
label: l(i)("inventory.transfer.receiveRequest.actions.resubmitRequest"),
|
|
1100
1098
|
onClick: a[5] || (a[5] = (j) => B("submitRequest")),
|
|
1101
1099
|
loading: f.value === "submitRequest",
|
|
1102
1100
|
disabled: f.value !== "submitRequest" && m.value
|
|
1103
1101
|
}, null, 8, ["label", "loading", "disabled"])) : P("", !0),
|
|
1104
|
-
(((Q = s.purchaseOrder) == null ? void 0 : Q.status) ===
|
|
1102
|
+
(((Q = s.purchaseOrder) == null ? void 0 : Q.status) === l(I).enum.REQUESTING || ((W = s.purchaseOrder) == null ? void 0 : W.status) === l(I).enum.PROCESSING) && s.canApprove ? (v(), V(o, {
|
|
1105
1103
|
key: 5,
|
|
1106
|
-
label:
|
|
1104
|
+
label: l(i)("inventory.transfer.approval.actions.approveRequest"),
|
|
1107
1105
|
onClick: a[6] || (a[6] = (j) => B("approveRequest")),
|
|
1108
1106
|
loading: f.value === "approveRequest",
|
|
1109
1107
|
disabled: f.value !== "approveRequest" && m.value
|
|
1110
1108
|
}, null, 8, ["label", "loading", "disabled"])) : P("", !0),
|
|
1111
|
-
((J = s.purchaseOrder) == null ? void 0 : J.status) ===
|
|
1109
|
+
((J = s.purchaseOrder) == null ? void 0 : J.status) === l(I).enum.REQUESTING && s.canApprove ? (v(), V(o, {
|
|
1112
1110
|
key: 6,
|
|
1113
|
-
label:
|
|
1111
|
+
label: l(i)("inventory.transfer.approval.actions.rejectRequest"),
|
|
1114
1112
|
onClick: a[7] || (a[7] = (j) => B("rejectRequest")),
|
|
1115
1113
|
loading: f.value === "rejectRequest",
|
|
1116
1114
|
disabled: f.value !== "rejectRequest" && m.value,
|
|
1117
1115
|
variant: "destructive"
|
|
1118
1116
|
}, null, 8, ["label", "loading", "disabled"])) : P("", !0),
|
|
1119
|
-
((se = s.purchaseOrder) == null ? void 0 : se.status) !==
|
|
1117
|
+
((se = s.purchaseOrder) == null ? void 0 : se.status) !== l(I).enum.COMPLETE && ((ae = s.purchaseOrder) == null ? void 0 : ae.status) !== l(I).enum.CANCEL && (((ne = s.purchaseOrder) == null ? void 0 : ne.status) !== l(I).enum.REQUESTING || s.canApprove) ? (v(), V(o, {
|
|
1120
1118
|
key: 7,
|
|
1121
|
-
label:
|
|
1119
|
+
label: l(i)("common.close"),
|
|
1122
1120
|
variant: "tertiary",
|
|
1123
1121
|
onClick: a[8] || (a[8] = (j) => r("update:show", !1))
|
|
1124
1122
|
}, null, 8, ["label"])) : P("", !0)
|