@feedmepos/mf-inventory-portal 1.2.42-dev.2 → 1.2.42
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-tCZXxWWi.js → App-DtXK9euh.js} +3 -3
- package/dist/{ApprovalView-DsoqQiwe.js → ApprovalView-Dbgrg06o.js} +6 -6
- package/dist/{BindingsDialog-BCXWR50h.js → BindingsDialog-CmdawNsd.js} +8 -8
- package/dist/{BindingsPicker-B3O_g_Nv.js → BindingsPicker-D69EpcEe.js} +3 -3
- package/dist/{BindingsTable-C9WLnkpX.js → BindingsTable-DWmPKyfq.js} +3 -3
- package/dist/ClosingDraftView-MP_8pz-s.js +2122 -0
- package/dist/{ClosingHistoryView-DZnzhSNn.js → ClosingHistoryView-R8R3Uh7o.js} +22 -22
- package/dist/{ClosingTemplateView-VKu9x3Nz.js → ClosingTemplateView-DvxGKgi5.js} +15 -15
- package/dist/{DeliveryOrderPrintPreview-CD_43MIv.js → DeliveryOrderPrintPreview-D72ZCCD0.js} +9 -9
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DbVm-oVE.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D0_DI2RM.js} +60 -59
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-UocERxk1.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-10nrUrma.js} +2 -2
- package/dist/{FmMultiselectDialog-CsohyGSW.js → FmMultiselectDialog-CDG-TGVz.js} +2 -2
- package/dist/{FmMultiselectDialog-BnSC4X04.js → FmMultiselectDialog-Cu1rrU1D.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BiRrQ1MQ.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CBjUDNbp.js} +3 -3
- package/dist/{ImportView-uqB1qMsv.js → ImportView-D6xhqe-Q.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CfypjWW9.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-QqXJLVHH.js} +1 -1
- package/dist/{IngredientGroupView-eN4sBErO.js → IngredientGroupView-ii3vnUZZ.js} +6 -6
- package/dist/{IngredientsView-DQvn_4YD.js → IngredientsView-PEJSbU0k.js} +15 -15
- package/dist/{IntegrationView-DCy2Ovro.js → IntegrationView-BT1gaSY6.js} +12 -12
- package/dist/{InventoryBindingForm-Bi_8m5gH.js → InventoryBindingForm-Cne6-kuv.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CO_qBo1J.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BElyB9Bl.js} +14 -14
- package/dist/{InventoryBindingSummary-BGFGNEaq.js → InventoryBindingSummary-DFT9v5ol.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CTzDO5jB.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DaHkM-BT.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Bcs3g9F2.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Cjv7KcJ4.js} +2 -2
- package/dist/{PublishView-BX8Ed4Fw.js → PublishView-DQrfrhE4.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-D6N8SLTM.js → PurchaseOrderPrintPreview-Chx37AA-.js} +9 -9
- package/dist/ReceiveRequestView-BoSyXZpP.js +2841 -0
- package/dist/{RecipeView-qjmtVVz0.js → RecipeView-wmMe34eS.js} +9 -9
- package/dist/{StockView-CKjuCvQc.js → StockView-CT3gj0bi.js} +342 -345
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BpsE9HjF.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BURlS6_T.js} +1 -1
- package/dist/{SupplierView-0Wkmi0vZ.js → SupplierView-DPV9FxB5.js} +12 -12
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-js9xKiOh.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-Dy43ya9v.js} +2 -2
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js +162 -0
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CFQjYlPf.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CsM4QiJy.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-EHUIhMvO.js → TransferDetails.vue_vue_type_script_setup_true_lang-BZUCFAt1.js} +431 -431
- package/dist/{TransferTemplateView-B686QVLm.js → TransferTemplateView-r5_D5Uoq.js} +355 -355
- package/dist/{UnitView-D3TwY-Rl.js → UnitView-Lat5ebwQ.js} +7 -7
- package/dist/{WarehouseView-wuSCGpc4.js → WarehouseView-OyG_RNCJ.js} +6 -6
- package/dist/{WastageTemplateView-BhVG1haN.js → WastageTemplateView-BsNcFdwO.js} +15 -15
- package/dist/api/closing-draft.d.ts +1 -0
- package/dist/{app-lUdYxPdT.js → app-BKNLF6m8.js} +2302 -2346
- package/dist/app.d.ts +3 -0
- package/dist/app.js +7 -7
- package/dist/{closing-template-5nZX2GD3.js → closing-template-BqKkRwOR.js} +1 -1
- package/dist/{date2-BPDWKAmI.js → date2-CPwYAyn5.js} +1 -1
- package/dist/{dayjs.min-CRgiNB25.js → dayjs.min-GA1Bp4dz.js} +21 -21
- package/dist/{decimal-xfLGGBXv.js → decimal-Di9UOYVh.js} +2 -2
- package/dist/{defineDeepModel-D_Oxy2Kx.js → defineDeepModel-BeUc-GyS.js} +1 -1
- package/dist/{duplicate-template-Blu_HX7A.js → duplicate-template-CPBBWXPV.js} +1 -1
- package/dist/feature-BHauwKBN.js +20162 -0
- package/dist/{format-time-from-id-DUZwcLw9.js → format-time-from-id-CYrBLIMG.js} +1 -1
- package/dist/{format-unit-display-D-X5mzYF.js → format-unit-display-DdLrmVRx.js} +246 -245
- package/dist/helper/component.d.ts +1 -1
- package/dist/helper/object.d.ts +0 -21
- package/dist/{import-export.helper-BgbvcSvd.js → import-export.helper-CdNxlvYU.js} +5 -5
- package/dist/{index-BaMcL6nD.js → index-B-9oJBGk.js} +9 -9
- package/dist/{index-tnlv1Cb_.js → index-BmtNZLpm.js} +1 -1
- package/dist/{index-BvxQIPJI.js → index-DmM3AECr.js} +3 -3
- package/dist/{lodash-C9Qka4SS.js → lodash--jDaTvRg.js} +1 -1
- package/dist/{netsuite-Dns3RQor.js → netsuite-D1TanQZF.js} +70 -70
- package/dist/{purchase-order-template-Yfp5lQ6o.js → purchase-order-template-CkP2Bv2a.js} +1 -1
- package/dist/{rules-2gDRiI3y.js → rules-VFDmrMwu.js} +3 -3
- package/dist/{stock-DMwTxyEy.js → stock-BoT5SHQs.js} +3 -3
- package/dist/{stock-D3amnnvm.js → stock-D73TmDS2.js} +1 -1
- package/dist/{supplier-Bi2nswlc.js → supplier-KMVv2AQj.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-B3j2244S.js → use-ingredient-select-dialog-BUghUhSb.js} +2 -2
- package/dist/{use-inventory-binding-dialog-cEzQyw4F.js → use-inventory-binding-dialog-CWOyVIFk.js} +2 -2
- package/dist/{use-template-enabled-locations-2-CnbMSpm9.js → use-template-enabled-locations-2-CxHgMmfO.js} +2 -2
- package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +4 -1
- package/dist/views/receive-request/components/netsuite/NetSuitePanel.vue.d.ts +2 -3
- package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +2 -3
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +2554 -23
- package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +0 -6
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +2 -3
- 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/constants/purchase-order-transaction-type.d.ts +4 -0
- package/dist/views/receive-request/helper/get-transfer-type.d.ts +2 -1
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +2 -3
- package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItemProps.d.ts +2 -3
- package/dist/views/transfer-template/helpers/import-export.helper.d.ts +3 -4
- package/dist/{vue-i18n-D6IE7fks.js → vue-i18n-DxedrFlV.js} +523 -523
- package/dist/{xlsx-By0V1CHo.js → xlsx-Dp__km89.js} +398 -398
- package/dist/{xlsx.util-DH2bvm7W.js → xlsx.util-BkGzpJpQ.js} +1 -1
- package/package.json +3 -3
- package/dist/ClosingDraftView-SgUfLfsI.js +0 -2089
- package/dist/ReceiveRequestView-CbP7cF9S.js +0 -2873
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +0 -135
- package/dist/feature-BQk-YWoV.js +0 -25699
- package/dist/helper/reactivity.d.ts +0 -11
- package/dist/helper/reactivity.spec.d.ts +0 -1
- package/dist/views/receive-request/components/transfer-form/composables/use-purchase-order-form-controller.d.ts +0 -22
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { p as wt, f as
|
|
2
|
-
import { ref as J, computed as Y, h as
|
|
3
|
-
import { c as dt } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { p as wt, f as Ge } from "./format-time-from-id-CYrBLIMG.js";
|
|
2
|
+
import { ref as J, computed as Y, h as V, 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
|
+
import { c as dt } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
|
|
4
4
|
import { R as pe, D as _e } from "./row-action.enum-BcW_L_nE.js";
|
|
5
|
-
import { o as Dt, u as ke,
|
|
6
|
-
import { l as
|
|
7
|
-
import { F as At } from "./decimal-
|
|
8
|
-
import { t as Ft, c as Tt, h as gt, a as
|
|
9
|
-
import { u as Me, F as
|
|
5
|
+
import { o as Dt, u as ke, P as E, Q as Xe, K as ee, C as Nt, c as yt, t as lt, T as vt, H as $e, z as We, s as Pe, A as Te } from "./app-BKNLF6m8.js";
|
|
6
|
+
import { l as bt, d as ht, a as be, t as Qe, e as ze } from "./rules-VFDmrMwu.js";
|
|
7
|
+
import { F as At } from "./decimal-Di9UOYVh.js";
|
|
8
|
+
import { t as Ft, c as Tt, h as gt, a as Ke } from "./date2-CPwYAyn5.js";
|
|
9
|
+
import { u as Me, F as Pt, a as tt } from "./feature-BHauwKBN.js";
|
|
10
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-
|
|
12
|
-
import { useDialog as et, useSnackbar as Ue, components as Ye, FmButtonVariant as
|
|
13
|
-
import { F as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { u as Be, _ as Mt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-
|
|
17
|
-
import { _ as Ut, a as Bt, b as jt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
11
|
+
import { u as Ze, a as ut, S as Oe } from "./netsuite-D1TanQZF.js";
|
|
12
|
+
import { useDialog as et, useSnackbar as Ue, components as Ye, FmButtonVariant as he, useProxiedModel as It } from "@feedmepos/ui-library";
|
|
13
|
+
import { F as Ie } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
|
|
14
|
+
import { u as qt, a as Et, P as He, f as Vt } from "./format-unit-display-DdLrmVRx.js";
|
|
15
|
+
import { E as Lt } from "./empty-placeholder-wf6-BWE8.js";
|
|
16
|
+
import { u as Be, _ as Mt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-Dy43ya9v.js";
|
|
17
|
+
import { _ as Ut, a as Bt, b as jt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CBjUDNbp.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-B-9oJBGk.js";
|
|
20
|
+
import { i as Ht } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-10nrUrma.js";
|
|
21
21
|
import { F as pt } from "./form-mode.enum-BKiNVH6A.js";
|
|
22
|
-
import { d as _t } from "./defineDeepModel-
|
|
23
|
-
import { u as
|
|
22
|
+
import { d as _t } from "./defineDeepModel-BeUc-GyS.js";
|
|
23
|
+
import { u as Gt } from "./vue-i18n-DxedrFlV.js";
|
|
24
24
|
const Wt = Dt((k, a) => {
|
|
25
25
|
const o = ke();
|
|
26
26
|
return {
|
|
27
27
|
async getShipments({
|
|
28
28
|
start: f,
|
|
29
|
-
end:
|
|
29
|
+
end: b
|
|
30
30
|
}) {
|
|
31
31
|
const n = o.currentLocationDBName, _ = `${k.inventoryBackendUrl}/${n}/shipments`;
|
|
32
|
-
return await a.get(`${_}?start=${f}&end=${
|
|
32
|
+
return await a.get(`${_}?start=${f}&end=${b}`);
|
|
33
33
|
},
|
|
34
34
|
async getShipmentsByIds(f) {
|
|
35
35
|
if (f.length === 0)
|
|
36
36
|
return [];
|
|
37
|
-
const
|
|
37
|
+
const b = o.currentLocationDBName, n = `${k.inventoryBackendUrl}/${b}/shipments/get`;
|
|
38
38
|
return await a.post(n, { shipmentIds: f });
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}), St = {
|
|
42
|
-
[
|
|
42
|
+
[E.enum.confirmDraft]: {
|
|
43
43
|
primaryActions: {
|
|
44
44
|
text: "Confirm draft",
|
|
45
45
|
close: !0
|
|
@@ -48,7 +48,7 @@ const Wt = Dt((k, a) => {
|
|
|
48
48
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
49
49
|
successMessage: "Purchase order draft has been confirmed"
|
|
50
50
|
},
|
|
51
|
-
[
|
|
51
|
+
[E.enum.cancelDraft]: {
|
|
52
52
|
primaryActions: {
|
|
53
53
|
text: "Cancel draft",
|
|
54
54
|
close: !0,
|
|
@@ -58,7 +58,7 @@ const Wt = Dt((k, a) => {
|
|
|
58
58
|
message: "Purchase order cannot be changed after cancelled draft.",
|
|
59
59
|
successMessage: "Purchase order draft has been cancelled"
|
|
60
60
|
},
|
|
61
|
-
[
|
|
61
|
+
[E.enum.submitRequest]: {
|
|
62
62
|
primaryActions: {
|
|
63
63
|
text: "Submit request",
|
|
64
64
|
close: !0
|
|
@@ -67,7 +67,7 @@ const Wt = Dt((k, a) => {
|
|
|
67
67
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
68
68
|
successMessage: "Purchase order draft has been submitted"
|
|
69
69
|
},
|
|
70
|
-
[
|
|
70
|
+
[E.enum.completeReceive]: {
|
|
71
71
|
primaryActions: {
|
|
72
72
|
text: "Mark received",
|
|
73
73
|
close: !0
|
|
@@ -76,7 +76,7 @@ const Wt = Dt((k, a) => {
|
|
|
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
|
+
[E.enum.approveRequest]: {
|
|
80
80
|
primaryActions: {
|
|
81
81
|
text: "Accept request",
|
|
82
82
|
close: !0
|
|
@@ -85,7 +85,7 @@ const Wt = Dt((k, a) => {
|
|
|
85
85
|
message: "Transfer out request will be accepted.",
|
|
86
86
|
successMessage: "Transfer out request has been approved"
|
|
87
87
|
},
|
|
88
|
-
[
|
|
88
|
+
[E.enum.rejectRequest]: {
|
|
89
89
|
primaryActions: {
|
|
90
90
|
text: "Reject request",
|
|
91
91
|
close: !0,
|
|
@@ -95,7 +95,7 @@ const Wt = Dt((k, a) => {
|
|
|
95
95
|
message: "Purchase order will be rejected.",
|
|
96
96
|
successMessage: "Purchase order has been rejected"
|
|
97
97
|
},
|
|
98
|
-
[
|
|
98
|
+
[E.enum.processRequest]: {
|
|
99
99
|
primaryActions: {
|
|
100
100
|
text: "Process request",
|
|
101
101
|
close: !0,
|
|
@@ -135,28 +135,28 @@ function xt() {
|
|
|
135
135
|
const k = ke(), a = Be(), o = Me();
|
|
136
136
|
async function f(n, _) {
|
|
137
137
|
const r = k.currentLocationDBName;
|
|
138
|
-
return n.doc.supplier.internal && n.operation ===
|
|
138
|
+
return n.doc.supplier.internal && n.operation === E.enum.confirmDraft && (n.operation = E.enum.submitRequest), await a.processPurchaseOrder(n, _ || r);
|
|
139
139
|
}
|
|
140
|
-
async function
|
|
140
|
+
async function b(n, _) {
|
|
141
141
|
const r = k.currentLocationDBName;
|
|
142
142
|
return await a.processPurchaseOrderV2(n, _ || r);
|
|
143
143
|
}
|
|
144
|
-
return (n) => o.useOperatePurchaseOrderV2 ?
|
|
144
|
+
return (n) => o.useOperatePurchaseOrderV2 ? b(n.operateV2, n.transferTo) : f(n.operate, n.transferTo);
|
|
145
145
|
}
|
|
146
146
|
var at = /* @__PURE__ */ ((k) => (k.RECEIVE_REQUEST = "receive/request", k.APPROVAL = "approval", k))(at || {});
|
|
147
147
|
const je = J(), st = J();
|
|
148
148
|
function Wn(k, a) {
|
|
149
|
-
const o = et(), f = ke(),
|
|
149
|
+
const o = et(), f = ke(), b = Me();
|
|
150
150
|
Ze();
|
|
151
|
-
const n =
|
|
152
|
-
a != null && a.startDate && (a != null && a.endDate) ? a :
|
|
151
|
+
const n = qt(), _ = Et(), r = J(!1), c = Ue(), O = Be(), w = Wt(), d = J(new Array()), P = J(new Array()), S = J(
|
|
152
|
+
a != null && a.startDate && (a != null && a.endDate) ? a : Ht()
|
|
153
153
|
), F = Y(() => {
|
|
154
154
|
const q = new Date(S.value.startDate), U = new Date(S.value.endDate);
|
|
155
155
|
return {
|
|
156
156
|
start: Ft(q).toISOString(),
|
|
157
157
|
end: Tt(U).toISOString()
|
|
158
158
|
};
|
|
159
|
-
}), l = J(new Array()), s = Nt(),
|
|
159
|
+
}), l = J(new Array()), s = Nt(), h = J(null);
|
|
160
160
|
async function u(q) {
|
|
161
161
|
function U(D) {
|
|
162
162
|
const x = {
|
|
@@ -167,12 +167,12 @@ function Wn(k, a) {
|
|
|
167
167
|
je.value.show = T;
|
|
168
168
|
},
|
|
169
169
|
templateId: D,
|
|
170
|
-
lastClosingDate:
|
|
170
|
+
lastClosingDate: h.value
|
|
171
171
|
};
|
|
172
172
|
je.value = x;
|
|
173
173
|
}
|
|
174
174
|
let ae;
|
|
175
|
-
|
|
175
|
+
b.mustUsePoTemplate && !(q != null && q.template) ? o.open({
|
|
176
176
|
title: "Create transfer",
|
|
177
177
|
message: "",
|
|
178
178
|
primaryActions: {
|
|
@@ -198,19 +198,19 @@ function Wn(k, a) {
|
|
|
198
198
|
"onUpdate:show"(ae) {
|
|
199
199
|
je.value.show = ae;
|
|
200
200
|
},
|
|
201
|
-
lastClosingDate:
|
|
201
|
+
lastClosingDate: h.value
|
|
202
202
|
};
|
|
203
203
|
je.value = U;
|
|
204
204
|
}
|
|
205
|
-
async function
|
|
206
|
-
d.value = [],
|
|
205
|
+
async function I() {
|
|
206
|
+
d.value = [], P.value = [], r.value = !0;
|
|
207
207
|
try {
|
|
208
208
|
const q = await O.getPurchaseOrders(F.value);
|
|
209
209
|
d.value = q.sort((j, t) => t._id.localeCompare(j._id));
|
|
210
210
|
const U = q.flatMap((j) => j.shipmentIds || []).filter(Boolean), ae = U.length > 0 ? await w.getShipmentsByIds(U) : [];
|
|
211
|
-
|
|
211
|
+
P.value = ae;
|
|
212
212
|
const D = await s.readCurrentLocationLastClosing(!0), x = D == null ? void 0 : D._id;
|
|
213
|
-
x && (
|
|
213
|
+
x && (h.value = wt(x)), await b.awaitFeatureLoaded(() => b.mustUsePoTemplate) && await _.fetchTemplates();
|
|
214
214
|
const T = d.value.map((j) => {
|
|
215
215
|
var t;
|
|
216
216
|
return ((t = j.request) == null ? void 0 : t.id) ?? "";
|
|
@@ -247,12 +247,12 @@ function Wn(k, a) {
|
|
|
247
247
|
function C() {
|
|
248
248
|
switch (k) {
|
|
249
249
|
case "receive/request":
|
|
250
|
-
return
|
|
250
|
+
return I();
|
|
251
251
|
case "approval":
|
|
252
252
|
return B();
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function H(q, U) {
|
|
256
256
|
S.value = {
|
|
257
257
|
startDate: q,
|
|
258
258
|
endDate: U
|
|
@@ -287,7 +287,7 @@ function Wn(k, a) {
|
|
|
287
287
|
},
|
|
288
288
|
scope: k,
|
|
289
289
|
receivedMap: Je(q) ?? {},
|
|
290
|
-
shipments:
|
|
290
|
+
shipments: P.value
|
|
291
291
|
};
|
|
292
292
|
Q.value = T;
|
|
293
293
|
}
|
|
@@ -301,8 +301,8 @@ function Wn(k, a) {
|
|
|
301
301
|
doc: q,
|
|
302
302
|
options: (
|
|
303
303
|
// auto receive for supplier to warehouse
|
|
304
|
-
(U ===
|
|
305
|
-
U ===
|
|
304
|
+
(U === E.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
305
|
+
U === E.enum.completeReceive) && b.autoReceiveWarehouse ? {
|
|
306
306
|
autoReceive: !0
|
|
307
307
|
} : void 0
|
|
308
308
|
)
|
|
@@ -316,7 +316,7 @@ function Wn(k, a) {
|
|
|
316
316
|
transferTo: D
|
|
317
317
|
}), await new Promise((t) => setTimeout(t, 1e3));
|
|
318
318
|
const j = ke().currentLocationDBName.startsWith("restaurant_");
|
|
319
|
-
U ===
|
|
319
|
+
U === E.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"
|
|
@@ -377,9 +377,9 @@ function Wn(k, a) {
|
|
|
377
377
|
}
|
|
378
378
|
return {
|
|
379
379
|
purchaseOrders: d,
|
|
380
|
-
shipments:
|
|
380
|
+
shipments: P,
|
|
381
381
|
purchaseRequests: l,
|
|
382
|
-
updateDateRange:
|
|
382
|
+
updateDateRange: H,
|
|
383
383
|
fetchData: C,
|
|
384
384
|
loading: r,
|
|
385
385
|
transferDialogProps: je,
|
|
@@ -394,15 +394,15 @@ function Wn(k, a) {
|
|
|
394
394
|
}
|
|
395
395
|
function Yt(k, a) {
|
|
396
396
|
return a.reduce(
|
|
397
|
-
(f,
|
|
398
|
-
const n =
|
|
399
|
-
return n && (f =
|
|
397
|
+
(f, b) => {
|
|
398
|
+
const n = b.received.find((_) => _.sku._id === k._id);
|
|
399
|
+
return n && (f = bt(f, n.amount)), f;
|
|
400
400
|
},
|
|
401
|
-
At.toPrecision(
|
|
401
|
+
At.toPrecision(ht(0), k.unit.precision)
|
|
402
402
|
);
|
|
403
403
|
}
|
|
404
404
|
function Jt(k) {
|
|
405
|
-
const { po: a, currentLocation: o, business: f, fulfilling:
|
|
405
|
+
const { po: a, currentLocation: o, business: f, fulfilling: b, por: n } = k, { name: _, address: r, regNo: c, legalName: O } = o.doc.profile, w = {
|
|
406
406
|
name: _,
|
|
407
407
|
legalName: O,
|
|
408
408
|
registrationNumber: c,
|
|
@@ -422,31 +422,31 @@ function Jt(k) {
|
|
|
422
422
|
city: a.supplier.address.city,
|
|
423
423
|
state: a.supplier.address.state,
|
|
424
424
|
country: a.supplier.address.country
|
|
425
|
-
},
|
|
426
|
-
const { sku: B, measurement: C } =
|
|
427
|
-
Yt(
|
|
425
|
+
}, P = a.items.map((I) => {
|
|
426
|
+
const { sku: B, measurement: C } = I, H = be(
|
|
427
|
+
Yt(I.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: be(I.quantity, !1),
|
|
434
434
|
unit: (C == null ? void 0 : C.abbrev) || B.unit.abbrev,
|
|
435
|
-
received:
|
|
436
|
-
cost:
|
|
437
|
-
value:
|
|
435
|
+
received: H,
|
|
436
|
+
cost: I.totalCost ? `${I.totalCost.currency} ${Pt.toFormatString({
|
|
437
|
+
value: I.totalCost
|
|
438
438
|
})}` : void 0
|
|
439
439
|
};
|
|
440
|
-
}), S = a.deliveryOrder.map((
|
|
441
|
-
createdAt: gt(new Date(
|
|
442
|
-
ref:
|
|
443
|
-
remark:
|
|
444
|
-
items:
|
|
440
|
+
}), S = a.deliveryOrder.map((I) => ({
|
|
441
|
+
createdAt: gt(new Date(I.createdAt)),
|
|
442
|
+
ref: I.deliveryOrderNumber,
|
|
443
|
+
remark: I.remark || "",
|
|
444
|
+
items: I.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: be(B.amount),
|
|
450
450
|
unit: ((C = B.measurement) == null ? void 0 : C.abbrev) || B.sku.unit.abbrev
|
|
451
451
|
};
|
|
452
452
|
})
|
|
@@ -458,70 +458,70 @@ function Jt(k) {
|
|
|
458
458
|
];
|
|
459
459
|
let l = "Inventory Receive Note";
|
|
460
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
|
|
462
|
-
o.dbName ===
|
|
461
|
+
const I = n.from.dbName;
|
|
462
|
+
o.dbName === I || (l = "Inventory Receive Note");
|
|
463
463
|
}
|
|
464
|
-
const
|
|
464
|
+
const h = {
|
|
465
465
|
title: l,
|
|
466
466
|
businessName: f == null ? void 0 : f.name,
|
|
467
467
|
logo: f == null ? void 0 : f.thumbnail,
|
|
468
468
|
orderNumber: a.seqNumber.toString(),
|
|
469
|
-
createdAt:
|
|
469
|
+
createdAt: Ge(a._id),
|
|
470
470
|
ref: a.ref || "",
|
|
471
471
|
remark: a.remark || "",
|
|
472
472
|
buyer: w,
|
|
473
473
|
supplier: d,
|
|
474
|
-
items:
|
|
474
|
+
items: P,
|
|
475
475
|
status: a.status,
|
|
476
476
|
deliveryOrders: S
|
|
477
|
-
}, u = new URL(window.location.href), $ =
|
|
478
|
-
u.pathname = u.hostname.includes("portal.feedme") ? `/inventory/${$}` : `/${$}`, u.searchParams.append("data", JSON.stringify(
|
|
477
|
+
}, u = new URL(window.location.href), $ = b && (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(h)), window.open(u.href, "_blank", "noreferrer");
|
|
479
479
|
}
|
|
480
|
-
const
|
|
480
|
+
const Ve = {
|
|
481
481
|
submitRequest: {
|
|
482
482
|
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
483
483
|
color: "text-fm-color-typo-primary",
|
|
484
|
-
value:
|
|
484
|
+
value: E.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: E.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: E.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: E.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: E.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: E.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: E.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: E.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: E.enum.closeRequest
|
|
525
525
|
},
|
|
526
526
|
approveDraft: {
|
|
527
527
|
translationKey: "",
|
|
@@ -536,30 +536,30 @@ const Ee = {
|
|
|
536
536
|
returnStock: {
|
|
537
537
|
translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
|
|
538
538
|
color: "text-fm-color-typo-primary",
|
|
539
|
-
value:
|
|
539
|
+
value: E.enum.returnStock
|
|
540
540
|
}
|
|
541
541
|
};
|
|
542
542
|
function Qn(k, a, o) {
|
|
543
|
-
const f = ke(),
|
|
543
|
+
const f = ke(), b = Ze(), n = it(), { t: _ } = ct();
|
|
544
544
|
function r(S) {
|
|
545
545
|
switch (S.status) {
|
|
546
546
|
case "DRAFT":
|
|
547
547
|
return [
|
|
548
548
|
_e[pe.Update],
|
|
549
549
|
_e[pe.Details],
|
|
550
|
-
S.supplier.internal === "restaurant" || S.supplier.internal === "warehouse" ?
|
|
551
|
-
|
|
550
|
+
S.supplier.internal === "restaurant" || S.supplier.internal === "warehouse" ? Ve[E.enum.submitRequest] : Ve[E.enum.confirmDraft],
|
|
551
|
+
Ve[E.enum.cancelDraft]
|
|
552
552
|
];
|
|
553
553
|
case "RECEIVING":
|
|
554
554
|
return [
|
|
555
|
-
|
|
555
|
+
Ve[E.enum.completeReceive],
|
|
556
556
|
_e[pe.Details],
|
|
557
557
|
_e[pe.Print]
|
|
558
558
|
];
|
|
559
559
|
case "REQUESTING":
|
|
560
560
|
return k === "receive/request" ? [_e[pe.Details], _e[pe.Print]] : [
|
|
561
|
-
|
|
562
|
-
|
|
561
|
+
Ve[E.enum.approveRequest],
|
|
562
|
+
Ve[E.enum.rejectRequest],
|
|
563
563
|
_e[pe.Details]
|
|
564
564
|
// DefaultRowActions[RowActionEnum.Print]
|
|
565
565
|
];
|
|
@@ -572,20 +572,20 @@ function Qn(k, a, o) {
|
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
function c(S) {
|
|
575
|
-
return Object.values(
|
|
575
|
+
return Object.values(E.enum).includes(S);
|
|
576
576
|
}
|
|
577
577
|
async function O(S, F, l) {
|
|
578
|
-
var
|
|
578
|
+
var h, u, $, I, B, C;
|
|
579
579
|
const s = yt(F);
|
|
580
580
|
if (S === pe.Print) {
|
|
581
|
-
const
|
|
582
|
-
if (
|
|
583
|
-
const Q = f.locationRestaurantFromCore(
|
|
584
|
-
Q !== null && (
|
|
581
|
+
const H = (l == null ? void 0 : l.toInventoryLocation) ?? f.currentLocation;
|
|
582
|
+
if (H.type === "restaurant") {
|
|
583
|
+
const Q = f.locationRestaurantFromCore(H.doc._id);
|
|
584
|
+
Q !== null && (H.doc = Q);
|
|
585
585
|
}
|
|
586
|
-
((
|
|
586
|
+
((h = l == null ? void 0 : l.netSuite) != null && h.refNo || (u = s.netSuite) != null && u.refNo) && (s.ref = [(($ = l == null ? void 0 : l.netSuite) == null ? void 0 : $.refNo) || ((I = s.netSuite) == null ? void 0 : I.refNo)].filter((Q) => Q).join(" ")), Jt({
|
|
587
587
|
po: s,
|
|
588
|
-
currentLocation:
|
|
588
|
+
currentLocation: H,
|
|
589
589
|
business: n.currentBusiness.value,
|
|
590
590
|
fulfilling: k === "approval",
|
|
591
591
|
por: l
|
|
@@ -619,7 +619,7 @@ function Qn(k, a, o) {
|
|
|
619
619
|
accessorKey: "_id",
|
|
620
620
|
header: () => _("inventory.transfer.table.createdAt"),
|
|
621
621
|
cell(l) {
|
|
622
|
-
return
|
|
622
|
+
return Ge(`${l.getValue()}`);
|
|
623
623
|
},
|
|
624
624
|
enableSorting: !0
|
|
625
625
|
},
|
|
@@ -633,15 +633,15 @@ function Qn(k, a, o) {
|
|
|
633
633
|
accessorKey: "items.length",
|
|
634
634
|
header: () => _("inventory.transfer.table.noOfItems"),
|
|
635
635
|
cell: (l) => {
|
|
636
|
-
const s = l.row.original.version || "1",
|
|
637
|
-
return
|
|
638
|
-
|
|
639
|
-
s !== "1" ?
|
|
636
|
+
const s = l.row.original.version || "1", h = l.getValue();
|
|
637
|
+
return V("div", { class: "flex items-center gap-2" }, [
|
|
638
|
+
h,
|
|
639
|
+
s !== "1" ? V(
|
|
640
640
|
"div",
|
|
641
641
|
{ class: "py-3" },
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
642
|
+
V(
|
|
643
|
+
Ie,
|
|
644
|
+
V(
|
|
645
645
|
"div",
|
|
646
646
|
{
|
|
647
647
|
class: ["fm-status-badge", "fm-status-badge-draft"].join(" ")
|
|
@@ -666,7 +666,7 @@ function Qn(k, a, o) {
|
|
|
666
666
|
...(F = n.sessionUser.value) != null && F.role.isAdmin ? [
|
|
667
667
|
{
|
|
668
668
|
id: "statusForAdmin",
|
|
669
|
-
header: () =>
|
|
669
|
+
header: () => V(Ie, {}, () => `${_("inventory.transfer.table.status")}`),
|
|
670
670
|
cell(l) {
|
|
671
671
|
return l.row.original.status;
|
|
672
672
|
},
|
|
@@ -678,28 +678,28 @@ function Qn(k, a, o) {
|
|
|
678
678
|
accessorKey: "status",
|
|
679
679
|
header: () => _("inventory.transfer.table.status"),
|
|
680
680
|
cell(l) {
|
|
681
|
-
const s = l.getValue(),
|
|
682
|
-
let B = _(`inventory.transfer.status.${
|
|
683
|
-
|
|
684
|
-
let
|
|
681
|
+
const s = l.getValue(), h = Je(l.row.original), { partial: u, over: $ } = ot(h), I = nt(s ?? "", u, $);
|
|
682
|
+
let B = _(`inventory.transfer.status.${I}`), C = `${s ?? ""}`.toLocaleLowerCase("en-us");
|
|
683
|
+
I === ee.enum.CLOSE && (B = `${_(`inventory.transfer.status.${ee.enum.COMPLETE}`)}`), I === "PARTIAL_RECEIVED" && C === ee.enum.PROCESSING.toLocaleLowerCase("en-us") && (C = ee.enum.RECEIVING.toLocaleLowerCase("en-us"));
|
|
684
|
+
let H = null;
|
|
685
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
689
|
const fe = new Date(se.estimatedTime), ye = fe.getDate().toString().padStart(2, "0");
|
|
690
|
-
|
|
690
|
+
H = `${fe.toLocaleString("en-US", { month: "short" })} ${ye}`;
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
|
-
return
|
|
693
|
+
return V(
|
|
694
694
|
"div",
|
|
695
695
|
{
|
|
696
696
|
class: "flex"
|
|
697
697
|
},
|
|
698
698
|
[
|
|
699
|
-
|
|
699
|
+
V(
|
|
700
700
|
"div",
|
|
701
701
|
{ class: "flex items-center" },
|
|
702
|
-
|
|
702
|
+
V(
|
|
703
703
|
"div",
|
|
704
704
|
{
|
|
705
705
|
class: [
|
|
@@ -711,22 +711,22 @@ function Qn(k, a, o) {
|
|
|
711
711
|
`${B}`
|
|
712
712
|
)
|
|
713
713
|
),
|
|
714
|
-
...
|
|
715
|
-
|
|
714
|
+
...H ? [
|
|
715
|
+
V(
|
|
716
716
|
"div",
|
|
717
717
|
{
|
|
718
718
|
class: "flex items-center gap-1 ml-2"
|
|
719
719
|
},
|
|
720
720
|
[
|
|
721
|
-
|
|
721
|
+
V(Ye.FmIcon, {
|
|
722
722
|
name: "local_shipping",
|
|
723
723
|
size: "md",
|
|
724
724
|
color: "neutral-gray-400"
|
|
725
725
|
}),
|
|
726
|
-
|
|
726
|
+
V(
|
|
727
727
|
"span",
|
|
728
728
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
729
|
-
|
|
729
|
+
H
|
|
730
730
|
)
|
|
731
731
|
]
|
|
732
732
|
)
|
|
@@ -740,8 +740,8 @@ function Qn(k, a, o) {
|
|
|
740
740
|
{
|
|
741
741
|
id: "action",
|
|
742
742
|
cell(l) {
|
|
743
|
-
const s = l.row.original,
|
|
744
|
-
return dt(
|
|
743
|
+
const s = l.row.original, h = r(s);
|
|
744
|
+
return dt(h, (u) => O(u, s));
|
|
745
745
|
},
|
|
746
746
|
enableSorting: !1,
|
|
747
747
|
size: 40,
|
|
@@ -751,19 +751,19 @@ function Qn(k, a, o) {
|
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
753
|
];
|
|
754
|
-
if (
|
|
754
|
+
if (b.isEnabled) {
|
|
755
755
|
const l = [
|
|
756
756
|
{
|
|
757
757
|
id: "netsuiteTransferOrder",
|
|
758
758
|
accessorFn: (s) => {
|
|
759
|
-
var
|
|
760
|
-
return (
|
|
759
|
+
var h;
|
|
760
|
+
return (h = s.netSuite) != null && h.id ? `${s.netSuite.refNo} (${s.netSuite.id})` : "N/A";
|
|
761
761
|
},
|
|
762
762
|
header: () => "NetSuite Order (ID)",
|
|
763
763
|
cell(s) {
|
|
764
764
|
var u;
|
|
765
|
-
const
|
|
766
|
-
return (u =
|
|
765
|
+
const h = s.row.original;
|
|
766
|
+
return (u = h.netSuite) != null && u.id ? `${h.netSuite.refNo} (${h.netSuite.id})` : "N/A";
|
|
767
767
|
},
|
|
768
768
|
enableSorting: !1,
|
|
769
769
|
size: 200,
|
|
@@ -775,8 +775,8 @@ function Qn(k, a, o) {
|
|
|
775
775
|
{
|
|
776
776
|
id: "netsuiteTransactionNumber",
|
|
777
777
|
accessorFn: (s) => {
|
|
778
|
-
var
|
|
779
|
-
return ((u = (
|
|
778
|
+
var h, u;
|
|
779
|
+
return ((u = (h = s.netSuite) == null ? void 0 : h.additionalInfo) == null ? void 0 : u.transactionnumber) ?? "N/A";
|
|
780
780
|
},
|
|
781
781
|
header: () => "NetSuite Transaction No.",
|
|
782
782
|
cell(s) {
|
|
@@ -809,7 +809,7 @@ function Qn(k, a, o) {
|
|
|
809
809
|
accessorKey: "purchaseOrder._id",
|
|
810
810
|
header: () => _("inventory.transfer.table.createdAt"),
|
|
811
811
|
cell(l) {
|
|
812
|
-
return
|
|
812
|
+
return Ge(`${l.getValue()}`);
|
|
813
813
|
},
|
|
814
814
|
enableSorting: !0
|
|
815
815
|
},
|
|
@@ -833,7 +833,7 @@ function Qn(k, a, o) {
|
|
|
833
833
|
...(F = n.sessionUser.value) != null && F.role.isAdmin ? [
|
|
834
834
|
{
|
|
835
835
|
id: "statusForAdmin",
|
|
836
|
-
header: () =>
|
|
836
|
+
header: () => V(Ie, {}, () => `${_("inventory.transfer.table.status")}`),
|
|
837
837
|
cell(l) {
|
|
838
838
|
return l.row.original.status;
|
|
839
839
|
},
|
|
@@ -845,26 +845,26 @@ function Qn(k, a, o) {
|
|
|
845
845
|
accessorKey: "purchaseOrder.status",
|
|
846
846
|
header: () => _("inventory.transfer.table.status"),
|
|
847
847
|
cell(l) {
|
|
848
|
-
const s = l.row.original,
|
|
848
|
+
const s = l.row.original, h = l.getValue();
|
|
849
849
|
if (!s.purchaseOrder)
|
|
850
|
-
return
|
|
850
|
+
return V(Ye.FmChip, {
|
|
851
851
|
label: "N/A",
|
|
852
852
|
compact: !0
|
|
853
853
|
});
|
|
854
|
-
const u = Je(s.purchaseOrder), { partial: $, over:
|
|
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: I } = ot(u), B = nt(h ?? "", $, I);
|
|
855
|
+
let C = _(`inventory.transfer.status.${B}`), H = `${h ?? ""}`.toLocaleLowerCase("en-us");
|
|
856
|
+
return B === ee.enum.CLOSE && (C = `${_(`inventory.transfer.status.${ee.enum.COMPLETE}`)}`), B === "PARTIAL_RECEIVED" && H === ee.enum.PROCESSING.toLocaleLowerCase("en-us") && (H = ee.enum.RECEIVING.toLocaleLowerCase("en-us")), s.rejectedAt && (C = _("inventory.transfer.status.REJECT"), H = ee.enum.REJECT.toLocaleLowerCase("en-us")), V(
|
|
857
857
|
"div",
|
|
858
858
|
{
|
|
859
859
|
class: "flex"
|
|
860
860
|
},
|
|
861
|
-
|
|
861
|
+
V(
|
|
862
862
|
"div",
|
|
863
863
|
{
|
|
864
864
|
class: [
|
|
865
865
|
"fm-status-badge",
|
|
866
|
-
`fm-status-badge-${
|
|
867
|
-
|
|
866
|
+
`fm-status-badge-${H}`,
|
|
867
|
+
I && "fm-status-badge-error"
|
|
868
868
|
].filter(Boolean).join(" ")
|
|
869
869
|
},
|
|
870
870
|
`${C}`
|
|
@@ -893,19 +893,19 @@ function Qn(k, a, o) {
|
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
895
|
];
|
|
896
|
-
if (
|
|
896
|
+
if (b.isEnabled) {
|
|
897
897
|
const l = [
|
|
898
898
|
{
|
|
899
899
|
id: "netsuiteTransferOrder",
|
|
900
900
|
accessorFn: (s) => {
|
|
901
|
-
var
|
|
902
|
-
return (
|
|
901
|
+
var h;
|
|
902
|
+
return (h = s.netSuite) != null && h.id ? `${s.netSuite.refNo} (${s.netSuite.id})` : "N/A";
|
|
903
903
|
},
|
|
904
904
|
header: () => "NetSuite Order (ID)",
|
|
905
905
|
cell(s) {
|
|
906
906
|
var u;
|
|
907
|
-
const
|
|
908
|
-
return (u =
|
|
907
|
+
const h = s.row.original;
|
|
908
|
+
return (u = h.netSuite) != null && u.id ? `${h.netSuite.refNo} (${h.netSuite.id})` : "N/A";
|
|
909
909
|
},
|
|
910
910
|
enableSorting: !1,
|
|
911
911
|
size: 200,
|
|
@@ -917,8 +917,8 @@ function Qn(k, a, o) {
|
|
|
917
917
|
{
|
|
918
918
|
id: "netsuiteTransactionNumber",
|
|
919
919
|
accessorFn: (s) => {
|
|
920
|
-
var
|
|
921
|
-
return ((u = (
|
|
920
|
+
var h, u;
|
|
921
|
+
return ((u = (h = s.netSuite) == null ? void 0 : h.additionalInfo) == null ? void 0 : u.transactionnumber) ?? "N/A";
|
|
922
922
|
},
|
|
923
923
|
header: () => "NetSuite Transaction No.",
|
|
924
924
|
cell(s) {
|
|
@@ -953,7 +953,7 @@ const Xt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
953
953
|
id: "",
|
|
954
954
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
955
955
|
items: []
|
|
956
|
-
}),
|
|
956
|
+
}), b = J(), n = a;
|
|
957
957
|
ft(() => {
|
|
958
958
|
o.purchaseOrder && (f.items = o.purchaseOrder.items.map((r) => ({
|
|
959
959
|
id: r.id,
|
|
@@ -967,7 +967,7 @@ const Xt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
967
967
|
const O = K("FmTable"), w = K("FmButton"), d = K("FmForm");
|
|
968
968
|
return i(), re(d, {
|
|
969
969
|
ref_key: "formRef",
|
|
970
|
-
ref:
|
|
970
|
+
ref: b,
|
|
971
971
|
class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
|
|
972
972
|
onValidationFailed: console.log,
|
|
973
973
|
onValidationSuccess: c[1] || (c[1] = () => o.confirm(f))
|
|
@@ -980,9 +980,9 @@ const Xt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
980
980
|
"column-defs": [
|
|
981
981
|
{
|
|
982
982
|
header: "Code",
|
|
983
|
-
cell: (
|
|
984
|
-
const S = o.purchaseOrder.items.find((F) => F.id ===
|
|
985
|
-
return
|
|
983
|
+
cell: (P) => {
|
|
984
|
+
const S = o.purchaseOrder.items.find((F) => F.id === P.row.original.id || F.sku._id === P.row.original.sku._id);
|
|
985
|
+
return V(
|
|
986
986
|
v(Ye).FmTooltip,
|
|
987
987
|
{
|
|
988
988
|
content: S.code,
|
|
@@ -990,7 +990,7 @@ const Xt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
990
990
|
variant: "plain",
|
|
991
991
|
zIndex: 50
|
|
992
992
|
},
|
|
993
|
-
|
|
993
|
+
V(
|
|
994
994
|
"span",
|
|
995
995
|
{
|
|
996
996
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
@@ -1002,9 +1002,9 @@ const Xt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1002
1002
|
},
|
|
1003
1003
|
{
|
|
1004
1004
|
header: "Name",
|
|
1005
|
-
cell: (
|
|
1006
|
-
const S = o.purchaseOrder.items.find((F) => F.id ===
|
|
1007
|
-
return
|
|
1005
|
+
cell: (P) => {
|
|
1006
|
+
const S = o.purchaseOrder.items.find((F) => F.id === P.row.original.id || F.sku._id === P.row.original.sku._id);
|
|
1007
|
+
return V(
|
|
1008
1008
|
v(Ye).FmTooltip,
|
|
1009
1009
|
{
|
|
1010
1010
|
content: S.name,
|
|
@@ -1012,7 +1012,7 @@ const Xt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1012
1012
|
variant: "plain",
|
|
1013
1013
|
zIndex: 50
|
|
1014
1014
|
},
|
|
1015
|
-
|
|
1015
|
+
V(
|
|
1016
1016
|
"span",
|
|
1017
1017
|
{
|
|
1018
1018
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
@@ -1024,12 +1024,12 @@ const Xt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1024
1024
|
},
|
|
1025
1025
|
{
|
|
1026
1026
|
header: "Amount",
|
|
1027
|
-
cell: (
|
|
1028
|
-
const S =
|
|
1027
|
+
cell: (P) => {
|
|
1028
|
+
const S = P.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 V(Ut, {
|
|
1033
1033
|
style: {
|
|
1034
1034
|
flex: "1 1 0%"
|
|
1035
1035
|
},
|
|
@@ -1041,15 +1041,15 @@ const Xt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1041
1041
|
unit: S.sku.unit,
|
|
1042
1042
|
"onUpdate:modelValue": (s) => {
|
|
1043
1043
|
if (!s) return;
|
|
1044
|
-
const
|
|
1045
|
-
|
|
1044
|
+
const h = f.items.find((u) => u.id === S.id || u.sku._id === S.sku._id);
|
|
1045
|
+
h && (h.amount = s.amount);
|
|
1046
1046
|
},
|
|
1047
1047
|
disableUnit: !0,
|
|
1048
1048
|
rules: [
|
|
1049
1049
|
v(Bt)(
|
|
1050
|
-
+v(
|
|
1050
|
+
+v(be)({ amount: 0, precision: 0 })
|
|
1051
1051
|
),
|
|
1052
|
-
v(jt)(+v(
|
|
1052
|
+
v(jt)(+v(be)(F.quantity))
|
|
1053
1053
|
],
|
|
1054
1054
|
applyDefaultRules: !0
|
|
1055
1055
|
});
|
|
@@ -1086,64 +1086,64 @@ const Xt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1086
1086
|
submitRequest: {
|
|
1087
1087
|
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
1088
1088
|
color: "primary",
|
|
1089
|
-
buttonVariant:
|
|
1089
|
+
buttonVariant: he.Primary
|
|
1090
1090
|
},
|
|
1091
1091
|
confirmDraft: {
|
|
1092
1092
|
translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
|
|
1093
1093
|
color: "primary",
|
|
1094
|
-
buttonVariant:
|
|
1094
|
+
buttonVariant: he.Primary
|
|
1095
1095
|
},
|
|
1096
1096
|
cancelDraft: {
|
|
1097
1097
|
translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
|
|
1098
1098
|
color: "system-error-300",
|
|
1099
|
-
buttonVariant:
|
|
1099
|
+
buttonVariant: he.Destructive
|
|
1100
1100
|
},
|
|
1101
1101
|
approveDraft: {
|
|
1102
1102
|
translationKey: "inventory.transfer.receiveRequest.actions.approveDraft",
|
|
1103
1103
|
color: "primary",
|
|
1104
|
-
buttonVariant:
|
|
1104
|
+
buttonVariant: he.Primary
|
|
1105
1105
|
},
|
|
1106
1106
|
rejectDraft: {
|
|
1107
1107
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectDraft",
|
|
1108
1108
|
color: "system-error-300",
|
|
1109
|
-
buttonVariant:
|
|
1109
|
+
buttonVariant: he.Destructive
|
|
1110
1110
|
},
|
|
1111
1111
|
approveRequest: {
|
|
1112
1112
|
translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
|
|
1113
1113
|
color: "primary",
|
|
1114
|
-
buttonVariant:
|
|
1114
|
+
buttonVariant: he.Primary
|
|
1115
1115
|
},
|
|
1116
1116
|
processRequest: {
|
|
1117
1117
|
translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
|
|
1118
1118
|
color: "primary",
|
|
1119
|
-
buttonVariant:
|
|
1119
|
+
buttonVariant: he.Primary
|
|
1120
1120
|
},
|
|
1121
1121
|
receiveStock: {
|
|
1122
1122
|
translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
|
|
1123
1123
|
color: "primary",
|
|
1124
|
-
buttonVariant:
|
|
1124
|
+
buttonVariant: he.Primary,
|
|
1125
1125
|
available: !1
|
|
1126
1126
|
},
|
|
1127
1127
|
completeReceive: {
|
|
1128
1128
|
translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
|
|
1129
1129
|
color: "primary",
|
|
1130
|
-
buttonVariant:
|
|
1130
|
+
buttonVariant: he.Plain
|
|
1131
1131
|
},
|
|
1132
1132
|
rejectRequest: {
|
|
1133
1133
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
|
|
1134
1134
|
color: "system-error-300",
|
|
1135
|
-
buttonVariant:
|
|
1135
|
+
buttonVariant: he.Destructive
|
|
1136
1136
|
},
|
|
1137
1137
|
closeRequest: {
|
|
1138
1138
|
translationKey: "inventory.transfer.receiveRequest.actions.closeRequest",
|
|
1139
1139
|
color: "system-error-300",
|
|
1140
|
-
buttonVariant:
|
|
1140
|
+
buttonVariant: he.Destructive,
|
|
1141
1141
|
available: !1
|
|
1142
1142
|
},
|
|
1143
1143
|
returnStock: {
|
|
1144
1144
|
translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
|
|
1145
1145
|
color: "primary",
|
|
1146
|
-
buttonVariant:
|
|
1146
|
+
buttonVariant: he.Primary,
|
|
1147
1147
|
available: !1
|
|
1148
1148
|
}
|
|
1149
1149
|
};
|
|
@@ -1163,8 +1163,8 @@ function ss() {
|
|
|
1163
1163
|
var n, _;
|
|
1164
1164
|
if (!k.acceptRequireFulfillment || !a || !o || a.status !== ee.enum.PROCESSING || !o.processedAt)
|
|
1165
1165
|
return !1;
|
|
1166
|
-
const f = (n = o == null ? void 0 : o.from) == null ? void 0 : n.dbName,
|
|
1167
|
-
return !(f.startsWith("restaurant_") &&
|
|
1166
|
+
const f = (n = o == null ? void 0 : o.from) == null ? void 0 : n.dbName, b = (_ = o == null ? void 0 : o.to) == null ? void 0 : _.dbName;
|
|
1167
|
+
return !(f.startsWith("restaurant_") && b.startsWith("restaurant_"));
|
|
1168
1168
|
}
|
|
1169
1169
|
};
|
|
1170
1170
|
}
|
|
@@ -1177,21 +1177,21 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1177
1177
|
scope: {}
|
|
1178
1178
|
},
|
|
1179
1179
|
setup(k) {
|
|
1180
|
-
const a = k, o = Ze(), f = Ue(),
|
|
1180
|
+
const a = k, o = Ze(), f = Ue(), b = et(), n = J(!1);
|
|
1181
1181
|
Y(() => {
|
|
1182
|
-
var w, d,
|
|
1182
|
+
var w, d, P, S;
|
|
1183
1183
|
let r = !0;
|
|
1184
1184
|
o.isEnabled || (r = !1);
|
|
1185
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 && !((
|
|
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 && !((P = c == null ? void 0 : c.netSuite) != null && P.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 || b.open({
|
|
1190
1190
|
title: "Sync with NetSuite",
|
|
1191
|
-
contentComponent:
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1191
|
+
contentComponent: V("div", [
|
|
1192
|
+
V("p", "Are you sure you want to sync now?"),
|
|
1193
|
+
V("br"),
|
|
1194
|
+
V(
|
|
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."
|
|
@@ -1215,7 +1215,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
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((P) => setTimeout(P, 5e3)), n.value = !1;
|
|
1219
1219
|
} catch {
|
|
1220
1220
|
f.open({
|
|
1221
1221
|
title: "Error",
|
|
@@ -1250,7 +1250,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1250
1250
|
}, cs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, us = { class: "fm-typo-en-body-lg-600" }, ds = { key: 0 }, ms = { key: 1 }, ps = {
|
|
1251
1251
|
key: 1,
|
|
1252
1252
|
class: "flex flex-col gap-4"
|
|
1253
|
-
}, fs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ys = { class: "fm-typo-en-body-lg-600" }, vs = { key: 0 },
|
|
1253
|
+
}, fs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ys = { class: "fm-typo-en-body-lg-600" }, vs = { key: 0 }, bs = { key: 1 }, hs = {
|
|
1254
1254
|
key: 2,
|
|
1255
1255
|
class: "flex flex-col gap-4"
|
|
1256
1256
|
}, gs = { class: "fm-typo-en-body-lg-600" }, _s = {
|
|
@@ -1267,55 +1267,55 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1267
1267
|
scope: {}
|
|
1268
1268
|
},
|
|
1269
1269
|
setup(k) {
|
|
1270
|
-
const a = k, o = Ze(), f = Be(),
|
|
1270
|
+
const a = k, o = Ze(), f = Be(), b = J(a.poRequest);
|
|
1271
1271
|
ft(async () => {
|
|
1272
1272
|
var c;
|
|
1273
1273
|
if (!a.poRequest && ((c = a.purchaseOrder) != null && c._id)) {
|
|
1274
1274
|
const O = await f.getLatestPurchaseOrderRequest(a.purchaseOrder._id);
|
|
1275
|
-
|
|
1275
|
+
b.value = O;
|
|
1276
1276
|
}
|
|
1277
1277
|
});
|
|
1278
1278
|
const n = Y(
|
|
1279
1279
|
() => {
|
|
1280
|
-
var c, O, w, d,
|
|
1280
|
+
var c, O, w, d, P, S;
|
|
1281
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 = (
|
|
1282
|
+
((w = (O = (c = a.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : O.subsidiary) == null ? void 0 : w.id) || ((S = (P = (d = a.poRequest) == null ? void 0 : d.netSuite) == null ? void 0 : P.subsidiary) == null ? void 0 : S.id)
|
|
1283
1283
|
).fullName;
|
|
1284
1284
|
}
|
|
1285
1285
|
), _ = Y(() => {
|
|
1286
|
-
var c, O, w, d,
|
|
1287
|
-
return (w = (O = (c = a.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : O.additionalInfo) != null && w.transactionnumber ? (S = (
|
|
1286
|
+
var c, O, w, d, P, S, F, l, s, h, u, $;
|
|
1287
|
+
return (w = (O = (c = a.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : O.additionalInfo) != null && w.transactionnumber ? (S = (P = (d = a.purchaseOrder) == null ? void 0 : d.netSuite) == null ? void 0 : P.additionalInfo) == null ? void 0 : S.transactionnumber : (s = (l = (F = b.value) == null ? void 0 : F.netSuite) == null ? void 0 : l.additionalInfo) != null && s.transactionnumber ? ($ = (u = (h = b.value) == null ? void 0 : h.netSuite) == null ? void 0 : u.additionalInfo) == null ? void 0 : $.transactionnumber : null;
|
|
1288
1288
|
}), r = Y(() => {
|
|
1289
|
-
var c, O, w, d,
|
|
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 = (
|
|
1289
|
+
var c, O, w, d, P, 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 = (P = a.purchaseOrder) == null ? void 0 : P.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
1295
|
return (c, O) => {
|
|
1296
|
-
var w, d,
|
|
1296
|
+
var w, d, P, S, F, l, s, h, u, $, I, B, C, H, Q, se;
|
|
1297
1297
|
return v(o).isEnabled ? (i(), g("div", ns, [
|
|
1298
1298
|
e("div", as, [
|
|
1299
1299
|
O[0] || (O[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
1300
1300
|
e("div", ls, y(n.value || "N/A"), 1)
|
|
1301
1301
|
]),
|
|
1302
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 = (
|
|
1303
|
+
e("div", cs, " NetSuite " + y((d = (w = c.purchaseOrder) == null ? void 0 : w.netSuite) != null && d.recordType ? v(vt)((S = (P = c.purchaseOrder) == null ? void 0 : P.netSuite) == null ? void 0 : S.recordType) : c.transferType === v(He).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(), g("span", ds, y((
|
|
1305
|
+
(l = (F = c.purchaseOrder) == null ? void 0 : F.netSuite) != null && l.id ? (i(), g("span", ds, y((h = (s = c.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : h.refNo) + " (" + y(($ = (u = c.purchaseOrder) == null ? void 0 : u.netSuite) == null ? void 0 : $.id) + ") ", 1)) : (i(), g("span", ms, "N/A"))
|
|
1306
1306
|
])
|
|
1307
1307
|
])) : M("", !0),
|
|
1308
|
-
!c.isTransferBetweenOutlets &&
|
|
1309
|
-
e("div", fs, " (Request) NetSuite " + y(c.transferType === v(
|
|
1308
|
+
!c.isTransferBetweenOutlets && b.value || c.scope === v(at).APPROVAL ? (i(), g("div", ps, [
|
|
1309
|
+
e("div", fs, " (Request) NetSuite " + y(c.transferType === v(He).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1310
1310
|
e("div", ys, [
|
|
1311
|
-
(B = (
|
|
1311
|
+
(B = (I = b.value) == null ? void 0 : I.netSuite) != null && B.id ? (i(), g("span", vs, y((H = (C = b.value) == null ? void 0 : C.netSuite) == null ? void 0 : H.refNo) + " (" + y((se = (Q = b.value) == null ? void 0 : Q.netSuite) == null ? void 0 : se.id) + ") ", 1)) : (i(), g("span", bs, "N/A"))
|
|
1312
1312
|
])
|
|
1313
1313
|
])) : M("", !0),
|
|
1314
|
-
_.value ? (i(), g("div",
|
|
1314
|
+
_.value ? (i(), g("div", hs, [
|
|
1315
1315
|
O[1] || (O[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
|
|
1316
1316
|
e("div", gs, y(_.value), 1)
|
|
1317
1317
|
])) : M("", !0),
|
|
1318
|
-
v(o).isEnabled && c.transferType === v(
|
|
1318
|
+
v(o).isEnabled && c.transferType === v(He).TRANSFER && !c.isTransferBetweenOutlets ? (i(), g("div", _s, [
|
|
1319
1319
|
O[2] || (O[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
1320
1320
|
e("div", Ss, y(r.value), 1)
|
|
1321
1321
|
])) : M("", !0)
|
|
@@ -1330,9 +1330,9 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1330
1330
|
},
|
|
1331
1331
|
setup(k) {
|
|
1332
1332
|
const a = Ue(), o = ut();
|
|
1333
|
-
async function f(
|
|
1333
|
+
async function f(b, n) {
|
|
1334
1334
|
const _ = [];
|
|
1335
|
-
if (
|
|
1335
|
+
if (b && _.push(`body.message:*${b}*`), n) {
|
|
1336
1336
|
const w = n.replace(/:/g, "\\:");
|
|
1337
1337
|
_.push(`${w}`);
|
|
1338
1338
|
}
|
|
@@ -1352,14 +1352,14 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1352
1352
|
800
|
|
1353
1353
|
), await new Promise((w) => setTimeout(w, 800)), window.open(O, "_blank");
|
|
1354
1354
|
}
|
|
1355
|
-
return (
|
|
1355
|
+
return (b, n) => {
|
|
1356
1356
|
const _ = K("FmButton");
|
|
1357
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] = (r) => f(
|
|
1362
|
+
onClick: n[0] || (n[0] = (r) => f(b.netsuiteId, b.purchaseOrderId)),
|
|
1363
1363
|
"text-color": "primary",
|
|
1364
1364
|
"bg-color": "transparent",
|
|
1365
1365
|
"border-color": "primary"
|
|
@@ -1373,24 +1373,24 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1373
1373
|
}, Ts = {
|
|
1374
1374
|
key: 1,
|
|
1375
1375
|
class: "border-t pt-6"
|
|
1376
|
-
},
|
|
1376
|
+
}, Ps = { class: "fm-typo-en-body-lg-600 mb-4 flex items-center gap-2" }, Is = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg overflow-y-auto" }, qs = { class: "w-full" }, Es = {
|
|
1377
1377
|
class: "p-3 fm-typo-en-body-sm-600",
|
|
1378
1378
|
style: { "min-width": "130px" }
|
|
1379
|
-
},
|
|
1379
|
+
}, Vs = { 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 }, Hs = { key: 1 }, Gs = /* @__PURE__ */ we({
|
|
1380
1380
|
__name: "NetSuiteLatestInfo",
|
|
1381
1381
|
props: {
|
|
1382
1382
|
netsuiteId: {},
|
|
1383
1383
|
purchaseOrderId: {}
|
|
1384
1384
|
},
|
|
1385
1385
|
setup(k) {
|
|
1386
|
-
const a = k, o = ut(), f = J(!1),
|
|
1386
|
+
const a = k, o = ut(), f = J(!1), b = ke(), n = J(!0), _ = J(!1), r = J(!1), c = J(!1), O = J(null), w = J([]);
|
|
1387
1387
|
async function d() {
|
|
1388
1388
|
if (!O.value) {
|
|
1389
1389
|
f.value = !0;
|
|
1390
1390
|
try {
|
|
1391
1391
|
n.value = !0;
|
|
1392
1392
|
const l = await o.getMoreInfo(
|
|
1393
|
-
|
|
1393
|
+
b.currentLocation.dbName,
|
|
1394
1394
|
a.purchaseOrderId
|
|
1395
1395
|
);
|
|
1396
1396
|
O.value = l, _.value = !1;
|
|
@@ -1399,10 +1399,10 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1399
1399
|
} finally {
|
|
1400
1400
|
n.value = !1;
|
|
1401
1401
|
}
|
|
1402
|
-
await
|
|
1402
|
+
await P();
|
|
1403
1403
|
}
|
|
1404
1404
|
}
|
|
1405
|
-
async function
|
|
1405
|
+
async function P() {
|
|
1406
1406
|
if (!(w.value.length > 0))
|
|
1407
1407
|
try {
|
|
1408
1408
|
r.value = !0;
|
|
@@ -1438,7 +1438,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1438
1438
|
});
|
|
1439
1439
|
}
|
|
1440
1440
|
return (l, s) => {
|
|
1441
|
-
const
|
|
1441
|
+
const h = K("FmButton"), u = K("FmLabel"), $ = K("FmCircularProgress"), I = K("FmIcon"), B = K("FmDialog");
|
|
1442
1442
|
return i(), g("div", $s, [
|
|
1443
1443
|
N(B, {
|
|
1444
1444
|
modelValue: f.value,
|
|
@@ -1447,7 +1447,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1447
1447
|
"max-width": 800
|
|
1448
1448
|
}, {
|
|
1449
1449
|
"dialog-button": X(() => [
|
|
1450
|
-
N(
|
|
1450
|
+
N(h, {
|
|
1451
1451
|
"prepend-icon": "info",
|
|
1452
1452
|
variant: "secondary",
|
|
1453
1453
|
label: "Latest Info",
|
|
@@ -1462,16 +1462,16 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1462
1462
|
])),
|
|
1463
1463
|
default: X(() => [
|
|
1464
1464
|
n.value ? (i(), g("div", Cs, "Loading...")) : (i(), g("div", Rs, [
|
|
1465
|
-
_.value ? (i(), g("p",
|
|
1465
|
+
_.value ? (i(), g("p", Hs, "Something went wrong.")) : (i(), g(ue, { key: 0 }, [
|
|
1466
1466
|
e("div", ks, [
|
|
1467
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,
|
|
1469
|
-
key:
|
|
1468
|
+
(i(!0), g(ue, null, Se(O.value, (C, H) => (i(), g("div", {
|
|
1469
|
+
key: H,
|
|
1470
1470
|
class: "mb-2"
|
|
1471
1471
|
}, [
|
|
1472
1472
|
e("div", null, [
|
|
1473
1473
|
N(u, {
|
|
1474
|
-
label: v(lt)(
|
|
1474
|
+
label: v(lt)(H)
|
|
1475
1475
|
}, null, 8, ["label"]),
|
|
1476
1476
|
e("div", Ds, [
|
|
1477
1477
|
Array.isArray(C) ? (i(), g("span", Ns, y(C.length > 0 ? C.join(", ") : "N/A"), 1)) : (i(), g("span", As, y(C), 1))
|
|
@@ -1484,15 +1484,15 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1484
1484
|
N($, { size: "md" })
|
|
1485
1485
|
])) : M("", !0),
|
|
1486
1486
|
!r.value && w.value.length > 0 ? (i(), g("div", Ts, [
|
|
1487
|
-
e("h3",
|
|
1488
|
-
N(
|
|
1487
|
+
e("h3", Ps, [
|
|
1488
|
+
N(I, {
|
|
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", Is, [
|
|
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" }, [
|
|
@@ -1511,12 +1511,12 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1511
1511
|
])
|
|
1512
1512
|
], -1)),
|
|
1513
1513
|
e("tbody", null, [
|
|
1514
|
-
(i(!0), g(ue, null, Se(w.value, (C,
|
|
1515
|
-
key:
|
|
1514
|
+
(i(!0), g(ue, null, Se(w.value, (C, H) => (i(), g("tr", {
|
|
1515
|
+
key: H,
|
|
1516
1516
|
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
1517
1517
|
}, [
|
|
1518
|
-
e("td",
|
|
1519
|
-
e("td",
|
|
1518
|
+
e("td", Es, y(F(C._dateiso8601)), 1),
|
|
1519
|
+
e("td", Vs, y(C._rolename), 1),
|
|
1520
1520
|
e("td", Ls, y(C._employeename), 1),
|
|
1521
1521
|
e("td", Ms, y(C._contextname), 1),
|
|
1522
1522
|
e("td", {
|
|
@@ -1537,7 +1537,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1537
1537
|
]))
|
|
1538
1538
|
]),
|
|
1539
1539
|
"dialog-footer": X(() => [
|
|
1540
|
-
N(
|
|
1540
|
+
N(h, {
|
|
1541
1541
|
class: "ml-auto sm:w-full xs:w-full",
|
|
1542
1542
|
label: "Close",
|
|
1543
1543
|
size: "md",
|
|
@@ -1564,7 +1564,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1564
1564
|
},
|
|
1565
1565
|
setup(k) {
|
|
1566
1566
|
const a = k, o = Kt(), f = Y(() => o.isNetSuiteEnabled);
|
|
1567
|
-
return (
|
|
1567
|
+
return (b, n) => {
|
|
1568
1568
|
var r, c;
|
|
1569
1569
|
const _ = K("FmMenuDivider");
|
|
1570
1570
|
return f.value ? (i(), g("div", Ws, [
|
|
@@ -1572,47 +1572,47 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1572
1572
|
n[0] || (n[0] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
1573
1573
|
e("div", Ys, [
|
|
1574
1574
|
e("div", Js, [
|
|
1575
|
-
(c = (r = a.purchaseOrder) == null ? void 0 : r.netSuite) != null && c.id ? (i(), re(
|
|
1575
|
+
(c = (r = a.purchaseOrder) == null ? void 0 : r.netSuite) != null && c.id ? (i(), re(Ie, { key: 0 }, {
|
|
1576
1576
|
default: X(() => {
|
|
1577
1577
|
var O, w, d;
|
|
1578
1578
|
return [
|
|
1579
|
-
N(
|
|
1580
|
-
"netsuite-id": (w = (O =
|
|
1581
|
-
"purchase-order-id": (d =
|
|
1579
|
+
N(Gs, {
|
|
1580
|
+
"netsuite-id": (w = (O = b.purchaseOrder) == null ? void 0 : O.netSuite) == null ? void 0 : w.id,
|
|
1581
|
+
"purchase-order-id": (d = b.purchaseOrder) == null ? void 0 : d._id
|
|
1582
1582
|
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
1583
1583
|
];
|
|
1584
1584
|
}),
|
|
1585
1585
|
_: 1
|
|
1586
1586
|
})) : M("", !0),
|
|
1587
|
-
N(
|
|
1587
|
+
N(Ie, null, {
|
|
1588
1588
|
default: X(() => {
|
|
1589
1589
|
var O, w, d;
|
|
1590
1590
|
return [
|
|
1591
1591
|
N(ws, {
|
|
1592
|
-
"netsuite-id": (w = (O =
|
|
1593
|
-
"purchase-order-id": (d =
|
|
1592
|
+
"netsuite-id": (w = (O = b.purchaseOrder) == null ? void 0 : O.netSuite) == null ? void 0 : w.id,
|
|
1593
|
+
"purchase-order-id": (d = b.purchaseOrder) == null ? void 0 : d._id
|
|
1594
1594
|
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
1595
1595
|
];
|
|
1596
1596
|
}),
|
|
1597
1597
|
_: 1
|
|
1598
1598
|
}),
|
|
1599
1599
|
N(os, {
|
|
1600
|
-
"po-request":
|
|
1601
|
-
"purchase-order":
|
|
1600
|
+
"po-request": b.poRequest,
|
|
1601
|
+
"purchase-order": b.purchaseOrder,
|
|
1602
1602
|
"is-transfer-between-outlets": !f.value,
|
|
1603
|
-
scope:
|
|
1603
|
+
scope: b.scope
|
|
1604
1604
|
}, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets", "scope"])
|
|
1605
1605
|
])
|
|
1606
1606
|
])
|
|
1607
1607
|
]),
|
|
1608
1608
|
N(_),
|
|
1609
1609
|
N(xs, {
|
|
1610
|
-
"po-request":
|
|
1611
|
-
"purchase-order":
|
|
1612
|
-
"transfer-type":
|
|
1613
|
-
"transfer-to-db-name":
|
|
1610
|
+
"po-request": b.poRequest,
|
|
1611
|
+
"purchase-order": b.purchaseOrder,
|
|
1612
|
+
"transfer-type": b.transferType,
|
|
1613
|
+
"transfer-to-db-name": b.transferToDbName,
|
|
1614
1614
|
"is-transfer-between-outlets": !f.value,
|
|
1615
|
-
scope:
|
|
1615
|
+
scope: b.scope
|
|
1616
1616
|
}, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
|
|
1617
1617
|
])) : M("", !0);
|
|
1618
1618
|
};
|
|
@@ -1626,7 +1626,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1626
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 = {
|
|
1627
1627
|
key: 0,
|
|
1628
1628
|
class: "flex flex-col gap-4"
|
|
1629
|
-
}, vr = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" },
|
|
1629
|
+
}, vr = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, br = /* @__PURE__ */ we({
|
|
1630
1630
|
__name: "EditForm",
|
|
1631
1631
|
props: {
|
|
1632
1632
|
purchaseOrder: {},
|
|
@@ -1634,19 +1634,19 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1634
1634
|
},
|
|
1635
1635
|
emits: ["submitted"],
|
|
1636
1636
|
setup(k, { emit: a }) {
|
|
1637
|
-
|
|
1638
|
-
const o = Me(), f = Ue(),
|
|
1637
|
+
Gt();
|
|
1638
|
+
const o = Me(), f = Ue(), b = J(!1), n = k, _ = a, r = _t("deliveryOrder"), c = Be(), O = Y(
|
|
1639
1639
|
() => {
|
|
1640
|
-
var
|
|
1641
|
-
return ((
|
|
1640
|
+
var h;
|
|
1641
|
+
return ((h = n.purchaseOrder.deliveryFullfillment) == null ? void 0 : h.findIndex(
|
|
1642
1642
|
(u) => n.deliveryOrder.fullfillmentId && u.id === n.deliveryOrder.fullfillmentId
|
|
1643
1643
|
)) ?? -1;
|
|
1644
1644
|
}
|
|
1645
|
-
), w = o.enablePurchaseOrderReceiveWithCustomCost, d = o.enablePortalDeliveryOrderWrite,
|
|
1645
|
+
), w = o.enablePurchaseOrderReceiveWithCustomCost, d = o.enablePortalDeliveryOrderWrite, P = J({}), S = Y(() => n.purchaseOrder.items.map((h, u) => Y({
|
|
1646
1646
|
get: () => {
|
|
1647
|
-
var
|
|
1648
|
-
const $ = (
|
|
1649
|
-
return $ ? +
|
|
1647
|
+
var I;
|
|
1648
|
+
const $ = (I = r.received[u]) == null ? void 0 : I.cost;
|
|
1649
|
+
return $ ? +be($) : 0;
|
|
1650
1650
|
},
|
|
1651
1651
|
set: ($) => {
|
|
1652
1652
|
r.received[u].cost = {
|
|
@@ -1654,31 +1654,31 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1654
1654
|
...Qe($, 4)
|
|
1655
1655
|
};
|
|
1656
1656
|
}
|
|
1657
|
-
}))), F = Y(() => n.deliveryOrder.received.map((
|
|
1657
|
+
}))), F = Y(() => n.deliveryOrder.received.map((h, u) => Y({
|
|
1658
1658
|
get: () => {
|
|
1659
|
-
var
|
|
1660
|
-
const $ = (
|
|
1661
|
-
return $ ? +
|
|
1659
|
+
var I;
|
|
1660
|
+
const $ = (I = r.received[u]) == null ? void 0 : I.amount;
|
|
1661
|
+
return $ ? +be($) : 0;
|
|
1662
1662
|
},
|
|
1663
1663
|
set: ($) => {
|
|
1664
1664
|
r.received[u].amount = Qe($, 2);
|
|
1665
1665
|
}
|
|
1666
1666
|
})));
|
|
1667
|
-
function l(
|
|
1668
|
-
const u = !
|
|
1669
|
-
if (
|
|
1670
|
-
const $ = n.deliveryOrder.received[
|
|
1671
|
-
$.cost ? r.received[
|
|
1667
|
+
function l(h) {
|
|
1668
|
+
const u = !P.value[h];
|
|
1669
|
+
if (P.value[h] = u, u) {
|
|
1670
|
+
const $ = n.deliveryOrder.received[h];
|
|
1671
|
+
$.cost ? r.received[h].cost = {
|
|
1672
1672
|
currency: $.cost.currency,
|
|
1673
1673
|
amount: $.cost.amount,
|
|
1674
1674
|
precision: $.cost.precision
|
|
1675
|
-
} : r.received[
|
|
1675
|
+
} : r.received[h].cost = {
|
|
1676
1676
|
currency: $e(),
|
|
1677
1677
|
amount: 0,
|
|
1678
1678
|
precision: 4
|
|
1679
1679
|
};
|
|
1680
1680
|
} else
|
|
1681
|
-
delete r.received[
|
|
1681
|
+
delete r.received[h].cost;
|
|
1682
1682
|
}
|
|
1683
1683
|
function s() {
|
|
1684
1684
|
c.updateDeliveryOrder({
|
|
@@ -1696,14 +1696,14 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1696
1696
|
type: "success"
|
|
1697
1697
|
},
|
|
1698
1698
|
1e4
|
|
1699
|
-
),
|
|
1699
|
+
), b.value = !1, _("submitted");
|
|
1700
1700
|
});
|
|
1701
1701
|
}
|
|
1702
|
-
return (
|
|
1703
|
-
const $ = K("FmButton"),
|
|
1704
|
-
return i(), re(
|
|
1705
|
-
modelValue:
|
|
1706
|
-
"onUpdate:modelValue": u[1] || (u[1] = (Q) =>
|
|
1702
|
+
return (h, u) => {
|
|
1703
|
+
const $ = K("FmButton"), I = K("FmStepperField"), B = K("FmSwitch"), C = K("FmTextField"), H = K("FmDialog");
|
|
1704
|
+
return i(), re(H, {
|
|
1705
|
+
modelValue: b.value,
|
|
1706
|
+
"onUpdate:modelValue": u[1] || (u[1] = (Q) => b.value = Q),
|
|
1707
1707
|
overlay: !0
|
|
1708
1708
|
}, {
|
|
1709
1709
|
"dialog-button": X(() => [
|
|
@@ -1716,7 +1716,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1716
1716
|
})) : M("", !0)
|
|
1717
1717
|
]),
|
|
1718
1718
|
"dialog-header": X(() => [
|
|
1719
|
-
e("div", null, "Received on " + y(v(
|
|
1719
|
+
e("div", null, "Received on " + y(v(Ke)(n.deliveryOrder.createdAt)), 1)
|
|
1720
1720
|
]),
|
|
1721
1721
|
"dialog-footer": X(() => [
|
|
1722
1722
|
N($, {
|
|
@@ -1732,7 +1732,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1732
1732
|
e("div", Zs, [
|
|
1733
1733
|
e("div", er, [
|
|
1734
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(
|
|
1735
|
+
e("div", tr, y(n.deliveryOrder.adjustment ? v(Ke)(new Date(v(We)(n.deliveryOrder.adjustment))) : "-"), 1)
|
|
1736
1736
|
]),
|
|
1737
1737
|
e("div", sr, [
|
|
1738
1738
|
u[4] || (u[4] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received items", -1)),
|
|
@@ -1745,7 +1745,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1745
1745
|
e("span", ar, y(Q.sku.code), 1)
|
|
1746
1746
|
]),
|
|
1747
1747
|
e("div", lr, [
|
|
1748
|
-
N(
|
|
1748
|
+
N(I, {
|
|
1749
1749
|
label: "Receive Quantity",
|
|
1750
1750
|
modelValue: F.value[se].value,
|
|
1751
1751
|
"onUpdate:modelValue": (ye) => F.value[se].value = ye,
|
|
@@ -1755,13 +1755,13 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1755
1755
|
e("div", ir, y(`${Q.cost ? `${v(ze)(Q.cost)}` : ""}`), 1),
|
|
1756
1756
|
v(w) ? (i(), g("div", cr, [
|
|
1757
1757
|
N(B, {
|
|
1758
|
-
"model-value":
|
|
1758
|
+
"model-value": P.value[se],
|
|
1759
1759
|
"onUpdate:modelValue": (ye) => l(se),
|
|
1760
1760
|
size: "sm"
|
|
1761
1761
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
1762
1762
|
u[3] || (u[3] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
1763
1763
|
])) : M("", !0),
|
|
1764
|
-
v(w) &&
|
|
1764
|
+
v(w) && P.value[se] ? (i(), re(I, {
|
|
1765
1765
|
key: 1,
|
|
1766
1766
|
modelValue: S.value[se].value,
|
|
1767
1767
|
"onUpdate:modelValue": (ye) => S.value[se].value = ye,
|
|
@@ -1804,7 +1804,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1804
1804
|
}, 8, ["modelValue"]);
|
|
1805
1805
|
};
|
|
1806
1806
|
}
|
|
1807
|
-
}),
|
|
1807
|
+
}), hr = { class: "flex flex-col gap-3" }, gr = { class: "flex flex-col gap-4" }, _r = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, Sr = {
|
|
1808
1808
|
key: 0,
|
|
1809
1809
|
class: "flex flex-col gap-4"
|
|
1810
1810
|
}, xr = { class: "flex items-center justify-between" }, Or = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, wr = {
|
|
@@ -1813,13 +1813,13 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1813
1813
|
}, $r = { class: "flex gap-4" }, Cr = { class: "flex-1" }, Rr = { class: "flex-1" }, kr = {
|
|
1814
1814
|
key: 0,
|
|
1815
1815
|
class: "flex items-center text-fm-color-system-error-300"
|
|
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" },
|
|
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" }, Pr = { class: "fm-typo-en-body-md-400" }, Ir = { class: "flex flex-col gap-2 items-end" }, qr = {
|
|
1817
1817
|
key: 0,
|
|
1818
1818
|
class: "flex items-center gap-2"
|
|
1819
|
-
},
|
|
1819
|
+
}, Er = {
|
|
1820
1820
|
key: 0,
|
|
1821
1821
|
class: "border-b border-fm-color-stroke-secondary"
|
|
1822
|
-
},
|
|
1822
|
+
}, Vr = { 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({
|
|
1823
1823
|
__name: "CreateForm",
|
|
1824
1824
|
props: {
|
|
1825
1825
|
purchaseOrder: {},
|
|
@@ -1828,22 +1828,22 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1828
1828
|
emits: ["submitted"],
|
|
1829
1829
|
setup(k, { emit: a }) {
|
|
1830
1830
|
var q, U, ae;
|
|
1831
|
-
const { t: o } = ct(), f = J(!1),
|
|
1831
|
+
const { t: o } = ct(), f = J(!1), b = it(), n = k, _ = a, r = _t("", {
|
|
1832
1832
|
default: {
|
|
1833
1833
|
deliveryOrderNumber: "",
|
|
1834
1834
|
remark: "",
|
|
1835
1835
|
received: n.purchaseOrder.items.map((D) => ({
|
|
1836
1836
|
sku: D.sku,
|
|
1837
|
-
amount:
|
|
1837
|
+
amount: Pe.fromNumber(0),
|
|
1838
1838
|
measurement: D.measurement
|
|
1839
1839
|
})),
|
|
1840
1840
|
createdBy: {
|
|
1841
|
-
id: ((q =
|
|
1842
|
-
name: ((U =
|
|
1841
|
+
id: ((q = b.sessionUser.value) == null ? void 0 : q.id) || "",
|
|
1842
|
+
name: ((U = b.sessionUser.value) == null ? void 0 : U.displayName) || ""
|
|
1843
1843
|
},
|
|
1844
1844
|
createdAt: ""
|
|
1845
1845
|
}
|
|
1846
|
-
}), c = Be(), O = et(), w = Me(), d = ((ae = n.purchaseOrder) == null ? void 0 : ae.supplier.internal) != null,
|
|
1846
|
+
}), c = Be(), O = et(), w = Me(), d = ((ae = n.purchaseOrder) == null ? void 0 : ae.supplier.internal) != null, P = d && w.enablePOSTransferRequireFulfillment, S = w.enablePortalDeliveryOrderWrite && (n.purchaseOrder.status === ee.Enum.RECEIVING || n.purchaseOrder.status === ee.Enum.COMPLETE) && (d ? !P : !0), F = w.enablePurchaseOrderReceiveWithCustomCost, l = w.enableBackdateReceive, s = J({}), h = Ue(), u = Y({
|
|
1847
1847
|
get() {
|
|
1848
1848
|
if (!r.createdAt) return "";
|
|
1849
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");
|
|
@@ -1867,7 +1867,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1867
1867
|
x.setHours(parseInt(T)), x.setMinutes(parseInt(j)), r.createdAt = x.toISOString();
|
|
1868
1868
|
}
|
|
1869
1869
|
}
|
|
1870
|
-
}),
|
|
1870
|
+
}), I = Y(() => {
|
|
1871
1871
|
const D = We(n.purchaseOrder._id);
|
|
1872
1872
|
if (!D) return "";
|
|
1873
1873
|
const x = new Date(D), T = x.getFullYear(), j = String(x.getMonth() + 1).padStart(2, "0"), t = String(x.getDate()).padStart(2, "0");
|
|
@@ -1878,13 +1878,13 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1878
1878
|
}), C = Y(() => {
|
|
1879
1879
|
if (!u.value || !$.value || !B.value) return null;
|
|
1880
1880
|
if (/* @__PURE__ */ new Date(`${u.value}T${$.value}:00`) < B.value) {
|
|
1881
|
-
const x =
|
|
1881
|
+
const x = I.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
1882
|
return `Delivery date & time cannot be earlier than order creation (${x} ${A})`;
|
|
1883
1883
|
}
|
|
1884
1884
|
return null;
|
|
1885
|
-
}),
|
|
1885
|
+
}), H = Y(() => C.value ? !1 : r.received.some((x) => {
|
|
1886
1886
|
const T = x.amount;
|
|
1887
|
-
return T ? +
|
|
1887
|
+
return T ? +be(T) > 0 : !1;
|
|
1888
1888
|
}));
|
|
1889
1889
|
function Q() {
|
|
1890
1890
|
r.createdAt = "";
|
|
@@ -1893,7 +1893,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1893
1893
|
get: () => {
|
|
1894
1894
|
var j;
|
|
1895
1895
|
const T = (j = r.received[x]) == null ? void 0 : j.amount;
|
|
1896
|
-
return T ? +
|
|
1896
|
+
return T ? +be(T) : 0;
|
|
1897
1897
|
},
|
|
1898
1898
|
set: (T) => {
|
|
1899
1899
|
r.received[x].amount = Qe(T, 2);
|
|
@@ -1920,7 +1920,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1920
1920
|
get: () => {
|
|
1921
1921
|
var j;
|
|
1922
1922
|
const T = (j = r.received[x]) == null ? void 0 : j.cost;
|
|
1923
|
-
return T ? +
|
|
1923
|
+
return T ? +be(T) : 0;
|
|
1924
1924
|
},
|
|
1925
1925
|
set: (T) => {
|
|
1926
1926
|
r.received[x].cost = {
|
|
@@ -1951,7 +1951,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1951
1951
|
purchaseOrderRev: n.purchaseOrder._rev,
|
|
1952
1952
|
currency: $e()
|
|
1953
1953
|
}).then(() => {
|
|
1954
|
-
|
|
1954
|
+
h.open(
|
|
1955
1955
|
{
|
|
1956
1956
|
title: "Success",
|
|
1957
1957
|
message: `New delivery order created for PO# ${n.purchaseOrder.seqNumber}`,
|
|
@@ -1962,7 +1962,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1962
1962
|
});
|
|
1963
1963
|
}
|
|
1964
1964
|
return (D, x) => {
|
|
1965
|
-
const T = K("FmButton"), j = K("FmDatePicker"), t = K("FmTimePicker"), p = K("FmIcon"), A = K("FmStepperField"), R = K("FmSwitch"),
|
|
1965
|
+
const T = K("FmButton"), j = K("FmDatePicker"), t = K("FmTimePicker"), p = K("FmIcon"), A = K("FmStepperField"), R = K("FmSwitch"), G = K("FmTextField"), W = K("FmDialog");
|
|
1966
1966
|
return i(), re(W, {
|
|
1967
1967
|
modelValue: f.value,
|
|
1968
1968
|
"onUpdate:modelValue": x[4] || (x[4] = (te) => f.value = te),
|
|
@@ -1988,17 +1988,17 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
1988
1988
|
label: "Create",
|
|
1989
1989
|
size: "md",
|
|
1990
1990
|
variant: "destructive",
|
|
1991
|
-
disabled: !
|
|
1991
|
+
disabled: !H.value,
|
|
1992
1992
|
onClick: De
|
|
1993
1993
|
}, null, 8, ["disabled"])
|
|
1994
1994
|
]),
|
|
1995
1995
|
default: X(() => {
|
|
1996
1996
|
var te;
|
|
1997
1997
|
return [
|
|
1998
|
-
e("div",
|
|
1998
|
+
e("div", hr, [
|
|
1999
1999
|
e("div", gr, [
|
|
2000
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(
|
|
2001
|
+
e("div", _r, y((te = v(b).sessionUser.value) == null ? void 0 : te.displayName), 1)
|
|
2002
2002
|
]),
|
|
2003
2003
|
v(l) ? (i(), g("div", Sr, [
|
|
2004
2004
|
e("div", xr, [
|
|
@@ -2045,14 +2045,14 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2045
2045
|
e("div", Ar, [
|
|
2046
2046
|
e("div", Fr, [
|
|
2047
2047
|
e("span", Tr, y(m.sku.name), 1),
|
|
2048
|
-
e("span",
|
|
2048
|
+
e("span", Pr, y(m.sku.code), 1)
|
|
2049
2049
|
]),
|
|
2050
|
-
e("div",
|
|
2050
|
+
e("div", Ir, [
|
|
2051
2051
|
N(A, {
|
|
2052
2052
|
label: "Receive Quantity",
|
|
2053
2053
|
modelValue: se.value[z].value,
|
|
2054
2054
|
"onUpdate:modelValue": (ne) => se.value[z].value = ne,
|
|
2055
|
-
"helper-text": `${v(o)("inventory.transfer.receiveRequest.details.received")} ${v(
|
|
2055
|
+
"helper-text": `${v(o)("inventory.transfer.receiveRequest.details.received")} ${v(Pe).toFormatString(
|
|
2056
2056
|
{
|
|
2057
2057
|
value: (le = D.receivedInfoMap[m.sku._id]) == null ? void 0 : le.received
|
|
2058
2058
|
}
|
|
@@ -2081,14 +2081,14 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2081
2081
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : M("", !0)
|
|
2082
2082
|
])
|
|
2083
2083
|
]),
|
|
2084
|
-
z < n.purchaseOrder.items.length - 1 ? (i(), g("div",
|
|
2084
|
+
z < n.purchaseOrder.items.length - 1 ? (i(), g("div", Er)) : M("", !0)
|
|
2085
2085
|
]);
|
|
2086
2086
|
}), 128))
|
|
2087
2087
|
]),
|
|
2088
|
-
e("div",
|
|
2088
|
+
e("div", Vr, [
|
|
2089
2089
|
x[9] || (x[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
|
|
2090
2090
|
e("div", Lr, [
|
|
2091
|
-
N(
|
|
2091
|
+
N(G, {
|
|
2092
2092
|
modelValue: v(r).deliveryOrderNumber,
|
|
2093
2093
|
"onUpdate:modelValue": x[2] || (x[2] = (m) => v(r).deliveryOrderNumber = m),
|
|
2094
2094
|
size: "md"
|
|
@@ -2098,7 +2098,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2098
2098
|
e("div", Mr, [
|
|
2099
2099
|
x[10] || (x[10] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
|
|
2100
2100
|
e("div", Ur, [
|
|
2101
|
-
N(
|
|
2101
|
+
N(G, {
|
|
2102
2102
|
modelValue: v(r).remark,
|
|
2103
2103
|
"onUpdate:modelValue": x[3] || (x[3] = (m) => v(r).remark = m),
|
|
2104
2104
|
size: "md"
|
|
@@ -2118,7 +2118,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2118
2118
|
}, Kr = {
|
|
2119
2119
|
key: 1,
|
|
2120
2120
|
class: "border-t pt-6"
|
|
2121
|
-
},
|
|
2121
|
+
}, Hr = { class: "fm-typo-en-body-lg-600 mb-4 flex items-center gap-2" }, Gr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg overflow-y-auto" }, Wr = { class: "w-full" }, Qr = {
|
|
2122
2122
|
class: "p-3 fm-typo-en-body-sm-600",
|
|
2123
2123
|
style: { "min-width": "130px" }
|
|
2124
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({
|
|
@@ -2127,17 +2127,17 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2127
2127
|
netsuiteId: {}
|
|
2128
2128
|
},
|
|
2129
2129
|
setup(k) {
|
|
2130
|
-
const a = k, o = ut(), f = J(!1),
|
|
2130
|
+
const a = k, o = ut(), f = J(!1), b = J(!1), n = J(!1), _ = J([]);
|
|
2131
2131
|
async function r() {
|
|
2132
2132
|
if (!(_.value.length > 0))
|
|
2133
2133
|
try {
|
|
2134
|
-
|
|
2134
|
+
b.value = !0;
|
|
2135
2135
|
const w = await o.getChangeLogs(a.netsuiteId);
|
|
2136
2136
|
_.value = w, n.value = !1;
|
|
2137
2137
|
} catch {
|
|
2138
2138
|
n.value = !0;
|
|
2139
2139
|
} finally {
|
|
2140
|
-
|
|
2140
|
+
b.value = !1;
|
|
2141
2141
|
}
|
|
2142
2142
|
}
|
|
2143
2143
|
function c(w) {
|
|
@@ -2164,7 +2164,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2164
2164
|
});
|
|
2165
2165
|
}
|
|
2166
2166
|
return (w, d) => {
|
|
2167
|
-
const
|
|
2167
|
+
const P = K("FmButton"), S = K("FmCircularProgress"), F = K("FmIcon"), l = K("FmDialog");
|
|
2168
2168
|
return i(), g("div", jr, [
|
|
2169
2169
|
N(l, {
|
|
2170
2170
|
modelValue: f.value,
|
|
@@ -2173,7 +2173,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2173
2173
|
"max-width": 800
|
|
2174
2174
|
}, {
|
|
2175
2175
|
"dialog-button": X(() => [
|
|
2176
|
-
N(
|
|
2176
|
+
N(P, {
|
|
2177
2177
|
"prepend-icon": "info",
|
|
2178
2178
|
variant: "secondary",
|
|
2179
2179
|
label: "NetSuite",
|
|
@@ -2187,12 +2187,12 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2187
2187
|
e("div", null, "NetSuite info", -1)
|
|
2188
2188
|
])),
|
|
2189
2189
|
default: X(() => [
|
|
2190
|
-
|
|
2190
|
+
b.value ? (i(), g("div", zr, [
|
|
2191
2191
|
d[4] || (d[4] = e("span", null, "Change Log Loading...", -1)),
|
|
2192
2192
|
N(S, { size: "md" })
|
|
2193
2193
|
])) : M("", !0),
|
|
2194
|
-
!
|
|
2195
|
-
e("h3",
|
|
2194
|
+
!b.value && _.value.length > 0 ? (i(), g("div", Kr, [
|
|
2195
|
+
e("h3", Hr, [
|
|
2196
2196
|
N(F, {
|
|
2197
2197
|
name: "error",
|
|
2198
2198
|
color: "#ff9500",
|
|
@@ -2200,7 +2200,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2200
2200
|
}),
|
|
2201
2201
|
d[5] || (d[5] = Re(" Change Logs "))
|
|
2202
2202
|
]),
|
|
2203
|
-
e("div",
|
|
2203
|
+
e("div", Gr, [
|
|
2204
2204
|
e("table", Wr, [
|
|
2205
2205
|
d[6] || (d[6] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
|
|
2206
2206
|
e("tr", { class: "border-b border-fm-color-neutral-gray-200" }, [
|
|
@@ -2219,8 +2219,8 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2219
2219
|
])
|
|
2220
2220
|
], -1)),
|
|
2221
2221
|
e("tbody", null, [
|
|
2222
|
-
(i(!0), g(ue, null, Se(_.value, (s,
|
|
2223
|
-
key:
|
|
2222
|
+
(i(!0), g(ue, null, Se(_.value, (s, h) => (i(), g("tr", {
|
|
2223
|
+
key: h,
|
|
2224
2224
|
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
2225
2225
|
}, [
|
|
2226
2226
|
e("td", Qr, y(O(s._dateiso8601)), 1),
|
|
@@ -2243,7 +2243,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2243
2243
|
])))
|
|
2244
2244
|
]),
|
|
2245
2245
|
"dialog-footer": X(() => [
|
|
2246
|
-
N(
|
|
2246
|
+
N(P, {
|
|
2247
2247
|
class: "ml-auto sm:w-full xs:w-full",
|
|
2248
2248
|
label: "Close",
|
|
2249
2249
|
size: "md",
|
|
@@ -2259,7 +2259,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2259
2259
|
}), no = { class: "flex flex-col w-full gap-3" }, ao = { class: "flex" }, lo = { class: "fm-typo-en-title-md-600 text-fm-color-typo-primary" }, io = { class: "flex flex-col gap-16 w-full h-full" }, co = { class: "flex justify-between" }, uo = { class: "fm-typo-en-body-lg-600" }, mo = { class: "flex gap-2" }, po = {
|
|
2260
2260
|
key: 0,
|
|
2261
2261
|
class: "flex items-center gap-1"
|
|
2262
|
-
}, fo = { class: "fm-typo-en-body-md-400" }, yo = { class: "flex flex-col gap-8" }, vo = { class: "flex flex-col gap-4" },
|
|
2262
|
+
}, fo = { class: "fm-typo-en-body-md-400" }, yo = { class: "flex flex-col gap-8" }, vo = { class: "flex flex-col gap-4" }, bo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ho = { class: "flex gap-1" }, go = { class: "fm-typo-en-body-lg-600" }, _o = {
|
|
2263
2263
|
key: 0,
|
|
2264
2264
|
class: "flex flex-col gap-4"
|
|
2265
2265
|
}, So = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xo = { class: "fm-typo-en-body-lg-600" }, Oo = { class: "flex flex-col gap-4" }, wo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $o = { class: "fm-typo-en-body-lg-600" }, Co = {
|
|
@@ -2271,10 +2271,10 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2271
2271
|
}, No = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ao = { class: "fm-typo-en-body-lg-600" }, Fo = {
|
|
2272
2272
|
key: 3,
|
|
2273
2273
|
class: "flex flex-col gap-4"
|
|
2274
|
-
}, To = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
2274
|
+
}, To = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Po = { class: "fm-typo-en-body-lg-600" }, Io = {
|
|
2275
2275
|
key: 4,
|
|
2276
2276
|
class: "flex flex-col gap-4"
|
|
2277
|
-
}, 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" }, Eo = { class: "fm-typo-en-body-lg-600" }, Vo = { 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" }, Ho = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Go = ["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 = {
|
|
2278
2278
|
key: 0,
|
|
2279
2279
|
class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
2280
2280
|
}, Jo = { class: "py-8" }, Xo = { class: "flex justify-end gap-4 items-center" }, Zo = { class: "fm-typo-en-body-lg-600" }, en = {
|
|
@@ -2292,7 +2292,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2292
2292
|
}, cn = { class: "flex-1 flex flex-col items-center" }, un = { class: "h-40 w-40 bg-fm-color-primary rounded-full flex items-center justify-center" }, dn = { class: "flex-1 flex flex-col items-center" }, mn = { class: "flex w-full items-center gap-4" }, pn = {
|
|
2293
2293
|
class: "py-12 flex flex-col gap-4",
|
|
2294
2294
|
name: "received-at header"
|
|
2295
|
-
}, fn = { class: "fm-typo-en-body-lg-400" }, yn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, vn = { class: "ml-auto flex gap-1" },
|
|
2295
|
+
}, fn = { class: "fm-typo-en-body-lg-400" }, yn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, vn = { class: "ml-auto flex gap-1" }, bn = { class: "flex gap-12 content-stretch" }, hn = {
|
|
2296
2296
|
class: "flex flex-col w-40",
|
|
2297
2297
|
name: "circles"
|
|
2298
2298
|
}, gn = { class: "flex-1 flex flex-col items-center" }, _n = {
|
|
@@ -2314,7 +2314,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2314
2314
|
},
|
|
2315
2315
|
emits: ["update:show", "submitted"],
|
|
2316
2316
|
setup(k, { emit: a }) {
|
|
2317
|
-
const o = k, f = a,
|
|
2317
|
+
const o = k, f = a, b = et(), n = Ue(), _ = Me(), r = ke(), c = it(), O = Y(
|
|
2318
2318
|
() => {
|
|
2319
2319
|
var t, p;
|
|
2320
2320
|
return {
|
|
@@ -2322,27 +2322,27 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2322
2322
|
name: ((p = c.sessionUser.value) == null ? void 0 : p.displayName) ?? ""
|
|
2323
2323
|
};
|
|
2324
2324
|
}
|
|
2325
|
-
), w = ss(), { t: d } = ct(),
|
|
2325
|
+
), w = ss(), { t: d } = ct(), P = Y(
|
|
2326
2326
|
() => {
|
|
2327
2327
|
var t, p, A, R;
|
|
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" ?
|
|
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" ? He.TRANSFER : He.PURCHASE;
|
|
2329
2329
|
}
|
|
2330
2330
|
), S = Y(() => {
|
|
2331
2331
|
var A;
|
|
2332
2332
|
const t = (A = o.shipments) == null ? void 0 : A.find((R) => {
|
|
2333
|
-
var
|
|
2334
|
-
return R.ref === ((
|
|
2333
|
+
var G;
|
|
2334
|
+
return R.ref === ((G = o.purchaseOrder) == null ? void 0 : G._id);
|
|
2335
2335
|
});
|
|
2336
2336
|
let p = null;
|
|
2337
2337
|
if (t != null && t.milestones && t.milestones.length > 0) {
|
|
2338
2338
|
const R = t.milestones[t.milestones.length - 1];
|
|
2339
2339
|
if (R.estimatedTime) {
|
|
2340
|
-
const
|
|
2341
|
-
p = `${
|
|
2340
|
+
const G = new Date(R.estimatedTime), W = G.getDate().toString().padStart(2, "0");
|
|
2341
|
+
p = `${G.toLocaleString("en-US", { month: "short" })} ${W}`;
|
|
2342
2342
|
}
|
|
2343
2343
|
}
|
|
2344
2344
|
return p;
|
|
2345
|
-
}), F = J(!1), l = J(""), s = J(!0),
|
|
2345
|
+
}), F = J(!1), l = J(""), s = J(!0), h = Be(), u = zt(h.getWorkflowConfig), $ = xt(), I = Y(() => {
|
|
2346
2346
|
if (!o.purchaseOrder)
|
|
2347
2347
|
return [];
|
|
2348
2348
|
const t = u.result.value;
|
|
@@ -2352,8 +2352,8 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2352
2352
|
user: O.value,
|
|
2353
2353
|
executedAt: r.locations.computeFirst(
|
|
2354
2354
|
(R) => {
|
|
2355
|
-
var
|
|
2356
|
-
return R.dbName === ((
|
|
2355
|
+
var G;
|
|
2356
|
+
return R.dbName === ((G = r._currentLocation) == null ? void 0 : G.dbName) ? R : null;
|
|
2357
2357
|
}
|
|
2358
2358
|
),
|
|
2359
2359
|
purchaseOrderRequest: o.poRequest,
|
|
@@ -2368,19 +2368,19 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2368
2368
|
(R) => (
|
|
2369
2369
|
// TODO: create receiveStock & processRequest dialog
|
|
2370
2370
|
// to create their payload
|
|
2371
|
-
R !==
|
|
2371
|
+
R !== E.enum.receiveStock && R !== E.enum.processRequest && R !== E.enum.closeRequest
|
|
2372
2372
|
)
|
|
2373
2373
|
)) : A = tt.getAvailableActions({
|
|
2374
2374
|
...p,
|
|
2375
2375
|
orderConfig: t.data
|
|
2376
2376
|
}).actions.filter(
|
|
2377
|
-
(R) => R !==
|
|
2377
|
+
(R) => R !== E.enum.receiveStock && R !== E.enum.processRequest && R !== E.enum.closeRequest
|
|
2378
2378
|
);
|
|
2379
2379
|
} catch (R) {
|
|
2380
2380
|
console.error("Error getting available actions:", R);
|
|
2381
2381
|
}
|
|
2382
|
-
return o.scope === "approval" && (A = A.filter((R) => R !==
|
|
2383
|
-
}), B =
|
|
2382
|
+
return o.scope === "approval" && (A = A.filter((R) => R !== E.enum.completeReceive)), A;
|
|
2383
|
+
}), B = It(o, "show"), C = Y(() => [
|
|
2384
2384
|
{
|
|
2385
2385
|
label: d("inventory.transfer.receiveRequest.details.overview"),
|
|
2386
2386
|
value: "overview"
|
|
@@ -2389,11 +2389,11 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2389
2389
|
label: d("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
2390
2390
|
value: "deliveryHistory"
|
|
2391
2391
|
}
|
|
2392
|
-
]),
|
|
2392
|
+
]), H = J(C.value[0]);
|
|
2393
2393
|
Ct(
|
|
2394
2394
|
() => o.show,
|
|
2395
2395
|
(t) => {
|
|
2396
|
-
t && (
|
|
2396
|
+
t && (H.value = C.value[0]);
|
|
2397
2397
|
}
|
|
2398
2398
|
);
|
|
2399
2399
|
function Q(t) {
|
|
@@ -2405,9 +2405,9 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2405
2405
|
}
|
|
2406
2406
|
}));
|
|
2407
2407
|
}
|
|
2408
|
-
async function se(t, p, A, R,
|
|
2408
|
+
async function se(t, p, A, R, G) {
|
|
2409
2409
|
return new Promise((W, te) => {
|
|
2410
|
-
|
|
2410
|
+
b.open({
|
|
2411
2411
|
closeButton: !1,
|
|
2412
2412
|
title: R.title,
|
|
2413
2413
|
message: R.message,
|
|
@@ -2416,7 +2416,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2416
2416
|
}).onPrimary(async () => {
|
|
2417
2417
|
var z, le, oe, L;
|
|
2418
2418
|
const m = [];
|
|
2419
|
-
A ===
|
|
2419
|
+
A === E.enum.approveRequest ? (m.push({
|
|
2420
2420
|
action: "approveRequest",
|
|
2421
2421
|
payload: null
|
|
2422
2422
|
}), p.fulfillment && m.push({
|
|
@@ -2428,7 +2428,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2428
2428
|
items: Q(p.fulfillment.items),
|
|
2429
2429
|
createdBy: O.value
|
|
2430
2430
|
}
|
|
2431
|
-
})) : A ===
|
|
2431
|
+
})) : A === E.enum.processRequest ? p.fulfillment && m.push({
|
|
2432
2432
|
action: "processRequest",
|
|
2433
2433
|
payload: {
|
|
2434
2434
|
fulfillmentId: "",
|
|
@@ -2437,10 +2437,10 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2437
2437
|
items: Q(p.fulfillment.items),
|
|
2438
2438
|
createdBy: O.value
|
|
2439
2439
|
}
|
|
2440
|
-
}) : A ===
|
|
2440
|
+
}) : A === E.enum.rejectRequest ? m.push({
|
|
2441
2441
|
action: "rejectRequest",
|
|
2442
2442
|
payload: null
|
|
2443
|
-
}) : A ===
|
|
2443
|
+
}) : A === E.enum.closeRequest && m.push({
|
|
2444
2444
|
action: "closeRequest",
|
|
2445
2445
|
payload: null
|
|
2446
2446
|
});
|
|
@@ -2465,15 +2465,15 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2465
2465
|
}
|
|
2466
2466
|
}).onSecondary(() => {
|
|
2467
2467
|
W("cancelled");
|
|
2468
|
-
for (let m = 0; m <
|
|
2469
|
-
|
|
2468
|
+
for (let m = 0; m < G + 2; m++)
|
|
2469
|
+
b.close();
|
|
2470
2470
|
}).onClose(() => {
|
|
2471
2471
|
});
|
|
2472
2472
|
});
|
|
2473
2473
|
}
|
|
2474
2474
|
async function fe(t) {
|
|
2475
|
-
var
|
|
2476
|
-
if (t ===
|
|
2475
|
+
var G, W, te, m;
|
|
2476
|
+
if (t === E.enum.receiveStock)
|
|
2477
2477
|
return;
|
|
2478
2478
|
const p = St[t];
|
|
2479
2479
|
if (!p) {
|
|
@@ -2489,14 +2489,14 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2489
2489
|
l.value = `${t}`, F.value = !0, s.value = !1;
|
|
2490
2490
|
const z = {};
|
|
2491
2491
|
let le = 0;
|
|
2492
|
-
if ((t ===
|
|
2493
|
-
t ===
|
|
2492
|
+
if ((t === E.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
2493
|
+
t === E.enum.completeReceive) && _.autoReceiveWarehouse)
|
|
2494
2494
|
z.autoReceive = !0;
|
|
2495
|
-
else if ((t ===
|
|
2496
|
-
const oe = (W = (
|
|
2495
|
+
else if ((t === E.enum.approveRequest || t === E.enum.processRequest) && _.acceptRequireFulfillment) {
|
|
2496
|
+
const oe = (W = (G = o.poRequest) == null ? void 0 : G.from) == null ? void 0 : W.dbName, L = (m = (te = o.poRequest) == null ? void 0 : te.to) == null ? void 0 : m.dbName;
|
|
2497
2497
|
if (oe && L && (oe.startsWith("warehouse_") || L.startsWith("warehouse_"))) {
|
|
2498
2498
|
const ne = await new Promise((xe, Ne) => {
|
|
2499
|
-
|
|
2499
|
+
b.open({
|
|
2500
2500
|
closeButton: !1,
|
|
2501
2501
|
title: "Confirm transfer amount",
|
|
2502
2502
|
dialogComponent: ts,
|
|
@@ -2504,7 +2504,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2504
2504
|
purchaseOrder: o.purchaseOrder,
|
|
2505
2505
|
confirm: xe,
|
|
2506
2506
|
"onUpdate:show": (Ae) => {
|
|
2507
|
-
Ae || (l.value = "", F.value = !1, s.value = !0, le++,
|
|
2507
|
+
Ae || (l.value = "", F.value = !1, s.value = !0, le++, b.close()), Ne("cancelled");
|
|
2508
2508
|
}
|
|
2509
2509
|
}
|
|
2510
2510
|
});
|
|
@@ -2542,9 +2542,9 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2542
2542
|
const t = o.purchaseOrder;
|
|
2543
2543
|
if (!t) return { status: "", statusClass: "" };
|
|
2544
2544
|
const { partial: p, over: A } = ot(De.value), R = nt(t.status, p, A);
|
|
2545
|
-
let
|
|
2546
|
-
return R === ee.enum.CLOSE && (
|
|
2547
|
-
status:
|
|
2545
|
+
let G = d(`inventory.transfer.status.${R}`), W = `${t.status}`.toLocaleLowerCase("en-us");
|
|
2546
|
+
return R === ee.enum.CLOSE && (G = `${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: G,
|
|
2548
2548
|
statusClass: `fm-status-badge fm-status-badge-${W}`
|
|
2549
2549
|
};
|
|
2550
2550
|
}), q = Y(() => {
|
|
@@ -2583,12 +2583,12 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2583
2583
|
return {
|
|
2584
2584
|
header: "Received",
|
|
2585
2585
|
deliveryOrder: m,
|
|
2586
|
-
date:
|
|
2586
|
+
date: Ke(new Date(m.createdAt)),
|
|
2587
2587
|
info: [
|
|
2588
2588
|
{
|
|
2589
2589
|
label: "Adjustment date",
|
|
2590
2590
|
values: [
|
|
2591
|
-
m.adjustment ?
|
|
2591
|
+
m.adjustment ? Ke(new Date(We(m.adjustment))) : "-"
|
|
2592
2592
|
]
|
|
2593
2593
|
},
|
|
2594
2594
|
{
|
|
@@ -2599,27 +2599,27 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2599
2599
|
label: "Received items",
|
|
2600
2600
|
values: m.received.map((ce) => {
|
|
2601
2601
|
var me;
|
|
2602
|
-
return
|
|
2603
|
-
|
|
2602
|
+
return V("div", [
|
|
2603
|
+
V(
|
|
2604
2604
|
"div",
|
|
2605
2605
|
{
|
|
2606
2606
|
class: "flex gap-4"
|
|
2607
2607
|
},
|
|
2608
2608
|
[
|
|
2609
|
-
|
|
2609
|
+
V(
|
|
2610
2610
|
"div",
|
|
2611
2611
|
{
|
|
2612
2612
|
class: "flex flex-col"
|
|
2613
2613
|
},
|
|
2614
2614
|
[
|
|
2615
|
-
|
|
2615
|
+
V(
|
|
2616
2616
|
"span",
|
|
2617
2617
|
{
|
|
2618
2618
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
2619
2619
|
},
|
|
2620
2620
|
`${ce.sku.name}`
|
|
2621
2621
|
),
|
|
2622
|
-
|
|
2622
|
+
V(
|
|
2623
2623
|
"span",
|
|
2624
2624
|
{
|
|
2625
2625
|
class: "fm-typo-en-body-md-400"
|
|
@@ -2628,26 +2628,26 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2628
2628
|
)
|
|
2629
2629
|
]
|
|
2630
2630
|
),
|
|
2631
|
-
|
|
2631
|
+
V(
|
|
2632
2632
|
"div",
|
|
2633
2633
|
{
|
|
2634
2634
|
class: "ml-auto flex flex-col"
|
|
2635
2635
|
},
|
|
2636
2636
|
[
|
|
2637
|
-
|
|
2637
|
+
V(
|
|
2638
2638
|
"div",
|
|
2639
2639
|
{
|
|
2640
2640
|
class: "ml-auto flex gap-1"
|
|
2641
2641
|
},
|
|
2642
2642
|
[
|
|
2643
|
-
|
|
2643
|
+
V(
|
|
2644
2644
|
"span",
|
|
2645
2645
|
{
|
|
2646
2646
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
2647
2647
|
},
|
|
2648
|
-
|
|
2648
|
+
be(ce.amount, !1)
|
|
2649
2649
|
),
|
|
2650
|
-
|
|
2650
|
+
V(
|
|
2651
2651
|
"span",
|
|
2652
2652
|
{
|
|
2653
2653
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
@@ -2656,7 +2656,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2656
2656
|
)
|
|
2657
2657
|
]
|
|
2658
2658
|
),
|
|
2659
|
-
|
|
2659
|
+
V(
|
|
2660
2660
|
"div",
|
|
2661
2661
|
{
|
|
2662
2662
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
@@ -2686,12 +2686,12 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2686
2686
|
].filter((ce) => !!ce)
|
|
2687
2687
|
};
|
|
2688
2688
|
}
|
|
2689
|
-
function
|
|
2689
|
+
function G(m) {
|
|
2690
2690
|
var le, oe;
|
|
2691
2691
|
const z = p.findIndex((L) => L.id === m.id);
|
|
2692
2692
|
return {
|
|
2693
2693
|
header: "Fulfillment",
|
|
2694
|
-
date:
|
|
2694
|
+
date: Ke(new Date(m.createdAt)),
|
|
2695
2695
|
info: [
|
|
2696
2696
|
{
|
|
2697
2697
|
label: "Sequence",
|
|
@@ -2701,27 +2701,27 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2701
2701
|
label: "Receiveable items",
|
|
2702
2702
|
values: m.items.map((L) => {
|
|
2703
2703
|
var ne;
|
|
2704
|
-
return
|
|
2705
|
-
|
|
2704
|
+
return V("div", [
|
|
2705
|
+
V(
|
|
2706
2706
|
"div",
|
|
2707
2707
|
{
|
|
2708
2708
|
class: "flex gap-4"
|
|
2709
2709
|
},
|
|
2710
2710
|
[
|
|
2711
|
-
|
|
2711
|
+
V(
|
|
2712
2712
|
"div",
|
|
2713
2713
|
{
|
|
2714
2714
|
class: "flex flex-col"
|
|
2715
2715
|
},
|
|
2716
2716
|
[
|
|
2717
|
-
|
|
2717
|
+
V(
|
|
2718
2718
|
"span",
|
|
2719
2719
|
{
|
|
2720
2720
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
2721
2721
|
},
|
|
2722
2722
|
`${L.sku.name}`
|
|
2723
2723
|
),
|
|
2724
|
-
|
|
2724
|
+
V(
|
|
2725
2725
|
"span",
|
|
2726
2726
|
{
|
|
2727
2727
|
class: "fm-typo-en-body-md-400"
|
|
@@ -2730,26 +2730,26 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2730
2730
|
)
|
|
2731
2731
|
]
|
|
2732
2732
|
),
|
|
2733
|
-
|
|
2733
|
+
V(
|
|
2734
2734
|
"div",
|
|
2735
2735
|
{
|
|
2736
2736
|
class: "ml-auto flex flex-col"
|
|
2737
2737
|
},
|
|
2738
2738
|
[
|
|
2739
|
-
|
|
2739
|
+
V(
|
|
2740
2740
|
"div",
|
|
2741
2741
|
{
|
|
2742
2742
|
class: "ml-auto flex gap-1"
|
|
2743
2743
|
},
|
|
2744
2744
|
[
|
|
2745
|
-
|
|
2745
|
+
V(
|
|
2746
2746
|
"span",
|
|
2747
2747
|
{
|
|
2748
2748
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
2749
2749
|
},
|
|
2750
|
-
|
|
2750
|
+
be(L.amount, !1)
|
|
2751
2751
|
),
|
|
2752
|
-
|
|
2752
|
+
V(
|
|
2753
2753
|
"span",
|
|
2754
2754
|
{
|
|
2755
2755
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
@@ -2758,7 +2758,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2758
2758
|
)
|
|
2759
2759
|
]
|
|
2760
2760
|
),
|
|
2761
|
-
|
|
2761
|
+
V(
|
|
2762
2762
|
"div",
|
|
2763
2763
|
{
|
|
2764
2764
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
@@ -2784,47 +2784,47 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2784
2784
|
case "grn":
|
|
2785
2785
|
return R(m.doc);
|
|
2786
2786
|
case "fulfillment":
|
|
2787
|
-
return
|
|
2787
|
+
return G(m.doc);
|
|
2788
2788
|
}
|
|
2789
2789
|
});
|
|
2790
2790
|
}), U = Y(() => {
|
|
2791
2791
|
var p;
|
|
2792
2792
|
const t = {
|
|
2793
|
-
...
|
|
2793
|
+
...ht(0),
|
|
2794
2794
|
currency: $e()
|
|
2795
2795
|
};
|
|
2796
2796
|
return ((p = o.purchaseOrder) == null ? void 0 : p.items.reduce((A, R) => ({
|
|
2797
|
-
...
|
|
2797
|
+
...bt(A, R.totalCost ?? t),
|
|
2798
2798
|
currency: $e()
|
|
2799
2799
|
}), t)) ?? t;
|
|
2800
2800
|
});
|
|
2801
2801
|
function ae(t) {
|
|
2802
2802
|
var W;
|
|
2803
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">${
|
|
2804
|
+
return `<span class="${D(t)} fm-typo-en-body-lg-600">${Pe.toFormatString({ value: R.received })}</span>/${Vt(t.quantity, t.sku.unit, t.measurement)}`;
|
|
2805
2805
|
}
|
|
2806
2806
|
function D(t) {
|
|
2807
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:
|
|
2809
|
-
return W ? "text-fm-color-typo-tertiary" :
|
|
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: G, isNoReceive: W, isOverReceive: te, isFullReceive: m } = Qt(R);
|
|
2809
|
+
return W ? "text-fm-color-typo-tertiary" : G ? "text-fm-color-system-warning-300" : te ? "text-fm-color-system-error-300" : m ? "text-fm-color-system-success-300" : "";
|
|
2810
2810
|
}
|
|
2811
2811
|
const x = Y(() => {
|
|
2812
2812
|
var t, p, A;
|
|
2813
|
-
return (t = o.purchaseOrder) != null && t.itemsAtSubmission ? ((p = o.purchaseOrder) == null ? void 0 : p.version) === Te.enum[2] ? o.purchaseOrder.items.reduce((R,
|
|
2813
|
+
return (t = o.purchaseOrder) != null && t.itemsAtSubmission ? ((p = o.purchaseOrder) == null ? void 0 : p.version) === Te.enum[2] ? o.purchaseOrder.items.reduce((R, G) => {
|
|
2814
2814
|
var te, m;
|
|
2815
2815
|
const W = (m = (te = o.purchaseOrder) == null ? void 0 : te.itemsAtSubmission) == null ? void 0 : m.find(
|
|
2816
|
-
(z) => z.id ===
|
|
2816
|
+
(z) => z.id === G.id
|
|
2817
2817
|
);
|
|
2818
|
-
return W && W.quantity !==
|
|
2819
|
-
originalAmount: Number(
|
|
2820
|
-
newAmount: Number(
|
|
2818
|
+
return W && W.quantity !== G.quantity && R.set(G.sku.code, {
|
|
2819
|
+
originalAmount: Number(Pe.toFormatString({ value: W.quantity })),
|
|
2820
|
+
newAmount: Number(Pe.toFormatString({ value: G.quantity }))
|
|
2821
2821
|
}), R;
|
|
2822
|
-
}, /* @__PURE__ */ new Map()) : (A = o.purchaseOrder) == null ? void 0 : A.items.reduce((R,
|
|
2822
|
+
}, /* @__PURE__ */ new Map()) : (A = o.purchaseOrder) == null ? void 0 : A.items.reduce((R, G) => {
|
|
2823
2823
|
var z, le;
|
|
2824
2824
|
const W = (le = (z = o.purchaseOrder) == null ? void 0 : z.itemsAtSubmission) == null ? void 0 : le.find(
|
|
2825
|
-
(oe) => oe.sku._id ===
|
|
2826
|
-
), te = W ? Number(
|
|
2827
|
-
return W && te !== m && R.set(
|
|
2825
|
+
(oe) => oe.sku._id === G.sku._id
|
|
2826
|
+
), te = W ? Number(Pe.toFormatString({ value: W.quantity })) : 0, m = Number(Pe.toFormatString({ value: G.quantity }));
|
|
2827
|
+
return W && te !== m && R.set(G.sku.code, {
|
|
2828
2828
|
originalAmount: te,
|
|
2829
2829
|
newAmount: m
|
|
2830
2830
|
}), R;
|
|
@@ -2839,7 +2839,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2839
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);
|
|
2840
2840
|
};
|
|
2841
2841
|
return (t, p) => {
|
|
2842
|
-
const A = K("FmButton"), R = K("FmButtonGroup"),
|
|
2842
|
+
const A = K("FmButton"), R = K("FmButtonGroup"), G = K("FmChip"), W = K("FmIcon"), te = K("FmMenuDivider"), m = K("FmCard"), z = K("FmTooltip"), le = K("FmSpacer"), oe = K("FmSideSheet");
|
|
2843
2843
|
return i(), re(oe, {
|
|
2844
2844
|
modelValue: v(B),
|
|
2845
2845
|
"onUpdate:modelValue": p[8] || (p[8] = (L) => Rt(B) ? B.value = L : null),
|
|
@@ -2862,10 +2862,10 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2862
2862
|
]),
|
|
2863
2863
|
N(R, {
|
|
2864
2864
|
items: C.value,
|
|
2865
|
-
modelValue:
|
|
2866
|
-
"onUpdate:modelValue": p[1] || (p[1] = (xe) =>
|
|
2865
|
+
modelValue: H.value,
|
|
2866
|
+
"onUpdate:modelValue": p[1] || (p[1] = (xe) => H.value = xe)
|
|
2867
2867
|
}, null, 8, ["items", "modelValue"]),
|
|
2868
|
-
t.purchaseOrder &&
|
|
2868
|
+
t.purchaseOrder && H.value.value === "deliveryHistory" ? (i(), re(Br, {
|
|
2869
2869
|
key: 0,
|
|
2870
2870
|
"purchase-order": t.purchaseOrder,
|
|
2871
2871
|
"received-info-map": De.value,
|
|
@@ -2880,7 +2880,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2880
2880
|
var L, ne, xe, Ne, Ae;
|
|
2881
2881
|
return [
|
|
2882
2882
|
e("div", io, [
|
|
2883
|
-
|
|
2883
|
+
H.value.value === "overview" ? (i(), g(ue, { key: 0 }, [
|
|
2884
2884
|
e("div", null, [
|
|
2885
2885
|
N(m, {
|
|
2886
2886
|
variant: "outlined",
|
|
@@ -2892,16 +2892,16 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2892
2892
|
e("div", co, [
|
|
2893
2893
|
e("div", uo, y(v(d)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
2894
2894
|
e("div", mo, [
|
|
2895
|
-
N(
|
|
2895
|
+
N(Ie, null, {
|
|
2896
2896
|
default: X(() => {
|
|
2897
|
-
var
|
|
2897
|
+
var Ee;
|
|
2898
2898
|
return [
|
|
2899
|
-
Re(y((
|
|
2899
|
+
Re(y((Ee = o.purchaseOrder) == null ? void 0 : Ee.status), 1)
|
|
2900
2900
|
];
|
|
2901
2901
|
}),
|
|
2902
2902
|
_: 1
|
|
2903
2903
|
}),
|
|
2904
|
-
N(
|
|
2904
|
+
N(G, {
|
|
2905
2905
|
label: qe.value.status,
|
|
2906
2906
|
class: Le(qe.value.statusClass),
|
|
2907
2907
|
compact: ""
|
|
@@ -2918,10 +2918,10 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2918
2918
|
N(te),
|
|
2919
2919
|
e("div", yo, [
|
|
2920
2920
|
e("div", vo, [
|
|
2921
|
-
e("div",
|
|
2922
|
-
e("div",
|
|
2921
|
+
e("div", bo, [
|
|
2922
|
+
e("div", ho, y(v(d)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
2923
2923
|
]),
|
|
2924
|
-
e("div", go, y(v(
|
|
2924
|
+
e("div", go, y(v(Ge)(((Z = t.purchaseOrder) == null ? void 0 : Z._id) ?? "")), 1)
|
|
2925
2925
|
]),
|
|
2926
2926
|
(ie = t.purchaseOrder) != null && ie.effectiveAt ? (i(), g("div", _o, [
|
|
2927
2927
|
e("div", So, y(v(d)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
@@ -2930,7 +2930,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2930
2930
|
e("div", Oo, [
|
|
2931
2931
|
e("div", wo, y(v(d)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
2932
2932
|
e("div", $o, y(v(d)(
|
|
2933
|
-
`inventory.transfer.receiveRequest.details.type.${
|
|
2933
|
+
`inventory.transfer.receiveRequest.details.type.${P.value.toLocaleLowerCase("en-US")}`
|
|
2934
2934
|
)), 1)
|
|
2935
2935
|
]),
|
|
2936
2936
|
(ge = (ve = t.purchaseOrder) == null ? void 0 : ve.supplier) != null && ge.name ? (i(), g("div", Co, [
|
|
@@ -2943,11 +2943,11 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2943
2943
|
])) : M("", !0),
|
|
2944
2944
|
(me = t.purchaseOrder) != null && me.ref ? (i(), g("div", Fo, [
|
|
2945
2945
|
e("div", To, y(v(d)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
2946
|
-
e("div",
|
|
2946
|
+
e("div", Po, y(t.purchaseOrder.ref), 1)
|
|
2947
2947
|
])) : M("", !0),
|
|
2948
|
-
(Fe = t.purchaseOrder) != null && Fe.remark ? (i(), g("div",
|
|
2948
|
+
(Fe = t.purchaseOrder) != null && Fe.remark ? (i(), g("div", Io, [
|
|
2949
2949
|
e("div", qo, y(v(d)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
2950
|
-
e("div",
|
|
2950
|
+
e("div", Eo, y(t.purchaseOrder.remark), 1)
|
|
2951
2951
|
])) : M("", !0)
|
|
2952
2952
|
])
|
|
2953
2953
|
];
|
|
@@ -2958,11 +2958,11 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
2958
2958
|
N(Xs, {
|
|
2959
2959
|
"po-request": t.poRequest,
|
|
2960
2960
|
purchaseOrder: t.purchaseOrder,
|
|
2961
|
-
transferType:
|
|
2961
|
+
transferType: P.value,
|
|
2962
2962
|
transferToDbName: t.transferToDbName,
|
|
2963
2963
|
scope: t.scope
|
|
2964
2964
|
}, null, 8, ["po-request", "purchaseOrder", "transferType", "transferToDbName", "scope"]),
|
|
2965
|
-
e("div",
|
|
2965
|
+
e("div", Vo, [
|
|
2966
2966
|
e("div", Lo, [
|
|
2967
2967
|
e("div", Mo, [
|
|
2968
2968
|
e("span", Uo, [
|
|
@@ -3037,10 +3037,10 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
3037
3037
|
_: 2
|
|
3038
3038
|
}, 1024)) : M("", !0)
|
|
3039
3039
|
]),
|
|
3040
|
-
e("div",
|
|
3040
|
+
e("div", Ho, [
|
|
3041
3041
|
e("span", {
|
|
3042
3042
|
innerHTML: ae(Z)
|
|
3043
|
-
}, null, 8,
|
|
3043
|
+
}, null, 8, Go)
|
|
3044
3044
|
])
|
|
3045
3045
|
]),
|
|
3046
3046
|
e("div", Wo, [
|
|
@@ -3049,7 +3049,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
3049
3049
|
])
|
|
3050
3050
|
]);
|
|
3051
3051
|
}), 128)),
|
|
3052
|
-
+v(
|
|
3052
|
+
+v(be)(U.value) ? (i(), g(ue, { key: 0 }, [
|
|
3053
3053
|
e("div", Jo, [
|
|
3054
3054
|
N(te)
|
|
3055
3055
|
]),
|
|
@@ -3060,7 +3060,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
3060
3060
|
], 64)) : M("", !0)
|
|
3061
3061
|
])
|
|
3062
3062
|
])
|
|
3063
|
-
], 64)) :
|
|
3063
|
+
], 64)) : H.value.value === "deliveryHistory" ? (i(), g("div", en, [
|
|
3064
3064
|
q.value.length ? (i(), g("div", nn, [
|
|
3065
3065
|
(i(!0), g(ue, null, Se(q.value, (Z, ie) => {
|
|
3066
3066
|
var de, ve, ge, Ce, ce;
|
|
@@ -3104,7 +3104,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
3104
3104
|
e("div", yn, y(Z.date), 1)
|
|
3105
3105
|
]),
|
|
3106
3106
|
e("div", vn, [
|
|
3107
|
-
Z.header === "Received" && Z.deliveryOrder && t.purchaseOrder ? (i(), re(
|
|
3107
|
+
Z.header === "Received" && Z.deliveryOrder && t.purchaseOrder ? (i(), re(br, {
|
|
3108
3108
|
key: 0,
|
|
3109
3109
|
deliveryOrder: Z.deliveryOrder,
|
|
3110
3110
|
purchaseOrder: t.purchaseOrder,
|
|
@@ -3112,7 +3112,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
3112
3112
|
f("update:show", !1), f("submitted");
|
|
3113
3113
|
})
|
|
3114
3114
|
}, null, 8, ["deliveryOrder", "purchaseOrder"])) : M("", !0),
|
|
3115
|
-
(ve = (de = Z.deliveryOrder) == null ? void 0 : de.netSuite) != null && ve.id ? (i(), re(
|
|
3115
|
+
(ve = (de = Z.deliveryOrder) == null ? void 0 : de.netSuite) != null && ve.id ? (i(), re(Ie, { key: 1 }, {
|
|
3116
3116
|
default: X(() => {
|
|
3117
3117
|
var me, Fe;
|
|
3118
3118
|
return [
|
|
@@ -3131,8 +3131,8 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
3131
3131
|
])
|
|
3132
3132
|
])
|
|
3133
3133
|
]),
|
|
3134
|
-
e("div",
|
|
3135
|
-
e("div",
|
|
3134
|
+
e("div", bn, [
|
|
3135
|
+
e("div", hn, [
|
|
3136
3136
|
e("div", gn, [
|
|
3137
3137
|
e("div", {
|
|
3138
3138
|
class: Le([
|
|
@@ -3158,13 +3158,13 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
3158
3158
|
}, [
|
|
3159
3159
|
e("div", xn, y(me == null ? void 0 : me.label), 1),
|
|
3160
3160
|
e("div", On, [
|
|
3161
|
-
(i(!0), g(ue, null, Se(me == null ? void 0 : me.values, (
|
|
3161
|
+
(i(!0), g(ue, null, Se(me == null ? void 0 : me.values, (Ee, Ot) => (i(), g("div", {
|
|
3162
3162
|
key: Ot,
|
|
3163
3163
|
class: "fm-typo-en-body-lg-600"
|
|
3164
3164
|
}, [
|
|
3165
|
-
typeof
|
|
3166
|
-
Re(y(
|
|
3167
|
-
], 64)) : (i(), re(kt(
|
|
3165
|
+
typeof Ee == "string" ? (i(), g(ue, { key: 0 }, [
|
|
3166
|
+
Re(y(Ee), 1)
|
|
3167
|
+
], 64)) : (i(), re(kt(Ee), { key: 1 }))
|
|
3168
3168
|
]))), 128))
|
|
3169
3169
|
])
|
|
3170
3170
|
]))), 128))
|
|
@@ -3180,7 +3180,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
3180
3180
|
N(le),
|
|
3181
3181
|
e("div", null, [
|
|
3182
3182
|
e("img", {
|
|
3183
|
-
src: v(
|
|
3183
|
+
src: v(Lt),
|
|
3184
3184
|
alt: "List is empty"
|
|
3185
3185
|
}, null, 8, sn)
|
|
3186
3186
|
]),
|
|
@@ -3195,7 +3195,7 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
3195
3195
|
}),
|
|
3196
3196
|
"side-sheet-footer": X(() => [
|
|
3197
3197
|
e("div", wn, [
|
|
3198
|
-
(i(!0), g(ue, null, Se(
|
|
3198
|
+
(i(!0), g(ue, null, Se(I.value, (L) => (i(), g(ue, null, [
|
|
3199
3199
|
v(rt)[L].available != !1 ? (i(), re(A, {
|
|
3200
3200
|
key: L,
|
|
3201
3201
|
label: v(d)(v(rt)[L].translationKey),
|
|
@@ -3205,14 +3205,14 @@ const rs = { class: "flex flex-row-reverse" }, os = /* @__PURE__ */ we({
|
|
|
3205
3205
|
variant: v(rt)[L].buttonVariant
|
|
3206
3206
|
}, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : M("", !0)
|
|
3207
3207
|
], 64))), 256)),
|
|
3208
|
-
v(w).ableToMarkReceived(t.purchaseOrder) && !
|
|
3208
|
+
v(w).ableToMarkReceived(t.purchaseOrder) && !I.value.includes("completeReceive") ? (i(), re(A, {
|
|
3209
3209
|
key: 0,
|
|
3210
3210
|
label: v(d)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
3211
3211
|
onClick: p[4] || (p[4] = (L) => fe("completeReceive")),
|
|
3212
3212
|
loading: l.value === "completeReceive",
|
|
3213
3213
|
disabled: l.value !== "completeReceive" && F.value
|
|
3214
3214
|
}, null, 8, ["label", "loading", "disabled"])) : M("", !0),
|
|
3215
|
-
v(w).ableToMarkApproved(t.purchaseOrder) && t.canApprove && !
|
|
3215
|
+
v(w).ableToMarkApproved(t.purchaseOrder) && t.canApprove && !I.value.includes("approveRequest") ? (i(), re(A, {
|
|
3216
3216
|
key: 1,
|
|
3217
3217
|
label: v(d)("inventory.transfer.approval.actions.approveRequest"),
|
|
3218
3218
|
onClick: p[5] || (p[5] = (L) => fe("approveRequest")),
|