@feedmepos/mf-inventory-portal 1.3.13 → 1.3.14-dev.2
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-D1_jkD6L.js +309 -0
- package/dist/{ApprovalView-ClQU6bq0.js → ApprovalView-CfF2FqsE.js} +12 -12
- package/dist/{BindingsDialog--w8amPhB.js → BindingsDialog-H-juP-az.js} +13 -13
- package/dist/{BindingsPicker-CLZ2cy95.js → BindingsPicker-ClruHF7p.js} +2 -2
- package/dist/{BindingsTable-DMKnwFJt.js → BindingsTable-Bx9pbFOO.js} +3 -3
- package/dist/{ClosingDraftView-DOSvb2cx.js → ClosingDraftView-DN97Tao5.js} +15 -15
- package/dist/{ClosingHistoryView-Dbysx1Ca.js → ClosingHistoryView-DsRYUqa2.js} +5 -5
- package/dist/{ClosingTemplateView-kOWpFBhr.js → ClosingTemplateView-f9zfsxCu.js} +14 -14
- package/dist/DefaultView-COVVxOrF.js +31 -0
- package/dist/{DeliveryOrderPrintPreview-CTrf0b97.js → DeliveryOrderPrintPreview-BMK4kBCQ.js} +11 -11
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-HLHu23Ly.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bqj_Ygmo.js} +8 -8
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BTwfJTx3.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CK1ha_AY.js} +2 -2
- package/dist/{FmMultiselectDialog-D8AXgAuO.js → FmMultiselectDialog-BazT9oUX.js} +1 -1
- package/dist/{FmMultiselectDialog-ByvnmkuF.js → FmMultiselectDialog-_gUuhudi.js} +16 -16
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-B8Jp-237.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BBtAgdsA.js} +4 -4
- package/dist/{ImportView-B8jTVkI3.js → ImportView-jpkwuCXO.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-D3bMh_iG.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DLJnF4do.js} +1 -1
- package/dist/{IngredientGroupView-DEZHQArP.js → IngredientGroupView-x3t1hyNn.js} +5 -5
- package/dist/{IngredientsView-D_0aKc2P.js → IngredientsView-BzWTnlb4.js} +15 -15
- package/dist/{IntegrationExplorerView-RNQ89fRN.js → IntegrationExplorerView-Bca3owbx.js} +5 -5
- package/dist/{IntegrationView-HyqeX65i.js → IntegrationView-Dh1c4Qyo.js} +81 -81
- package/dist/{InventoryBindingForm-GXWU6jVC.js → InventoryBindingForm-B1sI1TGZ.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BSWEOGs7.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-7NeE7Xos.js} +5 -5
- package/dist/{InventoryBindingSummary-Dcsun-ae.js → InventoryBindingSummary-R8zHPc52.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BPHzJFkv.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DMJVh7Nt.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-eaX2F6rA.js → PremiumBadge.vue_vue_type_script_setup_true_lang-ChC9sEIk.js} +7 -7
- package/dist/{PublishView-BzaSX1CF.js → PublishView-Bqp8Ww4J.js} +15 -15
- package/dist/{PurchaseOrderPrintPreview-Dq9RVILX.js → PurchaseOrderPrintPreview-D7TCn8U-.js} +11 -11
- package/dist/{ReceiveRequestView-CUR65B8h.js → ReceiveRequestView-oNBVAMYu.js} +23 -23
- package/dist/{RecipeView-DA1exNa3.js → RecipeView-D8Mvgji9.js} +15 -15
- package/dist/{SettingsView-G9VVMREu.js → SettingsView-BJScLK9z.js} +4 -4
- package/dist/StockView-CRRdVCcD.js +2439 -0
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DflfaS_i.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DUKv_LV6.js} +1 -1
- package/dist/{SupplierView-Br3PxWl6.js → SupplierView-DdBBIV8W.js} +12 -12
- package/dist/{SurchargeView-DnC875ic.js → SurchargeView-DisBUPIs.js} +16 -16
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DxElZDE3.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CZ3Q3BAf.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DncbuAH1.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CC7F5HVc.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-R0DRQHII.js → TransferDetails.vue_vue_type_script_setup_true_lang-BLlg1Vka.js} +821 -837
- package/dist/{TransferTemplateView-CN-1iASP.js → TransferTemplateView-7ICJMF9z.js} +17 -17
- package/dist/{UnitCostHistoryView-HMfTl2Rl.js → UnitCostHistoryView-BMRDBQ58.js} +246 -243
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BQSRm_uN.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-mNXHzLN3.js} +4 -4
- package/dist/{UnitView-2J7SxbnX.js → UnitView-uUUYOjYn.js} +7 -7
- package/dist/{WarehouseView-EIXt8wd0.js → WarehouseView-BfMf_iuj.js} +25 -25
- package/dist/{WastageTemplateView-B8yQevPX.js → WastageTemplateView-BQYjJGZ-.js} +14 -14
- package/dist/{app-DZ_O5S5y.js → app-B_zMegJc.js} +23521 -22309
- package/dist/app.d.ts +22 -6
- package/dist/app.js +2 -2
- package/dist/{closing-template-C3F4uA55.js → closing-template-9vhx5Ji1.js} +1 -1
- package/dist/components/HrmPermissionGuard.vue.d.ts +54 -0
- package/dist/composable/useHrmPermission.d.ts +17 -0
- package/dist/composable/useInventoryAccess.d.ts +11 -0
- package/dist/composable/useNavigationMenu.d.ts +14 -0
- package/dist/{date2-DoKx3vEH.js → date2-BMCS_Dsc.js} +1 -1
- package/dist/{dayjs.min-BzKmIVU5.js → dayjs.min-Dl26OaXo.js} +16 -16
- package/dist/{decimal-CHryhQrv.js → decimal-e6OK2jkR.js} +2 -2
- package/dist/{defineDeepModel-Dt72PPYN.js → defineDeepModel-BvLlwxnd.js} +1 -1
- package/dist/{duplicate-template-k0PYkiot.js → duplicate-template-Cnhu8Rxw.js} +1 -1
- package/dist/{empty-placeholder-wf6-BWE8.js → empty-placeholder-B0QU467o.js} +1 -1
- package/dist/{export-D0nU9NCc.js → export-CGvyGmeo.js} +1 -1
- package/dist/{feature-DTXvUM9q.js → feature-Do41WWzx.js} +46 -46
- package/dist/{format-time-from-id-CjML4YH3.js → format-time-from-id-CqX_KaUG.js} +1 -1
- package/dist/{format-unit-display-BASnDwRJ.js → format-unit-display-D8qWmRXP.js} +11 -11
- package/dist/{import-export.helper-BGRAKGXv.js → import-export.helper-85V8Ib5e.js} +6 -6
- package/dist/{index-Db7jD-CU.js → index-C-CwnjUn.js} +3 -3
- package/dist/{index-D5qTaOFp.js → index-Cg3aLEhT.js} +1 -1
- package/dist/{index-FhahM2dg.js → index-CtUF9Nsv.js} +1 -1
- package/dist/{inventory-core-dart.default-Cvvr8rpN.js → inventory-core-dart.default-B64FzAla.js} +10 -10
- package/dist/{lodash-B4Uj749H.js → lodash-U9ycVPlv.js} +1 -1
- package/dist/{lz-string-Ckbaw1Bu.js → lz-string-0CgVsQoC.js} +21 -21
- package/dist/{netsuite-B4O7LRpC.js → netsuite-Du7-sXJt.js} +37 -37
- package/dist/{number-9PlMlR2G.js → number-iJAzDfmj.js} +11 -11
- package/dist/{predefined-templates-BqAy88Rp.js → predefined-templates-LlSrXOXm.js} +1 -1
- package/dist/{purchase-order-template-KkhC0FCL.js → purchase-order-template-DFuXb0rr.js} +1 -1
- package/dist/{recalculationUtils-Rj0SZQO3.js → recalculationUtils-DWPnMW1G.js} +1 -1
- package/dist/router/name.d.ts +1 -0
- package/dist/router/route-permission.d.ts +10 -0
- package/dist/{rules-BvLBkdfK.js → rules-DefSKiUN.js} +2 -2
- package/dist/{stock-CoG3l91v.js → stock-BfF6peMd.js} +3 -3
- package/dist/{stock-yUbmIey0.js → stock-Cx1BwdWs.js} +28 -27
- package/dist/{supplier-Qlox4B8s.js → supplier-CU3iqdGr.js} +2 -2
- package/dist/{surcharge-CsAxFX-L.js → surcharge-D77J5opH.js} +8 -8
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-BOtDFKQO.js → use-ingredient-select-dialog-B-jxV-79.js} +2 -2
- package/dist/{use-inventory-binding-dialog-Dz5NbeEn.js → use-inventory-binding-dialog-BdTd5qPl.js} +2 -2
- package/dist/{use-template-enabled-locations-MNNKqChl.js → use-template-enabled-locations-vFvaCjlH.js} +2 -2
- package/dist/useHrmPermission-CekUhyck.js +16 -0
- package/dist/useNavigationMenu-BiLWMIip.js +162 -0
- package/dist/views/DefaultView.vue.d.ts +2 -0
- package/dist/views/receive-request/composables/use-order-draft-permission.d.ts +2 -5
- package/dist/{vue-i18n-BqX2td3b.js → vue-i18n-C3_OsgSl.js} +371 -371
- package/dist/{xlsx-CtRIIkxr.js → xlsx-o7n1whCa.js} +398 -398
- package/dist/{xlsx.util-Bd4_86rn.js → xlsx.util-D6nPboPW.js} +1 -1
- package/package.json +3 -2
- package/dist/App-Dm-YoD_v.js +0 -411
- package/dist/StockView-3J7Gkskb.js +0 -2406
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import { defineComponent as Oe, ref as
|
|
2
|
-
import { f as mr, h as pr, r as fr, s as yr } from "./predefined-templates-
|
|
3
|
-
import { f as tt, p as vr } from "./format-time-from-id-
|
|
1
|
+
import { defineComponent as Oe, ref as W, watch as et, nextTick as Zt, openBlock as l, createBlock as ie, Teleport as er, createElementBlock as v, withModifiers as tr, createElementVNode as e, normalizeClass as Pe, toDisplayString as d, createCommentVNode as j, unref as m, withDirectives as rr, vModelText as sr, toRaw as or, shallowRef as Tt, onUnmounted as nr, triggerRef as ar, computed as Z, readonly as lr, h as z, reactive as ir, onMounted as Ut, resolveComponent as X, withCtx as oe, createVNode as L, Fragment as fe, renderList as ke, createTextVNode as Ee, renderSlot as cr, isRef as ur, resolveDynamicComponent as dr } from "vue";
|
|
2
|
+
import { f as mr, h as pr, r as fr, s as yr } from "./predefined-templates-LlSrXOXm.js";
|
|
3
|
+
import { f as tt, p as vr } from "./format-time-from-id-CqX_KaUG.js";
|
|
4
4
|
import { c as Ft } from "./component-kqxARxvM.js";
|
|
5
5
|
import { D as xe, R as ue } from "./row-action.enum-Co_O4qD9.js";
|
|
6
|
-
import {
|
|
7
|
-
import { j as Sr, c as Or, a as be, t as ot, d as
|
|
8
|
-
import { F as wr } from "./decimal-
|
|
9
|
-
import { h as
|
|
10
|
-
import { F as
|
|
11
|
-
import { L as kr } from "./lz-string-
|
|
12
|
-
import { useI18n as it, useCoreStore as
|
|
13
|
-
import { u as
|
|
14
|
-
import { useDialog as
|
|
6
|
+
import { G as We, m as br, u as Te, W as N, X as lt, P as ae, a as hr, Y as It, Z as gr, _ as _r, E as xr, c as Bt, s as ht, q as De, K as qt, $ as zt, r as Xe, B as st, w as Ue, C as Me } from "./app-B_zMegJc.js";
|
|
7
|
+
import { j as Sr, c as Or, a as be, t as ot, d as Qe } from "./number-iJAzDfmj.js";
|
|
8
|
+
import { F as wr } from "./decimal-e6OK2jkR.js";
|
|
9
|
+
import { h as gt, t as Cr, d as Dr, a as Ze } from "./date2-BMCS_Dsc.js";
|
|
10
|
+
import { F as Je, c as $r, a as dt } from "./inventory-core-dart.default-B64FzAla.js";
|
|
11
|
+
import { L as kr } from "./lz-string-0CgVsQoC.js";
|
|
12
|
+
import { useI18n as it, useCoreStore as _t } from "@feedmepos/mf-common";
|
|
13
|
+
import { u as ct, a as xt, S as Ne } from "./netsuite-Du7-sXJt.js";
|
|
14
|
+
import { useDialog as ut, useSnackbar as Ke, components as nt, FmButtonVariant as Ce, useProxiedModel as Rr } from "@feedmepos/ui-library";
|
|
15
15
|
import { F as ze } from "./FmAdminBadge-DjnBAgyv.js";
|
|
16
|
-
import { u as Ve } from "./feature-
|
|
17
|
-
import {
|
|
18
|
-
import { u as
|
|
19
|
-
import { u as
|
|
20
|
-
import { _ as
|
|
21
|
-
import { u as
|
|
22
|
-
import { c as
|
|
23
|
-
import { i as
|
|
16
|
+
import { u as Ve } from "./feature-Do41WWzx.js";
|
|
17
|
+
import { _ as Nr } from "./empty-placeholder-B0QU467o.js";
|
|
18
|
+
import { u as Ar, a as Pr, f as Tr } from "./format-unit-display-D8qWmRXP.js";
|
|
19
|
+
import { u as He, _ as Fr } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-CZ3Q3BAf.js";
|
|
20
|
+
import { _ as Ir, a as qr, b as Er } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BBtAgdsA.js";
|
|
21
|
+
import { u as Vr, R as Et } from "./usePromise-CbVUCxhj.js";
|
|
22
|
+
import { c as Lr } from "./index-C-CwnjUn.js";
|
|
23
|
+
import { i as jr } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CK1ha_AY.js";
|
|
24
24
|
import { F as Vt } from "./form-mode.enum-BKiNVH6A.js";
|
|
25
|
-
import { u as
|
|
26
|
-
import { u as
|
|
27
|
-
import { d as Kt } from "./defineDeepModel-
|
|
28
|
-
import { u as
|
|
29
|
-
|
|
25
|
+
import { u as Mr } from "./supplier-CU3iqdGr.js";
|
|
26
|
+
import { u as Ur } from "./surcharge-D77J5opH.js";
|
|
27
|
+
import { d as Kt } from "./defineDeepModel-BvLlwxnd.js";
|
|
28
|
+
import { u as Br } from "./vue-i18n-C3_OsgSl.js";
|
|
29
|
+
import { u as zr } from "./useHrmPermission-CekUhyck.js";
|
|
30
|
+
function Ht(f, r) {
|
|
30
31
|
return r.reduce(
|
|
31
|
-
(
|
|
32
|
-
const n = c.received.find((
|
|
33
|
-
return n && (
|
|
32
|
+
(i, c) => {
|
|
33
|
+
const n = c.received.find((p) => p.sku._id === f._id);
|
|
34
|
+
return n && (i = Sr(i, n.amount)), i;
|
|
34
35
|
},
|
|
35
|
-
wr.toPrecision(Or(0),
|
|
36
|
+
wr.toPrecision(Or(0), f.unit.precision)
|
|
36
37
|
);
|
|
37
38
|
}
|
|
38
|
-
function Kr(
|
|
39
|
-
const { po: r, currentLocation: s, business:
|
|
40
|
-
name:
|
|
39
|
+
function Kr(f) {
|
|
40
|
+
const { po: r, currentLocation: s, business: i, fulfilling: c, por: n } = f, { name: p, address: t, regNo: a, legalName: b } = s.doc.profile, y = {
|
|
41
|
+
name: p,
|
|
41
42
|
legalName: b || void 0,
|
|
42
43
|
registrationNumber: a || void 0,
|
|
43
44
|
line1: (t == null ? void 0 : t.line1) || "",
|
|
@@ -57,7 +58,7 @@ function Kr(p) {
|
|
|
57
58
|
state: r.supplier.address.state,
|
|
58
59
|
country: r.supplier.address.country
|
|
59
60
|
}, _ = r.items.map((k) => {
|
|
60
|
-
const { sku: Y, measurement:
|
|
61
|
+
const { sku: Y, measurement: A } = k, T = be(
|
|
61
62
|
Ht(k.sku, r.deliveryOrder || []),
|
|
62
63
|
!1
|
|
63
64
|
);
|
|
@@ -65,38 +66,38 @@ function Kr(p) {
|
|
|
65
66
|
code: Y.code,
|
|
66
67
|
description: Y.name,
|
|
67
68
|
quantity: be(k.quantity, !1),
|
|
68
|
-
unit: (
|
|
69
|
-
received:
|
|
70
|
-
unitCost: k.totalCost ? `${k.totalCost.currency} ${
|
|
71
|
-
value: k.quantity.amount === 0 ?
|
|
69
|
+
unit: (A == null ? void 0 : A.abbrev) || Y.unit.abbrev,
|
|
70
|
+
received: T,
|
|
71
|
+
unitCost: k.totalCost ? `${k.totalCost.currency} ${Je.toFormatString({
|
|
72
|
+
value: k.quantity.amount === 0 ? Je.fromNumber(0) : Je.divide([k.totalCost, k.quantity])
|
|
72
73
|
})}` : void 0,
|
|
73
|
-
cost: k.totalCost ? `${k.totalCost.currency} ${
|
|
74
|
+
cost: k.totalCost ? `${k.totalCost.currency} ${Je.toFormatString({
|
|
74
75
|
value: k.totalCost
|
|
75
76
|
})}` : void 0
|
|
76
77
|
};
|
|
77
78
|
}), C = r.deliveryOrder.map((k) => ({
|
|
78
|
-
createdAt:
|
|
79
|
+
createdAt: gt(new Date(k.createdAt)),
|
|
79
80
|
ref: k.deliveryOrderNumber,
|
|
80
81
|
remark: k.remark || "",
|
|
81
82
|
items: k.received.map((Y) => {
|
|
82
|
-
var
|
|
83
|
+
var A;
|
|
83
84
|
return {
|
|
84
85
|
code: Y.sku.code,
|
|
85
86
|
description: Y.sku.name,
|
|
86
87
|
quantity: be(Y.amount),
|
|
87
|
-
unit: ((
|
|
88
|
+
unit: ((A = Y.measurement) == null ? void 0 : A.abbrev) || Y.sku.unit.abbrev
|
|
88
89
|
};
|
|
89
90
|
})
|
|
90
91
|
}));
|
|
91
|
-
let h =
|
|
92
|
-
if (r.supplier.internal ? (
|
|
92
|
+
let h = We.Enum.purchaseOrder, M = "Inventory Receive Note";
|
|
93
|
+
if (r.supplier.internal ? (M = "Inventory Transfer Note", h = We.Enum.transferOrder) : (M = "Purchase Order", h = We.Enum.purchaseOrder), n) {
|
|
93
94
|
const k = n.from.dbName;
|
|
94
|
-
s.dbName === k || (
|
|
95
|
+
s.dbName === k || (M = "Inventory Receive Note", h = We.Enum.goodsReceivedNote);
|
|
95
96
|
}
|
|
96
|
-
const
|
|
97
|
-
title:
|
|
98
|
-
businessName:
|
|
99
|
-
logo:
|
|
97
|
+
const U = {
|
|
98
|
+
title: M,
|
|
99
|
+
businessName: i == null ? void 0 : i.name,
|
|
100
|
+
logo: i == null ? void 0 : i.thumbnail,
|
|
100
101
|
orderNumber: r.seqNumber.toString(),
|
|
101
102
|
createdAt: tt(r._id),
|
|
102
103
|
ref: r.ref || "",
|
|
@@ -107,11 +108,11 @@ function Kr(p) {
|
|
|
107
108
|
status: r.status,
|
|
108
109
|
deliveryOrders: C
|
|
109
110
|
}, O = c && (r.deliveryFullfillment || []).length > 0;
|
|
110
|
-
return O && (h =
|
|
111
|
+
return O && (h = We.Enum.deliveryOrder), { printData: U, templateType: h, isDeliveryPrint: O };
|
|
111
112
|
}
|
|
112
|
-
function Hr(
|
|
113
|
+
function Hr(f) {
|
|
113
114
|
var y;
|
|
114
|
-
const { printData: r, templateType: s } = Kr(
|
|
115
|
+
const { printData: r, templateType: s } = Kr(f), c = mr().getTemplateByType(s), n = !!((y = c == null ? void 0 : c.blocks) != null && y.length), p = pr(s), t = n ? c.blocks : p.blocks, a = n ? c.name : p.name, b = !n;
|
|
115
116
|
try {
|
|
116
117
|
const x = fr(t, r), _ = x.match(/<style>([\s\S]*?)<\/style>/), C = _ ? `<style>${_[1]}</style>` : "", h = x.replace(/<style>[\s\S]*?<\/style>/, "");
|
|
117
118
|
return {
|
|
@@ -138,10 +139,10 @@ ${C}
|
|
|
138
139
|
return alert("Failed to render print template. Please try recreating the template."), null;
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
|
-
const
|
|
142
|
+
const Gr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-2xl overflow-hidden" }, Wr = { class: "flex justify-between items-center px-16 py-3 border-b border-gray-200 bg-gray-50" }, Yr = { class: "flex items-center gap-2.5" }, Qr = {
|
|
142
143
|
key: 1,
|
|
143
144
|
class: "text-xs text-gray-100 bg-gray-500 px-2 py-0.5 rounded font-medium"
|
|
144
|
-
}, Jr = { class: "flex-1 overflow-auto bg-gray-100" },
|
|
145
|
+
}, Jr = { class: "flex-1 overflow-auto bg-gray-100" }, _l = /* @__PURE__ */ Oe({
|
|
145
146
|
__name: "CustomPrintTemplatePreview",
|
|
146
147
|
props: {
|
|
147
148
|
html: {},
|
|
@@ -150,12 +151,12 @@ const Wr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
|
|
|
150
151
|
isDefault: { type: Boolean }
|
|
151
152
|
},
|
|
152
153
|
emits: ["update:modelValue"],
|
|
153
|
-
setup(
|
|
154
|
-
const s =
|
|
154
|
+
setup(f, { emit: r }) {
|
|
155
|
+
const s = f, i = r, c = W(null);
|
|
155
156
|
function n() {
|
|
156
|
-
|
|
157
|
+
i("update:modelValue", !1);
|
|
157
158
|
}
|
|
158
|
-
function
|
|
159
|
+
function p() {
|
|
159
160
|
var a, b;
|
|
160
161
|
try {
|
|
161
162
|
(b = (a = c.value) == null ? void 0 : a.contentWindow) == null || b.print();
|
|
@@ -163,11 +164,11 @@ const Wr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
|
|
|
163
164
|
alert("Failed to trigger print.");
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
|
-
|
|
167
|
+
et(
|
|
167
168
|
() => s.modelValue,
|
|
168
169
|
async (a) => {
|
|
169
170
|
a && (await Zt(), t(), setTimeout(() => {
|
|
170
|
-
|
|
171
|
+
p();
|
|
171
172
|
}, 300));
|
|
172
173
|
}
|
|
173
174
|
);
|
|
@@ -238,26 +239,26 @@ const Wr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
|
|
|
238
239
|
</html>
|
|
239
240
|
`), y.close());
|
|
240
241
|
}
|
|
241
|
-
return (a, b) => (
|
|
242
|
-
a.modelValue ? (
|
|
242
|
+
return (a, b) => (l(), ie(er, { to: "body" }, [
|
|
243
|
+
a.modelValue ? (l(), v("div", {
|
|
243
244
|
key: 0,
|
|
244
245
|
class: "fixed inset-0 z-[9999] bg-black/50 flex justify-center items-center",
|
|
245
246
|
onClick: tr(n, ["self"])
|
|
246
247
|
}, [
|
|
247
|
-
e("div",
|
|
248
|
-
e("div",
|
|
248
|
+
e("div", Gr, [
|
|
249
|
+
e("div", Wr, [
|
|
249
250
|
e("div", Yr, [
|
|
250
251
|
b[0] || (b[0] = e("span", { class: "text-base font-semibold text-gray-700" }, "Print Preview", -1)),
|
|
251
|
-
a.templateName ? (
|
|
252
|
+
a.templateName ? (l(), v("span", {
|
|
252
253
|
key: 0,
|
|
253
254
|
class: Pe(["text-xs font-medium px-2 py-0.5 rounded", a.isDefault ? "text-gray-500 bg-gray-100" : "text-blue-700 bg-blue-50"])
|
|
254
|
-
}, d(a.templateName), 3)) :
|
|
255
|
-
a.isDefault ? (
|
|
255
|
+
}, d(a.templateName), 3)) : j("", !0),
|
|
256
|
+
a.isDefault ? (l(), v("span", Qr, "Default")) : j("", !0)
|
|
256
257
|
]),
|
|
257
258
|
e("div", { class: "flex gap-2 items-center" }, [
|
|
258
259
|
e("button", {
|
|
259
260
|
class: "px-8 py-1.5 bg-blue-500 text-white border-none rounded text-sm cursor-pointer hover:bg-blue-700",
|
|
260
|
-
onClick:
|
|
261
|
+
onClick: p
|
|
261
262
|
}, " Print "),
|
|
262
263
|
e("button", {
|
|
263
264
|
class: "px-2.5 py-1 bg-transparent border border-gray-300 rounded text-xl leading-none cursor-pointer text-gray-500 hover:bg-gray-100",
|
|
@@ -274,28 +275,28 @@ const Wr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
|
|
|
274
275
|
}, null, 512)
|
|
275
276
|
])
|
|
276
277
|
])
|
|
277
|
-
])) :
|
|
278
|
+
])) : j("", !0)
|
|
278
279
|
]));
|
|
279
280
|
}
|
|
280
|
-
}), Xr = br((
|
|
281
|
+
}), Xr = br((f, r) => {
|
|
281
282
|
const s = Te();
|
|
282
283
|
return {
|
|
283
284
|
async getShipments({
|
|
284
|
-
start:
|
|
285
|
+
start: i,
|
|
285
286
|
end: c
|
|
286
287
|
}) {
|
|
287
|
-
const n = s.currentLocationDBName,
|
|
288
|
-
return await r.get(`${
|
|
288
|
+
const n = s.currentLocationDBName, p = `${f.inventoryBackendUrl}/${n}/shipments`;
|
|
289
|
+
return await r.get(`${p}?start=${i}&end=${c}`);
|
|
289
290
|
},
|
|
290
|
-
async getShipmentsByIds(
|
|
291
|
-
if (
|
|
291
|
+
async getShipmentsByIds(i) {
|
|
292
|
+
if (i.length === 0)
|
|
292
293
|
return [];
|
|
293
|
-
const c = s.currentLocationDBName, n = `${
|
|
294
|
-
return await r.post(n, { shipmentIds:
|
|
294
|
+
const c = s.currentLocationDBName, n = `${f.inventoryBackendUrl}/${c}/shipments/get`;
|
|
295
|
+
return await r.post(n, { shipmentIds: i });
|
|
295
296
|
}
|
|
296
297
|
};
|
|
297
|
-
}),
|
|
298
|
-
[
|
|
298
|
+
}), Gt = {
|
|
299
|
+
[N.enum.confirmDraft]: {
|
|
299
300
|
primaryActions: {
|
|
300
301
|
text: "Confirm draft",
|
|
301
302
|
close: !0
|
|
@@ -304,7 +305,7 @@ const Wr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
|
|
|
304
305
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
305
306
|
successMessage: "Purchase order draft has been confirmed"
|
|
306
307
|
},
|
|
307
|
-
[
|
|
308
|
+
[N.enum.cancelDraft]: {
|
|
308
309
|
primaryActions: {
|
|
309
310
|
text: "Cancel draft",
|
|
310
311
|
close: !0,
|
|
@@ -314,7 +315,7 @@ const Wr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
|
|
|
314
315
|
message: "Purchase order cannot be changed after cancelled draft.",
|
|
315
316
|
successMessage: "Purchase order draft has been cancelled"
|
|
316
317
|
},
|
|
317
|
-
[
|
|
318
|
+
[N.enum.approveDraft]: {
|
|
318
319
|
primaryActions: {
|
|
319
320
|
text: "Approve draft",
|
|
320
321
|
close: !0
|
|
@@ -323,7 +324,7 @@ const Wr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
|
|
|
323
324
|
message: "Purchase order request will be accepted.",
|
|
324
325
|
successMessage: "Purchase order has been approved"
|
|
325
326
|
},
|
|
326
|
-
[
|
|
327
|
+
[N.enum.rejectDraft]: {
|
|
327
328
|
primaryActions: {
|
|
328
329
|
text: "Reject draft",
|
|
329
330
|
close: !0
|
|
@@ -332,7 +333,7 @@ const Wr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
|
|
|
332
333
|
message: "Purchase order request will be rejected. You may provide an optional reason for rejection.",
|
|
333
334
|
successMessage: "Purchase order has been rejected"
|
|
334
335
|
},
|
|
335
|
-
[
|
|
336
|
+
[N.enum.submitRequest]: {
|
|
336
337
|
primaryActions: {
|
|
337
338
|
text: "Submit request",
|
|
338
339
|
close: !0
|
|
@@ -341,7 +342,7 @@ const Wr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
|
|
|
341
342
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
342
343
|
successMessage: "Purchase order draft has been submitted"
|
|
343
344
|
},
|
|
344
|
-
[
|
|
345
|
+
[N.enum.completeReceive]: {
|
|
345
346
|
primaryActions: {
|
|
346
347
|
text: "Mark received",
|
|
347
348
|
close: !0
|
|
@@ -350,7 +351,7 @@ const Wr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
|
|
|
350
351
|
message: "Purchase order cannot be changed after it has complete receiving.",
|
|
351
352
|
successMessage: "Purchase order has been marked as received"
|
|
352
353
|
},
|
|
353
|
-
[
|
|
354
|
+
[N.enum.approveRequest]: {
|
|
354
355
|
primaryActions: {
|
|
355
356
|
text: "Accept request",
|
|
356
357
|
close: !0
|
|
@@ -359,7 +360,7 @@ const Wr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
|
|
|
359
360
|
message: "Transfer out request will be accepted.",
|
|
360
361
|
successMessage: "Transfer out request has been approved"
|
|
361
362
|
},
|
|
362
|
-
[
|
|
363
|
+
[N.enum.rejectRequest]: {
|
|
363
364
|
primaryActions: {
|
|
364
365
|
text: "Reject request",
|
|
365
366
|
close: !0,
|
|
@@ -369,7 +370,7 @@ const Wr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
|
|
|
369
370
|
message: "Purchase order will be rejected.",
|
|
370
371
|
successMessage: "Purchase order has been rejected"
|
|
371
372
|
},
|
|
372
|
-
[
|
|
373
|
+
[N.enum.processRequest]: {
|
|
373
374
|
primaryActions: {
|
|
374
375
|
text: "Process request",
|
|
375
376
|
close: !0,
|
|
@@ -382,31 +383,31 @@ const Wr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
|
|
|
382
383
|
}, Zr = { class: "p-4" }, es = {
|
|
383
384
|
key: 0,
|
|
384
385
|
class: "fm-typo-en-body-md-400 mb-3"
|
|
385
|
-
}, ts = { class: "fm-typo-en-body-md-400" },
|
|
386
|
+
}, ts = { class: "fm-typo-en-body-md-400" }, Wt = /* @__PURE__ */ Oe({
|
|
386
387
|
__name: "RejectDraftForm",
|
|
387
388
|
props: {
|
|
388
389
|
message: {},
|
|
389
390
|
confirm: { type: Function },
|
|
390
391
|
onChange: { type: Function }
|
|
391
392
|
},
|
|
392
|
-
setup(
|
|
393
|
-
const r =
|
|
394
|
-
|
|
395
|
-
var
|
|
396
|
-
(
|
|
393
|
+
setup(f) {
|
|
394
|
+
const r = f, { t: s } = it(), i = W("");
|
|
395
|
+
et(i, (n) => {
|
|
396
|
+
var p;
|
|
397
|
+
(p = r.onChange) == null || p.call(r, n ?? "");
|
|
397
398
|
});
|
|
398
399
|
function c() {
|
|
399
|
-
|
|
400
|
+
i.value = "";
|
|
400
401
|
}
|
|
401
|
-
return (n,
|
|
402
|
-
r.message ? (
|
|
402
|
+
return (n, p) => (l(), v("div", Zr, [
|
|
403
|
+
r.message ? (l(), v("div", es, d(r.message), 1)) : j("", !0),
|
|
403
404
|
e("label", ts, d(m(s)("inventory.transfer.receiveRequest.details.rejectionReason")) + " (" + d(m(s)("inventory.common.optional")) + ")", 1),
|
|
404
405
|
rr(e("textarea", {
|
|
405
|
-
"onUpdate:modelValue":
|
|
406
|
+
"onUpdate:modelValue": p[0] || (p[0] = (t) => i.value = t),
|
|
406
407
|
rows: "4",
|
|
407
408
|
class: "w-full mt-2 p-2 border rounded"
|
|
408
409
|
}, null, 512), [
|
|
409
|
-
[sr,
|
|
410
|
+
[sr, i.value]
|
|
410
411
|
]),
|
|
411
412
|
e("div", { class: "mt-3 flex gap-2" }, [
|
|
412
413
|
e("button", {
|
|
@@ -418,74 +419,74 @@ const Wr = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
|
|
|
418
419
|
]));
|
|
419
420
|
}
|
|
420
421
|
});
|
|
421
|
-
function at(
|
|
422
|
+
function at(f) {
|
|
422
423
|
return lt.generatedPOReceivedMap({
|
|
423
|
-
purchaseOrder:
|
|
424
|
+
purchaseOrder: f
|
|
424
425
|
});
|
|
425
426
|
}
|
|
426
|
-
function rs(
|
|
427
|
+
function rs(f) {
|
|
427
428
|
return lt.validatePOItemReceivedStatus({
|
|
428
|
-
dto:
|
|
429
|
+
dto: f
|
|
429
430
|
});
|
|
430
431
|
}
|
|
431
|
-
function
|
|
432
|
+
function yt(f) {
|
|
432
433
|
return lt.validatePOReceivedStatus({
|
|
433
|
-
receivedMap:
|
|
434
|
+
receivedMap: f
|
|
434
435
|
});
|
|
435
436
|
}
|
|
436
|
-
function
|
|
437
|
-
if (!ae.safeParse(
|
|
438
|
-
throw new Error(`Invalid purchase order status: ${
|
|
439
|
-
const
|
|
437
|
+
function vt(f, r, s) {
|
|
438
|
+
if (!ae.safeParse(f).success)
|
|
439
|
+
throw new Error(`Invalid purchase order status: ${f}`);
|
|
440
|
+
const i = ae.parse(f);
|
|
440
441
|
return lt.orderStatusCombination({
|
|
441
|
-
status:
|
|
442
|
+
status: i,
|
|
442
443
|
isPOPartialReceive: r,
|
|
443
444
|
isPOOverReceive: s
|
|
444
445
|
});
|
|
445
446
|
}
|
|
446
447
|
function Yt() {
|
|
447
|
-
const
|
|
448
|
-
async function
|
|
449
|
-
const t =
|
|
450
|
-
return n.doc.supplier.internal && n.operation ===
|
|
448
|
+
const f = Te(), r = He(), s = Ve();
|
|
449
|
+
async function i(n, p) {
|
|
450
|
+
const t = f.currentLocationDBName;
|
|
451
|
+
return n.doc.supplier.internal && n.operation === N.enum.confirmDraft && (n.operation = N.enum.submitRequest), await r.processPurchaseOrder(n, p || t);
|
|
451
452
|
}
|
|
452
|
-
async function c(n,
|
|
453
|
-
const t =
|
|
454
|
-
return await r.processPurchaseOrderV2(n,
|
|
453
|
+
async function c(n, p) {
|
|
454
|
+
const t = f.currentLocationDBName;
|
|
455
|
+
return await r.processPurchaseOrderV2(n, p || t);
|
|
455
456
|
}
|
|
456
|
-
return (n) => s.useOperatePurchaseOrderV2 ? c(n.operateV2, n.transferTo) :
|
|
457
|
+
return (n) => s.useOperatePurchaseOrderV2 ? c(n.operateV2, n.transferTo) : i(n.operate, n.transferTo);
|
|
457
458
|
}
|
|
458
|
-
function qe(
|
|
459
|
-
const r = or(
|
|
459
|
+
function qe(f) {
|
|
460
|
+
const r = or(f);
|
|
460
461
|
if (Array.isArray(r))
|
|
461
462
|
return r.map(qe);
|
|
462
463
|
if (r !== null && typeof r == "object") {
|
|
463
464
|
const s = {};
|
|
464
|
-
for (const
|
|
465
|
-
Object.prototype.hasOwnProperty.call(r,
|
|
465
|
+
for (const i in r)
|
|
466
|
+
Object.prototype.hasOwnProperty.call(r, i) && (s[i] = qe(r[i]));
|
|
466
467
|
return s;
|
|
467
468
|
}
|
|
468
469
|
return r;
|
|
469
470
|
}
|
|
470
|
-
const
|
|
471
|
+
const mt = {
|
|
471
472
|
set: "set",
|
|
472
473
|
add: "add",
|
|
473
474
|
delete: "delete"
|
|
474
475
|
};
|
|
475
|
-
function Lt(
|
|
476
|
+
function Lt(f) {
|
|
476
477
|
return {
|
|
477
|
-
dbName:
|
|
478
|
-
type:
|
|
479
|
-
name:
|
|
480
|
-
acceptRequest:
|
|
481
|
-
doc:
|
|
478
|
+
dbName: f.dbName,
|
|
479
|
+
type: f.type,
|
|
480
|
+
name: f.name,
|
|
481
|
+
acceptRequest: f.acceptRequest ?? !1,
|
|
482
|
+
doc: f.doc
|
|
482
483
|
};
|
|
483
484
|
}
|
|
484
|
-
function
|
|
485
|
-
const n = qe(
|
|
485
|
+
function jt(f, r, s, i, c) {
|
|
486
|
+
const n = qe(f.suppliers ?? []), p = qe(r.allLocations ?? []).map(Lt), t = r._currentLocation ? Lt(qe(r._currentLocation)) : null, a = s.inventory ? [qe(s.inventory)] : [], b = i.state.setting ? qe(i.state.setting) : null, y = qe(c.surcharges ?? []);
|
|
486
487
|
return {
|
|
487
488
|
suppliers: n,
|
|
488
|
-
locations:
|
|
489
|
+
locations: p,
|
|
489
490
|
currentLocation: t,
|
|
490
491
|
inventoryDoc: a,
|
|
491
492
|
netSuiteSetting: b,
|
|
@@ -493,27 +494,27 @@ function Mt(p, r, s, l, c) {
|
|
|
493
494
|
};
|
|
494
495
|
}
|
|
495
496
|
function Qt() {
|
|
496
|
-
const
|
|
497
|
-
|
|
497
|
+
const f = Mr(), r = Te(), s = hr(), i = ct(), c = Ur(), n = jt(
|
|
498
|
+
f,
|
|
498
499
|
r,
|
|
499
500
|
s,
|
|
500
|
-
|
|
501
|
+
i,
|
|
501
502
|
c
|
|
502
|
-
),
|
|
503
|
-
|
|
504
|
-
const t = Tt(
|
|
503
|
+
), p = Tt($r({ env: n }));
|
|
504
|
+
p.value.setUsePartialUpdates(!0);
|
|
505
|
+
const t = Tt(p.value.state()), a = (_) => {
|
|
505
506
|
t.value = _;
|
|
506
507
|
};
|
|
507
|
-
|
|
508
|
+
p.value.addListener(a);
|
|
508
509
|
const b = (_, C, h) => {
|
|
509
510
|
switch (_) {
|
|
510
|
-
case
|
|
511
|
+
case mt.set:
|
|
511
512
|
It(t.value, C, h);
|
|
512
513
|
break;
|
|
513
|
-
case
|
|
514
|
+
case mt.add:
|
|
514
515
|
_r(t.value, C, h);
|
|
515
516
|
break;
|
|
516
|
-
case
|
|
517
|
+
case mt.delete:
|
|
517
518
|
gr(t.value, C);
|
|
518
519
|
break;
|
|
519
520
|
default:
|
|
@@ -521,24 +522,24 @@ function Qt() {
|
|
|
521
522
|
}
|
|
522
523
|
C !== "remark" && C !== "ref" && ar(t);
|
|
523
524
|
};
|
|
524
|
-
|
|
525
|
+
p.value.addPartialListener(b);
|
|
525
526
|
function y() {
|
|
526
|
-
const _ =
|
|
527
|
-
|
|
527
|
+
const _ = jt(
|
|
528
|
+
f,
|
|
528
529
|
r,
|
|
529
530
|
s,
|
|
530
|
-
|
|
531
|
+
i,
|
|
531
532
|
c
|
|
532
533
|
);
|
|
533
|
-
|
|
534
|
+
p.value.updateFullEnv(_), t.value = p.value.state();
|
|
534
535
|
}
|
|
535
|
-
|
|
536
|
+
et(
|
|
536
537
|
[
|
|
537
|
-
() =>
|
|
538
|
+
() => f.suppliers,
|
|
538
539
|
() => r.allLocations,
|
|
539
540
|
() => r._currentLocation,
|
|
540
541
|
() => s.inventory,
|
|
541
|
-
() =>
|
|
542
|
+
() => i.state.setting,
|
|
542
543
|
() => c.surcharges
|
|
543
544
|
],
|
|
544
545
|
() => {
|
|
@@ -546,54 +547,54 @@ function Qt() {
|
|
|
546
547
|
},
|
|
547
548
|
{ deep: !0 }
|
|
548
549
|
), nr(() => {
|
|
549
|
-
|
|
550
|
+
p.value.removeListener(a), p.value.removePartialListener(b);
|
|
550
551
|
});
|
|
551
552
|
function x(_) {
|
|
552
553
|
var C;
|
|
553
554
|
if (_ != null && _._id) {
|
|
554
|
-
|
|
555
|
+
p.value.loadPurchaseOrder(_);
|
|
555
556
|
return;
|
|
556
557
|
}
|
|
557
558
|
if (!Ve().mustUsePoTemplate) {
|
|
558
|
-
|
|
559
|
+
p.value.init();
|
|
559
560
|
return;
|
|
560
561
|
}
|
|
561
|
-
_ != null && _.template && ((C = _.templateDoc) != null && C.purchaseOrder) ? (_.items = _.templateDoc.purchaseOrder.items,
|
|
562
|
+
_ != null && _.template && ((C = _.templateDoc) != null && C.purchaseOrder) ? (_.items = _.templateDoc.purchaseOrder.items, p.value.initFromTemplate(_)) : p.value.initOutletToOutlet();
|
|
562
563
|
}
|
|
563
564
|
return {
|
|
564
|
-
controller:
|
|
565
|
+
controller: p,
|
|
565
566
|
state: t,
|
|
566
567
|
init: x
|
|
567
568
|
};
|
|
568
569
|
}
|
|
569
|
-
var
|
|
570
|
-
const
|
|
571
|
-
function
|
|
572
|
-
const s =
|
|
573
|
-
r != null && r.startDate && (r != null && r.endDate) ? r :
|
|
570
|
+
var bt = /* @__PURE__ */ ((f) => (f.RECEIVE_REQUEST = "receive/request", f.APPROVAL = "approval", f))(bt || {});
|
|
571
|
+
const Ye = W(), pt = W();
|
|
572
|
+
function xl(f, r) {
|
|
573
|
+
const s = ut(), i = Te(), c = Ve(), n = Ar(), p = Pr(), t = W(!1), a = Ke(), b = He(), y = Xr(), x = W(new Array()), _ = W(new Array()), C = W(
|
|
574
|
+
r != null && r.startDate && (r != null && r.endDate) ? r : jr()
|
|
574
575
|
), h = Z(() => {
|
|
575
|
-
const
|
|
576
|
+
const E = new Date(C.value.startDate), F = new Date(C.value.endDate);
|
|
576
577
|
return {
|
|
577
|
-
start: Cr(
|
|
578
|
-
end: Dr(
|
|
578
|
+
start: Cr(E).toISOString(),
|
|
579
|
+
end: Dr(F).toISOString()
|
|
579
580
|
};
|
|
580
|
-
}),
|
|
581
|
-
async function O(
|
|
582
|
-
function
|
|
581
|
+
}), M = W(new Array()), R = xr(), U = W(null);
|
|
582
|
+
async function O(E) {
|
|
583
|
+
function F(w) {
|
|
583
584
|
const g = {
|
|
584
585
|
mode: Vt.CREATE,
|
|
585
|
-
modelValue:
|
|
586
|
+
modelValue: E || void 0,
|
|
586
587
|
show: !0,
|
|
587
588
|
"onUpdate:show"(V) {
|
|
588
|
-
|
|
589
|
+
Ye.value.show = V;
|
|
589
590
|
},
|
|
590
591
|
templateId: w,
|
|
591
|
-
lastClosingDate:
|
|
592
|
+
lastClosingDate: U.value
|
|
592
593
|
};
|
|
593
|
-
|
|
594
|
+
Ye.value = g;
|
|
594
595
|
}
|
|
595
596
|
let ee;
|
|
596
|
-
c.mustUsePoTemplate && !(
|
|
597
|
+
c.mustUsePoTemplate && !(E != null && E.template) ? s.open({
|
|
597
598
|
title: "Create transfer",
|
|
598
599
|
message: "",
|
|
599
600
|
primaryActions: {
|
|
@@ -606,37 +607,37 @@ function _l(p, r) {
|
|
|
606
607
|
close: !0
|
|
607
608
|
}
|
|
608
609
|
}).onPrimary(async () => {
|
|
609
|
-
ee = await n.getTemplateId(), ee &&
|
|
610
|
+
ee = await n.getTemplateId(), ee && F(ee);
|
|
610
611
|
}).onSecondary(() => {
|
|
611
|
-
|
|
612
|
-
}) :
|
|
612
|
+
F(void 0);
|
|
613
|
+
}) : F(ee);
|
|
613
614
|
}
|
|
614
|
-
function k(
|
|
615
|
-
const
|
|
615
|
+
function k(E) {
|
|
616
|
+
const F = {
|
|
616
617
|
mode: Vt.UPDATE,
|
|
617
|
-
modelValue: Bt(
|
|
618
|
+
modelValue: Bt(E),
|
|
618
619
|
show: !0,
|
|
619
620
|
"onUpdate:show"(ee) {
|
|
620
|
-
|
|
621
|
+
Ye.value.show = ee;
|
|
621
622
|
},
|
|
622
|
-
lastClosingDate:
|
|
623
|
+
lastClosingDate: U.value
|
|
623
624
|
};
|
|
624
|
-
|
|
625
|
+
Ye.value = F;
|
|
625
626
|
}
|
|
626
627
|
async function Y() {
|
|
627
628
|
x.value = [], _.value = [], t.value = !0;
|
|
628
629
|
try {
|
|
629
|
-
const
|
|
630
|
-
x.value =
|
|
631
|
-
const
|
|
630
|
+
const E = await b.getPurchaseOrders(h.value);
|
|
631
|
+
x.value = E.sort((H, ce) => ce._id.localeCompare(H._id));
|
|
632
|
+
const F = E.flatMap((H) => H.shipmentIds || []).filter(Boolean), ee = F.length > 0 ? await y.getShipmentsByIds(F) : [];
|
|
632
633
|
_.value = ee;
|
|
633
634
|
const w = await R.readCurrentLocationLastClosing(!0), g = w == null ? void 0 : w._id;
|
|
634
|
-
g && (
|
|
635
|
+
g && (U.value = vr(g)), await c.awaitFeatureLoaded(() => c.mustUsePoTemplate) && await p.fetchTemplates();
|
|
635
636
|
const V = x.value.map((H) => {
|
|
636
637
|
var ce;
|
|
637
638
|
return ((ce = H.request) == null ? void 0 : ce.id) ?? "";
|
|
638
639
|
}).filter((H) => H);
|
|
639
|
-
|
|
640
|
+
M.value = await b.readRequestByIds(V);
|
|
640
641
|
} catch {
|
|
641
642
|
a.open({
|
|
642
643
|
title: "Something went wrong",
|
|
@@ -647,14 +648,14 @@ function _l(p, r) {
|
|
|
647
648
|
t.value = !1;
|
|
648
649
|
}
|
|
649
650
|
}
|
|
650
|
-
async function
|
|
651
|
-
|
|
651
|
+
async function A() {
|
|
652
|
+
M.value = [], t.value = !0;
|
|
652
653
|
try {
|
|
653
|
-
|
|
654
|
+
M.value = await b.readRequests(
|
|
654
655
|
void 0,
|
|
655
656
|
h.value.start,
|
|
656
657
|
h.value.end
|
|
657
|
-
).then((
|
|
658
|
+
).then((E) => E.reverse());
|
|
658
659
|
} catch {
|
|
659
660
|
a.open({
|
|
660
661
|
title: "Something went wrong",
|
|
@@ -665,38 +666,38 @@ function _l(p, r) {
|
|
|
665
666
|
t.value = !1;
|
|
666
667
|
}
|
|
667
668
|
}
|
|
668
|
-
function
|
|
669
|
-
switch (
|
|
669
|
+
function T() {
|
|
670
|
+
switch (f) {
|
|
670
671
|
case "receive/request":
|
|
671
672
|
return Y();
|
|
672
673
|
case "approval":
|
|
673
|
-
return
|
|
674
|
+
return A();
|
|
674
675
|
}
|
|
675
676
|
}
|
|
676
|
-
function $(
|
|
677
|
+
function $(E, F) {
|
|
677
678
|
C.value = {
|
|
678
|
-
startDate:
|
|
679
|
-
endDate:
|
|
680
|
-
},
|
|
679
|
+
startDate: E,
|
|
680
|
+
endDate: F
|
|
681
|
+
}, T();
|
|
681
682
|
}
|
|
682
|
-
|
|
683
|
-
if (!
|
|
683
|
+
i.watchLocation(async (E) => {
|
|
684
|
+
if (!E) {
|
|
684
685
|
x.value = [];
|
|
685
686
|
return;
|
|
686
687
|
}
|
|
687
|
-
await
|
|
688
|
+
await T();
|
|
688
689
|
});
|
|
689
|
-
const S =
|
|
690
|
-
async function
|
|
690
|
+
const S = W(), q = W(Math.random().toString());
|
|
691
|
+
async function G(E, F) {
|
|
691
692
|
const ee = Math.random().toString();
|
|
692
|
-
|
|
693
|
-
(H) => H.purchaseOrderId ===
|
|
693
|
+
q.value = ee, F ?? (F = M.value.computeFirst(
|
|
694
|
+
(H) => H.purchaseOrderId === E._id ? H : null
|
|
694
695
|
) ?? void 0);
|
|
695
|
-
const w =
|
|
696
|
-
poRequest:
|
|
696
|
+
const w = f === "receive/request" ? i.currentLocation : F == null ? void 0 : F.to, g = f === "approval", V = {
|
|
697
|
+
poRequest: F,
|
|
697
698
|
purchaseOrder: {
|
|
698
|
-
...
|
|
699
|
-
status: g && (
|
|
699
|
+
...E,
|
|
700
|
+
status: g && (F != null && F.rejectedAt) ? ae.Enum.REJECT : E.status
|
|
700
701
|
},
|
|
701
702
|
transferTo: w == null ? void 0 : w.name,
|
|
702
703
|
transferToDbName: w == null ? void 0 : w.dbName,
|
|
@@ -706,38 +707,38 @@ function _l(p, r) {
|
|
|
706
707
|
"onUpdate:show"(H) {
|
|
707
708
|
S.value.show = H;
|
|
708
709
|
},
|
|
709
|
-
scope:
|
|
710
|
-
receivedMap: at(
|
|
710
|
+
scope: f,
|
|
711
|
+
receivedMap: at(E) ?? {},
|
|
711
712
|
shipments: _.value
|
|
712
713
|
};
|
|
713
714
|
S.value = V;
|
|
714
715
|
}
|
|
715
|
-
async function Q(
|
|
716
|
+
async function Q(E, F, ee, w, g) {
|
|
716
717
|
const V = Yt();
|
|
717
718
|
t.value = !0;
|
|
718
719
|
try {
|
|
719
720
|
await V({
|
|
720
721
|
operate: {
|
|
721
|
-
operation:
|
|
722
|
-
doc:
|
|
722
|
+
operation: F,
|
|
723
|
+
doc: E,
|
|
723
724
|
options: (
|
|
724
725
|
// auto receive for supplier to warehouse
|
|
725
|
-
(
|
|
726
|
-
|
|
726
|
+
(F === N.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
727
|
+
F === N.enum.completeReceive) && c.autoReceiveWarehouse ? {
|
|
727
728
|
autoReceive: !0
|
|
728
729
|
} : void 0
|
|
729
730
|
)
|
|
730
731
|
},
|
|
731
732
|
operateV2: {
|
|
732
|
-
_id:
|
|
733
|
-
_rev:
|
|
734
|
-
action:
|
|
733
|
+
_id: E._id,
|
|
734
|
+
_rev: E._rev ?? "",
|
|
735
|
+
action: F === N.enum.submitRequest ? N.enum.confirmDraft : F,
|
|
735
736
|
payloads: g ?? []
|
|
736
737
|
},
|
|
737
738
|
transferTo: w
|
|
738
739
|
}), await new Promise((Re) => setTimeout(Re, 1e3));
|
|
739
740
|
const ce = Te().currentLocationDBName.startsWith("restaurant_");
|
|
740
|
-
|
|
741
|
+
F === N.enum.confirmDraft && E.effectiveAt && ce ? a.open({
|
|
741
742
|
title: "Success",
|
|
742
743
|
message: `${ee}. The backdate will be reflected once your POS has received this change.`,
|
|
743
744
|
type: "success"
|
|
@@ -751,29 +752,29 @@ function _l(p, r) {
|
|
|
751
752
|
title: "Something went wrong",
|
|
752
753
|
message: "Please try again.",
|
|
753
754
|
type: "error"
|
|
754
|
-
}), console.error("Error when submitting PO operation",
|
|
755
|
+
}), console.error("Error when submitting PO operation", F, E, H);
|
|
755
756
|
} finally {
|
|
756
|
-
t.value = !1,
|
|
757
|
+
t.value = !1, T();
|
|
757
758
|
}
|
|
758
759
|
}
|
|
759
|
-
async function ye(
|
|
760
|
-
const w =
|
|
760
|
+
async function ye(E, F, ee) {
|
|
761
|
+
const w = Gt[F];
|
|
761
762
|
if (!w) {
|
|
762
763
|
a.open({
|
|
763
764
|
title: "Something went wrong",
|
|
764
|
-
message: `Cannot process order: ${
|
|
765
|
+
message: `Cannot process order: ${ht(F)}`,
|
|
765
766
|
type: "error"
|
|
766
767
|
});
|
|
767
768
|
return;
|
|
768
769
|
}
|
|
769
770
|
const { successMessage: g, ...V } = w;
|
|
770
|
-
if (
|
|
771
|
+
if (F === N.enum.rejectDraft) {
|
|
771
772
|
let Re = "";
|
|
772
773
|
s.open({
|
|
773
774
|
title: V.title,
|
|
774
775
|
message: V.message,
|
|
775
776
|
primaryActions: V.primaryActions,
|
|
776
|
-
contentComponent:
|
|
777
|
+
contentComponent: Wt,
|
|
777
778
|
contentComponentProps: {
|
|
778
779
|
message: V.message,
|
|
779
780
|
onChange: (we) => Re = we
|
|
@@ -785,12 +786,12 @@ function _l(p, r) {
|
|
|
785
786
|
payload: {
|
|
786
787
|
rejectReason: Re
|
|
787
788
|
}
|
|
788
|
-
}), Q(
|
|
789
|
+
}), Q(E, F, g, ee, we);
|
|
789
790
|
});
|
|
790
791
|
return;
|
|
791
792
|
}
|
|
792
793
|
const H = [], ce = Qt();
|
|
793
|
-
ce.init(
|
|
794
|
+
ce.init(E), (F === N.enum.confirmDraft || F === N.enum.submitRequest) && H.push({
|
|
794
795
|
action: "confirmDraft",
|
|
795
796
|
payload: ce.controller.value.toConfirmDraftData(De())
|
|
796
797
|
}), s.open({
|
|
@@ -798,7 +799,7 @@ function _l(p, r) {
|
|
|
798
799
|
message: V.message,
|
|
799
800
|
primaryActions: V.primaryActions
|
|
800
801
|
}).onPrimary(() => {
|
|
801
|
-
Q(
|
|
802
|
+
Q(E, F, g, ee, H);
|
|
802
803
|
});
|
|
803
804
|
}
|
|
804
805
|
async function he() {
|
|
@@ -813,35 +814,35 @@ function _l(p, r) {
|
|
|
813
814
|
close: !0
|
|
814
815
|
}
|
|
815
816
|
}).onPrimary(() => {
|
|
816
|
-
const
|
|
817
|
+
const E = {
|
|
817
818
|
show: !0,
|
|
818
|
-
"onUpdate:show"(
|
|
819
|
-
|
|
819
|
+
"onUpdate:show"(F) {
|
|
820
|
+
pt.value.show = F;
|
|
820
821
|
}
|
|
821
822
|
};
|
|
822
|
-
|
|
823
|
+
pt.value = E;
|
|
823
824
|
});
|
|
824
825
|
}
|
|
825
826
|
return {
|
|
826
827
|
purchaseOrders: x,
|
|
827
828
|
shipments: _,
|
|
828
|
-
purchaseRequests:
|
|
829
|
+
purchaseRequests: M,
|
|
829
830
|
updateDateRange: $,
|
|
830
|
-
fetchData:
|
|
831
|
+
fetchData: T,
|
|
831
832
|
loading: t,
|
|
832
|
-
transferDialogProps:
|
|
833
|
+
transferDialogProps: Ye,
|
|
833
834
|
promptCreateTransferDialog: O,
|
|
834
835
|
promptUpdateTransferDialog: k,
|
|
835
836
|
transferDetailsProps: S,
|
|
836
|
-
promptShowTransferDetails:
|
|
837
|
+
promptShowTransferDetails: G,
|
|
837
838
|
submitAction: ye,
|
|
838
|
-
xilnexImportDialogProps:
|
|
839
|
+
xilnexImportDialogProps: pt,
|
|
839
840
|
promptUploadTransferDialog: he
|
|
840
841
|
};
|
|
841
842
|
}
|
|
842
|
-
function ss(
|
|
843
|
-
const { po: r, currentLocation: s, business:
|
|
844
|
-
name:
|
|
843
|
+
function ss(f) {
|
|
844
|
+
const { po: r, currentLocation: s, business: i, fulfilling: c, por: n } = f, { name: p, address: t, regNo: a, legalName: b } = s.doc.profile, y = {
|
|
845
|
+
name: p,
|
|
845
846
|
legalName: b,
|
|
846
847
|
registrationNumber: a,
|
|
847
848
|
line1: t == null ? void 0 : t.line1,
|
|
@@ -860,32 +861,32 @@ function ss(p) {
|
|
|
860
861
|
city: r.supplier.address.city,
|
|
861
862
|
state: r.supplier.address.state,
|
|
862
863
|
country: r.supplier.address.country
|
|
863
|
-
}, _ = r.items.map((
|
|
864
|
-
const { sku:
|
|
865
|
-
Ht(
|
|
864
|
+
}, _ = r.items.map((A) => {
|
|
865
|
+
const { sku: T, measurement: $ } = A, S = be(
|
|
866
|
+
Ht(A.sku, r.deliveryOrder || []),
|
|
866
867
|
!1
|
|
867
868
|
);
|
|
868
869
|
return {
|
|
869
|
-
code:
|
|
870
|
-
description:
|
|
871
|
-
quantity: be(
|
|
872
|
-
unit: ($ == null ? void 0 : $.abbrev) ||
|
|
870
|
+
code: T.code,
|
|
871
|
+
description: T.name,
|
|
872
|
+
quantity: be(A.quantity, !1),
|
|
873
|
+
unit: ($ == null ? void 0 : $.abbrev) || T.unit.abbrev,
|
|
873
874
|
received: S,
|
|
874
|
-
cost:
|
|
875
|
-
value:
|
|
875
|
+
cost: A.totalCost ? `${A.totalCost.currency} ${Je.toFormatString({
|
|
876
|
+
value: A.totalCost
|
|
876
877
|
})}` : void 0
|
|
877
878
|
};
|
|
878
|
-
}), C = r.deliveryOrder.map((
|
|
879
|
-
createdAt:
|
|
880
|
-
ref:
|
|
881
|
-
remark:
|
|
882
|
-
items:
|
|
879
|
+
}), C = r.deliveryOrder.map((A) => ({
|
|
880
|
+
createdAt: gt(new Date(A.createdAt)),
|
|
881
|
+
ref: A.deliveryOrderNumber,
|
|
882
|
+
remark: A.remark || "",
|
|
883
|
+
items: A.received.map((T) => {
|
|
883
884
|
var $;
|
|
884
885
|
return {
|
|
885
|
-
code:
|
|
886
|
-
description:
|
|
887
|
-
quantity: be(
|
|
888
|
-
unit: (($ =
|
|
886
|
+
code: T.sku.code,
|
|
887
|
+
description: T.sku.name,
|
|
888
|
+
quantity: be(T.amount),
|
|
889
|
+
unit: (($ = T.measurement) == null ? void 0 : $.abbrev) || T.sku.unit.abbrev
|
|
889
890
|
};
|
|
890
891
|
})
|
|
891
892
|
})), h = [
|
|
@@ -894,15 +895,15 @@ function ss(p) {
|
|
|
894
895
|
// Dev
|
|
895
896
|
"6880b36a3054c5001db19218"
|
|
896
897
|
];
|
|
897
|
-
let
|
|
898
|
-
if (r.supplier.internal ? (
|
|
899
|
-
const
|
|
900
|
-
s.dbName ===
|
|
898
|
+
let M = "Inventory Receive Note";
|
|
899
|
+
if (r.supplier.internal ? (M = "Inventory Transfer Note", h.includes((i == null ? void 0 : i._id) || "") && (M = "Stock Request")) : M = "Purchase Order", n) {
|
|
900
|
+
const A = n.from.dbName;
|
|
901
|
+
s.dbName === A || (M = "Inventory Receive Note");
|
|
901
902
|
}
|
|
902
|
-
const
|
|
903
|
-
title:
|
|
904
|
-
businessName:
|
|
905
|
-
logo:
|
|
903
|
+
const U = {
|
|
904
|
+
title: M,
|
|
905
|
+
businessName: i == null ? void 0 : i.name,
|
|
906
|
+
logo: i == null ? void 0 : i.thumbnail,
|
|
906
907
|
orderNumber: r.seqNumber.toString(),
|
|
907
908
|
createdAt: tt(r._id),
|
|
908
909
|
ref: r.ref || "",
|
|
@@ -914,130 +915,118 @@ function ss(p) {
|
|
|
914
915
|
deliveryOrders: C
|
|
915
916
|
}, O = new URL(window.location.href), k = c && (r.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
|
|
916
917
|
O.pathname = O.hostname.includes("portal.feedme") ? `/inventory/${k}` : `/${k}`;
|
|
917
|
-
const Y = kr.compressToEncodedURIComponent(JSON.stringify(
|
|
918
|
+
const Y = kr.compressToEncodedURIComponent(JSON.stringify(U));
|
|
918
919
|
O.searchParams.append("data", Y), window.open(O.href, "_blank", "noreferrer");
|
|
919
920
|
}
|
|
920
921
|
const Ie = {
|
|
921
922
|
submitRequest: {
|
|
922
923
|
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
923
924
|
color: "text-fm-color-typo-primary",
|
|
924
|
-
value:
|
|
925
|
+
value: N.enum.submitRequest
|
|
925
926
|
},
|
|
926
927
|
confirmDraft: {
|
|
927
928
|
translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
|
|
928
929
|
color: "text-fm-color-typo-primary",
|
|
929
|
-
value:
|
|
930
|
+
value: N.enum.confirmDraft
|
|
930
931
|
},
|
|
931
932
|
cancelDraft: {
|
|
932
933
|
translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
|
|
933
934
|
color: "text-fm-color-typo-error",
|
|
934
|
-
value:
|
|
935
|
+
value: N.enum.cancelDraft
|
|
935
936
|
},
|
|
936
937
|
approveRequest: {
|
|
937
938
|
translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
|
|
938
939
|
color: "text-fm-color-typo-primary",
|
|
939
|
-
value:
|
|
940
|
+
value: N.enum.approveRequest
|
|
940
941
|
},
|
|
941
942
|
rejectRequest: {
|
|
942
943
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
|
|
943
944
|
color: "text-fm-color-typo-error",
|
|
944
|
-
value:
|
|
945
|
+
value: N.enum.rejectRequest
|
|
945
946
|
},
|
|
946
947
|
processRequest: {
|
|
947
948
|
translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
|
|
948
949
|
color: "text-fm-color-typo-primary",
|
|
949
|
-
value:
|
|
950
|
+
value: N.enum.processRequest
|
|
950
951
|
},
|
|
951
952
|
receiveStock: {
|
|
952
953
|
translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
|
|
953
954
|
color: "text-fm-color-typo-primary",
|
|
954
|
-
value:
|
|
955
|
+
value: N.enum.receiveStock
|
|
955
956
|
},
|
|
956
957
|
completeReceive: {
|
|
957
958
|
translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
|
|
958
959
|
color: "text-fm-color-typo-primary",
|
|
959
|
-
value:
|
|
960
|
+
value: N.enum.completeReceive
|
|
960
961
|
},
|
|
961
962
|
closeRequest: {
|
|
962
963
|
translationKey: "inventory.transfer.receiveRequest.actions.closeRequest",
|
|
963
964
|
color: "system-error-300",
|
|
964
|
-
value:
|
|
965
|
+
value: N.enum.closeRequest
|
|
965
966
|
},
|
|
966
967
|
approveDraft: {
|
|
967
968
|
translationKey: "inventory.transfer.receiveRequest.actions.approveDraft",
|
|
968
969
|
color: "text-fm-color-typo-primary",
|
|
969
|
-
value:
|
|
970
|
+
value: N.enum.approveDraft
|
|
970
971
|
},
|
|
971
972
|
rejectDraft: {
|
|
972
973
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectDraft",
|
|
973
974
|
color: "text-fm-color-typo-error",
|
|
974
|
-
value:
|
|
975
|
+
value: N.enum.rejectDraft
|
|
975
976
|
},
|
|
976
977
|
returnStock: {
|
|
977
978
|
translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
|
|
978
979
|
color: "text-fm-color-typo-primary",
|
|
979
|
-
value:
|
|
980
|
+
value: N.enum.returnStock
|
|
980
981
|
}
|
|
981
982
|
};
|
|
982
983
|
function Jt() {
|
|
983
|
-
const
|
|
984
|
+
const f = Ve();
|
|
984
985
|
return {
|
|
985
986
|
ableToMarkReceived(r) {
|
|
986
|
-
if (!r || r.status !== ae.enum.RECEIVING ||
|
|
987
|
-
const
|
|
988
|
-
return `${r.supplier.internal}_${r.supplier._id}` !==
|
|
987
|
+
if (!r || r.status !== ae.enum.RECEIVING || f.useOperatePurchaseOrderV2) return !1;
|
|
988
|
+
const i = Te().currentLocationDBName;
|
|
989
|
+
return `${r.supplier.internal}_${r.supplier._id}` !== i;
|
|
989
990
|
},
|
|
990
991
|
ableToMarkApproved(r) {
|
|
991
992
|
return !(!r || (r == null ? void 0 : r.status) !== ae.enum.REQUESTING);
|
|
992
993
|
},
|
|
993
994
|
ableToCreateFulfillment(r, s) {
|
|
994
|
-
var n,
|
|
995
|
-
if (!
|
|
995
|
+
var n, p;
|
|
996
|
+
if (!f.acceptRequireFulfillment || !r || !s || r.status !== ae.enum.PROCESSING || !s.processedAt)
|
|
996
997
|
return !1;
|
|
997
|
-
const
|
|
998
|
-
return !(
|
|
998
|
+
const i = (n = s == null ? void 0 : s.from) == null ? void 0 : n.dbName, c = (p = s == null ? void 0 : s.to) == null ? void 0 : p.dbName;
|
|
999
|
+
return !(i.startsWith("restaurant_") && c.startsWith("restaurant_"));
|
|
999
1000
|
}
|
|
1000
1001
|
};
|
|
1001
1002
|
}
|
|
1002
1003
|
function Xt() {
|
|
1003
|
-
const
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
sessionUser: p.sessionUser.value,
|
|
1008
|
-
validationManifest: {
|
|
1009
|
-
requiredCaslPermissions: [
|
|
1010
|
-
{
|
|
1011
|
-
action: qt.Action.manage,
|
|
1012
|
-
subject: qt.Subject.Business.orderDraft
|
|
1013
|
-
}
|
|
1014
|
-
]
|
|
1015
|
-
}
|
|
1016
|
-
});
|
|
1017
|
-
r.value = (l == null ? void 0 : l.canAccess) ?? !1;
|
|
1018
|
-
} catch (l) {
|
|
1019
|
-
console.error("Permission validation failed:", l), r.value = !1;
|
|
1004
|
+
const f = Z(() => [
|
|
1005
|
+
{
|
|
1006
|
+
action: qt.Action.manage,
|
|
1007
|
+
subject: qt.Subject.Business.inventory_orderDraftApproval
|
|
1020
1008
|
}
|
|
1021
|
-
|
|
1009
|
+
]), { hasPermission: r } = zr(f);
|
|
1010
|
+
return {
|
|
1022
1011
|
hasOrderDraftPermission: lr(r)
|
|
1023
1012
|
};
|
|
1024
1013
|
}
|
|
1025
|
-
function
|
|
1026
|
-
const
|
|
1014
|
+
function Sl(f, r, s) {
|
|
1015
|
+
const i = Te(), c = ct(), n = _t(), p = Jt(), { t } = it(), { hasOrderDraftPermission: a } = Xt(), b = Ve(), y = Z(
|
|
1027
1016
|
() => b.enablePrintTemplate ? [xe[ue.PrintCustom]] : []
|
|
1028
1017
|
);
|
|
1029
|
-
function x(
|
|
1030
|
-
switch (
|
|
1018
|
+
function x(A) {
|
|
1019
|
+
switch (A.status) {
|
|
1031
1020
|
case "DRAFT":
|
|
1032
1021
|
return [
|
|
1033
1022
|
xe[ue.Update],
|
|
1034
1023
|
xe[ue.Details],
|
|
1035
|
-
|
|
1036
|
-
Ie[
|
|
1024
|
+
A.supplier.internal === "restaurant" || A.supplier.internal === "warehouse" ? Ie[N.enum.submitRequest] : Ie[N.enum.confirmDraft],
|
|
1025
|
+
Ie[N.enum.cancelDraft]
|
|
1037
1026
|
];
|
|
1038
1027
|
case "RECEIVING":
|
|
1039
1028
|
return [
|
|
1040
|
-
...
|
|
1029
|
+
...p.ableToMarkReceived(A) ? [Ie[N.enum.completeReceive]] : [],
|
|
1041
1030
|
xe[ue.Details],
|
|
1042
1031
|
xe[ue.Print],
|
|
1043
1032
|
...y.value
|
|
@@ -1046,18 +1035,18 @@ function xl(p, r, s) {
|
|
|
1046
1035
|
const $ = [xe[ue.Details]];
|
|
1047
1036
|
return a.value && $.push(
|
|
1048
1037
|
xe[ue.Update],
|
|
1049
|
-
Ie[
|
|
1050
|
-
Ie[
|
|
1038
|
+
Ie[N.enum.approveDraft],
|
|
1039
|
+
Ie[N.enum.rejectDraft]
|
|
1051
1040
|
), $;
|
|
1052
1041
|
}
|
|
1053
1042
|
case "REQUESTING":
|
|
1054
|
-
return
|
|
1043
|
+
return f === "receive/request" ? [
|
|
1055
1044
|
xe[ue.Details],
|
|
1056
1045
|
xe[ue.Print],
|
|
1057
1046
|
...y.value
|
|
1058
1047
|
] : [
|
|
1059
|
-
Ie[
|
|
1060
|
-
Ie[
|
|
1048
|
+
Ie[N.enum.approveRequest],
|
|
1049
|
+
Ie[N.enum.rejectRequest],
|
|
1061
1050
|
xe[ue.Details]
|
|
1062
1051
|
// DefaultRowActions[RowActionEnum.Print]
|
|
1063
1052
|
];
|
|
@@ -1077,49 +1066,49 @@ function xl(p, r, s) {
|
|
|
1077
1066
|
];
|
|
1078
1067
|
}
|
|
1079
1068
|
}
|
|
1080
|
-
function _(
|
|
1081
|
-
return Object.values(
|
|
1069
|
+
function _(A) {
|
|
1070
|
+
return Object.values(N.enum).includes(A);
|
|
1082
1071
|
}
|
|
1083
|
-
async function C(
|
|
1084
|
-
var
|
|
1085
|
-
const S = Bt(
|
|
1086
|
-
if (
|
|
1087
|
-
const
|
|
1088
|
-
if (
|
|
1089
|
-
const w =
|
|
1090
|
-
w !== null && (
|
|
1072
|
+
async function C(A, T, $) {
|
|
1073
|
+
var q, G, Q, ye, he, E;
|
|
1074
|
+
const S = Bt(T);
|
|
1075
|
+
if (A === ue.Print || A === ue.PrintCustom) {
|
|
1076
|
+
const F = ($ == null ? void 0 : $.toInventoryLocation) ?? i.currentLocation;
|
|
1077
|
+
if (F.type === "restaurant") {
|
|
1078
|
+
const w = i.locationRestaurantFromCore(F.doc._id);
|
|
1079
|
+
w !== null && (F.doc = w);
|
|
1091
1080
|
}
|
|
1092
|
-
((
|
|
1081
|
+
((q = $ == null ? void 0 : $.netSuite) != null && q.refNo || (G = S.netSuite) != null && G.refNo) && (S.ref = [((Q = $ == null ? void 0 : $.netSuite) == null ? void 0 : Q.refNo) || ((ye = S.netSuite) == null ? void 0 : ye.refNo)].filter((w) => w).join(" "));
|
|
1093
1082
|
const ee = {
|
|
1094
1083
|
po: S,
|
|
1095
|
-
currentLocation:
|
|
1084
|
+
currentLocation: F,
|
|
1096
1085
|
business: n.currentBusiness.value,
|
|
1097
|
-
fulfilling:
|
|
1086
|
+
fulfilling: f === "approval",
|
|
1098
1087
|
por: $
|
|
1099
1088
|
};
|
|
1100
|
-
if (
|
|
1089
|
+
if (A === ue.PrintCustom) {
|
|
1101
1090
|
const w = Hr(ee);
|
|
1102
|
-
w && (O.value = w.html, k.value = w.templateName, Y.value = w.isDefault,
|
|
1091
|
+
w && (O.value = w.html, k.value = w.templateName, Y.value = w.isDefault, U.value = !0);
|
|
1103
1092
|
} else
|
|
1104
1093
|
ss(ee);
|
|
1105
1094
|
return;
|
|
1106
1095
|
}
|
|
1107
|
-
if (
|
|
1096
|
+
if (A === ue.Details) {
|
|
1108
1097
|
r.promptShowTransferDetails(S, $);
|
|
1109
1098
|
return;
|
|
1110
1099
|
}
|
|
1111
|
-
if (
|
|
1100
|
+
if (A === ue.Update) {
|
|
1112
1101
|
(he = r.promptUpdateTransferDialog) == null || he.call(r, S);
|
|
1113
1102
|
return;
|
|
1114
1103
|
}
|
|
1115
|
-
if (_(
|
|
1116
|
-
r.submitAction(
|
|
1104
|
+
if (_(A)) {
|
|
1105
|
+
r.submitAction(T, A, (E = $ == null ? void 0 : $.to) == null ? void 0 : E.dbName);
|
|
1117
1106
|
return;
|
|
1118
1107
|
}
|
|
1119
1108
|
}
|
|
1120
1109
|
function h() {
|
|
1121
|
-
var
|
|
1122
|
-
const
|
|
1110
|
+
var T;
|
|
1111
|
+
const A = [
|
|
1123
1112
|
{
|
|
1124
1113
|
accessorKey: "seqNumber",
|
|
1125
1114
|
header: () => t("inventory.transfer.table.seqNo"),
|
|
@@ -1145,9 +1134,9 @@ function xl(p, r, s) {
|
|
|
1145
1134
|
accessorKey: "items.length",
|
|
1146
1135
|
header: () => t("inventory.transfer.table.noOfItems"),
|
|
1147
1136
|
cell: ($) => {
|
|
1148
|
-
const S = $.row.original.version || "1",
|
|
1137
|
+
const S = $.row.original.version || "1", q = $.getValue();
|
|
1149
1138
|
return z("div", { class: "flex items-center gap-2" }, [
|
|
1150
|
-
|
|
1139
|
+
q,
|
|
1151
1140
|
S !== "1" ? z(
|
|
1152
1141
|
"div",
|
|
1153
1142
|
{ class: "py-3" },
|
|
@@ -1175,7 +1164,7 @@ function xl(p, r, s) {
|
|
|
1175
1164
|
enableSorting: !1,
|
|
1176
1165
|
size: "auto"
|
|
1177
1166
|
},
|
|
1178
|
-
...(
|
|
1167
|
+
...(T = n.sessionUser.value) != null && T.role.isAdmin ? [
|
|
1179
1168
|
{
|
|
1180
1169
|
id: "statusForAdmin",
|
|
1181
1170
|
header: () => z(ze, {}, () => `${t("inventory.transfer.table.status")}`),
|
|
@@ -1190,16 +1179,16 @@ function xl(p, r, s) {
|
|
|
1190
1179
|
accessorKey: "status",
|
|
1191
1180
|
header: () => t("inventory.transfer.table.status"),
|
|
1192
1181
|
cell($) {
|
|
1193
|
-
const S = $.getValue(),
|
|
1194
|
-
let he = t(`inventory.transfer.status.${ye}`),
|
|
1195
|
-
ye === ae.enum.CLOSE && (he = `${t(`inventory.transfer.status.${ae.enum.COMPLETE}`)}`), ye === "PARTIAL_RECEIVED" &&
|
|
1196
|
-
let
|
|
1182
|
+
const S = $.getValue(), q = at($.row.original), { partial: G, over: Q } = yt(q), ye = vt(S ?? "", G, Q);
|
|
1183
|
+
let he = t(`inventory.transfer.status.${ye}`), E = `${S ?? ""}`.toLocaleLowerCase("en-us");
|
|
1184
|
+
ye === ae.enum.CLOSE && (he = `${t(`inventory.transfer.status.${ae.enum.COMPLETE}`)}`), ye === "PARTIAL_RECEIVED" && E === ae.enum.PROCESSING.toLocaleLowerCase("en-us") && (E = ae.enum.RECEIVING.toLocaleLowerCase("en-us"));
|
|
1185
|
+
let F = null;
|
|
1197
1186
|
const ee = s.value.find((w) => w.ref === $.row.original._id);
|
|
1198
1187
|
if (ee != null && ee.milestones && ee.milestones.length > 0) {
|
|
1199
1188
|
const w = ee.milestones[ee.milestones.length - 1];
|
|
1200
1189
|
if (w.estimatedTime) {
|
|
1201
1190
|
const g = new Date(w.estimatedTime), V = g.getDate().toString().padStart(2, "0");
|
|
1202
|
-
|
|
1191
|
+
F = `${g.toLocaleString("en-US", { month: "short" })} ${V}`;
|
|
1203
1192
|
}
|
|
1204
1193
|
}
|
|
1205
1194
|
return z(
|
|
@@ -1216,14 +1205,14 @@ function xl(p, r, s) {
|
|
|
1216
1205
|
{
|
|
1217
1206
|
class: [
|
|
1218
1207
|
"fm-status-badge",
|
|
1219
|
-
`fm-status-badge-${
|
|
1208
|
+
`fm-status-badge-${E}`,
|
|
1220
1209
|
Q && "fm-status-badge-error"
|
|
1221
1210
|
].filter(Boolean).join(" ")
|
|
1222
1211
|
},
|
|
1223
1212
|
`${he}`
|
|
1224
1213
|
)
|
|
1225
1214
|
),
|
|
1226
|
-
...
|
|
1215
|
+
...F ? [
|
|
1227
1216
|
z(
|
|
1228
1217
|
"div",
|
|
1229
1218
|
{
|
|
@@ -1238,7 +1227,7 @@ function xl(p, r, s) {
|
|
|
1238
1227
|
z(
|
|
1239
1228
|
"span",
|
|
1240
1229
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1241
|
-
|
|
1230
|
+
F
|
|
1242
1231
|
)
|
|
1243
1232
|
]
|
|
1244
1233
|
)
|
|
@@ -1252,8 +1241,8 @@ function xl(p, r, s) {
|
|
|
1252
1241
|
{
|
|
1253
1242
|
id: "action",
|
|
1254
1243
|
cell($) {
|
|
1255
|
-
const S = $.row.original,
|
|
1256
|
-
return Ft(
|
|
1244
|
+
const S = $.row.original, q = x(S);
|
|
1245
|
+
return Ft(q, (G) => C(G, S));
|
|
1257
1246
|
},
|
|
1258
1247
|
enableSorting: !1,
|
|
1259
1248
|
size: 40,
|
|
@@ -1268,14 +1257,14 @@ function xl(p, r, s) {
|
|
|
1268
1257
|
{
|
|
1269
1258
|
id: "netsuiteTransferOrder",
|
|
1270
1259
|
accessorFn: (S) => {
|
|
1271
|
-
var
|
|
1272
|
-
return (
|
|
1260
|
+
var q;
|
|
1261
|
+
return (q = S.netSuite) != null && q.id ? `${S.netSuite.refNo} (${S.netSuite.id})` : "N/A";
|
|
1273
1262
|
},
|
|
1274
1263
|
header: () => "NetSuite Order (ID)",
|
|
1275
1264
|
cell(S) {
|
|
1276
|
-
var
|
|
1277
|
-
const
|
|
1278
|
-
return (
|
|
1265
|
+
var G;
|
|
1266
|
+
const q = S.row.original;
|
|
1267
|
+
return (G = q.netSuite) != null && G.id ? `${q.netSuite.refNo} (${q.netSuite.id})` : "N/A";
|
|
1279
1268
|
},
|
|
1280
1269
|
enableSorting: !1,
|
|
1281
1270
|
size: 200,
|
|
@@ -1287,13 +1276,13 @@ function xl(p, r, s) {
|
|
|
1287
1276
|
{
|
|
1288
1277
|
id: "netsuiteTransactionNumber",
|
|
1289
1278
|
accessorFn: (S) => {
|
|
1290
|
-
var
|
|
1291
|
-
return ((
|
|
1279
|
+
var q, G;
|
|
1280
|
+
return ((G = (q = S.netSuite) == null ? void 0 : q.additionalInfo) == null ? void 0 : G.transactionnumber) ?? "N/A";
|
|
1292
1281
|
},
|
|
1293
1282
|
header: () => "NetSuite Transaction No.",
|
|
1294
1283
|
cell(S) {
|
|
1295
|
-
var
|
|
1296
|
-
return ((Q = (
|
|
1284
|
+
var G, Q;
|
|
1285
|
+
return ((Q = (G = S.row.original.netSuite) == null ? void 0 : G.additionalInfo) == null ? void 0 : Q.transactionnumber) ?? "N/A";
|
|
1297
1286
|
},
|
|
1298
1287
|
enableSorting: !1,
|
|
1299
1288
|
size: 200,
|
|
@@ -1303,13 +1292,13 @@ function xl(p, r, s) {
|
|
|
1303
1292
|
}
|
|
1304
1293
|
}
|
|
1305
1294
|
];
|
|
1306
|
-
|
|
1295
|
+
A.splice(A.length - 1, 0, ...$);
|
|
1307
1296
|
}
|
|
1308
|
-
return
|
|
1297
|
+
return A;
|
|
1309
1298
|
}
|
|
1310
|
-
function
|
|
1311
|
-
var
|
|
1312
|
-
const
|
|
1299
|
+
function M() {
|
|
1300
|
+
var T;
|
|
1301
|
+
const A = [
|
|
1313
1302
|
{
|
|
1314
1303
|
accessorKey: "purchaseOrder.seqNumber",
|
|
1315
1304
|
header: () => t("inventory.transfer.table.seqNo"),
|
|
@@ -1342,7 +1331,7 @@ function xl(p, r, s) {
|
|
|
1342
1331
|
enableSorting: !1,
|
|
1343
1332
|
size: "auto"
|
|
1344
1333
|
},
|
|
1345
|
-
...(
|
|
1334
|
+
...(T = n.sessionUser.value) != null && T.role.isAdmin ? [
|
|
1346
1335
|
{
|
|
1347
1336
|
id: "statusForAdmin",
|
|
1348
1337
|
header: () => z(ze, {}, () => `${t("inventory.transfer.table.status")}`),
|
|
@@ -1357,15 +1346,15 @@ function xl(p, r, s) {
|
|
|
1357
1346
|
accessorKey: "purchaseOrder.status",
|
|
1358
1347
|
header: () => t("inventory.transfer.table.status"),
|
|
1359
1348
|
cell($) {
|
|
1360
|
-
const S = $.row.original,
|
|
1349
|
+
const S = $.row.original, q = $.getValue();
|
|
1361
1350
|
if (!S.purchaseOrder)
|
|
1362
1351
|
return z(nt.FmChip, {
|
|
1363
1352
|
label: "N/A",
|
|
1364
1353
|
compact: !0
|
|
1365
1354
|
});
|
|
1366
|
-
const
|
|
1367
|
-
let
|
|
1368
|
-
return he === ae.enum.CLOSE && (
|
|
1355
|
+
const G = at(S.purchaseOrder), { partial: Q, over: ye } = yt(G), he = vt(q ?? "", Q, ye);
|
|
1356
|
+
let E = t(`inventory.transfer.status.${he}`), F = `${q ?? ""}`.toLocaleLowerCase("en-us");
|
|
1357
|
+
return he === ae.enum.CLOSE && (E = `${t(`inventory.transfer.status.${ae.enum.COMPLETE}`)}`), he === "PARTIAL_RECEIVED" && F === ae.enum.PROCESSING.toLocaleLowerCase("en-us") && (F = ae.enum.RECEIVING.toLocaleLowerCase("en-us")), S.rejectedAt && (E = t("inventory.transfer.status.REJECT"), F = ae.enum.REJECT.toLocaleLowerCase("en-us")), z(
|
|
1369
1358
|
"div",
|
|
1370
1359
|
{
|
|
1371
1360
|
class: "flex"
|
|
@@ -1375,11 +1364,11 @@ function xl(p, r, s) {
|
|
|
1375
1364
|
{
|
|
1376
1365
|
class: [
|
|
1377
1366
|
"fm-status-badge",
|
|
1378
|
-
`fm-status-badge-${
|
|
1367
|
+
`fm-status-badge-${F}`,
|
|
1379
1368
|
ye && "fm-status-badge-error"
|
|
1380
1369
|
].filter(Boolean).join(" ")
|
|
1381
1370
|
},
|
|
1382
|
-
`${
|
|
1371
|
+
`${E}`
|
|
1383
1372
|
)
|
|
1384
1373
|
);
|
|
1385
1374
|
},
|
|
@@ -1388,12 +1377,12 @@ function xl(p, r, s) {
|
|
|
1388
1377
|
{
|
|
1389
1378
|
id: "action",
|
|
1390
1379
|
cell($) {
|
|
1391
|
-
const S = $.row.original,
|
|
1380
|
+
const S = $.row.original, G = (S.purchaseOrder ? x(S.purchaseOrder) : []).map((Q) => Q.value === ue.Print ? {
|
|
1392
1381
|
...Q,
|
|
1393
1382
|
translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
|
|
1394
1383
|
} : Q);
|
|
1395
1384
|
return Ft(
|
|
1396
|
-
|
|
1385
|
+
G,
|
|
1397
1386
|
(Q) => S.purchaseOrder ? C(Q, S.purchaseOrder, S) : void 0
|
|
1398
1387
|
);
|
|
1399
1388
|
},
|
|
@@ -1410,14 +1399,14 @@ function xl(p, r, s) {
|
|
|
1410
1399
|
{
|
|
1411
1400
|
id: "netsuiteTransferOrder",
|
|
1412
1401
|
accessorFn: (S) => {
|
|
1413
|
-
var
|
|
1414
|
-
return (
|
|
1402
|
+
var q;
|
|
1403
|
+
return (q = S.netSuite) != null && q.id ? `${S.netSuite.refNo} (${S.netSuite.id})` : "N/A";
|
|
1415
1404
|
},
|
|
1416
1405
|
header: () => "NetSuite Order (ID)",
|
|
1417
1406
|
cell(S) {
|
|
1418
|
-
var
|
|
1419
|
-
const
|
|
1420
|
-
return (
|
|
1407
|
+
var G;
|
|
1408
|
+
const q = S.row.original;
|
|
1409
|
+
return (G = q.netSuite) != null && G.id ? `${q.netSuite.refNo} (${q.netSuite.id})` : "N/A";
|
|
1421
1410
|
},
|
|
1422
1411
|
enableSorting: !1,
|
|
1423
1412
|
size: 200,
|
|
@@ -1429,13 +1418,13 @@ function xl(p, r, s) {
|
|
|
1429
1418
|
{
|
|
1430
1419
|
id: "netsuiteTransactionNumber",
|
|
1431
1420
|
accessorFn: (S) => {
|
|
1432
|
-
var
|
|
1433
|
-
return ((
|
|
1421
|
+
var q, G;
|
|
1422
|
+
return ((G = (q = S.netSuite) == null ? void 0 : q.additionalInfo) == null ? void 0 : G.transactionnumber) ?? "N/A";
|
|
1434
1423
|
},
|
|
1435
1424
|
header: () => "NetSuite Transaction No.",
|
|
1436
1425
|
cell(S) {
|
|
1437
|
-
var
|
|
1438
|
-
return ((Q = (
|
|
1426
|
+
var G, Q;
|
|
1427
|
+
return ((Q = (G = S.row.original.netSuite) == null ? void 0 : G.additionalInfo) == null ? void 0 : Q.transactionnumber) ?? "N/A";
|
|
1439
1428
|
},
|
|
1440
1429
|
enableSorting: !1,
|
|
1441
1430
|
size: 200,
|
|
@@ -1445,14 +1434,14 @@ function xl(p, r, s) {
|
|
|
1445
1434
|
}
|
|
1446
1435
|
}
|
|
1447
1436
|
];
|
|
1448
|
-
|
|
1437
|
+
A.splice(A.length - 2, 0, ...$);
|
|
1449
1438
|
}
|
|
1450
|
-
return
|
|
1439
|
+
return A;
|
|
1451
1440
|
}
|
|
1452
|
-
const R = Z(() =>
|
|
1441
|
+
const R = Z(() => f === "receive/request" ? h() : M()), U = W(!1), O = W(""), k = W(""), Y = W(!1);
|
|
1453
1442
|
return {
|
|
1454
1443
|
columnDefs: R,
|
|
1455
|
-
showCustomPrintDialog:
|
|
1444
|
+
showCustomPrintDialog: U,
|
|
1456
1445
|
customPrintHtml: O,
|
|
1457
1446
|
customPrintTemplateName: k,
|
|
1458
1447
|
customPrintIsDefault: Y
|
|
@@ -1465,29 +1454,29 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1465
1454
|
confirm: { type: Function }
|
|
1466
1455
|
},
|
|
1467
1456
|
emits: ["update:show"],
|
|
1468
|
-
setup(
|
|
1469
|
-
const s =
|
|
1457
|
+
setup(f, { emit: r }) {
|
|
1458
|
+
const s = f, i = ir({
|
|
1470
1459
|
id: "",
|
|
1471
1460
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1472
1461
|
items: []
|
|
1473
|
-
}), c =
|
|
1474
|
-
|
|
1475
|
-
s.purchaseOrder && (
|
|
1462
|
+
}), c = W(), n = r;
|
|
1463
|
+
Ut(() => {
|
|
1464
|
+
s.purchaseOrder && (i.items = s.purchaseOrder.items.map((t) => ({
|
|
1476
1465
|
id: t.id,
|
|
1477
1466
|
sku: t.sku,
|
|
1478
1467
|
measurement: t.measurement,
|
|
1479
1468
|
amount: t.quantity ?? { amount: 1, precision: 0 }
|
|
1480
1469
|
})));
|
|
1481
1470
|
});
|
|
1482
|
-
const
|
|
1471
|
+
const p = Z(() => i.items.length <= 10);
|
|
1483
1472
|
return (t, a) => {
|
|
1484
1473
|
const b = X("FmTable"), y = X("FmButton"), x = X("FmForm");
|
|
1485
|
-
return
|
|
1474
|
+
return l(), ie(x, {
|
|
1486
1475
|
ref_key: "formRef",
|
|
1487
1476
|
ref: c,
|
|
1488
1477
|
class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
|
|
1489
1478
|
onValidationFailed: console.log,
|
|
1490
|
-
onValidationSuccess: a[1] || (a[1] = () => s.confirm(
|
|
1479
|
+
onValidationSuccess: a[1] || (a[1] = () => s.confirm(i))
|
|
1491
1480
|
}, {
|
|
1492
1481
|
default: oe(() => [
|
|
1493
1482
|
a[2] || (a[2] = e("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
|
|
@@ -1542,39 +1531,39 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1542
1531
|
{
|
|
1543
1532
|
header: "Amount",
|
|
1544
1533
|
cell: (_) => {
|
|
1545
|
-
const C = _.row.original, h = s.purchaseOrder.items.find((R) => R.id === C.id || R.sku._id === C.sku._id),
|
|
1534
|
+
const C = _.row.original, h = s.purchaseOrder.items.find((R) => R.id === C.id || R.sku._id === C.sku._id), M = C.amount ?? {
|
|
1546
1535
|
amount: 1,
|
|
1547
1536
|
precision: 0
|
|
1548
1537
|
};
|
|
1549
|
-
return z(
|
|
1538
|
+
return z(Ir, {
|
|
1550
1539
|
style: {
|
|
1551
1540
|
flex: "1 1 0%"
|
|
1552
1541
|
},
|
|
1553
1542
|
modelValue: {
|
|
1554
|
-
amount:
|
|
1543
|
+
amount: M,
|
|
1555
1544
|
measurement: C.measurement ?? null
|
|
1556
1545
|
},
|
|
1557
1546
|
key: C.id ?? C.sku._id,
|
|
1558
1547
|
unit: C.sku.unit,
|
|
1559
1548
|
"onUpdate:modelValue": (R) => {
|
|
1560
1549
|
if (!R) return;
|
|
1561
|
-
const
|
|
1562
|
-
|
|
1550
|
+
const U = i.items.find((O) => O.id === C.id || O.sku._id === C.sku._id);
|
|
1551
|
+
U && (U.amount = R.amount);
|
|
1563
1552
|
},
|
|
1564
1553
|
disableUnit: !0,
|
|
1565
1554
|
rules: [
|
|
1566
|
-
m(
|
|
1555
|
+
m(qr)(
|
|
1567
1556
|
+m(be)({ amount: 0, precision: 0 })
|
|
1568
1557
|
),
|
|
1569
|
-
m(
|
|
1558
|
+
m(Er)(+m(be)(h.quantity))
|
|
1570
1559
|
],
|
|
1571
1560
|
applyDefaultRules: !0
|
|
1572
1561
|
});
|
|
1573
1562
|
}
|
|
1574
1563
|
}
|
|
1575
1564
|
],
|
|
1576
|
-
"row-data":
|
|
1577
|
-
"hide-footer":
|
|
1565
|
+
"row-data": i.items,
|
|
1566
|
+
"hide-footer": p.value
|
|
1578
1567
|
}, null, 8, ["column-defs", "row-data", "hide-footer"])
|
|
1579
1568
|
])
|
|
1580
1569
|
]),
|
|
@@ -1599,7 +1588,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1599
1588
|
}, 8, ["onValidationFailed"]);
|
|
1600
1589
|
};
|
|
1601
1590
|
}
|
|
1602
|
-
}),
|
|
1591
|
+
}), ft = {
|
|
1603
1592
|
submitRequest: {
|
|
1604
1593
|
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
1605
1594
|
color: "primary",
|
|
@@ -1671,8 +1660,8 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1671
1660
|
isTransferBetweenOutlets: { type: Boolean },
|
|
1672
1661
|
scope: {}
|
|
1673
1662
|
},
|
|
1674
|
-
setup(
|
|
1675
|
-
const r =
|
|
1663
|
+
setup(f) {
|
|
1664
|
+
const r = f, s = ct(), i = Ke(), c = ut(), n = W(!1);
|
|
1676
1665
|
Z(() => {
|
|
1677
1666
|
var y, x, _, C;
|
|
1678
1667
|
let t = !0;
|
|
@@ -1680,7 +1669,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1680
1669
|
const a = r.purchaseOrder, b = r.poRequest;
|
|
1681
1670
|
return a && ((y = a == null ? void 0 : a.supplier) != null && y.internal ? (!b && a.status == ae.enum.DRAFT && (t = !1), b && !((x = b == null ? void 0 : b.netSuite) != null && x.id) && (t = !1), r.isTransferBetweenOutlets && (t = !1)) : ((a == null ? void 0 : a.status) !== ae.enum.REQUESTING && a.supplier.internal && (t = !1), !b && !((_ = a == null ? void 0 : a.netSuite) != null && _.id) && (t = !1), !b && ((C = a == null ? void 0 : a.netSuite) != null && C.id) && (a == null ? void 0 : a.status) == ae.enum.REQUESTING && (t = !1))), t;
|
|
1682
1671
|
});
|
|
1683
|
-
async function
|
|
1672
|
+
async function p() {
|
|
1684
1673
|
n.value || c.open({
|
|
1685
1674
|
title: "Sync with NetSuite",
|
|
1686
1675
|
contentComponent: z("div", [
|
|
@@ -1702,18 +1691,18 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1702
1691
|
var t, a, b, y, x, _, C;
|
|
1703
1692
|
try {
|
|
1704
1693
|
n.value = !0;
|
|
1705
|
-
const h = ((t = r.purchaseOrder) == null ? void 0 : t._id) || ((a = r.poRequest) == null ? void 0 : a.purchaseOrderId) || "",
|
|
1694
|
+
const h = ((t = r.purchaseOrder) == null ? void 0 : t._id) || ((a = r.poRequest) == null ? void 0 : a.purchaseOrderId) || "", M = (b = r.poRequest) == null ? void 0 : b.to.dbName;
|
|
1706
1695
|
await s.syncPurchaseOrder({
|
|
1707
1696
|
purchaseOrderId: h,
|
|
1708
|
-
locationId: r.scope === "approval" ?
|
|
1697
|
+
locationId: r.scope === "approval" ? M : void 0,
|
|
1709
1698
|
netsuiteId: ((x = (y = r.purchaseOrder) == null ? void 0 : y.netSuite) == null ? void 0 : x.id) || ((C = (_ = r.poRequest) == null ? void 0 : _.netSuite) == null ? void 0 : C.id)
|
|
1710
|
-
}),
|
|
1699
|
+
}), i.open({
|
|
1711
1700
|
title: "Sync with NetSuite",
|
|
1712
1701
|
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
1713
1702
|
type: "success"
|
|
1714
1703
|
}), await new Promise((R) => setTimeout(R, 5e3)), n.value = !1;
|
|
1715
1704
|
} catch (h) {
|
|
1716
|
-
console.log("Failed to sync with NetSuite", h),
|
|
1705
|
+
console.log("Failed to sync with NetSuite", h), i.open({
|
|
1717
1706
|
title: "Error",
|
|
1718
1707
|
message: "Failed to sync with NetSuite",
|
|
1719
1708
|
type: "error"
|
|
@@ -1723,13 +1712,13 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1723
1712
|
}
|
|
1724
1713
|
return (t, a) => {
|
|
1725
1714
|
const b = X("FmButton");
|
|
1726
|
-
return
|
|
1715
|
+
return l(), v("div", is, [
|
|
1727
1716
|
L(b, {
|
|
1728
1717
|
"prepend-icon": "sync",
|
|
1729
1718
|
variant: "secondary",
|
|
1730
1719
|
label: "Sync",
|
|
1731
1720
|
loading: n.value,
|
|
1732
|
-
onClick:
|
|
1721
|
+
onClick: p,
|
|
1733
1722
|
"text-color": "primary",
|
|
1734
1723
|
"bg-color": "transparent",
|
|
1735
1724
|
"border-color": "primary"
|
|
@@ -1762,12 +1751,12 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1762
1751
|
isTransferBetweenOutlets: { type: Boolean },
|
|
1763
1752
|
scope: {}
|
|
1764
1753
|
},
|
|
1765
|
-
setup(
|
|
1766
|
-
const r =
|
|
1767
|
-
|
|
1754
|
+
setup(f) {
|
|
1755
|
+
const r = f, s = ct(), i = He(), c = W(r.poRequest);
|
|
1756
|
+
Ut(async () => {
|
|
1768
1757
|
var a;
|
|
1769
1758
|
if (!r.poRequest && ((a = r.purchaseOrder) != null && a._id)) {
|
|
1770
|
-
const b = await
|
|
1759
|
+
const b = await i.getLatestPurchaseOrderRequest(r.purchaseOrder._id);
|
|
1771
1760
|
c.value = b;
|
|
1772
1761
|
}
|
|
1773
1762
|
});
|
|
@@ -1778,44 +1767,44 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1778
1767
|
((y = (b = (a = r.purchaseOrder) == null ? void 0 : a.netSuite) == null ? void 0 : b.subsidiary) == null ? void 0 : y.id) || ((C = (_ = (x = r.poRequest) == null ? void 0 : x.netSuite) == null ? void 0 : _.subsidiary) == null ? void 0 : C.id)
|
|
1779
1768
|
).fullName;
|
|
1780
1769
|
}
|
|
1781
|
-
),
|
|
1782
|
-
var a, b, y, x, _, C, h,
|
|
1783
|
-
return (y = (b = (a = r.purchaseOrder) == null ? void 0 : a.netSuite) == null ? void 0 : b.additionalInfo) != null && y.transactionnumber ? (C = (_ = (x = r.purchaseOrder) == null ? void 0 : x.netSuite) == null ? void 0 : _.additionalInfo) == null ? void 0 : C.transactionnumber : (R = (
|
|
1770
|
+
), p = Z(() => {
|
|
1771
|
+
var a, b, y, x, _, C, h, M, R, U, O, k;
|
|
1772
|
+
return (y = (b = (a = r.purchaseOrder) == null ? void 0 : a.netSuite) == null ? void 0 : b.additionalInfo) != null && y.transactionnumber ? (C = (_ = (x = r.purchaseOrder) == null ? void 0 : x.netSuite) == null ? void 0 : _.additionalInfo) == null ? void 0 : C.transactionnumber : (R = (M = (h = c.value) == null ? void 0 : h.netSuite) == null ? void 0 : M.additionalInfo) != null && R.transactionnumber ? (k = (O = (U = c.value) == null ? void 0 : U.netSuite) == null ? void 0 : O.additionalInfo) == null ? void 0 : k.transactionnumber : null;
|
|
1784
1773
|
}), t = Z(() => {
|
|
1785
1774
|
var a, b, y, x, _, C;
|
|
1786
1775
|
return (b = (a = r.purchaseOrder) == null ? void 0 : a.deliveryFullfillment) != null && b.length && ((x = (y = r.purchaseOrder) == null ? void 0 : y.deliveryFullfillment) == null ? void 0 : x.length) > 0 ? (C = (_ = r.purchaseOrder) == null ? void 0 : _.deliveryFullfillment) == null ? void 0 : C.map((h) => {
|
|
1787
|
-
var
|
|
1788
|
-
return (
|
|
1776
|
+
var M;
|
|
1777
|
+
return (M = h.netSuite) == null ? void 0 : M.refNo;
|
|
1789
1778
|
}).join(", ") : "N/A";
|
|
1790
1779
|
});
|
|
1791
1780
|
return (a, b) => {
|
|
1792
|
-
var y, x, _, C, h,
|
|
1793
|
-
return m(s).isEnabled ? (
|
|
1781
|
+
var y, x, _, C, h, M, R, U, O, k, Y, A, T, $, S, q;
|
|
1782
|
+
return m(s).isEnabled ? (l(), v("div", us, [
|
|
1794
1783
|
e("div", ds, [
|
|
1795
1784
|
b[0] || (b[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
1796
1785
|
e("div", ms, d(n.value || "N/A"), 1)
|
|
1797
1786
|
]),
|
|
1798
|
-
!a.isTransferBetweenOutlets && a.scope === m(
|
|
1799
|
-
e("div", fs, " NetSuite " + d((x = (y = a.purchaseOrder) == null ? void 0 : y.netSuite) != null && x.recordType ? m(zt)((C = (_ = a.purchaseOrder) == null ? void 0 : _.netSuite) == null ? void 0 : C.recordType) : a.transferType === m(
|
|
1787
|
+
!a.isTransferBetweenOutlets && a.scope === m(bt).RECEIVE_REQUEST ? (l(), v("div", ps, [
|
|
1788
|
+
e("div", fs, " NetSuite " + d((x = (y = a.purchaseOrder) == null ? void 0 : y.netSuite) != null && x.recordType ? m(zt)((C = (_ = a.purchaseOrder) == null ? void 0 : _.netSuite) == null ? void 0 : C.recordType) : a.transferType === m(Xe).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1800
1789
|
e("div", ys, [
|
|
1801
|
-
(
|
|
1790
|
+
(M = (h = a.purchaseOrder) == null ? void 0 : h.netSuite) != null && M.id ? (l(), v("span", vs, d((U = (R = a.purchaseOrder) == null ? void 0 : R.netSuite) == null ? void 0 : U.refNo) + " (" + d((k = (O = a.purchaseOrder) == null ? void 0 : O.netSuite) == null ? void 0 : k.id) + ") ", 1)) : (l(), v("span", bs, "N/A"))
|
|
1802
1791
|
])
|
|
1803
|
-
])) :
|
|
1804
|
-
!a.isTransferBetweenOutlets && c.value || a.scope === m(
|
|
1805
|
-
e("div", gs, " (Request) NetSuite " + d(a.transferType === m(
|
|
1792
|
+
])) : j("", !0),
|
|
1793
|
+
!a.isTransferBetweenOutlets && c.value || a.scope === m(bt).APPROVAL ? (l(), v("div", hs, [
|
|
1794
|
+
e("div", gs, " (Request) NetSuite " + d(a.transferType === m(Xe).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1806
1795
|
e("div", _s, [
|
|
1807
|
-
(
|
|
1796
|
+
(A = (Y = c.value) == null ? void 0 : Y.netSuite) != null && A.id ? (l(), v("span", xs, d(($ = (T = c.value) == null ? void 0 : T.netSuite) == null ? void 0 : $.refNo) + " (" + d((q = (S = c.value) == null ? void 0 : S.netSuite) == null ? void 0 : q.id) + ") ", 1)) : (l(), v("span", Ss, "N/A"))
|
|
1808
1797
|
])
|
|
1809
|
-
])) :
|
|
1810
|
-
|
|
1798
|
+
])) : j("", !0),
|
|
1799
|
+
p.value ? (l(), v("div", Os, [
|
|
1811
1800
|
b[1] || (b[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
|
|
1812
|
-
e("div", ws, d(
|
|
1813
|
-
])) :
|
|
1814
|
-
m(s).isEnabled && a.transferType === m(
|
|
1801
|
+
e("div", ws, d(p.value), 1)
|
|
1802
|
+
])) : j("", !0),
|
|
1803
|
+
m(s).isEnabled && a.transferType === m(Xe).enum.transfer && !a.isTransferBetweenOutlets ? (l(), v("div", Cs, [
|
|
1815
1804
|
b[2] || (b[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
1816
1805
|
e("div", Ds, d(t.value), 1)
|
|
1817
|
-
])) :
|
|
1818
|
-
])) :
|
|
1806
|
+
])) : j("", !0)
|
|
1807
|
+
])) : j("", !0);
|
|
1819
1808
|
};
|
|
1820
1809
|
}
|
|
1821
1810
|
}), ks = { class: "flex flex-row-reverse" }, Rs = /* @__PURE__ */ Oe({
|
|
@@ -1824,22 +1813,22 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1824
1813
|
netsuiteId: {},
|
|
1825
1814
|
purchaseOrderId: {}
|
|
1826
1815
|
},
|
|
1827
|
-
setup(
|
|
1828
|
-
const r =
|
|
1829
|
-
async function
|
|
1830
|
-
const
|
|
1831
|
-
if (c &&
|
|
1816
|
+
setup(f) {
|
|
1817
|
+
const r = Ke(), s = xt();
|
|
1818
|
+
async function i(c, n) {
|
|
1819
|
+
const p = [];
|
|
1820
|
+
if (c && p.push(`body.message:*${c}*`), n) {
|
|
1832
1821
|
const y = n.replace(/:/g, "\\:");
|
|
1833
|
-
|
|
1822
|
+
p.push(`${y}`);
|
|
1834
1823
|
}
|
|
1835
|
-
if (
|
|
1824
|
+
if (p.length === 0) {
|
|
1836
1825
|
r.open({
|
|
1837
1826
|
message: "Cannot open logs without valid filters.",
|
|
1838
1827
|
type: "error"
|
|
1839
1828
|
});
|
|
1840
1829
|
return;
|
|
1841
1830
|
}
|
|
1842
|
-
const a = `attributes.pod:netsuite* AND (${
|
|
1831
|
+
const a = `attributes.pod:netsuite* AND (${p.join(" OR ")})`, { url: b } = await s.getSyncLogs(a);
|
|
1843
1832
|
r.open(
|
|
1844
1833
|
{
|
|
1845
1834
|
message: "Opening NetSuite logs...",
|
|
@@ -1849,13 +1838,13 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1849
1838
|
), await new Promise((y) => setTimeout(y, 800)), window.open(b, "_blank");
|
|
1850
1839
|
}
|
|
1851
1840
|
return (c, n) => {
|
|
1852
|
-
const
|
|
1853
|
-
return
|
|
1854
|
-
L(
|
|
1841
|
+
const p = X("FmButton");
|
|
1842
|
+
return l(), v("div", ks, [
|
|
1843
|
+
L(p, {
|
|
1855
1844
|
"prepend-icon": "history",
|
|
1856
1845
|
variant: "secondary",
|
|
1857
1846
|
label: "Logs",
|
|
1858
|
-
onClick: n[0] || (n[0] = (t) =>
|
|
1847
|
+
onClick: n[0] || (n[0] = (t) => i(c.netsuiteId, c.purchaseOrderId)),
|
|
1859
1848
|
"text-color": "primary",
|
|
1860
1849
|
"bg-color": "transparent",
|
|
1861
1850
|
"border-color": "primary"
|
|
@@ -1869,29 +1858,29 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1869
1858
|
}, Vs = {
|
|
1870
1859
|
key: 1,
|
|
1871
1860
|
class: "border-t pt-6"
|
|
1872
|
-
}, Ls = { class: "fm-typo-en-body-lg-600 mb-4 flex items-center gap-2" },
|
|
1861
|
+
}, Ls = { class: "fm-typo-en-body-lg-600 mb-4 flex items-center gap-2" }, js = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg overflow-y-auto" }, Ms = { class: "w-full" }, Us = {
|
|
1873
1862
|
class: "p-3 fm-typo-en-body-sm-600",
|
|
1874
1863
|
style: { "min-width": "130px" }
|
|
1875
|
-
}, Bs = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, zs = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ks = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Hs = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1864
|
+
}, Bs = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, zs = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ks = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Hs = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Gs = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ws = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ys = { class: "p-3 fm-typo-en-body-sm-600" }, Qs = { key: 2 }, Js = { key: 1 }, Xs = /* @__PURE__ */ Oe({
|
|
1876
1865
|
__name: "NetSuiteLatestInfo",
|
|
1877
1866
|
props: {
|
|
1878
1867
|
netsuiteId: {},
|
|
1879
1868
|
purchaseOrderId: {}
|
|
1880
1869
|
},
|
|
1881
|
-
setup(
|
|
1882
|
-
const r =
|
|
1870
|
+
setup(f) {
|
|
1871
|
+
const r = f, s = xt(), i = W(!1), c = Te(), n = W(!0), p = W(!1), t = W(!1), a = W(!1), b = W(null), y = W([]);
|
|
1883
1872
|
async function x() {
|
|
1884
1873
|
if (!b.value) {
|
|
1885
|
-
|
|
1874
|
+
i.value = !0;
|
|
1886
1875
|
try {
|
|
1887
1876
|
n.value = !0;
|
|
1888
|
-
const
|
|
1877
|
+
const M = await s.getMoreInfo(
|
|
1889
1878
|
c.currentLocation.dbName,
|
|
1890
1879
|
r.purchaseOrderId
|
|
1891
1880
|
);
|
|
1892
|
-
b.value =
|
|
1881
|
+
b.value = M, p.value = !1;
|
|
1893
1882
|
} catch {
|
|
1894
|
-
|
|
1883
|
+
p.value = !0;
|
|
1895
1884
|
} finally {
|
|
1896
1885
|
n.value = !1;
|
|
1897
1886
|
}
|
|
@@ -1902,16 +1891,16 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1902
1891
|
if (!(y.value.length > 0))
|
|
1903
1892
|
try {
|
|
1904
1893
|
t.value = !0;
|
|
1905
|
-
const
|
|
1906
|
-
y.value =
|
|
1894
|
+
const M = await s.getChangeLogs(r.netsuiteId);
|
|
1895
|
+
y.value = M, a.value = !1;
|
|
1907
1896
|
} catch {
|
|
1908
1897
|
a.value = !0;
|
|
1909
1898
|
} finally {
|
|
1910
1899
|
t.value = !1;
|
|
1911
1900
|
}
|
|
1912
1901
|
}
|
|
1913
|
-
function C(
|
|
1914
|
-
switch (
|
|
1902
|
+
function C(M) {
|
|
1903
|
+
switch (M) {
|
|
1915
1904
|
case Ne.Create:
|
|
1916
1905
|
return "text-green-600 bg-green-100";
|
|
1917
1906
|
case Ne.Set:
|
|
@@ -1924,8 +1913,8 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1924
1913
|
return "text-gray-600 bg-gray-100";
|
|
1925
1914
|
}
|
|
1926
1915
|
}
|
|
1927
|
-
function h(
|
|
1928
|
-
return new Date(
|
|
1916
|
+
function h(M) {
|
|
1917
|
+
return new Date(M).toLocaleDateString("en-US", {
|
|
1929
1918
|
year: "numeric",
|
|
1930
1919
|
month: "short",
|
|
1931
1920
|
day: "numeric",
|
|
@@ -1933,21 +1922,21 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1933
1922
|
minute: "2-digit"
|
|
1934
1923
|
});
|
|
1935
1924
|
}
|
|
1936
|
-
return (
|
|
1937
|
-
const
|
|
1938
|
-
return
|
|
1939
|
-
L(
|
|
1940
|
-
modelValue:
|
|
1941
|
-
"onUpdate:modelValue": R[2] || (R[2] = (
|
|
1925
|
+
return (M, R) => {
|
|
1926
|
+
const U = X("FmButton"), O = X("FmLabel"), k = X("FmCircularProgress"), Y = X("FmIcon"), A = X("FmDialog");
|
|
1927
|
+
return l(), v("div", Ns, [
|
|
1928
|
+
L(A, {
|
|
1929
|
+
modelValue: i.value,
|
|
1930
|
+
"onUpdate:modelValue": R[2] || (R[2] = (T) => i.value = T),
|
|
1942
1931
|
overlay: !0,
|
|
1943
1932
|
"max-width": 800
|
|
1944
1933
|
}, {
|
|
1945
1934
|
"dialog-button": oe(() => [
|
|
1946
|
-
L(
|
|
1935
|
+
L(U, {
|
|
1947
1936
|
"prepend-icon": "info",
|
|
1948
1937
|
variant: "secondary",
|
|
1949
1938
|
label: "Latest Info",
|
|
1950
|
-
onClick: R[0] || (R[0] = (
|
|
1939
|
+
onClick: R[0] || (R[0] = (T) => x()),
|
|
1951
1940
|
"text-color": "primary",
|
|
1952
1941
|
"bg-color": "transparent",
|
|
1953
1942
|
"border-color": "primary"
|
|
@@ -1957,29 +1946,29 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1957
1946
|
e("div", null, "NetSuite latest info", -1)
|
|
1958
1947
|
])),
|
|
1959
1948
|
default: oe(() => [
|
|
1960
|
-
n.value ? (
|
|
1961
|
-
|
|
1949
|
+
n.value ? (l(), v("div", As, "Loading...")) : (l(), v("div", Ps, [
|
|
1950
|
+
p.value ? (l(), v("p", Js, "Something went wrong.")) : (l(), v(fe, { key: 0 }, [
|
|
1962
1951
|
e("div", Ts, [
|
|
1963
1952
|
R[4] || (R[4] = e("h3", { class: "fm-typo-en-body-lg-600 mb-4" }, "NetSuite Order Details", -1)),
|
|
1964
|
-
(
|
|
1953
|
+
(l(!0), v(fe, null, ke(b.value, (T, $) => (l(), v("div", {
|
|
1965
1954
|
key: $,
|
|
1966
1955
|
class: "mb-2"
|
|
1967
1956
|
}, [
|
|
1968
1957
|
e("div", null, [
|
|
1969
1958
|
L(O, {
|
|
1970
|
-
label: m(
|
|
1959
|
+
label: m(ht)($)
|
|
1971
1960
|
}, null, 8, ["label"]),
|
|
1972
1961
|
e("div", Fs, [
|
|
1973
|
-
Array.isArray(
|
|
1962
|
+
Array.isArray(T) ? (l(), v("span", Is, d(T.length > 0 ? T.join(", ") : "N/A"), 1)) : (l(), v("span", qs, d(T), 1))
|
|
1974
1963
|
])
|
|
1975
1964
|
])
|
|
1976
1965
|
]))), 128))
|
|
1977
1966
|
]),
|
|
1978
|
-
t.value ? (
|
|
1967
|
+
t.value ? (l(), v("div", Es, [
|
|
1979
1968
|
R[5] || (R[5] = e("span", null, "Change Log Loading...", -1)),
|
|
1980
1969
|
L(k, { size: "md" })
|
|
1981
|
-
])) :
|
|
1982
|
-
!t.value && y.value.length > 0 ? (
|
|
1970
|
+
])) : j("", !0),
|
|
1971
|
+
!t.value && y.value.length > 0 ? (l(), v("div", Vs, [
|
|
1983
1972
|
e("h3", Ls, [
|
|
1984
1973
|
L(Y, {
|
|
1985
1974
|
name: "error",
|
|
@@ -1988,8 +1977,8 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1988
1977
|
}),
|
|
1989
1978
|
R[6] || (R[6] = Ee(" Change Logs "))
|
|
1990
1979
|
]),
|
|
1991
|
-
e("div",
|
|
1992
|
-
e("table",
|
|
1980
|
+
e("div", js, [
|
|
1981
|
+
e("table", Ms, [
|
|
1993
1982
|
R[7] || (R[7] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
|
|
1994
1983
|
e("tr", { class: "border-b border-fm-color-neutral-gray-200" }, [
|
|
1995
1984
|
e("th", {
|
|
@@ -2007,38 +1996,38 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2007
1996
|
])
|
|
2008
1997
|
], -1)),
|
|
2009
1998
|
e("tbody", null, [
|
|
2010
|
-
(
|
|
1999
|
+
(l(!0), v(fe, null, ke(y.value, (T, $) => (l(), v("tr", {
|
|
2011
2000
|
key: $,
|
|
2012
2001
|
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
2013
2002
|
}, [
|
|
2014
|
-
e("td",
|
|
2015
|
-
e("td", Bs, d(
|
|
2016
|
-
e("td", zs, d(
|
|
2017
|
-
e("td", Ks, d(
|
|
2003
|
+
e("td", Us, d(h(T._dateiso8601)), 1),
|
|
2004
|
+
e("td", Bs, d(T._rolename), 1),
|
|
2005
|
+
e("td", zs, d(T._employeename), 1),
|
|
2006
|
+
e("td", Ks, d(T._contextname), 1),
|
|
2018
2007
|
e("td", {
|
|
2019
|
-
class: Pe(`p-3 fm-typo-en-body-sm-600 ${C(Number(
|
|
2020
|
-
}, d(m(Ne)[Number(
|
|
2021
|
-
e("td", Hs, d(
|
|
2022
|
-
e("td",
|
|
2023
|
-
e("td",
|
|
2024
|
-
e("td", Ys, d(
|
|
2008
|
+
class: Pe(`p-3 fm-typo-en-body-sm-600 ${C(Number(T.type) - 1)}`)
|
|
2009
|
+
}, d(m(Ne)[Number(T.type) - 1]), 3),
|
|
2010
|
+
e("td", Hs, d(T.lineid || ""), 1),
|
|
2011
|
+
e("td", Gs, d(T._fieldname), 1),
|
|
2012
|
+
e("td", Ws, d(T.oldvalue || ""), 1),
|
|
2013
|
+
e("td", Ys, d(T.newvalue || ""), 1)
|
|
2025
2014
|
]))), 128))
|
|
2026
2015
|
])
|
|
2027
2016
|
])
|
|
2028
2017
|
])
|
|
2029
|
-
])) : (
|
|
2018
|
+
])) : (l(), v("div", Qs, R[8] || (R[8] = [
|
|
2030
2019
|
e("p", null, "No change logs available.", -1)
|
|
2031
2020
|
])))
|
|
2032
2021
|
], 64))
|
|
2033
2022
|
]))
|
|
2034
2023
|
]),
|
|
2035
2024
|
"dialog-footer": oe(() => [
|
|
2036
|
-
L(
|
|
2025
|
+
L(U, {
|
|
2037
2026
|
class: "ml-auto sm:w-full xs:w-full",
|
|
2038
2027
|
label: "Close",
|
|
2039
2028
|
size: "md",
|
|
2040
2029
|
variant: "primary",
|
|
2041
|
-
onClick: R[1] || (R[1] = (
|
|
2030
|
+
onClick: R[1] || (R[1] = (T) => i.value = !1)
|
|
2042
2031
|
})
|
|
2043
2032
|
]),
|
|
2044
2033
|
_: 1
|
|
@@ -2058,17 +2047,17 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2058
2047
|
transferToDbName: {},
|
|
2059
2048
|
scope: {}
|
|
2060
2049
|
},
|
|
2061
|
-
setup(
|
|
2062
|
-
const r =
|
|
2050
|
+
setup(f) {
|
|
2051
|
+
const r = f, s = Lr(), i = Z(() => s.isNetSuiteEnabled);
|
|
2063
2052
|
return (c, n) => {
|
|
2064
2053
|
var t, a;
|
|
2065
|
-
const
|
|
2066
|
-
return
|
|
2054
|
+
const p = X("FmMenuDivider");
|
|
2055
|
+
return i.value ? (l(), v("div", Zs, [
|
|
2067
2056
|
e("div", eo, [
|
|
2068
2057
|
n[0] || (n[0] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
2069
2058
|
e("div", to, [
|
|
2070
2059
|
e("div", ro, [
|
|
2071
|
-
(a = (t = r.purchaseOrder) == null ? void 0 : t.netSuite) != null && a.id ? (
|
|
2060
|
+
(a = (t = r.purchaseOrder) == null ? void 0 : t.netSuite) != null && a.id ? (l(), ie(ze, { key: 0 }, {
|
|
2072
2061
|
default: oe(() => {
|
|
2073
2062
|
var b, y, x;
|
|
2074
2063
|
return [
|
|
@@ -2079,7 +2068,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2079
2068
|
];
|
|
2080
2069
|
}),
|
|
2081
2070
|
_: 1
|
|
2082
|
-
})) :
|
|
2071
|
+
})) : j("", !0),
|
|
2083
2072
|
L(ze, null, {
|
|
2084
2073
|
default: oe(() => {
|
|
2085
2074
|
var b, y, x;
|
|
@@ -2095,25 +2084,25 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2095
2084
|
L(cs, {
|
|
2096
2085
|
"po-request": c.poRequest,
|
|
2097
2086
|
"purchase-order": c.purchaseOrder,
|
|
2098
|
-
"is-transfer-between-outlets": !
|
|
2087
|
+
"is-transfer-between-outlets": !i.value,
|
|
2099
2088
|
scope: c.scope
|
|
2100
2089
|
}, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets", "scope"])
|
|
2101
2090
|
])
|
|
2102
2091
|
])
|
|
2103
2092
|
]),
|
|
2104
|
-
L(
|
|
2093
|
+
L(p),
|
|
2105
2094
|
L($s, {
|
|
2106
2095
|
"po-request": c.poRequest,
|
|
2107
2096
|
"purchase-order": c.purchaseOrder,
|
|
2108
2097
|
"transfer-type": c.transferType,
|
|
2109
2098
|
"transfer-to-db-name": c.transferToDbName,
|
|
2110
|
-
"is-transfer-between-outlets": !
|
|
2099
|
+
"is-transfer-between-outlets": !i.value,
|
|
2111
2100
|
scope: c.scope
|
|
2112
2101
|
}, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
|
|
2113
|
-
])) :
|
|
2102
|
+
])) : j("", !0);
|
|
2114
2103
|
};
|
|
2115
2104
|
}
|
|
2116
|
-
}), oo = ["open"], no = { class: "fm-typo-en-body-sm-600 cursor-pointer select-none" },
|
|
2105
|
+
}), oo = ["open"], no = { class: "fm-typo-en-body-sm-600 cursor-pointer select-none" }, Mt = /* @__PURE__ */ Oe({
|
|
2117
2106
|
__name: "FmAdminCollapsiblePanel",
|
|
2118
2107
|
props: {
|
|
2119
2108
|
title: { default: "Admin" },
|
|
@@ -2122,9 +2111,9 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2122
2111
|
class: { default: void 0 },
|
|
2123
2112
|
contentClass: { default: void 0 }
|
|
2124
2113
|
},
|
|
2125
|
-
setup(
|
|
2126
|
-
const r =
|
|
2127
|
-
return (s,
|
|
2114
|
+
setup(f) {
|
|
2115
|
+
const r = f;
|
|
2116
|
+
return (s, i) => (l(), ie(ze, {
|
|
2128
2117
|
selectable: r.selectable,
|
|
2129
2118
|
class: Pe(r.class)
|
|
2130
2119
|
}, {
|
|
@@ -2160,16 +2149,16 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2160
2149
|
deliveryOrder: {}
|
|
2161
2150
|
},
|
|
2162
2151
|
emits: ["submitted"],
|
|
2163
|
-
setup(
|
|
2164
|
-
|
|
2165
|
-
const s = Ve(),
|
|
2152
|
+
setup(f, { emit: r }) {
|
|
2153
|
+
Br();
|
|
2154
|
+
const s = Ve(), i = Ke(), c = W(!1), n = f, p = r, t = Kt("deliveryOrder"), a = He(), b = Z(
|
|
2166
2155
|
() => {
|
|
2167
|
-
var
|
|
2168
|
-
return ((
|
|
2156
|
+
var U;
|
|
2157
|
+
return ((U = n.purchaseOrder.deliveryFullfillment) == null ? void 0 : U.findIndex(
|
|
2169
2158
|
(O) => n.deliveryOrder.fullfillmentId && O.id === n.deliveryOrder.fullfillmentId
|
|
2170
2159
|
)) ?? -1;
|
|
2171
2160
|
}
|
|
2172
|
-
), y = s.enablePurchaseOrderReceiveWithCustomCost, x = s.enablePortalDeliveryOrderWrite, _ =
|
|
2161
|
+
), y = s.enablePurchaseOrderReceiveWithCustomCost, x = s.enablePortalDeliveryOrderWrite, _ = W({}), C = Z(() => n.purchaseOrder.items.map((U, O) => Z({
|
|
2173
2162
|
get: () => {
|
|
2174
2163
|
var Y;
|
|
2175
2164
|
const k = (Y = t.received[O]) == null ? void 0 : Y.cost;
|
|
@@ -2181,7 +2170,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2181
2170
|
...ot(k, 4)
|
|
2182
2171
|
};
|
|
2183
2172
|
}
|
|
2184
|
-
}))), h = Z(() => n.deliveryOrder.received.map((
|
|
2173
|
+
}))), h = Z(() => n.deliveryOrder.received.map((U, O) => Z({
|
|
2185
2174
|
get: () => {
|
|
2186
2175
|
var Y;
|
|
2187
2176
|
const k = (Y = t.received[O]) == null ? void 0 : Y.amount;
|
|
@@ -2191,21 +2180,21 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2191
2180
|
t.received[O].amount = ot(k, 2);
|
|
2192
2181
|
}
|
|
2193
2182
|
})));
|
|
2194
|
-
function U
|
|
2195
|
-
const O = !_.value[
|
|
2196
|
-
if (_.value[
|
|
2197
|
-
const k = n.deliveryOrder.received[
|
|
2198
|
-
k.cost ? t.received[
|
|
2183
|
+
function M(U) {
|
|
2184
|
+
const O = !_.value[U];
|
|
2185
|
+
if (_.value[U] = O, O) {
|
|
2186
|
+
const k = n.deliveryOrder.received[U];
|
|
2187
|
+
k.cost ? t.received[U].cost = {
|
|
2199
2188
|
currency: k.cost.currency,
|
|
2200
2189
|
amount: k.cost.amount,
|
|
2201
2190
|
precision: k.cost.precision
|
|
2202
|
-
} : t.received[
|
|
2191
|
+
} : t.received[U].cost = {
|
|
2203
2192
|
currency: De(),
|
|
2204
2193
|
amount: 0,
|
|
2205
2194
|
precision: 4
|
|
2206
2195
|
};
|
|
2207
2196
|
} else
|
|
2208
|
-
delete t.received[
|
|
2197
|
+
delete t.received[U].cost;
|
|
2209
2198
|
}
|
|
2210
2199
|
function R() {
|
|
2211
2200
|
a.updateDeliveryOrder({
|
|
@@ -2216,34 +2205,34 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2216
2205
|
purchaseOrderId: n.purchaseOrder._id,
|
|
2217
2206
|
purchaseOrderRev: n.purchaseOrder._rev
|
|
2218
2207
|
}).then(() => {
|
|
2219
|
-
|
|
2208
|
+
i.open(
|
|
2220
2209
|
{
|
|
2221
2210
|
title: "Success",
|
|
2222
2211
|
message: `PO# ${n.purchaseOrder.seqNumber} Changes have been saved`,
|
|
2223
2212
|
type: "success"
|
|
2224
2213
|
},
|
|
2225
2214
|
1e4
|
|
2226
|
-
), c.value = !1,
|
|
2215
|
+
), c.value = !1, p("submitted");
|
|
2227
2216
|
});
|
|
2228
2217
|
}
|
|
2229
|
-
return (
|
|
2230
|
-
const k = X("FmButton"), Y = X("FmStepperField"),
|
|
2231
|
-
return
|
|
2218
|
+
return (U, O) => {
|
|
2219
|
+
const k = X("FmButton"), Y = X("FmStepperField"), A = X("FmSwitch"), T = X("FmTextField"), $ = X("FmDialog");
|
|
2220
|
+
return l(), ie($, {
|
|
2232
2221
|
modelValue: c.value,
|
|
2233
2222
|
"onUpdate:modelValue": O[1] || (O[1] = (S) => c.value = S),
|
|
2234
2223
|
overlay: !0
|
|
2235
2224
|
}, {
|
|
2236
2225
|
"dialog-button": oe(() => [
|
|
2237
|
-
m(x) ? (
|
|
2226
|
+
m(x) ? (l(), ie(k, {
|
|
2238
2227
|
key: 0,
|
|
2239
2228
|
variant: "plain",
|
|
2240
2229
|
label: "Edit",
|
|
2241
2230
|
size: "md",
|
|
2242
2231
|
"prepend-icon": "edit"
|
|
2243
|
-
})) :
|
|
2232
|
+
})) : j("", !0)
|
|
2244
2233
|
]),
|
|
2245
2234
|
"dialog-header": oe(() => [
|
|
2246
|
-
e("div", null, "Received on " + d(m(
|
|
2235
|
+
e("div", null, "Received on " + d(m(Ze)(n.deliveryOrder.createdAt)), 1)
|
|
2247
2236
|
]),
|
|
2248
2237
|
"dialog-footer": oe(() => [
|
|
2249
2238
|
L(k, {
|
|
@@ -2259,13 +2248,13 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2259
2248
|
e("div", ao, [
|
|
2260
2249
|
e("div", lo, [
|
|
2261
2250
|
O[2] || (O[2] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Adjustment date", -1)),
|
|
2262
|
-
e("div", io, d(n.deliveryOrder.adjustment ? m(
|
|
2251
|
+
e("div", io, d(n.deliveryOrder.adjustment ? m(Ze)(new Date(m(st)(n.deliveryOrder.adjustment))) : "-"), 1)
|
|
2263
2252
|
]),
|
|
2264
2253
|
e("div", co, [
|
|
2265
2254
|
O[4] || (O[4] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received items", -1)),
|
|
2266
|
-
(
|
|
2267
|
-
var
|
|
2268
|
-
return
|
|
2255
|
+
(l(!0), v(fe, null, ke(n.deliveryOrder.received, (S, q) => {
|
|
2256
|
+
var G;
|
|
2257
|
+
return l(), v("div", { key: q }, [
|
|
2269
2258
|
e("div", uo, [
|
|
2270
2259
|
e("div", mo, [
|
|
2271
2260
|
e("span", po, d(S.sku.name), 1),
|
|
@@ -2274,41 +2263,41 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2274
2263
|
e("div", yo, [
|
|
2275
2264
|
L(Y, {
|
|
2276
2265
|
label: "Receive Quantity",
|
|
2277
|
-
modelValue: h.value[
|
|
2278
|
-
"onUpdate:modelValue": (Q) => h.value[
|
|
2266
|
+
modelValue: h.value[q].value,
|
|
2267
|
+
"onUpdate:modelValue": (Q) => h.value[q].value = Q,
|
|
2279
2268
|
min: 0,
|
|
2280
|
-
"append-text": ((
|
|
2269
|
+
"append-text": ((G = S.measurement) == null ? void 0 : G.abbrev) ?? S.sku.unit.abbrev
|
|
2281
2270
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"]),
|
|
2282
|
-
e("div", vo, d(`${S.cost ? `${m(
|
|
2283
|
-
m(y) ? (
|
|
2284
|
-
L(
|
|
2285
|
-
"model-value": _.value[
|
|
2286
|
-
"onUpdate:modelValue": (Q) =>
|
|
2271
|
+
e("div", vo, d(`${S.cost ? `${m(Qe)(S.cost)}` : ""}`), 1),
|
|
2272
|
+
m(y) ? (l(), v("div", bo, [
|
|
2273
|
+
L(A, {
|
|
2274
|
+
"model-value": _.value[q],
|
|
2275
|
+
"onUpdate:modelValue": (Q) => M(q),
|
|
2287
2276
|
size: "sm"
|
|
2288
2277
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2289
2278
|
O[3] || (O[3] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
2290
|
-
])) :
|
|
2291
|
-
m(y) && _.value[
|
|
2279
|
+
])) : j("", !0),
|
|
2280
|
+
m(y) && _.value[q] ? (l(), ie(Y, {
|
|
2292
2281
|
key: 1,
|
|
2293
|
-
modelValue: C.value[
|
|
2294
|
-
"onUpdate:modelValue": (Q) => C.value[
|
|
2282
|
+
modelValue: C.value[q].value,
|
|
2283
|
+
"onUpdate:modelValue": (Q) => C.value[q].value = Q,
|
|
2295
2284
|
label: "Total Cost",
|
|
2296
2285
|
step: 1e-4,
|
|
2297
2286
|
min: 0,
|
|
2298
2287
|
placeholder: "0.0000",
|
|
2299
2288
|
size: "sm",
|
|
2300
2289
|
"append-text": m(De)()
|
|
2301
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) :
|
|
2290
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : j("", !0)
|
|
2302
2291
|
])
|
|
2303
2292
|
]),
|
|
2304
|
-
|
|
2293
|
+
q < n.purchaseOrder.items.length - 1 ? (l(), v("div", ho)) : j("", !0)
|
|
2305
2294
|
]);
|
|
2306
2295
|
}), 128))
|
|
2307
2296
|
]),
|
|
2308
2297
|
e("div", go, [
|
|
2309
2298
|
O[5] || (O[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
|
|
2310
2299
|
e("div", _o, [
|
|
2311
|
-
L(
|
|
2300
|
+
L(T, {
|
|
2312
2301
|
modelValue: m(t).deliveryOrderNumber,
|
|
2313
2302
|
"onUpdate:modelValue": O[0] || (O[0] = (S) => m(t).deliveryOrderNumber = S),
|
|
2314
2303
|
size: "md",
|
|
@@ -2320,10 +2309,10 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2320
2309
|
O[6] || (O[6] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
|
|
2321
2310
|
e("div", So, d(n.deliveryOrder.remark || "N/A"), 1)
|
|
2322
2311
|
]),
|
|
2323
|
-
b.value >= 0 ? (
|
|
2312
|
+
b.value >= 0 ? (l(), v("div", Oo, [
|
|
2324
2313
|
O[7] || (O[7] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fulfilment's sequence ", -1)),
|
|
2325
2314
|
e("div", wo, d(b.value + 1), 1)
|
|
2326
|
-
])) :
|
|
2315
|
+
])) : j("", !0)
|
|
2327
2316
|
])
|
|
2328
2317
|
])
|
|
2329
2318
|
]),
|
|
@@ -2340,37 +2329,37 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2340
2329
|
}, To = { class: "flex gap-4" }, Fo = { class: "flex-1" }, Io = { class: "flex-1" }, qo = {
|
|
2341
2330
|
key: 0,
|
|
2342
2331
|
class: "flex items-center text-fm-color-system-error-300"
|
|
2343
|
-
}, Eo = { class: "fm-typo-en-body-md-400" }, Vo = { class: "flex flex-col gap-4" }, Lo = { class: "flex justify-between items-center py-1 gap-4" },
|
|
2332
|
+
}, Eo = { class: "fm-typo-en-body-md-400" }, Vo = { class: "flex flex-col gap-4" }, Lo = { class: "flex justify-between items-center py-1 gap-4" }, jo = { class: "flex flex-col" }, Mo = { class: "fm-typo-en-body-lg-600" }, Uo = { class: "fm-typo-en-body-md-400" }, Bo = { class: "flex flex-col gap-2 items-end" }, zo = {
|
|
2344
2333
|
key: 0,
|
|
2345
2334
|
class: "flex items-center gap-2"
|
|
2346
2335
|
}, Ko = {
|
|
2347
2336
|
key: 0,
|
|
2348
2337
|
class: "border-b border-fm-color-stroke-secondary"
|
|
2349
|
-
}, Ho = { class: "flex flex-col gap-4" },
|
|
2338
|
+
}, Ho = { class: "flex flex-col gap-4" }, Go = { class: "flex flex-col gap-4" }, Wo = { class: "flex flex-col gap-4" }, Yo = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, Qo = /* @__PURE__ */ Oe({
|
|
2350
2339
|
__name: "CreateForm",
|
|
2351
2340
|
props: {
|
|
2352
2341
|
purchaseOrder: {},
|
|
2353
2342
|
receivedInfoMap: {}
|
|
2354
2343
|
},
|
|
2355
2344
|
emits: ["submitted"],
|
|
2356
|
-
setup(
|
|
2357
|
-
var
|
|
2358
|
-
const { t: s } = it(),
|
|
2345
|
+
setup(f, { emit: r }) {
|
|
2346
|
+
var E, F, ee;
|
|
2347
|
+
const { t: s } = it(), i = W(!1), c = _t(), n = f, p = r, t = Kt("", {
|
|
2359
2348
|
default: {
|
|
2360
2349
|
deliveryOrderNumber: "",
|
|
2361
2350
|
remark: "",
|
|
2362
2351
|
received: n.purchaseOrder.items.map((w) => ({
|
|
2363
2352
|
sku: w.sku,
|
|
2364
|
-
amount:
|
|
2353
|
+
amount: Ue.fromNumber(0),
|
|
2365
2354
|
measurement: w.measurement
|
|
2366
2355
|
})),
|
|
2367
2356
|
createdBy: {
|
|
2368
|
-
id: ((
|
|
2369
|
-
name: ((
|
|
2357
|
+
id: ((E = c.sessionUser.value) == null ? void 0 : E.id) || "",
|
|
2358
|
+
name: ((F = c.sessionUser.value) == null ? void 0 : F.displayName) || ""
|
|
2370
2359
|
},
|
|
2371
2360
|
createdAt: ""
|
|
2372
2361
|
}
|
|
2373
|
-
}), a =
|
|
2362
|
+
}), a = He(), b = ut(), y = Ve(), x = ((ee = n.purchaseOrder) == null ? void 0 : ee.supplier.internal) != null, _ = x && y.enablePOSTransferRequireFulfillment, C = y.enablePortalDeliveryOrderWrite && (n.purchaseOrder.status === ae.Enum.RECEIVING || n.purchaseOrder.status === ae.Enum.COMPLETE) && (x ? !_ : !0), h = y.enablePurchaseOrderReceiveWithCustomCost, M = y.enableBackdateReceive, R = W({}), U = Ke(), O = Z({
|
|
2374
2363
|
get() {
|
|
2375
2364
|
if (!t.createdAt) return "";
|
|
2376
2365
|
const w = new Date(t.createdAt), g = w.getFullYear(), V = String(w.getMonth() + 1).padStart(2, "0"), H = String(w.getDate()).padStart(2, "0");
|
|
@@ -2399,24 +2388,24 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2399
2388
|
if (!w) return "";
|
|
2400
2389
|
const g = new Date(w), V = g.getFullYear(), H = String(g.getMonth() + 1).padStart(2, "0"), ce = String(g.getDate()).padStart(2, "0");
|
|
2401
2390
|
return `${V}-${H}-${ce}`;
|
|
2402
|
-
}),
|
|
2391
|
+
}), A = Z(() => {
|
|
2403
2392
|
const w = st(n.purchaseOrder._id);
|
|
2404
2393
|
return w ? new Date(w) : null;
|
|
2405
|
-
}),
|
|
2406
|
-
if (!O.value || !k.value || !
|
|
2407
|
-
if (/* @__PURE__ */ new Date(`${O.value}T${k.value}:00`) <
|
|
2408
|
-
const g = Y.value, V =
|
|
2394
|
+
}), T = Z(() => {
|
|
2395
|
+
if (!O.value || !k.value || !A.value) return null;
|
|
2396
|
+
if (/* @__PURE__ */ new Date(`${O.value}T${k.value}:00`) < A.value) {
|
|
2397
|
+
const g = Y.value, V = A.value.getHours(), H = A.value.getMinutes(), ce = V >= 12 ? "PM" : "AM", Re = V % 12 || 12, we = `${String(Re).padStart(2, "0")}:${String(H).padStart(2, "0")} ${ce}`;
|
|
2409
2398
|
return `Delivery date & time cannot be earlier than order creation (${g} ${we})`;
|
|
2410
2399
|
}
|
|
2411
2400
|
return null;
|
|
2412
|
-
}), $ = Z(() =>
|
|
2401
|
+
}), $ = Z(() => T.value ? !1 : t.received.some((g) => {
|
|
2413
2402
|
const V = g.amount;
|
|
2414
2403
|
return V ? +be(V) > 0 : !1;
|
|
2415
2404
|
}));
|
|
2416
2405
|
function S() {
|
|
2417
2406
|
t.createdAt = "";
|
|
2418
2407
|
}
|
|
2419
|
-
const
|
|
2408
|
+
const q = Z(() => n.purchaseOrder.items.map((w, g) => Z({
|
|
2420
2409
|
get: () => {
|
|
2421
2410
|
var H;
|
|
2422
2411
|
const V = (H = t.received[g]) == null ? void 0 : H.amount;
|
|
@@ -2426,7 +2415,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2426
2415
|
t.received[g].amount = ot(V, 2);
|
|
2427
2416
|
}
|
|
2428
2417
|
})));
|
|
2429
|
-
function
|
|
2418
|
+
function G(w) {
|
|
2430
2419
|
const g = !R.value[w];
|
|
2431
2420
|
if (R.value[w] = g, g) {
|
|
2432
2421
|
const V = n.purchaseOrder.items[w];
|
|
@@ -2478,33 +2467,33 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2478
2467
|
purchaseOrderRev: n.purchaseOrder._rev,
|
|
2479
2468
|
currency: De()
|
|
2480
2469
|
}).then(() => {
|
|
2481
|
-
|
|
2470
|
+
U.open(
|
|
2482
2471
|
{
|
|
2483
2472
|
title: "Success",
|
|
2484
2473
|
message: `New delivery order created for PO# ${n.purchaseOrder.seqNumber}`,
|
|
2485
2474
|
type: "success"
|
|
2486
2475
|
},
|
|
2487
2476
|
1e4
|
|
2488
|
-
),
|
|
2477
|
+
), i.value = !1, p("submitted");
|
|
2489
2478
|
});
|
|
2490
2479
|
}
|
|
2491
2480
|
return (w, g) => {
|
|
2492
2481
|
const V = X("FmButton"), H = X("FmDatePicker"), ce = X("FmTimePicker"), Re = X("FmIcon"), we = X("FmStepperField"), Ge = X("FmSwitch"), o = X("FmTextField"), u = X("FmDialog");
|
|
2493
|
-
return
|
|
2494
|
-
modelValue:
|
|
2495
|
-
"onUpdate:modelValue": g[4] || (g[4] = (
|
|
2482
|
+
return l(), ie(u, {
|
|
2483
|
+
modelValue: i.value,
|
|
2484
|
+
"onUpdate:modelValue": g[4] || (g[4] = (I) => i.value = I),
|
|
2496
2485
|
overlay: !0,
|
|
2497
2486
|
"min-width": 800
|
|
2498
2487
|
}, {
|
|
2499
2488
|
"dialog-button": oe(() => [
|
|
2500
|
-
m(C) ? (
|
|
2489
|
+
m(C) ? (l(), ie(V, {
|
|
2501
2490
|
key: 0,
|
|
2502
2491
|
variant: "primary",
|
|
2503
2492
|
label: "Create",
|
|
2504
2493
|
size: "md",
|
|
2505
2494
|
"prepend-icon": "add",
|
|
2506
2495
|
class: "w-full"
|
|
2507
|
-
})) :
|
|
2496
|
+
})) : j("", !0)
|
|
2508
2497
|
]),
|
|
2509
2498
|
"dialog-header": oe(() => [
|
|
2510
2499
|
e("div", null, "Order #" + d(n.purchaseOrder.seqNumber) + " (New Delivery Order)", 1)
|
|
@@ -2520,82 +2509,82 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2520
2509
|
}, null, 8, ["disabled"])
|
|
2521
2510
|
]),
|
|
2522
2511
|
default: oe(() => {
|
|
2523
|
-
var
|
|
2512
|
+
var I;
|
|
2524
2513
|
return [
|
|
2525
2514
|
e("div", Do, [
|
|
2526
2515
|
e("div", $o, [
|
|
2527
2516
|
g[5] || (g[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received by", -1)),
|
|
2528
|
-
e("div", ko, d((
|
|
2517
|
+
e("div", ko, d((I = m(c).sessionUser.value) == null ? void 0 : I.displayName), 1)
|
|
2529
2518
|
]),
|
|
2530
|
-
m(
|
|
2519
|
+
m(M) ? (l(), v("div", Ro, [
|
|
2531
2520
|
e("div", No, [
|
|
2532
2521
|
e("div", Ao, [
|
|
2533
2522
|
g[6] || (g[6] = Ee(" Delivery Date & Time ")),
|
|
2534
|
-
!O.value && !k.value ? (
|
|
2523
|
+
!O.value && !k.value ? (l(), v("div", Po, " Leave blank to use current date & time ")) : j("", !0)
|
|
2535
2524
|
]),
|
|
2536
|
-
O.value || k.value ? (
|
|
2525
|
+
O.value || k.value ? (l(), ie(V, {
|
|
2537
2526
|
key: 0,
|
|
2538
2527
|
variant: "tertiary",
|
|
2539
2528
|
label: "Clear",
|
|
2540
2529
|
"prepend-icon": "close",
|
|
2541
2530
|
onClick: S
|
|
2542
|
-
})) :
|
|
2531
|
+
})) : j("", !0)
|
|
2543
2532
|
]),
|
|
2544
2533
|
e("div", To, [
|
|
2545
2534
|
e("div", Fo, [
|
|
2546
2535
|
L(H, {
|
|
2547
2536
|
modelValue: O.value,
|
|
2548
|
-
"onUpdate:modelValue": g[0] || (g[0] = (
|
|
2537
|
+
"onUpdate:modelValue": g[0] || (g[0] = (P) => O.value = P)
|
|
2549
2538
|
}, null, 8, ["modelValue"])
|
|
2550
2539
|
]),
|
|
2551
2540
|
e("div", Io, [
|
|
2552
2541
|
L(ce, {
|
|
2553
2542
|
modelValue: k.value,
|
|
2554
|
-
"onUpdate:modelValue": g[1] || (g[1] = (
|
|
2543
|
+
"onUpdate:modelValue": g[1] || (g[1] = (P) => k.value = P)
|
|
2555
2544
|
}, null, 8, ["modelValue"])
|
|
2556
2545
|
])
|
|
2557
2546
|
]),
|
|
2558
|
-
|
|
2547
|
+
T.value ? (l(), v("div", qo, [
|
|
2559
2548
|
L(Re, {
|
|
2560
2549
|
name: "error",
|
|
2561
2550
|
class: "inline-block mr-1",
|
|
2562
2551
|
size: "sm"
|
|
2563
2552
|
}),
|
|
2564
|
-
e("div", Eo, d(
|
|
2565
|
-
])) :
|
|
2566
|
-
])) :
|
|
2553
|
+
e("div", Eo, d(T.value), 1)
|
|
2554
|
+
])) : j("", !0)
|
|
2555
|
+
])) : j("", !0),
|
|
2567
2556
|
e("div", Vo, [
|
|
2568
2557
|
g[8] || (g[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
|
|
2569
|
-
(
|
|
2558
|
+
(l(!0), v(fe, null, ke(n.purchaseOrder.items, (P, K) => {
|
|
2570
2559
|
var B, J, D;
|
|
2571
|
-
return
|
|
2560
|
+
return l(), v("div", { key: K }, [
|
|
2572
2561
|
e("div", Lo, [
|
|
2573
|
-
e("div",
|
|
2574
|
-
e("span",
|
|
2575
|
-
e("span",
|
|
2562
|
+
e("div", jo, [
|
|
2563
|
+
e("span", Mo, d(P.sku.name), 1),
|
|
2564
|
+
e("span", Uo, d(P.sku.code), 1)
|
|
2576
2565
|
]),
|
|
2577
2566
|
e("div", Bo, [
|
|
2578
2567
|
L(we, {
|
|
2579
2568
|
label: "Receive Quantity",
|
|
2580
|
-
modelValue:
|
|
2581
|
-
"onUpdate:modelValue": (te) =>
|
|
2582
|
-
"helper-text": `${m(s)("inventory.transfer.receiveRequest.details.received")} ${m(
|
|
2569
|
+
modelValue: q.value[K].value,
|
|
2570
|
+
"onUpdate:modelValue": (te) => q.value[K].value = te,
|
|
2571
|
+
"helper-text": `${m(s)("inventory.transfer.receiveRequest.details.received")} ${m(Ue).toFormatString(
|
|
2583
2572
|
{
|
|
2584
|
-
value: (B = w.receivedInfoMap[
|
|
2573
|
+
value: (B = w.receivedInfoMap[P.sku._id]) == null ? void 0 : B.received
|
|
2585
2574
|
}
|
|
2586
|
-
)} ${((J =
|
|
2575
|
+
)} ${((J = P.measurement) == null ? void 0 : J.abbrev) ?? P.sku.unit.abbrev}`,
|
|
2587
2576
|
min: 0,
|
|
2588
|
-
"append-text": ((D =
|
|
2577
|
+
"append-text": ((D = P.measurement) == null ? void 0 : D.abbrev) ?? P.sku.unit.abbrev
|
|
2589
2578
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "helper-text", "append-text"]),
|
|
2590
|
-
m(h) ? (
|
|
2579
|
+
m(h) ? (l(), v("div", zo, [
|
|
2591
2580
|
L(Ge, {
|
|
2592
2581
|
"model-value": R.value[K],
|
|
2593
|
-
"onUpdate:modelValue": (te) =>
|
|
2582
|
+
"onUpdate:modelValue": (te) => G(K),
|
|
2594
2583
|
size: "sm"
|
|
2595
2584
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2596
2585
|
g[7] || (g[7] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
2597
|
-
])) :
|
|
2598
|
-
m(h) && R.value[K] ? (
|
|
2586
|
+
])) : j("", !0),
|
|
2587
|
+
m(h) && R.value[K] ? (l(), ie(we, {
|
|
2599
2588
|
key: 1,
|
|
2600
2589
|
modelValue: Q.value[K].value,
|
|
2601
2590
|
"onUpdate:modelValue": (te) => Q.value[K].value = te,
|
|
@@ -2605,29 +2594,29 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2605
2594
|
placeholder: "0.0000",
|
|
2606
2595
|
size: "sm",
|
|
2607
2596
|
"append-text": m(De)()
|
|
2608
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) :
|
|
2597
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : j("", !0)
|
|
2609
2598
|
])
|
|
2610
2599
|
]),
|
|
2611
|
-
K < n.purchaseOrder.items.length - 1 ? (
|
|
2600
|
+
K < n.purchaseOrder.items.length - 1 ? (l(), v("div", Ko)) : j("", !0)
|
|
2612
2601
|
]);
|
|
2613
2602
|
}), 128))
|
|
2614
2603
|
]),
|
|
2615
2604
|
e("div", Ho, [
|
|
2616
2605
|
g[9] || (g[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
|
|
2617
|
-
e("div",
|
|
2606
|
+
e("div", Go, [
|
|
2618
2607
|
L(o, {
|
|
2619
2608
|
modelValue: m(t).deliveryOrderNumber,
|
|
2620
|
-
"onUpdate:modelValue": g[2] || (g[2] = (
|
|
2609
|
+
"onUpdate:modelValue": g[2] || (g[2] = (P) => m(t).deliveryOrderNumber = P),
|
|
2621
2610
|
size: "md"
|
|
2622
2611
|
}, null, 8, ["modelValue"])
|
|
2623
2612
|
])
|
|
2624
2613
|
]),
|
|
2625
|
-
e("div",
|
|
2614
|
+
e("div", Wo, [
|
|
2626
2615
|
g[10] || (g[10] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
|
|
2627
2616
|
e("div", Yo, [
|
|
2628
2617
|
L(o, {
|
|
2629
2618
|
modelValue: m(t).remark,
|
|
2630
|
-
"onUpdate:modelValue": g[3] || (g[3] = (
|
|
2619
|
+
"onUpdate:modelValue": g[3] || (g[3] = (P) => m(t).remark = P),
|
|
2631
2620
|
size: "md"
|
|
2632
2621
|
}, null, 8, ["modelValue"])
|
|
2633
2622
|
])
|
|
@@ -2653,14 +2642,14 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2653
2642
|
props: {
|
|
2654
2643
|
netsuiteId: {}
|
|
2655
2644
|
},
|
|
2656
|
-
setup(
|
|
2657
|
-
const r =
|
|
2645
|
+
setup(f) {
|
|
2646
|
+
const r = f, s = xt(), i = W(!1), c = W(!1), n = W(!1), p = W([]);
|
|
2658
2647
|
async function t() {
|
|
2659
|
-
if (!(
|
|
2648
|
+
if (!(p.value.length > 0))
|
|
2660
2649
|
try {
|
|
2661
2650
|
c.value = !0;
|
|
2662
2651
|
const y = await s.getChangeLogs(r.netsuiteId);
|
|
2663
|
-
|
|
2652
|
+
p.value = y, n.value = !1;
|
|
2664
2653
|
} catch {
|
|
2665
2654
|
n.value = !0;
|
|
2666
2655
|
} finally {
|
|
@@ -2691,11 +2680,11 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2691
2680
|
});
|
|
2692
2681
|
}
|
|
2693
2682
|
return (y, x) => {
|
|
2694
|
-
const _ = X("FmButton"), C = X("FmCircularProgress"), h = X("FmIcon"),
|
|
2695
|
-
return
|
|
2696
|
-
L(
|
|
2697
|
-
modelValue:
|
|
2698
|
-
"onUpdate:modelValue": x[2] || (x[2] = (R) =>
|
|
2683
|
+
const _ = X("FmButton"), C = X("FmCircularProgress"), h = X("FmIcon"), M = X("FmDialog");
|
|
2684
|
+
return l(), v("div", Jo, [
|
|
2685
|
+
L(M, {
|
|
2686
|
+
modelValue: i.value,
|
|
2687
|
+
"onUpdate:modelValue": x[2] || (x[2] = (R) => i.value = R),
|
|
2699
2688
|
overlay: !0,
|
|
2700
2689
|
"max-width": 800
|
|
2701
2690
|
}, {
|
|
@@ -2714,11 +2703,11 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2714
2703
|
e("div", null, "NetSuite info", -1)
|
|
2715
2704
|
])),
|
|
2716
2705
|
default: oe(() => [
|
|
2717
|
-
c.value ? (
|
|
2706
|
+
c.value ? (l(), v("div", Xo, [
|
|
2718
2707
|
x[4] || (x[4] = e("span", null, "Change Log Loading...", -1)),
|
|
2719
2708
|
L(C, { size: "md" })
|
|
2720
|
-
])) :
|
|
2721
|
-
!c.value &&
|
|
2709
|
+
])) : j("", !0),
|
|
2710
|
+
!c.value && p.value.length > 0 ? (l(), v("div", Zo, [
|
|
2722
2711
|
e("h3", en, [
|
|
2723
2712
|
L(h, {
|
|
2724
2713
|
name: "error",
|
|
@@ -2746,8 +2735,8 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2746
2735
|
])
|
|
2747
2736
|
], -1)),
|
|
2748
2737
|
e("tbody", null, [
|
|
2749
|
-
(
|
|
2750
|
-
key:
|
|
2738
|
+
(l(!0), v(fe, null, ke(p.value, (R, U) => (l(), v("tr", {
|
|
2739
|
+
key: U,
|
|
2751
2740
|
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
2752
2741
|
}, [
|
|
2753
2742
|
e("td", sn, d(b(R._dateiso8601)), 1),
|
|
@@ -2765,7 +2754,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2765
2754
|
])
|
|
2766
2755
|
])
|
|
2767
2756
|
])
|
|
2768
|
-
])) : (
|
|
2757
|
+
])) : (l(), v("div", mn, x[7] || (x[7] = [
|
|
2769
2758
|
e("p", null, "No change logs available.", -1)
|
|
2770
2759
|
])))
|
|
2771
2760
|
]),
|
|
@@ -2775,7 +2764,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2775
2764
|
label: "Close",
|
|
2776
2765
|
size: "md",
|
|
2777
2766
|
variant: "primary",
|
|
2778
|
-
onClick: x[1] || (x[1] = (R) =>
|
|
2767
|
+
onClick: x[1] || (x[1] = (R) => i.value = !1)
|
|
2779
2768
|
})
|
|
2780
2769
|
]),
|
|
2781
2770
|
_: 1
|
|
@@ -2801,13 +2790,13 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2801
2790
|
}, An = { class: "text-xs font-mono text-right break-all" }, Pn = { class: "flex flex-col gap-4" }, Tn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fn = { class: "flex gap-1" }, In = { class: "fm-typo-en-body-lg-600" }, qn = {
|
|
2802
2791
|
key: 0,
|
|
2803
2792
|
class: "flex flex-col gap-4"
|
|
2804
|
-
}, En = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vn = { class: "fm-typo-en-body-lg-600" }, Ln = { class: "flex flex-col gap-4" },
|
|
2793
|
+
}, En = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vn = { class: "fm-typo-en-body-lg-600" }, Ln = { class: "flex flex-col gap-4" }, jn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mn = { class: "fm-typo-en-body-lg-600" }, Un = {
|
|
2805
2794
|
key: 1,
|
|
2806
2795
|
class: "flex flex-col gap-4"
|
|
2807
2796
|
}, Bn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zn = { class: "fm-typo-en-body-lg-600" }, Kn = {
|
|
2808
2797
|
key: 2,
|
|
2809
2798
|
class: "flex flex-col gap-4"
|
|
2810
|
-
}, Hn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
2799
|
+
}, Hn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Gn = { class: "fm-typo-en-body-lg-600" }, Wn = {
|
|
2811
2800
|
key: 3,
|
|
2812
2801
|
class: "flex flex-col gap-4"
|
|
2813
2802
|
}, Yn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qn = { class: "fm-typo-en-body-lg-600" }, Jn = {
|
|
@@ -2840,10 +2829,10 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2840
2829
|
}, Fa = { class: "fm-typo-en-body-lg-400" }, Ia = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, qa = { class: "ml-auto flex gap-1" }, Ea = { class: "flex gap-12 content-stretch" }, Va = {
|
|
2841
2830
|
class: "flex flex-col w-40",
|
|
2842
2831
|
name: "circles"
|
|
2843
|
-
}, La = { class: "flex-1 flex flex-col items-center" },
|
|
2832
|
+
}, La = { class: "flex-1 flex flex-col items-center" }, ja = {
|
|
2844
2833
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
2845
2834
|
name: "delivery details"
|
|
2846
|
-
},
|
|
2835
|
+
}, Ma = { class: "flex flex-col gap-8" }, Ua = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ba = { class: "flex flex-col gap-4" }, za = { class: "flex gap-8 xs:flex-col" }, Ol = /* @__PURE__ */ Oe({
|
|
2847
2836
|
__name: "TransferDetails",
|
|
2848
2837
|
props: {
|
|
2849
2838
|
poRequest: {},
|
|
@@ -2858,13 +2847,13 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2858
2847
|
shipments: {}
|
|
2859
2848
|
},
|
|
2860
2849
|
emits: ["update:show", "submitted"],
|
|
2861
|
-
setup(
|
|
2862
|
-
const s =
|
|
2850
|
+
setup(f, { emit: r }) {
|
|
2851
|
+
const s = f, i = r, c = ut(), n = Ke(), p = Ve(), t = Te(), a = _t(), { hasOrderDraftPermission: b } = Xt(), y = Qt();
|
|
2863
2852
|
function x(o) {
|
|
2864
|
-
const u = o.isCustomCost,
|
|
2865
|
-
return u != null ? u === !0 :
|
|
2853
|
+
const u = o.isCustomCost, I = o.totalCost;
|
|
2854
|
+
return u != null ? u === !0 : I != null;
|
|
2866
2855
|
}
|
|
2867
|
-
|
|
2856
|
+
et(
|
|
2868
2857
|
() => s.purchaseOrder,
|
|
2869
2858
|
(o) => {
|
|
2870
2859
|
y.init(o);
|
|
@@ -2879,34 +2868,34 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2879
2868
|
name: ((u = a.sessionUser.value) == null ? void 0 : u.displayName) ?? ""
|
|
2880
2869
|
};
|
|
2881
2870
|
}
|
|
2882
|
-
), C = Jt(), { t: h } = it(),
|
|
2871
|
+
), C = Jt(), { t: h } = it(), M = Z(
|
|
2883
2872
|
() => {
|
|
2884
|
-
var o, u,
|
|
2885
|
-
return ((u = (o = s.purchaseOrder) == null ? void 0 : o.supplier) == null ? void 0 : u.internal) === "restaurant" || ((
|
|
2873
|
+
var o, u, I, P;
|
|
2874
|
+
return ((u = (o = s.purchaseOrder) == null ? void 0 : o.supplier) == null ? void 0 : u.internal) === "restaurant" || ((P = (I = s.purchaseOrder) == null ? void 0 : I.supplier) == null ? void 0 : P.internal) === "warehouse" ? Xe.enum.transfer : Xe.enum.purchase;
|
|
2886
2875
|
}
|
|
2887
2876
|
), R = Z(() => {
|
|
2888
|
-
var
|
|
2889
|
-
const o = (
|
|
2877
|
+
var I;
|
|
2878
|
+
const o = (I = s.shipments) == null ? void 0 : I.find((P) => {
|
|
2890
2879
|
var K;
|
|
2891
|
-
return
|
|
2880
|
+
return P.ref === ((K = s.purchaseOrder) == null ? void 0 : K._id);
|
|
2892
2881
|
});
|
|
2893
2882
|
let u = null;
|
|
2894
2883
|
if (o != null && o.milestones && o.milestones.length > 0) {
|
|
2895
|
-
const
|
|
2896
|
-
if (
|
|
2897
|
-
const K = new Date(
|
|
2884
|
+
const P = o.milestones[o.milestones.length - 1];
|
|
2885
|
+
if (P.estimatedTime) {
|
|
2886
|
+
const K = new Date(P.estimatedTime), B = K.getDate().toString().padStart(2, "0");
|
|
2898
2887
|
u = `${K.toLocaleString("en-US", { month: "short" })} ${B}`;
|
|
2899
2888
|
}
|
|
2900
2889
|
}
|
|
2901
2890
|
return u;
|
|
2902
|
-
}),
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2891
|
+
}), U = W(!1), O = W(""), k = W(!0), Y = He(), A = Vr(Y.getWorkflowConfig), T = Yt(), $ = [
|
|
2892
|
+
N.enum.receiveStock,
|
|
2893
|
+
N.enum.processRequest,
|
|
2894
|
+
N.enum.closeRequest
|
|
2906
2895
|
], S = Z(() => {
|
|
2907
2896
|
if (!s.purchaseOrder)
|
|
2908
2897
|
return [];
|
|
2909
|
-
const o =
|
|
2898
|
+
const o = A.result.value;
|
|
2910
2899
|
if (o.state === Et.loading)
|
|
2911
2900
|
return [];
|
|
2912
2901
|
const u = {
|
|
@@ -2919,24 +2908,24 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2919
2908
|
),
|
|
2920
2909
|
purchaseOrderRequest: s.poRequest,
|
|
2921
2910
|
purchaseOrder: s.purchaseOrder
|
|
2922
|
-
},
|
|
2923
|
-
|
|
2911
|
+
}, I = p.useOperatePurchaseOrderV2, P = p.poWorkflowAllowToMarkCompleted, K = [...$];
|
|
2912
|
+
I && !P && K.push(N.enum.completeReceive);
|
|
2924
2913
|
let B = [];
|
|
2925
2914
|
try {
|
|
2926
|
-
o.state === Et.error ? (console.error("Error fetching workflow config:", o.error), B =
|
|
2915
|
+
o.state === Et.error ? (console.error("Error fetching workflow config:", o.error), B = dt.getAvailableActions({
|
|
2927
2916
|
...u,
|
|
2928
|
-
orderConfig:
|
|
2929
|
-
}).actions.filter((J) => !K.includes(J))) : B =
|
|
2917
|
+
orderConfig: dt.getDefaultConfig()
|
|
2918
|
+
}).actions.filter((J) => !K.includes(J))) : B = dt.getAvailableActions({
|
|
2930
2919
|
...u,
|
|
2931
2920
|
orderConfig: o.data
|
|
2932
2921
|
}).actions.filter((J) => !K.includes(J));
|
|
2933
2922
|
} catch (J) {
|
|
2934
2923
|
console.error("Error getting available actions:", J);
|
|
2935
2924
|
}
|
|
2936
|
-
return s.scope === "approval" && (B = B.filter((J) => J !==
|
|
2937
|
-
(J) => J !==
|
|
2925
|
+
return s.scope === "approval" && (B = B.filter((J) => J !== N.enum.completeReceive)), b.value || (B = B.filter(
|
|
2926
|
+
(J) => J !== N.enum.approveDraft && J !== N.enum.rejectDraft
|
|
2938
2927
|
)), B;
|
|
2939
|
-
}),
|
|
2928
|
+
}), q = Rr(s, "show"), G = Z(() => [
|
|
2940
2929
|
{
|
|
2941
2930
|
label: h("inventory.transfer.receiveRequest.details.overview"),
|
|
2942
2931
|
value: "overview"
|
|
@@ -2945,11 +2934,11 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2945
2934
|
label: h("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
2946
2935
|
value: "deliveryHistory"
|
|
2947
2936
|
}
|
|
2948
|
-
]), Q = G
|
|
2949
|
-
|
|
2937
|
+
]), Q = W(G.value[0]);
|
|
2938
|
+
et(
|
|
2950
2939
|
() => s.show,
|
|
2951
2940
|
(o) => {
|
|
2952
|
-
o && (Q.value =
|
|
2941
|
+
o && (Q.value = G.value[0]);
|
|
2953
2942
|
}
|
|
2954
2943
|
);
|
|
2955
2944
|
function ye(o) {
|
|
@@ -2961,28 +2950,28 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2961
2950
|
}
|
|
2962
2951
|
}));
|
|
2963
2952
|
}
|
|
2964
|
-
async function he(o, u,
|
|
2953
|
+
async function he(o, u, I, P, K) {
|
|
2965
2954
|
return new Promise((B, J) => {
|
|
2966
2955
|
const D = {
|
|
2967
2956
|
closeButton: !1,
|
|
2968
|
-
title:
|
|
2969
|
-
message:
|
|
2970
|
-
primaryActions:
|
|
2957
|
+
title: P.title,
|
|
2958
|
+
message: P.message,
|
|
2959
|
+
primaryActions: P.primaryActions,
|
|
2971
2960
|
secondaryActions: { text: "No", close: !1 }
|
|
2972
2961
|
};
|
|
2973
2962
|
let te = u.rejectReason ?? "";
|
|
2974
|
-
|
|
2975
|
-
message:
|
|
2963
|
+
I === N.enum.rejectDraft && (D.contentComponent = Wt, D.contentComponentProps = {
|
|
2964
|
+
message: P.message,
|
|
2976
2965
|
onChange: (ne) => {
|
|
2977
2966
|
te = ne ?? "";
|
|
2978
2967
|
}
|
|
2979
2968
|
}), c.open(D).onPrimary(async () => {
|
|
2980
2969
|
var de, re, le, ve;
|
|
2981
2970
|
const ne = [];
|
|
2982
|
-
|
|
2971
|
+
I === N.enum.confirmDraft || I === N.enum.submitRequest ? ne.push({
|
|
2983
2972
|
action: "confirmDraft",
|
|
2984
2973
|
payload: y.controller.value.toConfirmDraftData(De())
|
|
2985
|
-
}) :
|
|
2974
|
+
}) : I === N.enum.approveRequest ? (ne.push({
|
|
2986
2975
|
action: "approveRequest",
|
|
2987
2976
|
payload: null
|
|
2988
2977
|
}), u.fulfillment && ne.push({
|
|
@@ -2994,7 +2983,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2994
2983
|
items: ye(u.fulfillment.items),
|
|
2995
2984
|
createdBy: _.value
|
|
2996
2985
|
}
|
|
2997
|
-
})) :
|
|
2986
|
+
})) : I === N.enum.processRequest ? u.fulfillment && ne.push({
|
|
2998
2987
|
action: "processRequest",
|
|
2999
2988
|
payload: {
|
|
3000
2989
|
fulfillmentId: "",
|
|
@@ -3003,29 +2992,29 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3003
2992
|
items: ye(u.fulfillment.items),
|
|
3004
2993
|
createdBy: _.value
|
|
3005
2994
|
}
|
|
3006
|
-
}) :
|
|
2995
|
+
}) : I === N.enum.rejectRequest ? ne.push({
|
|
3007
2996
|
action: "rejectRequest",
|
|
3008
2997
|
payload: null
|
|
3009
|
-
}) :
|
|
2998
|
+
}) : I === N.enum.closeRequest ? ne.push({
|
|
3010
2999
|
action: "closeRequest",
|
|
3011
3000
|
payload: null
|
|
3012
|
-
}) :
|
|
3001
|
+
}) : I === N.enum.rejectDraft && ne.push({
|
|
3013
3002
|
action: "rejectDraft",
|
|
3014
3003
|
payload: {
|
|
3015
3004
|
rejectReason: te ?? ""
|
|
3016
3005
|
}
|
|
3017
3006
|
});
|
|
3018
3007
|
try {
|
|
3019
|
-
await
|
|
3008
|
+
await T({
|
|
3020
3009
|
operate: {
|
|
3021
|
-
operation:
|
|
3010
|
+
operation: I,
|
|
3022
3011
|
doc: o,
|
|
3023
3012
|
options: u
|
|
3024
3013
|
},
|
|
3025
3014
|
operateV2: {
|
|
3026
3015
|
_id: ((de = s.purchaseOrder) == null ? void 0 : de._id) ?? "",
|
|
3027
3016
|
_rev: ((re = s.purchaseOrder) == null ? void 0 : re._rev) ?? "",
|
|
3028
|
-
action:
|
|
3017
|
+
action: I === N.enum.submitRequest ? N.enum.confirmDraft : I,
|
|
3029
3018
|
payloads: ne
|
|
3030
3019
|
// add payload if action is receiveStock or processRequest
|
|
3031
3020
|
},
|
|
@@ -3042,28 +3031,28 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3042
3031
|
});
|
|
3043
3032
|
});
|
|
3044
3033
|
}
|
|
3045
|
-
async function
|
|
3034
|
+
async function E(o) {
|
|
3046
3035
|
var K, B, J, D;
|
|
3047
|
-
if (o ===
|
|
3036
|
+
if (o === N.enum.receiveStock)
|
|
3048
3037
|
return;
|
|
3049
|
-
const u =
|
|
3038
|
+
const u = Gt[o];
|
|
3050
3039
|
if (!u) {
|
|
3051
3040
|
n.open({
|
|
3052
3041
|
title: "Something went wrong",
|
|
3053
|
-
message: `Cannot process order: ${
|
|
3042
|
+
message: `Cannot process order: ${ht(o)}`,
|
|
3054
3043
|
type: "error"
|
|
3055
3044
|
});
|
|
3056
3045
|
return;
|
|
3057
3046
|
}
|
|
3058
|
-
const { successMessage:
|
|
3047
|
+
const { successMessage: I, ...P } = u;
|
|
3059
3048
|
if (s.purchaseOrder) {
|
|
3060
|
-
O.value = `${o}`,
|
|
3049
|
+
O.value = `${o}`, U.value = !0, k.value = !1;
|
|
3061
3050
|
const te = {};
|
|
3062
3051
|
let ne = 0;
|
|
3063
|
-
if ((o ===
|
|
3064
|
-
o ===
|
|
3052
|
+
if ((o === N.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
3053
|
+
o === N.enum.completeReceive) && p.autoReceiveWarehouse)
|
|
3065
3054
|
te.autoReceive = !0;
|
|
3066
|
-
else if ((o ===
|
|
3055
|
+
else if ((o === N.enum.approveRequest || o === N.enum.processRequest) && p.acceptRequireFulfillment) {
|
|
3067
3056
|
const de = (B = (K = s.poRequest) == null ? void 0 : K.from) == null ? void 0 : B.dbName, re = (D = (J = s.poRequest) == null ? void 0 : J.to) == null ? void 0 : D.dbName;
|
|
3068
3057
|
if (de && re && (de.startsWith("warehouse_") || re.startsWith("warehouse_"))) {
|
|
3069
3058
|
const le = await new Promise((ve, Ae) => {
|
|
@@ -3075,7 +3064,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3075
3064
|
purchaseOrder: s.purchaseOrder,
|
|
3076
3065
|
confirm: ve,
|
|
3077
3066
|
"onUpdate:show": (Le) => {
|
|
3078
|
-
Le || (O.value = "",
|
|
3067
|
+
Le || (O.value = "", U.value = !1, k.value = !0, ne++, c.close()), Ae("cancelled");
|
|
3079
3068
|
}
|
|
3080
3069
|
}
|
|
3081
3070
|
});
|
|
@@ -3092,9 +3081,9 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3092
3081
|
ne
|
|
3093
3082
|
) === "submitted" && (n.open({
|
|
3094
3083
|
title: "Success",
|
|
3095
|
-
message:
|
|
3084
|
+
message: I,
|
|
3096
3085
|
type: "success"
|
|
3097
|
-
}),
|
|
3086
|
+
}), i("update:show", !1), i("submitted"));
|
|
3098
3087
|
} catch (de) {
|
|
3099
3088
|
n.open({
|
|
3100
3089
|
title: "Something went wrong",
|
|
@@ -3102,25 +3091,25 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3102
3091
|
type: "error"
|
|
3103
3092
|
}), console.error("Error when submitting PO operation", o, s.purchaseOrder, de);
|
|
3104
3093
|
} finally {
|
|
3105
|
-
O.value = "",
|
|
3094
|
+
O.value = "", U.value = !1, k.value = !0;
|
|
3106
3095
|
}
|
|
3107
3096
|
}
|
|
3108
3097
|
}
|
|
3109
|
-
const
|
|
3098
|
+
const F = Z(() => {
|
|
3110
3099
|
var o, u;
|
|
3111
3100
|
return ((o = s.purchaseOrder) == null ? void 0 : o.status) === ae.enum.RECEIVING || ((u = s.purchaseOrder) == null ? void 0 : u.status) === ae.enum.COMPLETE;
|
|
3112
3101
|
}), ee = Z(() => s.purchaseOrder ? at(s.purchaseOrder) : {}), w = Z(() => {
|
|
3113
3102
|
const o = s.purchaseOrder;
|
|
3114
3103
|
if (!o) return { status: "", statusClass: "" };
|
|
3115
|
-
const { partial: u, over:
|
|
3116
|
-
let K = h(`inventory.transfer.status.${
|
|
3117
|
-
return
|
|
3104
|
+
const { partial: u, over: I } = yt(ee.value), P = vt(o.status, u, I);
|
|
3105
|
+
let K = h(`inventory.transfer.status.${P}`), B = `${o.status}`.toLocaleLowerCase("en-us");
|
|
3106
|
+
return P === ae.enum.CLOSE && (K = `${h(`inventory.transfer.status.${ae.enum.COMPLETE}`)}`), P === "PARTIAL_RECEIVED" && B === ae.enum.PROCESSING.toLocaleLowerCase("en-us") && (B = ae.enum.RECEIVING.toLocaleLowerCase("en-us")), {
|
|
3118
3107
|
status: K,
|
|
3119
3108
|
statusClass: `fm-status-badge fm-status-badge-${B}`
|
|
3120
3109
|
};
|
|
3121
3110
|
}), g = Z(() => {
|
|
3122
3111
|
var B, J;
|
|
3123
|
-
const o = ((B = s.purchaseOrder) == null ? void 0 : B.deliveryOrder) ?? [], u = ((J = s.purchaseOrder) == null ? void 0 : J.deliveryFullfillment) ?? [],
|
|
3112
|
+
const o = ((B = s.purchaseOrder) == null ? void 0 : B.deliveryOrder) ?? [], u = ((J = s.purchaseOrder) == null ? void 0 : J.deliveryFullfillment) ?? [], I = [
|
|
3124
3113
|
...o.map((D) => ({
|
|
3125
3114
|
createdAt: D.createdAt,
|
|
3126
3115
|
type: "grn",
|
|
@@ -3132,8 +3121,8 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3132
3121
|
doc: D
|
|
3133
3122
|
}))
|
|
3134
3123
|
];
|
|
3135
|
-
|
|
3136
|
-
function
|
|
3124
|
+
I.reverse().sort((D, te) => D.createdAt.localeCompare(te.createdAt));
|
|
3125
|
+
function P(D) {
|
|
3137
3126
|
var de, re, le, ve, Ae, Le, se, me, ge, Se, $e, Fe;
|
|
3138
3127
|
const te = u.findIndex((pe) => pe.id === D.fullfillmentId), ne = [
|
|
3139
3128
|
(re = (de = u[te]) == null ? void 0 : de.netSuite) != null && re.id ? {
|
|
@@ -3154,12 +3143,12 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3154
3143
|
return {
|
|
3155
3144
|
header: "Received",
|
|
3156
3145
|
deliveryOrder: D,
|
|
3157
|
-
date:
|
|
3146
|
+
date: Ze(new Date(D.createdAt)),
|
|
3158
3147
|
info: [
|
|
3159
3148
|
{
|
|
3160
3149
|
label: "Adjustment date",
|
|
3161
3150
|
values: [
|
|
3162
|
-
D.adjustment ?
|
|
3151
|
+
D.adjustment ? Ze(new Date(st(D.adjustment))) : "-"
|
|
3163
3152
|
]
|
|
3164
3153
|
},
|
|
3165
3154
|
{
|
|
@@ -3232,7 +3221,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3232
3221
|
{
|
|
3233
3222
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
3234
3223
|
},
|
|
3235
|
-
`${pe.cost ? `(${
|
|
3224
|
+
`${pe.cost ? `(${Qe(pe.cost)})` : ""}`
|
|
3236
3225
|
)
|
|
3237
3226
|
]
|
|
3238
3227
|
)
|
|
@@ -3262,7 +3251,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3262
3251
|
const te = u.findIndex((le) => le.id === D.id);
|
|
3263
3252
|
return {
|
|
3264
3253
|
header: "Fulfillment",
|
|
3265
|
-
date:
|
|
3254
|
+
date: Ze(new Date(D.createdAt)),
|
|
3266
3255
|
info: [
|
|
3267
3256
|
{
|
|
3268
3257
|
label: "Sequence",
|
|
@@ -3334,7 +3323,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3334
3323
|
{
|
|
3335
3324
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
3336
3325
|
},
|
|
3337
|
-
`${le.cost ? `(${
|
|
3326
|
+
`${le.cost ? `(${Qe(le.cost)})` : ""}`
|
|
3338
3327
|
)
|
|
3339
3328
|
]
|
|
3340
3329
|
)
|
|
@@ -3350,69 +3339,64 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3350
3339
|
].filter((le) => !!le)
|
|
3351
3340
|
};
|
|
3352
3341
|
}
|
|
3353
|
-
return
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
return A(D.doc);
|
|
3357
|
-
case "fulfillment":
|
|
3358
|
-
return K(D.doc);
|
|
3359
|
-
}
|
|
3360
|
-
});
|
|
3342
|
+
return I.map(
|
|
3343
|
+
(D) => D.type === "grn" ? P(D.doc) : K(D.doc)
|
|
3344
|
+
);
|
|
3361
3345
|
});
|
|
3362
3346
|
function V(o) {
|
|
3363
3347
|
var B;
|
|
3364
|
-
const
|
|
3365
|
-
return `<span class="${H(o)} fm-typo-en-body-lg-600">${
|
|
3348
|
+
const I = (((B = s.purchaseOrder) == null ? void 0 : B.version) ?? Me.enum[1]) === Me.enum[2] ? o.id : o.sku._id, P = s.receivedMap[I];
|
|
3349
|
+
return `<span class="${H(o)} fm-typo-en-body-lg-600">${Ue.toFormatString({ value: P.received })}</span>/${Tr(o.quantity, o.sku.unit, o.measurement)}`;
|
|
3366
3350
|
}
|
|
3367
3351
|
function H(o) {
|
|
3368
3352
|
var te;
|
|
3369
|
-
const
|
|
3353
|
+
const I = (((te = s.purchaseOrder) == null ? void 0 : te.version) ?? Me.enum[1]) === Me.enum[2] ? o.id : o.sku._id, P = s.receivedMap[I], { isPartialReceive: K, isNoReceive: B, isOverReceive: J, isFullReceive: D } = rs(P);
|
|
3370
3354
|
return B ? "text-fm-color-typo-tertiary" : K ? "text-fm-color-system-warning-300" : J ? "text-fm-color-system-error-300" : D ? "text-fm-color-system-success-300" : "";
|
|
3371
3355
|
}
|
|
3372
3356
|
const ce = Z(() => {
|
|
3373
|
-
var o, u,
|
|
3374
|
-
return (o = s.purchaseOrder) != null && o.itemsAtSubmission ? ((u = s.purchaseOrder) == null ? void 0 : u.version) ===
|
|
3357
|
+
var o, u, I;
|
|
3358
|
+
return (o = s.purchaseOrder) != null && o.itemsAtSubmission ? ((u = s.purchaseOrder) == null ? void 0 : u.version) === Me.enum[2] ? s.purchaseOrder.items.reduce((P, K) => {
|
|
3375
3359
|
var J, D;
|
|
3376
3360
|
const B = (D = (J = s.purchaseOrder) == null ? void 0 : J.itemsAtSubmission) == null ? void 0 : D.find(
|
|
3377
3361
|
(te) => te.id === K.id
|
|
3378
3362
|
);
|
|
3379
|
-
return B && B.quantity !== K.quantity &&
|
|
3380
|
-
originalAmount: Number(
|
|
3381
|
-
newAmount: Number(
|
|
3382
|
-
}),
|
|
3383
|
-
}, /* @__PURE__ */ new Map()) : (
|
|
3363
|
+
return B && B.quantity !== K.quantity && P.set(K.sku.code, {
|
|
3364
|
+
originalAmount: Number(Ue.toFormatString({ value: B.quantity })),
|
|
3365
|
+
newAmount: Number(Ue.toFormatString({ value: K.quantity }))
|
|
3366
|
+
}), P;
|
|
3367
|
+
}, /* @__PURE__ */ new Map()) : (I = s.purchaseOrder) == null ? void 0 : I.items.reduce((P, K) => {
|
|
3384
3368
|
var te, ne;
|
|
3385
3369
|
const B = (ne = (te = s.purchaseOrder) == null ? void 0 : te.itemsAtSubmission) == null ? void 0 : ne.find(
|
|
3386
3370
|
(de) => de.sku._id === K.sku._id
|
|
3387
|
-
), J = B ? Number(
|
|
3388
|
-
return B && J !== D &&
|
|
3371
|
+
), J = B ? Number(Ue.toFormatString({ value: B.quantity })) : 0, D = Number(Ue.toFormatString({ value: K.quantity }));
|
|
3372
|
+
return B && J !== D && P.set(K.sku.code, {
|
|
3389
3373
|
originalAmount: J,
|
|
3390
3374
|
newAmount: D
|
|
3391
|
-
}),
|
|
3375
|
+
}), P;
|
|
3392
3376
|
}, /* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
|
|
3393
3377
|
}), Re = (o) => {
|
|
3394
|
-
var
|
|
3378
|
+
var I, P;
|
|
3395
3379
|
const u = ce.value;
|
|
3396
|
-
return ((
|
|
3380
|
+
return ((I = s.purchaseOrder) == null ? void 0 : I.version) === Me.enum[2] ? u.has(o.id) : u.has((P = o.sku) == null ? void 0 : P.code);
|
|
3397
3381
|
}, we = (o) => {
|
|
3398
|
-
var
|
|
3382
|
+
var I, P;
|
|
3399
3383
|
const u = ce.value;
|
|
3400
|
-
return ((
|
|
3384
|
+
return ((I = s.purchaseOrder) == null ? void 0 : I.version) === Me.enum[2] ? u.get(o.id) : u.get((P = o.sku) == null ? void 0 : P.code);
|
|
3401
3385
|
}, Ge = Z(() => {
|
|
3402
3386
|
const o = s.purchaseOrder;
|
|
3403
3387
|
if (!o) return "";
|
|
3404
|
-
const u = o.actionChangelogs ?? [],
|
|
3405
|
-
if (
|
|
3406
|
-
const
|
|
3407
|
-
return
|
|
3388
|
+
const u = o.actionChangelogs ?? [], I = u.length ? u[u.length - 1] : null;
|
|
3389
|
+
if (I && I.action === "rejectDraft") {
|
|
3390
|
+
const P = I.remarks ?? "";
|
|
3391
|
+
return P && P.toString().trim() !== "" ? P.toString() : "-";
|
|
3408
3392
|
}
|
|
3409
3393
|
return "";
|
|
3410
3394
|
});
|
|
3411
3395
|
return (o, u) => {
|
|
3412
|
-
const
|
|
3413
|
-
return
|
|
3414
|
-
modelValue: m(
|
|
3415
|
-
"onUpdate:modelValue": u[8] || (u[8] = (re) => ur(
|
|
3396
|
+
const I = X("FmButton"), P = X("FmButtonGroup"), K = X("FmChip"), B = X("FmIcon"), J = X("FmMenuDivider"), D = X("FmCard"), te = X("FmTooltip"), ne = X("FmSpacer"), de = X("FmSideSheet");
|
|
3397
|
+
return l(), ie(de, {
|
|
3398
|
+
modelValue: m(q),
|
|
3399
|
+
"onUpdate:modelValue": u[8] || (u[8] = (re) => ur(q) ? q.value = re : null),
|
|
3416
3400
|
"dismiss-away": k.value,
|
|
3417
3401
|
"max-width": 600,
|
|
3418
3402
|
"close-button": !1
|
|
@@ -3423,26 +3407,26 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3423
3407
|
e("div", fn, [
|
|
3424
3408
|
e("div", yn, [
|
|
3425
3409
|
e("div", vn, d(m(h)("inventory.transfer.receiveRequest.details.title") + ((re = o.purchaseOrder) != null && re.seqNumber ? ` #${(le = o.purchaseOrder) == null ? void 0 : le.seqNumber}` : "")), 1),
|
|
3426
|
-
L(
|
|
3410
|
+
L(I, {
|
|
3427
3411
|
class: "ml-auto -m-2",
|
|
3428
3412
|
variant: "tertiary",
|
|
3429
3413
|
"prepend-icon": "close",
|
|
3430
|
-
onClick: u[0] || (u[0] = (ve) =>
|
|
3414
|
+
onClick: u[0] || (u[0] = (ve) => i("update:show", !1))
|
|
3431
3415
|
})
|
|
3432
3416
|
]),
|
|
3433
|
-
L(
|
|
3434
|
-
items:
|
|
3417
|
+
L(P, {
|
|
3418
|
+
items: G.value,
|
|
3435
3419
|
modelValue: Q.value,
|
|
3436
3420
|
"onUpdate:modelValue": u[1] || (u[1] = (ve) => Q.value = ve)
|
|
3437
3421
|
}, null, 8, ["items", "modelValue"]),
|
|
3438
|
-
o.purchaseOrder && Q.value.value === "deliveryHistory" ? (
|
|
3422
|
+
o.purchaseOrder && Q.value.value === "deliveryHistory" ? (l(), ie(Qo, {
|
|
3439
3423
|
key: 0,
|
|
3440
3424
|
"purchase-order": o.purchaseOrder,
|
|
3441
3425
|
"received-info-map": ee.value,
|
|
3442
3426
|
onSubmitted: u[2] || (u[2] = () => {
|
|
3443
|
-
|
|
3427
|
+
i("update:show", !1), i("submitted");
|
|
3444
3428
|
})
|
|
3445
|
-
}, null, 8, ["purchase-order", "received-info-map"])) :
|
|
3429
|
+
}, null, 8, ["purchase-order", "received-info-map"])) : j("", !0)
|
|
3446
3430
|
])
|
|
3447
3431
|
];
|
|
3448
3432
|
}),
|
|
@@ -3450,14 +3434,14 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3450
3434
|
var re, le, ve, Ae, Le;
|
|
3451
3435
|
return [
|
|
3452
3436
|
e("div", bn, [
|
|
3453
|
-
Q.value.value === "overview" ? (
|
|
3437
|
+
Q.value.value === "overview" ? (l(), v(fe, { key: 0 }, [
|
|
3454
3438
|
e("div", null, [
|
|
3455
3439
|
L(D, {
|
|
3456
3440
|
variant: "outlined",
|
|
3457
3441
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
3458
3442
|
}, {
|
|
3459
3443
|
default: oe(() => {
|
|
3460
|
-
var se, me, ge, Se, $e, Fe, pe, _e,
|
|
3444
|
+
var se, me, ge, Se, $e, Fe, pe, _e, je, Be;
|
|
3461
3445
|
return [
|
|
3462
3446
|
e("div", hn, [
|
|
3463
3447
|
e("div", gn, d(m(h)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
@@ -3467,37 +3451,37 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3467
3451
|
class: Pe(w.value.statusClass),
|
|
3468
3452
|
compact: ""
|
|
3469
3453
|
}, null, 8, ["label", "class"]),
|
|
3470
|
-
R.value ? (
|
|
3454
|
+
R.value ? (l(), v("div", xn, [
|
|
3471
3455
|
L(B, {
|
|
3472
3456
|
name: "local_shipping",
|
|
3473
3457
|
color: "#666666"
|
|
3474
3458
|
}),
|
|
3475
3459
|
e("span", Sn, d(R.value), 1)
|
|
3476
|
-
])) :
|
|
3460
|
+
])) : j("", !0)
|
|
3477
3461
|
])
|
|
3478
3462
|
]),
|
|
3479
3463
|
L(J),
|
|
3480
3464
|
e("div", On, [
|
|
3481
|
-
L(
|
|
3465
|
+
L(Mt, { title: "Debug Info" }, {
|
|
3482
3466
|
default: oe(() => {
|
|
3483
3467
|
var rt, St, Ot, wt, Ct, Dt, $t, kt, Rt, Nt, At, Pt;
|
|
3484
3468
|
return [
|
|
3485
|
-
(rt = o.purchaseOrder) != null && rt._id ? (
|
|
3469
|
+
(rt = o.purchaseOrder) != null && rt._id ? (l(), v("div", wn, [
|
|
3486
3470
|
u[9] || (u[9] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Purchase Order ID ", -1)),
|
|
3487
3471
|
e("span", Cn, d((St = o.purchaseOrder) == null ? void 0 : St._id), 1)
|
|
3488
|
-
])) :
|
|
3489
|
-
(Ot = o.purchaseOrder) != null && Ot.status ? (
|
|
3472
|
+
])) : j("", !0),
|
|
3473
|
+
(Ot = o.purchaseOrder) != null && Ot.status ? (l(), v("div", Dn, [
|
|
3490
3474
|
u[10] || (u[10] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Purchase Order Status ", -1)),
|
|
3491
3475
|
e("span", $n, d((wt = o.purchaseOrder) == null ? void 0 : wt.status), 1)
|
|
3492
|
-
])) :
|
|
3493
|
-
(Dt = (Ct = o.purchaseOrder) == null ? void 0 : Ct.supplier) != null && Dt._id ? (
|
|
3476
|
+
])) : j("", !0),
|
|
3477
|
+
(Dt = (Ct = o.purchaseOrder) == null ? void 0 : Ct.supplier) != null && Dt._id ? (l(), v("div", kn, [
|
|
3494
3478
|
u[11] || (u[11] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Source Location ID ", -1)),
|
|
3495
3479
|
e("span", Rn, d(((kt = ($t = o.purchaseOrder) == null ? void 0 : $t.supplier) == null ? void 0 : kt.internal) != null ? `${(Nt = (Rt = o.purchaseOrder) == null ? void 0 : Rt.supplier) == null ? void 0 : Nt.internal}_` : "") + d((Pt = (At = o.purchaseOrder) == null ? void 0 : At.supplier) == null ? void 0 : Pt._id), 1)
|
|
3496
|
-
])) :
|
|
3497
|
-
o.transferToDbName ? (
|
|
3480
|
+
])) : j("", !0),
|
|
3481
|
+
o.transferToDbName ? (l(), v("div", Nn, [
|
|
3498
3482
|
u[12] || (u[12] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Destination Location ID ", -1)),
|
|
3499
3483
|
e("span", An, d(o.transferToDbName), 1)
|
|
3500
|
-
])) :
|
|
3484
|
+
])) : j("", !0)
|
|
3501
3485
|
];
|
|
3502
3486
|
}),
|
|
3503
3487
|
_: 1
|
|
@@ -3508,36 +3492,36 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3508
3492
|
]),
|
|
3509
3493
|
e("div", In, d(m(tt)(((se = o.purchaseOrder) == null ? void 0 : se._id) ?? "")), 1)
|
|
3510
3494
|
]),
|
|
3511
|
-
(me = o.purchaseOrder) != null && me.effectiveAt ? (
|
|
3495
|
+
(me = o.purchaseOrder) != null && me.effectiveAt ? (l(), v("div", qn, [
|
|
3512
3496
|
e("div", En, d(m(h)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
3513
|
-
e("div", Vn, d(m(
|
|
3514
|
-
])) :
|
|
3497
|
+
e("div", Vn, d(m(gt)(new Date((ge = o.purchaseOrder) == null ? void 0 : ge.effectiveAt))), 1)
|
|
3498
|
+
])) : j("", !0),
|
|
3515
3499
|
e("div", Ln, [
|
|
3516
|
-
e("div",
|
|
3517
|
-
e("div",
|
|
3518
|
-
`inventory.transfer.receiveRequest.details.type.${
|
|
3500
|
+
e("div", jn, d(m(h)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
3501
|
+
e("div", Mn, d(m(h)(
|
|
3502
|
+
`inventory.transfer.receiveRequest.details.type.${M.value.toLocaleLowerCase("en-US")}`
|
|
3519
3503
|
)), 1)
|
|
3520
3504
|
]),
|
|
3521
|
-
($e = (Se = o.purchaseOrder) == null ? void 0 : Se.supplier) != null && $e.name ? (
|
|
3505
|
+
($e = (Se = o.purchaseOrder) == null ? void 0 : Se.supplier) != null && $e.name ? (l(), v("div", Un, [
|
|
3522
3506
|
e("div", Bn, d(m(h)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
3523
3507
|
e("div", zn, d((pe = (Fe = o.purchaseOrder) == null ? void 0 : Fe.supplier) == null ? void 0 : pe.name), 1)
|
|
3524
|
-
])) :
|
|
3525
|
-
o.transferTo ? (
|
|
3508
|
+
])) : j("", !0),
|
|
3509
|
+
o.transferTo ? (l(), v("div", Kn, [
|
|
3526
3510
|
e("div", Hn, d(m(h)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
3527
|
-
e("div",
|
|
3528
|
-
])) :
|
|
3529
|
-
(_e = o.purchaseOrder) != null && _e.ref ? (
|
|
3511
|
+
e("div", Gn, d(o.transferTo), 1)
|
|
3512
|
+
])) : j("", !0),
|
|
3513
|
+
(_e = o.purchaseOrder) != null && _e.ref ? (l(), v("div", Wn, [
|
|
3530
3514
|
e("div", Yn, d(m(h)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
3531
3515
|
e("div", Qn, d(o.purchaseOrder.ref), 1)
|
|
3532
|
-
])) :
|
|
3533
|
-
(
|
|
3516
|
+
])) : j("", !0),
|
|
3517
|
+
(je = o.purchaseOrder) != null && je.remark ? (l(), v("div", Jn, [
|
|
3534
3518
|
e("div", Xn, d(m(h)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
3535
3519
|
e("div", Zn, d(o.purchaseOrder.remark), 1)
|
|
3536
|
-
])) :
|
|
3537
|
-
((Be = o.purchaseOrder) == null ? void 0 : Be.status) === m(ae).enum.DRAFT && Ge.value ? (
|
|
3520
|
+
])) : j("", !0),
|
|
3521
|
+
((Be = o.purchaseOrder) == null ? void 0 : Be.status) === m(ae).enum.DRAFT && Ge.value ? (l(), v("div", ea, [
|
|
3538
3522
|
e("div", ta, d(m(h)("inventory.transfer.receiveRequest.details.rejectionReason")), 1),
|
|
3539
3523
|
e("div", ra, d(Ge.value !== "" ? Ge.value : "-"), 1)
|
|
3540
|
-
])) :
|
|
3524
|
+
])) : j("", !0)
|
|
3541
3525
|
])
|
|
3542
3526
|
];
|
|
3543
3527
|
}),
|
|
@@ -3547,7 +3531,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3547
3531
|
L(so, {
|
|
3548
3532
|
"po-request": o.poRequest,
|
|
3549
3533
|
purchaseOrder: o.purchaseOrder,
|
|
3550
|
-
transferType:
|
|
3534
|
+
transferType: M.value,
|
|
3551
3535
|
transferToDbName: o.transferToDbName,
|
|
3552
3536
|
scope: o.scope
|
|
3553
3537
|
}, null, 8, ["po-request", "purchaseOrder", "transferType", "transferToDbName", "scope"]),
|
|
@@ -3555,8 +3539,8 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3555
3539
|
e("div", oa, [
|
|
3556
3540
|
e("div", na, [
|
|
3557
3541
|
e("span", aa, [
|
|
3558
|
-
Ee(d(
|
|
3559
|
-
(le = (re = o.purchaseOrder) == null ? void 0 : re.netSuite) != null && le.missingItems && ((Ae = (ve = o.purchaseOrder) == null ? void 0 : ve.netSuite) == null ? void 0 : Ae.missingItems.length) > 0 ? (
|
|
3542
|
+
Ee(d(F.value ? m(h)("inventory.transfer.receiveRequest.details.receivedItems") : m(h)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
|
|
3543
|
+
(le = (re = o.purchaseOrder) == null ? void 0 : re.netSuite) != null && le.missingItems && ((Ae = (ve = o.purchaseOrder) == null ? void 0 : ve.netSuite) == null ? void 0 : Ae.missingItems.length) > 0 ? (l(), ie(te, {
|
|
3560
3544
|
key: 0,
|
|
3561
3545
|
variant: "rich",
|
|
3562
3546
|
placement: "top",
|
|
@@ -3566,7 +3550,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3566
3550
|
var se, me;
|
|
3567
3551
|
return [
|
|
3568
3552
|
e("div", la, [
|
|
3569
|
-
(
|
|
3553
|
+
(l(!0), v(fe, null, ke((me = (se = o.purchaseOrder) == null ? void 0 : se.netSuite) == null ? void 0 : me.missingItems, (ge, Se) => (l(), v("div", {
|
|
3570
3554
|
class: "flex justify-center align-middle",
|
|
3571
3555
|
key: Se
|
|
3572
3556
|
}, [
|
|
@@ -3587,20 +3571,20 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3587
3571
|
})
|
|
3588
3572
|
]),
|
|
3589
3573
|
_: 1
|
|
3590
|
-
})) :
|
|
3574
|
+
})) : j("", !0)
|
|
3591
3575
|
])
|
|
3592
3576
|
]),
|
|
3593
3577
|
L(J),
|
|
3594
|
-
(
|
|
3578
|
+
(l(!0), v(fe, null, ke(((Le = o.purchaseOrder) == null ? void 0 : Le.items) ?? [], (se, me) => {
|
|
3595
3579
|
var ge;
|
|
3596
|
-
return
|
|
3580
|
+
return l(), v("div", {
|
|
3597
3581
|
key: me,
|
|
3598
3582
|
class: "flex flex-col"
|
|
3599
3583
|
}, [
|
|
3600
3584
|
e("div", ia, [
|
|
3601
3585
|
e("div", ca, [
|
|
3602
3586
|
Ee(d(se.name) + " ", 1),
|
|
3603
|
-
Re(se) ? (
|
|
3587
|
+
Re(se) ? (l(), ie(te, {
|
|
3604
3588
|
key: 0,
|
|
3605
3589
|
variant: "rich",
|
|
3606
3590
|
placement: "top",
|
|
@@ -3624,7 +3608,7 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3624
3608
|
})
|
|
3625
3609
|
]),
|
|
3626
3610
|
_: 2
|
|
3627
|
-
}, 1024)) :
|
|
3611
|
+
}, 1024)) : j("", !0)
|
|
3628
3612
|
]),
|
|
3629
3613
|
e("div", da, [
|
|
3630
3614
|
e("span", {
|
|
@@ -3634,37 +3618,37 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3634
3618
|
]),
|
|
3635
3619
|
e("div", pa, [
|
|
3636
3620
|
e("div", fa, d(se.code), 1),
|
|
3637
|
-
m(
|
|
3638
|
-
e("span", va, d(m(
|
|
3621
|
+
m(p).enableTotalCost ? (l(), v("div", ya, [
|
|
3622
|
+
e("span", va, d(m(Qe)(
|
|
3639
3623
|
(ge = se.totalCost) != null && ge.amount ? se.totalCost : m(y).controller.value.getItemCost(se, m(De)()).cost
|
|
3640
3624
|
)), 1),
|
|
3641
|
-
x(se) ?
|
|
3625
|
+
x(se) ? j("", !0) : (l(), v("span", ba, [
|
|
3642
3626
|
u[14] || (u[14] = e("span", { class: "w-1.5 h-1.5 rounded-full bg-gray-400" }, null, -1)),
|
|
3643
3627
|
Ee(" " + d(m(h)("inventory.transfer.form.items.autoCalculated")), 1)
|
|
3644
3628
|
]))
|
|
3645
|
-
])) :
|
|
3629
|
+
])) : j("", !0)
|
|
3646
3630
|
])
|
|
3647
3631
|
]);
|
|
3648
3632
|
}), 128)),
|
|
3649
|
-
+m(be)(m(y).controller.value.getTotalCosts()) ? (
|
|
3633
|
+
+m(be)(m(y).controller.value.getTotalCosts()) ? (l(), v(fe, { key: 0 }, [
|
|
3650
3634
|
e("div", ha, [
|
|
3651
3635
|
L(J)
|
|
3652
3636
|
]),
|
|
3653
3637
|
e("div", ga, [
|
|
3654
3638
|
u[15] || (u[15] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
|
|
3655
|
-
e("div", _a, d(m(De)()) + " " + d(m(
|
|
3639
|
+
e("div", _a, d(m(De)()) + " " + d(m(Qe)({
|
|
3656
3640
|
...m(y).controller.value.getTotalCosts(),
|
|
3657
3641
|
currency: m(De)()
|
|
3658
3642
|
}).replace(/[^0-9.,]/g, "")), 1)
|
|
3659
3643
|
])
|
|
3660
|
-
], 64)) :
|
|
3644
|
+
], 64)) : j("", !0)
|
|
3661
3645
|
])
|
|
3662
3646
|
])
|
|
3663
|
-
], 64)) : Q.value.value === "deliveryHistory" ? (
|
|
3664
|
-
g.value.length ? (
|
|
3665
|
-
(
|
|
3647
|
+
], 64)) : Q.value.value === "deliveryHistory" ? (l(), v("div", xa, [
|
|
3648
|
+
g.value.length ? (l(), v("div", Da, [
|
|
3649
|
+
(l(!0), v(fe, null, ke(g.value, (se, me) => {
|
|
3666
3650
|
var ge, Se, $e, Fe, pe;
|
|
3667
|
-
return
|
|
3651
|
+
return l(), v(fe, { key: me }, [
|
|
3668
3652
|
e("div", $a, [
|
|
3669
3653
|
e("div", ka, [
|
|
3670
3654
|
e("div", Ra, [
|
|
@@ -3679,12 +3663,12 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3679
3663
|
}, null, 2)
|
|
3680
3664
|
]),
|
|
3681
3665
|
e("div", Na, [
|
|
3682
|
-
se.header === "Received" ? (
|
|
3666
|
+
se.header === "Received" ? (l(), ie(B, {
|
|
3683
3667
|
key: 0,
|
|
3684
3668
|
name: "local_shipping",
|
|
3685
3669
|
outline: "",
|
|
3686
3670
|
color: "#ffffff"
|
|
3687
|
-
})) :
|
|
3671
|
+
})) : j("", !0)
|
|
3688
3672
|
]),
|
|
3689
3673
|
e("div", Aa, [
|
|
3690
3674
|
e("div", {
|
|
@@ -3704,34 +3688,34 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3704
3688
|
e("div", Ia, d(se.date), 1)
|
|
3705
3689
|
]),
|
|
3706
3690
|
e("div", qa, [
|
|
3707
|
-
se.header === "Received" && se.deliveryOrder && o.purchaseOrder ? (
|
|
3691
|
+
se.header === "Received" && se.deliveryOrder && o.purchaseOrder ? (l(), ie(Co, {
|
|
3708
3692
|
key: 0,
|
|
3709
3693
|
deliveryOrder: se.deliveryOrder,
|
|
3710
3694
|
purchaseOrder: o.purchaseOrder,
|
|
3711
3695
|
onSubmitted: u[3] || (u[3] = () => {
|
|
3712
|
-
|
|
3696
|
+
i("update:show", !1), i("submitted");
|
|
3713
3697
|
})
|
|
3714
|
-
}, null, 8, ["deliveryOrder", "purchaseOrder"])) :
|
|
3715
|
-
(Se = (ge = se.deliveryOrder) == null ? void 0 : ge.netSuite) != null && Se.id ? (
|
|
3698
|
+
}, null, 8, ["deliveryOrder", "purchaseOrder"])) : j("", !0),
|
|
3699
|
+
(Se = (ge = se.deliveryOrder) == null ? void 0 : ge.netSuite) != null && Se.id ? (l(), ie(Mt, {
|
|
3716
3700
|
key: 1,
|
|
3717
3701
|
title: "Admin",
|
|
3718
3702
|
class: "min-w-[140px]"
|
|
3719
3703
|
}, {
|
|
3720
3704
|
default: oe(() => {
|
|
3721
|
-
var _e,
|
|
3705
|
+
var _e, je;
|
|
3722
3706
|
return [
|
|
3723
3707
|
L(pn, {
|
|
3724
|
-
"netsuite-id": (
|
|
3708
|
+
"netsuite-id": (je = (_e = se.deliveryOrder) == null ? void 0 : _e.netSuite) == null ? void 0 : je.id
|
|
3725
3709
|
}, null, 8, ["netsuite-id"])
|
|
3726
3710
|
];
|
|
3727
3711
|
}),
|
|
3728
3712
|
_: 2
|
|
3729
|
-
}, 1024)) :
|
|
3730
|
-
o.purchaseOrder && (($e = se.deliveryOrder) != null && $e.id) ? (
|
|
3713
|
+
}, 1024)) : j("", !0),
|
|
3714
|
+
o.purchaseOrder && (($e = se.deliveryOrder) != null && $e.id) ? (l(), ie(Fr, {
|
|
3731
3715
|
key: 2,
|
|
3732
3716
|
"purchase-order-id": (Fe = o.purchaseOrder) == null ? void 0 : Fe._id,
|
|
3733
3717
|
"delivery-order-id": (pe = se.deliveryOrder) == null ? void 0 : pe.id
|
|
3734
|
-
}, null, 8, ["purchase-order-id", "delivery-order-id"])) :
|
|
3718
|
+
}, null, 8, ["purchase-order-id", "delivery-order-id"])) : j("", !0)
|
|
3735
3719
|
])
|
|
3736
3720
|
])
|
|
3737
3721
|
]),
|
|
@@ -3749,26 +3733,26 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3749
3733
|
}, null, 2)
|
|
3750
3734
|
])
|
|
3751
3735
|
]),
|
|
3752
|
-
e("div",
|
|
3736
|
+
e("div", ja, [
|
|
3753
3737
|
L(D, {
|
|
3754
3738
|
variant: "outlined",
|
|
3755
3739
|
class: "py-12 px-16"
|
|
3756
3740
|
}, {
|
|
3757
3741
|
default: oe(() => [
|
|
3758
|
-
e("div",
|
|
3759
|
-
(
|
|
3760
|
-
key:
|
|
3742
|
+
e("div", Ma, [
|
|
3743
|
+
(l(!0), v(fe, null, ke(se.info, (_e, je) => (l(), v("div", {
|
|
3744
|
+
key: je,
|
|
3761
3745
|
class: "flex flex-col gap-4"
|
|
3762
3746
|
}, [
|
|
3763
|
-
e("div",
|
|
3747
|
+
e("div", Ua, d(_e == null ? void 0 : _e.label), 1),
|
|
3764
3748
|
e("div", Ba, [
|
|
3765
|
-
(
|
|
3749
|
+
(l(!0), v(fe, null, ke(_e == null ? void 0 : _e.values, (Be, rt) => (l(), v("div", {
|
|
3766
3750
|
key: rt,
|
|
3767
3751
|
class: "fm-typo-en-body-lg-600"
|
|
3768
3752
|
}, [
|
|
3769
|
-
typeof Be == "string" ? (
|
|
3753
|
+
typeof Be == "string" ? (l(), v(fe, { key: 0 }, [
|
|
3770
3754
|
Ee(d(Be), 1)
|
|
3771
|
-
], 64)) : (
|
|
3755
|
+
], 64)) : (l(), ie(dr(Be), { key: 1 }))
|
|
3772
3756
|
]))), 128))
|
|
3773
3757
|
])
|
|
3774
3758
|
]))), 128))
|
|
@@ -3780,11 +3764,11 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3780
3764
|
])
|
|
3781
3765
|
], 64);
|
|
3782
3766
|
}), 128))
|
|
3783
|
-
])) : (
|
|
3767
|
+
])) : (l(), v("div", Sa, [
|
|
3784
3768
|
L(ne),
|
|
3785
3769
|
e("div", null, [
|
|
3786
3770
|
e("img", {
|
|
3787
|
-
src: m(
|
|
3771
|
+
src: m(Nr),
|
|
3788
3772
|
alt: "List is empty"
|
|
3789
3773
|
}, null, 8, Oa)
|
|
3790
3774
|
]),
|
|
@@ -3793,47 +3777,47 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3793
3777
|
L(ne),
|
|
3794
3778
|
L(ne)
|
|
3795
3779
|
]))
|
|
3796
|
-
])) :
|
|
3780
|
+
])) : j("", !0)
|
|
3797
3781
|
])
|
|
3798
3782
|
];
|
|
3799
3783
|
}),
|
|
3800
3784
|
"side-sheet-footer": oe(() => [
|
|
3801
3785
|
e("div", za, [
|
|
3802
|
-
(
|
|
3803
|
-
m(
|
|
3786
|
+
(l(!0), v(fe, null, ke(S.value, (re) => (l(), v(fe, null, [
|
|
3787
|
+
m(ft)[re].available != !1 ? (l(), ie(I, {
|
|
3804
3788
|
key: re,
|
|
3805
|
-
label: m(h)(m(
|
|
3806
|
-
onClick: (le) =>
|
|
3789
|
+
label: m(h)(m(ft)[re].translationKey),
|
|
3790
|
+
onClick: (le) => E(re),
|
|
3807
3791
|
loading: O.value === re,
|
|
3808
|
-
disabled: O.value !== re &&
|
|
3809
|
-
variant: m(
|
|
3810
|
-
}, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) :
|
|
3792
|
+
disabled: O.value !== re && U.value,
|
|
3793
|
+
variant: m(ft)[re].buttonVariant
|
|
3794
|
+
}, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : j("", !0)
|
|
3811
3795
|
], 64))), 256)),
|
|
3812
|
-
m(C).ableToMarkReceived(o.purchaseOrder) && !S.value.includes("completeReceive") ? (
|
|
3796
|
+
m(C).ableToMarkReceived(o.purchaseOrder) && !S.value.includes("completeReceive") ? (l(), ie(I, {
|
|
3813
3797
|
key: 0,
|
|
3814
3798
|
label: m(h)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
3815
|
-
onClick: u[4] || (u[4] = (re) =>
|
|
3799
|
+
onClick: u[4] || (u[4] = (re) => E("completeReceive")),
|
|
3816
3800
|
loading: O.value === "completeReceive",
|
|
3817
|
-
disabled: O.value !== "completeReceive" &&
|
|
3818
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
3819
|
-
m(C).ableToMarkApproved(o.purchaseOrder) && o.canApprove && !S.value.includes("approveRequest") ? (
|
|
3801
|
+
disabled: O.value !== "completeReceive" && U.value
|
|
3802
|
+
}, null, 8, ["label", "loading", "disabled"])) : j("", !0),
|
|
3803
|
+
m(C).ableToMarkApproved(o.purchaseOrder) && o.canApprove && !S.value.includes("approveRequest") ? (l(), ie(I, {
|
|
3820
3804
|
key: 1,
|
|
3821
3805
|
label: m(h)("inventory.transfer.approval.actions.approveRequest"),
|
|
3822
|
-
onClick: u[5] || (u[5] = (re) =>
|
|
3806
|
+
onClick: u[5] || (u[5] = (re) => E("approveRequest")),
|
|
3823
3807
|
loading: O.value === "approveRequest",
|
|
3824
|
-
disabled: O.value !== "approveRequest" &&
|
|
3825
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
3826
|
-
m(C).ableToCreateFulfillment(o.purchaseOrder, o.poRequest) && s.scope === "approval" ? (
|
|
3808
|
+
disabled: O.value !== "approveRequest" && U.value
|
|
3809
|
+
}, null, 8, ["label", "loading", "disabled"])) : j("", !0),
|
|
3810
|
+
m(C).ableToCreateFulfillment(o.purchaseOrder, o.poRequest) && s.scope === "approval" ? (l(), ie(I, {
|
|
3827
3811
|
key: 2,
|
|
3828
3812
|
label: m(h)("inventory.transfer.receiveRequest.actions.processRequest"),
|
|
3829
|
-
onClick: u[6] || (u[6] = (re) =>
|
|
3813
|
+
onClick: u[6] || (u[6] = (re) => E("processRequest")),
|
|
3830
3814
|
loading: O.value === "processRequest",
|
|
3831
|
-
disabled: O.value !== "processRequest" &&
|
|
3832
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
3833
|
-
L(
|
|
3815
|
+
disabled: O.value !== "processRequest" && U.value
|
|
3816
|
+
}, null, 8, ["label", "loading", "disabled"])) : j("", !0),
|
|
3817
|
+
L(I, {
|
|
3834
3818
|
label: m(h)("common.close"),
|
|
3835
3819
|
variant: "tertiary",
|
|
3836
|
-
onClick: u[7] || (u[7] = (re) =>
|
|
3820
|
+
onClick: u[7] || (u[7] = (re) => i("update:show", !1))
|
|
3837
3821
|
}, null, 8, ["label"])
|
|
3838
3822
|
])
|
|
3839
3823
|
]),
|
|
@@ -3843,11 +3827,11 @@ const os = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3843
3827
|
}
|
|
3844
3828
|
});
|
|
3845
3829
|
export {
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3830
|
+
bt as P,
|
|
3831
|
+
Ol as _,
|
|
3832
|
+
xl as a,
|
|
3833
|
+
Sl as b,
|
|
3834
|
+
_l as c,
|
|
3851
3835
|
Ht as g,
|
|
3852
3836
|
Qt as u
|
|
3853
3837
|
};
|