@feedmepos/mf-inventory-portal 1.2.40 → 1.2.41-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-CFp4VWkn.js → App-DjVeGAF9.js} +3 -3
- package/dist/{ApprovalView-BR-qwJZU.js → ApprovalView-NN1B2IOQ.js} +5 -5
- package/dist/{BindingsDialog-DCEb7sT8.js → BindingsDialog-BUYZ8tw1.js} +8 -8
- package/dist/{BindingsPicker-CKQ5qIsY.js → BindingsPicker-D6CV8wn1.js} +2 -2
- package/dist/{BindingsTable-DkRi1hCC.js → BindingsTable-FWfJIE7U.js} +3 -3
- package/dist/{ClosingDraftView-C_LQUzJ8.js → ClosingDraftView-ERFxw2au.js} +8 -8
- package/dist/{ClosingHistoryView-BbH6v1rk.js → ClosingHistoryView-B_VBYXQ0.js} +22 -22
- package/dist/{ClosingTemplateView-CM72EBRP.js → ClosingTemplateView-B-Zb6Ir6.js} +14 -14
- package/dist/{DeliveryOrderPrintPreview-5-7-1XU5.js → DeliveryOrderPrintPreview-DZOdyNMy.js} +9 -9
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DU2xeJtz.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CUO5in5A.js} +60 -61
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-qkS1g4m3.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CURtV-K5.js} +2 -2
- package/dist/{FmMultiselectDialog-C3b-iSE2.js → FmMultiselectDialog-B_pY8XP5.js} +1 -1
- package/dist/{FmMultiselectDialog-DJUiGIHJ.js → FmMultiselectDialog-I1n2kVON.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-dnE7g0iB.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Af3ob_cD.js} +3 -3
- package/dist/{ImportView-C-OH0lW1.js → ImportView-NgLl8SAd.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DZaO7ghp.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DJ6M4bMf.js} +1 -1
- package/dist/{IngredientGroupView-Bz2dANo0.js → IngredientGroupView-QPjSPbPk.js} +5 -5
- package/dist/{IngredientsView-CwVCJ2hv.js → IngredientsView-RP45JT6F.js} +14 -14
- package/dist/{IntegrationView-BKfzgu3o.js → IntegrationView-CQLKUdeV.js} +448 -446
- package/dist/{InventoryBindingForm-CNZ1tuxg.js → InventoryBindingForm-DbPjVHvx.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CeQbJ5M-.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-D_Z3uBZS.js} +14 -14
- package/dist/{InventoryBindingSummary-iJD9V9f7.js → InventoryBindingSummary-BMfOHhBW.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-4u88I-eh.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Bf_H-he3.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-tZ7-qsUc.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DeiPsNQS.js} +2 -2
- package/dist/{PublishView-DhIomByw.js → PublishView-6pKWty2v.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-1Jm8hmYB.js → PurchaseOrderPrintPreview-Bexn0z-1.js} +9 -9
- package/dist/ReceiveRequestView-qkJJ3VFK.js +2877 -0
- package/dist/{RecipeView-DVrcKtAa.js → RecipeView-C-rzKweI.js} +8 -8
- package/dist/{StockView-BmwDyRwP.js → StockView-DBu_ssH_.js} +15 -15
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-crC3-G5l.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-YLdgHpck.js} +1 -1
- package/dist/{SupplierView-CwTK_sYl.js → SupplierView-BtQGtwqx.js} +11 -11
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-C8Yle9k2.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-BFzQ9YOw.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CfZKi0So.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BfH5N4qH.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-jw2-Xg5Q.js → TransferDetails.vue_vue_type_script_setup_true_lang-BlcdYJ8b.js} +1018 -1022
- package/dist/{TransferTemplateView-BCT6mq6u.js → TransferTemplateView-DkwjjiW8.js} +354 -354
- package/dist/{UnitView-Cuh2LX3K.js → UnitView-C7DbjS8v.js} +6 -6
- package/dist/{WarehouseView-DZ06EmIm.js → WarehouseView-ztwU7TTt.js} +5 -5
- package/dist/{WastageTemplateView-CUAgAB-K.js → WastageTemplateView-DWi9lDs7.js} +14 -14
- package/dist/{app-DsvKAAar.js → app-DI81LaYD.js} +345 -332
- package/dist/app.js +1 -1
- package/dist/{closing-template-B4q3uNXW.js → closing-template-CiJZAF2p.js} +1 -1
- package/dist/{date2-DPON4K9X.js → date2-BYKFHbis.js} +1 -1
- package/dist/{dayjs.min-BUcpGcn-.js → dayjs.min-DWzYoqEQ.js} +12 -12
- package/dist/{decimal-O0r48Ccj.js → decimal-H1GrMoC9.js} +2 -2
- package/dist/{defineDeepModel-DKSKw3d8.js → defineDeepModel-WqBfh9j4.js} +1 -1
- package/dist/{duplicate-template-AZR81F4P.js → duplicate-template-uuCvon-m.js} +1 -1
- package/dist/feature-BRonrkVa.js +25312 -0
- package/dist/{format-time-from-id-C0ju5W3p.js → format-time-from-id-BRS6Wf0e.js} +1 -1
- package/dist/{format-unit-display-CIh10egg.js → format-unit-display-CQhnHa-X.js} +245 -246
- package/dist/helper/reactivity.d.ts +11 -0
- package/dist/helper/reactivity.spec.d.ts +1 -0
- package/dist/{import-export.helper-Dz7WeOmz.js → import-export.helper-DQ5ia8oQ.js} +5 -5
- package/dist/{index-6H1yTL5Z.js → index-CeVJchTm.js} +9 -9
- package/dist/{index-BYYuUmlN.js → index-CxB-ZEdh.js} +3 -3
- package/dist/{index-BiYceIQq.js → index-DKcXhLj3.js} +1 -1
- package/dist/{lodash-CcF-iQsS.js → lodash-DLcim3g_.js} +1 -1
- package/dist/{netsuite-BSgSRRLZ.js → netsuite-Vwqgf-Yk.js} +1753 -1667
- package/dist/{purchase-order-template-gLB1CO-a.js → purchase-order-template-CzmTSuyW.js} +1 -1
- package/dist/{rules-BRx1HG7R.js → rules-_Qrn8iAv.js} +3 -3
- package/dist/{stock-BJjMCR2I.js → stock-BUvbn_27.js} +1 -1
- package/dist/{stock-qe8Qoouq.js → stock-Du9y9LZH.js} +3 -3
- package/dist/{supplier-BLMn0x03.js → supplier-BRrJ--tq.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-Djd_7uji.js → use-ingredient-select-dialog-DVVbnh_L.js} +2 -2
- package/dist/{use-inventory-binding-dialog-DvMtdhSZ.js → use-inventory-binding-dialog-CatakG_z.js} +2 -2
- package/dist/{use-template-enabled-locations-2-C0JE_mEH.js → use-template-enabled-locations-2-Cxk8b75m.js} +2 -2
- package/dist/views/integration/components/netsuite/business/NetSuiteLocationField.vue.d.ts +6 -0
- package/dist/views/receive-request/components/netsuite/NetSuitePanel.vue.d.ts +3 -2
- package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +3 -2
- package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +2 -0
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +518 -2225
- package/dist/views/receive-request/components/transfer-form/TransferForm2.vue.d.ts +1430 -0
- package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +1 -0
- package/dist/views/receive-request/components/transfer-form/composables/use-purchase-order-form-controller.d.ts +13974 -0
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +3 -2
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +1 -1
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +6 -6
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +7 -7
- package/dist/views/receive-request/helper/get-transfer-type.d.ts +1 -2
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +3 -2
- package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItemProps.d.ts +3 -2
- package/dist/views/transfer-template/helpers/import-export.helper.d.ts +4 -3
- package/dist/{vue-i18n-gFHTGAs6.js → vue-i18n-Dl1sRfbB.js} +524 -524
- package/dist/{xlsx-QHyL0Tej.js → xlsx-D_k1aCyC.js} +398 -398
- package/dist/{xlsx.util-d5-VGpcM.js → xlsx.util-CPXsPFyJ.js} +1 -1
- package/package.json +3 -3
- package/dist/ReceiveRequestView-CD-w_Cph.js +0 -2821
- package/dist/feature-Chb7LGRV.js +0 -20162
- package/dist/views/receive-request/constants/purchase-order-transaction-type.d.ts +0 -4
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { p as wt, f as
|
|
2
|
-
import { ref as J, computed as Y, h as
|
|
1
|
+
import { p as wt, f as He } from "./format-time-from-id-BRS6Wf0e.js";
|
|
2
|
+
import { ref as J, computed as Y, h as E, defineComponent as we, reactive as $t, onMounted as ft, resolveComponent as K, openBlock as i, createBlock as re, withCtx as X, createElementVNode as e, createVNode as N, unref as v, createElementBlock as g, toDisplayString as y, createCommentVNode as M, Fragment as ue, renderList as Se, createTextVNode as Re, normalizeClass as Le, watch as Ct, isRef as Rt, resolveDynamicComponent as kt } from "vue";
|
|
3
3
|
import { c as dt } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
4
|
-
import { R as
|
|
5
|
-
import { o as Dt, u as
|
|
6
|
-
import { l as ht, d as bt, a as
|
|
7
|
-
import { F as At } from "./decimal-
|
|
8
|
-
import { t as
|
|
9
|
-
import { u as
|
|
10
|
-
import { useCoreStore as
|
|
11
|
-
import { u as
|
|
12
|
-
import { useDialog as
|
|
4
|
+
import { R as pe, D as _e } from "./row-action.enum-BcW_L_nE.js";
|
|
5
|
+
import { o as Dt, u as ke, Q as V, T as Xe, L as ee, D as Nt, c as yt, v as lt, U as vt, t as Ke, I as $e, A as We, s as Ie, B as Te } from "./app-DI81LaYD.js";
|
|
6
|
+
import { l as ht, d as bt, a as he, t as Qe, e as ze } from "./rules-_Qrn8iAv.js";
|
|
7
|
+
import { F as At } from "./decimal-H1GrMoC9.js";
|
|
8
|
+
import { t as Ft, c as Tt, h as gt, a as Ge } from "./date2-BYKFHbis.js";
|
|
9
|
+
import { u as Me, F as It, a as tt } from "./feature-BRonrkVa.js";
|
|
10
|
+
import { useCoreStore as it, useI18n as ct } from "@feedmepos/mf-common";
|
|
11
|
+
import { u as Ze, a as ut, S as Oe } from "./netsuite-Vwqgf-Yk.js";
|
|
12
|
+
import { useDialog as et, useSnackbar as Ue, components as Ye, FmButtonVariant as be, useProxiedModel as Pt } from "@feedmepos/ui-library";
|
|
13
13
|
import { F as Pe } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { u as Be, _ as
|
|
17
|
-
import { _ as
|
|
14
|
+
import { E as qt } from "./empty-placeholder-wf6-BWE8.js";
|
|
15
|
+
import { u as Vt, a as Et, f as Lt } from "./format-unit-display-CQhnHa-X.js";
|
|
16
|
+
import { u as Be, _ as Mt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-BFzQ9YOw.js";
|
|
17
|
+
import { _ as Ut, a as Bt, b as jt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-Af3ob_cD.js";
|
|
18
18
|
import { u as zt, R as mt } from "./usePromise-CbVUCxhj.js";
|
|
19
|
-
import { c as Kt } from "./index-
|
|
20
|
-
import { i as
|
|
19
|
+
import { c as Kt } from "./index-CeVJchTm.js";
|
|
20
|
+
import { i as Gt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CURtV-K5.js";
|
|
21
21
|
import { F as pt } from "./form-mode.enum-BKiNVH6A.js";
|
|
22
|
-
import { d as _t } from "./defineDeepModel-
|
|
23
|
-
import { u as
|
|
24
|
-
const Wt = Dt((k,
|
|
25
|
-
const
|
|
22
|
+
import { d as _t } from "./defineDeepModel-WqBfh9j4.js";
|
|
23
|
+
import { u as Ht } from "./vue-i18n-Dl1sRfbB.js";
|
|
24
|
+
const Wt = Dt((k, a) => {
|
|
25
|
+
const o = ke();
|
|
26
26
|
return {
|
|
27
27
|
async getShipments({
|
|
28
28
|
start: f,
|
|
29
|
-
end:
|
|
29
|
+
end: h
|
|
30
30
|
}) {
|
|
31
|
-
const n =
|
|
32
|
-
return await
|
|
31
|
+
const n = o.currentLocationDBName, _ = `${k.inventoryBackendUrl}/${n}/shipments`;
|
|
32
|
+
return await a.get(`${_}?start=${f}&end=${h}`);
|
|
33
33
|
},
|
|
34
34
|
async getShipmentsByIds(f) {
|
|
35
35
|
if (f.length === 0)
|
|
36
36
|
return [];
|
|
37
|
-
const
|
|
38
|
-
return await
|
|
37
|
+
const h = o.currentLocationDBName, n = `${k.inventoryBackendUrl}/${h}/shipments/get`;
|
|
38
|
+
return await a.post(n, { shipmentIds: f });
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}), St = {
|
|
42
|
-
[
|
|
42
|
+
[V.enum.confirmDraft]: {
|
|
43
43
|
primaryActions: {
|
|
44
44
|
text: "Confirm draft",
|
|
45
45
|
close: !0
|
|
@@ -48,7 +48,7 @@ const Wt = Dt((k, o) => {
|
|
|
48
48
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
49
49
|
successMessage: "Purchase order draft has been confirmed"
|
|
50
50
|
},
|
|
51
|
-
[
|
|
51
|
+
[V.enum.cancelDraft]: {
|
|
52
52
|
primaryActions: {
|
|
53
53
|
text: "Cancel draft",
|
|
54
54
|
close: !0,
|
|
@@ -58,7 +58,7 @@ const Wt = Dt((k, o) => {
|
|
|
58
58
|
message: "Purchase order cannot be changed after cancelled draft.",
|
|
59
59
|
successMessage: "Purchase order draft has been cancelled"
|
|
60
60
|
},
|
|
61
|
-
[
|
|
61
|
+
[V.enum.submitRequest]: {
|
|
62
62
|
primaryActions: {
|
|
63
63
|
text: "Submit request",
|
|
64
64
|
close: !0
|
|
@@ -67,7 +67,7 @@ const Wt = Dt((k, o) => {
|
|
|
67
67
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
68
68
|
successMessage: "Purchase order draft has been submitted"
|
|
69
69
|
},
|
|
70
|
-
[
|
|
70
|
+
[V.enum.completeReceive]: {
|
|
71
71
|
primaryActions: {
|
|
72
72
|
text: "Mark received",
|
|
73
73
|
close: !0
|
|
@@ -76,7 +76,7 @@ const Wt = Dt((k, o) => {
|
|
|
76
76
|
message: "Purchase order cannot be changed after it has complete receiving.",
|
|
77
77
|
successMessage: "Purchase order has been marked as received"
|
|
78
78
|
},
|
|
79
|
-
[
|
|
79
|
+
[V.enum.approveRequest]: {
|
|
80
80
|
primaryActions: {
|
|
81
81
|
text: "Accept request",
|
|
82
82
|
close: !0
|
|
@@ -85,7 +85,7 @@ const Wt = Dt((k, o) => {
|
|
|
85
85
|
message: "Transfer out request will be accepted.",
|
|
86
86
|
successMessage: "Transfer out request has been approved"
|
|
87
87
|
},
|
|
88
|
-
[
|
|
88
|
+
[V.enum.rejectRequest]: {
|
|
89
89
|
primaryActions: {
|
|
90
90
|
text: "Reject request",
|
|
91
91
|
close: !0,
|
|
@@ -95,7 +95,7 @@ const Wt = Dt((k, o) => {
|
|
|
95
95
|
message: "Purchase order will be rejected.",
|
|
96
96
|
successMessage: "Purchase order has been rejected"
|
|
97
97
|
},
|
|
98
|
-
[
|
|
98
|
+
[V.enum.processRequest]: {
|
|
99
99
|
primaryActions: {
|
|
100
100
|
text: "Process request",
|
|
101
101
|
close: !0,
|
|
@@ -116,63 +116,63 @@ function Qt(k) {
|
|
|
116
116
|
dto: k
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function ot(k) {
|
|
120
120
|
return Xe.validatePOReceivedStatus({
|
|
121
121
|
receivedMap: k
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function nt(k, a, o) {
|
|
125
125
|
if (!ee.safeParse(k).success)
|
|
126
126
|
throw new Error(`Invalid purchase order status: ${k}`);
|
|
127
127
|
const f = ee.parse(k);
|
|
128
128
|
return Xe.orderStatusCombination({
|
|
129
129
|
status: f,
|
|
130
|
-
isPOPartialReceive:
|
|
131
|
-
isPOOverReceive:
|
|
130
|
+
isPOPartialReceive: a,
|
|
131
|
+
isPOOverReceive: o
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
function xt() {
|
|
135
|
-
const k =
|
|
135
|
+
const k = ke(), a = Be(), o = Me();
|
|
136
136
|
async function f(n, _) {
|
|
137
|
-
const
|
|
138
|
-
return n.doc.supplier.internal && n.operation ===
|
|
137
|
+
const r = k.currentLocationDBName;
|
|
138
|
+
return n.doc.supplier.internal && n.operation === V.enum.confirmDraft && (n.operation = V.enum.submitRequest), await a.processPurchaseOrder(n, _ || r);
|
|
139
139
|
}
|
|
140
|
-
async function
|
|
141
|
-
const
|
|
142
|
-
return await
|
|
140
|
+
async function h(n, _) {
|
|
141
|
+
const r = k.currentLocationDBName;
|
|
142
|
+
return await a.processPurchaseOrderV2(n, _ || r);
|
|
143
143
|
}
|
|
144
|
-
return (n) =>
|
|
144
|
+
return (n) => o.useOperatePurchaseOrderV2 ? h(n.operateV2, n.transferTo) : f(n.operate, n.transferTo);
|
|
145
145
|
}
|
|
146
|
-
var
|
|
147
|
-
const
|
|
148
|
-
function Wn(k,
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
const n =
|
|
152
|
-
|
|
146
|
+
var at = /* @__PURE__ */ ((k) => (k.RECEIVE_REQUEST = "receive/request", k.APPROVAL = "approval", k))(at || {});
|
|
147
|
+
const je = J(), st = J();
|
|
148
|
+
function Wn(k, a) {
|
|
149
|
+
const o = et(), f = ke(), h = Me();
|
|
150
|
+
Ze();
|
|
151
|
+
const n = Vt(), _ = Et(), r = J(!1), c = Ue(), O = Be(), w = Wt(), d = J(new Array()), I = J(new Array()), S = J(
|
|
152
|
+
a != null && a.startDate && (a != null && a.endDate) ? a : Gt()
|
|
153
153
|
), F = Y(() => {
|
|
154
|
-
const q = new Date(
|
|
154
|
+
const q = new Date(S.value.startDate), U = new Date(S.value.endDate);
|
|
155
155
|
return {
|
|
156
|
-
start:
|
|
157
|
-
end:
|
|
156
|
+
start: Ft(q).toISOString(),
|
|
157
|
+
end: Tt(U).toISOString()
|
|
158
158
|
};
|
|
159
|
-
}), l = J(new Array()),
|
|
160
|
-
async function
|
|
161
|
-
function
|
|
162
|
-
const
|
|
159
|
+
}), l = J(new Array()), s = Nt(), b = J(null);
|
|
160
|
+
async function u(q) {
|
|
161
|
+
function U(D) {
|
|
162
|
+
const x = {
|
|
163
163
|
mode: pt.CREATE,
|
|
164
164
|
modelValue: q || void 0,
|
|
165
165
|
show: !0,
|
|
166
|
-
"onUpdate:show"(
|
|
167
|
-
|
|
166
|
+
"onUpdate:show"(T) {
|
|
167
|
+
je.value.show = T;
|
|
168
168
|
},
|
|
169
169
|
templateId: D,
|
|
170
|
-
lastClosingDate:
|
|
170
|
+
lastClosingDate: b.value
|
|
171
171
|
};
|
|
172
|
-
|
|
172
|
+
je.value = x;
|
|
173
173
|
}
|
|
174
174
|
let ae;
|
|
175
|
-
|
|
175
|
+
h.mustUsePoTemplate && !(q != null && q.template) ? o.open({
|
|
176
176
|
title: "Create transfer",
|
|
177
177
|
message: "",
|
|
178
178
|
primaryActions: {
|
|
@@ -185,37 +185,37 @@ function Wn(k, o) {
|
|
|
185
185
|
close: !0
|
|
186
186
|
}
|
|
187
187
|
}).onPrimary(async () => {
|
|
188
|
-
ae = await n.getTemplateId(), ae &&
|
|
188
|
+
ae = await n.getTemplateId(), ae && U(ae);
|
|
189
189
|
}).onSecondary(() => {
|
|
190
|
-
|
|
191
|
-
}) :
|
|
190
|
+
U(void 0);
|
|
191
|
+
}) : U(ae);
|
|
192
192
|
}
|
|
193
193
|
function $(q) {
|
|
194
|
-
const
|
|
194
|
+
const U = {
|
|
195
195
|
mode: pt.UPDATE,
|
|
196
196
|
modelValue: yt(q),
|
|
197
197
|
show: !0,
|
|
198
198
|
"onUpdate:show"(ae) {
|
|
199
|
-
|
|
199
|
+
je.value.show = ae;
|
|
200
200
|
},
|
|
201
|
-
lastClosingDate:
|
|
201
|
+
lastClosingDate: b.value
|
|
202
202
|
};
|
|
203
|
-
|
|
203
|
+
je.value = U;
|
|
204
204
|
}
|
|
205
|
-
async function
|
|
206
|
-
|
|
205
|
+
async function P() {
|
|
206
|
+
d.value = [], I.value = [], r.value = !0;
|
|
207
207
|
try {
|
|
208
|
-
const q = await
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
const D = await
|
|
213
|
-
|
|
214
|
-
const
|
|
208
|
+
const q = await O.getPurchaseOrders(F.value);
|
|
209
|
+
d.value = q.sort((j, t) => t._id.localeCompare(j._id));
|
|
210
|
+
const U = q.flatMap((j) => j.shipmentIds || []).filter(Boolean), ae = U.length > 0 ? await w.getShipmentsByIds(U) : [];
|
|
211
|
+
I.value = ae;
|
|
212
|
+
const D = await s.readCurrentLocationLastClosing(!0), x = D == null ? void 0 : D._id;
|
|
213
|
+
x && (b.value = wt(x)), await h.awaitFeatureLoaded(() => h.mustUsePoTemplate) && await _.fetchTemplates();
|
|
214
|
+
const T = d.value.map((j) => {
|
|
215
215
|
var t;
|
|
216
216
|
return ((t = j.request) == null ? void 0 : t.id) ?? "";
|
|
217
217
|
}).filter((j) => j);
|
|
218
|
-
l.value = await
|
|
218
|
+
l.value = await O.readRequestByIds(T);
|
|
219
219
|
} catch {
|
|
220
220
|
c.open({
|
|
221
221
|
title: "Something went wrong",
|
|
@@ -223,13 +223,13 @@ function Wn(k, o) {
|
|
|
223
223
|
type: "error"
|
|
224
224
|
});
|
|
225
225
|
} finally {
|
|
226
|
-
|
|
226
|
+
r.value = !1;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
async function B() {
|
|
230
|
-
l.value = [],
|
|
230
|
+
l.value = [], r.value = !0;
|
|
231
231
|
try {
|
|
232
|
-
l.value = await
|
|
232
|
+
l.value = await O.readRequests(
|
|
233
233
|
void 0,
|
|
234
234
|
F.value.start,
|
|
235
235
|
F.value.end
|
|
@@ -241,68 +241,68 @@ function Wn(k, o) {
|
|
|
241
241
|
type: "error"
|
|
242
242
|
});
|
|
243
243
|
} finally {
|
|
244
|
-
|
|
244
|
+
r.value = !1;
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
function C() {
|
|
248
248
|
switch (k) {
|
|
249
249
|
case "receive/request":
|
|
250
|
-
return
|
|
250
|
+
return P();
|
|
251
251
|
case "approval":
|
|
252
252
|
return B();
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
function
|
|
256
|
-
|
|
255
|
+
function G(q, U) {
|
|
256
|
+
S.value = {
|
|
257
257
|
startDate: q,
|
|
258
|
-
endDate:
|
|
258
|
+
endDate: U
|
|
259
259
|
}, C();
|
|
260
260
|
}
|
|
261
261
|
f.watchLocation(async (q) => {
|
|
262
262
|
if (!q) {
|
|
263
|
-
|
|
263
|
+
d.value = [];
|
|
264
264
|
return;
|
|
265
265
|
}
|
|
266
266
|
await C();
|
|
267
267
|
});
|
|
268
268
|
const Q = J(), se = J(Math.random().toString());
|
|
269
|
-
async function
|
|
269
|
+
async function fe(q, U) {
|
|
270
270
|
const ae = Math.random().toString();
|
|
271
|
-
se.value = ae,
|
|
271
|
+
se.value = ae, U ?? (U = l.value.computeFirst(
|
|
272
272
|
(j) => j.purchaseOrderId === q._id ? j : null
|
|
273
273
|
) ?? void 0);
|
|
274
|
-
const D = k === "receive/request" ? f.currentLocation :
|
|
275
|
-
poRequest:
|
|
274
|
+
const D = k === "receive/request" ? f.currentLocation : U == null ? void 0 : U.to, x = k === "approval", T = {
|
|
275
|
+
poRequest: U,
|
|
276
276
|
purchaseOrder: {
|
|
277
277
|
...q,
|
|
278
|
-
status:
|
|
278
|
+
status: x && (U != null && U.rejectedAt) ? ee.Enum.REJECT : q.status
|
|
279
279
|
},
|
|
280
280
|
transferTo: D == null ? void 0 : D.name,
|
|
281
281
|
transferToDbName: D == null ? void 0 : D.dbName,
|
|
282
282
|
show: !0,
|
|
283
283
|
canResubmit: !1,
|
|
284
|
-
canApprove:
|
|
284
|
+
canApprove: x,
|
|
285
285
|
"onUpdate:show"(j) {
|
|
286
286
|
Q.value.show = j;
|
|
287
287
|
},
|
|
288
288
|
scope: k,
|
|
289
289
|
receivedMap: Je(q) ?? {},
|
|
290
|
-
shipments:
|
|
290
|
+
shipments: I.value
|
|
291
291
|
};
|
|
292
|
-
Q.value =
|
|
292
|
+
Q.value = T;
|
|
293
293
|
}
|
|
294
|
-
async function
|
|
295
|
-
const
|
|
296
|
-
|
|
294
|
+
async function ye(q, U, ae, D) {
|
|
295
|
+
const x = xt();
|
|
296
|
+
r.value = !0;
|
|
297
297
|
try {
|
|
298
|
-
await
|
|
298
|
+
await x({
|
|
299
299
|
operate: {
|
|
300
|
-
operation:
|
|
300
|
+
operation: U,
|
|
301
301
|
doc: q,
|
|
302
302
|
options: (
|
|
303
303
|
// auto receive for supplier to warehouse
|
|
304
|
-
(
|
|
305
|
-
|
|
304
|
+
(U === V.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
305
|
+
U === V.enum.completeReceive) && h.autoReceiveWarehouse ? {
|
|
306
306
|
autoReceive: !0
|
|
307
307
|
} : void 0
|
|
308
308
|
)
|
|
@@ -310,13 +310,13 @@ function Wn(k, o) {
|
|
|
310
310
|
operateV2: {
|
|
311
311
|
_id: q._id,
|
|
312
312
|
_rev: q._rev ?? "",
|
|
313
|
-
action:
|
|
313
|
+
action: U,
|
|
314
314
|
payloads: []
|
|
315
315
|
},
|
|
316
316
|
transferTo: D
|
|
317
317
|
}), await new Promise((t) => setTimeout(t, 1e3));
|
|
318
|
-
const j =
|
|
319
|
-
|
|
318
|
+
const j = ke().currentLocationDBName.startsWith("restaurant_");
|
|
319
|
+
U === V.enum.confirmDraft && q.effectiveAt && j ? c.open({
|
|
320
320
|
title: "Success",
|
|
321
321
|
message: `${ae}. The backdate will be reflected once your POS has received this change.`,
|
|
322
322
|
type: "success"
|
|
@@ -325,37 +325,37 @@ function Wn(k, o) {
|
|
|
325
325
|
message: ae,
|
|
326
326
|
type: "success"
|
|
327
327
|
});
|
|
328
|
-
} catch (
|
|
328
|
+
} catch (T) {
|
|
329
329
|
c.open({
|
|
330
330
|
title: "Something went wrong",
|
|
331
331
|
message: "Please try again.",
|
|
332
332
|
type: "error"
|
|
333
|
-
}), console.error("Error when submitting PO operation",
|
|
333
|
+
}), console.error("Error when submitting PO operation", U, q, T);
|
|
334
334
|
} finally {
|
|
335
|
-
|
|
335
|
+
r.value = !1, C();
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
async function
|
|
339
|
-
const D = St[
|
|
338
|
+
async function De(q, U, ae) {
|
|
339
|
+
const D = St[U];
|
|
340
340
|
if (!D) {
|
|
341
341
|
c.open({
|
|
342
342
|
title: "Something went wrong",
|
|
343
|
-
message: `Cannot process order: ${
|
|
343
|
+
message: `Cannot process order: ${lt(U)}`,
|
|
344
344
|
type: "error"
|
|
345
345
|
});
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
|
-
const { successMessage:
|
|
349
|
-
|
|
350
|
-
title:
|
|
351
|
-
message:
|
|
352
|
-
primaryActions:
|
|
348
|
+
const { successMessage: x, ...T } = D;
|
|
349
|
+
o.open({
|
|
350
|
+
title: T.title,
|
|
351
|
+
message: T.message,
|
|
352
|
+
primaryActions: T.primaryActions
|
|
353
353
|
}).onPrimary(() => {
|
|
354
|
-
|
|
354
|
+
ye(q, U, x, ae);
|
|
355
355
|
});
|
|
356
356
|
}
|
|
357
357
|
async function qe() {
|
|
358
|
-
|
|
358
|
+
o.open({
|
|
359
359
|
title: "Upload Transfer",
|
|
360
360
|
primaryActions: {
|
|
361
361
|
text: "Xilnex transfer note",
|
|
@@ -368,85 +368,85 @@ function Wn(k, o) {
|
|
|
368
368
|
}).onPrimary(() => {
|
|
369
369
|
const q = {
|
|
370
370
|
show: !0,
|
|
371
|
-
"onUpdate:show"(
|
|
372
|
-
|
|
371
|
+
"onUpdate:show"(U) {
|
|
372
|
+
st.value.show = U;
|
|
373
373
|
}
|
|
374
374
|
};
|
|
375
|
-
|
|
375
|
+
st.value = q;
|
|
376
376
|
});
|
|
377
377
|
}
|
|
378
378
|
return {
|
|
379
|
-
purchaseOrders:
|
|
380
|
-
shipments:
|
|
379
|
+
purchaseOrders: d,
|
|
380
|
+
shipments: I,
|
|
381
381
|
purchaseRequests: l,
|
|
382
|
-
updateDateRange:
|
|
382
|
+
updateDateRange: G,
|
|
383
383
|
fetchData: C,
|
|
384
|
-
loading:
|
|
385
|
-
transferDialogProps:
|
|
386
|
-
promptCreateTransferDialog:
|
|
384
|
+
loading: r,
|
|
385
|
+
transferDialogProps: je,
|
|
386
|
+
promptCreateTransferDialog: u,
|
|
387
387
|
promptUpdateTransferDialog: $,
|
|
388
388
|
transferDetailsProps: Q,
|
|
389
|
-
promptShowTransferDetails:
|
|
390
|
-
submitAction:
|
|
391
|
-
xilnexImportDialogProps:
|
|
389
|
+
promptShowTransferDetails: fe,
|
|
390
|
+
submitAction: De,
|
|
391
|
+
xilnexImportDialogProps: st,
|
|
392
392
|
promptUploadTransferDialog: qe
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
|
-
function Yt(k,
|
|
396
|
-
return
|
|
397
|
-
(f,
|
|
398
|
-
const n =
|
|
395
|
+
function Yt(k, a) {
|
|
396
|
+
return a.reduce(
|
|
397
|
+
(f, h) => {
|
|
398
|
+
const n = h.received.find((_) => _.sku._id === k._id);
|
|
399
399
|
return n && (f = ht(f, n.amount)), f;
|
|
400
400
|
},
|
|
401
401
|
At.toPrecision(bt(0), k.unit.precision)
|
|
402
402
|
);
|
|
403
403
|
}
|
|
404
404
|
function Jt(k) {
|
|
405
|
-
const { po:
|
|
405
|
+
const { po: a, currentLocation: o, business: f, fulfilling: h, por: n } = k, { name: _, address: r, regNo: c, legalName: O } = o.doc.profile, w = {
|
|
406
406
|
name: _,
|
|
407
|
-
legalName:
|
|
407
|
+
legalName: O,
|
|
408
408
|
registrationNumber: c,
|
|
409
|
-
line1:
|
|
410
|
-
line2:
|
|
411
|
-
postcode:
|
|
412
|
-
city:
|
|
413
|
-
state:
|
|
414
|
-
country:
|
|
415
|
-
},
|
|
416
|
-
name:
|
|
417
|
-
phoneNumber:
|
|
418
|
-
registrationNumber:
|
|
419
|
-
line1:
|
|
420
|
-
line2:
|
|
421
|
-
postcode:
|
|
422
|
-
city:
|
|
423
|
-
state:
|
|
424
|
-
country:
|
|
425
|
-
},
|
|
426
|
-
const { sku: B, measurement: C } =
|
|
427
|
-
Yt(
|
|
409
|
+
line1: r == null ? void 0 : r.line1,
|
|
410
|
+
line2: r == null ? void 0 : r.line2,
|
|
411
|
+
postcode: r == null ? void 0 : r.postcode,
|
|
412
|
+
city: r == null ? void 0 : r.city,
|
|
413
|
+
state: r == null ? void 0 : r.state,
|
|
414
|
+
country: r == null ? void 0 : r.country
|
|
415
|
+
}, d = {
|
|
416
|
+
name: a.supplier.name,
|
|
417
|
+
phoneNumber: a.supplier.phoneNumber,
|
|
418
|
+
registrationNumber: a.supplier.registrationNumber,
|
|
419
|
+
line1: a.supplier.address.line1,
|
|
420
|
+
line2: a.supplier.address.line2,
|
|
421
|
+
postcode: a.supplier.address.postcode,
|
|
422
|
+
city: a.supplier.address.city,
|
|
423
|
+
state: a.supplier.address.state,
|
|
424
|
+
country: a.supplier.address.country
|
|
425
|
+
}, I = a.items.map((P) => {
|
|
426
|
+
const { sku: B, measurement: C } = P, G = he(
|
|
427
|
+
Yt(P.sku, a.deliveryOrder || []),
|
|
428
428
|
!1
|
|
429
429
|
);
|
|
430
430
|
return {
|
|
431
431
|
code: B.code,
|
|
432
432
|
description: B.name,
|
|
433
|
-
quantity:
|
|
433
|
+
quantity: he(P.quantity, !1),
|
|
434
434
|
unit: (C == null ? void 0 : C.abbrev) || B.unit.abbrev,
|
|
435
|
-
received:
|
|
436
|
-
cost:
|
|
437
|
-
value:
|
|
435
|
+
received: G,
|
|
436
|
+
cost: P.totalCost ? `${P.totalCost.currency} ${It.toFormatString({
|
|
437
|
+
value: P.totalCost
|
|
438
438
|
})}` : void 0
|
|
439
439
|
};
|
|
440
|
-
}),
|
|
441
|
-
createdAt: gt(new Date(
|
|
442
|
-
ref:
|
|
443
|
-
remark:
|
|
444
|
-
items:
|
|
440
|
+
}), S = a.deliveryOrder.map((P) => ({
|
|
441
|
+
createdAt: gt(new Date(P.createdAt)),
|
|
442
|
+
ref: P.deliveryOrderNumber,
|
|
443
|
+
remark: P.remark || "",
|
|
444
|
+
items: P.received.map((B) => {
|
|
445
445
|
var C;
|
|
446
446
|
return {
|
|
447
447
|
code: B.sku.code,
|
|
448
448
|
description: B.sku.name,
|
|
449
|
-
quantity:
|
|
449
|
+
quantity: he(B.amount),
|
|
450
450
|
unit: ((C = B.measurement) == null ? void 0 : C.abbrev) || B.sku.unit.abbrev
|
|
451
451
|
};
|
|
452
452
|
})
|
|
@@ -457,71 +457,71 @@ function Jt(k) {
|
|
|
457
457
|
"6880b36a3054c5001db19218"
|
|
458
458
|
];
|
|
459
459
|
let l = "Inventory Receive Note";
|
|
460
|
-
if (
|
|
461
|
-
const
|
|
462
|
-
|
|
460
|
+
if (a.supplier.internal ? (l = "Inventory Transfer Note", F.includes((f == null ? void 0 : f._id) || "") && (l = "Stock Request")) : l = "Purchase Order", n) {
|
|
461
|
+
const P = n.from.dbName;
|
|
462
|
+
o.dbName === P || (l = "Inventory Receive Note");
|
|
463
463
|
}
|
|
464
|
-
const
|
|
464
|
+
const b = {
|
|
465
465
|
title: l,
|
|
466
466
|
businessName: f == null ? void 0 : f.name,
|
|
467
467
|
logo: f == null ? void 0 : f.thumbnail,
|
|
468
|
-
orderNumber:
|
|
469
|
-
createdAt:
|
|
470
|
-
ref:
|
|
471
|
-
remark:
|
|
468
|
+
orderNumber: a.seqNumber.toString(),
|
|
469
|
+
createdAt: He(a._id),
|
|
470
|
+
ref: a.ref || "",
|
|
471
|
+
remark: a.remark || "",
|
|
472
472
|
buyer: w,
|
|
473
|
-
supplier:
|
|
474
|
-
items:
|
|
475
|
-
status:
|
|
476
|
-
deliveryOrders:
|
|
477
|
-
},
|
|
478
|
-
|
|
473
|
+
supplier: d,
|
|
474
|
+
items: I,
|
|
475
|
+
status: a.status,
|
|
476
|
+
deliveryOrders: S
|
|
477
|
+
}, u = new URL(window.location.href), $ = h && (a.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
|
|
478
|
+
u.pathname = u.hostname.includes("portal.feedme") ? `/inventory/${$}` : `/${$}`, u.searchParams.append("data", JSON.stringify(b)), window.open(u.href, "_blank", "noreferrer");
|
|
479
479
|
}
|
|
480
|
-
const
|
|
480
|
+
const Ee = {
|
|
481
481
|
submitRequest: {
|
|
482
482
|
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
483
483
|
color: "text-fm-color-typo-primary",
|
|
484
|
-
value:
|
|
484
|
+
value: V.enum.submitRequest
|
|
485
485
|
},
|
|
486
486
|
confirmDraft: {
|
|
487
487
|
translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
|
|
488
488
|
color: "text-fm-color-typo-primary",
|
|
489
|
-
value:
|
|
489
|
+
value: V.enum.confirmDraft
|
|
490
490
|
},
|
|
491
491
|
cancelDraft: {
|
|
492
492
|
translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
|
|
493
493
|
color: "text-fm-color-typo-error",
|
|
494
|
-
value:
|
|
494
|
+
value: V.enum.cancelDraft
|
|
495
495
|
},
|
|
496
496
|
approveRequest: {
|
|
497
497
|
translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
|
|
498
498
|
color: "text-fm-color-typo-primary",
|
|
499
|
-
value:
|
|
499
|
+
value: V.enum.approveRequest
|
|
500
500
|
},
|
|
501
501
|
rejectRequest: {
|
|
502
502
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
|
|
503
503
|
color: "text-fm-color-typo-error",
|
|
504
|
-
value:
|
|
504
|
+
value: V.enum.rejectRequest
|
|
505
505
|
},
|
|
506
506
|
processRequest: {
|
|
507
507
|
translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
|
|
508
508
|
color: "text-fm-color-typo-primary",
|
|
509
|
-
value:
|
|
509
|
+
value: V.enum.processRequest
|
|
510
510
|
},
|
|
511
511
|
receiveStock: {
|
|
512
512
|
translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
|
|
513
513
|
color: "text-fm-color-typo-primary",
|
|
514
|
-
value:
|
|
514
|
+
value: V.enum.receiveStock
|
|
515
515
|
},
|
|
516
516
|
completeReceive: {
|
|
517
517
|
translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
|
|
518
518
|
color: "text-fm-color-typo-primary",
|
|
519
|
-
value:
|
|
519
|
+
value: V.enum.completeReceive
|
|
520
520
|
},
|
|
521
521
|
closeRequest: {
|
|
522
522
|
translationKey: "inventory.transfer.receiveRequest.actions.closeRequest",
|
|
523
523
|
color: "system-error-300",
|
|
524
|
-
value:
|
|
524
|
+
value: V.enum.closeRequest
|
|
525
525
|
},
|
|
526
526
|
approveDraft: {
|
|
527
527
|
translationKey: "",
|
|
@@ -536,78 +536,78 @@ const Ve = {
|
|
|
536
536
|
returnStock: {
|
|
537
537
|
translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
|
|
538
538
|
color: "text-fm-color-typo-primary",
|
|
539
|
-
value:
|
|
539
|
+
value: V.enum.returnStock
|
|
540
540
|
}
|
|
541
541
|
};
|
|
542
|
-
function Qn(k,
|
|
543
|
-
const f =
|
|
544
|
-
function
|
|
545
|
-
switch (
|
|
542
|
+
function Qn(k, a, o) {
|
|
543
|
+
const f = ke(), h = Ze(), n = it(), { t: _ } = ct();
|
|
544
|
+
function r(S) {
|
|
545
|
+
switch (S.status) {
|
|
546
546
|
case "DRAFT":
|
|
547
547
|
return [
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
548
|
+
_e[pe.Update],
|
|
549
|
+
_e[pe.Details],
|
|
550
|
+
S.supplier.internal === "restaurant" || S.supplier.internal === "warehouse" ? Ee[V.enum.submitRequest] : Ee[V.enum.confirmDraft],
|
|
551
|
+
Ee[V.enum.cancelDraft]
|
|
552
552
|
];
|
|
553
553
|
case "RECEIVING":
|
|
554
554
|
return [
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
555
|
+
Ee[V.enum.completeReceive],
|
|
556
|
+
_e[pe.Details],
|
|
557
|
+
_e[pe.Print]
|
|
558
558
|
];
|
|
559
559
|
case "REQUESTING":
|
|
560
|
-
return k === "receive/request" ? [
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
560
|
+
return k === "receive/request" ? [_e[pe.Details], _e[pe.Print]] : [
|
|
561
|
+
Ee[V.enum.approveRequest],
|
|
562
|
+
Ee[V.enum.rejectRequest],
|
|
563
|
+
_e[pe.Details]
|
|
564
564
|
// DefaultRowActions[RowActionEnum.Print]
|
|
565
565
|
];
|
|
566
566
|
case "PROCESSING":
|
|
567
|
-
return [
|
|
567
|
+
return [_e[pe.Details], _e[pe.Print]];
|
|
568
568
|
case "COMPLETE":
|
|
569
569
|
case "CANCEL":
|
|
570
570
|
default:
|
|
571
|
-
return [
|
|
571
|
+
return [_e[pe.Details], _e[pe.Print]];
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
function c(
|
|
575
|
-
return Object.values(
|
|
574
|
+
function c(S) {
|
|
575
|
+
return Object.values(V.enum).includes(S);
|
|
576
576
|
}
|
|
577
|
-
async function
|
|
578
|
-
var
|
|
579
|
-
const
|
|
580
|
-
if (
|
|
581
|
-
const
|
|
582
|
-
if (
|
|
583
|
-
const Q = f.locationRestaurantFromCore(
|
|
584
|
-
Q !== null && (
|
|
577
|
+
async function O(S, F, l) {
|
|
578
|
+
var b, u, $, P, B, C;
|
|
579
|
+
const s = yt(F);
|
|
580
|
+
if (S === pe.Print) {
|
|
581
|
+
const G = (l == null ? void 0 : l.toInventoryLocation) ?? f.currentLocation;
|
|
582
|
+
if (G.type === "restaurant") {
|
|
583
|
+
const Q = f.locationRestaurantFromCore(G.doc._id);
|
|
584
|
+
Q !== null && (G.doc = Q);
|
|
585
585
|
}
|
|
586
|
-
((
|
|
587
|
-
po:
|
|
588
|
-
currentLocation:
|
|
586
|
+
((b = l == null ? void 0 : l.netSuite) != null && b.refNo || (u = s.netSuite) != null && u.refNo) && (s.ref = [(($ = l == null ? void 0 : l.netSuite) == null ? void 0 : $.refNo) || ((P = s.netSuite) == null ? void 0 : P.refNo)].filter((Q) => Q).join(" ")), Jt({
|
|
587
|
+
po: s,
|
|
588
|
+
currentLocation: G,
|
|
589
589
|
business: n.currentBusiness.value,
|
|
590
590
|
fulfilling: k === "approval",
|
|
591
591
|
por: l
|
|
592
592
|
});
|
|
593
593
|
return;
|
|
594
594
|
}
|
|
595
|
-
if (
|
|
596
|
-
|
|
595
|
+
if (S === pe.Details) {
|
|
596
|
+
a.promptShowTransferDetails(s, l);
|
|
597
597
|
return;
|
|
598
598
|
}
|
|
599
|
-
if (
|
|
600
|
-
(B =
|
|
599
|
+
if (S === pe.Update) {
|
|
600
|
+
(B = a.promptUpdateTransferDialog) == null || B.call(a, s);
|
|
601
601
|
return;
|
|
602
602
|
}
|
|
603
|
-
if (c(
|
|
604
|
-
|
|
603
|
+
if (c(S)) {
|
|
604
|
+
a.submitAction(F, S, (C = l == null ? void 0 : l.to) == null ? void 0 : C.dbName);
|
|
605
605
|
return;
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
function w() {
|
|
609
609
|
var F;
|
|
610
|
-
const
|
|
610
|
+
const S = [
|
|
611
611
|
{
|
|
612
612
|
accessorKey: "seqNumber",
|
|
613
613
|
header: () => _("inventory.transfer.table.seqNo"),
|
|
@@ -619,7 +619,7 @@ function Qn(k, o, a) {
|
|
|
619
619
|
accessorKey: "_id",
|
|
620
620
|
header: () => _("inventory.transfer.table.createdAt"),
|
|
621
621
|
cell(l) {
|
|
622
|
-
return
|
|
622
|
+
return He(`${l.getValue()}`);
|
|
623
623
|
},
|
|
624
624
|
enableSorting: !0
|
|
625
625
|
},
|
|
@@ -633,20 +633,20 @@ function Qn(k, o, a) {
|
|
|
633
633
|
accessorKey: "items.length",
|
|
634
634
|
header: () => _("inventory.transfer.table.noOfItems"),
|
|
635
635
|
cell: (l) => {
|
|
636
|
-
const
|
|
637
|
-
return
|
|
638
|
-
|
|
639
|
-
|
|
636
|
+
const s = l.row.original.version || "1", b = l.getValue();
|
|
637
|
+
return E("div", { class: "flex items-center gap-2" }, [
|
|
638
|
+
b,
|
|
639
|
+
s !== "1" ? E(
|
|
640
640
|
"div",
|
|
641
641
|
{ class: "py-3" },
|
|
642
|
-
|
|
642
|
+
E(
|
|
643
643
|
Pe,
|
|
644
|
-
|
|
644
|
+
E(
|
|
645
645
|
"div",
|
|
646
646
|
{
|
|
647
647
|
class: ["fm-status-badge", "fm-status-badge-draft"].join(" ")
|
|
648
648
|
},
|
|
649
|
-
`v${
|
|
649
|
+
`v${s}`
|
|
650
650
|
)
|
|
651
651
|
)
|
|
652
652
|
) : null
|
|
@@ -666,7 +666,7 @@ function Qn(k, o, a) {
|
|
|
666
666
|
...(F = n.sessionUser.value) != null && F.role.isAdmin ? [
|
|
667
667
|
{
|
|
668
668
|
id: "statusForAdmin",
|
|
669
|
-
header: () =>
|
|
669
|
+
header: () => E(Pe, {}, () => `${_("inventory.transfer.table.status")}`),
|
|
670
670
|
cell(l) {
|
|
671
671
|
return l.row.original.status;
|
|
672
672
|
},
|
|
@@ -678,28 +678,28 @@ function Qn(k, o, a) {
|
|
|
678
678
|
accessorKey: "status",
|
|
679
679
|
header: () => _("inventory.transfer.table.status"),
|
|
680
680
|
cell(l) {
|
|
681
|
-
const
|
|
682
|
-
let B = _(`inventory.transfer.status.${
|
|
683
|
-
|
|
684
|
-
let
|
|
685
|
-
const Q =
|
|
681
|
+
const s = l.getValue(), b = Je(l.row.original), { partial: u, over: $ } = ot(b), P = nt(s ?? "", u, $);
|
|
682
|
+
let B = _(`inventory.transfer.status.${P}`), C = `${s ?? ""}`.toLocaleLowerCase("en-us");
|
|
683
|
+
P === ee.enum.CLOSE && (B = `${_(`inventory.transfer.status.${ee.enum.COMPLETE}`)}`), P === "PARTIAL_RECEIVED" && C === ee.enum.PROCESSING.toLocaleLowerCase("en-us") && (C = ee.enum.RECEIVING.toLocaleLowerCase("en-us"));
|
|
684
|
+
let G = null;
|
|
685
|
+
const Q = o.value.find((se) => se.ref === l.row.original._id);
|
|
686
686
|
if (Q != null && Q.milestones && Q.milestones.length > 0) {
|
|
687
687
|
const se = Q.milestones[Q.milestones.length - 1];
|
|
688
688
|
if (se.estimatedTime) {
|
|
689
|
-
const
|
|
690
|
-
|
|
689
|
+
const fe = new Date(se.estimatedTime), ye = fe.getDate().toString().padStart(2, "0");
|
|
690
|
+
G = `${fe.toLocaleString("en-US", { month: "short" })} ${ye}`;
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
|
-
return
|
|
693
|
+
return E(
|
|
694
694
|
"div",
|
|
695
695
|
{
|
|
696
696
|
class: "flex"
|
|
697
697
|
},
|
|
698
698
|
[
|
|
699
|
-
|
|
699
|
+
E(
|
|
700
700
|
"div",
|
|
701
701
|
{ class: "flex items-center" },
|
|
702
|
-
|
|
702
|
+
E(
|
|
703
703
|
"div",
|
|
704
704
|
{
|
|
705
705
|
class: [
|
|
@@ -711,22 +711,22 @@ function Qn(k, o, a) {
|
|
|
711
711
|
`${B}`
|
|
712
712
|
)
|
|
713
713
|
),
|
|
714
|
-
...
|
|
715
|
-
|
|
714
|
+
...G ? [
|
|
715
|
+
E(
|
|
716
716
|
"div",
|
|
717
717
|
{
|
|
718
718
|
class: "flex items-center gap-1 ml-2"
|
|
719
719
|
},
|
|
720
720
|
[
|
|
721
|
-
|
|
721
|
+
E(Ye.FmIcon, {
|
|
722
722
|
name: "local_shipping",
|
|
723
723
|
size: "md",
|
|
724
724
|
color: "neutral-gray-400"
|
|
725
725
|
}),
|
|
726
|
-
|
|
726
|
+
E(
|
|
727
727
|
"span",
|
|
728
728
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
729
|
-
|
|
729
|
+
G
|
|
730
730
|
)
|
|
731
731
|
]
|
|
732
732
|
)
|
|
@@ -740,8 +740,8 @@ function Qn(k, o, a) {
|
|
|
740
740
|
{
|
|
741
741
|
id: "action",
|
|
742
742
|
cell(l) {
|
|
743
|
-
const
|
|
744
|
-
return dt(
|
|
743
|
+
const s = l.row.original, b = r(s);
|
|
744
|
+
return dt(b, (u) => O(u, s));
|
|
745
745
|
},
|
|
746
746
|
enableSorting: !1,
|
|
747
747
|
size: 40,
|
|
@@ -751,19 +751,19 @@ function Qn(k, o, a) {
|
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
753
|
];
|
|
754
|
-
if (
|
|
754
|
+
if (h.isEnabled) {
|
|
755
755
|
const l = [
|
|
756
756
|
{
|
|
757
757
|
id: "netsuiteTransferOrder",
|
|
758
|
-
accessorFn: (
|
|
759
|
-
var
|
|
760
|
-
return (
|
|
758
|
+
accessorFn: (s) => {
|
|
759
|
+
var b;
|
|
760
|
+
return (b = s.netSuite) != null && b.id ? `${s.netSuite.refNo} (${s.netSuite.id})` : "N/A";
|
|
761
761
|
},
|
|
762
762
|
header: () => "NetSuite Order (ID)",
|
|
763
|
-
cell(
|
|
764
|
-
var
|
|
765
|
-
const
|
|
766
|
-
return (
|
|
763
|
+
cell(s) {
|
|
764
|
+
var u;
|
|
765
|
+
const b = s.row.original;
|
|
766
|
+
return (u = b.netSuite) != null && u.id ? `${b.netSuite.refNo} (${b.netSuite.id})` : "N/A";
|
|
767
767
|
},
|
|
768
768
|
enableSorting: !1,
|
|
769
769
|
size: 200,
|
|
@@ -774,14 +774,14 @@ function Qn(k, o, a) {
|
|
|
774
774
|
},
|
|
775
775
|
{
|
|
776
776
|
id: "netsuiteTransactionNumber",
|
|
777
|
-
accessorFn: (
|
|
778
|
-
var
|
|
779
|
-
return ((
|
|
777
|
+
accessorFn: (s) => {
|
|
778
|
+
var b, u;
|
|
779
|
+
return ((u = (b = s.netSuite) == null ? void 0 : b.additionalInfo) == null ? void 0 : u.transactionnumber) ?? "N/A";
|
|
780
780
|
},
|
|
781
781
|
header: () => "NetSuite Transaction No.",
|
|
782
|
-
cell(
|
|
783
|
-
var
|
|
784
|
-
return (($ = (
|
|
782
|
+
cell(s) {
|
|
783
|
+
var u, $;
|
|
784
|
+
return (($ = (u = s.row.original.netSuite) == null ? void 0 : u.additionalInfo) == null ? void 0 : $.transactionnumber) ?? "N/A";
|
|
785
785
|
},
|
|
786
786
|
enableSorting: !1,
|
|
787
787
|
size: 200,
|
|
@@ -791,13 +791,13 @@ function Qn(k, o, a) {
|
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
793
|
];
|
|
794
|
-
|
|
794
|
+
S.splice(S.length - 1, 0, ...l);
|
|
795
795
|
}
|
|
796
|
-
return
|
|
796
|
+
return S;
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function d() {
|
|
799
799
|
var F;
|
|
800
|
-
const
|
|
800
|
+
const S = [
|
|
801
801
|
{
|
|
802
802
|
accessorKey: "purchaseOrder.seqNumber",
|
|
803
803
|
header: () => _("inventory.transfer.table.seqNo"),
|
|
@@ -809,7 +809,7 @@ function Qn(k, o, a) {
|
|
|
809
809
|
accessorKey: "purchaseOrder._id",
|
|
810
810
|
header: () => _("inventory.transfer.table.createdAt"),
|
|
811
811
|
cell(l) {
|
|
812
|
-
return
|
|
812
|
+
return He(`${l.getValue()}`);
|
|
813
813
|
},
|
|
814
814
|
enableSorting: !0
|
|
815
815
|
},
|
|
@@ -833,7 +833,7 @@ function Qn(k, o, a) {
|
|
|
833
833
|
...(F = n.sessionUser.value) != null && F.role.isAdmin ? [
|
|
834
834
|
{
|
|
835
835
|
id: "statusForAdmin",
|
|
836
|
-
header: () =>
|
|
836
|
+
header: () => E(Pe, {}, () => `${_("inventory.transfer.table.status")}`),
|
|
837
837
|
cell(l) {
|
|
838
838
|
return l.row.original.status;
|
|
839
839
|
},
|
|
@@ -845,26 +845,26 @@ function Qn(k, o, a) {
|
|
|
845
845
|
accessorKey: "purchaseOrder.status",
|
|
846
846
|
header: () => _("inventory.transfer.table.status"),
|
|
847
847
|
cell(l) {
|
|
848
|
-
const
|
|
849
|
-
if (!
|
|
850
|
-
return
|
|
848
|
+
const s = l.row.original, b = l.getValue();
|
|
849
|
+
if (!s.purchaseOrder)
|
|
850
|
+
return E(Ye.FmChip, {
|
|
851
851
|
label: "N/A",
|
|
852
852
|
compact: !0
|
|
853
853
|
});
|
|
854
|
-
const
|
|
855
|
-
let C = _(`inventory.transfer.status.${B}`),
|
|
856
|
-
return B === ee.enum.CLOSE && (C = `${_(`inventory.transfer.status.${ee.enum.COMPLETE}`)}`), B === "PARTIAL_RECEIVED" &&
|
|
854
|
+
const u = Je(s.purchaseOrder), { partial: $, over: P } = ot(u), B = nt(b ?? "", $, P);
|
|
855
|
+
let C = _(`inventory.transfer.status.${B}`), G = `${b ?? ""}`.toLocaleLowerCase("en-us");
|
|
856
|
+
return B === ee.enum.CLOSE && (C = `${_(`inventory.transfer.status.${ee.enum.COMPLETE}`)}`), B === "PARTIAL_RECEIVED" && G === ee.enum.PROCESSING.toLocaleLowerCase("en-us") && (G = ee.enum.RECEIVING.toLocaleLowerCase("en-us")), s.rejectedAt && (C = _("inventory.transfer.status.REJECT"), G = ee.enum.REJECT.toLocaleLowerCase("en-us")), E(
|
|
857
857
|
"div",
|
|
858
858
|
{
|
|
859
859
|
class: "flex"
|
|
860
860
|
},
|
|
861
|
-
|
|
861
|
+
E(
|
|
862
862
|
"div",
|
|
863
863
|
{
|
|
864
864
|
class: [
|
|
865
865
|
"fm-status-badge",
|
|
866
|
-
`fm-status-badge-${
|
|
867
|
-
|
|
866
|
+
`fm-status-badge-${G}`,
|
|
867
|
+
P && "fm-status-badge-error"
|
|
868
868
|
].filter(Boolean).join(" ")
|
|
869
869
|
},
|
|
870
870
|
`${C}`
|
|
@@ -876,13 +876,13 @@ function Qn(k, o, a) {
|
|
|
876
876
|
{
|
|
877
877
|
id: "action",
|
|
878
878
|
cell(l) {
|
|
879
|
-
const
|
|
879
|
+
const s = l.row.original, u = (s.purchaseOrder ? r(s.purchaseOrder) : []).map(($) => $.value === pe.Print ? {
|
|
880
880
|
...$,
|
|
881
881
|
translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
|
|
882
882
|
} : $);
|
|
883
883
|
return dt(
|
|
884
|
-
|
|
885
|
-
($) =>
|
|
884
|
+
u,
|
|
885
|
+
($) => s.purchaseOrder ? O($, s.purchaseOrder, s) : void 0
|
|
886
886
|
);
|
|
887
887
|
},
|
|
888
888
|
enableSorting: !1,
|
|
@@ -893,19 +893,19 @@ function Qn(k, o, a) {
|
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
895
|
];
|
|
896
|
-
if (
|
|
896
|
+
if (h.isEnabled) {
|
|
897
897
|
const l = [
|
|
898
898
|
{
|
|
899
899
|
id: "netsuiteTransferOrder",
|
|
900
|
-
accessorFn: (
|
|
901
|
-
var
|
|
902
|
-
return (
|
|
900
|
+
accessorFn: (s) => {
|
|
901
|
+
var b;
|
|
902
|
+
return (b = s.netSuite) != null && b.id ? `${s.netSuite.refNo} (${s.netSuite.id})` : "N/A";
|
|
903
903
|
},
|
|
904
904
|
header: () => "NetSuite Order (ID)",
|
|
905
|
-
cell(
|
|
906
|
-
var
|
|
907
|
-
const
|
|
908
|
-
return (
|
|
905
|
+
cell(s) {
|
|
906
|
+
var u;
|
|
907
|
+
const b = s.row.original;
|
|
908
|
+
return (u = b.netSuite) != null && u.id ? `${b.netSuite.refNo} (${b.netSuite.id})` : "N/A";
|
|
909
909
|
},
|
|
910
910
|
enableSorting: !1,
|
|
911
911
|
size: 200,
|
|
@@ -916,14 +916,14 @@ function Qn(k, o, a) {
|
|
|
916
916
|
},
|
|
917
917
|
{
|
|
918
918
|
id: "netsuiteTransactionNumber",
|
|
919
|
-
accessorFn: (
|
|
920
|
-
var
|
|
921
|
-
return ((
|
|
919
|
+
accessorFn: (s) => {
|
|
920
|
+
var b, u;
|
|
921
|
+
return ((u = (b = s.netSuite) == null ? void 0 : b.additionalInfo) == null ? void 0 : u.transactionnumber) ?? "N/A";
|
|
922
922
|
},
|
|
923
923
|
header: () => "NetSuite Transaction No.",
|
|
924
|
-
cell(
|
|
925
|
-
var
|
|
926
|
-
return (($ = (
|
|
924
|
+
cell(s) {
|
|
925
|
+
var u, $;
|
|
926
|
+
return (($ = (u = s.row.original.netSuite) == null ? void 0 : u.additionalInfo) == null ? void 0 : $.transactionnumber) ?? "N/A";
|
|
927
927
|
},
|
|
928
928
|
enableSorting: !1,
|
|
929
929
|
size: 200,
|
|
@@ -933,123 +933,123 @@ function Qn(k, o, a) {
|
|
|
933
933
|
}
|
|
934
934
|
}
|
|
935
935
|
];
|
|
936
|
-
|
|
936
|
+
S.splice(S.length - 2, 0, ...l);
|
|
937
937
|
}
|
|
938
|
-
return
|
|
938
|
+
return S;
|
|
939
939
|
}
|
|
940
940
|
return {
|
|
941
|
-
columnDefs: Y(() => k === "receive/request" ? w() :
|
|
941
|
+
columnDefs: Y(() => k === "receive/request" ? w() : d())
|
|
942
942
|
};
|
|
943
943
|
}
|
|
944
|
-
const Xt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Zt = { class: "flex flex-col gap-8" }, es = { class: "flex w-full justify-end gap-16" }, ts = /* @__PURE__ */
|
|
944
|
+
const Xt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Zt = { class: "flex flex-col gap-8" }, es = { class: "flex w-full justify-end gap-16" }, ts = /* @__PURE__ */ we({
|
|
945
945
|
__name: "FulfillmentForm",
|
|
946
946
|
props: {
|
|
947
947
|
purchaseOrder: {},
|
|
948
948
|
confirm: { type: Function }
|
|
949
949
|
},
|
|
950
950
|
emits: ["update:show"],
|
|
951
|
-
setup(k, { emit:
|
|
952
|
-
const
|
|
951
|
+
setup(k, { emit: a }) {
|
|
952
|
+
const o = k, f = $t({
|
|
953
953
|
id: "",
|
|
954
954
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
955
955
|
items: []
|
|
956
|
-
}),
|
|
956
|
+
}), h = J(), n = a;
|
|
957
957
|
ft(() => {
|
|
958
|
-
|
|
959
|
-
id:
|
|
960
|
-
sku:
|
|
961
|
-
measurement:
|
|
962
|
-
amount:
|
|
958
|
+
o.purchaseOrder && (f.items = o.purchaseOrder.items.map((r) => ({
|
|
959
|
+
id: r.id,
|
|
960
|
+
sku: r.sku,
|
|
961
|
+
measurement: r.measurement,
|
|
962
|
+
amount: r.quantity ?? { amount: 1, precision: 0 }
|
|
963
963
|
})));
|
|
964
964
|
});
|
|
965
965
|
const _ = Y(() => f.items.length <= 10);
|
|
966
|
-
return (
|
|
967
|
-
const
|
|
968
|
-
return i(), re(
|
|
966
|
+
return (r, c) => {
|
|
967
|
+
const O = K("FmTable"), w = K("FmButton"), d = K("FmForm");
|
|
968
|
+
return i(), re(d, {
|
|
969
969
|
ref_key: "formRef",
|
|
970
|
-
ref:
|
|
970
|
+
ref: h,
|
|
971
971
|
class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
|
|
972
972
|
onValidationFailed: console.log,
|
|
973
|
-
onValidationSuccess: c[1] || (c[1] = () =>
|
|
973
|
+
onValidationSuccess: c[1] || (c[1] = () => o.confirm(f))
|
|
974
974
|
}, {
|
|
975
975
|
default: X(() => [
|
|
976
976
|
c[2] || (c[2] = e("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
|
|
977
977
|
e("div", Xt, [
|
|
978
978
|
e("div", Zt, [
|
|
979
|
-
N(
|
|
979
|
+
N(O, {
|
|
980
980
|
"column-defs": [
|
|
981
981
|
{
|
|
982
982
|
header: "Code",
|
|
983
|
-
cell: (
|
|
984
|
-
const
|
|
985
|
-
return
|
|
983
|
+
cell: (I) => {
|
|
984
|
+
const S = o.purchaseOrder.items.find((F) => F.id === I.row.original.id || F.sku._id === I.row.original.sku._id);
|
|
985
|
+
return E(
|
|
986
986
|
v(Ye).FmTooltip,
|
|
987
987
|
{
|
|
988
|
-
content:
|
|
988
|
+
content: S.code,
|
|
989
989
|
placement: "top",
|
|
990
990
|
variant: "plain",
|
|
991
991
|
zIndex: 50
|
|
992
992
|
},
|
|
993
|
-
|
|
993
|
+
E(
|
|
994
994
|
"span",
|
|
995
995
|
{
|
|
996
996
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
997
997
|
},
|
|
998
|
-
|
|
998
|
+
S.code
|
|
999
999
|
)
|
|
1000
1000
|
);
|
|
1001
1001
|
}
|
|
1002
1002
|
},
|
|
1003
1003
|
{
|
|
1004
1004
|
header: "Name",
|
|
1005
|
-
cell: (
|
|
1006
|
-
const
|
|
1007
|
-
return
|
|
1005
|
+
cell: (I) => {
|
|
1006
|
+
const S = o.purchaseOrder.items.find((F) => F.id === I.row.original.id || F.sku._id === I.row.original.sku._id);
|
|
1007
|
+
return E(
|
|
1008
1008
|
v(Ye).FmTooltip,
|
|
1009
1009
|
{
|
|
1010
|
-
content:
|
|
1010
|
+
content: S.name,
|
|
1011
1011
|
placement: "top",
|
|
1012
1012
|
variant: "plain",
|
|
1013
1013
|
zIndex: 50
|
|
1014
1014
|
},
|
|
1015
|
-
|
|
1015
|
+
E(
|
|
1016
1016
|
"span",
|
|
1017
1017
|
{
|
|
1018
1018
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
1019
1019
|
},
|
|
1020
|
-
|
|
1020
|
+
S.name
|
|
1021
1021
|
)
|
|
1022
1022
|
);
|
|
1023
1023
|
}
|
|
1024
1024
|
},
|
|
1025
1025
|
{
|
|
1026
1026
|
header: "Amount",
|
|
1027
|
-
cell: (
|
|
1028
|
-
const
|
|
1027
|
+
cell: (I) => {
|
|
1028
|
+
const S = I.row.original, F = o.purchaseOrder.items.find((s) => s.id === S.id || s.sku._id === S.sku._id), l = S.amount ?? {
|
|
1029
1029
|
amount: 1,
|
|
1030
1030
|
precision: 0
|
|
1031
1031
|
};
|
|
1032
|
-
return
|
|
1032
|
+
return E(Ut, {
|
|
1033
1033
|
style: {
|
|
1034
1034
|
flex: "1 1 0%"
|
|
1035
1035
|
},
|
|
1036
1036
|
modelValue: {
|
|
1037
1037
|
amount: l,
|
|
1038
|
-
measurement:
|
|
1038
|
+
measurement: S.measurement ?? null
|
|
1039
1039
|
},
|
|
1040
|
-
key:
|
|
1041
|
-
unit:
|
|
1042
|
-
"onUpdate:modelValue": (
|
|
1043
|
-
if (!
|
|
1044
|
-
const
|
|
1045
|
-
|
|
1040
|
+
key: S.id ?? S.sku._id,
|
|
1041
|
+
unit: S.sku.unit,
|
|
1042
|
+
"onUpdate:modelValue": (s) => {
|
|
1043
|
+
if (!s) return;
|
|
1044
|
+
const b = f.items.find((u) => u.id === S.id || u.sku._id === S.sku._id);
|
|
1045
|
+
b && (b.amount = s.amount);
|
|
1046
1046
|
},
|
|
1047
1047
|
disableUnit: !0,
|
|
1048
1048
|
rules: [
|
|
1049
1049
|
v(Bt)(
|
|
1050
|
-
+v(
|
|
1050
|
+
+v(he)({ amount: 0, precision: 0 })
|
|
1051
1051
|
),
|
|
1052
|
-
v(jt)(+v(
|
|
1052
|
+
v(jt)(+v(he)(F.quantity))
|
|
1053
1053
|
],
|
|
1054
1054
|
applyDefaultRules: !0
|
|
1055
1055
|
});
|
|
@@ -1082,7 +1082,7 @@ const Xt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1082
1082
|
}, 8, ["onValidationFailed"]);
|
|
1083
1083
|
};
|
|
1084
1084
|
}
|
|
1085
|
-
}),
|
|
1085
|
+
}), rt = {
|
|
1086
1086
|
submitRequest: {
|
|
1087
1087
|
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
1088
1088
|
color: "primary",
|
|
@@ -1148,27 +1148,27 @@ const Xt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1148
1148
|
}
|
|
1149
1149
|
};
|
|
1150
1150
|
function ss() {
|
|
1151
|
-
const k =
|
|
1151
|
+
const k = Me();
|
|
1152
1152
|
return {
|
|
1153
|
-
ableToMarkReceived(
|
|
1154
|
-
if (!
|
|
1153
|
+
ableToMarkReceived(a) {
|
|
1154
|
+
if (!a || a.status !== ee.enum.RECEIVING)
|
|
1155
1155
|
return !1;
|
|
1156
|
-
const f =
|
|
1157
|
-
return `${
|
|
1156
|
+
const f = ke().currentLocationDBName;
|
|
1157
|
+
return `${a.supplier.internal}_${a.supplier._id}` !== f;
|
|
1158
1158
|
},
|
|
1159
|
-
ableToMarkApproved(
|
|
1160
|
-
return !(!
|
|
1159
|
+
ableToMarkApproved(a) {
|
|
1160
|
+
return !(!a || (a == null ? void 0 : a.status) !== ee.enum.REQUESTING);
|
|
1161
1161
|
},
|
|
1162
|
-
ableToCreateFulfillment(
|
|
1162
|
+
ableToCreateFulfillment(a, o) {
|
|
1163
1163
|
var n, _;
|
|
1164
|
-
if (!k.acceptRequireFulfillment || !
|
|
1164
|
+
if (!k.acceptRequireFulfillment || !a || !o || a.status !== ee.enum.PROCESSING || !o.processedAt)
|
|
1165
1165
|
return !1;
|
|
1166
|
-
const f = (n =
|
|
1167
|
-
return !(f.startsWith("restaurant_") &&
|
|
1166
|
+
const f = (n = o == null ? void 0 : o.from) == null ? void 0 : n.dbName, h = (_ = o == null ? void 0 : o.to) == null ? void 0 : _.dbName;
|
|
1167
|
+
return !(f.startsWith("restaurant_") && h.startsWith("restaurant_"));
|
|
1168
1168
|
}
|
|
1169
1169
|
};
|
|
1170
1170
|
}
|
|
1171
|
-
const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */
|
|
1171
|
+
const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
1172
1172
|
__name: "NetSuiteSync",
|
|
1173
1173
|
props: {
|
|
1174
1174
|
poRequest: {},
|
|
@@ -1177,21 +1177,21 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1177
1177
|
scope: {}
|
|
1178
1178
|
},
|
|
1179
1179
|
setup(k) {
|
|
1180
|
-
const
|
|
1180
|
+
const a = k, o = Ze(), f = Ue(), h = et(), n = J(!1);
|
|
1181
1181
|
Y(() => {
|
|
1182
|
-
var w,
|
|
1183
|
-
let
|
|
1184
|
-
|
|
1185
|
-
const c =
|
|
1186
|
-
return c && ((w = c == null ? void 0 : c.supplier) != null && w.internal ? (!
|
|
1182
|
+
var w, d, I, S;
|
|
1183
|
+
let r = !0;
|
|
1184
|
+
o.isEnabled || (r = !1);
|
|
1185
|
+
const c = a.purchaseOrder, O = a.poRequest;
|
|
1186
|
+
return c && ((w = c == null ? void 0 : c.supplier) != null && w.internal ? (!O && c.status == ee.enum.DRAFT && (r = !1), O && !((d = O == null ? void 0 : O.netSuite) != null && d.id) && (r = !1), a.isTransferBetweenOutlets && (r = !1)) : ((c == null ? void 0 : c.status) !== ee.enum.REQUESTING && c.supplier.internal && (r = !1), !O && !((I = c == null ? void 0 : c.netSuite) != null && I.id) && (r = !1), !O && ((S = c == null ? void 0 : c.netSuite) != null && S.id) && (c == null ? void 0 : c.status) == ee.enum.REQUESTING && (r = !1))), r;
|
|
1187
1187
|
});
|
|
1188
1188
|
async function _() {
|
|
1189
|
-
n.value ||
|
|
1189
|
+
n.value || h.open({
|
|
1190
1190
|
title: "Sync with NetSuite",
|
|
1191
|
-
contentComponent:
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1191
|
+
contentComponent: E("div", [
|
|
1192
|
+
E("p", "Are you sure you want to sync now?"),
|
|
1193
|
+
E("br"),
|
|
1194
|
+
E(
|
|
1195
1195
|
"p",
|
|
1196
1196
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1197
1197
|
"Please wait a moment before syncing manually to avoid unnecessary actions."
|
|
@@ -1204,18 +1204,18 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1204
1204
|
},
|
|
1205
1205
|
secondaryActions: { text: "Not now", close: !0 }
|
|
1206
1206
|
}).onPrimary(async () => {
|
|
1207
|
-
var
|
|
1207
|
+
var r, c, O;
|
|
1208
1208
|
try {
|
|
1209
1209
|
n.value = !0;
|
|
1210
|
-
const w = ((
|
|
1211
|
-
await
|
|
1210
|
+
const w = ((r = a.purchaseOrder) == null ? void 0 : r._id) || ((c = a.poRequest) == null ? void 0 : c.purchaseOrderId) || "", d = (O = a.poRequest) == null ? void 0 : O.to.dbName;
|
|
1211
|
+
await o.syncPurchaseOrder(
|
|
1212
1212
|
w,
|
|
1213
|
-
|
|
1213
|
+
a.scope === "approval" ? d : void 0
|
|
1214
1214
|
), f.open({
|
|
1215
1215
|
title: "Sync with NetSuite",
|
|
1216
1216
|
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
1217
1217
|
type: "success"
|
|
1218
|
-
}), await new Promise((
|
|
1218
|
+
}), await new Promise((I) => setTimeout(I, 5e3)), n.value = !1;
|
|
1219
1219
|
} catch {
|
|
1220
1220
|
f.open({
|
|
1221
1221
|
title: "Error",
|
|
@@ -1225,10 +1225,10 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1225
1225
|
}
|
|
1226
1226
|
});
|
|
1227
1227
|
}
|
|
1228
|
-
return (
|
|
1229
|
-
const
|
|
1230
|
-
return i(),
|
|
1231
|
-
N(
|
|
1228
|
+
return (r, c) => {
|
|
1229
|
+
const O = K("FmButton");
|
|
1230
|
+
return i(), g("div", rs, [
|
|
1231
|
+
N(O, {
|
|
1232
1232
|
"prepend-icon": "sync",
|
|
1233
1233
|
variant: "secondary",
|
|
1234
1234
|
label: "Sync",
|
|
@@ -1256,7 +1256,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1256
1256
|
}, gs = { class: "fm-typo-en-body-lg-600" }, _s = {
|
|
1257
1257
|
key: 3,
|
|
1258
1258
|
class: "flex flex-col gap-4"
|
|
1259
|
-
}, Ss = { class: "fm-typo-en-body-lg-600" }, xs = /* @__PURE__ */
|
|
1259
|
+
}, Ss = { class: "fm-typo-en-body-lg-600" }, xs = /* @__PURE__ */ we({
|
|
1260
1260
|
__name: "NetSuiteInfo",
|
|
1261
1261
|
props: {
|
|
1262
1262
|
transferType: {},
|
|
@@ -1267,99 +1267,99 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1267
1267
|
scope: {}
|
|
1268
1268
|
},
|
|
1269
1269
|
setup(k) {
|
|
1270
|
-
const
|
|
1270
|
+
const a = k, o = Ze(), f = Be(), h = J(a.poRequest);
|
|
1271
1271
|
ft(async () => {
|
|
1272
1272
|
var c;
|
|
1273
|
-
if (!
|
|
1274
|
-
const
|
|
1275
|
-
|
|
1273
|
+
if (!a.poRequest && ((c = a.purchaseOrder) != null && c._id)) {
|
|
1274
|
+
const O = await f.getLatestPurchaseOrderRequest(a.purchaseOrder._id);
|
|
1275
|
+
h.value = O;
|
|
1276
1276
|
}
|
|
1277
1277
|
});
|
|
1278
1278
|
const n = Y(
|
|
1279
1279
|
() => {
|
|
1280
|
-
var c,
|
|
1281
|
-
return
|
|
1282
|
-
((w = (
|
|
1280
|
+
var c, O, w, d, I, S;
|
|
1281
|
+
return o.getSubsidiaryFullName(
|
|
1282
|
+
((w = (O = (c = a.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : O.subsidiary) == null ? void 0 : w.id) || ((S = (I = (d = a.poRequest) == null ? void 0 : d.netSuite) == null ? void 0 : I.subsidiary) == null ? void 0 : S.id)
|
|
1283
1283
|
).fullName;
|
|
1284
1284
|
}
|
|
1285
1285
|
), _ = Y(() => {
|
|
1286
|
-
var c,
|
|
1287
|
-
return (w = (
|
|
1288
|
-
}),
|
|
1289
|
-
var c,
|
|
1290
|
-
return (
|
|
1286
|
+
var c, O, w, d, I, S, F, l, s, b, u, $;
|
|
1287
|
+
return (w = (O = (c = a.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : O.additionalInfo) != null && w.transactionnumber ? (S = (I = (d = a.purchaseOrder) == null ? void 0 : d.netSuite) == null ? void 0 : I.additionalInfo) == null ? void 0 : S.transactionnumber : (s = (l = (F = h.value) == null ? void 0 : F.netSuite) == null ? void 0 : l.additionalInfo) != null && s.transactionnumber ? ($ = (u = (b = h.value) == null ? void 0 : b.netSuite) == null ? void 0 : u.additionalInfo) == null ? void 0 : $.transactionnumber : null;
|
|
1288
|
+
}), r = Y(() => {
|
|
1289
|
+
var c, O, w, d, I, S;
|
|
1290
|
+
return (O = (c = a.purchaseOrder) == null ? void 0 : c.deliveryFullfillment) != null && O.length && ((d = (w = a.purchaseOrder) == null ? void 0 : w.deliveryFullfillment) == null ? void 0 : d.length) > 0 ? (S = (I = a.purchaseOrder) == null ? void 0 : I.deliveryFullfillment) == null ? void 0 : S.map((F) => {
|
|
1291
1291
|
var l;
|
|
1292
1292
|
return (l = F.netSuite) == null ? void 0 : l.refNo;
|
|
1293
1293
|
}).join(", ") : "N/A";
|
|
1294
1294
|
});
|
|
1295
|
-
return (c,
|
|
1296
|
-
var w,
|
|
1297
|
-
return v(
|
|
1295
|
+
return (c, O) => {
|
|
1296
|
+
var w, d, I, S, F, l, s, b, u, $, P, B, C, G, Q, se;
|
|
1297
|
+
return v(o).isEnabled ? (i(), g("div", ns, [
|
|
1298
1298
|
e("div", as, [
|
|
1299
|
-
|
|
1300
|
-
e("div", ls,
|
|
1299
|
+
O[0] || (O[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
1300
|
+
e("div", ls, y(n.value || "N/A"), 1)
|
|
1301
1301
|
]),
|
|
1302
|
-
!c.isTransferBetweenOutlets && c.scope === v(
|
|
1303
|
-
e("div", cs, " NetSuite " +
|
|
1302
|
+
!c.isTransferBetweenOutlets && c.scope === v(at).RECEIVE_REQUEST ? (i(), g("div", is, [
|
|
1303
|
+
e("div", cs, " NetSuite " + y((d = (w = c.purchaseOrder) == null ? void 0 : w.netSuite) != null && d.recordType ? v(vt)((S = (I = c.purchaseOrder) == null ? void 0 : I.netSuite) == null ? void 0 : S.recordType) : c.transferType === v(Ke).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1304
1304
|
e("div", us, [
|
|
1305
|
-
(l = (F = c.purchaseOrder) == null ? void 0 : F.netSuite) != null && l.id ? (i(),
|
|
1305
|
+
(l = (F = c.purchaseOrder) == null ? void 0 : F.netSuite) != null && l.id ? (i(), g("span", ds, y((b = (s = c.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : b.refNo) + " (" + y(($ = (u = c.purchaseOrder) == null ? void 0 : u.netSuite) == null ? void 0 : $.id) + ") ", 1)) : (i(), g("span", ms, "N/A"))
|
|
1306
1306
|
])
|
|
1307
|
-
])) :
|
|
1308
|
-
!c.isTransferBetweenOutlets &&
|
|
1309
|
-
e("div", fs, " (Request) NetSuite " +
|
|
1307
|
+
])) : M("", !0),
|
|
1308
|
+
!c.isTransferBetweenOutlets && h.value || c.scope === v(at).APPROVAL ? (i(), g("div", ps, [
|
|
1309
|
+
e("div", fs, " (Request) NetSuite " + y(c.transferType === v(Ke).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1310
1310
|
e("div", ys, [
|
|
1311
|
-
(B = (
|
|
1311
|
+
(B = (P = h.value) == null ? void 0 : P.netSuite) != null && B.id ? (i(), g("span", vs, y((G = (C = h.value) == null ? void 0 : C.netSuite) == null ? void 0 : G.refNo) + " (" + y((se = (Q = h.value) == null ? void 0 : Q.netSuite) == null ? void 0 : se.id) + ") ", 1)) : (i(), g("span", hs, "N/A"))
|
|
1312
1312
|
])
|
|
1313
|
-
])) :
|
|
1314
|
-
_.value ? (i(),
|
|
1315
|
-
|
|
1316
|
-
e("div", gs,
|
|
1317
|
-
])) :
|
|
1318
|
-
v(
|
|
1319
|
-
|
|
1320
|
-
e("div", Ss,
|
|
1321
|
-
])) :
|
|
1322
|
-
])) :
|
|
1313
|
+
])) : M("", !0),
|
|
1314
|
+
_.value ? (i(), g("div", bs, [
|
|
1315
|
+
O[1] || (O[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
|
|
1316
|
+
e("div", gs, y(_.value), 1)
|
|
1317
|
+
])) : M("", !0),
|
|
1318
|
+
v(o).isEnabled && c.transferType === v(Ke).enum.transfer && !c.isTransferBetweenOutlets ? (i(), g("div", _s, [
|
|
1319
|
+
O[2] || (O[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
1320
|
+
e("div", Ss, y(r.value), 1)
|
|
1321
|
+
])) : M("", !0)
|
|
1322
|
+
])) : M("", !0);
|
|
1323
1323
|
};
|
|
1324
1324
|
}
|
|
1325
|
-
}), Os = { class: "flex flex-row-reverse" }, ws = /* @__PURE__ */
|
|
1325
|
+
}), Os = { class: "flex flex-row-reverse" }, ws = /* @__PURE__ */ we({
|
|
1326
1326
|
__name: "NetSuiteLog",
|
|
1327
1327
|
props: {
|
|
1328
1328
|
netsuiteId: {},
|
|
1329
1329
|
purchaseOrderId: {}
|
|
1330
1330
|
},
|
|
1331
1331
|
setup(k) {
|
|
1332
|
-
const
|
|
1333
|
-
async function f(
|
|
1332
|
+
const a = Ue(), o = ut();
|
|
1333
|
+
async function f(h, n) {
|
|
1334
1334
|
const _ = [];
|
|
1335
|
-
if (
|
|
1335
|
+
if (h && _.push(`body.message:*${h}*`), n) {
|
|
1336
1336
|
const w = n.replace(/:/g, "\\:");
|
|
1337
1337
|
_.push(`${w}`);
|
|
1338
1338
|
}
|
|
1339
1339
|
if (_.length === 0) {
|
|
1340
|
-
|
|
1340
|
+
a.open({
|
|
1341
1341
|
message: "Cannot open logs without valid filters.",
|
|
1342
1342
|
type: "error"
|
|
1343
1343
|
});
|
|
1344
1344
|
return;
|
|
1345
1345
|
}
|
|
1346
|
-
const c = `attributes.pod:netsuite* AND (${_.join(" OR ")})`, { url:
|
|
1347
|
-
|
|
1346
|
+
const c = `attributes.pod:netsuite* AND (${_.join(" OR ")})`, { url: O } = await o.getSyncLogs(c);
|
|
1347
|
+
a.open(
|
|
1348
1348
|
{
|
|
1349
1349
|
message: "Opening NetSuite logs...",
|
|
1350
1350
|
type: "info"
|
|
1351
1351
|
},
|
|
1352
1352
|
800
|
|
1353
|
-
), await new Promise((w) => setTimeout(w, 800)), window.open(
|
|
1353
|
+
), await new Promise((w) => setTimeout(w, 800)), window.open(O, "_blank");
|
|
1354
1354
|
}
|
|
1355
|
-
return (
|
|
1356
|
-
const _ =
|
|
1357
|
-
return i(),
|
|
1355
|
+
return (h, n) => {
|
|
1356
|
+
const _ = K("FmButton");
|
|
1357
|
+
return i(), g("div", Os, [
|
|
1358
1358
|
N(_, {
|
|
1359
1359
|
"prepend-icon": "history",
|
|
1360
1360
|
variant: "secondary",
|
|
1361
1361
|
label: "Logs",
|
|
1362
|
-
onClick: n[0] || (n[0] = (
|
|
1362
|
+
onClick: n[0] || (n[0] = (r) => f(h.netsuiteId, h.purchaseOrderId)),
|
|
1363
1363
|
"text-color": "primary",
|
|
1364
1364
|
"bg-color": "transparent",
|
|
1365
1365
|
"border-color": "primary"
|
|
@@ -1367,62 +1367,62 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1367
1367
|
]);
|
|
1368
1368
|
};
|
|
1369
1369
|
}
|
|
1370
|
-
}), $s = { class: "flex flex-row-reverse" }, Cs = { key: 0 }, Rs = { key: 1 }, ks = { class: "mb-6" }, Ds = { class: "fm-typo-en-body-md-400" }, Ns = { key: 0 }, As = { key: 1 },
|
|
1370
|
+
}), $s = { class: "flex flex-row-reverse" }, Cs = { key: 0 }, Rs = { key: 1 }, ks = { class: "mb-6" }, Ds = { class: "fm-typo-en-body-md-400" }, Ns = { key: 0 }, As = { key: 1 }, Fs = {
|
|
1371
1371
|
key: 0,
|
|
1372
1372
|
class: "flex"
|
|
1373
|
-
},
|
|
1373
|
+
}, Ts = {
|
|
1374
1374
|
key: 1,
|
|
1375
1375
|
class: "border-t pt-6"
|
|
1376
|
-
},
|
|
1376
|
+
}, Is = { class: "fm-typo-en-body-lg-600 mb-4 flex items-center gap-2" }, Ps = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg overflow-y-auto" }, qs = { class: "w-full" }, Vs = {
|
|
1377
1377
|
class: "p-3 fm-typo-en-body-sm-600",
|
|
1378
1378
|
style: { "min-width": "130px" }
|
|
1379
|
-
},
|
|
1379
|
+
}, Es = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ls = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ms = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Us = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Bs = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, js = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, zs = { class: "p-3 fm-typo-en-body-sm-600" }, Ks = { key: 2 }, Gs = { key: 1 }, Hs = /* @__PURE__ */ we({
|
|
1380
1380
|
__name: "NetSuiteLatestInfo",
|
|
1381
1381
|
props: {
|
|
1382
1382
|
netsuiteId: {},
|
|
1383
1383
|
purchaseOrderId: {}
|
|
1384
1384
|
},
|
|
1385
1385
|
setup(k) {
|
|
1386
|
-
const
|
|
1387
|
-
async function
|
|
1388
|
-
if (!
|
|
1386
|
+
const a = k, o = ut(), f = J(!1), h = ke(), n = J(!0), _ = J(!1), r = J(!1), c = J(!1), O = J(null), w = J([]);
|
|
1387
|
+
async function d() {
|
|
1388
|
+
if (!O.value) {
|
|
1389
1389
|
f.value = !0;
|
|
1390
1390
|
try {
|
|
1391
1391
|
n.value = !0;
|
|
1392
|
-
const l = await
|
|
1393
|
-
|
|
1394
|
-
|
|
1392
|
+
const l = await o.getMoreInfo(
|
|
1393
|
+
h.currentLocation.dbName,
|
|
1394
|
+
a.purchaseOrderId
|
|
1395
1395
|
);
|
|
1396
|
-
|
|
1396
|
+
O.value = l, _.value = !1;
|
|
1397
1397
|
} catch {
|
|
1398
1398
|
_.value = !0;
|
|
1399
1399
|
} finally {
|
|
1400
1400
|
n.value = !1;
|
|
1401
1401
|
}
|
|
1402
|
-
await
|
|
1402
|
+
await I();
|
|
1403
1403
|
}
|
|
1404
1404
|
}
|
|
1405
|
-
async function
|
|
1405
|
+
async function I() {
|
|
1406
1406
|
if (!(w.value.length > 0))
|
|
1407
1407
|
try {
|
|
1408
|
-
|
|
1409
|
-
const l = await
|
|
1408
|
+
r.value = !0;
|
|
1409
|
+
const l = await o.getChangeLogs(a.netsuiteId);
|
|
1410
1410
|
w.value = l, c.value = !1;
|
|
1411
1411
|
} catch {
|
|
1412
1412
|
c.value = !0;
|
|
1413
1413
|
} finally {
|
|
1414
|
-
|
|
1414
|
+
r.value = !1;
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
1417
|
-
function
|
|
1417
|
+
function S(l) {
|
|
1418
1418
|
switch (l) {
|
|
1419
|
-
case
|
|
1419
|
+
case Oe.Create:
|
|
1420
1420
|
return "text-green-600 bg-green-100";
|
|
1421
|
-
case
|
|
1421
|
+
case Oe.Set:
|
|
1422
1422
|
return "text-blue-600 bg-blue-100";
|
|
1423
|
-
case
|
|
1423
|
+
case Oe.Change:
|
|
1424
1424
|
return "text-yellow-600 bg-yellow-100";
|
|
1425
|
-
case
|
|
1425
|
+
case Oe.Unset:
|
|
1426
1426
|
return "text-red-600 bg-red-100";
|
|
1427
1427
|
default:
|
|
1428
1428
|
return "text-gray-600 bg-gray-100";
|
|
@@ -1437,64 +1437,64 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1437
1437
|
minute: "2-digit"
|
|
1438
1438
|
});
|
|
1439
1439
|
}
|
|
1440
|
-
return (l,
|
|
1441
|
-
const
|
|
1442
|
-
return i(),
|
|
1440
|
+
return (l, s) => {
|
|
1441
|
+
const b = K("FmButton"), u = K("FmLabel"), $ = K("FmCircularProgress"), P = K("FmIcon"), B = K("FmDialog");
|
|
1442
|
+
return i(), g("div", $s, [
|
|
1443
1443
|
N(B, {
|
|
1444
1444
|
modelValue: f.value,
|
|
1445
|
-
"onUpdate:modelValue":
|
|
1445
|
+
"onUpdate:modelValue": s[2] || (s[2] = (C) => f.value = C),
|
|
1446
1446
|
overlay: !0,
|
|
1447
1447
|
"max-width": 800
|
|
1448
1448
|
}, {
|
|
1449
1449
|
"dialog-button": X(() => [
|
|
1450
|
-
N(
|
|
1450
|
+
N(b, {
|
|
1451
1451
|
"prepend-icon": "info",
|
|
1452
1452
|
variant: "secondary",
|
|
1453
1453
|
label: "Latest Info",
|
|
1454
|
-
onClick:
|
|
1454
|
+
onClick: s[0] || (s[0] = (C) => d()),
|
|
1455
1455
|
"text-color": "primary",
|
|
1456
1456
|
"bg-color": "transparent",
|
|
1457
1457
|
"border-color": "primary"
|
|
1458
1458
|
})
|
|
1459
1459
|
]),
|
|
1460
|
-
"dialog-header": X(() =>
|
|
1460
|
+
"dialog-header": X(() => s[3] || (s[3] = [
|
|
1461
1461
|
e("div", null, "NetSuite latest info", -1)
|
|
1462
1462
|
])),
|
|
1463
1463
|
default: X(() => [
|
|
1464
|
-
n.value ? (i(),
|
|
1465
|
-
_.value ? (i(),
|
|
1464
|
+
n.value ? (i(), g("div", Cs, "Loading...")) : (i(), g("div", Rs, [
|
|
1465
|
+
_.value ? (i(), g("p", Gs, "Something went wrong.")) : (i(), g(ue, { key: 0 }, [
|
|
1466
1466
|
e("div", ks, [
|
|
1467
|
-
|
|
1468
|
-
(i(!0),
|
|
1469
|
-
key:
|
|
1467
|
+
s[4] || (s[4] = e("h3", { class: "fm-typo-en-body-lg-600 mb-4" }, "NetSuite Order Details", -1)),
|
|
1468
|
+
(i(!0), g(ue, null, Se(O.value, (C, G) => (i(), g("div", {
|
|
1469
|
+
key: G,
|
|
1470
1470
|
class: "mb-2"
|
|
1471
1471
|
}, [
|
|
1472
1472
|
e("div", null, [
|
|
1473
|
-
N(
|
|
1474
|
-
label: v(
|
|
1473
|
+
N(u, {
|
|
1474
|
+
label: v(lt)(G)
|
|
1475
1475
|
}, null, 8, ["label"]),
|
|
1476
1476
|
e("div", Ds, [
|
|
1477
|
-
Array.isArray(C) ? (i(),
|
|
1477
|
+
Array.isArray(C) ? (i(), g("span", Ns, y(C.length > 0 ? C.join(", ") : "N/A"), 1)) : (i(), g("span", As, y(C), 1))
|
|
1478
1478
|
])
|
|
1479
1479
|
])
|
|
1480
1480
|
]))), 128))
|
|
1481
1481
|
]),
|
|
1482
|
-
|
|
1483
|
-
|
|
1482
|
+
r.value ? (i(), g("div", Fs, [
|
|
1483
|
+
s[5] || (s[5] = e("span", null, "Change Log Loading...", -1)),
|
|
1484
1484
|
N($, { size: "md" })
|
|
1485
|
-
])) :
|
|
1486
|
-
!
|
|
1487
|
-
e("h3",
|
|
1488
|
-
N(
|
|
1485
|
+
])) : M("", !0),
|
|
1486
|
+
!r.value && w.value.length > 0 ? (i(), g("div", Ts, [
|
|
1487
|
+
e("h3", Is, [
|
|
1488
|
+
N(P, {
|
|
1489
1489
|
name: "error",
|
|
1490
1490
|
color: "#ff9500",
|
|
1491
1491
|
size: "sm"
|
|
1492
1492
|
}),
|
|
1493
|
-
|
|
1493
|
+
s[6] || (s[6] = Re(" Change Logs "))
|
|
1494
1494
|
]),
|
|
1495
|
-
e("div",
|
|
1495
|
+
e("div", Ps, [
|
|
1496
1496
|
e("table", qs, [
|
|
1497
|
-
|
|
1497
|
+
s[7] || (s[7] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
|
|
1498
1498
|
e("tr", { class: "border-b border-fm-color-neutral-gray-200" }, [
|
|
1499
1499
|
e("th", {
|
|
1500
1500
|
class: "text-left p-3 fm-typo-en-body-md-600",
|
|
@@ -1511,38 +1511,38 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1511
1511
|
])
|
|
1512
1512
|
], -1)),
|
|
1513
1513
|
e("tbody", null, [
|
|
1514
|
-
(i(!0),
|
|
1515
|
-
key:
|
|
1514
|
+
(i(!0), g(ue, null, Se(w.value, (C, G) => (i(), g("tr", {
|
|
1515
|
+
key: G,
|
|
1516
1516
|
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
1517
1517
|
}, [
|
|
1518
|
-
e("td",
|
|
1519
|
-
e("td",
|
|
1520
|
-
e("td", Ls,
|
|
1521
|
-
e("td",
|
|
1518
|
+
e("td", Vs, y(F(C._dateiso8601)), 1),
|
|
1519
|
+
e("td", Es, y(C._rolename), 1),
|
|
1520
|
+
e("td", Ls, y(C._employeename), 1),
|
|
1521
|
+
e("td", Ms, y(C._contextname), 1),
|
|
1522
1522
|
e("td", {
|
|
1523
|
-
class: Le(`p-3 fm-typo-en-body-sm-600 ${
|
|
1524
|
-
},
|
|
1525
|
-
e("td",
|
|
1526
|
-
e("td", Bs,
|
|
1527
|
-
e("td", js,
|
|
1528
|
-
e("td", zs,
|
|
1523
|
+
class: Le(`p-3 fm-typo-en-body-sm-600 ${S(Number(C.type) - 1)}`)
|
|
1524
|
+
}, y(v(Oe)[Number(C.type) - 1]), 3),
|
|
1525
|
+
e("td", Us, y(C.lineid || ""), 1),
|
|
1526
|
+
e("td", Bs, y(C._fieldname), 1),
|
|
1527
|
+
e("td", js, y(C.oldvalue || ""), 1),
|
|
1528
|
+
e("td", zs, y(C.newvalue || ""), 1)
|
|
1529
1529
|
]))), 128))
|
|
1530
1530
|
])
|
|
1531
1531
|
])
|
|
1532
1532
|
])
|
|
1533
|
-
])) : (i(),
|
|
1533
|
+
])) : (i(), g("div", Ks, s[8] || (s[8] = [
|
|
1534
1534
|
e("p", null, "No change logs available.", -1)
|
|
1535
1535
|
])))
|
|
1536
1536
|
], 64))
|
|
1537
1537
|
]))
|
|
1538
1538
|
]),
|
|
1539
1539
|
"dialog-footer": X(() => [
|
|
1540
|
-
N(
|
|
1540
|
+
N(b, {
|
|
1541
1541
|
class: "ml-auto sm:w-full xs:w-full",
|
|
1542
1542
|
label: "Close",
|
|
1543
1543
|
size: "md",
|
|
1544
1544
|
variant: "primary",
|
|
1545
|
-
onClick:
|
|
1545
|
+
onClick: s[1] || (s[1] = (C) => f.value = !1)
|
|
1546
1546
|
})
|
|
1547
1547
|
]),
|
|
1548
1548
|
_: 1
|
|
@@ -1553,7 +1553,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1553
1553
|
}), Ws = {
|
|
1554
1554
|
key: 0,
|
|
1555
1555
|
class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16 flex flex-col gap-8"
|
|
1556
|
-
}, Qs = { class: "flex gap-8 items-center" }, Ys = { class: "ml-auto" }, Js = { class: "flex gap-3" }, Xs = /* @__PURE__ */
|
|
1556
|
+
}, Qs = { class: "flex gap-8 items-center" }, Ys = { class: "ml-auto" }, Js = { class: "flex gap-3" }, Xs = /* @__PURE__ */ we({
|
|
1557
1557
|
__name: "NetSuitePanel",
|
|
1558
1558
|
props: {
|
|
1559
1559
|
poRequest: {},
|
|
@@ -1563,64 +1563,58 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1563
1563
|
scope: {}
|
|
1564
1564
|
},
|
|
1565
1565
|
setup(k) {
|
|
1566
|
-
const
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
return n || _ && !y || ((u = (w = o.purchaseOrder) == null ? void 0 : w.netSuite) == null ? void 0 : u.id) || ((b = (T = o.poRequest) == null ? void 0 : T.netSuite) == null ? void 0 : b.id);
|
|
1572
|
-
});
|
|
1573
|
-
return (y, n) => {
|
|
1574
|
-
var s, c;
|
|
1575
|
-
const _ = z("FmMenuDivider");
|
|
1576
|
-
return v(a).isNetSuiteEnabled && f.value ? (i(), S("div", Ws, [
|
|
1566
|
+
const a = k, o = Kt(), f = Y(() => o.isNetSuiteEnabled);
|
|
1567
|
+
return (h, n) => {
|
|
1568
|
+
var r, c;
|
|
1569
|
+
const _ = K("FmMenuDivider");
|
|
1570
|
+
return f.value ? (i(), g("div", Ws, [
|
|
1577
1571
|
e("div", Qs, [
|
|
1578
1572
|
n[0] || (n[0] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
1579
1573
|
e("div", Ys, [
|
|
1580
1574
|
e("div", Js, [
|
|
1581
|
-
(c = (
|
|
1575
|
+
(c = (r = a.purchaseOrder) == null ? void 0 : r.netSuite) != null && c.id ? (i(), re(Pe, { key: 0 }, {
|
|
1582
1576
|
default: X(() => {
|
|
1583
|
-
var
|
|
1577
|
+
var O, w, d;
|
|
1584
1578
|
return [
|
|
1585
|
-
N(
|
|
1586
|
-
"netsuite-id": (w = (
|
|
1587
|
-
"purchase-order-id": (
|
|
1579
|
+
N(Hs, {
|
|
1580
|
+
"netsuite-id": (w = (O = h.purchaseOrder) == null ? void 0 : O.netSuite) == null ? void 0 : w.id,
|
|
1581
|
+
"purchase-order-id": (d = h.purchaseOrder) == null ? void 0 : d._id
|
|
1588
1582
|
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
1589
1583
|
];
|
|
1590
1584
|
}),
|
|
1591
1585
|
_: 1
|
|
1592
|
-
})) :
|
|
1586
|
+
})) : M("", !0),
|
|
1593
1587
|
N(Pe, null, {
|
|
1594
1588
|
default: X(() => {
|
|
1595
|
-
var
|
|
1589
|
+
var O, w, d;
|
|
1596
1590
|
return [
|
|
1597
1591
|
N(ws, {
|
|
1598
|
-
"netsuite-id": (w = (
|
|
1599
|
-
"purchase-order-id": (
|
|
1592
|
+
"netsuite-id": (w = (O = h.purchaseOrder) == null ? void 0 : O.netSuite) == null ? void 0 : w.id,
|
|
1593
|
+
"purchase-order-id": (d = h.purchaseOrder) == null ? void 0 : d._id
|
|
1600
1594
|
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
1601
1595
|
];
|
|
1602
1596
|
}),
|
|
1603
1597
|
_: 1
|
|
1604
1598
|
}),
|
|
1605
1599
|
N(os, {
|
|
1606
|
-
"po-request":
|
|
1607
|
-
"purchase-order":
|
|
1600
|
+
"po-request": h.poRequest,
|
|
1601
|
+
"purchase-order": h.purchaseOrder,
|
|
1608
1602
|
"is-transfer-between-outlets": !f.value,
|
|
1609
|
-
scope:
|
|
1603
|
+
scope: h.scope
|
|
1610
1604
|
}, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets", "scope"])
|
|
1611
1605
|
])
|
|
1612
1606
|
])
|
|
1613
1607
|
]),
|
|
1614
1608
|
N(_),
|
|
1615
1609
|
N(xs, {
|
|
1616
|
-
"po-request":
|
|
1617
|
-
"purchase-order":
|
|
1618
|
-
"transfer-type":
|
|
1619
|
-
"transfer-to-db-name":
|
|
1610
|
+
"po-request": h.poRequest,
|
|
1611
|
+
"purchase-order": h.purchaseOrder,
|
|
1612
|
+
"transfer-type": h.transferType,
|
|
1613
|
+
"transfer-to-db-name": h.transferToDbName,
|
|
1620
1614
|
"is-transfer-between-outlets": !f.value,
|
|
1621
|
-
scope:
|
|
1615
|
+
scope: h.scope
|
|
1622
1616
|
}, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
|
|
1623
|
-
])) :
|
|
1617
|
+
])) : M("", !0);
|
|
1624
1618
|
};
|
|
1625
1619
|
}
|
|
1626
1620
|
}), Zs = { class: "flex flex-col gap-3" }, er = { class: "flex flex-col gap-4" }, tr = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, sr = { class: "flex flex-col gap-4" }, rr = { class: "flex justify-between items-center py-1 gap-4" }, or = { class: "flex flex-col" }, nr = { class: "fm-typo-en-body-lg-600" }, ar = { class: "fm-typo-en-body-md-400" }, lr = { class: "flex flex-col gap-2 items-end" }, ir = { class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, cr = {
|
|
@@ -1632,65 +1626,65 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1632
1626
|
}, dr = { class: "flex flex-col gap-4" }, mr = { class: "flex flex-col gap-4" }, pr = { class: "flex flex-col gap-4" }, fr = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, yr = {
|
|
1633
1627
|
key: 0,
|
|
1634
1628
|
class: "flex flex-col gap-4"
|
|
1635
|
-
}, vr = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, hr = /* @__PURE__ */
|
|
1629
|
+
}, vr = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, hr = /* @__PURE__ */ we({
|
|
1636
1630
|
__name: "EditForm",
|
|
1637
1631
|
props: {
|
|
1638
1632
|
purchaseOrder: {},
|
|
1639
1633
|
deliveryOrder: {}
|
|
1640
1634
|
},
|
|
1641
1635
|
emits: ["submitted"],
|
|
1642
|
-
setup(k, { emit:
|
|
1643
|
-
|
|
1644
|
-
const
|
|
1636
|
+
setup(k, { emit: a }) {
|
|
1637
|
+
Ht();
|
|
1638
|
+
const o = Me(), f = Ue(), h = J(!1), n = k, _ = a, r = _t("deliveryOrder"), c = Be(), O = Y(
|
|
1645
1639
|
() => {
|
|
1646
|
-
var
|
|
1647
|
-
return ((
|
|
1648
|
-
(
|
|
1640
|
+
var b;
|
|
1641
|
+
return ((b = n.purchaseOrder.deliveryFullfillment) == null ? void 0 : b.findIndex(
|
|
1642
|
+
(u) => n.deliveryOrder.fullfillmentId && u.id === n.deliveryOrder.fullfillmentId
|
|
1649
1643
|
)) ?? -1;
|
|
1650
1644
|
}
|
|
1651
|
-
), w =
|
|
1645
|
+
), w = o.enablePurchaseOrderReceiveWithCustomCost, d = o.enablePortalDeliveryOrderWrite, I = J({}), S = Y(() => n.purchaseOrder.items.map((b, u) => Y({
|
|
1652
1646
|
get: () => {
|
|
1653
|
-
var
|
|
1654
|
-
const $ = (
|
|
1655
|
-
return $ ? +
|
|
1647
|
+
var P;
|
|
1648
|
+
const $ = (P = r.received[u]) == null ? void 0 : P.cost;
|
|
1649
|
+
return $ ? +he($) : 0;
|
|
1656
1650
|
},
|
|
1657
1651
|
set: ($) => {
|
|
1658
|
-
|
|
1659
|
-
currency:
|
|
1652
|
+
r.received[u].cost = {
|
|
1653
|
+
currency: $e(),
|
|
1660
1654
|
...Qe($, 4)
|
|
1661
1655
|
};
|
|
1662
1656
|
}
|
|
1663
|
-
}))), F = Y(() => n.deliveryOrder.received.map((
|
|
1657
|
+
}))), F = Y(() => n.deliveryOrder.received.map((b, u) => Y({
|
|
1664
1658
|
get: () => {
|
|
1665
|
-
var
|
|
1666
|
-
const $ = (
|
|
1667
|
-
return $ ? +
|
|
1659
|
+
var P;
|
|
1660
|
+
const $ = (P = r.received[u]) == null ? void 0 : P.amount;
|
|
1661
|
+
return $ ? +he($) : 0;
|
|
1668
1662
|
},
|
|
1669
1663
|
set: ($) => {
|
|
1670
|
-
|
|
1664
|
+
r.received[u].amount = Qe($, 2);
|
|
1671
1665
|
}
|
|
1672
1666
|
})));
|
|
1673
|
-
function l(
|
|
1674
|
-
const
|
|
1675
|
-
if (
|
|
1676
|
-
const $ = n.deliveryOrder.received[
|
|
1677
|
-
$.cost ?
|
|
1667
|
+
function l(b) {
|
|
1668
|
+
const u = !I.value[b];
|
|
1669
|
+
if (I.value[b] = u, u) {
|
|
1670
|
+
const $ = n.deliveryOrder.received[b];
|
|
1671
|
+
$.cost ? r.received[b].cost = {
|
|
1678
1672
|
currency: $.cost.currency,
|
|
1679
1673
|
amount: $.cost.amount,
|
|
1680
1674
|
precision: $.cost.precision
|
|
1681
|
-
} :
|
|
1682
|
-
currency:
|
|
1675
|
+
} : r.received[b].cost = {
|
|
1676
|
+
currency: $e(),
|
|
1683
1677
|
amount: 0,
|
|
1684
1678
|
precision: 4
|
|
1685
1679
|
};
|
|
1686
1680
|
} else
|
|
1687
|
-
delete
|
|
1681
|
+
delete r.received[b].cost;
|
|
1688
1682
|
}
|
|
1689
|
-
function
|
|
1683
|
+
function s() {
|
|
1690
1684
|
c.updateDeliveryOrder({
|
|
1691
1685
|
deliveryOrder: {
|
|
1692
1686
|
...n.deliveryOrder,
|
|
1693
|
-
...
|
|
1687
|
+
...r
|
|
1694
1688
|
},
|
|
1695
1689
|
purchaseOrderId: n.purchaseOrder._id,
|
|
1696
1690
|
purchaseOrderRev: n.purchaseOrder._rev
|
|
@@ -1702,27 +1696,27 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1702
1696
|
type: "success"
|
|
1703
1697
|
},
|
|
1704
1698
|
1e4
|
|
1705
|
-
),
|
|
1699
|
+
), h.value = !1, _("submitted");
|
|
1706
1700
|
});
|
|
1707
1701
|
}
|
|
1708
|
-
return (
|
|
1709
|
-
const $ =
|
|
1710
|
-
return i(), re(
|
|
1711
|
-
modelValue:
|
|
1712
|
-
"onUpdate:modelValue":
|
|
1702
|
+
return (b, u) => {
|
|
1703
|
+
const $ = K("FmButton"), P = K("FmStepperField"), B = K("FmSwitch"), C = K("FmTextField"), G = K("FmDialog");
|
|
1704
|
+
return i(), re(G, {
|
|
1705
|
+
modelValue: h.value,
|
|
1706
|
+
"onUpdate:modelValue": u[1] || (u[1] = (Q) => h.value = Q),
|
|
1713
1707
|
overlay: !0
|
|
1714
1708
|
}, {
|
|
1715
1709
|
"dialog-button": X(() => [
|
|
1716
|
-
v(
|
|
1710
|
+
v(d) ? (i(), re($, {
|
|
1717
1711
|
key: 0,
|
|
1718
1712
|
variant: "plain",
|
|
1719
1713
|
label: "Edit",
|
|
1720
1714
|
size: "md",
|
|
1721
1715
|
"prepend-icon": "edit"
|
|
1722
|
-
})) :
|
|
1716
|
+
})) : M("", !0)
|
|
1723
1717
|
]),
|
|
1724
1718
|
"dialog-header": X(() => [
|
|
1725
|
-
e("div", null, "Received on " +
|
|
1719
|
+
e("div", null, "Received on " + y(v(Ge)(n.deliveryOrder.createdAt)), 1)
|
|
1726
1720
|
]),
|
|
1727
1721
|
"dialog-footer": X(() => [
|
|
1728
1722
|
N($, {
|
|
@@ -1730,79 +1724,79 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1730
1724
|
label: "Apply changes",
|
|
1731
1725
|
size: "md",
|
|
1732
1726
|
variant: "destructive",
|
|
1733
|
-
onClick:
|
|
1727
|
+
onClick: s
|
|
1734
1728
|
})
|
|
1735
1729
|
]),
|
|
1736
1730
|
default: X(() => [
|
|
1737
1731
|
e("div", null, [
|
|
1738
1732
|
e("div", Zs, [
|
|
1739
1733
|
e("div", er, [
|
|
1740
|
-
|
|
1741
|
-
e("div", tr,
|
|
1734
|
+
u[2] || (u[2] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Adjustment date", -1)),
|
|
1735
|
+
e("div", tr, y(n.deliveryOrder.adjustment ? v(Ge)(new Date(v(We)(n.deliveryOrder.adjustment))) : "-"), 1)
|
|
1742
1736
|
]),
|
|
1743
1737
|
e("div", sr, [
|
|
1744
|
-
|
|
1745
|
-
(i(!0),
|
|
1746
|
-
var
|
|
1747
|
-
return i(),
|
|
1738
|
+
u[4] || (u[4] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received items", -1)),
|
|
1739
|
+
(i(!0), g(ue, null, Se(n.deliveryOrder.received, (Q, se) => {
|
|
1740
|
+
var fe;
|
|
1741
|
+
return i(), g("div", { key: se }, [
|
|
1748
1742
|
e("div", rr, [
|
|
1749
1743
|
e("div", or, [
|
|
1750
|
-
e("span", nr,
|
|
1751
|
-
e("span", ar,
|
|
1744
|
+
e("span", nr, y(Q.sku.name), 1),
|
|
1745
|
+
e("span", ar, y(Q.sku.code), 1)
|
|
1752
1746
|
]),
|
|
1753
1747
|
e("div", lr, [
|
|
1754
|
-
N(
|
|
1748
|
+
N(P, {
|
|
1755
1749
|
label: "Receive Quantity",
|
|
1756
1750
|
modelValue: F.value[se].value,
|
|
1757
|
-
"onUpdate:modelValue": (
|
|
1751
|
+
"onUpdate:modelValue": (ye) => F.value[se].value = ye,
|
|
1758
1752
|
min: 0,
|
|
1759
|
-
"append-text": ((
|
|
1753
|
+
"append-text": ((fe = Q.measurement) == null ? void 0 : fe.abbrev) ?? Q.sku.unit.abbrev
|
|
1760
1754
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"]),
|
|
1761
|
-
e("div", ir,
|
|
1762
|
-
v(w) ? (i(),
|
|
1755
|
+
e("div", ir, y(`${Q.cost ? `${v(ze)(Q.cost)}` : ""}`), 1),
|
|
1756
|
+
v(w) ? (i(), g("div", cr, [
|
|
1763
1757
|
N(B, {
|
|
1764
|
-
"model-value":
|
|
1765
|
-
"onUpdate:modelValue": (
|
|
1758
|
+
"model-value": I.value[se],
|
|
1759
|
+
"onUpdate:modelValue": (ye) => l(se),
|
|
1766
1760
|
size: "sm"
|
|
1767
1761
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
1768
|
-
|
|
1769
|
-
])) :
|
|
1770
|
-
v(w) &&
|
|
1762
|
+
u[3] || (u[3] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
1763
|
+
])) : M("", !0),
|
|
1764
|
+
v(w) && I.value[se] ? (i(), re(P, {
|
|
1771
1765
|
key: 1,
|
|
1772
|
-
modelValue:
|
|
1773
|
-
"onUpdate:modelValue": (
|
|
1766
|
+
modelValue: S.value[se].value,
|
|
1767
|
+
"onUpdate:modelValue": (ye) => S.value[se].value = ye,
|
|
1774
1768
|
label: "Total Cost",
|
|
1775
1769
|
step: 1e-4,
|
|
1776
1770
|
min: 0,
|
|
1777
1771
|
placeholder: "0.0000",
|
|
1778
1772
|
size: "sm",
|
|
1779
|
-
"append-text": v(
|
|
1780
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) :
|
|
1773
|
+
"append-text": v($e)()
|
|
1774
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : M("", !0)
|
|
1781
1775
|
])
|
|
1782
1776
|
]),
|
|
1783
|
-
se < n.purchaseOrder.items.length - 1 ? (i(),
|
|
1777
|
+
se < n.purchaseOrder.items.length - 1 ? (i(), g("div", ur)) : M("", !0)
|
|
1784
1778
|
]);
|
|
1785
1779
|
}), 128))
|
|
1786
1780
|
]),
|
|
1787
1781
|
e("div", dr, [
|
|
1788
|
-
|
|
1782
|
+
u[5] || (u[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
|
|
1789
1783
|
e("div", mr, [
|
|
1790
1784
|
N(C, {
|
|
1791
|
-
modelValue: v(
|
|
1792
|
-
"onUpdate:modelValue":
|
|
1785
|
+
modelValue: v(r).deliveryOrderNumber,
|
|
1786
|
+
"onUpdate:modelValue": u[0] || (u[0] = (Q) => v(r).deliveryOrderNumber = Q),
|
|
1793
1787
|
size: "md",
|
|
1794
1788
|
placeholder: n.deliveryOrder.deliveryOrderNumber
|
|
1795
1789
|
}, null, 8, ["modelValue", "placeholder"])
|
|
1796
1790
|
])
|
|
1797
1791
|
]),
|
|
1798
1792
|
e("div", pr, [
|
|
1799
|
-
|
|
1800
|
-
e("div", fr,
|
|
1793
|
+
u[6] || (u[6] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
|
|
1794
|
+
e("div", fr, y(n.deliveryOrder.remark || "N/A"), 1)
|
|
1801
1795
|
]),
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
e("div", vr,
|
|
1805
|
-
])) :
|
|
1796
|
+
O.value >= 0 ? (i(), g("div", yr, [
|
|
1797
|
+
u[7] || (u[7] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fulfilment's sequence ", -1)),
|
|
1798
|
+
e("div", vr, y(O.value + 1), 1)
|
|
1799
|
+
])) : M("", !0)
|
|
1806
1800
|
])
|
|
1807
1801
|
])
|
|
1808
1802
|
]),
|
|
@@ -1819,124 +1813,124 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1819
1813
|
}, $r = { class: "flex gap-4" }, Cr = { class: "flex-1" }, Rr = { class: "flex-1" }, kr = {
|
|
1820
1814
|
key: 0,
|
|
1821
1815
|
class: "flex items-center text-fm-color-system-error-300"
|
|
1822
|
-
}, Dr = { class: "fm-typo-en-body-md-400" }, Nr = { class: "flex flex-col gap-4" }, Ar = { class: "flex justify-between items-center py-1 gap-4" },
|
|
1816
|
+
}, Dr = { class: "fm-typo-en-body-md-400" }, Nr = { class: "flex flex-col gap-4" }, Ar = { class: "flex justify-between items-center py-1 gap-4" }, Fr = { class: "flex flex-col" }, Tr = { class: "fm-typo-en-body-lg-600" }, Ir = { class: "fm-typo-en-body-md-400" }, Pr = { class: "flex flex-col gap-2 items-end" }, qr = {
|
|
1823
1817
|
key: 0,
|
|
1824
1818
|
class: "flex items-center gap-2"
|
|
1825
|
-
},
|
|
1819
|
+
}, Vr = {
|
|
1826
1820
|
key: 0,
|
|
1827
1821
|
class: "border-b border-fm-color-stroke-secondary"
|
|
1828
|
-
},
|
|
1822
|
+
}, Er = { class: "flex flex-col gap-4" }, Lr = { class: "flex flex-col gap-4" }, Mr = { class: "flex flex-col gap-4" }, Ur = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, Br = /* @__PURE__ */ we({
|
|
1829
1823
|
__name: "CreateForm",
|
|
1830
1824
|
props: {
|
|
1831
1825
|
purchaseOrder: {},
|
|
1832
1826
|
receivedInfoMap: {}
|
|
1833
1827
|
},
|
|
1834
1828
|
emits: ["submitted"],
|
|
1835
|
-
setup(k, { emit:
|
|
1836
|
-
var q,
|
|
1837
|
-
const { t:
|
|
1829
|
+
setup(k, { emit: a }) {
|
|
1830
|
+
var q, U, ae;
|
|
1831
|
+
const { t: o } = ct(), f = J(!1), h = it(), n = k, _ = a, r = _t("", {
|
|
1838
1832
|
default: {
|
|
1839
1833
|
deliveryOrderNumber: "",
|
|
1840
1834
|
remark: "",
|
|
1841
1835
|
received: n.purchaseOrder.items.map((D) => ({
|
|
1842
1836
|
sku: D.sku,
|
|
1843
|
-
amount:
|
|
1837
|
+
amount: Ie.fromNumber(0),
|
|
1844
1838
|
measurement: D.measurement
|
|
1845
1839
|
})),
|
|
1846
1840
|
createdBy: {
|
|
1847
|
-
id: ((q =
|
|
1848
|
-
name: ((
|
|
1841
|
+
id: ((q = h.sessionUser.value) == null ? void 0 : q.id) || "",
|
|
1842
|
+
name: ((U = h.sessionUser.value) == null ? void 0 : U.displayName) || ""
|
|
1849
1843
|
},
|
|
1850
1844
|
createdAt: ""
|
|
1851
1845
|
}
|
|
1852
|
-
}), c = Be(),
|
|
1846
|
+
}), c = Be(), O = et(), w = Me(), d = ((ae = n.purchaseOrder) == null ? void 0 : ae.supplier.internal) != null, I = d && w.enablePOSTransferRequireFulfillment, S = w.enablePortalDeliveryOrderWrite && (n.purchaseOrder.status === ee.Enum.RECEIVING || n.purchaseOrder.status === ee.Enum.COMPLETE) && (d ? !I : !0), F = w.enablePurchaseOrderReceiveWithCustomCost, l = w.enableBackdateReceive, s = J({}), b = Ue(), u = Y({
|
|
1853
1847
|
get() {
|
|
1854
|
-
if (!
|
|
1855
|
-
const D = new Date(
|
|
1856
|
-
return `${
|
|
1848
|
+
if (!r.createdAt) return "";
|
|
1849
|
+
const D = new Date(r.createdAt), x = D.getFullYear(), T = String(D.getMonth() + 1).padStart(2, "0"), j = String(D.getDate()).padStart(2, "0");
|
|
1850
|
+
return `${x}-${T}-${j}`;
|
|
1857
1851
|
},
|
|
1858
1852
|
set(D) {
|
|
1859
1853
|
if (D) {
|
|
1860
|
-
const
|
|
1861
|
-
|
|
1854
|
+
const x = r.createdAt ? new Date(r.createdAt) : /* @__PURE__ */ new Date(), [T, j, t] = D.split("-");
|
|
1855
|
+
x.setFullYear(parseInt(T)), x.setMonth(parseInt(j) - 1), x.setDate(parseInt(t)), r.createdAt = x.toISOString();
|
|
1862
1856
|
}
|
|
1863
1857
|
}
|
|
1864
1858
|
}), $ = Y({
|
|
1865
1859
|
get() {
|
|
1866
|
-
if (!
|
|
1867
|
-
const D = new Date(
|
|
1868
|
-
return `${
|
|
1860
|
+
if (!r.createdAt) return "";
|
|
1861
|
+
const D = new Date(r.createdAt), x = String(D.getHours()).padStart(2, "0"), T = String(D.getMinutes()).padStart(2, "0");
|
|
1862
|
+
return `${x}:${T}`;
|
|
1869
1863
|
},
|
|
1870
1864
|
set(D) {
|
|
1871
1865
|
if (D) {
|
|
1872
|
-
const
|
|
1873
|
-
|
|
1866
|
+
const x = r.createdAt ? new Date(r.createdAt) : /* @__PURE__ */ new Date(), [T, j] = D.split(":");
|
|
1867
|
+
x.setHours(parseInt(T)), x.setMinutes(parseInt(j)), r.createdAt = x.toISOString();
|
|
1874
1868
|
}
|
|
1875
1869
|
}
|
|
1876
|
-
}),
|
|
1870
|
+
}), P = Y(() => {
|
|
1877
1871
|
const D = We(n.purchaseOrder._id);
|
|
1878
1872
|
if (!D) return "";
|
|
1879
|
-
const
|
|
1880
|
-
return `${
|
|
1873
|
+
const x = new Date(D), T = x.getFullYear(), j = String(x.getMonth() + 1).padStart(2, "0"), t = String(x.getDate()).padStart(2, "0");
|
|
1874
|
+
return `${T}-${j}-${t}`;
|
|
1881
1875
|
}), B = Y(() => {
|
|
1882
1876
|
const D = We(n.purchaseOrder._id);
|
|
1883
1877
|
return D ? new Date(D) : null;
|
|
1884
1878
|
}), C = Y(() => {
|
|
1885
|
-
if (!
|
|
1886
|
-
if (/* @__PURE__ */ new Date(`${
|
|
1887
|
-
const
|
|
1888
|
-
return `Delivery date & time cannot be earlier than order creation (${
|
|
1879
|
+
if (!u.value || !$.value || !B.value) return null;
|
|
1880
|
+
if (/* @__PURE__ */ new Date(`${u.value}T${$.value}:00`) < B.value) {
|
|
1881
|
+
const x = P.value, T = B.value.getHours(), j = B.value.getMinutes(), t = T >= 12 ? "PM" : "AM", p = T % 12 || 12, A = `${String(p).padStart(2, "0")}:${String(j).padStart(2, "0")} ${t}`;
|
|
1882
|
+
return `Delivery date & time cannot be earlier than order creation (${x} ${A})`;
|
|
1889
1883
|
}
|
|
1890
1884
|
return null;
|
|
1891
|
-
}),
|
|
1892
|
-
const
|
|
1893
|
-
return
|
|
1885
|
+
}), G = Y(() => C.value ? !1 : r.received.some((x) => {
|
|
1886
|
+
const T = x.amount;
|
|
1887
|
+
return T ? +he(T) > 0 : !1;
|
|
1894
1888
|
}));
|
|
1895
1889
|
function Q() {
|
|
1896
|
-
|
|
1890
|
+
r.createdAt = "";
|
|
1897
1891
|
}
|
|
1898
|
-
const se = Y(() => n.purchaseOrder.items.map((D,
|
|
1892
|
+
const se = Y(() => n.purchaseOrder.items.map((D, x) => Y({
|
|
1899
1893
|
get: () => {
|
|
1900
1894
|
var j;
|
|
1901
|
-
const
|
|
1902
|
-
return
|
|
1895
|
+
const T = (j = r.received[x]) == null ? void 0 : j.amount;
|
|
1896
|
+
return T ? +he(T) : 0;
|
|
1903
1897
|
},
|
|
1904
|
-
set: (
|
|
1905
|
-
|
|
1898
|
+
set: (T) => {
|
|
1899
|
+
r.received[x].amount = Qe(T, 2);
|
|
1906
1900
|
}
|
|
1907
1901
|
})));
|
|
1908
|
-
function
|
|
1909
|
-
const
|
|
1910
|
-
if (
|
|
1911
|
-
const
|
|
1912
|
-
|
|
1913
|
-
currency:
|
|
1914
|
-
amount:
|
|
1902
|
+
function fe(D) {
|
|
1903
|
+
const x = !s.value[D];
|
|
1904
|
+
if (s.value[D] = x, x) {
|
|
1905
|
+
const T = n.purchaseOrder.items[D];
|
|
1906
|
+
T.totalCost ? r.received[D].cost = {
|
|
1907
|
+
currency: T.totalCost.currency,
|
|
1908
|
+
amount: T.totalCost.amount,
|
|
1915
1909
|
precision: 4
|
|
1916
1910
|
// Standardize to 4 decimals
|
|
1917
|
-
} :
|
|
1918
|
-
currency:
|
|
1911
|
+
} : r.received[D].cost = {
|
|
1912
|
+
currency: $e(),
|
|
1919
1913
|
amount: 0,
|
|
1920
1914
|
precision: 4
|
|
1921
1915
|
};
|
|
1922
1916
|
} else
|
|
1923
|
-
delete
|
|
1917
|
+
delete r.received[D].cost;
|
|
1924
1918
|
}
|
|
1925
|
-
const
|
|
1919
|
+
const ye = Y(() => n.purchaseOrder.items.map((D, x) => Y({
|
|
1926
1920
|
get: () => {
|
|
1927
1921
|
var j;
|
|
1928
|
-
const
|
|
1929
|
-
return
|
|
1922
|
+
const T = (j = r.received[x]) == null ? void 0 : j.cost;
|
|
1923
|
+
return T ? +he(T) : 0;
|
|
1930
1924
|
},
|
|
1931
|
-
set: (
|
|
1932
|
-
|
|
1933
|
-
currency:
|
|
1934
|
-
...Qe(
|
|
1925
|
+
set: (T) => {
|
|
1926
|
+
r.received[x].cost = {
|
|
1927
|
+
currency: $e(),
|
|
1928
|
+
...Qe(T, 4)
|
|
1935
1929
|
};
|
|
1936
1930
|
}
|
|
1937
1931
|
})));
|
|
1938
|
-
function
|
|
1939
|
-
|
|
1932
|
+
function De() {
|
|
1933
|
+
O.open({
|
|
1940
1934
|
title: "Confirm Create Delivery Order",
|
|
1941
1935
|
message: `Are you sure you want to create delivery order for PO# ${n.purchaseOrder.seqNumber}?`,
|
|
1942
1936
|
primaryActions: {
|
|
@@ -1952,12 +1946,12 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1952
1946
|
}
|
|
1953
1947
|
function qe() {
|
|
1954
1948
|
c.createDeliveryOrder({
|
|
1955
|
-
deliveryOrder:
|
|
1949
|
+
deliveryOrder: r,
|
|
1956
1950
|
purchaseOrderId: n.purchaseOrder._id,
|
|
1957
1951
|
purchaseOrderRev: n.purchaseOrder._rev,
|
|
1958
|
-
currency:
|
|
1952
|
+
currency: $e()
|
|
1959
1953
|
}).then(() => {
|
|
1960
|
-
|
|
1954
|
+
b.open(
|
|
1961
1955
|
{
|
|
1962
1956
|
title: "Success",
|
|
1963
1957
|
message: `New delivery order created for PO# ${n.purchaseOrder.seqNumber}`,
|
|
@@ -1967,35 +1961,35 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
1967
1961
|
), f.value = !1, _("submitted");
|
|
1968
1962
|
});
|
|
1969
1963
|
}
|
|
1970
|
-
return (D,
|
|
1971
|
-
const
|
|
1964
|
+
return (D, x) => {
|
|
1965
|
+
const T = K("FmButton"), j = K("FmDatePicker"), t = K("FmTimePicker"), p = K("FmIcon"), A = K("FmStepperField"), R = K("FmSwitch"), H = K("FmTextField"), W = K("FmDialog");
|
|
1972
1966
|
return i(), re(W, {
|
|
1973
1967
|
modelValue: f.value,
|
|
1974
|
-
"onUpdate:modelValue":
|
|
1968
|
+
"onUpdate:modelValue": x[4] || (x[4] = (te) => f.value = te),
|
|
1975
1969
|
overlay: !0,
|
|
1976
1970
|
"min-width": 800
|
|
1977
1971
|
}, {
|
|
1978
1972
|
"dialog-button": X(() => [
|
|
1979
|
-
v(
|
|
1973
|
+
v(S) ? (i(), re(T, {
|
|
1980
1974
|
key: 0,
|
|
1981
1975
|
variant: "primary",
|
|
1982
1976
|
label: "Create",
|
|
1983
1977
|
size: "md",
|
|
1984
1978
|
"prepend-icon": "add",
|
|
1985
1979
|
class: "w-full"
|
|
1986
|
-
})) :
|
|
1980
|
+
})) : M("", !0)
|
|
1987
1981
|
]),
|
|
1988
1982
|
"dialog-header": X(() => [
|
|
1989
|
-
e("div", null, "Order #" +
|
|
1983
|
+
e("div", null, "Order #" + y(n.purchaseOrder.seqNumber) + " (New Delivery Order)", 1)
|
|
1990
1984
|
]),
|
|
1991
1985
|
"dialog-footer": X(() => [
|
|
1992
|
-
N(
|
|
1986
|
+
N(T, {
|
|
1993
1987
|
class: "ml-auto",
|
|
1994
1988
|
label: "Create",
|
|
1995
1989
|
size: "md",
|
|
1996
1990
|
variant: "destructive",
|
|
1997
|
-
disabled: !
|
|
1998
|
-
onClick:
|
|
1991
|
+
disabled: !G.value,
|
|
1992
|
+
onClick: De
|
|
1999
1993
|
}, null, 8, ["disabled"])
|
|
2000
1994
|
]),
|
|
2001
1995
|
default: X(() => {
|
|
@@ -2003,62 +1997,62 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2003
1997
|
return [
|
|
2004
1998
|
e("div", br, [
|
|
2005
1999
|
e("div", gr, [
|
|
2006
|
-
|
|
2007
|
-
e("div", _r,
|
|
2000
|
+
x[5] || (x[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received by", -1)),
|
|
2001
|
+
e("div", _r, y((te = v(h).sessionUser.value) == null ? void 0 : te.displayName), 1)
|
|
2008
2002
|
]),
|
|
2009
|
-
v(l) ? (i(),
|
|
2003
|
+
v(l) ? (i(), g("div", Sr, [
|
|
2010
2004
|
e("div", xr, [
|
|
2011
2005
|
e("div", Or, [
|
|
2012
|
-
|
|
2013
|
-
!
|
|
2006
|
+
x[6] || (x[6] = Re(" Delivery Date & Time ")),
|
|
2007
|
+
!u.value && !$.value ? (i(), g("div", wr, " Leave blank to use current date & time ")) : M("", !0)
|
|
2014
2008
|
]),
|
|
2015
|
-
|
|
2009
|
+
u.value || $.value ? (i(), re(T, {
|
|
2016
2010
|
key: 0,
|
|
2017
2011
|
variant: "tertiary",
|
|
2018
2012
|
label: "Clear",
|
|
2019
2013
|
"prepend-icon": "close",
|
|
2020
2014
|
onClick: Q
|
|
2021
|
-
})) :
|
|
2015
|
+
})) : M("", !0)
|
|
2022
2016
|
]),
|
|
2023
2017
|
e("div", $r, [
|
|
2024
2018
|
e("div", Cr, [
|
|
2025
2019
|
N(j, {
|
|
2026
|
-
modelValue:
|
|
2027
|
-
"onUpdate:modelValue":
|
|
2020
|
+
modelValue: u.value,
|
|
2021
|
+
"onUpdate:modelValue": x[0] || (x[0] = (m) => u.value = m)
|
|
2028
2022
|
}, null, 8, ["modelValue"])
|
|
2029
2023
|
]),
|
|
2030
2024
|
e("div", Rr, [
|
|
2031
2025
|
N(t, {
|
|
2032
2026
|
modelValue: $.value,
|
|
2033
|
-
"onUpdate:modelValue":
|
|
2027
|
+
"onUpdate:modelValue": x[1] || (x[1] = (m) => $.value = m)
|
|
2034
2028
|
}, null, 8, ["modelValue"])
|
|
2035
2029
|
])
|
|
2036
2030
|
]),
|
|
2037
|
-
C.value ? (i(),
|
|
2031
|
+
C.value ? (i(), g("div", kr, [
|
|
2038
2032
|
N(p, {
|
|
2039
2033
|
name: "error",
|
|
2040
2034
|
class: "inline-block mr-1",
|
|
2041
2035
|
size: "sm"
|
|
2042
2036
|
}),
|
|
2043
|
-
e("div", Dr,
|
|
2044
|
-
])) :
|
|
2045
|
-
])) :
|
|
2037
|
+
e("div", Dr, y(C.value), 1)
|
|
2038
|
+
])) : M("", !0)
|
|
2039
|
+
])) : M("", !0),
|
|
2046
2040
|
e("div", Nr, [
|
|
2047
|
-
|
|
2048
|
-
(i(!0),
|
|
2041
|
+
x[8] || (x[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
|
|
2042
|
+
(i(!0), g(ue, null, Se(n.purchaseOrder.items, (m, z) => {
|
|
2049
2043
|
var le, oe, L;
|
|
2050
|
-
return i(),
|
|
2044
|
+
return i(), g("div", { key: z }, [
|
|
2051
2045
|
e("div", Ar, [
|
|
2052
|
-
e("div",
|
|
2053
|
-
e("span",
|
|
2054
|
-
e("span",
|
|
2046
|
+
e("div", Fr, [
|
|
2047
|
+
e("span", Tr, y(m.sku.name), 1),
|
|
2048
|
+
e("span", Ir, y(m.sku.code), 1)
|
|
2055
2049
|
]),
|
|
2056
|
-
e("div",
|
|
2050
|
+
e("div", Pr, [
|
|
2057
2051
|
N(A, {
|
|
2058
2052
|
label: "Receive Quantity",
|
|
2059
|
-
modelValue: se.value[
|
|
2060
|
-
"onUpdate:modelValue": (ne) => se.value[
|
|
2061
|
-
"helper-text": `${v(
|
|
2053
|
+
modelValue: se.value[z].value,
|
|
2054
|
+
"onUpdate:modelValue": (ne) => se.value[z].value = ne,
|
|
2055
|
+
"helper-text": `${v(o)("inventory.transfer.receiveRequest.details.received")} ${v(Ie).toFormatString(
|
|
2062
2056
|
{
|
|
2063
2057
|
value: (le = D.receivedInfoMap[m.sku._id]) == null ? void 0 : le.received
|
|
2064
2058
|
}
|
|
@@ -2066,47 +2060,47 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2066
2060
|
min: 0,
|
|
2067
2061
|
"append-text": ((L = m.measurement) == null ? void 0 : L.abbrev) ?? m.sku.unit.abbrev
|
|
2068
2062
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "helper-text", "append-text"]),
|
|
2069
|
-
v(F) ? (i(),
|
|
2063
|
+
v(F) ? (i(), g("div", qr, [
|
|
2070
2064
|
N(R, {
|
|
2071
|
-
"model-value":
|
|
2072
|
-
"onUpdate:modelValue": (ne) =>
|
|
2065
|
+
"model-value": s.value[z],
|
|
2066
|
+
"onUpdate:modelValue": (ne) => fe(z),
|
|
2073
2067
|
size: "sm"
|
|
2074
2068
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2075
|
-
|
|
2076
|
-
])) :
|
|
2077
|
-
v(F) &&
|
|
2069
|
+
x[7] || (x[7] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
2070
|
+
])) : M("", !0),
|
|
2071
|
+
v(F) && s.value[z] ? (i(), re(A, {
|
|
2078
2072
|
key: 1,
|
|
2079
|
-
modelValue:
|
|
2080
|
-
"onUpdate:modelValue": (ne) =>
|
|
2073
|
+
modelValue: ye.value[z].value,
|
|
2074
|
+
"onUpdate:modelValue": (ne) => ye.value[z].value = ne,
|
|
2081
2075
|
label: "Total Cost",
|
|
2082
2076
|
step: 1e-4,
|
|
2083
2077
|
min: 0,
|
|
2084
2078
|
placeholder: "0.0000",
|
|
2085
2079
|
size: "sm",
|
|
2086
|
-
"append-text": v(
|
|
2087
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) :
|
|
2080
|
+
"append-text": v($e)()
|
|
2081
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : M("", !0)
|
|
2088
2082
|
])
|
|
2089
2083
|
]),
|
|
2090
|
-
|
|
2084
|
+
z < n.purchaseOrder.items.length - 1 ? (i(), g("div", Vr)) : M("", !0)
|
|
2091
2085
|
]);
|
|
2092
2086
|
}), 128))
|
|
2093
2087
|
]),
|
|
2094
|
-
e("div",
|
|
2095
|
-
|
|
2088
|
+
e("div", Er, [
|
|
2089
|
+
x[9] || (x[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
|
|
2096
2090
|
e("div", Lr, [
|
|
2097
|
-
N(
|
|
2098
|
-
modelValue: v(
|
|
2099
|
-
"onUpdate:modelValue":
|
|
2091
|
+
N(H, {
|
|
2092
|
+
modelValue: v(r).deliveryOrderNumber,
|
|
2093
|
+
"onUpdate:modelValue": x[2] || (x[2] = (m) => v(r).deliveryOrderNumber = m),
|
|
2100
2094
|
size: "md"
|
|
2101
2095
|
}, null, 8, ["modelValue"])
|
|
2102
2096
|
])
|
|
2103
2097
|
]),
|
|
2104
|
-
e("div",
|
|
2105
|
-
|
|
2106
|
-
e("div",
|
|
2107
|
-
N(
|
|
2108
|
-
modelValue: v(
|
|
2109
|
-
"onUpdate:modelValue":
|
|
2098
|
+
e("div", Mr, [
|
|
2099
|
+
x[10] || (x[10] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
|
|
2100
|
+
e("div", Ur, [
|
|
2101
|
+
N(H, {
|
|
2102
|
+
modelValue: v(r).remark,
|
|
2103
|
+
"onUpdate:modelValue": x[3] || (x[3] = (m) => v(r).remark = m),
|
|
2110
2104
|
size: "md"
|
|
2111
2105
|
}, null, 8, ["modelValue"])
|
|
2112
2106
|
])
|
|
@@ -2124,43 +2118,43 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2124
2118
|
}, Kr = {
|
|
2125
2119
|
key: 1,
|
|
2126
2120
|
class: "border-t pt-6"
|
|
2127
|
-
},
|
|
2121
|
+
}, Gr = { class: "fm-typo-en-body-lg-600 mb-4 flex items-center gap-2" }, Hr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg overflow-y-auto" }, Wr = { class: "w-full" }, Qr = {
|
|
2128
2122
|
class: "p-3 fm-typo-en-body-sm-600",
|
|
2129
2123
|
style: { "min-width": "130px" }
|
|
2130
|
-
}, Yr = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Jr = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Xr = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Zr = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, eo = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, to = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, so = { class: "p-3 fm-typo-en-body-sm-600" }, ro = { key: 2 }, oo = /* @__PURE__ */
|
|
2124
|
+
}, Yr = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Jr = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Xr = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Zr = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, eo = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, to = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, so = { class: "p-3 fm-typo-en-body-sm-600" }, ro = { key: 2 }, oo = /* @__PURE__ */ we({
|
|
2131
2125
|
__name: "NetSuiteTransactionChangeLog",
|
|
2132
2126
|
props: {
|
|
2133
2127
|
netsuiteId: {}
|
|
2134
2128
|
},
|
|
2135
2129
|
setup(k) {
|
|
2136
|
-
const
|
|
2137
|
-
async function
|
|
2130
|
+
const a = k, o = ut(), f = J(!1), h = J(!1), n = J(!1), _ = J([]);
|
|
2131
|
+
async function r() {
|
|
2138
2132
|
if (!(_.value.length > 0))
|
|
2139
2133
|
try {
|
|
2140
|
-
|
|
2141
|
-
const w = await
|
|
2134
|
+
h.value = !0;
|
|
2135
|
+
const w = await o.getChangeLogs(a.netsuiteId);
|
|
2142
2136
|
_.value = w, n.value = !1;
|
|
2143
2137
|
} catch {
|
|
2144
2138
|
n.value = !0;
|
|
2145
2139
|
} finally {
|
|
2146
|
-
|
|
2140
|
+
h.value = !1;
|
|
2147
2141
|
}
|
|
2148
2142
|
}
|
|
2149
2143
|
function c(w) {
|
|
2150
2144
|
switch (w) {
|
|
2151
|
-
case
|
|
2145
|
+
case Oe.Create:
|
|
2152
2146
|
return "text-green-600 bg-green-100";
|
|
2153
|
-
case
|
|
2147
|
+
case Oe.Set:
|
|
2154
2148
|
return "text-blue-600 bg-blue-100";
|
|
2155
|
-
case
|
|
2149
|
+
case Oe.Change:
|
|
2156
2150
|
return "text-yellow-600 bg-yellow-100";
|
|
2157
|
-
case
|
|
2151
|
+
case Oe.Unset:
|
|
2158
2152
|
return "text-red-600 bg-red-100";
|
|
2159
2153
|
default:
|
|
2160
2154
|
return "text-gray-600 bg-gray-100";
|
|
2161
2155
|
}
|
|
2162
2156
|
}
|
|
2163
|
-
function
|
|
2157
|
+
function O(w) {
|
|
2164
2158
|
return new Date(w).toLocaleDateString("en-US", {
|
|
2165
2159
|
year: "numeric",
|
|
2166
2160
|
month: "short",
|
|
@@ -2169,46 +2163,46 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2169
2163
|
minute: "2-digit"
|
|
2170
2164
|
});
|
|
2171
2165
|
}
|
|
2172
|
-
return (w,
|
|
2173
|
-
const
|
|
2174
|
-
return i(),
|
|
2166
|
+
return (w, d) => {
|
|
2167
|
+
const I = K("FmButton"), S = K("FmCircularProgress"), F = K("FmIcon"), l = K("FmDialog");
|
|
2168
|
+
return i(), g("div", jr, [
|
|
2175
2169
|
N(l, {
|
|
2176
2170
|
modelValue: f.value,
|
|
2177
|
-
"onUpdate:modelValue":
|
|
2171
|
+
"onUpdate:modelValue": d[2] || (d[2] = (s) => f.value = s),
|
|
2178
2172
|
overlay: !0,
|
|
2179
2173
|
"max-width": 800
|
|
2180
2174
|
}, {
|
|
2181
2175
|
"dialog-button": X(() => [
|
|
2182
|
-
N(
|
|
2176
|
+
N(I, {
|
|
2183
2177
|
"prepend-icon": "info",
|
|
2184
2178
|
variant: "secondary",
|
|
2185
2179
|
label: "NetSuite",
|
|
2186
|
-
onClick:
|
|
2180
|
+
onClick: d[0] || (d[0] = (s) => r()),
|
|
2187
2181
|
"text-color": "primary",
|
|
2188
2182
|
"bg-color": "transparent",
|
|
2189
2183
|
"border-color": "primary"
|
|
2190
2184
|
})
|
|
2191
2185
|
]),
|
|
2192
|
-
"dialog-header": X(() =>
|
|
2186
|
+
"dialog-header": X(() => d[3] || (d[3] = [
|
|
2193
2187
|
e("div", null, "NetSuite info", -1)
|
|
2194
2188
|
])),
|
|
2195
2189
|
default: X(() => [
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
N(
|
|
2199
|
-
])) :
|
|
2200
|
-
!
|
|
2201
|
-
e("h3",
|
|
2190
|
+
h.value ? (i(), g("div", zr, [
|
|
2191
|
+
d[4] || (d[4] = e("span", null, "Change Log Loading...", -1)),
|
|
2192
|
+
N(S, { size: "md" })
|
|
2193
|
+
])) : M("", !0),
|
|
2194
|
+
!h.value && _.value.length > 0 ? (i(), g("div", Kr, [
|
|
2195
|
+
e("h3", Gr, [
|
|
2202
2196
|
N(F, {
|
|
2203
2197
|
name: "error",
|
|
2204
2198
|
color: "#ff9500",
|
|
2205
2199
|
size: "sm"
|
|
2206
2200
|
}),
|
|
2207
|
-
|
|
2201
|
+
d[5] || (d[5] = Re(" Change Logs "))
|
|
2208
2202
|
]),
|
|
2209
|
-
e("div",
|
|
2203
|
+
e("div", Hr, [
|
|
2210
2204
|
e("table", Wr, [
|
|
2211
|
-
|
|
2205
|
+
d[6] || (d[6] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
|
|
2212
2206
|
e("tr", { class: "border-b border-fm-color-neutral-gray-200" }, [
|
|
2213
2207
|
e("th", {
|
|
2214
2208
|
class: "text-left p-3 fm-typo-en-body-md-600",
|
|
@@ -2225,36 +2219,36 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2225
2219
|
])
|
|
2226
2220
|
], -1)),
|
|
2227
2221
|
e("tbody", null, [
|
|
2228
|
-
(i(!0),
|
|
2229
|
-
key:
|
|
2222
|
+
(i(!0), g(ue, null, Se(_.value, (s, b) => (i(), g("tr", {
|
|
2223
|
+
key: b,
|
|
2230
2224
|
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
2231
2225
|
}, [
|
|
2232
|
-
e("td", Qr,
|
|
2233
|
-
e("td", Yr,
|
|
2234
|
-
e("td", Jr,
|
|
2235
|
-
e("td", Xr,
|
|
2226
|
+
e("td", Qr, y(O(s._dateiso8601)), 1),
|
|
2227
|
+
e("td", Yr, y(s._rolename), 1),
|
|
2228
|
+
e("td", Jr, y(s._employeename), 1),
|
|
2229
|
+
e("td", Xr, y(s._contextname), 1),
|
|
2236
2230
|
e("td", {
|
|
2237
|
-
class: Le(`p-3 fm-typo-en-body-sm-600 ${c(Number(
|
|
2238
|
-
},
|
|
2239
|
-
e("td", Zr,
|
|
2240
|
-
e("td", eo,
|
|
2241
|
-
e("td", to,
|
|
2242
|
-
e("td", so,
|
|
2231
|
+
class: Le(`p-3 fm-typo-en-body-sm-600 ${c(Number(s.type) - 1)}`)
|
|
2232
|
+
}, y(v(Oe)[Number(s.type) - 1]), 3),
|
|
2233
|
+
e("td", Zr, y(s.lineid || ""), 1),
|
|
2234
|
+
e("td", eo, y(s._fieldname), 1),
|
|
2235
|
+
e("td", to, y(s.oldvalue || ""), 1),
|
|
2236
|
+
e("td", so, y(s.newvalue || ""), 1)
|
|
2243
2237
|
]))), 128))
|
|
2244
2238
|
])
|
|
2245
2239
|
])
|
|
2246
2240
|
])
|
|
2247
|
-
])) : (i(),
|
|
2241
|
+
])) : (i(), g("div", ro, d[7] || (d[7] = [
|
|
2248
2242
|
e("p", null, "No change logs available.", -1)
|
|
2249
2243
|
])))
|
|
2250
2244
|
]),
|
|
2251
2245
|
"dialog-footer": X(() => [
|
|
2252
|
-
N(
|
|
2246
|
+
N(I, {
|
|
2253
2247
|
class: "ml-auto sm:w-full xs:w-full",
|
|
2254
2248
|
label: "Close",
|
|
2255
2249
|
size: "md",
|
|
2256
2250
|
variant: "primary",
|
|
2257
|
-
onClick:
|
|
2251
|
+
onClick: d[1] || (d[1] = (s) => f.value = !1)
|
|
2258
2252
|
})
|
|
2259
2253
|
]),
|
|
2260
2254
|
_: 1
|
|
@@ -2274,13 +2268,13 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2274
2268
|
}, Ro = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ko = { class: "fm-typo-en-body-lg-600" }, Do = {
|
|
2275
2269
|
key: 2,
|
|
2276
2270
|
class: "flex flex-col gap-4"
|
|
2277
|
-
}, No = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ao = { class: "fm-typo-en-body-lg-600" },
|
|
2271
|
+
}, No = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ao = { class: "fm-typo-en-body-lg-600" }, Fo = {
|
|
2278
2272
|
key: 3,
|
|
2279
2273
|
class: "flex flex-col gap-4"
|
|
2280
|
-
},
|
|
2274
|
+
}, To = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Io = { class: "fm-typo-en-body-lg-600" }, Po = {
|
|
2281
2275
|
key: 4,
|
|
2282
2276
|
class: "flex flex-col gap-4"
|
|
2283
|
-
}, qo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
2277
|
+
}, qo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vo = { class: "fm-typo-en-body-lg-600" }, Eo = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Lo = { class: "flex flex-col gap-8" }, Mo = { class: "flex gap-8 items-center" }, Uo = { class: "flex-1 fm-typo-en-body-lg-600" }, Bo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-4" }, jo = { class: "flex w-full gap-4" }, zo = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2 flex items-center gap-2" }, Ko = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-2" }, Go = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Ho = ["innerHTML"], Wo = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Qo = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, Yo = {
|
|
2284
2278
|
key: 0,
|
|
2285
2279
|
class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
2286
2280
|
}, Jo = { class: "py-8" }, Xo = { class: "flex justify-end gap-4 items-center" }, Zo = { class: "fm-typo-en-body-lg-600" }, en = {
|
|
@@ -2304,7 +2298,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2304
2298
|
}, gn = { class: "flex-1 flex flex-col items-center" }, _n = {
|
|
2305
2299
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
2306
2300
|
name: "delivery details"
|
|
2307
|
-
}, Sn = { class: "flex flex-col gap-8" }, xn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, On = { class: "flex flex-col gap-4" }, wn = { class: "flex gap-8 xs:flex-col" }, Yn = /* @__PURE__ */
|
|
2301
|
+
}, Sn = { class: "flex flex-col gap-8" }, xn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, On = { class: "flex flex-col gap-4" }, wn = { class: "flex gap-8 xs:flex-col" }, Yn = /* @__PURE__ */ we({
|
|
2308
2302
|
__name: "TransferDetails",
|
|
2309
2303
|
props: {
|
|
2310
2304
|
poRequest: {},
|
|
@@ -2319,8 +2313,8 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2319
2313
|
shipments: {}
|
|
2320
2314
|
},
|
|
2321
2315
|
emits: ["update:show", "submitted"],
|
|
2322
|
-
setup(k, { emit:
|
|
2323
|
-
const
|
|
2316
|
+
setup(k, { emit: a }) {
|
|
2317
|
+
const o = k, f = a, h = et(), n = Ue(), _ = Me(), r = ke(), c = it(), O = Y(
|
|
2324
2318
|
() => {
|
|
2325
2319
|
var t, p;
|
|
2326
2320
|
return {
|
|
@@ -2328,78 +2322,78 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2328
2322
|
name: ((p = c.sessionUser.value) == null ? void 0 : p.displayName) ?? ""
|
|
2329
2323
|
};
|
|
2330
2324
|
}
|
|
2331
|
-
), w = ss(), { t:
|
|
2325
|
+
), w = ss(), { t: d } = ct(), I = Y(
|
|
2332
2326
|
() => {
|
|
2333
2327
|
var t, p, A, R;
|
|
2334
|
-
return ((p = (t =
|
|
2328
|
+
return ((p = (t = o.purchaseOrder) == null ? void 0 : t.supplier) == null ? void 0 : p.internal) === "restaurant" || ((R = (A = o.purchaseOrder) == null ? void 0 : A.supplier) == null ? void 0 : R.internal) === "warehouse" ? Ke.enum.transfer : Ke.enum.purchase;
|
|
2335
2329
|
}
|
|
2336
|
-
),
|
|
2330
|
+
), S = Y(() => {
|
|
2337
2331
|
var A;
|
|
2338
|
-
const t = (A =
|
|
2339
|
-
var
|
|
2340
|
-
return R.ref === ((
|
|
2332
|
+
const t = (A = o.shipments) == null ? void 0 : A.find((R) => {
|
|
2333
|
+
var H;
|
|
2334
|
+
return R.ref === ((H = o.purchaseOrder) == null ? void 0 : H._id);
|
|
2341
2335
|
});
|
|
2342
2336
|
let p = null;
|
|
2343
2337
|
if (t != null && t.milestones && t.milestones.length > 0) {
|
|
2344
2338
|
const R = t.milestones[t.milestones.length - 1];
|
|
2345
2339
|
if (R.estimatedTime) {
|
|
2346
|
-
const
|
|
2347
|
-
p = `${
|
|
2340
|
+
const H = new Date(R.estimatedTime), W = H.getDate().toString().padStart(2, "0");
|
|
2341
|
+
p = `${H.toLocaleString("en-US", { month: "short" })} ${W}`;
|
|
2348
2342
|
}
|
|
2349
2343
|
}
|
|
2350
2344
|
return p;
|
|
2351
|
-
}), F = J(!1), l = J(""),
|
|
2352
|
-
if (!
|
|
2345
|
+
}), F = J(!1), l = J(""), s = J(!0), b = Be(), u = zt(b.getWorkflowConfig), $ = xt(), P = Y(() => {
|
|
2346
|
+
if (!o.purchaseOrder)
|
|
2353
2347
|
return [];
|
|
2354
|
-
const t =
|
|
2348
|
+
const t = u.result.value;
|
|
2355
2349
|
if (t.state === mt.loading)
|
|
2356
2350
|
return [];
|
|
2357
2351
|
const p = {
|
|
2358
|
-
user:
|
|
2359
|
-
executedAt:
|
|
2352
|
+
user: O.value,
|
|
2353
|
+
executedAt: r.locations.computeFirst(
|
|
2360
2354
|
(R) => {
|
|
2361
|
-
var
|
|
2362
|
-
return R.dbName === ((
|
|
2355
|
+
var H;
|
|
2356
|
+
return R.dbName === ((H = r._currentLocation) == null ? void 0 : H.dbName) ? R : null;
|
|
2363
2357
|
}
|
|
2364
2358
|
),
|
|
2365
|
-
purchaseOrderRequest:
|
|
2366
|
-
purchaseOrder:
|
|
2359
|
+
purchaseOrderRequest: o.poRequest,
|
|
2360
|
+
purchaseOrder: o.purchaseOrder
|
|
2367
2361
|
};
|
|
2368
2362
|
let A = [];
|
|
2369
2363
|
try {
|
|
2370
|
-
t.state === mt.error ? (console.error("Error fetching workflow config:", t.error), A =
|
|
2364
|
+
t.state === mt.error ? (console.error("Error fetching workflow config:", t.error), A = tt.getAvailableActions({
|
|
2371
2365
|
...p,
|
|
2372
|
-
orderConfig:
|
|
2366
|
+
orderConfig: tt.getDefaultConfig()
|
|
2373
2367
|
}).actions.filter(
|
|
2374
2368
|
(R) => (
|
|
2375
2369
|
// TODO: create receiveStock & processRequest dialog
|
|
2376
2370
|
// to create their payload
|
|
2377
|
-
R !==
|
|
2371
|
+
R !== V.enum.receiveStock && R !== V.enum.processRequest && R !== V.enum.closeRequest
|
|
2378
2372
|
)
|
|
2379
|
-
)) : A =
|
|
2373
|
+
)) : A = tt.getAvailableActions({
|
|
2380
2374
|
...p,
|
|
2381
2375
|
orderConfig: t.data
|
|
2382
2376
|
}).actions.filter(
|
|
2383
|
-
(R) => R !==
|
|
2377
|
+
(R) => R !== V.enum.receiveStock && R !== V.enum.processRequest && R !== V.enum.closeRequest
|
|
2384
2378
|
);
|
|
2385
2379
|
} catch (R) {
|
|
2386
2380
|
console.error("Error getting available actions:", R);
|
|
2387
2381
|
}
|
|
2388
|
-
return
|
|
2389
|
-
}), B =
|
|
2382
|
+
return o.scope === "approval" && (A = A.filter((R) => R !== V.enum.completeReceive)), A;
|
|
2383
|
+
}), B = Pt(o, "show"), C = Y(() => [
|
|
2390
2384
|
{
|
|
2391
|
-
label:
|
|
2385
|
+
label: d("inventory.transfer.receiveRequest.details.overview"),
|
|
2392
2386
|
value: "overview"
|
|
2393
2387
|
},
|
|
2394
2388
|
{
|
|
2395
|
-
label:
|
|
2389
|
+
label: d("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
2396
2390
|
value: "deliveryHistory"
|
|
2397
2391
|
}
|
|
2398
|
-
]),
|
|
2392
|
+
]), G = J(C.value[0]);
|
|
2399
2393
|
Ct(
|
|
2400
|
-
() =>
|
|
2394
|
+
() => o.show,
|
|
2401
2395
|
(t) => {
|
|
2402
|
-
t && (
|
|
2396
|
+
t && (G.value = C.value[0]);
|
|
2403
2397
|
}
|
|
2404
2398
|
);
|
|
2405
2399
|
function Q(t) {
|
|
@@ -2411,18 +2405,18 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2411
2405
|
}
|
|
2412
2406
|
}));
|
|
2413
2407
|
}
|
|
2414
|
-
async function se(t, p, A, R,
|
|
2408
|
+
async function se(t, p, A, R, H) {
|
|
2415
2409
|
return new Promise((W, te) => {
|
|
2416
|
-
|
|
2410
|
+
h.open({
|
|
2417
2411
|
closeButton: !1,
|
|
2418
2412
|
title: R.title,
|
|
2419
2413
|
message: R.message,
|
|
2420
2414
|
primaryActions: R.primaryActions,
|
|
2421
2415
|
secondaryActions: { text: "No", close: !1 }
|
|
2422
2416
|
}).onPrimary(async () => {
|
|
2423
|
-
var
|
|
2417
|
+
var z, le, oe, L;
|
|
2424
2418
|
const m = [];
|
|
2425
|
-
A ===
|
|
2419
|
+
A === V.enum.approveRequest ? (m.push({
|
|
2426
2420
|
action: "approveRequest",
|
|
2427
2421
|
payload: null
|
|
2428
2422
|
}), p.fulfillment && m.push({
|
|
@@ -2432,21 +2426,21 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2432
2426
|
deliveryOrderNumber: "",
|
|
2433
2427
|
deliveryRemark: null,
|
|
2434
2428
|
items: Q(p.fulfillment.items),
|
|
2435
|
-
createdBy:
|
|
2429
|
+
createdBy: O.value
|
|
2436
2430
|
}
|
|
2437
|
-
})) : A ===
|
|
2431
|
+
})) : A === V.enum.processRequest ? p.fulfillment && m.push({
|
|
2438
2432
|
action: "processRequest",
|
|
2439
2433
|
payload: {
|
|
2440
2434
|
fulfillmentId: "",
|
|
2441
2435
|
deliveryOrderNumber: "",
|
|
2442
2436
|
deliveryRemark: null,
|
|
2443
2437
|
items: Q(p.fulfillment.items),
|
|
2444
|
-
createdBy:
|
|
2438
|
+
createdBy: O.value
|
|
2445
2439
|
}
|
|
2446
|
-
}) : A ===
|
|
2440
|
+
}) : A === V.enum.rejectRequest ? m.push({
|
|
2447
2441
|
action: "rejectRequest",
|
|
2448
2442
|
payload: null
|
|
2449
|
-
}) : A ===
|
|
2443
|
+
}) : A === V.enum.closeRequest && m.push({
|
|
2450
2444
|
action: "closeRequest",
|
|
2451
2445
|
payload: null
|
|
2452
2446
|
});
|
|
@@ -2458,70 +2452,70 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2458
2452
|
options: p
|
|
2459
2453
|
},
|
|
2460
2454
|
operateV2: {
|
|
2461
|
-
_id: ((
|
|
2462
|
-
_rev: ((le =
|
|
2455
|
+
_id: ((z = o.purchaseOrder) == null ? void 0 : z._id) ?? "",
|
|
2456
|
+
_rev: ((le = o.purchaseOrder) == null ? void 0 : le._rev) ?? "",
|
|
2463
2457
|
action: A,
|
|
2464
2458
|
payloads: m
|
|
2465
2459
|
// add payload if action is receiveStock or processRequest
|
|
2466
2460
|
},
|
|
2467
|
-
transferTo: (L = (oe =
|
|
2461
|
+
transferTo: (L = (oe = o.poRequest) == null ? void 0 : oe.to) == null ? void 0 : L.dbName
|
|
2468
2462
|
}).delayed(1e3), W("submitted");
|
|
2469
2463
|
} catch (ne) {
|
|
2470
2464
|
te(ne);
|
|
2471
2465
|
}
|
|
2472
2466
|
}).onSecondary(() => {
|
|
2473
2467
|
W("cancelled");
|
|
2474
|
-
for (let m = 0; m <
|
|
2475
|
-
|
|
2468
|
+
for (let m = 0; m < H + 2; m++)
|
|
2469
|
+
h.close();
|
|
2476
2470
|
}).onClose(() => {
|
|
2477
2471
|
});
|
|
2478
2472
|
});
|
|
2479
2473
|
}
|
|
2480
|
-
async function
|
|
2481
|
-
var
|
|
2482
|
-
if (t ===
|
|
2474
|
+
async function fe(t) {
|
|
2475
|
+
var H, W, te, m;
|
|
2476
|
+
if (t === V.enum.receiveStock)
|
|
2483
2477
|
return;
|
|
2484
2478
|
const p = St[t];
|
|
2485
2479
|
if (!p) {
|
|
2486
2480
|
n.open({
|
|
2487
2481
|
title: "Something went wrong",
|
|
2488
|
-
message: `Cannot process order: ${
|
|
2482
|
+
message: `Cannot process order: ${lt(t)}`,
|
|
2489
2483
|
type: "error"
|
|
2490
2484
|
});
|
|
2491
2485
|
return;
|
|
2492
2486
|
}
|
|
2493
2487
|
const { successMessage: A, ...R } = p;
|
|
2494
|
-
if (
|
|
2495
|
-
l.value = `${t}`, F.value = !0,
|
|
2496
|
-
const
|
|
2488
|
+
if (o.purchaseOrder) {
|
|
2489
|
+
l.value = `${t}`, F.value = !0, s.value = !1;
|
|
2490
|
+
const z = {};
|
|
2497
2491
|
let le = 0;
|
|
2498
|
-
if ((t ===
|
|
2499
|
-
t ===
|
|
2500
|
-
|
|
2501
|
-
else if ((t ===
|
|
2502
|
-
const oe = (W = (
|
|
2492
|
+
if ((t === V.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
2493
|
+
t === V.enum.completeReceive) && _.autoReceiveWarehouse)
|
|
2494
|
+
z.autoReceive = !0;
|
|
2495
|
+
else if ((t === V.enum.approveRequest || t === V.enum.processRequest) && _.acceptRequireFulfillment) {
|
|
2496
|
+
const oe = (W = (H = o.poRequest) == null ? void 0 : H.from) == null ? void 0 : W.dbName, L = (m = (te = o.poRequest) == null ? void 0 : te.to) == null ? void 0 : m.dbName;
|
|
2503
2497
|
if (oe && L && (oe.startsWith("warehouse_") || L.startsWith("warehouse_"))) {
|
|
2504
|
-
const ne = await new Promise((
|
|
2505
|
-
|
|
2498
|
+
const ne = await new Promise((xe, Ne) => {
|
|
2499
|
+
h.open({
|
|
2506
2500
|
closeButton: !1,
|
|
2507
2501
|
title: "Confirm transfer amount",
|
|
2508
2502
|
dialogComponent: ts,
|
|
2509
2503
|
dialogComponentProps: {
|
|
2510
|
-
purchaseOrder:
|
|
2511
|
-
confirm:
|
|
2512
|
-
"onUpdate:show": (
|
|
2513
|
-
|
|
2504
|
+
purchaseOrder: o.purchaseOrder,
|
|
2505
|
+
confirm: xe,
|
|
2506
|
+
"onUpdate:show": (Ae) => {
|
|
2507
|
+
Ae || (l.value = "", F.value = !1, s.value = !0, le++, h.close()), Ne("cancelled");
|
|
2514
2508
|
}
|
|
2515
2509
|
}
|
|
2516
2510
|
});
|
|
2517
2511
|
});
|
|
2518
|
-
|
|
2512
|
+
z.fulfillment = ne;
|
|
2519
2513
|
}
|
|
2520
2514
|
}
|
|
2521
2515
|
try {
|
|
2522
2516
|
await se(
|
|
2523
|
-
|
|
2524
|
-
|
|
2517
|
+
o.purchaseOrder,
|
|
2518
|
+
z,
|
|
2525
2519
|
t,
|
|
2526
2520
|
p,
|
|
2527
2521
|
le
|
|
@@ -2535,27 +2529,27 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2535
2529
|
title: "Something went wrong",
|
|
2536
2530
|
message: "Please try again.",
|
|
2537
2531
|
type: "error"
|
|
2538
|
-
}), console.error("Error when submitting PO operation", t,
|
|
2532
|
+
}), console.error("Error when submitting PO operation", t, o.purchaseOrder, oe);
|
|
2539
2533
|
} finally {
|
|
2540
|
-
l.value = "", F.value = !1,
|
|
2534
|
+
l.value = "", F.value = !1, s.value = !0;
|
|
2541
2535
|
}
|
|
2542
2536
|
}
|
|
2543
2537
|
}
|
|
2544
|
-
const
|
|
2538
|
+
const ye = Y(() => {
|
|
2545
2539
|
var t, p;
|
|
2546
|
-
return ((t =
|
|
2547
|
-
}),
|
|
2548
|
-
const t =
|
|
2540
|
+
return ((t = o.purchaseOrder) == null ? void 0 : t.status) === ee.enum.RECEIVING || ((p = o.purchaseOrder) == null ? void 0 : p.status) === ee.enum.COMPLETE;
|
|
2541
|
+
}), De = Y(() => o.purchaseOrder ? Je(o.purchaseOrder) : {}), qe = Y(() => {
|
|
2542
|
+
const t = o.purchaseOrder;
|
|
2549
2543
|
if (!t) return { status: "", statusClass: "" };
|
|
2550
|
-
const { partial: p, over: A } =
|
|
2551
|
-
let
|
|
2552
|
-
return R === ee.enum.CLOSE && (
|
|
2553
|
-
status:
|
|
2544
|
+
const { partial: p, over: A } = ot(De.value), R = nt(t.status, p, A);
|
|
2545
|
+
let H = d(`inventory.transfer.status.${R}`), W = `${t.status}`.toLocaleLowerCase("en-us");
|
|
2546
|
+
return R === ee.enum.CLOSE && (H = `${d(`inventory.transfer.status.${ee.enum.COMPLETE}`)}`), R === "PARTIAL_RECEIVED" && W === ee.enum.PROCESSING.toLocaleLowerCase("en-us") && (W = ee.enum.RECEIVING.toLocaleLowerCase("en-us")), {
|
|
2547
|
+
status: H,
|
|
2554
2548
|
statusClass: `fm-status-badge fm-status-badge-${W}`
|
|
2555
2549
|
};
|
|
2556
2550
|
}), q = Y(() => {
|
|
2557
2551
|
var W, te;
|
|
2558
|
-
const t = ((W =
|
|
2552
|
+
const t = ((W = o.purchaseOrder) == null ? void 0 : W.deliveryOrder) ?? [], p = ((te = o.purchaseOrder) == null ? void 0 : te.deliveryFullfillment) ?? [], A = [
|
|
2559
2553
|
...t.map((m) => ({
|
|
2560
2554
|
createdAt: m.createdAt,
|
|
2561
2555
|
type: "grn",
|
|
@@ -2567,105 +2561,107 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2567
2561
|
doc: m
|
|
2568
2562
|
}))
|
|
2569
2563
|
];
|
|
2570
|
-
A.reverse().sort((m,
|
|
2564
|
+
A.reverse().sort((m, z) => m.createdAt.localeCompare(z.createdAt));
|
|
2571
2565
|
function R(m) {
|
|
2572
|
-
var oe, L, ne,
|
|
2573
|
-
const
|
|
2574
|
-
(L = (oe = p[
|
|
2566
|
+
var oe, L, ne, xe, Ne, Ae, Z, ie, de, ve, ge, Ce;
|
|
2567
|
+
const z = p.findIndex((ce) => ce.id === m.fullfillmentId), le = [
|
|
2568
|
+
(L = (oe = p[z]) == null ? void 0 : oe.netSuite) != null && L.id ? {
|
|
2575
2569
|
label: "Fulfillment's ref no. (Netsuite)",
|
|
2576
|
-
values: [
|
|
2570
|
+
values: [
|
|
2571
|
+
`${((xe = (ne = p[z]) == null ? void 0 : ne.netSuite) == null ? void 0 : xe.refNo) ?? "N/A"} (${((Ae = (Ne = p[z]) == null ? void 0 : Ne.netSuite) == null ? void 0 : Ae.id) ?? "-"})`
|
|
2572
|
+
]
|
|
2577
2573
|
} : null,
|
|
2578
|
-
(
|
|
2574
|
+
(Z = m == null ? void 0 : m.netSuite) != null && Z.id ? {
|
|
2579
2575
|
label: "Netsuite ref no.",
|
|
2580
|
-
values: [`${(
|
|
2576
|
+
values: [`${((ie = m == null ? void 0 : m.netSuite) == null ? void 0 : ie.refNo) ?? "N/A"} (${((de = m == null ? void 0 : m.netSuite) == null ? void 0 : de.id) ?? "-"})`]
|
|
2581
2577
|
} : null,
|
|
2582
|
-
(
|
|
2578
|
+
(ve = m == null ? void 0 : m.netSuite) != null && ve.recordType ? {
|
|
2583
2579
|
label: "Netsuite Type",
|
|
2584
|
-
values: [vt((
|
|
2580
|
+
values: [vt((ge = m == null ? void 0 : m.netSuite) == null ? void 0 : ge.recordType)]
|
|
2585
2581
|
} : null
|
|
2586
2582
|
];
|
|
2587
2583
|
return {
|
|
2588
2584
|
header: "Received",
|
|
2589
2585
|
deliveryOrder: m,
|
|
2590
|
-
date:
|
|
2586
|
+
date: Ge(new Date(m.createdAt)),
|
|
2591
2587
|
info: [
|
|
2592
2588
|
{
|
|
2593
2589
|
label: "Adjustment date",
|
|
2594
2590
|
values: [
|
|
2595
|
-
m.adjustment ?
|
|
2591
|
+
m.adjustment ? Ge(new Date(We(m.adjustment))) : "-"
|
|
2596
2592
|
]
|
|
2597
2593
|
},
|
|
2598
2594
|
{
|
|
2599
2595
|
label: "Received by",
|
|
2600
|
-
values: [(
|
|
2596
|
+
values: [(Ce = m.createdBy) == null ? void 0 : Ce.name]
|
|
2601
2597
|
},
|
|
2602
2598
|
{
|
|
2603
2599
|
label: "Received items",
|
|
2604
|
-
values: m.received.map((
|
|
2605
|
-
var
|
|
2606
|
-
return
|
|
2607
|
-
|
|
2600
|
+
values: m.received.map((ce) => {
|
|
2601
|
+
var me;
|
|
2602
|
+
return E("div", [
|
|
2603
|
+
E(
|
|
2608
2604
|
"div",
|
|
2609
2605
|
{
|
|
2610
2606
|
class: "flex gap-4"
|
|
2611
2607
|
},
|
|
2612
2608
|
[
|
|
2613
|
-
|
|
2609
|
+
E(
|
|
2614
2610
|
"div",
|
|
2615
2611
|
{
|
|
2616
2612
|
class: "flex flex-col"
|
|
2617
2613
|
},
|
|
2618
2614
|
[
|
|
2619
|
-
|
|
2615
|
+
E(
|
|
2620
2616
|
"span",
|
|
2621
2617
|
{
|
|
2622
2618
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
2623
2619
|
},
|
|
2624
|
-
`${
|
|
2620
|
+
`${ce.sku.name}`
|
|
2625
2621
|
),
|
|
2626
|
-
|
|
2622
|
+
E(
|
|
2627
2623
|
"span",
|
|
2628
2624
|
{
|
|
2629
2625
|
class: "fm-typo-en-body-md-400"
|
|
2630
2626
|
},
|
|
2631
|
-
`${
|
|
2627
|
+
`${ce.sku.code} `
|
|
2632
2628
|
)
|
|
2633
2629
|
]
|
|
2634
2630
|
),
|
|
2635
|
-
|
|
2631
|
+
E(
|
|
2636
2632
|
"div",
|
|
2637
2633
|
{
|
|
2638
2634
|
class: "ml-auto flex flex-col"
|
|
2639
2635
|
},
|
|
2640
2636
|
[
|
|
2641
|
-
|
|
2637
|
+
E(
|
|
2642
2638
|
"div",
|
|
2643
2639
|
{
|
|
2644
2640
|
class: "ml-auto flex gap-1"
|
|
2645
2641
|
},
|
|
2646
2642
|
[
|
|
2647
|
-
|
|
2643
|
+
E(
|
|
2648
2644
|
"span",
|
|
2649
2645
|
{
|
|
2650
2646
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
2651
2647
|
},
|
|
2652
|
-
|
|
2648
|
+
he(ce.amount, !1)
|
|
2653
2649
|
),
|
|
2654
|
-
|
|
2650
|
+
E(
|
|
2655
2651
|
"span",
|
|
2656
2652
|
{
|
|
2657
2653
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
2658
2654
|
},
|
|
2659
|
-
((
|
|
2655
|
+
((me = ce.measurement) == null ? void 0 : me.abbrev) ?? ce.sku.unit.abbrev
|
|
2660
2656
|
)
|
|
2661
2657
|
]
|
|
2662
2658
|
),
|
|
2663
|
-
|
|
2659
|
+
E(
|
|
2664
2660
|
"div",
|
|
2665
2661
|
{
|
|
2666
2662
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
2667
2663
|
},
|
|
2668
|
-
`${
|
|
2664
|
+
`${ce.cost ? `(${ze(ce.cost)})` : ""}`
|
|
2669
2665
|
)
|
|
2670
2666
|
]
|
|
2671
2667
|
)
|
|
@@ -2682,50 +2678,50 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2682
2678
|
label: "Remark",
|
|
2683
2679
|
values: [m.remark || "N/A"]
|
|
2684
2680
|
},
|
|
2685
|
-
|
|
2681
|
+
z > -1 ? {
|
|
2686
2682
|
label: "Fulfilment's sequence",
|
|
2687
|
-
values: [`${
|
|
2683
|
+
values: [`${z + 1}`]
|
|
2688
2684
|
} : null,
|
|
2689
2685
|
...le
|
|
2690
|
-
].filter((
|
|
2686
|
+
].filter((ce) => !!ce)
|
|
2691
2687
|
};
|
|
2692
2688
|
}
|
|
2693
|
-
function
|
|
2689
|
+
function H(m) {
|
|
2694
2690
|
var le, oe;
|
|
2695
|
-
const
|
|
2691
|
+
const z = p.findIndex((L) => L.id === m.id);
|
|
2696
2692
|
return {
|
|
2697
2693
|
header: "Fulfillment",
|
|
2698
|
-
date:
|
|
2694
|
+
date: Ge(new Date(m.createdAt)),
|
|
2699
2695
|
info: [
|
|
2700
2696
|
{
|
|
2701
2697
|
label: "Sequence",
|
|
2702
|
-
values: [String(
|
|
2698
|
+
values: [String(z + 1)]
|
|
2703
2699
|
},
|
|
2704
2700
|
{
|
|
2705
2701
|
label: "Receiveable items",
|
|
2706
2702
|
values: m.items.map((L) => {
|
|
2707
2703
|
var ne;
|
|
2708
|
-
return
|
|
2709
|
-
|
|
2704
|
+
return E("div", [
|
|
2705
|
+
E(
|
|
2710
2706
|
"div",
|
|
2711
2707
|
{
|
|
2712
2708
|
class: "flex gap-4"
|
|
2713
2709
|
},
|
|
2714
2710
|
[
|
|
2715
|
-
|
|
2711
|
+
E(
|
|
2716
2712
|
"div",
|
|
2717
2713
|
{
|
|
2718
2714
|
class: "flex flex-col"
|
|
2719
2715
|
},
|
|
2720
2716
|
[
|
|
2721
|
-
|
|
2717
|
+
E(
|
|
2722
2718
|
"span",
|
|
2723
2719
|
{
|
|
2724
2720
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
2725
2721
|
},
|
|
2726
2722
|
`${L.sku.name}`
|
|
2727
2723
|
),
|
|
2728
|
-
|
|
2724
|
+
E(
|
|
2729
2725
|
"span",
|
|
2730
2726
|
{
|
|
2731
2727
|
class: "fm-typo-en-body-md-400"
|
|
@@ -2734,26 +2730,26 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2734
2730
|
)
|
|
2735
2731
|
]
|
|
2736
2732
|
),
|
|
2737
|
-
|
|
2733
|
+
E(
|
|
2738
2734
|
"div",
|
|
2739
2735
|
{
|
|
2740
2736
|
class: "ml-auto flex flex-col"
|
|
2741
2737
|
},
|
|
2742
2738
|
[
|
|
2743
|
-
|
|
2739
|
+
E(
|
|
2744
2740
|
"div",
|
|
2745
2741
|
{
|
|
2746
2742
|
class: "ml-auto flex gap-1"
|
|
2747
2743
|
},
|
|
2748
2744
|
[
|
|
2749
|
-
|
|
2745
|
+
E(
|
|
2750
2746
|
"span",
|
|
2751
2747
|
{
|
|
2752
2748
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
2753
2749
|
},
|
|
2754
|
-
|
|
2750
|
+
he(L.amount, !1)
|
|
2755
2751
|
),
|
|
2756
|
-
|
|
2752
|
+
E(
|
|
2757
2753
|
"span",
|
|
2758
2754
|
{
|
|
2759
2755
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
@@ -2762,12 +2758,12 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2762
2758
|
)
|
|
2763
2759
|
]
|
|
2764
2760
|
),
|
|
2765
|
-
|
|
2761
|
+
E(
|
|
2766
2762
|
"div",
|
|
2767
2763
|
{
|
|
2768
2764
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
2769
2765
|
},
|
|
2770
|
-
`${L.cost ? `(${
|
|
2766
|
+
`${L.cost ? `(${ze(L.cost)})` : ""}`
|
|
2771
2767
|
)
|
|
2772
2768
|
]
|
|
2773
2769
|
)
|
|
@@ -2788,66 +2784,66 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2788
2784
|
case "grn":
|
|
2789
2785
|
return R(m.doc);
|
|
2790
2786
|
case "fulfillment":
|
|
2791
|
-
return
|
|
2787
|
+
return H(m.doc);
|
|
2792
2788
|
}
|
|
2793
2789
|
});
|
|
2794
|
-
}),
|
|
2790
|
+
}), U = Y(() => {
|
|
2795
2791
|
var p;
|
|
2796
2792
|
const t = {
|
|
2797
2793
|
...bt(0),
|
|
2798
|
-
currency:
|
|
2794
|
+
currency: $e()
|
|
2799
2795
|
};
|
|
2800
|
-
return ((p =
|
|
2796
|
+
return ((p = o.purchaseOrder) == null ? void 0 : p.items.reduce((A, R) => ({
|
|
2801
2797
|
...ht(A, R.totalCost ?? t),
|
|
2802
|
-
currency:
|
|
2798
|
+
currency: $e()
|
|
2803
2799
|
}), t)) ?? t;
|
|
2804
2800
|
});
|
|
2805
2801
|
function ae(t) {
|
|
2806
2802
|
var W;
|
|
2807
|
-
const A = (((W =
|
|
2808
|
-
return `<span class="${D(t)} fm-typo-en-body-lg-600">${
|
|
2803
|
+
const A = (((W = o.purchaseOrder) == null ? void 0 : W.version) ?? Te.enum[1]) === Te.enum[2] ? t.id : t.sku._id, R = o.receivedMap[A];
|
|
2804
|
+
return `<span class="${D(t)} fm-typo-en-body-lg-600">${Ie.toFormatString({ value: R.received })}</span>/${Lt(t.quantity, t.sku.unit, t.measurement)}`;
|
|
2809
2805
|
}
|
|
2810
2806
|
function D(t) {
|
|
2811
|
-
var
|
|
2812
|
-
const A = (((
|
|
2813
|
-
return W ? "text-fm-color-typo-tertiary" :
|
|
2807
|
+
var z;
|
|
2808
|
+
const A = (((z = o.purchaseOrder) == null ? void 0 : z.version) ?? Te.enum[1]) === Te.enum[2] ? t.id : t.sku._id, R = o.receivedMap[A], { isPartialReceive: H, isNoReceive: W, isOverReceive: te, isFullReceive: m } = Qt(R);
|
|
2809
|
+
return W ? "text-fm-color-typo-tertiary" : H ? "text-fm-color-system-warning-300" : te ? "text-fm-color-system-error-300" : m ? "text-fm-color-system-success-300" : "";
|
|
2814
2810
|
}
|
|
2815
|
-
const
|
|
2811
|
+
const x = Y(() => {
|
|
2816
2812
|
var t, p, A;
|
|
2817
|
-
return (t =
|
|
2813
|
+
return (t = o.purchaseOrder) != null && t.itemsAtSubmission ? ((p = o.purchaseOrder) == null ? void 0 : p.version) === Te.enum[2] ? o.purchaseOrder.items.reduce((R, H) => {
|
|
2818
2814
|
var te, m;
|
|
2819
|
-
const W = (m = (te =
|
|
2820
|
-
(
|
|
2815
|
+
const W = (m = (te = o.purchaseOrder) == null ? void 0 : te.itemsAtSubmission) == null ? void 0 : m.find(
|
|
2816
|
+
(z) => z.id === H.id
|
|
2821
2817
|
);
|
|
2822
|
-
return W && W.quantity !==
|
|
2823
|
-
originalAmount: Number(
|
|
2824
|
-
newAmount: Number(
|
|
2818
|
+
return W && W.quantity !== H.quantity && R.set(H.sku.code, {
|
|
2819
|
+
originalAmount: Number(Ie.toFormatString({ value: W.quantity })),
|
|
2820
|
+
newAmount: Number(Ie.toFormatString({ value: H.quantity }))
|
|
2825
2821
|
}), R;
|
|
2826
|
-
}, /* @__PURE__ */ new Map()) : (A =
|
|
2827
|
-
var
|
|
2828
|
-
const W = (le = (
|
|
2829
|
-
(oe) => oe.sku._id ===
|
|
2830
|
-
), te = W ? Number(
|
|
2831
|
-
return W && te !== m && R.set(
|
|
2822
|
+
}, /* @__PURE__ */ new Map()) : (A = o.purchaseOrder) == null ? void 0 : A.items.reduce((R, H) => {
|
|
2823
|
+
var z, le;
|
|
2824
|
+
const W = (le = (z = o.purchaseOrder) == null ? void 0 : z.itemsAtSubmission) == null ? void 0 : le.find(
|
|
2825
|
+
(oe) => oe.sku._id === H.sku._id
|
|
2826
|
+
), te = W ? Number(Ie.toFormatString({ value: W.quantity })) : 0, m = Number(Ie.toFormatString({ value: H.quantity }));
|
|
2827
|
+
return W && te !== m && R.set(H.sku.code, {
|
|
2832
2828
|
originalAmount: te,
|
|
2833
2829
|
newAmount: m
|
|
2834
2830
|
}), R;
|
|
2835
2831
|
}, /* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
|
|
2836
|
-
}),
|
|
2832
|
+
}), T = (t) => {
|
|
2837
2833
|
var A, R;
|
|
2838
|
-
const p =
|
|
2839
|
-
return ((A =
|
|
2834
|
+
const p = x.value;
|
|
2835
|
+
return ((A = o.purchaseOrder) == null ? void 0 : A.version) === Te.enum[2] ? p.has(t.id) : p.has((R = t.sku) == null ? void 0 : R.code);
|
|
2840
2836
|
}, j = (t) => {
|
|
2841
2837
|
var A, R;
|
|
2842
|
-
const p =
|
|
2843
|
-
return ((A =
|
|
2838
|
+
const p = x.value;
|
|
2839
|
+
return ((A = o.purchaseOrder) == null ? void 0 : A.version) === Te.enum[2] ? p.get(t.id) : p.get((R = t.sku) == null ? void 0 : R.code);
|
|
2844
2840
|
};
|
|
2845
2841
|
return (t, p) => {
|
|
2846
|
-
const A =
|
|
2842
|
+
const A = K("FmButton"), R = K("FmButtonGroup"), H = K("FmChip"), W = K("FmIcon"), te = K("FmMenuDivider"), m = K("FmCard"), z = K("FmTooltip"), le = K("FmSpacer"), oe = K("FmSideSheet");
|
|
2847
2843
|
return i(), re(oe, {
|
|
2848
2844
|
modelValue: v(B),
|
|
2849
2845
|
"onUpdate:modelValue": p[8] || (p[8] = (L) => Rt(B) ? B.value = L : null),
|
|
2850
|
-
"dismiss-away":
|
|
2846
|
+
"dismiss-away": s.value,
|
|
2851
2847
|
"max-width": 600,
|
|
2852
2848
|
"close-button": !1
|
|
2853
2849
|
}, {
|
|
@@ -2856,103 +2852,103 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2856
2852
|
return [
|
|
2857
2853
|
e("div", no, [
|
|
2858
2854
|
e("div", ao, [
|
|
2859
|
-
e("div", lo,
|
|
2855
|
+
e("div", lo, y(v(d)("inventory.transfer.receiveRequest.details.title") + ((L = t.purchaseOrder) != null && L.seqNumber ? ` #${(ne = t.purchaseOrder) == null ? void 0 : ne.seqNumber}` : "")), 1),
|
|
2860
2856
|
N(A, {
|
|
2861
2857
|
class: "ml-auto -m-2",
|
|
2862
2858
|
variant: "tertiary",
|
|
2863
2859
|
"prepend-icon": "close",
|
|
2864
|
-
onClick: p[0] || (p[0] = (
|
|
2860
|
+
onClick: p[0] || (p[0] = (xe) => f("update:show", !1))
|
|
2865
2861
|
})
|
|
2866
2862
|
]),
|
|
2867
2863
|
N(R, {
|
|
2868
2864
|
items: C.value,
|
|
2869
|
-
modelValue:
|
|
2870
|
-
"onUpdate:modelValue": p[1] || (p[1] = (
|
|
2865
|
+
modelValue: G.value,
|
|
2866
|
+
"onUpdate:modelValue": p[1] || (p[1] = (xe) => G.value = xe)
|
|
2871
2867
|
}, null, 8, ["items", "modelValue"]),
|
|
2872
|
-
t.purchaseOrder &&
|
|
2868
|
+
t.purchaseOrder && G.value.value === "deliveryHistory" ? (i(), re(Br, {
|
|
2873
2869
|
key: 0,
|
|
2874
2870
|
"purchase-order": t.purchaseOrder,
|
|
2875
|
-
"received-info-map":
|
|
2871
|
+
"received-info-map": De.value,
|
|
2876
2872
|
onSubmitted: p[2] || (p[2] = () => {
|
|
2877
2873
|
f("update:show", !1), f("submitted");
|
|
2878
2874
|
})
|
|
2879
|
-
}, null, 8, ["purchase-order", "received-info-map"])) :
|
|
2875
|
+
}, null, 8, ["purchase-order", "received-info-map"])) : M("", !0)
|
|
2880
2876
|
])
|
|
2881
2877
|
];
|
|
2882
2878
|
}),
|
|
2883
2879
|
default: X(() => {
|
|
2884
|
-
var L, ne,
|
|
2880
|
+
var L, ne, xe, Ne, Ae;
|
|
2885
2881
|
return [
|
|
2886
2882
|
e("div", io, [
|
|
2887
|
-
|
|
2883
|
+
G.value.value === "overview" ? (i(), g(ue, { key: 0 }, [
|
|
2888
2884
|
e("div", null, [
|
|
2889
2885
|
N(m, {
|
|
2890
2886
|
variant: "outlined",
|
|
2891
2887
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
2892
2888
|
}, {
|
|
2893
2889
|
default: X(() => {
|
|
2894
|
-
var Z,
|
|
2890
|
+
var Z, ie, de, ve, ge, Ce, ce, me, Fe;
|
|
2895
2891
|
return [
|
|
2896
2892
|
e("div", co, [
|
|
2897
|
-
e("div", uo,
|
|
2893
|
+
e("div", uo, y(v(d)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
2898
2894
|
e("div", mo, [
|
|
2899
2895
|
N(Pe, null, {
|
|
2900
2896
|
default: X(() => {
|
|
2901
|
-
var
|
|
2897
|
+
var Ve;
|
|
2902
2898
|
return [
|
|
2903
|
-
|
|
2899
|
+
Re(y((Ve = o.purchaseOrder) == null ? void 0 : Ve.status), 1)
|
|
2904
2900
|
];
|
|
2905
2901
|
}),
|
|
2906
2902
|
_: 1
|
|
2907
2903
|
}),
|
|
2908
|
-
N(
|
|
2904
|
+
N(H, {
|
|
2909
2905
|
label: qe.value.status,
|
|
2910
2906
|
class: Le(qe.value.statusClass),
|
|
2911
2907
|
compact: ""
|
|
2912
2908
|
}, null, 8, ["label", "class"]),
|
|
2913
|
-
|
|
2909
|
+
S.value ? (i(), g("div", po, [
|
|
2914
2910
|
N(W, {
|
|
2915
2911
|
name: "local_shipping",
|
|
2916
2912
|
color: "#666666"
|
|
2917
2913
|
}),
|
|
2918
|
-
e("span", fo,
|
|
2919
|
-
])) :
|
|
2914
|
+
e("span", fo, y(S.value), 1)
|
|
2915
|
+
])) : M("", !0)
|
|
2920
2916
|
])
|
|
2921
2917
|
]),
|
|
2922
2918
|
N(te),
|
|
2923
2919
|
e("div", yo, [
|
|
2924
2920
|
e("div", vo, [
|
|
2925
2921
|
e("div", ho, [
|
|
2926
|
-
e("div", bo,
|
|
2922
|
+
e("div", bo, y(v(d)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
2927
2923
|
]),
|
|
2928
|
-
e("div", go,
|
|
2924
|
+
e("div", go, y(v(He)(((Z = t.purchaseOrder) == null ? void 0 : Z._id) ?? "")), 1)
|
|
2929
2925
|
]),
|
|
2930
|
-
(
|
|
2931
|
-
e("div", So,
|
|
2932
|
-
e("div", xo,
|
|
2933
|
-
])) :
|
|
2926
|
+
(ie = t.purchaseOrder) != null && ie.effectiveAt ? (i(), g("div", _o, [
|
|
2927
|
+
e("div", So, y(v(d)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
2928
|
+
e("div", xo, y(v(gt)(new Date((de = t.purchaseOrder) == null ? void 0 : de.effectiveAt))), 1)
|
|
2929
|
+
])) : M("", !0),
|
|
2934
2930
|
e("div", Oo, [
|
|
2935
|
-
e("div", wo,
|
|
2936
|
-
e("div", $o,
|
|
2937
|
-
`inventory.transfer.receiveRequest.details.type.${
|
|
2931
|
+
e("div", wo, y(v(d)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
2932
|
+
e("div", $o, y(v(d)(
|
|
2933
|
+
`inventory.transfer.receiveRequest.details.type.${I.value.toLocaleLowerCase("en-US")}`
|
|
2938
2934
|
)), 1)
|
|
2939
2935
|
]),
|
|
2940
|
-
(
|
|
2941
|
-
e("div", Ro,
|
|
2942
|
-
e("div", ko,
|
|
2943
|
-
])) :
|
|
2944
|
-
t.transferTo ? (i(),
|
|
2945
|
-
e("div", No,
|
|
2946
|
-
e("div", Ao,
|
|
2947
|
-
])) :
|
|
2948
|
-
(
|
|
2949
|
-
e("div",
|
|
2950
|
-
e("div",
|
|
2951
|
-
])) :
|
|
2952
|
-
(
|
|
2953
|
-
e("div", qo,
|
|
2954
|
-
e("div",
|
|
2955
|
-
])) :
|
|
2936
|
+
(ge = (ve = t.purchaseOrder) == null ? void 0 : ve.supplier) != null && ge.name ? (i(), g("div", Co, [
|
|
2937
|
+
e("div", Ro, y(v(d)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
2938
|
+
e("div", ko, y((ce = (Ce = t.purchaseOrder) == null ? void 0 : Ce.supplier) == null ? void 0 : ce.name), 1)
|
|
2939
|
+
])) : M("", !0),
|
|
2940
|
+
t.transferTo ? (i(), g("div", Do, [
|
|
2941
|
+
e("div", No, y(v(d)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
2942
|
+
e("div", Ao, y(t.transferTo), 1)
|
|
2943
|
+
])) : M("", !0),
|
|
2944
|
+
(me = t.purchaseOrder) != null && me.ref ? (i(), g("div", Fo, [
|
|
2945
|
+
e("div", To, y(v(d)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
2946
|
+
e("div", Io, y(t.purchaseOrder.ref), 1)
|
|
2947
|
+
])) : M("", !0),
|
|
2948
|
+
(Fe = t.purchaseOrder) != null && Fe.remark ? (i(), g("div", Po, [
|
|
2949
|
+
e("div", qo, y(v(d)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
2950
|
+
e("div", Vo, y(t.purchaseOrder.remark), 1)
|
|
2951
|
+
])) : M("", !0)
|
|
2956
2952
|
])
|
|
2957
2953
|
];
|
|
2958
2954
|
}),
|
|
@@ -2962,34 +2958,34 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
2962
2958
|
N(Xs, {
|
|
2963
2959
|
"po-request": t.poRequest,
|
|
2964
2960
|
purchaseOrder: t.purchaseOrder,
|
|
2965
|
-
transferType:
|
|
2961
|
+
transferType: I.value,
|
|
2966
2962
|
transferToDbName: t.transferToDbName,
|
|
2967
2963
|
scope: t.scope
|
|
2968
2964
|
}, null, 8, ["po-request", "purchaseOrder", "transferType", "transferToDbName", "scope"]),
|
|
2969
|
-
e("div",
|
|
2965
|
+
e("div", Eo, [
|
|
2970
2966
|
e("div", Lo, [
|
|
2971
|
-
e("div",
|
|
2972
|
-
e("span",
|
|
2973
|
-
|
|
2974
|
-
(ne = (L = t.purchaseOrder) == null ? void 0 : L.netSuite) != null && ne.missingItems && ((
|
|
2967
|
+
e("div", Mo, [
|
|
2968
|
+
e("span", Uo, [
|
|
2969
|
+
Re(y(ye.value ? v(d)("inventory.transfer.receiveRequest.details.receivedItems") : v(d)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
|
|
2970
|
+
(ne = (L = t.purchaseOrder) == null ? void 0 : L.netSuite) != null && ne.missingItems && ((Ne = (xe = t.purchaseOrder) == null ? void 0 : xe.netSuite) == null ? void 0 : Ne.missingItems.length) > 0 ? (i(), re(z, {
|
|
2975
2971
|
key: 0,
|
|
2976
2972
|
variant: "rich",
|
|
2977
2973
|
placement: "top",
|
|
2978
2974
|
"z-index": 51
|
|
2979
2975
|
}, {
|
|
2980
2976
|
content: X(() => {
|
|
2981
|
-
var Z,
|
|
2977
|
+
var Z, ie;
|
|
2982
2978
|
return [
|
|
2983
2979
|
e("div", Bo, [
|
|
2984
|
-
(i(!0),
|
|
2980
|
+
(i(!0), g(ue, null, Se((ie = (Z = t.purchaseOrder) == null ? void 0 : Z.netSuite) == null ? void 0 : ie.missingItems, (de, ve) => (i(), g("div", {
|
|
2985
2981
|
class: "flex justify-center align-middle",
|
|
2986
|
-
key:
|
|
2982
|
+
key: ve
|
|
2987
2983
|
}, [
|
|
2988
2984
|
N(W, {
|
|
2989
2985
|
name: "arrow_right",
|
|
2990
2986
|
size: "sm"
|
|
2991
2987
|
}),
|
|
2992
|
-
|
|
2988
|
+
Re(" " + y(`(${de.netSuiteId}) ${de.name}: ${de.reason}`), 1)
|
|
2993
2989
|
]))), 128))
|
|
2994
2990
|
])
|
|
2995
2991
|
];
|
|
@@ -3002,32 +2998,32 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
3002
2998
|
})
|
|
3003
2999
|
]),
|
|
3004
3000
|
_: 1
|
|
3005
|
-
})) :
|
|
3001
|
+
})) : M("", !0)
|
|
3006
3002
|
])
|
|
3007
3003
|
]),
|
|
3008
3004
|
N(te),
|
|
3009
|
-
(i(!0),
|
|
3005
|
+
(i(!0), g(ue, null, Se(((Ae = t.purchaseOrder) == null ? void 0 : Ae.items) ?? [], (Z, ie) => {
|
|
3010
3006
|
var de;
|
|
3011
|
-
return i(),
|
|
3012
|
-
key:
|
|
3007
|
+
return i(), g("div", {
|
|
3008
|
+
key: ie,
|
|
3013
3009
|
class: "flex flex-col"
|
|
3014
3010
|
}, [
|
|
3015
3011
|
e("div", jo, [
|
|
3016
3012
|
e("div", zo, [
|
|
3017
|
-
|
|
3018
|
-
|
|
3013
|
+
Re(y(Z.name) + " ", 1),
|
|
3014
|
+
T(Z) ? (i(), re(z, {
|
|
3019
3015
|
key: 0,
|
|
3020
3016
|
variant: "rich",
|
|
3021
3017
|
placement: "top",
|
|
3022
3018
|
"z-index": 51
|
|
3023
3019
|
}, {
|
|
3024
3020
|
content: X(() => {
|
|
3025
|
-
var
|
|
3021
|
+
var ve, ge;
|
|
3026
3022
|
return [
|
|
3027
3023
|
e("div", Ko, [
|
|
3028
3024
|
p[9] || (p[9] = e("div", { class: "font-semibold" }, "Submission changes", -1)),
|
|
3029
|
-
e("div", null, "Original Amount: " +
|
|
3030
|
-
e("div", null, " New Amount: " +
|
|
3025
|
+
e("div", null, "Original Amount: " + y((ve = j(Z)) == null ? void 0 : ve.originalAmount), 1),
|
|
3026
|
+
e("div", null, " New Amount: " + y((ge = j(Z)) == null ? void 0 : ge.newAmount), 1)
|
|
3031
3027
|
])
|
|
3032
3028
|
];
|
|
3033
3029
|
}),
|
|
@@ -3039,44 +3035,44 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
3039
3035
|
})
|
|
3040
3036
|
]),
|
|
3041
3037
|
_: 2
|
|
3042
|
-
}, 1024)) :
|
|
3038
|
+
}, 1024)) : M("", !0)
|
|
3043
3039
|
]),
|
|
3044
|
-
e("div",
|
|
3040
|
+
e("div", Go, [
|
|
3045
3041
|
e("span", {
|
|
3046
3042
|
innerHTML: ae(Z)
|
|
3047
|
-
}, null, 8,
|
|
3043
|
+
}, null, 8, Ho)
|
|
3048
3044
|
])
|
|
3049
3045
|
]),
|
|
3050
3046
|
e("div", Wo, [
|
|
3051
|
-
e("div", Qo,
|
|
3052
|
-
(de = Z.totalCost) != null && de.amount && v(_).enableTotalCost ? (i(),
|
|
3047
|
+
e("div", Qo, y(Z.code), 1),
|
|
3048
|
+
(de = Z.totalCost) != null && de.amount && v(_).enableTotalCost ? (i(), g("div", Yo, " (" + y(v(ze)(Z.totalCost)) + ") ", 1)) : M("", !0)
|
|
3053
3049
|
])
|
|
3054
3050
|
]);
|
|
3055
3051
|
}), 128)),
|
|
3056
|
-
+v(
|
|
3052
|
+
+v(he)(U.value) ? (i(), g(ue, { key: 0 }, [
|
|
3057
3053
|
e("div", Jo, [
|
|
3058
3054
|
N(te)
|
|
3059
3055
|
]),
|
|
3060
3056
|
e("div", Xo, [
|
|
3061
3057
|
p[10] || (p[10] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
|
|
3062
|
-
e("div", Zo,
|
|
3058
|
+
e("div", Zo, y(v(ze)(U.value)), 1)
|
|
3063
3059
|
])
|
|
3064
|
-
], 64)) :
|
|
3060
|
+
], 64)) : M("", !0)
|
|
3065
3061
|
])
|
|
3066
3062
|
])
|
|
3067
|
-
], 64)) :
|
|
3068
|
-
q.value.length ? (i(),
|
|
3069
|
-
(i(!0),
|
|
3070
|
-
var de,
|
|
3071
|
-
return i(),
|
|
3063
|
+
], 64)) : G.value.value === "deliveryHistory" ? (i(), g("div", en, [
|
|
3064
|
+
q.value.length ? (i(), g("div", nn, [
|
|
3065
|
+
(i(!0), g(ue, null, Se(q.value, (Z, ie) => {
|
|
3066
|
+
var de, ve, ge, Ce, ce;
|
|
3067
|
+
return i(), g(ue, { key: ie }, [
|
|
3072
3068
|
e("div", an, [
|
|
3073
3069
|
e("div", ln, [
|
|
3074
3070
|
e("div", cn, [
|
|
3075
3071
|
e("div", {
|
|
3076
3072
|
class: Le([
|
|
3077
3073
|
{
|
|
3078
|
-
"bg-fm-color-primary":
|
|
3079
|
-
"bg-white":
|
|
3074
|
+
"bg-fm-color-primary": ie !== 0,
|
|
3075
|
+
"bg-white": ie === 0
|
|
3080
3076
|
},
|
|
3081
3077
|
"w-[2px] h-full"
|
|
3082
3078
|
])
|
|
@@ -3088,14 +3084,14 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
3088
3084
|
name: "local_shipping",
|
|
3089
3085
|
outline: "",
|
|
3090
3086
|
color: "#ffffff"
|
|
3091
|
-
})) :
|
|
3087
|
+
})) : M("", !0)
|
|
3092
3088
|
]),
|
|
3093
3089
|
e("div", dn, [
|
|
3094
3090
|
e("div", {
|
|
3095
3091
|
class: Le([
|
|
3096
3092
|
{
|
|
3097
|
-
"bg-fm-color-primary":
|
|
3098
|
-
"bg-white":
|
|
3093
|
+
"bg-fm-color-primary": ie < q.value.length - 1,
|
|
3094
|
+
"bg-white": ie >= q.value.length - 1
|
|
3099
3095
|
},
|
|
3100
3096
|
"w-[2px] h-full"
|
|
3101
3097
|
])
|
|
@@ -3104,8 +3100,8 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
3104
3100
|
]),
|
|
3105
3101
|
e("div", mn, [
|
|
3106
3102
|
e("div", pn, [
|
|
3107
|
-
e("div", fn,
|
|
3108
|
-
e("div", yn,
|
|
3103
|
+
e("div", fn, y(Z.header), 1),
|
|
3104
|
+
e("div", yn, y(Z.date), 1)
|
|
3109
3105
|
]),
|
|
3110
3106
|
e("div", vn, [
|
|
3111
3107
|
Z.header === "Received" && Z.deliveryOrder && t.purchaseOrder ? (i(), re(hr, {
|
|
@@ -3115,23 +3111,23 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
3115
3111
|
onSubmitted: p[3] || (p[3] = () => {
|
|
3116
3112
|
f("update:show", !1), f("submitted");
|
|
3117
3113
|
})
|
|
3118
|
-
}, null, 8, ["deliveryOrder", "purchaseOrder"])) :
|
|
3119
|
-
(
|
|
3114
|
+
}, null, 8, ["deliveryOrder", "purchaseOrder"])) : M("", !0),
|
|
3115
|
+
(ve = (de = Z.deliveryOrder) == null ? void 0 : de.netSuite) != null && ve.id ? (i(), re(Pe, { key: 1 }, {
|
|
3120
3116
|
default: X(() => {
|
|
3121
|
-
var
|
|
3117
|
+
var me, Fe;
|
|
3122
3118
|
return [
|
|
3123
3119
|
N(oo, {
|
|
3124
|
-
"netsuite-id": (
|
|
3120
|
+
"netsuite-id": (Fe = (me = Z.deliveryOrder) == null ? void 0 : me.netSuite) == null ? void 0 : Fe.id
|
|
3125
3121
|
}, null, 8, ["netsuite-id"])
|
|
3126
3122
|
];
|
|
3127
3123
|
}),
|
|
3128
3124
|
_: 2
|
|
3129
|
-
}, 1024)) :
|
|
3130
|
-
t.purchaseOrder && ((
|
|
3125
|
+
}, 1024)) : M("", !0),
|
|
3126
|
+
t.purchaseOrder && ((ge = Z.deliveryOrder) != null && ge.id) ? (i(), re(Mt, {
|
|
3131
3127
|
key: 2,
|
|
3132
|
-
"purchase-order-id": (
|
|
3133
|
-
"delivery-order-id": (
|
|
3134
|
-
}, null, 8, ["purchase-order-id", "delivery-order-id"])) :
|
|
3128
|
+
"purchase-order-id": (Ce = t.purchaseOrder) == null ? void 0 : Ce._id,
|
|
3129
|
+
"delivery-order-id": (ce = Z.deliveryOrder) == null ? void 0 : ce.id
|
|
3130
|
+
}, null, 8, ["purchase-order-id", "delivery-order-id"])) : M("", !0)
|
|
3135
3131
|
])
|
|
3136
3132
|
])
|
|
3137
3133
|
]),
|
|
@@ -3141,8 +3137,8 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
3141
3137
|
e("div", {
|
|
3142
3138
|
class: Le([
|
|
3143
3139
|
{
|
|
3144
|
-
"bg-fm-color-primary":
|
|
3145
|
-
"bg-white":
|
|
3140
|
+
"bg-fm-color-primary": ie < q.value.length - 1,
|
|
3141
|
+
"bg-white": ie >= q.value.length - 1
|
|
3146
3142
|
},
|
|
3147
3143
|
"w-[2px] h-full"
|
|
3148
3144
|
])
|
|
@@ -3156,19 +3152,19 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
3156
3152
|
}, {
|
|
3157
3153
|
default: X(() => [
|
|
3158
3154
|
e("div", Sn, [
|
|
3159
|
-
(i(!0),
|
|
3160
|
-
key:
|
|
3155
|
+
(i(!0), g(ue, null, Se(Z.info, (me, Fe) => (i(), g("div", {
|
|
3156
|
+
key: Fe,
|
|
3161
3157
|
class: "flex flex-col gap-4"
|
|
3162
3158
|
}, [
|
|
3163
|
-
e("div", xn,
|
|
3159
|
+
e("div", xn, y(me == null ? void 0 : me.label), 1),
|
|
3164
3160
|
e("div", On, [
|
|
3165
|
-
(i(!0),
|
|
3161
|
+
(i(!0), g(ue, null, Se(me == null ? void 0 : me.values, (Ve, Ot) => (i(), g("div", {
|
|
3166
3162
|
key: Ot,
|
|
3167
3163
|
class: "fm-typo-en-body-lg-600"
|
|
3168
3164
|
}, [
|
|
3169
|
-
typeof
|
|
3170
|
-
|
|
3171
|
-
], 64)) : (i(), re(kt(
|
|
3165
|
+
typeof Ve == "string" ? (i(), g(ue, { key: 0 }, [
|
|
3166
|
+
Re(y(Ve), 1)
|
|
3167
|
+
], 64)) : (i(), re(kt(Ve), { key: 1 }))
|
|
3172
3168
|
]))), 128))
|
|
3173
3169
|
])
|
|
3174
3170
|
]))), 128))
|
|
@@ -3180,58 +3176,58 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
3180
3176
|
])
|
|
3181
3177
|
], 64);
|
|
3182
3178
|
}), 128))
|
|
3183
|
-
])) : (i(),
|
|
3179
|
+
])) : (i(), g("div", tn, [
|
|
3184
3180
|
N(le),
|
|
3185
3181
|
e("div", null, [
|
|
3186
3182
|
e("img", {
|
|
3187
|
-
src: v(
|
|
3183
|
+
src: v(qt),
|
|
3188
3184
|
alt: "List is empty"
|
|
3189
3185
|
}, null, 8, sn)
|
|
3190
3186
|
]),
|
|
3191
|
-
e("div", rn,
|
|
3192
|
-
e("div", on,
|
|
3187
|
+
e("div", rn, y(v(d)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
3188
|
+
e("div", on, y(v(d)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
|
|
3193
3189
|
N(le),
|
|
3194
3190
|
N(le)
|
|
3195
3191
|
]))
|
|
3196
|
-
])) :
|
|
3192
|
+
])) : M("", !0)
|
|
3197
3193
|
])
|
|
3198
3194
|
];
|
|
3199
3195
|
}),
|
|
3200
3196
|
"side-sheet-footer": X(() => [
|
|
3201
3197
|
e("div", wn, [
|
|
3202
|
-
(i(!0),
|
|
3203
|
-
v(
|
|
3198
|
+
(i(!0), g(ue, null, Se(P.value, (L) => (i(), g(ue, null, [
|
|
3199
|
+
v(rt)[L].available != !1 ? (i(), re(A, {
|
|
3204
3200
|
key: L,
|
|
3205
|
-
label: v(
|
|
3206
|
-
onClick: (ne) =>
|
|
3201
|
+
label: v(d)(v(rt)[L].translationKey),
|
|
3202
|
+
onClick: (ne) => fe(L),
|
|
3207
3203
|
loading: l.value === L,
|
|
3208
3204
|
disabled: l.value !== L && F.value,
|
|
3209
|
-
variant: v(
|
|
3210
|
-
}, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) :
|
|
3205
|
+
variant: v(rt)[L].buttonVariant
|
|
3206
|
+
}, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : M("", !0)
|
|
3211
3207
|
], 64))), 256)),
|
|
3212
|
-
v(w).ableToMarkReceived(t.purchaseOrder) && !
|
|
3208
|
+
v(w).ableToMarkReceived(t.purchaseOrder) && !P.value.includes("completeReceive") ? (i(), re(A, {
|
|
3213
3209
|
key: 0,
|
|
3214
|
-
label: v(
|
|
3215
|
-
onClick: p[4] || (p[4] = (L) =>
|
|
3210
|
+
label: v(d)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
3211
|
+
onClick: p[4] || (p[4] = (L) => fe("completeReceive")),
|
|
3216
3212
|
loading: l.value === "completeReceive",
|
|
3217
3213
|
disabled: l.value !== "completeReceive" && F.value
|
|
3218
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
3219
|
-
v(w).ableToMarkApproved(t.purchaseOrder) && t.canApprove && !
|
|
3214
|
+
}, null, 8, ["label", "loading", "disabled"])) : M("", !0),
|
|
3215
|
+
v(w).ableToMarkApproved(t.purchaseOrder) && t.canApprove && !P.value.includes("approveRequest") ? (i(), re(A, {
|
|
3220
3216
|
key: 1,
|
|
3221
|
-
label: v(
|
|
3222
|
-
onClick: p[5] || (p[5] = (L) =>
|
|
3217
|
+
label: v(d)("inventory.transfer.approval.actions.approveRequest"),
|
|
3218
|
+
onClick: p[5] || (p[5] = (L) => fe("approveRequest")),
|
|
3223
3219
|
loading: l.value === "approveRequest",
|
|
3224
3220
|
disabled: l.value !== "approveRequest" && F.value
|
|
3225
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
3226
|
-
v(w).ableToCreateFulfillment(t.purchaseOrder, t.poRequest) &&
|
|
3221
|
+
}, null, 8, ["label", "loading", "disabled"])) : M("", !0),
|
|
3222
|
+
v(w).ableToCreateFulfillment(t.purchaseOrder, t.poRequest) && o.scope === "approval" ? (i(), re(A, {
|
|
3227
3223
|
key: 2,
|
|
3228
|
-
label: v(
|
|
3229
|
-
onClick: p[6] || (p[6] = (L) =>
|
|
3224
|
+
label: v(d)("inventory.transfer.receiveRequest.actions.processRequest"),
|
|
3225
|
+
onClick: p[6] || (p[6] = (L) => fe("processRequest")),
|
|
3230
3226
|
loading: l.value === "processRequest",
|
|
3231
3227
|
disabled: l.value !== "processRequest" && F.value
|
|
3232
|
-
}, null, 8, ["label", "loading", "disabled"])) :
|
|
3228
|
+
}, null, 8, ["label", "loading", "disabled"])) : M("", !0),
|
|
3233
3229
|
N(A, {
|
|
3234
|
-
label: v(
|
|
3230
|
+
label: v(d)("common.close"),
|
|
3235
3231
|
variant: "tertiary",
|
|
3236
3232
|
onClick: p[7] || (p[7] = (L) => f("update:show", !1))
|
|
3237
3233
|
}, null, 8, ["label"])
|
|
@@ -3243,7 +3239,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ Oe({
|
|
|
3243
3239
|
}
|
|
3244
3240
|
});
|
|
3245
3241
|
export {
|
|
3246
|
-
|
|
3242
|
+
at as P,
|
|
3247
3243
|
Yn as _,
|
|
3248
3244
|
Qn as a,
|
|
3249
3245
|
Yt as g,
|