@feedmepos/mf-inventory-portal 0.0.19-dev.4 → 0.0.19-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ApprovalView-CT8w22Ga.js → ApprovalView-CzKLgsJ9.js} +16 -15
- package/dist/{BindingsDialog-CrB5aA3X.js → BindingsDialog-D7CWodmi.js} +1 -1
- package/dist/{BindingsPicker-jBTfZ4vJ.js → BindingsPicker-Dxavpg09.js} +5 -5
- package/dist/{BindingsTable-DaZ3Vxpn.js → BindingsTable-BQEyLG4F.js} +1 -1
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BWFoHqPU.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-4EAZjYHf.js} +1 -1
- package/dist/{IngredientsView-DOoXPJop.js → IngredientsView-DLeVfaAy.js} +26 -25
- package/dist/{IntegrationView-BX1nvP-k.js → IntegrationView-CZTl4lcU.js} +2 -2
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CFConGe4.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CEhOhALE.js} +1 -1
- package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-CCD2yMHJ.js +88 -0
- package/dist/PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js +29 -0
- package/dist/{PurchaseOrderPrintPreview-DSXXSlof.js → PurchaseOrderPrintPreview-pVhvi2XF.js} +11 -11
- package/dist/ReceiveRequestView-CzsOfdV4.js +208 -0
- package/dist/{RecipeView-DtoX2e_9.js → RecipeView-DsTG2guX.js} +117 -116
- package/dist/{StockView-DTnY8LfO.js → StockView-ruZ30kOE.js} +17 -16
- package/dist/{SupplierView-CzWM2tH4.js → SupplierView-BT9IfLzB.js} +6 -6
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-BUArpD4v.js +745 -0
- package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-DqaAbttB.js +1269 -0
- package/dist/TransferTemplateView-CXafUQyI.js +1130 -0
- package/dist/{UnitView-Bk-OLoW2.js → UnitView-sSGMkQo5.js} +33 -33
- package/dist/{WarehouseView-C3F_YWO-.js → WarehouseView-B2ueU0Oq.js} +4 -4
- package/dist/api/purchase-order-template.d.ts +7 -0
- package/dist/{app-YOcJA0qj.js → app-D8_IIKxj.js} +6097 -5889
- package/dist/app.d.ts +38 -0
- package/dist/app.js +5 -4
- package/dist/components/FmUnitInputProps.d.ts +2 -0
- package/dist/components/FmUnitInputRules.d.ts +1 -0
- package/dist/components/row-action.enum.d.ts +2 -0
- package/dist/composable/defineDeepModel.d.ts +2 -0
- package/dist/{decimal-Cr-8e35u.js → decimal-BbpHeqMX.js} +1 -1
- package/dist/helper/country.d.ts +2 -0
- package/dist/id-to-date-DNUSJ_a1.js +30 -0
- package/dist/layout-D-dTwEwF.js +147 -0
- package/dist/purchase-order-transaction-type-M-fz1Vrz.js +295 -0
- package/dist/router/name.d.ts +1 -0
- package/dist/row-action.enum-7jVyol1k.js +36 -0
- package/dist/stores/supplier.d.ts +90 -7
- package/dist/style.css +1 -1
- package/dist/supplier-tz4ui5Tz.js +54 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +2 -0
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingSummary.vue.d.ts +26 -0
- package/dist/views/ingredients/helper/calculate-default-cost.d.ts +9 -0
- package/dist/views/receive-request/components/transfer-dialog/TransferDialogProps.d.ts +1 -0
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +2 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +3 -1
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +6 -0
- package/dist/views/transfer-template/TransferTemplateView.vue.d.ts +2 -0
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +22 -0
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialogProps.d.ts +10 -0
- package/dist/views/transfer-template/components/transfer-template-form/TransferTemplateForm.vue.d.ts +16 -0
- package/dist/views/transfer-template/components/transfer-template-form/TransferTemplateFormProps.d.ts +7 -0
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItem.vue.d.ts +18 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +116 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +112 -0
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +470 -0
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +289 -0
- package/dist/{xlsx-CUjMCYbh.js → xlsx-CjvXXGPi.js} +1 -1
- package/dist/{xlsx.util-ByRzckFP.js → xlsx.util-CTgyjOr7.js} +2 -2
- package/package.json +4 -4
- package/dist/PreviewBadge.vue_vue_type_script_setup_true_lang-BvadeWUz.js +0 -35
- package/dist/ReceiveRequestView-5nXXoRL_.js +0 -1394
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DIc2G2jF.js +0 -1031
- package/dist/id-to-date-9OvJMyEX.js +0 -121
- package/dist/layout-DCDPTIlR.js +0 -151
- package/dist/row-action.enum-BwQbURNh.js +0 -28
- package/dist/supplier-Bos9ifGc.js +0 -65
|
@@ -0,0 +1,745 @@
|
|
|
1
|
+
import { f as ae, P as Z, a as qe, d as Ce } from "./purchase-order-transaction-type-M-fz1Vrz.js";
|
|
2
|
+
import { computed as re, h as be, defineComponent as De, ref as ee, resolveComponent as L, openBlock as m, createBlock as T, unref as s, isRef as Se, withCtx as te, createElementVNode as e, createVNode as $, createElementBlock as b, Fragment as X, toDisplayString as l, normalizeClass as se, createCommentVNode as p, renderList as le } from "vue";
|
|
3
|
+
import { c as ge } from "./layout-D-dTwEwF.js";
|
|
4
|
+
import { D as _, R as v } from "./row-action.enum-7jVyol1k.js";
|
|
5
|
+
import { B as Re, l as ie, a as oe, ad as ce, ae as g, c as Ae, j as Ee, a9 as w, H as Pe, G as Te, E as Ne, b as Fe, w as je } from "./app-D8_IIKxj.js";
|
|
6
|
+
import { F as $e } from "./decimal-BbpHeqMX.js";
|
|
7
|
+
import { components as _e, useDialog as Ie, useSnackbar as Me, useProxiedModel as Ue } from "@feedmepos/ui-library";
|
|
8
|
+
import { useI18n as Oe } from "@feedmepos/mf-common";
|
|
9
|
+
import { E as Le } from "./empty-placeholder-wf6-BWE8.js";
|
|
10
|
+
function Ve(u, R) {
|
|
11
|
+
return R.reduce(
|
|
12
|
+
(r, A) => {
|
|
13
|
+
const C = A.received.find((E) => E.sku._id === u._id);
|
|
14
|
+
return C && (r = Re(r, C.amount)), r;
|
|
15
|
+
},
|
|
16
|
+
$e.toPrecision(ie(0), u.unit.precision)
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function ue(u, R, f) {
|
|
20
|
+
const r = (f == null ? void 0 : f.abbrev) ?? R.abbrev;
|
|
21
|
+
return `${oe(u, !1)} ${r}`;
|
|
22
|
+
}
|
|
23
|
+
function Be(u, R) {
|
|
24
|
+
const { name: f, address: r, regNo: A } = R.doc.profile, C = {
|
|
25
|
+
name: f,
|
|
26
|
+
registrationNumber: A,
|
|
27
|
+
line1: r == null ? void 0 : r.line1,
|
|
28
|
+
line2: r == null ? void 0 : r.line2,
|
|
29
|
+
postcode: r == null ? void 0 : r.postcode,
|
|
30
|
+
city: r == null ? void 0 : r.city,
|
|
31
|
+
state: r == null ? void 0 : r.state,
|
|
32
|
+
country: r == null ? void 0 : r.country
|
|
33
|
+
}, E = {
|
|
34
|
+
name: u.supplier.name,
|
|
35
|
+
registrationNumber: u.supplier.registrationNumber,
|
|
36
|
+
line1: u.supplier.address.line1,
|
|
37
|
+
line2: u.supplier.address.line2,
|
|
38
|
+
postcode: u.supplier.address.postcode,
|
|
39
|
+
city: u.supplier.address.city,
|
|
40
|
+
state: u.supplier.address.state,
|
|
41
|
+
country: u.supplier.address.country
|
|
42
|
+
}, i = u.items.map((o) => {
|
|
43
|
+
const { sku: a, measurement: y } = o, B = oe(
|
|
44
|
+
Ve(o.sku, u.deliveryOrder || []),
|
|
45
|
+
!1
|
|
46
|
+
);
|
|
47
|
+
return {
|
|
48
|
+
code: a.code,
|
|
49
|
+
description: a.name,
|
|
50
|
+
quantity: ue(o.quantity, a.unit, o.measurement),
|
|
51
|
+
unit: (y == null ? void 0 : y.abbrev) || a.unit.abbrev,
|
|
52
|
+
received: B
|
|
53
|
+
};
|
|
54
|
+
}), I = u.deliveryOrder.map((o) => ({
|
|
55
|
+
createdAt: ce(new Date(o.createdAt)),
|
|
56
|
+
ref: o.deliveryOrderNumber,
|
|
57
|
+
remark: o.remark || "",
|
|
58
|
+
items: o.received.map((a) => {
|
|
59
|
+
var y;
|
|
60
|
+
return {
|
|
61
|
+
code: a.sku.code,
|
|
62
|
+
description: a.sku.name,
|
|
63
|
+
quantity: oe(a.amount),
|
|
64
|
+
unit: ((y = a.measurement) == null ? void 0 : y.abbrev) || a.sku.unit.abbrev
|
|
65
|
+
};
|
|
66
|
+
})
|
|
67
|
+
})), V = {
|
|
68
|
+
orderNumber: u.seqNumber.toString(),
|
|
69
|
+
createdAt: ae(u._id),
|
|
70
|
+
ref: u.ref || "",
|
|
71
|
+
remark: u.remark || "",
|
|
72
|
+
buyer: C,
|
|
73
|
+
supplier: E,
|
|
74
|
+
items: i,
|
|
75
|
+
status: u.status,
|
|
76
|
+
deliveryOrders: I
|
|
77
|
+
}, c = new URL(window.location.href);
|
|
78
|
+
c.pathname = "/receive-request/print-preview", c.searchParams.append("data", JSON.stringify(V)), window.open(c.href, "_blank", "noreferrer");
|
|
79
|
+
}
|
|
80
|
+
const z = {
|
|
81
|
+
submitRequest: {
|
|
82
|
+
label: "Submit request",
|
|
83
|
+
color: "text-fm-color-typo-primary",
|
|
84
|
+
value: g.enum.submitRequest
|
|
85
|
+
},
|
|
86
|
+
confirmDraft: {
|
|
87
|
+
label: "Confirm draft",
|
|
88
|
+
color: "text-fm-color-typo-primary",
|
|
89
|
+
value: g.enum.confirmDraft
|
|
90
|
+
},
|
|
91
|
+
cancelDraft: {
|
|
92
|
+
label: "Cancel draft",
|
|
93
|
+
color: "text-fm-color-typo-error",
|
|
94
|
+
value: g.enum.cancelDraft
|
|
95
|
+
},
|
|
96
|
+
approveRequest: {
|
|
97
|
+
label: "Approve",
|
|
98
|
+
color: "text-fm-color-typo-primary",
|
|
99
|
+
value: g.enum.approveRequest
|
|
100
|
+
},
|
|
101
|
+
rejectRequest: {
|
|
102
|
+
label: "Reject",
|
|
103
|
+
color: "text-fm-color-typo-error",
|
|
104
|
+
value: g.enum.rejectRequest
|
|
105
|
+
},
|
|
106
|
+
processRequest: {
|
|
107
|
+
label: "Process",
|
|
108
|
+
color: "text-fm-color-typo-primary",
|
|
109
|
+
value: g.enum.processRequest
|
|
110
|
+
},
|
|
111
|
+
receiveStock: {
|
|
112
|
+
label: "Receive Stock",
|
|
113
|
+
color: "text-fm-color-typo-primary",
|
|
114
|
+
value: g.enum.receiveStock
|
|
115
|
+
},
|
|
116
|
+
completeReceive: {
|
|
117
|
+
label: "Mark completed",
|
|
118
|
+
color: "text-fm-color-typo-primary",
|
|
119
|
+
value: g.enum.completeReceive
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
function fs(u, R) {
|
|
123
|
+
const f = Ee(), { t: r } = Oe();
|
|
124
|
+
function A(c) {
|
|
125
|
+
switch (c.status) {
|
|
126
|
+
case "DRAFT":
|
|
127
|
+
return [
|
|
128
|
+
c.supplier.internal === "restaurant" || c.supplier.internal === "warehouse" ? z[g.enum.submitRequest] : z[g.enum.confirmDraft],
|
|
129
|
+
z[g.enum.cancelDraft],
|
|
130
|
+
_[v.Update],
|
|
131
|
+
_[v.Details],
|
|
132
|
+
_[v.Print]
|
|
133
|
+
];
|
|
134
|
+
case "RECEIVING":
|
|
135
|
+
return [
|
|
136
|
+
z[g.enum.completeReceive],
|
|
137
|
+
_[v.Update],
|
|
138
|
+
_[v.Details],
|
|
139
|
+
_[v.Print]
|
|
140
|
+
];
|
|
141
|
+
case "REQUESTING":
|
|
142
|
+
return u === "receive/request" ? [
|
|
143
|
+
_[v.Update],
|
|
144
|
+
_[v.Details],
|
|
145
|
+
_[v.Print]
|
|
146
|
+
] : [
|
|
147
|
+
z[g.enum.approveRequest],
|
|
148
|
+
z[g.enum.rejectRequest],
|
|
149
|
+
_[v.Details],
|
|
150
|
+
_[v.Print]
|
|
151
|
+
];
|
|
152
|
+
case "PROCESSING":
|
|
153
|
+
return [_[v.Details], _[v.Print]];
|
|
154
|
+
case "COMPLETE":
|
|
155
|
+
case "CANCEL":
|
|
156
|
+
default:
|
|
157
|
+
return [
|
|
158
|
+
_[v.Update],
|
|
159
|
+
_[v.Details],
|
|
160
|
+
_[v.Print]
|
|
161
|
+
];
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function C(c) {
|
|
165
|
+
return Object.values(g.enum).includes(c);
|
|
166
|
+
}
|
|
167
|
+
async function E(c, o, a) {
|
|
168
|
+
var B, G;
|
|
169
|
+
const y = Ae(o);
|
|
170
|
+
if (c === v.Print) {
|
|
171
|
+
Be(y, f.currentLocation);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (c === v.Details) {
|
|
175
|
+
R.promptShowTransferDetails(y, a);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (c === v.Update) {
|
|
179
|
+
(B = R.promptUpdateTransferDialog) == null || B.call(R, y);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (C(c)) {
|
|
183
|
+
R.submitAction(o, c, (G = a == null ? void 0 : a.to) == null ? void 0 : G.dbName);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function i() {
|
|
188
|
+
return [
|
|
189
|
+
{
|
|
190
|
+
accessorKey: "seqNumber",
|
|
191
|
+
header: () => r("inventory.transfer.table.seqNo"),
|
|
192
|
+
enableSorting: !0,
|
|
193
|
+
size: 80,
|
|
194
|
+
sortUndefined: "last"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
accessorKey: "_id",
|
|
198
|
+
header: () => r("inventory.transfer.table.createdAt"),
|
|
199
|
+
cell(c) {
|
|
200
|
+
return ae(`${c.getValue()}`);
|
|
201
|
+
},
|
|
202
|
+
enableSorting: !0
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
accessorKey: "supplier.name",
|
|
206
|
+
header: () => r("inventory.transfer.table.transferFrom"),
|
|
207
|
+
enableSorting: !0,
|
|
208
|
+
size: 200
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
accessorKey: "items.length",
|
|
212
|
+
header: () => r("inventory.transfer.table.noOfItems"),
|
|
213
|
+
enableSorting: !1,
|
|
214
|
+
meta: {
|
|
215
|
+
width: "10rem"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
accessorKey: "ref",
|
|
220
|
+
header: () => r("inventory.transfer.table.reference"),
|
|
221
|
+
enableSorting: !1,
|
|
222
|
+
size: "auto"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
accessorKey: "status",
|
|
226
|
+
header: () => r("inventory.transfer.table.status"),
|
|
227
|
+
cell(c) {
|
|
228
|
+
const o = r(`inventory.transfer.status.${c.getValue() ?? ""}`), a = `${c.getValue() ?? ""}`.toLocaleLowerCase("en-us");
|
|
229
|
+
return be(_e.FmChip, {
|
|
230
|
+
label: o,
|
|
231
|
+
class: `fm-status-badge fm-status-badge-${a}`,
|
|
232
|
+
compact: !0
|
|
233
|
+
});
|
|
234
|
+
},
|
|
235
|
+
enableSorting: !0,
|
|
236
|
+
size: 200
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
id: "action",
|
|
240
|
+
cell(c) {
|
|
241
|
+
const o = c.row.original, a = A(o);
|
|
242
|
+
return ge(a, (y) => E(y, o));
|
|
243
|
+
},
|
|
244
|
+
enableSorting: !1,
|
|
245
|
+
size: 40,
|
|
246
|
+
meta: {
|
|
247
|
+
cellClass: "",
|
|
248
|
+
headerClass: ""
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
];
|
|
252
|
+
}
|
|
253
|
+
function I() {
|
|
254
|
+
return [
|
|
255
|
+
{
|
|
256
|
+
accessorKey: "purchaseOrder.seqNumber",
|
|
257
|
+
header: () => r("inventory.transfer.table.seqNo"),
|
|
258
|
+
enableSorting: !0,
|
|
259
|
+
size: 80,
|
|
260
|
+
sortUndefined: "last"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
accessorKey: "purchaseOrder._id",
|
|
264
|
+
header: () => r("inventory.transfer.table.createdAt"),
|
|
265
|
+
cell(c) {
|
|
266
|
+
return ae(`${c.getValue()}`);
|
|
267
|
+
},
|
|
268
|
+
enableSorting: !0
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
accessorKey: "to.name",
|
|
272
|
+
header: () => r("inventory.transfer.table.transferTo"),
|
|
273
|
+
enableSorting: !1,
|
|
274
|
+
size: 200
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
accessorKey: "purchaseOrder.items.length",
|
|
278
|
+
header: () => r("inventory.transfer.table.noOfItems"),
|
|
279
|
+
enableSorting: !1
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
accessorKey: "purchaseOrder.ref",
|
|
283
|
+
header: () => r("inventory.transfer.table.reference"),
|
|
284
|
+
enableSorting: !1,
|
|
285
|
+
size: "auto"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
accessorKey: "purchaseOrder.status",
|
|
289
|
+
header: () => r("inventory.transfer.table.status"),
|
|
290
|
+
cell(c) {
|
|
291
|
+
const o = r(`inventory.transfer.status.${c.getValue() ?? ""}`), a = `${c.getValue() ?? ""}`.toLocaleLowerCase("en-us");
|
|
292
|
+
return be(_e.FmChip, {
|
|
293
|
+
label: o,
|
|
294
|
+
class: `fm-status-badge fm-status-badge-${a}`,
|
|
295
|
+
compact: !0
|
|
296
|
+
});
|
|
297
|
+
},
|
|
298
|
+
enableSorting: !0
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
id: "action",
|
|
302
|
+
cell(c) {
|
|
303
|
+
const o = c.row.original, a = o.purchaseOrder ? A(o.purchaseOrder) : [];
|
|
304
|
+
return ge(
|
|
305
|
+
a,
|
|
306
|
+
(y) => o.purchaseOrder ? E(y, o.purchaseOrder, o) : void 0
|
|
307
|
+
);
|
|
308
|
+
},
|
|
309
|
+
enableSorting: !1,
|
|
310
|
+
size: 40,
|
|
311
|
+
meta: {
|
|
312
|
+
cellClass: "",
|
|
313
|
+
headerClass: ""
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
];
|
|
317
|
+
}
|
|
318
|
+
const V = re(() => u === "receive/request" ? i() : I());
|
|
319
|
+
return {
|
|
320
|
+
get columnDefs() {
|
|
321
|
+
return V.value;
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
const Ge = { class: "flex flex-col gap-16 w-full h-full" }, Ke = { class: "xs:w-screen max-w-full" }, He = { class: "flex justify-between" }, ze = { class: "fm-typo-en-body-lg-600" }, Qe = { class: "flex flex-col gap-8" }, Ye = { class: "flex flex-col gap-4" }, Je = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, We = { class: "flex gap-1" }, Xe = { class: "fm-typo-en-body-lg-600" }, Ze = {
|
|
326
|
+
key: 0,
|
|
327
|
+
class: "flex flex-col gap-4"
|
|
328
|
+
}, et = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, tt = { class: "fm-typo-en-body-lg-600" }, st = { class: "flex flex-col gap-4" }, rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, at = { class: "fm-typo-en-body-lg-600" }, ot = {
|
|
329
|
+
key: 1,
|
|
330
|
+
class: "flex flex-col gap-4"
|
|
331
|
+
}, nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt = { class: "fm-typo-en-body-lg-600" }, it = {
|
|
332
|
+
key: 2,
|
|
333
|
+
class: "flex flex-col gap-4"
|
|
334
|
+
}, ct = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ut = { class: "fm-typo-en-body-lg-600" }, dt = {
|
|
335
|
+
key: 3,
|
|
336
|
+
class: "flex flex-col gap-4"
|
|
337
|
+
}, mt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ft = { class: "fm-typo-en-body-lg-600" }, pt = {
|
|
338
|
+
key: 4,
|
|
339
|
+
class: "flex flex-col gap-4"
|
|
340
|
+
}, vt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, yt = { class: "fm-typo-en-body-lg-600" }, ht = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, bt = { class: "flex flex-col gap-8" }, gt = { class: "fm-typo-en-body-lg-600" }, _t = { class: "flex w-full gap-4" }, Rt = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, Ot = /* @__PURE__ */ e("div", { class: "flex-1 min-w-32" }, null, -1), kt = { class: "fm-typo-en-body-lg-600 shrink-0" }, wt = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, xt = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, qt = {
|
|
341
|
+
key: 0,
|
|
342
|
+
class: "shrink-0 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
343
|
+
}, Ct = {
|
|
344
|
+
key: 1,
|
|
345
|
+
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
346
|
+
}, Dt = {
|
|
347
|
+
key: 0,
|
|
348
|
+
class: "flex flex-col items-center gap-8 h-full"
|
|
349
|
+
}, St = ["src"], At = { class: "fm-typo-en-body-lg-600" }, Et = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, Pt = {
|
|
350
|
+
key: 1,
|
|
351
|
+
class: "px-4 flex flex-col"
|
|
352
|
+
}, Tt = { class: "flex gap-12 content-stretch" }, Nt = {
|
|
353
|
+
class: "flex flex-col w-24",
|
|
354
|
+
name: "circles"
|
|
355
|
+
}, Ft = { class: "flex-1 flex flex-col items-center" }, jt = /* @__PURE__ */ e("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1), $t = { class: "flex-1 flex flex-col items-center" }, It = {
|
|
356
|
+
class: "py-12 flex flex-col gap-4",
|
|
357
|
+
name: "received-at header"
|
|
358
|
+
}, Mt = { class: "fm-typo-en-body-lg-400" }, Ut = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Lt = { class: "flex gap-12 content-stretch" }, Vt = {
|
|
359
|
+
class: "flex flex-col w-24",
|
|
360
|
+
name: "circles"
|
|
361
|
+
}, Bt = { class: "flex-1 flex flex-col items-center" }, Gt = {
|
|
362
|
+
class: "py-12 flex flex-col gap-4 flex-1",
|
|
363
|
+
name: "delivery details"
|
|
364
|
+
}, Kt = { class: "flex flex-col gap-8" }, Ht = { class: "flex flex-col gap-4" }, zt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Qt = { class: "fm-typo-en-body-lg-600" }, Yt = { class: "flex flex-col gap-4" }, Jt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Wt = { class: "flex flex-col gap-4" }, Xt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Zt = { class: "fm-typo-en-body-lg-600" }, es = { class: "flex flex-col gap-4" }, ts = {
|
|
365
|
+
key: 0,
|
|
366
|
+
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
367
|
+
}, ss = { class: "fm-typo-en-body-lg-600" }, rs = { class: "flex gap-8 xs:flex-col" }, ps = /* @__PURE__ */ De({
|
|
368
|
+
__name: "TransferDetails",
|
|
369
|
+
props: {
|
|
370
|
+
purchaseOrder: {},
|
|
371
|
+
transferTo: {},
|
|
372
|
+
transferToDbName: {},
|
|
373
|
+
show: { type: Boolean },
|
|
374
|
+
canResubmit: { type: Boolean },
|
|
375
|
+
canApprove: { type: Boolean }
|
|
376
|
+
},
|
|
377
|
+
emits: ["update:show", "submitted"],
|
|
378
|
+
setup(u, { emit: R }) {
|
|
379
|
+
const f = u, r = R, A = Ie(), C = Me(), E = Fe(), { t: i } = Oe(), I = re(
|
|
380
|
+
() => {
|
|
381
|
+
var t, n, D, h;
|
|
382
|
+
return ((n = (t = f.purchaseOrder) == null ? void 0 : t.supplier) == null ? void 0 : n.internal) === "restaurant" || ((h = (D = f.purchaseOrder) == null ? void 0 : D.supplier) == null ? void 0 : h.internal) === "warehouse" ? Z.TRANSFER : Z.PURCHASE;
|
|
383
|
+
}
|
|
384
|
+
), V = [
|
|
385
|
+
{
|
|
386
|
+
label: i("inventory.transfer.receiveRequest.details.overview"),
|
|
387
|
+
value: "overview"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
label: i("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
391
|
+
value: "deliveryHistory"
|
|
392
|
+
}
|
|
393
|
+
], c = ee(V[0]), o = ee(!1), a = ee(""), y = ee(!0), B = qe(), G = Ue(f, "show");
|
|
394
|
+
async function ke(t, n, D) {
|
|
395
|
+
a.value = n, o.value = !0, y.value = !1;
|
|
396
|
+
try {
|
|
397
|
+
await B.processPurchaseOrder(
|
|
398
|
+
{
|
|
399
|
+
operation: n,
|
|
400
|
+
doc: t,
|
|
401
|
+
options: (
|
|
402
|
+
// auto receive for supplier to warehouse
|
|
403
|
+
(n === g.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
404
|
+
n === g.enum.completeReceive) && E.autoReceiveWarehouse ? {
|
|
405
|
+
autoReceive: !0
|
|
406
|
+
} : void 0
|
|
407
|
+
)
|
|
408
|
+
},
|
|
409
|
+
f.transferToDbName
|
|
410
|
+
), await new Promise((h) => setTimeout(h, 1e3)), C.open({
|
|
411
|
+
title: "Success",
|
|
412
|
+
message: D,
|
|
413
|
+
type: "success"
|
|
414
|
+
}), r("update:show", !1), r("submitted");
|
|
415
|
+
} catch (h) {
|
|
416
|
+
C.open({
|
|
417
|
+
title: "Something went wrong",
|
|
418
|
+
message: "Please try again.",
|
|
419
|
+
type: "error"
|
|
420
|
+
}), console.error("Error when submitting PO operation", n, t, h);
|
|
421
|
+
} finally {
|
|
422
|
+
a.value = "", o.value = !1, y.value = !0;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
async function M(t) {
|
|
426
|
+
const n = Ce[t];
|
|
427
|
+
if (!n) {
|
|
428
|
+
C.open({
|
|
429
|
+
title: "Something went wrong",
|
|
430
|
+
message: `Cannot process order: ${je(t)}`,
|
|
431
|
+
type: "error"
|
|
432
|
+
});
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
const { successMessage: D, ...h } = n;
|
|
436
|
+
A.open({
|
|
437
|
+
title: h.title,
|
|
438
|
+
message: h.message,
|
|
439
|
+
primaryActions: h.primaryActions
|
|
440
|
+
}).onPrimary(() => {
|
|
441
|
+
f.purchaseOrder && ke(f.purchaseOrder, t, D);
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
const we = re(() => {
|
|
445
|
+
var t, n;
|
|
446
|
+
return ((t = f.purchaseOrder) == null ? void 0 : t.status) === w.enum.RECEIVING || ((n = f.purchaseOrder) == null ? void 0 : n.status) === w.enum.COMPLETE;
|
|
447
|
+
}), xe = re(() => {
|
|
448
|
+
var Q, K, x;
|
|
449
|
+
const D = (((Q = f.purchaseOrder) == null ? void 0 : Q.deliveryOrder) ?? []).flatMap((k) => k.received ?? []).reduce(
|
|
450
|
+
(k, N) => {
|
|
451
|
+
const H = k[N.sku._id] ?? [];
|
|
452
|
+
return k[N.sku._id] = [...H, N], k;
|
|
453
|
+
},
|
|
454
|
+
{}
|
|
455
|
+
), h = Object.entries(D).reduce(
|
|
456
|
+
(k, [N, H]) => {
|
|
457
|
+
const P = H.reduce((F, j) => {
|
|
458
|
+
const U = Pe(
|
|
459
|
+
F,
|
|
460
|
+
Math.max(F.precision, j.amount.precision)
|
|
461
|
+
);
|
|
462
|
+
return Re(U, j.amount);
|
|
463
|
+
}, ie(0));
|
|
464
|
+
return k[N] = P, k;
|
|
465
|
+
},
|
|
466
|
+
{}
|
|
467
|
+
), ne = ((K = f.purchaseOrder) == null ? void 0 : K.items) ?? [];
|
|
468
|
+
for (const k of ne)
|
|
469
|
+
h[x = k.sku._id] ?? (h[x] = ie(0));
|
|
470
|
+
return h;
|
|
471
|
+
});
|
|
472
|
+
return (t, n) => {
|
|
473
|
+
var N, H;
|
|
474
|
+
const D = L("FmButtonGroup"), h = L("FmChip"), ne = L("FmMenuDivider"), Q = L("FmCard"), K = L("FmSpacer"), x = L("FmButton"), k = L("FmSideSheet");
|
|
475
|
+
return m(), T(k, {
|
|
476
|
+
header: s(i)("inventory.transfer.receiveRequest.details.title") + ((N = t.purchaseOrder) != null && N.seqNumber ? ` #${(H = t.purchaseOrder) == null ? void 0 : H.seqNumber}` : ""),
|
|
477
|
+
modelValue: s(G),
|
|
478
|
+
"onUpdate:modelValue": n[9] || (n[9] = (P) => Se(G) ? G.value = P : null),
|
|
479
|
+
"dismiss-away": y.value,
|
|
480
|
+
"close-button": "",
|
|
481
|
+
"max-width": 500
|
|
482
|
+
}, {
|
|
483
|
+
default: te(() => {
|
|
484
|
+
var P, F, j, U, Y, J;
|
|
485
|
+
return [
|
|
486
|
+
e("div", Ge, [
|
|
487
|
+
e("div", null, [
|
|
488
|
+
$(D, {
|
|
489
|
+
items: V,
|
|
490
|
+
modelValue: c.value,
|
|
491
|
+
"onUpdate:modelValue": n[0] || (n[0] = (d) => c.value = d)
|
|
492
|
+
}, null, 8, ["modelValue"])
|
|
493
|
+
]),
|
|
494
|
+
c.value.value === "overview" ? (m(), b(X, { key: 0 }, [
|
|
495
|
+
e("div", Ke, [
|
|
496
|
+
$(Q, {
|
|
497
|
+
variant: "outlined",
|
|
498
|
+
class: "flex flex-col gap-8 px-12 py-16"
|
|
499
|
+
}, {
|
|
500
|
+
default: te(() => {
|
|
501
|
+
var d, O, q, W, S, de, me, fe, pe, ve, ye, he;
|
|
502
|
+
return [
|
|
503
|
+
e("div", He, [
|
|
504
|
+
e("div", ze, l(s(i)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
505
|
+
e("div", null, [
|
|
506
|
+
$(h, {
|
|
507
|
+
label: s(i)(`inventory.transfer.status.${(d = t.purchaseOrder) == null ? void 0 : d.status}`),
|
|
508
|
+
class: se(`fm-status-badge fm-status-badge-${(q = (O = t.purchaseOrder) == null ? void 0 : O.status) == null ? void 0 : q.toLocaleLowerCase("en-us")}`),
|
|
509
|
+
compact: ""
|
|
510
|
+
}, null, 8, ["label", "class"])
|
|
511
|
+
])
|
|
512
|
+
]),
|
|
513
|
+
$(ne),
|
|
514
|
+
e("div", Qe, [
|
|
515
|
+
e("div", Ye, [
|
|
516
|
+
e("div", Je, [
|
|
517
|
+
e("div", We, l(s(i)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
518
|
+
]),
|
|
519
|
+
e("div", Xe, l(s(ae)(((W = t.purchaseOrder) == null ? void 0 : W._id) ?? "")), 1)
|
|
520
|
+
]),
|
|
521
|
+
(S = t.purchaseOrder) != null && S.effectiveAt ? (m(), b("div", Ze, [
|
|
522
|
+
e("div", et, l(s(i)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
523
|
+
e("div", tt, l(s(ce)(new Date((de = t.purchaseOrder) == null ? void 0 : de.effectiveAt))), 1)
|
|
524
|
+
])) : p("", !0),
|
|
525
|
+
e("div", st, [
|
|
526
|
+
e("div", rt, l(s(i)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
527
|
+
e("div", at, l(s(i)(
|
|
528
|
+
`inventory.transfer.receiveRequest.details.type.${I.value.toLocaleLowerCase("en-US")}`
|
|
529
|
+
)), 1)
|
|
530
|
+
]),
|
|
531
|
+
(fe = (me = t.purchaseOrder) == null ? void 0 : me.supplier) != null && fe.name ? (m(), b("div", ot, [
|
|
532
|
+
e("div", nt, l(s(i)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
533
|
+
e("div", lt, l((ve = (pe = t.purchaseOrder) == null ? void 0 : pe.supplier) == null ? void 0 : ve.name), 1)
|
|
534
|
+
])) : p("", !0),
|
|
535
|
+
t.transferTo ? (m(), b("div", it, [
|
|
536
|
+
e("div", ct, l(s(i)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
537
|
+
e("div", ut, l(t.transferTo), 1)
|
|
538
|
+
])) : p("", !0),
|
|
539
|
+
(ye = t.purchaseOrder) != null && ye.ref ? (m(), b("div", dt, [
|
|
540
|
+
e("div", mt, l(s(i)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
541
|
+
e("div", ft, l(t.purchaseOrder.ref), 1)
|
|
542
|
+
])) : p("", !0),
|
|
543
|
+
(he = t.purchaseOrder) != null && he.remark ? (m(), b("div", pt, [
|
|
544
|
+
e("div", vt, l(s(i)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
545
|
+
e("div", yt, l(t.purchaseOrder.remark), 1)
|
|
546
|
+
])) : p("", !0)
|
|
547
|
+
])
|
|
548
|
+
];
|
|
549
|
+
}),
|
|
550
|
+
_: 1
|
|
551
|
+
})
|
|
552
|
+
]),
|
|
553
|
+
e("div", ht, [
|
|
554
|
+
e("div", bt, [
|
|
555
|
+
e("div", gt, l(we.value ? s(i)("inventory.transfer.receiveRequest.details.receivedItems") : s(i)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
556
|
+
(m(!0), b(X, null, le(((P = t.purchaseOrder) == null ? void 0 : P.items) ?? [], (d) => (m(), b("div", {
|
|
557
|
+
key: d.code,
|
|
558
|
+
class: "flex flex-col"
|
|
559
|
+
}, [
|
|
560
|
+
e("div", _t, [
|
|
561
|
+
e("div", Rt, l(d.name), 1),
|
|
562
|
+
Ot,
|
|
563
|
+
e("div", kt, l(s(oe)(xe.value[d.sku._id], !1)) + "/" + l(s(ue)(d.quantity, d.sku.unit, d.measurement)), 1)
|
|
564
|
+
]),
|
|
565
|
+
e("div", wt, [
|
|
566
|
+
e("div", xt, l(d.code), 1),
|
|
567
|
+
d.totalCost && s(E).enableTotalCost ? (m(), b("div", qt, " (" + l(s(Te)(d.totalCost)) + ") ", 1)) : p("", !0)
|
|
568
|
+
])
|
|
569
|
+
]))), 128))
|
|
570
|
+
])
|
|
571
|
+
])
|
|
572
|
+
], 64)) : p("", !0),
|
|
573
|
+
c.value.value === "deliveryHistory" ? (m(), b("div", Ct, [
|
|
574
|
+
((j = (F = t.purchaseOrder) == null ? void 0 : F.deliveryOrder) == null ? void 0 : j.length) === 0 ? (m(), b("div", Dt, [
|
|
575
|
+
$(K),
|
|
576
|
+
e("div", null, [
|
|
577
|
+
e("img", {
|
|
578
|
+
src: s(Le),
|
|
579
|
+
alt: "List is empty"
|
|
580
|
+
}, null, 8, St)
|
|
581
|
+
]),
|
|
582
|
+
e("div", At, l(s(i)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
583
|
+
e("div", Et, l(s(i)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
|
|
584
|
+
$(K),
|
|
585
|
+
$(K)
|
|
586
|
+
])) : p("", !0),
|
|
587
|
+
(U = t.purchaseOrder) != null && U.deliveryOrder && ((Y = t.purchaseOrder) == null ? void 0 : Y.deliveryOrder.length) > 0 ? (m(), b("div", Pt, [
|
|
588
|
+
(m(!0), b(X, null, le((J = t.purchaseOrder) == null ? void 0 : J.deliveryOrder, (d, O) => (m(), b(X, { key: O }, [
|
|
589
|
+
e("div", Tt, [
|
|
590
|
+
e("div", Nt, [
|
|
591
|
+
e("div", Ft, [
|
|
592
|
+
e("div", {
|
|
593
|
+
class: se([
|
|
594
|
+
{
|
|
595
|
+
"bg-fm-color-primary": O !== 0,
|
|
596
|
+
"bg-white": O === 0
|
|
597
|
+
},
|
|
598
|
+
"w-[2px] h-full"
|
|
599
|
+
])
|
|
600
|
+
}, null, 2)
|
|
601
|
+
]),
|
|
602
|
+
jt,
|
|
603
|
+
e("div", $t, [
|
|
604
|
+
e("div", {
|
|
605
|
+
class: se([
|
|
606
|
+
{
|
|
607
|
+
"bg-fm-color-primary": O < t.purchaseOrder.deliveryOrder.length - 1,
|
|
608
|
+
"bg-white": O >= t.purchaseOrder.deliveryOrder.length - 1
|
|
609
|
+
},
|
|
610
|
+
"w-[2px] h-full"
|
|
611
|
+
])
|
|
612
|
+
}, null, 2)
|
|
613
|
+
])
|
|
614
|
+
]),
|
|
615
|
+
e("div", It, [
|
|
616
|
+
e("div", Mt, l(s(i)("inventory.transfer.receiveRequest.details.received")), 1),
|
|
617
|
+
e("div", Ut, l(s(ce)(new Date(d.createdAt))) + ", " + l(s(Ne)(new Date(d.createdAt))), 1)
|
|
618
|
+
])
|
|
619
|
+
]),
|
|
620
|
+
e("div", Lt, [
|
|
621
|
+
e("div", Vt, [
|
|
622
|
+
e("div", Bt, [
|
|
623
|
+
e("div", {
|
|
624
|
+
class: se([
|
|
625
|
+
{
|
|
626
|
+
"bg-fm-color-primary": O < t.purchaseOrder.deliveryOrder.length - 1,
|
|
627
|
+
"bg-white": O >= t.purchaseOrder.deliveryOrder.length - 1
|
|
628
|
+
},
|
|
629
|
+
"w-[2px] h-full"
|
|
630
|
+
])
|
|
631
|
+
}, null, 2)
|
|
632
|
+
])
|
|
633
|
+
]),
|
|
634
|
+
e("div", Gt, [
|
|
635
|
+
$(Q, {
|
|
636
|
+
variant: "outlined",
|
|
637
|
+
class: "py-12 px-16"
|
|
638
|
+
}, {
|
|
639
|
+
default: te(() => [
|
|
640
|
+
e("div", Kt, [
|
|
641
|
+
e("div", Ht, [
|
|
642
|
+
e("div", zt, l(s(i)("inventory.transfer.receiveRequest.details.receivedBy")), 1),
|
|
643
|
+
e("div", Qt, l(d.createdBy.name), 1)
|
|
644
|
+
]),
|
|
645
|
+
e("div", Yt, [
|
|
646
|
+
e("div", Jt, l(s(i)("inventory.transfer.receiveRequest.details.receivedItems")), 1),
|
|
647
|
+
(m(!0), b(X, null, le(d.received, (q) => (m(), b("div", {
|
|
648
|
+
class: "fm-typo-en-body-lg-600",
|
|
649
|
+
key: q.sku._id
|
|
650
|
+
}, l(q.sku.name) + " " + l(s(ue)(q.amount, q.sku.unit, q.measurement)), 1))), 128))
|
|
651
|
+
]),
|
|
652
|
+
e("div", Wt, [
|
|
653
|
+
e("div", Xt, l(s(i)("inventory.transfer.receiveRequest.details.deliveryOrderNo")), 1),
|
|
654
|
+
e("div", Zt, l(d.deliveryOrderNumber.trim().length ? d.deliveryOrderNumber : "-"), 1)
|
|
655
|
+
]),
|
|
656
|
+
e("div", es, [
|
|
657
|
+
d.remark ? (m(), b("div", ts, l(s(i)("inventory.transfer.receiveRequest.details.deliveryRemark")), 1)) : p("", !0),
|
|
658
|
+
e("div", ss, l(d.remark), 1)
|
|
659
|
+
])
|
|
660
|
+
])
|
|
661
|
+
]),
|
|
662
|
+
_: 2
|
|
663
|
+
}, 1024)
|
|
664
|
+
])
|
|
665
|
+
])
|
|
666
|
+
], 64))), 128))
|
|
667
|
+
])) : p("", !0)
|
|
668
|
+
])) : p("", !0)
|
|
669
|
+
])
|
|
670
|
+
];
|
|
671
|
+
}),
|
|
672
|
+
"side-sheet-footer": te(() => {
|
|
673
|
+
var P, F, j, U, Y, J, d, O, q, W;
|
|
674
|
+
return [
|
|
675
|
+
e("div", rs, [
|
|
676
|
+
((P = t.purchaseOrder) == null ? void 0 : P.status) === s(w).enum.DRAFT && I.value === s(Z).PURCHASE ? (m(), T(x, {
|
|
677
|
+
key: 0,
|
|
678
|
+
label: s(i)("inventory.transfer.receiveRequest.actions.confirmDraft"),
|
|
679
|
+
onClick: n[1] || (n[1] = (S) => M("confirmDraft")),
|
|
680
|
+
loading: a.value === "confirmDraft",
|
|
681
|
+
disabled: a.value !== "confirmDraft" && o.value
|
|
682
|
+
}, null, 8, ["label", "loading", "disabled"])) : p("", !0),
|
|
683
|
+
((F = t.purchaseOrder) == null ? void 0 : F.status) === s(w).enum.DRAFT && I.value === s(Z).TRANSFER ? (m(), T(x, {
|
|
684
|
+
key: 1,
|
|
685
|
+
label: s(i)("inventory.transfer.receiveRequest.actions.submitRequest"),
|
|
686
|
+
onClick: n[2] || (n[2] = (S) => M("submitRequest")),
|
|
687
|
+
loading: a.value === "submitRequest",
|
|
688
|
+
disabled: a.value !== "submitRequest" && o.value
|
|
689
|
+
}, null, 8, ["label", "loading", "disabled"])) : p("", !0),
|
|
690
|
+
((j = t.purchaseOrder) == null ? void 0 : j.status) === s(w).enum.DRAFT ? (m(), T(x, {
|
|
691
|
+
key: 2,
|
|
692
|
+
label: s(i)("inventory.transfer.receiveRequest.actions.cancelDraft"),
|
|
693
|
+
onClick: n[3] || (n[3] = (S) => M("cancelDraft")),
|
|
694
|
+
loading: a.value === "cancelDraft",
|
|
695
|
+
disabled: a.value !== "cancelDraft" && o.value,
|
|
696
|
+
variant: "destructive"
|
|
697
|
+
}, null, 8, ["label", "loading", "disabled"])) : p("", !0),
|
|
698
|
+
((U = t.purchaseOrder) == null ? void 0 : U.status) === s(w).enum.RECEIVING ? (m(), T(x, {
|
|
699
|
+
key: 3,
|
|
700
|
+
label: s(i)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
701
|
+
onClick: n[4] || (n[4] = (S) => M("completeReceive")),
|
|
702
|
+
loading: a.value === "completeReceive",
|
|
703
|
+
disabled: a.value !== "completeReceive" && o.value
|
|
704
|
+
}, null, 8, ["label", "loading", "disabled"])) : p("", !0),
|
|
705
|
+
t.canResubmit ? (m(), T(x, {
|
|
706
|
+
key: 4,
|
|
707
|
+
label: s(i)("inventory.transfer.receiveRequest.actions.resubmitRequest"),
|
|
708
|
+
onClick: n[5] || (n[5] = (S) => M("submitRequest")),
|
|
709
|
+
loading: a.value === "submitRequest",
|
|
710
|
+
disabled: a.value !== "submitRequest" && o.value
|
|
711
|
+
}, null, 8, ["label", "loading", "disabled"])) : p("", !0),
|
|
712
|
+
(((Y = t.purchaseOrder) == null ? void 0 : Y.status) === s(w).enum.REQUESTING || ((J = t.purchaseOrder) == null ? void 0 : J.status) === s(w).enum.PROCESSING) && t.canApprove ? (m(), T(x, {
|
|
713
|
+
key: 5,
|
|
714
|
+
label: s(i)("inventory.transfer.approval.actions.approveRequest"),
|
|
715
|
+
onClick: n[6] || (n[6] = (S) => M("approveRequest")),
|
|
716
|
+
loading: a.value === "approveRequest",
|
|
717
|
+
disabled: a.value !== "approveRequest" && o.value
|
|
718
|
+
}, null, 8, ["label", "loading", "disabled"])) : p("", !0),
|
|
719
|
+
((d = t.purchaseOrder) == null ? void 0 : d.status) === s(w).enum.REQUESTING && t.canApprove ? (m(), T(x, {
|
|
720
|
+
key: 6,
|
|
721
|
+
label: s(i)("inventory.transfer.approval.actions.rejectRequest"),
|
|
722
|
+
onClick: n[7] || (n[7] = (S) => M("rejectRequest")),
|
|
723
|
+
loading: a.value === "rejectRequest",
|
|
724
|
+
disabled: a.value !== "rejectRequest" && o.value,
|
|
725
|
+
variant: "destructive"
|
|
726
|
+
}, null, 8, ["label", "loading", "disabled"])) : p("", !0),
|
|
727
|
+
((O = t.purchaseOrder) == null ? void 0 : O.status) !== s(w).enum.COMPLETE && ((q = t.purchaseOrder) == null ? void 0 : q.status) !== s(w).enum.CANCEL && (((W = t.purchaseOrder) == null ? void 0 : W.status) !== s(w).enum.REQUESTING || t.canApprove) ? (m(), T(x, {
|
|
728
|
+
key: 7,
|
|
729
|
+
label: s(i)("common.close"),
|
|
730
|
+
variant: "tertiary",
|
|
731
|
+
onClick: n[8] || (n[8] = (S) => r("update:show", !1))
|
|
732
|
+
}, null, 8, ["label"])) : p("", !0)
|
|
733
|
+
])
|
|
734
|
+
];
|
|
735
|
+
}),
|
|
736
|
+
_: 1
|
|
737
|
+
}, 8, ["header", "modelValue", "dismiss-away"]);
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
export {
|
|
742
|
+
ps as _,
|
|
743
|
+
Ve as g,
|
|
744
|
+
fs as u
|
|
745
|
+
};
|